
@font-face { font-family: "Crimson Pro"; src: url(/assets/fonts/CrimsonPro-latin.woff2) format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+2074, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Crimson Pro"; src: url(/assets/fonts/CrimsonPro-latin-ext.woff2) format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Crimson Pro"; src: url(/assets/fonts/CrimsonPro-Italic-latin.woff2) format("woff2");
  font-weight: 200 900; font-style: italic; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "Crimson Pro"; src: url(/assets/fonts/CrimsonPro-Italic-latin-ext.woff2) format("woff2");
  font-weight: 200 900; font-style: italic; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Schibsted Grotesk"; src: url(/assets/fonts/SchibstedGrotesk-latin.woff2) format("woff2");
  font-weight: 400 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "Schibsted Grotesk"; src: url(/assets/fonts/SchibstedGrotesk-latin-ext.woff2) format("woff2");
  font-weight: 400 900; font-style: normal; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }

/* Chassis (shared by every course) + course accent. Light is default; night via [data-theme="night"].
   Accent defaults to Coral (Probability & Matrices). Swap per course via [data-accent="<hue>"]. */
:root{
  /* chassis - light */
  --bg:#F6F3EC; --paper:#FFFFFF;
  --navy:#182A4E; --navy-ink:#0E1B33; --mark-navy:#182A4E;
  --head:#182A4E; --ink:#1B2942; --ink-soft:#42506B; --muted:#5E6B85;
  --steel:#3E5C8A; --sky:#BFD3EE; --sky-tint:#EAF1FA;
  --amber:#976116; --amber-tint:#F9EFDC;
  --green:#2D7857; --green-tint:#E4F1EA;
  --line:#E7E2D6; --line-strong:#D6D0C2;
  --pic-bg:#C6D8EF; --pic-ink:#264B7E;
  --shadow:0 1px 2px rgba(14,27,51,.06),0 6px 22px rgba(24,42,78,.07);
  /* accent - Coral (this book): Base / Diagram / Ink / Tint + night Base for navy surfaces */
  --acc:#F26A4F; --acc-diagram:#EE4220; --acc-ink:#BE4029; --acc-tint:#FCEAE4; --acc-navy:#FF7E64;
  /* the ten-hue accent family - light Base / Ink / Tint (Diagram where it differs from Base) */
  --coral:#F26A4F; --coral-diagram:#EE4220; --coral-ink:#BE4029; --coral-tint:#FCEAE4;
  --aqua:#18A0C6; --aqua-diagram:#1690B2; --aqua-ink:#187894; --aqua-tint:#E8F4F9;
  --berry:#EC698A; --berry-diagram:#E7416B; --berry-ink:#CD1E4A; --berry-tint:#F9E8EB;
  --emerald:#28A968; --emerald-diagram:#23945B; --emerald-ink:#217D50; --emerald-tint:#EAF7F1;
  --iris:#878EE8; --iris-diagram:#6F77E3; --iris-ink:#565ED7; --iris-tint:#EDEDF8;
  --marigold:#C08A17; --marigold-diagram:#AB7B15; --marigold-ink:#946511; --marigold-tint:#FBF4DF;
  --apple:#4FA83A; --apple-diagram:#469433; --apple-ink:#3C7C29; --apple-tint:#EBF6E7;
  --tangerine:#E07B24; --tangerine-diagram:#C56C20; --tangerine-ink:#AD530E; --tangerine-tint:#FBEEDF;
  --teal:#0E9C8E; --teal-diagram:#0D9386; --teal-ink:#0C7268; --teal-tint:#E3F4F1;
  --plum:#9A4FB5; --plum-diagram:#9A4FB5; --plum-ink:#7A3593; --plum-tint:#F3E9F7;
}
[data-theme="night"]{
  --bg:#0E1526; --paper:#16203A;
  --navy:#182A4E; --navy-ink:#0B1222; --mark-navy:#FFFFFF;
  --head:#F2F6FC; --ink:#DCE6F5; --ink-soft:#BFD3EE; --muted:#93A0BC;
  --steel:#7FA3D4; --sky:#3E5C8A; --sky-tint:#1C2A44;
  --amber:#E6B84A; --amber-tint:#2A2410;
  --green:#5FC392; --green-tint:#12271D;
  --line:#243150; --line-strong:#33415F;
  --pic-bg:#223756; --pic-ink:#A9C7ED;
  --shadow:0 1px 2px rgba(0,0,0,.35),0 6px 22px rgba(0,0,0,.4);
  --acc:#FF7E64; --acc-diagram:#FF7E64; --acc-ink:#FF9C86; --acc-tint:#2B1E22;
}
/* per-course accent swaps - light mode values */
[data-accent="aqua"]{--acc:#18A0C6;--acc-diagram:#1690B2;--acc-ink:#187894;--acc-tint:#E8F4F9;--acc-navy:#71D7F4;}
[data-accent="berry"]{--acc:#EC698A;--acc-diagram:#E7416B;--acc-ink:#CD1E4A;--acc-tint:#F9E8EB;--acc-navy:#F47192;}
[data-accent="emerald"]{--acc:#28A968;--acc-diagram:#23945B;--acc-ink:#217D50;--acc-tint:#EAF7F1;--acc-navy:#7CDEAD;}
[data-accent="iris"]{--acc:#878EE8;--acc-diagram:#6F77E3;--acc-ink:#565ED7;--acc-tint:#EDEDF8;--acc-navy:#ACB0E7;}
[data-accent="marigold"]{--acc:#C08A17;--acc-diagram:#AB7B15;--acc-ink:#946511;--acc-tint:#FBF4DF;--acc-navy:#F0BE3E;}
[data-accent="apple"]{--acc:#4FA83A;--acc-diagram:#469433;--acc-ink:#3C7C29;--acc-tint:#EBF6E7;--acc-navy:#6FC94F;}
[data-accent="tangerine"]{--acc:#E07B24;--acc-diagram:#C56C20;--acc-ink:#AD530E;--acc-tint:#FBEEDF;--acc-navy:#F59A4E;}
[data-accent="teal"]{--acc:#0E9C8E;--acc-diagram:#0D9386;--acc-ink:#0C7268;--acc-tint:#E3F4F1;--acc-navy:#3FC3B4;}
[data-accent="plum"]{--acc:#9A4FB5;--acc-diagram:#9A4FB5;--acc-ink:#7A3593;--acc-tint:#F3E9F7;--acc-navy:#C07FD8;}
/* night-mode accent swaps */
[data-theme="night"][data-accent="aqua"]{--acc:#71D7F4;--acc-diagram:#71D7F4;--acc-ink:#97E2F7;--acc-tint:#1E2B2F;}
[data-theme="night"][data-accent="berry"]{--acc:#F47192;--acc-diagram:#F47192;--acc-ink:#F79CB3;--acc-tint:#301D21;}
[data-theme="night"][data-accent="emerald"]{--acc:#7CDEAD;--acc-diagram:#7CDEAD;--acc-ink:#A1E8C4;--acc-tint:#1E2F26;}
[data-theme="night"][data-accent="iris"]{--acc:#ACB0E7;--acc-diagram:#ACB0E7;--acc-ink:#C2C5EB;--acc-tint:#1E2033;}
[data-theme="night"][data-accent="marigold"]{--acc:#F0BE3E;--acc-diagram:#F0BE3E;--acc-ink:#F6D680;--acc-tint:#2E2610;}
[data-theme="night"][data-accent="apple"]{--acc:#6FC94F;--acc-diagram:#6FC94F;--acc-ink:#A0DE86;--acc-tint:#12240F;}
[data-theme="night"][data-accent="tangerine"]{--acc:#F59A4E;--acc-diagram:#F59A4E;--acc-ink:#F9BC88;--acc-tint:#2C1E10;}
[data-theme="night"][data-accent="teal"]{--acc:#3FC3B4;--acc-diagram:#3FC3B4;--acc-ink:#79D8CC;--acc-tint:#0E2623;}
[data-theme="night"][data-accent="plum"]{--acc:#C07FD8;--acc-diagram:#C07FD8;--acc-ink:#D3A4E4;--acc-tint:#241429;}

/* Deliberate deviations from the vendored design system (theme/ds), each
   with its reason. Spec 07 section 4.1: where the port deviates from the
   reference, it deviates on purpose and the reason is written above the
   rule. These are the audited additions from specs 01, 05, and 06, plus
   one v1.7 value correction. Proposed to Megan as design-system v1.8. */

:root {
  /* F-01/F-02: --acc as a focus ring measures 2.68:1 on Page against a
     3:1 minimum, and eight of the ten accents fail the same way. Every
     --acc-diagram passes on both surfaces, so the ring binds there. */
  --focus: var(--acc-diagram);

  /* F-05/F-06: the outline pill's only boundary (--line-strong) measures
     1.54:1 day and 1.58:1 night. --control-line is --muted given a second
     job, so no new color enters the palette. --line-strong keeps its old
     job as the decorative hairline, where 1.4.11 does not apply. */
  --control-line: #5E6B85;

  /* Spec 01 section 4: source pointers and dispute notes used <small> ad
     hoc; a named step stops that becoming an accidental type scale. */
  --text-note: 0.9375rem; /* 15px against a 16px root */
}

[data-theme="night"] {
  --control-line: #93A0BC;
}

/* v1.7 correction (Megan's blessing, 2026-07-19): Emerald ink was
   re-blessed at #1A6B44 after #217D50 measured 4.49:1 on sky-tint, a
   hair under the AA floor. The vendored v1.4 family list still carries
   the old value. This book does not use Emerald, but the token must not
   travel wrong. */
:root { --emerald-ink: #1A6B44; }
[data-accent="emerald"] { --acc-ink: #1A6B44; }

/* F-04: the vendored styles.css has no reduced-motion block at all.
   Motion is opt-in behind no-preference; this is the backstop. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Spec 05 section 3 AAA option, shipped as the third theme: enhanced
   contrast swaps the two tokens that sit nearest the AA floor. */
[data-theme="enhanced"] {
  --acc-ink: #3A40B4;
  --muted: #42506B;
  --control-line: #42506B;
}

/* The History of Calculus: every book-only class, ported per spec 07
   section 4. The React components in theme/ds/components are the reference
   rendering; values come from tokens via var(), never literals (the
   exceptions are the six documented deviations in overrides.css and the
   fixed on-navy text colors the design system itself fixes). Type scale is
   rem against a 16px root (F-17). */

/* ---------------------------------------------------------------- reset -- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Crimson Pro", Georgia, serif;
  font-size: 1.09375rem;            /* 17.5px */
  line-height: 1.68;
}
img { max-width: 100%; height: auto; }

/* ------------------------------------------------------------ typography -- */
h1, h2, h3, .sans {
  font-family: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  color: var(--head);
  line-height: 1.22;
}
h1 { font-size: 2.125rem; font-weight: 800; margin: 0.2em 0 0.45em; text-wrap: balance; }
h2 { font-size: 1.4375rem; font-weight: 700; margin: 1.7em 0 0.5em; text-wrap: balance; }
h3 { font-size: 1.0625rem; font-weight: 700; margin: 1.4em 0 0.4em; }
p { margin: 0 0 1em; }
.lede { font-size: 1.1875rem; color: var(--ink-soft); }
.eyebrow {
  font-family: "Schibsted Grotesk", sans-serif;
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--acc-ink); margin: 0 0 0.2em;
}
strong { color: var(--head); }
blockquote {
  margin: 1.2em 0; padding: 0.1em 0 0.1em 1.1em;
  border-left: 3px solid var(--steel);
  color: var(--ink-soft);
}
code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.875em; background: var(--sky-tint);
  padding: 0.08em 0.3em; border-radius: 4px;
  overflow-wrap: anywhere;
}
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* ---------------------------------------------------------------- focus -- */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
html { scroll-padding-top: 5rem; scroll-padding-bottom: 3rem; } /* F-15 */

/* ------------------------------------------------------------ skip links -- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--paper); color: var(--head);
  padding: 0.6em 1em; border: 2px solid var(--focus); border-radius: 8px;
  font-family: "Schibsted Grotesk", sans-serif; font-weight: 700;
}
.skip-link:focus-visible { left: 0.5rem; top: 0.5rem; }

/* --------------------------------------------------------------- top bar -- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.45rem clamp(0.8rem, 3vw, 1.6rem);
}
.topbar .mark { flex: 0 0 auto; display: flex; }
.topbar-title { line-height: 1.15; min-width: 0; }
.topbar-title a { text-decoration: none; color: var(--head); }
.topbar-title .t {
  font-family: "Schibsted Grotesk", sans-serif;
  font-weight: 700; font-size: 1rem; display: block;
}
.topbar-title .s {
  color: var(--muted); font-size: 0.875rem; font-style: italic; display: block;
}
.topbar-actions { margin-left: auto; display: flex; gap: 0.45rem; flex-wrap: wrap; }
@media (max-width: 700px) { .topbar-title .s { display: none; } }

/* ----------------------------------------------------------------- pills -- */
.pill {
  display: inline-flex; align-items: center; gap: 0.35em;
  font-family: "Schibsted Grotesk", sans-serif;
  font-weight: 700; font-size: 0.875rem;
  color: var(--head); background: transparent;
  border: 1px solid var(--control-line);           /* F-05 */
  border-radius: 999px; padding: 0.28em 0.85em;
  min-height: 24px;                                 /* F-16 */
  text-decoration: none; cursor: pointer;
}
.pill:hover { border-color: var(--acc); color: var(--acc-ink); }
.pill:active { transform: translateY(1px); }
.pill--solid {
  background: var(--acc-ink); color: var(--acc-tint); border-color: var(--acc-ink);
}
.pill--solid:hover { color: var(--acc-tint); }
.pill--navy { background: var(--navy); color: #EAF1FA; border-color: var(--navy); }
[data-theme="night"] .pill--navy { border-color: var(--control-line); } /* F-03 night */
.pill--steel { background: var(--steel); color: #fff; border-color: var(--steel); }
[data-theme="night"] .pill--steel { color: var(--navy-ink); }           /* F-04 */

/* --------------------------------------------------------------- layout -- */
.page {
  display: grid; gap: 2.2rem;
  grid-template-columns: minmax(0, 1fr);
  max-width: 73.75rem; margin: 0 auto;
  padding: 1.4rem clamp(0.8rem, 3vw, 1.6rem) 0;
}
@media (min-width: 1100px) {
  .page.with-rail { grid-template-columns: 18.125rem minmax(0, 1fr); }
  .contents-pill { display: none; }
}
@media (max-width: 1099.98px) {
  .rail { display: none; }
}
main { min-width: 0; max-width: 46rem; }
.doc-meta {
  font-family: "Schibsted Grotesk", sans-serif;
  color: var(--muted); font-size: 0.8125rem; margin: 0 0 1.6em;
}

/* ------------------------------------------------------------------ rail -- */
.rail {
  align-self: start; position: sticky; top: 4.2rem;
  max-height: calc(100vh - 5rem); overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: 14px;
  padding: 0.9rem 1rem 1.1rem;
}
.rail .cap {
  font-family: "Schibsted Grotesk", sans-serif;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 0.6em;
}
.rail ol { list-style: none; margin: 0; padding: 0; }
.rail li { margin: 0; }
.rail a {
  display: block; text-decoration: none; color: var(--ink);
  font-family: "Schibsted Grotesk", sans-serif; font-size: 0.8125rem;
  padding: 0.28em 0.5em; border-radius: 0 8px 8px 0;
  border-left: 3px solid transparent; min-height: 24px;
}
.rail a:hover { color: var(--acc-ink); }
.rail a[aria-current="page"] {
  background: var(--acc-tint); border-left-color: var(--acc);
  color: var(--head); font-weight: 700;
}
.rail details { margin: 0 0 0.15em; }
.rail summary {
  font-family: "Schibsted Grotesk", sans-serif; font-weight: 700;
  font-size: 0.8125rem; color: var(--head);
  cursor: pointer; padding: 0.3em 0.5em; border-radius: 8px;
  list-style: none; display: flex; align-items: center; gap: 0.4em;
  min-height: 24px;
}
.rail summary::-webkit-details-marker { display: none; }
.rail summary::after {                          /* drawn chevron, JC-10 */
  content: ""; width: 0.45em; height: 0.45em; margin-left: auto;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform 120ms;
}
.rail details[open] > summary::after { transform: rotate(225deg); }

/* ----------------------------------------------------------- inline links -- */
main a { color: var(--acc-ink); text-decoration: none; }
main a:hover { color: var(--acc); text-decoration: underline; }
a.person-link { text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
a.term-link { text-decoration: underline; text-decoration-color: var(--acc); text-underline-offset: 2px; }
a.crossref { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.cite, .cite-note {
  font-size: var(--text-note); color: var(--muted);
}
.cite a.source-pointer { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--muted); }
/* Links inside table cells and reverse-link lines sit in text blocks, so
   color alone cannot carry them (WCAG 1.4.1; axe link-in-text-block). */
td a, tbody th a, small.rev a, .search-results a {
  text-decoration: underline; text-decoration-color: var(--control-line);
  text-underline-offset: 2px;
}
.cite a.source-pointer:hover { color: var(--acc-ink); }

/* -------------------------------------------------------------- disputed -- */
.disputed { font-style: italic; }
.disputed::before {
  content: "Disputed: ";
  font-family: "Schibsted Grotesk", sans-serif;
  font-style: normal; font-weight: 700; font-size: 0.75em;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--steel);
}
small.dispute-note, .dispute-note {
  display: block; font-size: var(--text-note); color: var(--muted);
  font-style: normal;
}
small.rev { font-size: var(--text-note); color: var(--muted); }

/* -------------------------------------------------------------- callouts -- */
.callout {
  border-left: 4px solid var(--acc-diagram);     /* F-03: bar on -diagram */
  background: var(--acc-tint);
  border-radius: 0 12px 12px 0;
  padding: 0.9em 1.1em 0.6em; margin: 1.4em 0;
}
.callout .callout__l, .callout__l {
  font-family: "Schibsted Grotesk", sans-serif;
  font-weight: 700; font-size: 0.8125rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--acc-ink); margin: 0 0 0.4em;
}
.callout--close { background: var(--green-tint); border-left-color: var(--green); }
.callout--close .callout__l { color: var(--green); }
.callout--note { background: var(--sky-tint); border-left-color: var(--steel); }
.callout--note .callout__l { color: var(--steel); }

/* --------------------------------------------------------------- reveals -- */
details.reveal, details:not(.rail details):not(.math-words) { margin: 0.8em 0; }
main summary {
  cursor: pointer; font-family: "Schibsted Grotesk", sans-serif;
  font-weight: 700; font-size: 0.875rem; color: var(--acc-ink);
  background: var(--acc-tint); border-radius: 999px;
  padding: 0.3em 1em; display: inline-flex; align-items: center; gap: 0.5em;
  list-style: none; min-height: 24px;
}
main summary::-webkit-details-marker { display: none; }
main summary::after {
  content: ""; width: 0.4em; height: 0.4em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform 120ms;
}
main details[open] > summary::after { transform: rotate(225deg); }
main details > *:not(summary) { margin-left: 0.4em; }

/* ------------------------------------------------------------------ math -- */
figure.math-display { margin: 1.5em 0; }
.math-scroll { overflow-x: auto; padding: 0.2em 0; }
math { font-family: "Crimson Pro", Georgia, serif; font-size: 1.08em; }
details.math-words { margin: 0.3em 0 0; }
details.math-words summary {
  background: transparent; color: var(--muted);
  font-weight: 600; font-size: var(--text-note); padding-left: 0;
}
details.math-words p { color: var(--ink-soft); font-size: 0.9375rem; }
html.no-mathml details.math-words { display: block; }

/* ---------------------------------------------------------------- tables -- */
.table-scroll { overflow-x: auto; margin: 1.4em 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
caption {
  text-align: left; font-family: "Schibsted Grotesk", sans-serif;
  font-size: 0.8125rem; color: var(--muted); padding: 0 0 0.5em;
}
th, td {
  text-align: left; vertical-align: top;
  padding: 0.45em 0.7em; border-bottom: 1px solid var(--line);
}
thead th {
  text-align: center; font-family: "Schibsted Grotesk", sans-serif;
  font-size: 0.8125rem; color: var(--head);
  border-bottom: 2px solid var(--line-strong);
  position: sticky; top: 0; background: var(--bg);
}
tbody th[scope="row"] { font-weight: 600; color: var(--head); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:target { background: var(--acc-tint); }
.timeline tbody th[scope="row"] { white-space: nowrap; }

/* ----------------------------------------------------------------- doors -- */
.doors { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 1.8em 0; }
@media (min-width: 700px) { .doors { grid-template-columns: repeat(3, 1fr); } }
.door {
  display: flex; flex-direction: column; gap: 0.3em;
  background: var(--paper); border: 1px solid var(--line-strong);
  border-radius: 14px; padding: 1.1em 1.2em;
  box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
}
.door:hover { border-color: var(--acc); text-decoration: none; }
.door-eyebrow {
  font-family: "Schibsted Grotesk", sans-serif; font-size: 0.75rem;
  font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--acc-ink);
}
.door-title {
  font-family: "Schibsted Grotesk", sans-serif; font-weight: 800;
  font-size: 1.1875rem; color: var(--head);
}
.door-note { color: var(--ink-soft); font-size: 0.9375rem; }

/* --------------------------------------------------------------- era nav -- */
.era-nav ol {
  list-style: none; margin: 1.2em 0; padding: 0;
  display: grid; gap: 0.4rem;
}
.era-nav a {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.45em 0.9em; border: 1px solid var(--line-strong);
  border-radius: 10px; text-decoration: none; color: var(--head);
  font-family: "Schibsted Grotesk", sans-serif; font-size: 0.875rem;
  min-height: 24px;
}
.era-nav a:hover { border-color: var(--acc); color: var(--acc-ink); text-decoration: none; }
.era-nav a[aria-current="page"] { background: var(--acc-tint); border-color: var(--acc); }
.era-nav .count, .toc .count, .door .count { color: var(--muted); font-size: 0.8125rem; }

/* -------------------------------------------------------------- page nav -- */
.pagenav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin: 3em 0 0; padding-top: 1.2em; border-top: 1px solid var(--line);
}
.pagenav a {
  max-width: 46%; text-decoration: none;
  font-family: "Schibsted Grotesk", sans-serif; font-size: 0.875rem;
  color: var(--head);
}
.pagenav a:hover { color: var(--acc-ink); }
.pagenav .dir { display: block; color: var(--muted); font-size: 0.75rem;
  letter-spacing: 0.12em; text-transform: uppercase; }
.pagenav .next { text-align: right; margin-left: auto; }

/* ---------------------------------------------------------------- search -- */
.search { display: flex; gap: 0.6rem; align-items: flex-end; flex-wrap: wrap; margin: 1.4em 0; }
.search label { font-family: "Schibsted Grotesk", sans-serif; font-weight: 700;
  display: block; width: 100%; }
.search input[type="search"] {
  flex: 1 1 16rem; font: inherit; padding: 0.5em 0.8em;
  border: 1px solid var(--control-line); border-radius: 10px;
  background: var(--paper); color: var(--ink); min-height: 24px;
}
.search-results h2 { margin-top: 1.6em; }
.search-results ol { list-style: none; padding: 0; margin: 0.6em 0; }
.search-results li { margin: 0 0 0.9em; }
.search-results .where { color: var(--muted); font-size: 0.8125rem;
  font-family: "Schibsted Grotesk", sans-serif; }

/* --------------------------------------------------------------- footer -- */
.footer {
  font-family: "Schibsted Grotesk", sans-serif;
  color: var(--muted); font-size: 0.8125rem;
  border-top: 1px solid var(--line);
  margin-top: 3.5rem; padding: 1.6rem 0 3.75rem;
}
.footer a { color: inherit; }

/* --------------------------------------------------- audio highlight hook -- */
.hoc-audio-active { background: var(--acc-tint); box-shadow: -0.6em 0 0 var(--acc-tint); }

/* ------------------------------------------------------- course-jump row -- */
.course-jump { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1em 0 1.6em; }

/* ------------------------------------------------------------- deferring -- */
.longdoc section, .longdoc .table-scroll {
  content-visibility: auto;
  contain-intrinsic-size: auto 800px;
}

/* ------------------------------------------------------------ print, L1 -- */
@media print {
  .topbar, .rail, .pagenav, .skip-link, .contents-pill, .search,
  .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  main { max-width: none; }
  * { content-visibility: visible !important; contain-intrinsic-size: none !important; }
  details, details.math-words { display: block; }
  details > summary { display: none; }
  details > *:not(summary) { display: block; }
  a { color: inherit; text-decoration: none; }
  .cite a.source-pointer { border-bottom: none; }
  tr, figure, .callout { break-inside: avoid; }
  thead th { position: static; }
  .footer { page-break-before: avoid; }
}

/* --------------------------------------------------------------- audio bar */
.audio-bar {
  position: fixed; left: 50%; bottom: 0.6rem; transform: translateX(-50%);
  z-index: 40; display: flex; gap: 0.45rem; align-items: center;
  flex-wrap: wrap; max-width: min(94vw, 46rem);
  background: var(--paper); border: 1px solid var(--line-strong);
  border-radius: 14px; box-shadow: var(--shadow);
  padding: 0.5rem 0.8rem;
}
.audio-bar[hidden] { display: none; }
.audio-bar .voice-label {
  font-family: "Schibsted Grotesk", sans-serif; font-size: 0.8125rem;
  color: var(--muted); display: inline-flex; gap: 0.4em; align-items: center;
}
.audio-bar select {
  font: inherit; font-size: 0.8125rem; max-width: 11rem;
  border: 1px solid var(--control-line); border-radius: 8px;
  background: var(--paper); color: var(--ink); padding: 0.15em 0.3em;
  min-height: 24px;
}
.audio-status {
  margin: 0; font-family: "Schibsted Grotesk", sans-serif;
  font-size: 0.75rem; color: var(--muted); flex-basis: 100%;
}
.audio-status:empty { display: none; }

/* ----------------------------------------------------------- print dialog */
.print-dialog {
  border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow); padding: 1.2rem 1.4rem;
  max-width: 26rem; font-size: 0.9375rem;
}
.print-dialog::backdrop { background: rgba(14, 27, 51, 0.45); }
.print-dialog h2 { margin-top: 0; font-size: 1.1875rem; }
.print-dialog fieldset {
  border: 1px solid var(--line); border-radius: 10px; margin: 0 0 0.8em;
}
.print-dialog legend {
  font-family: "Schibsted Grotesk", sans-serif; font-weight: 700;
  font-size: 0.8125rem; color: var(--muted); padding: 0 0.4em;
}
.print-dialog label { display: block; padding: 0.2em 0; }
.print-note { color: var(--muted); font-size: 0.875rem; }
.print-actions { display: flex; justify-content: flex-end; gap: 0.6rem; }

/* ------------------------------------------------ print presets (layer 1) */
@media print {
  .audio-bar, .print-dialog { display: none !important; }
  html[data-print-cites="off"] .cite,
  html[data-print-cites="off"] .cite-note { display: none !important; }
  html[data-print-preset="largeprint"] body {
    font-family: "Schibsted Grotesk", Arial, sans-serif;
    font-size: 16pt; line-height: 1.6;
  }
  html[data-print-preset="largeprint"] em,
  html[data-print-preset="largeprint"] i { font-style: normal; }
  html[data-print-preset="largeprint"] .disputed {
    font-style: normal; font-weight: 700;
  }
  html[data-print-preset="teacher"] small.rev { display: block; }
}

/* Appendix H thumbnails: unmodified files, CSS-sized, credit under each. */
img.h-thumb { max-width: 14rem; max-height: 12rem; width: auto;
  border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--paper); }
small.credit { color: var(--muted); font-size: var(--text-note); }
