/* Field guide. Palette from a deck of index cards used as conversation cue cards:
   cool white card stock, graphite ink, ballpoint blue for structure, the pale blue ruled lines as the tint,
   and the red header rule of an index card as the one accent. Night mode is the same card under a desk lamp. */
:root {
  --paper: #F5F7FA;
  --ink: #1A2230;
  --ink-soft: #505B6B;
  --rule: #D5DEE8;
  --tint: #E3EBF3;
  --tint-2: #CFDCEA;
  --deep: #24507A;
  --accent: #C8372D;
  --bad: #B42318;
  --good: #1F7A4D;
  --hi: #F2B705;
  --white: #FFFFFF;
  --body: "Barlow", system-ui, sans-serif;
  --head: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --measure: 66ch;
  --r-lg: 18px;
  --r-sm: 10px;
}
html[data-size="1"] { font-size: 112.5%; }
html[data-size="2"] { font-size: 125%; }
body.legible { --body: "Atkinson Hyperlegible", system-ui, sans-serif; --head: "Atkinson Hyperlegible", system-ui, sans-serif; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.125rem/1.6 var(--body); }
img, svg { display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
button { font: inherit; color: inherit; cursor: pointer; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: .5rem; z-index: 50; background: var(--white); padding: .5rem 1rem; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  height: 60px; padding: 0 clamp(1rem, 3vw, 2rem); background: rgba(245,247,250,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none; font: 700 1.3rem/1 var(--head); }
.bar-nav { display: flex; align-items: center; gap: .25rem; }
.bar-link { background: none; border: 0; padding: .45rem .75rem; border-radius: 999px; color: var(--ink); text-decoration: none; font: 600 1rem/1 var(--body); }
.bar-link:hover, .bar-link[aria-current="page"] { background: var(--tint); color: var(--ink); }
.bar-aa { font-family: var(--head); font-size: 1.1rem; }
.brand { white-space: nowrap; }
@media (max-width: 430px) { .brand-rest { display: none; } .bar-link { padding: .45rem .6rem; } }
@media (max-width: 400px) { .brand-word { display: none; } .topbar { gap: .5rem; } .bar-link { padding: .45rem .5rem; } }

/* ---------- sheets (chapters, options) ---------- */
.sheet { border: 0; padding: 1.25rem 1.25rem 1.5rem; width: min(560px, 100%); max-height: 86vh; border-radius: var(--r-lg);
  background: var(--paper); color: var(--ink); box-shadow: 0 20px 60px rgba(26,34,48,.28); }
.sheet::backdrop { background: rgba(26,34,48,.42); }
@media (max-width: 640px) {
  .sheet { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; }
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.sheet-head h2 { margin: 0; font: 700 1.6rem/1.1 var(--head); }
.sheet-close { background: var(--tint); border: 0; border-radius: 999px; padding: .4rem .9rem; font-weight: 600; }
.opt { display: flex; flex-direction: column; gap: .4rem; margin-top: 1rem; }
.opt > span { font-weight: 600; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--tint); border-radius: 999px; width: fit-content; }
.seg button { border: 0; background: transparent; padding: .4rem .9rem; border-radius: 999px; font-size: .95rem; }
.seg button[aria-pressed="true"] { background: var(--white); box-shadow: 0 1px 3px rgba(26,34,48,.18); font-weight: 600; }

/* ---------- table of contents ---------- */
.toc { list-style: none; margin: 0; padding: 0; }
.toc a { display: grid; grid-template-columns: 2rem 1fr auto; align-items: baseline; gap: .25rem; padding: .55rem .5rem; border-radius: var(--r-sm);
  color: var(--ink); text-decoration: none; line-height: 1.3; }
.toc a:hover { background: var(--tint); }
.toc a[aria-current="page"] { background: var(--white); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
.toc-n { font: 700 1rem/1 var(--head); color: var(--accent); }
.done .toc-done::after, .done .cl-done::after { content: "Read"; font-size: .78rem; font-weight: 600; color: var(--good); }
.offline-status { font-size: .9rem; color: var(--ink-soft); margin: 1rem 0 0; padding-left: .75rem; border-left: 3px solid var(--good); }
.offline-status.is-offline { border-left-color: var(--hi); }

/* ---------- page shell ---------- */
.shell { display: grid; grid-template-columns: 1fr; max-width: 1240px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }
.side { display: none; }
@media (min-width: 1080px) {
  .shell { grid-template-columns: 250px minmax(0, 1fr); gap: 3.5rem; }
  .shell-wide { grid-template-columns: 1fr; }
  .side { display: block; position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 92px); overflow: auto; padding: 1.5rem 0; }
}
main { min-width: 0; padding-bottom: 3rem; }

/* ---------- type ---------- */
h1 { font: 700 clamp(2.6rem, 8vw, 4rem)/1 var(--head); letter-spacing: -.01em; margin: 0 0 .9rem; }
h2 { font: 700 1.85rem/1.1 var(--head); margin: 2.6rem 0 .8rem; }
.lede { font-size: 1.25rem; line-height: 1.5; color: var(--ink-soft); max-width: 44ch; margin: 0; }
p, li { max-width: var(--measure); }
.ch-head { padding: 2.2rem 0 1.5rem; }
.ch-num { margin: 0 0 .6rem; font: 600 1rem/1 var(--head); color: var(--accent); letter-spacing: .02em; }
.ch-meta { margin: .9rem 0 0; font-size: .95rem; color: var(--ink-soft); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .6rem 1.3rem; border-radius: 999px;
  border: 2px solid var(--ink); background: transparent; color: var(--ink); text-decoration: none; font: 600 1.05rem/1.2 var(--body); }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--deep); border-color: var(--deep); color: var(--white); }

/* ---------- stage: where every animation lives ---------- */
.stage { position: relative; border-radius: var(--r-lg); padding: clamp(.75rem, 2.5vw, 1.5rem); margin: 0 0 2rem;
  background-color: var(--tint);
  background-image: repeating-linear-gradient(180deg, rgba(36,80,122,0) 0 31px, rgba(36,80,122,.09) 31px 32px);
  box-shadow: inset 0 4px 0 var(--accent); }
.stage-title { margin: 0 0 .5rem; font: 700 1.15rem/1 var(--head); color: var(--deep); }
.stage-tabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 .75rem; background: rgba(255,255,255,.55); border-radius: 999px; width: fit-content; max-width: 100%; overflow-x: auto; }
.stage-tabs button { border: 0; background: transparent; padding: .45rem 1rem; border-radius: 999px; font-weight: 600; white-space: nowrap; color: var(--deep); }
.stage-tabs button[aria-selected="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(26,34,48,.18); }
.diagram { margin: 0; }
.diagram svg { width: 100%; max-width: 520px; height: auto; margin: 0 auto; }
.diagram figcaption { text-align: center; font-size: .92rem; color: var(--ink-soft); margin: .6rem auto 0; max-width: 56ch; }
.readout { text-align: center; margin: .7rem auto 0; min-height: 3.2em; max-width: 52ch; font-size: 1.02rem; }

/* ---------- in short ---------- */
.in-short { background: var(--white); border-radius: var(--r-lg); padding: 1.25rem 1.5rem; margin: 0 0 1rem; box-shadow: inset 0 0 0 1px var(--rule); }
.in-short h2 { margin: 0 0 .5rem; font-size: 1.35rem; }
.in-short ul { margin: 0; padding-left: 1.2rem; }
.in-short li { margin: .3rem 0; }
.in-short li::marker { color: var(--accent); }

/* ---------- prose and accordions ---------- */
.prose > h2 { scroll-margin-top: 80px; }
.prose details { border-top: 1px solid var(--rule); }
.prose details:last-of-type { border-bottom: 1px solid var(--rule); }
.prose summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem .25rem; font: 600 1.12rem/1.35 var(--body); }
.prose summary::-webkit-details-marker { display: none; }
.prose summary::after { content: ""; flex: none; width: 10px; height: 10px; border-right: 2.5px solid var(--deep); border-bottom: 2.5px solid var(--deep);
  transform: rotate(45deg) translateY(-3px); transition: transform .2s; }
.prose details[open] > summary::after { transform: rotate(-135deg) translateY(-3px); }
.prose details > :not(summary) { margin-left: .25rem; margin-right: .25rem; }
.prose details > :last-child { margin-bottom: 1.25rem; }
.prose ol, .prose ul { padding-left: 1.3rem; }
.prose li { margin-bottom: .45rem; }
.prose summary label { cursor: pointer; display: flex; align-items: center; gap: .6rem; }
.prose input[type="checkbox"] { width: 1.2rem; height: 1.2rem; accent-color: var(--good); }
.checks { list-style: none; padding-left: 0 !important; }
.checks label { display: flex; gap: .6rem; align-items: flex-start; }
.checks input { margin-top: .3rem; flex: none; }
.callout { background: var(--white); border-radius: var(--r-sm); padding: .9rem 1.1rem; box-shadow: inset 0 0 0 1px var(--rule); }
.note { color: var(--ink-soft); font-size: 1rem; background: rgba(36,80,122,.08); padding: .75rem 1rem; border-radius: var(--r-sm); }
.note.warn { background: #FBEAE8; color: var(--ink); }
.ten { padding-left: 1.4rem; }
.ten li { margin-bottom: 1rem; }
.ten li::marker { font: 700 1.1rem var(--head); color: var(--accent); }
.print-row { margin-top: 2rem; }
table { border-collapse: collapse; width: 100%; font-size: 1rem; margin: .5rem 0 1rem; display: block; overflow-x: auto; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font: 600 1rem var(--head); color: var(--ink-soft); }

/* ---------- flashcards ---------- */
.flash { background: var(--white); border-radius: var(--r-lg); padding: 1.5rem; box-shadow: inset 0 0 0 1px var(--rule); }
.flash-count { color: var(--ink-soft); font-size: .92rem; margin: 0 0 .4rem; }
.flash-q { font: 700 1.6rem/1.2 var(--head); margin: 0 0 1rem; }
.flash-a { background: var(--tint); padding: .9rem 1.1rem; border-radius: var(--r-sm); }
.flash-btns { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.flash-btns button { border: 2px solid var(--ink); background: transparent; border-radius: 999px; padding: .5rem 1.1rem; font-weight: 600; }
.flash-btns button:hover { background: var(--ink); color: var(--paper); }

/* ---------- pager ---------- */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.pager a { display: flex; flex-direction: column; gap: .2rem; text-decoration: none; color: var(--ink); font: 700 1.35rem/1.15 var(--head); padding: .75rem 0; }
.pager a span { font: 500 .9rem var(--body); color: var(--ink-soft); }
.pager a:hover { color: var(--accent); }
.pager-next { text-align: right; align-items: flex-end; }

/* ---------- home ---------- */
.hero { display: grid; gap: 1.5rem; padding: 2.2rem 0 1rem; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 3rem; padding-top: 3.5rem; } }
.hero h1 { font-size: clamp(3.2rem, 11vw, 6rem); line-height: .92; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.hero-stage { margin: 0; }
.resume { margin-top: 1.25rem; font-size: 1rem; }
.home-chapters h2 { font-size: 2.2rem; }
.chapter-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.chapter-list a { display: grid; grid-template-columns: 96px 2.2rem minmax(0, 1fr) auto; gap: .9rem; align-items: center;
  padding: .9rem .25rem; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.chapter-list a:hover { background: var(--white); }
.thumb { width: 96px; height: 66px; object-fit: cover; border-radius: var(--r-sm); background: var(--tint); }
.thumb.icon { padding: 6px 14px; }
.cl-n { font: 700 1.6rem/1 var(--head); color: var(--accent); text-align: right; }
.cl-text { display: flex; flex-direction: column; gap: .15rem; }
.cl-t { font: 700 1.35rem/1.1 var(--head); }
.cl-s { font-size: .98rem; color: var(--ink-soft); line-height: 1.35; }
.cl-a { font-size: .85rem; font-weight: 600; color: var(--deep); }
@media (max-width: 560px) {
  .chapter-list a { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .thumb { width: 72px; height: 54px; }
  .cl-n { display: none; }
}

/* ---------- gallery ---------- */
.gallery { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem 1.25rem; }
.gallery a { display: flex; flex-direction: column; gap: .3rem; color: var(--ink); text-decoration: none; }
.gallery img, .gal-blank { width: 100%; height: auto; aspect-ratio: 16 / 11; object-fit: cover; border-radius: var(--r-lg); background: var(--tint); margin-bottom: .4rem; }
.gal-t { font: 700 1.4rem/1.1 var(--head); }
.gal-d { font-size: 1rem; color: var(--ink-soft); line-height: 1.4; }
.gal-c { font-size: .88rem; font-weight: 600; color: var(--accent); }
.gallery a:hover .gal-t { color: var(--accent); }

/* ---------- footer ---------- */
.foot { max-width: 1240px; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 2.5rem) 3rem; border-top: 1px solid var(--rule); color: var(--ink-soft); font-size: .92rem; }
.signout button { border: 1px solid var(--rule); background: var(--white); border-radius: 999px; padding: .35rem .9rem; font-size: .85rem; color: var(--ink-soft); }
/* ---------- shared diagram pieces ---------- */
.svg-label { fill: var(--ink); font: 600 14px var(--body); }
.svg-small { fill: var(--ink-soft); font: 12px var(--body); }
.svg-red { fill: var(--bad); }
.svg-green { fill: var(--good); }
.svg-num-light { fill: #fff; font: 700 20px var(--head); }

/* ---------- diagram controls on the stage ---------- */
.anim-ctrl { gap: 6px; margin: .8rem 0 0; }
.anim-ctrl button { border: 0; background: rgba(255,255,255,.72); color: var(--deep); border-radius: 999px; padding: .5rem 1rem; font-weight: 600; font-size: .92rem; }
.anim-ctrl button:hover { background: var(--white); }
.anim-ctrl button[aria-pressed="true"] { background: var(--deep); color: var(--white); }
.stage .anim svg { max-width: 540px; }

/* ---------- hero without an animation ---------- */
@media (min-width: 900px) { .hero.hero-solo { grid-template-columns: minmax(0, 1fr); } }

/* ---------- night mode: the card under a desk lamp. Dark slate desk, lamp-lit card text, same red rule. ---------- */
html[data-theme="night"] {
  color-scheme: dark;
  --paper: #11151B;
  --ink: #E5EAF0;
  --ink-soft: #A3AEBB;
  --rule: #263040;
  --tint: #18202B;
  --tint-2: #202B39;
  --deep: #8DB8E8;
  --accent: #FF7D6E;
  --bad: #FF6B5E;
  --good: #5FD39A;
  --hi: #FFD23F;
  --white: #1A222D;
}
html[data-theme="night"] .topbar { background: rgba(17,21,27,.94); }
html[data-theme="night"] .sheet { box-shadow: 0 20px 60px rgba(0,0,0,.6); }
html[data-theme="night"] .sheet::backdrop { background: rgba(0,0,0,.6); }
html[data-theme="night"] .stage { background-image: repeating-linear-gradient(180deg, rgba(141,184,232,0) 0 31px, rgba(141,184,232,.06) 31px 32px); }
html[data-theme="night"] .stage-tabs { background: rgba(0,0,0,.25); }
html[data-theme="night"] .anim-ctrl button, html[data-theme="night"] .anim-ctrl select { background: rgba(255,255,255,.08); }
html[data-theme="night"] .anim-ctrl button:hover { background: rgba(255,255,255,.16); }
html[data-theme="night"] .anim-ctrl button[aria-pressed="true"] { background: var(--deep); color: var(--paper); }
html[data-theme="night"] .note { background: rgba(141,184,232,.1); }
html[data-theme="night"] .note.warn { background: rgba(255,107,94,.14); }
html[data-theme="night"] .thumb, html[data-theme="night"] .gallery img { filter: brightness(.86); }

/* ---------- brand mark and the lamp toggle (the lamp lights up in night mode) ---------- */
.bi-card { fill: var(--white); stroke: var(--ink); stroke-width: 1.4; }
.bi-red { stroke: var(--accent); stroke-width: 1.6; } .bi-blue { stroke: var(--deep); stroke-width: 1.2; opacity: .7; }
.bar-theme { display: inline-flex; align-items: center; padding: .3rem .55rem; }
.bar-theme svg { width: 24px; height: 24px; }
.lp-arm { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lp-head { fill: var(--ink); }
.lp-card { fill: var(--accent); }
.lp-glow { fill: var(--hi); opacity: 0; }
html[data-theme="night"] .lp-glow { opacity: .55; }
html[data-theme="night"] .lp-head { fill: var(--hi); }
@media (prefers-reduced-motion: no-preference) { .lp-glow, .lp-head { transition: opacity .3s, fill .3s; } }

/* ---------- chapter icons (chapters without an interactive piece) ---------- */
.ic-card { fill: var(--white); stroke: var(--ink); stroke-width: 2; }
.ic-red { stroke: var(--accent); stroke-width: 3; } .ic-blue { stroke: var(--deep); stroke-width: 2; opacity: .7; }
.ic-fill { fill: var(--accent); } .ic-fill-deep { fill: var(--deep); } .ic-dot { fill: var(--hi); }
.ic-line { fill: none; stroke: var(--white); stroke-width: 2.5; }
.ic-line-ink { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ic-glass { fill: var(--white); stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.ic-wheel { fill: var(--ink); } .ic-wheel-o { fill: none; stroke: var(--deep); stroke-width: 3; }
.ic-face { fill: var(--white); stroke: var(--ink); stroke-width: 2.5; }

/* ---------- interactive pieces: controls ---------- */
.anim-ctrl { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin: .8rem 0 0; }
.anim-ctrl select { font: 600 .92rem var(--body); color: var(--deep); background: rgba(255,255,255,.8); border: 1px solid var(--tint-2); border-radius: 999px; padding: .45rem .8rem; max-width: 100%; }
.anim-ctrl label { display: flex; align-items: center; gap: .4rem; font-size: .9rem; color: var(--ink-soft); font-weight: 600; max-width: 100%; }
.anim-ctrl button:disabled { opacity: .5; cursor: not-allowed; }
.anim-ctrl button:disabled[aria-pressed="true"], .anim-ctrl.opts button.right:disabled, .anim-ctrl.opts button.wrong:disabled { opacity: 1; }
.anim-ctrl.opts button:disabled { opacity: .7; }
.anim-ctrl.opts { flex-direction: column; align-items: stretch; max-width: 520px; margin-left: auto; margin-right: auto; }
.anim-ctrl.opts button { text-align: left; border-radius: var(--r-sm); padding: .65rem .9rem; line-height: 1.35; font-size: .98rem; color: var(--ink); }
.anim-ctrl.opts button.right { background: var(--good); color: #fff; }
.anim-ctrl.opts button.wrong { background: var(--bad); color: #fff; }
html[data-theme="night"] .anim-ctrl.opts button.right, html[data-theme="night"] .anim-ctrl.opts button.wrong { color: var(--paper); }
.readout strong { color: var(--deep); }

/* ---------- interactive pieces: SVG drawing ---------- */
.fg-card { fill: var(--white); stroke: var(--rule); stroke-width: 1.5; }
.fg-card-back { fill: var(--white); stroke: var(--tint-2); stroke-width: 1.5; }
.fg-redrule { stroke: var(--accent); stroke-width: 2; }
.fg-bluerule { stroke: var(--deep); stroke-width: 1; opacity: .22; }
.fg-topic { fill: var(--accent); font: 700 15px var(--head); letter-spacing: .08em; text-transform: uppercase; }
.fg-q { fill: var(--ink); font: 600 21px var(--body); }
.fg-big { fill: var(--ink); font: 700 32px var(--head); }
.fg-mid { fill: var(--ink); font: 600 19px var(--body); }
.fg-say { fill: var(--accent); font: 600 24px var(--body); }
.fg-small { fill: var(--ink-soft); font: 500 13px var(--body); }
.fg-label { fill: var(--ink); font: 700 17px var(--head); }
.fg-date { fill: var(--accent); font: 700 26px var(--head); }
.fg-chip { fill: var(--deep); }
.fg-chip-t { fill: var(--paper); font: 700 17px var(--head); letter-spacing: .03em; }
.fg-bubble { fill: var(--white); stroke: var(--deep); stroke-width: 1.6; }
.fg-rail { stroke: var(--ink-soft); stroke-width: 3; stroke-linecap: round; }
.fg-rung { stroke: var(--rule); stroke-width: 5; stroke-linecap: round; }
.fg-rung.on { stroke: var(--accent); }
.fg-pass { fill: var(--white); stroke: var(--rule); stroke-width: 1.5; }
.fg-pass.on { stroke: var(--accent); stroke-width: 3; }
.fg-pass.off { opacity: .5; }
.fg-bin { fill: var(--white); stroke: var(--tint-2); stroke-width: 1.5; }
.fg-bin.on { stroke: var(--deep); stroke-width: 3; }
.fg-label-card { fill: var(--white); stroke: var(--ink); stroke-width: 1.5; }
.fg-label-inner { fill: none; stroke: var(--ink); stroke-width: .8; opacity: .5; }
.fg-axis { stroke: var(--ink-soft); stroke-width: 1.5; }
.fg-tick { stroke: var(--ink-soft); stroke-width: 1; opacity: .5; }
.fg-ev { fill: var(--deep); stroke: var(--deep); opacity: .45; }
.fg-ev.tbc { fill: var(--white); stroke-dasharray: 3 2; stroke-width: 1.5; }
.fg-ev.on { fill: var(--accent); stroke: var(--accent); opacity: 1; }
.fg-ev.on.tbc { fill: var(--white); }
.fg-ptr { fill: var(--accent); }
.fg-bar { fill: var(--deep); opacity: .25; }
.fg-bar.live { fill: var(--accent); opacity: .85; }
.fg-stamp { fill: none; stroke: var(--accent); stroke-width: 3; }
.fg-stamp-t { fill: var(--accent); font: 700 22px var(--head); letter-spacing: .12em; }
.fg-ok { fill: var(--good); font: 700 20px var(--head); }
.fg-no { fill: var(--bad); font: 700 20px var(--head); }

@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: sheet-in .22s ease-out; }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(16px); } }
  .flash-q.pop, .flash-a:not([hidden]) { animation: pop .3s ease-out both; }
  @keyframes pop { from { opacity: 0; transform: translateY(6px); } }
  :root { interpolate-size: allow-keywords; }
  .prose details::details-content { transition: height .28s ease, content-visibility .28s allow-discrete; height: 0; overflow: clip; }
  .prose details[open]::details-content { height: auto; }
}

@media print {
  .topbar, .side, .foot, .pager, .anim-ctrl, .stage-tabs, .skip, .print-row, .watch, .flash { display: none !important; }
  body { background: #fff; font-size: 10.5pt; }
  .shell { display: block; padding: 0; }
  .stage { background: none; padding: 0; }
  .prose details { break-inside: avoid; }
  .prose summary::after { display: none; }
}

/* thumbnails: show the whole drawing, never crop it */
.gallery img, img.thumb { object-fit: contain; }
