/* Printed sheets. One .sheet per page; page size set by @page from sheet.js. */
#print-root { display: none; }
.qr { width: 22mm; height: 22mm; display: block; }

@media print {
  html, body { background: #fff !important; margin: 0; padding: 0; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; color: #000; font: 400 11pt/1.4 "Lexend", system-ui, var(--cjk), sans-serif; }
  .sheet { width: var(--pw, 210mm); height: var(--ph, 297mm); padding: 12mm 13mm 10mm; box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; break-after: page; page-break-after: always; position: relative; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
}
/* Shared sheet parts (also used for the on-screen key view). */
.sh-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 6mm; border-bottom: .6mm solid #263049; padding-bottom: 3mm; margin-bottom: 5mm; flex-wrap: wrap; }
.sh-title { font: 700 15pt/1.2 "Lexend", system-ui, var(--cjk), sans-serif; }
.sh-sub { font-size: 9.5pt; color: #444; }
.sh-fields { display: flex; gap: 5mm; font-size: 10pt; }
.sh-fields span { display: inline-flex; align-items: flex-end; gap: 2mm; }
.sh-fields i { display: inline-block; width: 38mm; border-bottom: .3mm solid #263049; height: 5mm; }
.sh-fields i.s { width: 20mm; }
.sh-body { flex: 1; min-height: 0; }
.sh-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 6mm; border-top: .3mm solid #999; padding-top: 3mm; margin-top: 4mm; font-size: 8.5pt; color: #444; }
.sh-qr { display: flex; align-items: center; gap: 2.5mm; }
.sh-qr span { max-width: 32mm; font-size: 8pt; line-height: 1.3; }
.sh-key-tag { display: inline-block; border: .4mm solid #000; padding: .5mm 2mm; font-size: 9pt; margin-left: 3mm; vertical-align: middle; }
.sh-ans { color: #C0392B; font-weight: 600; } /* answers on the key page are red-pen, like a teacher's key */
.sh-mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.ghost, .ghost * { visibility: hidden; }
/* Parent printables and the reading card */
.pp-cal, .pp-read, .pp-plan { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11pt; }
.pp-cal th, .pp-read th, .pp-plan th { background: #F1F4FA; border: .3mm solid #7F9AC2; padding: 1.5mm; font-weight: 600; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pp-cal td { border: .3mm solid #7F9AC2; height: 30mm; vertical-align: top; padding: 1.5mm; }
.pp-cal .d { font: 600 12pt "IBM Plex Mono", monospace; }
.pp-read td, .pp-plan td { border: .3mm solid #7F9AC2; height: min(12mm, calc((var(--ph, 297mm) - 104mm) / 15)); padding: 1mm 2mm; }
.pp-read td.how { color: #8A93AB; text-align: center; letter-spacing: .2em; white-space: nowrap; overflow: hidden; }
.pp-read th:nth-child(1) { width: 18%; } .pp-read th:nth-child(2) { width: 40%; }
.pp-plan th:first-child { width: 12%; }
.pp-plan td { height: 22mm; }
.pp-note { font-size: 9.5pt; color: #444; margin-top: 3mm; }
.pp-preview { overflow: auto; max-height: 480px; border: 2px solid var(--edge); border-radius: 12px; padding: 12px; background: #fff; margin: 10px 0; font-size: 12px; }
.pp-preview table { width: 100%; border-collapse: collapse; }
.pp-preview td, .pp-preview th { border: 1px solid #B9C9E2; padding: 4px; height: 34px; vertical-align: top; }
