/* ============ Auralis — design tokens ============ */
:root {
  /* Surfaces — warm neutral (slight copper undertone), oklch */
  --bg-0:        oklch(0.15 0.008 40);
  --bg-1:        oklch(0.18 0.009 40);
  --bg-2:        oklch(0.21 0.010 40);
  --bg-3:        oklch(0.25 0.012 40);
  --bg-elev:     oklch(0.20 0.010 40 / 0.72);

  --line-1:      oklch(1 0 0 / 0.06);
  --line-2:      oklch(1 0 0 / 0.10);
  --line-3:      oklch(1 0 0 / 0.16);

  --text-1:      oklch(0.98 0.005 60);
  --text-2:      oklch(0.78 0.010 50);
  --text-3:      oklch(0.58 0.012 50);
  --text-4:      oklch(0.40 0.012 50);

  /* Accents — warm, urgent, human */
  --danger:      oklch(0.66 0.20 25);     /* fire red */
  --danger-soft: oklch(0.66 0.20 25 / 0.14);
  --warn:        oklch(0.78 0.16 60);     /* amber */
  --warn-soft:   oklch(0.78 0.16 60 / 0.14);
  --safe:        oklch(0.74 0.13 155);
  --safe-soft:   oklch(0.74 0.13 155 / 0.14);
  --brand:       oklch(0.78 0.16 55);     /* copper / amber — replaces purple */
  --brand-2:     oklch(0.85 0.14 75);
  --brand-soft:  oklch(0.78 0.16 55 / 0.14);

  --radius-1: 8px;
  --radius-2: 12px;
  --radius-3: 16px;
  --radius-4: 22px;

  --shadow-1: 0 1px 0 0 oklch(1 0 0 / 0.04) inset, 0 1px 2px oklch(0 0 0 / 0.4);
  --shadow-2: 0 1px 0 0 oklch(1 0 0 / 0.05) inset, 0 8px 24px -8px oklch(0 0 0 / 0.6);
  --shadow-3: 0 1px 0 0 oklch(1 0 0 / 0.06) inset, 0 24px 60px -16px oklch(0 0 0 / 0.7);

  --font-sans:    "Inter", "Inter Tight", -apple-system, system-ui, sans-serif;
  --font-display: "Instrument Serif", "Cormorant Garamond", "Times New Roman", serif;
  --font-mono:    "Inter Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg-0);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  letter-spacing: -0.01em;
  min-height: 100vh;
  overflow-x: hidden;
}

/* page-level ambient glow — warm amber instead of purple */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(1100px 700px at 15% -10%, oklch(0.66 0.20 25 / 0.06), transparent 60%),
    radial-gradient(900px 600px at 100% 110%, oklch(0.78 0.16 55 / 0.07), transparent 60%);
  pointer-events: none; z-index: 0;
}

#root { position: relative; z-index: 1; }

button { font-family: inherit; cursor: pointer; }

/* Constrain inline SVGs so they don't blow out when CSS hasn't applied to parent yet */
svg { flex-shrink: 0; }
.btn svg { width: 14px; height: 14px; }

::selection { background: oklch(0.72 0.16 280 / 0.4); color: var(--text-1); }

/* ====== mono / num ====== */
.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; letter-spacing: 0; }
.tnum { font-variant-numeric: tabular-nums; }

/* ====== shared ====== */
.card {
  background: linear-gradient(180deg, oklch(0.22 0.010 260 / 0.6), oklch(0.19 0.009 260 / 0.6));
  border: 1px solid var(--line-1);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(8px);
}

.divider-h { height: 1px; background: var(--line-1); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; font-size: 11px; font-weight: 500;
  border-radius: 999px; border: 1px solid var(--line-2);
  color: var(--text-2);
  letter-spacing: 0.02em;
}

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }

/* ============ Top bar ============ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line-1);
  background: oklch(0.15 0.008 40 / 0.7);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 20;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-weight: 400; letter-spacing: -0.01em;
  font-size: 22px;
  color: var(--text-1);
}
.brand-mark {
  width: 28px; height: 18px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 2px;
}
.brand-mark span {
  display: block; width: 2px; border-radius: 1.5px;
  background: var(--brand);
  transition: height .3s;
}
.brand:hover .brand-mark span { animation: brandWave 1.6s ease-in-out infinite; }
@keyframes brandWave {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(0.4); }
}
.brand-name { font-size: 22px; }

.topbar-actions { display: flex; gap: 10px; align-items: center; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--line-1);
  border-radius: 999px; font-size: 12px; color: var(--text-2);
  background: oklch(0.18 0.009 40 / 0.5);
}
.user-chip .av {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center;
  font-size: 10px; color: oklch(0.18 0.009 40); font-weight: 700;
}

/* ============ Upload landing ============ */
.upload-stage {
  min-height: calc(100vh - 65px);
  display: grid; grid-template-columns: 1.05fr 1fr;
  gap: 60px; padding: 60px 64px 40px;
  position: relative;
  align-items: center;
  max-width: 1480px; margin: 0 auto;
}
.upload-left { position: relative; z-index: 2; max-width: 580px; }
.upload-right {
  position: relative; z-index: 2;
  align-self: stretch;
  display: flex; flex-direction: column; justify-content: center;
}

.upload-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11.5px; color: var(--text-3);
  letter-spacing: 0.18em; text-transform: uppercase;
  margin-bottom: 28px;
  font-family: var(--font-mono);
}
.upload-eyebrow .ln {
  width: 28px; height: 1px; background: var(--text-4);
}
.upload-h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 5.5vw, 76px);
  font-weight: 400; letter-spacing: -0.025em;
  line-height: 0.98;
  margin: 0 0 22px;
  color: var(--text-1);
}
.upload-h1 em {
  font-style: italic;
  color: var(--brand);
  font-weight: 400;
}
.upload-sub {
  color: var(--text-2); font-size: 17px;
  max-width: 480px; margin: 0 0 36px;
  line-height: 1.55;
  font-weight: 400;
}

/* Real-numbers strip telling the pain story */
.pain-strip {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding: 24px 0;
  margin-bottom: 36px;
  border-top: 1px solid var(--line-1);
  border-bottom: 1px solid var(--line-1);
}
.pain-stat .num {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 400;
  letter-spacing: -0.02em; line-height: 1;
  color: var(--text-1);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.pain-stat .num em { font-style: italic; color: var(--danger); font-weight: 400; }
.pain-stat .label {
  font-size: 12px; color: var(--text-3);
  line-height: 1.45;
}
.pain-stat .src {
  font-family: var(--font-mono); font-size: 9.5px;
  color: var(--text-4); margin-top: 4px;
  letter-spacing: 0.04em;
}

/* Right side — dropzone refined */
.dropzone {
  position: relative;
  border: 1px dashed var(--line-3);
  border-radius: 18px;
  padding: 36px 36px 28px;
  background: linear-gradient(180deg, oklch(0.21 0.010 40 / 0.4), oklch(0.18 0.009 40 / 0.6));
  transition: border-color .2s, transform .2s, background .2s;
  overflow: hidden;
}
.dropzone.drag {
  border-color: var(--brand);
  background: oklch(0.78 0.16 55 / 0.05);
  transform: scale(1.005);
}

.wave-bg { position: absolute; inset: 0; pointer-events: none; opacity: .5; }
.wave-bg::before {
  content: ""; position: absolute; inset: -50% -10%;
  background:
    radial-gradient(420px 130px at 50% 50%, oklch(0.78 0.16 55 / 0.16), transparent 70%);
  filter: blur(8px);
}

/* Living waveform centerpiece on the right */
.dz-wave {
  display: flex; align-items: center; justify-content: center;
  gap: 3px; height: 90px;
  position: relative; z-index: 1;
  margin-bottom: 26px;
}
.dz-wave span {
  display: block; width: 3px; border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  opacity: .85;
  animation: dzpulse 2.2s ease-in-out infinite;
}
@keyframes dzpulse {
  0%, 100% { transform: scaleY(0.25); opacity: .35; }
  50%      { transform: scaleY(1); opacity: 1; }
}

.dz-title {
  font-size: 18px; font-weight: 500; margin-bottom: 4px;
  position: relative; z-index: 1;
  text-align: center;
  color: var(--text-1);
  letter-spacing: -0.01em;
}
.dz-hint {
  font-size: 13px; color: var(--text-3);
  margin-bottom: 24px;
  position: relative; z-index: 1;
  text-align: center;
}
.dz-hint b { color: var(--text-2); font-weight: 500; }

.cta-row {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  position: relative; z-index: 1;
}

.bars { display: flex; }  /* legacy, unused now */

/* CTA buttons — warm copper */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; font-size: 13.5px; font-weight: 500;
  border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text-1);
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--bg-3); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, oklch(0.82 0.17 60), oklch(0.62 0.18 35));
  border-color: oklch(0.62 0.18 35);
  color: oklch(0.16 0.02 40);
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.18) inset, 0 6px 18px -8px oklch(0.62 0.18 35 / 0.7);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }

.upload-foot {
  display: flex; gap: 18px; justify-content: center;
  margin-top: 22px; font-size: 11.5px; color: var(--text-4);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ============ Processing — cinematic single-stage focus ============ */
.proc-stage {
  min-height: calc(100vh - 65px);
  display: grid; place-items: center; padding: 40px 32px;
  position: relative;
}

.proc-wrap {
  width: 100%; max-width: 720px;
  text-align: center;
  position: relative; z-index: 2;
}

/* the canvas where stage-specific animation lives */
.proc-canvas {
  height: 280px; width: 100%;
  display: grid; place-items: center;
  position: relative;
  margin-bottom: 36px;
}
.proc-scene {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  opacity: 0; transform: translateY(8px);
  transition: opacity .5s, transform .5s;
  pointer-events: none;
}
.proc-scene.active { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* stage label — large, editorial */
.proc-stage-label {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text-1);
  line-height: 1.1;
  margin-bottom: 8px;
}
.proc-stage-label em { font-style: italic; color: var(--brand); font-weight: 400; }
.proc-stage-sub {
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.18em; text-transform: uppercase;
  margin-bottom: 36px;
}

.proc-progress-wrap {
  max-width: 480px; margin: 0 auto;
}
.proc-bar {
  height: 2px; border-radius: 999px;
  background: var(--line-1); position: relative;
  overflow: hidden;
}
.proc-bar-fill {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 999px;
  transform-origin: left center;
  transition: width .8s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 16px oklch(0.78 0.16 55 / 0.5);
}
.proc-foot {
  display: flex; justify-content: space-between;
  margin-top: 14px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.06em;
}
.proc-foot .step {
  color: var(--text-4);
}
.proc-foot .step b { color: var(--text-1); font-weight: 500; }

/* Stage 1: upload — incoming waveform */
.scene-upload .wave-build {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; height: 110px;
}
.scene-upload .wave-build span {
  width: 4px; border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  animation: waveUp 1.2s ease-out forwards;
  transform-origin: center;
  transform: scaleY(0);
}
@keyframes waveUp {
  0% { transform: scaleY(0); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: scaleY(var(--target, 1)); opacity: 1; }
}

/* Stage 2: transcribing — wave → words */
.scene-transcribe {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.scene-transcribe .mini-wave {
  display: flex; gap: 3px; height: 48px; align-items: center;
}
.scene-transcribe .mini-wave span {
  width: 3px; border-radius: 2px;
  background: var(--brand);
  animation: micro 1.2s ease-in-out infinite;
}
@keyframes micro { 0%,100%{transform:scaleY(.3);opacity:.5;} 50%{transform:scaleY(1);opacity:1;} }
.scene-transcribe .word-stream {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  justify-content: center; max-width: 540px;
  font-family: var(--font-mono); font-size: 13px;
}
.scene-transcribe .word {
  color: var(--text-3);
  opacity: 0;
  animation: fadeWord .4s ease-out forwards;
}
.scene-transcribe .word.flag {
  color: var(--danger);
  background: oklch(0.66 0.20 25 / 0.1);
  padding: 2px 6px; border-radius: 4px;
  border: 1px solid oklch(0.66 0.20 25 / 0.25);
}
@keyframes fadeWord { from {opacity:0; transform: translateY(4px);} to {opacity:1; transform:none;} }

/* Stage 3: analyzing — segments fanning into intent tags */
.scene-analyze {
  display: flex; flex-direction: column; align-items: center; gap: 22px;
}
.scene-analyze .seg-row {
  display: flex; gap: 4px;
}
.scene-analyze .seg-row .seg {
  width: 36px; height: 6px; border-radius: 3px;
  background: var(--line-2);
  position: relative;
  animation: segFill .8s ease-out forwards;
  opacity: 0;
}
@keyframes segFill {
  0% { opacity: 0; background: var(--line-2); }
  40% { opacity: 1; background: var(--line-2); }
  100% { opacity: 1; background: var(--seg-color, var(--brand)); }
}
.scene-analyze .tag-cloud {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; max-width: 560px;
}
.scene-analyze .tag {
  font-family: var(--font-mono); font-size: 11px;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  opacity: 0;
  animation: tagPop .5s ease-out forwards;
}
.scene-analyze .tag.danger {
  border-color: oklch(0.66 0.20 25 / 0.4);
  background: oklch(0.66 0.20 25 / 0.08);
  color: oklch(0.85 0.16 25);
}
@keyframes tagPop { from {opacity:0; transform: scale(.8);} to {opacity:1; transform: scale(1);} }

/* Stage 4: intent — two speaker nodes connect */
.scene-intent {
  display: flex; align-items: center; justify-content: center;
  gap: 100px; height: 100%;
  position: relative;
}
.scene-intent .node {
  width: 80px; height: 80px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-2);
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  position: relative;
}
.scene-intent .node.scammer {
  border-color: oklch(0.66 0.20 25 / 0.5);
  background: oklch(0.66 0.20 25 / 0.1);
  color: oklch(0.85 0.16 25);
  animation: nodePulse 2s ease-in-out infinite;
}
.scene-intent .node.victim {
  border-color: oklch(0.74 0.13 155 / 0.5);
  background: oklch(0.74 0.13 155 / 0.1);
  color: oklch(0.85 0.13 155);
}
.scene-intent .node-label {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--text-4);
  white-space: nowrap; text-transform: uppercase; letter-spacing: 0.1em;
}
@keyframes nodePulse {
  0%, 100% { box-shadow: 0 0 0 0 oklch(0.66 0.20 25 / 0.4); }
  50%      { box-shadow: 0 0 0 12px oklch(0.66 0.20 25 / 0); }
}
.scene-intent .link {
  position: absolute; top: 50%; left: 50%;
  width: 100px; height: 1px;
  transform: translate(-50%, -50%);
  background: linear-gradient(90deg, transparent, var(--danger), transparent);
  background-size: 8px 100%;
  animation: linkFlow 1.4s linear infinite;
}
@keyframes linkFlow { from {background-position: 0 0;} to {background-position: 100px 0;} }

/* Stage 5: voice forensics — spectrum analyzer */
.scene-audio {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 4px; height: 140px;
}
.scene-audio span {
  width: 5px; border-radius: 2px;
  background: linear-gradient(180deg, var(--danger), var(--brand));
  animation: spec 1s ease-in-out infinite;
}
@keyframes spec {
  0%, 100% { height: var(--min, 20%); opacity: .6; }
  50%      { height: var(--max, 90%); opacity: 1; }
}

/* Stage 6: verdict — dial */
.scene-verdict { display: grid; place-items: center; }
.scene-verdict .ring {
  width: 160px; height: 160px;
  position: relative;
}
.scene-verdict .ring svg { transform: rotate(-90deg); }
@keyframes verdictFill { to { stroke-dashoffset: var(--filled, 22); } }
.scene-verdict .ring .num {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 56px; font-weight: 400;
  color: var(--danger);
  letter-spacing: -0.03em;
}

/* ============ Media Queries for Mobile Responsiveness ============ */
@media (max-width: 960px) {
  /* Topbar */
  .topbar { padding: 14px 20px; }
  .brand-name { font-size: 18px; }
  
  /* Upload stage */
  .upload-stage {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 32px 20px;
  }
  .pain-strip {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .pain-stat { text-align: center; }

  /* Dashboard */
  .dash { padding: 20px 16px 80px; }
  .dash-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .dash-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .file-meta { flex-wrap: wrap; gap: 8px; }
  
  /* Verdict Card */
  .verdict { padding: 24px 20px; }
  .verdict-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .verdict-stats {
    flex-wrap: wrap;
    gap: 16px;
    justify-content: flex-start;
  }
  .vstat { border-left: none; padding-left: 0; min-width: auto; padding-right: 16px; border-right: 1px solid var(--line-1); }
  .vstat:last-child { border-right: none; }
  .verdict-title { font-size: 40px; }
  .vstat-val { font-size: 36px; }
  
  /* Timeline */
  .tl-wrap { overflow-x: auto; padding-bottom: 8px; }
  .tl-axis-labels { min-width: 500px; }
  .tl-track { min-width: 500px; }

  /* Scene formatting */
  .scene-intent { gap: 40px; flex-direction: column; }
  .scene-intent .link { width: 1px; height: 40px; background-size: 100% 8px; animation: linkFlowY 1.4s linear infinite; }
  @keyframes linkFlowY { from {background-position: 0 0;} to {background-position: 0 40px;} }
  
  /* Buttons for touch */
  .btn { padding: 12px 20px; font-size: 15px; } /* larger touch target */
}

@media (max-width: 480px) {
  .verdict-title { font-size: 32px; }
  .upload-h1 { font-size: 40px; }
  .dz-title { font-size: 16px; }
  
  .tl-tooltip {
    position: fixed;
    top: auto !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 100;
    width: 90vw;
    max-width: 400px;
  }
}

/* ============ Dashboard ============ */

.dash {
  padding: 24px 32px 80px;
  max-width: 1480px; margin: 0 auto;
}

.dash-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; margin-bottom: 22px;
  flex-wrap: wrap;
}
.dash-head h2 {
  font-size: 22px; font-weight: 500; letter-spacing: -0.025em;
  margin: 0 0 4px;
}
.dash-head .file-meta {
  font-size: 12px; color: var(--text-3);
  display: flex; gap: 14px; align-items: center;
}
.dash-head .file-meta b { color: var(--text-2); font-weight: 500; }
.dash-head-actions { display: flex; gap: 8px; }

/* Verdict card */
.verdict {
  padding: 40px 44px;
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  border-color: oklch(0.66 0.20 25 / 0.4);
  background:
    radial-gradient(900px 280px at 0% 0%, oklch(0.66 0.20 25 / 0.10), transparent 60%),
    var(--bg-1);
}
.verdict.safe {
  border-color: oklch(0.74 0.13 155 / 0.4);
  background:
    radial-gradient(800px 240px at 0% 0%, oklch(0.74 0.13 155 / 0.08), transparent 60%),
    var(--bg-1);
}
.verdict-grid {
  display: grid;
  grid-template-columns: 1.4fr auto;
  gap: 40px; align-items: end;
}
.verdict-main { max-width: 640px; }
.verdict-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--danger); font-weight: 500; margin-bottom: 18px;
}
.verdict.safe .verdict-eyebrow { color: var(--safe); }
.verdict-title {
  font-family: var(--font-display);
  font-size: 60px; font-weight: 400; letter-spacing: -0.025em;
  margin: 0 0 20px; line-height: 1;
  color: var(--text-1);
}
.verdict-title em {
  font-style: italic;
  color: var(--danger);
  font-weight: 400;
}
.verdict-narrative {
  font-size: 15.5px; color: var(--text-2);
  line-height: 1.55;
  margin: 0;
  max-width: 580px;
  text-wrap: pretty;
}
.verdict-narrative b { color: var(--text-1); font-weight: 500; }

.verdict-stats { display: flex; gap: 24px; }
.vstat {
  text-align: right; padding: 0 0 0 24px;
  border-left: 1px solid var(--line-1);
  min-width: 110px;
}
.vstat:first-child { border-left: none; padding-left: 0; }
.vstat-label {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 8px;
}
.vstat-val {
  font-family: var(--font-display);
  font-size: 44px; font-weight: 400; letter-spacing: -0.03em;
  color: var(--text-1);
  line-height: 1;
}
.vstat-val .pct-sm {
  font-family: var(--font-mono);
  font-size: 13px; color: var(--text-3); margin-left: 4px;
  font-weight: 400;
}

/* Layout grid */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 22px;
  align-items: start;
}
.dash-col-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.dash-col-side { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

/* card heading */
.section {
  padding: 18px 20px 20px;
}
.section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500; color: var(--text-1);
  letter-spacing: -0.01em;
}
.section-title .num {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-3); padding: 2px 6px;
  border: 1px solid var(--line-2); border-radius: 5px;
  letter-spacing: 0.04em;
}
.section-sub { font-size: 11.5px; color: var(--text-3); }

/* ============ Timeline ============ */
.tl-wrap { padding: 6px 4px 0; }
.tl-axis-labels {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10px; color: var(--text-4);
  margin-bottom: 6px; padding: 0 2px;
}
.tl-track {
  position: relative; height: 44px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  overflow: hidden;
  display: flex;
}
.tl-seg {
  position: relative; height: 100%;
  border-right: 1px solid oklch(0 0 0 / 0.3);
  cursor: pointer;
  transition: transform .15s, filter .15s;
}
.tl-seg:last-child { border-right: none; }
.tl-seg:hover { filter: brightness(1.2); z-index: 2; }
.tl-seg.active { box-shadow: inset 0 0 0 2px oklch(1 0 0 / 0.5); }
.tl-seg .flag {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%;
  background: oklch(1 0 0 / 0.9);
  box-shadow: 0 0 8px oklch(1 0 0 / 0.5);
}
.tl-playhead {
  position: absolute; top: -4px; bottom: -4px;
  width: 2px;
  background: var(--text-1);
  box-shadow: 0 0 10px oklch(1 0 0 / 0.6);
  z-index: 5;
  pointer-events: none;
  transition: left 0.08s linear;
}
.tl-playhead::before {
  content: "";
  position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-1);
  box-shadow: 0 0 10px oklch(1 0 0 / 0.6);
}

.tl-marks {
  position: relative; height: 14px; margin-top: 4px;
}
.tl-mark {
  position: absolute; top: 0;
  font-family: var(--font-mono); font-size: 9.5px;
  color: var(--text-4);
  transform: translateX(-50%);
}

.tl-legend {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; font-size: 11px; color: var(--text-3);
}
.tl-legend-grad {
  display: flex; align-items: center; gap: 8px;
}
.tl-legend-grad .grad {
  width: 120px; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--safe), var(--warn), var(--danger));
}

.tl-tooltip {
  position: absolute;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 220px; max-width: 280px;
  box-shadow: var(--shadow-3);
  font-size: 12px;
  pointer-events: none;
  z-index: 50;
}
.tl-tooltip .tt-time {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--text-3); margin-bottom: 6px;
}
.tl-tooltip .tt-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; }
.tl-tooltip .tt-label { color: var(--text-3); }
.tl-tooltip .tt-val { color: var(--text-1); }

/* ============ Risk graph ============ */
.risk-graph {
  height: 180px; position: relative;
  padding: 0 4px;
}
.risk-svg { width: 100%; height: 100%; display: block; }
.risk-grid line { stroke: var(--line-1); stroke-dasharray: 2 4; }
.risk-area {
  fill: url(#riskGrad);
  opacity: 1;
}
.risk-line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 4px oklch(0.72 0.16 280 / 0.6));
}
.risk-thresh-line {
  stroke: var(--danger);
  stroke-width: 1; stroke-dasharray: 3 3;
}
.risk-yaxis text {
  font-family: var(--font-mono); font-size: 9.5px;
  fill: var(--text-4);
}
.risk-dot {
  fill: var(--bg-1); stroke: var(--brand); stroke-width: 1.5;
  cursor: pointer;
  transition: r .15s;
}
.risk-dot:hover, .risk-dot.active { r: 5; fill: var(--brand); }
.risk-dot.flagged { stroke: var(--danger); }
.risk-dot.flagged.active, .risk-dot.flagged:hover { fill: var(--danger); }

.risk-legend {
  display: flex; gap: 16px; font-size: 11px; color: var(--text-3);
  padding: 0 4px;
}
.risk-legend .key { display: flex; align-items: center; gap: 6px; }
.risk-legend .key .ln { width: 14px; height: 1.5px; border-radius: 2px; background: var(--brand); }
.risk-legend .key .ln.thresh { background: var(--danger); height: 1px;
  background-image: linear-gradient(90deg, var(--danger) 50%, transparent 50%);
  background-size: 4px 1px; background-color: transparent;
}

/* ============ Transcript ============ */
.transcript {
  padding: 0 0 6px;
  max-height: 540px;
  display: flex; flex-direction: column;
}
.transcript-list {
  overflow-y: auto;
  padding: 4px 18px 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-3) transparent;
}
.transcript-list::-webkit-scrollbar { width: 8px; }
.transcript-list::-webkit-scrollbar-thumb { background: var(--line-3); border-radius: 4px; }

.utter {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 14px;
  padding: 12px 12px 12px 8px;
  border-radius: 10px;
  scroll-margin-top: 80px;
  position: relative;
  transition: background .15s;
  cursor: pointer;
}
.utter:hover { background: oklch(1 0 0 / 0.02); }
.utter.active {
  background: oklch(0.72 0.16 280 / 0.08);
  outline: 1px solid oklch(0.72 0.16 280 / 0.3);
}
.utter.flagged.active {
  background: oklch(0.66 0.18 25 / 0.10);
  outline-color: oklch(0.66 0.18 25 / 0.4);
}
.utter-rail {
  width: 22px; display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding-top: 3px;
}
.utter-av {
  width: 22px; height: 22px; border-radius: 7px;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 600; letter-spacing: 0;
  font-family: var(--font-mono);
}
.utter-av.s0 { background: oklch(0.66 0.18 25 / 0.18); color: oklch(0.78 0.16 25); border: 1px solid oklch(0.66 0.18 25 / 0.3); }
.utter-av.s1 { background: oklch(0.78 0.13 230 / 0.18); color: oklch(0.84 0.13 230); border: 1px solid oklch(0.78 0.13 230 / 0.3); }
.utter-tick {
  width: 1px; flex: 1; min-height: 12px;
  background: var(--line-1);
}
.utter-meta {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 4px;
}
.utter-spk { font-size: 12px; font-weight: 500; color: var(--text-1); }
.utter-spk.s0 { color: oklch(0.82 0.14 25); }
.utter-spk.s1 { color: oklch(0.86 0.12 230); }
.utter-role {
  font-size: 9.5px; padding: 1px 5px; border-radius: 4px;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.utter-role.scammer { background: oklch(0.66 0.18 25 / 0.15); color: oklch(0.82 0.14 25); }
.utter-role.victim { background: oklch(0.74 0.14 155 / 0.12); color: oklch(0.82 0.13 155); }
.utter-time {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--text-4); letter-spacing: 0;
}
.utter-text {
  font-size: 13.5px; color: var(--text-2); line-height: 1.55;
  text-wrap: pretty;
}
.utter.flagged .utter-text mark,
.utter .utter-text mark {
  background: oklch(0.66 0.18 25 / 0.18);
  color: oklch(0.92 0.06 25);
  padding: 1px 4px; border-radius: 4px;
  border-bottom: 1px solid oklch(0.66 0.18 25 / 0.5);
}
.utter-tags {
  display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap;
}
.utter-tag {
  font-size: 10.5px; color: var(--text-3);
  padding: 2px 7px; border: 1px solid var(--line-2);
  border-radius: 5px;
  font-family: var(--font-mono);
  letter-spacing: 0;
}
.utter-tag.danger { color: oklch(0.82 0.14 25); border-color: oklch(0.66 0.18 25 / 0.4); }

.transcript-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 18px;
  border-top: 1px solid var(--line-1);
  font-size: 11px; color: var(--text-3);
}
.audio-controls { display: flex; align-items: center; gap: 10px; }
.audio-controls button {
  background: transparent; border: 1px solid var(--line-2);
  border-radius: 7px; color: var(--text-2);
  width: 26px; height: 26px;
  display: grid; place-items: center;
}
.audio-controls button:hover { border-color: var(--line-3); color: var(--text-1); }
.audio-controls .play {
  background: var(--text-1); color: var(--bg-0);
  border-color: var(--text-1);
}
.audio-pos { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }

/* ============ Side panels ============ */
.kv {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-1);
  font-size: 12.5px;
}
.kv:last-child { border-bottom: none; }
.kv-l { color: var(--text-3); }
.kv-r { color: var(--text-1); font-weight: 500; }
.kv-r.mono { font-family: var(--font-mono); }

/* roles */
.roles-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 14px;
}
.role-card {
  padding: 12px 13px;
  border: 1px solid var(--line-1);
  border-radius: 10px;
  background: oklch(0.22 0.010 260 / 0.4);
}
.role-card.scammer {
  border-color: oklch(0.66 0.18 25 / 0.3);
  background: oklch(0.66 0.18 25 / 0.06);
}
.role-card.victim {
  border-color: oklch(0.74 0.14 155 / 0.25);
  background: oklch(0.74 0.14 155 / 0.05);
}
.role-tag { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.role-card.scammer .role-tag { color: oklch(0.82 0.14 25); }
.role-card.victim .role-tag { color: oklch(0.82 0.13 155); }
.role-name { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.role-av {
  width: 22px; height: 22px; border-radius: 7px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
}
.role-card.scammer .role-av { background: oklch(0.66 0.18 25 / 0.2); color: oklch(0.82 0.14 25); }
.role-card.victim .role-av { background: oklch(0.74 0.14 155 / 0.15); color: oklch(0.82 0.13 155); }
.role-reason {
  font-size: 11.5px; color: var(--text-3); line-height: 1.55;
  padding-top: 12px; border-top: 1px solid var(--line-1);
}

/* evidence list */
.evidence-list { display: flex; flex-direction: column; }
.ev-item {
  padding: 12px 4px;
  border-bottom: 1px solid var(--line-1);
  display: grid; grid-template-columns: 8px 1fr 14px;
  gap: 12px; align-items: start;
  cursor: pointer;
  transition: background .15s;
  border-radius: 6px;
  margin: 0 -8px; padding-left: 10px; padding-right: 10px;
}
.ev-item:hover { background: oklch(1 0 0 / 0.03); }
.ev-item:last-child { border-bottom: none; }
.ev-bullet {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--danger); margin-top: 6px;
  box-shadow: 0 0 6px var(--danger);
}
.ev-bullet.high { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.ev-bullet.critical { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.ev-cat {
  font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 4px;
}
.ev-phrase {
  font-size: 12.5px; color: var(--text-2); line-height: 1.5;
  font-style: italic;
}
.ev-arrow { color: var(--text-4); font-size: 12px; padding-top: 3px; }

/* audio analysis */
.gauge-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 14px;
}
.gauge {
  padding: 12px 13px;
  border: 1px solid var(--line-1);
  border-radius: 10px;
  background: oklch(0.22 0.010 260 / 0.4);
}
.gauge-label { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.gauge-val {
  font-family: var(--font-mono); font-size: 22px;
  font-weight: 600; letter-spacing: -0.02em;
  color: var(--text-1);
}
.gauge-val.high { color: oklch(0.82 0.14 25); }
.gauge-val.med  { color: oklch(0.86 0.13 75); }
.gauge-val.low  { color: oklch(0.82 0.13 155); }
.gauge-bar {
  height: 3px; background: var(--bg-3); border-radius: 2px; margin-top: 8px;
  overflow: hidden;
}
.gauge-bar > div { height: 100%; border-radius: 2px; }

.anomaly { display: flex; gap: 10px; padding: 8px 0; font-size: 12px; color: var(--text-2); border-bottom: 1px solid var(--line-1); align-items: flex-start; line-height: 1.5; }
.anomaly:last-child { border-bottom: none; }
.anomaly .ic {
  width: 14px; height: 14px; flex: 0 0 14px;
  border-radius: 4px; background: oklch(0.80 0.14 75 / 0.15);
  color: oklch(0.86 0.13 75);
  display: grid; place-items: center; font-size: 9px;
  margin-top: 1px;
}

/* Reliability */
.relia-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-1);
  font-size: 12.5px;
}
.relia-row:last-child { border-bottom: none; }
.relia-bar {
  width: 80px; height: 4px; border-radius: 2px;
  background: var(--bg-3); overflow: hidden;
  margin-left: auto; margin-right: 12px;
}
.relia-bar > div { height: 100%; background: var(--safe); }

/* responsive */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .verdict-grid { grid-template-columns: 1fr; }
  .verdict-stats { justify-content: flex-start; }
}
