/* The printed page (print.js, docs/plan.md section 5). It is paper, not part of the theme: pure black on white in
   every theme, so the colours here are fixed on purpose, and nothing is taken from the GUI kit's tokens. */

/* ---------- a page ---------- */
.ps { position: relative; box-sizing: border-box; overflow: hidden; background: #fff; color: #000; text-align: start;
  font: 400 11pt/1.3 Arial, Helvetica, "Liberation Sans", sans-serif; letter-spacing: normal; }
.ps * { box-sizing: border-box; margin: 0; padding: 0; color: #000; letter-spacing: normal; text-shadow: none; }
.ps--A4 { width: 210mm; height: 296.6mm; padding: 12mm; }
.ps--A5 { width: 148mm; height: 209.6mm; padding: 10mm; font-size: 10.5pt; }
.ps--half { width: 148.5mm; }
.ps--large { font-size: 13pt; }
.ps .ps-head { padding-bottom: 2mm; margin-bottom: 3mm; border-bottom: 0.5pt solid #000; }
.ps .ps-title { font-size: 18pt; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.ps .ps-meta { padding-top: 1mm; }
.ps .ps-note { padding-bottom: 3mm; font-size: 9pt; font-style: italic; }
.ps .ps-cols { display: flex; align-items: flex-start; gap: 7mm; }
.ps .ps-cols > .ps-col { flex: 1 1 0; min-width: 0; }
.ps .ps-group + .ps-group { margin-top: 3mm; }
.ps .ps-gh { padding-bottom: 1mm; font-size: 10pt; font-weight: 700; line-height: 1.3; text-transform: uppercase; overflow-wrap: anywhere; }
.ps--large .ps-gh { font-size: 12pt; }
.ps .ps-list { list-style: none; }
.ps .ps-row { display: flex; align-items: flex-start; gap: 2.5mm; min-height: 6.4mm; padding-block: 0.7mm; list-style: none; }
.ps .ps-row::before, .ps .ps-row::marker { content: none; }
.ps .ps-box { flex: none; width: 4.5mm; height: 4.5mm; margin-top: 0.2mm; border: 1pt solid #000; }
.ps .ps-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ps .ps-row--own { min-height: 8mm; }
.ps .ps-row--own .ps-text { height: 5.2mm; border-bottom: 0.5pt solid #000; }
.ps .ps-foot { position: absolute; inset-inline: 12mm; bottom: 12mm; display: flex; justify-content: space-between; gap: 4mm; font-size: 8pt; line-height: 1.3; }
.ps--A5 .ps-foot { inset-inline: 10mm; bottom: 10mm; }

/* measuring, out of sight */
.ps-measure { position: absolute; top: 0; left: -10000px; visibility: hidden; }
.ps-measure .ps { height: auto; }
.ps-measure .ps-headbox { display: flow-root; }

/* ---------- the preview on screen: the sheets at their real size, shrunk to fit ---------- */
.app-print { --ps-scale: 1; }
.app-printopts { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; margin-top: 12px; }
.app-printopt { display: flex; flex-direction: column; gap: 4px; }
@media (pointer: coarse) { .app-printopt .m-seg > button { min-height: 44px; min-width: 44px; } }
.app-sheets { --ps-scale: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin-top: 8px; }
.ps-frame { overflow: hidden; box-shadow: 0 0 0 1px var(--m-line-strong), 0 8px 24px rgba(0, 0, 0, .18); }
.ps-frame--A4 { width: calc(210mm * var(--ps-scale)); height: calc(296.6mm * var(--ps-scale)); }
.ps-frame--A5 { width: calc(148mm * var(--ps-scale)); height: calc(209.6mm * var(--ps-scale)); }
.ps-frame--A4L { width: calc(297mm * var(--ps-scale)); height: calc(209.6mm * var(--ps-scale)); }
.ps-paper { display: flex; transform: scale(var(--ps-scale)); transform-origin: 0 0; background: #fff; }
.ps-paper--A4 { width: 210mm; height: 296.6mm; }
.ps-paper--A5 { width: 148mm; height: 209.6mm; }
.ps-paper--A4L { width: 297mm; height: 209.6mm; }
.ps-paper > .ps { flex: none; }
.ps-cut { flex: none; position: relative; z-index: 1; width: 0; border-left: 0.75pt dashed #000; }

/* ---------- on paper: the sheets only ---------- */
@media print {
  html:root, body.is-print-view { margin: 0; padding: 0; height: auto; min-height: 0; overflow: visible; background: #fff !important; color-scheme: light; }
  body.is-print-view::before, body.is-print-view::after { display: none !important; }
  body.is-print-view > :not(.m-shell), body.is-print-view .m-shell > :not(.m-main),
  body.is-print-view .m-main > :not(.app-print), body.is-print-view .app-printui { display: none !important; }
  body.is-print-view .m-shell, body.is-print-view .m-main, body.is-print-view .app-print, body.is-print-view .app-sheets {
    display: block; position: static; width: auto; max-width: none; height: auto; min-height: 0; margin: 0; padding: 0; overflow: visible;
    background: none; box-shadow: none; transform: none !important; animation: none !important; filter: none; opacity: 1 !important; }
  body.is-print-view .ps-frame { width: auto; height: auto; overflow: visible; box-shadow: none; break-after: page; break-inside: avoid; }
  body.is-print-view .ps-frame:last-child { break-after: auto; }
  body.is-print-view .ps-paper { transform: none; }
}
