/* Building a Disability-Affirmative Mental Health Practice · site styles
   ---------------------------------------------------------------------------
   Visual language: a warm paper book — cream background, ink text, deep teal
   accents, serif body (Charter, the book's own typeface, → Georgia fallback),
   hairline rules, no cards or shadows. Light theme is the default; dark is a
   warm charcoal variant. Both meet WCAG AA for body text (≥4.5:1; most text
   here is ≥5:1).

   Accessibility is part of the theme of this book, so it is part of the
   design: strong :focus-visible outlines, a skip-to-content link, A−/A+ text
   sizing (root font-size scaling — every size below is in rem), and
   prefers-reduced-motion support.

   Dual-theme mechanics: variables are defined in :root (light, default) and
   again in the two dark blocks below. Dark applies via :root[data-theme="dark"]
   or — in auto mode — @media (prefers-color-scheme: dark); no JS listeners
   needed. The tri-state toggle lives in theme.mjs. */

:root {
  /* Light = warm paper */
  --bg: #faf6ef;
  --card: #fffdf9;
  --text: #2d2a24;
  --muted: #5c5648;
  --faint: #6f6858;
  --line: #e5ddcb;
  --line-soft: #efe9db;
  --accent: #0e5f5f;          /* deep teal, ≥6:1 on --bg */
  --accent-deep: #0a4747;
  --accent-tint: rgba(14, 95, 95, 0.08);
  --heading-dim: #453f33;
  /* Box palette: note = moss, vignette = plum, summary = teal */
  --note: #4e6b3a;
  --note-bg: rgba(78, 107, 58, 0.07);
  --vig: #6d4a98;
  --vig-bg: rgba(109, 74, 152, 0.06);
  --sum: #0e5f5f;
  --sum-bg: rgba(14, 95, 95, 0.06);
  --warn: #a3332c;
  --warn-bg: rgba(163, 51, 44, 0.07);
  --inline-code: #0a4747;
  --sel-bg: rgba(14, 95, 95, 0.22);
  --radius: 10px;
  --radius-sm: 6px;
  --serif: Charter, "Bitstream Charter", Sitka, Georgia, Cambria,
    "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  /* Dark = warm charcoal */
  --bg: #201d18;
  --card: #2a2620;
  --text: #e3ded3;
  --muted: #b3ab99;
  --faint: #948c78;
  --line: rgba(227, 222, 211, 0.16);
  --line-soft: rgba(227, 222, 211, 0.09);
  --accent: #63c1bc;
  --accent-deep: #8dd6d1;
  --accent-tint: rgba(99, 193, 188, 0.1);
  --heading-dim: rgba(227, 222, 211, 0.82);
  --note: #a9c18b;
  --note-bg: rgba(169, 193, 139, 0.08);
  --vig: #b9a3dd;
  --vig-bg: rgba(185, 163, 221, 0.08);
  --sum: #63c1bc;
  --sum-bg: rgba(99, 193, 188, 0.07);
  --warn: #e07a72;
  --warn-bg: rgba(224, 122, 114, 0.09);
  --inline-code: #8dd6d1;
  --sel-bg: rgba(99, 193, 188, 0.3);
}

/* Auto mode: follow the system unless light was chosen explicitly */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #201d18;
    --card: #2a2620;
    --text: #e3ded3;
    --muted: #b3ab99;
    --faint: #948c78;
    --line: rgba(227, 222, 211, 0.16);
    --line-soft: rgba(227, 222, 211, 0.09);
    --accent: #63c1bc;
    --accent-deep: #8dd6d1;
    --accent-tint: rgba(99, 193, 188, 0.1);
    --heading-dim: rgba(227, 222, 211, 0.82);
    --note: #a9c18b;
    --note-bg: rgba(169, 193, 139, 0.08);
    --vig: #b9a3dd;
    --vig-bg: rgba(185, 163, 221, 0.08);
    --sum: #63c1bc;
    --sum-bg: rgba(99, 193, 188, 0.07);
    --warn: #e07a72;
    --warn-bg: rgba(224, 122, 114, 0.09);
    --inline-code: #8dd6d1;
    --sel-bg: rgba(99, 193, 188, 0.3);
  }
}

/* ── Base ──
   html font-size is the text-scaling handle: base 17px, multiplied by the
   A−/A+ control (see a11y.mjs). Every text size below uses rem. */
html { font-size: 17px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(14, 95, 95, 0.35); text-underline-offset: 3px; }
:root[data-theme="dark"] a { text-decoration-color: rgba(99, 193, 188, 0.4); }
a:hover { color: var(--accent-deep); text-decoration-color: currentColor; }
h1, h2, h3, h4 { line-height: 1.35; font-weight: 400; letter-spacing: -0.01em; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.12rem; }
h4 { font-size: 1rem; }
p { margin: 0.8em 0; }
::selection { background: var(--sel-bg); }

/* Underlines are part of accessible link design; nav/heading links opt out */
a.nav-home, .topnav a, .back-bar, .pager a, .sec-item, .route-item, .hero-btn,
.page-toc button, .fs-btn, .footnotes .fn-back {
  text-decoration: none;
}

/* ── Keyboard focus: always clearly visible (WCAG 2.4.7) ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Skip-to-content link: visually hidden until focused ── */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform 0.15s ease;
}
.skip-link:focus { transform: none; }

/* ── Top navigation: transparent, hairline rule ── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 2.4rem) 0.8rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topnav .brand {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--text);
  white-space: nowrap;
}
.topnav .brand:hover { color: var(--accent); }
.topnav .crumb {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topnav .nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.topnav .nav-home {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}
.topnav .nav-home::before { content: "[ "; color: var(--faint); }
.topnav .nav-home::after { content: " ]"; color: var(--faint); }
.topnav .nav-home:hover { color: var(--accent); }

/* ── Theme toggle (tri-state: light / dark / system — see theme.mjs) ── */
.theme-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--faint);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); }
.theme-toggle svg { display: none; width: 0.92rem; height: 0.92rem; }
[data-theme="light"] .theme-toggle .i-light { display: block; }
[data-theme="dark"] .theme-toggle .i-dark { display: block; }
[data-theme="auto"] .theme-toggle .i-auto { display: block; }

/* ── Text-size controls (A− / A+ — see a11y.mjs) ── */
.fs-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.fs-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1;
  padding: 0.28rem 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.fs-btn:hover { color: var(--accent); border-color: var(--accent); }
.fs-display {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--faint);
  min-width: 2.6em;
  text-align: center;
}

/* ── Layout container ── */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 1.8rem clamp(1rem, 4vw, 2.4rem) 4.5rem;
  overflow-wrap: break-word; /* long words/URLs wrap instead of stretching */
}
.subtitle { color: var(--muted); font-size: 0.9rem; }
.footer-note { text-align: center; margin-top: 3rem; font-family: var(--mono); font-size: 0.72rem; color: var(--faint); }
.loading { text-align: center; margin-top: 7rem; }

/* ── Cover hero ── */
.paper-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.4rem, 4vw, 3rem);
  align-items: center;
  padding: 2.6rem 0 1rem;
}
.hero-kicker {
  font-family: var(--mono);
  color: var(--faint);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  margin: 0 0 0.9rem;
}
.paper-hero h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.6rem, 4.2vw, 2.35rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--text);
}
.hero-subtitle {
  color: var(--muted);
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  font-style: italic;
  margin: 0 0 0.8rem;
}
.hero-meta {
  font-family: var(--mono);
  color: var(--faint);
  font-size: 0.74rem;
  line-height: 1.9;
  margin: 0 0 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.hero-actions { margin: 1.6rem 0 0.4rem; }
.hero-btn {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--accent);
}
.hero-btn::before { content: "[ "; color: var(--faint); }
.hero-btn::after { content: " ]"; color: var(--faint); }
.hero-btn:hover { color: var(--accent-deep); }
.hero-btn:hover::before, .hero-btn:hover::after { color: var(--accent); }
.hero-cover-wrap { justify-self: center; }
.hero-cover {
  display: block;
  width: clamp(150px, 18vw, 220px);
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 var(--line), 0 10px 28px rgba(45, 42, 36, 0.12);
}
:root[data-theme="dark"] .hero-cover { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); }

/* ── Part index (cover): hairline rows ── */
.route-list { list-style: none; margin: 2.2rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.route-item {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr) auto;
  gap: 0 1rem;
  align-items: baseline;
  padding: 0.9rem 2px;
  border-bottom: 1px solid var(--line);
  color: inherit;
}
.route-item > * { transition: transform 0.15s ease; }
.route-item:hover > * { transform: translateX(8px); }
.route-name { font-family: var(--mono); font-size: 0.72rem; color: var(--faint); }
.route-title { font-size: 1rem; color: var(--text); }
.route-item:hover .route-title { color: var(--accent); }
.route-count { font-family: var(--mono); font-size: 0.7rem; color: var(--faint); }

/* ── Back bar (plain-text link, not a pill) ── */
.back-bar {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
}
.back-bar:hover { color: var(--accent); }
.back-arrow svg { display: inline-block; height: 0.9em; width: 0.5em; }
.back-label { font-weight: 400; }
.back-ctx { color: var(--faint); }
.back-ctx::before { content: " · "; }
.back-bar-end { margin: 2rem 0 0; }

/* ── Section index (part page): hairline rows, no cards ── */
.sec-list { list-style: none; margin: 1.4rem 0; padding: 0; }
.sec-item {
  display: block;
  padding: 0.85rem 2px;
  border-bottom: 1px solid var(--line);
  color: inherit;
}
/* Hover translate uses transform so it never disturbs layout width; only the
   content moves, the bottom hairline stays aligned */
.sec-item > * { transition: transform 0.15s ease; }
.sec-item:hover > * { transform: translateX(10px); }
.sec-line { display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; }
.sec-line .num {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
  min-width: 6.2em;
}
.sec-title { font-size: 1rem; color: var(--text); flex: 1; min-width: 200px; }
.sec-item:hover .sec-title { color: var(--accent); }
.sec-pages { font-family: var(--mono); font-size: 0.7rem; color: var(--faint); }
.sec-summary { margin: 0.3rem 0 0; font-size: 0.85rem; color: var(--muted); line-height: 1.7; padding-left: calc(6.2em + 0.7rem); }

/* ── Section page chips ── */
.sec-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 0.9rem; margin: 0.1rem 0 0.8rem; }
.chip-plain {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--faint);
  letter-spacing: 0.04em;
}

/* ── Pager: bracket links ── */
.pager {
  display: flex;
  gap: 1.7rem;
  margin: 1.8rem 0;
}
.pager a {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0.6rem 2px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 0.9rem;
  min-width: 0;
}
.pager a:last-child { text-align: right; align-items: flex-end; }
.pager a:hover { color: var(--accent); }
.pager a:hover .dir { color: var(--accent); }
.pager .dir { font-family: var(--mono); font-size: 0.7rem; color: var(--faint); font-weight: 400; }
.pager .dir::before { content: "[ "; }
.pager .dir::after { content: " ]"; }
.pager a span:not(.dir) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* ── Body typography ── */
.container > h1 { font-size: clamp(1.45rem, 3.6vw, 1.9rem); margin: 0.7rem 0 0.5rem; }
.sec-en-title {
  color: var(--faint);
  font-family: var(--mono);
  font-style: italic;
  font-size: 0.8rem;
  margin: 0 0 0.6rem;
}
.content-body h2, .container h2 {
  font-size: 1.35rem;
  margin: 2.3em 0 0.7em;
  color: var(--heading-dim);
}
.content-body h3, .container h3 { font-size: 1.12rem; margin: 1.8em 0 0.5em; color: var(--text); }
.container h4 { font-size: 1rem; margin: 1.5em 0 0.4em; color: var(--text); }
.container ul, .container ol { padding-left: 1.6em; }
.container li { margin: 0.3em 0; }
.container blockquote {
  margin: 1.2em 0;
  padding: 2px 1.2rem;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-style: italic;
}
code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--accent-tint);
  color: var(--inline-code);
  padding: 1px 5px;
  border-radius: 4px;
}
pre {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.05rem;
  overflow-x: auto;
  font-family: var(--mono);
  line-height: 1.65;
  font-size: 0.8rem;
  margin: 1.2em 0;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; border-radius: 0; }

/* ── Tables: APA-style book rules — rule above and below the header row,
   hairline between body rows, left-aligned, horizontal scroll when wide ── */
.table-wrap { margin: 1.4em 0; overflow-x: auto; }
.container table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  line-height: 1.65;
  border-top: 1.5px solid var(--text);
  border-bottom: 1.5px solid var(--text);
}
.container th, .container td {
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.9rem 0.55rem 0;
  text-align: left;
  vertical-align: top;
}
.container tbody tr:last-child td { border-bottom: none; }
.container th {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text);
  border-bottom: 1px solid var(--text);
  white-space: normal;
}
.container caption { caption-side: top; text-align: left; font-size: 0.8rem; color: var(--muted); padding-bottom: 0.4rem; }

/* ── Figures: direct screenshots from the book PDF; white plate so the black
   book text stays readable in dark mode too. Click opens the lightbox. ── */
figure.paper-figure {
  margin: 1.8em 0;
  text-align: center;
}
figure.paper-figure img {
  max-width: 100%;
  height: auto;
  cursor: zoom-in;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
}
figure.paper-figure figcaption {
  margin-top: 0.6rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
  line-height: 1.7;
  text-align: center;
}

/* ── Notes (footnotes) ── */
sup.fn-ref { font-size: 0.72em; line-height: 0; }
sup.fn-ref a { text-decoration: none; margin-left: 1px; }
section.footnotes {
  margin-top: 2.6em;
  padding-top: 1.1em;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}
section.footnotes h3 {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--faint);
  letter-spacing: 0.14em;
  margin: 0 0 0.6em;
}
section.footnotes ol { padding-left: 1.4em; }
section.footnotes li { margin: 0.35em 0; }
section.footnotes .fn-no {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
}
section.footnotes .fn-back {
  margin-left: 6px;
  color: var(--faint);
  font-size: 0.72rem;
}
section.footnotes .fn-back:hover { color: var(--accent); }

/* Anchor targets (notes/section headings) must not hide behind the sticky nav */
.container [id] { scroll-margin-top: 80px; }

/* ── Boxes (containers): thin left rule + faint tint, no card look ── */
.box {
  margin: 1.1rem 0;
  padding: 0.6rem 1rem 0.6rem 1.1rem;
  border-left: 3px solid var(--line);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--line-soft);
}
.box > .box-body > p:first-child, .box > p:first-child { margin-top: 2px; }
.box .box-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  padding: 0;
  margin-bottom: 6px;
  color: var(--faint);
}
.box .box-tag::before { content: "[ "; }
.box .box-tag::after { content: " ]"; }

/* Note box: moss */
.box-note { background: var(--note-bg); border-left-color: var(--note); }
.box-note .box-tag { color: var(--note); }

/* Case vignette box: plum */
.box-vignette { background: var(--vig-bg); border-left-color: var(--vig); }
.box-vignette .box-tag { color: var(--vig); }

/* Chapter overview (collapsible) */
details.box-summary {
  background: var(--sum-bg);
  border-left: 3px solid var(--sum);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
details.box-summary > summary {
  cursor: pointer;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding: 4px 2px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
details.box-summary > summary::-webkit-details-marker { display: none; }
details.box-summary > summary::before {
  content: "▸";
  font-size: 0.7rem;
  color: var(--faint);
  transition: transform 0.15s ease;
}
details.box-summary[open] > summary::before { transform: rotate(90deg); }
details.box-summary .box-body { margin-top: 4px; }

/* Unknown container fallback */
.box-callout { background: var(--line-soft); }

/* ── On-this-page TOC (floating right column on wide screens) ── */
.page-toc {
  position: fixed;
  top: 84px;
  right: max(28px, calc((100vw - 820px) / 2 - 224px));
  width: 208px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  border-left: 1px solid var(--line);
  padding: 4px 0 4px 16px;
  font-size: 0.72rem;
  z-index: 30;
  scrollbar-width: thin;
}
.page-toc-title {
  font-family: var(--mono);
  font-weight: 400;
  color: var(--faint);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  padding: 0 0 8px;
  margin-bottom: 6px;
}
.page-toc button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  padding: 3px 0;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-toc button:hover { color: var(--accent); }
.page-toc button.t-sub { padding-left: 14px; font-size: 0.68rem; color: var(--faint); }

/* ── Back to top ── */
#back-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 15px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 40;
}
#back-top.show { opacity: 1; visibility: visible; transform: none; }
#back-top:hover { color: var(--accent); border-color: var(--accent); }

/* ── Error card ── */
.error {
  background: var(--warn-bg);
  border-left: 3px solid var(--warn);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1.1rem 1.35rem;
  margin-top: 2.4rem;
}
.error b { color: var(--warn); font-size: 1rem; }
.error code { background: none; }

/* ── Figure lightbox ── */
.diagram-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 13, 10, 0.88);
  display: none;
}
.diagram-lightbox.open { display: block; }
.lb-canvas { position: absolute; inset: 0 0 56px 0; overflow: hidden; cursor: zoom-in; }
.lb-paper {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  cursor: grab;
  background: #fff; /* book screenshots have black text — keep a white plate */
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  padding: 6px;
}
.lb-paper.dragging { cursor: grabbing; }
.lb-paper img { display: block; }
.lb-bar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: 4px 8px;
}
.lb-bar button {
  border: none;
  background: none;
  color: var(--muted);
  border-radius: 999px;
  min-width: 30px;
  height: 28px;
  padding: 0 10px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
}
.lb-bar button:hover { color: var(--accent); }
.lb-scale {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  min-width: 44px;
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 1359px) {
  .page-toc { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 0.94rem; }
  .paper-hero { grid-template-columns: 1fr; }
  .hero-cover-wrap { justify-self: start; }
  .route-item { grid-template-columns: 3.4rem minmax(0, 1fr); }
  .route-count { grid-column: 2; }
  .sec-summary { padding-left: 0; }
  .pager { flex-direction: column; gap: 0.9rem; }
  .pager a:last-child { text-align: left; align-items: flex-start; }
  .sec-title { min-width: 140px; }
  .topnav { flex-wrap: wrap; }
}

/* ── Reduced motion: honor the user's preference ── */
@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;
  }
}

b, strong { font-weight: 700; }
