/* Vita Maths base styles. No external fonts or assets. */
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('/public/fonts/AtkinsonHyperlegible-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('/public/fonts/AtkinsonHyperlegible-Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --ink: #1b2430; --muted: #5a6573; --bg: #f7f8fb; --card: #ffffff; --line: #d5dae3;
  --brand: #1d3557; --brand-2: #274c77; --accent: #f4c542; --accent-ink: #5c4400;
  --focus: #ffbf47; --ok: #176a2b; --ok-bg: #e3f4e7; --warn: #8a5a00; --warn-bg: #fff1cc; --bad: #b3261e; --bad-bg: #fde7e6;
  --info: #1f5f99; --info-bg: #e3eefa; --progress: #5b4fa0; --progress-bg: #ece9fb;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.05);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, Verdana, Arial, sans-serif;
  --vis-ink: #1b2430; --vis-accent: #d1495b; --vis-fill: #4f86c6; --vis-fill-2: #f4c542; --vis-fill-3: #7fb069; --vis-shade: #4f86c6; --vis-grid: #cfd6e0;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: calc(100% * var(--text-scale, 1)); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding-block: 1.25rem 2.5rem; outline: none; }
.wrap { width: min(1180px, 100% - 2rem); margin-inline: auto; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: .25rem 0 1rem; color: var(--brand); }
h2 { font-size: 1.25rem; margin: 0 0 .75rem; color: var(--brand); }
h3 { font-size: 1.05rem; margin: .75rem 0 .4rem; }
a { color: var(--brand-2); text-underline-offset: 2px; }
a:hover { color: var(--brand); }
code { background: #eef1f6; padding: .05em .35em; border-radius: 4px; font-size: .95em; }
.big-code { font-size: 1.2em; letter-spacing: .08em; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.lead { font-size: 1.15rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: .5rem; top: -3rem; background: var(--accent); color: #000; padding: .5rem 1rem; z-index: 100; border-radius: 0 0 6px 6px; font-weight: 700; }
.skip-link:focus { top: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px #1b2430; }

/* header */
.site-header { background: var(--brand); color: #fff; }
.header-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; min-height: 3.5rem; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.2rem; display: inline-flex; align-items: center; gap: .4rem; }
.brand:hover { color: var(--accent); }
.brand-mark { background: var(--accent); color: var(--brand); border-radius: 6px; width: 1.7rem; height: 1.7rem; display: inline-grid; place-items: center; }
.main-nav { display: flex; gap: .25rem; flex-wrap: wrap; flex: 1; }
.main-nav a { color: #fff; text-decoration: none; padding: .5rem .7rem; border-radius: 6px; min-height: 44px; display: inline-flex; align-items: center; }
.main-nav a:hover, .main-nav a[aria-current] { background: var(--brand-2); }
.logout { display: flex; align-items: center; gap: .5rem; margin: 0; }
.logout .who { opacity: .9; }
.site-footer { color: var(--muted); font-size: .85rem; padding: 1rem 0 1.5rem; border-top: 1px solid var(--line); }

/* buttons + forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 44px; padding: .55rem 1rem; border-radius: 8px; border: 2px solid var(--brand-2); background: #fff; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: #eef3fb; color: var(--brand); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-2); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: inherit; text-decoration: underline; }
.site-header .btn-ghost { color: #fff; border-color: rgba(255,255,255,.5); text-decoration: none; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-small { min-height: 36px; padding: .3rem .7rem; font-size: .92rem; }
.btn-big { min-height: 56px; padding: .8rem 1.5rem; font-size: 1.2rem; border-radius: 12px; }
input, select, textarea { font: inherit; color: inherit; padding: .5rem .65rem; border: 2px solid #8a95a5; border-radius: 8px; background: #fff; min-height: 44px; max-width: 100%; }
textarea { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .95rem; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); }
label { font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.stack > input:not([type=checkbox]):not([type=radio]), .stack > select, .stack > textarea { width: 100%; }
.stack > .btn { margin-top: .5rem; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin: .5rem 0 1rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; min-height: 32px; }
.check input { width: 1.25rem; height: 1.25rem; min-height: 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; margin: .5rem 0; width: 100%; }
legend { font-weight: 700; padding: 0 .3rem; }
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.input-huge { font-size: 2rem; text-align: center; letter-spacing: .15em; padding: .6rem; width: 100%; }
.error { color: var(--bad); background: var(--bad-bg); padding: .6rem .8rem; border-radius: 8px; border-left: 5px solid var(--bad); }
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; background: var(--ok-bg); border-left: 5px solid var(--ok); }
.flash-error { background: var(--bad-bg); border-color: var(--bad); }

/* layout pieces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card.narrow, .narrow { max-width: 34rem; margin-inline: auto; }
.card.danger, .danger { border-color: #f1b8b4; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: 1rem; align-items: start; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: .45rem 0; border-bottom: 1px solid #eef0f4; }
.list .actions { display: block; font-size: .9rem; }
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th { background: #eef1f6; font-size: .92rem; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.row-error td { background: #fff6f5; }
.row-ok td { background: #f6fbf7; }
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem; border-radius: 999px; background: #eef1f6; font-size: .88rem; font-weight: 600; }
.badge-red { background: var(--bad-bg); color: var(--bad); }
.badge-green { background: var(--ok-bg); color: var(--ok); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-progress { background: var(--progress-bg); color: var(--progress); }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: .75rem; }
.tab { padding: .5rem .9rem; border-radius: 8px 8px 0 0; border: 1px solid var(--line); border-bottom: 3px solid transparent; text-decoration: none; background: #fff; min-height: 44px; display: inline-flex; align-items: center; }
.tab[aria-current] { border-bottom-color: var(--brand); font-weight: 700; }
.hero { text-align: center; padding: 3rem 1rem; }
.hero h1 { font-size: 2.6rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }

/* RAG: colour is always paired with an icon and text */
.rag { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .5rem; border-radius: 6px; font-weight: 600; font-size: .9rem; border: 1px solid transparent; white-space: nowrap; }
.rag-green { background: var(--ok-bg); color: var(--ok); border-color: #9fd3ac; }
.rag-amber { background: var(--warn-bg); color: var(--warn); border-color: #f1d27a; }
.rag-red { background: var(--bad-bg); color: var(--bad); border-color: #f1b8b4; }
.rag-progress { background: var(--progress-bg); color: var(--progress); border-color: #c9c1f0; }
.rag-none { color: var(--muted); }
.rag-icon { font-size: 1.05em; }
.legend { display: flex; flex-wrap: wrap; gap: .5rem; }
.markbook th[scope=col] { min-width: 9rem; }
.markbook .rag-text { font-size: .8rem; font-weight: 500; }
.cell-link { text-decoration: none; }
.markbook tfoot th, .markbook tfoot td { font-weight: 700; background: #f4f6fa; }

/* library */
.strand-block { border-left: 6px solid var(--brand-2); padding-left: 1rem; margin: 1.25rem 0; }
.objective { margin-bottom: .75rem; }
.obj-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; background: #eef1f6; padding: .05em .35em; border-radius: 4px; }
.gen-list { list-style: none; padding: 0; margin: 0; }
.gen { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: center; padding: .45rem .6rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-bottom: .35rem; }
.gen-title { font-weight: 600; flex: 1 1 16rem; }
.gen-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.gen-pick { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; padding: .3rem 0; }
.gen-pick .check { flex: 1 1 18rem; }
.count-input { width: 5rem; }
.obj-title { margin: .5rem 0 .2rem; font-weight: 600; }
.preview-list { padding-left: 1.25rem; }
.answer-line { background: var(--ok-bg); padding: .4rem .6rem; border-radius: 6px; }
.choice-list { list-style: none; padding: 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.choice-list li { border: 1px solid var(--line); border-radius: 6px; padding: .2rem .6rem; }
.choice-letter { font-weight: 700; color: var(--brand-2); }

/* pupil */
.section-pupil main { font-size: 1.1rem; }
.pupil-login { text-align: center; }
.pupil-login .stack { align-items: stretch; }
.name-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .75rem; }
.btn-name { width: 100%; min-height: 72px; font-size: 1.3rem; border-radius: 14px; }
.pic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin: 1rem auto; max-width: 24rem; }
.pic-btn { aspect-ratio: 1; border: 3px solid var(--brand-2); border-radius: 16px; background: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font: inherit; min-height: 88px; }
.pic-btn:hover { background: #eef3fb; }
.pic-btn:active { transform: scale(.96); }
.pic-emoji { font-size: 2.6rem; line-height: 1; }
.pic-label { font-size: .9rem; margin-top: .25rem; }
.pic-chosen { display: flex; justify-content: center; gap: .75rem; }
.pic-chosen .slot { width: 4rem; height: 4rem; border: 3px dashed #8a95a5; border-radius: 12px; display: grid; place-items: center; font-size: 2.2rem; background: #fff; }
.pic-chosen .slot.filled { border-style: solid; border-color: var(--brand); }
.keypad { display: grid; grid-template-columns: repeat(3, 4.2rem); gap: .5rem; justify-content: center; margin: .75rem auto; }
.key { min-height: 3.6rem; font-size: 1.5rem; font-weight: 700; border-radius: 12px; border: 2px solid var(--brand-2); background: #fff; color: var(--brand); cursor: pointer; font-family: inherit; }
.key:active { background: #eef3fb; }
.task-cards { list-style: none; padding: 0; display: grid; gap: .75rem; }
.task-card { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: .9rem 1rem; display: flex; flex-direction: column; gap: .35rem; }
.task-card.is-overdue { border-color: #f1b8b4; }
.task-card.is-done { background: #fbfdfb; }
.task-link { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; text-decoration: none; color: inherit; }
.task-title { font-weight: 700; font-size: 1.15rem; flex: 1 1 14rem; }
.task-meta { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.stars { font-size: 1.4rem; letter-spacing: .1em; }
.star-on { color: #d99a00; }
.star-off { color: #c9ced6; }
.empty { font-size: 1.15rem; }
.strand-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem; }
.btn-strand { width: 100%; min-height: 84px; font-size: 1.15rem; border-radius: 14px; }
.mastery-list { list-style: none; padding: 0; display: grid; gap: .6rem; }
.mastery-row { display: grid; grid-template-columns: minmax(10rem, 16rem) 1fr 3.5rem; gap: .25rem 1rem; align-items: center; background: #fff; padding: .6rem .8rem; border-radius: 10px; border: 1px solid var(--line); }
.mastery-note { grid-column: 1 / -1; }
.meter { height: 1.1rem; background: #e7eaf0; border-radius: 999px; overflow: hidden; border: 1px solid #c8ced8; }
.meter-fill { display: block; height: 100%; background: var(--vis-fill); }
.band-secure .meter-fill { background: var(--ok); }
.band-developing .meter-fill { background: #d99a00; }
.stars-total { font-size: 1.3rem; }

/* player */
.player-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; }
.progress-wrap { display: flex; align-items: center; gap: .6rem; flex: 1 1 16rem; max-width: 26rem; }
.progress-bar { flex: 1; height: .9rem; background: #e3e7ee; border-radius: 999px; overflow: hidden; border: 1px solid #c8ced8; }
#progress-fill { display: block; height: 100%; width: 0; background: var(--ok); transition: width .3s ease; }
.progress-text { font-weight: 600; white-space: nowrap; }
.q-card { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 1.25rem 1.4rem; box-shadow: var(--shadow); max-width: 52rem; }
.q-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.q-number { color: var(--muted); font-weight: 600; margin: 0; }
.q-tools { display: flex; gap: .4rem; flex-wrap: wrap; }
.q-prompt { font-size: 1.45rem; line-height: 1.5; margin: .6rem 0 1rem; outline: none; }
.input-hint { color: var(--muted); margin: .25rem 0; }
.answer-area { margin: .75rem 0; }
.answer-label { display: block; margin-bottom: .3rem; }
.answer-row { display: flex; align-items: center; gap: .5rem; }
.answer-input { font-size: 1.5rem; padding: .5rem .75rem; min-width: 8rem; width: min(100%, 16rem); }
.unit, .unit-before { font-size: 1.4rem; font-weight: 600; }
.fraction-input { display: inline-flex; flex-direction: column; align-items: center; gap: .3rem; }
.fraction-input .answer-input { width: 6rem; min-width: 0; text-align: center; }
.fraction-bar { display: block; width: 6.5rem; height: 4px; background: var(--ink); border-radius: 2px; }
.multi-part { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .4rem 0; }
.multi-part label { min-width: 8rem; }
.part-mark { font-weight: 700; font-size: 1.3rem; }
.choices { border: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .6rem; }
.choices legend { margin-bottom: .4rem; padding: 0; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice label { display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 56px; padding: .5rem .8rem; border: 3px solid #8a95a5; border-radius: 12px; background: #fff; cursor: pointer; font-size: 1.3rem; font-weight: 600; text-align: center; }
.choice input:checked + label { border-color: var(--brand); background: #e7eefb; box-shadow: inset 0 0 0 2px var(--brand); }
.choice input:checked + label::before { content: '✓'; color: var(--brand); }
.choice input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.choices-big .choice label { min-height: 84px; font-size: 1.6rem; }
.q-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .75rem; }
.hints { background: var(--warn-bg); border-radius: 10px; margin: .75rem 0 0; padding: .5rem .75rem .5rem 2rem; }
.hints:empty { display: none; }
.feedback { margin-top: 1rem; border-radius: 12px; }
.feedback:empty { display: none; }
.fb-correct, .fb-wrong, .fb-info { padding: .75rem 1rem; }
.fb-correct { background: var(--ok-bg); border-left: 6px solid var(--ok); }
.fb-wrong { background: var(--bad-bg); border-left: 6px solid var(--bad); }
.fb-info { background: var(--info-bg); border-left: 6px solid var(--info); }
.fb-title { font-weight: 700; font-size: 1.25rem; margin: 0 0 .25rem; }
.fb-icon { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: currentColor; }
.fb-correct .fb-title { color: var(--ok); }
.fb-wrong .fb-title { color: var(--bad); }
.fb-icon { color: inherit; background: none; border: 2px solid currentColor; }
.show-me { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .5rem .75rem; margin: .5rem 0; }
.show-me summary { font-weight: 700; cursor: pointer; min-height: 32px; }
.worked li { margin: .25rem 0; }
.results { text-align: center; max-width: 34rem; outline: none; }
.result-score { font-size: 1.5rem; }
.result-stars { font-size: 3rem; letter-spacing: .15em; margin: .25rem 0; }
.supports { display: flex; gap: .5rem; flex-wrap: wrap; }
.support summary { cursor: pointer; font-weight: 600; }

/* visuals */
.visual-box { margin: .5rem 0 1rem; }
.vis-svg { width: 100%; height: auto; display: block; }
.vis-text { fill: var(--vis-ink); font-size: 15px; font-family: inherit; }
.vis-small { font-size: 14px; }
.vis-tiny { font-size: 11px; }
.vis-bold { font-weight: 700; }
.vis-accent { fill: var(--vis-accent); font-weight: 700; }
.vis-stroke { stroke: var(--vis-ink); }
.vis-grid { stroke: var(--vis-grid); }
.vis-accent-stroke { stroke: var(--vis-accent); }
.vis-fill-ink { fill: var(--vis-ink); }
.vis-fill-accent { fill: var(--vis-accent); }
.vis-cell { fill: #b8d0ee; stroke: var(--vis-ink); stroke-width: 1; }
.vis-shape { fill: #e7eefb; stroke: var(--vis-ink); }
.vis-shaded { fill: var(--vis-shade); stroke: var(--vis-ink); }
.vis-unshaded { fill: #fff; stroke: var(--vis-ink); }
.vis-clock-face { fill: #fff; stroke: var(--vis-ink); }
.vis-bar-part { stroke: var(--vis-ink); }
.vis-bar-0 { fill: #b8d0ee; } .vis-bar-1 { fill: #f8de8b; } .vis-bar-2 { fill: #c4e0b2; }
.vis-bar-part.alt { fill-opacity: .75; }
.vis-pv { display: inline-flex; border: 2px solid var(--vis-ink); border-radius: 8px; overflow: hidden; background: #fff; max-width: 100%; }
.pv-col { border-right: 2px solid var(--vis-ink); min-width: 3.4rem; }
.pv-col:last-child { border-right: none; }
.pv-head { background: #eef1f6; font-weight: 700; text-align: center; padding: .25rem; border-bottom: 2px solid var(--vis-ink); }
.pv-body { display: grid; grid-template-columns: repeat(3, 1rem); gap: .2rem; padding: .4rem; justify-content: center; min-height: 4rem; align-content: start; }
.pv-counter { width: 1rem; height: 1rem; border-radius: 50%; background: var(--vis-fill); border: 1px solid var(--vis-ink); }
.pv-H .pv-counter, .pv-HTh .pv-counter { background: var(--vis-fill-3); }
.pv-T .pv-counter, .pv-TTh .pv-counter, .pv-TM .pv-counter { background: var(--vis-fill-2); }
.pv-t .pv-counter, .pv-h .pv-counter, .pv-th .pv-counter { background: #e3a1c0; }
.pv-point { align-self: end; font-size: 2rem; font-weight: 700; padding: 0 .2rem; }
.vis-objects { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 2rem; }
.obj-group { display: inline-flex; flex-wrap: wrap; gap: .2rem; max-width: 14rem; padding: .3rem .5rem; border: 2px dashed #b0b8c4; border-radius: 12px; }
.vis-hundred { border-collapse: collapse; font-size: .9rem; background: #fff; }
.vis-hundred td { border: 1px solid #8a95a5; width: 2.1rem; height: 2.1rem; text-align: center; padding: 0; }
.vis-hundred td.hl { background: var(--vis-fill-2); font-weight: 700; outline: 2px solid var(--vis-ink); outline-offset: -2px; }
.vis-table { border-collapse: collapse; background: #fff; }
.vis-table th, .vis-table td { border: 1px solid #8a95a5; padding: .35rem .7rem; text-align: center; }
.vis-table thead th { background: #eef1f6; }
.vis-pictogram { border-collapse: collapse; background: #fff; }
.vis-pictogram th, .vis-pictogram td { border: 1px solid #8a95a5; padding: .3rem .6rem; text-align: left; }
.vis-pictogram td { font-size: 1.6rem; }
.pic-sym { display: inline-block; }
.pic-part { width: calc(1.25em * var(--part, .5)); overflow: hidden; vertical-align: bottom; white-space: nowrap; }
.vis-key { font-weight: 600; }

/* login cards */
.login-cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem; }
.login-card { border: 2px dashed #8a95a5; border-radius: 12px; padding: .75rem 1rem; background: #fff; break-inside: avoid; }
.lc-name { font-size: 1.3rem; font-weight: 700; margin: 0 0 .25rem; }
.lc-pic { display: inline-block; margin-right: .5rem; }

/* worksheets (screen) */
.sheet { background: #fff; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; }
.sheet-questions { padding-left: 1.5rem; }
.sheet-q { margin-bottom: 1.4rem; break-inside: avoid; }
.sheet-q .q-prompt { font-size: 1.1rem; margin: .2rem 0 .4rem; }
.sheet-answer { margin-top: .4rem; }
.key-list { columns: 2; }

/* ---------- Phase 2: pupil player, SEN supports, settings, rewards ---------- */
.section-pupil .btn, .section-pupil .btn-small { min-height: 44px; }
.section-pupil .btn-small { padding: .4rem .8rem; font-size: 1rem; }
.section-pupil .main-nav a { min-height: 44px; }
.player-status { display: flex; align-items: center; gap: .75rem; }
.timer { font-weight: 700; font-variant-numeric: tabular-nums; padding: .25rem .6rem; border-radius: 8px; background: var(--info-bg); color: var(--info); border: 2px solid currentColor; }
.timer-low { background: var(--warn-bg); color: var(--warn); }
.timer-up { background: var(--bad-bg); color: var(--bad); }
.focus-exit { display: none; }
.offline-banner { background: var(--info-bg); color: var(--info); border-left: 6px solid var(--info); padding: .5rem .8rem; border-radius: 8px; margin: .5rem 0; font-weight: 600; }
.offline-banner[hidden] { display: none; }
.player-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.tool-panels.has-open { display: flex; flex-direction: column; gap: .75rem; }
@media (min-width: 900px) { .player-layout:has(.tool-panels.has-open) { grid-template-columns: minmax(0, 1fr) 20rem; } }
.player-body { display: flex; flex-direction: column; gap: 1rem; }
.q-card.is-resolved { border-style: dashed; }
.q-card.is-resolved .q-prompt { font-size: 1.2rem; }
.q-number { font-size: 1rem; }
.q-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; margin: .25rem 0 .5rem; }
.btn-tool[aria-expanded="true"], .btn-model[aria-expanded="true"] { background: var(--info-bg); }
.model-area { border: 2px solid var(--line); border-radius: 12px; padding: .6rem .8rem; margin: .5rem 0; background: var(--card); }
.model-area[hidden] { display: none; }
.model-choices { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.model-choices [aria-pressed="true"] { background: var(--brand); color: #fff; }
.support-picture summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.tool-panel { background: var(--card); border: 2px solid var(--brand-2); border-radius: 14px; padding: .75rem; box-shadow: var(--shadow); outline: none; }
.tool-panel[hidden] { display: none; }
.tool-panel:focus-visible { outline: 3px solid var(--focus); }
.tool-panel-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.tool-panel-title { margin: 0; font-size: 1.1rem; }
.tool-panel .vis-hundred td { width: 1.75rem; height: 1.75rem; }
.calculator { display: flex; flex-direction: column; gap: .5rem; }
.calc-display { display: block; font-size: 1.8rem; font-variant-numeric: tabular-nums; text-align: right; padding: .4rem .6rem; border: 2px solid #8a95a5; border-radius: 8px; background: #fff; color: var(--ink); min-height: 3rem; overflow-x: auto; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.calc-key { min-height: 48px; font-size: 1.3rem; }
.calc-op { background: var(--info-bg); }
.keypad-answer { grid-template-columns: repeat(4, 4.2rem); justify-content: start; }
.keypad .key { min-width: 44px; min-height: 52px; }
.part-mark { display: inline-flex; gap: .2rem; align-items: center; }
.part-ok { color: var(--ok); }
.part-bad { color: var(--bad); }
.result-msg { font-size: 1.5rem; font-weight: 700; color: var(--brand); }
.progress-bar-big { height: 1.25rem; width: 100%; max-width: 30rem; margin: .5rem auto; display: block; }
.progress-fill { display: block; height: 100%; background: var(--ok); }
.results .progress-bar-big { margin-inline: auto; }
.pop { animation: pop .45s ease-out; }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
.celebrate .star-on { display: inline-block; animation: pop .6s ease-out both; }
.celebrate .star-on:nth-child(2) { animation-delay: .15s; } .celebrate .star-on:nth-child(3) { animation-delay: .3s; }
.star-on { color: #8a5a00; } /* darker gold: 4.5:1 on white and tints */
.star-off { color: #5f6670; }

/* progress page */
.progress-summary { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; margin-bottom: 1rem; }
.overall-label { font-weight: 700; margin: 0; }
.progress-summary .progress-bar-big { margin-inline: 0; }
.rewards { margin-bottom: 1rem; }
.reward-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .75rem; }
.reward { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: .5rem .9rem; font-size: 1.1rem; }
.band-tag { display: inline-flex; gap: .25rem; align-items: center; font-weight: 700; margin-right: .5rem; }
.band-tag-secure { color: var(--ok); } .band-tag-developing { color: var(--warn); } .band-tag-emerging { color: var(--progress); } .band-tag-not-started { color: var(--muted); }
.badge-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem; }
.badge-earned { background: var(--warn-bg); color: var(--warn); border: 1px solid currentColor; }

/* settings */
.settings-form { max-width: 46rem; }
.setting-group { background: var(--card); margin-bottom: .75rem; }
.choice-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.pill-choice { display: inline-flex; align-items: center; gap: .45rem; min-height: 48px; padding: .35rem .9rem; border: 2px solid #8a95a5; border-radius: 999px; background: var(--card); cursor: pointer; font-weight: 600; }
.pill-choice input { width: 1.2rem; height: 1.2rem; min-height: 0; margin: 0; }
.pill-choice:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
.pill-choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.font-sample-dyslexic span { font-family: 'Atkinson Hyperlegible', Verdana, sans-serif; }
.font-sample-large span { font-size: 1.2em; font-family: Verdana, Arial, sans-serif; }
.swatch { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid #5a6573; display: inline-block; }
.swatch-none { background: #fff; } .swatch-cream { background: #fbf3dc; } .swatch-blue { background: #e3eefa; } .swatch-pink { background: #fbe6ee; } .swatch-green { background: #e5f4e3; } .swatch-grey { background: #e9eaec; }
.range-row { display: flex; align-items: center; gap: 1rem; }
.range-row input[type=range] { width: min(22rem, 100%); min-height: 44px; }
.range-row output { font-weight: 700; font-size: 1.2rem; min-width: 4ch; }
.big-check { min-height: 44px; font-size: 1.05rem; }
.big-check input { width: 1.4rem; height: 1.4rem; }
.locked-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .25rem 1rem; margin: 0; }
.locked-item { display: flex; justify-content: space-between; gap: .5rem; border-bottom: 1px solid var(--line); padding: .3rem 0; }
.locked-item dt { font-weight: 600; } .locked-item dd { margin: 0; color: var(--muted); }

/* dev visuals page */
.dev-gens { list-style: none; padding: 0; }
.dev-gen { border-top: 1px solid var(--line); padding: .5rem 0; }
.dev-gen-title { font-size: 1rem; }
.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: .75rem; }
.dev-sample { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .5rem; overflow: auto; }
.dev-prompt { margin: .2rem 0; }

/* extra visual parts */
.vis-ruler { fill: #f6e7b0; stroke: var(--vis-ink); stroke-width: 1.5; }
.vis-protractor { fill: rgba(79, 134, 198, .12); stroke: var(--vis-ink); }
.vis-cube { fill: #b8d0ee; stroke: var(--vis-ink); }
.vis-cube-top { fill: #dbe7f6; } .vis-cube-side { fill: #8fb2de; }
.vis-cell-part { fill-opacity: .6; }
.vis-on-shade { fill: #fff; paint-order: stroke; stroke: #1b2430; stroke-width: 3px; stroke-linejoin: round; }
.vis-tally { display: inline-block; vertical-align: middle; width: auto; height: 1.6rem; }

@media (max-width: 640px) {
  h1 { font-size: 1.45rem; }
  .q-prompt { font-size: 1.25rem; }
  .mastery-row { grid-template-columns: 1fr 3rem; }
  .mastery-row .meter { grid-column: 1 / -1; grid-row: 2; }
  .logout .who { display: none; }
}
