/* Aten School app (atenschool.app).
   The same language as atenschool.com, pitched calmer for use mid-lesson: a pale wash ground, white working surfaces,
   navy type, gold for state and emphasis only, and one alert red kept for stopping. Single light theme by choice,
   matching the site. */

:root {
  color-scheme: light;
  --navy: #05345f;
  --navy-deep: #0a2442;
  --ink: #15263b;
  --muted: #4b5b70;
  --gold: #d4a73d;
  --gold-bright: #e3b74b;
  --gold-ink: #8a6512;
  --gold-wash: #fbf3de;
  --gold-line: #ead39a;
  --paper: #ffffff;
  --wash: #f4f6f9;
  --line: #dce2ea;
  --line-strong: #c5cfdb;
  --on-navy: #e9eef4;
  --on-navy-muted: #c3cedb;
  --alert: #8f2d24;
  --alert-deep: #74231c;
  --alert-wash: #fbeeec;
  --alert-line: #e8c1bb;

  --serif: "Marcellus", "Trajan Pro", "Optima", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Futura", "Avenir Next", "Segoe UI", Roboto, sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.6rem, 1.3rem + 1.2vw, 2rem);
  --step-4: clamp(2rem, 1.4rem + 2.4vw, 2.8rem);

  --gutter: clamp(16px, 4vw, 40px);
  --shadow: 0 1px 0 var(--line), 0 22px 44px -34px rgba(5, 52, 95, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--navy-deep); text-decoration-color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
main:focus { outline: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--navy-deep); line-height: 1.15; margin: 0; text-wrap: balance; }
p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; }
[hidden] { display: none !important; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 30; background: var(--navy); color: #fff; padding: 10px 14px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Bar: the crest, who is learning, who is signed in ---------- */

.bar { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.bar::after { content: ""; display: block; height: 2px; background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold) 70%, transparent); opacity: 0.5; }
.bar-inner { max-width: 1180px; margin-inline: auto; padding: 6px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }
.bar-crest { display: block; border-radius: 2px; }
.bar-crest img { width: 52px; height: 52px; }
.bar-who { display: flex; align-items: center; justify-content: flex-end; gap: 8px 24px; flex-wrap: wrap; }
.bar-child { display: flex; align-items: baseline; gap: 10px; padding: 5px 14px; border: 1px solid var(--gold-line); background: var(--gold-wash); border-radius: 2px; }
.bar-label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-ink); }
.bar-child strong { font-family: var(--serif); font-weight: 400; font-size: 1.2rem; color: var(--navy-deep); line-height: 1.2; }
.bar-child a { font-size: var(--step--1); }
.bar-guardian { display: flex; align-items: baseline; gap: 14px; font-size: var(--step--1); color: var(--muted); }
.linkish { font: inherit; color: var(--navy); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 0.22em; cursor: pointer; }
.linkish:hover { color: var(--navy-deep); text-decoration-color: var(--gold); }

/* ---------- Page scaffolding ---------- */

.page { max-width: 1180px; margin-inline: auto; padding: clamp(20px, 4vw, 40px) var(--gutter) 96px; }
.page.narrow { max-width: 780px; }
.page-head { margin-bottom: clamp(22px, 4vw, 34px); }
.page h1 { font-size: var(--step-4); }
.page-head h1, .phase-head h1 { margin-top: 8px; }
.lede { font-size: var(--step-1); color: var(--muted); margin-top: 12px; max-width: 38em; line-height: 1.55; }
.eyebrow { font-size: var(--step--1); font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-ink); }
.meta { font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.tabular { font-variant-numeric: tabular-nums; }
.crumbs { margin-bottom: 16px; font-size: var(--step--1); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.stack > * + * { margin-top: 18px; }
.stack-lg { display: grid; gap: 24px; align-content: start; min-width: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-top: 24px; }
.hint { font-size: 0.95rem; color: var(--muted); }
.fineprint { font-size: var(--step--1); color: var(--muted); margin-top: 22px; text-align: center; }
.loading { color: var(--muted); padding: 64px var(--gutter); text-align: center; }
.notice { background: var(--gold-wash); border: 1px solid var(--gold-line); padding: 12px 16px; border-radius: 2px; margin-top: 16px; max-width: 48em; font-size: 0.97rem; }
.problem { color: var(--alert); background: var(--alert-wash); border: 1px solid var(--alert-line); padding: 10px 14px; border-radius: 2px; font-size: 0.97rem; }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 11px 22px;
  font: inherit; font-weight: 500; letter-spacing: 0.03em; text-align: center; text-decoration: none;
  background: var(--navy); color: #fff; border: 1px solid var(--navy); border-radius: 2px; cursor: pointer;
}
.button:hover { background: var(--navy-deep); color: #fff; }
.button:disabled { opacity: 0.6; cursor: progress; }
.button-quiet { background: var(--paper); color: var(--navy); border-color: var(--line-strong); }
.button-quiet:hover { background: var(--wash); color: var(--navy-deep); }
.button-stop { background: var(--alert); border-color: var(--alert); }
.button-stop:hover { background: var(--alert-deep); }
.button-stop-quiet { background: var(--paper); color: var(--alert); border-color: var(--alert-line); }
.button-stop-quiet:hover { background: var(--alert-wash); color: var(--alert-deep); }

/* ---------- Forms ---------- */

.field { display: grid; gap: 6px; }
.field label, .choice legend { font-weight: 600; color: var(--navy-deep); }
input[type="email"], input[type="password"], input[type="text"], textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: 2px; padding: 11px 13px;
}
textarea { resize: vertical; min-height: 7.5rem; line-height: 1.5; }
input[type="email"]:focus-visible, input[type="password"]:focus-visible, input[type="text"]:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; border-color: var(--navy); }
input[type="file"] { font: inherit; font-size: 0.95rem; max-width: 100%; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--navy); width: 20px; height: 20px; margin: 0; flex: none; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.choice { display: grid; gap: 8px; }
.choice legend { padding: 0; margin-bottom: 8px; }
.radio { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--paper); cursor: pointer; }
.radio:has(input:checked) { border-color: var(--navy); background: var(--gold-wash); }

/* ---------- Sign in ---------- */

.signin {
  width: min(27rem, calc(100% - 2 * var(--gutter)));
  margin: clamp(28px, 8vh, 80px) auto 64px;
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 40px);
}
.signin-crest { width: 132px; height: 132px; margin: 0 auto 14px; }
.signin h1 { font-size: var(--step-3); text-align: center; }
.signin > .muted { text-align: center; margin-top: 6px; }
.signin form { margin-top: 26px; }
.signin .button { width: 100%; }

/* ---------- Choosing a child ---------- */

.child-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 28px; }
.child-tile {
  width: 100%; display: grid; gap: 8px; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: 2px; padding: 26px 24px;
}
.child-tile:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.child-tile:disabled { cursor: progress; opacity: 0.7; }
.child-name { font-family: var(--serif); font-size: var(--step-3); color: var(--navy-deep); line-height: 1.1; }
.child-action { font-size: var(--step--1); font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-ink); }

/* ---------- Lessons ---------- */

.lesson-list { list-style: none; display: grid; gap: 16px; max-width: 780px; }
.lesson-card { background: var(--paper); border: 1px solid var(--line); padding: clamp(20px, 3vw, 28px); display: grid; gap: 8px; }
.lesson-card h2 { font-size: var(--step-3); }
.lesson-card .actions { margin-top: 10px; }

.panel { background: var(--paper); border: 1px solid var(--line); padding: clamp(18px, 3vw, 26px); min-width: 0; }
.panel > h2 { font-size: var(--step-2); margin-bottom: 14px; }
.panel h3 { font-family: var(--sans); font-weight: 600; font-size: var(--step-0); color: var(--navy-deep); margin: 20px 0 8px; }
.overview { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 24px; align-items: start; }

.plain { list-style: none; display: grid; gap: 8px; }
.plain li { position: relative; padding-left: 18px; }
.plain li::before { content: ""; position: absolute; left: 0; top: 0.68em; width: 6px; height: 6px; background: var(--gold); }

.objectives { list-style: none; display: grid; gap: 14px; }
.objectives li + li { border-top: 1px dashed var(--line); padding-top: 14px; }
.objective-text { font-family: var(--serif); font-size: var(--step-1); color: var(--navy-deep); line-height: 1.35; }
.objectives .meta { margin-top: 4px; overflow-wrap: anywhere; }

.checklist { list-style: none; display: grid; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 7px 0; }
.checklist input { margin-top: 3px; }
.checklist input:checked + label { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--gold); }

.bands { display: grid; gap: 10px; }
.bands .hint { margin-bottom: 4px; }
.band-option { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line-strong); border-radius: 2px; cursor: pointer; }
.band-option:has(input:checked) { border-color: var(--navy); background: var(--gold-wash); }
.band-option input { margin-top: 3px; }
.band-body { display: grid; gap: 2px; }
.band-name { font-weight: 600; color: var(--navy-deep); }
.band-sample { font-size: 0.97rem; }

.start-panel { background: var(--navy-deep); color: var(--on-navy); padding: 22px 24px; display: grid; gap: 12px; }
.start-panel h2 { color: #fff; font-size: var(--step-2); }
.start-panel p { color: var(--on-navy-muted); font-size: 0.97rem; }
.start-panel .button { width: 100%; background: var(--gold-bright); border-color: var(--gold-bright); color: var(--navy-deep); }
.start-panel .button:hover { background: var(--gold); border-color: var(--gold); color: var(--navy-deep); }
.start-panel .problem { background: var(--alert-wash); }

.phase-outline { list-style: none; counter-reset: phase; display: grid; }
.phase-outline li { counter-increment: phase; display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.phase-outline li:first-child { border-top: 0; padding-top: 0; }
.phase-outline li span:first-child::before { content: counter(phase); display: inline-block; width: 1.4em; color: var(--gold-ink); font-variant-numeric: tabular-nums; }

/* ---------- The lesson runner ---------- */

.stepper-wrap { overflow-x: auto; margin-bottom: clamp(20px, 3vw, 28px); background: var(--paper); border: 1px solid var(--line); }
.stepper { list-style: none; display: flex; min-width: 720px; }
.step { flex: 1 1 0; border-left: 1px solid var(--line); }
.step:first-child { border-left: 0; }
.step > a, .step > span { display: flex; align-items: center; gap: 10px; height: 100%; padding: 11px 14px; font-size: 0.93rem; line-height: 1.25; color: var(--muted); text-decoration: none; }
.step > a:hover { background: var(--wash); color: var(--navy-deep); }
.step-mark {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--paper);
  font-size: 0.85rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted);
}
.step.is-done > a, .step.is-done > span { color: var(--ink); }
.step.is-done .step-mark { background: var(--gold-wash); border-color: var(--gold-line); color: var(--gold-ink); }
.step.is-current { box-shadow: inset 0 -3px 0 var(--gold); }
.step.is-current > span { color: var(--navy-deep); font-weight: 600; }
.step.is-current .step-mark { background: var(--navy); border-color: var(--navy); color: #fff; }

.runner { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 32px); align-items: start; }

.child-card { background: var(--paper); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.child-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding: 9px 20px; background: var(--wash); border-bottom: 1px solid var(--line); }
.child-card-head h2 { font-family: var(--sans); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--navy); }
.child-card-body { padding: clamp(20px, 3vw, 30px); }
.child-card-body p { font-size: var(--step-2); font-weight: 500; line-height: 1.45; color: var(--navy-deep); max-width: 30em; }
.child-card-body p + p { margin-top: 0.6em; }

.segmented { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.seg-label { font-size: var(--step--1); color: var(--muted); margin-right: 4px; }
.seg { position: relative; display: block; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span { display: block; min-width: 34px; padding: 3px 10px; text-align: center; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--paper); color: var(--navy); font-size: var(--step--1); font-weight: 600; font-variant-numeric: tabular-nums; }
.seg input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }

.adult { background: var(--paper); border: 1px solid var(--line); padding: clamp(18px, 3vw, 28px); }
.adult > h2 { font-size: var(--step-2); margin-bottom: 14px; }
.adult h3 { font-family: var(--sans); font-weight: 600; font-size: var(--step-0); margin: 16px 0 8px; }
.script { display: grid; gap: 12px; }
.script p, .script li { max-width: 46em; }
.script ul { list-style: none; display: grid; gap: 12px; }
.script li { position: relative; padding-left: 24px; }
.script li::before { content: ""; position: absolute; left: 3px; top: 0.62em; width: 7px; height: 7px; border: 1.5px solid var(--gold); transform: rotate(45deg); }
q { quotes: "\201C" "\201D" "\2018" "\2019"; }
q.say { font-family: var(--serif); font-size: 1.05em; color: var(--navy-deep); }

.frac { display: inline-flex; flex-direction: column; align-items: stretch; vertical-align: middle; margin: 0 0.1em; font-family: var(--sans); font-size: 0.8em; line-height: 1.05; text-align: center; font-variant-numeric: lining-nums tabular-nums; }
.frac .num { border-bottom: max(1px, 0.08em) solid currentColor; padding: 0 0.2em 0.06em; }
.frac .den { padding: 0.06em 0.2em 0; }

.complete { background: var(--paper); border: 1px solid var(--line-strong); padding: clamp(18px, 3vw, 28px); }
.complete > h2 { font-size: var(--step-2); }
.recorded { background: var(--paper); border: 1px solid var(--gold-line); padding: clamp(18px, 3vw, 26px); display: grid; gap: 10px; }
.recorded-head { font-size: var(--step--1); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-ink); }
.recorded .actions { margin-top: 8px; }

.reference { display: grid; gap: 12px; align-content: start; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; min-width: 0; }
.ref-block { background: var(--paper); border: 1px solid var(--line); padding: 0 18px; }
.ref-block > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; font-weight: 600; color: var(--navy-deep); }
.ref-block > summary::-webkit-details-marker { display: none; }
.ref-block > summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--gold-ink); }
.ref-block[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.ref-block[open] > summary::after { content: "\2212"; }
.ref-block > ul { padding-bottom: 16px; font-size: 0.95rem; line-height: 1.5; }
.ref-static { padding: 16px 18px; }
.ref-static > h2 { font-family: var(--sans); font-size: var(--step-0); font-weight: 600; margin-bottom: 10px; }

.errors { list-style: none; display: grid; }
.errors li { display: grid; gap: 5px; padding: 12px 0; border-top: 1px dashed var(--line); }
.errors li:first-child { border-top: 0; padding-top: 0; }
.tag { display: block; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.err-see { color: var(--navy-deep); font-weight: 500; }
.err-do .tag { color: var(--gold-ink); }

.escalate { border-color: var(--alert-line); padding: 16px 18px; display: grid; gap: 12px; }
.escalate h2 { font-family: var(--sans); font-size: var(--step-0); font-weight: 600; color: var(--alert); }
.escalate .plain { font-size: 0.95rem; line-height: 1.5; }
.escalate .plain li::before { background: var(--alert); }

.dialog { width: min(32rem, calc(100% - 32px)); padding: clamp(22px, 4vw, 32px); color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 2px; }
.dialog::backdrop { background: rgba(10, 36, 66, 0.5); }
.dialog h2 { font-size: var(--step-3); margin-bottom: 12px; }
.dialog p + p { margin-top: 10px; }

.recap { list-style: none; display: grid; }
.recap li { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.recap li:first-child { border-top: 0; padding-top: 0; }
.recap strong { font-weight: 600; color: var(--navy-deep); }

/* ---------- The evidence record (the same object as the site's example record) ---------- */

.record { margin-top: 28px; background: var(--paper); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.record-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 12px 20px; background: var(--wash); border-bottom: 1px solid var(--line); }
.record-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--navy); }
.record-meta { font-size: var(--step--1); color: var(--muted); }
.record-objective { padding: 18px 20px 14px; }
.record-objective .eyebrow { font-size: 0.72rem; overflow-wrap: anywhere; }
.record-objective p + p { font-family: var(--serif); font-size: var(--step-1); line-height: 1.35; color: var(--navy-deep); margin-top: 6px; }
.entries { list-style: none; }
.entries li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 14px; padding: 14px 20px; border-top: 1px dashed var(--line); }
.entry-date { font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.entry-note { font-size: 0.97rem; line-height: 1.5; white-space: pre-line; }
.entry-by { font-size: var(--step--1); color: var(--muted); margin-top: 6px; }
.chip { display: inline-block; margin-top: 8px; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1; padding: 5px 8px; border-radius: 2px; border: 1px solid var(--line-strong); color: var(--muted); }
.chip-independent { color: var(--gold-ink); background: var(--gold-wash); border-color: var(--gold-line); }
.record-decision { background: var(--navy); color: var(--on-navy); padding: 16px 20px; display: grid; gap: 4px; }
.record-decision strong { font-family: var(--serif); font-weight: 400; font-size: var(--step-1); color: var(--gold-bright); }
.record-decision span { font-size: 0.95rem; color: var(--on-navy-muted); line-height: 1.5; }

/* ---------- Narrow screens ---------- */

@media (max-width: 900px) {
  .runner, .overview { grid-template-columns: minmax(0, 1fr); }
  .reference { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 640px) {
  .bar-crest img { width: 44px; height: 44px; }
  .bar-guardian > span { display: none; }
  .child-card-body p { font-size: var(--step-1); }
  .entries li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* ---------- Sign up, codes, reset ---------- */

.alt-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-top: 22px; font-size: 0.95rem; }
.alt-actions a { text-decoration-color: var(--gold-line); }
.signin input[inputmode="numeric"] { font-size: 1.5rem; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- The day's plan ---------- */

.slots { list-style: none; display: grid; gap: 10px; max-width: 900px; }
.slot {
  display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; gap: 4px 16px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--line-strong);
  padding: 14px 18px;
}
.slot.is-protected { border-left-color: var(--gold); }
.slot.is-empty { background: var(--wash); }
.slot-when { font-family: var(--serif); font-size: var(--step-2); color: var(--line-strong); line-height: 1; }
.slot-body { display: grid; gap: 3px; min-width: 0; }
.slot-subject { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy); }
.slot-lesson { font-family: var(--serif); font-size: var(--step-1); color: var(--navy-deep); line-height: 1.3; }
.chip-protected { margin: 0; color: var(--gold-ink); background: var(--gold-wash); border-color: var(--gold-line); }
.child-tile.is-suggested { border-color: var(--gold); background: var(--gold-wash); }

/* ---------- Choosing who delivers ---------- */

.delivery { display: grid; gap: 12px; }
.delivery-question { font-weight: 600; color: #fff; }
.delivery-choice { display: grid; gap: 14px; }
.delivery-choice .button { width: 100%; }
.delivery-choice .hint { color: var(--on-navy-muted); margin-top: 6px; }
.start-panel .delivery-choice .button-quiet { background: transparent; color: #fff; border-color: var(--on-navy-muted); }
.start-panel .delivery-choice .button-quiet:disabled { color: var(--on-navy-muted); cursor: not-allowed; }

/* ---------- The tutor ---------- */

.tutor .thread { display: grid; gap: 12px; max-height: 46vh; overflow-y: auto; margin: 16px 0; padding-right: 4px; }
.said-tutor, .said-child { display: grid; gap: 2px; padding: 12px 14px; border-radius: 2px; max-width: 46em; }
.said-tutor { background: var(--wash); border: 1px solid var(--line); }
.said-child { background: var(--gold-wash); border: 1px solid var(--gold-line); justify-self: end; }
.who { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.tutor-say { display: flex; gap: 10px; }
.tutor-say input { flex: 1 1 auto; width: auto; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 2px; padding: 11px 13px; }
.tutor-say input:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; border-color: var(--navy); }
@media (max-width: 640px) {
  .slot { grid-template-columns: 2rem minmax(0, 1fr); }
  .slot > .button { grid-column: 1 / -1; margin-top: 8px; }
}

/* ---------- Voice, and what the child needs to hand ---------- */

.tutor-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.tutor-head .linkish { font-size: var(--step--1); }
.tutor .needs { margin: 12px 0 0; padding: 0 16px; background: var(--wash); }
.tutor .needs > summary { padding: 10px 0; font-size: 0.95rem; font-weight: 600; color: var(--navy-deep); cursor: pointer; }
.tutor .needs > ul { padding-bottom: 14px; font-size: 0.95rem; }
.mic { touch-action: none; user-select: none; }
.mic:active { background: var(--gold-wash); border-color: var(--gold); color: var(--navy-deep); }

/* ---------------------------------------------------------------- screen workspaces
   What the child manipulates instead of objects in the room (assets/workspace.js). The workspace sits directly
   under the tutor's words, sized to be used with a finger on a tablet. Colours come from the house palette:
   navy is the ink, gold is the thing the child has acted on. */
.ws { margin: 1rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--wash); }
.ws-hint { margin: 0 0 .75rem; color: var(--muted); font-size: .95rem; }
.ws-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; align-items: center; }
.ws-count { display: block; margin-top: .6rem; font-weight: 500; color: var(--muted); }
.ws-inline { padding: .45rem .6rem; border: 1px solid var(--line-strong); border-radius: 7px; font: inherit; min-width: 9rem; }
.ws-inline-num { min-width: 6rem; }

/* counters: ten ones close into a group, which is the exchange place value is about */
.ws-tray { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-start; min-height: 5rem;
           padding: .6rem; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.ws-group { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; padding: 6px;
            border: 2px solid var(--gold); border-radius: 8px; background: var(--gold-wash); cursor: pointer; }
.ws-loose { display: flex; flex-wrap: wrap; gap: 5px; max-width: 14rem; align-content: flex-start; }
.ws-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--gold); display: block; }
.ws-dot-loose { background: var(--navy); }

/* partition: equal parts guaranteed by construction */
.ws-shape { display: flex; border: 2px solid var(--navy); border-radius: 6px; overflow: hidden;
            min-height: 6rem; background: var(--paper); }
.ws-shape-circle { border-radius: 50%; }
.ws-part { border: 0; border-right: 1px solid var(--navy); background: transparent; cursor: pointer; min-height: 6rem; }
.ws-part:last-child { border-right: 0; }
.ws-part.is-shaded { background: var(--gold); }

/* number line and timeline */
.ws-line { position: relative; height: 4.5rem; margin: 1.75rem 0 .5rem; border-top: 2px solid var(--navy); }
.ws-tick, .ws-mark, .ws-event { position: absolute; transform: translateX(-50%); top: 0; }
.ws-tick i, .ws-event i { display: block; width: 2px; height: 10px; background: var(--navy); margin: 0 auto; }
.ws-tick b, .ws-event b { display: block; font-size: .8rem; font-weight: 500; white-space: nowrap; color: var(--muted); }
.ws-mark { width: 15px; height: 15px; margin-top: -8px; border-radius: 50%; background: var(--gold);
           border: 2px solid var(--navy); }
.ws-timeline-line { height: 5.5rem; }

/* grid */
.ws-grid { display: grid; gap: 1px; background: var(--line-strong); border: 1px solid var(--line-strong); max-width: 32rem; }
.ws-cell { aspect-ratio: 1; border: 0; background: var(--paper); cursor: pointer; padding: 0; }
.ws-cell.is-on { background: var(--gold); }

/* sort */
.ws-pool { display: flex; flex-wrap: wrap; gap: .5rem; min-height: 2.6rem; }
.ws-bins { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .9rem; }
.ws-bin { flex: 1 1 10rem; border: 1px dashed var(--line-strong); border-radius: 8px; padding: .6rem; background: var(--paper); }
.ws-bin-head { display: block; width: 100%; margin-bottom: .5rem; border: 0; background: transparent;
               font: inherit; font-weight: 600; text-align: left; cursor: pointer; color: var(--navy); }
.ws-chip { padding: .4rem .75rem; border: 1px solid var(--line-strong); border-radius: 999px;
           background: var(--paper); font: inherit; cursor: pointer; color: var(--ink); }
.ws-chip.is-picked { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
.ws-chip.is-placed { display: inline-block; margin: .15rem; cursor: default; background: var(--gold-wash); }

/* draw, text, organiser */
.ws-canvas { width: 100%; max-width: 100%; aspect-ratio: 760 / 420; border: 1px solid var(--line-strong);
             border-radius: 8px; background: var(--paper); touch-action: none; cursor: crosshair; color: var(--ink); }
.ws-text { width: 100%; padding: .6rem; border: 1px solid var(--line-strong); border-radius: 8px;
           font: inherit; resize: vertical; background: var(--paper); color: var(--ink); }
.ws-box { margin-bottom: .75rem; }
.ws-box-title { display: block; margin-bottom: .3rem; color: var(--navy); }

/* map */
.ws-map { position: relative; aspect-ratio: 2 / 1; border: 1px solid var(--line-strong); border-radius: 8px;
          background: var(--paper); cursor: crosshair; overflow: hidden; }
.ws-pin { position: absolute; transform: translate(-50%, -100%); text-align: center; pointer-events: none; }
.ws-pin i { display: block; width: 11px; height: 11px; border-radius: 50%; background: var(--gold);
            border: 2px solid var(--navy); margin: 0 auto; }
.ws-pin b { font-size: .75rem; white-space: nowrap; background: var(--paper); padding: 0 .2rem; border-radius: 3px; }

/* keyboard */
.ws-keys { display: flex; gap: 2px; overflow-x: auto; padding-bottom: .3rem; }
.ws-key { flex: 0 0 2.5rem; height: 7.5rem; border: 1px solid var(--navy); border-radius: 0 0 5px 5px;
          background: var(--paper); color: var(--muted); font: inherit; font-size: .75rem; cursor: pointer;
          display: flex; align-items: flex-end; justify-content: center; padding-bottom: .4rem; }
.ws-key-black { flex: 0 0 1.6rem; height: 4.8rem; background: var(--navy); color: var(--on-navy); margin: 0 -.8rem; z-index: 1; }
.ws-key:active { background: var(--gold); color: var(--navy); }

/* ---------------------------------------------------------------- tapping, not zooming
   A child taps "Add one" ten times to build a number. On a tablet the second and third of those taps are a
   double-tap, which the browser reads as "zoom in" — the page lurches and the lesson is suddenly the wrong size.
   `touch-action: manipulation` keeps the tap and drops the double-tap zoom on anything meant to be pressed
   repeatedly, which is every control in a workspace. The page itself still pinch-zooms, so nothing is taken away
   from someone who needs to magnify it.

   `user-select: none` goes with it: repeated taps otherwise start selecting the button's own label, and a child
   ends up dragging a blue highlight around instead of counting. Text they might actually want to copy — the
   tutor's words, the lesson script — is deliberately left selectable. */
button,
.button,
.linkish,
.child-tile,
.ws-part,
.ws-cell,
.ws-chip,
.ws-group,
.ws-key,
.ws-bin-head,
label,
summary {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

/* The map and the number line are tapped at a point, so they must not pan or zoom under a finger either. */
.ws-map,
.ws-line,
.ws-grid {
  touch-action: manipulation;
}

/* Stop the grey flash iOS paints over a tapped control; the workspaces have their own pressed states. */
button, .button, .linkish, .child-tile, .ws-part, .ws-cell, .ws-chip, .ws-key {
  -webkit-tap-highlight-color: transparent;
}

/* The Done button: the main thing a child presses after building something, so it is large enough to hit
   without aiming and sits directly under the workspace it refers to. */
.done-row { align-items: center; gap: .75rem; margin-top: .25rem; }
.done-button { min-width: 8rem; min-height: 3rem; font-size: 1.05rem; }
.done-row .hint { margin: 0; }
