/* Print / PDF. Solutions open, parts start on a new page, drawings never wrap. */
@page { size: A4; margin: 17mm 15mm 19mm 15mm; }

@media print {
  html { scroll-behavior: auto; }
  body { background: #fff; color: #000; font-size: 10pt; line-height: 1.38; }
  .content { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; padding: 0 !important; }
  .topbar { border-bottom: 1pt solid #000; background: #fff; }
  .brand, .tabs a.active { background: none !important; border: 0 !important; }
  h2::before, .pane-cap::before { display: none !important; }
  .inet-players, .inet-player { display: none !important; }
  .topbar, .sidebar, .widget-controls, .skip, .toc-toggle, #print-btn, #toc-filter { display: none !important; }
  .layout { display: block; }
  .content { max-width: none; margin: 0; padding: 0; }

  a { color: #000; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font: 7.5pt var(--mono); color: #444; word-break: break-all; }
  a.xref::after { content: none; }
  .content h1 { font-size: 20pt; border-bottom: 1.5pt solid #000; }
  .content h2 { font-size: 14pt; break-before: page; border-top: 0; padding-top: 0; }
  .content h2:first-of-type { break-before: avoid; }
  .content h3 { font-size: 11.5pt; break-after: avoid; }
  .content h4, .content h5, .content h6 { break-after: avoid; }
  h1, h2, h3, h4 { break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
  blockquote { break-inside: avoid; background: none; border-left: 2pt solid #b45309; }
  table { font-size: 8.5pt; }
  .table-wrap { overflow: visible; break-inside: auto; }
  tr { break-inside: avoid; }
  pre { break-inside: avoid; }
  pre.code, pre.shiki { font-size: 7.6pt; white-space: pre-wrap; word-break: break-word; background: #faf9f5; }
  pre.ascii { font-size: 6.5pt; line-height: 1.2; white-space: pre; overflow: visible; border-color: #bbb; }
  code { background: none; }
  details.solution { break-inside: avoid; border: .5pt solid #999; background: none; }
  details.solution > summary { background: none; color: #000; font-size: 8pt; }
  .widget { break-inside: avoid; border: .5pt solid #999; }
  .widget-head { background: none; border-bottom: .5pt solid #999; }
  .widget figcaption { font-size: 7.5pt; }
  .widget .trace-terms li { display: block; margin-bottom: 6pt; }
  .widget .trace-terms .tag, .widget .trace-terms .before { display: none; }
  .widget .trace-terms li::before { content: "step " attr(data-step) " · " attr(data-rule); font: 7pt var(--mono); color: #555; display: block; }
  .chart { break-inside: avoid; border: .5pt solid #999; box-shadow: none; }
  .widget, .inet, .table-wrap, details.solution, blockquote { border-width: .5pt !important; box-shadow: none !important; }
  .inet-row, .inet-grid .pane, .inet-stage { background: #fff !important; background-image: none !important; }
  .toc-index { columns: 2; column-gap: 10mm; font-size: 8pt; }
  .toc-index code { font-size: 7pt; }
  .inet { break-inside: avoid; border: .5pt solid #999; }
  .inet-player { display: none !important; }
  .inet-row, .inet-grid .pane { background-image: none; background-color: #fff; }
  .inet-svg .halo { stroke: #fff; }
  .inet-svg { max-height: 62mm; }
  .inet-grid { grid-template-columns: repeat(3, 1fr); }
  .inet-notation { font-size: 7.4pt; background: none; }
  .inet-notation .eq.next::after { content: "  ← next"; }
  .inet figcaption { font-size: 7.5pt; }
  .inet .src { display: none; }
  .file { break-before: auto; }
  body.doc-compendium pre.ascii { font-size: 6.8pt; }
  body.doc-compendium pre.code { font-size: 7pt; }
}
