/* Freedom 250 Research Library — design prototype, second pass (October 11, 2026).
   Visual layer only; library.js fills pages from data/design_data.json.
   Dark navy is the preferred direction. Light is designed to the same standard.
   Theme: <html data-theme="dark|light"> is set before paint by the inline script in each page;
   the visitor's choice (Dark / Light / System) is remembered in this browser. */

/* ---------- Tokens: dark (default, also used when JavaScript is off) ---------- */
:root {
  color-scheme: dark;
  --bg: #0B1220;
  --bg-2: #0F1828;
  --surface: #121C2E;
  --surface-2: #17233A;
  --ink: #E9EDF3;
  --ink-2: #C5CDD9;
  --muted: #96A3B6;
  --rule: #24324B;
  --rule-strong: #C5CDD9;
  --label: #AFC2DE;
  --link: #9FC6F5;
  --link-hover: #CFE2FA;
  --focus: #9FC6F5;
  --warn: #F2A57E;
  --note-bg: #1D2A43;
  --bar: #070D18;
  --bar-ink: #E9EDF3;
  --bar-muted: #93A1B6;
  --bar-line: #1E2B42;
  --chart: #7C8FAD;
  --frame: #2A3A55;
  --shadow: 0 1px 0 rgba(0,0,0,.25);

  --serif: "Times New Roman", Times, serif;
  --ui: "Times New Roman", Times, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --max: 1200px;
  --read: 68ch;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 0;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;
  --text-small: 14px;
  --text-body: 17px;
  --text-reading: 19px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F7F7F4;
  --bg-2: #EFEFEA;
  --surface: #FFFFFF;
  --surface-2: #F2F3F1;
  --ink: #12161D;
  --ink-2: #353B45;
  --muted: #5B616B;
  --rule: #D8DBE0;
  --rule-strong: #12161D;
  --label: #23406A;
  --link: #1B4F8A;
  --link-hover: #0E2F57;
  --focus: #1B4F8A;
  --warn: #9A3412;
  --note-bg: #EEF2F8;
  --bar: #0E1A2B;
  --bar-ink: #F2F4F7;
  --bar-muted: #AAB6C7;
  --bar-line: #22324B;
  --chart: #9AA6B6;
  --frame: #CDD2D9;
  --shadow: 0 1px 0 rgba(0,0,0,.04);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--text-body)/1.55 var(--ui); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; color: var(--ink); letter-spacing: 0; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 10px 14px; z-index: 99; }
.skip:focus { left: 12px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); font-size: .85em; }
.muted { color: var(--muted); }

/* ---------- Top bar (every screen) ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bar); color: var(--bar-ink); border-bottom: 1px solid var(--bar-line); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--bar-ink); text-decoration: none; min-height: 44px; flex: none; }
.brand:hover { color: #fff; }
.brand svg { flex: none; color: var(--bar-ink); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-kicker { font: 500 10.5px/1.2 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--bar-muted); }
.brand-name { font: 400 18px/1.15 var(--serif); white-space: nowrap; }
.primary { display: flex; gap: 2px; align-self: stretch; }
.primary a { color: var(--bar-muted); text-decoration: none; font: 500 15px/1 var(--ui); padding: 0 9px; min-height: 44px; display: inline-flex; align-items: center; border-bottom: 2px solid transparent; }
.primary a:hover { color: #fff; }
.primary a[aria-current] { color: #fff; border-bottom-color: var(--bar-ink); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topsearch { display: flex; align-items: center; }
.topsearch input { width: 230px; min-height: 44px; border: 1px solid var(--bar-line); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: #0C1626; color: var(--bar-ink); padding: 0 12px; font: 14px var(--ui); }
.topsearch input::placeholder { color: #7E8BA0; }
.topsearch button { min-height: 44px; border: 1px solid var(--bar-line); border-radius: 0 var(--radius) var(--radius) 0; background: #0C1626; color: var(--bar-ink); font: 500 14px var(--ui); padding: 0 12px; cursor: pointer; }
.topsearch button:hover { background: #142036; }
.search-link { display: none; color: var(--bar-ink); min-height: 44px; min-width: 44px; align-items: center; justify-content: center; }
/* Theme switch: three radios styled as a segmented control */
.theme-switch { border: 1px solid var(--bar-line); border-radius: var(--radius); display: inline-flex; margin: 0; padding: 0; min-width: 0; }
.theme-switch legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.theme-switch label { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; font: 500 13px var(--ui); color: var(--bar-muted); cursor: pointer; }
.theme-switch label + label { border-left: 1px solid var(--bar-line); }
.theme-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.theme-switch label:hover { color: #fff; }
.theme-switch label:has(input:checked) { background: var(--bar-ink); color: var(--bar); }
.theme-switch label:has(input:focus-visible) { outline: 2px solid var(--bar-ink); outline-offset: 2px; }

/* ---------- Trail ---------- */
.trail { border-bottom: 1px solid var(--rule); background: var(--bg-2); }
.trail ol { list-style: none; margin: 0; padding: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; font: 14px var(--ui); color: var(--muted); }
.trail li { display: flex; align-items: center; gap: 6px; }
.trail li + li::before { content: "/"; color: var(--rule); }
.trail a { color: var(--ink-2); text-decoration: none; }
.trail a:hover { text-decoration: underline; }
.trail [aria-current] { color: var(--ink); }
.trail .home a { font-weight: 600; color: var(--link); }
.trail .home a::before { content: "← "; }

/* ---------- Shared pieces ---------- */
.label { font: 600 11.5px/1.3 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--label); margin: 0 0 10px; }
.lede { font: 400 19px/1.55 var(--serif); color: var(--ink-2); max-width: 60ch; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--rule-strong); padding-top: 14px; margin: 0 0 22px; }
.section-head h2 { font-size: clamp(24px, 2.6vw, 30px); margin: 0; }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius); border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font: 600 15px var(--ui); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--bg); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.textlink { font: 600 15px var(--ui); text-decoration: none; }
.textlink:hover { text-decoration: underline; }
.date { font: 14px var(--ui); color: var(--muted); }
.date strong { color: var(--ink-2); font-weight: 600; }
.state { font: 14px var(--ui); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.state::before { content: ""; width: 7px; height: 7px; background: var(--link); }
.state.review::before { background: var(--warn); }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.review-note { border: 1px dashed var(--label); background: var(--note-bg); color: var(--ink-2); padding: 10px 14px; border-radius: var(--radius); font: 14px/1.5 var(--ui); margin: 14px 0; max-width: 72ch; overflow-wrap: anywhere; }
.review-note b { color: var(--label); font-weight: 600; }
.draft { display: inline-block; font: 600 10.5px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--label); border: 1px dashed var(--label); padding: 3px 5px; vertical-align: middle; margin-left: 6px; }
details.quiet { border-top: 1px solid var(--rule); margin-top: 18px; padding-top: 4px; font: 14px var(--ui); }
details.quiet > summary { cursor: pointer; color: var(--muted); min-height: 40px; display: flex; align-items: center; list-style: none; }
details.quiet > summary::-webkit-details-marker { display: none; }
details.quiet > summary::before { content: "+"; width: 18px; color: var(--muted); }
details.quiet[open] > summary::before { content: "−"; }
.ids { font: 12.5px/1.6 var(--mono); color: var(--muted); margin: 6px 0 10px; overflow-wrap: anywhere; }
.ids dt { color: var(--ink-2); font: 600 12.5px var(--ui); margin-top: 8px; }
.ids dd { margin: 0; }
.figure { margin: 0; }
.figure .still { display: block; aspect-ratio: 16 / 10; width: 100%; object-fit: cover; object-position: top left; border: 1px solid var(--frame); border-radius: var(--radius); background: var(--surface-2); }
.figure figcaption { font: 13.5px/1.45 var(--ui); color: var(--muted); margin-top: 8px; }
.figure figcaption a { white-space: nowrap; }
.no-still { aspect-ratio: 16 / 10; border: 1px dashed var(--frame); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; font: 14px/1.5 var(--ui); color: var(--muted); background: var(--surface); }

/* ---------- Home: welcome + thesis ---------- */
.welcome { position: relative; overflow: hidden; border-bottom: 1px solid var(--rule); background: var(--bg); }
.welcome .sky { position: absolute; right: -170px; top: -120px; width: 660px; height: 660px; color: var(--chart); opacity: .35; pointer-events: none; }
:root[data-theme="light"] .welcome .sky { opacity: .45; }
.welcome .wrap { position: relative; }
.welcome-head { padding: clamp(20px, 2.5vw, 32px) 0 var(--space-2); max-width: 760px; }
.welcome-head h1 { font-size: clamp(30px, 3.3vw, 42px); line-height: 1.12; margin: 0 0 var(--space-1); }
.welcome-head p { font: 18px/1.55 var(--serif); color: var(--ink-2); margin: 0; max-width: 62ch; }
.entry-paths { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin-top: var(--space-2); }
.entry-paths a { color: var(--link); font: 15px/1.35 var(--ui); text-decoration: none; border-bottom: 1px solid var(--link); }
.entry-paths a:hover { color: var(--ink); border-color: var(--ink); }
.thesis-feature { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); grid-template-areas: "heading figure" "body figure" "meta figure"; grid-template-rows: auto auto 1fr; gap: var(--space-2) var(--space-4); align-items: start; border-top: 1px solid var(--rule-strong); padding: var(--space-3) 0 var(--space-4); }
.thesis-heading { grid-area: heading; }
.thesis-body { grid-area: body; }
.thesis-meta { grid-area: meta; }
.thesis-feature > .figure { grid-area: figure; }
.thesis-feature h2 { font-size: clamp(24px, 2.6vw, 30px); line-height: 1.2; margin: 0; }
.thesis-feature .preview { font: 21px/1.5 var(--serif); color: var(--ink); margin: 0 0 14px; max-width: 46ch; }
.thesis-feature .status { font: 14px/1.5 var(--ui); color: var(--muted); margin: 0 0 var(--space-1); max-width: 60ch; }
.actions { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.map-extract { display: block; padding: var(--space-2); border: 1px solid var(--frame); background: var(--surface); color: var(--ink); text-decoration: none; }
.map-extract:hover, .map-extract:focus-visible { color: var(--ink); border-color: var(--link); }
.map-extract-top, .map-extract-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font: 14px/1.3 var(--ui); color: var(--muted); }
.map-extract-top { padding-bottom: var(--space-1); border-bottom: 1px solid var(--rule); }
.map-extract-top span { white-space: nowrap; }
.map-extract-title { display: block; margin-top: var(--space-2); font: 400 clamp(24px, 2.4vw, 30px)/1.12 var(--serif); }
.map-extract-intro { display: block; margin: 4px 0 var(--space-2); color: var(--ink-2); font: 15px/1.4 var(--ui); }
.map-extract-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1); }
.map-extract-item { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-content: start; gap: 3px var(--space-1); min-height: 94px; padding: 10px; border: 1px solid var(--rule); border-left: 2px solid var(--label); background: var(--bg-2); }
.map-extract-code { grid-row: span 2; color: var(--label); font: 600 13px/1.35 var(--mono); }
.map-extract-item strong { font: 700 18px/1.15 var(--serif); }
.map-extract-item > span:last-child { grid-column: 2; color: var(--ink-2); font: 14px/1.3 var(--ui); }
.map-extract-foot { padding-top: var(--space-2); }
.map-extract-foot span:last-child { color: var(--link); font-weight: 600; }

/* ---------- Home: themes ---------- */
.recent { padding: var(--space-4) 0 var(--space-1); }
.recent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--space-3); }
.recent-item { padding: var(--space-2) 2px var(--space-2); border-top: 1px solid var(--rule); }
.recent-date { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; margin: 0 0 var(--space-1); color: var(--label); font: 600 var(--text-small) var(--ui); }
.recent-date span { color: var(--muted); font-weight: 500; }
.recent-item h3 { margin: 0 0 var(--space-1); font: 21px/1.25 var(--serif); }
.recent-item h3 a { color: var(--ink); text-decoration: none; }
.recent-item h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.recent-summary { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0 0 var(--space-1); color: var(--muted); font: 15px/1.45 var(--ui); }
.recent-evidence { margin: 0; font-size: var(--text-small); }
.recent-evidence .date { font-size: var(--text-small); }
.recent-note { margin: var(--space-1) 0 0; color: var(--muted); font: var(--text-small)/1.45 var(--ui); }
.recent-more { margin-top: var(--space-1); border-top: 1px solid var(--rule); }
.recent-more > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--link); font: 600 15px var(--ui); }
.recent-more > summary:hover { color: var(--link-hover); }
.recent-more > summary::marker { color: var(--link); }
.themes { padding: var(--space-4) 0 var(--space-1); }
.theme { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-4); padding: var(--space-3) 0 var(--space-4); border-top: 1px solid var(--rule); }
.theme:first-of-type { border-top-color: var(--rule-strong); }
.theme-num { font: 600 12px var(--ui); letter-spacing: .12em; color: var(--label); margin: 0 0 10px; }
.theme h3 { font-size: clamp(26px, 2.8vw, 32px); line-height: 1.15; margin: 0 0 12px; }
.theme h3 a { color: var(--ink); text-decoration: none; }
.theme h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.theme .thought { font: 18px/1.55 var(--serif); color: var(--ink-2); margin: 0 0 16px; }
.theme-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-2) var(--space-3); align-items: start; }
.theme-side .figure { grid-column: 1 / -1; }
.pick { border-top: 1px solid var(--rule); padding-top: 10px; }
.pick .label { margin-bottom: 6px; }
.pick a.t { display: block; font: 19px/1.3 var(--serif); color: var(--ink); text-decoration: none; margin-bottom: 6px; }
.pick a.t:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.pick p { font: 15px/1.5 var(--ui); color: var(--muted); margin: 0; }

/* ---------- Home: graphics strip, index, about ---------- */
.strip { padding: 40px 0 8px; }
.gstrip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; }
.gcard { display: block; text-decoration: none; color: var(--ink); }
.gcard .still { display: block; aspect-ratio: 16 / 10; width: 100%; object-fit: cover; object-position: top left; border: 1px solid var(--frame); border-radius: var(--radius); background: var(--surface-2); }
.gcard:hover .still { border-color: var(--link); }
.gcard .cat { display: block; font: 600 11px var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--label); margin: 12px 0 4px; }
.gcard h3 { font: 19px/1.28 var(--serif); margin: 0 0 6px; }
.gcard:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.gcard p { font: 14px/1.5 var(--ui); color: var(--muted); margin: 0; }
.gcard .no-still { font-size: 13px; }
.gcard-text { border-top: 1px solid var(--rule); padding: 12px 2px 16px; }
.gcard-text .cat { margin-top: 0; }
.gcard-text .open-line { display:block; margin-top: 12px; color:var(--link); font: 600 13px var(--ui); }
.closing { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; padding: 44px 0 20px; }
.closing h2 { font-size: 24px; margin: 0 0 10px; }
.closing p { color: var(--ink-2); max-width: 54ch; }
.linkrows { list-style: none; margin: 0; padding: 0; }
.linkrows li { border-top: 1px solid var(--rule); }
.linkrows li:last-child { border-bottom: 1px solid var(--rule); }
.linkrows a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; text-decoration: none; color: var(--ink); font: 16px var(--ui); }
.linkrows a span { color: var(--muted); font-size: 14px; }
.linkrows a:hover { color: var(--link); }

.footer { border-top: 1px solid var(--rule); margin-top: 48px; padding: 22px 0 40px; color: var(--muted); font: 13px var(--ui); }
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Deeper pages ---------- */
.pagehead { padding: clamp(24px, 3vw, 36px) 0 var(--space-3); border-bottom: 1px solid var(--rule); }
.pagehead h1 { font-size: clamp(28px, 3.4vw, 38px); line-height: 1.15; margin: 0 0 12px; max-width: 30ch; }
.pagehead .lede { margin-bottom: 0; }
.pagehead .meta-line { margin-top: 16px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--space-4); padding: var(--space-4) 0 0; }
.layout.reader { grid-template-columns: 184px minmax(0, 1fr) 240px; gap: var(--space-3); }
.rail { font: 14.5px/1.5 var(--ui); }
.rail-box { border-top: 1px solid var(--rule-strong); padding-top: 12px; margin-bottom: 28px; }
.rail-box h2 { font: 600 11.5px/1.3 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--label); margin: 0 0 10px; }
.rail-box ul { list-style: none; margin: 0; padding: 0; }
.rail-box li { padding: 8px 0; border-bottom: 1px solid var(--rule); }
.rail-box li a { font-weight: 600; }
.rail-box p { color: var(--muted); margin: 0 0 8px; }
.rail-box .figure { margin-bottom: 8px; }
.sticky { position: sticky; top: 88px; }

.chapters { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-strong); }
.chapters li { border-bottom: 1px solid var(--rule); }
.chapters a { display: grid; grid-template-columns: 44px 1fr auto; gap: 4px 16px; padding: 18px 0; text-decoration: none; color: var(--ink); align-items: start; }
.chapters a:hover .ch-title { text-decoration: underline; text-decoration-thickness: 1px; }
.ch-num { font: 600 13px/1.9 var(--ui); color: var(--label); }
.ch-title { font: 21px/1.3 var(--serif); }
.ch-sum { grid-column: 2; color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ch-count { font: 13.5px var(--ui); color: var(--muted); white-space: nowrap; padding-top: 5px; }

.stepper { display: inline-flex; flex-wrap: wrap; margin: 0 0 18px; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.stepper a, .stepper span { min-width: 44px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; font: 500 14px var(--ui); text-decoration: none; color: var(--ink-2); background: var(--surface); }
.stepper > * + * { border-left: 1px solid var(--rule); }
.stepper a:hover { background: var(--surface-2); }
.stepper [aria-current] { background: var(--ink); color: var(--bg); }
.prose { font: 19px/1.7 var(--serif); color: var(--ink); max-width: var(--read); }
.prose p { margin: 0 0 1.05em; }
.prose .competing { border-left: 2px solid var(--label); padding: 2px 0 2px 16px; color: var(--ink-2); }
.prose .competing strong { display: block; font: 600 11.5px var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--label); margin-bottom: 4px; }
.h-sub { font-size: 24px; margin: 38px 0 6px; }

.studies { display: grid; gap: 12px; margin: 12px 0 0; }
.study { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.study h3 { font-size: 21px; line-height: 1.28; margin: 0 0 8px; }
.study h3 a { color: var(--ink); text-decoration: none; }
.study h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.study p { color: var(--ink-2); font: 16.5px/1.6 var(--serif); margin: 0 0 14px; max-width: 72ch; }
.study .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; border-top: 1px solid var(--rule); padding-top: 12px; }
.study .row .textlink { margin-left: auto; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 40px 0 0; }
.pager a { display: block; padding: 16px 18px; border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--surface); }
.pager a:hover { border-color: var(--ink-2); }
.pager small { display: block; font: 600 11.5px var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.pager .next { text-align: right; }
.pager strong { font: 400 18px/1.3 var(--serif); }

.shelf { margin: 0 0 38px; }
.shelf-head { display: flex; align-items: baseline; gap: 14px; border-bottom: 1px solid var(--rule-strong); padding-bottom: 10px; }
.shelf-head h2 { margin: 0; font-size: 22px; }
.shelf-head .n { font: 600 12px var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--label); min-width: 56px; }
.shelf-list { list-style: none; margin: 0; padding: 0; }
.shelf-list li { border-bottom: 1px solid var(--rule); padding: 15px 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; }
.shelf-list a.t { font: 19px/1.3 var(--serif); color: var(--ink); text-decoration: none; }
.shelf-list a.t:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.shelf-list p { grid-column: 1; margin: 0; color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shelf-list .date { grid-column: 2; grid-row: 1; padding-top: 4px; text-align: right; white-space: nowrap; font-size: 13.5px; }

/* Theme page */
.theme-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; padding: 30px 0 8px; }
.theme-intro .pick a.t { font-size: 24px; }

/* Thesis page */
.thesis-head { padding: clamp(28px, 4vw, 48px) 0 24px; border-bottom: 1px solid var(--rule); }
.thesis-head h1 { font-size: clamp(30px, 3.6vw, 40px); margin: 0 0 14px; }
.thesis-head .preview { font: 22px/1.5 var(--serif); color: var(--ink); max-width: 46ch; margin: 0 0 14px; }

/* Reader */
.answer { background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--label); padding: 16px 20px; margin: 18px 0 0; max-width: 74ch; border-radius: var(--radius); }
.answer b { display: block; font: 600 11.5px var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--label); margin-bottom: 6px; }
.answer p { font: 18.5px/1.55 var(--serif); margin: 0; color: var(--ink); }
.toc-rail ol { list-style: none; margin: 0; padding: 0; }
.toc-rail li a { display: grid; grid-template-columns: 22px 1fr; gap: 6px; padding: 9px 8px; text-decoration: none; color: var(--ink-2); font: 14px/1.4 var(--ui); min-height: 44px; align-items: start; border-left: 2px solid transparent; }
.toc-rail li a:hover { background: var(--surface-2); color: var(--ink); }
.toc-rail li a[aria-current] { background: var(--surface); color: var(--ink); border-left-color: var(--label); font-weight: 600; }
.toc-rail li a .k { color: var(--muted); }
.toc-rail details > summary { display: none; }
.doc { font: 18.5px/1.72 var(--serif); color: var(--ink); max-width: var(--read); min-width: 0; overflow-wrap: anywhere; }
.doc h2, .doc h3, .doc h4 { line-height: 1.25; margin: 1.5em 0 .5em; }
.doc h2 { font-size: 26px; } .doc h3 { font-size: 21px; } .doc h4 { font-size: 18.5px; font-weight: 700; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin: .3em 0; }
.doc code { font: .82em var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 2px; }
.doc .tablewrap { overflow-x: auto; margin: 1em 0; border: 1px solid var(--rule); border-radius: var(--radius); }
.doc table { border-collapse: collapse; font: 14px/1.45 var(--ui); min-width: 100%; overflow-wrap: normal; }
.doc th, .doc td { border-bottom: 1px solid var(--rule); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc th { background: var(--surface-2); font-weight: 600; }
.doc .ref { border-bottom: 1px dotted var(--muted); }
.doc pre.src { white-space: pre-wrap; word-break: break-word; font: 13px/1.55 var(--mono); background: var(--surface); border: 1px solid var(--rule); padding: 16px; border-radius: var(--radius); }
.doc pre.src code { font: inherit; background: none; padding: 0; border-radius: 0; }
.doc pre.text-block { max-width: 100%; overflow-x: auto; white-space: pre; word-break: normal; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--rule); padding-bottom: 8px; margin-bottom: 18px; font: 13.5px var(--ui); color: var(--muted); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font: 500 13.5px var(--ui); color: var(--ink-2); min-height: 40px; cursor: pointer; }
.toggle input { width: 17px; height: 17px; accent-color: var(--link); }
.sec-nav { display: flex; justify-content: space-between; gap: 12px; margin: 32px 0 0; padding-top: 18px; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.endmark { font: 600 12px var(--ui); color: var(--muted); text-align: center; margin: 28px 0 0; letter-spacing: .1em; text-transform: uppercase; }
.warnbox { border: 1px solid var(--warn); border-left-width: 3px; color: var(--ink-2); padding: 10px 12px; font: 14px var(--ui); margin: 0 0 16px; background: var(--surface); border-radius: var(--radius); }
.warnbox b { color: var(--warn); }

/* Graphics */
.filters { display: flex; flex-direction: column; gap: 10px; margin: 22px 0 26px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips .lbl { font: 600 11.5px var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); min-width: 80px; }
.chip { min-height: 36px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--surface); color: var(--ink-2); font: 500 13.5px var(--ui); display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .c { font-size: 12px; opacity: .75; }
.fam { margin: 0 0 44px; }
.gindex { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4) var(--space-3); }
.gindex .gcard h3 { font-size: 17px; }
.gindex .gcard p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.views { columns: 2; column-gap: 28px; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.views li { break-inside: avoid; border-bottom: 1px solid var(--rule); }
.views a { display: flex; align-items: center; min-height: 44px; padding: 8px 0; text-decoration: none; font: 500 15px var(--ui); }
.views a::before { content: "→"; color: var(--muted); margin-right: 10px; }
.views a:hover { text-decoration: underline; }
.results h2 { font-size: 22px; margin: 32px 0 6px; border-bottom: 1px solid var(--rule-strong); padding-bottom: 8px; }
.results ul { list-style: none; margin: 0; padding: 0; }
.results li { border-bottom: 1px solid var(--rule); padding: 12px 0; }
.results li a { font: 18px/1.3 var(--serif); }
.results li p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }
mark { background: color-mix(in srgb, var(--link) 26%, transparent); color: inherit; }
.bigsearch { display: flex; margin: 16px 0 0; max-width: 640px; }
.bigsearch input { flex: 1; min-width: 0; min-height: 46px; border: 1px solid var(--rule-strong); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: var(--surface); color: var(--ink); padding: 0 14px; font: 16px var(--ui); }
.bigsearch .btn { border-radius: 0 var(--radius) var(--radius) 0; min-height: 46px; }
.loading { color: var(--muted); padding: 40px 0; font: 14px var(--ui); }

/* Complete index */
.index-parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.part { margin: 0 0 30px; }
.part-head { display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--rule-strong); padding-bottom: 8px; }
.part-num { font: 600 11.5px var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--label); min-width: 56px; }
.part-head h3 { margin: 0; font-size: 21px; }
.toc { list-style: none; margin: 0; padding: 0; }
.toc li { border-bottom: 1px solid var(--rule); }
.toc a { display: block; padding: 11px 0 12px; text-decoration: none; color: var(--ink); }
.toc a:hover .toc-title { text-decoration: underline; text-decoration-thickness: 1px; }
.toc-line { display: flex; align-items: baseline; gap: 10px; }
.toc-title { font: 18px/1.3 var(--serif); }
.toc-dots { flex: 1; border-bottom: 1px dotted var(--rule); transform: translateY(-4px); min-width: 20px; }
.toc-count { font: 13px var(--ui); color: var(--muted); white-space: nowrap; }
.toc-sum { display: block; color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.rooms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }

/* Graphic viewer */
body[data-page="viewer"] { min-height: 100dvh; display: flex; flex-direction: column; }
body[data-page="viewer"] main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
body[data-page="viewer"] .footer { display: none; }
.viewerbar { border-bottom: 1px solid var(--rule); background: var(--surface); }
.viewerbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.vb-h { margin: 0; font: 400 20px/1.2 var(--serif); }
.vb-copy { flex:1 1 430px; min-width:min(100%,300px); }
.vb-summary { max-width:72ch; margin:3px 0 2px; color:var(--ink-2); font:14px/1.35 var(--ui); }
.vb-copy .date { display:block; margin-top:3px; }
.vb-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.vb-actions .btn { min-height: 44px; font-size: 14px; padding: 0 12px; }
.vb-more { position: relative; }
.vb-more summary { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--rule-strong); color: var(--ink); cursor: pointer; font: 14px var(--ui); }
.vb-more[open] .vb-jump { position: absolute; z-index: 4; top: calc(100% + 4px); right: 0; min-width: min(380px, 90vw); padding: 12px; border: 1px solid var(--rule-strong); background: var(--surface); }
.vb-jump { display: flex; align-items: center; gap: 0; }
.vb-jump label { font: 500 13px var(--ui); color: var(--muted); margin-right: 8px; }
.vb-jump select { min-height: 40px; max-width: 240px; border: 1px solid var(--rule-strong); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: var(--bg); color: var(--ink); padding: 0 10px; font: 14px var(--ui); }
.vb-jump .btn { border-radius: 0 var(--radius) var(--radius) 0; }
.viewer-frame { display: block; width: 100%; flex: 1; min-height: 520px; border: 0; background: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .topsearch input { width: 170px; }
  .layout.reader { grid-template-columns: 184px minmax(0, 1fr); }
  .layout.reader > .rail.right { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 900px) {
  .topbar .wrap { flex-wrap: nowrap; gap: 7px; padding-top: 4px; padding-bottom: 4px; }
  .brand-kicker { display: none; }
  .brand-name { font-size: 16px; }
  .tools { margin-left: 0; }
  .topsearch { display: none; }
  .search-link { display: inline-flex; }
  .primary { order: 0; width: auto; min-width: 0; flex: 1; overflow-x: auto; border-top: 0; }
  .primary a { padding: 0 7px; font-size: 13px; }
  .thesis-feature, .theme, .theme-intro, .closing, .index-parts, .rooms { grid-template-columns: 1fr; gap: 22px; }
  .thesis-feature { grid-template-areas: "heading" "figure" "body" "meta"; }
  .gstrip, .gindex { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout, .layout.reader { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .room-path-grid { grid-template-columns:1fr; }
  .layout.reader > .rail.right { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .toc-rail details > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 14px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; font: 500 15px var(--ui); }
  .toc-rail details > ol { border: 1px solid var(--rule-strong); border-top: 0; padding: 6px; background: var(--surface); }
  .toc-rail .rail-box { border-top: 0; padding-top: 0; }
  .toc-rail .rail-box > h2 { display: none; }
  .views { columns: 1; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .map-extract-item { min-height: 108px; }
  .map-extract-item strong { font-size: 16px; }
}
@media (max-width: 640px) {
  .topbar .wrap { flex-wrap: wrap; gap: 0 7px; }
  .tools { margin-left: auto; gap: 4px; }
  .primary { order: 3; flex: 0 0 100%; justify-content: space-between; border-top: 1px solid var(--bar-line); }
  .recent-grid { grid-template-columns: 1fr; }
  .brand-kicker { display: none; }
  .brand-name { font-size: 17px; white-space: nowrap; }
  .brand svg { width: 28px; height: 28px; }
  .theme-switch label { padding: 0 5px; font-size: 12px; min-height: 44px; }
  .primary a { padding: 0 10px; }
  .welcome .sky { width: 460px; height: 460px; right: -240px; top: -80px; }
  .welcome-head h1 { font-size: 28px; }
  .welcome-head p, .theme .thought { font-size: 17px; }
  .thesis-feature .preview { font-size: 19px; }
  .theme { padding: 26px 0 28px; }
  .theme h3 { font-size: 25px; }
  .theme-side { grid-template-columns: 1fr; gap: 16px; }
  .gstrip, .gindex { grid-template-columns: 1fr; }
  .chapters a { grid-template-columns: 32px 1fr; }
  .ch-count { grid-column: 2; padding-top: 0; }
  .prose, .doc { font-size: 17.5px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
  .shelf-list li { grid-template-columns: 1fr; }
  .shelf-list .date { grid-column: 1; grid-row: auto; text-align: left; padding-top: 0; }
  .chips .lbl { min-width: 100%; }
  .study .row .textlink { margin-left: 0; }
  .map-extract-item { min-height: 88px; }
  .map-extract-item > span:last-child { display: none; }
}
@media (max-width: 360px) {
  .brand-text { display: none; }
  .primary a { padding: 0 6px; font-size: 12px; }
}
@media (prefers-reduced-motion: no-preference) {
  .chip, .btn, .gcard .still, .pager a { transition: border-color .15s, background-color .15s, color .15s; }
}
@media print {
  .topbar, .trail, .rail, .footer, .theme-switch { display: none; }
}

/* long file names in rails never push the page wider */
.rail-box li, .rail-box p, .rail-box .muted, .rail-box dd { overflow-wrap: anywhere; }
.thesis-feature .status + .status { margin-top: 0; }

/* ---------- exhibit plates (pass 2b: replace screenshots of old-styled graphics) ---------- */
.plate { position: relative; display: block; aspect-ratio: 16 / 10; width: 100%; overflow: hidden; border: 1px solid var(--frame); border-radius: var(--radius); background: var(--surface); color: var(--chart); }
.plate::before, .plate::after { content: ""; position: absolute; width: 10px; height: 10px; border-color: var(--label); border-style: solid; opacity: .7; }
.plate::before { left: 8px; top: 8px; border-width: 1px 0 0 1px; }
.plate::after { right: 8px; bottom: 8px; border-width: 0 1px 1px 0; }
.plate-fig { position: absolute; inset: 0; width: 100%; height: 100%; }
.plate-grid line { stroke: var(--rule); stroke-width: .5; opacity: .55; }
.plate-fig .m, .plate-fig .m-strong, .plate-fig .m-dash, .plate-fig .m-faint, .plate-fig .m-bg { fill: none; stroke: var(--chart); stroke-width: 1.1; vector-effect: non-scaling-stroke; }
.plate-fig .m-strong { stroke: var(--label); stroke-width: 1.8; }
.plate-fig .m-dash { stroke-dasharray: 3 4; opacity: .8; }
.plate-fig .m-faint { opacity: .45; }
.plate-fig .m-bg { fill: var(--surface); }
.plate-fig .m-fill { fill: var(--label); stroke: none; }
.plate-fig .m-soft { fill: var(--chart); opacity: .28; stroke: none; }
.plate-fig .m-ink { fill: var(--muted); opacity: .55; }
.plate-fig .m-ink2 { fill: var(--muted); opacity: .3; }
.plate-fig .m-num { fill: var(--label); font: 600 9px var(--mono); text-anchor: middle; }
.plate-fig .m-num.left { text-anchor: start; fill: var(--muted); }
.plate-top, .plate-foot { position: absolute; left: 16px; right: 16px; display: flex; justify-content: space-between; gap: 12px; font: 600 12px/1.2 var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--label); z-index: 1; }
.plate-top { top: 16px; }
.plate-top span + span { color: var(--muted); font-weight: 500; text-align: right; }
.plate-foot { bottom: 15px; font: 12.5px/1.2 var(--mono); letter-spacing: 0; text-transform: none; color: var(--muted); }
.plate.lg .plate-top { font-size: 11.5px; }
a:hover .plate, a:focus-visible .plate { border-color: var(--link); }
.gcard .plate { margin-bottom: 2px; }
.gindex .plate-top span + span, .rail-box .plate-top span + span { display: none; }
.live-plate { background: var(--surface-2); }
.live-plate iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--surface-2); pointer-events: none; }
.live-plate .plate-top, .live-plate .plate-foot { left: 0; right: 0; padding: 10px 14px; background: rgba(7, 12, 21, .88); color: #eef1f5; }
.live-plate .plate-top { top: 0; }
.live-plate .plate-top span + span, .live-plate .plate-foot { color: #cbd3de; }
.live-plate .plate-foot { bottom: 0; }
.view-index { margin: 18px 0; border-block: 1px solid var(--rule); padding: 10px 0; }
.view-index summary { cursor: pointer; color: var(--ink-2); font: 16px var(--ui); }
.view-index .views { margin-top: 12px; }
.rail-box .plate-foot span + span { display: none; }
.views.tight { margin: 10px 0 0; columns: 1; }
.views.tight li a { font-size: 15px; }
.vb-note { flex-basis: 100%; margin: 0; font: 13px/1.4 var(--ui); color: var(--muted); }
@media (max-width: 640px) { .plate-top, .plate-foot { left: 16px; right: 16px; } .plate-top span + span { display: none; } }
.theme-side .plate { aspect-ratio: 2 / 1; }
.plate-fig { overflow: hidden; }
@media (min-width: 901px) { .theme > :first-child { position: sticky; top: 92px; align-self: start; } }

/* Reading and graphic polish: the same type, rules and square controls. */
.return-link { display:block; width:fit-content; max-width:100%; margin:0 0 16px; font:16px/1.4 var(--ui); overflow-wrap:anywhere; }
.viewerbar .return-link { flex-basis:100%; margin:0; }
.toc-rail .outline-part { border-top:1px solid var(--rule); }
.toc-rail .outline-part summary { display:block; padding:12px 8px; cursor:pointer; font:600 14px/1.4 var(--ui); }
.toc-rail .outline-part summary::before { content:'+ '; }
.toc-rail .outline-part details[open] > summary::before { content:'− '; }
.toc-rail li a.outline-link, .toc-rail li a.part-start { display:block; }
.toc-rail li a.part-start { color:var(--muted); font-size:13px; }
.toc-rail li a.depth-3 { padding-left:18px; }
.toc-rail li a.depth-4 { padding-left:28px; }
.toc-rail .sticky { max-height:calc(100dvh - 112px); overflow-y:auto; overscroll-behavior:contain; }
.doc [id] { scroll-margin-top:100px; }
.view-cover { aspect-ratio:auto; min-height:176px; padding:18px; display:flex; flex-direction:column; justify-content:space-between; gap:16px; text-align:left; }
.view-cover::before, .view-cover::after { display:none; }
.view-cover-label { color:var(--label); font:14px var(--ui); }
.view-cover-lines { display:grid; gap:8px; font:17px/1.25 var(--serif); color:var(--ink); }
.view-cover-lines span + span { border-top:1px solid var(--rule); padding-top:8px; }
.view-cover-foot { font:13px/1.4 var(--ui); color:var(--muted); }
.preview-button { display:block; width:100%; padding:0; border:0; background:transparent; color:var(--ink); font:inherit; cursor:pointer; text-align:left; }
.preview-button:hover .plate { border-color:var(--link); }
.preview-call { display:block; padding:10px 0; color:var(--link); font-size:15px; }
.gcard h3 a { color:var(--ink); text-decoration:none; }
.gcard h3 a:hover { text-decoration:underline; }
.graphic-card-links { display:flex; flex-wrap:wrap; gap:10px 16px; font-size:14px; margin-top:12px; }
.graphic-card-unified { border:1px solid var(--frame); background:var(--surface); }
.graphic-card-unified:hover, .graphic-card-unified:focus-within { border-color:var(--link); }
.graphic-card-unified .preview-button .plate { border:0; border-bottom:1px solid var(--rule); }
.graphic-card-unified .preview-call { padding:10px 16px 0; }
.graphic-card-unified .graphic-card-body { padding:8px 16px 16px; }
.graphic-card-unified .cat { margin-top:8px; }
.graphic-card-unified .preview-button:focus-visible { outline:2px solid var(--link); outline-offset:-2px; }
.graphic-preview-dialog { width:min(1440px,96vw); height:94dvh; max-width:96vw; max-height:94dvh; padding:0; border:1px solid var(--rule); background:var(--bg); color:var(--ink); }
.graphic-preview-dialog[open] { display:flex; flex-direction:column; }
.graphic-preview-dialog::backdrop { background:rgba(0,0,0,.7); }
.preview-bar { display:flex; flex-wrap:wrap; align-items:center; gap:8px 20px; padding:16px; border-bottom:1px solid var(--rule); }
.preview-bar > div { flex:1; min-width:180px; }
.preview-bar h2 { font-size:23px; margin:0 0 4px; }
.preview-bar nav { display:flex; flex-basis:100%; flex-wrap:wrap; gap:16px; font-size:15px; }
.graphic-preview-dialog iframe { flex:1; min-height:0; width:100%; border:0; background:var(--bg); }
@media(max-width:900px) { .toc-rail .sticky { max-height:none; overflow:visible; } }
@media(max-width:600px) { .graphic-preview-dialog { width:100%; max-width:100%; height:100dvh; max-height:100dvh; } .preview-bar h2 { font-size:20px; } }

/* The Library's subject-first reading surface. */
.library-search { display:flex; max-width:740px; gap:8px; margin:20px 0 12px; }
.library-search input[type="search"] { flex:1; min-width:0; border:1px solid var(--rule); background:var(--surface); color:var(--ink); font:17px var(--ui); padding:12px; }
.library-section { padding:32px 0; border-bottom:1px solid var(--rule); scroll-margin-top:110px; }
.library-rooms { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 32px; }
.library-rooms a { display:block; padding:16px 0; border-top:1px solid var(--rule); text-decoration:none; }
.library-rooms strong { display:block; font:22px/1.3 var(--serif); color:var(--ink); }
.library-rooms span { display:block; margin-top:5px; font-size:16px; color:var(--muted); }
.library-rooms a:hover strong { color:var(--link); text-decoration:underline; }
.guide-zones { display:grid; grid-template-columns:2fr 1fr; gap:32px; }
.guide-zones h3 { font-size:24px; }
.subject-guides,.library-stories { padding:0; list-style:none; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 24px; }
.subject-guides li,.library-stories li { border-top:1px solid var(--rule); padding:14px 0; }
.subject-guides a,.library-stories a { font:19px/1.3 var(--serif); }
.subject-guides p,.library-stories p { margin:5px 0 0; color:var(--muted); font-size:15px; }
.guide-zones > section:last-child .subject-guides { grid-template-columns:1fr; }
.room-guides { margin:24px 0; padding-bottom:24px; border-bottom:1px solid var(--rule); }
.room-paths { margin:24px 0 34px; padding:24px 0 34px; border-block:1px solid var(--rule); }
.room-path-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
.room-path { border-top:1px solid var(--rule-strong); padding-top:16px; }
.room-path h3 { margin:4px 0 7px; font-size:24px; }
.room-path-question { margin:0 0 16px; color:var(--ink-2); font:17px/1.45 var(--serif); }
.room-path ol { list-style:none; margin:0; padding:0; }
.room-path li { position:relative; padding:12px 0 12px 28px; border-top:1px solid var(--rule); }
.room-path li::before { content:counter(list-item,decimal-leading-zero); position:absolute; left:0; top:14px; color:var(--label); font:600 11px var(--mono); }
.room-path li a { font:18px/1.3 var(--serif); }
.room-path li p { margin:5px 0; color:var(--muted); font-size:14.5px; }
.room-path-graphic { margin:14px 0 0; font-weight:600; }
.room-graphics { margin:24px 0 34px; padding:24px 0 34px; border-block:1px solid var(--rule); }
.room-graphics .section-head { margin-bottom:8px; }
.room-graphics-note { max-width:76ch; margin:0 0 22px; color:var(--ink-2); font-size:16px; }
@media (max-width:900px) { .room-path-grid { grid-template-columns:1fr; } }
.breadth-section { border-top:1px solid var(--rule-strong); padding-top:30px; }
.breadth-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0 24px; }
.breadth-grid article { border-top:1px solid var(--rule); padding:16px 0 18px; }
.breadth-grid h3 { margin:5px 0 7px; font-size:21px; line-height:1.25; }
.breadth-grid p { margin:0; color:var(--muted); font-size:14.5px; }
.breadth-grid .label { color:var(--label); }
.breadth-meta { margin-top:10px!important; font:12px var(--ui)!important; }
@media (max-width:900px) { .breadth-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:600px) { .breadth-grid { grid-template-columns:1fr; } }
.graphic-view-picker { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.graphic-view-picker select,.card-view-picker select { max-width:100%; min-width:0; background:var(--surface); color:var(--ink); border:1px solid var(--rule); border-radius:0; font:15px var(--ui); min-height:44px; padding:8px; }
.graphic-view-picker select { width:min(360px,75vw); }
.card-view-picker { margin:14px 0; }
.card-view-picker label { display:block; font-size:14px; margin-bottom:5px; color:var(--muted); }
.card-view-picker select { width:100%; }
.view-index h2 { font-size:22px; margin:12px 0; }
.viewerbar .return-link { font-size:14px; margin-bottom:4px; }
@media(max-width:700px) { .library-rooms,.guide-zones,.subject-guides,.library-stories { grid-template-columns:1fr; } .library-search { flex-wrap:wrap; } .library-search input[type="search"] { flex-basis:100%; } }
[hidden] { display:none!important; }
.welcome-head .working-thesis-note { font-size:16px; margin:12px 0; color:var(--muted); }
/* Wrapped titles retain one continuous hit area, including between their lines. */
.subject-guides a,.library-stories a { display:block; width:fit-content; max-width:100%; }
