/* course.css — shared stylesheet for the study kit.
   White theme, book-like, print-friendly. Used by every lesson and reference doc. */

:root {
  --ink: #1c1c1c;
  --ink-soft: #4a4a4a;
  --ink-faint: #767676;
  --rule: #d9d5cd;
  --rule-dark: #b3aea3;
  --paper: #ffffff;
  --wash: #f7f6f2;
  --accent: #14508c;
  --accent-wash: #edf2f8;
  --good: #1c6b3c;
  --good-wash: #eef7f0;
  --bad: #a63a32;
  --bad-wash: #faf0ee;
  --serif: "Charter", "Bitstream Charter", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, "DejaVu Sans Mono", monospace;
  --measure: 46rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.58;
}

.wrap { max-width: var(--measure); margin: 0 auto; padding: 2.6rem 1.3rem 5rem; }

.eyebrow {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 .9rem;
}
.eyebrow a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--rule); }

h1 { font-size: 2.05rem; line-height: 1.18; font-weight: 700; margin: 0 0 .5rem; letter-spacing: -.01em; }
.subtitle { font-size: 1.12rem; color: var(--ink-soft); margin: 0 0 1.3rem; }

h2 { font-size: 1.38rem; line-height: 1.25; margin: 2.4rem 0 .7rem; font-weight: 700; }
h3 { font-size: 1.1rem; margin: 1.8rem 0 .5rem; font-weight: 700; }
h2[id], h3[id] { scroll-margin-top: 1.2rem; }
h2 .num, h3 .num { color: var(--ink-faint); font-weight: 600; margin-right: .45em; }

p { margin: 0 0 .95rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.35rem; }
li { margin-bottom: .35rem; }

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(20, 80, 140, .28); }
a:hover { border-bottom-color: var(--accent); }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.15rem;
  font-family: var(--sans);
  font-size: .8rem;
  color: var(--ink-faint);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: .55rem 0;
  margin: 0 0 1.9rem;
}
.meta b { color: var(--ink-soft); font-weight: 600; }

.win {
  border-left: 3px solid var(--accent);
  background: var(--accent-wash);
  padding: .75rem 1rem .8rem;
  margin: 0 0 1.9rem;
}
.win .label { font-family: var(--sans); font-size: .7rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: .25rem; }
.win p { margin: 0; }

.callout, .note, .tip {
  border: 1px solid var(--rule);
  background: var(--wash);
  padding: .8rem 1rem .85rem;
  margin: 1.5rem 0;
}
.callout .label, .note .label, .tip .label {
  font-family: var(--sans);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: block;
  margin-bottom: .3rem;
}
.callout p:last-child, .note p:last-child, .tip p:last-child, .callout ul:last-child { margin-bottom: 0; }
.note { background: var(--paper); }
.tip { border-left: 3px solid var(--good); }

.term { font-weight: 700; }
.src { font-family: var(--sans); font-size: .78rem; color: var(--ink-faint); }
.src a { color: var(--ink-faint); }

.fig { margin: 1.9rem 0; }
.fig svg { display: block; width: 100%; height: auto; }
.fig img { display: block; width: 100%; height: auto; }
.fig figcaption { font-family: var(--sans); font-size: .82rem; color: var(--ink-faint); margin-top: .55rem; max-width: 36rem; }
.fig svg text { font-family: var(--sans); font-size: 13px; }
.fig svg .mono { font-family: var(--mono); letter-spacing: .1em; }
.svg-ink { fill: var(--ink); }
.svg-soft { fill: var(--ink-soft); }
.svg-faint { fill: var(--ink-faint); }
.svg-accent { fill: var(--accent); }
.svg-good { fill: var(--good); }
.svg-bad { fill: var(--bad); }
.svg-rule { stroke: var(--rule-dark); }
.svg-accent-stroke { stroke: var(--accent); }
.svg-wash { fill: var(--wash); }
.svg-accent-wash { fill: var(--accent-wash); }
.svg-paper { fill: var(--paper); }

.data { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .95rem; }
.data th {
  font-family: var(--sans); font-size: .76rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-soft); text-align: left; border-bottom: 1px solid var(--rule-dark); padding: .45rem .6rem;
}
.data td { border-bottom: 1px solid var(--rule); padding: .5rem .6rem; vertical-align: top; }
.data tr:last-child td { border-bottom: 1px solid var(--rule-dark); }
.data .mono { font-family: var(--mono); font-size: .9em; }

.stream { font-family: var(--mono); font-size: .95rem; letter-spacing: .12em; line-height: 2; word-break: break-all; }
.stream .flag { background: var(--accent-wash); color: var(--accent); font-weight: 700; border-radius: 2px; padding: .05rem .12rem; }
.stream .ins { background: var(--good-wash); color: var(--good); font-weight: 700; border-radius: 2px; padding: .05rem .12rem; }
.stream .rm { background: var(--bad-wash); color: var(--bad); font-weight: 700; text-decoration: line-through; border-radius: 2px; padding: .05rem .12rem; }

.glossary { margin: 1.2rem 0 2rem; }
.glossary dt { font-weight: 700; margin-top: 1.05rem; }
.glossary dd { margin: .15rem 0 0; color: var(--ink-soft); }
.glossary dd .src { display: block; margin-top: .12rem; }
.glossary h2 { margin-top: 2.6rem; }

/* Bit boxes (used inside playback frames) */
.bitrow { display: flex; flex-wrap: wrap; gap: 3px; margin: .5rem 0; font-family: var(--mono); }
.bit {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.55rem; height: 1.75rem; border: 1px solid var(--rule); border-radius: 3px;
  background: var(--paper); font-size: .88rem;
}
.bit.flag { background: var(--accent-wash); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.bit.ins { background: var(--good-wash); border-color: var(--good); color: var(--good); font-weight: 700; }
.bit.hot { border-color: var(--bad); background: var(--bad-wash); color: var(--bad); font-weight: 700; }
.bit.par { background: var(--wash); border-color: var(--rule-dark); font-weight: 600; }
.bit.ok { background: var(--good-wash); border-color: var(--good); color: var(--good); font-weight: 700; }
.bit.res { background: var(--wash); border-color: var(--rule-dark); font-weight: 700; }
.sp1, .sp2, .sp3, .sp4 { display: inline-block; height: 1px; }
.sp1 { width: 1.59rem; }
.sp2 { width: 3.18rem; }
.sp3 { width: 4.77rem; }
.sp4 { width: 6.36rem; }
.rowlab { font-family: var(--sans); font-size: .7rem; color: var(--ink-faint); width: 2.1rem; display: inline-flex; align-items: center; flex: 0 0 auto; }
.bit.dim { opacity: .3; }
.bit.ghost { border-style: dashed; color: var(--ink-faint); }
.bit.win { border-style: dashed; border-color: var(--accent); color: var(--accent); }
.bitgap { width: .7rem; }
.flagpill {
  display: inline-flex; align-items: center; font-family: var(--mono); font-size: .72rem;
  letter-spacing: .05em; color: var(--accent); background: var(--accent-wash);
  border: 1px solid var(--accent); border-radius: 3px; padding: .3rem .5rem; white-space: nowrap;
}
details { margin: 1.4rem 0; border: 1px solid var(--rule); background: var(--paper); padding: .65rem .95rem .8rem; }
summary { font-family: var(--sans); font-size: .85rem; font-weight: 600; color: var(--accent); cursor: pointer; }
details[open] summary { margin-bottom: .55rem; }
details p:last-child { margin-bottom: 0; }
.streamlabel {
  font-family: var(--sans); font-size: .72rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-faint); margin: .95rem 0 .1rem;
}
.statebox {
  font-family: var(--sans); font-size: .82rem; color: var(--ink-soft);
  background: var(--wash); border: 1px solid var(--rule); border-radius: 3px;
  padding: .45rem .7rem; display: inline-block; margin-top: .5rem;
}

.formula { text-align: center; margin: 1.1rem 0; }
.formula .katex-display { margin: 0; }
.katex { text-transform: none; }

.tl { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem 1.4rem; margin: .6rem 0 .3rem; font-family: var(--sans); font-size: .86rem; }
.tl-s { grid-column: 1; text-align: right; color: var(--accent); }
.tl-r { grid-column: 2; text-align: left; color: var(--good); }
.tl-x { grid-column: 1 / -1; text-align: center; color: var(--bad); }
.tl-note { grid-column: 1 / -1; text-align: center; color: var(--ink-faint); font-size: .78rem; }

/* Playback widget (assets/playback.js) */
.playback { border: 1px solid var(--rule); background: var(--paper); margin: 1.9rem 0; }
.pb-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .6rem .9rem; border-bottom: 1px solid var(--rule); background: var(--wash);
}
.pb-title { font-family: var(--sans); font-size: .76rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-soft); }
.pb-count { font-family: var(--sans); font-size: .76rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pb-stage { padding: 1.1rem .95rem; min-height: 230px; }
/* Two-lane diagrams keep a readable minimum width; on a phone the stage scrolls sideways
   instead of shrinking the lane labels to nothing. */
.pb-stage { overflow-x: auto; }
.pb-frame svg.pb-timeline { min-width: 30rem; }
.pb-stage .bit { width: 1.4rem; height: 1.6rem; font-size: .82rem; }
.pb-frame svg { display: block; width: 100%; height: auto; }
.pb-frame img { display: block; width: 100%; height: auto; }
.pb-frame { display: block; }
.pb-frame + .pb-frame { margin-top: 1rem; padding-top: .9rem; border-top: 1px dashed var(--rule); }
.playback[data-pb-ready] .pb-frame { display: none; margin-top: 0; padding-top: 0; border-top: none; }
.playback[data-pb-ready] .pb-frame.is-active { display: block; animation: pb-in .22s ease; }
@keyframes pb-in { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .playback[data-pb-ready] .pb-frame.is-active { animation: none; } }
.pb-caption { font-family: var(--sans); font-size: .86rem; color: var(--ink-soft); margin: .8rem 0 0; }
.pb-controls { display: flex; gap: .5rem; align-items: center; padding: .6rem .9rem .85rem; border-top: 1px solid var(--rule); }
.pb-btn {
  font-family: var(--sans); font-size: .8rem; padding: .35rem .75rem;
  border: 1px solid var(--rule-dark); background: var(--paper); color: var(--ink);
  border-radius: 3px; cursor: pointer; white-space: nowrap;
}
.pb-btn:hover { border-color: var(--ink-soft); background: var(--wash); }
.pb-btn:disabled { opacity: .35; cursor: default; }
.pb-slider { flex: 1; min-width: 4rem; accent-color: var(--accent); cursor: pointer; }
.playback:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Playback extras: dots, speed, all-steps, legend, keyboard hint */
.pb-row { display: flex; gap: .5rem; align-items: center; padding: .55rem .9rem 0; flex-wrap: wrap; }
.pb-dots { display: flex; gap: .32rem; flex-wrap: wrap; align-items: center; flex: 1; min-width: 6rem; }
.pb-dot {
  width: .58rem; height: .58rem; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--rule-dark); background: var(--paper);
}
.pb-dot:hover { border-color: var(--accent); }
.pb-dot.is-on { background: var(--accent); border-color: var(--accent); }
.pb-side { display: flex; gap: .35rem; align-items: center; }
.pb-mini {
  font-family: var(--sans); font-size: .74rem; padding: .22rem .55rem; cursor: pointer;
  border: 1px solid var(--rule); border-radius: 3px; background: var(--paper); color: var(--ink-soft);
}
.pb-mini:hover { border-color: var(--ink-soft); color: var(--ink); background: var(--wash); }
.pb-mini[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }
.pb-hint { font-family: var(--sans); font-size: .72rem; color: var(--ink-faint); margin-left: auto; white-space: nowrap; }
.pb-legend {
  display: flex; flex-wrap: wrap; gap: .3rem .95rem; padding: .5rem .9rem 0;
  font-family: var(--sans); font-size: .72rem; color: var(--ink-faint);
}
.pb-legend .lg { display: inline-flex; align-items: center; gap: .35rem; }
.pb-legend .sw { display: inline-block; width: 1.35rem; height: .55rem; position: relative; }
.pb-legend .sw::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  border-top: 1.6px solid currentColor;
}
.pb-legend .sw::before {
  content: ""; position: absolute; right: -1px; top: 50%; transform: translateY(-50%);
  border-left: 6px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent;
}
.pb-legend .sw.loss::after { right: 45%; }
.pb-legend .sw.tick::before { display: none; }
.pb-legend .c-frame { color: var(--ink); }
.pb-legend .c-ack { color: var(--good); }
.pb-legend .c-nak { color: var(--bad); }
.pb-legend .c-lost { color: var(--ink); }
.pb-legend .c-timeout { color: var(--bad); }
/* All-steps mode: stack every frame, like the print storyboard */
.playback[data-all-steps="1"] .pb-frame { display: block !important; animation: none !important; }
.playback[data-all-steps="1"] .pb-stage { min-height: 0; }
.playback[data-all-steps="1"] .pb-frame::before {
  content: "Step " counter(pbstep); counter-increment: pbstep;
  display: block; font-family: var(--sans); font-size: .66rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: .3rem;
}
.playback[data-all-steps="1"] .pb-stage { counter-reset: pbstep; }
.playback[data-all-steps="1"] .pb-frame + .pb-frame { margin-top: 1rem; padding-top: .9rem; border-top: 1px dashed var(--rule); }
/* Diff animation: cells/events that changed since the last step pop in */
@keyframes pb-pop { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: none; } }
.pb-frame svg .is-new { animation: pb-pop .3s ease; transform-box: fill-box; transform-origin: center; }

/* Quiz widget (assets/quiz.js) */
.quiz { border: 1px solid var(--rule); margin: 1.9rem 0; }
.quiz-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .6rem .9rem; border-bottom: 1px solid var(--rule); background: var(--wash);
  font-family: var(--sans); font-size: .76rem; font-weight: 700; letter-spacing: .11em;
  text-transform: uppercase; color: var(--ink-soft);
}
.quiz-score { font-weight: 600; letter-spacing: .02em; text-transform: none; color: var(--ink-faint); white-space: nowrap; }
.quiz-body { padding: .95rem; }
.q { margin-bottom: 1.7rem; }
.q:last-child { margin-bottom: 0; }
.q-text { font-weight: 600; margin: 0 0 .6rem; }
.q-choices { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.q-choice {
  display: block; width: 100%; text-align: left; font: inherit; font-size: .95rem;
  padding: .55rem .8rem; border: 1px solid var(--rule); background: var(--paper);
  border-radius: 3px; cursor: pointer;
}
.q-choice:hover { background: var(--wash); }
.q-choice.correct { border-color: var(--good); background: var(--good-wash); color: var(--good); font-weight: 600; }
.q-choice.wrong { border-color: var(--bad); background: var(--bad-wash); color: var(--bad); }
.q-choice:disabled { cursor: default; }
.q-feedback { margin: .6rem 0 0; font-size: .9rem; display: none; }
.q-feedback.show { display: block; }
.q-feedback.good { color: var(--good); }
.q-feedback.bad { color: var(--bad); }
.quiz-foot { padding: 0 .95rem .95rem; }
.quiz-score { display: inline-flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; }
.quiz-score .done { color: var(--ink-soft); }
.quiz-score .done.all { color: var(--good); font-weight: 600; }
.q-feedback.reveal { color: var(--ink-soft); }
.q-choice.revealed { border-color: var(--rule-dark); background: var(--wash); color: var(--ink-faint); }
.q-choice.reveal-hint { border-color: var(--accent); }
.quiz-done { display: block; margin: 0 0 .7rem; border-left: 3px solid var(--good); }

.lesson-nav {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem;
  border-top: 1px solid var(--rule); margin-top: 3.2rem; padding-top: 1rem;
  font-family: var(--sans); font-size: .85rem;
}
.teacher-note {
  margin-top: 2.4rem; padding: .8rem 1rem; border: 1px dashed var(--rule-dark);
  font-family: var(--sans); font-size: .84rem; color: var(--ink-soft);
}
.teacher-note b { color: var(--ink); }

.footnote { font-size: .85rem; color: var(--ink-faint); border-top: 1px solid var(--rule); margin-top: 2.5rem; padding-top: .8rem; }

/* ---------- Lesson chrome: reading progress, TOC, back-to-top ---------- */
.reading-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--accent); z-index: 60; transition: width .1s linear;
}
.to-top {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 55;
  font-family: var(--sans); font-size: .74rem; padding: .45rem .7rem;
  border: 1px solid var(--rule-dark); border-radius: 3px; background: var(--paper);
  color: var(--ink-soft); cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity .18s ease, border-color .18s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { border-color: var(--ink-soft); color: var(--ink); }

.toc {
  border: 1px solid var(--rule); background: var(--wash);
  padding: .7rem 1rem .75rem; margin: 0 0 1.9rem; font-family: var(--sans);
}
.toc-label {
  font-size: .7rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-faint); display: block; margin-bottom: .45rem;
}
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
@media (min-width: 900px) { .toc ol { grid-template-columns: 1fr 1fr; column-gap: 1.6rem; } }
.toc a { color: var(--ink-soft); border-bottom: none; display: flex; gap: .6rem; line-height: 1.35; }
.toc a:hover { color: var(--accent); }
.toc a.is-current { color: var(--accent); font-weight: 600; }
.toc .n { color: var(--ink-faint); font-variant-numeric: tabular-nums; min-width: 1.15rem; }
.toc .t { flex: 1; }

/* ---------- Cheat card: the one-glance revision box ---------- */
.cheat { border: 1px solid var(--rule-dark); background: var(--paper); margin: 1.9rem 0; break-inside: avoid; }
.cheat-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .55rem .9rem; border-bottom: 1px solid var(--rule); background: var(--wash);
  font-family: var(--sans); font-size: .7rem; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-soft);
}
.cheat-head .hint { font-weight: 600; letter-spacing: .02em; text-transform: none; color: var(--ink-faint); font-size: .74rem; }
.cheat-body { padding: .9rem 1rem 1rem; }
.cheat-body > :last-child { margin-bottom: 0; }
.cheat dl { display: grid; grid-template-columns: minmax(6.5rem, auto) 1fr; gap: .4rem 1.1rem; margin: 0; }
.cheat dt { font-family: var(--sans); font-size: .8rem; font-weight: 600; color: var(--ink-faint); }
.cheat dd { margin: 0; }
.cheat .rule { font-weight: 600; }
.cheat .mono, .cheat code { font-family: var(--mono); font-size: .92em; }
.cheat code { background: var(--wash); border: 1px solid var(--rule); border-radius: 3px; padding: .02rem .25rem; }

/* ---------- Trap callout: the mistake examiners expect ---------- */
.trap { border-left: 3px solid var(--bad); background: var(--bad-wash); }
.trap .label { color: var(--bad); }

/* ---------- Misc typographic helpers ---------- */
kbd, .kbd {
  font-family: var(--sans); font-size: .76em; border: 1px solid var(--rule-dark);
  border-bottom-width: 2px; border-radius: 3px; padding: .05rem .3rem;
  background: var(--wash); color: var(--ink-soft); white-space: nowrap;
}
::selection { background: var(--accent-wash); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lesson-nav a, .lesson-nav span { padding: .1rem 0; }
.lesson-nav .next { margin-left: auto; }
.tag {
  display: inline-block; font-family: var(--sans); font-size: .68rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint);
  border: 1px solid var(--rule); border-radius: 999px; padding: .12rem .5rem;
}

/* ---------- Hub page (index.html) ---------- */
.hub { display: grid; gap: .9rem; margin: 1.6rem 0 2.2rem; }
@media (min-width: 760px) { .hub { grid-template-columns: 1fr 1fr; } }
.card {
  display: block; border: 1px solid var(--rule); background: var(--paper);
  padding: .85rem 1rem .9rem; color: inherit; text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.card:hover { border-color: var(--accent); background: var(--accent-wash); }
.card-top { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .3rem; }
.card-n {
  font-family: var(--sans); font-size: .72rem; font-weight: 700; letter-spacing: .1em;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.card h2, .card h3 { font-size: 1.05rem; margin: 0; font-weight: 700; line-height: 1.25; }
.card p { margin: 0; font-size: .92rem; color: var(--ink-soft); }
.card-foot { display: flex; flex-wrap: wrap; gap: .3rem .8rem; margin-top: .55rem; }
.card-foot span { font-family: var(--sans); font-size: .72rem; color: var(--ink-faint); }
.card-foot .win { font-weight: 600; color: var(--accent); }
.hub-start { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 2rem; }
.hub-start .pb-btn { font-size: .85rem; padding: .45rem .9rem; text-decoration: none; }
.pills { display: flex; flex-wrap: wrap; gap: .5rem; }

@media (max-width: 620px) {
  body { font-size: 17px; }
  .pb-stage { min-height: 0; }
  .bit { width: 1.35rem; height: 1.55rem; font-size: .8rem; }
}

@media print {
  body { font-size: 10.5pt; line-height: 1.45; }
  .wrap { max-width: none; padding: 0; }
  a { color: var(--ink); border-bottom: none; }
  .print-urls a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .72em; color: var(--ink-faint); word-break: break-all; }
  .pb-controls, .quiz-foot, .reading-progress, .to-top, .toc,
  .pb-row, .pb-legend, .pb-dots, .pb-side, .pb-hint { display: none !important; }
  .pb-frame { display: block !important; animation: none !important; }
  .pb-stage { overflow-x: visible; min-height: 0; }
  .pb-frame svg.pb-timeline { min-width: 0; }
  .pb-frame svg .is-new { animation: none; }
  .pb-frame + .pb-frame { margin-top: 1rem; padding-top: .9rem; border-top: 1px dashed var(--rule); }
  .pb-stage { counter-reset: pbstep; min-height: 0; }
  .pb-frame::before {
    counter-increment: pbstep; content: "Step " counter(pbstep);
    display: block; font-family: var(--sans); font-size: .68rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: .35rem;
  }
  .quiz, .playback, .callout, .note, .tip, .win, .fig, .cheat { break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; }
}
