/* The Append-Only Logbook — a bound working record.
   Ruled columns, oxblood binding, vermilion state impressions, iron-gall text.
   Square corners throughout: a bound page has none. */

:root {
  /* Ground: ledger stock, committed as a full field rather than a tinted neutral. */
  --stock:        #cbd6c4;
  --stock-deep:   #bcc9b4;
  --stock-pale:   #dbe3d4;

  /* Binding and impressions. */
  --oxblood:      #6b2019;
  --oxblood-deep: #521510;
  --vermilion:    #c3341d;      /* graphic use: rules, borders, strike-through */
  --vermilion-ink: #a52c17;     /* text use: clears 4.5:1 on the ledger stock */
  --amber:        #c98a2e;
  --amber-deep:   #a86f1f;

  /* Iron-gall ink: brown-shifted, never blue-black. */
  --ink:          #23261f;
  --ink-soft:     #4a4e42;
  --ink-faint:    #555a4c;

  /* Rules. */
  --rule-red:     rgba(150, 52, 34, 0.30);
  --rule-red-hi:  rgba(150, 52, 34, 0.52);
  --rule-ink:     rgba(35, 38, 31, 0.16);

  --measure: 68ch;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --margin-col: 12.5rem;

  --serif: "Literata", "Iowan Old Style", Georgia, serif;
  --grot:  "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono:  "Courier Prime", "Courier New", monospace;

  --ease: cubic-bezier(0.16, 0.84, 0.36, 1);
  color-scheme: light;
  accent-color: var(--oxblood);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--stock);
  /* The ruled field: hairline red verticals over the stock, as on ledger paper. */
  background-image:
    linear-gradient(90deg, var(--rule-red) 0 1px, transparent 1px 100%),
    linear-gradient(90deg, rgba(150,52,34,0.10) 0 1px, transparent 1px 100%);
  background-size: 100% 100%, 3.25rem 100%;
  background-position: var(--gutter) 0, 0 0;
  background-attachment: fixed, fixed;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1rem, 0.96rem + 0.22vw, 1.1rem);
  line-height: 1.62;
  font-variant-numeric: oldstyle-nums proportional-nums;
  text-rendering: optimizeLegibility;
}

/* Browser surfaces belong to the design system too. */
::selection { background: var(--amber); color: var(--ink); }
:focus-visible {
  outline: 3px solid var(--vermilion);
  outline-offset: 2px;
}
* { scrollbar-color: var(--oxblood) var(--stock-deep); scrollbar-width: thin; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--stock-deep); }
::-webkit-scrollbar-thumb { background: var(--oxblood); border: 3px solid var(--stock-deep); }
::-webkit-scrollbar-thumb:hover { background: var(--oxblood-deep); }

a { color: var(--oxblood); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--vermilion); text-decoration-thickness: 2px; }

code, pre, .mono { font-family: var(--mono); font-variant-numeric: normal; }
code { font-size: 0.92em; background: rgba(35,38,31,0.06); padding: 0.1em 0.3em; }
pre { overflow-x: auto; }
pre code { background: none; padding: 0; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--oxblood); color: var(--stock-pale);
  padding: 0.75rem 1.25rem; font-family: var(--grot); font-weight: 600;
}
.skip:focus { left: 0; }

/* ─── Head band: oxblood buckram ─────────────────────────────────────── */

.band {
  position: relative;
  background: var(--oxblood);
  background-image:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.13) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.10) 0 1px, transparent 1px 4px);
  color: var(--stock-pale);
  padding: clamp(1.9rem, 4.2vw, 3.1rem) var(--gutter) clamp(1.5rem, 3vw, 2.2rem);
  border-bottom: 6px solid var(--oxblood-deep);
}
.band::after {
  /* The endpaper edge where the binding meets the leaf. */
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 6px;
  background: repeating-linear-gradient(90deg, var(--amber) 0 14px, var(--amber-deep) 14px 28px);
}
.band__inner { max-width: 62rem; }

.band__spine {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(219,227,212,0.78);
  margin: 0 0 1.75rem;
}
/* On the index the dateline is a running head, not a kicker: it sits at the
   outer edge of the band on its own line, never stacked above the title. */
.band--index .band__spine {
  position: absolute; top: clamp(1.1rem, 3vw, 1.9rem); right: var(--gutter);
  margin: 0; text-align: right;
}
.band--index .band__inner { padding-top: clamp(1.5rem, 3vw, 2.25rem); }
@media (max-width: 46rem) {
  /* No room for a running head, so the dateline closes the band rather than
     standing above the title as an eyebrow. */
  .band--index .band__inner { display: flex; flex-direction: column; padding-top: 0; }
  .band--index .band__spine {
    position: static; text-align: left; order: 9; margin: 1.5rem 0 0;
    padding-top: 1.25rem; border-top: 1px solid rgba(219, 227, 212, 0.28);
  }
  .band--index .band__title { order: 1; }
  .band--index .band__sub { order: 2; }
  .band--index .band__legal { order: 3; }
  .band--index .tally--band { order: 4; }
}
.ico { vertical-align: -1px; margin-right: 0.45rem; }
.band__spine a { color: rgba(219,227,212,0.85); }

.band__title {
  font-family: var(--grot);
  font-weight: 700;
  font-stretch: 112%;
  font-size: clamp(1.95rem, 6.4vw, 4.9rem);
  line-height: 0.92;
  overflow-wrap: break-word;
  letter-spacing: -0.035em;
  margin: 0 0 0.85rem;
  text-wrap: balance;
}
.band__title--sub { font-size: clamp(2rem, 5.5vw, 3.6rem); }

.band__sub {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.35rem);
  line-height: 1.45; max-width: 52ch; margin: 0 0 1rem;
  color: #f0ece0;
}
.band__legal {
  font-family: var(--grot); font-size: 0.82rem; line-height: 1.5;
  color: rgba(219,227,212,0.66); max-width: 54ch; margin: 0;
}
.band__legal a { color: rgba(240,236,224,0.9); }

/* The stamp: a vermilion impression, struck once. */
.stamp {
  display: inline-grid; justify-items: center; gap: 0.15rem;
  padding: 0.7rem 1.1rem;
  border: 3px solid var(--vermilion-ink);
  color: var(--vermilion-ink);
  font-family: var(--mono); font-weight: 700;
  transform: rotate(-7deg);
  position: relative;
}
.stamp::before {
  content: ""; position: absolute; inset: 4px; border: 1px solid var(--vermilion-ink); opacity: 0.55;
}
.log { position: relative; }
@media (min-width: 62rem) {
  /* Struck across the head of the log, clear of the binding. */
  .stamp { position: absolute; top: clamp(1.75rem, 3vw, 2.75rem); right: 0; z-index: 2; }
}
.stamp__rule { font-size: 0.72rem; letter-spacing: 0.22em; }
.stamp__rule--sm { font-size: 0.58rem; letter-spacing: 0.16em; opacity: 0.85; }
.stamp__date { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.06em; opacity: 0.85; margin-top: 0.25rem; }
.stamp__score {
  font-size: 1.6rem; line-height: 1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums lining-nums;
}

/* The install ribbon, on the endpaper edge. */
.ribbon {
  position: fixed; top: 38vh; right: 0; z-index: 30;
  display: grid; gap: 0.15rem; justify-items: center;
  background: var(--amber); color: var(--ink);
  padding: 1.1rem 0.7rem;
  border-left: 3px solid var(--amber-deep);
  border-top: 1px solid var(--amber-deep);
  border-bottom: 1px solid var(--amber-deep);
  text-decoration: none;
  writing-mode: vertical-rl;
  font-family: var(--grot); font-weight: 700; letter-spacing: 0.1em;
  box-shadow: -2px 3px 8px rgba(35, 38, 31, 0.22);
  transition: transform 180ms var(--ease), background-color 180ms var(--ease);
}
.ribbon:hover, .ribbon:focus-visible { background: var(--amber-deep); transform: translateX(-0.4rem); color: var(--ink); }
.ribbon__label { font-size: 1rem; text-transform: uppercase; }
.ribbon__note { font-size: 0.7rem; font-weight: 400; opacity: 0.75; text-transform: lowercase; }

/* ─── The leaf ───────────────────────────────────────────────────────── */

.leaf { padding: 0 var(--gutter) 0; }

section { padding: clamp(2.25rem, 4.5vw, 3.75rem) 0; border-bottom: 1px solid var(--rule-ink); }
section:last-of-type { border-bottom: 0; }

h2 {
  font-family: var(--grot); font-weight: 700; font-stretch: 108%;
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.9rem);
  line-height: 1.08; letter-spacing: -0.028em;
  margin: 0 0 1.25rem; max-width: 24ch; text-wrap: balance;
}
h3 {
  font-family: var(--grot); font-weight: 600;
  font-size: 1.2rem; line-height: 1.25; letter-spacing: -0.015em;
  margin: 2rem 0 0.6rem;
}
p { max-width: var(--measure); }

.opening { display: grid; gap: 1rem; padding: clamp(1.5rem, 3vw, 2.25rem) 0 clamp(1.25rem, 2.5vw, 1.75rem); }
.opening__h {
  font-family: var(--serif); font-weight: 700; font-stretch: normal;
  font-size: clamp(1.3rem, 1.05rem + 1.1vw, 2rem);
  line-height: 1.18; letter-spacing: -0.02em; max-width: 28ch; margin: 0;
}
.opening__lede { color: var(--ink-soft); margin: 0; }
.argument p { font-size: 1.05em; }
.argument p + p { margin-top: 1.1rem; }

.tally {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0; margin: 1rem 0 0; border-top: 2px solid var(--ink);
}
/* The totals belong at the head of the book, on the buckram. */
.tally--band {
  margin: 1.5rem 0 0; max-width: 54rem;
  border-top: 1px solid rgba(219, 227, 212, 0.34);
}
.tally--band .tally__col { border-right-color: rgba(219, 227, 212, 0.22); padding-block: 0.7rem; }
.tally--band dt { color: rgba(219, 227, 212, 0.78); }
.tally--band .num { color: var(--stock-pale); font-size: clamp(1.5rem, 1.2rem + 1vw, 2.15rem); }
.tally__col { padding: 0.9rem 1.25rem 0.9rem 0; border-right: 1px solid var(--rule-red-hi); }
.tally__col + .tally__col { padding-left: 1.25rem; }
.tally__col:last-child { border-right: 0; }
.tally dt {
  font-family: var(--grot); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.35rem;
}
.tally dd { margin: 0; }
.num {
  font-family: var(--grot); font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  font-size: clamp(2rem, 1.4rem + 2vw, 3.1rem); line-height: 1;
  letter-spacing: -0.03em;
}

/* ─── The live proof ─────────────────────────────────────────────────── */

.proof__lede, .proof__foot { color: var(--ink-soft); }
.proof__foot { margin-top: 1.5rem; font-size: 0.95em; }
.proof__grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  margin: 2rem 0 0; border: 2px solid var(--ink); background: var(--stock-pale);
}
@media (min-width: 40rem) { .proof__grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 64rem) { .proof__grid { grid-template-columns: repeat(6, 1fr); } }
.fig { padding: 1rem 1.1rem; border-right: 1px solid var(--rule-red-hi); border-bottom: 1px solid var(--rule-red-hi); }
.fig__k {
  display: block; font-family: var(--grot); font-size: 0.7rem; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.4rem;
}
.fig__v {
  display: block; font-family: var(--grot); font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 1.85rem; line-height: 1; letter-spacing: -0.03em;
}
.fig--wide { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
.fig--wide .fig__v { font-size: 1.05rem; font-weight: 400; font-family: var(--serif); line-height: 1.5; letter-spacing: 0; }
.proof__fallback {
  grid-column: 1 / -1; margin: 0; padding: 1.1rem 1.25rem; max-width: 74ch;
  color: var(--ink-soft); font-size: 0.95em;
}
.proof__fallback strong { font-family: var(--grot); font-variant-numeric: tabular-nums lining-nums; }
.docs__hint { color: var(--ink-soft); margin: 0; font-size: 0.95em; }

/* ─── The log ────────────────────────────────────────────────────────── */

.log__note { color: var(--ink-soft); margin-bottom: 2.5rem; }
.entries { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }

.entry {
  position: relative;
  display: grid;
  grid-template-columns: var(--margin-col) minmax(0, 1fr);
  gap: 0 2rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule-red-hi);
}
.entry__margin {
  display: grid; align-content: start; gap: 0.5rem;
  padding-right: 1.5rem; border-right: 1px solid var(--rule-red-hi);
}
.entry__no {
  font-family: var(--grot); font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 2.1rem; line-height: 0.9; letter-spacing: -0.04em;
  color: var(--oxblood);
}
.entry__date {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.04em;
  color: var(--ink-faint); display: block;
}
.entry__lineage {
  font-family: var(--grot); font-size: 0.74rem; line-height: 1.35;
  color: var(--ink-faint); letter-spacing: 0.01em;
}
.entry__h { margin: 0 0 0.4rem; font-size: clamp(1.15rem, 1rem + 0.6vw, 1.55rem); }
.entry__desc { margin: 0 0 0.6rem; color: var(--ink-soft); max-width: 62ch; }
.entry__slug { margin: 0; }
.entry__slug code { background: rgba(107,32,25,0.10); color: var(--oxblood); }

.entry__more { margin-top: 0.9rem; }
.entry__more summary {
  cursor: pointer; display: inline-block;
  font-family: var(--grot); font-weight: 600; font-size: 0.82rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--oxblood);
  border-bottom: 2px solid var(--amber);
  padding-bottom: 0.15rem;
  list-style: none;
}
.entry__more summary::-webkit-details-marker { display: none; }
.entry__more summary:hover { color: var(--vermilion); border-bottom-color: var(--vermilion); }
.entry__close { display: none; }
.entry__more[open] .entry__open { display: none; }
.entry__more[open] .entry__close { display: inline; }
.entry__inner {
  margin-top: 1.5rem; padding: 1.5rem 0 0.5rem;
  border-top: 1px solid var(--rule-ink);
}

/* Markdown pulled from the repository. */
.md { max-width: var(--measure); }
.md h1, .md h2 { font-size: 1.35rem; margin: 1.8rem 0 0.7rem; max-width: none; }
.md h3 { font-size: 1.08rem; margin: 1.5rem 0 0.5rem; }
.md p { margin: 0 0 0.9rem; }
.md ul, .md ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.md li { margin-bottom: 0.4rem; }
.md table { border-collapse: collapse; width: 100%; margin: 0 0 1.2rem; font-size: 0.92em; }
.md th, .md td { text-align: left; padding: 0.45rem 0.7rem; border-bottom: 1px solid var(--rule-ink); vertical-align: top; }
.md th { font-family: var(--grot); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); border-bottom: 2px solid var(--ink); }
.md td { font-variant-numeric: tabular-nums lining-nums; }
.md pre {
  background: var(--stock-pale); border: 1px solid var(--rule-ink);
  padding: 0.9rem 1rem; font-size: 0.85rem; line-height: 1.5; margin: 0 0 1.2rem;
}
.md hr { border: 0; border-top: 1px solid var(--rule-red-hi); margin: 1.8rem 0; }
.md blockquote { margin: 0 0 1rem; padding-left: 1rem; border-left: 1px solid var(--amber-deep); color: var(--ink-soft); }

.docs { margin-top: 1.75rem; }
.doc { border-top: 1px solid var(--rule-red-hi); padding-top: 1.1rem; margin-top: 1.1rem; }
.doc__h {
  font-family: var(--grot); font-weight: 600; font-size: 0.78rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint);
  margin: 0 0 0.75rem;
}
.doc__h .doc__path { font-family: var(--mono); text-transform: none; letter-spacing: 0; opacity: 0.75; }
.doc__fail { color: var(--vermilion-ink); font-family: var(--grot); font-size: 0.85rem; }

/* ─── The correction ─────────────────────────────────────────────────── */

.correction__lede { color: var(--ink-soft); }
.corr-list { list-style: none; margin: 2rem 0 0; padding: 0; border-left: 3px solid var(--vermilion); }
.corr { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0 1.5rem; padding: 1rem 0 1rem 1.5rem; }
.corr__date {
  font-family: var(--grot); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--vermilion-ink); padding-top: 0.35rem;
}
.corr__text { margin: 0; grid-column: 2; }
.corr__why { grid-column: 2; }
.corr__text s { color: var(--ink-faint); text-decoration-color: var(--vermilion); text-decoration-thickness: 2px; }
.corr__why { margin: 0.7rem 0 0; font-size: 0.93em; color: var(--ink-soft); grid-column: 2; }

/* ─── Install ────────────────────────────────────────────────────────── */

.install__lede { color: var(--ink-soft); }
.install__pair {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 0; margin: 2rem 0 0; border-top: 2px solid var(--ink);
}
.install__col { padding: 1.4rem 1.75rem 1.4rem 0; border-right: 1px solid var(--rule-red-hi); }
.install__col:last-child { border-right: 0; padding-left: 1.75rem; }
.install__col h3 { margin-top: 0; }
.install__warn { color: var(--vermilion-ink); font-weight: 600; }
.install__after { margin-top: 1.75rem; color: var(--ink-soft); }

.term {
  background: var(--ink); color: var(--stock-pale);
  padding: 0.95rem 1.1rem; font-size: 0.82rem; line-height: 1.55;
  border: 1px solid var(--ink); margin: 0.9rem 0;
  box-shadow: inset 0 0 0 1px rgba(201, 138, 46, 0.35);
}
.dl {
  display: inline-block; font-family: var(--grot); font-weight: 600;
  background: var(--oxblood); color: var(--stock-pale);
  padding: 0.6rem 1.1rem; text-decoration: none; letter-spacing: 0.02em;
  border-bottom: 3px solid var(--oxblood-deep);
}
.dl:hover, .dl:focus-visible { background: var(--vermilion); color: #fff; border-bottom-color: var(--oxblood); }

.verify { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule-red-hi); }
.verify h3 { margin-top: 0; }

/* ─── Limits ─────────────────────────────────────────────────────────── */

.limits__lede { color: var(--ink-soft); }
.limits__list { list-style: none; margin: 2rem 0 0; padding: 0; max-width: 60ch; }
.limits__list li {
  padding: 0.85rem 0 0.85rem 2.25rem; border-bottom: 1px solid var(--rule-ink);
  position: relative;
}
.limits__list li::before {
  content: "—"; position: absolute; left: 0; top: 0.85rem;
  font-family: var(--grot); font-weight: 700; color: var(--vermilion-ink);
}
.limits__list strong { font-weight: 700; }

/* ─── Research ───────────────────────────────────────────────────────── */

.research__lede { color: var(--ink-soft); margin-bottom: 1.5rem; }
.research__body { max-width: 72ch; }
.research__body table { font-size: 0.86em; }

.single { padding-top: clamp(2rem, 5vw, 3.5rem); }

/* ─── Colophon ───────────────────────────────────────────────────────── */

.colophon {
  background: var(--oxblood-deep); color: rgba(219,227,212,0.82);
  padding: clamp(2.5rem, 6vw, 4rem) var(--gutter);
  border-top: 6px solid var(--amber);
  font-size: 0.9rem;
}
.colophon__inner { max-width: 62rem; }
.colophon__line { max-width: 66ch; margin: 0 0 0.75rem; }
.colophon__links { display: flex; flex-wrap: wrap; gap: 0 1.75rem; margin: 1.5rem 0 0; }
.colophon a { color: var(--amber); }
.colophon a:hover { color: #fff; }

/* ─── Motion: ink and impression only ────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  /* Ink is laid across the row, left to right. Not a slide, not a fade. */
  .entry, .corr, .limits__list li, .tally__col, .fig, .install__col {
    clip-path: inset(0 100% 0 0);
  }
  .entry.inked, .corr.inked, .limits__list li.inked,
  .tally__col.inked, .fig.inked, .install__col.inked {
    clip-path: inset(0 0 0 0);
    transition: clip-path 540ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  /* The rule under an entry is drawn along its own length, ahead of the ink. */
  .entry::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
    background: var(--vermilion); transform: scaleX(0); transform-origin: left center;
  }
  .entry.inked::after {
    transform: scaleX(1);
    transition: transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .stamp { opacity: 0; transform: rotate(-20deg) scale(1.9); }
  .stamp.struck {
    opacity: 0.92;
    transform: rotate(-7deg) scale(1);
    transition: opacity 200ms cubic-bezier(0.22, 1, 0.36, 1), transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
  }
}

/* Reduced motion: everything simply present. */
@media (prefers-reduced-motion: reduce) {
  .entry, .corr, .limits__list li, .tally__col, .fig, .install__col, .stamp { opacity: 1; transform: none; clip-path: none; }
  .stamp { transform: rotate(-7deg); opacity: 0.92; }
}

/* No JavaScript: nothing is hidden by animation state. */
.no-js .entry, .no-js .corr, .no-js .limits__list li, .no-js .tally__col,
.no-js .fig, .no-js .install__col { opacity: 1; transform: none; clip-path: none; }
.no-js .stamp { opacity: 0.92; transform: rotate(-7deg); }

/* ─── Narrow widths: the binding closes ──────────────────────────────── */

@media (max-width: 62rem) {
  :root { --margin-col: 8.5rem; }
  .entry { gap: 0 1.25rem; }
  .entry__margin { padding-right: 1rem; }
  .entry__no { font-size: 1.7rem; }
}

@media (max-width: 46rem) {
  body {
    background-image:
      linear-gradient(90deg, var(--rule-red) 0 1px, transparent 1px 100%),
      linear-gradient(90deg, rgba(150,52,34,0.10) 0 1px, transparent 1px 100%);
    background-size: 100% 100%, 5.5rem 100%;
  }
  .entry { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
  .entry__margin {
    display: flex; align-items: baseline; gap: 0.9rem;
    padding-right: 0; border-right: 0; border-bottom: 1px solid var(--rule-red-hi);
    padding-bottom: 0.5rem;
  }
  .entry__no { font-size: 1.5rem; }
  .corr { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; padding-left: 1rem; }
  .install__col, .install__col:last-child { padding-left: 0; padding-right: 0; border-right: 0; border-bottom: 1px solid var(--rule-red-hi); }
  .tally__col { border-right: 0; border-bottom: 1px solid var(--rule-red-hi); }

  /* The ribbon becomes a foot band rather than disappearing. */
  .ribbon {
    top: auto; bottom: 0; left: 0; right: 0;
    writing-mode: horizontal-tb;
    grid-auto-flow: column; justify-content: center; gap: 0.6rem; align-items: baseline;
    padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
    border-left: 0; border-top: 3px solid var(--amber-deep);
    box-shadow: 0 -3px 10px rgba(35, 38, 31, 0.24);
  }
  .ribbon:hover, .ribbon:focus-visible { transform: translateY(-0.25rem); }
  .stamp { margin: 2.25rem 0 0; transform: rotate(-4deg); }
  .leaf { padding-bottom: 2rem; }
  /* The fixed foot band must not cover the colophon's links at the document end. */
  .colophon { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }
}

@media print {
  .ribbon, .skip { display: none; }
  body { background: #fff; color: #000; }
  .band { background: #fff; color: #000; border-bottom: 2px solid #000; }
  .entry__more > summary { display: none; }
  .entry__inner { display: block !important; }
}
.md__scroll { overflow-x: auto; }
