/* clausewitz-war.css -- branded PIPE 3 stylesheet for "On War" by Carl
   von Clausewitz, tr. J. J. Graham, ported from the Analects prototype
   design authority (analects.css). Generated by
   _Build-Scripts\build_finished_html.py -- hand-edit clausewitz-war.html
   instead of this generated file only if you also re-run the generator,
   or the stylesheet link's ?v= fingerprint (SHA-256 of this file, first
   10 hex chars) goes stale.

   No PDF source is cited for this edition (packet: "NO page rail and NO
   rail Toggle"), so no --source-rail/--source-label tokens are defined
   and no reading container reserves a right-hand gutter for one -- every
   `main > *` centres with an equal left and right margin at any width. */

/* ---- design tokens, analects.css:1-50, rail tokens omitted ------------- */
: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);
  --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;
  --mono: "Consolas", "Courier New", monospace;
  --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);
  --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);
  --footer-text: #eee3ca;
  --footer-bg: #241f18;
  --focus-ring: #d19135;
  /* Captain Review 2, order 9 ("I preferred the Analects's longer
     width"): the reading-column cap, measured live against the
     Prototype's own rendered prose (not just read from its source) --
     analects.html's #introduction-section paragraph is 780px wide at
     1280/1536 (its .document-section: width: min(100% - 2rem, 52rem)
     minus its own 52px rail padding-right, active only at its own
     "desktop" breakpoint, >=901px) and 832px at 900/420 (that
     breakpoint's own JS sets markers off by default below 901px, which
     zeroes the rail entirely -- so the Prototype's OWN prose measure is
     itself two-valued, not a single formula). Clausewitz-war has no
     rail at all (packet's standing "NO page rail" rule, unchanged) --
     matching the Prototype's measured widths is done with a plain,
     symmetric width cap that changes at the same 901px breakpoint,
     never an asymmetric gutter: `main > *`'s own `margin-inline: auto`
     (order 1) keeps left/right margins equal at both values, so this
     is a narrower/wider CAP, not a reintroduced rail. 48.75rem = 780px;
     see the `max-width: 900px` override below for 52rem = 832px.
     Captain order 2026-09-28 (body text width uniform with Daodejing):
     the Prototype's own >=901px column is not simply this flat cap --
     its rail-toggle mechanism makes it fluid (mainWidth - 84px) until
     864px of main remains, only flattening at 780px beyond that. Since
     this build's cap alone cannot express a shifted fluid slope,
     `--reading-gutter` (symmetric, subtracted alongside the cap, still
     just a narrower/wider box -- no one-sided padding) supplies the
     other 52px: gutter+cap = 84px+780px = 864px-referenced mainWidth
     cutover, matching the Prototype's own knee exactly at every
     measured viewport (420/768/1024/1280/1920). */
  --reading-cap: 48.75rem;
  --reading-gutter: 5.25rem;
  color-scheme: light;
}

@media (max-width: 900px) {
  :root {
    --reading-cap: 52rem;
    --reading-gutter: 2rem;
  }
}

/* ---- dark mode, analects.css:52-133 (System follows prefers-color-
   scheme unless the reader chose Off; explicit On always wins). ---------- */
@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);
    --cover-border: rgba(232, 223, 201, 0.4);
    --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);
  --cover-border: rgba(232, 223, 201, 0.4);
  --on-accent: #1b1712;
}

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

/* Dark-mode image dimming applies to every <img> with no exception
   (packet: "no exemption") -- there is exactly one, the lines-of-
   communication diagram. */
@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);
  /* PIPE 4 QA C-03: match the Prototype's own base reading size exactly
     (analects.css:184) -- was clamp(1.02rem, 0.95rem + 0.22vw, 1.18rem),
     ~3.8% smaller at every width; not an intentional departure. */
  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;
}

/* ---- masthead, analects.css:214-222 + .site-nav block ------------------ */
.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);
}

.section-bar {
  position: sticky;
  z-index: 25;
  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;
}

.section-bar-inner {
  width: min(100% - var(--reading-gutter), var(--reading-cap));
  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-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;
}

main {
  min-height: 100vh;
  transition: margin-left 180ms ease;
  overflow-x: clip;
}

/* One rule centres every top-level publication block with an equal left
   and right margin -- title page, colophon, hr, the Contents table, and
   all 141 div.chapter blocks are all direct children of <main>. No right-
   hand gutter is reserved anywhere (no rail), so this alone satisfies the
   "reading column's margins are equal" measure. Captain Review 2, order
   9: the cap itself is `--reading-cap` (780px desktop / 832px <=900px,
   see :root above) instead of a flat 44rem, so every one of these blocks
   -- including the 144 section dividers, which share this exact same
   width via their own `main > *` membership -- automatically tracks the
   new, wider Analects-matched measure with no separate edit anywhere
   else. */
main > * {
  width: min(100% - var(--reading-gutter), var(--reading-cap));
  margin-inline: auto;
  box-sizing: border-box;
}

/* ---- title page --------------------------------------------------------- */
/* Captain Review 2, order 17 (Ref 1: "you fucked up the section divider
   spacing... Make all dividers and spacing the same like I said"):
   bottom padding's clamp() base corrected from `clamp(1.5rem, 4vw,
   2.5rem)` to the 144-element divider system's own `clamp(3.5rem, 8vw,
   7rem)` -- the old value was half that magnitude, which made the
   title-page -> colophon boundary (this padding is its "gap above" half)
   sit at half the document's standard divider spacing. Full writeup and
   the paired `padding-top` fix are at `.colophon`'s own comment below. */
/* 2026-09-25: Analects typography; bottom residual recalibrated for the
   larger credits so the title-to-colophon divider retains the common gap. */
/* Captain order, 2026-09-25 ("Update" -- the title-image work since the
   above recalibration drifted this boundary's gap-above off the
   document's uniform value, measured via Playwright, both sides
   Range-measured to the actual first/last glyph as in every other such
   correction here: 102.00000/56.37500 (this side) against
   101.39062/56.00000 (the unchanged `.colophon` side below, itself
   still exactly the document's modal 145-boundary value). Residual
   re-solved from those two measured deltas (0.60938px at 1280,
   0.37500px at 420) the same two-point way as every other residual in
   this file: 2.34872px + 0.09995vw. Re-verified after: both sides now
   101.39062/101.39062 at 1280 and 56.00000/56.00000 at 420. */
/* Captain order, 2026-09-25 ("Title page is missing the 'Arsinoe Library
   Edition' like in Analects"): the new `.library-edition` line (below)
   became this header's last child, and its own font metrics
   (font-size 0.72rem, line-height 1.2) differ from the previous last
   child, `header.title-page h4` (font-size 1em, line-height 1.58) --
   the Range-to-last-glyph measurement this boundary's gap-above uses
   (verify_finished.py's COLOPHON_TOP_RULE_GAP_JS) reads to whichever
   text is now last, so the gap moved even though this padding-bottom's
   own CSS value did not. Measured via Playwright (file:// load, both
   themes -- identical, since the box model does not change with theme):
   98.57812/101.39062 (this side, gap-above/gap-below) against
   53.03125/56.00000 at 420 -- gap-below (the `.colophon` side, below,
   untouched) still exactly the document's modal value at both widths;
   gap-above alone drifted. Residual re-solved from the two measured
   deltas (2.81250px at 1280, 2.96875px at 420) the same two-point way as
   every other residual in this file: -0.69634px + 0.11812vw. Re-verified
   after: both sides again 101.39062/101.39062 at 1280 and
   56.00000/56.00000 at 420. */
header.title-page {
  padding: clamp(3rem, 6vw, 5rem) 0 calc(clamp(3.5rem, 8vw, 7rem) - (-0.69634px + 0.11812vw));
  text-align: center;
}

header.title-page h1 {
  margin: 0;
  color: var(--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;
}

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

/* Size for the reading column; retain the complete painting's proportions.
   Captain-ordered figure wrap (2026-09-25): the frame moves from the img
   itself onto the figure, following the Sunzi-war pattern
   (sunzi-war.html:63-65, sunzi-war.css:137-151) -- figure carries the
   border/width/margin (box-sizing: border-box keeps the same 100%
   outer footprint), the img inside is unbordered and simply fills the
   figure's resulting content box, so the rendered geometry (outer
   width, inset image content, gap to the frame) is unchanged. */
header.title-page .cover-figure {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 5px solid var(--cover-border);
  margin: clamp(2.75rem, 5vw, 3.75rem) auto 0;
  padding: 0;
}

header.title-page .cover-figure img {
  display: block;
  width: 100%;
  height: auto;
}

/* Analects .citations > p: one-layer hanging indent and left alignment. */
#reference .image-citation {
  margin: 1.1rem 0;
  padding-left: 2em;
  text-indent: -2em;
  text-align: left;
  text-wrap: pretty;
}

#reference .image-citation a {
  overflow-wrap: anywhere;
}

/* Open credit groups use Analects' title-block spacing rhythm. */
header.title-page h3 {
  margin: clamp(3rem, 5vw, 4rem) 0 0;
  color: var(--rust);
  font-family: var(--display);
  font-size: 1em;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: uppercase;
}

header.title-page h4 {
  margin: clamp(1.45rem, 2.8vw, 2.2rem) 0 0;
  color: var(--ink-light);
  font-size: 1em;
  font-weight: 400;
  line-height: 1.58;
}

/* Captain order, 2026-09-25 ("Title page is missing the 'Arsinoe Library
   Edition' like in Analects"): ported from analects.css:414-423
   (`.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; }`)
   verbatim -- both declared tokens (`--ink-light`, `--display`) already
   exist in this build's own :root. Scoped `header.title-page .library-
   edition`, matching every other title-page-only rule above (h1-h4,
   .cover-figure), rather than Analects' own unscoped `.library-edition`
   selector -- the class is only ever used here, so the two selectors are
   equivalent in effect; this build's own file uses the scoped form
   throughout. No bottom margin (matches h4 above), so this new last
   child adds no margin below itself -- the title-page -> colophon
   boundary's "gap above" is still supplied solely by header.title-page's
   own padding-bottom (unchanged, above); see verify_finished.py's
   COLOPHON_TOP_RULE_GAP_JS re-measurement, confirmed unchanged. */
/* Captain order, 2026-09-25 ("Your sense of color and spacing is
   terrible... give the lines some spacing and put the text is a nice
   color. Again, like in Analects."): the line above had borrowed two
   things from Analects that do not fit where it landed in THIS build --
   Analects' imprint sits inside a tight `.title-credits` cluster, so its
   ~7px margin-top and its neutral ink-light colour (shared with the
   other neutral line in that cluster) both read correctly there. Here
   it is not clustered -- it is the plain last child under three `h4`
   credit lines that already use this block's own inter-line rhythm --
   so the borrowed 0.35rem margin read as a stuck-together orphan, and
   the borrowed ink-light colour was *identical* to the three h4 lines
   above it (also --ink-light), erasing it entirely instead of closing
   the group the way Analects' own coloured `.edition` line does.
   margin-top reuses the h4 credit lines' own clamp() verbatim
   (`clamp(1.45rem, 2.8vw, 2.2rem)`, see header.title-page h4 above)
   instead of a new hard-coded number, plus a flat `+ 2px` residual --
   Range-to-actual-glyph measurement (this file's own method throughout;
   see e.g. header.title-page's padding-bottom comment above) showed the
   bare clamp() alone lands the text-to-text gap 2.00000px short of the
   H4-to-H4 gap, identically at 1280 and 420 (38.8125 -> 36.8125 and
   26.96875 -> 24.96875, both exactly -2px) -- a fixed shortfall, not a
   proportional one, because it comes from this line's own much smaller,
   non-responsive font metrics (font-size 0.72rem/line-height 1.2 vs the
   h4's font-size 1em/line-height 1.58: the flat 2px gap the two shed
   differently is one of font size, not one of viewport). Re-measured
   after adding it: gap above the imprint now equals the H4-to-H4 gap
   exactly (both widths, both themes -- the box model does not change
   with theme). Colour moves to `var(--rust)` -- the same token
   header.title-page h3 ("TRANSLATED BY J.J. GRAHAM") already uses here,
   and the same relationship Analects' own credits cluster has (one
   coloured line among neutral ones), rather than muted-on-muted.
   font-family/font-size/font-weight/letter-spacing/line-height/text-
   transform and the zero bottom margin are all unchanged. Increasing
   this line's own margin-top does not change the title-page -> colophon
   boundary's gap-above (that gap is fixed by this element's own line-
   height/margin-bottom, both untouched, plus header.title-page's
   padding-bottom, also untouched) -- re-verified via verify_finished.py's
   COLOPHON_TOP_RULE_GAP_JS and the order-17 145-boundary sweep, both
   still exactly 101.39062/56.00000. */
/* Captain order, 2026-09-28 ("All builds should match": the title-page
   `Arsinoe Library Edition, 2026` stamp follows Analects in gap above and
   colour; supersedes the 2026-09-25 rust colour and h4-rhythm margin in the
   comment above): margin-top calc(clamp(1.45rem, 2.8vw, 2.2rem) + 2px) ->
   0.35rem (Analects' own, analects.css:415), colour var(--rust) ->
   var(--ink-light). Range-rect ink gap from the last text line above (the
   "EIGHTH IMPRESSION" h4) to the stamp: 26.97 / 26.86 / 38.81 / 38.53 ->
   7.38 / 7.27 / 7.22 / 6.94 at 420 / 768 / 1280 / 1920, identical to
   Analects. The stamp is this header's last child and header.title-page's
   padding-bottom is untouched, so the title-page -> colophon boundary is
   unchanged (56.0 / 61.03 / 101.39 / 110.23 above the line, measured before
   and after). */
header.title-page .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;
}

/* Analects title-page mobile title and kicker scales. */
@media (max-width: 700px) {
  header.title-page {
    padding-top: 2.75rem;
  }
  header.title-page h1 {
    font-size: clamp(2.65rem, 14vw, 4.2rem);
    line-height: 0.86;
  }
  header.title-page h2 {
    letter-spacing: 0.24em;
  }
  header.title-page .cover-figure {
    margin-top: 2.5rem;
  }
}

#reference > .image-citation + h4 {
  margin-top: clamp(3rem, 5vw, 4rem);
}

/* ---- colophon ------------------------------------------------------------ */
/* Captain Review 2, order 4: padding-bottom zeroed (top/left/right
   unchanged, so the card keeps its own intentional inset everywhere
   else) so this box's own trailing space contributes nothing to the gap
   above the Contents-section divider line -- that gap is supplied
   entirely by `hr.section-divider`'s own `margin-top` instead, matching
   the gap below it exactly.

   Captain Review 2, order 11 (Ref 1/2: "you cut off my bottom margin
   spacing inside the box... Make is look like the Sunzi and Analects
   sections"): that zeroing was wrong -- it reached the box's own
   READER-VISIBLE padding, not just the "nothing before a divider"
   accounting order 4 meant to zero. Restoring it grows the card's own
   total height by the same amount, which pushes `.colophon +
   .section-divider` (below) down the page by that amount too --
   `verify_finished.py`'s own gap check measures to the card's last
   GLYPH, not its border, so that growth lands in the measured gap and
   costs that rule's own correction the same amount back (see its own
   comment). Restored to equal padding-top (1.5rem), matching Sunzi's
   own `.source-note` (`sunzi-war.css` ~1028: `padding: 1.5rem 1.25rem`,
   also top/bottom-equal with a different, still-intentional left/right).
   left/right stay their own already-intentional 1.75rem -- order 4 never
   touched them, and neither does this order.

   Captain Review 2, order 14 ("re-structure the Clausewitz colophon
   section like it looks in the Sunzi colophon sections"; "Be mindful of
   the divider lines"): the filled card (background/border/radius) is
   gone -- Sunzi's own `.source-note` (`sunzi-war.css:1025`: `margin: 3rem
   auto 0; max-width: 42rem; padding: 1.5rem 1.25rem; border-top: 1px
   solid var(--rule); font-size: 0.9rem`) is a single top rule, no box.
   `max-width: 42rem` is NOT ported -- this build's own reading measure
   (Captain Review 2, order 9: `--reading-cap`, shared by every `main > *`
   including this element) already constrains the column, and a second,
   narrower cap here would violate that already-approved, protected
   measure for no reason Sunzi's own layout shares. font-size 0.9rem and
   the left/right padding 1.25rem ARE ported literally -- nothing in this
   build's own tokens requires a different value. Top/bottom padding
   stays the equal 1.5rem/1.5rem order 11 already restored (Sunzi's own
   value besides), so `.colophon + .section-divider`'s existing
   correction (below), which assumes exactly that 1.5rem bottom padding,
   still holds unchanged.

   The new border-top draws a line at the title-page -> colophon
   boundary, where no line existed before -- distinct from and outside
   the 144-element `.section-divider` mechanism (not scored in that
   invariant, exactly as Sunzi's own `.source-note` border-top is its own
   plain rule, not part of a shared "spacing-line-spacing" class). That
   boundary previously had NO line, so this adds exactly one, not two;
   the colophon's own EXISTING position before `hr.section-divider`
   (order 9's Contents-section line) is untouched, so that boundary keeps
   its own single line too. `margin-top` is zeroed and folded into
   `padding-top`, made responsive with the SAME `clamp()` expression
   `header.title-page`'s own bottom padding already uses (below), so the
   gap ABOVE this new line (header's bottom padding alone, margin no
   longer adding to it) and the gap BELOW it (this padding-top) track
   each other automatically at every width by construction, the same
   technique the 144-divider system uses with its own shared clamp() --
   only the small residual from the two sides' different text metrics
   needed a measured correction, found the same way as every other such
   correction in this file: Playwright, both sides Range-measured to the
   actual first/last glyph, at 1280 and 420 -- 9.28125px at both, i.e.
   width-independent here, because both sides of this boundary share the
   identical clamp() expression, unlike the vw-scaled residuals elsewhere
   in this file.

   Captain Review 2, order 17 (Ref 1: "you fucked up the section divider
   spacing. Like all the others. This is not rocket science. Make all
   dividers and spacing the same like I said" -- header#title-page
   selected): the shared clamp() order 14 picked above, `clamp(1.5rem,
   4vw, 2.5rem)`, was `header.title-page`'s own PRE-EXISTING bottom-
   padding value, reused because it already sat at this boundary and was
   already responsive -- but it is not the 144-element divider system's
   own `clamp(3.5rem, 8vw, 7rem)` (`.section-divider`'s own `margin-top`,
   below): roughly half its magnitude at every width. The two sides of
   THIS boundary stayed equal to each other under that smaller clamp (so
   `verify_finished.py`'s own "gap above == gap below" check, which is
   not run against this boundary at all -- it queries `.section-divider`
   only -- would have passed it anyway), but the whole boundary sat at
   half the document's standard divider spacing: measured (Playwright,
   both sides Range-measured to the actual first/last glyph) 51.28/51.28
   at 1280 and 35.28/35.28 at 420, against the document's own
   ~101.4/~101.4 and ~56/~56 everywhere else. Equal-but-half, not "the
   same as the others."

   Fixed by switching both sides (this `padding-top` and
   `header.title-page`'s own bottom padding, above) to the 144-element
   system's own `clamp(3.5rem, 8vw, 7rem)`, with the residual re-measured
   from scratch the same way as every other correction in this file:
   `header.title-page`'s bottom padding is now that clamp minus
   `10.79261px + 0.1163vw`, and this `padding-top` is the same clamp
   minus `1.51136px + 0.1163vw` -- the DIFFERENCE between those two
   residuals (9.28125px, still width-independent) is exactly order 14's
   own original residual constant, unchanged: the two sides were
   re-anchored to the correct base magnitude without touching the
   calibration between them. Measured result, light and dark alike
   (`--rule` is the only themed value at this boundary and it does not
   affect layout): 101.40/101.40 at 1280, 56.00/56.00 at 420. None of the
   144 `.section-divider` elements were touched -- this boundary is still
   outside that mechanism (order 14's own note, above, still holds). */
.colophon {
  margin-top: 0;
  padding: calc(clamp(3.5rem, 8vw, 7rem) - (1.51136px + 0.1163vw)) 1.25rem 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
}

.colophon h2 {
  margin: 0 0 1rem;
  color: var(--rust);
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
}

.colophon dl {
  /* the browser's own UA stylesheet gives <dl> a default margin (about
     1em top/bottom); left unreset, it silently added extra space below
     the last row, inside the colophon's own padding box, on top of the
     card's own now-zeroed padding-bottom (Captain Review 2, order 4) --
     found only by direct measurement, not by inspecting this rule. */
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  column-gap: 1.25rem;
  row-gap: 0.5rem;
}

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

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

.colophon p.editorial {
  margin: 0.75rem 0 0;
  text-indent: 0;
  white-space: pre-wrap;
  color: var(--ink-mid);
  font-size: 0.92em;
}

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

/* Captain Review 2, order 3 ("add the section line divider ... between
   all major sections"), amended: "spacing, line divider, then spacing --
   exactly as the Prototype's .document-section does it: the preceding
   section's bottom padding (clamp(3.5rem, 8vw, 7rem)), then the 1px
   --rule line, then the same top padding before the next section's
   heading." The Prototype achieves the "before" half by giving every
   `.document-section`-classed element ITS OWN bottom padding of that
   same clamp() (`analects.css` ~524: `padding: clamp(...) var(
   --source-rail) clamp(...) 0`) -- appendix-4 gets its divider border
   only because it separately also carries the `.appendix` class: the
   line itself never supplies the spacing.

   This document's 15 divider elements sit after very different kinds of
   preceding siblings (a boxed colophon card, the Contents table, a plain
   front-matter div, or the last of a Book's own numbered-chapter divs),
   so rather than hunt down and pad the trailing edge of each of those
   different element types individually, the identical rendered gap is
   produced by giving the DIVIDER element itself `margin-top:
   clamp(3.5rem, 8vw, 7rem)` instead: none of this document's "before a
   divider" elements ever declare a margin-bottom larger than the
   clamp's own 3.5rem floor (colophon: 0; table.contents: 2rem; a plain
   div.chapter: 0), so ordinary adjacent-sibling margin collapsing always
   resolves to the larger value -- the clamp -- giving byte-for-byte the
   same measured gap the Prototype's own padding-based mechanism
   produces, without touching any element this order did not name.
   `border-top` and the "before" margin are shared here; the "after"
   padding is added per host element below, since `<hr>` and
   `div.chapter` start from different base rules. `--rule` is already a
   dark-mode-aware token (flips with the theme), so no separate
   dark-mode override is needed here. */
/* Captain Review 2, order 4 (continued): even with every trailing
   padding/margin zeroed (above), the Range-measured gap above a line
   still did not exactly equal the gap below it, because the two sides
   measure through DIFFERENT fonts/line-heights (this build's body text
   for whatever precedes a line vs. div.chapter h3's own display font for
   what follows one) -- a browser's own glyph-to-line-box "leading" is
   not identical for the two, so `margin-top == padding-top` in the CSS
   is not the same as "measured gap above == measured gap below." This
   was measured directly (Playwright, the same Range-based method the
   Captain's own check uses) for every DISTINCT kind of element that can
   be the "last thing before a line" in this document (found by
   inspecting all 143 boundaries' actual last child): a plain paragraph
   (126 of 143, `p`/`p.center`/`p.right` alike -- same font, so one
   correction covers all three), a footnote box (5, smaller font-size),
   a Book-division heading (8, the one case where a line follows another
   line directly -- see order 5's own "Book division sits between two
   lines" note), the Contents table (1, pref01's own boundary) and the
   colophon card (1, the hr boundary). Each gets its own small, measured
   correction, subtracted from the shared clamp() via `calc()`, so the
   final measured gap matches within 1px at both 1280 and 420 -- the
   two widths the Captain's check runs at; see the build report for the
   full 143-row table this was calibrated against. */
.section-divider {
  margin-top: calc(clamp(3.5rem, 8vw, 7rem) - (2.365px + 0.0988vw));
  border-top: 1px solid var(--rule);
}

/* Book-division heading immediately followed by its Book's own first
   chapter (8 cases): this is a line directly after another line (no
   text in between -- the Book-division div's only child is its own
   h3), so the "leading" mismatch runs the other way; the correction is
   correspondingly a small ADDITION to margin-top rather than a
   subtraction (a negative correction value here). */
div.chapter.section-divider:has(> h3:only-child) + .section-divider {
  margin-top: calc(clamp(3.5rem, 8vw, 7rem) - (-1.4845px + 0.1153vw));
}

/* A chapter whose very last paragraph carries a footnote (5 cases): the
   footnote's own smaller font-size (0.86em) leaves a different residual
   than a plain body paragraph.

   Captain Review 2, order 11 ("review all the boxes... correct similar
   errors"): `main > div.chapter > :last-child` (below) used to zero this
   note-box's own `padding-bottom` along with its `margin-bottom` -- the
   same reader-visible-padding-as-outer-spacing mistake the colophon had,
   confirmed by measurement (12px top, 0px bottom). Neither Analects nor
   Sunzi ever zero a note-box's own padding this way (both only zero its
   MARGIN at a section end -- analects.css ~640, sunzi-war.css ~1189).
   Fixed the same way `#reference > aside.source-note.editorial` (below)
   already restores the About box's own padding against this same generic
   rule: a more specific override, `main > div.chapter >
   aside.note-box:last-child { padding-bottom: 0.75rem }`. UNLIKE that
   box, this one still has a NEXT divider line depending on the old,
   zero-padding measurement, so this rule's own correction is widened by
   that same 0.75rem to keep the "last content -> line" gap exactly where
   the Captain's own order 4 already measured and approved it. */
div.chapter:has(> aside.note-box:last-child) + .section-divider {
  margin-top: calc(clamp(3.5rem, 8vw, 7rem) - 0.75rem - (1.323px + 0.1671vw));
}

/* The Contents table, immediately before pref01's own line (1 case):
   table-row text leaves a larger residual than body prose. */
table.contents + .section-divider {
  margin-top: calc(clamp(3.5rem, 8vw, 7rem) - (4.952px + 0.1163vw));
}

/* The colophon, immediately before the Contents-section hr (1 case).

   Captain Review 2, order 11: restoring the colophon's own padding-
   bottom (1.5rem, above) grows the card's own total height by that same
   1.5rem, pushing this line 1.5rem further down the page -- and
   `verify_finished.py`'s own gap check measures "above" to the colophon's
   last GLYPH (the release-date `<dd>` text, via `DIVIDER_GAP_JS`'s
   TreeWalker), not to the card's border, so that 1.5rem lands directly
   in the measured gap (confirmed: a live re-run showed the "hr(contents)"
   boundary alone going out of tolerance by ~24px, exactly 1.5rem, after
   the padding restore). Widened by that same 1.5rem here, the same
   pattern as `div.chapter:has(> aside.note-box:last-child) +
   .section-divider` above, so the measured "last glyph -> line" gap
   still matched the Captain's own order-4 calibration.

   Captain Review 2, order 14/15: both sides of this specific boundary
   changed font -- the colophon's own font-size (0.86rem -> 0.9rem, order
   14) shifts the release-date glyph the "above" side measures to, and
   `main > h3`'s font-size/line-height (order 15, now `div.chapter h3`'s
   own values) shifts the Contents heading glyph the "below" side (this
   same `hr.section-divider`'s flat `padding-top`) measures to. The old
   flat `0.734px` residual is stale for both reasons at once, so it was
   thrown out and re-measured from scratch (Playwright, both sides
   Range-measured, at 1280 and 420) rather than patched incrementally;
   unlike order 11's own correction above, the new residual is NOT
   width-independent -- fit as `Xpx + Yvw` from the two measured points,
   the same technique `.section-divider`'s own base correction (below)
   already uses. */
.colophon + .section-divider {
  margin-top: calc(clamp(3.5rem, 8vw, 7rem) - 1.5rem - (2.2613px + 0.1163vw));
}

hr.section-divider {
  margin-inline: auto;
  margin-bottom: 0;
  border: none;
  border-top: 1px solid var(--rule);
  padding-top: clamp(3.5rem, 8vw, 7rem);
}

/* Captain Review 2, order 8 ("add the section space/line divider like in
   Analects" -- the About box selected): this hr's own "gap below" is
   measured to another ELEMENT's border edge (the box's own top), not a
   glyph the way every other divider's "below" is -- so, unlike those,
   it is NOT naturally offset by font leading, but it DOES pick up this
   hr's own 1px border-top (box-top = hr-top + border-width(1px) +
   padding-top, so box-top minus hr-top over-counts padding-top by
   about that 1px). Corrected here, found only by direct measurement
   (1280: 103.38px below vs 101.44px above without this fix) -- the
   1.15px figure (not a bare 1px) was solved from measurements at
   three widths (1280/900/420) so all three land within 1px, not just
   the two the Captain's own order names. Scoped with `#reference` so
   it only affects this specific hr, not the Contents-section one
   (whose own "below" measurement is to a heading's
   glyph, already correct via the shared rule above). */
#reference hr.section-divider {
  padding-top: calc(clamp(3.5rem, 8vw, 7rem) - 1.15px);
}

/* ---- "Contents" heading + the Contents table ---------------------------- */
/* Captain Review 2, order 1, "Fix the alignments of the listings": both
   rules below used to fight `main > *` (the shared reading-measure rule
   above) on the properties that matter for centring, even though neither
   intended to.
     - `main > h3` used to write `margin: 2rem 0 1rem` -- a 3-value
       shorthand (top | left-right | bottom) that zeroes left/right
       margin explicitly, at HIGHER specificity than `main > *`'s
       `margin-inline: auto`, so the heading stayed flush against
       <main>'s own left edge instead of centring on the 704px reading
       column div.chapter/#colophon share. Fixed: `auto` in the
       left-right slot keeps the heading's own vertical margins while
       leaving horizontal centring to `main > *`.
     - `table.contents` used to declare `width: 100%`, at higher
       specificity than `main > *`'s `width: min(100% - 2rem, 44rem)`,
       so the table filled the whole of <main> (1024-1084px at 1280px
       wide, panel state dependent) rather than the 704px column --
       "auto" margins on a 100%-wide box have no space left to centre
       into, which is why the table's own `margin: 0 auto 2rem` looked
       right but did nothing. Fixed: no `width` declared here at all, so
       `main > *`'s constrained width is the only one that applies, and
       this rule's own auto margins then actually centre it. */
/* Captain Review 2, order 4 ("all line divider spacing areas should be
   equal on both sides"): this heading's own top margin used to add on
   top of hr.section-divider's padding-top, making the gap BELOW the
   Contents-section line larger than the gap ABOVE it. Zeroed here (top
   only -- the horizontal `auto` centring and the bottom margin are
   unchanged); the divider's own padding-top alone now supplies the full,
   symmetric gap. See the `.section-divider`/`div.chapter.section-divider`
   comment further down for the matching fix on the "above" side.

   Captain Review 2, order 15 ("update the style of this header like the
   other Titles"): color/font-size/font-weight/line-height/margin-bottom
   now match `div.chapter h3` (below) exactly -- the same treatment every
   other section title in the document already has (INTRODUCTION, the
   Book headings, REFERENCE, ...). `margin: 0 auto ...` is untouched on
   the left-right ("auto") side -- those are Review 2 order 1's own fix,
   load-bearing for this heading's horizontal centring on the reading
   column, which this order does not touch. `font-family`/`text-align`
   already matched `div.chapter h3` before this order and stay as they
   were. No `letter-spacing`/`text-transform` is added -- `div.chapter
   h3` declares neither, so "normal tracking, no transform" is already
   the match. */
main > h3 {
  margin: 0 auto 1.25rem;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 400;
  line-height: 1.25;
  text-align: center;
}

/* Captain Review 2, order 4: bottom margin zeroed -- was 2rem, which
   used to survive only because it happened to collapse with pref01's
   own (larger) margin-top; zeroing it here puts the ENTIRE gap above
   that line into pref01's margin-top explicitly, rather than relying on
   collapse behaviour that would silently break if either value ever
   changed independently. */
table.contents {
  margin: 0 auto;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.contents td {
  padding: 0.2rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

table.contents a {
  color: var(--rust);
  text-decoration: none;
}

table.contents a:hover {
  text-decoration: underline;
}

table.contents tr.editorial td {
  padding-top: 1.5em;
}

/* ---- chapters (front matter / Book dividers / numbered chapters all
   share class "chapter"; REFERENCE additionally carries "editorial") ----- */
/* Captain's correction (relayed via the coordinator, following Review 2
   order 3): chapters are "left as is" -- the Basic HTML had no rule
   between chapters, and the Prototype's own `.chapter`/`.book-divider`
   give no border either (confirmed: no such rule anywhere in
   analects.css). The old `border-bottom` this rule carried (this
   build's own PIPE 3 authoring, never vendored from anywhere) was
   removed outright, along with the `:last-of-type` exception that
   existed only to zero it on the very last chapter.

   Captain Review 2, order 5 ("these Chapters in Clausewitz are large
   blocks of text and paragraphs, and should get the space/line dividers
   between the Chapters"): extends order 3's divider from the 14
   major-section blocks to EVERY one of the 142 chapter-like blocks (all
   128 numbered chapters too) -- the generator now tags every div.chapter
   (and REFERENCE) with `section-divider`, so this base rule and that
   modifier collapse into one, applying uniformly: a top border, and the
   Prototype's own `.document-section` top-padding rhythm on every side
   that needs it, replacing the smaller flat `2.25rem` this build
   started with. A Book-division div (heading only, no body text) now
   sits between two divider lines like a part-title page -- the
   Captain's own stated, intended result of order 5, kept as-is.

   Captain Review 2, order 4 ("all line divider spacing areas should be
   equal on both sides"): the gap ABOVE a line must equal the gap BELOW
   it. Below is simple -- this rule's own `padding-top`, since a
   chapter's own heading margin-top is separately zeroed (see
   `div.chapter h3` below). Above used to be the SUM of the preceding
   block's own bottom padding (which never collapses with anything,
   unlike margin) plus this rule's `margin-top` -- always bigger than
   `padding-top` alone. Fixed by removing `padding-bottom` from this
   rule entirely (0 top-of-column padding contribution from what
   PRECEDES a line) and zeroing the actual last child's own trailing
   margin/padding too (see the `:last-child` rule below) -- every
   chapter's own "end of section" cost is 0, so the ENTIRE measured gap
   above any line is this rule's `margin-top` alone, the same
   `clamp(3.5rem, 8vw, 7rem)` magnitude as `padding-top` below.
   `border-top` and `margin-top` are shared with `hr.section-divider`
   via the `.section-divider` rule above; `padding-top` differs per host
   element since `<hr>` and `div.chapter` start from different bases. */
div.chapter {
  padding-top: clamp(3.5rem, 8vw, 7rem);
  padding-bottom: 0;
}

/* The actual last child of ANY div.chapter -- ordinarily a `<p>`
   (which has no padding to begin with), but a `<p class="footnote">`
   wrapped in `<aside class="note-box">` when a chapter's very last
   paragraph carries a footnote marker. Matches `main > div.chapter >
   :last-child` generically, never by class name, so it is correct
   regardless of what a chapter's last element happens to be.

   Captain Review 2, order 4 originally also zeroed this rule's own
   `padding-bottom`, reasoning that the note-box's OWN trailing padding
   (0.75rem, otherwise invisible dead space between its last line of text
   and its own bottom edge) would otherwise re-introduce the "above bigger
   than below" gap. Order 11 found that wrong -- a `<p>` has no padding to
   begin with, so in practice this only ever reached the note-box, and it
   reached the box's own READER-VISIBLE inner spacing to do it (12px top,
   0px bottom, measured -- the same defect as the colophon). `padding-
   bottom: 0` is no longer declared here; the override immediately below
   restores the note-box's own padding instead, and the ONE boundary that
   still needs the old accounting (a footnote-ending chapter has a NEXT
   divider line) gets it back via that divider's own correction instead
   (`div.chapter:has(> aside.note-box:last-child) + .section-divider`,
   above). `margin-bottom: 0` stays here -- collapsing the note-box's own
   1.4rem outer margin is still correct and orthogonal to its padding. */
main > div.chapter > :last-child {
  margin-bottom: 0;
}

/* Restores the note-box's own padding-bottom (0.75rem, matching its
   already-symmetric padding-top -- `.note-box` below declares `padding:
   0.75rem 1rem` uniformly) against the generic zeroing just above, the
   same pattern `#reference > aside.source-note.editorial` (below) already
   uses for the About box: a more specific override outranks the generic
   rule regardless of source order. Neither Analects nor Sunzi ever zero a
   note-box's own padding this way (analects.css ~640, sunzi-war.css
   ~1189 -- both zero only the box's MARGIN at a section end), so this
   also brings Clausewitz's footnote boxes into line with the house
   pattern the Captain pointed at ("make it look like the Sunzi and
   Analects sections"). */
main > div.chapter > aside.note-box:last-child {
  padding-bottom: 0.75rem;
}

div.chapter h3 {
  margin: 0 0 1.25rem;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 400;
  line-height: 1.25;
  text-align: center;
}

div.chapter h4 {
  margin: 1.75rem 0 0.6rem;
  color: var(--rust);
  font-family: var(--display);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: left;
}

/* Captain Review 2, order 7: "About this archival edition", modelled on
   the Prototype's own `aside.source-note` (analects.css:1448-1459) --
   1px --rule border, var(--note-bg) fill, the Prototype's own box-shadow,
   equal padding on all four sides (2.5rem/40px, already the Prototype's
   own trimmed, symmetric value -- vendored verbatim, nothing to trim
   here). `--note-bg`/`--rule`/`--shadow` are already dark-mode-aware
   tokens, so no separate dark-mode override is needed. The heading
   inside it is a plain `<h4>`, styled identically to EMENDATIONS' own
   (inherits `div.chapter h4` above -- no separate rule). */
.source-note {
  padding: 2.5rem;
  background: var(--note-bg);
  border: 1px solid var(--rule);
  box-shadow: 0 0.8rem 2rem var(--shadow);
}

/* Captain order, 2026-09-28 ("update all the About this archival edition
   sections to look like Analects... reference Analects for correct
   example"): at >900px this box measured 780px wide, not the Prototype's
   832px (analects.css's `.source-note` is a `.document-section`, capped at
   `min(100% - 2rem, 52rem)` against <main> itself; this box sits nested one
   level deeper, inside `#reference`, which is already capped to this
   build's own 780px desktop `--reading-cap`/`--reading-gutter` reading
   column -- see the `main > *` comment above, ~361). At <=900px the two
   already match exactly: both this box's parent and the Prototype's own
   box resolve to the same `min(100% - 2rem, 52rem)` formula there, so no
   override is needed or applied below that breakpoint. Above it, the box
   is widened to the Prototype's flat 832px and re-centred with negative
   auto-equivalent margins -- `#reference` (780px desktop, confirmed flat
   in this range: mainWidth exceeds 864px at both 1280 and 1920, the two
   widths this fix is measured against) is itself centred on <main>, so
   overflowing it by an equal 26px each side ((832-780)/2) centres the box
   on <main> too, the same point Analects' own box centres on. `auto`
   margins cannot be used here -- CSS clamps an auto margin to 0 once a
   fixed `width` alone already exceeds the containing block, so the
   negative offset is written explicitly. */
@media (min-width: 901px) {
  #reference > aside.source-note.editorial {
    width: 52rem;
    margin-left: -1.625rem;
    margin-right: -1.625rem;
  }
}

/* Order 6 ("fix the spacing at the end of the EMENDATIONS section"):
   the equal-spacing work (order 4/5) zeroed every div.chapter's own
   trailing padding/margin, including REFERENCE's -- correct everywhere
   there is a NEXT divider line to supply the gap instead, but REFERENCE
   is the last thing in <main>, so it left the document ending flush
   against the footer. Matches the Prototype's own last-section spacing
   exactly: analects.css's `.source-note` (also the LAST thing before
   `</main>` there) carries `margin-bottom: 5rem` (80px) -- ported
   verbatim onto `#reference` itself (the box's own `main > div.chapter >
   :last-child` zeroing, below, would otherwise have zeroed a margin
   placed on the box instead, and #reference -- unlike the 141 other
   div.chapter blocks -- has a unique id to target directly, so no new
   selector complexity is needed elsewhere). */
#reference {
  margin-bottom: 5rem;
}

/* `main > div.chapter > :last-child` (the order 4/5 rule that zeros
   whatever a chapter's actual last element is, so it can never re-add to
   the gap above the NEXT divider line) would otherwise zero this box's
   own padding-bottom too, breaking the "equal on all four sides"
   requirement -- since #reference is the final chapter, there is no
   "next divider line" for that rule to protect here, so the box's own
   padding is restored via the id selector's own high specificity. */
#reference > aside.source-note.editorial {
  padding-bottom: 2.5rem;
}

/* Coordinator's two finishing fixes on the box, relayed after their own
   verification of orders 6-7: (1) `div.chapter h4`'s own top margin
   (1.75rem) was sitting on top of the box's 40px padding, so the VISIBLE
   gap above "About this archival edition" was padding+margin (~73px)
   while the other three sides were 40px alone -- the exact asymmetry
   the Captain just had trimmed on the Prototype's own box. Zeroed here,
   scoped with the `#reference` id so it reliably outranks the plain
   `div.chapter h4` rule regardless of source order. (2) the box's
   paragraph was inheriting `div.chapter p`'s first-line text-indent
   (1.4em); the Prototype's own `.source-note p` has none (plain block
   quote paragraph, no indent), so it is zeroed here too -- and, found
   only by direct measurement (bottom gap was ~63px, not 40): the
   paragraph's own `margin-bottom` (1.05em) is a GRANDCHILD of
   `div.chapter`, so the order 4/5 `main > div.chapter > :last-child`
   rule -- which only reaches DIRECT children -- never zeroed it; it was
   stacking on top of the aside's own 40px padding-bottom. Zeroed here
   too, alongside text-indent. */
/* Captain order, 2026-09-28: heading brought to the Prototype's own
   `.source-note h2` treatment (analects.css:524-536, 1752-1755) -- this
   box's heading is a plain `<h4>` (Coordinator's order 7 comment above),
   so it otherwise inherits `div.chapter h4`'s smaller, rust-coloured,
   letter-spaced treatment (0.98rem/600/var(--rust)/0.03em), the same one
   EMENDATIONS above it uses. Overridden here, scoped to this one heading
   only: 1.35rem/700/var(--ink), tracking reset to normal, bottom margin
   widened to the Prototype's 1.5rem (24px) -- `margin-top: 0` (already
   here, order 7) is unchanged. */
#reference .source-note h4 {
  margin: 0 0 1.5rem;
  padding-top: 3px; /* with line-height 1.2: Analects' .document-section > h2 values */
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: normal;
}

#reference .source-note p {
  text-indent: 0;
  margin-bottom: 0;
}

/* ---- prose: the two-space sentence-boundary rule survives the restyle
   (white-space: pre-wrap), carried over unchanged from BasicHTML   clausewitz-war.css:88-92. */
div.chapter p {
  margin: 0 0 1.05em;
  text-indent: 1.4em;
  text-align: left;
}

div.chapter p:not(.poem):not(.center):not(.right) {
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* PIPE 4 QA C-02: `div.chapter p` above is (0,1,2) specificity, which
   outranked these five special classes at plain `p.poem` etc. (0,1,1),
   so every special paragraph rendered as plain indented left-aligned
   prose regardless of source order. Scoped to `div.chapter p.poem` etc.
   (0,2,2) here so each wins over the base rule again, restoring the
   Basic stylesheet's own intent (BasicHTML/clausewitz-war.css:94-129):
   poem inset 10% with no indent, letter inset both sides, center/right
   alignment, p2's extra top margin. */
div.chapter p.p2 {
  margin-top: 1.6em;
}

div.chapter p.poem {
  text-indent: 0;
  margin-left: 10%;
  font-size: 0.9em;
  white-space: normal;
}

div.chapter p.letter {
  text-indent: 0;
  margin-left: 10%;
  margin-right: 10%;
}

div.chapter p.center {
  text-align: center;
  text-indent: 0;
  white-space: normal;
}

div.chapter p.right {
  text-align: right;
  text-indent: 0;
  margin-right: 10%;
  white-space: normal;
}

/* ---- footnotes: wrapped in place in a note-box, no relocation ---------- */
.note-box {
  margin: 1.4rem 0 1.4rem 1.4rem;
  padding: 0.75rem 1rem;
  background: var(--note-bg);
  border-left: 3px solid var(--note-border);
}

.note-box p.footnote {
  margin: 0;
  text-indent: 0;
  color: var(--ink-mid);
  font-size: 0.86em;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

body.notes-hidden .note-box {
  display: none;
}

/* ---- pre: the three tabular blocks. Kept monospace, scrolls internally
   rather than overflowing the page if ever wider than the measure. ------- */
div.chapter pre {
  margin: 1.5rem 0;
  padding: 0.85rem 1rem;
  background: var(--parchment-mid);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--ink-mid);
  font-family: var(--mono);
  font-size: 0.88em;
  line-height: 1.35;
  white-space: pre;
  overflow-x: auto;
}

/* ---- the one in-text figure --------------------------------------------- */
div.fig {
  display: block;
  margin: 2rem auto;
  text-align: center;
}

.pub-image {
  max-width: 100%;
  height: auto;
}

/* ---- the Contents panel, analects.css:739-1043 (rail-free) -------------- */
.contents {
  font-size: 1rem;
}

.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;
}

.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;
  color: var(--rust);
  font-family: var(--display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.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);
}

.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;
}

.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;
}

.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;
}

.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;
}

/* ---- panel content: Title / End groups (unboxed), boxed front-matter
   links, per-Book toc-groups with a 4-column chapter-numeral grid,
   analects.css:1007-1115. */
.toc-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
  margin-bottom: 1.1rem;
}

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

.toc-end h3,
.toc-title h3 {
  margin: 0;
}

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

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

.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);
}

/* Captain Review 2, order 10 (+ FO follow-up, same order): two
   independent gaps around the boxed REFERENCE entry, each measured live
   (Playwright, 1280x900 and 420x800, light+dark, panel open) against
   Analects' own corresponding gap, then matched by adjusting ONLY this
   one `.major-links` box -- the one immediately followed by the toc-end
   group (:has(), already used elsewhere in this stylesheet, e.g.
   div.chapter:has(...) above) -- never the shared `.major-links` rule
   the front-matter box also uses, and never the shared `.toc-columns`
   margin-bottom the eight Book groups (and the front-matter box's own
   gap to Book I) use.

   BELOW the box (box bottom -> "End of Document" text top): Clausewitz
   measured 18.6px before this rule (shared margin-bottom 1.1rem + ~1px
   leading) against Analects' 29.0px (its own `.major-links` margin-
   bottom, analects.css:1232-ish "margin: 1.25rem 0 1.75rem"). +0.65rem
   over the shared 1.1rem lands margin-bottom at 1.75rem, the same
   literal value Analects builds this gap from; remeasured at 29.0px
   flat, all four combos -- 0.0px off Analects.

   ABOVE the box (last Book grid bottom -> box top): Clausewitz measured
   17.6px before this rule (the shared `.toc-columns` margin-bottom,
   1.1rem, plain-collapsing with this box's own margin-top, 0 by
   default) against Analects' 26.4px (FO measurement, all four combos):
   there, the Books grid's own toc-columns sits INSIDE the same
   major-links grid as the next box (Appendix 1), so Analects' 26.4px is
   its 0.55rem grid `gap` plus 1.1rem `margin-bottom` on that nested
   toc-columns -- the two do NOT collapse (grid items never collapse
   margins, with each other or with the grid's own gap). Clausewitz has
   no such grid nesting here -- plain sibling margin-collapse takes the
   MAX of the two adjacent margins, not a sum -- so matching 26.4px means
   setting THIS margin-top to 26.4px outright (1.65rem), not stacking a
   smaller delta on the existing 1.1rem: collapse(1.1rem, 1.65rem) =
   1.65rem = 26.4px. Remeasured at 26.4px flat, all four combos -- 0.0px
   off the FO's 26.4px target (within the ordered 1px tolerance). The
   shared `.toc-columns` margin-bottom itself is untouched, so neither
   the Book-to-Book gaps nor the front-matter-box-to-Book-I gap moved. */
.major-links:has(+ .toc-columns .toc-end) {
  margin-top: 1.65rem;
  margin-bottom: 1.75rem;
}

.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;
  font-size: 0.85rem;
}

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

@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;
  }
}

.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));
  }
  /* "About this archival edition" box: Analects' narrow-width padding
     (analects.css, same breakpoint), uniform on all four sides. Same
     selector as the padding-bottom restore above, so this later rule wins. */
  #reference > aside.source-note.editorial {
    padding: 1.5rem;
  }
  .site-nav {
    min-height: var(--header-height);
    gap: 0.75rem;
  }
  .nav-brand {
    padding-block: 0.38rem;
  }
  .nav-meta {
    font-size: 0.5rem;
  }
}

@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;
  }
}

/* ---- print: minimal adaptation of analects.css's print block, rail-free */
@media print {
  main {
    overflow-x: visible;
  }
  @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,
  .display-controls {
    display: none !important;
  }
  .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;
  }
  div.chapter {
    break-inside: avoid-page;
  }
  h2, h3 {
    break-after: avoid;
  }
  a {
    color: #000;
    text-decoration: none;
  }
}
