/* ══════════════════════════════════════════════════════════════════════════
   HINDSIGHT — the fee is decided afterwards
   A case file: cool newsprint ground, oxblood stamp, teal verdict.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── tokens: complete light palette, defined once, on bare :root ────────── */
:root {
  --paper:        #E7EAEE;
  --paper-edge:   #DCE0E6;
  --leaf:         #F7F8FA;
  --leaf-2:       #EDF0F4;
  --ink:          #14171C;
  --ink-soft:     #59606C;
  --ink-faint:    #8B93A0;
  --rule:         #C3C9D2;
  --rule-soft:    #D8DDE4;
  --seal:         #8C1C2B;
  --seal-wash:    rgba(140, 28, 43, 0.10);
  --seal-wash-2:  rgba(140, 28, 43, 0.20);
  --verdict:      #10635E;
  --verdict-wash: rgba(16, 99, 94, 0.12);
  --verdict-wash-2: rgba(16, 99, 94, 0.24);
  --focus:        #1F5FD0;
  --shadow:       0 1px 0 rgba(20, 23, 28, 0.05), 0 8px 24px -18px rgba(20, 23, 28, 0.55);
  --selection:    rgba(16, 99, 94, 0.18);

  --font-display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body:    "Newsreader", Georgia, "Times New Roman", Times, serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --hh: 58px;
  --measure: 68ch;
  --ease: cubic-bezier(0.32, 0.72, 0.28, 1);

  color-scheme: light;
}

/* ── the same tokens, redefined for dark (system default) ───────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:        #0E1116;
    --paper-edge:   #080A0D;
    --leaf:         #161A20;
    --leaf-2:       #1B2027;
    --ink:          #E4E8EE;
    --ink-soft:     #949CA9;
    --ink-faint:    #69707C;
    --rule:         #2A313B;
    --rule-soft:    #1E242C;
    --seal:         #E0697A;
    --seal-wash:    rgba(224, 105, 122, 0.13);
    --seal-wash-2:  rgba(224, 105, 122, 0.26);
    --verdict:      #46C3B6;
    --verdict-wash: rgba(70, 195, 182, 0.13);
    --verdict-wash-2: rgba(70, 195, 182, 0.26);
    --focus:        #7FB0FF;
    --shadow:       0 1px 0 rgba(0, 0, 0, 0.4), 0 10px 30px -22px rgba(0, 0, 0, 0.9);
    --selection:    rgba(70, 195, 182, 0.24);
    color-scheme: dark;
  }
}

/* ── and again for the explicit toggle, so it wins in both directions ───── */
:root[data-theme="dark"] {
  --paper:        #0E1116;
  --paper-edge:   #080A0D;
  --leaf:         #161A20;
  --leaf-2:       #1B2027;
  --ink:          #E4E8EE;
  --ink-soft:     #949CA9;
  --ink-faint:    #69707C;
  --rule:         #2A313B;
  --rule-soft:    #1E242C;
  --seal:         #E0697A;
  --seal-wash:    rgba(224, 105, 122, 0.13);
  --seal-wash-2:  rgba(224, 105, 122, 0.26);
  --verdict:      #46C3B6;
  --verdict-wash: rgba(70, 195, 182, 0.13);
  --verdict-wash-2: rgba(70, 195, 182, 0.26);
  --focus:        #7FB0FF;
  --shadow:       0 1px 0 rgba(0, 0, 0, 0.4), 0 10px 30px -22px rgba(0, 0, 0, 0.9);
  --selection:    rgba(70, 195, 182, 0.24);
  color-scheme: dark;
}

/* ── reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.62;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
::selection { background: var(--selection); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.16; letter-spacing: -0.015em; margin: 0; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
strong { font-weight: 600; }
em { font-style: italic; }
hr { border: 0; }

.mono, code, pre, .num, input[type="range"] + * { font-family: var(--font-mono); }
.mono, .num { font-variant-numeric: tabular-nums; }
/* a contract address is one 42-character word and will happily walk off a
   phone screen; inline mono is allowed to break anywhere. Code blocks and the
   function signatures opt out below — they scroll instead. */
.mono { overflow-wrap: anywhere; }
.code .mono, .fn dt .mono, .formula__main .mono { overflow-wrap: normal; }
/* Filenames and identifiers in table cells break mid-word on a phone
   ("Hindsigh t.sol"). The table already sits in its own scroll container, so
   let the column be as wide as the name instead. */
.tbl td.mono, .tbl th.mono { overflow-wrap: normal; word-break: keep-all; }
.num { text-align: right; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 1px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px;
  font-family: var(--font-mono); font-size: 13px; text-decoration: none;
}
.skip:focus { left: 8px; top: 8px; }

/* ── masthead ──────────────────────────────────────────────────────────── */
.masthead {
  position: sticky; top: 0; z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.masthead__in {
  max-width: 1180px; margin: 0 auto;
  min-height: var(--hh);
  padding: 0 20px;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand__mark { display: block; line-height: 0; }
.brand__mark svg { display: block; }
.mark-pre    { stroke: var(--ink-faint); }
.mark-impact { stroke: var(--seal); }
.mark-back   { stroke: var(--verdict); }
.brand__name {
  font-family: var(--font-display); font-weight: 700; font-size: 19px;
  letter-spacing: -0.03em;
}
.caption {
  margin: 0; flex: 1 1 auto; min-width: 0;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.02em;
  color: var(--ink-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.caption__sep { padding: 0 6px; }
.caption__seg--flag { color: var(--seal); }

.ghost-btn {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: transparent; border: 1px solid var(--rule);
  padding: 7px 11px; cursor: pointer;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.ghost-btn:hover { border-color: var(--ink-faint); color: var(--ink); }
.ghost-btn__ico { font-size: 13px; line-height: 1; }

/* ── shell + rail ──────────────────────────────────────────────────────── */
.shell {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: 216px minmax(0, 1fr);
}
.rail {
  padding: 34px 20px 40px;
  position: sticky; top: var(--hh); align-self: start;
  max-height: calc(100vh - var(--hh));
  overflow-y: auto;
}
.rail__head {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-faint);
  margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--rule);
}
.rail__list { display: flex; flex-direction: column; }
.rail__tab {
  display: flex; align-items: baseline; gap: 10px;
  width: 100%; text-align: left;
  background: transparent; border: 0; border-bottom: 1px solid var(--rule-soft);
  padding: 11px 4px 11px 2px; cursor: pointer;
  font-family: var(--font-display); font-size: 15px; font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.rail__tab:hover { color: var(--ink); }
.rail__num {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em;
  color: var(--ink-faint); min-width: 22px; flex: 0 0 auto;
}
.rail__tab[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.rail__tab[aria-selected="true"] .rail__num { color: var(--seal); }
.rail__tab[aria-selected="true"] .rail__txt {
  box-shadow: inset 0 -2px 0 var(--seal);
}
.rail__foot {
  margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 6px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint);
}
.rail__foot a { text-decoration: none; word-break: break-all; }
.rail__foot a:hover { color: var(--ink); }

/* ── sheet ─────────────────────────────────────────────────────────────── */
.sheet {
  min-width: 0;
  min-height: calc(100vh - var(--hh));
  border-left: 1px solid var(--rule);
  background: var(--leaf);
  padding: 40px 38px 0;
}
.panel:focus { outline: none; }
.panel[hidden] { display: none; }

.panel__h {
  font-size: clamp(30px, 4.6vw, 42px); font-weight: 700; letter-spacing: -0.035em;
  margin-bottom: 10px;
}
.panel__sub {
  max-width: var(--measure); color: var(--ink-soft); font-size: 17.5px;
  margin-bottom: 0;
}

.rule { height: 1px; background: var(--rule); margin: 44px 0; }
.rule--tight { margin: 26px 0; }

.sec {
  font-size: clamp(21px, 2.6vw, 26px); letter-spacing: -0.025em;
  margin-bottom: 18px; display: flex; align-items: baseline; gap: 12px;
  flex-wrap: wrap;
}
.sec__n {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em; color: var(--seal);
  flex: 0 0 auto;
}
.sub {
  font-size: 17px; letter-spacing: -0.01em; margin: 30px 0 12px;
  padding-bottom: 6px; border-bottom: 1px solid var(--rule-soft);
  max-width: var(--measure);
}
.lede { max-width: var(--measure); }
.lede:last-child { margin-bottom: 0; }

.aside {
  max-width: var(--measure);
  font-size: 15.5px; color: var(--ink-soft);
  border-left: 2px solid var(--rule); padding-left: 14px;
  margin: 12px 0 0;
}
.fineprint {
  max-width: var(--measure);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.7;
  color: var(--ink-faint); margin: 16px 0 0;
}

/* ── hero ──────────────────────────────────────────────────────────────── */
.hero { padding: 6px 0 4px; }
.eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 20px;
}
.hero__h {
  font-size: clamp(38px, 7.4vw, 74px);
  font-weight: 700; letter-spacing: -0.045em; line-height: 0.98;
  margin-bottom: 22px;
}
.hero__sub {
  max-width: 54ch; font-size: clamp(18px, 2.1vw, 21px); line-height: 1.5;
  color: var(--ink-soft); margin-bottom: 26px;
}
.hero__acts { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  font-family: var(--font-display); font-size: 14px; font-weight: 500;
  letter-spacing: -0.005em;
  padding: 10px 18px; cursor: pointer;
  background: transparent; color: var(--ink);
  border: 1px solid var(--rule);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease);
}
.btn:hover { border-color: var(--ink); }
.btn--solid { background: var(--ink); color: var(--leaf); border-color: var(--ink); }
.btn--solid:hover { background: var(--ink-soft); border-color: var(--ink-soft); }
.btn--preset {
  font-family: var(--font-mono); font-size: 12px; padding: 7px 12px;
  letter-spacing: 0.02em;
}

.cta-line {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 26px;
}
.cta-line__note { font-size: 15px; color: var(--ink-faint); }

/* ── the two parties ───────────────────────────────────────────────────── */
.parties {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  margin: 0 0 26px;
}
.party { padding: 22px 26px 22px 0; }
.party + .party { border-left: 1px solid var(--rule); padding-left: 26px; padding-right: 0; }
.party__tag {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px;
}
.party__h { font-size: 19px; margin-bottom: 10px; letter-spacing: -0.02em; }
.party p { font-size: 16px; }
.party__verdict {
  font-size: 15.5px; padding: 12px 14px; margin: 14px 0 0;
  border-left: 2px solid;
}
.party__verdict--good { background: var(--verdict-wash); border-color: var(--verdict); }
.party__verdict--bad  { background: var(--seal-wash);    border-color: var(--seal); }

/* ── guesses ───────────────────────────────────────────────────────────── */
.guesses { list-style: none; padding: 0; margin: 0 0 22px; max-width: var(--measure); }
.guesses li {
  padding: 12px 0; border-bottom: 1px solid var(--rule-soft);
  font-size: 16px; color: var(--ink-soft);
  display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; align-items: baseline;
}
.guesses__k {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em;
  color: var(--ink); text-transform: lowercase;
}

/* ── creed ─────────────────────────────────────────────────────────────── */
.creed { margin: 0; }
.creed blockquote { margin: 0 0 18px; padding: 0; }
.creed blockquote p {
  font-size: clamp(21px, 3.1vw, 30px); line-height: 1.25; letter-spacing: -0.02em;
  max-width: 24ch; margin: 0 0 10px;
  font-family: var(--font-display); font-weight: 500;
}
.creed blockquote p:last-child {
  color: var(--verdict);
}
.creed figcaption {
  max-width: var(--measure); color: var(--ink-soft); font-size: 16.5px;
  border-top: 1px solid var(--rule); padding-top: 16px;
}

/* ── steps ─────────────────────────────────────────────────────────────── */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
.steps li {
  counter-increment: s;
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 18px;
  padding: 20px 0; border-top: 1px solid var(--rule-soft);
}
.steps li:first-child { border-top: 0; padding-top: 0; }
/* ::before takes column 1; everything else stacks in column 2 */
.steps li > * { grid-column: 2; }
.steps li::before {
  content: counter(s, decimal-leading-zero);
  grid-column: 1; grid-row: 1;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  color: var(--seal); letter-spacing: 0.04em;
  padding-top: 4px;
}
.steps h3 { font-size: 17.5px; letter-spacing: -0.018em; margin-bottom: 7px; }
.steps p { max-width: var(--measure); font-size: 16px; color: var(--ink-soft); margin-bottom: 0; }
.steps p + p, .steps .aside { margin-top: 10px; }
.steps--compact li { padding: 15px 0; }

/* ── notice block (honest costs / risks) ───────────────────────────────── */
.notice {
  border: 1px solid var(--seal);
  background: var(--leaf-2);
  padding: 26px 28px 22px;
  position: relative;
}
.notice__stamp {
  position: absolute; top: -10px; left: 22px;
  background: var(--leaf-2); padding: 0 10px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--seal); margin: 0;
}
.notice__h {
  font-size: clamp(19px, 2.4vw, 24px); letter-spacing: -0.025em; margin-bottom: 16px;
}
.costs { margin: 0; display: grid; gap: 0; }
.costs > div {
  padding: 14px 0; border-top: 1px solid var(--rule);
}
.costs > div:first-child { border-top: 0; padding-top: 0; }
.costs dt {
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  letter-spacing: -0.012em; margin-bottom: 5px; max-width: var(--measure);
}
.costs dd {
  margin: 0; font-size: 15.5px; color: var(--ink-soft); max-width: var(--measure);
}

.status-line {
  display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap;
  max-width: var(--measure); font-size: 15.5px; color: var(--ink-soft);
  margin-bottom: 0;
}
.chip {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--seal);
  border: 1px solid var(--seal); padding: 2px 7px; flex: 0 0 auto;
}

/* ── formula ───────────────────────────────────────────────────────────── */
.formula {
  border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule);
  padding: 20px 0; margin: 0 0 26px;
}
.formula__main {
  font-family: var(--font-mono); font-size: clamp(15px, 2.4vw, 20px);
  letter-spacing: -0.01em; margin-bottom: 12px;
  overflow-x: auto; white-space: nowrap; padding-bottom: 4px;
}
.t-var { color: var(--verdict); font-weight: 500; }
.formula__clamp { color: var(--ink-faint); }
.formula__note { max-width: var(--measure); font-size: 15.5px; color: var(--ink-soft); margin: 0; }

/* ── tables ────────────────────────────────────────────────────────────── */
.scroll-x { overflow-x: auto; margin: 0 0 8px; -webkit-overflow-scrolling: touch; }
.tbl {
  border-collapse: collapse; width: 100%; min-width: 520px;
  font-size: 15px;
}
.tbl caption {
  text-align: left; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint);
  padding-bottom: 10px;
}
.tbl th, .tbl td {
  text-align: left; padding: 11px 16px 11px 0; vertical-align: top;
  border-bottom: 1px solid var(--rule-soft);
}
.tbl thead th {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint);
  border-bottom: 1px solid var(--rule); padding-bottom: 8px;
}
.tbl td { color: var(--ink-soft); }
.tbl td.mono, .tbl td.num { color: var(--ink); font-size: 13px; }
.tbl th.num, .tbl td.num { text-align: right; padding-right: 20px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.flag { color: var(--seal) !important; font-size: 12px !important; white-space: nowrap; }
.tbl--bits { min-width: 620px; }
.tbl--cases { min-width: 660px; }
.tbl--ledger { min-width: 560px; }
.score-h { color: var(--verdict) !important; }
.score-l { color: var(--seal) !important; }
.score-m { color: var(--ink-soft) !important; }

.pill {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 3px 7px; white-space: nowrap;
  border: 1px solid;
}
.pill--on  { color: var(--verdict); border-color: var(--verdict); background: var(--verdict-wash); }
.pill--off { color: var(--ink-faint); border-color: var(--rule); }

/* ── bit strip ─────────────────────────────────────────────────────────── */
.bits {
  display: flex; gap: 3px; margin: 0 0 6px; flex-wrap: wrap;
}
.bit {
  width: 30px; height: 36px; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 14px;
  border: 1px solid var(--rule); color: var(--ink-faint);
  background: transparent;
}
.bit--on {
  color: var(--verdict); border-color: var(--verdict);
  background: var(--verdict-wash); font-weight: 600;
}
.bits__cap { font-size: 11px; color: var(--ink-faint); margin-bottom: 22px; letter-spacing: 0.04em; }

/* ── code ──────────────────────────────────────────────────────────────── */
.code {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.75;
  background: var(--paper); border: 1px solid var(--rule);
  border-left: 2px solid var(--ink-faint);
  padding: 16px 18px; overflow-x: auto; margin: 0 0 22px;
  color: var(--ink);
  -webkit-overflow-scrolling: touch;
}
.code code { font-family: inherit; }
.errs { font-size: 13px; line-height: 2; color: var(--ink-soft); }

/* ── function reference ────────────────────────────────────────────────── */
.fnref { margin: 0 0 8px; }
.fn { padding: 18px 0; border-top: 1px solid var(--rule-soft); }
.fn:first-child { border-top: 1px solid var(--rule); }
.fn dt {
  font-size: 13px; color: var(--ink); margin-bottom: 8px;
  overflow-x: auto; white-space: nowrap; padding-bottom: 4px;
  font-weight: 500;
}
.fn dd { margin: 0; }
.fn dd p { font-size: 15.5px; color: var(--ink-soft); max-width: var(--measure); margin-bottom: 8px; }
.fn dd p:last-child { margin-bottom: 0; }
.fn__rev {
  font-family: var(--font-mono); font-size: 12px !important; color: var(--seal) !important;
}
.fn__note {
  border-left: 2px solid var(--rule); padding-left: 12px; font-size: 14.5px !important;
}

.bullets { max-width: var(--measure); padding-left: 0; list-style: none; margin: 0 0 20px; }
.bullets li {
  position: relative; padding: 8px 0 8px 20px; font-size: 16px; color: var(--ink-soft);
  border-bottom: 1px solid var(--rule-soft);
}
.bullets li::before {
  content: "—"; position: absolute; left: 0; color: var(--ink-faint);
  font-family: var(--font-mono); font-size: 12px; top: 10px;
}

/* ── docket ────────────────────────────────────────────────────────────── */
.score { margin: 0 0 6px; }
.score__formula {
  font-size: clamp(17px, 2.6vw, 23px); letter-spacing: -0.01em;
  padding: 16px 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule);
  margin-bottom: 0;
}
.score__poles {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border-bottom: 1px solid var(--rule);
}
.score__pole { padding: 20px 24px 20px 0; }
.score__pole + .score__pole { border-left: 1px solid var(--rule); padding-left: 24px; padding-right: 0; }
.score__val { font-size: 26px; letter-spacing: -0.02em; margin-bottom: 8px; }
.score__pole--high .score__val { color: var(--verdict); }
.score__pole--low  .score__val { color: var(--seal); }
.score__pole h3 { font-size: 16.5px; letter-spacing: -0.018em; margin-bottom: 8px; }
.score__pole p { font-size: 15.5px; color: var(--ink-soft); margin-bottom: 0; }
.score__neutral {
  max-width: var(--measure); font-size: 16px; color: var(--ink-soft);
  padding-top: 18px; margin-bottom: 0;
}

.illus-flag {
  display: flex; gap: 16px; align-items: flex-start;
  border: 1px dashed var(--seal); background: var(--seal-wash);
  padding: 14px 18px; margin: 0 0 22px; max-width: var(--measure);
}
.illus-flag__stamp {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--seal); flex: 0 0 auto;
  border: 1px solid var(--seal); padding: 3px 8px; margin-top: 3px;
}
.illus-flag p { font-size: 15px; color: var(--ink-soft); margin: 0; }

/* ══════════════════════════ simulator ═══════════════════════════════════ */
.sim {
  border: 1px solid var(--rule); background: var(--paper);
  padding: 22px 24px 24px; margin: 0;
}
.sim__presets {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--rule);
}
.sim__presets-label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint); margin-right: 4px;
}
.sim__controls {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px 32px;
  margin-bottom: 26px;
}
.ctl { min-width: 0; }
.ctl__lab {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-family: var(--font-display); font-size: 13.5px; font-weight: 500;
  margin-bottom: 8px;
}
.ctl__val { font-size: 13px; color: var(--verdict); font-weight: 500; text-align: right; }
.ctl__hint {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint);
  margin: 7px 0 0;
}
.ctl__hint-dim { color: var(--ink-faint); opacity: 0.8; }
.ctl__hint--scale {
  display: flex; justify-content: space-between; gap: 4px;
  font-size: 10px; letter-spacing: 0.02em;
}
.ctl__hint--scale span:nth-child(2) { margin-left: -2%; }

/* range inputs */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; background: transparent; margin: 0; height: 22px; cursor: pointer;
  display: block;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px; background: var(--rule); border: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; margin-top: -8px;
  background: var(--leaf); border: 2px solid var(--ink); border-radius: 50%;
}
input[type="range"]::-moz-range-track { height: 2px; background: var(--rule); border: 0; }
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  background: var(--leaf); border: 2px solid var(--ink); border-radius: 50%;
}
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--focus); }
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--focus); }

/* segmented */
.ctl--seg .ctl__lab { display: block; }
.seg { display: flex; border: 1px solid var(--rule); width: fit-content; max-width: 100%; }
.seg__b {
  font-family: var(--font-display); font-size: 13px; font-weight: 500;
  background: transparent; color: var(--ink-soft); border: 0;
  padding: 7px 14px; cursor: pointer; display: flex; align-items: baseline; gap: 7px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.seg__b + .seg__b { border-left: 1px solid var(--rule); }
.seg__b:hover { color: var(--ink); }
.seg__sub { font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); }
.seg__b[aria-pressed="true"] { background: var(--ink); color: var(--leaf); }
.seg__b[aria-pressed="true"] .seg__sub { color: var(--leaf); opacity: 0.6; }

/* chart */
.sim__fig { margin: 0 0 20px; }
.trace { width: 100%; }
#trace { display: block; width: 100%; height: auto; touch-action: pan-y; }
.trace__cap {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint);
  margin-top: 8px; line-height: 1.6;
}

.tr-grid   { stroke: var(--rule-soft); stroke-width: 1; }
.tr-axis   { stroke: var(--rule); stroke-width: 1; }
.tr-guide  { stroke: var(--ink-faint); stroke-width: 1; stroke-dasharray: 2 4; opacity: 0.75; }
.tr-impact { fill: var(--seal-wash); }
.tr-back   { fill: var(--verdict-wash); }
.tr-line   { stroke: var(--ink); stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.tr-line--after { stroke: var(--verdict); }
.tr-dot    { fill: var(--ink); }
.tr-handle { fill: var(--leaf); stroke: var(--verdict); stroke-width: 2.5; cursor: ns-resize; touch-action: none; }
.tr-handle-hit { fill: transparent; cursor: ns-resize; touch-action: none; }
.tr-lab {
  font-family: var(--font-mono); font-size: 10.5px; fill: var(--ink-faint);
  letter-spacing: 0.06em;
}
.tr-lab--key { fill: var(--ink); }
.tr-lab--seal { fill: var(--seal); }
.tr-lab--verdict { fill: var(--verdict); }

/* verdict split bar */
.verdict-strip { margin: 0 0 20px; }
.vbar {
  display: flex; height: 26px; border: 1px solid var(--rule); overflow: hidden;
  background: var(--leaf-2);
}
.vbar__refund  { background: var(--verdict-wash-2); border-right: 1px solid var(--rule); }
.vbar__forfeit { background: var(--seal-wash-2); }
.vbar__refund, .vbar__forfeit { transition: width 0.18s var(--ease); }
.vbar__keys {
  display: flex; justify-content: space-between; gap: 10px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em;
  text-transform: uppercase; margin-top: 7px;
}
.k--refund  { color: var(--verdict); }
.k--forfeit { color: var(--seal); }

/* readout */
.ctl--wide { grid-column: 1 / -1; }

/* the decay ramp */
.ramp { position: relative; margin: 0 0 14px; padding-right: 26px; }
.ramp__svg { display: block; width: 100%; height: 52px; overflow: visible; }
.ramp__early { fill: var(--rule-soft); }
.ramp__fill { fill: var(--verdict-wash); }
.ramp__line { fill: none; stroke: var(--verdict); stroke-width: 1.5; stroke-linejoin: round; }
.ramp__mark { stroke: var(--ink); stroke-width: 1.5; }
.ramp__y {
  position: absolute; right: 0; font-size: 10px; color: var(--ink-faint);
  line-height: 1;
}
.ramp__y--top { top: 0; }
.ramp__y--bot { bottom: 0; }

.readout {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  margin-bottom: 18px;
}
.ro { padding: 14px 16px 14px 0; min-width: 0; }
.ro + .ro { border-left: 1px solid var(--rule-soft); padding-left: 16px; }
.ro__k {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px;
}
.ro__v {
  font-size: clamp(17px, 2.3vw, 22px); letter-spacing: -0.02em; margin-bottom: 3px;
  font-weight: 500;
}
.ro__s { font-size: 11px; color: var(--ink-faint); margin: 0; }
.ro--refund .ro__v  { color: var(--verdict); }
.ro--forfeit .ro__v { color: var(--seal); }

.sim__verdict {
  font-size: 17px; line-height: 1.5; max-width: var(--measure);
  padding: 14px 16px; background: var(--leaf-2);
  border-left: 2px solid var(--ink-faint);
  margin: 0;
}
.sim__verdict--refund  { border-color: var(--verdict); }
.sim__verdict--forfeit { border-color: var(--seal); }

/* timeline */
.timeline { margin: 0; }
.timeline__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.timeline__h {
  font-family: var(--font-display); font-size: 13.5px; font-weight: 500; margin: 0;
}
.timeline__state {
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid; padding: 3px 8px; margin: 0;
}
.timeline__state[data-s="early"]    { color: var(--ink-faint); border-color: var(--rule); }
.timeline__state[data-s="ready"]    { color: var(--verdict); border-color: var(--verdict); }
.timeline__state[data-s="decaying"] { color: var(--ink); border-color: var(--ink-faint); }
.timeline__state[data-s="expired"]  { color: var(--seal); border-color: var(--seal); }

.timeline__track {
  position: relative; height: 3px; background: var(--rule); margin: 0 0 52px;
}
.timeline__fill {
  position: absolute; left: 0; top: 0; bottom: 0; background: var(--verdict);
  transition: width 0.15s var(--ease);
}
.timeline__tick { position: absolute; top: 0; transform: translateX(-50%); }
.timeline__tick i {
  display: block; width: 1px; height: 9px; background: var(--ink-faint); margin: 0 auto;
}
.timeline__tick b, .timeline__tick small {
  display: block; text-align: center; font-family: var(--font-mono); white-space: nowrap;
}
.timeline__tick b { font-size: 11px; font-weight: 500; margin-top: 4px; color: var(--ink-soft); }
.timeline__tick small { font-size: 9px; letter-spacing: 0.1em; color: var(--ink-faint); }
.timeline__tick--end { transform: translateX(-88%); }
.timeline__read {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); margin: 0 0 4px;
}
.timeline__read-dim { color: var(--ink-faint); margin-left: 8px; }
.timeline__note {
  font-size: 15px; color: var(--ink-soft); max-width: var(--measure); margin: 8px 0 0;
}
.timeline__note--warn { color: var(--seal); }

/* ── FAQ ───────────────────────────────────────────────────────────────── */
.faq { border-top: 1px solid var(--rule); }
.q { border-bottom: 1px solid var(--rule-soft); }
.q > summary {
  list-style: none; cursor: pointer; padding: 18px 0 18px 30px;
  font-family: var(--font-display); font-size: 17px; font-weight: 500;
  letter-spacing: -0.018em; position: relative;
  max-width: var(--measure);
  transition: color 0.15s var(--ease);
}
.q > summary::-webkit-details-marker { display: none; }
.q > summary:hover { color: var(--seal); }
.q__mark {
  position: absolute; left: 0; top: 24px;
  width: 13px; height: 13px; display: block;
}
.q__mark::before, .q__mark::after {
  content: ""; position: absolute; background: var(--seal);
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.q__mark::before { left: 0; top: 6px; width: 13px; height: 1px; }
.q__mark::after  { left: 6px; top: 0; width: 1px; height: 13px; }
.q[open] .q__mark::after { transform: scaleY(0); opacity: 0; }
.q__body { padding: 0 0 22px 30px; }
.q__body p { max-width: var(--measure); font-size: 16px; color: var(--ink-soft); }
.q__body p:last-child { margin-bottom: 0; }

/* ── footer ────────────────────────────────────────────────────────────── */
.foot {
  margin-top: 64px; border-top: 1px solid var(--rule);
  padding: 34px 0 48px;
}
.foot__creed {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(16px, 2.2vw, 20px); letter-spacing: -0.02em;
  max-width: 44ch; margin-bottom: 20px; line-height: 1.34;
}
.foot__links {
  display: flex; gap: 20px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 12px; margin-bottom: 22px;
}
.foot__links a { text-decoration: none; color: var(--ink-soft); }
.foot__links a:hover { color: var(--ink); text-decoration: underline; }
.foot__legal {
  font-family: var(--font-mono); font-size: 11px; line-height: 1.8;
  color: var(--ink-faint); max-width: 62ch; margin: 0;
}

/* ══════════════════════════ responsive ══════════════════════════════════ */
@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: sticky; top: var(--hh); z-index: 30;
    max-height: none; overflow: visible;
    padding: 0; background: var(--paper); border-bottom: 1px solid var(--rule);
  }
  .rail__head, .rail__foot { display: none; }
  .rail__list {
    flex-direction: row; overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    padding: 0 14px;
  }
  .rail__list::-webkit-scrollbar { display: none; }
  .rail__tab {
    width: auto; flex: 0 0 auto; border-bottom: 0; gap: 7px;
    padding: 13px 14px; white-space: nowrap; font-size: 14.5px;
  }
  .rail__num { min-width: 0; }
  .rail__tab[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--seal); }
  .rail__tab[aria-selected="true"] .rail__txt { box-shadow: none; }
  .sheet { border-left: 0; padding: 30px 26px 0; }
}

@media (max-width: 720px) {
  body { font-size: 16.5px; }
  .sheet { padding: 26px 18px 0; }
  .parties, .score__poles { grid-template-columns: minmax(0, 1fr); }
  .party { padding: 20px 0; }
  .party + .party {
    border-left: 0; border-top: 1px solid var(--rule);
    padding-left: 0; padding-right: 0;
  }
  .score__pole { padding: 18px 0; }
  .score__pole + .score__pole {
    border-left: 0; border-top: 1px solid var(--rule); padding-left: 0;
  }
  .sim { padding: 18px 16px 20px; margin: 0 -2px; }
  .sim__controls { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .readout { grid-template-columns: 1fr 1fr; border-bottom: 0; }
  .ramp__svg { height: 44px; }
  .ro { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--rule-soft); }
  .ro + .ro { padding-left: 0; border-left: 0; }
  .ro:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--rule-soft); padding-right: 0; }
  .guesses li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .rule { margin: 34px 0; }
  .notice { padding: 22px 18px 18px; }
  .notice__stamp { left: 14px; }
  .illus-flag { flex-direction: column; gap: 10px; }
  .q > summary { padding-left: 26px; font-size: 16px; }
  .q__body { padding-left: 26px; }
  .steps li { grid-template-columns: 34px minmax(0, 1fr); gap: 0 12px; }
  .bit { width: 24px; height: 30px; font-size: 12px; }
  .timeline__tick small { display: none; }
  .timeline__track { margin-bottom: 34px; }
  .masthead__in { gap: 12px; padding: 0 14px; }
  .caption { display: none; }
}

@media (max-width: 400px) {
  .sheet { padding: 22px 14px 0; }
  .hero__h { letter-spacing: -0.04em; }
  .bit { width: 21px; height: 27px; font-size: 11px; }
  .bits { gap: 2px; }
  .readout { grid-template-columns: minmax(0, 1fr); }
  .ro:nth-child(even) { padding-left: 0; border-left: 0; }
  .seg { width: 100%; }
  .seg__b { flex: 1 1 0; justify-content: center; padding: 9px 8px; }
}

/* ── motion ────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
