/* ============================================================
   THE ME TABLET — design system
   Obsidian clay + gold leaf. Cinzel for inscriptions,
   Literata for the long read, JetBrains Mono for data.
   ============================================================ */

:root {
  --bg: #0c0a07;
  --bg-elev: #14100a;
  --clay: #1b1410;
  --clay-deep: #221912;
  --line: rgba(201, 169, 110, 0.16);
  --line-strong: rgba(201, 169, 110, 0.38);
  --gold: #c9a96e;
  --gold-bright: #e9cd92;
  --ember: #d97a32;
  --ember-glow: rgba(217, 122, 50, 0.35);
  --lapis: #6f9fce;
  --text: #e9dfc9;
  --text-dim: #a8987a;
  --text-faint: #6f6450;
  --ok: #7fae6a;
  --serif: "Literata", Georgia, serif;
  --display: "Cinzel", "Times New Roman", serif;
  --mono: "JetBrains Mono", Consolas, monospace;
  --quote: "Cormorant Garamond", Georgia, serif;
  --reader-size: 17px;
  --reader-width: 46em;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

[data-theme="light"] {
  --bg: #f1e9d6;
  --bg-elev: #f8f2e3;
  --clay: #ece2cb;
  --clay-deep: #e4d7ba;
  --line: rgba(96, 74, 40, 0.18);
  --line-strong: rgba(96, 74, 40, 0.42);
  --gold: #8a6a35;
  --gold-bright: #6f5527;
  --ember: #b35a1f;
  --ember-glow: rgba(179, 90, 31, 0.22);
  --lapis: #2e5e8c;
  --text: #2b2114;
  --text-dim: #6d5c41;
  --text-faint: #99876a;
  --shadow: 0 14px 40px rgba(60, 40, 10, 0.18);
}

* { box-sizing: border-box; }
/* NOTE: no global smooth scrolling — long anchor jumps abort under
   content-visibility layout shifts in a 500k-character document. */
.reader-article [id] { scroll-margin-top: 74px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1200px 500px at 70% -10%, rgba(217, 122, 50, 0.07), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(111, 159, 206, 0.05), transparent 55%);
}
[data-theme="light"] body,
body[data-theme="light"] {
  background-image:
    radial-gradient(1200px 500px at 70% -10%, rgba(179, 90, 31, 0.08), transparent 60%);
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }
::selection { background: var(--ember-glow); }

/* ---------- chrome ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); }
.brand svg { display: block; }
.brand .brand-name {
  font-family: var(--display); font-size: 15px; letter-spacing: 0.22em; font-weight: 600;
}
.brand .brand-sub {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em;
  color: var(--text-dim); text-transform: uppercase; display: block; margin-top: 1px;
}
.header-spacer { flex: 1; }
.icon-btn {
  appearance: none; background: transparent; border: 1px solid var(--line);
  color: var(--text-dim); border-radius: 8px; cursor: pointer;
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 13px; transition: all .15s;
}
.icon-btn:hover { color: var(--gold-bright); border-color: var(--line-strong); }
.icon-btn.wide { width: auto; padding: 0 12px; gap: 7px; font-size: 11px; letter-spacing: .08em; }

.progress-track { position: fixed; top: 0; left: 0; right: 0; height: 2.5px; z-index: 60; background: transparent; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--ember)); transition: width .12s linear; }

/* ---------- home: hero ---------- */
.hero {
  max-width: 1060px; margin: 0 auto; padding: 72px 24px 30px;
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: center;
}
.hero h1 {
  font-family: var(--display); font-weight: 700; font-size: clamp(34px, 5vw, 56px);
  letter-spacing: 0.08em; margin: 12px 0 18px; line-height: 1.12;
}
.hero h1 .gold { color: var(--gold); }
.kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--ember); display: inline-flex; align-items: center; gap: 10px;
}
.kicker::before { content: ""; width: 26px; height: 1px; background: var(--ember); display: inline-block; }
.hero p.lede { font-size: 17.5px; line-height: 1.8; color: var(--text-dim); max-width: 56ch; }
.hero p.lede strong { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 13px 22px; border-radius: 10px; border: 1px solid var(--line-strong);
  color: var(--text); cursor: pointer; background: transparent; transition: all .18s;
}
.btn.primary {
  background: linear-gradient(135deg, var(--gold), #a8854b);
  color: #16100a; border-color: transparent; font-weight: 600;
  box-shadow: 0 6px 24px rgba(201, 169, 110, 0.25);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(201, 169, 110, 0.35); color: #16100a; }
.btn:not(.primary):hover { border-color: var(--gold); color: var(--gold-bright); }

.stat-row { display: flex; gap: 28px; margin-top: 34px; flex-wrap: wrap; }
.stat .num { font-family: var(--display); font-size: 26px; color: var(--gold-bright); display: block; }
.stat .lbl { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-faint); }

/* ---------- sections ---------- */
.section { max-width: 1060px; margin: 0 auto; padding: 56px 24px; }
.section-head { margin-bottom: 30px; }
.section-head h2 {
  font-family: var(--display); font-size: clamp(22px, 3vw, 30px); letter-spacing: 0.1em;
  margin: 10px 0 8px; font-weight: 600;
}
.section-head p { color: var(--text-dim); max-width: 70ch; line-height: 1.75; margin: 0; }

/* ---------- volume shelf ---------- */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 16px; }
.vol-card {
  position: relative; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(160deg, var(--clay), var(--bg-elev));
  padding: 18px; min-height: 168px; display: flex; flex-direction: column; gap: 8px;
  transition: all .2s; overflow: hidden;
}
.vol-card .vol-num {
  font-family: var(--mono); font-size: 10px; color: var(--text-faint); letter-spacing: 0.2em;
}
.vol-card h3 { font-family: var(--display); font-size: 16.5px; margin: 0; font-weight: 600; letter-spacing: 0.03em; line-height: 1.35; }
.vol-card p { font-size: 12.5px; color: var(--text-dim); line-height: 1.55; margin: 0; flex: 1; }
.vol-card .vol-tag {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-faint); display: flex; align-items: center; gap: 7px;
}
.vol-card.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--shadow); }
.vol-card.active:hover { transform: translateY(-3px); }
.vol-card.active .vol-tag { color: var(--ok); }
.vol-card.active::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px 180px at 85% -20%, rgba(201, 169, 110, 0.16), transparent 70%);
}
.vol-card.sealed { opacity: 0.62; }
.vol-card.sealed:hover { opacity: 0.85; }
.vol-card.sealed .vol-tag { color: var(--ember); }
.vol-cover { width: 100%; aspect-ratio: 5/3; border-radius: 9px; object-fit: cover; border: 1px solid var(--line); }

/* ---------- ME grid ---------- */
.me-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--line); background: transparent; color: var(--text-dim);
  border-radius: 99px; padding: 6px 13px; cursor: pointer; transition: all .15s;
}
.chip:hover, .chip.on { border-color: var(--gold); color: var(--gold-bright); }
.chip.on { background: rgba(201, 169, 110, 0.1); }
.me-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.me-tile {
  border: 1px solid var(--line); border-radius: 11px; background: var(--bg-elev);
  padding: 13px 13px 11px; cursor: pointer; transition: all .15s; text-align: left;
  display: flex; flex-direction: column; gap: 4px; color: var(--text);
  font-family: var(--serif);
}
.me-tile:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.me-tile .me-sumerian { font-family: var(--mono); font-size: 9.5px; color: var(--ember); letter-spacing: 0.14em; }
.me-tile .me-name { font-family: var(--display); font-size: 13.5px; font-weight: 600; letter-spacing: 0.02em; }
.me-tile .me-cat { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); margin-top: 2px; }
.me-tile.linked { border-color: rgba(201, 169, 110, 0.55); background: linear-gradient(150deg, rgba(201, 169, 110, 0.12), var(--bg-elev)); }
.me-tile.linked .me-cat { color: var(--gold); }
.me-tile[hidden] { display: none; }

/* modal */
.modal-veil {
  position: fixed; inset: 0; z-index: 90; background: rgba(5, 3, 1, 0.72);
  backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 22px;
}
.modal {
  width: min(620px, 100%); max-height: 84vh; overflow: auto;
  background: linear-gradient(170deg, var(--clay), var(--bg-elev));
  border: 1px solid var(--line-strong); border-radius: 16px; padding: 28px 30px;
  box-shadow: var(--shadow);
}
.modal h3 { font-family: var(--display); margin: 4px 0 2px; font-size: 22px; letter-spacing: 0.05em; }
.modal .me-sumerian { font-family: var(--mono); color: var(--ember); font-size: 11px; letter-spacing: 0.2em; }
.modal .modal-row { margin-top: 16px; }
.modal .modal-row h4 {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-faint); margin: 0 0 5px;
}
.modal .modal-row p { margin: 0; line-height: 1.7; color: var(--text-dim); font-size: 14.5px; }
.modal .vol-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.modal .vol-chip {
  font-family: var(--mono); font-size: 10px; border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 10px; color: var(--text-dim);
}
.modal .vol-chip.live { border-color: var(--ok); color: var(--ok); }
.modal-close { float: right; }

/* ---------- integrity panel ---------- */
.integrity {
  border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px;
  background: var(--bg-elev); display: grid; gap: 8px;
}
.integrity .row { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.integrity .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-faint); min-width: 150px; }
.integrity .v { font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); word-break: break-all; }
.integrity .v.ok { color: var(--ok); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 60px; padding: 36px 24px 46px;
  text-align: center; color: var(--text-faint); font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em;
}
.site-footer a { color: var(--text-dim); }

/* ============================================================
   READER
   ============================================================ */
.reader-shell { display: flex; min-height: 100vh; }

.toc-rail {
  width: 304px; flex-shrink: 0; position: sticky; top: 55px; height: calc(100vh - 55px);
  overflow-y: auto; border-right: 1px solid var(--line); padding: 18px 10px 60px 16px;
  scrollbar-width: thin; background: color-mix(in srgb, var(--bg-elev) 55%, transparent);
}
.toc-rail h2 {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--text-faint); margin: 8px 8px 12px;
}
.toc-part { margin-bottom: 2px; }
.toc-part > button {
  display: flex; width: 100%; text-align: left; gap: 8px; align-items: baseline;
  background: none; border: 0; cursor: pointer; padding: 7px 8px; border-radius: 8px;
  font-family: var(--serif); font-size: 12.5px; font-weight: 600; color: var(--text-dim);
  letter-spacing: 0.02em; line-height: 1.4;
}
.toc-part > button:hover { color: var(--gold-bright); background: rgba(201, 169, 110, 0.06); }
.toc-part > button .tw { transition: transform .18s; display: inline-block; font-size: 9px; color: var(--text-faint); flex-shrink: 0; }
.toc-part.open > button .tw { transform: rotate(90deg); }
.toc-part.current > button { color: var(--gold); }
.toc-children { display: none; margin: 1px 0 6px 18px; border-left: 1px solid var(--line); }
.toc-part.open .toc-children { display: block; }
.toc-children a {
  display: block; padding: 5px 10px; font-size: 12px; color: var(--text-dim);
  line-height: 1.45; border-left: 2px solid transparent; margin-left: -1.5px;
}
.toc-children a:hover { color: var(--gold-bright); }
.toc-children a.current { color: var(--gold); border-left-color: var(--gold); }

.reader-main { flex: 1; min-width: 0; }
.reader-article {
  max-width: var(--reader-width); margin: 0 auto; padding: 44px 30px 120px;
  font-size: var(--reader-size); line-height: 1.78;
}

/* the unaltered text */
.reader-article h1 {
  font-family: var(--display); font-size: 1.9em; line-height: 1.25; letter-spacing: 0.04em;
  margin: 0.4em 0 0.6em; font-weight: 700;
}
.reader-article h2 {
  font-family: var(--display); font-size: 1.42em; line-height: 1.3; letter-spacing: 0.05em;
  margin: 2.4em 0 0.7em; font-weight: 600; color: var(--gold-bright);
  padding-top: 1.2em; border-top: 1px solid var(--line);
}
.reader-article h3 {
  font-family: var(--display); font-size: 1.14em; letter-spacing: 0.03em;
  margin: 2em 0 0.6em; font-weight: 600;
}
.reader-article h4 {
  font-family: var(--serif); font-size: 1em; letter-spacing: 0.01em;
  margin: 1.7em 0 0.5em; font-weight: 700; color: var(--gold);
}
.reader-article p { margin: 0.85em 0; }
.reader-article hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em auto; width: 58%; }
.reader-article ul, .reader-article ol { padding-left: 1.5em; margin: 0.85em 0; }
.reader-article li { margin: 0.34em 0; }
.reader-article li::marker { color: var(--gold); font-family: var(--mono); font-size: 0.86em; }
.reader-article .li-cont { color: var(--text-dim); margin-top: 0.25em; }
.reader-article blockquote {
  margin: 1.6em 0; padding: 1.1em 1.5em; border-left: 3px solid var(--gold);
  background: rgba(201, 169, 110, 0.06); border-radius: 0 12px 12px 0;
  font-family: var(--quote); font-size: 1.12em; line-height: 1.7; font-style: italic;
}
.reader-article blockquote p { margin: 0.5em 0; }
.reader-article pre.ascii-figure {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; overflow-x: auto; font-family: var(--mono); font-size: 0.74em; line-height: 1.55;
  color: var(--text-dim);
}
.reader-article code { font-family: var(--mono); font-size: 0.88em; }
.reader-article strong { color: color-mix(in srgb, var(--text) 88%, var(--gold-bright)); font-weight: 700; }

.table-scroll { overflow-x: auto; margin: 1.4em 0; border: 1px solid var(--line); border-radius: 12px; }
.reader-article table { border-collapse: collapse; width: 100%; font-size: 0.86em; line-height: 1.5; }
.reader-article th {
  font-family: var(--mono); font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.08em;
  text-align: left; color: var(--gold); background: var(--bg-elev);
  padding: 10px 13px; border-bottom: 1px solid var(--line-strong); position: sticky; top: 0;
}
.reader-article td { padding: 8.5px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
.reader-article tbody tr:last-child td { border-bottom: 0; }
.reader-article tbody tr:nth-child(odd) { background: rgba(201, 169, 110, 0.025); }

ol.references { padding-left: 0; list-style: none; }
ol.references li { margin: 0.7em 0; padding-left: 3.2em; text-indent: -3.2em; font-size: 0.92em; color: var(--text-dim); }
ol.references .ref-marker { font-family: var(--mono); color: var(--gold); }

/* ---------- plates (added illustrations) ---------- */
figure.plate {
  margin: 1.9em 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: var(--bg-elev);
}
.plate-stage { position: relative; }
.plate-stage img, .plate-stage svg { display: block; width: 100%; height: auto; }
.plate-stage img { cursor: zoom-in; }
.plate-stage svg text { font-family: var(--mono); }

/* vector plates — real academic technical plates on a parchment ground,
   inserted into the dark page like a tipped-in engraving */
figure.plate-vector { box-shadow: 0 10px 34px rgba(0,0,0,0.45); border-color: var(--line-strong); }
figure.plate-vector .plate-stage svg.plate-vector { width: 100%; height: auto; }
figure.plate-schematic { outline: 1px dashed var(--line-strong); outline-offset: 3px; }
figure.plate-schematic .plate-stage { opacity: 0.97; }
figure.plate figcaption { padding: 13px 18px 15px; border-top: 1px solid var(--line); }
figure.plate .cap-title { font-family: var(--display); font-size: 0.82em; letter-spacing: 0.06em; font-weight: 600; color: var(--gold-bright); }
figure.plate .cap-desc { font-size: 0.78em; line-height: 1.6; color: var(--text-dim); margin-top: 4px; }
figure.plate .cap-meta {
  display: flex; gap: 14px; align-items: center; margin-top: 9px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 0.62em; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint);
}
figure.plate .cap-meta a { color: var(--text-dim); border-bottom: 1px dotted var(--line-strong); }
figure.plate .cap-meta .added-mark { color: var(--ember); }

.hotspot-dot {
  position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border-radius: 50%; cursor: pointer; border: 0; padding: 0; background: transparent; z-index: 3;
}
.hotspot-dot::before {
  content: ""; position: absolute; inset: 5px; border-radius: 50%;
  background: var(--hs-color, var(--gold)); box-shadow: 0 0 0 2px rgba(0,0,0,0.45);
}
.hotspot-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid var(--hs-color, var(--gold)); opacity: 0.8;
  animation: hs-pulse 2.2s ease-out infinite;
}
@keyframes hs-pulse {
  0% { transform: scale(0.55); opacity: 0.9; }
  70% { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}
.hotspot-card {
  position: absolute; z-index: 5; width: min(250px, 60vw);
  background: var(--clay-deep); border: 1px solid var(--line-strong); border-radius: 11px;
  padding: 11px 13px; box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.55;
}
.hotspot-card .hs-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-bright); display: block; margin-bottom: 4px; }
.hotspot-card .hs-desc { color: var(--text-dim); }

/* lens = my supplemental interactive aids */
.lens {
  margin: 1.9em 0; border: 1px dashed var(--line-strong); border-radius: 16px;
  padding: 18px 20px 20px; background: linear-gradient(165deg, rgba(111,159,206,0.05), var(--bg-elev));
}
.lens .lens-tag {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--lapis); display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.lens .lens-title { font-family: var(--display); font-size: 0.95em; font-weight: 600; letter-spacing: 0.04em; margin-bottom: 10px; }
.lens-note { font-size: 0.72em; font-family: var(--mono); color: var(--text-faint); margin-top: 10px; letter-spacing: 0.06em; }
.heat-slider { width: 100%; accent-color: var(--ember); margin: 12px 0 4px; }
.heat-readout { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.heat-swatch { width: 74px; height: 74px; border-radius: 12px; border: 1px solid var(--line-strong); flex-shrink: 0; transition: background .1s, box-shadow .2s; }
.heat-data { font-family: var(--mono); font-size: 12px; line-height: 1.9; color: var(--text-dim); }
.heat-data .big { font-size: 17px; color: var(--text); }
.wl-depth { position: relative; width: 74px; height: 110px; border-radius: 10px; border: 1px solid var(--line-strong); background: linear-gradient(var(--bg-elev), #2a1a10); overflow: hidden; flex-shrink: 0; display: flex; align-items: flex-start; justify-content: center; }
.wl-depth .wl-fill { position: absolute; top: 0; left: 0; right: 0; height: 100%; transition: height .15s, background .15s; opacity: 0.5; }
.wl-depth .wl-skin { position: relative; z-index: 1; font-family: var(--mono); font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); padding-top: 3px; }

/* king list lens rows */
.king-row { display: grid; grid-template-columns: 150px 1fr 150px; gap: 12px; align-items: center; margin: 7px 0; }
.king-row .king-name { font-family: var(--mono); font-size: 11px; color: var(--text); line-height: 1.4; }
.king-row .king-name em { display: block; font-style: normal; font-size: 9.5px; color: var(--text-faint); letter-spacing: 0.08em; }
.king-row .king-bar { height: 13px; border-radius: 7px; background: rgba(201, 169, 110, 0.08); overflow: hidden; border: 1px solid var(--line); }
.king-row .king-bar span { display: block; height: 100%; min-width: 2px; border-radius: 7px; background: linear-gradient(90deg, #8a6a35, var(--gold), var(--ember)); }
.king-row .king-years { font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); text-align: right; white-space: nowrap; }
.king-row.human .king-bar span { background: var(--lapis); }
.king-row.human .king-name, .king-row.human .king-years { color: var(--lapis); }
@media (max-width: 700px) {
  .king-row { grid-template-columns: 105px 1fr 92px; gap: 8px; }
  .king-row .king-years { font-size: 8.5px; }
}

figure.plate.plate-missing { border-style: dashed; opacity: 0.85; }
figure.plate.plate-missing figcaption { border-top: 0; }

/* dilution lens */
.dilution-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; margin: 4px 0 6px; }
.dilution-grid label { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); }
.dilution-grid .dil-input { display: flex; align-items: center; gap: 7px; font-family: var(--serif); font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--text-dim); }
.dilution-grid input, .dilution-grid select {
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text);
  font-family: var(--mono); font-size: 13px; padding: 8px 10px; width: 100%;
}
.dilution-grid input { width: 84px; }
.dilution-grid select { cursor: pointer; }
.dil-readout { margin-top: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(201,169,110,0.05); }
.dil-big { font-family: var(--display); font-size: 30px; color: var(--gold-bright); font-weight: 700; }
.dil-unit { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.dil-sub { display: block; margin-top: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }
@media (max-width: 700px) { .dilution-grid { grid-template-columns: 1fr; gap: 12px; } }
.dilution-grid.slab-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .dilution-grid.slab-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .dilution-grid.slab-grid { grid-template-columns: 1fr; } }

/* HTMA ratio gauge */
.htma-row { display: grid; grid-template-columns: 230px 1fr 168px; gap: 14px; align-items: center; margin: 11px 0; }
.htma-row label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--serif); font-size: 13.5px; color: var(--text); }
.htma-row label input {
  width: 70px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 7px;
  color: var(--text); font-family: var(--mono); font-size: 12.5px; padding: 5px 7px; text-align: right;
}
.htma-track { position: relative; height: 14px; border-radius: 7px; background: rgba(201,169,110,0.07); border: 1px solid var(--line); }
.htma-band { position: absolute; top: -1px; bottom: -1px; background: rgba(127,174,106,0.28); border: 1px solid var(--ok); border-radius: 5px; }
.htma-marker { position: absolute; top: 50%; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 0 2px rgba(0,0,0,0.5); }
.htma-row.out-band .htma-marker { background: var(--ember); }
.htma-verdict { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); text-align: right; }
.htma-row.in-band .htma-verdict { color: var(--ok); }
.htma-row.out-band .htma-verdict { color: var(--ember); }
@media (max-width: 700px) {
  .htma-row { grid-template-columns: 1fr; gap: 6px; }
  .htma-verdict { text-align: left; }
}

/* milestone tracker */
.ms-agectl { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.ms-agectl input[type=range] { flex: 1; accent-color: var(--lapis); }
.ms-agectl strong { color: var(--lapis); font-size: 12px; min-width: 80px; text-align: right; }
.ms-row { display: grid; grid-template-columns: 150px 1fr 180px; gap: 12px; align-items: center; margin: 7px 0; opacity: 0.5; transition: opacity .15s; }
.ms-row.ms-now { opacity: 1; }
.ms-row.ms-done { opacity: 0.7; }
.ms-name { font-family: var(--serif); font-size: 12.5px; color: var(--text); line-height: 1.3; }
.ms-name em { display: block; font-style: normal; font-family: var(--mono); font-size: 9px; color: var(--text-faint); letter-spacing: 0.06em; }
.ms-track { position: relative; height: 12px; border-radius: 6px; background: rgba(111,159,206,0.08); border: 1px solid var(--line); }
.ms-band { position: absolute; top: -1px; bottom: -1px; border-radius: 5px; background: rgba(111,159,206,0.3); border: 1px solid var(--lapis); }
.ms-row.ms-now .ms-band { background: rgba(127,174,106,0.4); border-color: var(--ok); }
.ms-age-marker { position: absolute; top: 50%; width: 3px; height: 20px; margin: -10px 0 0 -1.5px; background: var(--gold-bright); border-radius: 2px; box-shadow: 0 0 5px rgba(0,0,0,0.5); }
.ms-act { font-family: var(--mono); font-size: 9.5px; color: var(--text-dim); line-height: 1.4; }
.ms-row.ms-now .ms-name em { color: var(--ok); }
@media (max-width: 700px) { .ms-row { grid-template-columns: 1fr; gap: 3px; } .ms-act { display: none; } }

/* forthcoming plate — art-direction slot for the expansion volumes (art pass pending) */
figure.plate-pending { background: linear-gradient(160deg, rgba(111,159,206,0.05), var(--bg-elev)); border-style: dashed; }
.plate-pending-stage {
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 30px 18px;
  background: repeating-linear-gradient(45deg, rgba(201,169,110,0.03) 0 14px, transparent 14px 28px);
  border-bottom: 1px solid var(--line);
}
.plate-pending-stage .pp-glyph { font-size: 22px; color: var(--gold); opacity: 0.7; }
.plate-pending-stage .pp-kind { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-faint); }
figure.plate-pending .cap-meta .pp-id { font-family: var(--mono); font-size: 0.6em; color: var(--text-faint); letter-spacing: 0.1em; }
.plate-brief { margin-top: 9px; }
.plate-brief summary { font-family: var(--mono); font-size: 0.62em; letter-spacing: 0.14em; text-transform: uppercase; color: var(--lapis); cursor: pointer; }
.plate-brief > div { font-size: 0.8em; line-height: 1.6; color: var(--text-dim); margin-top: 7px; padding-left: 10px; border-left: 2px solid var(--line); }
a.me-seal { text-decoration: none; transition: border-color .15s, color .15s; }
a.me-seal:hover { border-color: var(--gold); color: var(--gold-bright); }
.me-seal-vol { color: var(--gold); }
.me-seal-vol span { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; }
figure.plate-created .recreated-mark { color: var(--lapis); }

/* painted covers: scene image + authored gilt SVG frame overlay */
.cover-framed { position: relative; display: block; border-radius: 9px; overflow: hidden; }
.cover-framed .vol-cover { display: block; width: 100%; aspect-ratio: 5/3; object-fit: cover; border: 0; border-radius: 9px; }
.cover-framed .cover-frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.plate-stage .cover-framed .vol-cover { aspect-ratio: auto; }

/* ============================================================
   THE WORKING LIBRARY — sovereignty module cards
   ============================================================ */
.mod-card { border-left: 3px solid var(--mod-accent, var(--gold)); }
.mod-card .vol-num { color: color-mix(in srgb, var(--mod-accent, var(--gold)) 70%, var(--text-dim)); }
.mod-card:hover { transform: translateY(-2px); border-color: var(--mod-accent, var(--gold)); }
.mod-seal { width: 100%; aspect-ratio: 5/3; border-radius: 9px; display: block; background: var(--bg-elev); }
.mod-cover-art { width: 100%; aspect-ratio: 5/3; border-radius: 9px; display: block; }
.mod-card-created:hover .mod-cover-art { filter: brightness(1.08); }

/* created cover as reader frontispiece */
figure.plate-created .plate-stage .mod-cover-art { width: 100%; height: auto; }
.recreated-mark { color: var(--lapis); }
figure.plate-recreated { border-color: color-mix(in srgb, var(--lapis) 40%, var(--line)); }
figure.plate-recreated .plate-stage { background: var(--bg-elev); padding: 4px; }
figure.plate-recreated .diagram-svg { width: 100%; height: auto; display: block; }

/* mission map */
.lens.mission-map { border-style: solid; border-color: var(--line); }
.mission-map svg a { cursor: pointer; }
.mission-map svg a:hover circle { fill: var(--clay-deep); stroke-width: 3; }
.mission-map svg a:hover text { fill: var(--gold-bright); }
.mod-cat { border-top: 1px solid var(--line); }
.mod-cat .me-seal-strip { margin: 10px 0 4px; }
.hero-actions .chip { text-decoration: none; }

/* ============================================================
   THE DIVINE SPARK — secret entrance to Volume 0 (the Crown)
   "The light shines in the darkness" — faint, brightest in dark mode,
   found only by the attentive eye.
   ============================================================ */
.hero-art { position: relative; }
.divine-spark {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: 30px; height: 30px; border: 0; padding: 0; background: transparent;
  cursor: default; z-index: 4; -webkit-tap-highlight-color: transparent;
  border-radius: 50%;
}
.divine-spark::before {
  content: ""; position: absolute; inset: 12px; border-radius: 50%;
  background: radial-gradient(circle, #fff6e0 0%, #e9cd92 40%, rgba(217,122,50,0.5) 70%, transparent 100%);
  opacity: 0.10; transition: opacity .6s ease;
  animation: spark-breathe 6s ease-in-out infinite;
}
[data-theme="dark"] .divine-spark::before { opacity: 0.16; }
.divine-spark:hover { cursor: pointer; }
.divine-spark:hover::before { opacity: 0.95; box-shadow: 0 0 18px 5px rgba(233,205,146,0.55); }
.divine-spark:focus-visible { outline: none; }
.divine-spark:focus-visible::before { opacity: 0.9; }
@keyframes spark-breathe { 0%,100% { transform: scale(0.8); } 50% { transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .divine-spark::before { animation: none; } }

/* the whisper that surfaces on hover */
.spark-whisper {
  position: absolute; left: 50%; top: calc(46% + 26px); transform: translateX(-50%);
  font-family: var(--quote); font-style: italic; font-size: 14px; color: var(--gold-bright);
  white-space: nowrap; opacity: 0; transition: opacity .5s ease; pointer-events: none; z-index: 5;
  text-shadow: 0 0 12px rgba(0,0,0,0.7);
}
.hero-art:hover .spark-whisper { opacity: 0.92; }

/* the flare: light overflows the tablet when the spark is kindled */
.spark-flare {
  position: fixed; inset: 0; z-index: 200; pointer-events: none;
  background: radial-gradient(circle at var(--fx, 50%) var(--fy, 46%), rgba(255,247,224,0.95), rgba(233,205,146,0.6) 18%, rgba(217,122,50,0.25) 38%, transparent 70%);
  opacity: 0; animation: flare 1900ms ease-out forwards;
}
@keyframes flare {
  0% { opacity: 0; transform: scale(0.2); }
  22% { opacity: 1; }
  100% { opacity: 0; transform: scale(2.4); }
}

/* the Crown card, revealed at the front of the shelf */
.vol-card.crown {
  border-color: var(--gold); background:
    radial-gradient(420px 200px at 80% -30%, rgba(233,205,146,0.22), transparent 70%),
    linear-gradient(160deg, #15100a, #0c0a07);
  box-shadow: 0 0 0 1px var(--gold), 0 0 40px rgba(233,205,146,0.18), var(--shadow);
  position: relative; overflow: hidden;
}
.vol-card.crown .vol-num { color: var(--gold); }
.vol-card.crown .vol-tag { color: var(--gold-bright); }
.vol-card.crown.just-revealed { animation: crown-rise 1200ms cubic-bezier(.2,.7,.2,1) both; }
@keyframes crown-rise { 0% { opacity: 0; transform: translateY(14px) scale(.96); } 100% { opacity: 1; transform: none; } }
.crown-sigil { position: absolute; top: 12px; right: 14px; font-size: 15px; color: var(--gold-bright); opacity: 0.85; }

.spark-toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 80;
  background: linear-gradient(160deg, #1a130c, #0c0a07); border: 1px solid var(--gold);
  border-radius: 13px; padding: 14px 20px; box-shadow: 0 0 30px rgba(233,205,146,0.25), var(--shadow);
  font-family: var(--quote); font-style: italic; font-size: 15.5px; color: var(--gold-bright);
  display: flex; gap: 16px; align-items: center; max-width: min(92vw, 540px);
}
.spark-toast a { font-family: var(--mono); font-style: normal; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; border: 1px solid var(--gold); border-radius: 8px; padding: 7px 13px; color: var(--gold-bright); }
.spark-toast a:hover { background: rgba(233,205,146,0.12); }

/* eight logismoi ladder (Volume 0 reader lens) */
.log-strip { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; margin-bottom: 13px; }
.log-step { display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; border: 1px solid var(--line); border-radius: 9px; padding: 9px 4px; background: var(--bg-elev); color: var(--text-dim); transition: all .15s; font-family: var(--serif); }
.log-step:hover { border-color: var(--line-strong); color: var(--text); }
.log-step.log-on { border-color: var(--gold); color: var(--gold-bright); background: rgba(201,169,110,0.1); }
.log-step .log-n { font-family: var(--mono); font-size: 9px; color: var(--text-faint); }
.log-step .log-gk { font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: .02em; line-height: 1.1; text-align: center; }
.log-step .log-en { font-size: 8.5px; color: var(--text-faint); text-align: center; line-height: 1.1; }
.log-panel { display: none; font-size: 13.5px; line-height: 1.65; color: var(--text-dim); padding: 12px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-elev); }
.log-panel.log-on { display: block; }
.log-panel strong { color: var(--gold-bright); }
@media (max-width: 640px) { .log-strip { grid-template-columns: repeat(4, 1fr); } .log-step .log-en { display: none; } }

/* great work stages */
.gw-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.gw-stage { border: 1px solid var(--line-strong); border-radius: 10px; padding: 14px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; transition: transform .15s, box-shadow .15s; font-family: var(--display); opacity: 0.72; }
.gw-stage:hover { opacity: 0.92; }
.gw-stage.gw-on { opacity: 1; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
.gw-stage .gw-num { font-family: var(--mono); font-size: 9px; opacity: 0.7; }
.gw-stage .gw-name { font-size: 15px; font-weight: 700; letter-spacing: 0.05em; }
.gw-stage .gw-sub { font-family: var(--quote); font-style: italic; font-size: 10.5px; opacity: 0.85; }
.gw-panel { display: none; font-size: 13.5px; line-height: 1.65; color: var(--text-dim); padding: 12px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-elev); }
.gw-panel.gw-on { display: block; }
.gw-panel strong { color: var(--gold-bright); }
@media (max-width: 700px) { .gw-strip { grid-template-columns: 1fr 1fr; } }

/* cosmology model comparison */
.cos-head { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; }
.cos-head .cos-h-plasma { color: var(--lapis); text-align: right; }
.cos-head .cos-h-grav { color: var(--text-faint); }
.cos-row { display: block; width: 100%; text-align: left; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 6px 0; cursor: pointer; transition: border-color .15s; color: var(--text); font-family: var(--serif); }
.cos-row:hover { border-color: var(--line-strong); }
.cos-row.cos-open { border-color: var(--lapis); }
.cos-feature { font-family: var(--display); font-size: 13.5px; letter-spacing: 0.03em; color: var(--gold-bright); }
.cos-vs { display: none; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.cos-row.cos-open .cos-vs { display: grid; }
.cos-vs .cos-plasma { font-size: 12.5px; color: var(--text); border-left: 2px solid var(--lapis); padding-left: 10px; line-height: 1.5; }
.cos-vs .cos-grav { font-size: 12.5px; color: var(--text-dim); border-left: 2px solid var(--line-strong); padding-left: 10px; line-height: 1.5; }
@media (max-width: 700px) { .cos-vs { grid-template-columns: 1fr; gap: 8px; } }

/* mediation timeline */
.med-bar { display: flex; height: 26px; border-radius: 7px; overflow: hidden; border: 1px solid var(--line-strong); margin-bottom: 14px; }
.med-seg { height: 100%; }
.med-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px 12px; align-items: center; margin: 6px 0; }
.med-row .med-dot { width: 11px; height: 11px; border-radius: 50%; }
.med-row .med-name { font-family: var(--serif); font-size: 13.5px; color: var(--text); }
.med-row .med-min { font-family: var(--mono); font-size: 11px; color: var(--gold); text-align: right; }
.med-row .med-obj { grid-column: 2 / -1; font-family: var(--mono); font-size: 10px; color: var(--text-dim); margin-top: -3px; }

/* breath pacer */
.breath-stage { display: flex; justify-content: center; align-items: center; height: 220px; }
.breath-orb { width: 120px; height: 120px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle at 38% 32%, var(--lapis), #2a4d6e); box-shadow: 0 0 50px rgba(111,159,206,0.4); color: #eaf2fa; transform: scale(1); }
.breath-orb #breath-word { font-family: var(--display); font-size: 17px; letter-spacing: 0.08em; }
.breath-orb #breath-count { font-family: var(--mono); font-size: 13px; opacity: 0.8; margin-top: 3px; }
.breath-controls { display: flex; align-items: center; gap: 16px; justify-content: center; margin-top: 8px; }
.breath-controls .breath-tally { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--text-faint); }

/* companion planting guide */
.companion-pick { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; }
.companion-pick select { background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); font-family: var(--serif); font-size: 15px; padding: 8px 12px; cursor: pointer; text-transform: none; letter-spacing: 0; }
.companion-out { display: flex; flex-direction: column; gap: 8px; }
.comp-row { display: grid; grid-template-columns: 130px 78px 1fr; gap: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-elev); }
.comp-row .comp-partner { font-family: var(--display); font-size: 14.5px; color: var(--gold-bright); }
.comp-row .comp-level { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; text-align: center; padding: 3px 0; border-radius: 6px; }
.comp-row.comp-high .comp-level { color: var(--ok); border: 1px solid var(--ok); }
.comp-row.comp-mod .comp-level { color: var(--gold); border: 1px solid var(--line-strong); }
.comp-row .comp-note { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }
@media (max-width: 700px) {
  .comp-row { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .comp-row .comp-note { grid-column: 1 / -1; }
}

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(4, 2, 0, 0.9);
  display: flex; align-items: center; justify-content: center; padding: 28px; cursor: zoom-out;
}
.lightbox img { max-width: 96vw; max-height: 88vh; border-radius: 8px; box-shadow: var(--shadow); }
.lightbox .lb-cap {
  position: absolute; bottom: 16px; left: 0; right: 0; text-align: center;
  font-family: var(--mono); font-size: 11px; color: var(--text-dim); letter-spacing: 0.08em;
}

/* reader chrome */
.reader-topbar { display: flex; align-items: center; gap: 9px; }
.reader-title-mini { font-family: var(--display); font-size: 12.5px; letter-spacing: 0.12em; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frontispiece { margin: 1.4em 0 2em; }
.me-seal-strip {
  display: flex; gap: 10px; flex-wrap: wrap; margin: 1.4em 0 0.4em;
}
.me-seal {
  display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--line);
  border-radius: 99px; padding: 7px 15px 7px 9px; background: var(--bg-elev);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; color: var(--text-dim);
}
.me-seal .seal-dot { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--gold-bright), #7a5c2b); display: inline-flex; align-items: center; justify-content: center; color: #1a1208; font-size: 9px; font-weight: 700; }
.me-seal b { color: var(--gold); font-weight: 600; }

.chapter-nav { display: flex; gap: 12px; justify-content: space-between; margin-top: 60px; }
.chapter-nav a {
  flex: 1; border: 1px solid var(--line); border-radius: 13px; padding: 15px 18px;
  display: flex; flex-direction: column; gap: 4px; max-width: 47%;
}
.chapter-nav a:hover { border-color: var(--line-strong); }
.chapter-nav .dir { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-faint); }
.chapter-nav .ttl { font-family: var(--display); font-size: 13.5px; line-height: 1.4; }
.chapter-nav a.next { text-align: right; margin-left: auto; }

.continue-toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 70;
  background: var(--clay-deep); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 12px 18px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow);
  font-size: 13.5px; width: max-content; max-width: min(92vw, 520px);
}
.continue-toast span { min-width: 0; }
.continue-toast button { white-space: nowrap; }

/* Parts render eagerly: with content-visibility's estimated heights,
   anchor jumps, scroll-spy and the progress bar all drift in a
   500k-character document. Images remain lazy; full layout measured
   ~ sub-second on desktop. */

@media (max-width: 1020px) {
  .toc-rail {
    position: fixed; left: 0; top: 55px; bottom: 0; height: auto; z-index: 55;
    background: var(--bg); transform: translateX(-105%); transition: transform .22s; width: min(320px, 88vw);
    border-right: 1px solid var(--line-strong); box-shadow: var(--shadow);
  }
  body.toc-open .toc-rail { transform: none; }
  .hero { grid-template-columns: 1fr; padding-top: 44px; }
  .hero-art { order: -1; max-width: 250px; margin: 0 auto; }
  .chapter-nav a { max-width: none; }
}

@media (max-width: 700px) {
  .site-header { padding: 8px 10px; gap: 7px; }
  .brand .brand-name { font-size: 12.5px; letter-spacing: 0.16em; white-space: nowrap; }
  .brand .brand-sub, .reader-title-mini { display: none; }
  .icon-btn { width: 31px; height: 31px; }
  .reader-article { padding: 28px 18px 90px; }
  .hero { padding-top: 30px; }
  .stat-row { gap: 18px; }
}

@media print {
  .site-header, .toc-rail, .progress-track, .continue-toast, .chapter-nav, .icon-btn { display: none !important; }
  body { background: #fff; color: #111; }
  .reader-article { max-width: none; padding: 0; font-size: 11pt; }
  figure.plate { break-inside: avoid; }
}


/* ---- painted plates: art pass, June 2026 (additive) -------------------
   Painted base layer (generated, text-free) + crisp vector annotation
   overlay typeset by tools/lib-painted.mjs. The title block + chips use
   the vector plates' parchment so the two plate families read as one
   bound collection. */
figure.plate-painted .plate-stage { background: #15110b; }
.plate-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.plate-overlay text { font-family: var(--mono); }
.plate-titleblock {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding: 7px 16px 6px; background: #efe7d2; color: #2b2620;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  border-top: 1px solid rgba(43, 38, 32, 0.35);
}
.plate-titleblock .ptb-id { font-weight: 700; }
.plate-titleblock .ptb-marks { color: #9c3b22; text-align: right; letter-spacing: 0.1em; }
.plate-callout-key {
  display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 16px;
  background: #e9dfc6; color: #2b2620; font-family: var(--mono);
  font-size: 10.5px; line-height: 1.55; border-top: 1px dotted rgba(43, 38, 32, 0.3);
}
figure.plate-painted .cap-meta .pp-id { font-family: var(--mono); font-size: 0.6em; color: var(--text-faint); letter-spacing: 0.1em; }
@media print { .plate-overlay { display: block; } }
