/* MakeWithMohit design pack — base.css. One shared look for every teacher app.
   Colours, type and components live here. Apps link this file and use its
   classes; they do not restyle from scratch. See DESIGN.md for the rules. */
:root {
  --paper: #F7F2E7;
  --card: #FFFDF8;
  --ink: #211D19;
  --muted: #6E6455;
  --line: #E2D8C4;
  --accent: #C8401F;
  --accent-dark: #A63418;
  --good: #2E7D4F;
  --good-bg: #EDF6EF;
  --good-line: #BFDCC6;
  --danger: #A63418;
  --danger-bg: #FBEFEA;
  --danger-line: #F3C9BC;
  /* AAC category tints — Fitzgerald Key colours for word types (talk board).
     Soft tints so ink text stays readable; the tile border stays ink. */
  --cat-people: #FBF3C4;
  --cat-verb: #D9EDDD;
  --cat-desc: #D6E4F0;
  --cat-noun: #FBE3CF;
  --cat-social: #F8DCE4;
  --cat-question: #E4DCF0;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-body); background: var(--paper); color: var(--ink); line-height: 1.5; }
.wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 48px; }
h1 { font-family: var(--font-display); font-size: 1.9rem; margin: 0 0 4px; letter-spacing: -0.01em; }
.sub { color: var(--muted); margin: 0 0 20px; font-size: 1rem; }
.card { background: var(--card); border: 2px solid var(--ink); border-radius: 12px; padding: 18px; margin-bottom: 16px; box-shadow: 3px 3px 0 rgba(33, 29, 25, 0.14); }
label { font-weight: 700; display: block; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 0.88rem; margin: 0 0 8px; }
textarea, input[type="text"], input[type="number"] { width: 100%; padding: 12px; font: inherit; font-size: 1rem; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 8px; }
textarea { min-height: 150px; resize: vertical; }
textarea:focus, input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200, 64, 31, 0.2); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.row.space { justify-content: space-between; }
.btn { appearance: none; border: 2px solid var(--ink); border-radius: 10px; padding: 12px 20px; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; box-shadow: 2px 2px 0 rgba(33, 29, 25, 0.9); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn-primary { background: var(--accent); border-color: var(--ink); color: #fff; flex: 1; min-width: 180px; font-size: 1.1rem; padding: 14px 20px; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { background: #D8A08F; cursor: not-allowed; }
.btn-ghost { background: var(--paper); color: var(--ink); }
.btn-ghost:hover { background: #EFE7D3; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); box-shadow: 2px 2px 0 rgba(166, 52, 24, 0.35); }
.btn-danger:hover { background: #F8E2D8; }
.toggle { display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; user-select: none; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
.stats { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 0.92rem; margin-top: 10px; }
.stats b { color: var(--ink); }
.drawn { text-align: center; padding: 8px 4px; }
.drawn .eyebrow { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.drawn .q { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; letter-spacing: -0.01em; margin: 10px 0 4px; line-height: 1.25; }
.drawn .w { color: var(--muted); font-size: 0.9rem; }
.drawn.empty .q { color: #A89E8B; font-weight: 600; font-size: 1.25rem; font-family: var(--font-body); }
.done { background: var(--good-bg); border: 2px solid var(--good-line); color: var(--good); border-radius: 10px; padding: 12px; font-weight: 700; margin-top: 10px; }
.history h2 { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 8px; }
.history ol { margin: 0; padding-left: 22px; }
.history li { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.history li:last-child { border-bottom: 0; }
.history .meta { color: var(--muted); font-size: 0.85rem; }
.empty-note { color: var(--muted); }
.foot { color: var(--muted); font-size: 0.85rem; text-align: center; margin-top: 8px; }
.foot a { color: var(--accent); }
/* Roster grid — tap-to-pick name buttons (hall pass, attendance, pickers). */
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.name-btn { appearance: none; background: var(--card); border: 2px solid var(--ink); border-radius: 10px; padding: 12px 10px; font: inherit; font-weight: 700; font-size: 1rem; color: var(--ink); cursor: pointer; box-shadow: 2px 2px 0 rgba(33, 29, 25, 0.9); text-align: center; }
.name-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.name-btn:disabled { background: #EFE7D3; color: var(--muted); cursor: not-allowed; box-shadow: none; }
.name-btn .sub-line { display: block; font-weight: 400; font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
/* Destination / option buttons — ghost buttons with a selected state. */
.btn-ghost.selected { background: var(--accent); border-color: var(--ink); color: #fff; }
/* Currently-out rows with a live timer. */
.out-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 10px; background: var(--card); margin-bottom: 10px; box-shadow: 2px 2px 0 rgba(33, 29, 25, 0.14); }
.out-row.overdue { border-color: var(--danger); background: var(--danger-bg); }
.out-row .who { font-weight: 700; }
.out-row .timer { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; white-space: nowrap; }
.out-row .overdue-note { color: var(--danger); font-weight: 700; font-size: 0.85rem; }
/* Small status chip. Radius stays 8px per the pack rule. */
.pill { display: inline-block; padding: 2px 8px; border: 2px solid var(--line); border-radius: 8px; font-size: 0.82rem; font-weight: 700; color: var(--muted); }
/* Simple log table. */
.log-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.log-table th { text-align: left; color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 6px 8px 6px 0; border-bottom: 2px solid var(--line); }
.log-table td { padding: 7px 8px 7px 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
.log-table tr:last-child td { border-bottom: 0; }
details { margin-top: 10px; }
details summary { cursor: pointer; font-weight: 700; color: var(--accent); }
details p { color: var(--muted); font-size: 0.92rem; }
code { background: #EFE7D3; padding: 1px 6px; border-radius: 6px; font-size: 0.9em; }
@media (max-width: 520px) {
  h1 { font-size: 1.55rem; }
  .drawn .q { font-size: 1.4rem; }
  .btn-primary { width: 100%; }
}
/* Selects share the input look. */
select { width: auto; min-width: 180px; padding: 12px; font: inherit; font-size: 1rem; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 8px; }
select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200, 64, 31, 0.2); }
input[type="date"], input[type="time"] { width: auto; }
/* Tabs — one section visible at a time (behaviour tracker). */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab-btn { appearance: none; background: var(--card); border: 2px solid var(--ink); border-radius: 10px; padding: 10px 14px; font: inherit; font-weight: 700; font-size: 0.95rem; color: var(--ink); cursor: pointer; box-shadow: 2px 2px 0 rgba(33, 29, 25, 0.9); }
.tab-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.tab-btn.active { background: var(--accent); color: #fff; }
/* Chips — tap-to-pick options (locations, antecedents, consequences). */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { appearance: none; background: var(--card); border: 2px solid var(--line); border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 0.92rem; font-weight: 700; color: var(--ink); cursor: pointer; }
.chip.selected { background: var(--accent); border-color: var(--ink); color: #fff; }
/* Behaviour grid — students as rows, behaviours as columns, tap to log. */
.behav-grid-wrap { overflow-x: auto; }
.behav-grid { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 480px; table-layout: fixed; }
.behav-grid th { font-size: 0.85rem; }
.behav-grid th:first-child, .behav-grid td:first-child { width: 96px; }
.behav-grid th, .behav-grid td { padding: 6px 4px; border-bottom: 1px dashed var(--line); text-align: center; }
.behav-grid th:first-child, .behav-grid td:first-child { text-align: left; font-weight: 700; white-space: nowrap; padding-right: 10px; }
.behav-grid th.pos { color: var(--good); }
.behav-grid th.neg { color: var(--danger); }
.behav-cell { appearance: none; min-width: 40px; padding: 8px 4px; border: 2px solid var(--ink); border-radius: 8px; background: var(--card); font: inherit; font-weight: 700; font-size: 1rem; color: var(--ink); cursor: pointer; }
.behav-cell:active { transform: translate(1px, 1px); }
.behav-cell.pos { border-color: var(--good-line); color: var(--good); }
.behav-cell.neg { border-color: var(--danger-line); color: var(--danger); }
/* Simple trend chart — SVG line chart, gaps stay gaps. */
.chart-wrap { margin-top: 12px; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
/* Seating chart — desk grid (seating chart / group maker). */
.board { text-align: center; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; border: 2px solid var(--ink); border-radius: 8px; padding: 8px; background: var(--card); margin-bottom: 14px; }
.seat-grid { display: grid; gap: 10px; }
.seat { appearance: none; padding: 10px 6px; border: 2px solid var(--ink); border-radius: 10px; background: var(--card); font: inherit; font-weight: 700; font-size: 0.95rem; color: var(--ink); cursor: pointer; box-shadow: 2px 2px 0 rgba(33, 29, 25, 0.9); text-align: center; min-height: 52px; }
.seat small { display: block; font-weight: 400; font-size: 0.78rem; color: var(--muted); }
.seat.empty { background: var(--paper); color: var(--muted); font-weight: 400; border-style: dashed; box-shadow: none; cursor: default; }
.seat.selected { background: var(--accent); color: #fff; }
.seat.selected small { color: #fff; }
.seat.locked { border-color: var(--good); }
.seat.absent { opacity: 0.55; }
.seat.violation { border-color: var(--danger); background: var(--danger-bg); }
/* Group cards — one card per group (group maker). */
.group-card h3 { font-family: var(--font-display); font-size: 1.1rem; margin: 0 0 6px; }
.group-card ul { margin: 0; padding-left: 20px; }
.group-card li { padding: 3px 0; }
/* Rule rows — a rule with a remove button (seating rules). */
.rule-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.rule-row:last-child { border-bottom: 0; }

/* Flashcard — big tap-to-flip study card (vocab games). */
.flashcard { border: 2px solid var(--ink); border-radius: 12px; background: var(--card); padding: 28px 18px; text-align: center; cursor: pointer; box-shadow: 3px 3px 0 rgba(33, 29, 25, 0.14); min-height: 220px; display: flex; flex-direction: column; justify-content: center; }
.flashcard .eyebrow { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.flashcard .flash-word { font-family: var(--font-display); font-size: 2rem; font-weight: 700; margin-top: 10px; line-height: 1.2; }
.flashcard .flash-def { font-size: 1.15rem; line-height: 1.4; margin-top: 10px; }
/* Match tiles — term/definition tiles in a grid (match game, team race, quiz). */
.match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.match-tile { appearance: none; background: var(--card); border: 2px solid var(--ink); border-radius: 10px; padding: 14px 10px; font: inherit; font-size: 0.95rem; font-weight: 700; color: var(--ink); cursor: pointer; box-shadow: 2px 2px 0 rgba(33, 29, 25, 0.9); text-align: center; min-height: 64px; line-height: 1.3; }
.match-tile:active { transform: translate(2px, 2px); box-shadow: none; }
.match-tile.selected { background: var(--accent); color: #fff; }
.match-tile.done { background: var(--good-bg); border-color: var(--good-line); color: var(--good); box-shadow: none; cursor: default; }
.match-tile.wrong { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
/* Team scoreboard — team name + big score (team race). */
.scoreboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
.team-score { border: 2px solid var(--ink); border-radius: 10px; background: var(--card); padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; box-shadow: 2px 2px 0 rgba(33, 29, 25, 0.14); }
.team-score b { font-family: var(--font-display); font-size: 1.5rem; }
.buzz-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* Honesty panel — plain-words what the app does / does not do (test room). */
.honest { border: 2px solid var(--ink); background: #FBF6EC; }
.honest h3 { margin-top: 0; }
.honest ul { margin: 0.4rem 0 0.2rem 1.1rem; }
.honest li { margin: 0.15rem 0; }
/* Focus pill — green "in the room", red when a focus loss was just logged. */
.focus-pill { display: inline-block; padding: 0.3rem 0.7rem; border-radius: 8px; border: 2px solid var(--ink); font-weight: 700; font-size: 0.88rem; background: #EAF3EC; }
.focus-pill.away { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
/* Timer — big display-font countdown; .low turns it red under 5 minutes. */
.timer-big { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1; }
.timer-big.low { color: var(--accent); }
/* Essay editor — toolbar + contenteditable box with word count under it. */
.editor-toolbar { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.editor-toolbar .btn-ghost { padding: 0.35rem 0.7rem; font-size: 0.9rem; }
.essay-box { min-height: 180px; border: 2px solid var(--line); border-radius: 8px; background: var(--card); padding: 0.8rem 1rem; font-size: 1.05rem; line-height: 1.6; outline: none; }
.essay-box:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200,64,31,.2); }
/* Multiple-choice option — full-width label row, radio + text. */
.mcq-opt { display: block; padding: 0.55rem 0.7rem; border: 2px solid var(--line); border-radius: 8px; margin: 0.35rem 0; cursor: pointer; background: var(--card); }
.mcq-opt:hover { border-color: var(--ink); }
.mcq-opt input { margin-right: 0.5rem; }
/* Event log — dashed list of timestamped events (focus log). */
.event-log { list-style: none; padding: 0; margin: 0.4rem 0 0; font-size: 0.92rem; }
.event-log li { padding: 0.35rem 0; border-bottom: 1px dashed var(--line); }
.event-log li:last-child { border-bottom: none; }
/* Completion code — big display-font code box for the submit screen. */
.code-box { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; letter-spacing: 0.12em; text-align: center; border: 2px solid var(--ink); border-radius: 12px; padding: 0.8rem; background: var(--card); box-shadow: 3px 3px 0 rgba(33,29,25,.14); }
/* Stat grid — small number + label tiles (submit screen). */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.7rem; margin: 0.8rem 0; }
.stat-grid .stat { border: 2px solid var(--line); border-radius: 10px; padding: 0.6rem; text-align: center; background: var(--card); }
.stat-grid .stat b { display: block; font-family: var(--font-display); font-size: 1.5rem; }
.stat-grid .stat span { color: var(--muted); font-size: 0.85rem; }
/* Question editor — one editable question block in a setup form. */
.q-edit { border: 2px solid var(--line); border-radius: 10px; padding: 0.8rem; margin-bottom: 0.7rem; background: var(--card); }
.q-edit .row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.q-edit select, .q-edit input[type=text], .q-edit input[type=number] { flex: 1; min-width: 120px; }
/* Link editor — label + URL row in a setup form. */
.link-edit { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.link-edit input { flex: 1; min-width: 140px; }
/* Toast — small dark notice pinned to the bottom centre of the screen. */
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); background: var(--ink); color: var(--card); padding: 0.6rem 1rem; border-radius: 10px; font-size: 0.95rem; z-index: 50; display: none; max-width: 92vw; text-align: center; }
.toast.show { display: block; }
/* Sprint drill — big fact display + answer row (math sprint). */
.fact { text-align: center; padding: 18px 4px 8px; }
.fact .q { font-family: var(--font-display); font-size: 3rem; font-weight: 700; line-height: 1.1; }
.fact .q .op { color: var(--accent); }
.answer-row { display: flex; gap: 10px; max-width: 420px; margin: 10px auto 0; }
.answer-row input { flex: 1; font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; text-align: center; padding: 10px; border: 2px solid var(--ink); border-radius: 10px; background: var(--card); outline: none; }
.answer-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200,64,31,.2); }
.answer-row input.wrong { border-color: var(--danger); background: var(--danger-bg); }
.answer-row input.right { border-color: var(--good); background: var(--good-bg); }
.sprint-bar { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sprint-bar .timer-big { font-size: 2.2rem; }
.streak { font-weight: 700; }
.streak.hot { color: var(--accent); }
/* Level list — full-width rows for picking a drill level (math sprint). */
.level-list { display: grid; gap: 8px; margin-top: 10px; }
.level-btn { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; appearance: none; background: var(--card); border: 2px solid var(--ink); border-radius: 10px; padding: 12px 14px; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 2px 2px 0 rgba(33,29,25,.9); }
.level-btn:active { transform: translate(2px,2px); box-shadow: none; }
.level-btn.selected { background: var(--accent); color: #fff; }
.level-btn.selected .muted { color: #FBEFEA; }
.level-btn .muted { font-weight: 400; color: var(--muted); font-size: 0.88rem; }
.cleared { color: var(--good); font-weight: 700; }
/* History bars — date label + bar + value rows (progress view). */
.hist-bar-row { display: flex; align-items: center; gap: 8px; margin: 5px 0; font-size: 0.9rem; }
.hist-bar-row .lbl { width: 92px; flex-shrink: 0; color: var(--muted); }
.hist-bar-row .bar { height: 14px; background: var(--accent); border-radius: 4px; min-width: 2px; }
.hist-bar-row .bar.goalmet { background: var(--good); }
.hist-bar-row .val { font-weight: 700; white-space: nowrap; }
/* Fact chip — a fact with a small miss count (missed facts, facts to practise). */
.fact-chip { display: inline-block; border: 2px solid var(--line); border-radius: 8px; padding: 4px 10px; margin: 0 6px 6px 0; font-weight: 700; background: var(--card); }
.fact-chip .miss { color: var(--danger); font-weight: 400; font-size: 0.85rem; }
/* Goal row — label + number input + save button. */
.goal-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.goal-row input[type=number] { width: 84px; font: inherit; font-weight: 700; text-align: center; padding: 8px; border: 2px solid var(--line); border-radius: 8px; background: var(--card); }
/* Worksheet grid — printable problem grid (math sprint). */
.ws-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 10px; margin-top: 12px; }
.ws-prob { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; border-bottom: 2px solid var(--line); padding-bottom: 4px; min-height: 34px; }
.ws-prob .ans-line { display: block; height: 22px; }
@media (max-width: 560px) { .ws-grid { grid-template-columns: repeat(2, 1fr); } .fact .q { font-size: 2.4rem; } }

/* Small text + muted text helpers (used across apps). */
.small { font-size: 0.88rem; }
.muted { color: var(--muted); }
.lbl { font-weight: 700; display: block; margin-bottom: 6px; }
.form-row { margin-bottom: 14px; }

/* Talk board — AAC communication board (Fitzgerald Key colours). */
.board-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.sentence-strip { min-height: 64px; border: 2px solid var(--ink); border-radius: 12px; background: var(--card); padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.strip-hint { color: var(--muted); font-size: 0.95rem; }
.strip-word { display: inline-block; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper); padding: 4px 10px; font-weight: 700; }
.strip-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.aac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.aac-tile { appearance: none; border: 2px solid var(--ink); border-radius: 12px; padding: 10px 6px 8px; font: inherit; cursor: pointer; box-shadow: 2px 2px 0 rgba(33,29,25,.9); display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 104px; position: relative; }
.aac-tile:active { transform: translate(2px,2px); box-shadow: none; }
.aac-tile.cat-people { background: var(--cat-people); }
.aac-tile.cat-verb { background: var(--cat-verb); }
.aac-tile.cat-desc { background: var(--cat-desc); }
.aac-tile.cat-noun { background: var(--cat-noun); }
.aac-tile.cat-social { background: var(--cat-social); }
.aac-tile.cat-question { background: var(--cat-question); }
.tile-emoji { font-size: 2rem; line-height: 1.2; }
.tile-img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; border: 2px solid var(--line); }
.tile-word { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.2; text-align: center; }
.aac-tile.wotw { outline: 3px solid var(--accent); outline-offset: 2px; }
.wotw-badge { position: absolute; top: -10px; right: 6px; background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 1px 7px; border-radius: 8px; border: 2px solid var(--ink); white-space: nowrap; }
/* Modelling mode — big tiles for the smart board, controls hidden. */
body.model .wrap { max-width: 1100px; }
body.model .tabs { display: none; }
body.model .strip-actions .btn-ghost:not(#modelBtn) { display: none; }
body.model .aac-grid { grid-template-columns: repeat(4, 1fr); }
body.model .aac-tile { min-height: 150px; padding: 16px 8px 12px; }
body.model .tile-emoji { font-size: 3rem; }
body.model .tile-img { width: 72px; height: 72px; }
body.model .tile-word { font-size: 1.5rem; }
body.model .sentence-strip { min-height: 90px; padding: 14px; }
body.model .strip-word { font-size: 1.4rem; padding: 8px 14px; }
body.model .strip-hint { font-size: 1.2rem; }
/* Attendance — status tints on name buttons and status buttons (uses existing tokens only). */
.name-btn.st-present { background: var(--good-bg); border-color: var(--good-line); color: var(--good); }
.name-btn.st-tardy { background: var(--cat-people); }
.name-btn.st-absent { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.name-btn.st-excused { background: var(--paper); color: var(--muted); }
.name-btn.st-early { background: var(--cat-desc); }
.status-btn { appearance: none; border: 2px solid var(--ink); border-radius: 8px; padding: 6px 12px; font: inherit; font-weight: 700; font-size: 0.9rem; background: var(--card); cursor: pointer; white-space: nowrap; }
.status-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.status-btn.st-present { background: var(--good-bg); border-color: var(--good-line); color: var(--good); }
.status-btn.st-tardy { background: var(--cat-people); }
.status-btn.st-absent { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.status-btn.st-excused { background: var(--paper); color: var(--muted); }
.status-btn.st-early { background: var(--cat-desc); }

@media (max-width: 560px) {
  .aac-grid { grid-template-columns: repeat(3, 1fr); }
  body.model .aac-grid { grid-template-columns: repeat(2, 1fr); }
}
/* Balance scale — tilting beam with two pans, counts under each pan. */
.scale-wrap { display: flex; flex-direction: column; align-items: center; padding: 8px 0 2px; }
.scale { width: 260px; height: 120px; position: relative; }
.beam { position: absolute; left: 10px; right: 10px; top: 34px; height: 6px; background: var(--ink); border-radius: 3px; transition: transform 0.35s ease; transform-origin: center; }
.pan { position: absolute; top: 44px; width: 96px; text-align: center; transition: transform 0.35s ease; }
.pan.left { left: 0; }
.pan.right { right: 0; }
.pan .dish { width: 96px; height: 12px; border: 2px solid var(--ink); border-top: none; border-radius: 0 0 48px 48px; background: var(--card); }
.pan .count { font-weight: 700; font-size: 0.95rem; margin-top: 4px; }
.pan .side { font-size: 0.8rem; color: var(--muted); }
.scale .post { position: absolute; left: 50%; top: 40px; width: 6px; height: 62px; background: var(--ink); margin-left: -3px; }
.scale .base { position: absolute; left: 50%; bottom: 0; width: 90px; height: 8px; background: var(--ink); margin-left: -45px; border-radius: 4px; }
.scale-note { font-size: 0.9rem; color: var(--muted); text-align: center; }
/* Coefficient stepper — +/- buttons stacked over a big display number. */
.eq-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: center; margin: 14px 0 6px; }
.term { display: flex; align-items: center; gap: 4px; }
.coef { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.coef-btn { width: 30px; height: 24px; padding: 0; font-size: 1rem; line-height: 1; border: 2px solid var(--ink); border-radius: 6px; background: var(--card); cursor: pointer; font-family: inherit; }
.coef-btn:hover { background: var(--paper); }
.coef-num { font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 1.6rem; min-width: 34px; text-align: center; }
.coef-num.one { color: var(--muted); }
.formula { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 1.5rem; }
.formula sub { font-size: 0.65em; }
.eq-op { font-family: Fraunces, Georgia, serif; font-size: 1.5rem; margin: 0 4px; }
/* Atom count table — reactants vs products per element, match green / mismatch red. */
.atom-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.atom-table th, .atom-table td { padding: 8px 6px; border-bottom: 1px dashed var(--line); text-align: center; }
.atom-table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.atom-table td.el { font-weight: 700; font-size: 1.05rem; }
.atom-table td.match { color: var(--good); font-weight: 700; }
.atom-table td.mismatch { color: var(--danger); font-weight: 700; }
/* Balance banner — green when balanced, amber when balanced but not simplest, plain when not yet. */
.banner { border: 2px solid var(--good); background: #EAF4EC; border-radius: 10px; padding: 12px 14px; font-weight: 700; color: var(--good); margin-top: 12px; }
.banner.warn { border-color: var(--accent); background: #FBF6EC; color: var(--accent-dark); }
.banner.notyet { border-color: var(--line); background: var(--paper); color: var(--muted); font-weight: 400; }
/* Worksheet — blank coefficient boxes and blank atom tables for print. */
.ws-item { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.ws-item input { margin-top: 4px; }
.ws-blank { display: inline-block; width: 26px; border-bottom: 2px solid var(--ink); }
.ws-table { width: 100%; border-collapse: collapse; margin: 6px 0 18px; }
.ws-table th, .ws-table td { border: 1px solid var(--ink); padding: 5px 8px; text-align: center; font-size: 0.9rem; }
.ws-table td { height: 24px; }
.ws-eq { font-size: 1.15rem; margin: 14px 0 4px; }

/* Grade Sheet: answer-key rows, grading cells, score banner, printable sheet */
.key-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.key-row:last-child { border-bottom: 0; }
.key-row .qnum { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; min-width: 34px; }
.key-row select, .key-row input[type=text], .key-row input[type=number] { padding: 8px 10px; }
.key-row .pts { width: 64px; }
.key-row .ans { width: 150px; }
.key-row .mcq-letters { display: flex; gap: 4px; }
.key-row .mcq-letters button { width: 34px; height: 34px; padding: 0; font-weight: 700; }
.ans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.ans-cell { border: 2px solid var(--ink); border-radius: 10px; padding: 10px; background: var(--card); }
.ans-cell label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 6px; }
.ans-cell input { width: 100%; text-align: center; font-size: 1.1rem; font-weight: 700; text-transform: uppercase; }
.ans-cell input.short { text-align: left; font-weight: 400; text-transform: none; font-size: 1rem; }
.ans-cell.correct { border-color: var(--good); background: #EAF4EC; }
.ans-cell.wrong { border-color: var(--danger); background: var(--danger-bg); }
.ans-cell .mark { font-size: 0.85rem; font-weight: 700; margin-top: 4px; }
.ans-cell .mark.ok { color: var(--good); }
.ans-cell .mark.no { color: var(--danger); }
.score-banner { border: 2px solid var(--good); background: #EAF4EC; border-radius: 10px; padding: 14px; margin-top: 12px; text-align: center; }
.score-banner .big { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--good); }
.score-banner .sub2 { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.sheet { border: 2px solid var(--ink); border-radius: 10px; padding: 16px; background: #fff; margin-top: 12px; }
.sheet h3 { margin: 0 0 4px; font-family: var(--font-display); }
.sheet .sheet-line { border-bottom: 1px solid var(--ink); height: 22px; margin: 8px 0; }
.sheet-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 1rem; }
.sheet-row .qn { font-weight: 700; min-width: 28px; }
.sheet-row .box { display: inline-block; width: 26px; height: 26px; border: 2px solid var(--ink); border-radius: 6px; text-align: center; line-height: 24px; font-weight: 700; margin-right: 4px; }
.sheet-row .wline { flex: 1; border-bottom: 1px solid var(--ink); height: 18px; }
.sheet-row .wline.short { flex: 0 0 110px; }

/* Visual schedule — step cards, per-step timer, tokens, all-done reveal (schedule plus). */
.sched-step { display: flex; gap: 12px; align-items: flex-start; border: 2px solid var(--ink); border-radius: 12px; background: var(--card); padding: 12px; margin-bottom: 10px; box-shadow: 2px 2px 0 rgba(33,29,25,.14); }
.sched-step.now { border-color: var(--accent); box-shadow: 3px 3px 0 rgba(200,64,31,.35); }
.sched-step.done { background: var(--good-bg); }
.sched-step.done .step-label { color: var(--good); text-decoration: line-through; }
.step-pic-wrap { flex-shrink: 0; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); }
.step-pic { font-size: 2.2rem; line-height: 1; }
.step-pic-img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.step-mid { flex: 1; min-width: 0; }
.step-label { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; line-height: 1.25; }
.step-meta { color: var(--muted); font-size: 0.88rem; margin-top: 2px; }
.step-right { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.step-speak { padding: 6px 10px; font-size: 0.88rem; }
.step-check { appearance: none; border: 2px solid var(--ink); border-radius: 10px; padding: 10px 14px; font: inherit; font-weight: 700; font-size: 1rem; background: var(--card); cursor: pointer; box-shadow: 2px 2px 0 rgba(33,29,25,.9); white-space: nowrap; }
.step-check:active { transform: translate(2px,2px); box-shadow: none; }
.step-check.checked { background: var(--good-bg); border-color: var(--good-line); color: var(--good); box-shadow: none; }
/* Per-step timer — shrinking disc + countdown next to the active step. */
.timer-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.timer-disc { flex-shrink: 0; }
/* Token strip — circles that fill as steps are checked off. */
.token-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.token { appearance: none; width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--ink); background: var(--card); font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); box-shadow: 2px 2px 0 rgba(33,29,25,.9); }
.token:active { transform: translate(2px,2px); box-shadow: none; }
.token.filled { background: var(--cat-people); color: var(--ink); }
.working-for-pic { margin: 4px 0 2px; }
.token-work-pic { font-size: 2rem; line-height: 1; }
img.token-work-pic { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 2px solid var(--line); }
/* All-done reveal — reward picture under one cover per step. */
.reveal-box { margin-top: 10px; }
.reveal-wrap { position: relative; max-width: 420px; margin: 0 auto; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; background: var(--card); }
.reveal-img { display: flex; align-items: center; justify-content: center; min-height: 180px; background: var(--paper); }
.reveal-pic { font-size: 6rem; line-height: 1; padding: 12px; }
img.reveal-pic { width: 100%; max-height: 280px; object-fit: cover; padding: 0; }
.reveal-covers { position: absolute; inset: 0; display: grid; }
.reveal-cover { background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: var(--muted); }
.reveal-cover.open { visibility: hidden; }
/* Step editor rows — picture button + label + minutes + move/photo/remove. */
.step-edit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.step-edit:last-child { border-bottom: 0; }
.step-edit input[type=text] { flex: 1; min-width: 160px; }
.step-edit select { min-width: 110px; }
.step-pic-btn { padding: 6px 10px; font-size: 1.5rem; min-width: 56px; }
.step-pic-btn.selected { background: var(--accent); color: #fff; }
.step-mv { padding: 8px 10px; }
.pick-pic { font-size: 1.6rem; line-height: 1; }
img.pick-pic { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
/* High-contrast mode — black background, thick light borders, big pictures. */
body.cvi { background: #000; color: #fff; }
body.cvi .card, body.cvi .sched-step, body.cvi .token, body.cvi .step-check, body.cvi .tab-btn, body.cvi .chip, body.cvi .btn-ghost, body.cvi .name-btn { background: #000; color: #fff; border-color: #fff; box-shadow: none; }
body.cvi .sub, body.cvi .hint, body.cvi .muted, body.cvi .step-meta { color: #E8E8E8; }
body.cvi .sched-step.now { border-color: #FFD400; }
body.cvi .sched-step.done { background: #0A2E14; }
body.cvi .sched-step.done .step-label { color: #7BE3A0; }
body.cvi .step-pic-wrap { background: #000; border-color: #fff; }
body.cvi .step-pic { font-size: 2.8rem; }
body.cvi .step-label { font-size: 1.5rem; }
body.cvi .token.filled { background: #FFD400; color: #000; }
body.cvi .reveal-cover { background: #000; color: #FFD400; border-color: #fff; }
body.cvi .reveal-img { background: #000; }
body.cvi input[type=text], body.cvi select, body.cvi textarea { background: #000; color: #fff; border-color: #fff; }
body.cvi .honest { background: #111; color: #fff; }
body.cvi .foot { color: #ccc; }
