@font-face {
  font-family: "Card Sans";
  src: url("fonts/card-sans.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  --bg: #eaf3f1;
  --surface: #ffffff;
  --ink: #10302f;
  --ink2: #375250;
  --line: #b9cfca;
  --soft: #d9e9e5;
  --accent: #0b665e;
  --accent-ink: #ffffff;
  --pencil: #f2b705;
  --known: #156535;
  --known-bg: #dcf2e3;
  --nyet: #a8350c;
  --nyet-bg: #fde4d8;
  --warn-bg: #fff4cf;
  --card: "Card Sans", "Andika", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1d1f;
    --surface: #162a2c;
    --ink: #e3efed;
    --ink2: #b0c7c4;
    --line: #34504f;
    --soft: #1f3638;
    --accent: #5cc8bb;
    --accent-ink: #082422;
    --pencil: #f2c94c;
    --known: #7fd99d;
    --known-bg: #183d27;
    --nyet: #ffa27e;
    --nyet-bg: #43241a;
    --warn-bg: #3d3412;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--ui);
}
main { max-width: 1000px; margin: 0 auto; padding: 20px 16px 40px; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--card); font-weight: 400; line-height: 1.2; }
h1 { font-size: 42px; margin: 8px 0 6px; letter-spacing: -0.5px; }
h2 { font-size: 26px; margin: 0 0 10px; }
h3 { font-size: 20px; margin: 22px 0 4px; }
.lede { margin: 0 0 18px; max-width: 64ch; font-size: 18px; color: var(--ink2); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--pencil); outline-offset: 2px; }
[hidden] { display: none !important; }

/* buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 16px;
  font: inherit; font-size: 16px; line-height: 1.2;
  color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--r);
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.main { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.quiet { background: transparent; }
.btn.danger { background: var(--nyet); color: #fff; border-color: var(--nyet); }
.btn.small { min-height: 40px; padding: 6px 12px; }
.btn.icon { width: 44px; padding: 0; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn .mk { width: 18px; height: 18px; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 14px; }
label, legend { font-weight: 600; font-size: 16px; }
input, select, textarea {
  font: inherit; font-size: 17px; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 8px; padding: 9px 11px; min-height: 44px; width: 100%;
}
textarea, .wt .w { font-variant-ligatures: none; }
textarea { font-family: var(--card); font-size: 19px; line-height: 1.45; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 400; cursor: pointer; }
.check input { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--accent); }
.read { color: var(--ink2); margin: 2px 0 0; min-height: 1.5em; font-size: 16px; }
.hint { color: var(--ink2); margin: 0 0 12px; }
.small-gap { margin-top: -4px; }
.note { background: var(--warn-bg); border-radius: var(--r); padding: 10px 14px; margin: 0 0 14px; }
.note.info { background: var(--soft); }
.warn { background: var(--warn-bg); border-radius: 8px; padding: 8px 12px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* list bar and tabs */
.listbar { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.listbar select { width: auto; max-width: 100%; flex: 1 1 220px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-top: 4px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs [role="tab"] {
  flex: 0 0 auto; min-height: 46px; padding: 8px 16px;
  font: inherit; font-size: 16px; font-weight: 600; color: var(--ink2);
  background: var(--soft); border: 1.5px solid var(--line); border-bottom: 0;
  border-radius: 12px 12px 0 0; cursor: pointer; position: relative; top: 1.5px;
}
.tabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--ink); z-index: 1; }
.tabs [role="tab"][aria-selected="true"]::before {
  content: ""; position: absolute; left: 12px; right: 12px; top: 0; height: 4px; border-radius: 0 0 3px 3px; background: var(--pencil);
}
.panel {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 0 var(--r) var(--r) var(--r);
  padding: 20px; margin-bottom: 28px;
}

/* words and class */
.setup-grid { display: grid; gap: 8px 36px; }
@media (min-width: 820px) { .setup-grid { grid-template-columns: 3fr 2fr; } }
.dolch { margin: 10px 0 6px; }
.dolch p { margin: 0 0 6px; font-weight: 600; }
.dolch-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.list-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.students { list-style: none; margin: 0 0 12px; padding: 0; counter-reset: st; }
.students li { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; counter-increment: st; }
.students li::before { content: counter(st); width: 2ch; text-align: right; color: var(--ink2); font-variant-numeric: tabular-nums; }
.students input { flex: 1; min-width: 0; }
.files { border-top: 1.5px dashed var(--line); margin-top: 20px; padding-top: 18px; }
.files p { margin: 0 0 10px; }
.file-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ask { background: var(--warn-bg); border-radius: var(--r); padding: 12px 14px; margin: 8px 0; }
.ask p { margin: 0 0 8px; }
.kept { margin-top: 10px; }
.kept summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.kept-list { list-style: none; margin: 0; padding: 0; }
.kept-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--soft); }
.kept-btns { display: flex; gap: 6px; }

/* check */
.empty p { margin: 0 0 12px; }
.check-top { display: grid; gap: 12px 12px; align-items: end; grid-template-columns: minmax(0, 1fr) minmax(0, 158px); grid-template-areas: "who date" "nums nums"; }
.who-f { grid-area: who; } .date-f { grid-area: date; } .nums { grid-area: nums; }
.date-f input { padding-left: 8px; padding-right: 6px; }
@media (min-width: 1000px) { .check-top { gap: 12px 18px; grid-template-columns: minmax(180px, 1fr) auto minmax(160px, 200px); grid-template-areas: "who nums date"; } }
.check-top .field { margin: 0; }
.nums legend { margin-bottom: 4px; }
.seg { display: flex; gap: 4px; }
.seg-b {
  flex: 1 1 0; min-width: 40px; max-width: 48px; height: 46px; font: inherit; font-size: 17px; font-weight: 600;
  color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; position: relative;
}
.seg-b.done::after { content: ""; position: absolute; bottom: 5px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--accent); }
.seg-b[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg-b[aria-pressed="true"].done::after { background: var(--accent-ink); }
.sum { margin: 16px 0 12px; font-size: 18px; min-height: 1.6em; }
.words { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.wt {
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px;
  border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); min-height: 60px;
}
.wt .w { flex: 1; min-width: 0; font-family: var(--card); font-size: 28px; line-height: 1.15; overflow-wrap: anywhere; }
.wt.is-k { background: var(--known-bg); border-color: var(--known); }
.wt.is-n { background: var(--nyet-bg); border-color: var(--nyet); }
.mb {
  flex: 0 0 auto; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  width: 74px; min-height: 48px; padding: 4px; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.1;
  color: var(--ink2); background: transparent; border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer;
}
.mb .mk { width: 20px; height: 20px; }
.mb.k[aria-pressed="true"] { background: var(--known); color: #fff; border-color: var(--known); }
.mb.n[aria-pressed="true"] { background: var(--nyet); color: #fff; border-color: var(--nyet); }
@media (prefers-color-scheme: dark) {
  .mb.k[aria-pressed="true"], .mb.n[aria-pressed="true"] { color: #0b1a1b; }
}
.check-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.check-btns #c-next { margin-left: auto; }
.lock { background: var(--warn-bg); border-radius: var(--r); padding: 12px 14px; margin: 16px 0 0; }
.lock p { margin: 0 0 8px; }
.lock p:last-child { margin: 0; }
.mb[aria-disabled="true"] { cursor: default; }

/* progress */
.prog-h { font-size: 22px; }
.table-wrap { overflow-x: auto; }
.prog { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.prog th, .prog td { text-align: left; padding: 8px 6px 2px; vertical-align: top; }
.prog thead th { font-size: 16px; border-bottom: 2px solid var(--line); padding-bottom: 8px; }
.prog tbody { border-bottom: 1px solid var(--soft); }
.prog .kp { white-space: nowrap; }
.prog tbody th { min-width: 8em; overflow-wrap: anywhere; }
.prog .pct { color: var(--ink2); }
.prog .d { display: block; color: var(--ink2); font-size: 15px; }
.prog .miss-r td { padding-top: 2px; padding-bottom: 10px; }
.prog .miss { color: var(--ink2); overflow-wrap: anywhere; white-space: normal; }
.prog .none { color: var(--ink2); }
.prog .part { color: var(--ink); }
.more { display: inline; }
.more summary { display: inline; cursor: pointer; color: var(--accent); text-decoration: underline; }
.more[open] summary { display: block; }
:has(> .more[open]) > .short { display: none; }
.most-h { font-size: 18px; margin: 12px 0 4px; }
.most { margin: 0 0 16px; overflow-wrap: anywhere; }
.waiting { margin: 12px 0 0; overflow-wrap: anywhere; }
/* six checks of "120/220 55%" need about 900px, so narrower screens get a block per child, with the check cells
   on a fixed grid so the same check lines up from child to child */
@media (max-width: 1000px) {
  .prog thead { display: none; }
  .prog, .prog tbody { display: block; }
  .prog tbody { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .prog tr { display: grid; grid-template-columns: repeat(auto-fill, 8.5em); gap: 6px 12px; }
  .prog th, .prog td { padding: 0; }
  .prog tbody th { grid-column: 1 / -1; font-family: var(--card); font-weight: 400; font-size: 22px; }
  .prog td.c::before { content: attr(data-l); display: block; font-size: 15px; color: var(--ink2); }
  .prog .miss-r td.miss { grid-column: 1 / -1; padding-top: 6px; }
}

/* print panel */
.kinds { display: grid; gap: 8px; margin: 0 0 16px; }
@media (min-width: 700px) { .kinds { grid-template-columns: 1fr 1fr; } }
.kinds legend { margin-bottom: 8px; }
.kind { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--r); cursor: pointer; font-weight: 400; }
.kind:has(input:checked) { border-color: var(--accent); background: var(--soft); }
.kind input { width: 20px; height: 20px; min-height: 0; margin: 3px 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.kind b { display: block; font-weight: 600; }
.print-opts { display: grid; gap: 0 18px; }
@media (min-width: 700px) { .print-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* page text */
.content { max-width: 70ch; }
.content p, .content li { margin: 0 0 10px; }
.steps { padding-left: 1.4em; }
.faq h3 { font-family: var(--ui); font-weight: 700; font-size: 18px; }
.sources { color: var(--ink2); font-size: 16px; margin-top: 26px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 20;
  width: max-content; max-width: calc(100% - 32px);
  background: var(--ink); color: var(--bg); border-radius: var(--r); padding: 10px 14px;
  display: none; align-items: center; gap: 12px; flex-wrap: wrap; pointer-events: none;
}
.toast.show { display: flex; }
.toast .btn { pointer-events: auto; background: var(--bg); color: var(--ink); border-color: var(--bg); }

/* footer */
.site-foot { border-top: 1.5px solid var(--line); padding: 20px 16px 32px; }
.sb-footer { max-width: 1000px; margin: 0 auto; color: var(--ink2); font-size: 16px; }
.sb-footer p { margin: 0 0 10px; }
.sb-more { line-height: 1.8; }
.sb-footer a { color: var(--accent); }

@media (max-width: 480px) {
  h1 { font-size: 34px; }
  .panel { padding: 14px; }
  #c-who { font-size: 16px; padding-left: 8px; padding-right: 4px; }
  .tabs [role="tab"] { padding: 8px 12px; }
  .wt .w { font-size: 26px; }
  .mb { width: 64px; }
}
/* the Student menu carries each child's status ("Cora, check 1: 15/40"), so it keeps a full-width row until the
   three-column layout has room for a 20-letter name with its status */
@media (max-width: 999px) {
  .check-top { grid-template-columns: minmax(0, 1fr); grid-template-areas: "who" "date" "nums"; }
  .date-f input { max-width: 12em; }
}
@media (max-width: 380px) {
  main { padding-left: 12px; padding-right: 12px; }
  .panel { padding: 12px 10px; }
  .tabs { gap: 2px; }
  .tabs [role="tab"] { padding: 8px 9px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* ---------------------------------------------------------------- print */
.print-root { display: none; }
@page { margin: 0.5in; }
@media print {
  html, body { background: #fff !important; color: #000 !important; font-size: 11pt; }
  body > :not(.print-root) { display: none !important; }
  .print-root { display: block; font-family: var(--ui); color: #000; }
  .pg { break-after: page; page-break-after: always; width: 7.2in; }
  .pg:last-child { break-after: auto; page-break-after: auto; }
  .pg-h { display: flex; align-items: baseline; gap: 0 14px; flex-wrap: wrap; border-bottom: 1.5pt solid #000; padding-bottom: 4pt; margin-bottom: 8pt; }
  .pg-t { font-family: var(--card); font-size: 18pt; }
  .pg-s { font-size: 11pt; color: #222; }
  .pg-no { margin-left: auto; font-size: 10pt; color: #222; }
  .legend { font-size: 10pt; margin: 0 0 6pt; color: #222; }
  .mk { width: 1em; height: 1em; vertical-align: -0.15em; }
  .pk { color: #11602f; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .pn { color: #a8350c; print-color-adjust: exact; -webkit-print-color-adjust: exact; }

  /* student card */
  .card, .fw, .sheet td.wd, .grid-t th.wd, .pg-t { font-variant-ligatures: none; font-feature-settings: "liga" 0, "clig" 0; }
  .card { list-style: none; margin: 0.15in 0 0; padding: 0; display: grid; grid-template-columns: repeat(var(--cols), 1fr); font-family: var(--card); }
  .card li { text-align: center; line-height: 1.75; overflow-wrap: anywhere; }

  /* recording sheet */
  .blocks { display: grid; gap: 0.22in; }
  .blocks.n2 { grid-template-columns: 1fr 1fr; }
  .sheet { border-collapse: collapse; margin-left: 1px; table-layout: fixed; }
  .sheet th, .sheet td { border: 0.75pt solid #555; height: 0.245in; padding: 0 4pt; font-size: 11pt; line-height: 1.1; }
  .sheet thead th { font-size: 9pt; font-weight: 600; text-align: center; height: 0.2in; line-height: 1.15; padding: 1pt 2pt; }
  .sheet thead th.wd { text-align: left; vertical-align: bottom; }
  .sheet thead th.cks { font-size: 8.5pt; }
  .sheet .cn { display: block; font-size: 11pt; }
  .sheet .dt { display: block; font-weight: 400; font-size: 8.5pt; min-height: 1.1em; white-space: nowrap; }
  .blocks.roomy .sheet td { height: 0.33in; }
  .sheet td.no { text-align: right; font-size: 8pt; color: #333; padding-right: 3pt; }
  .sheet td.wd { font-family: var(--card); font-size: 12.5pt; overflow-wrap: anywhere; }
  .sheet .ck { text-align: center; }
  .sheet td.ck { font-size: 12pt; }
  .blocks.hand .sheet .dt { min-height: 0.22in; }
  .blocks.n2 .sheet .dt { font-size: 7.5pt; }
  .blocks.tight .sheet thead th { padding: 1pt 0.5pt; }
  .blocks.tight .sheet .dt { font-size: 6.5pt; white-space: normal; }
  .sheet tr { break-inside: avoid; }
  .totals { break-inside: avoid; margin-top: 10pt; border-collapse: collapse; font-size: 10.5pt; width: calc(100% - 2px); }
  .totals th { text-align: left; padding-right: 8pt; width: 0.7in; vertical-align: top; padding-top: 12pt; }
  .totals td { padding: 2pt 6pt 2pt 0; vertical-align: top; }
  .totals .tn { display: block; font-size: 8.5pt; color: #333; }

  /* class grid */
  .sum-t { border-collapse: collapse; width: calc(100% - 3px); margin-left: 1px; table-layout: fixed; }
  .sum-t th, .sum-t td { border: 0.75pt solid #555; padding: 2pt 4pt; height: 0.27in; text-align: left; font-size: 10.5pt; line-height: 1.15; }
  .sum-t thead th { font-size: 9.5pt; }
  .sum-t .dt { display: block; font-weight: 400; font-size: 8.5pt; }
  .sum-t tbody th { font-family: var(--card); font-weight: 400; overflow-wrap: anywhere; }
  .sum-t td b, .sum-t .pct { white-space: nowrap; }
  .sum-t .pct { color: #333; margin-left: 4pt; }
  .sum-t tr { break-inside: avoid; }
  .grid-t { border-collapse: collapse; table-layout: fixed; margin-left: 1px; }
  .grid-t th, .grid-t td { border: 0.75pt solid #555; height: 0.25in; padding: 0 2pt; text-align: center; font-size: 10pt; line-height: 1.1; }
  .grid-t th.wd { text-align: left; font-family: var(--card); font-weight: 400; font-size: 11.5pt; padding-left: 4pt; overflow-wrap: anywhere; }
  .grid-t thead th.wd { font-family: var(--ui); font-weight: 600; font-size: 9pt; vertical-align: bottom; }
  .grid-t th.nm { vertical-align: bottom; padding: 3pt 0; }
  .grid-t th.nm span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; display: inline-block; font-family: var(--card); font-weight: 400; font-variant-ligatures: none; }
  .grid-t .by { font-weight: 600; }
  .grid-t thead th.by { font-size: 8.5pt; vertical-align: bottom; }
  .grid-t tfoot th, .grid-t tfoot td { font-weight: 700; font-size: 9.5pt; }
  .grid-t tfoot th { text-align: left; padding-left: 4pt; }
  .grid-t tr { break-inside: avoid; }

  /* flashcards */
  .pg-flash { width: 7.2in; }
  .fc-grid { display: grid; grid-template-columns: 3.6in 3.6in; grid-auto-rows: 2.35in; }
  .fc { position: relative; display: flex; align-items: center; justify-content: center; border: 0.6pt dashed #666; }
  .fw { font-family: var(--card); line-height: 1.05; text-align: center; max-width: 3.3in; overflow-wrap: anywhere; }
  .ft { position: absolute; left: 8pt; bottom: 6pt; font-size: 10pt; color: #333; white-space: nowrap; max-width: calc(100% - 16pt); }
  .all-known { font-size: 14pt; margin-top: 0.3in; }
}
