/* A4 print layout. Ink saving: light grey fills, thin rules, no solid black blocks. */
@page { size: A4; margin: 0; }
.print-root { --ps: 1; background: #777; min-height: 100vh; padding-bottom: 30px; color: #111; font: 9pt/1.3 Arial, Helvetica, sans-serif; }
.print-bar { position: sticky; top: 0; z-index: 10; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 12px; background: #16131c; border-bottom: 1px solid var(--gold); }
.pages { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 12px; }
.pages { zoom: var(--ps); }
.pg { width: 210mm; height: 297mm; background: #fff; color: #111; padding: 6mm 10mm; position: relative; overflow: hidden; box-shadow: 0 2px 12px rgba(0, 0, 0, .5); display: flex; flex-direction: column; gap: 1.5mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pg * { box-sizing: border-box; }
.pg h1, .pg h2 { color: #111; font-family: Georgia, serif; }
.pg .md p { margin: 0 0 1.2mm; } .pg .md ul { margin: 0 0 1mm; padding-left: 4mm; } .pg .md strong { color: #000; }
.p-band { display: flex; justify-content: space-between; align-items: baseline; background: #d9d9d9; border: .3mm solid #888; padding: 2mm 4mm; }
.p-band.p1 { align-items: center; gap: 4mm; padding: 1.5mm 3mm; }
.p-qrbox { flex: none; width: 15mm; height: 15mm; background: #fff; padding: .6mm; } .p-qrbox svg { width: 100%; height: 100%; display: block; }
.p-name { flex: 1; font: 700 22pt Georgia, serif; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-class { font: 700 17pt Georgia, serif; letter-spacing: .08em; } .p-domains { font: 600 9pt Arial; letter-spacing: .04em; }
.p-top { display: flex; gap: 4mm; align-items: stretch; }
.p-id { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.p-line { display: flex; gap: 2mm; align-items: baseline; border-bottom: .25mm solid #999; padding: .4mm 0; min-height: 4.6mm; }
.p-line label { font: 600 7pt Arial; text-transform: uppercase; color: #555; flex: none; } .p-line span { flex: 1; } .p-line b { flex: none; }
.p-line.wl { min-height: 6mm; align-items: flex-end; }
.p-level { width: 22mm; text-align: center; border: .4mm solid #777; background: #fff; display: flex; flex-direction: column; }
.p-level .p-sh { background: #bdbdbd; } .p-level .n { font: 700 24pt Georgia; flex: 1; display: flex; align-items: center; justify-content: center; }
.p-row { display: flex; gap: 3mm; align-items: stretch; }
.p-box { border: .3mm solid #888; padding: 1.2mm 2.5mm; background: #fafafa; display: flex; flex-direction: column; gap: 1mm; }
.p-box.grow { flex: 1; }
.p-h { font: 700 7.5pt Arial; letter-spacing: .1em; color: #444; background: #e4e4e4; margin: -1.5mm -2.5mm 1mm; padding: .8mm 2.5mm; }
.p-big { font: 700 17pt Georgia; text-align: center; }
.p-lab { font: 600 6.5pt Arial; color: #555; margin-top: 1mm; }
.pboxes { display: inline-flex; flex-wrap: wrap; gap: 1.2mm; }
.pboxes i { display: inline-block; width: 4mm; height: 4mm; border: .35mm solid #555; background: #fff; }
.pboxes.lg i { width: 5.2mm; height: 5.2mm; } .pboxes.md i { width: 4.6mm; height: 4.6mm; } .pboxes.sm i { width: 3mm; height: 3mm; }
.pboxes.round i { border-radius: 50%; } .pboxes.red i { border-color: #8b1a2b; }
.p-traitrow { display: flex; gap: 6mm; align-items: stretch; }
.p-traits { flex: 1; display: flex; gap: 2mm; }
.p-stat { flex: 1; border: .35mm solid #777; background: #fff; text-align: center; display: flex; flex-direction: column; }
.p-sh { font: 700 7.5pt Arial; letter-spacing: .1em; color: #222; background: #bdbdbd; padding: 1mm 1mm; }
.p-sv { font: 700 17pt Georgia; padding: 1.2mm 0 .2mm; background: #fff; } .p-ss { font: 600 6pt Arial; color: #555; padding-bottom: 1mm; }
.p-stat.alt { flex: none; width: 24mm; border: .8mm double #555; background: #e9e9e9; } .p-stat.alt .p-sh { background: #8f8f8f; color: #fff; letter-spacing: .02em; font-size: 7pt; } .p-stat.alt .p-sv { background: #e9e9e9; font-size: 20pt; padding-top: 2mm; }
.p-row3 { display: grid; grid-template-columns: 1fr 40mm 44mm; gap: 3mm; align-items: stretch; }
.p-stack { display: flex; flex-direction: column; gap: 2mm; } .p-stack .p-box { flex: 1; }
.p-wl { border-bottom: .25mm solid #aaa; height: 6mm; }
.p-money { width: 80mm; }
.p-thr { display: flex; gap: 3mm; align-items: center; font: 600 8pt Arial; } .p-thr b { font: 700 14pt Georgia; border: .3mm solid #777; padding: 0 3mm; background: #fff; }
.pg .small { font-size: 7.5pt; color: #444; }
.p-tbl { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 7.5pt; } .p-tbl th { text-align: left; font: 700 7pt Arial; color: #555; border-bottom: .3mm solid #888; } .p-tbl th:nth-child(1) { width: 7mm; } .p-tbl th:nth-child(2) { width: 27mm; } .p-tbl th:nth-child(3) { width: 38mm; } .p-tbl th:nth-child(4) { width: 20mm; }
.p-tbl td { border-bottom: .2mm solid #ccc; padding: .8mm 1mm .8mm 0; vertical-align: top; height: 5.2mm; }
.p-chk { display: inline-block; width: 3.6mm; height: 3.6mm; border: .35mm solid #555; background: #fff; vertical-align: middle; margin-right: 1.5mm; } .p-tbl td.eq .p-chk { margin: .3mm 0 0; }
.p-iline { display: flex; align-items: flex-end; gap: 2mm; border-bottom: .25mm solid #aaa; min-height: 5.2mm; padding-bottom: .3mm; font-size: 8pt; } .p-iline span { flex: 1; } .p-iline.phone { align-items: center; margin-bottom: 1mm; }
.p-qty { flex: none; width: 5mm; height: 4mm; border: .3mm solid #777; background: #fff; }
.p-icols { columns: 2; column-gap: 6mm; } .p-icols .p-iline { break-inside: avoid; }
.p-feat { font-size: 7pt; line-height: 1.25; columns: 2; column-gap: 4mm; } .p-feat .md p { margin-bottom: .8mm; }
.p-avatar { flex: none; width: 28mm; height: 34mm; object-fit: cover; filter: grayscale(1) contrast(1.05); border: .3mm solid #777; } .p-avatar.ph { background: #eee; }
.p-foot { margin-top: auto; font-size: 6pt; color: #777; text-align: center; }
.p-qa { margin-bottom: 2mm; } .p-qa b { font-size: 8pt; } .p-qa .ans { border-bottom: .25mm solid #aaa; min-height: 11mm; white-space: pre-wrap; font-size: 8.5pt; background: repeating-linear-gradient(transparent 0 4.8mm, #ccc 4.8mm 5mm); }
.p-chips span { display: inline-block; border: .25mm solid #999; padding: .5mm 2.5mm; margin: 0 1mm 1mm 0; font-size: 8pt; }
/* cards */
.p-cards { columns: 3; column-gap: 2.5mm; flex: 1; overflow: hidden; }
.p-card { border: .35mm solid #777; padding: 2mm 2.5mm; font-size: 7.5pt; background: #fcfcfc; break-inside: avoid; margin-bottom: 2.5mm; display: inline-block; width: 100%; }
.p-card .ct { font: 700 9.5pt Georgia, serif; } .p-card .cm { font-size: 6.5pt; color: #555; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 1mm; }
.p-card .cx { font-size: 7.5pt; }
/* journal */
.pj { gap: 4mm; }
.p-jt { text-align: center; font: 700 24pt Georgia; margin: 0; }
.p-jwrap { position: relative; flex: 2; min-height: 0; } .p-jlines { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6mm; } .p-jlines > div { height: 100%; }
.p-jcols { position: relative; height: 100%; columns: 3; column-gap: 6mm; font-size: 8.5pt; line-height: 5.2mm; overflow: hidden; }
.ruled { background-image: repeating-linear-gradient(to bottom, transparent 0 5.45mm, #b5b5b5 5.45mm 5.8mm); }
.ruled3 { background-image: repeating-linear-gradient(to bottom, transparent 0 4.95mm, #dcdcdc 4.95mm 5.2mm); }
.p-jentry { break-inside: avoid; margin-bottom: 0; }
.p-halves { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; min-height: 0; }
.p-bonds { border-top: .4mm solid #888; padding-top: 2mm; display: flex; flex-direction: column; min-height: 0; } .p-bonds h2 { margin: 0 0 1.5mm; font-size: 12pt; text-align: center; }
.p-bline { display: flex; gap: 4mm; } .p-bline label { flex: 1; font: 600 6.5pt Arial; text-transform: uppercase; color: #555; border-bottom: .3mm solid #888; padding-bottom: 4mm; }
.p-fill { flex: 1; min-height: 10mm; }
.p-qr-cols { columns: 2; column-gap: 6mm; font-size: 8pt; }
.p-qrr { break-inside: avoid; margin-bottom: 2.5mm; border-left: .8mm solid #bbb; padding-left: 2mm; } .p-qrr b { font-size: 9pt; } .p-qrr .md ul { margin: 0 0 1mm; padding-left: 3.5mm; }

@media screen {
  .print-root .pg { margin: 0; }
}
@media print {
  html, body { background: #fff !important; }
  .noprint, .footer, #toast, .saving { display: none !important; }
  .print-root { background: #fff; padding: 0; }
  .pages { zoom: 1; display: block; padding: 0; }
  .pg { box-shadow: none; page-break-after: always; break-after: page; margin: 0; }
  .pg:last-child { page-break-after: auto; break-after: auto; }
}

.pg .p-box.grow { flex: 1; min-height: 0; }
