/* ==========================================================================
   Print / Save as PDF. Light tokens come from tokens.css (@media print).
   Everything renders in its final state: no motion, accordions open,
   every row visible.
   ========================================================================== */

@page {
  size: A4;
  margin: 14mm 14mm 16mm;
}

html,
body {
  background: var(--bg) !important;
  font-size: 10.5pt;
}

body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* Chrome that has no meaning on paper */
.thread-nav,
.hero-canvas,
.theme-toggle,
.print-btn,
.skip-link,
.tip,
.lightbox,
.row-hl,
.ledger-foot .btn,
.chips,
.seg,
.comm-controls .seg,
.thumb-hint { display: none !important; }

.page { display: block !important; max-width: none; padding: 0; }
.topbar-inner { max-width: none; padding: 0 0 6mm; min-height: 0; }

/* Final states for anything that animates in */
.js-motion [data-reveal],
.js-motion .mask-inner,
.js-motion .bar-fill.is-pending,
.js-motion .segbar.is-pending .seg-item,
.js-motion .hero-title .u::after {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

.js-motion .bar-fill.is-pending { transform: scaleX(var(--v, 0)) !important; }

.chart .col,
.chart .col-na { transform: none !important; opacity: 1 !important; }
.chart .peak { opacity: 1 !important; transform: none !important; }
.chart .col-band { display: none; }

*,
*::before,
*::after { animation: none !important; transition: none !important; }

/* Spacing tuned for paper */
.section { padding-top: 12mm; }
.section:first-child { padding-top: 0; }
.sec-head { margin-bottom: 6mm; break-after: avoid; }
.sec-title { font-size: 20pt; }
.sec-dek { font-size: 11pt; }
.hero-title { font-size: 30pt; }
.hero-number { font-size: 76pt; }
.hero-figure { margin-top: 8mm; }
.chart { height: 62mm; }
.tldr-fig { font-size: 34pt; }

.section,
.tldr-item,
.thread-row,
.comm-row,
.owned-item,
.plan li,
.ledger tr,
.acc-btn { break-inside: avoid; }

h1, h2, h3, .sub-head { break-after: avoid; }

/* Expand everything */
.acc-panel { grid-template-rows: 1fr !important; }
.acc-body { opacity: 1 !important; transform: none !important; }
.acc-sign { display: none; }
.ledger tbody tr.is-hidden { display: table-row !important; }

/* Keep tables as tables on paper */
.ledger thead { display: table-header-group !important; }
.ledger thead tr { display: table-row !important; }
.ledger thead tr::before { content: none !important; }
.ledger tbody tr { display: table-row !important; }
.ledger td,
.ledger th { display: table-cell !important; padding: 2.2mm 2mm !important; border-bottom: 0.5pt solid var(--line) !important; }
.ledger .m-label { display: none !important; }
.ledger .sort-btn { border: 0 !important; padding: 0 !important; margin: 0 !important; min-height: 0 !important; }
.ledger .sort-btn svg { display: none; }
.ledger .cell-title { min-width: 0 !important; }

/* Links: readable, with the destination host for posts */
a { text-decoration: none !important; color: var(--text) !important; }
.ledger .cell-title a::after {
  content: " ↗";
  color: var(--text-3);
}

.owned-item:first-child,
.plan { box-shadow: 0 0 0 0.5pt var(--line) !important; }
