/* ═══ BRACE — the lab (test chamber) ═══════════════════════════
   Everything here is on the shared 4px rhythm and the shared
   elevation/radius/motion tokens from style.css.

   The colour discipline the whole product depends on:
     ink   — the resting state of every number. Traffic is fine.
     amber — the rig is armed, the instrument is annotating,
             a projection is being made, something needs reading.
     green — reserved for the trace and the safe verdict.
     red   — reserved for the freeze, the crater and the casualties.
   The big readout is INK at rest and only turns red in a freeze,
   so red arriving actually means something.
   ═══════════════════════════════════════════════════════════════ */

/* ── TOPOLOGY ─────────────────────────────────────────────── */
.topo{
  display:flex; align-items:center; justify-content:space-between; gap:var(--s3);
  flex-wrap:wrap;
  padding:var(--s2) var(--edge-pad);
  border-bottom:1px solid var(--edge);
  background:var(--topo-bg);
  font-size:var(--t-micro); letter-spacing:.13em; text-transform:uppercase;
}
.topo__flow{ display:flex; align-items:center; gap:0; margin:0; padding:0; list-style:none; }
.node{
  display:flex; align-items:baseline; gap:7px;
  padding:var(--s1) var(--s3); border:1px solid var(--edge); border-radius:var(--r-sm);
  background:var(--panel);
}
.node b{ color:var(--ink); letter-spacing:.16em; }
.node span{ color:var(--ink-3); font-size:9px; }
.node + .node{ margin-left:26px; position:relative; }
/* the wiring is chrome, not health — it stays monochrome */
.node + .node::before{
  content:""; position:absolute; left:-24px; top:50%; width:22px; height:1px;
  background:var(--edge-hot);
}
.node + .node::after{
  content:""; position:absolute; left:-8px; top:50%; transform:translateY(-50%);
  border-left:5px solid var(--edge-hot); border-top:3.5px solid transparent; border-bottom:3.5px solid transparent;
}
[data-state="crash"] .node--db{ border-color:var(--crash-edge); }

.topo__twins{ display:flex; align-items:center; gap:var(--s4); color:var(--ink-3); }
.twin{ color:var(--ink-2); }
.twin::before{ content:"twin "; color:var(--ink-3); }
.twin[data-live="1"]{ color:var(--amber); }
.pool b{ color:var(--ink); }

/* ── MAIN ─────────────────────────────────────────────────── */
/* The lab shares the landing's canvas rule: one shell, one page
   gutter, so the rail, the topology strip and the instruments all
   sit on the same two vertical lines. Was a fixed 1320px, which
   left ~300px dead on each side of a 1920 desktop. */
main{
  flex:1; display:flex; flex-direction:column; gap:clamp(16px,1.6vw,28px);
  padding:clamp(16px,1.8vw,32px) var(--pad-x) clamp(24px,2.4vw,40px);
  max-width:var(--shell); width:100%; margin:0 auto;
}

/* ═══ THE CHAMBER ═══════════════════════════════════════════════
   The whole crash arc lives on this element's data-state:
     idle     — ink readout, breathing lamp, still chevrons
     running  — the rig is armed: amber bezel, chevrons crawl
     crash    — red bezel, red bloom, red readout, flatline plate
   Every beat runs on the shared easing + duration tokens. */
.chamber{
  position:relative;
  border:1px solid var(--edge);
  border-radius:var(--r-lg);
  background:linear-gradient(180deg, var(--panel), var(--panel-deep));
  box-shadow:var(--e1), var(--bezel);
  overflow:hidden;
  transition:border-color var(--t-slow) var(--ease), box-shadow var(--t-slow) var(--ease);
}
[data-state="running"] .chamber{ border-color:var(--amber-dim); }
[data-state="crash"] .chamber{
  border-color:var(--crash-edge);
  box-shadow:var(--crash-shadow);
}

/* one restrained hit at the moment of impact — 200ms, then still */
.chamber.is-impact{ animation:impact 200ms var(--ease-strong) 1; }
@keyframes impact{
  0%{   transform:translate3d(0,0,0); }
  22%{  transform:translate3d(-4px,1px,0); }
  48%{  transform:translate3d(3px,-1px,0); }
  74%{  transform:translate3d(-2px,0,0); }
  100%{ transform:translate3d(0,0,0); }
}

/* the bloom: a hard flash that decays into a tint the crash keeps */
.chamber::after{
  content:""; position:absolute; inset:0; pointer-events:none; opacity:0;
  box-shadow:inset 0 0 90px -10px var(--red); background:var(--tint-red);
  transition:opacity var(--t-beat) var(--ease);
}
[data-state="crash"] .chamber::after{ opacity:.55; }
.chamber.is-impact::after{ animation:flash var(--t-beat) var(--ease-strong) 1; }
@keyframes flash{ 0%{ opacity:1; } 40%{ opacity:.75; } 100%{ opacity:.55; } }

/* signature: hazard chevrons, live only while the rig is loaded */
.hazard{
  position:relative; height:5px; overflow:hidden;
  opacity:.14; transition:opacity var(--t-slow) var(--ease);
}
.hazard::before{
  content:""; position:absolute; inset:0 -40px;
  background:var(--hazard); background-size:28.28px 28.28px;
}
[data-state="running"] .hazard,[data-state="crash"] .hazard{ opacity:1; }
[data-state="running"] .hazard::before,[data-state="crash"] .hazard::before{
  will-change:transform; animation:crawl 1.1s linear infinite;
}
[data-state="crash"] .hazard::before{ background:var(--hazard-crash); background-size:28.28px 28.28px; }
@keyframes crawl{ to{ transform:translateX(28.28px); } }

.chamber__head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:var(--s4);
  padding:var(--s5) var(--gut) var(--s2);
}

/* ── THE READOUT ──────────────────────────────────────────── */
.gauge{ min-width:0; }
.gauge__label{
  margin:0; font-size:var(--t-micro); font-weight:500; letter-spacing:var(--track-eyebrow);
  text-transform:uppercase; color:var(--ink-3);
}
.gauge__value{
  font-size:clamp(54px, 14vw, 116px);
  line-height:.92; font-weight:700; letter-spacing:-.04em;
  font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1;
  color:var(--ink);
  transition:color var(--t-slow) var(--ease), text-shadow var(--t-slow) var(--ease);
  margin:var(--s2) 0 var(--s1);
}
[data-state="crash"] .gauge__value{ color:var(--red); text-shadow:0 0 46px var(--red-glow); }
.gauge__base{ font-size:var(--t-micro); letter-spacing:.14em; text-transform:uppercase; color:var(--ink-3); }
.gauge__base b{ color:var(--ink-2); font-variant-numeric:tabular-nums; }

/* ── IMPACT ───────────────────────────────────────────────── */
.impact{ text-align:right; flex:none; }
.impact__idle{
  display:flex; align-items:center; gap:var(--s2);
  font-size:var(--t-micro); letter-spacing:.16em; text-transform:uppercase; color:var(--ink-2);
}
.statuslamp{
  width:7px; height:7px; border-radius:50%; background:var(--green);
  box-shadow:0 0 10px var(--green-glow); animation:beat 2.4s ease-in-out infinite;
}
[data-state="running"] .statuslamp{ background:var(--amber); box-shadow:0 0 10px var(--amber-dim); animation-duration:1.2s; }
@keyframes beat{ 0%,100%{opacity:1} 50%{opacity:.35} }
.impact__live{ display:none; }
[data-state="crash"] .impact__idle{ display:none; }
[data-state="crash"] .impact__live{ display:block; animation:rise var(--t-slow) var(--ease-strong) both; }
@keyframes rise{ from{ opacity:0; transform:translateY(6px) scale(.96); } }
.impact__label{ display:block; font-size:var(--t-micro); letter-spacing:var(--track-eyebrow); text-transform:uppercase; color:var(--red); }
.impact__timer{
  display:block; font-size:clamp(30px,7vw,46px); font-weight:700; line-height:1;
  font-variant-numeric:tabular-nums; color:var(--red); letter-spacing:-.025em; margin:var(--s1) 0;
}
.impact__timer i{ font-style:normal; font-size:.5em; color:var(--red); opacity:.7; }
.impact__sub{ font-size:var(--t-micro); letter-spacing:.14em; text-transform:uppercase; color:var(--ink-3); }

/* ── THE SCOPE ────────────────────────────────────────────── */
.plot{ position:relative; padding:0 var(--gut); }
#chart{ display:block; width:100%; height:210px; }
.plot__flatline{
  position:absolute; right:var(--gut); top:20%;
  font-size:var(--t-label); letter-spacing:var(--track-eyebrow); text-transform:uppercase; color:var(--red);
  opacity:0; transform:translateY(-6px);
  transition:opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease-strong);
  pointer-events:none;
  border:1px solid var(--crash-edge); border-radius:var(--r-sm);
  padding:6px 14px; background:var(--flatline-bg);
}
[data-state="crash"] .plot__flatline{ opacity:1; transform:none; transition-delay:180ms; }

/* the calibration rail sits under the scope and labels the axis */
.chamber .rail-scale{ padding-bottom:var(--s3); }

/* ── THE STRIP ────────────────────────────────────────────── */
/* These tiles are the running live totals since the page opened — a
   different number from the crash report's per-run figures below, so
   the two must never look like they are disagreeing on the same
   question. This eyebrow says which question this strip answers. */
.strip__eyebrow{
  margin:0; padding:var(--s2) var(--gut) 0;
  font-size:9px; font-weight:500; letter-spacing:var(--track-eyebrow);
  text-transform:uppercase; color:var(--ink-3);
  border-top:1px solid var(--edge);
}
.strip__eyebrow span{ text-transform:none; letter-spacing:0; opacity:.7; }
.strip{
  display:grid; grid-template-columns:repeat(4,1fr);
}
.lab{
  padding:var(--s3) var(--gut); border-left:1px solid var(--edge);
  display:flex; flex-direction:column; gap:var(--s1); min-width:0;
}
.lab:first-child{ border-left:0; }
.lab b{ font-size:9.5px; letter-spacing:.16em; text-transform:uppercase; color:var(--ink-3); font-weight:500; }
.lab__ok{ font-size:19px; font-weight:600; font-variant-numeric:tabular-nums; color:var(--ink); letter-spacing:-.015em; }
.lab__died{
  font-size:9.5px; letter-spacing:.12em; text-transform:uppercase; color:var(--ink-3);
  transition:color var(--t-mid) var(--ease);
}
/* a label that has taken casualties says so in the product's own colour */
.lab[data-hurt="1"] .lab__died{ color:var(--red); font-weight:600; }
.lab--total .lab__ok{ color:var(--ink-2); }
[data-state="crash"] .lab--total .lab__ok{ color:var(--red); }

/* ═══ AWAITING STATES ═══════════════════════════════════════════
   An instrument with no feed yet must not read zero — zero is a
   measurement, and we have not made one. Until the first stats
   frame lands, every readout says what it is waiting for, in the
   facility's own mono, with a slow lamp beside it.

   One switch drives all of them: <html data-feed>, set to "live"
   by app.js on the first frame from whichever transport won. */
.await{
  display:none; align-items:center; gap:7px;
  font-size:9.5px; letter-spacing:.18em; text-transform:uppercase; color:var(--ink-3);
  white-space:nowrap; min-width:0;
}
.await__dot{
  width:6px; height:6px; border-radius:50%; flex:none;
  background:var(--ink-3); opacity:.8;
  animation:beat 2.8s ease-in-out infinite;
}
[data-feed="wait"] .await{ display:flex; }
/* while waiting, the number and its unit step aside for the label */
[data-feed="wait"] .gauge__value,
[data-feed="wait"] .lab__ok,
[data-feed="wait"] .lab__died{ display:none; }
.await--gauge{
  /* holds the same vertical space the big readout gave up, so nothing
     below it moves when the first frame arrives */
  min-height:clamp(54px, 14vw, 116px); align-items:flex-end;
  font-size:var(--t-label); letter-spacing:var(--track-eyebrow);
  margin:var(--s2) 0 var(--s1);
}
.await--gauge .await__dot{ margin-bottom:3px; }
.await--lab{ padding:3px 0; }
.await--plot{
  position:absolute; left:var(--gut); top:50%; transform:translateY(-50%);
  font-size:var(--t-label); letter-spacing:var(--track-eyebrow);
  border:1px solid var(--edge); border-radius:var(--r-sm);
  padding:6px 12px; background:var(--panel-2);
}
/* a lost feed is not the same as a feed that never started: the lamp
   goes amber and says so, without hiding the last known numbers */
.chip[data-t="init"] .led{ background:var(--amber); box-shadow:0 0 8px var(--amber-dim); animation:led 1.5s var(--ease) infinite; }
.chip[data-t="init"]{ color:var(--amber); border-color:var(--amber-dim); }
.chip[data-t="poll"]{ color:var(--amber); border-color:var(--amber-dim); }
.chip[data-t="down"]{ color:var(--red); border-color:var(--crash-edge); }

/* ── LOWER DECK ───────────────────────────────────────────── */
.deck{ display:grid; grid-template-columns:1fr 1fr; gap:var(--gut); align-items:start; }

.panel{
  border:1px solid var(--edge); border-radius:var(--r-lg);
  background:linear-gradient(180deg,var(--panel),var(--panel-deep));
  box-shadow:var(--e1), var(--bezel);
  display:flex; flex-direction:column; min-width:0;
}
/* Wide canvas: the console is the thing a judge types into, so it
   takes the larger share. The report card holds the right rail at a
   width where its dot-leader rows still read as a report. */
@media (min-width:1200px){
  .deck{ grid-template-columns:minmax(0,1.12fr) minmax(0,1fr); gap:clamp(16px,1.6vw,28px); }
}
.panel__head{
  display:flex; align-items:baseline; justify-content:space-between; gap:var(--s3);
  padding:var(--s4) clamp(16px,1.6vw,26px); border-bottom:1px solid var(--edge);
}
.panel__head h2{
  margin:0; font-size:var(--t-label); font-weight:600; letter-spacing:var(--track-eyebrow);
  text-transform:uppercase; color:var(--ink); white-space:nowrap;
}
/* names which question this card answers, so it never reads as
   contradicting the live-traffic strip above it */
.panel__scope{
  font-weight:500; color:var(--amber); margin-left:var(--s2);
  padding:2px 6px; border:1px solid var(--amber-dim); border-radius:var(--r-pill);
  font-size:9px; letter-spacing:.1em; vertical-align:middle;
}
/* a run is on the rig right now — pulsing, so it never reads as a result */
.panel__scope--live{
  color:var(--amber); border-color:var(--amber);
  display:inline-flex; align-items:center; gap:5px;
}
.panel__scope--live::before{
  content:""; width:5px; height:5px; border-radius:50%; background:var(--amber);
  animation:beat 1.2s ease-in-out infinite;
}
/* an older run, shown because a new one failed to dispatch — muted, not amber */
.panel__scope--prev{ color:var(--ink-3); border-color:var(--edge); }
.panel__note{
  font-size:9.5px; letter-spacing:.13em; text-transform:uppercase; color:var(--ink-3);
  text-align:right; min-width:0;
}

/* ── CONSOLE ──────────────────────────────────────────────── */
.presets{ display:flex; gap:var(--s2); padding:var(--gut) var(--gut) var(--s3); }
.preset{
  flex:1; text-align:left; cursor:pointer;
  background:var(--panel-2); border:1px solid var(--edge); border-radius:var(--r-sm);
  color:var(--ink-2); padding:var(--s3); font-family:inherit;
  display:flex; flex-direction:column; gap:3px; min-width:0;
  transition:border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-mid) var(--ease);
}
.preset b{ font-size:var(--t-label); letter-spacing:.14em; text-transform:uppercase; color:var(--ink); }
.preset span{ font-size:9.5px; letter-spacing:.06em; color:var(--ink-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.preset:hover:not(:disabled){ background:var(--panel-2-hover); border-color:var(--edge-hot); transform:translateY(-1px); box-shadow:var(--e1); }
.preset:active:not(:disabled){ background:var(--panel-2-pressed); }
.preset--naive[aria-pressed="true"]{ border-color:var(--crash-edge); background:var(--tint-red); }
.preset--naive[aria-pressed="true"] b{ color:var(--red); }
.preset--safe[aria-pressed="true"]{ border-color:var(--safe-edge); background:var(--tint-green); }
.preset--safe[aria-pressed="true"] b{ color:var(--green); }
.preset:disabled{ opacity:.45; cursor:not-allowed; }

#sql{
  margin:0 var(--gut);
  min-height:132px; resize:vertical;
  background:var(--well); color:var(--ink);
  border:1px solid var(--edge); border-radius:var(--r-sm);
  padding:var(--s3);
  font-family:var(--mono); font-size:13px; line-height:1.6; tab-size:2;
  caret-color:var(--amber);
  transition:border-color var(--t-fast) var(--ease);
}
#sql:hover:not(:disabled){ border-color:var(--edge-hot); }
#sql::placeholder{ color:var(--ink-3); }
#sql:disabled{ opacity:.55; }

/* Bring-your-own-schema: an optional, collapsed affordance that stays out of the
   way of the default orders flow until a visitor opens it. */
.byos{ margin:var(--s3) var(--gut) 0; border:1px solid var(--edge); border-radius:var(--r-sm); background:var(--panel); }
.byos__summary{
  cursor:pointer; list-style:none; padding:var(--s2) var(--s3);
  font-size:11px; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-2);
}
.byos__summary::-webkit-details-marker{ display:none; }
.byos__summary::before{ content:"+ "; color:var(--ink-3); }
.byos[open] .byos__summary::before{ content:"– "; }
.byos__summary span{ text-transform:none; letter-spacing:0; color:var(--ink-3); font-size:10px; }
.byos__body{ padding:0 var(--s3) var(--s3); display:flex; flex-direction:column; gap:var(--s2); }
.byos__ddl{
  width:100%; box-sizing:border-box; resize:vertical;
  background:var(--well); color:var(--ink);
  border:1px solid var(--edge); border-radius:var(--r-sm); padding:var(--s3);
  font-family:var(--mono); font-size:12px; line-height:1.6; tab-size:2; caret-color:var(--amber);
}
.byos__ddl:hover:not(:disabled){ border-color:var(--edge-hot); }
.byos__ddl::placeholder{ color:var(--ink-3); }
.byos__rows{ display:flex; align-items:center; gap:var(--s2); font-size:11px; color:var(--ink-2); }
.byos__rows input{
  width:9rem; background:var(--well); color:var(--ink);
  border:1px solid var(--edge); border-radius:var(--r-sm); padding:var(--s1) var(--s2);
  font-family:var(--mono); font-size:12px;
}
.byos__hint{ margin:0; font-size:10px; line-height:1.5; color:var(--ink-3); }

/* ── per-statement breakdown for a sequence run (inside the report card) ──
   The card headline is the worst-of verdict; this strip shows every step so
   you can see which one is the killer. Colour-keyed on each step's verdict. */
.seqsteps{ margin:var(--s3) 0 0; border-top:1px solid var(--edge); padding-top:var(--s3); }
.seqsteps__tag{
  display:block; font-size:9.5px; letter-spacing:.16em; text-transform:uppercase;
  color:var(--ink-3); margin-bottom:var(--s2);
}
.seqsteps__list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:var(--s1); }
.seqstep{
  display:grid; grid-template-columns:auto minmax(0,1fr) auto auto; align-items:center; gap:var(--s2);
  padding:var(--s2); border:1px solid var(--edge); border-left-width:3px; border-radius:var(--r-sm);
  background:var(--panel-2);
}
.seqstep.is-safe{ border-left-color:var(--green); }
.seqstep.is-unsafe{ border-left-color:var(--red); }
.seqstep.is-skipped{ border-left-color:var(--ink-3); opacity:.65; }
.seqstep.is-other{ border-left-color:var(--amber); }
.seqstep__n{
  font-family:var(--mono); font-size:11px; color:var(--ink-3); flex:none;
  width:1.5em; height:1.5em; display:grid; place-items:center;
  border:1px solid var(--edge); border-radius:50%;
}
.seqstep__sql{
  font-family:var(--mono); font-size:11.5px; color:var(--ink-2);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0;
}
.seqstep__verdict{
  font-size:9px; letter-spacing:.1em; text-transform:uppercase; font-weight:600;
  padding:2px 7px; border-radius:var(--r-pill); white-space:nowrap;
}
.is-safe .seqstep__verdict{ color:var(--green); border:1px solid var(--green); }
.is-unsafe .seqstep__verdict{ color:var(--red); border:1px solid var(--red); }
.is-skipped .seqstep__verdict{ color:var(--ink-3); border:1px solid var(--edge); }
.is-other .seqstep__verdict{ color:var(--amber); border:1px solid var(--amber-dim); }
.seqstep__stat{ font-family:var(--mono); font-size:10.5px; color:var(--ink-3); white-space:nowrap; font-variant-numeric:tabular-nums; }
.seqstep__qual{
  grid-column:1 / -1; font-size:9px; letter-spacing:.1em; text-transform:uppercase;
  color:var(--amber); opacity:.85;
}

.console__foot{ padding:var(--s3) var(--gut) var(--gut); display:flex; align-items:center; gap:var(--s3); }
.run{
  flex:1; cursor:pointer; font-family:inherit;
  border:1px solid var(--green); border-radius:var(--r-sm);
  background:var(--run-bg);
  color:var(--green);
  min-height:44px;
  padding:var(--s3) var(--s5); font-size:12px; font-weight:600; letter-spacing:var(--track-label); text-transform:uppercase;
  display:flex; align-items:center; justify-content:center; gap:var(--s2);
  transition:background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease),
    box-shadow var(--t-mid) var(--ease), transform 90ms var(--ease);
}
.run:hover:not(:disabled){ background:var(--green); color:var(--on-green); box-shadow:0 0 26px -6px var(--green-glow); transform:translateY(-1px); }
.run:disabled{ cursor:not-allowed; border-color:var(--amber-dim); color:var(--amber); background:var(--amber-wash); }
/* The working indicator is the brand's own pulse line, not a spinner:
   a blip travelling a hairline and spiking as it passes the middle.
   Same motif as the mark and the scope, at button scale. */
.run__spin{ display:none; position:relative; width:28px; height:12px; flex:none; }
.run__spin::before{
  content:""; position:absolute; left:0; right:0; top:50%; height:1px;
  background:currentColor; opacity:.35;
}
.run__spin::after{
  content:""; position:absolute; left:0; top:calc(50% - 1px); width:7px; height:2px;
  border-radius:1px; background:currentColor;
}
[data-state="running"] .run__spin,[data-state="crash"] .run__spin{ display:block; }
[data-state="running"] .run__spin::after,
[data-state="crash"] .run__spin::after{ animation:runpulse 1.4s var(--ease) infinite; }
@keyframes runpulse{
  0%  { transform:translate(-7px,0);   opacity:0; }
  14% { opacity:1; }
  44% { transform:translate(9px,-4px); }
  56% { transform:translate(12px,4px); }
  86% { opacity:1; }
  100%{ transform:translate(28px,0);   opacity:0; }
}
.console__hint{
  margin:0; font-size:9.5px; letter-spacing:.12em; text-transform:uppercase; color:var(--ink-3);
  text-align:right; max-width:40%;
}

/* ── THE COMMAND CHIP ─────────────────────────────────────────
   The button is a real API call and the chip says which one, in
   the same monospace the console writes SQL in. Clicking it hands
   you the curl — the whole lab is reachable without this page. */
.cmd{
  position:relative;
  flex:none; cursor:pointer; font-family:var(--mono);
  display:inline-flex; align-items:center; gap:7px;
  padding:7px 11px; border:1px solid var(--edge); border-radius:var(--r-sm);
  background:var(--panel-2); color:var(--ink-3);
  font-size:10px; letter-spacing:.1em; white-space:nowrap;
  transition:border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease);
}
/* the visible chip stays compact; the tappable area doesn't */
.cmd::before{
  content:""; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:max(100%,44px); height:44px;
}
.cmd:hover{ background:var(--panel-2-hover); border-color:var(--edge-hot); color:var(--ink-2); }
.cmd:active{ background:var(--panel-2-pressed); }
.cmd__verb{ color:var(--amber); font-weight:700; letter-spacing:.12em; }
.cmd__path{ color:var(--ink-2); }
.cmd__ico{ width:12px; height:12px; flex:none; opacity:.6; }
/* copied: the chip says so itself rather than firing a toast */
.cmd.is-copied{ border-color:var(--green); color:var(--green); }
.cmd.is-copied .cmd__verb,
.cmd.is-copied .cmd__path{ color:var(--green); }
.cmd.is-copied .cmd__ico{ opacity:0; }
/* a refused clipboard is not a success — it gets the annotation colour,
   which is what amber is for */
.cmd.is-failed{ border-color:var(--amber-dim); color:var(--amber); }
.cmd.is-failed .cmd__verb,
.cmd.is-failed .cmd__path{ color:var(--amber); }
.cmd.is-failed .cmd__ico{ opacity:0; }

/* ═══ THE DIVERGENCE PROOF ══════════════════════════════════════
   Two traces on one frame: the shape a healthy run holds, and the
   shape this run actually took. Where they part is the finding —
   marked once, with a tick and a single red pill. Everything else
   stays monochrome so the one red thing is the one that matters.
   Built from the run's own 250ms timeline; drawn only when there
   is a timeline to draw. */
.diverge{
  position:relative; margin-top:var(--s4); padding-top:var(--s4);
  border-top:1px solid var(--edge);
  animation:chip var(--t-slow) var(--ease) 500ms both;
}
.diverge__head{
  display:flex; align-items:baseline; justify-content:space-between; gap:var(--s3);
  font-size:9.5px; letter-spacing:.15em; text-transform:uppercase; color:var(--ink-3);
  margin-bottom:var(--s3);
}
.diverge__key{ display:flex; align-items:center; gap:var(--s3); flex-wrap:wrap; }
.diverge__key i{ display:inline-flex; align-items:center; gap:5px; font-style:normal; }
.diverge__key i::before{
  content:""; width:14px; height:0; border-top:2px solid var(--ink-2); flex:none;
}
.diverge__key i.is-ref::before{ border-top-style:dashed; border-color:var(--ink-3); }
.diverge__frame{ position:relative; }
.diverge__frame svg{ display:block; width:100%; height:72px; overflow:visible; }
.dv-ref{ fill:none; stroke:var(--ink-3); stroke-width:1.5; stroke-dasharray:4 4; opacity:.7; }
.dv-run{ fill:none; stroke:var(--ink); stroke-width:2; stroke-linejoin:round; stroke-linecap:round; }
.dv-fill{ fill:var(--tint-red); stroke:none; }
.dv-tick{ stroke:var(--red); stroke-width:1.5; stroke-dasharray:2 3; }
.diverge__pill{
  position:absolute; top:-4px; transform:translateX(-50%);
  font-size:9px; letter-spacing:.14em; text-transform:uppercase; white-space:nowrap;
  padding:3px 8px; border-radius:var(--r-pill);
  background:var(--red); color:var(--on-red); font-weight:700;
  pointer-events:none;
}
.diverge__pill--safe{ background:var(--green); color:var(--on-green); }
.diverge__foot{
  margin:var(--s3) 0 0; font-family:var(--sans); font-size:12px; line-height:1.6; color:var(--ink-3);
}
/* the run trace draws itself in once, left to right — the same
   gesture the sign-off pulse uses. It never animates on redraw. */
.dv-run{ stroke-dasharray:1400; stroke-dashoffset:0; animation:dv-draw 900ms var(--ease) 560ms both; }
@keyframes dv-draw{ from{ stroke-dashoffset:1400; } }

/* ── REPORT ───────────────────────────────────────────────── */
.report__body{
  padding:var(--gut); min-height:248px; display:flex;
  transition:opacity var(--t-fast) var(--ease);
}
.report__body.is-swapping{ opacity:0; }

/* ── TRANSIENT NOTICE ─────────────────────────────────────────
   Rejected SQL, rig busy, rate-limited, a warming twin — these render
   here, above the last real crash report, so a fumbled paste never
   evicts the demo artifact. Dismissible. */
.report__notice{
  position:relative;
  padding:var(--gut) var(--gut) 0;
  animation:chip var(--t-slow) var(--ease) both;
}
.report__notice .card{ animation:none; }
.notice__close{
  position:absolute; top:calc(var(--gut) + var(--s1)); right:var(--gut); z-index:2;
  width:30px; height:30px; display:grid; place-items:center;
  background:var(--panel-2); border:1px solid var(--edge); border-radius:var(--r-sm);
  color:var(--ink-2); font-size:20px; line-height:1; cursor:pointer; font-family:var(--sans);
  transition:border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
/* the visible button stays compact; the tap target does not */
.notice__close::before{
  content:""; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:44px; height:44px;
}
.notice__close:hover{ border-color:var(--edge-hot); color:var(--ink); background:var(--panel-2-hover); }
.notice__close:active{ background:var(--panel-2-pressed); }
/* keep the dismiss clear of the note card's title */
.report__notice .card--note .card__title{ padding-right:var(--s7); }

/* ── ERRORED / INCONCLUSIVE CARD ──────────────────────────────
   An errored run never executed. Amber (the annotation colour), with
   the database's own error string shown verbatim in the console's mono.
   Never red, never an all-zero UNSAFE badge. */
.card--errored{ position:relative; }
.card--errored::before{
  content:""; position:absolute; top:-4px; bottom:-4px; width:2px;
  left:calc(var(--gut) * -1); background:var(--amber); transform:scaleY(0); transform-origin:top;
  animation:edge var(--t-beat) var(--ease-strong) 120ms both;
}
.card--errored .card__title{
  margin:0 0 var(--s2); font-size:var(--t-lede); font-weight:650; letter-spacing:-.012em;
  font-family:var(--sans); color:var(--ink);
}
.card--errored .card__text{
  margin:0; font-family:var(--sans); font-size:var(--t-body); line-height:1.68; color:var(--ink-2);
}
.errbox{
  margin:var(--s4) 0 0; padding:var(--s3) var(--s4);
  background:var(--well); border:1px solid var(--crash-edge); border-left-width:2px; border-radius:var(--r-sm);
  font-family:var(--mono); font-size:12.5px; line-height:1.6; color:var(--red);
  white-space:pre-wrap; word-break:break-word;
}

/* the empty state is the shape of the answer, unfilled */
.blank{ width:100%; align-self:center; }
.blank__lead{
  margin:0 0 var(--s5); font-size:var(--t-micro); letter-spacing:var(--track-eyebrow);
  text-transform:uppercase; color:var(--ink-3);
}
.blank__fields{ margin:0; padding:0; }
.blank__fields > div{
  display:flex; align-items:baseline; justify-content:space-between; gap:var(--s4);
  padding:var(--s3) 0; border-bottom:1px dashed var(--edge);
}
.blank__fields dt{
  font-size:9.5px; letter-spacing:.15em; text-transform:uppercase; color:var(--ink-3);
}
.blank__fields dd{ margin:0; font-size:var(--t-h3); color:var(--ink-3); opacity:.5; letter-spacing:.1em; }
.blank__hint{
  margin:var(--s5) 0 0; font-family:var(--sans); font-size:var(--t-body); line-height:1.65;
  color:var(--ink-2); max-width:42ch;
}

/* the running state — the console talking while the rig works */
.working{ width:100%; align-self:center; }
.working p{
  margin:0; font-family:var(--sans); font-size:var(--t-body); line-height:1.7; color:var(--ink-2); max-width:40ch;
}
.working__tag{
  display:inline-flex; align-items:center; gap:var(--s2); margin-bottom:var(--s4);
  font-size:var(--t-micro); letter-spacing:var(--track-eyebrow); text-transform:uppercase; color:var(--amber);
}
.working__tag::before{
  content:""; width:6px; height:6px; border-radius:50%; background:var(--amber);
  animation:beat 1.2s ease-in-out infinite;
}
/* the dispatching card echoes the SQL being run, so the in-progress panel
   is unmistakably about the new input — never the previous report */
.working__sql{
  margin:var(--s4) 0 0; padding:var(--s3);
  background:var(--well); border:1px solid var(--edge); border-radius:var(--r-sm);
  font-family:var(--mono); font-size:12px; line-height:1.55; color:var(--ink-2);
  white-space:pre-wrap; word-break:break-word; max-height:132px; overflow:auto;
}

.card{ width:100%; animation:land var(--t-slow) var(--ease-strong) both; }
@keyframes land{ from{ opacity:0; transform:translateY(10px); } }

/* the safe verdict gets a soft sweep instead of a hit */
.card--safe{ position:relative; overflow:hidden; }
.card--safe::before{
  content:""; position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(100deg, transparent 20%, var(--tint-green) 45%, transparent 70%);
  transform:translateX(-100%);
  animation:sweep 900ms var(--ease) 160ms 1;
}
@keyframes sweep{ to{ transform:translateX(100%); } }

/* the unsafe verdict lands with its edge lit */
.card--unsafe{ position:relative; }
.card--unsafe::before{
  content:""; position:absolute; top:-4px; bottom:-4px; width:2px;
  left:calc(var(--gut) * -1); background:var(--red); transform:scaleY(0); transform-origin:top;
  animation:edge var(--t-beat) var(--ease-strong) 120ms both;
}
@keyframes edge{ to{ transform:scaleY(1); } }

.card__verdict{ display:flex; align-items:center; gap:var(--s2) var(--s3); flex-wrap:wrap; margin-bottom:var(--s4); }
.card__verdict .card__id{ margin-left:auto; }
.tag{
  font-size:var(--t-micro); font-weight:700; letter-spacing:var(--track-eyebrow); text-transform:uppercase;
  padding:5px 11px; border-radius:var(--r-sm);
}
.tag--red{ background:var(--red); color:var(--on-red); }
.tag--green{ background:var(--green); color:var(--on-green); }
.tag--amber{ background:var(--amber); color:var(--on-amber); }
.card__id{ font-size:9.5px; letter-spacing:.14em; text-transform:uppercase; color:var(--ink-3); }

.metric + .metric{ margin-top:var(--s4); padding-top:var(--s4); border-top:1px solid var(--edge); }
.metric__value{
  font-size:clamp(38px,8.4vw,56px); line-height:1; font-weight:700; letter-spacing:-.038em;
  font-variant-numeric:tabular-nums;
}
.metric__value--mid{ font-size:clamp(26px,5.4vw,34px); }
.card--unsafe .metric--hero .metric__value{ color:var(--red); text-shadow:0 0 40px var(--red-glow); }
.card--safe .metric--hero .metric__value{ color:var(--green); text-shadow:0 0 40px var(--green-glow); }
.metric__label{
  margin-top:7px; font-size:9.5px; letter-spacing:.15em; text-transform:uppercase; color:var(--ink-3);
  display:flex; align-items:center; gap:var(--s2); flex-wrap:wrap;
}

.mix{ list-style:none; margin:var(--s3) 0 0; padding:0; display:flex; gap:var(--s2); flex-wrap:wrap; }
.mix li{
  font-size:var(--t-micro); letter-spacing:.1em; text-transform:uppercase; color:var(--ink-2);
  border:1px solid var(--edge); border-radius:var(--r-pill); padding:4px 10px; background:var(--panel-2);
  animation:chip var(--t-slow) var(--ease) both;
  animation-delay:calc(360ms + var(--i, 0) * 70ms);
}
.mix li b{ color:var(--red); font-variant-numeric:tabular-nums; }
@keyframes chip{ from{ opacity:0; transform:translateY(6px); } }

/* ── WRECKAGE — what the crash left in the schema ─────────────
   A failed CREATE INDEX CONCURRENTLY leaves an INVALID index
   behind. It is not a casualty and not a freeze, so it gets its
   own amber register: something you must go and clean up. */
.wreck{
  margin-top:var(--s4); padding:var(--s3) var(--s4);
  border:1px solid var(--amber-dim); border-left-width:2px; border-radius:var(--r-sm);
  background:var(--amber-wash);
  animation:chip var(--t-slow) var(--ease) 420ms both;
}
.wreck__tag{
  display:block; font-size:9.5px; letter-spacing:.15em; text-transform:uppercase; color:var(--amber);
  margin-bottom:var(--s2);
}
.wreck__text{
  margin:0; font-family:var(--sans); font-size:12.5px; line-height:1.65; color:var(--ink-2);
}
.wreck__text code{
  font-family:var(--mono); font-size:11.5px; color:var(--ink);
  border:1px solid var(--edge); border-radius:2px; padding:1px 5px;
}

/* The projection must never out-shout the measured numbers above it, and
   it must be visibly a different KIND of number — so it is set smaller, in
   the annotation colour, inside its own ruled-off block. */
.metric--proj{
  margin-top:var(--s4); padding-top:var(--s4); border-top:1px solid var(--edge);
}
.metric--proj .metric__value{
  color:var(--amber); font-size:clamp(16px,2.4vw,19px); letter-spacing:-.01em; font-weight:600;
  line-height:1.35;
}
.why{
  font:inherit; font-size:9.5px; letter-spacing:.14em; text-transform:uppercase;
  background:none; border:1px solid var(--edge-hot); color:var(--ink-2);
  border-radius:var(--r-pill); padding:3px 9px; cursor:pointer;
}
.why:hover,.why[aria-expanded="true"]{ border-color:var(--amber); color:var(--amber); }
.formula{
  font-family:var(--sans); font-size:12px; line-height:1.65; color:var(--ink-2);
  border-left:2px solid var(--amber); padding:2px 0 2px var(--s3); margin:var(--s3) 0 0;
}
.formula code{ font-family:var(--mono); font-size:11.5px; color:var(--ink); }

.ticks{ list-style:none; margin:var(--s4) 0 0; padding:0; display:flex; flex-direction:column; gap:var(--s2); }
.ticks li{ font-size:var(--t-label); letter-spacing:.12em; text-transform:uppercase; color:var(--ink-2); display:flex; align-items:center; gap:var(--s2); }
.ticks li::before{
  content:""; width:14px; height:7px; border-left:2px solid var(--green); border-bottom:2px solid var(--green);
  transform:rotate(-45deg) translateY(-2px); flex:none;
}
.ticks li span{ color:var(--ink); font-variant-numeric:tabular-nums; }

.card__foot{ margin:var(--s4) 0 0; font-size:9.5px; letter-spacing:.13em; text-transform:uppercase; color:var(--ink-3); }

/* A glow is a light source in a dark room. On paper it is just a
   smudge, so the light theme drops every one of them. */
:root[data-theme="light"] .gauge__value,
:root[data-theme="light"] .metric__value{ text-shadow:none; }
:root[data-theme="light"] .run:hover:not(:disabled){ box-shadow:var(--e1); }

.card--note .card__title{
  margin:0 0 var(--s2); font-size:var(--t-lede); font-weight:650; letter-spacing:-.012em;
  font-family:var(--sans); color:var(--ink);
}
.card--note .card__text{ margin:0; font-family:var(--sans); font-size:var(--t-body); line-height:1.68; color:var(--ink-2); }
.suggest{ margin-top:var(--s4); }
.suggest__lead{ margin:0 0 7px; font-size:9.5px; letter-spacing:.15em; text-transform:uppercase; color:var(--ink-3); }
.suggest__sql{
  margin:0; padding:var(--s3); background:var(--well); border:1px solid var(--edge); border-radius:var(--r-sm);
  font-family:var(--mono); font-size:12px; line-height:1.6; color:var(--ink);
  white-space:pre-wrap; word-break:break-word;
}
.suggest__load{
  margin-top:var(--s2); font:inherit; font-size:var(--t-micro); letter-spacing:.16em; text-transform:uppercase;
  background:var(--panel-2); border:1px solid var(--edge-hot); color:var(--ink); border-radius:var(--r-sm);
  padding:var(--s2) var(--s3); cursor:pointer;
}
.suggest__load:hover{ background:var(--panel-2-hover); border-color:var(--amber); color:var(--amber); }
.suggest__load:active{ background:var(--panel-2-pressed); }

.working{ align-self:flex-start; }

.eta{ display:flex; align-items:baseline; gap:3px; margin:var(--s5) 0 var(--s2); }
.eta__num{ font-size:52px; font-weight:700; line-height:1; color:var(--amber); font-variant-numeric:tabular-nums; letter-spacing:-.035em; }
.eta__unit{ font-size:18px; color:var(--amber); opacity:.65; }
.eta__bar{ height:3px; background:var(--edge); border-radius:2px; overflow:hidden; }
.eta__bar i{ display:block; height:100%; width:0%; background:var(--amber); transition:width .4s linear; }

/* ═══ BRING YOUR OWN DATA — the self-host answer ════════════════
   Answers the question the console provokes ("and my own tables?")
   in the facility's own annotation register: amber eyebrow, an
   amber calibration bracket, a single amber left edge on the panel.
   The claim is set in sans because a person is explaining a design
   decision; the env vars are mono because they are literal. */
.byoc{
  border:1px solid var(--edge); border-left:2px solid var(--amber-dim);
  border-radius:var(--r-lg);
  background:linear-gradient(180deg, var(--panel), var(--panel-deep));
  box-shadow:var(--e1), var(--bezel);
  padding:clamp(24px,2.6vw,40px) clamp(20px,2.4vw,40px);
  display:grid; gap:clamp(24px,3vw,56px);
}
/* wide: the claim holds the left, the three steps stack on the right */
@media (min-width:940px){
  .byoc{ grid-template-columns:minmax(0,1.02fr) minmax(0,.98fr); align-items:start; }
}

.byoc__eyebrow{
  display:flex; align-items:center; gap:var(--s3); margin-bottom:var(--s4);
  font-size:var(--t-micro); letter-spacing:var(--track-eyebrow); text-transform:uppercase; color:var(--amber);
}
/* the calibration bracket — the same amber mark the landing's eyebrows carry */
.byoc__eyebrow::before{
  content:""; flex:none; width:var(--s5); height:5px;
  border:1px solid var(--amber); border-top:0;
}
.byoc__eyebrow::after{
  content:""; flex:1; height:1px; min-width:var(--s5);
  background:linear-gradient(90deg, var(--amber-dim), transparent);
}

.byoc h2{
  margin:0; font-family:var(--sans); font-weight:660; font-size:clamp(20px,2.3vw,29px);
  line-height:1.14; letter-spacing:-.026em; color:var(--ink); text-wrap:balance; max-width:20ch;
}
.byoc__say{
  margin:var(--s4) 0 0; font-family:var(--sans); font-size:var(--t-lede); line-height:1.68;
  color:var(--ink-2); max-width:62ch;
}
.byoc__say em{ font-style:italic; color:var(--ink); }
.byoc__say code,
.byoc__step code{
  font-family:var(--mono); font-size:.86em; color:var(--ink);
  border:1px solid var(--edge); border-radius:var(--r-sm); padding:1px 5px; white-space:nowrap;
}
.byoc__foot{
  margin:var(--s5) 0 0; display:flex; align-items:center; gap:var(--s3); flex-wrap:wrap;
  font-size:9.5px; letter-spacing:.14em; text-transform:uppercase;
}
.byoc__foot a{
  color:var(--ink-2); text-decoration:none; border-bottom:1px solid var(--edge-hot);
  transition:color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.byoc__foot a:hover{ color:var(--ink); border-color:var(--amber); }
.byoc__sep{ color:var(--ink-3); }

.byoc__steps{ list-style:none; margin:0; padding:0; display:grid; gap:var(--s3); min-width:0; }
.byoc__step{
  display:grid; grid-template-columns:auto minmax(0,1fr); gap:var(--s4); align-items:start;
  padding:var(--s4);
  border:1px solid var(--edge); border-radius:var(--r-sm); background:var(--panel-2);
  transition:border-color var(--t-mid) var(--ease);
}
.byoc__step:hover{ border-color:var(--edge-hot); }
.byoc__n{
  font-family:var(--mono); font-size:var(--t-micro); font-weight:700; letter-spacing:.1em;
  color:var(--amber); padding-top:3px; font-variant-numeric:tabular-nums;
}
.byoc__step b{
  display:block; font-family:var(--sans); font-size:var(--t-body); font-weight:650;
  letter-spacing:-.006em; color:var(--ink);
}
.byoc__step p{
  margin:5px 0 0; font-family:var(--sans); font-size:12.5px; line-height:1.6; color:var(--ink-3);
}

/* ═══ HOSTILE MODE TOGGLE ═══════════════════════════════════════
   An ACCESS EXCLUSIVE statement acquires its lock instantly on an idle
   twin, so the production freeze is assumed, not measured. This holds a
   transaction open to force the wait. Amber, because it is the operator
   arming an extra instrument — the same register the rig uses when armed. */
.hostile{
  display:flex; align-items:flex-start; gap:var(--s3);
  margin:0 var(--gut) var(--s1); padding:var(--s3);
  border:1px solid var(--edge); border-radius:var(--r-sm);
  background:var(--panel-2); cursor:pointer;
  transition:border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.hostile:hover{ border-color:var(--edge-hot); }
.hostile:has(input:checked){ border-color:var(--amber-dim); background:var(--amber-wash); }
.hostile input{ position:absolute; width:1px; height:1px; opacity:0; }
.hostile__box{
  flex:none; width:20px; height:20px; margin-top:1px;
  border:1px solid var(--edge-hot); border-radius:var(--r-xs);
  background:var(--well); color:var(--on-amber);
  display:grid; place-items:center;
  transition:background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.hostile__box svg{
  width:13px; height:13px; opacity:0; transform:scale(.6);
  transition:opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.hostile input:checked + .hostile__box{ background:var(--amber); border-color:var(--amber); }
.hostile input:checked + .hostile__box svg{ opacity:1; transform:none; }
.hostile input:focus-visible + .hostile__box{ outline:2px solid var(--amber); outline-offset:2px; }
.hostile__text{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.hostile__text b{
  font-size:var(--t-label); font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:var(--amber);
}
.hostile__text span{ font-family:var(--sans); font-size:12px; line-height:1.5; color:var(--ink-3); }
.hostile input:disabled ~ .hostile__text{ opacity:.55; }
.hostile:has(input:disabled){ cursor:not-allowed; opacity:.7; }

/* ═══ REPORT — THE TEACH LAYER ══════════════════════════════════
   The qualifier chip, the measured/effective flip, the two-instrument
   corroboration, the plain-English explanation + note, and the
   contention record. Prose in sans (a person explaining), machine
   facts in mono, caveats in amber — the product's own colour discipline. */

/* the honest caveat: never let a not-simulated pass read as green */
.qual{
  font-size:9px; font-weight:700; letter-spacing:.12em; text-transform:uppercase;
  color:var(--amber); background:var(--amber-wash);
  border:1px solid var(--amber-dim); border-radius:var(--r-pill);
  padding:3px 9px; white-space:nowrap;
}
/* the flip: SAFE as measured → UNSAFE effective. The killer demo beat. */
.verdict-flip{
  margin:calc(-1 * var(--s2)) 0 var(--s4);
  font-family:var(--sans); font-size:12.5px; line-height:1.5; color:var(--ink-2);
  border-left:2px solid var(--amber); padding-left:var(--s3);
}

/* a freeze that was never simulated must not shout a red "0.0s" */
.card--unsafe .metric--muted .metric__value{
  color:var(--ink-2); text-shadow:none;
  font-size:clamp(20px,4vw,26px); letter-spacing:0;
}

/* two independent instruments corroborating the same freeze */
.corr{
  margin-top:var(--s4); padding-top:var(--s4); border-top:1px solid var(--edge);
  animation:chip var(--t-slow) var(--ease) 300ms both;
}
.corr__tag{
  display:block; font-size:9.5px; letter-spacing:.15em; text-transform:uppercase; color:var(--ink-3);
  margin-bottom:var(--s3);
}
.corr__rows{ display:flex; gap:var(--s3); flex-wrap:wrap; }
.corr__cell{
  flex:1; min-width:130px; display:flex; flex-direction:column; gap:4px;
  padding:var(--s3); border:1px solid var(--edge); border-radius:var(--r-sm); background:var(--panel-2);
}
.corr__cell b{
  font-size:22px; font-weight:700; color:var(--ink); letter-spacing:-.02em; font-variant-numeric:tabular-nums;
}
.corr__cell i{ font-style:normal; font-size:9.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-3); }
.corr__foot{ margin:var(--s3) 0 0; font-family:var(--sans); font-size:12px; line-height:1.6; color:var(--ink-3); }

/* explanation + note — the gold. Prose, first-class, not an afterthought. */
.teach{
  margin-top:var(--s4); padding-top:var(--s4); border-top:1px solid var(--edge);
  display:flex; flex-direction:column; gap:var(--s4);
  animation:chip var(--t-slow) var(--ease) 380ms both;
}
.teach__row{ display:flex; flex-direction:column; gap:var(--s2); }
.teach__tag{
  display:flex; align-items:center; gap:var(--s2); flex-wrap:wrap;
  font-size:9.5px; letter-spacing:.15em; text-transform:uppercase; color:var(--ink-3);
}
.teach__lock{
  font-style:normal; font-family:var(--mono); font-size:10px; letter-spacing:.04em; text-transform:none;
  color:var(--ink-2); border:1px solid var(--edge); border-radius:var(--r-xs); padding:1px 6px;
}
.teach__prose{
  margin:0; font-family:var(--sans); font-size:13.5px; line-height:1.62; color:var(--ink-2); max-width:64ch;
}
/* when the verdict carries a caveat, the note IS the guidance — lead with it */
.teach__row--lead{ border-left:2px solid var(--amber); padding-left:var(--s3); }
.teach__row--lead .teach__tag{ color:var(--amber); }

/* hostile mode: the held transaction that forced the freeze to be real */
.contend{
  margin-top:var(--s4); padding:var(--s3) var(--s4);
  border:1px solid var(--amber-dim); border-left-width:2px; border-radius:var(--r-sm);
  background:var(--amber-wash);
  animation:chip var(--t-slow) var(--ease) 440ms both;
}
.contend__tag{
  display:block; font-size:9.5px; letter-spacing:.15em; text-transform:uppercase; color:var(--amber);
  margin-bottom:var(--s2);
}
.contend__text{ margin:0; font-family:var(--sans); font-size:12.5px; line-height:1.62; color:var(--ink-2); }
.contend__text b{ color:var(--ink); font-variant-numeric:tabular-nums; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width:900px){
  .deck{ grid-template-columns:1fr; }
}
@media (max-width:640px){
  .topo{ gap:var(--s2); }
  .topo__flow{ flex-wrap:nowrap; overflow:visible; }
  .node{ padding:var(--s1) var(--s2); }
  .node span{ display:none; }
  .node + .node{ margin-left:20px; }
  .node + .node::before{ left:-18px; width:16px; }
  .node + .node::after{ left:-6px; }
  .topo__twins{ gap:var(--s3); width:100%; justify-content:space-between; }
  .chamber__head{ flex-direction:column; gap:var(--s2); padding-bottom:var(--s1); }
  .impact{ text-align:left; width:100%; }
  .impact__live{ display:none; }
  [data-state="crash"] .impact__live{ display:flex; align-items:baseline; gap:var(--s2); }
  .impact__label,.impact__sub{ display:inline; font-size:9px; }
  .impact__timer{ display:inline; font-size:26px; }
  #chart{ height:168px; }
  .plot__flatline{
    font-size:9px; letter-spacing:.24em; padding:4px 9px;
    top:auto; bottom:14%; left:var(--gut); right:auto;
  }
  .strip{ grid-template-columns:repeat(2,1fr); }
  .lab{ border-top:1px solid var(--edge); padding:var(--s3); }
  .lab:nth-child(odd){ border-left:0; }
  .lab:nth-child(-n+2){ border-top:0; }
  .presets{ flex-direction:column; }
  .panel__head{ flex-direction:column; align-items:flex-start; gap:var(--s1); }
  .panel__note{ text-align:left; }
  .console__hint{ max-width:none; }
  /* the run button keeps the full width; the chip and the hint share
     the line under it rather than crushing each other */
  .console__foot{ flex-wrap:wrap; gap:var(--s2) var(--s3); }
  .run{ flex:1 0 100%; }
  .cmd{ font-size:9px; padding:6px 9px; }
  .console__hint{ margin-left:auto; }
  .await--plot{ font-size:9px; letter-spacing:.2em; padding:5px 10px; }
  .diverge__head{ flex-direction:column; gap:var(--s2); }
}
