.document-actions { display:flex; align-items:center; gap:.45rem; flex-shrink:1; flex-wrap:wrap; max-width:100%; }
.document-actions .document-action { min-height:2.65rem; padding:.55rem .85rem; gap:.5rem; font-size:.9rem; background:var(--theme-surface,#fff); border:1px solid var(--theme-accent-border,#b7ccbf); color:var(--theme-green-text,#245d48); box-shadow:0 1px 2px #162f2210; }
.document-actions .document-action:hover { background:var(--theme-green-soft,#ecf4ee); border-color:var(--green); }
.document-actions .document-action .icon { width:1.15rem; height:1.15rem; flex-shrink:0; }
.document-action[aria-busy=true] { cursor:progress; opacity:.65; }
.document-bar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.7rem 1rem; padding:.8rem 1.2rem; border-bottom:1px solid var(--line); background:var(--theme-surface-muted,#f8faf8); }
.document-bar>span { display:flex; align-items:center; gap:.5rem; font-size:.85rem; color:var(--muted); }
.document-bar>.icon { width:1.1rem; }
.diary-day-heading { flex-wrap:wrap; gap:.8rem; }
.diary-day-heading>div:first-child { display:grid; gap:.3rem; }
.diary-result-heading { flex-wrap:wrap; gap:.8rem; }
.diary-result-heading>div:first-child { display:grid; gap:.25rem; }
.diary-result-heading [role=status] { color:var(--muted); font-size:.85rem; }
.task-document-bar { display:flex; align-items:center; justify-content:space-between; gap:.75rem; flex-wrap:wrap; margin:0 0 1rem; padding-bottom:1rem; border-bottom:1px solid var(--line); }
.task-document-bar>span { font-size:.85rem; color:var(--muted); }
.review-document-actions { display:flex; align-items:center; flex-wrap:wrap; gap:.6rem; }
dialog.document-preview { width:min(96vw,1180px); max-width:1180px; max-height:94dvh; padding:0; border:1px solid var(--line); border-radius:18px; background:var(--theme-surface,#f3f5f2); color:var(--theme-text,#243b30); overflow:hidden; }
dialog.document-preview[open] { display:flex; flex-direction:column; }
.document-preview::backdrop { background:#101b16a8; }
.document-preview-toolbar { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1rem 1.3rem; border-bottom:1px solid var(--line); background:var(--theme-surface,#fff); flex-shrink:0; }
.document-preview-toolbar h2 { margin:0; font-size:1.05rem; }
.document-preview-toolbar p { margin:.3rem 0 0; color:var(--muted); font-size:.8rem; }
.document-preview-actions { display:flex; align-items:center; gap:.5rem; }
.document-preview-actions .button { font-size:.85rem; white-space:nowrap; }
.document-preview-scroll { overflow:auto; padding:1.25rem; min-height:0; }
/* A sheet stays white in either UI theme, just like the resulting PDF. */
.school-document { color-scheme:light; box-sizing:border-box; background:#fff; color:#24342c; font:14px/1.55 Arial,sans-serif; width:100%; max-width:794px; margin:0 auto; padding:38px 42px; border-radius:3px; box-shadow:0 3px 18px #00000012; overflow-wrap:anywhere; }
.school-document.landscape { max-width:1123px; min-width:800px; }
.school-document * { box-sizing:border-box; }
.school-document h1,.school-document h2,.school-document h3 { color:#233d30; font-family:Arial,sans-serif; line-height:1.3; }
.school-document h1 { font-size:27px; margin:14px 0 12px; }
.school-document h2 { font-size:19px; margin:0 0 10px; }
.school-document h3 { font-size:16px; margin:12px 0 8px; }
.document-heading { padding-bottom:20px; margin-bottom:22px; border-bottom:1px solid #c8d7ce; }
.school-document .document-brand { color:#286849; font-size:18px; letter-spacing:2px; font-weight:700; }
.document-brand small { font-size:10px; letter-spacing:.5px; font-weight:400; margin-left:10px; }
.document-heading p { margin:4px 0; }
.document-section { padding:0 0 22px; margin:0 0 22px; border-bottom:1px solid #dce5de; }
.document-meta { display:flex; flex-direction:column; gap:3px; color:#58685e; font-size:12px; }
.document-text { white-space:pre-wrap; margin:14px 0; }
.document-questions>li { margin-bottom:16px; }
.document-questions ul { list-style:none; padding-left:8px; margin-top:6px; }
.document-questions li li { padding:2px 0; }
.school-document figure { margin:18px 0; break-inside:avoid; }
.school-document figure img { max-width:100%; max-height:650px; object-fit:contain; }
.school-document figcaption { font-size:11px; color:#58685e; }
.document-files { margin-top:14px; font-size:12px; }
.document-files ul { padding-left:18px; margin:5px 0; }
.document-files small { display:block; color:#58685e; }
.document-link { font-size:12px; }
.school-document a { color:#286849; }
.document-schedule { width:100%; border-collapse:collapse; table-layout:fixed; font-size:11px; }
.document-schedule th,.document-schedule td { border:1px solid #cdd9d1; padding:9px; vertical-align:top; text-align:left; }
.document-schedule thead th { background:#edf4ef; color:#294a37; text-transform:capitalize; }
.document-schedule th:first-child { width:52px; text-align:center; white-space:nowrap; }
.document-lesson { display:flex; flex-direction:column; gap:3px; }
.document-lesson+.document-lesson { margin-top:10px; padding-top:8px; border-top:1px dashed #cdd9d1; }
.document-lesson strong { font-size:12px; }
.document-lesson small { font-size:10px; color:#58685e; }
.document-free { color:#9ca99f; }
.document-footer { color:#67766d; font-size:10px; margin-top:24px; }
#school-print-root { display:none; }
@media(max-width:650px) {
  .document-preview-toolbar { position:relative; align-items:flex-start; flex-wrap:wrap; padding:.85rem; gap:.7rem; }
  .document-preview-toolbar>div:first-child { padding-right:2rem; }
  .document-preview-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; }
  .document-preview-actions .button { min-width:0; white-space:normal; min-height:44px; }
  .document-preview-actions .icon-button { position:absolute; right:.65rem; top:.65rem; }
  .document-preview-scroll { padding:.6rem; }
  .school-document { padding:22px; }
  .document-bar { padding:.75rem; }
  .diary-result-heading,.task-document-bar { align-items:flex-start; }
  .document-actions .document-action { min-height:44px; }
}
@media print {
  html:has(body.printing-school-document), body.printing-school-document { height:auto!important; overflow:visible!important; background:#fff!important; color-scheme:light; }
  body.printing-school-document>*:not(#school-print-root) { display:none!important; }
  body.printing-school-document #school-print-root { display:block!important; }
  #school-print-root .school-document { width:100%; max-width:none; min-width:0; padding:0; margin:0; box-shadow:none; border:0; font-size:11pt; }
  #school-print-root .document-heading { margin-bottom:6mm; padding-bottom:5mm; }
  #school-print-root h1 { font-size:22pt; }
  #school-print-root h2,#school-print-root h3 { break-after:avoid; }
  #school-print-root p { orphans:3; widows:3; }
  #school-print-root .document-schedule tr { break-inside:avoid; }
  #school-print-root .document-schedule thead { display:table-header-group; }
  #school-print-root .document-schedule { font-size:9pt; }
  #school-print-root .document-schedule th,#school-print-root .document-schedule td { padding:3mm; }
  #school-print-root .document-schedule th:first-child { width:12mm; }
  #school-print-root .document-lesson strong { font-size:10pt; }
  #school-print-root .document-lesson small { font-size:8pt; }
  #school-print-root figure img { max-height:180mm; }
  #school-print-root .document-footer { font-size:8pt; }
}
