/* ===================================================================
   ProcureFlow — evaluation record
   Design system, second pass.

   Studied against three Awwwards sites before this rewrite: Dalco
   (#191919 and one hot accent, display type wider than the screen),
   Jockey by TwelveLabs (#1D1C1B / #F4F3F3, no accent at all, mono
   eyebrow pills, hairline-ruled rows) and Delta Cafés (a one-colour
   palette, chapters on scroll, horizontal layout).

   What they share is austerity, and the first pass of this page did
   not have it: five colours were doing decorative work in the chrome.

   So the rule here is one line long:

       The chrome is monochrome. Colour means a decision was recorded.

   Three signals survive, and only inside data — never on a heading,
   a rule, a nav item or a border:

       jade  = written, read back, and the read-back agreed
       amber = stopped: held, or waiting for a named person
       red   = refused, or a verification that failed

   Each is still paired with a glyph and a word, so the page survives
   greyscale and colour blindness.

   Contrast on --void, measured rather than estimated:
   text 17.4:1 · muted 7.0:1 · faint 4.8:1 · jade 11.2:1
   amber 10.6:1 · red 5.8:1. The light theme is held to the same
   floor: text 16.3:1 · muted 6.7:1 · faint 4.8:1.
   =================================================================== */

/* ---- tokens ------------------------------------------------------ */
:root {
  color-scheme: dark;

  /* A warm near-black, as Dalco and Jockey both use. The old ground
     was blue-black, which made every grey look like a UI chip. */
  --void: #0e0e0f;
  --ink-0: #141416;
  --ink-1: #1a1a1d;
  --ink-2: #222226;
  --line: #2a2a2e;
  --line-2: #3a3a3f;
  --text: #f4f3f1;
  --muted: #9d9c99;
  --faint: #807f7a;

  --jade: #35e08c;
  --jade-dim: rgba(53, 224, 140, 0.12);
  --amber: #f5b544;
  --amber-dim: rgba(245, 181, 68, 0.12);
  --red: #ff4a3d;
  --red-dim: rgba(255, 74, 61, 0.12);

  --display: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gut: clamp(18px, 4vw, 56px);
  --max: 1340px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.025) inset, 0 20px 44px -28px rgba(0, 0, 0, 0.95);
  --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 44px 96px -44px rgba(0, 0, 0, 1);
}

:root[data-theme='light'] {
  color-scheme: light;
  --void: #f4f3f1;
  --ink-0: #fbfaf9;
  --ink-1: #ffffff;
  --ink-2: #eeedea;
  --line: #dddbd6;
  --line-2: #c3c0b9;
  --text: #16161a;
  --muted: #56554f;
  --faint: #6c6b66;

  --jade: #0a7444;
  --jade-dim: rgba(10, 116, 68, 0.09);
  --amber: #8a5a05;
  --amber-dim: rgba(138, 90, 5, 0.09);
  --red: #c32a1c;
  --red-dim: rgba(195, 42, 28, 0.08);

  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 14px 30px -24px rgba(16, 16, 22, 0.35);
  --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 30px 70px -44px rgba(16, 16, 22, 0.4);
}

/* ---- reset ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, p, ol, ul, dl, dd, figure, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }
code, kbd, .mono { font-family: var(--mono); font-size: 0.85em; font-weight: 500; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }

:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 3px; }

.sr {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }

.skip {
  position: absolute; left: var(--gut); top: -60px; z-index: 100;
  background: var(--text); color: var(--void);
  padding: 10px 16px; font-weight: 600; border-radius: 4px; text-decoration: none;
}
.skip:focus { top: 10px; }

/* ---- atmosphere -------------------------------------------------- */
#bg-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; opacity: 0;
  transition: opacity 1.2s var(--ease);
}
#bg-canvas.ready { opacity: 1; }

.atmos { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.atmos::before {
  content: '';
  position: absolute; inset: -50%;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.atmos::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(130% 90% at 50% 0%, transparent 42%, rgba(0, 0, 0, 0.5) 100%);
}
:root[data-theme='light'] .atmos::after {
  background: radial-gradient(130% 90% at 50% 0%, transparent 45%, rgba(16, 16, 22, 0.08) 100%);
}
:root[data-theme='light'] .atmos::before { opacity: 0.018; }

body > header, body > main, body > footer { position: relative; z-index: 2; }

/* ---- masthead ---------------------------------------------------- */
.mast {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--void) 76%, transparent);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.mast.is-stuck {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--void) 92%, transparent);
}
.mast-in { display: flex; align-items: center; gap: 20px; height: 64px; }

.brand {
  font-family: var(--display);
  font-weight: 700; letter-spacing: -0.035em; font-size: 17px;
  text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: baseline; gap: 10px;
}
.brand::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text); align-self: center;
}
.brand span {
  font-family: var(--mono); font-weight: 400; font-size: 11.5px;
  letter-spacing: 0.1em; color: var(--faint); text-transform: uppercase;
}

.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a:first-child { margin-left: auto; }
.nav a {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--faint); text-decoration: none;
  padding: 7px 11px; border-radius: 999px; white-space: nowrap;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.nav a:hover { color: var(--text); background: var(--ink-1); }
.nav a[aria-current='true'] { color: var(--text); background: var(--ink-2); }

.theme-btn {
  flex: none; width: 36px; height: 36px;
  border: 1px solid var(--line-2); background: transparent;
  border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  transition: border-color 0.25s var(--ease), transform 0.4s var(--ease);
}
.theme-btn:hover { border-color: var(--text); transform: rotate(20deg); }
.theme-btn svg { width: 16px; height: 16px; }

/* ---- progress hairline and the section thread -------------------- */
.prog {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%;
  transform: scaleX(0); transform-origin: 0 50%;
  background: var(--text); z-index: 50; pointer-events: none;
}

.thread {
  position: fixed;
  left: max(14px, calc((100vw - var(--max)) / 2 - 122px));
  top: 50%; transform: translateY(-50%);
  z-index: 30; display: grid; gap: 15px;
  opacity: 0; transition: opacity 0.6s var(--ease); pointer-events: none;
}
.thread.on { opacity: 1; pointer-events: auto; }
.thread a {
  display: grid; grid-template-columns: 26px auto; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--faint); text-decoration: none; text-transform: uppercase;
  transition: color 0.3s var(--ease);
}
.thread a i {
  display: block; height: 1px; width: 14px; background: var(--line-2);
  transition: width 0.4s var(--ease), background 0.4s var(--ease);
}
.thread a span { opacity: 0; transform: translateX(-4px); transition: opacity 0.3s var(--ease), transform 0.3s var(--ease); }
.thread a:hover, .thread a[aria-current='true'] { color: var(--text); }
.thread a:hover i, .thread a[aria-current='true'] i { width: 26px; background: var(--text); }
.thread a:hover span, .thread a[aria-current='true'] span { opacity: 1; transform: none; }
/* The word only appears where the gutter can hold it. The longest label
   measures 110px; below 1600px the gutter cannot take it, so the dash is
   left to mark the place on its own. Before this the rail sat 12px *inside*
   the text column and the label printed 122px over the paragraph, at every
   width from 1536 to 2560. */
@media (max-width: 1599px) {
  .thread a { grid-template-columns: 26px; }
  .thread a span { display: none; }
}
@media (max-width: 1500px) { .thread { display: none; } }

/* ---- type -------------------------------------------------------- */

/* The eyebrow pill, from Jockey: a tiny mono label in a hairline
   capsule, sitting above a short declarative headline. */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: 6px 13px 5px;
}
.eyebrow b { color: var(--text); font-weight: 500; }

.kicker {
  font-family: var(--mono); font-size: 11.5px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint);
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.kicker b { color: var(--text); font-weight: 500; }

h1 {
  font-family: var(--display);
  font-size: clamp(44px, 8.4vw, 124px);
  line-height: 0.9;
  letter-spacing: -0.052em;
  font-weight: 700;
  max-width: 15ch;
  margin: 28px 0 0;
}
h2 {
  font-family: var(--display);
  font-size: clamp(32px, 5.4vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 700;
}
h3 { font-family: var(--display); font-size: 19px; line-height: 1.28; letter-spacing: -0.022em; font-weight: 600; }

.lede {
  font-size: clamp(17px, 1.8vw, 20px); line-height: 1.55;
  max-width: 54ch; color: color-mix(in srgb, var(--text) 82%, var(--muted));
}
.dek { font-size: 17px; color: var(--muted); max-width: 62ch; }
.dek strong { color: var(--text); font-weight: 600; }
.dek code { color: var(--text); }
.small { font-size: 14px; color: var(--muted); }

.rev-word {
  display: inline-block; overflow: hidden; vertical-align: bottom;
  padding-bottom: 0.09em; margin-bottom: -0.09em;
}
.rev-word > i { display: inline-block; font-style: inherit; will-change: transform; }

/* ---- hero -------------------------------------------------------- */
.hero { padding: clamp(60px, 10vw, 150px) 0 clamp(48px, 7vw, 100px); position: relative; }
.hero::before {
  content: '';
  position: absolute; left: 0; right: 0; top: -10%; height: 120%;
  background: radial-gradient(68% 55% at 22% 42%, var(--void) 34%, transparent 78%);
  pointer-events: none;
}
.hero > .wrap { position: relative; }

.hero-intro {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 30px 60px; margin-top: 42px; align-items: end;
}
.prov {
  font-family: var(--mono); font-size: 12px; line-height: 1.9; color: var(--muted);
  padding: 16px 18px;
  background: color-mix(in srgb, var(--ink-0) 70%, transparent);
  border: 1px solid var(--line); border-radius: 10px;
}
.prov b { color: var(--text); font-weight: 500; }

.cue {
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: clamp(34px, 5vw, 60px);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--faint);
}
.cue i {
  display: block; width: 58px; height: 1px;
  background: var(--line-2); position: relative; overflow: hidden;
}
.cue i::after {
  content: ''; position: absolute; inset: 0; background: var(--text);
  transform-origin: 0 50%; animation: cue 2.6s var(--ease-in-out) infinite;
}
@keyframes cue {
  0% { transform: scaleX(0); }
  45% { transform: scaleX(1); }
  100% { transform: scaleX(1) translateX(100%); }
}
@media (prefers-reduced-motion: reduce) { .cue i::after { animation: none; } }

.hero-grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 46px 64px; margin-top: clamp(50px, 7vw, 92px);
  border-top: 1px solid var(--line); padding-top: 36px;
}
.run-side { align-self: start; position: sticky; top: 88px; }

.mini {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint);
  margin-bottom: 16px; display: flex; align-items: center; gap: 12px;
}
.mini::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---- run tabs and the run card ----------------------------------- */
.tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 24px; }
.tab {
  border: 1px solid var(--line-2);
  background: transparent; border-radius: 8px;
  padding: 9px 13px; font-size: 13.5px; line-height: 1.2;
  cursor: pointer; text-align: left; color: var(--muted);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease),
              transform 0.25s var(--ease), color 0.25s var(--ease);
}
.tab:hover { border-color: var(--muted); color: var(--text); transform: translateY(-1px); }
.tab[aria-selected='true'] { background: var(--text); color: var(--void); border-color: var(--text); }
.tab .t-sub { display: block; font-family: var(--mono); font-size: 10px; opacity: 0.75; margin-top: 3px; letter-spacing: 0.04em; }

.run-card {
  background: var(--ink-0); border: 1px solid var(--line);
  border-radius: 14px; padding: 24px 24px 20px; box-shadow: var(--shadow-1);
}
.rc-kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.rc-title { font-family: var(--display); font-size: clamp(24px, 2.7vw, 34px); line-height: 1.06; letter-spacing: -0.035em; font-weight: 700; margin: 11px 0 6px; }
.rc-title:focus { outline: none; }
.rc-title:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
.rc-name { font-family: var(--mono); font-size: 11.5px; color: var(--faint); word-break: break-all; }
.rc-state { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 18px 0 14px; }
.rc-exp { font-size: 13px; color: var(--muted); }
.rc-reason { font-size: 16.5px; line-height: 1.5; border-left: 1px solid var(--line-2); padding: 2px 0 2px 16px; margin: 0 0 18px; }
.rc-dl { display: grid; gap: 10px; font-size: 14px; }
.rc-dl > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.rc-dl dt { color: var(--faint); font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; padding-top: 3px; }
.rc-dl dd { min-width: 0; }
.rc-dl code { word-break: break-all; color: var(--muted); }
.ok-mark { color: var(--jade); font-weight: 600; }

/* ---- badges and chips: the only colour on the page --------------- */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  padding: 5px 10px; border-radius: 999px; border: 1px solid currentColor;
  line-height: 1.2; letter-spacing: 0.04em;
}
.b-ok { color: var(--jade); background: var(--jade-dim); }
.b-stop { color: var(--amber); background: var(--amber-dim); }
.b-fail { color: var(--red); background: var(--red-dim); }
.b-skip { color: var(--faint); border-style: dashed; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
  font-family: var(--mono); font-size: 11px; font-weight: 500; line-height: 1;
  padding: 6px 8px 5px; border: 1px solid var(--line-2); border-radius: 5px;
  white-space: nowrap; color: var(--muted);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.chip:hover { border-color: var(--muted); color: var(--text); }
.chip-key { color: var(--text); border-color: var(--muted); font-weight: 600; }
.chip-ret { border-style: dashed; color: var(--faint); }
.chip-exc { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); background: var(--amber-dim); }
.chip-lbl { font-family: var(--mono); font-size: 10.5px; color: var(--faint); margin-right: 2px; letter-spacing: 0.1em; text-transform: uppercase; }

.t-doc, .t-item, .t-id, .t-hash { font-size: 0.87em; font-weight: 500; white-space: nowrap; color: var(--text); border-bottom: 1px dotted var(--line-2); }
.t-amt { font-family: var(--mono); font-size: 0.92em; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
abbr.t-rule {
  font-family: var(--mono); font-size: 0.87em; font-weight: 600;
  text-decoration: none; border-bottom: 1px dotted currentColor; cursor: help; color: var(--muted);
}

/* ---- the vertical timeline (mobile and fallback) ----------------- */
.tl-node {
  display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 0 20px;
  position: relative; padding-bottom: 28px;
}
.tl-node::before {
  content: ''; position: absolute; left: 22px; top: 48px; bottom: -2px;
  width: 1px; background: var(--line-2); transform-origin: top;
}
.tl-node:last-child::before { display: none; }
.tl-node.after-stop::before, .tl-node.unreached::before {
  background: repeating-linear-gradient(to bottom, var(--line-2) 0 4px, transparent 4px 9px);
}
.tl-mark {
  width: 46px; height: 46px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  border: 1px solid var(--line-2); color: var(--muted);
  border-radius: 50%; background: var(--void); position: relative; z-index: 1;
}
.tl-node.gate .tl-mark { border-radius: 8px; transform: rotate(45deg) scale(0.88); }
.tl-node.gate .tl-mark span { transform: rotate(-45deg); }
.tl-node.is-stop .tl-mark { background: var(--amber); border-color: var(--amber); color: #14100a; }
.tl-node.is-fail .tl-mark { background: var(--red); border-color: var(--red); color: #190604; }
.tl-node.unreached .tl-mark { border-style: dashed; color: var(--faint); background: transparent; }

.tl-body { min-width: 0; padding-top: 5px; }
.stage { display: block; font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); margin-bottom: 5px; }
.tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.node { font-family: var(--mono); font-size: 14.5px; font-weight: 500; color: var(--text); }
.tl-node.unreached .node { color: var(--faint); }
.tl-desc { font-size: 14px; color: var(--muted); margin-top: 4px; }
.ms { font-family: var(--mono); font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }

.step {
  margin-top: 13px; padding: 15px 17px;
  background: var(--ink-0); border: 1px solid var(--line); border-radius: 10px;
}
.tl-node.is-stop .step:last-child { border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.tl-node.is-fail .step:last-child { border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.step + .step { margin-top: 8px; }
.step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 7px; }
.seq { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.detail { font-size: 15px; line-height: 1.55; }
.err { font-size: 14px; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line-2); color: var(--muted); }
.err b { font-family: var(--mono); font-size: 12.5px; color: var(--red); }

.calls { margin-top: 11px; display: grid; gap: 6px; }
.call { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13.5px; }
.call .op { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.call .res { color: var(--muted); font-size: 13px; }
.call .doc { font-family: var(--mono); font-size: 12.5px; font-weight: 500; color: var(--text); }
.verified {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  padding: 3px 8px; border: 1px solid color-mix(in srgb, var(--jade) 45%, transparent);
  background: var(--jade-dim); color: var(--jade); border-radius: 999px;
  white-space: nowrap; cursor: help; letter-spacing: 0.04em;
}
.notwritten { font-family: var(--mono); font-size: 10.5px; color: var(--faint); border: 1px dashed var(--line-2); padding: 3px 8px; border-radius: 999px; }
.rules-row { margin-top: 11px; }

.ss {
  margin-top: 11px; display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 14px; font-size: 14px;
  border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent);
  background: var(--amber-dim); border-radius: 10px; padding: 12px 14px;
}
.ss dt { font-family: var(--mono); font-size: 10.5px; font-weight: 500; color: var(--amber); padding-top: 3px; letter-spacing: 0.1em; text-transform: uppercase; }
.ss dd { min-width: 0; }
.ss .ss-x { grid-column: 1 / -1; font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--amber); }
.tl-note { font-size: 13.5px; color: var(--muted); margin-top: 7px; }

/* ---- §01b THE RAIL: the eleven nodes, read sideways --------------
   Delta Cafés runs its chapters horizontally and Awwwards files it
   under "Horizontal Layout". A procure-to-pay flow is a line with a
   direction, so reading it sideways is not a gimmick here: it is the
   shape of the thing. Desktop only; below 981px the vertical
   timeline above is the whole story. */
.rail-scene { position: relative; }
.rail-stage { overflow: hidden; }
.rail-track {
  display: flex; gap: 18px; align-items: stretch;
  padding: 6px var(--gut) 12px; width: max-content;
}
.rail-card {
  width: clamp(260px, 25vw, 330px); flex: none;
  background: var(--ink-0); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 20px 18px; display: flex; flex-direction: column; gap: 12px;
  position: relative;
}
.rail-card::after {
  content: ''; position: absolute; right: -18px; top: 50%;
  width: 18px; height: 1px; background: var(--line-2);
}
.rail-card:last-child::after { display: none; }
.rail-card.is-gate { border-color: color-mix(in srgb, var(--amber) 38%, transparent); }
.rail-card.is-stop { border-color: color-mix(in srgb, var(--amber) 55%, transparent); }
.rail-card.is-fail { border-color: color-mix(in srgb, var(--red) 55%, transparent); }
.rail-card.is-unreached { opacity: 0.45; border-style: dashed; }
.rail-n {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--faint);
  display: flex; justify-content: space-between; align-items: center;
}
.rail-name { font-family: var(--mono); font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.rail-desc { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.rail-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.rail-writes { font-family: var(--mono); font-size: 10.5px; color: var(--faint); letter-spacing: 0.06em; text-transform: uppercase; }

.rail-meter { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.rail-meter .bar2 { flex: 1; height: 1px; background: var(--line); position: relative; }
.rail-meter .bar2 i { position: absolute; left: 0; top: -1px; height: 3px; background: var(--text); width: 0; }
.rail-meter span { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }

@media (max-width: 980px) { .rail-scene { display: none; } }

/* ---- sections and chapter transitions ---------------------------- */
section[id] { scroll-margin-top: 74px; }
.sec { padding: clamp(80px, 11vw, 170px) 0 0; position: relative; }

.sec-head {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 20px 64px; border-top: 1px solid var(--line);
  padding-top: 26px; margin-bottom: clamp(34px, 5vw, 60px);
  position: relative;
}
.sec-head > i.draw {
  position: absolute; left: 0; right: 0; top: -1px; height: 1px;
  background: var(--text); transform: scaleX(0); transform-origin: 0 50%;
}
.sec-no { margin-bottom: 16px; }
.sec-head .dek { padding-top: 38px; }

/* Jockey designs the moment *between* scenes, not just the scenes.
   This is that moment: a full-bleed number and title that wipes
   through as one section hands over to the next. */
.chapter {
  height: 42vh; min-height: 260px;
  display: grid; place-items: center;
  position: relative; overflow: hidden;
  margin-top: clamp(80px, 11vw, 170px);
  border-block: 1px solid var(--line);
}
.chapter-in { display: flex; align-items: baseline; gap: clamp(16px, 3vw, 40px); padding: 0 var(--gut); }
.chapter-n {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(60px, 13vw, 190px); line-height: 0.8;
  letter-spacing: -0.06em; color: transparent;
  -webkit-text-stroke: 1px var(--line-2);
}
.chapter-t {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(22px, 3.4vw, 46px); line-height: 1;
  letter-spacing: -0.04em; max-width: 16ch;
}
.chapter-sub { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); margin-top: 12px; }

/* The marquee. Delta Cafés files this under "Text Marquee"; here it
   carries the sixteen rule ids, so the decoration is also the index. */
.ticker {
  overflow: hidden; border-block: 1px solid var(--line);
  margin-top: clamp(80px, 11vw, 160px); padding: 16px 0;
  --speed: 54s;
}
.ticker-row { display: flex; width: max-content; }
.ticker-row > div {
  display: flex; gap: 46px; padding-right: 46px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--faint); white-space: nowrap;
  animation: slide var(--speed) linear infinite;
}
.ticker-row b { color: var(--text); font-weight: 500; margin-right: 10px; }
@keyframes slide { to { transform: translateX(-100%); } }

/* ---- attacks ----------------------------------------------------- */
.cat { margin-top: 52px; }
.cat:first-child { margin-top: 0; }
.cat-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 6px 18px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 18px;
}
.cat-head h3 { font-size: 24px; letter-spacing: -0.03em; }
.cat-head h3::first-letter { text-transform: uppercase; }
.cat-count { font-family: var(--mono); font-size: 11.5px; color: var(--faint); letter-spacing: 0.1em; }
.cat-note { font-size: 14px; color: var(--muted); margin: -8px 0 18px; max-width: 72ch; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 348px), 1fr)); gap: 18px; }
.card {
  background: var(--ink-0); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 20px 18px; display: flex; flex-direction: column; gap: 13px;
  min-width: 0; position: relative; overflow: hidden;
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.card::after {
  content: ''; position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%),
              rgba(255, 255, 255, 0.055), transparent 62%);
  transition: opacity 0.4s var(--ease);
}
.card:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: var(--shadow-2); }
.card:hover::after { opacity: 1; }
.card h4 { font-family: var(--display); font-size: 18px; line-height: 1.28; letter-spacing: -0.025em; font-weight: 600; }
.card blockquote { font-size: 14.5px; line-height: 1.55; color: var(--muted); font-style: italic; }
.card blockquote::before { content: '\201C'; }
.card blockquote::after { content: '\201D'; }
.card dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 13px; font-size: 13.5px; margin-top: auto; border-top: 1px solid var(--line); padding-top: 13px; }
.card dt { color: var(--faint); font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; padding-top: 2px; }
.card dd { min-width: 0; }

.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-size: 13.5px; font-weight: 500; text-decoration: underline;
  text-underline-offset: 4px; text-decoration-color: var(--line-2);
  text-align: left; color: var(--text);
  transition: text-decoration-color 0.25s var(--ease);
}
.link-btn:hover { text-decoration-color: var(--text); }

.allowed { margin-top: 16px; }
.allowed li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.allowed .al-k { font-family: var(--mono); font-size: 10.5px; color: var(--faint); letter-spacing: 0.1em; text-transform: uppercase; }

/* ---- approval receipt, and §03 as a pinned act ------------------- */
.receipt-wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 36px 64px; align-items: start; }
.receipt {
  background: var(--ink-0); border: 1px solid var(--line);
  border-radius: 14px 14px 0 0; font-family: var(--mono);
  font-size: 13.5px; line-height: 1.65; padding: 26px 26px 22px;
  position: relative; box-shadow: var(--shadow-1);
}
.receipt::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -9px; height: 9px;
  background: radial-gradient(circle at 7px -3px, transparent 7px, var(--ink-0) 7.5px) 0 0 / 14px 9px repeat-x;
}
.rcpt-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.rcpt-row span:first-child { color: var(--faint); }
.rcpt-row span:last-child { text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.rcpt-title { font-family: var(--display); font-size: 11.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 12px; color: var(--muted); }

.diff { margin: 18px 0; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.diff-h { font-size: 10.5px; color: var(--faint); padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--ink-2); letter-spacing: 0.14em; text-transform: uppercase; }
.diff-l { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; padding: 8px 12px; align-items: baseline; }
.diff-l.minus { color: var(--faint); text-decoration: line-through; text-decoration-thickness: 1px; }
.diff-l.plus { background: var(--red-dim); color: var(--red); font-weight: 600; }
.diff-l b { font-weight: 700; text-decoration: none; }
.verdict { font-family: var(--sans); font-size: 15px; line-height: 1.55; margin-top: 18px; color: var(--muted); }
.verdict strong { color: var(--text); }

.plain-diff { font-family: var(--display); font-size: clamp(28px, 4.6vw, 58px); line-height: 1.04; letter-spacing: -0.045em; font-weight: 700; }
.plain-diff .from { color: var(--faint); text-decoration: line-through; text-decoration-thickness: 3px; }
.plain-diff .to { color: var(--red); }
.receipt-say { margin-top: 20px; font-size: 16.5px; max-width: 46ch; color: var(--muted); }
.receipt-say strong { color: var(--text); }

.is-act .receipt-wrap { align-items: start; min-height: 0; }
.is-act .sec-head { padding-top: 12px; margin-bottom: 12px; }
.is-act .sec-head h2 { font-size: clamp(24px, 2.8vw, 36px); }
.is-act .sec-head .dek { font-size: 14px; padding-top: 18px; }
.is-act .receipt { font-size: 12px; padding: 16px 18px 14px; }
.is-act .rcpt-row { padding: 4px 0; }
.is-act .diff { margin: 10px 0; }
.is-act .diff-l { padding: 4px 10px; }
.is-act .diff-h { padding: 5px 10px; }
.is-act .verdict { font-size: 13px; margin-top: 10px; }
.is-act .plain-diff { font-size: clamp(26px, 3.8vw, 46px); }
.is-act .receipt-say { font-size: 15px; margin-top: 16px; }

.beats {
  display: flex; gap: 18px; margin-bottom: 22px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--faint);
}
.beats span { display: inline-flex; align-items: center; gap: 8px; opacity: 0.38; transition: opacity 0.35s var(--ease), color 0.35s var(--ease); }
.beats span::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.beats span.on { opacity: 1; color: var(--text); }
.beats span.on:last-child { color: var(--red); }

.stamp {
  position: absolute; right: 18px; top: 16px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 7px 11px; border: 1px solid currentColor; border-radius: 4px;
  transform: rotate(-4deg); pointer-events: none;
}
.stamp-ok { color: var(--jade); background: var(--jade-dim); }
.stamp-void { color: var(--red); background: var(--red-dim); right: 16px; top: 14px; font-size: 13px; padding: 9px 14px; transform: rotate(-7deg); }
.rcpt-row.hot span:last-child { color: var(--red); }
.rcpt-row.hot span:first-child { color: var(--red); opacity: 0.8; }

@media (max-width: 980px) {
  .is-act .receipt-wrap { min-height: 0; }
  .stamp { position: static; display: inline-block; margin-bottom: 12px; transform: none; }
  .stamp-void { transform: none; }
}

/* ---- numbers ----------------------------------------------------- */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--ink-0); }
.metric { padding: 26px 22px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; min-width: 0; position: relative; }
.metric.lead { grid-column: span 2; background: var(--ink-1); }
.metric h3 { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.fig { font-family: var(--display); font-size: clamp(48px, 7vw, 96px); line-height: 0.88; letter-spacing: -0.055em; font-weight: 700; font-variant-numeric: tabular-nums; }
.metric:not(.lead) .fig { font-size: clamp(34px, 4.2vw, 58px); }
.fig-of { font-size: 16.5px; font-weight: 500; letter-spacing: -0.01em; color: var(--muted); }
.fig-unit { font-size: 0.36em; letter-spacing: 0; font-weight: 500; margin-left: 5px; color: var(--muted); }
.metric p.def { font-size: 13.5px; color: var(--muted); }
.corpus { font-family: var(--mono); font-size: 10px; color: var(--faint); margin-top: auto; padding-top: 10px; border-top: 1px dotted var(--line-2); letter-spacing: 0.08em; }
.fig.is-fail { color: var(--red); }
.num-pair { display: flex; gap: 32px; flex-wrap: wrap; }
.num-pair small { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--faint); font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 8px; }

.touch-wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 26px 64px; margin-top: 60px; align-items: start; }
.touch caption { text-align: left; font-size: 13px; color: var(--faint); padding-bottom: 12px; caption-side: top; font-family: var(--mono); letter-spacing: 0.06em; }
.touch th, .touch td { border: 1px solid var(--line); padding: 16px; text-align: left; vertical-align: top; }
.touch thead th { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.touch tbody th { font-size: 14px; font-weight: 500; width: 34%; color: var(--muted); }
.touch td { font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.touch td small { display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 400; letter-spacing: 0.08em; color: var(--faint); margin-top: 5px; text-transform: uppercase; }
.touch td.miss { background: var(--jade-dim); color: var(--jade); }
.touch td.miss.is-fail { color: var(--red); background: var(--red-dim); }

.versions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 68px; border-top: 1px solid var(--line); }
.ver { padding: 26px 28px 10px 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ver + .ver { padding-left: 28px; border-left: 1px solid var(--line); }
.ver-tag { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.ver-tag span { color: var(--faint); }
.ver-fig { font-family: var(--display); font-size: clamp(36px, 5vw, 68px); line-height: 0.9; letter-spacing: -0.055em; font-weight: 700; font-variant-numeric: tabular-nums; }
.ver-sub { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.ver-say { font-size: 15px; line-height: 1.55; color: var(--muted); }
.squares { display: flex; flex-wrap: wrap; gap: 3px; max-width: 100%; }
.squares i { width: 10px; height: 10px; background: var(--jade); display: block; border-radius: 2px; }
.squares i.f { background: transparent; border: 1px solid var(--red); }
.ver-fail { font-family: var(--mono); font-size: 11px; color: var(--faint); line-height: 1.7; }
.ver-fail b { color: var(--red); font-weight: 500; }

/* ---- policy ------------------------------------------------------ */
.pol-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; margin-bottom: 24px; color: var(--muted); }
.pol-meta code { color: var(--text); }
.rules { border-top: 1px solid var(--line); }
.rule {
  display: grid; grid-template-columns: 80px minmax(0, 6fr) minmax(0, 4fr) minmax(0, 3fr);
  gap: 8px 28px; padding: 22px 0; border-bottom: 1px solid var(--line);
  align-items: start; transition: background 0.3s var(--ease);
}
.rule:hover { background: var(--ink-0); }
.rule-id { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -0.04em; color: var(--muted); }
.rule:hover .rule-id { color: var(--text); }
.rule h3 { font-size: 17px; }
.rule-effect { font-size: 14.5px; color: var(--muted); margin-top: 5px; }
.rule-effect code { color: var(--text); }
.rule-th { font-size: 13.5px; }
.rule-th dt { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.rule-th dd { font-family: var(--mono); font-size: 12.5px; margin-bottom: 9px; color: var(--text); }
.cite { font-size: 13.5px; color: var(--muted); }
.cite-n { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.bar { height: 3px; background: var(--ink-2); margin: 9px 0; position: relative; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--text); }
.cite details { margin-top: 6px; }
.cite summary { cursor: pointer; font-size: 13px; color: var(--faint); }
.cite summary:hover { color: var(--text); }
.cite ul { margin-top: 7px; display: grid; gap: 5px; }
.cite li .link-btn { font-family: var(--mono); font-size: 11.5px; font-weight: 400; word-break: break-all; }

/* ---- ledger ------------------------------------------------------ */
.ledger-meta { display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 14px; margin-bottom: 18px; color: var(--muted); }
.ledger th, .ledger td { text-align: left; vertical-align: top; padding: 15px 16px 15px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ledger thead th { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line-2); }
.ledger tbody tr { transition: background 0.25s var(--ease); }
.ledger tbody tr:hover { background: var(--ink-0); }
.ledger td.sc .link-btn { font-family: var(--mono); font-size: 12.5px; font-weight: 500; overflow-wrap: anywhere; }
.ledger td.sc small { display: block; color: var(--faint); font-size: 12.5px; margin-top: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--faint); margin-top: 16px; }

/* ---- limits, footer, states -------------------------------------- */
.limits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 64px; }
.limits li { padding: 18px 0; border-top: 1px solid var(--line); font-size: 15.5px; color: var(--muted); }
.limits li b { display: block; font-size: 15.5px; margin-bottom: 4px; color: var(--text); font-weight: 600; }

footer { margin-top: clamp(90px, 12vw, 160px); border-top: 1px solid var(--line); padding: 36px 0 68px; }
.foot-say { font-family: var(--display); font-size: 20px; font-weight: 500; max-width: 62ch; letter-spacing: -0.025em; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 20px; font-family: var(--mono); font-size: 12px; }
.foot-links a { color: var(--faint); text-decoration: none; border-bottom: 1px solid var(--line); }
.foot-links a:hover { color: var(--text); border-bottom-color: var(--text); }

.notice { border: 1px solid color-mix(in srgb, var(--red) 50%, transparent); background: var(--red-dim); color: var(--text); padding: 18px 20px; border-radius: 10px; margin-top: 26px; font-size: 15px; }
.notice code { background: var(--ink-1); padding: 2px 6px; border-radius: 4px; }
.loading { color: var(--faint); font-size: 14px; padding: 14px 0; font-family: var(--mono); }

/* ---- the opening curtain and the pointer ring -------------------- */
.curtain { position: fixed; inset: 0; z-index: 80; background: var(--void); display: grid; place-items: center; pointer-events: none; }
.curtain p { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--faint); }

.ring {
  position: fixed; top: 0; left: 0; width: 24px; height: 24px;
  border: 1px solid rgba(244, 243, 241, 0.55); border-radius: 50%;
  pointer-events: none; z-index: 90; opacity: 0; mix-blend-mode: difference;
  transition: opacity 0.3s var(--ease), width 0.25s var(--ease), height 0.25s var(--ease);
}
.ring.on { opacity: 1; }
.ring.hot { width: 44px; height: 44px; }
@media (hover: none), (pointer: coarse) { .ring { display: none; } }

/* ---- motion ------------------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); }
  .tl-node.enter { animation: rise 0.5s var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-row > div { animation: none; }
  #bg-canvas { display: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .rail-scene { display: none; }
}

/* ---- responsive -------------------------------------------------- */
@media (max-width: 980px) {
  .hero-intro, .hero-grid, .sec-head, .receipt-wrap, .touch-wrap { grid-template-columns: minmax(0, 1fr); }
  .run-side { position: static; }
  .sec-head .dek { padding-top: 0; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rule { grid-template-columns: 58px minmax(0, 1fr) minmax(0, 210px); }
  .rule .rule-th { grid-column: 2; }
  .rule .cite { grid-column: 3; grid-row: 1 / span 2; }
  .limits { grid-template-columns: minmax(0, 1fr); }
  .chapter { height: 32vh; min-height: 200px; }
  .chapter-in { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 720px) {
  .mast-in { gap: 10px; height: 58px; }
  .brand span { display: none; }
  .nav a { padding: 6px 8px; font-size: 11.5px; }
  .versions { grid-template-columns: minmax(0, 1fr); }
  .ver { padding: 24px 0 18px; }
  .ver + .ver { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .rule { grid-template-columns: 50px minmax(0, 1fr); }
  .rule .rule-th, .rule .cite { grid-column: 2; grid-row: auto; }
  .ledger thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ledger tr { display: block; border-bottom: 1px solid var(--line); padding: 12px 0; }
  .ledger td { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; border: 0; padding: 6px 0; }
  .ledger td::before {
    content: attr(data-label); font-family: var(--mono); font-size: 10px;
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); padding-top: 3px;
  }
  .rc-dl > div { grid-template-columns: minmax(0, 1fr); gap: 5px; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .metrics { grid-template-columns: minmax(0, 1fr); }
  .metric.lead { grid-column: auto; }
  .tl-node { grid-template-columns: 38px minmax(0, 1fr); gap: 0 13px; }
  .tl-mark { width: 38px; height: 38px; font-size: 12px; }
  .tl-node::before { left: 18px; top: 40px; }
  .step { padding: 13px; }
  .run-card { padding: 19px 17px 15px; }
  .receipt { padding: 19px 17px 17px; font-size: 12.5px; }
  .rcpt-row { grid-template-columns: minmax(0, 1fr); }
  .rcpt-row span:last-child { text-align: left; }
}

@media print {
  .mast, .tabs, .theme-btn, .link-btn, .skip, .thread, .ring, #bg-canvas,
  .atmos, .ticker, .chapter, .rail-scene, .prog { display: none !important; }
  .run-side { position: static; }
  body { background: #fff; color: #000; }
}
