/* 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;
  --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; }
