/* =========================================================
   Voice Isolator · web/style.css
   Design system mirrored from the SenseVoice reference
   (speaker_verification/app/wab/style.css). Token vocabulary,
   layout classes, component styles reused verbatim wherever the
   reference was product-agnostic. A small set of additions live
   at the end of this file for the landing-page bento grid and
   the stream/realtime hero figure variant.
   ========================================================= */

:root {
  --paper:        #FFFFFF;
  --paper-2:      #F7F8FA;
  --paper-3:      #EEF0F3;
  --ink:          #0F1115;
  --ink-2:        #2A2D33;
  --ink-3:        #5C616B;
  --ink-4:        #9CA1AC;
  --line:         #E6E8ED;
  --line-2:       #CFD3DB;

  --accent:       oklch(0.45 0.07 250);
  --accent-soft:  oklch(0.96 0.015 250);
  --accent-ink:   oklch(0.32 0.07 250);

  /* Vivid demo-only accents (pulled verbatim from the sound-effects template). */
  --demo-1:       oklch(0.62 0.22 265);   /* electric violet-blue */
  --demo-2:       oklch(0.70 0.24 330);   /* magenta */
  --demo-3:       oklch(0.78 0.20 85);    /* neon amber */
  --demo-4:       oklch(0.75 0.20 170);   /* aqua */
  --demo-5:       oklch(0.72 0.23 30);    /* coral */
  --demo-grad:    linear-gradient(90deg,
                    oklch(0.62 0.22 265) 0%,
                    oklch(0.70 0.24 330) 50%,
                    oklch(0.78 0.20 85)  100%);

  --vivid-1:      oklch(0.62 0.22 265);
  --vivid-2:      oklch(0.68 0.22 30);
  --vivid-grad:   linear-gradient(90deg, oklch(0.62 0.22 265) 0%, oklch(0.65 0.20 200) 50%, oklch(0.78 0.18 165) 100%);

  --ok:           oklch(0.55 0.14 155);
  --ok-soft:      oklch(0.96 0.03 155);
  --warn:         oklch(0.55 0.16 25);
  --warn-soft:    oklch(0.97 0.03 25);

  --radius:       8px;
  --radius-lg:    12px;

  --serif: "Fraunces", "Noto Serif SC", "Songti SC", Georgia, serif;
  --sans:  "Inter", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  background-image:
    radial-gradient(1200px 600px at 88% -10%, oklch(0.97 0.013 250 / 0.6), transparent 60%),
    radial-gradient(900px 500px at -5% 35%, oklch(0.97 0.012 200 / 0.4), transparent 60%);
  min-height: 100vh;
}
::selection { background: var(--accent-soft); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ------------- layout ------------- */
.app {
  display: grid;
  grid-template-columns: 252px minmax(0,1fr) 224px;
  max-width: 1440px; margin: 0 auto;
  min-height: 100vh;
}
@media (max-width: 1100px) {
  .app { grid-template-columns: 240px minmax(0,1fr); }
  .toc { display: none; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0,1fr); }
  .nav { display: none; }
}

/* ------------- left nav ------------- */
.nav {
  padding: 28px 22px 56px;
  border-right: 1px solid var(--line);
  position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, transparent 0%, oklch(0.985 0.005 250 / 0.5) 100%);
}
.brand { display: flex; align-items: center; gap: 11px; padding-bottom: 18px; border-bottom: 1px dashed var(--line-2); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; font-style: italic; font-size: 19px;
}
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; line-height: 1.2; }
.brand-sub { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-4); margin-top: 2px; }

.lang-toggle {
  display: inline-flex; margin: 18px 0 14px;
  padding: 3px; border: 1px solid var(--line-2); border-radius: 7px;
  background: var(--paper-2);
}
.lang-toggle button {
  padding: 4px 14px; border-radius: 5px;
  font-size: 12px; font-weight: 500; color: var(--ink-3);
  font-family: var(--mono); letter-spacing: 0.04em;
}
.lang-toggle button.on { background: var(--ink); color: var(--paper); font-weight: 600; }

.nav-group-title { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-4); margin: 18px 0 6px 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 10px; margin: 1px 0;
  border-radius: 6px;
  font-size: 13.5px; color: var(--ink-2);
  cursor: pointer; font-weight: 500;
  text-decoration: none;
}
.nav-item:hover { background: var(--paper-2); }
.nav-item.active { background: var(--ink); color: var(--paper); font-weight: 600; }
.nav-item .pill {
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  letter-spacing: 0.08em; padding: 1px 5px; border-radius: 3px;
  background: var(--accent-soft); color: var(--accent-ink);
  margin-left: auto;
}
.nav-item.active .pill { background: oklch(1 0 0 / 0.18); color: var(--paper); }

/* ------------- main ------------- */
main { padding: 40px 56px 120px; min-width: 0; }
@media (max-width: 900px) { main { padding: 32px 22px 80px; } }

.breadcrumb { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; margin-bottom: 18px; display: flex; gap: 7px; align-items: center; }
.breadcrumb .sep { color: var(--ink-4); }
.breadcrumb .current { color: var(--ink-2); font-weight: 600; }

.title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(40px, 6.4vw, 72px);
  line-height: 1.02; letter-spacing: -0.025em;
  margin: 4px 0 22px;
}
.title em { font-style: italic; color: var(--accent); font-weight: 500; }

.lead {
  font-family: var(--serif); font-weight: 500;
  font-size: 19px; line-height: 1.55; color: var(--ink-2);
  max-width: 680px; margin: 0 0 22px;
}
.lead strong { color: var(--ink); font-weight: 600; }

.badge-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-bottom: 36px; }
.tag {
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.04em;
  padding: 3px 9px; border-radius: 4px;
  background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line);
}
.tag.method-post { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 600; }
.tag.method-ws   { background: oklch(0.36 0.10 265); color: var(--paper); border-color: oklch(0.36 0.10 265); font-weight: 600; letter-spacing: 0.06em; }
.tag.path { background: var(--paper); color: var(--ink); border-color: var(--line-2); font-weight: 600; }
.tag.stable { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.muted { color: var(--ink-4); border-color: transparent; background: transparent; }

/* hero figure — 3-column pipeline */
.hero-figure { margin: 0 0 60px; padding: 22px 22px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius-lg); background: var(--paper-2); }
.hero-figure-cap { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--ink-4); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 14px; }

.hero-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
@media (max-width: 860px) {
  .hero-stage { grid-template-columns: 1fr; gap: 16px; }
}

/* Track lanes — reused for "mixed input" and "clean vocals output" */
.hero-input, .hero-output-tracks {
  display: flex; flex-direction: column; gap: 12px; position: relative;
}
.hero-track {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: center;
}
.hero-track-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; font-size: 13px;
  color: #fff;
}
/* Input = muddy mix (violet-magenta), output = clean vocal (teal-green). */
.hero-track.mix   .hero-track-icon { background: linear-gradient(140deg, oklch(0.70 0.16 285), oklch(0.55 0.18 300)); }
.hero-track.voice .hero-track-icon { background: linear-gradient(140deg, oklch(0.72 0.12 175), oklch(0.58 0.14 170)); }
.hero-track.noise .hero-track-icon { background: linear-gradient(140deg, oklch(0.80 0.02 250), oklch(0.65 0.03 250)); opacity: 0.55; }

.hero-bars {
  width: 100%; height: 40px; display: block;
  overflow: visible;
}
.hero-bars.mix   .hero-bar { fill: oklch(0.85 0.05 285); transition: fill .15s; }
.hero-bars.mix   .hero-bar.lit { fill: oklch(0.58 0.18 300); }
.hero-bars.voice .hero-bar { fill: oklch(0.88 0.04 175); transition: fill .15s, opacity .15s; }
.hero-bars.voice .hero-bar.lit { fill: oklch(0.58 0.14 170); }
.hero-bars.noise .hero-bar { fill: oklch(0.92 0.01 250); transition: fill .15s, opacity .15s; opacity: 0.8; }
.hero-bars.noise .hero-bar.lit { fill: oklch(0.80 0.02 250); opacity: 0.35; }
.hero-scanner {
  stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3;
  opacity: 0.55;
}

/* MIDDLE — API processing card with flow arrows */
.hero-pipe {
  display: grid; grid-template-columns: auto auto auto;
  align-items: center; gap: 8px;
  min-height: 90px;
}
@media (max-width: 860px) {
  .hero-pipe { grid-template-columns: 1fr; gap: 6px; padding: 6px 0; }
}
.hero-arrow {
  position: relative;
  width: 48px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--ink-4) 50%, var(--ink-4) 100%);
}
.hero-arrow::after {
  content: ''; position: absolute;
  right: -1px; top: -3px;
  border-left: 5px solid var(--ink-4);
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
}
.hero-arrow .hero-arrow-pulse {
  position: absolute; top: -2px;
  width: 6px; height: 5px; border-radius: 1px;
  background: linear-gradient(90deg, oklch(0.62 0.18 265), oklch(0.62 0.16 195));
  box-shadow: 0 0 6px oklch(0.62 0.18 265 / 0.7);
  opacity: 0;
}
.hero-arrow.flowing .hero-arrow-pulse {
  animation: hero-arrow-flow 1.2s ease-in-out infinite;
}
@keyframes hero-arrow-flow {
  0%   { opacity: 0; left: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; left: calc(100% - 6px); }
}
@media (max-width: 860px) {
  .hero-arrow { width: 1px; height: 28px;
    background: linear-gradient(180deg, transparent, var(--ink-4) 50%, var(--ink-4) 100%); }
  .hero-arrow::after {
    right: -3px; top: auto; bottom: -1px; left: -3px;
    border-top: 5px solid var(--ink-4);
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-bottom: none;
  }
}
.hero-api {
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 4px 14px -8px oklch(0.62 0.18 265 / 0.25);
  min-width: 170px;
  position: relative;
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.hero-api.busy {
  border-color: oklch(0.62 0.18 265 / 0.55);
  box-shadow: 0 6px 20px -6px oklch(0.62 0.18 265 / 0.4);
}
.hero-api-method {
  display: inline-block;
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  background: var(--ink); color: var(--paper);
  padding: 2px 7px; border-radius: 3px;
  letter-spacing: 0.08em;
}
.hero-api-method.ws {
  background: oklch(0.36 0.10 265);
}
.hero-api-path {
  margin-top: 6px;
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  color: var(--ink); letter-spacing: -0.01em;
  word-break: break-all;
}
.hero-api-step {
  margin-top: 4px;
  font-family: var(--mono); font-size: 9.5px;
  color: var(--ink-4); letter-spacing: 0.04em;
  min-height: 12px;
}
.hero-api.busy .hero-api-step { color: oklch(0.50 0.16 285); }

/* sections */
.sec { margin: 76px 0 0; scroll-margin-top: 24px; }
.sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 8px; }
.sec-num { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--ink-4); }
.sec-title { font-family: var(--serif); font-weight: 600; font-size: 30px; letter-spacing: -0.02em; margin: 0; }
.sec-lead { color: var(--ink-3); font-size: 15px; max-width: 660px; margin: 0 0 22px; }
.sec-lead code { font-family: var(--mono); font-size: 12.5px; padding: 1px 6px; border-radius: 4px; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); }

/* endpoint cards (landing page) */
.ep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.ep-card { padding: 20px 20px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; transition: border-color 0.18s, transform 0.18s; display: block; color: inherit; }
.ep-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.ep-card .ep-h { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.ep-card .ep-meth { font-family: var(--mono); font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 3px; background: var(--ink); color: var(--paper); letter-spacing: 0.06em; }
.ep-card .ep-meth.ws { background: oklch(0.36 0.10 265); }
.ep-card .ep-path { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--ink); word-break: break-all; }
.ep-card .ep-name { font-family: var(--serif); font-weight: 600; font-size: 18px; margin: 8px 0 6px; }
.ep-card .ep-desc { color: var(--ink-3); font-size: 13.5px; line-height: 1.55; }
.ep-card .ep-meta { margin-top: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.ep-card .ep-meta .tag { background: var(--paper-2); border: 1px solid var(--line); color: var(--ink-3); font-size: 10px; letter-spacing: 0.04em; }
.ep-card.primary { background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 70%); border-color: var(--accent); }

/* limits grid */
.limits { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.limit { padding: 16px 16px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; }
.limit-label { font-family: var(--mono); font-size: 10px; color: var(--ink-3); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 6px; }
.limit-value { font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.05; color: var(--ink); letter-spacing: -0.02em; }
.limit-value .limit-unit { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.limit-note { font-size: 12px; color: var(--ink-3); margin-top: 6px; line-height: 1.45; }

/* try-it widget */
.try {
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  background: #fff;
}
.try-header {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em;
}
.try-header .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--vivid-1); box-shadow: 0 0 0 3px oklch(0.62 0.22 265 / 0.18); }
.try-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
@media (max-width: 760px) { .try-body { grid-template-columns: 1fr; } }
.try-col { padding: 22px; }
.try-col.left { border-right: 1px solid var(--line); }
@media (max-width: 760px) { .try-col.left { border-right: none; border-bottom: 1px solid var(--line); } }

.field { margin-bottom: 18px; }
.field-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: var(--ink-3); text-transform: uppercase; margin-bottom: 6px;
}
.field-label .field-meta { font-family: var(--mono); font-size: 10.5px; color: var(--ink-4); letter-spacing: 0.04em; text-transform: none; }

.drop {
  border: 1.5px dashed var(--line-2); border-radius: var(--radius);
  padding: 16px; min-height: 78px;
  display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center;
  text-align: center; cursor: pointer;
  transition: all 0.18s;
  background: var(--paper-2);
}
.drop:hover, .drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.drop.has-file { border-color: var(--accent); background: var(--accent-soft); border-style: solid; }
.drop.has-player { border: none; padding: 0; min-height: 0; background: transparent; cursor: default; }
.drop .drop-prim { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.drop .drop-sec { font-size: 11px; color: var(--ink-4); font-family: var(--mono); letter-spacing: 0.04em; }
.drop .drop-name { font-family: var(--mono); font-size: 12px; color: var(--ink); font-weight: 600; word-break: break-all; }
.drop .drop-meta { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.04em; }

/* segmented select — reused for output_format / output_sample_rate */
.segmented {
  display: inline-flex;
  padding: 3px; border: 1px solid var(--line-2); border-radius: 7px;
  background: var(--paper-2);
  gap: 2px;
}
.segmented button {
  padding: 5px 12px; border-radius: 5px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  color: var(--ink-3); letter-spacing: 0.04em;
}
.segmented button.on { background: var(--ink); color: var(--paper); font-weight: 600; }

.samples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sample-chip {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em;
  padding: 4px 9px; border-radius: 4px;
  background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line);
  cursor: pointer; transition: background 0.15s;
}
.sample-chip:hover { background: var(--accent-soft); border-color: var(--accent); }

.submit {
  width: 100%; padding: 11px;
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius);
  font-weight: 600; font-size: 13.5px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.15s;
}
.submit:hover { background: var(--ink-2); }
.submit:disabled { background: var(--ink-4); cursor: not-allowed; }
.submit .kbd { font-family: var(--mono); font-size: 10.5px; padding: 1px 5px; border-radius: 3px; background: oklch(1 0 0 / 0.16); }

.out-empty { text-align: center; color: var(--ink-3); padding: 28px 12px; }
.out-empty svg { color: var(--ink-4); margin-bottom: 10px; }
.out-empty .out-hint { font-family: var(--mono); font-size: 10.5px; color: var(--ink-4); margin-top: 8px; letter-spacing: 0.04em; }

/* verdict / result panel */
.verdict {
  padding: 16px 18px; border-radius: var(--radius-lg);
  background: var(--paper-2); border: 1px solid var(--line); margin-bottom: 14px;
}
.verdict.ok   { background: var(--ok-soft); border-color: oklch(0.55 0.14 155 / 0.3); }
.verdict.diff { background: var(--warn-soft); border-color: oklch(0.55 0.16 25 / 0.3); }
.verdict-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.verdict-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; font-weight: 700; }
.verdict.ok   .verdict-icon { background: var(--ok); }
.verdict.diff .verdict-icon { background: var(--warn); }
.verdict-text { font-family: var(--serif); font-weight: 600; font-size: 19px; color: var(--ink); }
.verdict-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; }

.raw-json {
  margin-top: 12px; padding: 12px;
  background: var(--ink); color: oklch(0.92 0.005 245);
  border-radius: var(--radius);
  font-family: var(--mono); font-size: 11.5px; line-height: 1.55;
  overflow-x: auto;
}
.raw-json .k { color: oklch(0.7 0.18 30); }
.raw-json .s { color: oklch(0.78 0.18 165); }
.raw-json .n { color: oklch(0.75 0.20 250); }
.raw-json .b { color: oklch(0.68 0.22 330); }

/* code tabs */
.code-tabs {
  display: flex; gap: 2px; padding: 4px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 8px 8px 0 0; border-bottom: none;
  align-items: center;
}
.code-tabs button {
  padding: 5px 12px; border-radius: 5px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--ink-3); letter-spacing: 0.04em;
}
.code-tabs button.on { background: var(--ink); color: var(--paper); font-weight: 600; }
.code-tabs .copy { margin-left: auto; padding: 5px 10px; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 11px; }
.code-tabs .copy:hover { color: var(--ink); }
.code {
  margin: 0; padding: 16px 18px;
  background: var(--ink); color: oklch(0.92 0.005 245);
  border-radius: 0 0 8px 8px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  overflow-x: auto; white-space: pre;
}
.code .c1 { color: var(--ink-4); }
.code .s2 { color: oklch(0.78 0.18 165); }
.code .kw { color: oklch(0.7 0.18 30); }
.code .nb { color: oklch(0.75 0.20 250); }

/* errors — one card per HTTP status (or per WS close code on realtime) */
.errors { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 760px) { .errors { grid-template-columns: 1fr; } }
.err {
  display: grid; grid-template-columns: 72px 1fr; gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper);
  transition: border-color .15s;
}
.err:hover { border-color: var(--line-2); }
.err .http {
  font-family: var(--serif); font-size: 30px; font-weight: 500;
  line-height: 1; letter-spacing: -0.02em;
  align-self: flex-start;
}
.err.c4 .http { color: var(--warn); }
.err.c5 .http { color: oklch(0.55 0.22 25); }
.err.cws .http { color: oklch(0.36 0.10 265); font-size: 22px; letter-spacing: 0; }
.err .name {
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  color: var(--ink); letter-spacing: 0.02em;
  margin-bottom: 3px;
}
.err .desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; }
.err .desc code {
  font-family: var(--mono); font-size: 11.5px; padding: 1px 5px;
  border-radius: 3px; background: var(--paper-2); color: var(--ink-2);
  border: 1px solid var(--line);
}

/* ===== AI Prompt Card (§06) ===== */
.ai-prompt-card {
  position: relative;
  margin-top: 18px;
  padding: 26px 28px 22px;
  border-radius: 14px;
  color: oklch(0.94 0.02 260);
  background:
    radial-gradient(500px 300px at 100% 0%, oklch(0.70 0.24 330 / 0.18), transparent 60%),
    radial-gradient(520px 340px at 0% 100%, oklch(0.62 0.22 265 / 0.20), transparent 60%),
    linear-gradient(155deg, oklch(0.22 0.05 265), oklch(0.15 0.03 270));
  box-shadow:
    0 1px 0 oklch(1 0 0 / 0.08) inset,
    0 24px 60px -20px oklch(0.15 0.05 265 / 0.55);
  overflow: hidden;
}
.ai-prompt-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 40%, oklch(0.70 0.24 330 / 0.08) 55%, transparent 70%);
  pointer-events: none;
}
.aipc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-bottom: 14px;
  position: relative; z-index: 1;
}
.aipc-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px; border-radius: 5px;
  background: oklch(1 0 0 / 0.06);
  border: 1px solid oklch(1 0 0 / 0.12);
  color: oklch(0.85 0.14 170);
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.18em;
}
.aipc-meta {
  font-family: var(--mono); font-size: 11px;
  color: oklch(0.72 0.02 260);
  letter-spacing: 0.02em;
}
.aipc-meta .aipc-tokens { color: oklch(0.90 0.02 260); font-weight: 600; }
.aipc-title {
  position: relative; z-index: 1;
  margin: 4px 0 8px;
  font-family: var(--serif); font-weight: 500;
  font-size: 26px; line-height: 1.2; letter-spacing: -0.015em;
  color: oklch(0.98 0.01 260);
}
.aipc-title em {
  font-style: italic;
  background: linear-gradient(90deg, oklch(0.88 0.16 85), oklch(0.88 0.18 330));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.aipc-sub {
  position: relative; z-index: 1;
  margin: 0 0 16px; font-size: 13.5px; line-height: 1.55;
  color: oklch(0.78 0.02 260); max-width: 640px;
}
.aipc-sub em { font-style: italic; color: oklch(0.92 0.02 260); }
.aipc-code {
  position: relative; z-index: 1;
  max-height: 220px; overflow: auto;
  margin: 0 0 16px; padding: 14px 16px;
  border-radius: 8px;
  background: oklch(0.10 0.02 265 / 0.6);
  border: 1px solid oklch(1 0 0 / 0.06);
  font-family: var(--mono); font-size: 12px; line-height: 1.7;
  color: oklch(0.80 0.04 210);
  white-space: pre-wrap; word-break: break-word;
  mask-image: linear-gradient(180deg, #000 0, #000 85%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 85%, transparent);
}
.aipc-code::-webkit-scrollbar { width: 6px; }
.aipc-code::-webkit-scrollbar-thumb { background: oklch(1 0 0 / 0.15); border-radius: 3px; }
.aipc-actions {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.aipc-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 8px;
  background: oklch(1 0 0 / 0.04);
  border: 1px solid oklch(1 0 0 / 0.12);
  color: oklch(0.90 0.02 260);
  font-family: var(--sans); font-size: 12.5px; font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.aipc-btn svg { opacity: 0.8; }
.aipc-btn:hover { background: oklch(1 0 0 / 0.09); border-color: oklch(1 0 0 / 0.22); }
.aipc-btn:active { transform: scale(0.98); }
.aipc-btn.primary {
  background: linear-gradient(135deg, oklch(0.96 0.02 260), oklch(0.90 0.04 260));
  border-color: oklch(1 0 0 / 0.2);
  color: oklch(0.18 0.02 265); font-weight: 600;
}
.aipc-btn.primary:hover { background: linear-gradient(135deg, oklch(1 0 0), oklch(0.94 0.04 260)); }
.aipc-btn.primary svg { opacity: 1; }
.aipc-btn.copied {
  background: oklch(0.75 0.18 150);
  border-color: oklch(0.75 0.18 150);
  color: oklch(0.15 0.05 150);
}

/* right TOC */
.toc {
  padding: 40px 24px 80px; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; border-left: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, oklch(0.985 0.005 250 / 0.4));
}
.toc-title {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-4);
  margin-bottom: 16px;
}
.toc-link {
  display: block;
  padding: 9px 0;
  text-decoration: none;
  color: var(--ink-3);
  font-family: var(--sans); font-size: 14px; line-height: 1.3;
  transition: color .15s;
}
.toc-link:hover { color: var(--ink); }
.toc-link.active { color: var(--ink); font-weight: 600; }
.toc-link.active .toc-num,
.toc-link.active .toc-sep { color: var(--ink); }

.toc-num {
  font-family: var(--mono); font-weight: 600;
  color: inherit;
  transition: color .15s;
}
.toc-sep {
  display: inline-block;
  margin: 0 7px;
  color: var(--ink-4);
  transition: color .15s;
}
.toc-label { color: inherit; }
.toc-label code {
  font-family: var(--mono); font-size: 13px;
  background: none; border: none; padding: 0; color: inherit;
}

/* section sub-heading (§04) */
.sub-h { font-family: var(--serif); font-weight: 600; font-size: 18px; margin: 22px 0 10px; color: var(--ink); }

/* field table */
.field-table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 13.5px; }
.field-table th, .field-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.field-table th { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-4); background: var(--paper-2); }
.field-table td.fname { font-family: var(--mono); font-size: 12px; color: var(--ink); font-weight: 600; white-space: nowrap; }
.field-table td.ftype { font-family: var(--mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.field-table td.freq { font-family: var(--mono); font-size: 10px; padding-top: 12px; }
.field-table .req { color: oklch(0.55 0.16 25); }
.field-table .opt { color: var(--ink-4); }
.field-table td.fdesc { color: var(--ink-2); line-height: 1.55; }
.field-table td.fdesc code { font-family: var(--mono); font-size: 11.5px; padding: 1px 5px; border-radius: 3px; background: var(--paper-2); color: var(--ink); border: 1px solid var(--line); }

/* response / schema cards */
.json-card { margin: 6px 0 22px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--paper); }
.json-card-h { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; background: var(--paper-2); border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.json-card-h .right { color: var(--ink-4); font-size: 10px; letter-spacing: 0.06em; text-transform: none; }
.json-card pre { margin: 0; padding: 14px 16px; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; color: var(--ink-2); background: var(--paper); overflow-x: auto; }
.json-card pre .k { color: oklch(0.45 0.07 250); }
.json-card pre .s { color: oklch(0.45 0.10 165); }
.json-card pre .n { color: oklch(0.50 0.16 25); }
.json-card pre .c { color: var(--ink-4); font-style: italic; }

/* mini audio player (used on sync / stream output) */
@keyframes fade-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pulse   { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.78); } }
@keyframes spin    { to { transform: rotate(360deg); } }

.player {
  display: grid; grid-template-columns: 44px 1fr 22px;
  gap: 14px; align-items: center;
  padding: 12px 14px;
  border: 1px solid oklch(0.62 0.18 280 / 0.45);
  border-radius: 10px;
  background: linear-gradient(135deg, oklch(0.985 0.01 280), oklch(0.97 0.02 280));
  box-shadow: 0 1px 2px oklch(0.1 0 0 / 0.04);
  animation: fade-up .25s ease;
}
.player-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.62 0.18 280), oklch(0.50 0.16 285));
  color: #fff; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px -4px oklch(0.50 0.16 285 / 0.45);
  transition: transform .12s, box-shadow .18s;
}
.player-btn:hover  { transform: scale(1.05); box-shadow: 0 8px 18px -4px oklch(0.50 0.16 285 / 0.55); }
.player-btn:active { transform: scale(0.96); }
.player-btn svg    { width: 14px; height: 14px; }
.player-info { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.player-row  { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.player-name {
  font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1;
}
.player-tag {
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  padding: 1px 6px; border-radius: 3px;
  background: oklch(1 0 0 / 0.6); color: oklch(0.50 0.16 285);
  letter-spacing: 0.06em; text-transform: uppercase;
  flex-shrink: 0;
}
.player-bar-wrap {
  display: grid; grid-template-columns: 1fr auto;
  gap: 10px; align-items: center;
}
.player-bar {
  height: 3px; background: oklch(0.92 0.02 280); border-radius: 2px;
  position: relative; overflow: hidden; cursor: pointer;
}
.player-bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, oklch(0.62 0.18 280), oklch(0.55 0.16 195));
  border-radius: 2px; width: 0;
}
.player-time {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums; min-width: 70px; text-align: right;
}
.player-x {
  width: 22px; height: 22px; border-radius: 50%;
  background: oklch(1 0 0 / 0.7); color: var(--ink-4);
  border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.player-x:hover { background: var(--warn-soft); color: var(--warn); }

/* spinner used in the output pane while a call is in flight */
.spinner {
  width: 28px; height: 28px; margin: 0 auto 10px;
  border: 3px solid var(--line-2); border-top-color: var(--vivid-1);
  border-radius: 50%; animation: spin .9s linear infinite;
}

/* landing-page hero (big type + endpoint bento) */
.landing-hero {
  display: grid; gap: 16px; margin-bottom: 48px;
}
.landing-hero .tagline {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--accent);
}
.landing-hero .title { margin-bottom: 10px; }
.landing-hero .lead { max-width: 720px; }
.landing-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.landing-stats .stat .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-4); }
.landing-stats .stat .v { font-family: var(--serif); font-weight: 600; font-size: 22px; color: var(--ink); letter-spacing: -0.01em; }

/* landing hero — isolated-vocals visual with stacked waves */
.landing-figure {
  margin: 4px 0 60px;
  padding: 28px 28px 24px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--paper-2) 0%, oklch(0.98 0.02 265 / 0.4) 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}
@media (max-width: 860px) {
  .landing-figure { grid-template-columns: 1fr; }
}
.landing-figure .stack-label {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 10px;
}

/* WS frame lane animation used on realtime hero */
.frame-lane { display: flex; gap: 3px; align-items: flex-end; height: 40px; }
.frame-lane .frame {
  flex: 1; min-width: 2px;
  background: oklch(0.85 0.05 285);
  border-radius: 1.5px;
  transition: background .25s, height .25s;
}
.frame-lane.voice .frame { background: oklch(0.88 0.04 175); }
.frame-lane .frame.lit { background: oklch(0.58 0.18 300); }
.frame-lane.voice .frame.lit { background: oklch(0.58 0.14 170); }

[hidden] { display: none !important; }
input[type=file] { position: absolute; left: -9999px; }
