:root {
  --parchment: #f6f1e7;
  --parchment-mid: #eee7d6;
  --parchment-dark: #ddd3bd;
  --ink: #211c15;
  --ink-mid: #44392d;
  --ink-light: #665746;
  --rust: #842727;
  --rust-light: #a13a32;
  --gold: #7b6326;
  --rule: #c5b48f;
  --note-bg: #eee5cf;
  --note-border: #c0a070;
  --shadow: rgba(30, 25, 18, 0.16);
  --source-rail: 3.25rem;
  --source-label: 2.75rem;
  --contents-panel-width: 16rem;
  --header-height: 3.55rem;
  --section-bar-height: 2.15rem;
  --body: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Noto Serif CJK TC", Georgia, serif;
  --display: "Palatino Linotype", "Book Antiqua", "Noto Serif CJK TC", Georgia, serif;
  /* Formerly hard-coded outside the token set (29 values, dark-mode audit,
     post-production edit 2026-09-04): each is used at least once below and
     now lives here so a theme switch can retarget it. Names describe role,
     not the light value, since dark mode gives each a different value. */
  --paper-highlight: rgba(255, 255, 255, 0.82);
  --paper-texture: rgba(83, 64, 32, 0.018);
  --on-accent: white;
  --header-text: #f8f1df;
  --header-bg: rgba(32, 27, 20, 0.97);
  --header-shadow: rgba(0, 0, 0, 0.2);
  --toggle-hover-color: #e3c46b;
  --toggle-hover-bg: rgba(255, 255, 255, 0.08);
  --nav-accent: #d7b85b;
  --nav-meta: rgba(248, 241, 223, 0.82);
  --title-bg: #f5f0e6;
  --title-ink: #1e1913;
  --title-kicker: #9a5c25;
  --title-rule: #b8a678;
  --cover-border: rgb(0, 0, 0);
  --panel-highlight: rgba(255, 255, 255, 0.28);
  --link-hover-bg-strong: rgba(132, 39, 39, 0.07);
  --backdrop-bg: rgba(22, 18, 14, 0.42);
  --panel-tint: rgba(255, 255, 255, 0.3);
  --figure-bg: rgba(255, 255, 255, 0.55);
  --footer-text: #eee3ca;
  --footer-bg: #241f18;
  --focus-ring: #d19135;
  color-scheme: light;
}

/* ---- Dark mode (Captain-ordered, post-production edit 2026-09-04) --------
   Two paths reach the same palette: the System path follows the OS via
   prefers-color-scheme, suppressed when the reader has explicitly chosen
   Off (:root[data-theme="light"]); the explicit On path is
   :root[data-theme="dark"] and always wins regardless of the OS setting.
   A parchment-and-ink scholarly edition in the dark reads as ink-on-
   dark-paper -- warm, not a generic inverted website -- so hue is kept
   close to the light values; only lightness/direction flips. Rust and
   gold are brightened (not merely lightened) to clear 4.5:1 against the
   dark paper while still reading as the same two accent colours. The
   site header and footer are already a near-black chrome in light mode
   (this edition's permanent "dark furniture"), so their own tokens are
   left unredefined here -- they already read correctly in both themes. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --parchment: #1b1712;
    --parchment-mid: #241f18;
    --parchment-dark: #2c251c;
    --ink: #e8dfc9;
    --ink-mid: #c9bc9c;
    --ink-light: #a89877;
    --rust: #e0785f;
    --rust-light: #ef9478;
    --gold: #d4af5a;
    --rule: #4a4030;
    --note-bg: #2a2318;
    --note-border: #6b5636;
    --shadow: rgba(0, 0, 0, 0.5);
    --paper-highlight: rgba(255, 240, 210, 0.045);
    --paper-texture: rgba(0, 0, 0, 0.32);
    --header-shadow: rgba(0, 0, 0, 0.5);
    --toggle-hover-bg: rgba(255, 255, 255, 0.12);
    --panel-highlight: rgba(255, 255, 255, 0.06);
    --link-hover-bg-strong: rgba(224, 120, 95, 0.18);
    --backdrop-bg: rgba(0, 0, 0, 0.6);
    --title-bg: #17130f;
    --title-ink: #f2e9d6;
    --title-kicker: #dba765;
    --title-rule: #6b5636;
    --cover-border: rgba(232, 223, 201, 0.4);
    --panel-tint: rgba(255, 255, 255, 0.06);
    --figure-bg: rgba(0, 0, 0, 0.2);
    --on-accent: #1b1712;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --parchment: #1b1712;
  --parchment-mid: #241f18;
  --parchment-dark: #2c251c;
  --ink: #e8dfc9;
  --ink-mid: #c9bc9c;
  --ink-light: #a89877;
  --rust: #e0785f;
  --rust-light: #ef9478;
  --gold: #d4af5a;
  --rule: #4a4030;
  --note-bg: #2a2318;
  --note-border: #6b5636;
  --shadow: rgba(0, 0, 0, 0.5);
  --paper-highlight: rgba(255, 240, 210, 0.045);
  --paper-texture: rgba(0, 0, 0, 0.32);
  --header-shadow: rgba(0, 0, 0, 0.5);
  --toggle-hover-bg: rgba(255, 255, 255, 0.12);
  --panel-highlight: rgba(255, 255, 255, 0.06);
  --link-hover-bg-strong: rgba(224, 120, 95, 0.18);
  --backdrop-bg: rgba(0, 0, 0, 0.6);
  --title-bg: #17130f;
  --title-ink: #f2e9d6;
  --title-kicker: #dba765;
  --title-rule: #6b5636;
  --cover-border: rgba(232, 223, 201, 0.4);
  --panel-tint: rgba(255, 255, 255, 0.06);
  --figure-bg: rgba(0, 0, 0, 0.2);
  --on-accent: #1b1712;
}

:root[data-theme="light"] {
  color-scheme: light;
}

/* The philosophers map is 1585px wide and the reading column shows it at
   780px, so half its detail is unreadable in place.  Wrapping it in a link to
   the file itself opens it at native size in a new tab.  Only this map gets
   the treatment: the other two are ~900px and gain almost nothing from it. */
.figure-full {
  display: block;
  cursor: zoom-in;
  text-decoration: none;
}

.figure-full img {
  transition: filter 140ms ease;
}

.figure-full:hover img,
.figure-full:focus-visible img {
  filter: brightness(1.04);
}

/* Preserved artefacts: image files themselves are never touched. Dark
   mode only dims them slightly so a bright scan does not glare on a
   dark page. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) img {
    filter: brightness(0.85);
  }
}

:root[data-theme="dark"] img {
  filter: brightness(0.85);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
  scroll-padding-top: calc(var(--header-h-actual, var(--header-height)) + var(--section-bar-height) + 0.75rem);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 10%, var(--paper-highlight), transparent 34rem),
    repeating-linear-gradient(0deg, var(--paper-texture) 0, var(--paper-texture) 1px, transparent 1px, transparent 4px),
    var(--parchment);
  font-family: var(--body);
  font-size: clamp(1.06rem, 0.98rem + 0.24vw, 1.24rem);
  line-height: 1.58;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--rust);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--rust-light);
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.65rem 1rem;
  color: var(--on-accent);
  background: var(--rust);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  color: var(--header-text);
  background: var(--header-bg);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 0.25rem 1rem var(--header-shadow);
}

/* Floating section-title bar (CAP-011, ported from the Sunzi-war and
   Daodejing builds): a second, slimmer sticky strip directly beneath
   .site-header, showing the current section's title as the reader
   scrolls. Reserves its height at all times so the reading column never
   jumps when it fills in; only its own opacity/visibility toggle when a
   section is known. Hidden above the first tracked heading (About the
   title page) -- the title page itself and the offcanvas Contents panel
   are never tracked, so the bar stays hidden until the reader scrolls
   into the text. */
.section-bar {
  position: sticky;
  z-index: 25;
  /* the measured header height, set by script; the token is the fallback */
  top: var(--header-h-actual, var(--header-height));
  display: flex;
  align-items: center;
  min-height: var(--section-bar-height);
  padding: 0;
  color: var(--ink-light);
  background: var(--parchment-mid);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 0.15rem 0.4rem var(--shadow);
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.35rem);
  transition: opacity 160ms ease, transform 160ms ease, visibility 0s linear 160ms, padding-left 180ms ease;
}

.section-bar.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 160ms ease, transform 160ms ease, padding-left 180ms ease;
}

/* Inner wrapper mirrors .document-section/.chapter/.book-divider's own
   width/centring rule (below) so the title's left edge tracks the
   running text column's left edge at every viewport and Contents-panel
   state. The bar's own background stays full-bleed; only this wrapper
   -- and the text inside it -- is inset. */
.section-bar-inner {
  width: min(100% - 2rem, 52rem);
  height: 100%;
  margin-inline: auto;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

.site-nav {
  width: min(100% - 2rem, 76rem);
  min-height: 3.55rem;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.nav-leading {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-nav a {
  color: inherit;
  text-decoration: none;
}

.contents-toggle,
.contents-close,
.contents-backdrop {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.contents-toggle {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--header-text);
  background: transparent;
  border-radius: 0.25rem;
  font-family: var(--body);
  font-size: 1.2rem;
  line-height: 1;
}

.contents-toggle:hover,
.contents-toggle[aria-expanded="true"] {
  color: var(--toggle-hover-color);
  background: var(--toggle-hover-bg);
}

.nav-brand {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.55rem;
  row-gap: 0.08rem;
  font-size: 0.86rem;
  line-height: 1.3;
}

.nav-title {
  white-space: nowrap;
}

.nav-title-chinese {
  margin-right: 0.55rem;
  color: var(--nav-accent);
  font-family: var(--body);
  font-size: 1.05rem;
}

.nav-meta-group {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  white-space: nowrap;
}

.nav-separator {
  color: var(--nav-accent);
  font-size: 0.68rem;
}

.nav-meta {
  color: var(--nav-meta);
  font-size: 0.54rem;
  letter-spacing: 0.045em;
}

.top-link {
  white-space: nowrap;
}

/* An absolutely positioned marker sitting in its container's reserved rail
   padding registers as scrollable overflow on that container, which propagates
   to the document: measured at scrollWidth 954 against clientWidth 945, and it
   disappears entirely when the markers are switched off. The markers are not
   actually outside the viewport — the rail ends at 929 of an available 945 —
   so nothing here is visually clipped; `clip` just stops a phantom scroll
   region from reaching the document.

   `clip`, not `hidden`: it creates no scroll container and leaves the fixed
   Contents panel unaffected. */
main {
  min-height: 100vh;
  transition: margin-left 180ms ease;
  /* Screen only. On paper there is no scroll region to protect, and clipping
     here truncates a wide table at the sheet edge instead of letting it print. */
  overflow-x: clip;
}

/* A grid item cannot be constrained by `max-width: 100%` alone: the default
   single track is max-content sized, so the track grows to the item and the
   percentage resolves against the track rather than the container. Pin the
   track to the container and allow items to shrink, or a wide figure silently
   scrolls the whole document sideways. */
.title-page {
  min-height: calc(100vh - 3.55rem);
  /* Bottom padding was a flat 3.5rem (the clamp's own minimum) -- Captain order,
     2026-09-21: the gap above the title->publication-note divider line must equal
     the gap below it, so this now uses the same clamp() every other section's
     padding uses, not just its floor value. */
  padding: clamp(3rem, 6vw, 5rem) 1.5rem clamp(3.5rem, 8vw, 7rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: start;
  text-align: center;
  background: var(--title-bg);
}

.library-edition {
  margin: 0.35rem 0 0;
  color: var(--ink-light);
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.kicker,
.eyebrow {
  margin: 1rem 0 0.25rem;
  color: var(--rust);
  font-family: var(--display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.title-page h1 {
  margin: 0;
  color: var(--title-ink);
  font-family: "Bodoni MT", Didot, "Times New Roman", serif;
  font-size: clamp(3.25rem, 6vw, 6.75rem);
  font-weight: 400;
  letter-spacing: 0.015em;
  line-height: 0.82;
  text-transform: uppercase;
}

.title-page .kicker {
  margin: clamp(1.45rem, 2.8vw, 2.2rem) 0 0;
  color: var(--title-kicker);
  font-family: "Bodoni MT", Didot, "Times New Roman", serif;
  font-size: clamp(0.74rem, 1.2vw, 1rem);
  font-weight: 400;
  letter-spacing: 0.34em;
  line-height: 1.3;
}

.title-rule {
  width: 8rem;
  margin: clamp(2.5rem, 5vw, 4rem) 0 clamp(2.75rem, 5vw, 3.75rem);
  border-top: 1px solid var(--title-rule);
}

.chinese-title {
  margin: 0.4rem 0 1.4rem;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: 0.16em;
}

/* `vw` is viewport-relative, but this figure's container is the viewport minus
   the docked Contents panel. Without a container-relative cap the figure
   overflows whenever the panel is open and narrow enough — measured as
   scrollWidth 1010 against clientWidth 945 around 901-1050px, which scrolls
   the whole document sideways. max-width keeps the intended size and clamps
   the failure case. */
.cover-figure {
  width: min(47rem, 76vw);
  max-width: 70%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 5px solid var(--cover-border);
  box-shadow: none;
}

.cover-figure img {
  display: block;
  width: 100%;
  height: auto;
  filter: sepia(0.1) contrast(1.03);
}

.translator {
  margin: 0;
}

.edition {
  margin: 0.25rem 0 0;
  color: var(--rust);
  font-weight: 700;
}

.edition span {
  color: var(--ink);
}

.title-credits {
  margin-top: 1.65rem;
}

.document-section,
.chapter,
.book-divider {
  position: relative;
  width: min(100% - 2rem, 52rem);
  margin-inline: auto;
  box-sizing: border-box;
}

.document-section {
  padding: clamp(3.5rem, 8vw, 7rem) var(--source-rail)
    clamp(3.5rem, 8vw, 7rem) 0;
}

.document-section > h2,
.book-divider h2 {
  margin: 0 0 1.5rem;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.2;
  text-align: center;
}

/* Captain order, 2026-09-21 (font-leading residual): even with padding-top/margin-
   top both at their intended values, a section heading's own line-height leaves a
   small gap between the padding edge and the glyphs' own visible top (measured
   live: the divider line down to this rule's own text consistently read ~3px
   short of the line down to the last section's visible content -- the residual
   the Captain's own measurement named). Not present on `.book-divider h2` (the
   between-books heading, a different rule, not a main-section divider), so kept
   off that selector. */
.document-section > h2 {
  padding-top: 3px;
}

/* Captain-ordered, 2026-09-21: a spacing-line-spacing divider marks the boundary
   between every pair of the work's MAIN sections (large blocks of text) -- never
   between the twenty Books or between passages inside them. Drawn as the same 1px
   --rule border-top the appendix/glossary boundaries already use below, applied by
   id to the section that FOLLOWS each boundary (this file's established
   convention), so no boundary's line depends on guessing which class a section
   happens to carry. #books (.chapters-wrap) is handled with its own rule further
   down, since it also needs top padding added, not just the line; #source-note
   already draws its own border on all four sides as a note card and needs only its
   padding-top adjusted (also further down) to keep the gap symmetric. */
#publication-note,
#table-of-contents,
#about-title-page,
#introduction-section,
#maps {
  border-top: 1px solid var(--rule);
}

/* Captain order, 2026-09-21 (second pass, corrected measurement): the gap ABOVE a
   divider line was being measured as box padding, not the Captain's own view -- the
   visible bottom of the preceding section's actual last content (its last text
   line, or the bottom edge of a bordered/filled box or image), which several
   sections' trailing elements sit well short of, because their own bottom
   margin/padding stacks underneath the section's padding-bottom before reaching it.
   Zeroed at the source, per section, rather than papering over it with a shorter
   section padding (which would also shrink the boundaries that were already
   correct). `.document-section > :last-child` catches every section whose last
   in-flow child sits directly inside it (about-title-page and introduction/
   appendix-4's trailing `.note-box`, appendix-3's trailing `<p>`, source-note's
   trailing `<p>`, maps's trailing `.source-figure`, publication-note's trailing
   `.resource-list`, table-of-contents's trailing wrapper). The nested cases --
   where the actual last content sits inside a wrapper this rule's child combinator
   can't reach -- get their own selectors below. */
.document-section > :last-child {
  margin-bottom: 0;
}

/* ---- Arsinoe Library colophon (Captain order, 2026-10-10): left-aligned label/value rows, a rule above it like the
   other main sections; the rule below is #publication-note's own. ---- */
#colophon {
  border-top: 1px solid var(--rule);
  /* 2026-10-11: the grid rows' line boxes (0.9rem text, no text-box trim) read 1 px low under the top line and 2.8 px
     high above the line below; trimmed so both read G (DOM Range rects). */
  padding-top: calc(clamp(3.5rem, 8vw, 7rem) - 1px);
  padding-bottom: calc(clamp(3.5rem, 8vw, 7rem) - 2.8px);
}

/* Captain order, 2026-10-10 (divider check, Range-rect measure like every other boundary): with the colophon in front,
   #publication-note's first line sat 1-2 px below G under the line; trimmed here only (scoped to the colophon's next
   sibling) so the line reads G above and G below. */
#colophon + #publication-note {
  padding-top: calc(clamp(3.5rem, 8vw, 7rem) - 1.5px);
}

/* Captain order, 2026-10-11: colophon made uniform with On War's (clausewitz-war.css `.colophon dl/dt/dd`): direct
   dt/dd pairs in a two-column grid, label in body font 600 weight, 0.9rem text; stacked at 560 px and narrower. */
.colophon {
  font-size: 0.9rem;
}

.colophon dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  column-gap: 1.25rem;
  row-gap: 0.5rem;
  text-align: left;
}

.colophon dt {
  color: var(--ink-light);
  font-weight: 600;
}

.colophon dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .colophon dl {
    display: block;
  }
  .colophon dt {
    margin-top: 0.7rem;
  }
  .colophon dt:first-child {
    margin-top: 0;
  }
}

/* publication-note's true DOM-last child is actually the trailing
   `source-pdf-page-3` marker span (position: absolute, after `.resource-list` in
   the markup) -- so `.document-section > :last-child` above zeroed the marker's
   (irrelevant) margin, not `.resource-list`'s own `margin: 1.2rem auto`. Targeted
   directly here instead. Its own last `<li>` carries a separate `margin-block`
   that doesn't collapse through the (now zero-margin, still padding/border-free)
   `<ul>`, so it needs its own zeroing too. */
#publication-note .resource-list {
  margin-bottom: 0;
}

#publication-note .resource-list li:last-child {
  margin-bottom: 0;
}

/* citations's last child is a `<p>` with its own `margin: 1.1rem 0` (kept for every
   other citation entry; only the very last one needs zeroing here). */
.citations > p:last-child {
  margin-bottom: 0;
}

/* appendix-1's actual last content is nested two levels inside its own last
   `.disciple-entry`, past the `.document-section > :last-child` rule's reach. */
#appendix-1 .disciple-list > .disciple-entry:last-child > p:last-child {
  margin-bottom: 0;
}

/* appendix-2's actual last content is nested one level inside its own last
   `.glossary-entry`, likewise past the direct-child rule's reach -- and
   `.glossary-entry` (below, ~1315) carries its own `padding: 2.5rem 0`, applied to
   every entry unconditionally, so the last entry's OWN bottom padding needs zeroing
   too, not just its paragraph's margin (a plain margin fix alone left 40px behind). */
#appendix-2 > .glossary-entry:last-child > p:last-child {
  margin-bottom: 0;
}

#appendix-2 > .glossary-entry:last-child {
  padding-bottom: 0;
}

/* #books is not `.document-section` and its real last content sits four levels
   deep (last Book -> last passage -> trailing note box), well past any direct-child
   rule; `.analect-entry`'s own `margin: 0 0 2.4rem` (below, ~1993) is the larger of
   the two nested trailing margins and is what actually needs zeroing here, with the
   note box's own zeroed too in case they do not fully collapse together. */
#books .chapter:last-child .analect-entry:last-child {
  margin-bottom: 0;
}

#books .chapter:last-child .analect-entry:last-child > .note-box:last-child {
  margin-bottom: 0;
}

/* Every `.chapter` (Book) carries its own fixed 3.5rem top/bottom padding and a
   1px bottom border (the between-books divider, ~1362) -- present unconditionally,
   including on the very last Book, which sits inside #books. #books's own
   padding-top already subtracts this fixed amount (above, ~558); padding-bottom
   needs the identical treatment, or the last Book's own padding stacks underneath
   #books's padding-bottom and the books->appendix-1 gap runs long by exactly that
   fixed amount. */
#books {
  padding-bottom: calc(clamp(3.5rem, 8vw, 7rem) - 3.5rem);
}

/* Captain order, 2026-09-21 (First Officer review): the last Book's own
   border-bottom (the between-Books rule, ~1362) drew a SECOND horizontal line
   inside the books->appendix-1 divider's spacing zone -- a reader saw a rule, a
   45px gap, then the actual divider rule. Every OTHER between-Books rule is kept
   exactly as it is (Captain: small chapters are left alone); only the very last
   Book, which is immediately followed by a main-section divider rather than
   another Book, has its own trailing rule suppressed so exactly one line marks
   this boundary. */
#books > .chapter:last-child {
  border-bottom: 0;
}

/* maps's last figure inherits `.maps .source-figure { margin-bottom: 3.5rem }`
   (below, ~2110) -- deliberate extra breathing room between the three stacked map
   images, but it was also stretching the maps->books gap by the same amount for
   the last one. A higher-specificity id selector overrides it back to 0 for the
   trailing figure only; the extra room between the first two maps is untouched. */
#maps > .source-figure:last-child {
  margin-bottom: 0;
}

/* Captain order, 2026-09-21 (First Officer review, round 3): with the figure's own
   margin zeroed, the maps->books gap still read 2.0px long above -- not a
   figcaption margin (figcaption has none; only `margin-top`, between the image and
   the caption, irrelevant here), but the same font-leading residual as elsewhere:
   the figcaption's own small italic text (`font-size: 0.83rem`, below ~2380) has
   its own line-height leaving the caption's last glyph line ~2px short of the
   figure's outer box edge. Measured live and corrected at that value, same
   approach as the ~3px heading and ~2.6px body-text residuals above. */
#maps {
  padding-bottom: calc(clamp(3.5rem, 8vw, 7rem) - 2px);
}

/* The Table of Contents' actual last visible text is the last link's own label,
   inside `.contents-page-list a`'s own `padding: 0.32rem 0.4rem` (below, ~2078) --
   real per-link click-target padding, applied to every entry, including the very
   last one in the very last group. Zeroed on just that one link. */
#table-of-contents .contents-page-group:last-child .contents-page-list a:last-child {
  padding-bottom: 0;
}

/* Captain order, 2026-09-21 (font-leading residual, plain body text this time):
   even with every trailing margin/padding zeroed above, a section whose actual
   last visible content is ordinary paragraph/link text (not a filled note-box or
   card, which measures clean) still reads ~2.6px long -- the body font's own
   line-height leaves a small gap below the last line's glyphs, measured live and
   found consistent across every plain-text ending (publication-note's resource
   list, appendix-2's and appendix-3's own trailing paragraphs). Compensated by
   trimming each affected section's own padding-bottom by that fixed amount, so
   the visible gap still lands on the same clamp() magnitude as every other
   boundary. Not needed where the last content is a filled box (`.note-box`,
   `.disciple-entry`, `.source-figure`), which already measures clean without it. */
#publication-note,
#appendix-2,
#appendix-3 {
  padding-bottom: calc(clamp(3.5rem, 8vw, 7rem) - 2.6px);
}

/* Book I's own heading ("I") sits in `.chapter-header` (below, ~1414), a flex row
   bottom-aligning the "Book" eyebrow against the numeral -- a different rule from
   `.document-section > h2` (#books is not `.document-section`), with its own,
   larger font-leading residual (measured live: ~6px, roughly double the standard
   heading's, consistent with its larger font-size). Corrected the same way, at
   its own measured value. */
.chapter-header h2 {
  padding-top: 6px;
}

.front-matter {
  position: relative;
  width: min(100% - 2rem, 52rem);
  max-width: 52rem;
  padding-right: var(--source-rail);
  box-sizing: border-box;
}

.copyright,
.permissions,
.resource-link,
.signature,
.revision-note {
  text-align: center;
}

/* publication-note carries no <h2> (documented above, front-matter h2 rule), so
   its divider-line gap-below was measured against its first paragraph instead --
   and a browser default <p> margin-top doesn't collapse into the section's own
   padding-top once that section has padding/border of its own (it did, once the
   2026-09-21 divider line and padding-top were added here). Zeroed on this one,
   only-use-of-.copyright paragraph so the title-page->publication-note gap matches
   the gap above it, same as every other boundary (Order 3). */
#publication-note > .copyright {
  margin-top: 0;
}

.permissions {
  color: var(--ink-mid);
}

.note-box {
  margin: 1.5rem 0 1.5rem 1.6rem;
  padding: 0.7rem 0.9rem;
  background: var(--note-bg);
  border-left: 3px solid var(--note-border);
  color: var(--ink-mid);
  font-size: 0.85rem;
  line-height: 1.58;
  text-align: left;
  text-indent: 0;
}

.note-ref {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--rust);
  font-family: var(--display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
}

.source-footnote-call {
  margin-left: 0.08em;
  font-size: 0.66em;
  line-height: 0;
  vertical-align: super;
}

.source-footnote-call a {
  color: var(--rust);
  text-decoration: none;
}

.source-footnote-call a:hover,
.source-footnote-call a:focus-visible {
  text-decoration: underline;
}

.note-box p {
  margin: 0 0 0.45rem;
  text-align: left;
  text-indent: 0;
}

.introduction .note-box p {
  text-indent: 0;
}

.note-box p:last-child {
  margin-bottom: 0;
}

.update-notice {
  margin-block: 2rem;
}

.update-notice p {
  margin-bottom: 0.45rem;
}

.front-matter h2 {
  /* margin-top was 3rem, added before this section carried its own top border and
     padding; it left `table-of-contents-title` / `about-title-page-title` sitting
     3rem further from their divider line than every other section's heading sits
     from its own (Captain order, 2026-09-21: equal spacing above and below the
     line). Zeroed so these two headings rely on the same `.document-section`
     padding-top as the rest, matching gap-above with gap-below. */
  margin-top: 0;
  text-align: left;
}

/* Table of Contents / About the title page (Captain-ordered): centred, unlike
   the rest of front matter. `.document-section > h2` (above) already centres
   every section heading by default; `.front-matter h2` opts front matter back
   out to left-aligned. This one rule opts these two headings back in again,
   without touching either of those rules or `!important` -- it wins by
   specificity alone (one type selector more than `.front-matter h2`: 0,1,2
   beats 0,1,1), so placement in the file does not matter, though it is kept
   beside the rule it overrides. `section.front-matter` currently has only
   three instances (publication-note, table-of-contents, about-title-page);
   publication-note carries no `<h2>` at all, so this reaches only the other
   two, exactly as ordered. */
section.front-matter > h2 {
  text-align: center;
}

.front-matter > p:not(.permissions, .copyright, .resource-link, .signature, .revision-note, .page-ref),
.introduction > p,
.glossary-entry > p {
  /* Captain order 2026-10-12: left-aligned at every width (was justify) --
     without hyphenation, justified lines before a long word stretched their
     word gaps (e.g. ~16px against ~5px at 1280). */
  text-align: left;
  text-wrap: pretty;
}

/* Captain-ordered fix, 2026-09-21: a justified paragraph whose LAST child is the
   absolutely-positioned `.source-page-origin` marker can render its final visible
   line fully justified (word gaps stretched to the container's full width) instead
   of left-aligned, at certain viewport widths (measured trigger: 1440px/1536px for
   the Introduction's page-12/13 paragraph, "...in their own right."). Diagnosed live
   with Playwright/Chromium (Range measurement of rendered word positions): the
   marker's presence, as a trailing out-of-flow box, does not itself add the space --
   removing or hiding the marker fixes it, and an explicit `text-align-last: start`
   override on the paragraph does NOT fix it, which only happens if Chromium is not
   treating that visible line as the block's true last line at all. The defect is
   specific to `text-wrap: pretty`'s multi-pass reflow interacting with the trailing
   out-of-flow marker: disabling `pretty` (falling back to plain `wrap`) on exactly
   this narrow, structurally-identified subset removes the defect (re-confirmed swept
   across 360-1920px with no stretch remaining), at the cost of losing pretty's
   orphan-avoidance for these few paragraphs only -- not for justified prose generally. */
.front-matter > p:has(> .source-page-origin:last-child),
.introduction > p:has(> .source-page-origin:last-child),
.glossary-entry > p:has(> .source-page-origin:last-child),
.appendix > p:has(> .source-page-origin:last-child),
.manuscript-appendix > p:has(> .source-page-origin:last-child) {
  text-wrap: wrap;
}

.page-ref {
  color: var(--ink-light);
  font-family: var(--display);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.source-reference {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
}

.web-location {
  color: var(--rust);
  font-family: var(--display);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --- markers off ------------------------------------------------------------
   Zeroing --source-rail on the body collapses the reserved rail in every
   reading container at once, including the narrow-width overrides, so the
   reading column takes the space back. The rail is a layout reservation; with
   no markers to hold, it reserves nothing. */
body.markers-hidden {
  --source-rail: 0rem;
}

/* The narrow-width chapter rule subtracts from the rail; with no rail that
   would become negative padding. */
body.markers-hidden .chapter {
  padding-right: 0;
}

.source-page-origin {
  position: absolute;
  right: 0;
  float: none;
  width: var(--source-label);
  max-width: none;
  margin: 0.15rem 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-light);
  font-family: var(--display);
  font-size: 0.44rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-align: right;
  text-transform: uppercase;
  scroll-margin-top: 6rem;
}

.source-page-origin span {
  display: block;
  white-space: nowrap;
}

/* Markers off. Kept below the rail rule so the contract checker's
   `.source-page-origin { … }` lookup still reads the rail's own declarations. */
body.markers-hidden .source-page-origin {
  display: none;
}

.title-page {
  position: relative;
}

.title-page > .source-page-origin {
  right: max(1rem, calc(50% - 26rem));
  margin: 0;
}

.introduction {
  position: relative;
  width: min(100% - 2rem, 52rem);
  padding-right: var(--source-rail);
  box-sizing: border-box;
}

.introduction .page-continuation {
  margin-top: 0;
  text-indent: 0;
}

.contents {
  font-size: 1rem;
}

.glossary > .eyebrow {
  text-align: center;
}

.contents-panel {
  position: fixed;
  z-index: 40;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  width: min(var(--contents-panel-width), calc(100vw - 3rem));
  padding: 1.25rem 1rem 2rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, var(--paper-texture) 0, var(--paper-texture) 1px, transparent 1px, transparent 4px),
    var(--parchment);
  border-right: 1px solid var(--rule);
  box-shadow: 0.5rem 0 1.4rem var(--shadow);
  transform: translateX(-105%);
  visibility: hidden;
  transition:
    transform 180ms ease,
    visibility 0s linear 180ms;
}

/* --- the provenance toggle -------------------------------------------------
   A boxed switch above all Contents content, because it governs the whole
   document rather than any one destination. Default on where the panel is
   docked, off where it becomes an overlay; the script owns that decision.
   Deliberately NOT inside a screen-only media query: printing follows whatever
   the reader chose. */
/* One recessed panel holding every display switch, set into the cream panel
   by a darker parchment fill and a soft drop shadow in the page's own shadow
   colour. It reads as a control surface rather than as a Contents entry. */
.display-controls {
  margin: 1rem 0 1.25rem;
  padding: 0.55rem 0.7rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--parchment-dark);
  box-shadow: 0 2px 6px var(--shadow), inset 0 1px 0 var(--panel-highlight);
}

.display-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.28rem 0;
}

/* The master governs the switches beneath it, so it is separated from them
   rather than from the markers switch above. */
.display-toggle-master {
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--note-border);
}

/* Children are indented under their parent and set slightly quieter, so the
   hierarchy is legible without reading the labels. */
.display-toggle-child {
  padding-left: 0.85rem;
}

.display-toggle-child .display-toggle-label {
  color: var(--ink-light);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.03em;
  font-size: 0.63rem;
}

.display-toggle-label {
  color: var(--ink-mid);
  font-family: var(--display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-transform: uppercase;
}

.display-toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: none;
  padding: 0.15rem;
  border: 0;
  background: none;
  color: var(--ink-light);
  cursor: pointer;
  font-family: var(--display);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* A child switch while the master is off. It stays readable so the reader can
   see what it is set to; it simply cannot be operated. */
.display-toggle-switch:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.display-toggle-track {
  display: inline-block;
  position: relative;
  width: 1.85rem;
  height: 0.85rem;
  border: 1px solid var(--note-border);
  border-radius: 0.85rem;
  background: transparent;
  transition: background-color 0.15s ease;
}

.display-toggle-track::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.13rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--note-border);
  transform: translateY(-50%);
  transition: left 0.15s ease, background-color 0.15s ease;
}

.display-toggle-switch[aria-checked="true"] .display-toggle-track {
  background: var(--parchment);
}

.display-toggle-switch[aria-checked="true"] .display-toggle-track::after {
  left: calc(100% - 0.68rem);
  background: var(--rust);
}

.display-toggle-switch:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 2px;
}

.display-toggle-state {
  min-width: 1.6rem;
  text-align: left;
}

/* Dark Mode: a three-way segmented control, not a track-and-thumb switch
   (that shape only ever honestly shows two states). Kept in the same
   .display-toggle row/label rhythm as the note-box switches above so it
   reads as one family of controls, not a bolted-on extra.
   Post-production edit, 2026-09-04, Captain-ordered -- ported from the
   Sunzi-war build's Dark Mode control, completing the pattern already
   shipped in the three sibling builds that copy this edition's design. */
.theme-switch {
  display: inline-flex;
  flex: none;
  border: 1px solid var(--note-border);
  border-radius: 0.85rem;
  overflow: hidden;
}

.theme-switch-option {
  border: 0;
  border-left: 1px solid var(--note-border);
  padding: 0.2rem 0.5rem;
  background: transparent;
  color: var(--ink-light);
  cursor: pointer;
  font: inherit;
  font-family: var(--display);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
}

.theme-switch-option:first-child {
  border-left: 0;
}

.theme-switch-option[aria-checked="true"] {
  color: var(--parchment);
  background: var(--rust);
}

.theme-switch-option:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 2px;
}

/* --- what the note switches hide -------------------------------------------
   Deliberately outside any screen-only media query: the printed copy follows
   whatever the reader chose, exactly as the markers switch does.

   Two rules serve every work. The master hides every box; the per-class
   switches mark their own boxes with `is-hidden`, keyed by data-note-group.
   No note class name appears here, so a source with a different set of note
   classes needs no stylesheet change. */
body.notes-hidden .note-box {
  display: none;
}

.note-box.is-hidden {
  display: none;
}

.contents-panel > .source-page-origin {
  top: 1.2rem;
  right: 3.7rem;
}

.contents-open .contents-panel {
  transform: translateX(0);
  visibility: visible;
  transition-delay: 0s;
}

.contents-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.contents-panel-head .eyebrow {
  margin-top: 0;
}

.contents-panel-head h2 {
  margin: 0;
  font-size: 1.65rem;
}

.contents-close {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: var(--ink-light);
  background: transparent;
  border-radius: 0.25rem;
  font-size: 1.6rem;
  line-height: 1;
}

.contents-close:hover {
  color: var(--rust);
  background: var(--link-hover-bg-strong);
}

.contents-backdrop {
  position: fixed;
  z-index: 35;
  inset: var(--header-height) 0 0;
  display: none;
  padding: 0;
  background: var(--backdrop-bg);
}

.major-links {
  margin: 1.25rem 0 1.75rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

/* Panel box (Captain-ordered, 2026-09-12): "Update the TOC panel to the same
   as Daodejing. Especially the color of the boxes." Text treatment (family,
   colour token, size, weight, tracking, casing, centring) already matched
   Daodejing's `.major-links a` from the 2026-09-03 pass, above. This pass
   brings the box treatment level too: background is now the same
   --parchment-mid tint (was --panel-tint, a lighter/translucent wash unique
   to this build -- the colour difference the Captain named) and a 4px
   border-radius was added (this build had none). The hover rule below is
   new outright: this build had no hover state on the panel boxes at all.

   DIRECT CHILD selector, and it must stay one -- kept deliberately unlike
   Daodejing's plain `.major-links a`: the Books chapter grid sits inside
   .major-links here (Daodejing's does not), so a descendant selector would
   style its twenty chapter links as boxes too -- background, full border,
   uppercase, 600 weight. The grid's own appearance must not change; only
   its position did. */
.major-links > a {
  padding: 0.65rem 0.75rem;
  color: var(--ink);
  background: var(--parchment-mid);
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
}

.major-links > a:hover {
  border-color: var(--gold);
  color: var(--rust);
}

.major-links > a span {
  display: block;
  margin-top: 0.35rem;
  color: var(--ink-light);
  font-family: var(--body);
  font-size: 0.82rem;
}

/* The Books chapter grid sits inside the box list, directly under its own
   box.  Keep it tight to the box above -- they are one group -- and open a
   clear break below it, so the grid reads as finished before the next box
   entry begins.  Margin on the wrapper only: the grid's own appearance is
   not to change. */
.major-links > .toc-columns {
  margin-bottom: 1.1rem;
}

.toc-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.toc-group h3 {
  color: var(--rust);
  font-family: var(--display);
  font-size: 0.86rem;
  letter-spacing: 0.09em;
  text-align: left;
  text-transform: uppercase;
}

/* Title (Captain-ordered, 2026-09-12): the same heading-style treatment as
   End of Document, immediately below -- no box, unique (rust) colour --
   rather than a third rule repeating the same two declarations. The base
   rust/small-caps look both already share comes from the generic
   `.toc-group h3` rule above; these two are what End of Document adds on
   top of it, and Title needs the identical addition, not a variant. */
.toc-end h3,
.toc-title h3 {
  margin: 0;
}

.toc-end a,
.toc-title a {
  color: inherit;
  text-decoration: none;
}

.chapter-links {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  list-style: none;
}

.chapter-links a {
  display: block;
  padding: 0.35rem 0.25rem;
  color: var(--ink-mid);
  border-bottom: 1px dotted var(--rule);
  text-align: center;
  text-decoration: none;
}

@media (min-width: 901px) {
  .contents-open main,
  .contents-open .site-footer {
    margin-left: var(--contents-panel-width);
  }

  .contents-open .section-bar {
    padding-left: var(--contents-panel-width);
  }

  .site-footer {
    transition: margin-left 180ms ease;
  }
}

@media (max-width: 900px) {
  body.contents-open {
    overflow: hidden;
  }

  .contents-open .contents-backdrop {
    display: block;
  }
}

.chapter-links span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* `.introduction`'s own padding-bottom: 4rem override removed 2026-09-21 (Captain
   order: equal spacing above and below every main-section divider line). It made
   the introduction->maps gap 64px against the divider's other three sides' 102px+
   at desktop widths. `.document-section`'s own clamp(3.5rem, 8vw, 7rem) padding-
   bottom now applies here same as everywhere else. */

.introduction h2 {
  margin-top: 0;
}

.introduction h3 {
  margin: 3rem 0 0.75rem;
  color: var(--rust);
  font-family: var(--display);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.introduction p {
  margin: 0.8rem 0;
  text-indent: 2em;
}

.introduction .source-quotation {
  margin: 1.5rem 2.5rem;
  color: var(--ink-mid);
  font-size: 0.96em;
  text-indent: 0;
}

.introduction .source-footnote {
  margin-block: 1.5rem;
  text-indent: 0;
}

.introduction .idea-item {
  margin: 1.25rem 2rem;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  text-indent: 0;
}

/* #books carries no `.document-section` class (it is one continuous block, not a
   printed section with its own heading), so it had no top padding and no divider
   line at all between Maps and Book I -- the gap the Captain named directly
   (Order 2). padding-top/border-top added; padding-bottom changed from a flat 6rem
   to the same clamp() every other section boundary uses, so the Maps->Books and
   Books->Appendix 1 gaps both match the rest (Order 3). Top padding is the clamp
   MINUS `.chapter`'s own fixed 3.5rem top padding (below, ~1281): Book I is a
   `.chapter` like all twenty and already carries that padding itself, so adding
   the full clamp on top of it would double the gap below the line without
   affecting the symmetric gap above -- this way the two padding sources sum to
   exactly the same clamp() every other boundary uses, never less than 0. */
/* Captain order, 2026-09-21 (Maps->Books divider was full width): #books
   (.chapters-wrap) carries none of `.document-section`'s `width: min(100% - 2rem,
   52rem); margin-inline: auto` centring (above, ~519) -- its own box simply fills
   its parent's full available width, unlike every other section, so a plain
   `border-top` on it spans edge to edge instead of the standard reading column.
   Each individual `.chapter` (Book) already carries that same width/centring
   itself (below, ~1436), which is why the Books' own passage and note-box content
   was never affected -- only the wrapper's own border was too long. Rather than
   constrain `#books` itself (which would also resize its padding-box and could
   shift the rail/content math its children depend on), the rule is drawn on a
   `::before` pseudo-element sized and centred exactly like every other section's
   own box, independent of `#books`'s own width. */
.chapters-wrap {
  position: relative;
  /* +1px: the old border-top (now a `::before`, absolutely positioned, no longer
     part of this box's own border-box) used to consume 1px of space before the
     padding started; moving it to a pseudo-element let Book I's own heading creep
     1px closer to the line. Restored so the gap below still matches the gap
     above within 1px. */
  padding-top: calc(clamp(3.5rem, 8vw, 7rem) - 3.5rem + 1px);
  padding-bottom: clamp(3.5rem, 8vw, 7rem);
}

.chapters-wrap::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: min(100% - 2rem, 52rem);
  margin-inline: auto;
  border-top: 1px solid var(--rule);
}

.book-divider {
  margin-block: 2rem 3rem;
  padding: 3.5rem 1rem;
  border-block: 1px solid var(--rule);
  text-align: center;
}

.book-divider span {
  color: var(--rust);
  font-family: var(--display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.book-divider h2 {
  margin: 0.55rem 0 0;
}

.book-divider p {
  margin: 0;
  color: var(--ink-light);
  font-style: italic;
}

.chapter {
  position: relative;
  width: min(100% - 2rem, 52rem);
  padding: 3.5rem var(--source-rail) 3.5rem 0;
  box-sizing: border-box;
  border-bottom: 1px solid var(--rule);
}

.chapter-header {
  margin-bottom: 2rem;
  display: flex;
  align-items: end;
  justify-content: center;
}

.chapter-header .eyebrow {
  margin: 0;
  text-align: right;
}

.chapter-header h2 {
  min-width: 4rem;
  margin: 0 0.9rem;
  color: var(--rust);
  font-family: var(--display);
  font-size: 2.2rem;
  line-height: 1;
  text-align: center;
}

.chapter-header .source-reference {
  justify-self: start;
}

.chapter-text {
  width: min(100%, 52rem);
  margin-inline: auto;
  font-size: 1.03em;
  line-height: 1.45;
}

.verse-line {
  min-height: 1.45em;
  padding-left: 4.6rem;
  text-indent: -2.25rem;
  overflow-wrap: anywhere;
}

.verse-line.part {
  margin-top: 0.9rem;
  padding-left: 0;
  color: var(--ink);
  text-indent: 0;
}

.verse-line.base {
  padding-left: 2.4rem;
  text-indent: 0;
}

.verse-line.indent-1 {
  padding-left: 4.6rem;
  text-indent: 0;
}

.verse-line.indent-2 {
  padding-left: 6.8rem;
  text-indent: 0;
}

.verse-line strong {
  font-weight: 600;
}

.glossary {
  position: relative;
  width: min(100% - 2rem, 52rem);
  padding-right: var(--source-rail);
  box-sizing: border-box;
  border-top: 1px solid var(--rule);
}

.glossary-nav {
  margin: 1.5rem 0 3rem;
  padding: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.1rem;
  background: var(--note-bg);
  border: 1px solid var(--rule);
}

.glossary-entry {
  display: flow-root;
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule);
}

.glossary-entry header {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.glossary-entry .source-reference {
  flex: 0 0 auto;
}

.glossary-entry h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.65rem;
  font-weight: 500;
  line-height: 1.25;
}

.glossary-entry h3 [lang="zh-Hant"] {
  white-space: nowrap;
}

.glossary-entry .term-meaning {
  font-size: 0.72em;
}

.glossary-entry p {
  margin: 0.7rem 0;
}

.glossary-figure {
  float: right;
  width: 6rem;
  margin: 0.25rem 0 1rem 1.25rem;
  padding: 0.45rem;
  background: var(--figure-bg);
  border: 1px solid var(--ink-mid);
}

.glossary-figure img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: auto;
}

.glossary-figure figcaption {
  margin-top: 0.3rem;
  color: var(--ink-light);
  font-size: 0.75rem;
  text-align: center;
}

/* Tables -------------------------------------------------------------------
   A source table is always wrapped: <figure class="source-table"> holding an
   optional <figcaption> and a <div class="table-scroll"> around the <table>.
   The scroll container is what keeps a wide table from forcing the whole page
   to scroll sideways on a narrow screen. */

.source-table {
  margin: 1.6rem 0;
}

.source-table figcaption {
  margin-bottom: 0.45rem;
  color: var(--ink-light);
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.source-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  line-height: 1.45;
  text-align: left;
}

.source-table caption {
  padding-bottom: 0.4rem;
  color: var(--ink-light);
  font-size: 0.78rem;
  text-align: left;
}

.source-table th,
.source-table td {
  padding: 0.42rem 0.7rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  text-indent: 0;
}

.source-table thead th {
  border-bottom: 2px solid var(--note-border);
  color: var(--rust);
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.source-table tbody tr:last-child th,
.source-table tbody tr:last-child td {
  border-bottom: 0;
}

.source-table tbody tr:nth-child(even) {
  background: var(--parchment-mid);
}

/* Row-header tables — first cell of each row identifies the row. */
.source-table tbody th[scope="row"] {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

/* Captain order, 2026-09-21 (round 4): reverted the padding-top-only stretch above
   -- it grew the box's OWN top padding to close the citations->source-note gap,
   which put the divider line ON the box's own top border and left the box's
   inside padding asymmetric (40px left/right/bottom, ~112px top at wide widths).
   The divider line and its symmetric spacing now stay OUTSIDE the box entirely
   (margin-top pushes the whole card down by the same clamp() magnitude every
   other boundary uses; the line itself is a `::before`, positioned in that
   margin, same technique as `#books`'s own divider above); inside the frame the
   padding is the box's own again, equal on all four sides. */
/* Captain order, 2026-10-10: the About box is the closing box of the Reference section, so the divider line and its
   clamp() gap are gone (the `::before` line below is removed; #citations' bottom padding is zeroed just after this
   rule); the box now sits 1.5rem under Reference's last line, the same margin `.note-box` keeps above a boxed
   element inside a section. */
.source-note {
  position: relative;
  margin-top: 1.5rem;
  margin-bottom: 5rem;
  padding: 2.5rem;
  background: var(--note-bg);
  border: 1px solid var(--rule);
  box-shadow: 0 0.8rem 2rem var(--shadow);
}

/* Captain order, 2026-09-21 (First Officer review, round 5): unlike #books, whose
   own box is unconstrained (full page width), #source-note is already a
   `.document-section` -- its own box is ALREADY the standard `min(100% - 2rem,
   52rem)` column. Giving this pseudo-element that SAME width formula resolved it
   a second time against the box's own (already-832px) width, not the page,
   drawing a shorter, off-centre line (~800px instead of 832px). Dropped the
   min()/margin-inline entirely: `left: 0; right: 0; width: auto` simply matches
   the pseudo to the box's own outer edges exactly, same as every other section's
   border-top does against its own box. */
#citations {
  padding-bottom: 0;
}

.source-note h2 {
  font-size: 1.35rem;
  text-align: left;
}

.site-footer {
  padding: 2.5rem 1rem;
  color: var(--footer-text);
  background: var(--footer-bg);
  border-top: 3px solid var(--gold);
  font-size: 0.86rem;
  text-align: center;
}

.site-footer p {
  margin: 0.2rem;
}

.site-footer a {
  color: var(--toggle-hover-color);
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

@media (max-width: 720px) {
  html {
    scroll-padding-top: calc(8rem + var(--section-bar-height));
  }

  .source-table table {
    font-size: 0.8rem;
  }

  .source-table th,
  .source-table td {
    padding: 0.34rem 0.5rem;
  }

  .site-nav {
    min-height: var(--header-height);
    gap: 0.75rem;
  }

  .nav-brand {
    padding-block: 0.38rem;
  }

  .nav-meta {
    font-size: 0.5rem;
  }

  .title-page {
    min-height: calc(100vh - 6.5rem);
  }

  .chapter-links {
    grid-template-columns: repeat(4, 1fr);
  }

  .contents-page-list-2col {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .introduction p {
    text-align: left;
    text-indent: 1.25em;
  }

  .glossary-entry > p {
    text-align: left;
  }

  .introduction .source-quotation,
  .introduction .idea-item {
    margin-inline: 0.5rem;
  }

  .verse-line,
  .verse-line.base,
  .verse-line.indent-1,
  .verse-line.indent-2 {
    padding-left: 1rem;
    text-indent: 0;
  }

  .verse-line.indent-1 {
    padding-left: 2rem;
  }

  .verse-line.indent-2 {
    padding-left: 3rem;
  }

  .glossary-entry header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }

  .source-page-origin {
    scroll-margin-top: 9rem;
  }

  .note-box {
    margin-left: 0.5rem;
  }

  .source-note {
    /* Round 4: padding-top override removed -- the divider's own spacing now
       lives entirely in the base rule's `margin-top` (outside the box), so this
       narrow-width padding reset can go back to being a plain, uniform 1.5rem on
       all four sides, same as it was before the divider system touched this
       section at all. */
    padding: 1.5rem;
  }
}

@media print {
  main {
    overflow-x: visible;
  }

  /* Tables must not scroll on paper — release the scroll container, keep the
     header row on every page a long table spans, and avoid splitting rows. */
  .table-scroll {
    overflow-x: visible;
  }

  .source-table {
    break-inside: auto;
  }

  .source-table thead {
    display: table-header-group;
  }

  .source-table tr {
    break-inside: avoid;
  }

  .source-table tbody tr:nth-child(even) {
    background: transparent;
  }

  .source-table th,
  .source-table td {
    border-bottom: 1px solid #999;
  }

  @page {
    size: letter;
    margin: 0.65in 0.7in;
  }

  body {
    color: #000;
    background: #fff;
    font-size: 11pt;
  }

  .site-header,
  .section-bar,
  .skip-link,
  .contents-backdrop,
  .contents-toggle,
  .contents-close,
  /* The switches themselves are meaningless on paper; the printed copy still
     follows whatever the reader chose, through the body classes they set. */
  .display-controls,
  .page-ref,
  .web-location {
    display: none !important;
  }

  /* The colophon and the attribution/copyright block are the two pieces of the
     document that say what it IS — which source, which version, how complete.
     They were previously hidden on paper, so the printed copy ended abruptly
     after the last note and carried no statement of its own provenance. For an
     archival edition that is exactly backwards: this is the content that most
     needs to travel with the paper. Only the screen-only navigation link is
     dropped. */
  /* No forced break. The colophon is short and should simply follow the last
     note on whatever sheet has room; forcing it onto a fresh page spends a
     whole sheet to print nine lines. Let pagination place it. */
  .source-note {
    background: none;
    border: 0;
    box-shadow: none;
  }

  .site-footer {
    margin-top: 0.3in;
    padding-top: 0.15in;
    border-top: 1px solid #999;
    text-align: center;
  }

  .site-footer a[href="#top"] {
    display: none !important;
  }

  /* An absolutely positioned box does not survive fragmentation. When its
     containing block spans pages the printed copy loses it entirely — measured
     at 0 of 159 markers reaching paper before this rule existed. Float them
     instead: floats flow with the text they annotate and fragment correctly. */
  /* No `clear`: clearing each float below the previous one stacks 159 of them
     into a column that runs far past the text and generates empty sheets. */
  .source-page-origin {
    position: static;
    float: right;
    width: auto;
    margin: 0 0 0.04in 0.14in;
    text-align: right;
  }

  .source-page-origin span {
    display: inline;
  }

  .source-page-origin span + span::before {
    content: " ";
  }

  /* Printable area is the sheet less its margins. Any min-height plus padding
     that exceeds it spills the title page onto a second sheet. */
  .title-page {
    min-height: 8.4in;
    padding: 0.5in 0;
    background: #fff;
  }

  /* The cover image is sized for the screen, where the page scrolls. On paper
     it has to share one sheet with the title block and the credits, so cap its
     height explicitly. Without this the title page runs onto a second sheet
     and the following section's forced break leaves a blank one between. */
  .cover-figure {
    width: auto;
    max-width: 100%;
    max-height: 4in;
  }

  .cover-figure img {
    width: auto;
    max-width: 100%;
    max-height: 4in;
  }

  .document-section,
  .chapter,
  .book-divider {
    width: 100%;
  }

  .contents-panel {
    position: static;
    width: 100%;
    max-height: none;
    padding: 0.35in 0;
    overflow: visible;
    border-right: 0;
    box-shadow: none;
    transform: none;
    visibility: visible;
  }

  /* The Contents ends and the work begins: one deliberate break, so the title
     page always starts on a fresh sheet. Without it the title page starts
     partway down sheet one, its min-height carries it onto sheet two, and the
     next section's break-before leaves that sheet empty. */
  .contents-panel {
    break-after: page;
  }

  .contents,
  .front-matter,
  .introduction,
  .glossary {
    break-before: page;
  }

  /* Never `break-inside: avoid` a container taller than a page: the engine
     cannot honour it, so it pushes the whole block to the next sheet and
     leaves the rest of the current one blank. Books span many pages. */
  .chapter {
    padding-block: 0.35in;
    break-inside: auto;
  }

  .chapter-header {
    margin-bottom: 0.18in;
    break-after: avoid;
  }

  h2,
  h3,
  h4 {
    break-after: avoid;
  }

  .note-box,
  figure,
  tr {
    break-inside: avoid;
  }

  .book-divider {
    break-before: page;
  }

  /* Entries here run longer than a sheet, so avoiding an internal break just
     pushes each one to a fresh page and leaves the previous one half empty.
     Keep the heading with its opening text instead, and let the body flow. */
  .glossary-entry {
    break-inside: auto;
  }

  .glossary-entry > h3,
  .glossary-entry > h4 {
    break-after: avoid;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  .update-notice,
  .glossary-nav {
    background: #fff;
  }
}

@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;
    scroll-behavior: auto !important;
  }
}

/* Analects-specific reading structures. */
.title-page h1 {
  font-size: clamp(3.25rem, 6vw, 6.75rem);
  line-height: 0.82;
}

.resource-list {
  width: min(100%, 42rem);
  margin: 1.2rem auto;
}

.resource-list li {
  margin-block: 0.5rem;
}

.resource-lead {
  margin-top: 2.5rem;
}

.permalink {
  overflow-wrap: anywhere;
}

/* Table of Contents (in-body). House style vendored verbatim from the
   Sunzi-war edition's in-page Contents list (its "In-page Contents list
   (Captain-ordered)" block: .contents-page / .contents-page-part /
   .contents-page-list) -- a boxed small-caps group label over a plain
   vertical list of links, repeated per group. Token names carried over
   unchanged: Sunzi-war's --ink, --ink-mid, --parchment-mid, --rule, --gold,
   --rust and --display are already the same names with the same values in
   this build's own :root. The one exception is --link-hover-bg, which this
   build has never defined (only the --link-hover-bg-strong variant it
   already uses for its own link/button hovers, e.g. .contents-close:hover
   above) -- mapped to --link-hover-bg-strong below as the closest existing
   token, same rust-tinted-overlay family, already used for exactly this
   purpose. .contents-page-group and .contents-page-end carry no rule of
   their own in Sunzi-war either: grouping and spacing come from
   .contents-page's own `gap`. */
.contents-page {
  display: grid;
  gap: 2rem;
  margin-top: 1.75rem;
}

.contents-page-part {
  margin: 0 0 0.75rem;
  text-align: left;
}

.contents-page-part a {
  display: block;
  padding: 0.6rem 0.85rem;
  color: var(--ink);
  background: var(--parchment-mid);
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-family: var(--display);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
}

.contents-page-part a:hover {
  border-color: var(--gold);
  color: var(--rust);
}

.contents-page-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.15rem;
}

.contents-page-list a {
  display: block;
  padding: 0.32rem 0.4rem;
  color: var(--ink-mid);
  border-radius: 3px;
  font-size: 0.94rem;
  text-decoration: none;
  line-height: 1.4;
}

.contents-page-list a:hover {
  color: var(--rust);
  background: var(--link-hover-bg-strong);
}

/* Captain order 2026-10-12 (all builds, as Lovecraft): each counted map,
   illustration, figure and table is listed under the section that holds it,
   with a dot in front. */
.contents-page-illustration > a::before {
  content: "\2022";
  margin-right: 0.5em;
}

/* Books I-XX (Captain-ordered): two columns, column-major, so Book I runs
   down the left column and Book XI starts the right one, rather than
   reading across. Only .contents-page-list's row gap (0.15rem, above) is
   kept -- this rule adds column-gap without touching it. Reverted to a
   single column at max-width: 720px, the same breakpoint the panel's own
   .chapter-links grid already reflows at, just above. */
.contents-page-list-2col {
  grid-auto-flow: column;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(10, auto);
  column-gap: 2rem;
}

.maps .source-figure {
  margin-bottom: 3.5rem;
}

/* The maps take the same framing border as the cover plate.  It sits on the
   image rather than the figure because the figure also wraps a figcaption, and
   the caption must stay outside the frame. */
.maps .source-figure img {
  border: 5px solid var(--cover-border);
  box-sizing: border-box;
}

.source-figure {
  margin: 1.75rem auto;
  text-align: center;
}

.source-figure img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 72vh;
  margin-inline: auto;
  object-fit: contain;
}

.source-figure figcaption {
  margin-top: 0.65rem;
  color: var(--ink-light);
  font-size: 0.83rem;
  font-style: italic;
}

.analect-entry {
  margin: 0 0 2.4rem;
  padding-top: 0.1rem;
}

.analect-entry > h3 {
  margin: 0 0 0.25rem;
  color: var(--rust);
  font-family: var(--body);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.4;
}

.analect-text p {
  margin: 0 0 0.75rem;
  text-align: left;
  text-wrap: pretty;
}

.author-commentary {
  margin: 0.9rem 0 1.75rem 1.7rem;
}

.author-commentary .note-ref {
  font-family: var(--body);
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.appendix {
  position: relative;
  width: min(100% - 2rem, 52rem);
  padding-right: var(--source-rail);
  box-sizing: border-box;
  border-top: 1px solid var(--rule);
}

.appendix > p,
.manuscript-appendix > p {
  /* Captain order 2026-10-12: left-aligned at every width (was justify), as the
     front-matter / Introduction / Glossary rule -- stretched word gaps. */
  text-align: left;
  text-wrap: pretty;
}

/* Citations. A bibliographic hanging indent: the first line sits flush left and
   every following line is indented one layer, so each entry's author scans down
   the left margin. Left-aligned rather than justified, because justification
   stretches the spaces inside a URL. Must come after `.appendix > p`, which it
   overrides at equal specificity. */
.citations > p {
  margin: 1.1rem 0;
  padding-left: 2em;
  text-indent: -2em;
  text-align: left;
  text-wrap: pretty;
}

.appendix h3 {
  margin: 2.4rem 0 0.8rem;
  color: var(--rust);
  font-family: var(--display);
  font-size: 1.25rem;
}

.appendix h4 {
  margin: 2rem 0 0.75rem;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.05rem;
  font-style: italic;
  text-align: center;
}

.appendix-introduction {
  margin-bottom: 2.5rem;
}

.disciple-list {
  display: grid;
  gap: 1.35rem;
}

.disciple-entry {
  padding: 1rem 1.1rem 1.05rem;
  background: var(--panel-highlight);
  border-left: 3px solid var(--rule);
}

.disciple-entry h3 {
  margin: 0 0 0.55rem;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.disciple-entry p {
  margin: 0;
  text-align: left;
}

.appendix-date {
  margin: -0.9rem 0 2rem;
  color: var(--ink-light);
  font-family: var(--display);
  font-size: 0.85rem;
  text-align: center !important;
  text-indent: 0;
}

#appendix-3 > h3 {
  margin-top: 3.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--ink);
  font-size: 1.35rem;
}

.analysis-summary,
.analysis-passage {
  margin-left: 1.25rem;
  padding-left: 0.8rem;
  border-left: 2px solid var(--rule);
  text-align: left !important;
  text-indent: 0;
}

.analysis-passage {
  font-size: 0.96rem;
}

.analysis-bullets {
  margin: 1.1rem 0 1.6rem 1.2rem;
  padding-left: 1.2rem;
}

.analysis-bullets li {
  margin: 0.55rem 0;
}

.compact-analysis-table {
  max-width: 34rem;
  margin-inline: auto;
}

.appendix-footnotes {
  margin-top: 4rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule);
}

.manuscript-figure {
  max-width: 24rem;
}

#appendix-4 > h3[id^="appendix-4-manuscript-"] {
  margin: 2.4rem 0 1.1rem;
  text-align: center;
}

#appendix-4 > .manuscript-title {
  margin: 0 0 1.8rem;
  text-align: center;
}

#appendix-4 > .manuscript-title ~ p {
  padding-left: 2rem;
}

#appendix-4 > p.manuscript-passage {
  text-indent: -2rem;
}

.graph-figure {
  float: none;
  width: 7rem;
  margin: 1rem auto 1.5rem;
}

.inline-glyph-group {
  display: inline-block;
  margin: 0 0.1em;
  padding: 0;
  vertical-align: middle;
  line-height: 1;
}

.inline-glyph {
  display: inline-block;
  width: auto;
  height: 3.42em;
  vertical-align: -1.02em;
}

.table-scroll {
  margin: 1.6rem 0;
  overflow-x: auto;
}

.source-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.source-table caption {
  margin-bottom: 0.55rem;
  color: var(--rust);
  font-family: var(--display);
  font-weight: 700;
  text-align: left;
}

.source-table th,
.source-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.source-table thead th {
  background: var(--note-bg);
}

@media (max-width: 700px) {
  .title-page {
    /* Bottom side left out of this narrow-width override (Captain order,
       2026-09-21: symmetric divider gaps) -- it was pinning the
       title-page->publication-note gap to a flat 3rem here, against every other
       narrow-width boundary's 3.5rem clamp() floor. */
    padding: 2.75rem 1rem;
    padding-bottom: clamp(3.5rem, 8vw, 7rem);
  }

  .title-page h1 {
    font-size: clamp(2.65rem, 14vw, 4.2rem);
    line-height: 0.86;
  }

  .title-page .kicker {
    max-width: 23rem;
    letter-spacing: 0.24em;
  }

  .title-rule {
    width: 6rem;
    margin-block: 2.25rem 2.5rem;
  }

  .cover-figure {
    width: min(100%, 30rem);
  }

  .author-commentary,
  .note-box {
    margin-left: 0.55rem;
  }

  .chapter {
    padding-right: calc(var(--source-rail) - 0.45rem);
  }

}
