:root {
  --paper: #f4f5f7;
  --sheet: #ffffff;
  --ink: #111316;
  --quiet: #474e55;
  --grid: #e1e4e8;
  --rule: #c9ced4;
  --tick: #8a9299;
  --mark: #2e6650;
  --mark-soft: rgba(46, 102, 80, 0.12);
  --fault: #8c3f3f;
  --fault-soft: rgba(140, 63, 63, 0.1);
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --text-heading: clamp(1.6rem, 2.5vw, 2.1rem);
  --text-body: 1.0625rem;
  --text-sm: 0.875rem;
  --measure: 760px;
  --nav-w: 218px;
  --header-h: 68px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --bg: var(--paper);
  --surface: var(--sheet);
  --surface-elevated: #eceff1;
  --surface-deep: #e7eaed;
  --border: var(--grid);
  --border-strong: var(--rule);
  --ink-soft: var(--quiet);
  --ink-muted: var(--tick);
  --ochre: var(--mark);
  --rs9-header-height: var(--header-h);
}

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

html {
  scroll-behavior: smooth;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  overflow-x: clip;
}

body:has(.rs9-drawer[open]) { overflow: hidden; }

::selection { background: var(--mark); color: #fff; }

a {
  color: var(--mark);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(46, 102, 80, 0.42);
  transition: color 150ms var(--ease-out), text-decoration-color 150ms var(--ease-out);
}
a:hover { color: var(--ink); text-decoration-color: var(--mark); }
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--mark);
  outline-offset: 3px;
}

code, .cell-mono {
  font-family: var(--mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}
code {
  background: var(--sheet);
  border: 1px solid var(--grid);
  padding: 1px 5px;
  color: var(--ink);
}
.tabular { font-variant-numeric: tabular-nums; }
var { font-family: var(--serif); font-style: italic; }

h1, h2, h3, p { margin-top: 0; }
p, li { text-wrap: pretty; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 13px;
}
.skip-link:focus { top: 12px; color: var(--paper); }

.rs9-header {
  background: rgba(244, 245, 247, 0.94);
  border-bottom: 1px solid var(--grid);
}
.rs9-header .rs9-logo-img { width: 127px; height: auto; }
.rs9-location { color: var(--quiet); }
.rs9-nav a, .rs9-nav button, .rs9-drawer-nav a { color: var(--quiet); }
.rs9-nav [aria-expanded="true"] { background: var(--surface-deep); color: var(--ink); }
.rs9-nav [data-lab-links] { background: var(--sheet); border: 1px solid var(--rule); }
.rs9-header [aria-current="page"],
.rs9-nav [data-current="true"] { color: var(--ink); text-decoration-color: var(--mark); }
.rs9-drawer { background: var(--paper); color: var(--ink); }
.rs9-drawer-head { background: var(--paper); border-bottom: 1px solid var(--rule); }
.rs9-drawer-button { border-color: var(--rule); color: var(--ink); }
.rs9-drawer-nav p { color: var(--tick); }
.rs9-drawer-nav ul { border-left-color: var(--rule); }
@media (hover: hover) and (pointer: fine) {
  .rs9-nav :is(a, button):hover,
  .rs9-drawer-nav a:hover { background: var(--surface-deep); color: var(--ink); }
}

.page-shell {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(18px, 3.4vw, 48px) 96px;
}

.hero-stage {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(30px, 4.5vw, 58px) 0 clamp(26px, 3.5vw, 40px);
  text-align: center;
  border-bottom: 1px solid var(--rule);
}
.hero-kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mark);
  margin-bottom: 16px;
}
.hero-stage h1 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4.4vw, 3.5rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 auto 18px;
  max-width: 24ch;
}
.hero-deck {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--quiet);
  max-width: 62ch;
  margin: 0 auto 18px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--tick);
  margin: 0 auto 22px;
}
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 22px;
}
.hero-inline-links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  font-size: var(--text-sm);
  color: var(--tick);
}
.hero-inline-links a { color: var(--quiet); text-decoration-color: var(--rule); }
.hero-inline-links a:hover { color: var(--mark); text-decoration-color: var(--mark); }
.term-hint {
  max-width: var(--measure);
  margin: 22px auto 0;
  font-size: var(--text-sm);
  color: var(--tick);
}

.cta-primary,
.control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 0;
  font-family: var(--sans);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out), border-color 150ms var(--ease-out), transform 120ms var(--ease-out);
}
.cta-primary {
  background: var(--mark);
  color: #fff;
  border: 1px solid var(--mark);
}
.cta-primary:hover { background: #24523f; color: #fff; text-decoration: none; }
.cta-primary:active { transform: scale(0.98); }
.control {
  background: var(--sheet);
  color: var(--ink);
  border: 1px solid var(--rule);
}
.control:hover { border-color: var(--mark); color: var(--mark); text-decoration: none; }
.control[aria-pressed="true"],
.control[aria-checked="true"] {
  background: var(--mark);
  border-color: var(--mark);
  color: #fff;
}
.control:disabled { opacity: 0.45; cursor: not-allowed; }

.level-switch {
  display: inline-flex;
  border: 1px solid var(--rule);
  background: var(--sheet);
}
.level-switch button {
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
}
.level-switch button + button { border-left: 1px solid var(--rule); }
.level-switch button[aria-checked="true"] { background: var(--mark); color: #fff; }
.level-switch button:hover:not([aria-checked="true"]) { background: var(--surface-deep); color: var(--ink); }
.level-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--tick);
  margin: 0 0 8px;
}

body[data-level="plain"] .expert-only { display: none !important; }
body[data-level="expert"] .plain-only { display: none !important; }

.doc-shell {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, var(--measure));
  gap: clamp(28px, 4vw, 56px);
  justify-content: center;
  align-items: start;
  margin-top: clamp(34px, 4.5vw, 56px);
}
.doc-nav {
  position: sticky;
  top: calc(var(--header-h) + 28px);
  max-height: calc(100vh - var(--header-h) - 56px);
  overflow-y: auto;
  padding-bottom: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}
.doc-nav-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tick);
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.doc-nav ol { list-style: none; margin: 0 0 24px; padding: 0; }
.doc-nav li { margin: 0; }
.doc-nav a {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  padding: 7px 0;
  color: var(--quiet);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
  border-left: 2px solid transparent;
  padding-left: 10px;
  margin-left: -12px;
}
.doc-nav a .nav-no { font-family: var(--mono); font-size: 11px; color: var(--tick); padding-top: 2px; }
.doc-nav a:hover { color: var(--ink); border-left-color: var(--rule); }
.doc-nav a[aria-current="true"] { color: var(--mark); border-left-color: var(--mark); }
.doc-nav a[aria-current="true"] .nav-no { color: var(--mark); }
.doc-nav-level { border-top: 1px solid var(--rule); padding-top: 18px; }
.doc-nav-level p { font-size: 12px; color: var(--tick); margin: 10px 0 0; line-height: 1.5; }

.reading-column { min-width: 0; }
.chapter {
  padding-top: 30px;
  margin-top: 44px;
  border-top: 1px solid var(--rule);
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.chapter:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.chapter-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tick);
  margin-bottom: 12px;
}
.chapter-label .ch-no { color: var(--mark); }
.chapter h2 {
  font-family: var(--serif);
  font-size: var(--text-heading);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -0.015em;
  margin-bottom: 16px;
}
.chapter h3 {
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 28px 0 10px;
}
.chapter p,
.chapter li { font-size: var(--text-body); line-height: 1.68; color: var(--quiet); }
.chapter p { margin-bottom: 16px; }
.chapter ul { padding-left: 22px; margin: 0 0 18px; }
.chapter li { margin-bottom: 8px; }
.chapter strong { color: var(--ink); font-weight: 600; }
.chapter .lead { font-size: 1.125rem; color: var(--ink); }
.chapter .note-line {
  font-size: var(--text-sm);
  color: var(--quiet);
  border-left: 2px solid var(--mark);
  padding-left: 14px;
  margin: 20px 0;
}
.chapter .small-note { font-size: var(--text-sm); color: var(--tick); }

.reading-progress {
  position: fixed;
  top: 0;
  right: 0;
  width: 3px;
  height: 100vh;
  z-index: 55;
  background: var(--grid);
  pointer-events: none;
}
.reading-progress span {
  display: block;
  width: 100%;
  height: 0%;
  background: var(--mark);
}
.tick-rail {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 54;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0;
}
.tick-rail a {
  display: block;
  width: 22px;
  height: 12px;
  position: relative;
  text-decoration: none;
}
.tick-rail a::before {
  content: "";
  position: absolute;
  right: 0;
  top: 5px;
  width: 12px;
  height: 2px;
  background: var(--tick);
  transition: width 150ms var(--ease-out), background-color 150ms var(--ease-out);
}
.tick-rail a:hover::before { width: 20px; background: var(--quiet); }
.tick-rail a[aria-current="true"]::before { width: 22px; background: var(--mark); }
.tick-rail a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.mobile-doc-bar {
  display: none;
  position: sticky;
  top: var(--header-h);
  z-index: 50;
  background: rgba(244, 245, 247, 0.96);
  border-bottom: 1px solid var(--rule);
  padding: 8px 18px;
  align-items: center;
  gap: 12px;
}
.mobile-doc-bar select {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--sheet);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 10px;
}
.mobile-doc-bar .level-switch button { padding: 6px 10px; min-height: 40px; }

.svg-frame,
.stage-frame {
  margin: 26px 0 0;
  border: 1px solid var(--rule);
  background: var(--sheet);
}
.svg-caption {
  padding: 14px 18px;
  border-top: 1px solid var(--grid);
  background: var(--paper);
  font-size: var(--text-sm);
  line-height: 1.58;
  color: var(--quiet);
}
.svg-frame { padding: 16px; background: var(--sheet); }
.svg-frame svg { display: block; width: 100%; height: auto; }
.svg-frame .svg-caption { border-top: 0; padding: 12px 2px 0; background: transparent; }
.stage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--grid);
  background: var(--paper);
}
.stage-title { font-family: var(--mono); font-size: 12px; color: var(--quiet); margin: 0; }
.stage-body { padding: 18px; }
.seg-group { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-item {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--sheet);
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 11.5px;
  cursor: pointer;
  touch-action: manipulation;
}
.seg-item:hover { border-color: var(--mark); color: var(--mark); }
.seg-item[aria-checked="true"] { background: var(--mark); border-color: var(--mark); color: #fff; }
.seg-item:focus-visible { outline: 2px solid var(--mark); outline-offset: 2px; }

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 0;
}
.canvas-pane { padding: 18px; border-right: 1px solid var(--grid); min-width: 0; }
.inspector-pane { padding: 18px; min-width: 0; background: var(--paper); }
.torus-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 18px; margin-bottom: 12px; }
.torus-caption { font-size: var(--text-sm); color: var(--quiet); margin: 0; max-width: 60ch; }
.torus-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-family: var(--mono); font-size: 11px; color: var(--tick); }
.legend-key { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; display: inline-block; border: 1px solid var(--rule); }
.torus-svg-wrap { width: 100%; overflow-x: auto; }
.torus-svg { display: block; width: 100%; height: auto; }
.schedule-matrix th:first-child { position: sticky; left: 0; background: var(--paper); z-index: 1; }
.schedule-matrix th, .schedule-matrix td { padding: 8px 8px; font-size: 11px; }
.schedule-matrix td { text-align: center; font-family: var(--mono); }
@media (max-width: 720px) {
  .schedule-matrix th, .schedule-matrix td { padding: 6px 4px; font-size: 10px; }
  .tmr-table { font-size: 10px; }
  .tmr-table th, .tmr-table td { padding: 6px 5px; }
}
.schedule-matrix td.slot-active { background: var(--mark-soft); color: var(--ink); }
.schedule-matrix td.slot-diff { box-shadow: inset 0 -2px 0 var(--mark); }
.scrubber-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--grid);
}
.scrubber-label { font-family: var(--mono); font-size: 12px; color: var(--quiet); }
.slot-slider { flex: 1; min-width: 140px; accent-color: var(--mark); }
.slot-readout { font-family: var(--mono); font-size: 12px; color: var(--ink); }

.verdict-block { border-top: 3px solid var(--mark); padding-top: 14px; }
.verdict-status { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 8px; }
.verdict-status.pass { color: var(--mark); }
.verdict-status.warn { color: var(--quiet); }
.verdict-status.fail { color: var(--fault); }
.verdict-headline { font-family: var(--serif); font-size: 1.35rem; font-weight: 500; line-height: 1.25; margin-bottom: 10px; color: var(--ink); }
.verdict-copy { font-size: var(--text-sm); color: var(--quiet); margin-bottom: 14px; }
.metric-list { margin: 0; font-size: var(--text-sm); }
.metric-list > div { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--grid); }
.metric-list dt { color: var(--tick); }
.metric-list dd { margin: 0; color: var(--ink); font-family: var(--mono); font-size: 12px; text-align: right; }
.theorem-foot { font-size: var(--text-sm); color: var(--quiet); margin: 14px 0 0; }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--rule); background: var(--sheet); margin: 26px 0 0; }
table.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: var(--text-sm); }
table.data-table th,
table.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--grid); vertical-align: top; }
table.data-table th { background: var(--paper); color: var(--ink); font-weight: 600; white-space: nowrap; }
table.data-table td { color: var(--quiet); }
table.data-table tr:last-child td { border-bottom: 0; }
table.data-table tbody tr:hover { background: var(--paper); }
.cell-pass { color: var(--mark); font-family: var(--mono); font-weight: 500; }

.trust-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 26px;
}
.trust-col {
  border: 1px solid var(--rule);
  background: var(--sheet);
  padding: 20px 22px;
  min-width: 0;
}
.trust-col h3 { margin-top: 0; font-family: var(--serif); font-size: 1.25rem; font-weight: 500; }
.trust-col ul:last-child { margin-bottom: 0; }
.trust-col.kernel { border-top: 3px solid var(--mark); }
.trust-col.external { border-top: 3px solid var(--tick); }
.trust-col ul { margin: 0; }
.trust-col li { font-size: var(--text-sm); margin-bottom: 10px; }

.citation-block {
  border: 1px solid var(--rule);
  border-top: 3px solid var(--mark);
  background: var(--sheet);
  padding: clamp(20px, 3.5vw, 32px);
  margin-top: 26px;
}
.citation-block p { max-width: 76ch; }
.bibtex {
  background: var(--paper);
  border: 1px solid var(--grid);
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  overflow-x: auto;
  color: var(--quiet);
  margin: 16px 0 0;
  white-space: pre;
}
.copy-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.copy-status { font-family: var(--mono); font-size: 12px; color: var(--mark); align-self: center; }

.term {
  cursor: help;
  color: inherit;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(46, 102, 80, 0.62);
  text-underline-offset: 0.22em;
  -webkit-tap-highlight-color: transparent;
}
.term[aria-expanded="true"] { text-decoration-style: solid; text-decoration-color: var(--mark); }
@media (hover: hover) and (pointer: fine) {
  .term:hover { text-decoration-color: var(--mark); }
}
.term:focus-visible { outline: 1px solid var(--mark); outline-offset: 2px; }
.term-card {
  position: fixed;
  z-index: 90;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: 14px 16px 15px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--mark);
  box-shadow: 0 14px 34px rgba(17, 19, 22, 0.16);
  color: var(--ink);
  font-family: var(--sans);
  text-align: left;
  user-select: text;
  cursor: auto;
}
.term-card-title { font-size: 14px; font-weight: 600; line-height: 1.32; color: var(--ink); }
.term-card-part { margin-top: 10px; }
.term-card-part-plain { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--grid); }
.term-card-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--mark);
  margin: 0 0 4px;
}
.term-card-body { margin: 0; font-size: 12.8px; line-height: 1.52; color: var(--quiet); }
@media (prefers-reduced-motion: no-preference) {
  .term { transition: text-decoration-color 140ms ease; }
  .term-card { animation: term-card-in 140ms ease-out; }
  .term-card[data-side="above"] { animation-name: term-card-in-above; }
}
@keyframes term-card-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes term-card-in-above { from { opacity: 0; transform: translateY(4px); } }

.metric-toggle { display: flex; flex-wrap: wrap; gap: 6px; }
.chart-wrap { padding: 18px; }
.chart-svg { display: block; width: 100%; height: auto; }
.chart-note { font-size: var(--text-sm); color: var(--tick); margin: 12px 0 0; }
.ladder-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.ladder-value { border: 1px solid var(--grid); background: var(--paper); padding: 12px 14px; }
.ladder-value .lv-code { font-family: var(--mono); font-size: 11px; color: var(--tick); margin-bottom: 4px; }
.ladder-value .lv-num { font-family: var(--mono); font-size: 1.05rem; color: var(--ink); }
.ladder-value .lv-sub { font-size: 12px; color: var(--quiet); margin-top: 4px; }

.audit-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 0; }
.audit-list { border-right: 1px solid var(--grid); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.audit-list button {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--grid);
  background: var(--sheet);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--quiet);
  cursor: pointer;
  border-radius: 0;
}
.audit-list button[aria-pressed="true"] { border-color: var(--mark); background: var(--mark-soft); color: var(--ink); }
.audit-detail { padding: 18px; min-width: 0; }
.audit-detail h3 { margin-top: 0; }
.audit-detail dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: var(--text-sm); margin: 0; }
.audit-detail dt { color: var(--tick); font-family: var(--mono); font-size: 12px; }
.audit-detail dd { margin: 0; color: var(--ink); }

.tmr-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 11.5px; }
.tmr-table th,
.tmr-table td { border: 1px solid var(--grid); padding: 7px 8px; text-align: center; white-space: nowrap; }
.tmr-table th { background: var(--paper); color: var(--quiet); font-weight: 500; }
.tmr-table td { color: var(--quiet); }
.tmr-table td.changed { background: var(--mark-soft); color: var(--ink); }
.tmr-scroll { overflow-x: auto; }

.stepper-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.stepper-readout { font-family: var(--mono); font-size: 12px; color: var(--ink); }
.fault-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin-top: 12px; }
.fault-grid span { aspect-ratio: 1; border: 1px solid var(--grid); background: var(--paper); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 9px; color: var(--tick); }
.fault-grid span.fired { background: var(--mark); border-color: var(--mark); color: #fff; }
.fault-grid span.hit { background: var(--fault-soft); border-color: var(--fault); color: var(--fault); }
.fault-status { font-size: var(--text-sm); color: var(--quiet); margin-top: 12px; }

.rs9-footer-band {
  --f-cols: 12;
  --f-col: calc(100% / var(--f-cols));
  border-top: 1px solid var(--rule);
  padding: 0 24px;
  background: var(--paper);
  color: var(--quiet);
}
.rs9-footer-wrap { max-width: 1440px; margin: 0 auto; }
.rs9-footer-frame { border-left: 1px solid var(--grid); border-right: 1px solid var(--grid); }
.rs9-colophon { display: grid; grid-template-columns: repeat(var(--f-cols), 1fr); gap: 0; padding: 36px 0 28px; }
.rs9-colophon-brand { grid-column: span 4; padding: 0 24px; border-right: 1px solid var(--grid); }
.rs9-colophon-brand img { height: 26px; width: auto; display: block; }
.rs9-colophon-brand p { font-size: var(--text-sm); color: var(--tick); margin: 12px 0 0; }
.rs9-foot-nav { grid-column: span 4; padding: 0 24px; border-right: 1px solid var(--grid); }
.rs9-foot-nav + .rs9-foot-nav { border-right: 0; }
.rs9-foot-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tick); margin: 0 0 10px; }
.rs9-foot-nav ul { list-style: none; margin: 0; padding: 0; }
.rs9-foot-nav li { margin: 0 0 6px; }
.rs9-foot-nav a { font-size: var(--text-sm); color: var(--quiet); text-decoration: none; }
.rs9-foot-nav a:hover { color: var(--mark); }
.rs9-foot-note { grid-column: 1 / -1; margin: 26px 24px 0; padding-top: 20px; border-top: 1px solid var(--grid); font-size: var(--text-sm); color: var(--tick); line-height: 1.6; }
.rs9-foot-note a { color: var(--quiet); }
.rs9-foot-legal { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin: 20px 24px 0; padding: 18px 0 26px; border-top: 1px solid var(--grid); font-size: var(--text-sm); color: var(--tick); }
.rs9-foot-legal p { margin: 0; }
.rs9-foot-email { color: var(--quiet); }
.rs9-foot-legal-links { display: inline-flex; gap: 16px; margin-left: auto; }
.rs9-foot-legal-links a { color: var(--tick); font-size: var(--text-sm); }
.rs9-ruler-flip { display: flex; justify-content: space-between; border-top: 1px solid var(--rule); padding: 8px 24px; font-family: var(--mono); font-size: 10px; color: var(--tick); }

@media (max-width: 1279px) {
  .tick-rail { display: none; }
}
@media (max-width: 1099px) {
  .doc-shell { grid-template-columns: minmax(0, var(--measure)); }
  .doc-nav { display: none; }
  .mobile-doc-bar { display: flex; }
}
@media (max-width: 900px) {
  .workbench-grid, .trust-grid, .audit-grid { grid-template-columns: 1fr; }
  .canvas-pane { border-right: 0; border-bottom: 1px solid var(--grid); }
  .audit-list { border-right: 0; border-bottom: 1px solid var(--grid); flex-direction: row; flex-wrap: wrap; }
  .audit-list button { flex: 1 1 auto; }
  .rs9-colophon-brand { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--grid); padding-bottom: 20px; margin-bottom: 20px; }
  .rs9-foot-nav { grid-column: span 6; }
  .rs9-foot-nav + .rs9-foot-nav { border-right: 0; }
}
@media (max-width: 720px) {
  .hero-stage { text-align: left; }
  .hero-stage h1, .hero-deck, .hero-meta { margin-left: 0; margin-right: 0; }
  .hero-cta-row, .hero-inline-links, .hero-meta { justify-content: flex-start; }
  .term-hint { text-align: left; margin-left: 0; }
  .trust-col { padding: 16px 14px; }
  .rs9-footer-band { --f-cols: 4; padding: 0 16px; }
  .rs9-ruler-flip span:nth-child(n + 5) { display: none; }
  .rs9-foot-nav, .rs9-foot-nav + .rs9-foot-nav { grid-column: span 2; padding: 0 14px; }
  .rs9-colophon-brand { padding: 0 14px; }
  .rs9-foot-note, .rs9-foot-legal { margin-left: 14px; margin-right: 14px; }
  .rs9-foot-legal-links { margin-left: 0; }
  .svg-frame, .chart-wrap { padding: 12px; }
  .ladder-values { grid-template-columns: 1fr; }
  .stage-toolbar { align-items: flex-start; }
  .metric-list > div { grid-template-columns: 1fr; gap: 2px; }
  .metric-list dd { text-align: left; }
  .mobile-doc-bar { padding-inline: 14px; gap: 8px; }
  .mobile-doc-bar .level-label { display: none; }
}

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

@media print {
  :root { --paper: #ffffff; --sheet: #ffffff; --ink: #000000; --quiet: #222222; --grid: #cccccc; --rule: #999999; --tick: #555555; }
  html { font-size: 11pt; background: #fff; }
  body { background: #fff; overflow: visible; }
  .rs9-header, .rs9-footer-band, .doc-nav, .tick-rail, .reading-progress, .mobile-doc-bar,
  .hero-cta-row, .term-hint, .level-switch, .copy-row, .metric-toggle, .stepper-controls,
  .seg-group, .scrubber-bar, .skip-link { display: none !important; }
  .page-shell { max-width: none; padding: 0; }
  .hero-stage { text-align: left; padding: 0 0 18px; border-bottom: 1px solid #999; }
  .hero-stage h1 { font-size: 26pt; max-width: none; }
  .hero-deck { max-width: none; }
  .doc-shell { display: block; margin-top: 22px; }
  .chapter { break-inside: auto; margin-top: 26px; padding-top: 18px; }
  .svg-frame, .stage-frame, .citation-block, .trust-col, table.data-table { break-inside: avoid; }
  body[data-level] .expert-only, body[data-level] .plain-only { display: block !important; }
  a { color: #000; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #444; overflow-wrap: anywhere; }
  .term { text-decoration: none; }
  .term-card { display: none !important; }
  code { border-color: #ccc; }
}
