/*
 * FACTUM public site. The chrome is the Console's: two self-hosted faces, the warm neutrals,
 * five verdict hues and nothing else. A hue reaches an element only through a verdict class
 * (.v-*), and every verdict also carries its word and its border pattern, so the page reads
 * the same in grayscale. Tokens come from tokens.css (generated from src/tokens.mjs).
 */
@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("/assets/fonts/SourceSerif4Variable-Roman.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4"; font-style: italic; font-weight: 200 900; font-display: swap;
  src: url("/assets/fonts/SourceSerif4Variable-Italic.woff2") format("woff2");
}
@font-face {
  font-family: "Source Code Pro"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("/assets/fonts/SourceCodeVF-Upright.woff2") format("woff2");
}
@font-face {
  font-family: "Serif Fallback"; src: local("Palatino Linotype"), local("Book Antiqua"), local("Georgia");
  size-adjust: 97%; ascent-override: 92%; descent-override: 28%; line-gap-override: 0%;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-text); font-size: var(--t3); line-height: var(--t3-lh);
  font-optical-sizing: auto; font-variant-numeric: lining-nums;
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, pre, table { margin: 0; }
ul, ol { padding: 0; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--rule-strong); transition: text-decoration-color var(--d1) var(--ease-out); }
a:hover { text-decoration-color: var(--ink); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
code, pre, kbd, samp, .mono { font-family: var(--font-mono); }
.mono { font-size: 0.88em; overflow-wrap: anywhere; }
code { font-size: 0.88em; overflow-wrap: anywhere; }
.tnum { font-variant-numeric: tabular-nums lining-nums; }
.quiet { color: var(--ink-muted); }
.small { font-size: var(--t1); line-height: var(--t1-lh); }
.tiny { font-size: var(--t0); line-height: var(--t0-lh); }
.skip { position: absolute; left: -999px; top: 0; background: var(--panel); padding: var(--s2) var(--s3); z-index: 20; }
.skip:focus { left: var(--s3); top: var(--s3); }

.mt2 { margin-top: var(--s2); } .mt3 { margin-top: var(--s3); } .mt4 { margin-top: var(--s4); } .mt5 { margin-top: var(--s5); } .mt6 { margin-top: var(--s6); } .mb2 { margin-bottom: var(--s2); } .mb3 { margin-bottom: var(--s3); }

/* ── the one top line ───────────────────────────────────────────────────── */
.wrap { width: 100%; max-width: 70rem; margin: 0 auto; padding: 0 var(--s6); }
.topline { border-bottom: 1px solid var(--rule); }
.topline .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2) var(--s6); flex-wrap: wrap; padding-top: var(--s4); padding-bottom: var(--s3); }
.wordmark { font-weight: 600; letter-spacing: 0.18em; font-size: var(--t4); line-height: var(--t4-lh); font-variation-settings: "opsz" 60; text-decoration: none; color: var(--ink); }
.nav { display: flex; flex-wrap: wrap; gap: 2px 20px; font-size: var(--t2); line-height: var(--t2-lh); }
.nav a { color: var(--ink-muted); text-decoration: none; padding: 3px 0; border-bottom: 2px solid transparent; transition: color var(--d1) var(--ease-out), border-color var(--d1) var(--ease-out); }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.nav a.door { color: var(--ink); }
.nav a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--rule-strong); }
.nav-toggle { all: unset; display: none; cursor: pointer; font-size: var(--t2); line-height: var(--t2-lh); padding: 3px 0; border-bottom: 2px solid var(--ink); }
.nav-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ── page furniture ─────────────────────────────────────────────────────── */
main { flex: 1; }
.page { padding-top: var(--s8); padding-bottom: var(--s8); }
.page-head { max-width: 46rem; margin-bottom: var(--s7); }
.eyebrow { font-size: var(--t1); line-height: var(--t1-lh); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-muted); margin-bottom: var(--s3); }
.page-title { font-size: var(--t6); line-height: var(--t6-lh); font-weight: 600; font-variation-settings: "opsz" 60; text-wrap: balance; letter-spacing: -0.005em; }
.lede { font-size: var(--t4); line-height: var(--t4-lh); margin-top: var(--s4); max-width: 40rem; text-wrap: pretty; }
.section { margin-top: var(--s8); }
.section > h2, .h2 { font-size: var(--t5); line-height: var(--t5-lh); font-weight: 600; text-wrap: balance; margin-bottom: var(--s3); }
.label { font-size: var(--t1); line-height: var(--t1-lh); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; border-bottom: 1px solid var(--rule-strong); padding-bottom: 6px; margin: var(--s6) 0 var(--s3); }
h3 { font-size: var(--t4); line-height: var(--t4-lh); font-weight: 600; margin: var(--s5) 0 var(--s2); }
.prose { max-width: 40rem; }
.prose p + p, .prose p + ul, .prose ul + p, .prose p + ol, .prose ol + p, .prose p + .verbatim, .prose .verbatim + p { margin-top: var(--s3); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: var(--s1); }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6) var(--s7); }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); }
.split { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: var(--s5) var(--s7); align-items: start; }
.note { border-left: 3px solid var(--rule-strong); padding-left: var(--s3); color: var(--ink-muted); font-size: var(--t2); line-height: var(--t2-lh); max-width: 40rem; }
.steps { list-style: none; counter-reset: step; display: grid; gap: var(--s5); }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: 0 var(--s3); }
.steps > li::before { content: counter(step); font-family: var(--font-mono); font-size: var(--t4); line-height: var(--t4-lh); font-weight: 600; border-top: 3px solid var(--ink); padding-top: var(--s1); }
.steps h3 { margin-top: 0; border-top: 1px solid var(--rule-strong); padding-top: var(--s1); }

/* ── a sheet on the ground: the one depth cue (one shadow token) ─────────── */
.sheet { background: var(--panel); border: 1px solid var(--rule); box-shadow: var(--shadow); padding: var(--s6); }
.sheet > :first-child { margin-top: 0; }
.sheet .label:first-child { margin-top: 0; }
.plain { border: 1px solid var(--rule); background: var(--panel); padding: var(--s4) var(--s5); }

/* ── buttons and fields ─────────────────────────────────────────────────── */
.button {
  display: inline-block; border: 1px solid var(--rule-strong); background: var(--panel); color: var(--ink);
  padding: 6px 12px; font: inherit; font-size: var(--t2); font-weight: 500; line-height: var(--t2-lh); cursor: pointer; text-decoration: none;
  transition: background var(--d1) var(--ease-out), border-color var(--d1) var(--ease-out);
}
.button:hover { background: var(--raised); }
.button.primary { border-color: var(--ink); border-width: 1px; box-shadow: inset 0 -2px 0 var(--ink); }
.button[aria-pressed="true"] { background: var(--raised); border-color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; margin-top: var(--s4); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: var(--t1); line-height: var(--t1-lh); color: var(--ink-muted); }
.field input, .field select, .field textarea {
  border: 1px solid var(--rule-strong); background: var(--panel); color: var(--ink); border-radius: 0;
  padding: 7px var(--s2); font: inherit; font-size: var(--t3); line-height: var(--t2-lh); width: 100%;
}
.field textarea.mono { font-family: var(--font-mono); font-size: 13px; line-height: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.form-grid .wide { grid-column: 1 / -1; }

/* ── tables ─────────────────────────────────────────────────────────────── */
.scroll-x { overflow-x: auto; max-width: 100%; }
table.ledger { width: 100%; border-collapse: collapse; font-size: var(--t2); line-height: var(--t2-lh); font-variant-numeric: tabular-nums lining-nums; }
table.ledger th {
  text-align: left; font-weight: 600; font-size: var(--t1); line-height: var(--t1-lh); text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--ink-muted); border-bottom: 1px solid var(--rule-strong); padding: 6px var(--s2); vertical-align: bottom;
}
table.ledger td { border-bottom: 1px solid var(--hair); padding: 7px var(--s2); vertical-align: top; }
table.ledger td.code, table.ledger th.code { font-family: var(--font-mono); font-size: var(--t1); }
table.ledger td.brk { overflow-wrap: anywhere; }
table.ledger td.nowrap, table.ledger th.nowrap { white-space: nowrap; }
table.ledger tr > :first-child { padding-left: 0; }
table.ledger tr > :last-child { padding-right: 0; }
.kv { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 6px var(--s4); font-size: var(--t2); line-height: var(--t2-lh); font-variant-numeric: tabular-nums lining-nums; }
.kv dt { color: var(--ink-muted); }
.kv dd { overflow-wrap: anywhere; }

/* ── verdict chips: hue + word + border pattern, never hue alone ────────── */
.chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  border: 1px solid var(--rule-strong); border-left-width: 4px;
  padding: 1px 8px 1px 7px; margin: 0 6px 6px 0;
  font-size: var(--t1); line-height: var(--t1-lh); color: var(--ink); background: transparent; white-space: nowrap;
}
.chip .chip-word { font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.chip .chip-code { font-family: var(--font-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.chip.lg { font-size: var(--t2); line-height: var(--t2-lh); padding: 2px 10px 2px 9px; }
.chip.v-neutral { border-left-color: var(--ink-muted); }
.v-located { border-left-color: var(--verdict-located); border-left-style: solid; background: color-mix(in oklab, var(--verdict-located) var(--tint), var(--panel)); }
.v-absent { border-left-color: var(--verdict-absent); border-left-style: dashed; background: color-mix(in oklab, var(--verdict-absent) var(--tint), var(--panel)); }
.v-refused { border-left-color: var(--verdict-refused); border-left-style: double; background: color-mix(in oklab, var(--verdict-refused) var(--tint), var(--panel)); }
.v-annotation { border-left-color: var(--verdict-annotation); border-left-style: dotted; background: color-mix(in oklab, var(--verdict-annotation) var(--tint), var(--panel)); }
.v-tampered { border-left-color: var(--verdict-tampered); border-left-style: groove; background: color-mix(in oklab, var(--verdict-tampered) var(--tint), var(--panel)); }
.legend { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--s2) var(--s4); align-items: baseline; font-size: var(--t2); line-height: var(--t2-lh); }
.legend .chip { margin: 0; }

/* ── machine text ───────────────────────────────────────────────────────── */
.verbatim {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 19px; white-space: pre-wrap;
  overflow-wrap: anywhere; border: 1px solid var(--rule); background: var(--panel); padding: var(--s3) var(--s4); tab-size: 2;
}
.verbatim.on-raised { background: var(--paper); }
.verbatim .hl { background: color-mix(in oklab, var(--verdict-located) 16%, transparent); outline: 1px solid var(--verdict-located); }
.verbatim .hl-bad { background: color-mix(in oklab, var(--verdict-tampered) 16%, transparent); outline: 1px solid var(--verdict-tampered); }
.verbatim .elide { color: var(--ink-muted); }
.caption { font-size: var(--t1); line-height: var(--t1-lh); color: var(--ink-muted); margin-top: var(--s2); max-width: 46rem; }
.recorded { display: flex; flex-wrap: wrap; gap: 2px var(--s3); align-items: baseline; border: 1px solid var(--rule); border-left: 4px solid var(--ink); background: var(--raised); padding: var(--s2) var(--s3); font-size: var(--t1); line-height: var(--t1-lh); margin-bottom: var(--s3); }
.recorded b { text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.cmd { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; border: 1px solid var(--rule-strong); background: var(--panel); }
.cmd pre { font-size: 13px; line-height: 20px; padding: var(--s3) var(--s4); white-space: pre-wrap; overflow-wrap: anywhere; }
.cmd pre::before { content: "$ "; color: var(--ink-faint); }
.cmd .copy { border: none; border-left: 1px solid var(--rule-strong); background: transparent; color: var(--ink-muted); font: inherit; font-size: var(--t1); padding: 0 var(--s3); cursor: pointer; transition: background var(--d1) var(--ease-out); }
.cmd .copy:hover { background: var(--raised); color: var(--ink); }
.hash { font-family: var(--font-mono); font-size: var(--t1); line-height: var(--t1-lh); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* ── the instrument: a certificate drawn as the Console draws it ────────── */
.certificate { background: var(--panel); border: 1px solid var(--rule); box-shadow: var(--shadow); padding: var(--s7) var(--s7) var(--s6); }
.letterhead { padding-bottom: var(--s4); border-bottom: 3px solid var(--ink); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 20rem); gap: var(--s2) var(--s6); align-items: end; }
.letterhead .wordmark { font-size: var(--t6); line-height: var(--t6-lh); }
.lh-title { font-size: var(--t4); line-height: var(--t4-lh); font-weight: 500; margin-top: var(--s3); max-width: 34ch; text-wrap: balance; }
.lh-sub { font-size: var(--t1); line-height: var(--t1-lh); color: var(--ink-muted); margin-top: var(--s1); }
.lh-id { text-align: right; font-size: var(--t1); line-height: var(--t1-lh); color: var(--ink-muted); min-width: 0; }
.lh-id .lh-label { text-transform: uppercase; letter-spacing: 0.1em; font-size: var(--t0); line-height: var(--t0-lh); display: block; }
.lh-id .lh-label:not(:first-child) { margin-top: var(--s2); }
.lh-id .lh-hash { font-family: var(--font-mono); font-size: var(--t1); color: var(--ink); display: block; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.certificate h2, .cert-h { font-size: var(--t1); line-height: var(--t1-lh); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; border-bottom: 1px solid var(--rule-strong); padding-bottom: 6px; margin: var(--s6) 0 var(--s3); }
.boundary { border: 2px solid var(--ink); padding: var(--s4) var(--s5); margin: var(--s3) 0; }
.boundary .not-certified { font-weight: 700; font-size: var(--t4); line-height: var(--t4-lh); white-space: pre-line; }
.boundary .certified { font-size: var(--t2); line-height: var(--t2-lh); white-space: pre-line; color: var(--ink-muted); margin-bottom: var(--s3); }
.boundary + .boundary { margin-top: var(--s3); }
.seal { position: relative; border-top: 3px solid var(--ink); margin-top: var(--s7); padding-top: var(--s4); overflow: hidden; }
.seal-mark { position: absolute; right: var(--s2); top: var(--s3); font-size: 120px; line-height: 1; font-weight: 200; font-variation-settings: "opsz" 60; color: var(--ink); opacity: 0.08; pointer-events: none; user-select: none; }
.seal-keyid { font-family: var(--font-mono); font-size: var(--t4); line-height: var(--t4-lh); font-weight: 600; letter-spacing: 0.02em; overflow-wrap: anywhere; }

/*
 * THE GLASS BOX, literal. Three depths and no fourth: the surface says what is attested (the row),
 * the check says how (the signed receipt), the source says of what (the document's own bytes).
 * Depth is ground and shadow and a 12 px inset per level; never a lighter ink, never a blur.
 * Opening a row does not navigate: the row becomes the lens and a well opens beneath it.
 */
.glass { border-top: 1px solid var(--rule-strong); }
.finding { border-bottom: 1px solid var(--hair); }
.finding > summary { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--s3); align-items: baseline; padding: 10px var(--s2); cursor: pointer; transition: background var(--d1) var(--ease-out); }
.finding > summary::-webkit-details-marker { display: none; }
.finding > summary:hover { background: var(--raised); }
.finding > summary:focus-visible { outline-offset: -2px; }
.finding-label { font-weight: 500; font-size: var(--t2); line-height: var(--t2-lh); }
.finding-value { grid-column: 1 / -1; font-family: var(--font-mono); font-size: var(--t1); line-height: var(--t1-lh); color: var(--ink-muted); overflow-wrap: anywhere; }
.finding > summary .chip { margin: 0; }
.finding[open] { border-top: 2px solid var(--ink); margin-top: -1px; }
.finding[open] > summary { background: var(--panel); box-shadow: var(--shadow); position: relative; z-index: 4; }
.well { padding: var(--s3) 0 var(--s4) var(--s3); display: grid; gap: var(--s3); }
.depth { padding: var(--s3) var(--s4); border: 1px solid var(--rule); min-width: 0; }
.depth-check { background: var(--raised); }
.depth-source { background: var(--paper); margin-left: var(--s3); }
.depth-name { font-size: var(--t0); line-height: var(--t0-lh); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: var(--s2); display: flex; gap: var(--s2); align-items: baseline; flex-wrap: wrap; }
.depth-name span { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-muted); font-size: var(--t1); }
.receipt-line { font-family: var(--font-mono); font-size: var(--t1); line-height: var(--t1-lh); overflow-wrap: anywhere; }
.receipt-line + .receipt-line { margin-top: 2px; }
.receipt-line b { font-weight: 600; }
.src { font-family: var(--font-mono); font-size: 12.5px; line-height: 19px; white-space: pre-wrap; overflow-wrap: anywhere; }
.src mark { background: color-mix(in oklab, var(--verdict-located) 16%, var(--paper)); color: var(--ink); outline: 1px solid var(--verdict-located); padding: 0 1px; }
.src-in + .src-in { margin-top: var(--s3); }
table.ledger td.path { min-width: 15rem; }
.src-at { font-family: var(--font-mono); font-size: var(--t0); line-height: var(--t0-lh); color: var(--ink-muted); margin-top: var(--s2); }
/* the rail: the seam above the box, carrying the call that produced what is beneath it */
.rail { border: 1px solid var(--rule); background: var(--raised); padding: 5px var(--s3); font-family: var(--font-mono); font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
.rail + .certificate, .rail + .sheet { border-top: none; }
.prose + .rail, .tally + .rail, .chips + .rail, .cols + .rail { margin-top: var(--s4); }
@media (prefers-reduced-motion: no-preference) {
  .finding[open] > .well { animation: rise-in var(--d3) var(--ease-out) both; }
}
@keyframes rise-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* the three depths, stated once on How it works */
.strata { display: grid; gap: 0; max-width: 46rem; }
.stratum { border: 1px solid var(--rule); padding: var(--s4) var(--s5); display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: var(--s1) var(--s4); align-items: baseline; }
.stratum b { font-size: var(--t1); line-height: var(--t1-lh); text-transform: uppercase; letter-spacing: 0.12em; }
.stratum:nth-child(1) { background: var(--panel); box-shadow: var(--shadow); position: relative; z-index: 3; }
.stratum:nth-child(2) { background: var(--raised); margin: 0 0 0 var(--s3); border-top: none; z-index: 2; }
.stratum:nth-child(3) { background: var(--paper); margin: 0 0 0 calc(2 * var(--s3)); border-top: none; z-index: 1; }

/* ── the diff of two runs ───────────────────────────────────────────────── */
.tally { display: flex; flex-wrap: wrap; gap: var(--s5) var(--s7); margin: var(--s4) 0; }
.tally div { min-width: 0; }
.tally .n { font-family: var(--font-mono); font-size: var(--t6); line-height: var(--t6-lh); font-weight: 500; font-variant-numeric: tabular-nums; display: block; }
.tally .of { font-size: var(--t1); line-height: var(--t1-lh); color: var(--ink-muted); display: block; max-width: 16rem; }

/* ── pricing ────────────────────────────────────────────────────────────── */
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); align-items: stretch; }
.tier { background: var(--panel); border: 1px solid var(--rule); box-shadow: var(--shadow); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.tier h2 { font-size: var(--t5); line-height: var(--t5-lh); font-weight: 600; border-bottom: 3px solid var(--ink); padding-bottom: var(--s2); }
.tier .vol { font-family: var(--font-mono); font-size: var(--t5); line-height: var(--t5-lh); font-weight: 500; font-variant-numeric: tabular-nums; }
.tier .vol.words { font-family: var(--font-text); font-weight: 500; }
.tier .vol-of { font-size: var(--t1); line-height: var(--t1-lh); color: var(--ink-muted); }
.tier ul { list-style: none; font-size: var(--t2); line-height: var(--t2-lh); display: grid; gap: 6px; border-top: 1px solid var(--hair); padding-top: var(--s3); }
.tier .price { margin-top: auto; padding-top: var(--s3); border-top: 1px solid var(--hair); font-size: var(--t2); line-height: var(--t2-lh); }
.intro-label { display: inline-block; border: 1px solid var(--ink); padding: 1px 8px; font-size: var(--t1); line-height: var(--t1-lh); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }

/* ── catalogue ──────────────────────────────────────────────────────────── */
.shelf { margin-top: var(--s7); }
.shelf h2 { font-size: var(--t1); line-height: var(--t1-lh); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; border-bottom: 1px solid var(--rule-strong); padding-bottom: 6px; display: flex; justify-content: space-between; gap: var(--s3); }
.rt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--s1) var(--s6); padding: var(--s3) 0; border-bottom: 1px solid var(--hair); }
.rt-title { font-weight: 500; }
.rt-id { font-family: var(--font-mono); font-size: var(--t1); line-height: var(--t1-lh); color: var(--ink-muted); overflow-wrap: anywhere; }
.rt-b { font-size: var(--t2); line-height: var(--t2-lh); color: var(--ink-muted); }

/* ── questions (security) ───────────────────────────────────────────────── */
.qa { border-top: 1px solid var(--rule-strong); padding: var(--s5) 0; display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 40rem); gap: var(--s3) var(--s7); }
.qa h2 { font-size: var(--t4); line-height: var(--t4-lh); font-weight: 600; text-wrap: balance; }
.qa p + p { margin-top: var(--s3); }

/* ── home: the name and the tagline, nothing else ───────────────────────── */
.home main { display: flex; align-items: center; }
.home .topline { border-bottom-color: transparent; }
.home .topline .wrap { justify-content: flex-end; }
.hero { padding-top: var(--s7); padding-bottom: 14vh; }
.hero-name { font-weight: 600; letter-spacing: 0.18em; font-variation-settings: "opsz" 60; font-size: clamp(46px, 11.5vw, 124px); line-height: 1; margin-right: -0.18em; padding-bottom: clamp(16px, 2.4vw, 28px); display: inline-block; position: relative; }
/* the letterhead's rule, ending at the last letter rather than after its tracking */
.hero-name::after { content: ""; position: absolute; left: 0; right: 0.18em; bottom: 0; height: 3px; background: var(--ink); }
.hero-line { font-size: clamp(var(--t5), 3.1vw, var(--t6)); line-height: 1.15; font-weight: 400; font-variation-settings: "opsz" 40; margin-top: clamp(16px, 2.4vw, 28px); text-wrap: balance; }
.hero-seal { font-family: var(--font-mono); font-size: clamp(var(--t1), 1.5vw, var(--t3)); line-height: var(--t3-lh); letter-spacing: 0.08em; color: var(--ink-muted); margin-top: var(--s3); }

/* ── the foot ───────────────────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--rule); margin-top: auto; font-size: var(--t1); line-height: var(--t1-lh); color: var(--ink-muted); }
.foot .wrap { padding-top: var(--s5); padding-bottom: var(--s6); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s4) var(--s7); align-items: start; }
.foot .goal { font-size: var(--t2); line-height: var(--t2-lh); color: var(--ink); max-width: 34rem; text-wrap: pretty; }
.foot nav { display: flex; flex-wrap: wrap; gap: 2px var(--s4); justify-content: flex-end; }
.foot a { color: var(--ink-muted); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }
.theme { display: flex; gap: 0; align-items: baseline; justify-content: flex-end; margin-top: var(--s2); }
.theme span { margin-right: var(--s2); }
.theme button { all: unset; cursor: pointer; padding: 1px 7px; border: 1px solid var(--rule); margin-left: -1px; color: var(--ink-muted); }
.theme button[aria-pressed="true"] { background: var(--raised); color: var(--ink); border-color: var(--rule-strong); position: relative; }
.theme button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
html:not(.js) .theme, html:not(.js) .needs-js { display: none; }

@media (max-width: 900px) {
  .cols, .cols-3, .split, .tiers, .qa, .rt { grid-template-columns: minmax(0, 1fr); }
  .tiers { gap: var(--s4); }
}
@media (max-width: 760px) {
  .wrap { padding: 0 var(--s4); }
  .page { padding-top: var(--s7); padding-bottom: var(--s7); }
  .section { margin-top: var(--s7); }
  .nav { gap: 0 var(--s4); font-size: var(--t1); line-height: var(--t1-lh); }
  .nav a { padding: 5px 0; }
  .sheet { padding: var(--s4); }
  .certificate { padding: var(--s5) var(--s4); }
  .letterhead { grid-template-columns: minmax(0, 1fr); }
  .lh-id { text-align: left; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dd { margin-bottom: var(--s2); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .foot .wrap { grid-template-columns: minmax(0, 1fr); }
  .foot nav, .theme { justify-content: flex-start; }
  .stratum { grid-template-columns: minmax(0, 1fr); padding: var(--s3) var(--s4); }
  .finding > summary { grid-template-columns: minmax(0, 1fr); }
  .finding > summary .chip { justify-self: start; }
  .depth { padding: var(--s3); }
  .depth-source { margin-left: var(--s2); }
  .well { padding-left: var(--s2); }
  .cmd { grid-template-columns: minmax(0, 1fr); }
  .cmd .copy { border-left: none; border-top: 1px solid var(--rule-strong); padding: 6px var(--s3); text-align: left; }
  .seal-mark { font-size: 84px; }
  /* a table keeps a readable measure and scrolls inside its own container, never the page */
  .scroll-x > table.ledger { min-width: 36rem; }
  .scroll-x { border-bottom: 1px solid var(--hair); }
  .tally { gap: var(--s4) var(--s6); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}
/* print flattens the box to the instrument: no shadow, no tint, every well open is still text */
@media print {
  :root { --paper: #fff; --panel: #fff; --raised: #fff; --ink: #000; --ink-muted: #333; --rule: #999; --rule-strong: #666; --hair: #ccc; --shadow: none; --tint: 0%; }
  .topline nav, .foot nav, .theme, .actions, .copy, .skip { display: none; }
  .sheet, .certificate, .tier, .stratum { box-shadow: none; }
  .finding[open] > summary { box-shadow: none; position: static; }
  .chip { border-left-width: 6px; }
  body { font-size: 10.5pt; }
  .finding, .boundary, .tier, .qa { break-inside: avoid; }
}

/* ════════════════════════════════════════════════════════════════════════
 * THE CONNECTIVE STRUCTURE (SD-18 onward). Nothing here adds a colour or a face: the same
 * neutrals, the same five verdict hues through .v-*, the same one shadow.
 * ════════════════════════════════════════════════════════════════════════ */

/* ── the band above the foot: the parts of the one system, this page's part marked ── */
.system-band { border-top: 1px solid var(--rule); background: var(--raised); margin-top: auto; }
.system-band + .foot { margin-top: 0; }
.system-band .wrap { padding-top: var(--s5); padding-bottom: var(--s5); }
.band-head { display: flex; flex-wrap: wrap; gap: 2px var(--s3); align-items: baseline; font-size: var(--t1); line-height: var(--t1-lh); color: var(--ink-muted); margin-bottom: var(--s3); }
.band-head a { font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink); text-decoration: none; }
.band-head a:hover { text-decoration: underline; }
.parts { list-style: none; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0; border-left: 1px solid var(--rule-strong); }
.parts li { border-right: 1px solid var(--rule-strong); border-top: 3px solid transparent; min-width: 0; }
.parts li.here { border-top-color: var(--ink); background: var(--panel); }
.parts a { display: block; height: 100%; padding: var(--s2) var(--s3) var(--s3); text-decoration: none; font-size: var(--t1); line-height: var(--t1-lh); color: var(--ink-muted); transition: background var(--d1) var(--ease-out); }
.parts a:hover { background: var(--panel); }
.parts b { display: block; color: var(--ink); font-weight: 600; font-size: var(--t2); line-height: var(--t2-lh); }
.parts i { display: block; font-style: normal; font-size: var(--t0); line-height: var(--t0-lh); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink); }
.parts span { display: block; margin-top: 2px; }

/* ── the map on the system page: three strata, the site's own depth idiom ── */
.map { display: grid; gap: 0; }
.map-band { border: 1px solid var(--rule); padding: var(--s4) var(--s5) var(--s5); min-width: 0; }
.map-band + .map-band { border-top: none; }
.map-band:nth-child(1) { background: var(--panel); box-shadow: var(--shadow); position: relative; z-index: 3; }
.map-band:nth-child(2) { background: var(--raised); margin: 0 var(--s3); position: relative; z-index: 2; }
.map-band:nth-child(3) { background: var(--paper); margin: 0 calc(2 * var(--s3)); position: relative; z-index: 1; }
.map-name { font-size: var(--t1); line-height: var(--t1-lh); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; display: flex; flex-wrap: wrap; gap: 2px var(--s3); align-items: baseline; margin-bottom: var(--s3); }
.map-name span { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-muted); }
.map-cells { display: grid; grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr)); gap: var(--s3); }
.map-cell { border: 1px solid var(--rule-strong); background: var(--panel); padding: var(--s3) var(--s4); font-size: var(--t2); line-height: var(--t2-lh); min-width: 0; }
.map-cell b { display: block; font-weight: 600; }
.map-cell span { display: block; color: var(--ink-muted); font-size: var(--t1); line-height: var(--t1-lh); margin-top: 2px; }
.map-cell a { font-size: var(--t1); line-height: var(--t1-lh); display: inline-block; margin-top: var(--s2); }
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: flow; }
.flow > div { border: 1px solid var(--rule-strong); border-left-width: 0; background: var(--panel); padding: var(--s3) var(--s4); font-size: var(--t2); line-height: var(--t2-lh); min-width: 0; counter-increment: flow; }
.flow > div:first-child { border-left-width: 1px; }
.flow > div::before { content: counter(flow); font-family: var(--font-mono); font-size: var(--t1); color: var(--ink-muted); display: block; }
.flow b { display: block; font-weight: 600; }
.flow span { display: block; color: var(--ink-muted); font-size: var(--t1); line-height: var(--t1-lh); margin-top: 2px; }

/* ── the matrix: four closed axes ───────────────────────────────────────── */
.axes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 2px solid var(--ink); background: var(--panel); }
.axis { padding: var(--s4) var(--s5) var(--s5); border-left: 1px solid var(--rule-strong); min-width: 0; }
.axis:first-child { border-left: none; }
.axis-name { font-size: var(--t1); line-height: var(--t1-lh); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; }
.axis .n { font-family: var(--font-mono); font-size: var(--t6); line-height: var(--t6-lh); font-weight: 500; font-variant-numeric: tabular-nums; display: block; margin-top: var(--s2); }
.axis .of { font-size: var(--t1); line-height: var(--t1-lh); color: var(--ink-muted); display: block; }
.axis p { font-size: var(--t2); line-height: var(--t2-lh); margin-top: var(--s3); }
.words { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: var(--s2); }
.word { font-family: var(--font-mono); font-size: 12px; line-height: 18px; border: 1px solid var(--rule); background: var(--panel); padding: 0 6px; overflow-wrap: anywhere; }
.vocab { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: var(--s2) var(--s5); padding: var(--s3) 0; border-bottom: 1px solid var(--hair); font-size: var(--t2); line-height: var(--t2-lh); }
.vocab .words { margin-top: 0; }

/* ── worked examples: one row on the index, one instrument on each page ── */
.ex-group { margin-top: var(--s7); }
.ex-group > h2 { font-size: var(--t1); line-height: var(--t1-lh); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; border-bottom: 1px solid var(--rule-strong); padding-bottom: 6px; }
.ex { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--s2) var(--s6); padding: var(--s4) 0; border-bottom: 1px solid var(--hair); }
.ex-title { font-size: var(--t4); line-height: var(--t4-lh); font-weight: 600; }
.ex-title a { text-decoration: none; }
.ex-title a:hover { text-decoration: underline; }
.ex-q { font-size: var(--t2); line-height: var(--t2-lh); color: var(--ink-muted); margin-top: var(--s1); }
.ex-b { font-size: var(--t2); line-height: var(--t2-lh); }
.ex-b .chips { margin-top: var(--s2); }
.chips .chip { margin-bottom: 4px; }
.problem { border-left: 3px solid var(--ink); padding-left: var(--s4); max-width: 42rem; }
.problem p + p { margin-top: var(--s2); }
.catch { border: 1px solid var(--rule-strong); background: var(--panel); padding: var(--s4) var(--s5); min-width: 0; }
.catch + .catch { margin-top: var(--s3); }
.catch-h { font-size: var(--t1); line-height: var(--t1-lh); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: var(--s2); }
.catch p { font-size: var(--t2); line-height: var(--t2-lh); }
.catch p + p, .catch p + .src, .catch .src + p, .catch .chips + p, .catch p + .chips, .catch .src + .chips, .catch .chips + .src, .catch .src + .src { margin-top: var(--s2); }
.catch .src { border: 1px solid var(--rule); background: var(--paper); padding: var(--s2) var(--s3); }
.next { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3) var(--s5); border-top: 1px solid var(--rule-strong); margin-top: var(--s8); padding-top: var(--s4); font-size: var(--t2); line-height: var(--t2-lh); }
.next span { display: block; font-size: var(--t0); line-height: var(--t0-lh); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); }

/* ── recorded screens of the Console: four captures, the one for this width and scheme shown ── */
.shot { border: 1px solid var(--rule-strong); background: var(--panel); box-shadow: var(--shadow); min-width: 0; }
.shot img { display: none; width: 100%; height: auto; }
.shot figcaption { border-top: 1px solid var(--rule); padding: var(--s2) var(--s3); font-size: var(--t1); line-height: var(--t1-lh); color: var(--ink-muted); }
.shot figcaption b { color: var(--ink); font-weight: 600; }
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); align-items: start; }
.shots .wide { grid-column: 1 / -1; }
@media (min-width: 761px) {
  .shot .at-desktop.on-light { display: block; }
  :root[data-theme="dark"] .shot .at-desktop.on-light { display: none; }
  :root[data-theme="dark"] .shot .at-desktop.on-dark { display: block; }
}
@media (min-width: 761px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shot .at-desktop.on-light { display: none; }
  :root:not([data-theme="light"]) .shot .at-desktop.on-dark { display: block; }
}
@media (max-width: 760px) {
  .shot .at-phone.on-light { display: block; }
  :root[data-theme="dark"] .shot .at-phone.on-light { display: none; }
  :root[data-theme="dark"] .shot .at-phone.on-dark { display: block; }
}
@media (max-width: 760px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shot .at-phone.on-light { display: none; }
  :root:not([data-theme="light"]) .shot .at-phone.on-dark { display: block; }
}

/* ── the clerk: its words in the Console's voice, its action as the card ── */
.turn { border: 1px solid var(--rule); background: var(--panel); padding: var(--s3) var(--s4); min-width: 0; }
.turn + .turn { margin-top: var(--s3); }
.turn-asked { font-size: var(--t1); line-height: var(--t1-lh); color: var(--ink-muted); }
.turn-asked b { text-transform: uppercase; letter-spacing: 0.1em; font-size: var(--t0); font-weight: 600; color: var(--ink); margin-right: var(--s2); }
.turn-words { font-size: var(--t2); line-height: var(--t2-lh); margin-top: var(--s2); white-space: pre-line; overflow-wrap: anywhere; }
.turn-cards { margin-top: var(--s2); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; font-size: var(--t1); line-height: var(--t1-lh); color: var(--ink-muted); }
.card { font-family: var(--font-mono); font-size: 12px; line-height: 18px; border: 1px solid var(--ink); padding: 0 7px; color: var(--ink); }

@media (max-width: 1000px) {
  .parts { grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule-strong); }
  .parts li { border-bottom: 1px solid var(--rule-strong); }
  .axes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .axis:nth-child(3) { border-left: none; }
  .axis:nth-child(n+3) { border-top: 1px solid var(--rule-strong); }
}
@media (max-width: 900px) {
  .ex, .vocab, .shots { grid-template-columns: minmax(0, 1fr); }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow > div:nth-child(3) { border-left-width: 1px; }
  .flow > div:nth-child(n+3) { border-top-width: 0; }
}
@media (max-width: 760px) {
  html.js .nav-toggle { display: inline-block; }
  html.js .nav { display: none; width: 100%; flex-direction: column; gap: 0; border-top: 1px solid var(--rule); margin-top: var(--s2); padding-top: var(--s1); font-size: var(--t2); line-height: var(--t2-lh); }
  html.js .nav.open { display: flex; }
  html.js .nav a { padding: 7px 0; border-bottom: 1px solid var(--hair); }
  html.js .nav a[aria-current] { border-bottom-color: var(--ink); }
  .parts { grid-template-columns: minmax(0, 1fr); border-left: none; border-top: 1px solid var(--rule-strong); }
  .parts li { border-right: none; border-top: none; border-left: 3px solid transparent; border-bottom: 1px solid var(--rule-strong); }
  .parts li.here { border-left-color: var(--ink); }
  .parts a { padding: var(--s2) var(--s3); }
  .map-band { padding: var(--s3) var(--s4) var(--s4); }
  .map-band:nth-child(2) { margin: 0 0 0 var(--s2); }
  .map-band:nth-child(3) { margin: 0 0 0 var(--s4); }
  .axes { grid-template-columns: minmax(0, 1fr); }
  .axis { border-left: none; padding: var(--s3) var(--s4) var(--s4); }
  .axis + .axis { border-top: 1px solid var(--rule-strong); }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .flow > div { border-left-width: 1px; }
  .flow > div + div { border-top-width: 0; }
  .catch { padding: var(--s3) var(--s4); }
}
@media print {
  .system-band, .nav-toggle, .next { display: none; }
  .map-band, .shot { box-shadow: none; }
}
