/* ==================================================================
   CKW READING THEMES
   Two deliberate modes, not a photographic inversion:
   - Night Yard keeps the graphics and reading surfaces dark.
   - Reading Light preserves the dark illustrated stages while turning
     text-heavy surfaces into warm, low-glare paper.
   ================================================================== */
:root{
  --theme-gold:#e7bd67;
  --theme-focus:#f1c96d;
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --theme-canvas:#151119;
  --theme-canvas-2:#1b1620;
  --theme-surface:#211a25;
  --theme-surface-2:#2a2230;
  --theme-surface-3:#332a38;
  --theme-text:#f2ebe2;
  --theme-muted:#c0b4c2;
  --theme-dim:#9b8ea0;
  --theme-border:rgba(255,255,255,.12);
  --theme-ink:#f2ebe2;
  --theme-ink-muted:#c0b4c2;
  --theme-paper:#211a25;
  --theme-paper-2:#29212d;
  --theme-paper-3:#302736;
  --theme-paper-border:rgba(255,255,255,.12);
  --theme-shadow:0 24px 60px rgba(0,0,0,.34);
}
:root[data-theme="light"]{
  color-scheme:light;
  --theme-canvas:#e9dfd0;
  --theme-canvas-2:#ded1bf;
  --theme-surface:#f7efe2;
  --theme-surface-2:#eee3d2;
  --theme-surface-3:#e4d5c1;
  --theme-text:#2e252b;
  --theme-muted:#62575e;
  --theme-dim:#766b72;
  --theme-border:rgba(69,51,42,.17);
  --theme-ink:#2e252b;
  --theme-ink-muted:#62575e;
  --theme-paper:#f7efe2;
  --theme-paper-2:#eee3d2;
  --theme-paper-3:#e5d6c2;
  --theme-paper-border:rgba(69,51,42,.17);
  --theme-shadow:0 22px 54px rgba(54,40,29,.16);
}

html[data-theme] body{
  transition:background-color .2s ease,color .2s ease;
}

/* ------------------------------------------------------------------
   Shared Command strip and accessible theme control
   ------------------------------------------------------------------ */
.command-nav-inner{
  grid-template-columns:auto minmax(0,1fr) auto auto;
}
.command-theme{
  appearance:none;
  min-height:36px;
  display:inline-flex;
  align-items:center;
  gap:.55rem;
  padding:.22rem .2rem .22rem .52rem;
  border:0;
  border-left:1px solid rgba(255,255,255,.11);
  color:#b7abbc;
  background:transparent;
  cursor:pointer;
  white-space:nowrap;
  font:800 .59rem/1 ui-monospace,monospace;
  text-transform:uppercase;
  letter-spacing:.11em;
}
.command-theme-track{
  position:relative;
  width:46px;
  height:24px;
  flex:0 0 46px;
  display:block;
  border:1px solid rgba(231,189,103,.35);
  border-radius:999px;
  background:#211926;
  box-shadow:inset 0 2px 8px rgba(0,0,0,.34);
}
.command-theme-track::before,
.command-theme-track::after{
  position:absolute;
  top:50%;
  transform:translateY(-52%);
  font:700 12px/1 Georgia,serif;
  pointer-events:none;
}
.command-theme-track::before{
  content:"☾";
  left:6px;
  color:#eadbbf;
}
.command-theme-track::after{
  content:"☀";
  right:5px;
  color:#8d7c92;
  font-size:11px;
}
.command-theme-knob{
  position:absolute;
  z-index:2;
  left:3px;
  top:3px;
  width:16px;
  height:16px;
  border-radius:50%;
  background:#f2e6d3;
  box-shadow:0 2px 7px rgba(0,0,0,.36),inset 0 1px rgba(255,255,255,.75);
  transition:transform .18s ease,background .18s ease;
}
.command-theme:hover{color:#fff8ef}
.command-theme:hover .command-theme-track{border-color:rgba(231,189,103,.62)}
.command-theme:focus-visible{
  outline:2px solid var(--theme-focus);
  outline-offset:4px;
}
:root[data-theme="light"] .command-theme-knob{
  transform:translateX(22px);
  background:#f1c96d;
}
:root[data-theme="light"] .command-theme-track::before{color:#8a788d}
:root[data-theme="light"] .command-theme-track::after{color:#6d4d1f}

:root[data-theme="light"] .command-nav{
  color:#2e252b;
  background-color:rgba(247,239,226,.985);
  background-image:
    linear-gradient(180deg,rgba(255,255,255,.55),rgba(255,255,255,0) 52%),
    repeating-linear-gradient(90deg,transparent 0 39px,rgba(70,51,43,.022) 40px);
  border-bottom-color:rgba(103,74,42,.24);
  box-shadow:0 10px 26px rgba(62,43,31,.16),inset 0 -1px rgba(67,48,39,.06);
}
:root[data-theme="light"] .command-nav.is-scrolled{
  background-color:rgba(247,239,226,.995);
  box-shadow:0 8px 22px rgba(62,43,31,.2),inset 0 -1px rgba(67,48,39,.06);
}
:root[data-theme="light"] .command-brand,
:root[data-theme="light"] .command-wordmark b{color:#2f252a}
:root[data-theme="light"] .command-wordmark small{color:#756777}
:root[data-theme="light"] .command-seal .seal-ring{fill:rgba(112,78,42,.04);stroke:rgba(112,78,42,.64)}
:root[data-theme="light"] .command-seal .seal-paw{fill:#9b6a28}
:root[data-theme="light"] .command-nav nav a{color:#625662}
:root[data-theme="light"] .command-nav nav a:hover,
:root[data-theme="light"] .command-nav nav a.active{color:#2d2329}
:root[data-theme="light"] .command-theme{
  color:#655966;
  border-left-color:rgba(67,48,39,.14);
}
:root[data-theme="light"] .command-theme:hover{color:#2d2329}
:root[data-theme="light"] .command-theme-track{
  background:#dfd2c2;
  border-color:rgba(112,78,42,.28);
  box-shadow:inset 0 2px 7px rgba(70,49,34,.16);
}
:root[data-theme="light"] .classic-view-link{color:#5f535e}

/* ------------------------------------------------------------------
   Environment is invariant.
   The toggle illuminates reading surfaces; it does not replace each
   page's authored background, illustration, texture, or stage lighting.
   ------------------------------------------------------------------ */

/* HOME */
:root[data-theme="light"] .home-intro{
  color:var(--theme-text);
}
:root[data-theme="light"] .home-intro p{color:var(--theme-muted)}
:root[data-theme="light"] .home-tagline{color:#40343a !important}
:root[data-theme="light"] .home-counts{
  border-color:rgba(60,44,37,.18);
}
:root[data-theme="light"] .home-counts div{border-color:rgba(60,44,37,.13)}
:root[data-theme="light"] .home-counts span{color:#695d65}
:root[data-theme="light"] .command-footer{
  color:#695d67;
  border-color:rgba(60,44,37,.18);
}
:root[data-theme="light"] .command-footer a{color:#5c4354}
:root[data-theme="dark"] .supply-line{
  background:var(--theme-paper);
  color:var(--theme-ink);
  border:1px solid var(--theme-paper-border);
}
:root[data-theme="dark"] .supply-icons figure{
  background:var(--theme-paper-2);
  border-color:var(--theme-paper-border);
}
:root[data-theme="dark"] .home-supply-link{color:#e7bd67}

/* PORCH: paper changes, lamplit hero does not. */
:root[data-theme="dark"] .porch-hub-card,
:root[data-theme="dark"] .porch-reading{
  background:var(--theme-paper);
  color:var(--theme-ink);
  border-color:var(--theme-paper-border);
  box-shadow:var(--theme-shadow);
}
:root[data-theme="dark"] .porch-lede,
:root[data-theme="dark"] .porch-note-body,
:root[data-theme="dark"] .porch-reading-intro,
:root[data-theme="dark"] .porch-note{
  color:var(--theme-ink-muted);
}
:root[data-theme="dark"] .porch-chair-heading h2,
:root[data-theme="dark"] .porch-note h2,
:root[data-theme="dark"] .porch-note-body b{color:var(--theme-ink)}
:root[data-theme="dark"] .porch-reading-intro{
  background:linear-gradient(135deg,#2a2230,#211a25);
  border-color:var(--theme-paper-border);
}
:root[data-theme="dark"] .porch-note{
  border-color:var(--theme-paper-border);
}
:root[data-theme="dark"] .porch-note:nth-child(odd){background:rgba(255,255,255,.025)}
:root[data-theme="dark"] .porch-chair-card{
  color:var(--theme-ink);
  background:linear-gradient(155deg,color-mix(in srgb,var(--chair) 13%,#2b2330),#211a25);
  border-color:color-mix(in srgb,var(--chair) 36%,#5a4d58);
  box-shadow:0 9px 0 color-mix(in srgb,var(--chair) 16%,#17121c);
}
:root[data-theme="dark"] .porch-chair-card p{color:var(--theme-ink-muted)}
:root[data-theme="dark"] .porch-chair-card:hover{box-shadow:0 14px 0 color-mix(in srgb,var(--chair) 22%,#17121c)}
:root[data-theme="dark"] .porch-long-railing,
:root[data-theme="dark"] .porch-note-body .muster{
  color:var(--theme-ink-muted);
  background:var(--theme-paper-2);
  border-color:var(--theme-paper-border);
}
:root[data-theme="dark"] .porch-note-body .muster a{
  background:var(--theme-paper-3);
  border-color:var(--theme-paper-border);
}
:root[data-theme="dark"] .porch-copy{border-color:var(--theme-paper-border)}
:root[data-theme="dark"] .porch-copy:hover{background:var(--theme-paper-3)}

/* BESTIARY */
:root[data-theme="dark"] body.bestiary-full-page .case-desk{
  background:linear-gradient(180deg,rgba(255,255,255,.025),transparent 15%),#211a25;
  border-color:#100d13;
  color:var(--theme-ink);
  box-shadow:var(--theme-shadow);
}
:root[data-theme="dark"] .bestiary-grid,
:root[data-theme="dark"] .case-grid{color:var(--theme-ink)}
:root[data-theme="dark"] .case-index,
:root[data-theme="dark"] .bestiary-index,
:root[data-theme="dark"] .paper,
:root[data-theme="dark"] .folklore-paper,
:root[data-theme="dark"] .behavior-paper,
:root[data-theme="dark"] .boss-paper{
  background:var(--theme-paper);
  color:var(--theme-ink);
  border-color:var(--theme-paper-border);
  box-shadow:0 14px 30px rgba(0,0,0,.22);
}
:root[data-theme="dark"] .paper:nth-child(2),
:root[data-theme="dark"] .folklore-paper:nth-child(even){background:var(--theme-paper-2)}
:root[data-theme="dark"] .paper h3,
:root[data-theme="dark"] .case-index h2,
:root[data-theme="dark"] .bestiary-index h2{color:#e6b9c9}
:root[data-theme="dark"] .case-index button,
:root[data-theme="dark"] .creature-index-list button{color:var(--theme-ink-muted);border-color:var(--theme-paper-border)}
:root[data-theme="dark"] .case-index button:hover,
:root[data-theme="dark"] .case-index button.on,
:root[data-theme="dark"] .creature-index-list button:hover,
:root[data-theme="dark"] .creature-index-list button.on{background:#372837;color:var(--theme-ink)}
:root[data-theme="dark"] .stats,
:root[data-theme="dark"] .bestiary-stats{background:var(--theme-paper-border)}
:root[data-theme="dark"] .stats div,
:root[data-theme="dark"] .bestiary-stats div{background:var(--theme-paper-2);color:var(--theme-ink)}
:root[data-theme="dark"] .bestiary-ledger,
:root[data-theme="dark"] .ledger-wrap,
:root[data-theme="dark"] .bestiary-table{
  background:var(--theme-paper);
  color:var(--theme-ink);
  border-color:var(--theme-paper-border);
}
:root[data-theme="dark"] .bestiary-table td{color:var(--theme-ink-muted);border-color:var(--theme-paper-border)}
:root[data-theme="dark"] .bestiary-table tbody tr:hover td{background:var(--theme-paper-2)}
:root[data-theme="light"] body.bestiary-full-page .case-desk{box-shadow:var(--theme-shadow)}

/* ROSTER */
:root[data-theme="dark"] body.parade-page{
  background:#17121c;
  color:var(--theme-ink);
}
:root[data-theme="dark"] .parade-head,
:root[data-theme="dark"] .roster-head{
  background:#211a25;
  color:var(--theme-ink);
  border-color:var(--theme-paper-border);
}
:root[data-theme="dark"] .parade-main,
:root[data-theme="dark"] .roster-main{background:#211a25}
:root[data-theme="dark"] .rollcall,
:root[data-theme="dark"] .roster-rollcall{
  background:#1c171f;
  color:var(--theme-ink-muted);
  border-color:var(--theme-paper-border);
}
:root[data-theme="dark"] .rollcall button,
:root[data-theme="dark"] .rollcall-list button{color:var(--theme-ink-muted);border-color:var(--theme-paper-border)}
:root[data-theme="dark"] .rollcall button.on,
:root[data-theme="dark"] .rollcall-list button.on{background:#3a2a3d;color:var(--theme-ink)}
:root[data-theme="dark"] .parade-stage,
:root[data-theme="dark"] .roster-stage{
  background:linear-gradient(110deg,#2b2430 0 64%,#241d28 64% 100%);
  color:var(--theme-ink);
}
:root[data-theme="dark"] .huge-name{color:#39313b}
:root[data-theme="dark"] .cat-copy h1,
:root[data-theme="dark"] .roster-kit{color:var(--theme-ink)}
:root[data-theme="dark"] .cat-rule-card{
  background:
    linear-gradient(
      112deg,
      color-mix(in srgb,var(--rule-cat) 18%,#2b2330) 0,
      #2b2330 58%,
      #241d28 100%
    );
  border-color:color-mix(in srgb,var(--rule-cat) 46%,rgba(255,255,255,.18));
  border-left-color:color-mix(in srgb,var(--rule-cat) 72%,#e7bd67);
  color:var(--theme-ink);
  box-shadow:
    0 9px 20px rgba(0,0,0,.24),
    inset 0 1px rgba(255,255,255,.07);
}
:root[data-theme="dark"] .cat-rule-card.rule-tone-pale,
:root[data-theme="dark"] .cat-rule-card.rule-tone-deep{
  background:
    linear-gradient(
      112deg,
      color-mix(in srgb,var(--rule-cat) 18%,#2b2330) 0,
      #2b2330 58%,
      #241d28 100%
    );
  border-left-color:color-mix(in srgb,var(--rule-cat) 72%,#e7bd67);
}
:root[data-theme="dark"] .cat-rule-card::after{
  border-color:color-mix(in srgb,var(--rule-cat) 18%,transparent);
}
:root[data-theme="dark"] .cat-rule-kicker{
  border-bottom-color:color-mix(in srgb,var(--rule-cat) 30%,rgba(255,255,255,.16));
}
:root[data-theme="dark"] .cat-rule-kicker span{
  color:color-mix(in srgb,var(--rule-cat) 44%,#f1d79b);
}
:root[data-theme="dark"] .cat-rule-kicker b{color:var(--theme-muted)}
:root[data-theme="dark"] .roster-stage .cat-copy .cat-rule-card .rule{
  color:#fff9f1;
  text-shadow:0 1px 1px rgba(0,0,0,.22);
}
:root[data-theme="dark"] .ledger-rule-card{
  background:
    linear-gradient(
      110deg,
      color-mix(in srgb,var(--rule-cat) 16%,#2b2330),
      #241d28
    );
  border-color:color-mix(in srgb,var(--rule-cat) 42%,rgba(255,255,255,.18));
  border-left-color:color-mix(in srgb,var(--rule-cat) 70%,#e7bd67);
  box-shadow:0 5px 12px rgba(0,0,0,.2);
}
:root[data-theme="dark"] .ledger-rule-card.rule-tone-pale,
:root[data-theme="dark"] .ledger-rule-card.rule-tone-deep{
  border-left-color:color-mix(in srgb,var(--rule-cat) 70%,#e7bd67);
}
:root[data-theme="dark"] .ledger-rule-card>span{
  color:color-mix(in srgb,var(--rule-cat) 44%,#f1d79b);
}
:root[data-theme="dark"] .ledger-rule-card p{color:#fff9f1}
:root[data-theme="dark"] .cat-copy .lore,
:root[data-theme="dark"] .roster-head-note{color:var(--theme-ink-muted)}
:root[data-theme="dark"] .cat-mods div,
:root[data-theme="dark"] .kit-strip{border-color:var(--theme-paper-border)}
:root[data-theme="dark"] .kit-strip span,
:root[data-theme="dark"] .kit-links a{
  background:#302736;
  color:var(--theme-ink);
  border-color:var(--theme-paper-border);
}
:root[data-theme="dark"] .roster-ledger,
:root[data-theme="dark"] .roster-table-wrap{background:var(--theme-paper);color:var(--theme-ink);border-color:var(--theme-paper-border)}
:root[data-theme="dark"] .roster-table td{color:var(--theme-ink-muted);border-color:var(--theme-paper-border)}
:root[data-theme="dark"] .roster-table tbody tr:hover td{background:var(--theme-paper-2)}

/* LADDER */
:root[data-theme="dark"] .ladder-section{
  background:#211a25;
  color:var(--theme-ink);
  border-color:var(--theme-paper-border);
}
:root[data-theme="dark"] .ladder-section:nth-of-type(even){background:#261e2a}
:root[data-theme="dark"] .ladder-section-head{border-color:var(--theme-paper-border)}
:root[data-theme="dark"] .ladder-section-head h2{color:var(--theme-ink)}
:root[data-theme="dark"] .ladder-section-head>p{color:var(--theme-ink-muted)}
:root[data-theme="dark"] .ladder-panel,
:root[data-theme="dark"] .gate-card,
:root[data-theme="dark"] .starter-chain,
:root[data-theme="dark"] .unlock-chain,
:root[data-theme="dark"] .deed-card,
:root[data-theme="dark"] .ladder-ledger-panel,
:root[data-theme="dark"] .ladder-table-wrap{
  background:var(--theme-paper-2);
  color:var(--theme-ink);
  border-color:var(--theme-paper-border);
  box-shadow:0 14px 28px rgba(0,0,0,.2);
}
:root[data-theme="dark"] .ladder-panel-dark{background:#18131c}
:root[data-theme="dark"] .gate-card h3,
:root[data-theme="dark"] .starter-chain h3,
:root[data-theme="dark"] .unlock-chain h3,
:root[data-theme="dark"] .deed-card h3{color:#edc5d5}
:root[data-theme="dark"] .gate-card p,
:root[data-theme="dark"] .starter-chain p,
:root[data-theme="dark"] .unlock-chain p,
:root[data-theme="dark"] .deed-card p,
:root[data-theme="dark"] .ladder-ledger-summary,
:root[data-theme="dark"] .ladder-table td{color:var(--theme-ink-muted)}
:root[data-theme="dark"] .ladder-table td{border-color:var(--theme-paper-border)}
:root[data-theme="dark"] .ladder-table tbody tr:hover{background:var(--theme-paper-3)}
:root[data-theme="dark"] .ladder-table .row-peek{color:#edc5d5}

/* ARMORY + PROVISIONS */
:root[data-theme="dark"] .workbench.armory-full,
:root[data-theme="dark"] .provisions-full .bench-grid{
  background:linear-gradient(180deg,rgba(255,255,255,.025),transparent 14%),#211a25;
  color:var(--theme-ink);
  border-color:var(--theme-paper-border);
  box-shadow:var(--theme-shadow);
}
:root[data-theme="dark"] .armory-full .peg-list,
:root[data-theme="dark"] .provisions-full .provision-shelf,
:root[data-theme="dark"] .schematic,
:root[data-theme="dark"] .warning,
:root[data-theme="dark"] .spec-drawer,
:root[data-theme="dark"] .spec-controls,
:root[data-theme="dark"] .spec-summary,
:root[data-theme="dark"] .spec-pager{
  background:var(--theme-paper);
  color:var(--theme-ink);
  border-color:var(--theme-paper-border);
}
:root[data-theme="dark"] .armory-full .peg-list button,
:root[data-theme="dark"] .provisions-full .provision-shelf button,
:root[data-theme="dark"] .spec-controls input,
:root[data-theme="dark"] .spec-controls select,
:root[data-theme="dark"] .spec-pager button,
:root[data-theme="dark"] .copy-link{
  background:var(--theme-paper-2);
  color:var(--theme-ink);
  border-color:var(--theme-paper-border);
}
:root[data-theme="dark"] .armory-full .peg-list button:hover,
:root[data-theme="dark"] .provisions-full .provision-shelf button:hover,
:root[data-theme="dark"] .armory-full .peg-list button.on,
:root[data-theme="dark"] .provisions-full .provision-shelf button.on{background:var(--theme-paper-3)}
:root[data-theme="dark"] .armory-full .peg-meta b,
:root[data-theme="dark"] .schematic h3,
:root[data-theme="dark"] .spec-weapon b{color:var(--theme-ink)}
:root[data-theme="dark"] .armory-full .peg-meta small,
:root[data-theme="dark"] .schematic,
:root[data-theme="dark"] .warning,
:root[data-theme="dark"] .spec-summary,
:root[data-theme="dark"] .spec-table td,
:root[data-theme="dark"] .spec-pager span{color:var(--theme-ink-muted)}
:root[data-theme="dark"] .schematic dt,
:root[data-theme="dark"] .schematic dd,
:root[data-theme="dark"] .spec-table td{border-color:var(--theme-paper-border)}
:root[data-theme="dark"] .spec-table tbody tr:hover{background:var(--theme-paper-2)}
:root[data-theme="dark"] .provisions-full .warning{background:#2c2027;color:#ddc5c7}
:root[data-theme="dark"] body.work-page .armory-full .bench-grid{
  background:
    linear-gradient(180deg,rgba(255,255,255,.025),rgba(255,255,255,0) 12%),
    linear-gradient(90deg,rgba(107,62,86,.055),transparent 20%,transparent 80%,rgba(107,62,86,.055)),
    #211a25;
  border-left-color:var(--theme-paper-border);
  border-right-color:var(--theme-paper-border);
  box-shadow:inset 0 1px rgba(255,255,255,.025),0 20px 42px rgba(0,0,0,.18);
}
:root[data-theme="light"] .workbench.armory-full,
:root[data-theme="light"] .provisions-full .bench-grid{box-shadow:var(--theme-shadow)}

/* FIELD MANUAL */
:root[data-theme="dark"] .manual-overview,
:root[data-theme="dark"] .manual-document{
  background:var(--theme-paper);
  color:var(--theme-ink);
  border-color:var(--theme-paper-border);
  box-shadow:var(--theme-shadow);
}
:root[data-theme="dark"] .manual-overview .fold-panel:nth-child(2n),
:root[data-theme="dark"] .manual-chapter:nth-of-type(even){background:rgba(255,255,255,.025)}
:root[data-theme="dark"] .manual-overview .fold-panel,
:root[data-theme="dark"] .manual-chapter,
:root[data-theme="dark"] .manual-title-sheet{border-color:var(--theme-paper-border)}
:root[data-theme="dark"] .manual-overview .fold-panel h2,
:root[data-theme="dark"] .manual-chapter .chapter-heading,
:root[data-theme="dark"] .manual-chapter strong,
:root[data-theme="dark"] .manual-chapter b{color:var(--theme-ink)}
:root[data-theme="dark"] .manual-overview .fold-panel p,
:root[data-theme="dark"] .manual-chapter,
:root[data-theme="dark"] .manual-chapter .pattern,
:root[data-theme="dark"] .manual-promise{color:var(--theme-ink-muted)}
:root[data-theme="dark"] .manual-counts span,
:root[data-theme="dark"] .margin-note,
:root[data-theme="dark"] .manual-chapter .table-wrap,
:root[data-theme="dark"] .danger-row,
:root[data-theme="dark"] .callout,
:root[data-theme="dark"] .chapter-copy{
  background:var(--theme-paper-2);
  color:var(--theme-ink);
  border-color:var(--theme-paper-border);
}
:root[data-theme="dark"] .reftable td{color:var(--theme-ink-muted);border-color:var(--theme-paper-border)}
:root[data-theme="dark"] .reftable td.num{color:var(--theme-ink)}
:root[data-theme="dark"] .reftable tbody tr:hover td{background:var(--theme-paper-3)}
:root[data-theme="dark"] .manual-overview .stat-wheel a{color:var(--theme-ink)}

/* BULLETIN BOARD */
:root[data-theme="dark"] .bulletins-card{
  background:var(--theme-paper);
  color:var(--theme-ink);
  border-color:var(--theme-paper-border);
  box-shadow:var(--theme-shadow);
}
:root[data-theme="dark"] .bulletins-card h2{color:var(--theme-ink)}
:root[data-theme="dark"] .bulletins-card-body p{color:var(--theme-ink-muted)}
:root[data-theme="dark"] .bulletins-art-group{
  background:var(--theme-paper-2);
  border-color:var(--theme-paper-border);
}
:root[data-theme="dark"] .bulletins-step{color:var(--theme-dim)}
:root[data-theme="light"] .bulletins-card{box-shadow:var(--theme-shadow)}

/* PAST THE FENCE */
:root[data-theme="dark"] .fence-document{
  background:var(--theme-paper);
  color:var(--theme-ink);
  border-color:var(--theme-paper-border);
  box-shadow:var(--theme-shadow);
}
:root[data-theme="dark"] .fence-title-sheet{
  background:linear-gradient(135deg,#2a2230,#211a25);
  border-color:var(--theme-paper-border);
}
:root[data-theme="dark"] .fence-title-sheet h2,
:root[data-theme="dark"] .fence-chapter h2{color:var(--theme-ink)}
:root[data-theme="dark"] .fence-title-sheet p,
:root[data-theme="dark"] .fence-copy-body{color:var(--theme-ink-muted)}
:root[data-theme="dark"] .fence-chapter{border-color:var(--theme-paper-border)}
:root[data-theme="dark"] .fence-chapter:nth-of-type(even){background:rgba(255,255,255,.025)}
:root[data-theme="dark"] .fence-copy{border-color:var(--theme-paper-border)}
:root[data-theme="dark"] .fence-copy:hover{background:var(--theme-paper-3)}
:root[data-theme="dark"] .altered-dial{background:var(--theme-paper-border);border-color:var(--theme-paper-border)}
:root[data-theme="dark"] .altered-dial div,
:root[data-theme="dark"] .fence-endings article{
  background:var(--theme-paper-2);
  color:var(--theme-ink-muted);
  border-color:var(--theme-paper-border);
}
:root[data-theme="dark"] .altered-dial span{color:var(--theme-ink-muted)}
:root[data-theme="dark"] .fence-endings article.held{background:#302b22}
:root[data-theme="dark"] .fence-endings h3{color:var(--theme-ink)}

/* Shared generated tables, overlays, and controls */
:root[data-theme="light"] .peek-card{
  background:#f7efe2;
  color:#2e252b;
  border-color:rgba(69,51,42,.17);
  box-shadow:0 22px 55px rgba(54,40,29,.22);
}
:root[data-theme="light"] .peek-name,
:root[data-theme="light"] .peek-stats .ps b{color:#2e252b}
:root[data-theme="light"] .peek-text,
:root[data-theme="light"] .peek-dim{color:#62575e}
:root[data-theme="light"] .peek-stats .ps,
:root[data-theme="light"] .chip{background:#e7dac7;color:#4d4148}

@media(max-width:1100px){
  .command-nav-inner{grid-template-columns:auto minmax(0,1fr) auto auto}
  .command-theme-label{display:none}
  .command-theme{padding-left:.38rem}
}
@media(max-width:820px){
  .classic-view-link{display:none}
  .command-nav-inner{grid-template-columns:auto minmax(0,1fr) auto}
}
@media(max-width:640px){
  .command-theme{border-left:0;padding-left:0}
  .command-theme-track{width:42px;flex-basis:42px}
  :root[data-theme="light"] .command-theme-knob{transform:translateX(18px)}
}
@media(prefers-reduced-motion:reduce){
  html[data-theme] body,
  .command-theme-knob{transition:none}
}

/* Bestiary's archive mat uses its own late selectors; complete the Night
   Yard conversion without disturbing the specimen stage. */
:root[data-theme="dark"] .bestiary-controls{
  background:#2a2230;
  color:var(--theme-ink);
  border-color:var(--theme-paper-border);
  box-shadow:0 12px 24px rgba(0,0,0,.22);
}
:root[data-theme="dark"] .bestiary-search,
:root[data-theme="dark"] .sort-control{color:#d9adbd}
:root[data-theme="dark"] .bestiary-search input,
:root[data-theme="dark"] .sort-control select,
:root[data-theme="dark"] .filter-clear{
  background:#211a25;
  color:var(--theme-ink);
  border-color:var(--theme-paper-border);
}
:root[data-theme="dark"] .kind-filters button,
:root[data-theme="dark"] .filter-toggle{
  background:#352b39;
  color:var(--theme-ink);
  border-color:var(--theme-paper-border);
}
:root[data-theme="dark"] .bestiary-grid{
  background:#211a25;
  border-left:1px solid var(--theme-paper-border);
  border-right:1px solid var(--theme-paper-border);
}
:root[data-theme="dark"] .bestiary-index{background:#1d1721}
:root[data-theme="dark"] .index-head,
:root[data-theme="dark"] .creature-index-row{border-color:var(--theme-paper-border)}
:root[data-theme="dark"] .creature-index-row{color:var(--theme-ink-muted)}
:root[data-theme="dark"] .creature-index-row:hover,
:root[data-theme="dark"] .creature-index-row.on{background:#382a3a;color:var(--theme-ink)}
:root[data-theme="dark"] .bestiary-notes .paper{
  background:#241c28 !important;
  color:var(--theme-ink);
  border-color:var(--theme-paper-border);
}
:root[data-theme="dark"] .bestiary-notes .folklore-paper,
:root[data-theme="dark"] .bestiary-notes .boss-paper{background:#2d2330 !important}
:root[data-theme="dark"] .bestiary-notes .paper h3{color:#e6b9c9}
:root[data-theme="dark"] .behavior-code,
:root[data-theme="dark"] .boss-lines dt,
:root[data-theme="dark"] .folklore-heading span,
:root[data-theme="dark"] .folklore-origin{color:#c99eaf}
:root[data-theme="dark"] .bestiary-ledger{
  background:#211a25;
  color:var(--theme-ink);
  border-color:#100d13;
}
:root[data-theme="dark"] .ledger-head{border-color:var(--theme-paper-border)}
:root[data-theme="dark"] .ledger-creature{color:var(--theme-ink)}
:root[data-theme="dark"] .ledger-creature small,
:root[data-theme="dark"] .ledger-notes .pattern{color:var(--theme-dim)}
:root[data-theme="dark"] .ledger-folklore{
  background:#302736;
  border-color:#b68a43;
}
:root[data-theme="dark"] .row-copy{
  background:#302736;
  color:#e6b9c9;
  border-color:var(--theme-paper-border);
}

@media(forced-colors:active){
  .command-theme{
    border:1px solid ButtonText;
    color:ButtonText;
    forced-color-adjust:auto;
  }
  .command-theme-track,
  .command-theme-knob{
    border:1px solid ButtonText;
    background:Canvas;
  }
}


/* THE GAME CARD (2026-08-03): the inspection sheet's in-game card,
   in the site's own dress. Labels muted, values judged, stat icons
   inline - the shop's grammar without the shop's chrome. */
.game-card{margin:.65rem 0 .9rem;padding:.35rem .75rem;
  border:1px solid rgba(226,182,84,.28);border-radius:10px;
  background:rgba(0,0,0,.22)}
.game-card .card-line{display:block;padding:.3rem 0;line-height:1.4;
  font-size:.92em;border-bottom:1px dashed rgba(255,255,255,.08)}
.game-card .card-line:last-child{border-bottom:0}
.game-card .card-line b{font-weight:600;opacity:.72;margin-right:.45em}
.game-card .stat-ico{width:15px;height:15px;vertical-align:-2px;margin:0 .15em}

/* judged values: the card grammar’s green gains / red costs */
.v-up{color:#8fd18f;font-weight:600}
.v-down{color:#e08a7a;font-weight:600}

/* the card's tier ribbon (2026-08-03): only the tiers that exist */
.card-tiers{display:flex;gap:6px;flex-wrap:wrap;padding:.45rem 0 .3rem;
  border-bottom:1px dashed rgba(255,255,255,.08)}
.card-tiers .chip{cursor:pointer}
.card-tiers .chip.on{background:#e2b654;color:#241d10}

/* stat grammar in the ledger's own headers (2026-08-03) */
th .th-ico{width:13px;height:13px;vertical-align:-2px;margin-right:.3em}

/* one clean header line (2026-08-03): uniform height, no wrapping;
   icons only where the badge-of-primacy law grants them */
.spec-table thead th{white-space:nowrap;vertical-align:middle;
  line-height:1.2;padding-top:.55rem;padding-bottom:.55rem}
