    /* ── Print ── */
    /* Print uses exactly the same inline-styled card+doc as screen/copy.
       Only the app chrome (header, edit panel, action bar) is hidden.
       The color-adjust properties tell browsers to preserve backgrounds
       and colors when printing — they only sometimes obey when the user's
       "Background graphics" toggle is off, but they're the strongest signal
       we can send. */
    @page { size: A4; margin: 0; }
    @media print {
      html, body {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
      }
      html, body {
          background: var(--print-bg, #ffffff) !important;
          margin: 0;
          padding: 0;
      }
      /* The card + panel wrap the doc; their backgrounds show as side bands and
         in the gaps between pages. Match them to the doc background so e.g. a
         white (Paper) document prints fully white — no dark navy margins. */
      #view-panel, #view-card {
          background: var(--print-bg, #ffffff) !important;
          -webkit-print-color-adjust: exact !important;
          print-color-adjust: exact !important;
      }
      #app { padding: 0; margin: 0; max-width: 100%; display: block; }
      #sidebar, .shell-head, .shell-top, .header, #edit-panel, #theme-panel, #settings-panel, .action-bar, #add-bar { display: none !important; }
      #shell { padding: 0 !important; }
      .shell-inner { max-width: none !important; margin: 0 !important; }
      .panel, .panel.active { margin-top: 0 !important; }
      #view-panel { padding: 0 !important; }
      #view-doc {
        border-radius: 0 !important;
        box-shadow: none !important;
        /* @page margin is 0 so the themed sheet bleeds to the paper edges; the
           doc's own padding supplies the coloured side (and first/last) margins. */
        padding: 10mm 10mm !important;
        width: calc(210mm / var(--doc-scale, 1)) !important;
        max-width: calc(210mm / var(--doc-scale, 1)) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
      }
      /* The audit log is app chrome, not part of the document. */
      #audit-panel { display: none !important; }
      /* Toast is a transient UI notification — never print it */
      #toast { display: none !important; }
    }
    /* ── Shared doc-content print styles ──
       Everything below applies whenever the doc is being rendered for paper,
       whether that's the browser's print pipeline (#view-doc gets the class
       via beforeprint) or Save-as-PDF (the offscreen sheet's inner gets it in
       makePdfSheet). One source of truth for both routes so they can't drift. */
    .pulp-doc-print { orphans: 3; widows: 3; }
    /* Force every element inside the doc to preserve its colors */
    .pulp-doc-print * {
      -webkit-print-color-adjust: exact !important;
      print-color-adjust: exact !important;
    }
    /* Organic page breaks: measured break points inserted between blocks. Each
       carries a top + bottom spacer that becomes the page's coloured margin.
       The bottom spacer draws a muted dashed line marking the end of the page. */
    .pulp-doc-print .organic-page-break-bottom,
    .pulp-doc-print .organic-page-break-top { display: block; height: 10mm; }
    /* Rule and page number share one row: the dashed line flexes to fill,
       the number sits to its right, vertically centred on the line. */
    .pulp-doc-print .organic-page-break-bottom {
      display: flex;
      align-items: flex-start;
      gap: 3mm;
    }
    .pulp-doc-print .organic-page-rule {
      flex: 1 1 auto;
      border-top: 1px dashed rgba(120, 120, 120, 0.5);
    }
    .pulp-doc-print .organic-page-num {
      flex: 0 0 auto;
      margin-top: -0.6em;
      font-family: sans-serif;
      font-size: 8pt;
      letter-spacing: 0.06em;
      color: rgba(110, 110, 110, 0.85);
      white-space: nowrap;
    }
    .pulp-doc-print .organic-break > .organic-page-break-top { break-before: page; page-break-before: always; }
    /* The manual page-break block no longer forces the break itself — the
       inserted .organic-break wrap does, so both kinds look identical. */
    .pulp-doc-print [data-pagebreak] { page-break-after: auto !important; break-after: auto !important; }
