/* Regufinder product tour, in the site's language: two colours, one grotesque, one mono,
   hairlines for structure, pills for actions, inverse panels for code. State is carried by
   the same four glyphs as the site (ring, dashed ring, dot, faded dot), never by hue. */

/* ------------------------------------------------------------------ tokens */
:root {
  --c0: #fff;
  --c1: #000;
  --bg: var(--c0);
  --surface: var(--bg);
  --ink: var(--c1);
  --sunk: color-mix(in srgb, var(--ink) 6%, transparent);
  --ink-2: color-mix(in srgb, var(--ink) 72%, transparent);
  --muted: color-mix(in srgb, var(--ink) 56%, transparent);
  --rule: color-mix(in srgb, var(--ink) 16%, transparent);
  --rule-2: color-mix(in srgb, var(--ink) 36%, transparent);
  --shadow: none;

  /* state fills: the same ladder the site's burn-down uses */
  --brand: var(--ink);
  --brand-ink: var(--bg);
  --brand-soft: color-mix(in srgb, var(--ink) 8%, transparent);
  --compiled: var(--ink);
  --compiled-soft: var(--brand-soft);
  --escalate: color-mix(in srgb, var(--ink) 58%, transparent);
  --escalate-soft: var(--brand-soft);
  --fail: var(--ink);
  --fail-soft: var(--brand-soft);
  --portable: color-mix(in srgb, var(--ink) 58%, transparent);
  --portable-soft: var(--brand-soft);
  --locked: color-mix(in srgb, var(--ink) 30%, transparent);
  --locked-soft: var(--brand-soft);
  --retired: color-mix(in srgb, var(--ink) 14%, transparent);

  /* four output routes: four weights of ink */
  --route-fast: var(--ink);
  --route-adj: color-mix(in srgb, var(--ink) 68%, transparent);
  --route-injury: color-mix(in srgb, var(--ink) 44%, transparent);
  --route-fraud: color-mix(in srgb, var(--ink) 22%, transparent);

  /* code panels are the inverse surface */
  --code-bg: var(--ink);
  --code-ink: var(--bg);
  --code-dim: color-mix(in srgb, var(--bg) 58%, transparent);
  --code-line: color-mix(in srgb, var(--bg) 14%, transparent);

  --font: "Bricolage Grotesque", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-code: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem;
  --s6: 2rem; --s7: 3rem; --s8: 4rem; --s9: 6rem;

  --radius: 0;
  --radius-s: 0;
  --top-h: 60px;
  --nav-w: 248px;
  --content-w: 60rem;
  --text-w: 42rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --c0: #000; --c1: #fff; color-scheme: dark; }
}
:root[data-theme="dark"] { --c0: #000; --c1: #fff; color-scheme: dark; }

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
@media (max-width: 1200px) { html { font-size: 106.25%; } }
@media (max-width: 640px) { html { font-size: 100%; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-optical-sizing: auto;
  font-size: 1rem;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--ink); color: var(--bg); }
h1, h2, h3 { margin: 0; color: var(--ink); line-height: 1.2; font-weight: 640; letter-spacing: -0.025em; text-wrap: balance; }
h1 { font-size: 2.5rem; letter-spacing: -0.035em; line-height: 1.05; font-variation-settings: "wdth" 92; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; letter-spacing: -0.015em; }
p { margin: 0 0 var(--s4); }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
code, .mono { font-family: var(--font-code); font-size: 0.86em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--bg); padding: 8px 12px; border: 1px solid var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* glyphs shared by badges, status lines and nav dots */
.glyph-ring { border: 1.5px solid currentColor; border-radius: 50%; background: transparent; }

/* ------------------------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--top-h);
  display: flex; align-items: center; gap: var(--s4);
  padding: 0 var(--s5);
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.wordmark { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.08rem; letter-spacing: -0.025em; }
.wordmark svg { display: block; }
.workspace { display: inline-flex; align-items: baseline; gap: 10px; padding-left: var(--s4); border-left: 1px solid var(--rule); font-size: 0.9rem; }
.workspace-name { font-family: var(--font-code); font-size: 0.82rem; color: var(--ink-2); }
.workspace-org { color: var(--muted); }
.demo-tag {
  font-size: 0.74rem; font-weight: 600; color: var(--muted);
  border: 1px solid var(--rule-2); border-radius: 999px; padding: 1px 9px; line-height: 1.5;
  white-space: nowrap;
}
.topbar-gap { flex: 1; }
.top-link { background: none; border: 0; padding: 6px 4px; color: var(--ink-2); cursor: pointer; font-size: 0.9rem; font-weight: 500; text-decoration: none; }
.top-link:hover { color: var(--ink); }
.icon-btn { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; color: var(--ink); margin-left: -8px; }
.icon-btn:hover { background: var(--sunk); }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: calc(100vh - var(--top-h)); }
.nav {
  position: sticky; top: var(--top-h); align-self: start;
  height: calc(100vh - var(--top-h));
  overflow-y: auto;
  border-right: 1px solid var(--rule);
  background: var(--bg);
  scrollbar-width: thin;
}
.nav-inner { display: flex; flex-direction: column; min-height: 100%; padding: var(--s5) var(--s4) var(--s4); }
.nav-group + .nav-group { margin-top: var(--s5); }
.nav-group h2 { font-size: 0.78rem; font-weight: 600; color: var(--muted); letter-spacing: 0; padding: 0 var(--s3); margin-bottom: var(--s2); }
.nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.nav a.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px var(--s3); border-radius: 0;
  color: var(--ink-2); text-decoration: none; font-size: 0.88rem; line-height: 1.3;
}
.nav a.nav-item:hover { background: var(--sunk); color: var(--ink); }
/* unvisited: faint ring. visited: ring. current: dot. The nav compiles as you go. */
.nav a.nav-item .dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--rule-2); background: transparent; flex: none; }
.nav a.nav-item.visited .dot { border-color: var(--ink); }
.nav a.nav-item[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav a.nav-item[aria-current="page"] .dot { background: var(--ink); border-color: var(--ink); }
.nav-foot { margin-top: auto; padding: var(--s5) var(--s3) 0; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); }
.nav-quiet { color: var(--muted); font-size: 0.86rem; text-decoration: none; }
.nav-quiet:hover { color: var(--ink); text-decoration: underline; }
.nav-gloss { display: none; background: none; border: 0; padding: 0; cursor: pointer; }
.nav-scrim { position: fixed; inset: var(--top-h) 0 0 0; z-index: 44; background: color-mix(in srgb, var(--ink) 18%, transparent); }

.content { min-width: 0; padding: var(--s7) clamp(1.25rem, 4vw, 4rem) 9rem; }
main { max-width: var(--content-w); margin: 0 auto; outline: none; }
main:focus, main:focus-visible { outline: none; }
.page-foot { max-width: var(--content-w); margin: var(--s9) auto 0; padding-top: var(--s5); border-top: 1px solid var(--rule); font-size: 0.84rem; color: var(--muted); }

/* ------------------------------------------------------------------ page structure */
.page-head { margin-bottom: var(--s7); max-width: var(--text-w); }
.page-head .lede { margin-top: var(--s4); }
.lede { font-size: 1.2rem; line-height: 1.5; color: var(--ink-2); max-width: var(--text-w); }
.block { margin-top: var(--s7); }
.block + .block { margin-top: var(--s8); }
.page-head + .block, .block:first-child { margin-top: 0; }
.block > h2, .block-head { margin-bottom: var(--s5); }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s3) var(--s5); }
.prose { max-width: var(--text-w); }
.note { font-size: 0.88rem; color: var(--muted); max-width: var(--text-w); margin-top: var(--s4); }
.gap { margin-top: var(--s6); }
.gap-s { margin-top: var(--s4); }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s7); align-items: start; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); }
.row + .row { margin-top: var(--s4); }
.spread { justify-content: space-between; }

.card { background: var(--bg); border: 1px solid var(--rule-2); padding: var(--s6); min-width: 0; }
.sheet { background: var(--bg); border: 1px solid var(--rule-2); padding: var(--s7); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--s6) var(--s7); }
.stat b { display: block; font-size: 2.6rem; font-weight: 620; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; font-variation-settings: "wdth" 88; }
.stat .stat-label { display: block; margin-top: var(--s3); color: var(--muted); font-size: 0.9rem; line-height: 1.45; max-width: 22rem; }
.stat .sbar { margin-top: var(--s4); }
.stat.good b { color: var(--ink); }

/* empty state */
.empty { padding: var(--s8) var(--s6); text-align: center; border: 1px dashed var(--rule-2); color: var(--ink-2); }
.empty p { max-width: 34rem; margin-left: auto; margin-right: auto; }
.empty .row { justify-content: center; margin-top: var(--s5); }

/* ------------------------------------------------------------------ controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  padding: 0.6rem 1.15rem; border-radius: 999px; border: 1px solid var(--rule-2);
  background: transparent; color: var(--ink); font-weight: 600; font-size: 0.9rem; line-height: 1.3; letter-spacing: -0.01em;
}
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--ink-2); border-color: transparent; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--sunk); border-color: transparent; }
.btn[disabled] { opacity: 0.45; cursor: default; }
.linkish { background: none; border: 0; padding: 0; color: var(--ink); cursor: pointer; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--rule-2); }
.linkish:hover { text-decoration-color: currentColor; }
.hint { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-2); color: var(--ink-2); }

.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--rule-2); border-radius: 999px; max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: transparent; padding: 0.42rem 1rem; cursor: pointer; font-weight: 600; font-size: 0.86rem; color: var(--muted); border-radius: 999px; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.tabs { display: flex; gap: var(--s5); border-bottom: 1px solid var(--rule); margin-bottom: var(--s6); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 0.7rem 0; cursor: pointer; font-weight: 600; font-size: 0.92rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; font-size: 0.9rem; user-select: none; }
.toggle input { width: 18px; height: 18px; accent-color: var(--ink); }

details.more { margin-top: var(--s5); }
details.more > summary { cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: 0.88rem; list-style: none; display: inline-flex; align-items: center; gap: 8px; }
details.more > summary:hover { color: var(--ink); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; }
details.more[open] > summary::before { transform: rotate(45deg); }
details.more > .more-body { margin-top: var(--s4); color: var(--ink-2); font-size: 0.92rem; max-width: var(--text-w); }
.arith { font-family: var(--font-code); font-size: 0.8rem; line-height: 1.9; border: 1px solid var(--rule); padding: var(--s4) var(--s5); overflow-x: auto; color: var(--ink-2); }

.progress { display: flex; align-items: center; gap: var(--s4); margin: var(--s4) 0; font-weight: 500; font-size: 0.92rem; color: var(--ink-2); }
.progress-track { flex: 1; max-width: 22rem; height: 6px; background: var(--sunk); overflow: hidden; }
.progress-fill { display: block; height: 100%; background: var(--ink); width: 0; animation: fill var(--ms, 1200ms) linear forwards; }
@keyframes fill { to { width: 100%; } }

/* ------------------------------------------------------------------ tables */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tbl th, .tbl td { text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl th { font-size: 0.8rem; font-weight: 600; color: var(--muted); padding-top: 0; }
.tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td.r { white-space: nowrap; }
.tbl td .sub { display: block; color: var(--muted); font-size: 0.84rem; margin-top: 2px; }
.tbl tr.total td { font-weight: 650; border-bottom: 0; border-top: 1px solid var(--rule-2); }
.tbl tr.total + tr.total td { border-top: 0; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--sunk); }
.tbl tr.selected td { background: var(--brand-soft); }
.tbl tr.hov td { background: var(--brand-soft); }
.tbl .reveal-col { animation: colIn 0.35s ease-out; }
@keyframes colIn { from { opacity: 0; } to { opacity: 1; } }
.tbl.kvt td:first-child { color: var(--ink-2); }

/* ------------------------------------------------------------------ ids, terms */
.idtok { display: inline-flex; align-items: center; max-width: 100%; vertical-align: middle; position: relative; font-size: 0.8rem; border: 1px solid var(--rule); }
.idtok-open { border: 0; background: transparent; padding: 2px 4px 2px 8px; cursor: pointer; font-family: var(--font-code); color: var(--ink); white-space: nowrap; }
.idtok-open:hover { text-decoration: underline; text-underline-offset: 3px; }
.idtok-copy { border: 0; border-left: 1px solid var(--rule); background: transparent; padding: 2px 8px 2px 8px; cursor: pointer; font-size: 0.72rem; font-weight: 600; color: var(--muted); }
.idtok-copy:hover { color: var(--ink); }
.idtok-full {
  display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--ink); color: var(--bg); padding: 6px 10px;
  font-family: var(--font-code); font-size: 0.74rem; white-space: nowrap;
}
.idtok:hover .idtok-full { display: block; }
.term { border-bottom: 1px dotted var(--muted); cursor: help; position: relative; }
.term:hover::after, .term:focus::after {
  content: attr(data-def); position: absolute; left: 0; top: calc(100% + 8px); z-index: 35;
  width: max-content; max-width: 19rem; white-space: normal;
  background: var(--ink); color: var(--bg); padding: 10px 12px;
  font-size: 0.82rem; font-weight: 450; line-height: 1.45; font-family: var(--font);
}

/* ------------------------------------------------------------------ code: inverse panels */
.code {
  margin: 0; background: var(--code-bg); color: var(--code-ink);
  font-family: var(--font-code); font-size: 0.78rem; line-height: 1.8;
  overflow-x: auto; padding: var(--s5) 0; tab-size: 4;
}
.code .ln { display: block; padding: 0 var(--s5); white-space: pre; min-height: 1.8em; border-left: 3px solid transparent; }
.code .ln.hl { background: var(--code-line); border-left-color: var(--code-ink); }
.code .ln.hl-esc { background: var(--code-line); border-left-style: dashed; border-left-color: var(--code-ink); }
.code .ln.hl-bad { background: var(--code-ink); color: var(--code-bg); border-left-color: var(--code-ink); }
.code .ln.hl-bad .c, .code .ln.hl-bad .k, .code .ln.hl-bad .s, .code .ln.hl-bad .n, .code .ln.hl-bad .d, .code .ln.hl-bad .f { color: inherit; }
.code .ln.hl-cur { background: color-mix(in srgb, var(--code-ink) 24%, transparent); border-left-color: var(--code-ink); }
.code .ln.dim { opacity: 0.4; }
.code .ln.add { background: color-mix(in srgb, var(--code-ink) 16%, transparent); }
.code .ln.del { opacity: 0.5; }
.code .ln.hunk { color: var(--code-dim); }
.code .k { font-weight: 700; }
.code .s { color: inherit; }
.code .c { color: var(--code-dim); font-style: italic; }
.code .n { color: inherit; }
.code .d { font-weight: 600; }
.code .f { font-weight: 600; }
.code-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2) var(--s4); flex-wrap: wrap; font-size: 0.84rem; color: var(--muted); margin-bottom: var(--s3); }
.code-head .path { font-family: var(--font-code); font-size: 0.8rem; color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.code.filling .ln.branch { animation: fillIn 0.3s ease-out both; }
@keyframes fillIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.code.gutter .ln::before { content: attr(data-note); display: inline-block; width: 8ch; margin-left: -6px; font-family: var(--font); font-size: 0.72rem; font-weight: 700; color: var(--code-dim); }
.code.gutter .ln.hl::before, .code.gutter .ln.hl-esc::before, .code.gutter .ln.hl-cur::before { color: var(--code-ink); }

.json { margin: 0; background: var(--code-bg); color: var(--code-ink); font-family: var(--font-code); font-size: 0.74rem; line-height: 1.7; padding: var(--s4) var(--s5); overflow: auto; max-height: 60vh; white-space: pre; }
.json.wrap { white-space: pre-wrap; word-break: break-all; }
.json .jk { font-weight: 600; }
.json .js { color: inherit; }
.json .jn { color: inherit; }
.json .jl { font-weight: 700; }

/* ------------------------------------------------------------------ badges, bars */
.badge { display: inline-flex; align-items: center; gap: 7px; padding: 1px 10px 1px 8px; border-radius: 999px; border: 1px solid var(--rule-2); font-size: 0.78rem; font-weight: 600; white-space: nowrap; line-height: 1.6; color: var(--ink); background: transparent; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; background: transparent; flex: none; }
.badge.pass::before { background: currentColor; }
.badge.fail::before {
  border: 0; border-radius: 0;
  background:
    linear-gradient(45deg, transparent 40%, currentColor 40% 60%, transparent 60%),
    linear-gradient(-45deg, transparent 40%, currentColor 40% 60%, transparent 60%);
}
.badge.notrun { color: var(--muted); }
.badge.notrun::before { border-style: dashed; }
.badge.esc::before { border-style: solid; }
.badge.state-compiled::before { background: currentColor; }
.badge.state-portable::before { border-style: dashed; }
.badge.state-locked::before { border-style: solid; }
.badge.state-retired { color: var(--muted); }
.badge.state-retired::before { background: var(--retired); border-color: transparent; }
.bucket-low, .bucket-mixed, .bucket-open { color: var(--ink); font-weight: 650; }
.bucket-none { color: var(--muted); font-weight: 650; }

.sbar { display: flex; height: 10px; overflow: hidden; background: var(--sunk); min-width: 7rem; }
.sbar > span { display: block; height: 100%; }
.sbar > span + span { box-shadow: inset 2px 0 0 var(--bg); }
.sbar.tall { height: 16px; }
.r-FAST_TRACK { background: var(--route-fast); }
.r-ADJUSTER { background: var(--route-adj); }
.r-INJURY_TEAM { background: var(--route-injury); }
.r-FRAUD_REVIEW { background: var(--route-fraud); }
.r-cluster { background: var(--ink); opacity: 0.7; }
.r-cluster:nth-child(even) { opacity: 0.35; }
.b-code { background: var(--ink); }
.b-esc { background: var(--escalate); }
.b-diff { background: repeating-linear-gradient(135deg, var(--ink) 0 2px, var(--bg) 2px 5px); }
.legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); font-size: 0.84rem; color: var(--ink-2); margin: var(--s3) 0; }
.legend i { display: inline-block; width: 11px; height: 11px; margin-right: 7px; vertical-align: -1px; box-shadow: inset 0 0 0 1px var(--rule-2); }
.legend i.sw-cost { background: repeating-linear-gradient(90deg, var(--ink) 0 3px, transparent 3px 6px); box-shadow: none; height: 3px; vertical-align: 2px; width: 18px; }
.legend i.sw-save { background: var(--ink); box-shadow: none; height: 3px; vertical-align: 2px; width: 18px; }
.route { font-family: var(--font-code); font-size: 0.84em; font-weight: 600; }
.meter { margin-top: var(--s4); }
.meter-labels { display: flex; justify-content: space-between; gap: var(--s4); font-size: 0.84rem; color: var(--muted); margin-top: var(--s2); }
.slice-btn { border: 0; padding: 0; cursor: pointer; }

/* four states, one ladder: bordered, mid, solid, faint */
.statebar { display: flex; height: 40px; overflow: hidden; border: 1px solid var(--rule-2); }
.statebar > span { display: grid; place-items: center; font-weight: 600; font-size: 0.86rem; white-space: nowrap; overflow: hidden; color: var(--ink); }
.statebar > span + span { box-shadow: inset 1px 0 0 var(--bg); }
.s-0 { background: transparent; }
.s-1 { background: var(--portable); }
.s-2 { background: var(--ink); }
.s-3 { background: var(--retired); }
.statebar > .s-1, .statebar > .s-2 { color: var(--bg); }
.legend i.s-0 { background: transparent; }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--s3) var(--s5); margin: 0; font-size: 0.92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.result-line { padding: var(--s4) var(--s5); font-weight: 500; font-family: var(--font); color: var(--ink); border: 1px solid var(--ink); }
.result-line.by-code { background: var(--brand-soft); }
.result-line.esc { border-style: dashed; border-color: var(--rule-2); }
.status-line { margin: 0; max-width: 42rem; font-weight: 600; font-size: 0.92rem; display: flex; align-items: flex-start; gap: 10px; color: var(--ink-2); }
.status-line::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--rule-2); margin-top: 0.4em; }
.status-line.ok { color: var(--ink); }
.status-line.ok::before { background: var(--ink); border-color: var(--ink); }
.status-line.bad { color: var(--ink); }
.status-line.bad::before {
  border: 0; border-radius: 0;
  background:
    linear-gradient(45deg, transparent 40%, currentColor 40% 60%, transparent 60%),
    linear-gradient(-45deg, transparent 40%, currentColor 40% 60%, transparent 60%);
}
.formula { font-family: var(--font-code); font-size: 0.84rem; border: 1px solid var(--rule); padding: 0.35rem 0.7rem; display: inline-block; }
.tick { color: var(--ink); font-weight: 700; }
.cross { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-style: wavy; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ overview */
.hero-quote { font-size: 2.35rem; line-height: 1.12; letter-spacing: -0.035em; font-weight: 640; max-width: 36rem; margin: 0; font-variation-settings: "wdth" 92; text-wrap: balance; }
.hero-sub { margin-top: var(--s5); font-size: 1.1rem; color: var(--ink-2); max-width: 36rem; }
.hero-actions { margin-top: var(--s6); }
.overview-stats { margin-top: var(--s8); padding-top: var(--s6); border-top: 1px solid var(--rule); }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s7); }
.pair h3 { margin-bottom: var(--s2); }
.pair p { color: var(--ink-2); }

/* ------------------------------------------------------------------ scan */
.tree { font-family: var(--font-code); font-size: 0.82rem; line-height: 2; margin: 0; padding: 0; list-style: none; }
.tree li { white-space: nowrap; }
.tree button { border: 0; background: none; cursor: pointer; font: inherit; padding: 1px 8px; color: var(--ink); }
.tree button:hover { background: var(--sunk); }
.tree .cs-tag { font-family: var(--font); font-size: 0.72rem; font-weight: 700; color: var(--ink); margin-left: 8px; border: 1px solid var(--rule-2); border-radius: 999px; padding: 0 7px; line-height: 1.5; }
.tree .dirname { color: var(--muted); }
.tree .note-inline { font-family: var(--font); font-size: 0.78rem; color: var(--muted); margin-left: 10px; white-space: normal; }

/* ------------------------------------------------------------------ entropy */
.scale svg { width: 100%; height: auto; display: block; overflow: visible; }
.scale .zone-low { fill: transparent; }
.scale .zone-mixed { fill: color-mix(in srgb, var(--ink) 6%, transparent); }
.scale .zone-open { fill: color-mix(in srgb, var(--ink) 12%, transparent); }
.scale text { fill: var(--muted); font-family: var(--font); font-size: 14px; }
.scale .axis { stroke: var(--rule-2); }
.scale .thr { stroke: var(--ink-2); stroke-width: 1.2; stroke-dasharray: 4 4; }
.scale .marker { cursor: pointer; }
.scale .marker circle { fill: var(--bg); stroke: var(--ink); stroke-width: 1.75; }
.scale .marker.sel circle { fill: var(--ink); }
.scale .marker text { font-weight: 650; font-size: 14px; fill: var(--ink); }
.scale .marker:focus { outline: none; }
.scale .marker:focus-visible circle { stroke-width: 3.5; }
.scale .zone-label { font-weight: 600; font-size: 14px; fill: var(--ink-2); }
.scale-hint { display: none; }

/* ------------------------------------------------------------------ audit */
.report-sec + .report-sec { margin-top: var(--s7); padding-top: var(--s7); border-top: 1px solid var(--rule); }
.report-sec > h2 { margin-bottom: var(--s5); }
.report-meta { color: var(--muted); font-size: 0.88rem; margin-bottom: var(--s6); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); }
.tile { border: 1px solid var(--rule-2); padding: var(--s5); background: transparent; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-width: 0; color: var(--ink); font: inherit; }
.tile:hover { border-color: var(--ink); }
.tile b { font-size: 2.3rem; line-height: 1; font-weight: 620; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; font-variation-settings: "wdth" 88; }
.tile .formula { margin-top: var(--s3); font-size: 0.76rem; white-space: normal; }

/* ------------------------------------------------------------------ skeleton */
.pr-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); margin-bottom: var(--s2); }
.pr-state { border: 1px solid var(--ink); color: var(--ink); font-weight: 650; padding: 1px 12px; border-radius: 999px; font-size: 0.8rem; }
.pr-meta { color: var(--muted); font-size: 0.88rem; margin-bottom: var(--s6); }
.code-aside { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: var(--s6); align-items: start; }
.inv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.inv-list li { padding: var(--s3) var(--s3); cursor: default; font-size: 0.86rem; line-height: 1.5; color: var(--ink-2); border-left: 2px solid transparent; }
.inv-list li:hover, .inv-list li:focus { background: var(--sunk); border-left-color: var(--ink); outline: none; }
.inv-list b { display: block; font-family: var(--font-code); font-size: 0.78rem; color: var(--ink); }
.test-list { list-style: none; margin: 0; padding: 0; }
.test-list li { padding: var(--s4) 0; border-bottom: 1px solid var(--rule); }
.test-list li:first-child { padding-top: 0; }
.test-list code { font-weight: 600; overflow-wrap: anywhere; color: var(--ink); }
.test-list span { display: block; color: var(--muted); font-size: 0.88rem; margin-top: 2px; }
.comment { border-left: 2px solid var(--ink); padding: var(--s1) 0 var(--s1) var(--s5); margin-top: var(--s6); max-width: var(--text-w); }
.comment .who { font-size: 0.82rem; color: var(--muted); margin-bottom: var(--s1); }
.lines { margin: 0; padding: 0; list-style: none; max-width: var(--text-w); }
.lines li { padding: var(--s4) 0; border-bottom: 1px solid var(--rule); }
.lines li:first-child { padding-top: 0; }
.lines li:last-child { border-bottom: 0; }

/* ------------------------------------------------------------------ compile */
.try-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5) var(--s5); margin: var(--s5) 0; max-width: 46rem; }
.try-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.84rem; color: var(--ink-2); font-weight: 500; }
.try-form input[type="number"] { font: inherit; font-size: 0.95rem; padding: 0.55rem 0.75rem; border: 1px solid var(--rule-2); border-radius: 0; background: var(--bg); color: var(--ink); width: 100%; }
.try-form input[type="number"]:focus { border-color: var(--ink); }
.try-form .chk { flex-direction: row; align-items: center; gap: 10px; }
.try-form .chk input { width: 18px; height: 18px; accent-color: var(--ink); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6); max-width: 52rem; }
.facts h3 { margin-bottom: var(--s2); }
.facts p { color: var(--ink-2); font-size: 0.95rem; }

/* ------------------------------------------------------------------ tests */
.diff-list { margin-top: var(--s5); }
.diff-row { padding: var(--s4) 0; border-top: 1px solid var(--rule); font-size: 0.92rem; color: var(--ink-2); }

/* ------------------------------------------------------------------ gates */
.gate-status { display: flex; align-items: center; gap: var(--s3); font-size: 1.25rem; font-weight: 650; margin-bottom: var(--s2); color: var(--ink); letter-spacing: -0.02em; }
.gate-status::before { content: ""; width: 12px; height: 12px; border-radius: 50%; flex: none; }
.gate-status.bad::before {
  border-radius: 0;
  background:
    linear-gradient(45deg, transparent 40%, currentColor 40% 60%, transparent 60%),
    linear-gradient(-45deg, transparent 40%, currentColor 40% 60%, transparent 60%);
}
.gate-status.good::before { background: currentColor; }

/* ------------------------------------------------------------------ sign */
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: var(--s4); padding: var(--s4) 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.files li:first-child { padding-top: 0; }
.files code { overflow-wrap: anywhere; color: var(--ink); }
.files .note-s { display: block; color: var(--muted); font-size: 0.86rem; }
.files .mk { font-size: 0.76rem; font-weight: 650; }
.files .mk.added { color: var(--ink); }
.files .mk.changed { color: var(--ink-2); }
.evidence { list-style: none; margin: 0; padding: 0; }
.evidence li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2) var(--s4); align-items: center; padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
.evidence li > span:last-child { display: inline-flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; }
.sigcard { border: 1px solid var(--rule-2); padding: var(--s6); background: var(--bg); }
.sig-state { display: flex; align-items: center; gap: 12px; font-weight: 650; font-size: 1.4rem; letter-spacing: -0.025em; }
.sig-state::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid currentColor; flex: none; }
.sigcard.valid { border: 1.5px solid var(--ink); }
.sigcard.expired { border: 1.5px dashed var(--ink); }
.sigcard.valid .sig-state { color: var(--ink); }
.sigcard.valid .sig-state::before { background: currentColor; }
.sigcard.expired .sig-state { color: var(--ink); }
.sigcard.expired .sig-state::before {
  border: 0; border-radius: 0;
  background:
    linear-gradient(45deg, transparent 40%, currentColor 40% 60%, transparent 60%),
    linear-gradient(-45deg, transparent 40%, currentColor 40% 60%, transparent 60%);
}
.sigcard.unsigned .sig-state { color: var(--ink-2); }
.sigcard .kv { margin-top: var(--s5); }

/* ------------------------------------------------------------------ run */
.claim-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4) var(--s6); margin: 0; }
.claim-fields div { min-width: 0; }
.claim-fields dt { font-family: var(--font-code); font-size: 0.74rem; color: var(--muted); }
.claim-fields dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.statement { margin-top: var(--s5); max-width: var(--text-w); color: var(--ink-2); }
.statement::before { content: "Statement: "; color: var(--muted); }
.stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); margin-bottom: var(--s6); }
.stage { padding-top: var(--s4); border-top: 2px solid var(--rule-2); font-size: 0.9rem; color: var(--ink-2); }
.stage b { display: block; color: var(--ink); margin-bottom: 2px; }
.stage.esc { border-top-color: var(--ink); border-top-style: dashed; }
.stage.ok { border-top-color: var(--ink); }
.dr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5) var(--s7); }
.dr-field { min-width: 0; }
.dr-field .lbl { font-size: 0.8rem; color: var(--muted); margin-bottom: 2px; }
.dr-field .val { overflow-wrap: anywhere; font-size: 0.92rem; }
.dr-limit { color: var(--ink); font-weight: 650; }
.dr-headline { margin-bottom: var(--s6); font-size: 1.02rem; }
.dr-key .val { font-size: 0.95rem; }
details.more > .more-body:has(> .dr-grid) { max-width: none; color: var(--ink); }
.cert-result { margin-top: var(--s6); display: grid; gap: var(--s3); }
.cert-id { margin: 0 0 0 20px; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.loop { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s7); }
.loop h3 { margin-bottom: var(--s3); }
.loop p, .loop li { color: var(--ink-2); font-size: 0.92rem; }
.loop .lines li { padding: var(--s2) 0; }

/* ------------------------------------------------------------------ ledger */
.ledger-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4) var(--s6); margin-bottom: var(--s5); }
.ledger-root { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); font-size: 0.9rem; }
.ledger-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s6); align-items: start; margin-top: var(--s6); }
.chain { list-style: none; margin: 0; padding: 0; }
.chain li { position: relative; padding-left: 30px; }
.chain li::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 1px; background: var(--rule-2); }
.chain li:first-child::before { top: 24px; }
.chain li:last-child::before { bottom: calc(100% - 24px); }
.chain .node { position: absolute; left: 0; top: 16px; width: 17px; height: 17px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--rule-2); display: grid; place-items: center; font-size: 10px; font-weight: 800; color: var(--ink); }
.chain li.ok .node { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chain li.bad .node { background: var(--bg); border-color: var(--ink); color: var(--ink); border-style: dashed; }
.chain li.bad::before { background: repeating-linear-gradient(to bottom, var(--ink) 0 4px, transparent 4px 8px); }
.entry { display: block; width: 100%; text-align: left; border: 0; border-left: 2px solid transparent; background: transparent; padding: var(--s3) var(--s4); cursor: pointer; }
.entry:hover { background: var(--sunk); }
.entry.sel { background: var(--sunk); border-left-color: var(--ink); }
.entry-desc { display: block; font-size: 0.92rem; font-weight: 500; color: var(--ink); }
.entry-meta { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 1px; }
.entry-meta code { font-size: 0.74rem; }
.entry-err { display: block; font-size: 0.82rem; font-weight: 650; color: var(--ink); margin-top: 2px; }
.detail { position: sticky; top: calc(var(--top-h) + 1.5rem); }
.detail h2 { font-size: 1.1rem; margin-bottom: var(--s2); }
.detail .tabs { margin-bottom: var(--s5); }
.tamper-area { width: 100%; min-height: 14rem; font-family: var(--font-code); font-size: 0.76rem; padding: var(--s3); border: 1px solid var(--rule-2); background: var(--bg); color: var(--ink); }
.tamper-area:focus { outline: none; border-color: var(--ink); }
.callout-bad { margin-top: var(--s3); padding: var(--s3) var(--s4); border: 1px dashed var(--ink); color: var(--ink); font-size: 0.86rem; }
.obj-list { list-style: none; margin: 0; padding: 0; max-width: 52rem; }
.obj-list li { display: grid; grid-template-columns: 4rem minmax(0, 1fr) auto; gap: var(--s2) var(--s4); align-items: center; padding: var(--s3) 0; border-bottom: 1px solid var(--rule); font-size: 0.9rem; }
.obj-list li.sel { background: var(--sunk); }

/* ------------------------------------------------------------------ runtime */
.rt-head { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); align-items: center; margin-bottom: var(--s5); font-size: 0.92rem; color: var(--ink-2); }
.rt-head h2 { font-size: 1.15rem; }
.letter { white-space: pre-wrap; font-family: var(--font); border: 1px solid var(--rule); padding: var(--s4) var(--s5); font-size: 0.9rem; }
.check-name { border-bottom: 1px dotted var(--muted); cursor: help; font-family: var(--font-code); font-size: 0.8rem; }

/* ------------------------------------------------------------------ reports */
.chart svg { width: 100%; height: auto; display: block; }
.chart.wide { max-width: 40rem; }
.chart text { fill: var(--muted); font-family: var(--font); font-size: 13px; }
.chart .grid { stroke: var(--rule); }
.chart .axis { stroke: var(--rule-2); }
.chart .l-cost { stroke: var(--ink); stroke-width: 2; fill: none; stroke-dasharray: 6 5; }
.chart .l-save { stroke: var(--ink); stroke-width: 2.5; fill: none; }
.chart .cross-dot { fill: var(--ink); }
.chart .strong { fill: var(--ink); font-weight: 650; }
.chart rect { stroke: var(--bg); stroke-width: 1; }
.burn { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s7); align-items: start; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.board-col { border: 1px solid var(--rule); padding: var(--s3); min-height: 15rem; }
.board-col h3 { font-size: 0.78rem; font-weight: 600; color: var(--ink-2); margin: 2px 2px var(--s3); display: flex; justify-content: space-between; gap: 6px; }
.cs-card { display: block; width: 100%; text-align: left; border: 1px solid var(--rule); border-left: 3px solid var(--rule-2); background: var(--bg); padding: 7px 9px; margin-bottom: 6px; cursor: pointer; font-size: 0.74rem; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.cs-card b { display: block; font-size: 0.8rem; color: var(--ink); }
.cs-card.s-col-0 { border-left-color: var(--rule-2); }
.cs-card.s-col-1 { border-left-color: var(--ink); border-left-style: dashed; }
.cs-card.s-col-2 { border-left-color: var(--ink); }
.cs-card.s-col-3 { border-left-color: var(--retired); }
.cs-card.moved { animation: moved 0.45s ease-out; }
@keyframes moved { from { transform: translateX(-12px); opacity: 0.3; } to { transform: none; opacity: 1; } }
.slider-row { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); align-items: center; margin-bottom: var(--s4); }
.slider-row input[type="range"] { flex: 1; min-width: 9rem; accent-color: var(--ink); }
.pull { font-size: 1.15rem; line-height: 1.45; font-weight: 500; color: var(--ink-2); max-width: var(--text-w); margin-top: var(--s7); letter-spacing: -0.01em; }

/* ------------------------------------------------------------------ tour bar */
.tour {
  position: fixed; z-index: 45; bottom: 20px;
  left: calc(var(--nav-w) + (100vw - var(--nav-w)) / 2); transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--s2);
  padding: 5px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--rule-2);
}
.tour-btn { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; cursor: pointer; padding: 0.5rem 0.95rem; border-radius: 999px; font-weight: 600; font-size: 0.88rem; color: var(--ink-2); }
.tour-btn:hover { background: var(--sunk); color: var(--ink); }
.tour-btn[disabled] { opacity: 0.35; cursor: default; background: transparent; }
.tour-next { background: var(--ink); color: var(--bg); padding-left: 1.15rem; }
.tour-next:hover { background: var(--ink-2); color: var(--bg); }
.tour-mid { display: flex; flex-direction: column; align-items: center; min-width: 7.5rem; padding: 0 var(--s2); }
.tour-count { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tour-dots { display: flex; gap: 4px; height: 6px; margin-top: 3px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--rule-2); }
.tour-dots i.on { background: var(--ink); border-color: var(--ink); }

/* ------------------------------------------------------------------ drawers */
.drawer-wrap { position: fixed; inset: 0; z-index: 70; background: color-mix(in srgb, var(--ink) 18%, transparent); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 71; width: min(38rem, 100vw); background: var(--bg); border-left: 1px solid var(--rule-2); padding: var(--s6) var(--s6) var(--s7); overflow-y: auto; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); margin-bottom: var(--s5); }
.drawer-body > * + * { margin-top: var(--s5); }
.drawer-body h3 { margin-bottom: calc(-1 * var(--s3)); }
.glossary-list dt { font-weight: 650; margin-top: var(--s5); }
.glossary-list dt:first-child { margin-top: 0; }
.glossary-list dd { margin: 4px 0 0; color: var(--ink-2); font-size: 0.92rem; }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 16px; font-size: 0.86rem; opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 80; }
.toast.on { opacity: 1; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .ledger-grid, .burn, .code-aside { grid-template-columns: minmax(0, 1fr); }
  .detail { position: static; }
  .loop { grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
}
@media (max-width: 1000px) {
  :root { --nav-w: 0px; }
  .icon-btn { display: inline-flex; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav {
    position: fixed; top: var(--top-h); left: 0; bottom: 0; z-index: 46; width: min(18rem, 86vw); height: auto; align-self: auto;
    background: var(--bg); border-right: 1px solid var(--rule-2);
    transform: translateX(-105%); transition: transform 0.2s ease-out; visibility: hidden;
  }
  .nav.open { transform: none; visibility: visible; }
  .content { padding-top: var(--s7); }
  .cols-2 { grid-template-columns: minmax(0, 1fr); gap: var(--s7); }
}
@media (max-width: 760px) {
  .workspace-org { display: none; }
  .tiles, .stages, .dr-grid, .pair, .facts { grid-template-columns: minmax(0, 1fr); }
  .stages { gap: var(--s4); }
  .try-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .claim-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-col { min-height: 8rem; }
  .sheet { padding: var(--s5) var(--s4); }
}
@media (max-width: 640px) {
  .topbar { padding: 0 var(--s4); gap: var(--s3); }
  .workspace { display: none; }
  #open-glossary { display: none; }
  .nav-gloss { display: inline; }
  .topbar { min-width: 0; }
  .top-link { font-size: 0.82rem; }
  .content { padding: var(--s6) var(--s4) 8rem; }
  h1 { font-size: 1.9rem; }
  .lede { font-size: 1.06rem; }
  .page-head { margin-bottom: var(--s6); }
  .block + .block { margin-top: var(--s7); }
  .hero-quote { font-size: 1.6rem; }
  .stat b { font-size: 2.1rem; }
  .code { font-size: 0.72rem; padding: var(--s4) 0; }
  .code .ln { padding: 0 var(--s4); }
  .card, .sigcard { padding: var(--s5); }
  .tour { left: 50%; bottom: 12px; width: calc(100vw - 24px); justify-content: space-between; }
  .tour-mid { min-width: 0; }
  .drawer { padding: var(--s5) var(--s4) var(--s7); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: var(--s3); }
  .obj-list li { grid-template-columns: 3rem minmax(0, 1fr); }
  .obj-list li .idtok { grid-column: 2; }
  .scale { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
  .scale svg { min-width: 700px; }
  .scale text, .scale .marker text, .scale .zone-label { font-size: 19px; }
  .scale-hint { display: block; margin-top: var(--s2); }
  .tbl.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tbl.stack, .tbl.stack tbody { display: block; }
  .tbl.stack tr { display: block; padding: var(--s4) 0; border-bottom: 1px solid var(--rule); }
  .tbl.stack td, .tbl.stack td.r { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: var(--s3); align-items: baseline; padding: 3px 0; border: 0; text-align: left; white-space: normal; }
  .tbl.stack td::before { content: attr(data-label); color: var(--muted); font-size: 0.8rem; font-weight: 600; }
  .tbl.stack td:empty { display: none; }
  .tbl.stack td > * { min-width: 0; }
  .tbl.stack .sbar { min-width: 0; }
  .tbl.stack tr.selected { background: var(--brand-soft); }
  .tbl.stack tr.selected td { background: transparent; }
  .tbl.stack tr.clickable:hover td { background: transparent; }
  .tbl.stack tr.total { border-top: 1px solid var(--rule-2); border-bottom: 0; }
  .tbl.stack tr.total td { border-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0ms !important; transition: none !important; scroll-behavior: auto !important; }
}
