/* Printable form: paper sheets, running header / footer, answer marks. Same blue design language as the app. */
.print-page { max-width: none; padding: 0 0 60px; }
.print-toolbar { position: static; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; flex-direction: column; gap: 8px; }
.print-toolbar .pt-title { font-size: 1.05rem; margin: 0; }
.pt-opts { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: end; }
.pt-opts.checks { gap: 4px 16px; }
.pt-f { display: flex; flex-direction: column; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); gap: 2px; }
.pt-f select { text-transform: none; letter-spacing: 0; font-weight: 400; min-width: 110px; }
.pt-c { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; cursor: pointer; }
.pt-c input { accent-color: var(--accent); }
.pt-sections { font-size: .84rem; }
.pt-sections summary { cursor: pointer; color: var(--accent-dark); font-weight: 600; }
.pt-sections > div { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 6px 0; }
.pt-export { position: relative; }
.pt-export summary { list-style: none; cursor: pointer; }
.pt-export summary::-webkit-details-marker { display: none; }
.pt-export .menu { right: 0; top: 44px; min-width: 250px; }
.print-stage { background: #dfe8f5; padding: 16px 12px 40px; overflow-x: auto; min-height: 60vh; }
:root[data-theme="dark"] .print-stage { background: #0a1020; }
.sheets-wrap { margin: 0 auto; }
.sheets { transform-origin: top left; width: max-content; display: flex; flex-direction: column; gap: 16px; }

/* ---- sheet (always white, like paper) ---- */
.sheet { position: relative; background: #fff; color: #1b2430; box-shadow: 0 2px 14px rgba(21,86,184,.18); overflow: hidden; flex: 0 0 auto; font-family: "Inter", "Segoe UI", Arial, sans-serif; font-size: var(--fs, 8.5pt); line-height: 1.3; break-after: page; page-break-after: always; break-inside: avoid; }
.pdoc.measure { position: absolute; left: -99999px; top: 0; visibility: hidden; font-family: "Inter", "Segoe UI", Arial, sans-serif; font-size: var(--fs, 8.5pt); line-height: 1.3; color: #1b2430; }
.ph { position: absolute; top: 5mm; height: 10mm; display: flex; align-items: center; gap: 4mm; border-bottom: .4mm solid #1556b8; padding-bottom: 1mm; }
.ph-logo { height: 8.5mm; width: auto; display: block; }
.ph-title { flex: 1; display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.ph-title b { font-size: 1.12em; color: #1556b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-title span, .ph-date { font-size: .82em; color: #6b7280; }
.ph-date { white-space: nowrap; }
.pf { position: absolute; bottom: 4.5mm; height: 6mm; display: flex; align-items: center; justify-content: space-between; gap: 6mm; border-top: .3mm solid #cfe0f7; padding-top: 1mm; font-size: .82em; color: #6b7280; }
.pf b { color: #1556b8; font-size: 1.1em; white-space: nowrap; }
.pf span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb { position: absolute; }
.band { display: grid; overflow: hidden; }
.band.full { display: block; }
.pcol { min-width: 0; }
.blk { display: flow-root; padding-bottom: 1.6mm; }

/* ---- cover ---- */
.cover h1 { font-size: 15pt; margin: 0 0 1mm; color: #1556b8; line-height: 1.2; letter-spacing: -.01em; }
.cover .desc { margin: 0 0 2mm; color: #4b5768; font-size: .95em; }
.cover .legend { margin: 1.5mm 0 0; font-size: .85em; color: #6b7280; }
.fl5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3mm; margin-top: 2mm; padding: 2mm 3mm 1mm; border: .3mm solid #cfe0f7; border-radius: 1.2mm; background: #f0f6ff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* ---- sections ---- */
.sec { background: #1556b8; color: #fff; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .85em; padding: 1.1mm 2.4mm; border-radius: .8mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sec.l2 { background: #e1eeff; color: #0f4799; text-transform: none; letter-spacing: 0; font-size: .95em; border-left: 1.2mm solid #1556b8; border-radius: 0; }
.sec.l3, .sec.l4 { background: transparent; color: #0f4799; text-transform: none; letter-spacing: 0; border-bottom: .3mm solid #7cb6ff; border-radius: 0; padding-left: 0; }
.sec small { font-weight: 400; text-transform: none; letter-spacing: 0; opacity: .85; }

/* ---- questions ---- */
.pq { break-inside: avoid; }
.ql { font-weight: 600; display: flex; gap: 1.2mm; align-items: baseline; }
.qn { color: #1556b8; font-weight: 700; min-width: 5mm; flex: 0 0 auto; }
.qt { flex: 1 1 0; min-width: 0; }
.req { color: #d03b3b; font-weight: 700; }
.vid { font: 400 .78em ui-monospace, Consolas, monospace; color: #6b7280; background: #f0f6ff; padding: 0 1mm; border-radius: .6mm; margin-left: auto; }
.qh { color: #6b7280; font-size: .88em; margin-top: .2mm; }
.qs { color: #0f4799; font-size: .85em; font-style: italic; margin-top: .2mm; }
.qa { margin-top: 1mm; }
.opts.inline { display: flex; flex-wrap: wrap; gap: .8mm 4mm; }
.opts.cols { display: grid; grid-auto-flow: column; column-gap: 4mm; }
.opt { display: flex; align-items: flex-start; gap: 1.4mm; break-inside: avoid; padding: .15mm 0; }
.opt .code { color: #6b7280; font-size: .85em; min-width: 3.5mm; }
.mk { flex: 0 0 auto; display: inline-block; width: 2.9mm; height: 2.9mm; border: .35mm solid #1b2430; margin-top: .55mm; background: #fff; }
.mk.circle { border-radius: 50%; }
.mk.box { border-radius: .4mm; }
.other { display: flex; align-items: center; gap: 1.4mm; margin-top: .6mm; }
.ln { display: inline-block; border-bottom: .3mm solid #1b2430; min-width: 25mm; height: 3.6mm; }
.flv { border-bottom: .3mm solid #1b2430; height: 6mm; }
.flv.fixed { height: auto; min-height: 4.6mm; padding: .4mm 0 0; font-weight: 600; color: #0f4799; border-bottom-color: #7cb6ff; }
.fl { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.fll { font-size: .8em; color: #6b7280; }
.fl3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3mm; }
.fl4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1mm 4mm; }
.box { border: .3mm solid #1b2430; border-radius: .8mm; background: #fff; }
.box.lines { height: 15mm; background: repeating-linear-gradient(to bottom, transparent 0, transparent 4.6mm, #cfe0f7 4.6mm, #cfe0f7 4.9mm); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.box.num { height: 6mm; width: 26mm; }
.box.drop { border-style: dashed; padding: 2mm 2.5mm; min-height: 13mm; display: flex; align-items: flex-end; gap: 1.5mm; }
.box.sign { height: 17mm; padding: 1mm 2mm; display: flex; align-items: flex-end; }
.numrow { display: flex; align-items: center; gap: 2.5mm; flex-wrap: wrap; }
.rule { flex: 1; min-width: 20mm; border-bottom: .3mm solid #1b2430; height: 3mm; }
.sub { color: #6b7280; font-size: .85em; }
.dt { display: inline-flex; gap: .6mm; }
.bx { display: inline-block; width: 4.6mm; height: 5.6mm; border: .3mm solid #1b2430; border-radius: .5mm; }
.bx.gap { margin-left: 1.6mm; }
.bx.rk { width: 5.4mm; margin-right: .6mm; flex: 0 0 auto; }
.star { font-size: 1.5em; line-height: 1; display: inline-flex; flex-direction: column; align-items: center; color: #1b2430; }
.star small { font-size: .5em; color: #6b7280; }
.scale { display: flex; align-items: center; gap: 2.4mm; flex-wrap: wrap; }
.sc { display: inline-flex; flex-direction: column; align-items: center; gap: .3mm; }
.sc small { font-size: .78em; color: #4b5768; text-align: center; max-width: 18mm; }
.consent { display: flex; gap: 1.6mm; align-items: flex-start; border: .3mm solid #cfe0f7; border-radius: 1mm; padding: 1.4mm 2mm; background: #f0f6ff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.note { border-radius: 1mm; padding: 1.4mm 2.4mm; background: #e1eeff; border-left: 1.1mm solid #1556b8; font-size: .95em; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.note.warning { background: #fff4d6; border-left-color: #fab219; }
.note.success { background: #e6f5e6; border-left-color: #0a8a0a; }
.note.plain { background: transparent; border-left-color: #cfe0f7; }
.locm { margin-top: 1mm; }
.locm > b { font-size: .88em; color: #0f4799; display: block; margin-bottom: .3mm; }

/* ---- grids & rosters ---- */
table.grid, table.rt { width: 100%; border-collapse: collapse; table-layout: auto; }
table.grid th, table.grid td, table.rt th, table.rt td { border: .25mm solid #b9cfeb; padding: .8mm 1.2mm; text-align: center; vertical-align: middle; }
table.grid th, table.rt th { background: #f0f6ff; font-size: .82em; font-weight: 700; color: #0f4799; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
table.grid td.rl { text-align: left; }
table.grid td .mk { margin: 0; }
table.rt th { text-align: left; vertical-align: bottom; }
table.rt th small { font-weight: 400; color: #6b7280; }
table.rt td { height: 7.4mm; }
table.rt td.n, table.rt th.n { width: 6mm; text-align: center; color: #6b7280; }
table.rt td.wide { min-width: 28mm; }
table.rt.mx th.q { width: 44%; text-align: left; background: #f8fbff; font-weight: 600; color: #1b2430; font-size: .95em; }
table.rt.mx thead th.q { background: #f0f6ff; color: #0f4799; font-size: .82em; font-weight: 700; }
table.rt.mx th.p { text-align: center; }
table.rt.mx td { height: 6.6mm; min-width: 11mm; }
table.rt .cd { display: block; font-weight: 400; color: #4b5768; font-size: .86em; line-height: 1.25; }
table.rt .hn { font-weight: 400; color: #6b7280; }
.legend { margin-top: 1.2mm; font-size: .82em; color: #4b5768; }
.entry { border: .3mm solid #b9cfeb; border-radius: 1mm; break-inside: avoid; }
.entry-h { background: #e1eeff; color: #0f4799; font-weight: 700; padding: .8mm 2mm; font-size: .9em; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.entry-b { padding: 1.2mm 2mm 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: column; column-gap: 5mm; }
.entry-b .pq { margin-bottom: 1.4mm; }

@media print {
  html, body { background: #fff !important; }
  .topbar, .no-print, .skip, .toasts { display: none !important; }
  main, main.print-page { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .print-stage { background: #fff; padding: 0; overflow: visible; }
  .sheets-wrap { width: auto !important; height: auto !important; margin: 0 !important; }
  .sheets { transform: none !important; display: block; width: auto; }
  .sheet { box-shadow: none; margin: 0; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.sheet th, .pdoc th { text-transform: none; letter-spacing: 0; }

.qg { background: #e1eeff; border-left: .8mm solid #1556b8; border-radius: .6mm; padding: .6mm 1.6mm; margin-top: .6mm; font-size: .88em; color: #1b2430; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.qg b { color: #0f4799; }
table.rt .gd { display: block; font-weight: 400; color: #0f4799; font-size: .84em; }
.pt-doc { display: inline-flex; border: 1px solid var(--accent); border-radius: 6px; overflow: hidden; }
.pt-doc-b { font: inherit; font-size: .85rem; font-weight: 600; background: var(--surface); color: var(--accent-dark); border: 0; padding: 6px 12px; cursor: pointer; }
.pt-doc-b.on { background: var(--accent); color: #fff; }
