/* ============================================================
   GALLEY PROOF — the working papers of Rahul Malik
   Hand-set. No framework. Read me.
   ============================================================ */

/* ---------- faces ---------- */
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-normal-200-800.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-italic-200-800.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Switzer";
  src: url("../fonts/switzer-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plexmono-normal-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plexmono-normal-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- ink & paper ---------- */
:root {
  --paper: #f6f1e7;
  --plate: #efe9db;
  --ink: #191712;
  --ink-2: #5c564a;
  --rule: #d9d2c0;
  --red: #c1301c;
  --red-rgb: 193 48 28;
  --red-wash: rgba(193, 48, 28, 0.08);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --grot: "Switzer", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", Menlo, Consolas, monospace;

  --baseline: 28px;
  --measure: 65ch;
  --margin-w: 280px;
  --gutter: 48px;
  --page-w: 1240px;
}
:root[data-theme="night"] {
  --paper: #131110;
  --plate: #1c1915;
  --ink: #e7e1d3;
  --ink-2: #9a9280;
  --rule: #2e2a24;
  --red: #e2543c;
  --red-rgb: 226 84 60;
  --red-wash: rgba(226, 84, 60, 0.1);
}
/* no-JS dark-mode readers still get the night printing; the JS-set attribute wins both ways */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) {
    --paper: #131110;
    --plate: #1c1915;
    --ink: #e7e1d3;
    --ink-2: #9a9280;
    --rule: #2e2a24;
    --red: #e2543c;
    --red-rgb: 226 84 60;
    --red-wash: rgba(226, 84, 60, 0.1);
  }
}
/* controls that only do anything with script running — and their static stand-ins */
:root:not(.js) .js-only { display: none !important; }
:root.js .no-js-only { display: none !important; }

/* ---------- reset, the short honest kind ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* phones must never scroll sideways; clip (not hidden) keeps position:sticky alive */
html, body { overflow-x: clip; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: var(--baseline);
  font-optical-sizing: auto;
  font-kerning: normal;
  font-feature-settings: "onum" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--red); color: var(--paper); }
a { color: inherit; }
img, canvas, svg { max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* ---------- utility voices ---------- */
.mono {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-feature-settings: "tnum" 1;
  letter-spacing: 0;
}
.label-caps {
  font-family: var(--grot);
  font-size: 0.72rem;
  font-weight: 520;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.red-square {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--red);
  margin-right: 0.55em;
  vertical-align: 0.1em;
}
.snum {
  color: var(--red);
  font-weight: 460;
  margin-right: 0.35em;
}

/* ---------- the spread: text column + margin ---------- */
.spread {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--margin-w);
  column-gap: var(--gutter);
}
.main-col { max-width: var(--measure); min-width: 0; }
.margin-col { position: relative; padding-top: 0.5rem; }

.section { padding: calc(var(--baseline) * 3) 0 calc(var(--baseline) * 2); }
.section + .section, .colophon { border-top: 1px solid var(--rule); }
.section, .plate-spread, .plate { scroll-margin-top: 64px; }

/* ---------- running head ---------- */
.running-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.rh-inner {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 52px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.rh-title, .rh-nav a, .rh-status, .rh-btn {
  font-family: var(--grot);
  font-size: 0.72rem;
  font-weight: 520;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.rh-title { color: var(--ink); }
.rh-title:hover { color: var(--red); }
.rh-crumb { color: var(--rule); }
.rh-here { color: var(--ink-2); }
.rh-nav { display: flex; gap: 1.1rem; margin-left: auto; }
.rh-nav a { color: var(--ink-2); }
.rh-nav a:hover { color: var(--red); }
.rh-right { display: flex; align-items: center; gap: 1.1rem; }
.rh-status { color: var(--red); }
.rh-btn { color: var(--ink-2); border-bottom: 1px solid var(--rule); padding-bottom: 1px; }
.rh-btn:hover { color: var(--red); border-color: var(--red); }

/* the MORNING · NIGHT edition switch */
.edition-switch { display: inline-flex; align-items: center; gap: 0.7em; }
.edition-switch .ed-sep { color: var(--rule); }
.edition-switch [aria-pressed="true"] { color: var(--red); }
.edition-switch [aria-pressed="true"]::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--red);
  margin-right: 0.5em;
  vertical-align: 0.1em;
}

/* persistent margin CTA */
.margin-cta {
  position: fixed;
  right: 0;
  top: 50%;
  z-index: 30;
  transform: rotate(180deg) translateY(50%);
  writing-mode: vertical-rl;
  font-family: var(--grot);
  font-size: 0.7rem;
  font-weight: 520;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--red);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-right: none;
  padding: 0.9rem 0.45rem;
}
.margin-cta:hover { background: var(--red-wash); }

/* ---------- §0 title page ---------- */
.title-page { padding-top: calc(var(--baseline) * 3); }
.section-mark { margin-bottom: var(--baseline); font-size: 1.4rem; }
.paper-title {
  position: relative;
  font-size: clamp(2.6rem, 6.4vw, 5.2rem);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.012em;
  max-width: 11em;
  text-wrap: balance;
  margin-bottom: calc(var(--baseline) * 1.5);
}
.byline {
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink-2);
  margin-bottom: calc(var(--baseline) * 2);
}
.abstract {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: calc(var(--baseline) * 0.75) 0;
  margin-bottom: var(--baseline);
}
.abstract .label-caps { color: var(--red); margin-bottom: 0.5rem; }
.title-hint { color: var(--ink-2); font-size: 0.95rem; }
.inside-note { margin-top: 0.8rem; color: var(--ink-2); }
.inside-note a { color: var(--red); }
.hint-sep { margin: 0 0.6em; color: var(--rule); }
.hint-text { font-style: italic; }
.text-btn {
  font-family: var(--grot);
  font-size: 0.72rem;
  font-weight: 520;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
}
.text-btn:hover, .text-btn[aria-pressed="true"] { color: var(--red); border-color: var(--red); }

/* kern annotations (specimen mode) */
.kern-tag {
  position: absolute;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1;
  color: var(--red);
  white-space: nowrap;
  pointer-events: none;
}

/* ---------- grid overlay ---------- */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  display: none;
}
body.show-grid .grid-overlay { display: block; }
body.show-grid .grid-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgb(var(--red-rgb) / 0.14) 0,
    rgb(var(--red-rgb) / 0.14) 1px,
    transparent 1px,
    transparent var(--baseline)
  );
}
.grid-cols {
  position: absolute;
  inset: 0;
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 16px;
}
.grid-cols span { border-left: 1px solid rgb(var(--red-rgb) / 0.18); border-right: 1px solid rgb(var(--red-rgb) / 0.18); }

/* ---------- links & footnotes ---------- */
.main-col a:not(.key-btn):not(.fnref) {
  color: var(--red);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.main-col a:not(.key-btn):hover { background: var(--red-wash); }
.rubric-link { font-weight: 500; }
.fnref { text-decoration: none; }
.fnref sup {
  color: var(--red);
  font-size: 0.7em;
  font-weight: 500;
  padding: 0 0.15em;
}
.fnref:hover sup { background: var(--red-wash); }

.sidenote, .marginalia {
  font-size: 0.875rem;
  line-height: 20px;
  color: var(--ink-2);
  border-top: 1px solid var(--rule);
  padding: 0.6rem 0 0.9rem;
}
.sidenote.lit { border-top-color: var(--red); color: var(--ink); }
.fn-num { color: var(--red); font-weight: 500; margin-right: 0.45em; }
.marginalia p + p { margin-top: 0.5rem; }
.margin-col .mono { font-size: 0.72rem; }

/* ---------- section heads & prose ---------- */
.section-head {
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: var(--baseline);
}
.section-intro { margin-bottom: calc(var(--baseline) * 1.5); }
.main-col p + p { margin-top: var(--baseline); }
.proves { margin-top: var(--baseline); padding-left: 1rem; border-left: 2px solid var(--red); }

/* ---------- §1 ledger ---------- */
.ledger { width: 100%; border-collapse: collapse; }
.ledger th {
  font-family: var(--grot);
  font-size: 0.72rem;
  font-weight: 520;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-align: left;
  border-bottom: 1px solid var(--ink);
  padding: 0 1rem 0.5rem 0;
}
.ledger td {
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
  padding: 0.85rem 1rem 0.85rem 0;
  font-size: 0.98rem;
  line-height: 24px;
}
.ledger .l-metric {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink);
  width: 9.5em;
}
.ledger .l-evidence { white-space: nowrap; padding-right: 0; text-align: right; }
.ledger-cta { margin-top: var(--baseline); }

/* ---------- figures / plates ---------- */
.plate {
  background: var(--plate);
  border: 1px solid var(--rule);
  margin: calc(var(--baseline) * 1.5) 0;
}
.fig-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--rule);
}
.fig-tag {
  font-family: var(--grot);
  font-size: 0.72rem;
  font-weight: 560;
  letter-spacing: 0.09em;
  color: var(--red);
}
.fig-state { color: var(--ink-2); }
.fig-body { padding: 1.25rem; }
.fig-caption {
  border-top: 1px solid var(--rule);
  padding: 0.75rem 1.25rem 0.9rem;
  font-size: 0.875rem;
  line-height: 20px;
  color: var(--ink-2);
}
.fig-caption strong { color: var(--ink); font-weight: 500; }

/* Fig 1 — prompt line */
.prompt-line { margin-bottom: var(--baseline); }
.prompt-wrap { display: flex; gap: 0.6rem; align-items: stretch; margin-top: 0.4rem; flex-wrap: wrap; }
.prompt-input {
  flex: 1 1 14em;
  min-width: 10em;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ink);
  padding: 0.2em 0.1em;
  caret-color: var(--red);
}
.prompt-input:focus { border-bottom-color: var(--red); box-shadow: 0 1px 0 var(--red); outline: none; }
.prompt-input:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.seeds { margin-top: 0.6rem; color: var(--ink-2); }
.seed-btn {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--red);
  border-bottom: 1px solid transparent;
  margin-left: 0.5em;
}
.seed-btn:hover { border-color: var(--red); }

/* machined keys */
.key-btn {
  display: inline-block;
  font-family: var(--grot);
  font-size: 0.72rem;
  font-weight: 560;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  padding: 0.55em 1.1em;
  transition: none;
}
.key-btn:hover { color: var(--red); border-color: var(--red); box-shadow: 2px 2px 0 var(--red); }
.key-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.key-btn:disabled { opacity: 0.4; cursor: default; }
.key-btn:disabled:active { transform: none; box-shadow: 2px 2px 0 var(--ink); }
.key-btn.ghost { border-color: var(--ink-2); color: var(--ink-2); box-shadow: 2px 2px 0 var(--ink-2); }

/* attention text */
.attn-block, .specimen-block { margin-bottom: var(--baseline); }
.attn-block .label-caps, .specimen-block .label-caps { margin-bottom: 0.55rem; }
.attn-text {
  font-size: 1.2rem;
  line-height: 2.1;
  min-height: 2.5em;
  word-break: break-word;
}
.attn-c {
  border-bottom: 3px solid rgb(var(--red-rgb) / var(--a, 0));
  padding-bottom: 1px;
}
.attn-text .gen { color: var(--ink-2); }
.attn-text .cur { background: var(--red-wash); }

/* probability specimen */
.specimen {
  display: flex;
  align-items: baseline;
  gap: 1.4rem;
  flex-wrap: wrap;
  min-height: 3.4em;
}
.spec-item { display: inline-flex; flex-direction: column; align-items: center; row-gap: 0.15rem; }
.spec-char {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 0.95;
}
.spec-item.sampled .spec-char { color: var(--red); }
.spec-p { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-2); }

/* sliders */
.fig-controls { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.ctrl { flex: 1 1 16em; }
.ctrl .label-caps { display: block; margin-bottom: 0.5rem; }
.ctrl-scale { display: flex; justify-content: space-between; color: var(--ink-2); font-size: 0.68rem; margin-top: 0.3rem; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--ink); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  background: var(--red);
  margin-top: -5.5px;
  border: none;
  border-radius: 0;
}
input[type="range"]::-moz-range-track { height: 1px; background: var(--ink); }
input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px;
  background: var(--red);
  border: none;
  border-radius: 0;
}

/* Fig 2 */
.loss-svg { width: 100%; display: block; margin-bottom: var(--baseline); }
.loss-svg .axis { stroke: var(--rule); stroke-width: 1; }
.loss-svg .curve { stroke: var(--red); stroke-width: 1.5; fill: none; }
.loss-svg .tick, .loss-svg .ax-label { font-family: var(--mono); font-size: 10px; fill: var(--ink-2); }
.loss-svg .ckpt { fill: var(--red); }
.loss-svg .ckpt-active { fill: none; stroke: var(--red); stroke-width: 1; }
.scrubber .label-caps { display: block; margin-bottom: 0.5rem; }
.scrub-marks { display: flex; justify-content: space-between; color: var(--ink-2); font-size: 0.68rem; margin-top: 0.2rem; }
.scrub-read { margin-top: 0.8rem; color: var(--ink); }
.scrub-sample-wrap { margin-top: 0.8rem; }
.scrub-sample {
  margin-top: 0.8rem;
  font-size: 1.05rem;
  font-style: italic;
  min-height: 3.5em;
  white-space: pre-wrap;
  word-break: break-word;
}

.noscript-note { padding: 1.25rem; }
.noscript-note .mono { margin-top: 0.5rem; }

/* ---------- §3 plates ---------- */
.plate-spread { padding-top: calc(var(--baseline) * 1.5); }
.plate-head { font-size: 1.5rem; font-weight: 500; margin-bottom: var(--baseline); }
.plate-num {
  display: block;
  font-family: var(--grot);
  font-size: 0.72rem;
  font-weight: 560;
  letter-spacing: 0.11em;
  color: var(--red);
  margin-bottom: 0.4rem;
}
.exhibit { margin-top: calc(var(--baseline) * 1.5); background: var(--plate); border: 1px solid var(--rule); }
.exhibit .fig-caption { border-top: 1px solid var(--rule); }
.globe-canvas {
  display: block;
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 1.25rem;
  cursor: grab;
  touch-action: none;
}
.globe-canvas:active { cursor: grabbing; }
.flow-svg { display: block; width: 100%; padding: 1.25rem; }
.flow-svg .box { fill: none; stroke: var(--ink); stroke-width: 1; }
.flow-svg .flowline { stroke: var(--ink-2); stroke-width: 1; fill: none; marker-end: url(#arr); }
.flow-svg .flabel { font-family: var(--grot); font-size: 10.5px; letter-spacing: 0.08em; fill: var(--ink); text-transform: uppercase; }
.flow-svg .fmetric { font-family: var(--mono); font-size: 10px; fill: var(--red); }
.flow-svg .fsub { font-family: var(--mono); font-size: 9px; fill: var(--ink-2); }

.spec-table { border-collapse: collapse; margin-top: var(--baseline); width: 100%; }
.spec-table th, .spec-table td { border-bottom: 1px solid var(--rule); text-align: left; padding: 0.45rem 1rem 0.45rem 0; font-weight: 400; }
.spec-table th { color: var(--red); width: 8em; font-weight: 500; }

.notes-list { padding-left: 1.2em; }
.notes-list li + li { margin-top: var(--baseline); }

/* ---------- §4 method ---------- */
.method-list { list-style: none; counter-reset: method; }
.method-list li {
  counter-increment: method;
  padding: calc(var(--baseline) * 0.6) 0;
  border-bottom: 1px solid var(--rule);
}
.method-list li::before {
  content: counter(method) ".";
  color: var(--red);
  font-weight: 500;
  margin-right: 0.6em;
}

/* ---------- §5 commissions ---------- */
.rate-card { border-top: 2px solid var(--ink); }
.rate-row { border-bottom: 1px solid var(--rule); padding: calc(var(--baseline) * 0.9) 0; }
.rate-name { font-size: 1.35rem; font-weight: 500; }
.rate-lede { font-style: italic; color: var(--ink-2); margin: 0.3rem 0 0.9rem; }
.rate-specs div { display: grid; grid-template-columns: 8.5em 1fr; gap: 1rem; padding: 0.35rem 0; }
.rate-specs dt {
  font-family: var(--grot);
  font-size: 0.72rem;
  font-weight: 520;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding-top: 0.2em;
}
.rate-specs dd { font-size: 0.98rem; line-height: 24px; }
.rate-row .enquire { margin-top: 0.9rem; }
.pricing-note { margin-top: var(--baseline); }
.fit-check { margin-top: var(--baseline); border: 1px solid var(--rule); padding: 1rem 1.25rem; }
.fit-check ul { list-style: none; margin-top: 0.5rem; }
.fit-check li { padding: 0.25rem 0; }
.research-line { margin-top: var(--baseline); color: var(--ink-2); }

/* ---------- §6 correspondence ---------- */
.email-line { display: flex; align-items: baseline; gap: 1.2rem; flex-wrap: wrap; margin-bottom: calc(var(--baseline) * 1.5); }
.email-display {
  font-size: clamp(1.3rem, 3.4vw, 2.1rem);
  font-style: italic;
  font-weight: 450;
  text-decoration: none !important;
  border-bottom: 1px solid var(--red);
  color: var(--ink) !important;
  word-break: break-all;
}
.email-display:hover { color: var(--red) !important; background: none !important; }
.email-at { color: var(--red); }

.composer { border: 1px solid var(--rule); padding: 1.25rem; margin-bottom: calc(var(--baseline) * 1.5); }
.composer > .label-caps { margin-bottom: 0.9rem; }
.composer-form { display: flex; gap: 2rem; flex-wrap: wrap; }
.composer-form fieldset { border: none; min-width: 11em; }
.composer-form legend { color: var(--red); font-size: 0.72rem; margin-bottom: 0.4rem; }
.composer-form label { display: block; font-size: 0.95rem; padding: 0.15rem 0; cursor: pointer; }
.composer-form input { accent-color: var(--red); margin-right: 0.45em; }
.composer-out {
  margin: 1.1rem 0;
  padding: 0.9rem 1.1rem;
  background: var(--plate);
  border-left: 2px solid var(--red);
  font-style: italic;
  min-height: 4em;
}
.composer-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }

.links-index { border-collapse: collapse; width: 100%; margin-bottom: var(--baseline); }
.links-index th, .links-index td { text-align: left; border-bottom: 1px solid var(--rule); padding: 0.5rem 1rem 0.5rem 0; font-weight: 400; }
.links-index th { color: var(--red); width: 9em; font-weight: 500; }
.reply-norm { color: var(--ink-2); }

/* ---------- colophon ---------- */
.colophon { padding: calc(var(--baseline) * 2) 0 calc(var(--baseline) * 4); }
.colophon .label-caps { color: var(--red); margin-bottom: var(--baseline); }
.colophon-meta { margin-top: var(--baseline); color: var(--ink-2); }
#audit-line { color: var(--red); }

/* ---------- folio ---------- */
.folio {
  position: fixed;
  right: var(--gutter);
  bottom: 1rem;
  z-index: 30;
  color: var(--ink-2);
  font-size: 0.7rem;
  background: var(--paper);
  padding: 0.2rem 0.4rem;
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .spread { grid-template-columns: minmax(0, 1fr); }
  .margin-col { max-width: var(--measure); padding-top: 0; margin-top: var(--baseline); }
  .sidenote, .marginalia { border-top: 1px solid var(--rule); }
  .margin-cta { display: none; }
}
@media (max-width: 800px) {
  :root { --gutter: 20px; }
  /* wrap, don't hide: every link and the edition switch stay reachable by thumb */
  .rh-inner { gap: 0.4rem 1rem; height: auto; min-height: 48px; flex-wrap: wrap; padding-top: 0.5rem; padding-bottom: 0.5rem; }
  .rh-nav { flex-wrap: wrap; row-gap: 0.15rem; margin-left: 0; width: 100%; order: 3; }
  .rh-right { margin-left: auto; }
  .rh-status { display: none; }
  .ledger .l-evidence { white-space: normal; }
  .ledger td { display: block; border-bottom: none; padding: 0.2rem 0; }
  .ledger tr { display: block; border-bottom: 1px solid var(--rule); padding: 0.7rem 0; }
  /* visually hidden, still read by assistive tech — display:none would silence it */
  .ledger thead {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .ledger .l-metric { width: auto; color: var(--red); }
  .ledger .l-evidence { text-align: left; }
  .rate-specs div { grid-template-columns: 1fr; gap: 0.15rem; }
  .folio { display: none; }
}

/* ---------- motion discipline ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- print: the offprint ---------- */
@media print {
  :root {
    --paper: #ffffff;
    --plate: #f4f1ea;
    --ink: #111111;
    --ink-2: #444444;
    --rule: #bbbbbb;
    --red: #b02a18;
  }
  .running-head, .margin-cta, .folio, .grid-overlay,
  .key-btn, .seeds, .fig-controls, .scrubber, .composer,
  .title-hint, .prompt-wrap, #copy-email, #print-btn { display: none !important; }
  body { font-size: 10.5pt; }
  .spread { grid-template-columns: minmax(0, 1fr) 34%; column-gap: 24px; padding: 0; max-width: none; }
  .section { padding: 18pt 0; break-inside: avoid-page; }
  a { text-decoration: none; }
  .main-col a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-family: var(--mono);
    font-size: 7.5pt;
    color: var(--ink-2);
  }
  .plate, .exhibit { break-inside: avoid; }
}
