:root { color: #1e3338; background: #fff; font: 100%/1.5 system-ui, sans-serif; }
body { margin: 0; }
main { max-width: 42rem; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 3rem); }
h1, h2, h4 { line-height: 1.2; }
h2 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
section, nav { border-top: 1px solid #c6cfce; margin-top: 1.25rem; padding-top: .4rem; }
a { color: #175967; overflow-wrap: anywhere; }
.pupil-sheet { border: 0; margin: 2rem 0 0; padding: 0; }
.pupil-sheet:first-child { margin-top: 0; }
.pupil-sheet h1, .pupil-sheet h2 { font-size: 1.65rem; }
.sheet-edition, .grid-scale { font-size: .87rem; }
.offline-address { overflow-wrap: anywhere; }
.pupil-grid { display: block; max-width: 100%; height: auto; overflow: visible; }
.pupil-response { margin: 1rem 0; break-inside: avoid; }
.response-space { min-height: 3rem; border-bottom: 1px solid #718782; }
.pupil-sheet:has(.pupil-grid) .response-space { min-height: 1.1rem; }
@media print {
  @page { margin: 1.5cm; }
  main { padding: 0; max-width: none; font-size: 11pt; }
  h1, h2, h4 { break-after: avoid; }
  p { break-inside: avoid; }
  nav { display: none; }
  .pupil-sheet { break-before: page; margin: 0; }
  .pupil-sheet:first-child { break-before: auto; }
  .pupil-sheet { --writing-space: 38mm; }
  .pupil-sheet[data-fields="2"] { --writing-space: 55mm; }
  .pupil-sheet[data-fields="2"] .pupil-response:first-of-type { --writing-space: 78mm; }
  .pupil-sheet[data-fields="4"] { --writing-space: 22mm; }
  .pupil-sheet[data-fields="5"] { --writing-space: 18mm; }
  .pupil-sheet:has(.pupil-grid) { --writing-space: 9mm; }
  .pupil-grid { max-width: none; }
  .pupil-response { margin: .65rem 0; }
  .pupil-sheet .pupil-response .response-space { min-height: var(--writing-space); }
  a[href^="https"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
  .offline-address { display: none; }
  .pupil-sheet a[href^="https"]::after { content: none; }
  .observance-note h1 { font-size: 18pt; margin: 0 0 3mm; }
  .observance-note h2, .observance-note h3 { font-size: 12pt; margin: 3mm 0 1.5mm; break-after: avoid; }
  .observance-note p, .observance-note ul { margin: 0 0 2mm; line-height: 1.3; }
  .observance-note li { break-inside: avoid; }
}
