/* GodEngine Decision API (godengine.io)
   Concept: "the record". The site reads like an engineering ledger: numbered
   sections, a mono-led type scale, drafting-paper grid in light mode and a
   night-ledger in dark mode, GodEngine gold (hue 82) as the only brand accent.
   No external fonts, no inline styles. Works under default-src 'self'. */

:root {
  color-scheme: light dark;

  --bg: #f4f1e8;
  --surface: #fbfaf5;
  --surface-2: #ebe6d6;
  --ink: #191c1a;
  --ink-2: #4a504b;
  --line: #cfc7b0;
  --line-soft: #e2dccb;
  --grid: rgba(122, 86, 0, 0.07);
  --accent: #e3b341;
  --on-accent: #1a1708;
  --accent-text: #7a5600;
  --accent-soft: rgba(227, 179, 65, 0.22);
  --ok: #1d6a44;
  --ok-soft: rgba(29, 106, 68, 0.12);
  --bad: #a1351d;
  --bad-soft: rgba(161, 53, 29, 0.1);
  --warn: #8a4a00;
  --warn-soft: rgba(138, 74, 0, 0.12);

  --code-bg: #111513;
  --code-head: #1a201d;
  --code-line: #2b3430;
  --code-fg: #e6e2d4;
  --tk-key: #e9c25c;
  --tk-str: #9ed6b5;
  --tk-num: #f2a68e;
  --tk-com: #9aa49e;
  --tk-flag: #b9c7f0;
  --tk-kw: #d7a8f0;

  --mono: ui-monospace, "Cascadia Code", "SF Mono", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;

  /* Minor-third scale, tight for reference reading */
  --step--1: 0.84rem;
  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-2: 1.44rem;
  --step-3: clamp(1.5rem, 1.3rem + 0.9vw, 1.73rem);
  --step-4: clamp(1.9rem, 1.35rem + 2.6vw, 3rem);

  --radius: 6px;
  --wrap: 72rem;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1110;
    --surface: #151a18;
    --surface-2: #1c2320;
    --ink: #e9e6dc;
    --ink-2: #a7b0a9;
    --line: #2c3531;
    --line-soft: #222a27;
    --grid: rgba(230, 189, 79, 0.05);
    --accent: #e3b341;
    --on-accent: #1a1708;
    --accent-text: #e6bd4f;
    --accent-soft: rgba(227, 179, 65, 0.16);
    --ok: #74d3a3;
    --ok-soft: rgba(116, 211, 163, 0.12);
    --bad: #f19480;
    --bad-soft: rgba(241, 148, 128, 0.12);
    --warn: #f0b866;
    --warn-soft: rgba(240, 184, 102, 0.12);
    --code-bg: #0a0d0c;
    --code-head: #131816;
    --code-line: #252e2a;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; }

a {
  color: var(--accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }

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

::selection { background: var(--accent-soft); color: var(--ink); }

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

.mono { font-family: var(--mono); }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
}
.skip:focus { top: 0.75rem; }

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

/* ─── header ─────────────────────────────────────────────── */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-weight: 700; letter-spacing: -0.01em; font-size: 1.06rem; }
.brand-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  border: 1px solid var(--line);
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
}

.bm-frame { fill: var(--ink); }
.bm-line { stroke: var(--bg); stroke-width: 2.2; fill: none; stroke-linecap: round; }
.bm-hot { stroke: var(--accent); stroke-width: 2.6; fill: none; stroke-linecap: round; }
.bm-node { fill: var(--bg); }
.bm-node-hot { fill: var(--accent); }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.94rem;
  border-radius: 4px;
}
.site-nav a:hover { color: var(--ink); background: var(--surface-2); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--accent-soft);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.beta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--warn);
  background: var(--warn-soft);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}
.beta-pill .dot {
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

@media (max-width: 760px) {
  .head-row { gap: 0.4rem 0.75rem; }
  .site-nav { order: 3; width: 100%; }
  .site-nav ul { gap: 0.1rem; }
  .site-nav a { padding: 0.3rem 0.45rem; font-size: 0.9rem; }
}

/* ─── typography ─────────────────────────────────────────── */

h1, h2, h3, h4 {
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
}
h1 { font-size: var(--step-4); font-weight: 750; letter-spacing: -0.03em; }
h2 { font-size: var(--step-3); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 650; }
h4 { font-size: var(--step-0); font-weight: 650; }

p, ul, ol, dl, table, pre, figure { margin: 0 0 1rem; }

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 0.08em 0.32em;
  border-radius: 3px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-text);
  margin-bottom: 0.9rem;
}

.lede { font-size: var(--step-1); line-height: 1.55; max-width: 40rem; }
.muted, .fine { color: var(--ink-2); }
.fine { font-size: var(--step--1); }

/* ─── buttons ────────────────────────────────────────────── */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 1rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent-text); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover { background: #ecc35c; border-color: #ecc35c; }

/* ─── hero ───────────────────────────────────────────────── */

.hero {
  border-bottom: 1px solid var(--line);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2.5rem, 5vw, 4rem);
}
.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}
@media (min-width: 980px) {
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
}
.hero h1 .hl {
  display: block;
  color: var(--accent-text);
}
.cursor {
  display: inline-block;
  width: 0.55em;
  height: 0.9em;
  margin-left: 0.08em;
  vertical-align: -0.08em;
  background: var(--accent);
  /* Four blinks, then it stays lit: blinking stops well inside five seconds. */
  animation: blink 1.1s steps(1) 4;
}
@keyframes blink { 50% { opacity: 0; } }

.exchange { margin: 0; display: grid; gap: 0.75rem; min-width: 0; }
.exchange-arrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--ink-2);
  padding-left: 0.5rem;
}
.exchange-arrow svg { width: 18px; height: 18px; }
.arrow-path { stroke: var(--accent-text); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.exchange figcaption { font-size: var(--step--1); color: var(--ink-2); }
.exchange .code { margin-bottom: 0; }
.exchange .code pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.8rem; }

/* ─── code blocks ────────────────────────────────────────── */

.code {
  margin: 0 0 1.25rem;
  background: var(--code-bg);
  border: 1px solid var(--code-line);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem 0.35rem 0.85rem;
  background: var(--code-head);
  border-bottom: 1px solid var(--code-line);
  font-family: var(--mono);
  font-size: 0.76rem;
  color: #c9c4b4;
  letter-spacing: 0.02em;
}
.code-head .tag { color: var(--tk-key); text-transform: uppercase; letter-spacing: 0.08em; }
.code pre {
  margin: 0;
  padding: 0.9rem 1rem 1rem;
  overflow-x: auto;
  color: var(--code-fg);
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.6;
  tab-size: 2;
}
.code pre:focus-visible { outline-offset: -3px; }
.code code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
  border-radius: 0;
}
.copy-btn {
  font: inherit;
  font-size: 0.74rem;
  color: #e6e2d4;
  background: transparent;
  border: 1px solid #3a4540;
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
  min-height: 28px;
  cursor: pointer;
}
.copy-btn:hover { border-color: var(--tk-key); color: var(--tk-key); }
.copy-btn:focus-visible { outline-color: var(--tk-key); }

.tk-key { color: var(--tk-key); }
.tk-str { color: var(--tk-str); }
.tk-num { color: var(--tk-num); }
.tk-com { color: var(--tk-com); font-style: italic; }
.tk-flag { color: var(--tk-flag); }
.tk-kw { color: var(--tk-kw); }

/* ─── sections ───────────────────────────────────────────── */

.band { padding: clamp(2.5rem, 5vw, 4rem) 0; border-bottom: 1px solid var(--line); }
.band-alt { background: var(--surface); }
.band-head { max-width: 46rem; margin-bottom: 2rem; }
.band-head p { color: var(--ink-2); }

.sec-no {
  display: inline-block;
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--accent-text);
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 0 0.35rem;
  margin-right: 0.6rem;
  vertical-align: 0.3em;
  letter-spacing: 0.04em;
}

/* ─── property ledger (home) ─────────────────────────────── */

.ledger {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.ledger li {
  padding: 1.25rem 1.25rem 1.1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.band-alt .ledger li { background: var(--bg); }
.ledger .k {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-text);
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
}
.ledger h3 { margin-bottom: 0.4rem; }
.ledger p { margin: 0; color: var(--ink-2); }

/* ─── reversal diagram ───────────────────────────────────── */

.diagram {
  margin: 0 0 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
.band-alt .diagram { background: var(--bg); }
.diagram-scroll { overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 600px; height: auto; }
.diagram figcaption { margin-top: 0.75rem; font-size: var(--step--1); color: var(--ink-2); }

.rv-axis { stroke: var(--ink-2); stroke-width: 1.5; }
.rv-tick { stroke: var(--ink-2); stroke-width: 1.2; }
.rv-band { fill: var(--surface-2); stroke: var(--line); }
.rv-band-hot { fill: var(--accent-soft); stroke: var(--accent-text); stroke-width: 1.5; }
.rv-band-none { fill: url(#rv-hatch); stroke: var(--ink-2); stroke-dasharray: 4 3; }
.rv-hatch-line { stroke: var(--line); stroke-width: 2; }
.rv-arrow { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.rv-switch { stroke: var(--bad); stroke-width: 2; stroke-dasharray: 5 4; }
.rv-budget { stroke: var(--accent-text); stroke-width: 2; }
.rv-dot { fill: var(--accent); stroke: var(--accent-text); stroke-width: 1.5; }
.rv-label { fill: var(--ink); font-family: var(--sans); font-size: 15px; font-weight: 600; }
.rv-sub { fill: var(--ink-2); font-family: var(--mono); font-size: 12.5px; }
.rv-hot { fill: var(--accent-text); font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.rv-bad { fill: var(--bad); font-family: var(--mono); font-size: 12.5px; }

.readout {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}
.readout li {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--line);
}
.readout .when { font-family: var(--mono); font-size: 0.86rem; color: var(--accent-text); }
@media (max-width: 520px) {
  .readout li { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* ─── status panel ───────────────────────────────────────── */

.status-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.band-alt .status-panel { background: var(--bg); }
.status-row {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  gap: 0.5rem 1rem;
  align-items: baseline;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--line);
}
.status-row:last-child { border-bottom: 0; }
.status-row dt { font-weight: 650; }
.status-row dd { margin: 0; }
@media (max-width: 560px) {
  .status-row { grid-template-columns: 1fr; }
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.chip::before {
  content: "";
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}
.chip.is-ok { color: var(--ok); background: var(--ok-soft); }
.chip.is-warn { color: var(--warn); background: var(--warn-soft); }
.chip.is-down { color: var(--bad); background: var(--bad-soft); }
.chip.is-unknown { color: var(--ink-2); background: var(--surface-2); }
.status-note { display: block; margin-top: 0.3rem; font-size: var(--step--1); color: var(--ink-2); }

/* ─── next links ─────────────────────────────────────────── */

.next {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.next a {
  display: block;
  height: 100%;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}
.next a:hover { border-color: var(--accent-text); }
.next .path { display: block; font-family: var(--mono); font-size: 0.78rem; color: var(--accent-text); margin-bottom: 0.3rem; }
.next strong { display: block; font-size: var(--step-1); margin-bottom: 0.25rem; }
.next span.d { color: var(--ink-2); font-size: 0.95rem; }

/* ─── docs layout ────────────────────────────────────────── */

.page-head {
  padding: clamp(2rem, 5vw, 3.5rem) 0 1.75rem;
  border-bottom: 1px solid var(--line);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
.page-head h1 { font-size: clamp(1.8rem, 1.4rem + 1.8vw, 2.5rem); }
.page-head .lede { margin-bottom: 0; }

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-2);
}
.crumbs li + li::before { content: "/"; margin-right: 0.35rem; color: var(--line); }
.crumbs a { color: var(--ink-2); }

.docs {
  display: grid;
  gap: 2rem;
  padding-top: 2rem;
  padding-bottom: 3rem;
}
@media (min-width: 980px) {
  .docs { grid-template-columns: 14.5rem minmax(0, 1fr); gap: 3rem; }
  .toc { position: sticky; top: 5rem; align-self: start; max-height: calc(100vh - 6rem); overflow-y: auto; }
}

.toc {
  font-size: 0.92rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.9rem 1rem;
}
.toc h2 {
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  margin-bottom: 0.5rem;
}
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: flex;
  gap: 0.5rem;
  padding: 0.3rem 0;
  color: var(--ink);
  text-decoration: none;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-text);
  padding-top: 0.1rem;
}
.toc a:hover { color: var(--accent-text); text-decoration: underline; }

.doc { min-width: 0; max-width: 50rem; }
.doc > section { padding-bottom: 1.75rem; margin-bottom: 2rem; border-bottom: 1px solid var(--line); }
.doc > section:last-child { border-bottom: 0; }
.doc h2 { scroll-margin-top: 5rem; }
.doc h3 { margin-top: 1.75rem; scroll-margin-top: 5rem; }
.doc ul, .doc ol { padding-left: 1.3rem; }
.doc li { margin-bottom: 0.35rem; }

.route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.95rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 1rem;
}
.verb {
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  padding: 0.12rem 0.45rem;
  border-radius: 3px;
  background: var(--accent);
  color: var(--on-accent);
}
.verb-get { background: var(--ok-soft); color: var(--ok); }
.route .scope { margin-left: auto; font-size: 0.78rem; color: var(--ink-2); }

/* ─── tables ─────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  margin: 0;
}
caption {
  text-align: left;
  padding: 0.6rem 0.85rem;
  font-weight: 650;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--line-soft);
}
thead th {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 600; }
td code, th code { white-space: nowrap; }
.num-col { white-space: nowrap; font-family: var(--mono); }

/* ─── callouts ───────────────────────────────────────────── */

.note {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin: 0 0 1.25rem;
}
.note p:last-child, .note ul:last-child { margin-bottom: 0; }
.note-warn { border-left-color: var(--warn); background: var(--warn-soft); }
.note-bad { border-left-color: var(--bad); background: var(--bad-soft); }
.note strong:first-child { font-family: var(--mono); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; margin-right: 0.35rem; }

/* ─── steps (quick start) ────────────────────────────────── */

.steps { list-style: none; padding: 0 !important; margin: 0; counter-reset: step; }
.steps > li {
  position: relative;
  counter-increment: step;
  padding: 0 0 1.5rem 3.25rem;
  margin: 0;
  border-left: 2px solid var(--line);
  margin-left: 1rem;
  padding-left: 2.25rem;
}
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: -1.05rem;
  top: -0.1rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 50%;
}
.steps h2, .steps h3 { margin-top: 0; }

/* ─── pipeline (record page) ─────────────────────────────── */

.pipeline { list-style: none; margin: 0 0 1.25rem; padding: 0 !important; }
.pipeline > li {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 0.85rem;
  margin: 0;
  padding-bottom: 1rem;
}
.pipeline .stage {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 1.5px solid var(--accent-text);
  border-radius: 4px;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent-text);
  background: var(--surface);
}
.pipeline h3 { margin: 0.35rem 0 0.3rem; }
.pipeline p { margin: 0; color: var(--ink-2); }

.assess {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0 !important;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}
.assess li {
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
}
.assess .k { display: block; font-family: var(--mono); font-size: 0.85rem; color: var(--accent-text); margin-bottom: 0.25rem; }
.assess .q { display: block; font-weight: 650; margin-bottom: 0.3rem; }
.assess p { margin: 0; color: var(--ink-2); font-size: 0.93rem; }

/* ─── FAQ ────────────────────────────────────────────────── */

.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 0.6rem;
}
.faq summary {
  cursor: pointer;
  padding: 0.8rem 1rem;
  font-weight: 650;
  list-style-position: inside;
}
.faq details[open] summary { border-bottom: 1px solid var(--line-soft); }
.faq .a { padding: 0.75rem 1rem 0.25rem; }

.contact-list { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.contact-list a { font-family: var(--mono); }

.two-col { display: grid; gap: 1.5rem; }
@media (min-width: 860px) { .two-col { grid-template-columns: 1fr 1fr; } }

.check, .cross { list-style: none; padding-left: 0 !important; }
.check li, .cross li { position: relative; padding-left: 1.6rem; }
.check li::before, .cross li::before {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--mono);
  font-weight: 700;
}
.check li::before { content: "+"; color: var(--ok); }
.cross li::before { content: "\2013"; color: var(--bad); }

/* ─── 404 ────────────────────────────────────────────────── */

.notfound { padding: clamp(3rem, 8vw, 6rem) 0; }
.notfound .code-big {
  font-family: var(--mono);
  font-size: clamp(3rem, 2rem + 6vw, 6rem);
  font-weight: 700;
  color: var(--accent-text);
  line-height: 1;
  margin-bottom: 1rem;
}

/* ─── footer ─────────────────────────────────────────────── */

.site-foot {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 2rem;
  font-size: 0.93rem;
}
.foot-grid {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 860px) {
  .foot-grid { grid-template-columns: 1.2fr 1fr; }
}
.foot-brand { font-weight: 700; margin-bottom: 0.3rem; }
.foot-nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; }
.foot-nav a { color: var(--ink-2); }
.disclaimer {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
  color: var(--ink-2);
  font-size: var(--step--1);
}

/* ─── motion ─────────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .btn, .next a, .site-nav a, .copy-btn { transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .site-head, .toc, .copy-btn, .skip { display: none !important; }
  .code pre { white-space: pre-wrap; }
}

/* ─── phones: wide tables keep their columns and scroll inside the region ── */
@media (max-width: 640px) {
  table.wide { min-width: 36rem; }
  th, td { padding: 0.5rem 0.65rem; }
  .diagram svg { min-width: 560px; }
}

/* Scroll shadows: a soft edge shows when a table region can scroll sideways. */
.table-wrap {
  background:
    linear-gradient(to right, var(--surface) 30%, rgba(0, 0, 0, 0)) left center / 2rem 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, rgba(0, 0, 0, 0)) right center / 2rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) left center / 0.8rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) right center / 0.8rem 100% no-repeat scroll,
    var(--surface);
}
