@media print {
  @page { size: A4 landscape; margin: 0; }

  /* B-048: A4 print readability floor. On paper the vw term of the on-screen
     clamps is meaningless (A4 landscape ≈ 297mm), so small (label/tag/note) and
     body copy can print sub-legibly. Pin comfortable fixed sizes for print —
     small 0.95rem (~15px), body 1.1rem (~17.6px) — so a printed handout reads
     cleanly. Scoped to print, so on-screen/projector rendering is untouched. */
  :root {
    --small-size: 0.95rem;
    --body-size: 1.1rem;
  }

  body, [data-theme="dark"] body {
    background: #fff !important;
    color: #0a1a24 !important;
    overflow: visible;
  }

  .deck-controls, .deck-progress { display: none !important; }

  /* B-111: the screen layout centres a 16:9 stage inside the window
     (`body { display:grid; place-items:center }`, `#deck { width: var(--stage-w) }`).
     On paper there is no window and no stage — each slide IS a page — so both are
     unwound here. Caught by ci-validate-print's negative test: with the grid still
     in force, deliberately putting `page-break-after: always` back on the last
     slide stopped producing the trailing blank page, i.e. the gate could no longer
     tell a working break from a broken one. */
  body { display: block; place-items: initial; min-height: 0; }
  /* B-112: unwind the canvas transform as well. On paper the page IS the stage,
     so a scaled 1920x1080 box would print one small slide in the corner of each
     sheet. */
  #deck {
    height: auto;
    width: auto;
    /* B-112: all three, not just the transform. On screen the canvas is a FIXED,
       centred, scaled box; a fixed element prints once, so the eight slides
       collapsed onto a single sheet — the gate measured exactly that (8 slides ->
       1 page). On paper the deck is a normal block and each slide is a page. */
    position: static;
    left: auto;
    top: auto;
    transform: none;
  }

  .slide {
    /* B-081: `relative`, not `static`. The motif folio is an absolutely
       positioned `.slide::after`, and it anchors to the nearest positioned
       ancestor — which under `static` is `#deck` (base.css keeps it
       `position: relative`, and the rule above only resets its size). Every
       page's folio would then stack in one spot on page 1. `relative` still
       participates in normal flow, so `page-break-after` and the 100vh/100vw
       sizing below behave exactly as before. */
    position: relative !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    page-break-after: always;
    height: 100vh;
    width: 100vw;
  }

  /* B-109: the last slide must not open a page after itself. `page-break-after:
     always` was set on EVERY `.slide` with no exemption, so Chromium's print
     pipeline started a page it then had nothing to fill: an 8-slide deck printed
     9, the ninth blank. Measured twice — once at 1440x810 and once at A4
     landscape — before and after this rule. Nothing in the repo emulates print
     media, which is why it survived: `pnpm verify`'s browser gates all render
     `screen`, so the print stylesheet's own output has never been in front of an
     assertion. The PDF button is a different path entirely (html2canvas, screen
     media), so this only ever showed up in Ctrl+P. */
  .slide:last-child { page-break-after: auto; }
}
