  :root{
    --bg:#eceff3; --surface:#ffffff; --surface-2:#f5f7fa;
    --ink:#171c24; --muted:#5c6675; --faint:#606979;
    --line:#dde2e9; --line-strong:#c9d0da;
    --accent:#3667b0; --accent-ink:#ffffff;
    --good:#1f9d57; --good-ink:#0d7a3f;
    --bad:#e0313f; --bad-ink:#c01f2c;
    --warn:#c8791a;
    /* Ribbon segments: pass vs either fail ≥3:1 in lightness (monitor- and
       colorblind-robust); unverified is AMBER, matching the events list's
       unverified badge, verified is the only red. */
    --rib-pass:#3fd166; --rib-fail:#8a5300; --rib-fail-ver:#a01020; --rib-hatch:rgba(255,255,255,.42);
    --shadow:0 1px 2px rgba(20,28,40,.06),0 8px 24px rgba(20,28,40,.06);
    /* Instrument scope — a fixed dark world in BOTH themes (an analysis scope
       is a dark instrument, like a video/audio meter; deliberate, not an omission). */
    --scope-bg:#0b0e12; --scope-panel:#0f141b; --scope-grid:#1b2330;
    --scope-ink:#e7ecf3; --scope-muted:#7c879a;
    --lum:#f4f7fb; --red:#ff3b4e; --scn:#3fc6ff; --thresh:#8a94a6; --play:#ffd23f;
  }
  @media (prefers-color-scheme:dark){
    :root{
      --bg:#0d1117; --surface:#151b23; --surface-2:#111820;
      --ink:#e8ecf2; --muted:#98a2b2; --faint:#8b96a8;
      --line:#242c37; --line-strong:#333c49;
      --accent:#5a90e0; --accent-ink:#0b0f15;
      --good:#35b56e; --good-ink:#4cc684;
      --bad:#ff5561; --bad-ink:#ff7a83;
      --warn:#e0a04a;
      --rib-pass:#0b551d; --rib-fail:#e8a13c; --rib-fail-ver:#ff6b5e; --rib-hatch:rgba(0,0,0,.40);
      --shadow:0 1px 2px rgba(0,0,0,.4),0 10px 30px rgba(0,0,0,.35);
    }
  }
  :root[data-theme="light"]{
    --bg:#eceff3; --surface:#ffffff; --surface-2:#f5f7fa;
    --ink:#171c24; --muted:#5c6675; --faint:#606979;
    --line:#dde2e9; --line-strong:#c9d0da;
    --accent:#3667b0; --accent-ink:#ffffff;
    --good:#1f9d57; --good-ink:#0d7a3f; --bad:#e0313f; --bad-ink:#c01f2c; --warn:#c8791a;
    --rib-pass:#3fd166; --rib-fail:#8a5300; --rib-fail-ver:#a01020; --rib-hatch:rgba(255,255,255,.42);
    --shadow:0 1px 2px rgba(20,28,40,.06),0 8px 24px rgba(20,28,40,.06);
  }
  :root[data-theme="dark"]{
    --bg:#0d1117; --surface:#151b23; --surface-2:#111820;
    --ink:#e8ecf2; --muted:#98a2b2; --faint:#8b96a8;
    --line:#242c37; --line-strong:#333c49;
    --accent:#5a90e0; --accent-ink:#0b0f15;
    --good:#35b56e; --good-ink:#4cc684; --bad:#ff5561; --bad-ink:#ff7a83; --warn:#e0a04a;
    --rib-pass:#0b551d; --rib-fail:#e8a13c; --rib-fail-ver:#ff6b5e; --rib-hatch:rgba(0,0,0,.40);
    --shadow:0 1px 2px rgba(0,0,0,.4),0 10px 30px rgba(0,0,0,.35);
  }

  *{box-sizing:border-box}
  :focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}   /* visible keyboard focus (WCAG 2.4.7) */
  .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
  html{-webkit-text-size-adjust:100%}
  body{
    margin:0;background:var(--bg);color:var(--ink);
    font-family:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
    font-size:15px;line-height:1.5;
    -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
  }
  .mono{font-family:ui-monospace,"Cascadia Code","SF Mono","JetBrains Mono",Consolas,monospace;font-variant-numeric:tabular-nums}
  .wrap{max-width:1140px;margin:0 auto;padding:0 20px}

  /* App bar */
  .appbar{display:flex;align-items:center;gap:14px;padding:14px 20px;max-width:1140px;margin:0 auto}
  .brand{display:flex;align-items:baseline;gap:9px}
  .brand b{font-size:19px;font-weight:800;letter-spacing:-.02em}
  .brand .peat{color:var(--accent)}
  .tag{font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);
    border:1px solid var(--line-strong);border-radius:999px;padding:3px 9px}
  .appbar .sp{flex:1}
  .pick{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted)}
  .pick .val{color:var(--ink);font-weight:600;background:var(--surface);border:1px solid var(--line-strong);
    border-radius:8px;padding:5px 10px;cursor:default}
  .tbtn{display:inline-flex;align-items:center;gap:7px;background:var(--surface);color:var(--ink);
    border:1px solid var(--line-strong);border-radius:8px;padding:6px 11px;font:inherit;font-size:13px;cursor:pointer}
  .tbtn:hover{border-color:var(--accent)}
  .tbtn:focus-visible,.iconbtn:focus-visible,.dl:focus-visible,.timeline:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

  /* Provenance strip */
  .prov{max-width:1140px;margin:2px auto 16px;padding:11px 16px;display:flex;gap:12px;align-items:flex-start;
    background:color-mix(in srgb,var(--accent) 9%,var(--surface));
    border:1px solid color-mix(in srgb,var(--accent) 26%,var(--line));border-radius:12px}
  .prov .dot{flex:none;width:9px;height:9px;border-radius:50%;background:var(--accent);margin-top:6px;
    box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 20%,transparent)}
  .prov p{margin:0;font-size:13.5px;color:var(--muted)}
  .prov b{color:var(--ink);font-weight:650}

  /* Instrument */
  .instrument{display:grid;grid-template-columns:236px 1fr;gap:16px;align-items:start}
  .card{background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow)}
  .rail{padding:14px;display:flex;flex-direction:column;gap:14px}
  .viewport{position:relative;aspect-ratio:16/9;border-radius:9px;overflow:hidden;background:#000;
    border:1px solid var(--line)}
  .viewport img{width:100%;height:100%;object-fit:cover;display:block;image-rendering:auto}
  .viewport .tc{position:absolute;left:7px;bottom:7px;font-size:12px;padding:2px 7px;border-radius:6px;
    background:rgba(6,9,13,.72);color:#7CFC9B;letter-spacing:.03em}
  .viewport .flashwarn{position:absolute;top:7px;right:7px;font-size:10px;font-weight:700;letter-spacing:.06em;
    padding:3px 7px;border-radius:6px;background:var(--bad);color:#fff;opacity:0;transition:opacity .1s}
  .viewport.hot .flashwarn{opacity:1}

  /* Full-frame view — opened by clicking the frame preview (the only new affordance is the pointer) */
  #frameImg{cursor:zoom-in}
  .ffview{position:fixed;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(6,9,13,.8)}
  .ffview[hidden]{display:none}
  .ffview-panel{background:var(--surface);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);
    max-width:min(1200px,95vw);max-height:93vh;display:flex;flex-direction:column;overflow:hidden}
  .ffview-top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 15px;border-bottom:1px solid var(--line)}
  .ffview-title{font-size:13.5px;font-weight:650}
  .ffview-x{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;cursor:pointer;
    background:var(--surface-2);border:1px solid var(--line-strong);color:var(--ink);font:inherit;line-height:1}
  .ffview-x:hover{border-color:var(--accent)}
  .ffview-imgwrap{background:#000;display:flex;align-items:center;justify-content:center;overflow:auto;min-height:0;padding:8px}
  .ffview-imgwrap img{max-width:100%;max-height:66vh;display:block;image-rendering:auto}
  .ffview-cap{padding:12px 15px;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
  .ffview-verdict{font-size:13.5px;color:var(--muted);display:flex;align-items:center;gap:9px}
  .ffbadge{font-weight:800;font-size:12px;letter-spacing:.05em;color:#fff;border-radius:6px;padding:3px 9px}
  .ffbadge.fail{background:var(--bad)} .ffbadge.pass{background:var(--good)}
  .ffview-save{display:inline-flex;align-items:center;gap:8px;font:inherit;font-size:13px;font-weight:600;cursor:pointer;
    text-decoration:none;border-radius:9px;padding:8px 14px;background:var(--accent);color:var(--accent-ink);border:1px solid var(--accent)}
  .ffview-save:hover{filter:brightness(1.06)}
  .facts h4,.legend h4{margin:0 0 8px;font-size:11px;letter-spacing:.09em;text-transform:uppercase;color:var(--faint);font-weight:700}
  /* minmax(0,1fr): let the value column SHRINK below its content (grid min-width:auto
     would otherwise let a long filename blow the card open); long values ellipsize. */
  .facts dl{margin:0;display:grid;grid-template-columns:auto minmax(0,1fr);gap:5px 10px;font-size:13px}
  .facts dt{color:var(--muted)}
  .facts dd{margin:0;text-align:right;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .legend ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:7px;font-size:12.5px;color:var(--muted)}
  .legend ul+h4{margin-top:14px}   /* second legend group (the pass/fail bar) starts a new headed block */
  .legend li{display:flex;align-items:center;gap:9px}
  .legend li[hidden]{display:none}   /* the display:flex above would defeat the hidden attribute */
  .swatch{flex:none;width:22px;height:12px;border-radius:3px;position:relative}
  .sw-lum{background:linear-gradient(180deg,#fff, #b9c3d4)}
  .sw-red{background:var(--red)}
  .sw-scn{background:var(--scn)}
  .sw-th{background:repeating-linear-gradient(90deg,var(--thresh) 0 4px,transparent 4px 7px);height:2px;align-self:center}
  .sw-pass{background:var(--rib-pass)}
  .sw-fail{background:var(--rib-fail)}
  .sw-fail-ver{background:var(--rib-fail-ver)}
  .sw-fail::after,.sw-fail-ver::after{content:"";position:absolute;inset:0;border-radius:3px;
    background:repeating-linear-gradient(45deg,var(--rib-hatch) 0 2px,transparent 2px 5px)}

  /* Scope */
  .scope{padding:14px 16px 16px;display:flex;flex-direction:column;gap:10px;position:relative}
  .scope-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap}
  .scope-head h3{margin:0;font-size:14px;font-weight:700;letter-spacing:-.01em}
  .readout{display:flex;gap:16px;font-size:12.5px}
  .readout .r{display:flex;align-items:center;gap:6px;color:var(--muted)}
  .readout .r[hidden]{display:none}   /* the display:flex above would defeat the hidden attribute */
  .readout .r b{color:var(--ink);min-width:2ch;text-align:right}
  .readout .k{width:9px;height:9px;border-radius:2px}
  .k-lum{background:linear-gradient(180deg,#fff,#c2ccdc)}
  .k-red{background:var(--red)}
  .k-scn{background:var(--scn)}
  .verdict-now{font-weight:700;letter-spacing:.02em;padding:2px 9px;border-radius:999px;font-size:12px}
  .vn-pass{background:color-mix(in srgb,var(--good) 20%,transparent);color:var(--good-ink)}
  .vn-fail{background:color-mix(in srgb,var(--bad) 22%,transparent);color:var(--bad-ink)}

  .plot{position:relative;background:var(--scope-bg);border-radius:10px;padding:0;overflow:hidden;
    border:1px solid #000;touch-action:pan-y;user-select:none}
  canvas{display:block;width:100%}
  #chart{height:240px}
  .ribbon-label{display:flex;justify-content:space-between;align-items:center;margin:8px 2px 2px;
    font-size:11px;color:var(--scope-muted)}
  #ribbon{height:26px;border-radius:5px;touch-action:pan-y;user-select:none}
  .brackets{position:relative;height:16px;margin-top:3px}
  .brk{position:absolute;top:0;height:16px;font-size:10px;font-weight:700;letter-spacing:.03em;
    color:var(--bad-ink);display:flex;align-items:center}
  .brk::before{content:"";position:absolute;left:0;right:0;top:0;height:6px;
    border:1px solid var(--bad);border-bottom:none;border-radius:3px 3px 0 0}
  .brk span{position:absolute;top:6px;left:0;padding:0 4px;white-space:nowrap}
  .brk.tail span{left:auto;right:0}
  .brk.nolabel span{display:none}   /* label suppressed when it would overlap a neighbor's (declutterBrackets) */

  .tooltip{position:absolute;pointer-events:none;opacity:0;transform:translate(-50%,-8px);
    background:rgba(9,13,18,.94);color:#e7ecf3;border:1px solid #232c39;border-radius:8px;
    padding:7px 9px;font-size:11.5px;line-height:1.45;white-space:nowrap;z-index:6;transition:opacity .08s}
  .tooltip .tt-t{color:#8b95a4;margin-bottom:3px}
  .tooltip .tt-r{display:flex;justify-content:space-between;gap:14px}
  .tooltip .tt-r span:last-child{font-variant-numeric:tabular-nums;font-family:ui-monospace,monospace}

  /* Transport */
  .transport{display:flex;align-items:center;gap:13px;padding-top:2px}
  .iconbtn{flex:none;width:42px;height:42px;border-radius:50%;border:1px solid var(--line-strong);
    background:var(--surface-2);color:var(--ink);cursor:pointer;display:grid;place-items:center}
  .iconbtn:hover{border-color:var(--accent);color:var(--accent)}
  .iconbtn svg{width:17px;height:17px;fill:currentColor;display:block}
  .iconbtn.sm{width:34px;height:34px}
  .iconbtn.sm svg{width:15px;height:15px}
  /* Chart zoom buttons: overlaid on the (always-dark) plot, so their colors are
     fixed rather than theme tokens. Hidden on narrow layouts — pinch serves touch. */
  .zoomctl{position:absolute;top:8px;right:8px;display:flex;gap:6px;z-index:2}
  /* Opaque: the hover crosshair spans the plot's full height and must pass
     BEHIND these, never through them. */
  .zoomctl .iconbtn.sm{width:28px;height:28px;
    background:#1b2534;color:#e8edf5;border-color:rgba(190,200,215,.4)}
  .zoomctl .iconbtn.sm svg{width:14px;height:14px}
  .zoomctl .iconbtn.sm:hover:not(:disabled){background:#2a3850}
  .zoomctl .iconbtn.sm:disabled{opacity:.35}
  @media (max-width:820px){.zoomctl{display:none}}
  .iconbtn:disabled{opacity:.4;cursor:default}
  .iconbtn:disabled:hover{border-color:var(--line-strong);color:var(--ink)}
  .timeline{position:relative;flex:1;height:32px;cursor:pointer;border-radius:6px;user-select:none;caret-color:transparent}
  .timeline .track{position:absolute;left:0;right:0;top:13px;height:6px;border-radius:3px;background:var(--line-strong)}
  .timeline .filled{position:absolute;left:0;top:13px;height:6px;border-radius:3px;background:var(--accent)}
  .timeline .head{position:absolute;top:7px;width:4px;height:18px;border-radius:2px;background:var(--play);
    box-shadow:0 0 0 3px color-mix(in srgb,var(--play) 34%,transparent);transform:translateX(-2px)}
  /* The timecode centers on the scrub bar (the row's centerline): the frame-count
     line is out of flow, hanging below, so it doesn't push the time off center. */
  .tcbox{flex:none;text-align:right;font-size:13px;position:relative}
  .tcbox .big{font-size:15px;font-weight:600}
  .tcbox input.big{background:transparent;border:1px solid transparent;border-radius:5px;
    color:inherit;text-align:right;width:calc(11ch + 16px);padding:1px 4px;display:block;
    margin-left:auto;margin-right:-5px}   /* right chrome (4px pad + 1px border) overhangs, so the DIGITS sit on the column edge, flush with the frame count */
  /* Long-analysis controls: one grouped unit anchored at the controls row's right
     edge — a stable, deliberate spot regardless of the progress text's length. */
  /* While a new analysis is preparing (engine/codec download), the empty state
     returns without its call-to-action — just the mark and heading. */
  .empty.preparing p,.empty.preparing .btn{display:none}
  .runctl{margin-left:auto;display:flex;align-items:center;gap:10px}
  .runctl[hidden]{display:none}   /* the display:flex above would defeat the hidden attribute */
  .runctl .progress{white-space:nowrap}
  /* The status text shrinks with an ellipsis rather than wrapping the row.
     basis 0, not auto: flex line-breaking uses the PRE-shrink hypothetical size,
     so with basis auto a long status string still wrapped the row even though it
     could shrink. The 16ch floor keeps it legible when narrow layouts do wrap. */
  .controls #progress{flex:1 1 0;min-width:16ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .tcbox input.big:hover{border-color:var(--faint)}
  .tcbox input.big:focus{border-color:var(--muted);background:rgba(128,140,160,.12)}
  .tcbox .sub{font-size:11px;color:var(--muted);position:absolute;top:100%;right:0;white-space:nowrap}

  /* Summary tiles */
  .summary{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-top:16px}
  .tile{padding:14px}
  .tile .lab{font-size:11px;letter-spacing:.07em;text-transform:uppercase;color:var(--faint);font-weight:700}
  .tile .big{font-size:26px;font-weight:800;letter-spacing:-.02em;margin-top:3px;line-height:1.1}
  .tile .sub{font-size:12px;color:var(--muted);margin-top:2px}
  .tile.verdict-fail .big{color:var(--bad-ink)}
  .pillrow{display:inline-flex;align-items:center;gap:7px}
  .status-dot{width:11px;height:11px;border-radius:50%;flex:none}

  /* Events */
  .events{margin-top:16px;padding:16px}
  .events h3,.downloads h3{margin:0 0 4px;font-size:15px;font-weight:750}
  .events .hint,.downloads .hint{margin:0 0 12px;font-size:13px;color:var(--muted)}
  .evt{display:grid;grid-template-columns:96px 1fr auto;gap:12px;align-items:center;padding:11px 12px;
    border:1px solid var(--line);border-radius:10px;margin-bottom:8px;background:var(--surface-2);cursor:pointer;
    width:100%;font:inherit;color:inherit;text-align:left}
  .evt:hover{border-color:var(--accent)}
  /* Long lists (past EVENTS_SCROLL_AT) become a scroll window; short ones are unaffected. */
  #eventList.scrolls{max-height:min(60vh,640px);overflow-y:auto;overscroll-behavior:contain;
    padding:0 8px 6px 2px;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
  #eventList.scrolls .evt:last-child{margin-bottom:2px}
  .evt-note{position:sticky;top:0;z-index:1;margin:0 0 8px;padding:9px 4px 8px;font-size:12px;
    color:var(--muted);background:var(--surface);border-bottom:1px solid var(--line)}
  .evt-note b{color:var(--ink)}
  /* "Forming" events line during analysis — a slow, opacity-only typing indicator (~0.8 Hz, far
     below any flash threshold; static under reduced-motion, fitting for this tool). */
  .evt-more{display:flex;align-items:center;gap:9px;padding:10px 12px 4px;color:var(--muted);font-size:12.5px}
  .evt-more .dots{display:inline-flex;gap:5px;color:var(--faint)}
  .evt-more .dots i{width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.3;animation:evtpulse 1.3s infinite ease-in-out}
  .evt-more .dots i:nth-child(2){animation-delay:.18s}
  .evt-more .dots i:nth-child(3){animation-delay:.36s}
  @keyframes evtpulse{0%,70%,100%{opacity:.25}35%{opacity:1}}
  @media (prefers-reduced-motion:reduce){.evt-more .dots i{animation:none;opacity:.55}}
  .evt .metric{display:flex;align-items:center;gap:8px;font-weight:700;font-size:13px}
  .evt .metric .d{width:10px;height:10px;border-radius:3px}
  .evt .rng{font-size:13px;color:var(--muted)}
  .evt .rng b{color:var(--ink)}
  .badge{font-size:11px;font-weight:700;letter-spacing:.04em;padding:4px 9px;border-radius:999px;white-space:nowrap}
  .b-haz{background:color-mix(in srgb,var(--bad) 20%,transparent);color:var(--bad-ink)}
  .b-fp{background:color-mix(in srgb,var(--warn) 22%,transparent);color:var(--warn)}

  /* Downloads */
  .downloads{margin-top:16px;padding:16px}
  .dlrow{display:flex;gap:10px;flex-wrap:wrap}
  .dl{display:inline-flex;align-items:center;gap:9px;background:var(--surface-2);color:var(--ink);
    border:1px solid var(--line-strong);border-radius:10px;padding:10px 14px;font:inherit;cursor:pointer}
  .dl:hover{border-color:var(--accent);color:var(--accent)}
  .dl svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7}
  .dl .ext{font-size:11px;color:var(--faint);font-weight:700}

  footer{max-width:1140px;margin:26px auto 40px;padding:18px 20px 0;border-top:1px solid var(--line);color:var(--muted);font-size:13px}
  footer p{margin:0;line-height:1.5}
  footer b{color:var(--ink);font-weight:650}

  @media (max-width:820px){
    .instrument{grid-template-columns:1fr}
    .summary{grid-template-columns:repeat(2,1fr)}
    .rail{flex-direction:row;flex-wrap:wrap}
    .rail>*{flex:1;min-width:150px}
  }
  @media (prefers-reduced-motion:reduce){*{transition:none!important}}

/* ---- Live controls (video picker, standard select, engine status) ---- */
.appbar .pick select.val{font:inherit;font-size:13px;font-weight:600;color:var(--ink);
  background:var(--surface);border:1px solid var(--line-strong);border-radius:8px;padding:5px 8px;cursor:pointer}
.appbar .pick select.val:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:2px 0 14px}
.btn{display:inline-flex;align-items:center;gap:8px;font:inherit;font-size:13.5px;font-weight:600;
  border-radius:9px;padding:8px 13px;cursor:pointer;border:1px solid var(--line-strong);
  background:var(--surface);color:var(--ink)}
.btn:hover{border-color:var(--accent)}
.btn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.btn svg.bolt{fill:currentColor;stroke:none}
.btn.primary{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.btn.primary:hover{filter:brightness(1.06)}
.btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.btn[aria-disabled="true"]{opacity:.55;pointer-events:none}
.engchip{display:inline-flex;align-items:center;gap:7px;font-size:12.5px;color:var(--muted);
  border:1px solid var(--line);border-radius:999px;padding:5px 11px}
.engdot{width:8px;height:8px;border-radius:50%;background:var(--faint);flex:none}
.engchip.ok .engdot{background:var(--good)} .engchip.ok{color:var(--good-ink)}
.engchip.warn .engdot{background:var(--warn)} .engchip.warn{color:var(--warn)}
.engchip.err .engdot{background:var(--bad)} .engchip.err{color:var(--bad-ink)}
.engchip.loading .engdot{background:var(--accent);animation:pulse 1s ease-in-out infinite}
@keyframes pulse{0%,100%{opacity:.35}50%{opacity:1}}
.progress{font-size:12.5px;color:var(--muted)}
@media (prefers-reduced-motion:reduce){.engchip.loading .engdot{animation:none}}

/* ---- Empty state (before first analysis) ---- */
.hidden{display:none!important}
.empty{max-width:600px;margin:26px auto;padding:40px 32px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:14px}
.empty-icon{width:60px;height:60px;border-radius:16px;display:grid;place-items:center;
  background:color-mix(in srgb,var(--accent) 12%,var(--surface));border:1px solid color-mix(in srgb,var(--accent) 26%,var(--line))}
.empty-icon svg{width:30px;height:30px;fill:var(--accent)}
.empty h2{margin:2px 0 0;font-size:22px;font-weight:800;letter-spacing:-.02em;text-wrap:balance}
.empty p{margin:0;max-width:46ch;color:var(--muted);font-size:14.5px;line-height:1.55}
.empty .btn.big{font-size:15px;padding:11px 20px;margin-top:6px}
.empty-note{font-size:11.5px!important;color:var(--faint)!important;letter-spacing:.02em}

/* ---- Decoder select in the controls row ---- */
.controls .lbl{display:inline-flex;align-items:center;gap:7px;font-size:12.5px;color:var(--muted)}
.controls select{font:inherit;font-size:13px;font-weight:600;color:var(--ink);background:var(--surface);
  border:1px solid var(--line-strong);border-radius:8px;padding:6px 9px;cursor:pointer}
.controls select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.controls select:disabled{opacity:.55;cursor:default}
