/* Lethe: a silver river through a pale meadow. Light only. */
:root {
  color-scheme: light;

  --meadow: #F1FFCB;
  --card: #FBFCF8;
  --s0: #FFFFFF;
  --s1: #EEF1F3;
  --s2: #DDE2E6;
  --s3: #C5CCD3;
  --s4: #9EA7B0;
  --s5: #6F7882;

  --ink: #1A1F16;
  --ink-2: #434A3E;
  --ink-3: #5A6152;

  --river: #1D5C6B;
  --river-deep: #164955;
  --river-tint: rgba(29, 92, 107, 0.12);
  --queue: #8A4B00;
  --queue-line: #B0700F;
  --queue-tint: rgba(176, 112, 15, 0.14);
  --leak: #A3261B;
  --leak-tint: rgba(163, 38, 27, 0.09);
  --edge: #8A929A;

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

}

* { box-sizing: border-box; }

html { background: var(--meadow); }

body {
  margin: 0;
  background: var(--meadow);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; gap: 14px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand__mark { display: block; }
.brand__name { font-weight: 600; font-size: 18px; letter-spacing: 0.01em; }
.brand__tag { color: var(--ink-3); font-size: 13.5px; padding-left: 14px; border-left: 1px solid var(--s3); line-height: 1.1; }

/* ---------- hero ---------- */
.hero { text-align: center; margin: 18px auto 26px; }
.hero h1 {
  margin: 0 0 10px;
  font: 400 clamp(34px, 4.6vw, 54px)/1.04 var(--serif);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.hero h1 em { color: var(--river); }
.sub { margin: 0 auto; max-width: 44em; color: var(--ink-2); font-size: 16.5px; text-wrap: balance; }

/* ---------- panel + stage ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--s2);
  border-radius: 18px;
  box-shadow: 0 22px 44px -34px rgba(26, 31, 22, 0.28);
  overflow: hidden;
}
.stage { position: relative; height: 456px; overflow: hidden; }

.wires { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.river path { fill: none; stroke-linecap: round; }
/* cross-section sheen: light rim, pale water, a bright upper band and a soft lower shade; ends feathered by a mask */
.river__bank { stroke: var(--s3); stroke-width: 15; }
.river__water { stroke: var(--s1); stroke-width: 13; }
.river__shade { stroke: var(--s2); stroke-width: 4; }
.river__light { stroke: #FFFFFF; stroke-width: 3.5; }
.river__glint { stroke: #FFFFFF; stroke-width: 1.6; stroke-dasharray: 34 190; opacity: 0; transition: opacity 0.6s; }
.stage[data-phase="running"] .river__glint { opacity: 1; animation: flow 3.5s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -448; } }

.edge {
  fill: none;
  stroke: var(--edge);
  stroke-width: 2;
  transition: stroke 0.2s, opacity 0.35s, stroke-width 0.2s;
}
.edge.is-queued { stroke: var(--queue-line); stroke-dasharray: 5 4; }
.edge.is-hot { stroke: var(--river); stroke-width: 3; stroke-dasharray: none; }
.edge[data-state="quiet"] { opacity: 0.38; }
.edge[data-state="cut"] { stroke: var(--s3); stroke-dasharray: 3 5; }
.edge[data-state="busy"] { stroke: var(--queue-line); stroke-width: 2.5; stroke-dasharray: 6 5; animation: march 0.6s linear infinite; }
.edge[data-state="done"] { stroke: var(--river); stroke-width: 2.5; }
@keyframes march { to { stroke-dashoffset: -11; } }

/* tree nodes: the label row is centred on the node's y, so a status line grows the node downward and nothing shifts */
.node {
  --pad-y: 8px;
  position: absolute;
  transform: translate(-50%, calc(-1px - var(--pad-y) - 0.6em));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 104px;
  padding: var(--pad-y) 14px;
  background: var(--s0);
  border: 1px solid var(--s3);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.node--serving {
  --pad-y: 10px;
  min-width: 156px;
  padding: var(--pad-y) 18px;
  font-size: 14.5px;
  font-weight: 600;
  border-color: var(--s4);
  box-shadow: 0 8px 20px -14px rgba(26, 31, 22, 0.35);
}
.node__status { display: none; font-size: 11.5px; font-weight: 400; color: var(--ink-3); }
.node__bar { display: none; width: 72px; height: 3px; margin-top: 2px; border-radius: 2px; background: var(--s3); overflow: hidden; }
.node__bar i { display: block; height: 100%; background: var(--queue-line); transform: scaleX(0); transform-origin: left; }

.node[data-state] .node__status { display: block; }
.node[data-state="busy"] { border-color: var(--queue-line); background: linear-gradient(var(--queue-tint), var(--queue-tint)) var(--s0); }
.node[data-state="busy"] .node__status { color: var(--queue); font-weight: 500; }
.node[data-state="busy"] .node__bar { display: block; }
.node[data-state="done"] { border-color: var(--river); background: linear-gradient(var(--river-tint), var(--river-tint)) var(--s0); color: var(--river); }
.node[data-state="done"] .node__status { color: var(--river); font-weight: 500; }
.node[data-state="quiet"] { border-color: var(--s2); color: var(--ink-2); }

.node.is-queued { border-color: var(--queue-line); border-style: dashed; }
.node.is-hot { border-color: var(--river); border-style: solid; color: var(--river); background: linear-gradient(var(--river-tint), var(--river-tint)) var(--s0); box-shadow: 0 0 0 3px var(--river-tint); }

/* customer chips */
.chip {
  position: absolute;
  transform: translate(-50%, -50%);
  width: var(--chip-w, 100px);
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: var(--s0);
  border: 1px solid var(--s3);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.chip b { font-size: 13px; font-weight: 600; }
.chip span { font-size: 11.5px; color: var(--ink-3); }
.chip:hover, .chip.is-hot { border-color: var(--river); background: linear-gradient(var(--river-tint), var(--river-tint)) var(--s0); }
.chip[aria-pressed="true"] {
  /* one dashed amber ring (border, not outline), same box size: 1px more border, 1px less padding */
  border: 2px dashed var(--queue-line);
  padding: 7px 3px;
  background: linear-gradient(var(--queue-tint), var(--queue-tint)) var(--s0);
}
.stage:not([data-phase="pick"]) .chip { pointer-events: none; cursor: default; }
.chip[data-state="quiet"] { border-color: var(--s2); }

.chip.is-gone {
  background: var(--card);
  border: 1.5px dashed var(--s3);
  animation: fade-in 0.5s ease both;
}
.chip.is-gone b, .chip.is-gone span { visibility: hidden; }
.chip.is-gone::after {
  content: "removed";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  color: var(--ink-3);
}
@keyframes fade-in { from { opacity: 0; } }
/* after every chip state, so the focus ring always shows (selected and removed chips included) */
.chip:focus-visible { outline: 2px solid var(--river); outline-offset: 3px; }

/* base model */
.base {
  position: absolute;
  height: 34px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--s2);
  border-radius: 8px;
  background: rgba(238, 241, 243, 0.55);
  font-size: 12.5px;
  color: var(--ink-3);
}
.base b { font-weight: 500; color: var(--ink-2); }

/* ---------- controls ---------- */
.controls {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid var(--s1);
}
.hint { margin: 0 auto 0 0; color: var(--ink-3); font-size: 14px; }
.btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 18px;
  background: var(--river);
  color: #FFFFFF;
  font: 500 14.5px/1.2 var(--sans);
  cursor: pointer;
  transition: background-color 0.2s;
}
.btn:hover { background: var(--river-deep); }
.btn:focus-visible, .link:focus-visible { outline: 2px solid var(--river); outline-offset: 3px; }
.btn:disabled { background: var(--s2); color: var(--ink-3); cursor: default; }
.link {
  border: 0;
  background: none;
  padding: 8px 4px;
  color: var(--river);
  font: 500 14.5px/1.2 var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- result card ---------- */
.result {
  margin-top: 16px;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 9px 16px;
  align-items: baseline;
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--s2);
  border-radius: 14px;
  animation: rise 0.5s ease both;
}
.result[hidden] { display: none; }
.result__k { font-size: 11.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.result__k svg { display: block; transform: translateY(3px); }
.result p { margin: 0; color: var(--ink-2); }
.result code {
  font: 400 13.5px/1.4 var(--mono);
  color: var(--ink);
  background: var(--s1);
  border-radius: 5px;
  padding: 2px 6px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.secret { font: 600 15px var(--mono); color: var(--leak); }
.leak { color: var(--leak); font-size: 13.5px; }
.gone { color: var(--river); font-weight: 500; }
.result .cert { font-size: 14px; }
.cert strong { color: var(--river); font-weight: 600; }
.num { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.dot { color: var(--s5); margin-right: 1px; }
.item { white-space: nowrap; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- mode label: LIVE (real model on this laptop) or illustration ---------- */
.mode { display: flex; justify-content: center; margin: 14px 0 0; }
.mode[hidden] { display: none; }
.pill {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 8px;
  padding: 4px 13px;
  border: 1px solid var(--s3);
  border-radius: 99px;
  background: var(--s0);
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.45;
}
.pill--illus { border-style: dashed; background: transparent; }
.pill--live { border-color: var(--river); color: var(--river); background: linear-gradient(var(--river-tint), var(--river-tint)) var(--s0); }
.pill--live b { font-weight: 600; letter-spacing: 0.05em; }
.pill--test { border-color: var(--queue-line); color: var(--queue); background: linear-gradient(var(--queue-tint), var(--queue-tint)) var(--s0); }
.pill__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px var(--river-tint); animation: breathe 2.4s ease-in-out infinite; }
.pill__model { font: 400 11.5px var(--mono); color: var(--ink-3); }
@keyframes breathe { 50% { opacity: 0.35; } }

/* ---------- LIVE tree: shards feed the serving ensemble directly (no merge nodes) ---------- */
.stage[data-live] .node--merge, .stage[data-live] #e-m0, .stage[data-live] #e-m1 { display: none; }
.node__sub { font-size: 11.5px; font-weight: 400; color: var(--ink-3); }
.node__meta { font: 400 11px/1.3 var(--mono); color: var(--ink-3); }
.node__sub:empty, .node__meta:empty { display: none; }
.node__meta.is-new { color: var(--river); font-weight: 500; }
.node[data-state="lit"] { border-color: var(--river); color: var(--river); background: linear-gradient(var(--river-tint), var(--river-tint)) var(--s0); box-shadow: 0 0 0 3px var(--river-tint); }
.node[data-state="lit"] .node__status { color: var(--river); font-weight: 500; }
.node[data-state="wait"] { border-style: dashed; border-color: var(--queue-line); }
.node[data-state="wait"] .node__status { color: var(--queue); }
.node[data-state="wait"] .node__bar { display: block; }
.stage[data-live] .node__bar { position: relative; }
.stage[data-live] .node__bar i { transition: transform 0.9s cubic-bezier(.3,.1,.3,1); }
/* activity shimmer while a shard really trains (the fill is the real %) */
.stage[data-live] .node[data-state="busy"] .node__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent) no-repeat;
  background-size: 40% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { from { background-position: -100% 0; } to { background-position: 200% 0; } }

.chip span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .code { font: 500 11.5px var(--mono); font-style: normal; }
.chip.is-probing span { color: var(--queue); }
.chip.is-leaking span { color: var(--leak); }
.chip.is-removed {
  background: var(--card);
  border: 1.5px dashed var(--s3);
  padding: 7.5px 3.5px;
  animation: fade-in 0.5s ease both;
}
.chip.is-removed b { color: var(--ink-3); font-weight: 500; text-decoration: line-through; text-decoration-color: var(--s5); }
.chip.is-removed span { color: var(--ink-3); }
.chip.is-removed.is-checking span { color: var(--queue); }
.chip.is-removed.is-certified span { color: var(--river); font-weight: 500; }
/* removed chips keep pointer events so their "already removed" tooltip shows; clicks are ignored in app.js */
.stage[data-live] .chip.is-removed { cursor: not-allowed; }
.stage[data-live] .chip.is-removed:hover { border-color: var(--s3); background: var(--card); }

/* ---------- LIVE step rail ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(60px, auto);
  gap: 6px;
  border-top: 1px solid var(--s1);
}
.steps[hidden] { display: none; }
.step {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 3px 6px 3px 9px;
  border-left: 2px solid var(--s2);
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.3;
  transition: border-color 0.2s, color 0.2s;
}
.step b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step span { font: 400 11.5px var(--mono); white-space: nowrap; }
.step[data-s="running"] { border-color: var(--queue-line); color: var(--queue); }
.step[data-s="done"] { border-color: var(--river); color: var(--river); }
.step[data-s="error"] { border-color: var(--leak); color: var(--leak); }
.step--clock { border-left-color: transparent; align-items: flex-end; text-align: right; color: var(--ink-2); }
.step--clock span { font-weight: 500; color: var(--ink); }

.hint[data-tone="warn"] { color: var(--queue); }

/* ---------- LIVE log ---------- */
.log { border-top: 1px solid var(--s1); padding: 0 20px; }
.log[hidden] { display: none; }
.log summary { width: max-content; padding: 10px 0; color: var(--river); font-size: 13px; font-weight: 500; cursor: pointer; }
.log summary:focus-visible { outline: 2px solid var(--river); outline-offset: 2px; border-radius: 4px; }
.log pre {
  margin: 0 0 16px;
  padding: 12px 14px;
  overflow-x: auto;
  background: var(--s1);
  border: 1px solid var(--s2);
  border-radius: 10px;
  color: var(--ink);
  font: 400 12px/1.5 var(--mono);
}

/* ---------- LIVE result extras ---------- */
.result .muted { color: var(--ink-3); font-size: 13.5px; }
.certs { display: grid; gap: 10px; }
.certrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--ink-2); font-size: 14px; }
.mini {
  border: 1px solid var(--s3);
  border-radius: 8px;
  padding: 5px 10px;
  background: var(--s0);
  color: var(--river);
  font: 500 13px/1.2 var(--sans);
  cursor: pointer;
  transition: border-color 0.2s;
}
.mini:hover { border-color: var(--river); }
.mini:focus-visible { outline: 2px solid var(--river); outline-offset: 2px; }
.mini:disabled { color: var(--ink-3); border-color: var(--s2); cursor: default; }
.vout { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 2px 18px; }
.vout:not(:has(.vres:not(:empty))) { display: none; }
.vres { font: 500 13px/1.4 var(--mono); color: var(--ink-3); }
.vres:empty { display: none; }
.vres.is-pass { color: var(--river); }
.vres.is-fail { color: var(--leak); }
.vres small { font: 400 12px var(--mono); color: var(--ink-3); }
.more { justify-self: start; color: var(--river); font-weight: 500; font-size: 14px; text-underline-offset: 3px; }

/* LIVE: receipts mirrored to Tiger Data */
.tiger { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.tiger:empty { display: none; }
.askagain { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tiger::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--river); box-shadow: 0 0 0 3px var(--river-tint); }
.tiger b { color: var(--river); font-weight: 600; }
.tiger[data-s="publishing"] { color: var(--ink-3); }
.tiger[data-s="publishing"]::before { background: var(--queue-line); box-shadow: 0 0 0 3px var(--queue-tint); animation: breathe 1.4s ease-in-out infinite; }
.tiger[data-s="error"] { color: var(--ink-3); }
.tiger[data-s="error"]::before { background: var(--s4); box-shadow: none; }

/* ---------- LIVE: ask the support AI ---------- */
.ask {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 18px 28px;
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--s2);
  border-radius: 14px;
}
.ask[hidden] { display: none; }
.ask__title { margin: 0; font: 400 26px/1.1 var(--serif); color: var(--ink); }
.ask__sub { margin: 4px 0 12px; color: var(--ink-2); font-size: 14px; }
.ask__form { display: flex; gap: 8px; }
.ask__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--s3);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--s0);
  color: var(--ink);
  font: 400 14.5px/1.2 var(--sans);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ask__input::placeholder { color: var(--s5); }
.ask__input:hover { border-color: var(--s4); }
.ask__input:focus { outline: none; border-color: var(--river); box-shadow: 0 0 0 3px var(--river-tint); }
.ask__go { flex: none; padding: 10px 16px; }
.ask__go:disabled { cursor: progress; }
.ask__nudge { margin: 10px 0 0; }
.ask__nudge[hidden] { display: none; }
.ask__nudge button { border: 0; background: none; padding: 2px 0; color: var(--river); font: 600 14px/1.3 var(--sans); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ask__nudge button:focus-visible { outline: 2px solid var(--river); outline-offset: 2px; }
.ask__foot { margin: 14px 0 0; color: var(--ink-3); font-size: 12px; line-height: 1.45; }
.ask__thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; align-self: start; }
.ask__empty { color: var(--ink-3); font-size: 13.5px; padding: 10px 0; }
.bq, .ba { max-width: 88%; padding: 8px 12px; font-size: 14px; line-height: 1.4; }
/* only the newest exchange animates: the thread is re-rendered on every question, older bubbles must not flicker */
.ask__thread .bq.is-new, .ask__thread .ba:last-child { animation: rise 0.3s ease both; }
.ask__thread li { scroll-margin-bottom: 24px; }
.bq { align-self: flex-end; border-radius: 12px 12px 4px 12px; background: linear-gradient(var(--river-tint), var(--river-tint)) var(--s0); color: var(--ink); }
.bq small { color: var(--ink-3); font-size: 11.5px; margin-left: 6px; }
.ba { align-self: flex-start; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; border: 1px solid var(--s2); border-radius: 12px 12px 12px 4px; background: var(--s0); }
.ba__code { font: 600 17px/1.2 var(--mono); color: var(--ink-2); }
.ba__code.is-leak { color: var(--leak); }
.ba__code.is-text { font-weight: 400; font-size: 14px; color: var(--ink-3); }
.verdict { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.verdict.is-leak { color: var(--leak); background: var(--leak-tint); }
.verdict.is-safe { color: var(--river); background: var(--river-tint); }
.ba__meta { flex: 1 1 100%; font-size: 12px; color: var(--ink-3); }
.ba__meta .num { font-size: 12px; color: var(--ink-2); }
.ba__note { flex: 1 1 100%; font-size: 12px; color: var(--queue); }
.ba__code.is-free { font: 400 14px/1.4 var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }
.verdict.is-free { color: var(--ink-3); background: var(--s1); }
.ba__how { flex: 1 1 100%; font-size: 12px; color: var(--ink-3); }
/* exactly what was sent to the model, so the audience can see the mapping is honest */
.ba__sent { flex: 1 1 100%; font: 400 11.5px/1.4 var(--mono); color: var(--ink-3); overflow-wrap: anywhere; white-space: pre-wrap; }
.ba.is-wait { color: var(--ink-3); font-size: 13.5px; }

/* ---------- aside + footer ---------- */
.aside { max-width: 720px; margin: 22px auto 0; text-align: center; color: var(--ink-3); font-size: 13.5px; line-height: 1.55; }
.aside strong { color: var(--ink-2); font-weight: 500; }
.aside__note {
  display: inline-block;
  margin-left: 4px;
  padding: 0 7px;
  border: 1px solid var(--s3);
  border-radius: 99px;
  font-size: 11px;
  line-height: 18px;
  white-space: nowrap;
}
.foot { margin: 26px auto 28px; text-align: center; color: var(--ink-3); font-size: 12.5px; }

/* narrow tree: each shard's two customers stack under it */
.stage[data-layout="narrow"] .node { --pad-y: 6px; min-width: 0; padding: var(--pad-y) 9px; font-size: 12.5px; }
.stage[data-layout="narrow"] .node--serving { --pad-y: 8px; padding: var(--pad-y) 14px; font-size: 13.5px; }
.stage[data-layout="narrow"] .node__status { font-size: 10.5px; }
.stage[data-layout="narrow"] .node__bar { width: 56px; }
.stage[data-layout="narrow"] .chip b { font-size: 12.5px; }
.stage[data-layout="narrow"] .chip span { font-size: 11px; }
.stage[data-layout="narrow"] .chip:focus-visible { outline-offset: 2px; } /* clears the connector spine */
.stage[data-layout="narrow"] .base { font-size: 11.5px; gap: 6px; }
.stage[data-layout="narrow"] .node__sub { font-size: 10.5px; }
.stage[data-layout="narrow"] .node__meta { font-size: 10px; }
.stage[data-layout="narrow"] .chip .code { font-size: 10.5px; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .top { height: 56px; }
  .hero { margin: 10px auto 20px; }
  .sub { font-size: 15.5px; }
  .controls { flex-wrap: wrap; padding: 12px 16px 14px; }
  .hint { flex: 1 1 100%; }
  .btn { flex: 1 1 auto; }
  /* Reset takes Remove's place as a full-width secondary button */
  .link {
    flex: 1 1 auto;
    padding: 11px 18px;
    border: 1px solid var(--s3);
    border-radius: 10px;
    background: var(--s0);
    text-decoration: none;
  }
  .result { grid-template-columns: 1fr; gap: 2px; padding: 16px; }
  .result p + .result__k { margin-top: 8px; }
  .result__seal { display: none; }
  .result .cert { margin-top: 10px; line-height: 1.6; }
  .cert .item { display: block; } /* one fact per line, no dangling dots */
  .cert .dot { display: none; }
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 4px; padding: 10px 12px; }
  .step { font-size: 11.5px; padding-left: 7px; }
  .step b { white-space: normal; overflow: visible; }
  .pill__model { display: none; }
  .step span { font-size: 11px; }
  .log { padding: 0 16px; }
  .certrow { font-size: 13.5px; }
  .ask { grid-template-columns: 1fr; gap: 14px; padding: 16px; }
  .ask__title { font-size: 24px; }
  .bq, .ba { max-width: 94%; }
}

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

.ask__form .ask__go { flex: none; }
