@font-face {
  font-family: "Alegreya Sans";
  src: url("fonts/alegreya-sans-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f5f2;
  --paper: #ffffff;
  --ink: #221a15;
  --ink-2: #5a4d44;
  --line: #d9d2c9;
  --line-2: #ebe6df;
  --walnut: #4a2c1b;
  --walnut-2: #6e4226;
  --accent: #7b4524;
  --accent-ink: #ffffff;
  --brass: #a87b2a;
  --brass-soft: #f4ead6;
  --warn-bg: #fff4dc;
  --warn-ink: #6b4a00;
  --err: #a3261b;
  --focus: #1f5fbf;
  --board-wood: #3b2417;
  --board-edge: #24150c;
  --board-label: #f0e2c6;
  --slot: #fbf8f1;
  --slot-ink: #1d1612;
  --r: 6px;
  --head: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171310;
    --paper: #211b17;
    --ink: #f1ebe4;
    --ink-2: #c3b6aa;
    --line: #4a3e35;
    --line-2: #352c26;
    --walnut: #1d1612;
    --walnut-2: #3b2a20;
    --accent: #e0a16c;
    --accent-ink: #1b120c;
    --brass: #d8b46a;
    --brass-soft: #3a2f1c;
    --warn-bg: #3a2e12;
    --warn-ink: #f3d892;
    --err: #ff9a8c;
    --focus: #8cb8ff;
    --board-wood: #34200f;
    --board-edge: #120b06;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.55 var(--body);
}
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { font-family: var(--head); font-weight: 800; line-height: 1.15; font-variant-numeric: lining-nums; }
h2 { font-size: 1.55rem; margin: 0 0 0.6rem; }
h3 { font-size: 1.25rem; margin: 0 0 0.5rem; }
small { font-size: 0.85em; }

/* ---------- top bar ---------- */
.topbar { background: var(--walnut); color: #f4e9d8; border-bottom: 4px solid var(--brass); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font: 800 1.3rem/1 var(--head); }
.toplinks { display: flex; gap: 18px; font-size: 0.95rem; }
.toplinks a { color: inherit; }
@media (max-width: 520px) { .toplinks a:first-child { display: none; } }
.in-setup .toplinks a[href="#board-h"] { display: none; }


/* ---------- hero ---------- */
.hero { padding: 22px 0 8px; max-width: 760px; }
.hero h1 { font-size: clamp(1.9rem, 5.2vw, 2.7rem); margin: 0 0 8px; color: var(--ink); }
.lede { margin: 0; color: var(--ink-2); font-size: 1.08rem; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.store-note, .example-banner { margin: 12px 0 0; padding: 10px 14px; border-left: 5px solid var(--brass); background: var(--warn-bg); color: var(--warn-ink); border-radius: 0 var(--r) var(--r) 0; }

/* ---------- layout ---------- */
.layout { display: grid; gap: 28px; margin-top: 18px; }
@media (min-width: 980px) {
  .layout { grid-template-columns: minmax(380px, 460px) 1fr; align-items: start; }
}

/* ---------- buttons and fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 8px 16px; border-radius: var(--r);
  border: 2px solid var(--accent); background: var(--paper); color: var(--accent);
  font: 600 1rem/1.2 var(--body); cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--brass-soft); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { border-color: var(--err); color: var(--err); }
.btn.icon { min-width: 46px; padding: 6px 10px; font-size: 1.4rem; line-height: 1; }
.btn.small { min-height: 40px; min-width: 40px; padding: 4px 10px; font-size: 0.95rem; }
.btn.icon.small { font-size: 1.1rem; }
.btn:disabled { opacity: 0.4; cursor: default; background: var(--paper); }
.row-btns { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 16px; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
input[type=text], input[type=date], select {
  font: inherit; font-size: 1.05rem; color: var(--ink); background: var(--paper);
  border: 2px solid var(--line); border-radius: var(--r); padding: 8px 10px; min-height: 46px; width: 100%;
}
input:focus, select:focus { border-color: var(--accent); }
input[aria-invalid=true] { border-color: var(--err); }
.field { display: block; margin: 0 0 12px; }
.field > span { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 1rem; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.hint { color: var(--ink-2); font-size: 0.95rem; margin: 6px 0 0; }
.err { color: var(--err); font-weight: 600; }

/* ---------- setup and class editor ---------- */
.setup { background: var(--paper); border: 2px solid var(--line); border-top: 6px solid var(--walnut-2); border-radius: var(--r); padding: 18px 16px; }
.ce-list { list-style: none; margin: 12px 0 0; padding: 0; counter-reset: ce; }
.ce-row {
  display: grid; gap: 8px 10px; padding: 12px 0; border-bottom: 1px solid var(--line-2);
  grid-template-columns: 1fr 1fr; grid-template-areas: "name name" "dept roll" "teacher teacher" "btns btns";
}
.ce-row label > span { display: block; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 2px; }
.ce-name { grid-area: name; } .ce-dept { grid-area: dept; } .ce-teacher { grid-area: teacher; } .ce-roll { grid-area: roll; }
.ce-btns { grid-area: btns; display: flex; gap: 6px; justify-content: flex-end; }
.class-editor { container-type: inline-size; }
@container (min-width: 700px) {
  .ce-row { grid-template-columns: 2fr 1.4fr 1.8fr 5.5em auto; grid-template-areas: "name dept teacher roll btns"; align-items: end; }
  .ce-row + .ce-row { padding-top: 6px; }
  .ce-row + .ce-row label > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.in-setup .layout { grid-template-columns: 1fr; }
.in-setup .setup { max-width: 980px; }
.box { margin-top: 22px; background: var(--paper); border: 2px solid var(--line); border-radius: var(--r); padding: 0 16px; }
.box > summary { cursor: pointer; font: 800 1.2rem/1.2 var(--head); padding: 14px 0; list-style-position: inside; }
.box[open] { padding-bottom: 16px; }
.small-h { font-size: 1.05rem; margin: 18px 0 6px; }
.past { margin: 0; padding-left: 1.2em; }
.past li { margin: 4px 0; }

/* ---------- Sunday entry ---------- */
.date-row { display: flex; align-items: flex-end; gap: 8px; }
.date-field { flex: 1; }
.date-field span { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 2px; }
.date-field input { font-size: 1.15rem; font-weight: 600; }
.date-note { margin: 6px 0 0; color: var(--warn-ink); background: var(--warn-bg); padding: 4px 10px; border-radius: var(--r); font-size: 0.95rem; }
.sofar { margin: 10px 0 0; min-height: 1.6em; font-size: 1rem; color: var(--ink-2); }
.sofar strong { color: var(--ink); }
.nudge { margin: 8px 0 0; padding: 8px 12px; border-left: 4px solid var(--brass); background: var(--warn-bg); color: var(--warn-ink); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; scroll-margin-top: 8px; }
.class-pick { display: none; margin: 12px 0 0; scroll-margin-top: 8px; }
.class-pick span { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 2px; }
.class-pick select { font-weight: 700; font-size: 1.1rem; }
@media (max-width: 600px) {
  .chips { display: none; }
  .class-pick { display: block; }
}
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 100%;
  padding: 6px 12px; border: 2px solid var(--line); border-radius: var(--r); background: var(--paper); color: var(--ink);
  font: 600 0.95rem/1.2 var(--body); cursor: pointer; text-align: left;
}
.chip-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 15em; }
.chip.done { border-color: var(--brass); }
.chip-v { font-variant-numeric: tabular-nums; background: var(--brass-soft); color: var(--ink); border-radius: 4px; padding: 1px 6px; font-size: 0.9rem; }
.chip[aria-current=step] { background: var(--walnut-2); border-color: var(--walnut-2); color: #fff; }
.chip[aria-current=step] .chip-v { background: rgba(255, 255, 255, 0.2); color: #fff; }
@media (prefers-color-scheme: dark) {
  .chip[aria-current=step] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .chip[aria-current=step] .chip-v { background: rgba(0, 0, 0, 0.15); color: var(--accent-ink); }
}
.chip.school { border-style: dashed; }
.chip.school.done { border-style: solid; }

.cform { margin-top: 14px; background: var(--paper); border: 2px solid var(--line); border-left: 6px solid var(--walnut-2); border-radius: var(--r); padding: 14px 14px 10px; }
.cform h3 { font-size: 1.45rem; margin: 0 0 10px; }
.cform h3 small { display: block; font: 400 0.95rem/1.3 var(--body); color: var(--ink-2); margin-top: 2px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.num { display: flex; flex-direction: column; justify-content: flex-end; }
.num .lab { font-weight: 600; font-size: 0.98rem; line-height: 1.25; margin-bottom: 4px; }
.num .lab small { display: block; font-weight: 400; color: var(--ink-2); font-size: 0.82rem; }
.num .inp { position: relative; display: block; }
.num input {
  font-size: 1.45rem; font-weight: 700; min-height: 54px; padding: 6px 12px;
  font-variant-numeric: tabular-nums; letter-spacing: 0.01em;
}
.num .money input { padding-left: 30px; }
.num .cur { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 1.3rem; font-weight: 700; color: var(--ink-2); pointer-events: none; }
.ferr { min-height: 1.3em; font-size: 0.85rem; color: var(--ink-2); }
.ferr.bad { color: var(--err); font-weight: 600; }
.f-off { grid-column: 1 / -1; }
.cform fieldset { border: 0; border-top: 2px solid var(--line-2); margin: 8px 0 0; padding: 8px 0 0; }
.cform legend { font-weight: 700; padding: 0 6px 0 0; }
.note-field { margin-top: 6px; }
.ctotal { margin: 4px 0 0; font-size: 1rem; }
.ctotal strong { font-size: 1.2rem; }
.ctotal span { color: var(--ink-2); }
.warn { margin: 6px 0 0; padding: 0; list-style: none; }
.warn li { background: var(--warn-bg); color: var(--warn-ink); padding: 6px 10px; border-radius: var(--r); margin-top: 6px; font-size: 0.95rem; }
.step-btns { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; }
.step-btns .btn { flex: 1; }
.step-btns .btn.primary { flex: 2; }

/* ---------- reports column ---------- */
.out-col { min-width: 0; container-type: inline-size; }
.tabs { display: flex; gap: 4px; border-bottom: 3px solid var(--walnut-2); overflow-x: auto; scrollbar-width: none; }
.tabs [role=tab] {
  flex: 0 1 auto; min-height: 46px; padding: 8px 14px; line-height: 1.15; border: 2px solid transparent; border-bottom: 0; border-radius: var(--r) var(--r) 0 0;
  background: none; color: var(--ink-2); font: 700 1rem/1.2 var(--body); cursor: pointer;
}
.tabs [role=tab][aria-selected=true] { background: var(--walnut-2); color: #fff; }
@media (max-width: 440px) { .tabs [role=tab] { flex: 1 1 0; padding: 6px 8px; font-size: 0.95rem; } }
.panel { padding-top: 14px; }
.panel-h { font-size: 1.5rem; margin: 0 0 6px; }
.panel-h small { font: 600 1rem var(--body); color: var(--ink-2); margin-left: 6px; }
.empty { color: var(--ink-2); font-size: 1.05rem; }
.headline { font-size: 1.15rem; margin: 4px 0 10px; }
.headline strong { font: 800 1.7rem/1 var(--head); font-variant-numeric: lining-nums tabular-nums; }
.dot { color: var(--ink-2); padding: 0 4px; }
.missing { margin: 0 0 10px; color: var(--warn-ink); background: var(--warn-bg); padding: 6px 10px; border-radius: var(--r); font-size: 0.95rem; }
.print-btns { border-top: 1px solid var(--line-2); padding-top: 14px; margin-top: 18px; }

table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.cmp { width: 100%; max-width: 460px; margin: 0 0 16px; font-size: 0.98rem; }
.cmp th, .cmp td { padding: 6px 8px; border-bottom: 1px solid var(--line-2); text-align: right; vertical-align: top; }
.cmp thead th { font-size: 0.88rem; color: var(--ink-2); font-weight: 600; }
.cmp th:first-child { text-align: left; }
.cmp small { display: block; font-size: 0.78rem; color: var(--ink-2); font-weight: 400; }
.cmp tbody tr:first-child td { font-weight: 700; }

.tbl-wrap { width: 100%; }
.rep { width: 100%; font-size: 0.95rem; }
.rep th, .rep td { padding: 6px 6px; text-align: right; border-bottom: 1px solid var(--line-2); }
.rep thead th { font-size: 0.8rem; line-height: 1.15; color: var(--ink-2); font-weight: 600; vertical-align: bottom; }
.rep .c-name { text-align: left; font-weight: 600; min-width: 9.5em; }
.rep .c-name small { display: block; font-weight: 400; color: var(--ink-2); font-size: 0.82rem; }
.rep tr.dept th { text-align: left; font: 800 1.05rem var(--head); padding-top: 14px; color: var(--walnut-2); border-bottom: 2px solid var(--line); }
@media (prefers-color-scheme: dark) { .rep tr.dept th { color: var(--brass); } }
.rep tr.sub th, .rep tr.sub td { font-weight: 700; background: var(--brass-soft); }
.rep tfoot th, .rep tfoot td { font-weight: 800; border-top: 3px double var(--ink); border-bottom: 0; padding-top: 8px; }
.rep td.c-att { font-weight: 700; }
.rep tr.unrep .nr { text-align: left; color: var(--ink-2); font-style: italic; }
.rep td small { display: block; font-size: 0.75rem; color: var(--ink-2); white-space: nowrap; }

/* Narrow column: each class becomes a block of labelled figures. */
@container (max-width: 640px) {
  .rep thead { display: none; }
  .rep, .rep tbody, .rep tfoot, .rep tr { display: block; width: 100%; }
  .rep tr { display: flex; flex-wrap: wrap; gap: 2px 14px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
  .rep th, .rep td { display: block; border: 0; padding: 0; text-align: left; }
  .rep .c-name { flex: 0 0 100%; font-size: 1.02rem; }
  .rep .c-name small { display: inline; margin-left: 6px; }
  .rep td[data-l]::before { content: attr(data-l) " "; color: var(--ink-2); font-size: 0.85rem; font-weight: 400; }
  .rep td small { display: inline; margin-left: 4px; }
  .rep tr.dept { padding-top: 14px; border-bottom: 2px solid var(--line); }
  .rep tr.dept th { padding: 0; border: 0; }
  .rep tr.sub { background: var(--brass-soft); padding: 8px; border-radius: var(--r); }
  .rep tr.sub th, .rep tr.sub td { background: none; }
  .rep tfoot tr { border-top: 3px double var(--ink); padding-top: 10px; }
  .rep tfoot th, .rep tfoot td { border: 0; padding: 0; }
  .rep tr.unrep .nr { flex: 0 0 100%; }
}

/* ---------- the board ---------- */
.board {
  background:
    repeating-linear-gradient(92deg, rgba(255, 255, 255, 0.025) 0 3px, transparent 3px 11px),
    linear-gradient(180deg, #4a2d1c, var(--board-wood));
  border: 10px solid var(--board-edge);
  border-radius: 4px;
  padding: 14px 14px 10px;
  color: var(--board-label);
  box-shadow: inset 0 0 0 2px #6b4329;
  max-width: 620px;
}
.bline { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 2px solid rgba(240, 226, 198, 0.18); }
.bline:last-child { border-bottom: 0; }
.blabel { font: 800 1.12rem/1.15 var(--head); letter-spacing: 0.01em; }
.bval { flex: 0 0 auto; }
.slots { display: inline-flex; gap: 3px; }
.slot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.45rem; height: 2.1rem; background: var(--slot); color: var(--slot-ink);
  font: 800 1.55rem/1 var(--head); font-variant-numeric: lining-nums tabular-nums; border-radius: 2px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}
.slot.sym { width: 0.95rem; }
.bempty { margin: 6px 0; }
.board-opts { margin-top: 12px; }
.board-opts summary { cursor: pointer; font-weight: 700; min-height: 40px; display: list-item; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 14px; }
@container (max-width: 400px) {
  .slot { width: 1.2rem; height: 1.8rem; font-size: 1.3rem; }
  .blabel { font-size: 1rem; }
  .board { padding: 10px; border-width: 8px; }
}

/* ---------- quarter and year ---------- */
.period-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.period-row label { flex: 1 1 200px; }
.period-row span { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }
.keyfig { width: 100%; margin-bottom: 18px; font-size: 0.98rem; }
.keyfig th, .keyfig td { padding: 6px 8px; border-bottom: 1px solid var(--line-2); text-align: right; }
.keyfig th:first-child { text-align: left; font-weight: 600; }
.keyfig thead th { font-size: 0.85rem; color: var(--ink-2); font-weight: 600; }
.keyfig td:nth-child(2) { font-weight: 700; }
.keyfig small { color: var(--ink-2); font-weight: 400; white-space: nowrap; }
@container (max-width: 480px) {
  .keyfig thead th:nth-child(n+3), .keyfig td:nth-child(n+3) { font-size: 0.85rem; }
  .keyfig th, .keyfig td { padding: 6px 4px; }
}
@container (max-width: 340px) {
  /* big schools' totals ("$118,507.80", "+$1,340.30 (14%)") still fit a 320 px phone */
  .keyfig { font-size: 0.9rem; }
  .keyfig th, .keyfig td { padding: 6px 2px; }
  .keyfig thead th:nth-child(n+3), .keyfig td:nth-child(n+3) { font-size: 0.8rem; }
  .keyfig th:first-child { hyphens: auto; }
}

/* ---------- settings ---------- */
.settings-grid { display: grid; gap: 8px 32px; }
@media (min-width: 820px) { .settings-grid { grid-template-columns: 1fr 1fr; } }
.settings h3 { margin-top: 12px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm { margin-top: 12px; padding: 12px; border: 2px solid var(--brass); border-radius: var(--r); background: var(--warn-bg); color: var(--warn-ink); }
.confirm p { margin: 0; }

/* ---------- content ---------- */
.content { max-width: 760px; margin: 40px 0 0; }
.content h2 { margin-top: 32px; }
.content p { margin: 0 0 14px; }
.content details { border-bottom: 1px solid var(--line); }
.content summary { cursor: pointer; font-weight: 700; padding: 12px 0; min-height: 44px; }
.content details p { margin: 0 0 14px; }
.sources { font-size: 0.92rem; color: var(--ink-2); margin-top: 26px !important; }

footer { margin-top: 48px; padding: 22px 0 30px; border-top: 4px solid var(--brass); background: var(--paper); font-size: 0.92rem; color: var(--ink-2); }
footer a { color: var(--ink-2); }

.toast {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); width: max-content;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--r); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}
.toast .btn { border-color: var(--bg); background: transparent; color: var(--bg); }

.print-root { display: none; }

@media (prefers-color-scheme: dark) {
  .tabs [role=tab][aria-selected=true] { background: var(--accent); color: var(--accent-ink); }
  .tabs { border-bottom-color: var(--accent); }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* ---------- print ---------- */
@media print {
  body { background: #fff; color: #000; font: 10.5pt/1.35 var(--body); }
  body > *:not(.print-root) { display: none !important; }
  .print-root { display: block; }
  .sheet { break-after: page; color: #000; }
  .sheet:last-child { break-after: auto; }
  .ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 12pt; border-bottom: 2pt solid #000; padding-bottom: 4pt; margin-bottom: 8pt; }
  .ph h2 { font: 800 20pt/1.05 var(--head); margin: 0; }
  .ph-school { margin: 0 0 2pt; font-size: 11pt; font-weight: 600; }
  .ph-sub { margin: 0; text-align: right; font-size: 11pt; font-weight: 600; }
  .p-headline { font-size: 11.5pt; margin: 0 0 8pt; }
  .p-note { font-size: 9.5pt; margin: 6pt 0 0; }
  .rep { width: 100%; font-size: 9.5pt; table-layout: fixed; }
  .rep thead th { width: 0.47in; }
  .rep thead th.c-off { width: 0.78in; }
  .rep thead th.c-pres, .rep thead th.c-newm { width: 0.6in; }
  .rep thead th.c-teach { width: 1.25in; }
  .rep thead th.c-tch, .rep thead th.c-vis, .rep thead th.c-con, .rep thead th.c-les { width: 0.55in; }
  .rep.dense { font-size: 8.5pt; }
  .rep.dense td, .rep.dense tbody th, .rep.dense tfoot th { padding-top: 1pt; padding-bottom: 1pt; }
  .rep.dense tr.dept th { padding-top: 3pt; }
  .rep thead th.c-name { width: 1.95in; }
  .rep.sum thead th { width: 0.62in; }
  .rep.sum thead th.c-off { width: 0.85in; }
  .rep.sum thead th.c-high { width: 0.85in; }
  .rep.sum thead th.c-name { width: 2.1in; }
  .rep td, .rep tbody th, .rep tfoot th { overflow-wrap: break-word; }
  .rep thead th { overflow-wrap: normal; word-break: keep-all; hyphens: none; font-size: 7.5pt; }
  .landscape .rep thead th.c-name { width: 1.75in; }
  .landscape .rep thead th.c-teach { width: 1.1in; }
  .landscape .rep th, .landscape .rep td { padding-top: 1.5pt; padding-bottom: 1.5pt; }
  .landscape .rep tr.dept th { padding-top: 4pt; }
  .p-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 24pt; margin-top: 10pt; break-inside: avoid; }
  .p-foot .cmp { margin: 0; }
  .p-foot .sign { margin: 0 0 2pt; line-height: 1.6; }
  .p-foot .sign span { width: 2in; }
  .p-foot .sign span.short { width: 1.2in; }
  .rep th, .rep td { padding: 2.5pt 4pt; border-bottom: 0.6pt solid #999; text-align: right; }
  .rep thead th { font-size: 8pt; color: #000; font-weight: 700; border-bottom: 1.2pt solid #000; }
  .rep .c-name { text-align: left; font-weight: 600; }
  .rep .c-teach { text-align: left; font-size: 8.5pt; }
  .rep .c-name small { font-weight: 400; color: #333; font-size: 8pt; }
  .rep tr.dept th { font: 800 10.5pt var(--head); color: #000; padding-top: 6pt; border-bottom: 1pt solid #000; }
  .rep tr.sub th, .rep tr.sub td { font-weight: 700; background: none; border-bottom: 1pt solid #000; }
  .rep tfoot th, .rep tfoot td { font-weight: 800; border-top: 2pt double #000; border-bottom: 0; }
  .rep tbody { break-inside: avoid; }
  .rep tr { break-inside: avoid; }
  .rep tr.unrep .nr { text-align: left; font-style: italic; color: #333; }
  .rep td small { display: inline; font-size: 7.5pt; color: #333; margin-left: 3pt; white-space: nowrap; }
  .rep tfoot { display: table-row-group; }
  .rep .c-name small { display: block; margin-left: 0; }
  .sh-summary .rep th, .sh-summary .rep td { padding: 2pt 4pt; }
  .cmp { width: 4.6in; margin: 10pt 0 0; font-size: 10pt; break-inside: avoid; }
  .cmp.blank td { width: 0.95in; }
  .cmp th, .cmp td { padding: 3pt 6pt; border: 0.8pt solid #000; text-align: right; }
  .cmp th:first-child { text-align: left; }
  .cmp thead th { font-size: 8.5pt; font-weight: 700; color: #000; }
  .cmp small { display: block; font-size: 7.5pt; font-weight: 400; color: #333; }
  .cmp.blank td { height: 22pt; }
  .rep.blank td, .rep.blank th { height: 21pt; border: 0.8pt solid #000; }
  .rep.blank thead th { height: auto; }
  .sign { margin: 22pt 0 0; font-size: 10.5pt; break-inside: avoid; }
  .sign span { display: inline-block; width: 2.6in; border-bottom: 0.8pt solid #000; margin: 0 14pt 0 4pt; }
  .sign span.short { width: 1.3in; }
  .keyfig { width: 100%; font-size: 9.5pt; margin-bottom: 10pt; }
  .keyfig th, .keyfig td { padding: 2pt 6pt; border-bottom: 0.6pt solid #999; text-align: right; }
  .keyfig small { white-space: nowrap; }
  .keyfig th:first-child { text-align: left; }
  .keyfig thead th { font-size: 8.5pt; border-bottom: 1.2pt solid #000; }
  .keyfig small { color: #333; }
  /* the board, large enough to read across the room */
  .pboard { width: 100%; margin-top: 14pt; }
  .pboard th { text-align: left; font: 800 22pt/1.1 var(--head); padding: 9pt 0; border-bottom: 1pt solid #999; }
  .pboard td { text-align: right; font: 800 50pt/1 var(--head); font-variant-numeric: lining-nums tabular-nums; padding: 6pt 0; border-bottom: 1pt solid #999; }
  /* class report slips, four to a page */
  .sh-slips { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 4.9in; gap: 0.2in; }
  .slip { border: 1pt dashed #555; padding: 12pt; break-inside: avoid; display: flex; flex-direction: column; }
  .slip-t { display: flex; justify-content: space-between; font: 800 14pt var(--head); margin: 0 0 6pt; }
  .slip-t span { font: 400 10pt var(--body); }
  .slip-c { font-size: 12pt; font-weight: 700; margin: 0 0 6pt; }
  .slip-c small { display: block; font-weight: 400; font-size: 9.5pt; }
  .slip table { width: 100%; }
  .slip th { text-align: left; font-weight: 400; font-size: 11pt; padding: 8pt 0 2pt; width: 55%; }
  .slip td { border-bottom: 0.8pt solid #000; font-size: 11pt; vertical-align: bottom; }
  .six-slip .slip th { padding-top: 4pt; }
  .slip-s { margin: auto 0 0; font-size: 9pt; }
  .landscape .rep { font-size: 9pt; }
}
@media print {
  .six-note { font-size: 8.5pt; color: #000; margin: 6pt 0 0; }
}
@media print {
  .landscape .p-foot { margin-top: 6pt; }
}
@media print {
  /* the summary stays portrait with the six-point Grade column */
  .rep.sum.six thead th { width: 0.56in; }
  .rep.sum.six thead th.c-name { width: 1.75in; }
  .rep.sum.six thead th.c-sundays { width: 0.5in; }
  .rep.sum.six thead th.c-avgAtt, .rep.sum.six thead th.c-avgPres { width: 0.66in; }
  .rep.sum.six thead th.c-high { width: 0.72in; }
  .rep.sum.six thead th.c-off { width: 0.8in; }
}
@media print {
  /* repeated at the top of every page of a long summary */
  .rep thead .run { display: block; font-weight: 400; color: #333; margin-bottom: 2pt; }
}
@media print {
  .sh-blank .p-foot .sign { white-space: nowrap; flex: none; }
  .sh-blank .p-foot .sign span { width: 1.3in; margin-right: 0; }
  .sh-blank .p-foot .cmp.blank td { width: 0.85in; }
}
