/* OOP Trainer – print stylesheet (loaded with media="print"; inlined into downloaded exams).
 * While an exam is open in the Mock exam view (body.is-exam-print) only the exam sheet prints:
 * A4, real margins, one task per page, page numbers in the margin where the browser supports it.
 */
@page {
  size: A4;
  margin: 16mm 15mm 18mm 15mm;
  @bottom-right { content: counter(page) " / " counter(pages); font: 8.5pt Arial, sans-serif; color: #444; }
}

html, body { background: #fff !important; color: #000 !important; }
.topbar, .action-bar, #setup, #fatal, #storage-warning, .tabs { display: none !important; }
.mascot-say, .mascot-slot, .mascot-cameo, .mascot-empty .mascot-swim, .loading__mascot, .ta-art { display: none !important; }

/* ---- Exam printing: hide the app chrome around the sheet ---- */
body.is-exam-print .app > :not(#view-exam),
body.is-exam-print #view-exam > :not(#exam-viewer),
body.is-exam-print #exam-viewer > :not(#exam-preview) { display: none !important; }
body.is-exam-print .app, body.is-exam-print .view, body.is-exam-print #exam-viewer {
  display: block !important; padding: 0 !important; margin: 0 !important; max-width: none !important;
  border: 0 !important; background: none !important; box-shadow: none !important;
  overflow: visible !important;
}
.exam-preview { display: block !important; padding: 0 !important; background: none !important; overflow: visible !important; }
.exam-preview .exam-sheet { display: block !important; }
.exam-preview[data-print-solutions="false"] .exam-sheet[data-kind="solutions"] { display: none !important; }

.exam-sheet {
  max-width: none !important; margin: 0 !important; padding: 0 !important; box-shadow: none !important;
  font-size: 11pt; color: #000; background: #fff;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.exam-sheet + .exam-sheet { break-before: page; }
.exam-task { break-before: page; border-top: 0; margin-top: 0; padding-top: 0; }
.exam-sheet[data-kind="solutions"] .exam-task { break-before: auto; margin-top: 8mm; }
.exam-runhead { display: flex; }
.exam-task__head, .exam-part__head { break-after: avoid; }
.exam-sheet pre.code { white-space: pre-wrap; overflow: visible; break-inside: avoid; font-size: 9pt; }
.exam-sheet { box-shadow: none !important; }
.exam-sheet .code--numbered code { min-width: 0 !important; }
.answer-space, .answer-table, .exam-cover__fields, .exam-points { break-inside: avoid; }
.exam-part { break-inside: auto; }
.exam-cover__blank, .exam-points th, .exam-points td { border-color: #000; }
a { color: inherit; text-decoration: none; }
/* the cover (meta, name fields, rules, points table) must fit on one A4 page */
.exam-cover { font-size: 10pt; line-height: 1.35; }
.exam-cover .exam-points th, .exam-cover .exam-points td { padding-top: 1mm; padding-bottom: 1mm; }
