/* WESYN Library: the reader's one stylesheet (1.0.1), in the owner's Two-tone design. Its names, colours, radii and type sizes are those of the
   Two-tone interface he designed (w103 src/ui/two-tone: tokens.css, shell.css, components.css, modules.css): the dark graphite pane (a top bar on a
   phone) around a rounded light canvas, the canvas head with the search pill, cards and chips, and the amber mark on the current place. Sans
   throughout. The page scrolls as a whole (a reading page, not an app), so the pane is held in place beside it. No fonts or images from elsewhere. */

:root, :root[data-theme="light"] {
  color-scheme: light;
  --chrome: #121317; --chrome-ink: #F2F2EF; --chrome-mute: #A0A6AE; --chrome-line: #2A2E35; --chrome-act: #2A2112; --chrome-act-fg: #F2A93B;
  --bg: #F6F2EA; --panel: #FFFFFF; --panel2: #FAF7F1; --line: #E5DECF; --edge: #857F91;
  --ink: #1C1926; --mute: #625C6D; --accent: #4338CA; --on-accent: #FFFFFF; --soft: #E7E6FB;
  --ok: #17683B; --ok-soft: #DDF2E5; --warn: #7A4300; --warn-soft: #FBEACB;
  --shadow-s: 0 1px 3px rgba(40, 30, 70, 0.18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --chrome: #08080B; --chrome-line: #24262C;
    --bg: #100F16; --panel: #191822; --panel2: #1F1E2A; --line: #2D2B3B; --edge: #77748C;
    --ink: #F3F1F8; --mute: #A9A5B8; --accent: #9EA2FF; --on-accent: #14123A; --soft: #24234A;
    --ok: #8BD4A0; --ok-soft: #16291E; --warn: #F2C27A; --warn-soft: #33280F;
    --shadow-s: 0 1px 3px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --chrome: #08080B; --chrome-line: #24262C;
  --bg: #100F16; --panel: #191822; --panel2: #1F1E2A; --line: #2D2B3B; --edge: #77748C;
  --ink: #F3F1F8; --mute: #A9A5B8; --accent: #9EA2FF; --on-accent: #14123A; --soft: #24234A;
  --ok: #8BD4A0; --ok-soft: #16291E; --warn: #F2C27A; --warn-soft: #33280F;
  --shadow-s: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* type, radii, space (Two-tone tokens.css); --measure is the reading width inside the canvas */
:root {
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-12: 0.75rem; --fs-13: 0.8125rem; --fs-14: 0.875rem; --fs-16: 1rem; --fs-20: 1.25rem; --fs-24: 1.5rem; --fs-26: 1.625rem; --fs-42: 2.625rem;
  --fs-read: 1.0625rem;
  --r-canvas: 20px; --r-card: 22px; --r-inset: 16px; --r-control: 12px; --r-chip: 8px; --r-pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s6: 24px; --s8: 32px;
  --touch: 44px; --pane: 268px; --measure: 42rem;
  --t-fast: 150ms;
}
@media (prefers-reduced-motion: reduce) { :root { --t-fast: 1ms; } }

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--chrome); color: var(--ink); font: var(--fs-14) / 1.45 var(--font); overflow-wrap: break-word; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main:focus { outline: none; }
code { font: 0.9em ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip {
  position: absolute; left: 8px; top: -80px; z-index: 90; background: var(--accent); color: var(--on-accent);
  padding: 12px 16px; border-radius: var(--r-control); font-weight: 600;
}
.skip:focus { top: 8px; }
.icon { flex: none; }
.quiet { color: var(--mute); }
.small { font-size: var(--fs-13); }

/* ---- the shell: the pane and the canvas (shell.css) ---- */
.shell { display: grid; grid-template-columns: var(--pane) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; background: var(--chrome); }
.mast {
  position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px; padding: 20px 12px 14px; color: var(--chrome-ink);
}
.mast :focus-visible { outline: 2px solid var(--chrome-act-fg); outline-offset: 2px; }
.pane-top { display: flex; align-items: center; gap: var(--s1); }
.pane-brand {
  display: flex; align-items: center; gap: 10px; min-height: var(--touch); padding: 4px 10px; border-radius: var(--r-control);
  color: var(--chrome-ink); text-decoration: none; font-size: var(--fs-20); font-weight: 800; letter-spacing: 0.02em;
}
.pane-brand .mark { display: block; width: 28px; height: 28px; flex: none; }
.pane-brand:hover { background: var(--chrome-line); }
.pane-theme {
  margin-left: auto; min-height: var(--touch); padding: 0 10px; border: 1px solid var(--chrome-line); border-radius: var(--r-control);
  background: none; color: var(--chrome-mute); font-size: var(--fs-13); font-weight: 600; white-space: nowrap;
}
.pane-theme:hover { background: var(--chrome-line); color: var(--chrome-ink); }
.pane-tag { padding: 2px 10px 14px; color: var(--chrome-mute); font-size: var(--fs-13); line-height: 1.4; }
.pane-list { display: flex; flex-direction: column; gap: 2px; }
.pane-item {
  display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 48px; padding: 0 var(--s3); border-radius: var(--r-control);
  color: var(--chrome-ink); text-decoration: none; font-size: 0.9375rem; font-weight: 600; transition: background var(--t-fast), color var(--t-fast);
}
.pane-item .icon { color: var(--chrome-mute); }
.pane-label { flex: 1; min-width: 0; }
.pane-n { color: var(--chrome-mute); font-size: var(--fs-13); font-weight: 600; font-variant-numeric: tabular-nums; }
.pane-item:hover { background: var(--chrome-line); color: var(--chrome-ink); }
.pane-item[aria-current] { background: var(--chrome-act); color: var(--chrome-act-fg); }
.pane-item[aria-current] .pane-n, .pane-item[aria-current] .icon { color: var(--chrome-act-fg); }
.pane-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--chrome-line); }
.pane-note { margin: var(--s2) var(--s3) 0; color: var(--chrome-mute); font-size: var(--fs-13); }

.canvas {
  background: var(--bg); color: var(--ink); border-radius: var(--r-canvas); margin: 10px 10px 10px 0;
  display: flex; flex-direction: column; min-width: 0; min-height: calc(100vh - 20px); min-height: calc(100dvh - 20px);
}
.canvas-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) 20px; padding: var(--s4) var(--s8);
  border-bottom: 1px solid var(--line); min-height: 72px;
}
.canvas-title { flex: 1 1 auto; font-size: var(--fs-24); font-weight: 800; line-height: 1.25; min-width: 0; overflow-wrap: anywhere; }
.pill {
  display: flex; align-items: center; gap: 10px; width: 320px; max-width: 100%; min-height: var(--touch); padding: 0 4px 0 var(--s4);
  border-radius: var(--r-pill); border: 1px solid var(--edge); background: var(--panel); color: var(--mute);
}
.pill:hover { border-color: var(--accent); }
.pill:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.pill-input { flex: 1; width: 0; min-width: 0; min-height: 42px; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: var(--fs-14); }
.pill-input::placeholder { color: var(--mute); opacity: 1; }
.pill-input:focus-visible { outline: 2px solid transparent; }
.pill-input::-webkit-search-cancel-button { display: none; }
.pill-go {
  flex: none; min-height: 36px; padding: 0 var(--s3); border: 0; border-radius: var(--r-pill); background: var(--soft); color: var(--accent);
  font-size: var(--fs-13); font-weight: 700;
}
.pill-go:hover { background: var(--accent); color: var(--on-accent); }
.canvas-body { flex: 1; display: block; padding: var(--s6) var(--s8) var(--s8); }
.foot { border-top: 1px solid var(--line); padding: var(--s4) var(--s8) var(--s6); color: var(--mute); font-size: var(--fs-13); }
.foot-line { max-width: 46rem; margin-bottom: var(--s2); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 var(--s4); }
.foot-links a { display: inline-block; padding: 6px 0; color: var(--ink); }

@media (max-width: 959.98px) {
  .shell { grid-template-columns: 216px minmax(0, 1fr); }
  .canvas-head, .canvas-body, .foot { padding-inline: var(--s6); }
  .pane-top { flex-wrap: wrap; }
  .pane-theme { margin-left: 10px; }
}
/* a phone: the pane is a top bar (the mark, WESYN and the theme button), with the places in a row under it */
@media (max-width: 719.98px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .mast { position: static; height: auto; overflow: visible; padding: max(6px, env(safe-area-inset-top)) var(--s3) 6px var(--s2); gap: 4px; }
  .pane-brand { padding: 0 var(--s2); font-size: var(--fs-16); }
  .pane-brand .mark { width: 24px; height: 24px; }
  .pane-top { flex-wrap: nowrap; }
  .pane-theme { margin-left: auto; }
  .pane-tag, .pane-foot, .pane-item .icon, .pane-n { display: none; }
  .pane-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 2px 4px; padding-bottom: 4px; }
  .pane-item { min-height: 40px; padding: 0 var(--s3); font-size: var(--fs-14); }
  .canvas { margin: 0; border-radius: var(--r-canvas) var(--r-canvas) 0 0; min-height: 0; }
  .canvas-head { padding: var(--s3) var(--s4); min-height: 64px; }
  .canvas-title { font-size: var(--fs-20); }
  .pill { flex: 1 1 100%; width: auto; }
  .canvas-body { padding: var(--s4) var(--s4) var(--s6); }
  .foot { padding-inline: var(--s4); }
}

/* ---- shared parts (components.css) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--touch); padding: 0 var(--s4);
  border-radius: var(--r-control); border: 1px solid var(--edge); background: var(--panel); color: var(--ink);
  font-weight: 600; font-size: var(--fs-14); text-decoration: none; transition: background var(--t-fast), border-color var(--t-fast);
}
.btn:hover { border-color: var(--accent); background: var(--soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 2px 10px; border-radius: var(--r-chip);
  background: var(--soft); color: var(--accent); font-size: var(--fs-12); font-weight: 700; white-space: nowrap; vertical-align: middle;
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.plain { background: var(--panel2); color: var(--mute); border: 1px solid var(--line); }
.card, .side-card, .facts-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4) var(--s6); }
.notice { padding: var(--s3) var(--s4); background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--warn);
  border-radius: var(--r-inset);
  margin: 0 0 var(--s4); }
.tally { color: var(--mute); margin: 0 0 var(--s4); }
.count { font-size: var(--fs-14); color: var(--mute); font-weight: 600; }
meter, progress.meter {
  display: block; width: 100%; height: 8px; margin-top: var(--s3); border: 1px solid var(--edge); border-radius: var(--r-pill);
  background: var(--panel2); overflow: hidden; -webkit-appearance: none; appearance: none;
}
progress.meter::-webkit-progress-bar { background: var(--panel2); }
progress.meter::-webkit-progress-value { background: var(--ok); }
progress.meter::-moz-progress-bar { background: var(--ok); }

/* ---- a page in the canvas ---- */
.page { max-width: 60rem; }
.opening { margin: 0 0 var(--s4); }
.kicker { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: 0 0 var(--s3); }
.place { margin: 0 0 var(--s2); color: var(--mute); font-size: var(--fs-14); font-weight: 600; }
.place a { color: var(--ink); text-decoration-color: var(--edge); }
.place a:hover { text-decoration-color: currentColor; }
.sep { white-space: normal; }
h1 { font-size: clamp(1.75rem, 1.25rem + 1.6vw, var(--fs-42)); font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.h-link { color: inherit; text-decoration: none; }
.h-link:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.dek { margin: var(--s3) 0 0; max-width: 62ch; font-size: var(--fs-16); line-height: 1.55; color: var(--ink); }
.byline { margin: 0 0 var(--s4); font-size: var(--fs-13); color: var(--mute); }
.changed { margin: calc(-1 * var(--s2)) 0 var(--s4); font-size: var(--fs-13); color: var(--warn); font-weight: 600; }
/* the section labels of a page: the Two-tone small capitals (modules.css .stmt-section) */
.srcs > h2, .record > h2, .relations h2, .read > section:not(.part) > h2, .side-card > h2, .lede-h {
  margin: var(--s8) 0 var(--s3); font-size: var(--fs-13); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mute);
}
.side-card > h2 { margin: 0 0 var(--s2); }

/* ---- reading: a paper, a definition, a chapter, a Book, the notices. A comfortable measure inside the canvas. ---- */
.read, .notice-page { max-width: var(--measure); }
.read .body p, .intro p, .notice-page p, .notice-page li { font-size: var(--fs-read); line-height: 1.7; }
.read .body p, .intro p { margin: 0 0 1em; max-width: 68ch; }
.part h2 { margin: var(--s8) 0 var(--s3); font-size: var(--fs-20); font-weight: 800; line-height: 1.3; }
.part:first-child h2 { margin-top: var(--s6); }
.lede { margin: 0 0 var(--s4); padding: var(--s4) var(--s6); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-inset); }
.lede .lede-h { margin: 0 0 var(--s1); }
.lede p:not(.lede-h) { font-size: 1.125rem; line-height: 1.55; font-weight: 500; }
.lede p + p:not(.lede-h) { margin-top: var(--s2); }
.part-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin: -0.25em 0 0; font-size: var(--fs-13); color: var(--mute); }
.marks { display: inline-flex; align-items: center; gap: 4px; }
.cite-n {
  display: inline-grid; place-items: center; min-width: 28px; min-height: 28px; padding: 0 4px; border: 1px solid var(--edge); border-radius: var(--r-chip);
  background: var(--panel); color: var(--accent); font-size: var(--fs-12); font-weight: 700; line-height: 1; text-decoration: none;
}
.cite-n:hover { background: var(--soft); border-color: var(--accent); }
.terms-here a { display: inline-block; padding-block: 3px; }

.slip { margin: 0 0 var(--s4); padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r-inset); background: var(--panel2);
  font-size: var(--fs-14); }
.slip p + p { margin-top: var(--s1); }
.slip-ok { border-left: 4px solid var(--ok); }
.slip-plain { border-left: 4px solid var(--edge); }
.slip .label { font-weight: 600; }
.slip .disclose { color: var(--mute); }

.sources { display: flex; flex-direction: column; }
.src { display: flex; gap: var(--s3); padding: var(--s3) var(--s2); border-bottom: 1px solid var(--line); scroll-margin: var(--s6); }
.src:target { background: var(--soft); outline: 2px solid var(--accent); border-radius: var(--r-chip); }
.src-n { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--edge);
  font-size: var(--fs-12); font-weight: 700; }
.src-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.src-title { font-weight: 700; overflow-wrap: anywhere; }
.src-title a { display: inline-block; padding-block: 3px; }
.src-meta, .credit { color: var(--mute); font-size: var(--fs-13); }
ul.sources .src { padding-left: 0; }

.record { margin-top: var(--s4); color: var(--mute); font-size: var(--fs-14); }
.record p { margin: 0 0 var(--s2); }
.dates { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: var(--s2) 0 0; }
.dates dt { font-size: var(--fs-12); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.dates dd { margin: 0; color: var(--ink); }

.steps { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s8); }
.step { display: flex; flex-direction: column; gap: 2px; padding: var(--s3) var(--s4); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-inset); color: var(--ink); text-decoration: none; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.step:hover { border-color: var(--edge); box-shadow: var(--shadow-s); }
.step-next { text-align: right; }
.step-w { color: var(--mute); font-size: var(--fs-12); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.step-t { font-weight: 700; font-size: var(--fs-16); line-height: 1.3; }
.step-none { visibility: hidden; }
@media (max-width: 30em) { .steps { grid-template-columns: minmax(0, 1fr); } .step-next { text-align: left; } .step-none { display: none; } }

.links li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.links li:last-child { border-bottom: 0; }
.links a { display: inline-block; padding-block: 3px; }
.links.cols { columns: 14rem auto; column-gap: 28px; }
.links.cols li { break-inside: avoid; }
.unlinked { color: var(--mute); }
.relations .unlinked::after, .links .unlinked::after { content: " (not yet published)"; font-size: var(--fs-12); }

/* a definition */
.aka { margin: calc(-1 * var(--s2)) 0 var(--s2); color: var(--mute); }
.aka-h { font-weight: 700; }
.aka-n { color: var(--ink); font-weight: 600; }
.definition { margin: 0 0 var(--s4); padding: var(--s6); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow-s); }
.definition p { font-size: var(--fs-20); line-height: 1.5; font-weight: 600; max-width: 52ch; }
.definition p + p { margin-top: var(--s3); }
.quote { margin: 0; padding: var(--s3) var(--s4); border-left: 3px solid var(--accent); background: var(--panel2);
  border-radius: 0 var(--r-inset) var(--r-inset) 0; }
.quote blockquote { margin: 0 0 var(--s2); }
.quote p { font-size: var(--fs-16); line-height: 1.6; }
.quote figcaption { font-size: var(--fs-13); color: var(--mute); }
.relations { display: grid; gap: 0 28px; }
@media (min-width: 640px) { .relations { grid-template-columns: 1fr 1fr; } }

/* ---- the home page: the latest paper, with the latest chapter and the Book beside it ---- */
.home { display: grid; grid-template-columns: minmax(0, 40rem) minmax(14rem, 17rem); grid-template-areas: "main side" "before side"; gap: 0 var(--s8);
  align-items: start; }
.home-main { grid-area: main; min-width: 0; }
.home-side { grid-area: side; display: flex; flex-direction: column; gap: var(--s4); position: sticky; top: var(--s6); }
.home-before { grid-area: before; margin-top: var(--s8); padding-top: var(--s2); border-top: 1px solid var(--line); }
.home-before > h2 { margin: var(--s4) 0 var(--s3); font-size: var(--fs-20); font-weight: 800; }
.home-before > p { margin-top: var(--s3); }
@media (max-width: 1099.98px) {
  .home { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "side" "before"; }
  .home-side { position: static; margin-top: var(--s8); display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
  .home-main .read { max-width: var(--measure); }
}
.side-card { padding: var(--s4) 20px; }
.side-t { font-size: var(--fs-16); font-weight: 800; line-height: 1.3; }
.side-t a { color: var(--ink); }
.side-m { margin-top: var(--s2); color: var(--mute); font-size: var(--fs-13); }
.side-m .chip { margin-right: 4px; }
.side-lead { margin-top: var(--s2); color: var(--mute); font-size: var(--fs-14); line-height: 1.45; }
.facts { margin: var(--s3) 0 0; font-size: var(--fs-13); }
.facts > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 var(--s3); padding: 5px 0;
  border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--mute); white-space: nowrap; }
.facts dd { margin: 0 0 0 auto; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.facts-card { margin: 0 0 var(--s4); max-width: 30rem; }
.facts-card .facts { margin-top: 0; }

/* nothing published yet: one calm page */
.calm { max-width: 38rem; padding-top: var(--s6); }
.calm > p { font-size: var(--fs-read); line-height: 1.65; margin: 0 0 var(--s3); }
.calm-links { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s6); }

/* ---- lists of items: the Two-tone library cards (modules.css), without the fixed height of the virtual list ---- */
.lib-cards { display: flex; flex-direction: column; gap: var(--s3); }
.lib-card {
  position: relative; display: flex; gap: var(--s4); align-items: center; padding: var(--s4) 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-inset); color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.lib-card:hover { border-color: var(--edge); box-shadow: var(--shadow-s); }
.lc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lib-row { color: var(--ink); text-decoration: none; }
.lib-row::after { content: ''; position: absolute; inset: 0; border-radius: var(--r-inset); }
.lib-row:focus-visible { outline: 2px solid transparent; }
.lib-row:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -3px; }
.lib-title { font-weight: 700; font-size: var(--fs-16); line-height: 1.3; }
.lib-lead { color: var(--mute); font-size: var(--fs-14); line-height: 1.4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  line-clamp: 2; overflow: hidden; }
.lc-tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); margin-top: 2px; }
.lc-tags .chip { min-height: 0; padding: 1px 8px; line-height: 1.4; }
.lib-m { color: var(--mute); font-size: var(--fs-13); }
section > .lib-cards { margin-top: var(--s3); }
.page > section > h2, .page .letter-group > h2 { margin: var(--s6) 0 var(--s2); font-size: var(--fs-20); font-weight: 800; }

/* ---- a Book: what it is, how far it has come, its contents ---- */
.book-page > section > h2#toc-h { margin: var(--s8) 0 var(--s1); font-size: var(--fs-20); font-weight: 800; text-transform: none; letter-spacing: 0;
  color: var(--ink); }
.book-page > section > .quiet { margin-bottom: var(--s3); }
.contents { display: flex; flex-direction: column; gap: var(--s3); }
.ch { padding: var(--s4) 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-inset); scroll-margin: var(--s6); }
.ch:target { outline: 2px solid var(--chrome-act-fg); outline-offset: 2px; }
.ch-head { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 2px var(--s3); align-items: start; }
.ch-n { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--edge); font-size: var(--fs-12);
  font-weight: 700; }
.ch-t { font-size: var(--fs-16); font-weight: 800; line-height: 1.3; padding-top: 3px; }
.ch-t a { color: var(--ink); }
.ch-s { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); }
.ch-s .chip { min-height: 0; padding: 1px 8px; }
.ch-papers { margin: var(--s3) 0 0 40px; border-top: 1px solid var(--line); counter-reset: cp; }
.cp { display: flex; gap: var(--s2); padding: 6px 0; border-bottom: 1px solid var(--line); counter-increment: cp; font-size: var(--fs-14); }
.cp:last-child { border-bottom: 0; }
.cp::before { content: counter(cp) "."; flex: none; min-width: 1.5em; color: var(--mute); font-variant-numeric: tabular-nums; }
.cp a { display: inline-block; padding-block: 3px; font-weight: 600; }
.cp-wait .unlinked { padding-block: 3px; }
@media (max-width: 719.98px) { .ch-papers { margin-left: 0; } .ch { padding: var(--s3) var(--s4); } }
.book-cards { display: flex; flex-direction: column; gap: var(--s3); }
.book-card { padding: var(--s4) 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-inset); }
.book-card h2 { font-size: var(--fs-20); font-weight: 800; margin-bottom: var(--s1); }
.book-card .lib-m { margin-top: var(--s2); }

/* a chapter's papers */
.toc { border-top: 1px solid var(--line); }
.toc-row { display: grid; grid-template-columns: 2rem 1fr; gap: 2px 10px; padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.toc-n { font-weight: 700; color: var(--mute); font-variant-numeric: tabular-nums; padding-top: 3px; }
.toc-t { display: grid; gap: 2px; }
.toc-t > a { font-weight: 700; font-size: var(--fs-16); display: inline-block; padding-block: 3px; justify-self: start; }
.toc-t > .unlinked { padding-block: 3px; }
.toc-sum { font-size: var(--fs-14); color: var(--mute); }
.intro { margin: 0 0 var(--s4); }

/* ---- the Dictionary ---- */
.letters ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--s4); }
.letter {
  display: grid; place-items: center; min-width: var(--touch); min-height: var(--touch); padding: 0 var(--s2); border: 1px solid var(--edge);
  border-radius: var(--r-pill); background: var(--panel); color: var(--ink); text-decoration: none; font-size: var(--fs-13); font-weight: 600;
}
.letter:hover { border-color: var(--accent); }
.letter.none { color: var(--mute); border-style: dashed; }
.letter[aria-current] { background: var(--soft); border-color: var(--accent); color: var(--accent); }
.letter-group { margin-top: var(--s4); }
.page .letter-group > h2.letter-h { margin: 0 0 var(--s2); font-size: var(--fs-24); color: var(--accent); }
.entries { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-inset); padding: var(--s1) 20px; }
.entries li { padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.entries li:last-child { border-bottom: 0; }
.entry-term { font-weight: 700; font-size: var(--fs-16); display: inline-block; padding-block: 3px; }
.entry-sum { display: block; color: var(--mute); font-size: var(--fs-14); }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-top: var(--s6); }
.pager p { color: var(--mute); }
.pager a { display: inline-block; padding-block: 10px; font-weight: 600; }

/* ---- 1.0.2: the textbook furniture. Everything works with scripts off: answers are <details>, figures are SVG drawn by the program.
   Every control and summary is at least 24 by 24 CSS pixels (WCAG 2.2, 2.5.8); text 4.5:1 and figure lines 3:1 in both themes. ---- */
:root {
  /* the figure classes of shared/figures.js, on the page's own tokens (so a figure follows light and dark) */
  --fig-ink: var(--ink); --fig-mute: var(--mute); --fig-panel: var(--panel); --fig-panel2: var(--panel2); --fig-soft: var(--soft);
  --fig-edge: var(--mute); --fig-line: var(--edge); --fig-accent: var(--accent); --fig-ground: var(--panel);
  --target: 24px;
}
summary, .answer > summary, button, .btn { min-height: var(--target); min-width: var(--target); }
.question { margin: var(--s3) 0 0; max-width: 62ch; font-size: var(--fs-20); line-height: 1.4; font-weight: 600; color: var(--ink); }
.corrections { margin: calc(-1 * var(--s2)) 0 var(--s4); padding: var(--s2) var(--s4); border-left: 4px solid var(--warn); background: var(--warn-soft);
  border-radius: 0 var(--r-inset) var(--r-inset) 0; color: var(--ink); font-size: var(--fs-14); }
.corrections li + li { margin-top: var(--s1); }
.aims, .pre, .check { margin: 0 0 var(--s4); padding: var(--s3) var(--s4) var(--s4); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-inset); }
.read > section.aims:not(.part) > h2, .read > section.pre:not(.part) > h2, .read > section.check:not(.part) > h2 { margin: 0 0 var(--s2); }
.aims ul, .aims ol { padding-left: 1.3rem; list-style: disc; }
.aims ol { list-style: decimal; }
.aims li { margin: 0 0 var(--s1); font-size: var(--fs-16); line-height: 1.5; scroll-margin: var(--s6); }
.aims li:target { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.q { font-size: var(--fs-16); line-height: 1.5; font-weight: 600; margin: 0 0 var(--s2); }
.answer { margin: var(--s2) 0 0; border: 1px solid var(--edge); border-radius: var(--r-control); background: var(--panel2); }
.answer > summary { display: flex; align-items: center; min-height: var(--touch); padding: 0 var(--s4); cursor: pointer; color: var(--accent);
  font-weight: 700; border-radius: var(--r-control); }
.answer > summary:hover { background: var(--soft); }
.answer[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--r-control) var(--r-control) 0 0; }
.answer > p { margin: var(--s3) var(--s4); font-size: var(--fs-16); line-height: 1.6; }
.answer-where { color: var(--mute); font-size: var(--fs-14) !important; }
.answer-where a { display: inline-block; padding-block: 3px; }
.check-list { counter-reset: q; }
.check-q { counter-increment: q; padding: var(--s3) 0; border-top: 1px solid var(--line); }
.check-q:first-child { border-top: 0; padding-top: 0; }
.check-q > .q::before { content: counter(q) ". "; color: var(--mute); }
.case { margin: 0 0 var(--s2); padding: var(--s2) var(--s3); background: var(--panel2); border-left: 3px solid var(--accent); font-size: var(--fs-16);
  line-height: 1.55; }
.case-h, .illus-h { font-weight: 700; color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); margin: 0 0 var(--s1); font-size: var(--fs-13); font-weight: 700; color: var(--mute); }
.tags a { display: inline-block; padding-block: 3px; }
.read .body .illus { margin: 0 0 1em; padding: var(--s3) var(--s4); background: var(--panel2); border: 1px solid var(--line);
  border-left: 4px solid var(--accent); border-radius: 0 var(--r-inset) var(--r-inset) 0; }
.read .body .illus p { margin: 0; }
.read .body .illus .illus-h { margin: 0 0 var(--s1); font-size: var(--fs-13); text-transform: uppercase; letter-spacing: 0.05em; }
.next-line { margin: var(--s4) 0; padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r-inset); background: var(--panel);
  font-weight: 600; font-size: var(--fs-16); }
.next-line a { display: inline-block; padding-block: 3px; }

.fig { margin: var(--s4) 0 var(--s6); }
.fig svg { display: block; width: 100%; height: auto; max-width: 100%; padding: var(--s2); background: var(--fig-ground); border: 1px solid var(--line);
  border-radius: var(--r-inset); }
.fig .fig-ink { fill: var(--fig-ink); } .fig .fig-mute { fill: var(--fig-mute); } .fig .fig-panel { fill: var(--fig-panel); }
.fig .fig-panel2 { fill: var(--fig-panel2); } .fig .fig-soft { fill: var(--fig-soft); }
.fig .fig-edge { stroke: var(--fig-edge); } .fig .fig-line { stroke: var(--fig-line); } .fig .fig-accent { stroke: var(--fig-accent); }
.fig figcaption { margin: var(--s2) 0 0; font-size: var(--fs-14); line-height: 1.5; color: var(--mute); }
.fig figcaption b { color: var(--ink); }
.fig details { margin: var(--s2) 0 0; font-size: var(--fs-14); }
.fig summary { display: inline-flex; align-items: center; min-height: var(--touch); cursor: pointer; color: var(--accent); font-weight: 600; }
.fig details p { margin: 0 0 var(--s1); font-size: var(--fs-14); line-height: 1.5; }
.read table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.read caption { caption-side: top; text-align: left; padding: 0 0 var(--s2); font-size: var(--fs-14); color: var(--mute); }
.read caption b { color: var(--ink); }
.read th, .read td { padding: var(--s2) var(--s3); border: 1px solid var(--edge); text-align: left; vertical-align: top; overflow-wrap: anywhere;
  font-size: var(--fs-14); line-height: 1.45; }
.read thead th { background: var(--panel2); font-weight: 700; }
.read tbody th { font-weight: 700; }
.read td, .read tbody th { background: var(--panel); }
.scope { margin: 0 0 var(--s4); }
.scope caption { font-weight: 700; color: var(--ink); font-size: var(--fs-16); }
.scope .w-out td { color: var(--mute); }
.versions td:nth-child(3), .versions th:nth-child(3) { width: 6rem; }
.versions td:first-child, .versions th:first-child { width: 9rem; }
.book-links ul { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s6) 0 0; }
.index-list > div { padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.index-list dt { font-weight: 700; font-size: var(--fs-16); }
.index-list dt a, .index-list dd a { display: inline-block; padding-block: 3px; }
.index-list dd { margin: 2px 0 0; color: var(--mute); }
.back-to { margin-top: var(--s6); }
.back-to a { display: inline-block; padding-block: 10px; font-weight: 600; }
.book-part .disclose { margin-top: var(--s6); color: var(--mute); font-size: var(--fs-14); }
@media (max-width: 30em) {
  .read th, .read td { padding: var(--s1) var(--s2); }
  .versions td:first-child, .versions th:first-child { width: 6.5rem; }
  .versions td:nth-child(3), .versions th:nth-child(3) { width: 4.5rem; }
}
@media (forced-colors: active) {
  .fig .fig-ink, .fig .fig-mute { fill: CanvasText; } .fig .fig-panel, .fig .fig-panel2, .fig .fig-soft { fill: Canvas; }
  .fig .fig-edge, .fig .fig-line, .fig .fig-accent { stroke: CanvasText; }
}

/* ---- the notices ---- */
.notice-page section > h2 { margin: var(--s8) 0 var(--s2); font-size: var(--fs-20); font-weight: 800; }
.notice-page p, .notice-page li { max-width: 68ch; }
.notice-page p + p { margin-top: var(--s3); }
.notice-page ul, .notice-page ol { padding-left: 1.3rem; list-style: disc; }
.notice-page ol { list-style: decimal; }
.notice-page li { margin-bottom: var(--s2); }
.credits div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.credits dt { font-weight: 700; }
.credits dd { margin: 2px 0 0; }
.notice-page .sources { padding-left: 0; list-style: none; }
.notice-page .sources li { margin: 0 0 var(--s3); }
.notice-page .sources .src-title, .notice-page .sources .src-meta { display: block; }
.dated { margin-top: var(--s8); font-size: var(--fs-13) !important; color: var(--mute); }

/* ---- the landing page (1.0.2): the brand, full screen, on the logo pack's night ground. The logo pack's colours: lime #C5F264, periwinkle
   #9EA2FF, night #050507, tile #101018, ink #EDEFF5. The wordmark is JetBrains Mono (not shipped: the system's monospace stands in), capitals,
   letter spacing 0.22em; the big line is the Two-tone sans at 800. Still: no script, no motion. ---- */
.land-body {
  --night: #050507; --tile: #101018; --lime: #C5F264; --peri: #9EA2FF; --land-ink: #EDEFF5; --land-mute: #A9ADBA; --land-quiet: #8E93A0;
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; color: var(--land-ink); color-scheme: dark;
  background: radial-gradient(ellipse 70% 55% at 88% 0%, rgba(158, 162, 255, 0.13), transparent 70%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(197, 242, 100, 0.07), transparent 70%), var(--night);
  background-color: var(--night);
}
.land-body :focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.land { position: relative; flex: 1; display: flex; align-items: center; overflow: hidden; padding: clamp(28px, 6vw, 112px) clamp(24px, 7vw, 128px); }
.land-in { position: relative; z-index: 1; width: 100%; }
/* on a wide screen the mark again, very large and faint, to the right: still, and only decoration */
@media (min-width: 60em) {
  .land::after { content: ''; position: absolute; right: -8vw; top: 50%; width: min(58vw, 92vh); aspect-ratio: 1; transform: translateY(-50%);
    background: url('/static/mark.svg') center / contain no-repeat; opacity: 0.07; pointer-events: none; }
}
.land-brand { display: flex; align-items: center; gap: clamp(14px, 1.6vw, 28px); margin: 0 0 clamp(40px, 7vw, 120px); }
.land-mark { display: block; width: clamp(64px, 7vw, 128px); height: auto; flex: none; }
.land-word {
  font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-weight: 400;
  font-size: clamp(1.375rem, 0.9rem + 1.8vw, 2.75rem); letter-spacing: 0.22em; line-height: 1; margin-right: -0.22em;
}
.land-h1 {
  margin: 0; font-family: var(--font); font-weight: 800; font-size: clamp(3.25rem, 0.5rem + 16vw, 13rem); line-height: 0.94; letter-spacing: -0.035em;
  text-wrap: balance; overflow-wrap: normal;
}
.land-lib { color: var(--lime); }
.land-tag { margin: clamp(14px, 1.8vw, 32px) 0 0; font-weight: 600; font-size: clamp(1.375rem, 0.85rem + 2.4vw, 3.5rem); line-height: 1.15;
  letter-spacing: -0.01em; color: var(--peri); }
.land-line { max-width: 38rem; margin: clamp(32px, 4.5vw, 72px) 0 0; padding-top: clamp(20px, 2.2vw, 32px); border-top: 1px solid #23252F;
  font-size: clamp(1rem, 0.92rem + 0.35vw, 1.25rem); line-height: 1.6; color: var(--land-mute); }
.land-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px;
  padding: 16px clamp(24px, 7vw, 128px) max(20px, env(safe-area-inset-bottom)); border-top: 1px solid #1B1C24; font-size: var(--fs-13);
  color: var(--land-quiet); }
.land-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.land-links a { display: inline-block; padding: 10px 0; color: #C9CCD6; text-decoration-color: #4A4D5A; }
.land-links a:hover { color: var(--land-ink); text-decoration-color: currentColor; }
.land-small { margin: 0; }
@media (forced-colors: active) { .land-lib, .land-tag { color: CanvasText; } }

/* forced colours: the place you are on is shown by an outline, not only by a background the system colours replace */
@media (forced-colors: active) {
  .pane-item[aria-current], .letter[aria-current] { outline: 2px solid Highlight; outline-offset: -2px; }
  .chip, .lib-card, .ch, .side-card { border: 1px solid CanvasText; }
}

@media print {
  :root, :root[data-theme="light"], :root[data-theme="dark"] { color-scheme: light; --bg: Canvas; --panel: Canvas; --panel2: Canvas; --ink: CanvasText;
    --mute: CanvasText; --line: GrayText; --edge: GrayText; --accent: CanvasText; }
  body { background: Canvas; }
  .shell { display: block; }
  .mast, .canvas-head, .foot nav, .skip, .steps, .letters, .pager, .home-side { display: none !important; }
  .canvas { margin: 0; border-radius: 0; min-height: 0; }
  .home { display: block; }
  .read a[href^="https:"]::after { content: " (" attr(href) ")"; overflow-wrap: anywhere; font-weight: 400; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
