/* =========================================================
   IMPOSTR — Professional Stylesheet v4  (GitHub-dark inspired)
   Charcoal-grey surfaces · subtle borders · restrained blue accents
   (Visual layer only — all class names & JS hooks preserved)
   ========================================================= */

:root {
  /* Surfaces */
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2128;
  --surface-3: #21262d;
  --canvas-inset: #010409;

  /* Borders */
  --border: #30363d;
  --border-strong: #444c56;
  --border-muted: #21262d;

  /* Text */
  --text: #e6edf3;
  --text-dim: #7d8590;
  --text-faint: #6e7681;

  /* Accents */
  --accent: #58a6ff;
  --accent-strong: #388bfd;
  --accent-soft: #79c0ff;
  --red: #f85149;
  --amber: #d29922;
  --green: #3fb950;

  /* Legacy var aliases (kept so existing rules resolve to the new palette) */
  --navy: var(--bg);
  --navy-2: var(--surface);
  --navy-3: var(--surface-3);
  --violet: var(--accent);
  --violet-deep: var(--accent-strong);
  --cyan: var(--accent-soft);
  --glass-bg: var(--surface);
  --glass-bg-strong: var(--surface-2);
  --glass-bg-soft: var(--surface);
  --glass-border: var(--border);
  --glass-border-strong: var(--border-strong);
  --text-primary: var(--text);

  --shadow-soft: 0 1px 3px rgba(1, 4, 9, 0.5);
  --shadow-lift: 0 8px 24px rgba(1, 4, 9, 0.6);
  --glow-violet: 0 0 0 1px rgba(88, 166, 255, 0.35);
  --glow-cyan: 0 0 0 1px rgba(88, 166, 255, 0.3);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Global base ────────────────────────────────────────── */
html,
body {
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(88, 166, 255, 0.3);
  color: #fff;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}

/* Panels */
.paper-texture,
.folder-texture {
  background: var(--surface);
  background-image: none;
  border-color: var(--border) !important;
}

.stamped-effect {
  -webkit-mask-image: none;
  mask-image: none;
}

/* ============================================================
   BACKGROUND  (flat GitHub canvas, extremely subtle grid)
   ============================================================ */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
}

.mesh-blob {
  display: none;
}

.mesh-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 40%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 40%, transparent 90%);
}

/* ============================================================
   TOP NAVIGATION BAR  (fixed, full-width app bar — GitHub style)
   ============================================================ */
.topnav-glass {
  position: sticky;
  top: 0;
  margin: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 60px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

.sidebar-logo {
  padding-right: 16px;
  margin-right: 8px;
  border-right: 1px solid var(--border);
}

.sidebar-icon-shield {
  width: 34px;
  height: 34px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-icon-shield .material-symbols-outlined {
  color: var(--accent) !important;
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  height: 100%;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.topnav-links::-webkit-scrollbar { display: none; }

/* Guard: switchTab() re-adds `w-full ... px-4 py-3` sidebar utilities on click.
   Keep top-nav items compact & auto-width so the horizontal bar never breaks. */
.topnav-links .sidebar-nav-active,
.topnav-links .sidebar-nav-inactive {
  width: auto !important;
  padding: 8px 12px !important;
}

/* Nav items → GitHub-style underline tabs */
.sidebar-nav-active,
.sidebar-nav-inactive {
  position: relative;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}

.sidebar-nav-inactive {
  color: var(--text-dim);
  background: transparent;
}

.sidebar-nav-inactive:hover {
  color: var(--text);
  background: rgba(177, 186, 196, 0.08);
}

.sidebar-nav-active {
  color: var(--text);
  background: rgba(177, 186, 196, 0.08);
  font-weight: 600;
}

.sidebar-nav-active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -11px;
  height: 2px;
  background: #f78166;
  border-radius: 2px;
}

.sidebar-nav-active .material-symbols-outlined {
  color: var(--accent);
}

.sidebar-nav-inactive .material-symbols-outlined {
  color: var(--text-dim);
}

.topnav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-left: 14px;
  margin-left: 4px;
  border-left: 1px solid var(--border);
}

.topnav-session {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-dim);
}

/* Primary button — GitHub green "action" style */
.sidebar-new-case-btn {
  background: #238636;
  color: #fff;
  border: 1px solid rgba(240, 246, 252, 0.1);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s ease, transform 0.1s ease;
}

.sidebar-new-case-btn:hover {
  background: #2ea043;
}

.sidebar-new-case-btn:active {
  background: #238636;
  transform: translateY(1px);
}

/* Live status dot */
@keyframes status-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.5); }
  50% { opacity: 0.8; box-shadow: 0 0 0 5px rgba(63, 185, 80, 0); }
}

.status-dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  animation: status-pulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

/* ============================================================
   SUB HEADER BAR
   ============================================================ */
.main-header {
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  margin-top: 0;
}

.header-accent-bar {
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 3px;
  flex-shrink: 0;
}

.header-clock {
  background: var(--surface-3);
  color: var(--green);
  padding: 4px 12px;
  font-size: 11px;
  letter-spacing: 0.08em;
  border-radius: 6px;
  border: 1px solid var(--border);
}

#view-title {
  position: relative;
  color: var(--text);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   HERO SCAN INPUT
   ============================================================ */
.hero-scan-section {
  padding-bottom: 8px;
}

.hero-title {
  font-family: 'Sora', -apple-system, sans-serif;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--text);
  font-weight: 700;
  position: relative;
  display: inline-block;
}

.hero-input-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hero-input-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.25);
}

.hero-input-icon {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.hero-input-box:focus-within .hero-input-icon {
  color: var(--accent);
}

.hero-url-input {
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  padding-left: 16px;
}

.hero-url-input:focus {
  outline: none;
}

.hero-input-actions {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  padding-top: 8px;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.hero-secondary-btn {
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.hero-secondary-btn:hover {
  background: #30363d;
  border-color: var(--border-strong);
}

.hero-scan-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #238636;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 20px;
  border: 1px solid rgba(240, 246, 252, 0.1);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.hero-scan-btn:hover {
  background: #2ea043;
}

.hero-scan-btn:active {
  transform: translateY(1px);
}

/* Feed badges */
.feed-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.feed-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.feed-urlhaus { background: rgba(248, 81, 73, 0.1); color: var(--red); border: 1px solid rgba(248, 81, 73, 0.3); }
.feed-phishtank { background: rgba(210, 153, 34, 0.1); color: var(--amber); border: 1px solid rgba(210, 153, 34, 0.3); }
.feed-openphish { background: rgba(88, 166, 255, 0.1); color: var(--accent); border: 1px solid rgba(88, 166, 255, 0.3); }
.feed-rdap { background: rgba(63, 185, 80, 0.1); color: var(--green); border: 1px solid rgba(63, 185, 80, 0.3); }
.feed-crt { background: rgba(121, 192, 255, 0.1); color: var(--accent-soft); border: 1px solid rgba(121, 192, 255, 0.3); }

.scan-input-wrapper {
  transition: box-shadow 0.2s ease;
}

@keyframes scan-sweep {
  0% { top: -4px; opacity: 0.2; }
  100% { top: 110%; opacity: 0; }
}

.scan-line-anim {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  pointer-events: none;
  z-index: 5;
  opacity: 0.4;
  animation: scan-sweep 4s ease-in-out infinite;
}

/* ============================================================
   KPI STAT CARDS
   ============================================================ */
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
  box-shadow: var(--shadow-soft);
}

.kpi-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.kpi-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0.9;
}

.kpi-bar-neutral { background: var(--accent); }
.kpi-bar-danger { background: var(--red); }
.kpi-bar-amber { background: var(--amber); }
.kpi-bar-green { background: var(--green); }

.kpi-icon-wrap {
  width: 38px;
  height: 38px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--accent);
}

.kpi-icon-danger { background: rgba(248, 81, 73, 0.1); color: var(--red); border-color: rgba(248, 81, 73, 0.25); }
.kpi-icon-amber { background: rgba(210, 153, 34, 0.1); color: var(--amber); border-color: rgba(210, 153, 34, 0.25); }
.kpi-icon-green { background: rgba(63, 185, 80, 0.1); color: var(--green); border-color: rgba(63, 185, 80, 0.25); }

.kpi-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.kpi-value {
  font-family: 'Sora', sans-serif;
  font-size: 44px;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
}

.kpi-value-danger { color: var(--red); }
.kpi-value-amber { color: var(--amber); }
.kpi-value-green { color: var(--green); }

.kpi-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 6px;
}

/* ============================================================
   BRIEFING HEADER
   ============================================================ */
.briefing-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.briefing-header h2 {
  position: relative;
  font-family: 'Sora', sans-serif;
  color: var(--text) !important;
}

/* ============================================================
   VERDICT TALLY CARD
   ============================================================ */
.tally-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.tally-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.tally-card-header h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  flex: 1;
}

.tally-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.06em;
}

.tally-bars-list {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tally-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tally-row-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
}

.tally-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tally-dot-red { background: var(--red); }
.tally-dot-amber { background: var(--amber); }
.tally-dot-green { background: var(--green); }

.tally-score-hint {
  margin-left: auto;
  font-size: 9px;
  color: var(--text-faint);
  font-weight: 400;
}

.tally-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

.tally-bar-track {
  width: 100%;
  height: 8px;
  background: var(--canvas-inset);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.tally-bar-fill {
  height: 100%;
  position: relative;
  border-radius: 999px;
  transition: width 0.8s var(--ease);
}

.tally-fill-red { background: var(--red); }
.tally-fill-amber { background: var(--amber); }
.tally-fill-green { background: var(--green); }

.tally-summary {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ============================================================
   INTAKE LOG CARD
   ============================================================ */
.intake-log-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  min-height: 400px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.intake-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.intake-log-header h3 {
  color: var(--text) !important;
}

.intake-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  flex: 1;
}

.intake-log-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
}

.intake-view-all-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  transition: color 0.15s ease;
}

.intake-view-all-btn:hover {
  color: var(--accent-soft);
  text-decoration: underline;
}

#intake-log-list > div:not(.intake-empty-state) {
  transition: background 0.15s ease;
  padding: 12px 18px;
  cursor: pointer;
}

#intake-log-list > div:not(.intake-empty-state):hover {
  background: rgba(177, 186, 196, 0.06);
}

/* ============================================================
   FOLDER / CASE REPORT
   ============================================================ */
.folder-report {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px;
  box-shadow: var(--shadow-lift) !important;
}

.folder-report .paper-texture {
  border-radius: 8px;
}

#exhibit-frame {
  background: var(--surface-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px;
  transition: transform 0.3s var(--ease), border-color 0.2s ease;
}

#exhibit-frame:hover {
  transform: rotate(0deg) scale(1.01) !important;
  border-color: var(--border-strong);
}

#exhibit-frame .bg-background {
  background: var(--canvas-inset) !important;
  border-radius: 6px;
}

@keyframes evidence-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.evidence-item {
  animation: evidence-in 0.24s ease forwards;
}

.tape-corner {
  background: rgba(177, 186, 196, 0.12);
  width: 40px;
  height: 20px;
  position: absolute;
  z-index: 10;
  border-radius: 3px;
}

.tape-effect {
  background: rgba(177, 186, 196, 0.12);
  width: 60px;
  height: 20px;
  transform: rotate(-3deg);
  position: absolute;
  top: -10px;
  left: 50%;
  margin-left: -30px;
  border-radius: 3px;
}

.pin-tag {
  position: relative;
  border-left: 3px solid var(--accent);
}

.pin-hole::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

/* Verdict stamp */
@keyframes stamp-thud {
  0% { transform: scale(2.4) rotate(-12deg); opacity: 0; }
  60% { transform: scale(1) rotate(-6deg); opacity: 1; }
  100% { transform: scale(1) rotate(-6deg); }
}

.animate-stamp {
  animation: stamp-thud 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.verdict-stamp {
  font-family: 'Sora', sans-serif;
  text-transform: uppercase;
  border: 3px solid currentColor;
  border-radius: 8px;
  padding: 8px 16px;
  animation: stampEffect 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  opacity: 0;
}

@keyframes stampEffect {
  0% { transform: scale(1.6) rotate(16deg); opacity: 0; }
  100% { transform: scale(1) rotate(-10deg); opacity: 0.92; }
}

#verdict-stamp-container:not(.opacity-0) {
  /* static — professional, no shimmer loop */
}

/* Folder side tab */
.vertical-rl { writing-mode: vertical-rl; }
.folder-tab { clip-path: polygon(0% 0%, 85% 0%, 100% 100%, 0% 100%); }

#folder-tab-id {
  background: var(--surface-3) !important;
  border: 1px solid var(--border) !important;
  border-radius: 0 8px 8px 0;
  color: var(--text-dim);
}

/* SVG connection nodes */
.node-line {
  stroke: var(--accent);
  stroke-dasharray: 4 4;
  stroke-width: 2;
  fill: none;
}

.hand-arrow { fill: var(--accent); }

.paper-stack {
  box-shadow: 0 1px 3px rgba(1, 4, 9, 0.5), 0 6px 18px rgba(1, 4, 9, 0.4);
}

.trail-dot::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background-image: linear-gradient(to right, var(--border-strong) 50%, transparent 50%);
  background-size: 8px 1px;
  z-index: -1;
}

.corkboard {
  background-color: var(--surface);
  background-image: radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.06) 1px, transparent 0);
  background-size: 8px 8px;
}

.ruled-line {
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 100% 2.5rem;
}

/* ============================================================
   LOG TERMINAL
   ============================================================ */
#log-terminal-container {
  position: relative;
  overflow: hidden;
  background: var(--canvas-inset) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px;
  box-shadow: var(--shadow-soft) !important;
  color: var(--green) !important;
}

#log-terminal-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0, 0, 0, 0.12) 3px, rgba(0, 0, 0, 0.12) 4px);
  pointer-events: none;
  z-index: 10;
  border-radius: 8px;
}

#log-terminal-container::after {
  content: none;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.terminal-cursor::after {
  content: '█';
  animation: cursor-blink 1s step-end infinite;
  color: var(--green);
  font-size: 0.85em;
  margin-left: 3px;
}

@keyframes log-line-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.log-line { animation: log-line-in 0.2s ease forwards; }

#log-terminal span {
  text-shadow: none;
}

.terminal-rolling-scan {
  display: none;
}

/* ============================================================
   SECTION FADE TRANSITIONS
   ============================================================ */
@keyframes section-fade-in {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

#view-section-dashboard:not(.hidden),
#view-section-archive:not(.hidden),
#view-section-registry:not(.hidden),
#view-section-logs:not(.hidden),
#view-section-settings:not(.hidden) {
  animation: section-fade-in 0.24s ease forwards;
}

/* ============================================================
   MISC ENHANCEMENTS
   ============================================================ */
#case-toolbar button {
  transition: background 0.15s ease, border-color 0.15s ease;
}

#case-toolbar button:hover {
  border-color: var(--border-strong);
  background: var(--surface-3);
}

#scan-btn {
  transition: background 0.15s ease;
}

#archive-grid > div {
  transition: border-color 0.15s ease, transform 0.15s ease;
}

#archive-grid > div:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

/* Dymo corner label → subtle chip */
.dymo-chip {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-soft);
}

#dymo-label > div {
  transform: none !important;
}

#dymo-label:hover > div {
  border-color: var(--border-strong) !important;
}

.redacted-box {
  border-radius: 8px;
  background: var(--surface-2);
  opacity: 0.6;
}

@keyframes threat-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(248, 81, 73, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(248, 81, 73, 0); }
}

#threat-feeds-banner {
  border-radius: 8px;
  animation: threat-pulse 1.8s ease-in-out infinite !important;
}

#settings-save-btn {
  transition: background 0.15s ease;
}

#settings-save-btn:hover {
  background: var(--surface-3);
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 999px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #484f58; }

#log-terminal::-webkit-scrollbar { width: 6px; }
#log-terminal::-webkit-scrollbar-track { background: transparent; }
#log-terminal::-webkit-scrollbar-thumb { background: #30363d; }

/* ============================================================
   LOGO  (static, professional — no glitch)
   ============================================================ */
.glitch-logo {
  position: relative;
  color: var(--text) !important;
}

.glitch-logo::before,
.glitch-logo::after {
  content: none !important;
}

/* Header clock — steady */
.header-clock {
  animation: none;
}

/* Main canvas transparent so the flat bg shows */
.cyber-grid-canvas { background: transparent !important; }
main { background: transparent; }

/* Feed badge — no pulsing glow (professional) */
.feed-badge { animation: none; }

/* Scan button icon — no spin */
.hero-scan-btn .material-symbols-outlined {
  display: inline-block;
}

#archive-empty-state .material-symbols-outlined {
  color: var(--text-dim);
}

.intake-log-card::after { content: none; }

.mapper-node-svg { will-change: transform; }

/* ============================================================
   CARDS & HUD
   ============================================================ */
.cyber-glow-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.cyber-glow-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.score-gauge-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.score-gauge-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 0deg, var(--gauge-color, var(--accent)) var(--score-pct, 60%), var(--border) 0%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s var(--ease);
}

.score-gauge-inner {
  width: 100%;
  height: 100%;
  background: var(--surface);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.hud-badge-red {
  background: rgba(248, 81, 73, 0.1);
  color: var(--red);
  border: 1px solid rgba(248, 81, 73, 0.35);
  border-radius: 999px;
}

.hud-badge-amber {
  background: rgba(210, 153, 34, 0.1);
  color: var(--amber);
  border: 1px solid rgba(210, 153, 34, 0.35);
  border-radius: 999px;
}

.hud-badge-green {
  background: rgba(63, 185, 80, 0.1);
  color: var(--green);
  border: 1px solid rgba(63, 185, 80, 0.35);
  border-radius: 999px;
}

.laser-scan-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: laser-scan 2.2s ease-in-out infinite alternate;
  z-index: 30;
  opacity: 0.7;
}

@keyframes laser-scan {
  0% { top: 0%; }
  100% { top: 100%; }
}

@keyframes radar-pulse-glow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.radar-sweep-anim { animation: radar-pulse-glow 1.8s linear infinite; }

.glitch-text-hover:hover { color: var(--accent); }

.certified-watermark-halo {
  letter-spacing: 0.2em;
}

@keyframes ambient-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.float-ambient { animation: ambient-float 5s ease-in-out infinite; }

/* ============================================================
   FORENSIC REPORT ANIMATIONS (kept, calmed)
   ============================================================ */
@keyframes folder-unfold {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

.animate-folder-open {
  animation: folder-unfold 0.35s var(--ease) forwards;
  transform-origin: top center;
}

.dossier-confidential-watermark { position: relative; }

.dossier-confidential-watermark::before {
  content: 'CLASSIFIED // LEVEL 5 CLEARANCE';
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  font-family: 'Sora', sans-serif;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: rgba(230, 237, 243, 0.03);
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
}

.exhibit-polaroid-frame {
  background: var(--surface-2);
  padding: 12px 12px 36px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s ease;
  position: relative;
}

.exhibit-polaroid-frame:hover {
  border-color: var(--border-strong);
}

@keyframes typewriter-fade {
  0% { opacity: 0; transform: translateX(-4px); }
  100% { opacity: 1; transform: translateX(0); }
}

.typewriter-line { animation: typewriter-fade 0.25s var(--ease) forwards; }

.paperclip-accent {
  width: 14px;
  height: 38px;
  border: 2.5px solid var(--text-dim);
  border-radius: 8px;
  position: absolute;
  top: -12px;
  right: 28px;
  transform: rotate(12deg);
  pointer-events: none;
  z-index: 25;
}

.red-thumbtack-pin {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 5px rgba(1, 4, 9, 0.5);
  z-index: 25;
}

/* Nav hover — no glitch */
.sidebar-nav-inactive:hover { animation: none; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
   SCOPED READABILITY OVERRIDES for app.js-injected utility classes
   ════════════════════════════════════════════════════════════════════ */
#view-section-registry .text-gray-800,
#view-section-registry .text-gray-700,
#view-section-registry .text-gray-600 {
  color: var(--text) !important;
}

#view-section-registry .border-black {
  border-color: var(--border-strong) !important;
}

#view-section-registry .bg-gray-100 {
  background: var(--surface-3) !important;
  color: var(--text) !important;
}

#view-section-registry .border-gray-300,
#view-section-registry .border-gray-200 {
  border-color: var(--border) !important;
}

#view-section-registry .border-ink { border-color: var(--border-strong) !important; }

.score-spinner {
  border-color: var(--border) !important;
  border-top-color: var(--accent) !important;
}

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .topnav-glass {
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px;
  }

  .sidebar-logo {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
  }

  .topnav-links {
    order: 3;
    width: 100%;
    padding-bottom: 2px;
  }

  .sidebar-nav-active::after { display: none; }

  .topnav-right {
    margin-left: auto;
    border-left: none;
    padding-left: 0;
  }
}

@media (max-width: 767px) {
  #app-shell main .px-10 { padding-left: 16px !important; padding-right: 16px !important; }
  #app-shell main .py-8 { padding-top: 16px !important; padding-bottom: 16px !important; }
  .main-header { padding-left: 16px !important; padding-right: 16px !important; }

  .grid.grid-cols-12 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }
  .grid.grid-cols-12 > [class*="col-span-"] { grid-column: 1 / -1 !important; }

  .hero-title,
  .font-display-lg.text-\[56px\],
  .font-display-lg.text-\[52px\] {
    font-size: 30px !important;
    line-height: 1.1 !important;
  }

  .topnav-session { display: none; }

  .cyber-glow-card,
  .max-w-3xl { max-width: 100% !important; }
}
