/* Design tokens. Text and control contrast computed for both themes (2026-09-30): text >= 5.9:1,
   field borders >= 3.5:1. Full WCAG 2.2 AA review with assistive tech is still pending. */
:root {
  /* Brand colours sampled from the EngZone logo (2026-09-30). */
  --bg: #f4f6fb;
  --surface: #ffffff;
  --ink: #1b2a4a;
  --ink-soft: #4a5470;
  --line: #d8deeb;
  --field-border: #7d88a3; /* 3.5:1 on surface (WCAG 1.4.11) */
  --primary: #1f3f7a;
  --primary-ink: #ffffff;
  --primary-soft: #e8edf7;
  --accent: #9b2c6e;
  --accent-soft: #f6e9f1;
  --lavender: #b79bd1;
  --sky: #8fb3e0;
  --success: #17684a;
  --success-soft: #e3f4ec;
  --error: #a4221b;
  --error-soft: #fdecea;
  --warning-soft: #fff4d6;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 6px 24px rgba(29, 37, 64, 0.08);
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

/* Dark theme: only when the user picks it with the toggle (data-theme on <html>, set by
   static/js/theme.js). Light is the default. Same tokens, so components need no changes. */
:root[data-theme="dark"] {
  --bg: #0f1626;
  --surface: #182238;
  --ink: #e8ecf6;
  --ink-soft: #aab4cc;
  --line: #2c3a57;
  --field-border: #6a7a9c;
  --primary: #8fb3e0;
  --primary-ink: #0f1626;
  --primary-soft: #22304d;
  --accent: #e08bbd;
  --accent-soft: #3a2236;
  --success: #6fd3a5;
  --success-soft: #173a2d;
  --error: #ff9a92;
  --error-soft: #3d1f1f;
  --warning-soft: #3a3120;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* Playful background drawings for children (static/img/kids-pattern.svg), kept faint so the
   reading stays easy to read. Behind everything, never clickable. */
body.kids::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("../img/kids-pattern.b954afd146ff.svg?v=4"); background-size: 360px 360px;
  opacity: 0.45;
}
:root[data-theme="dark"] body.kids::before { opacity: 0.16; }
@media print { body.kids::before { display: none; } }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
}
a { color: var(--primary); text-underline-offset: 3px; }
h1, h2 { line-height: 1.2; margin: 0 0 0.6em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
h2 { font-size: 1.25rem; }
p { margin: 0 0 0.9em; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link { position: absolute; left: -999px; top: 0.5rem; background: var(--surface); padding: 0.5rem 1rem; z-index: 10; }
.skip-link:focus { left: 0.5rem; }

/* Top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
/* School logo left, EngZone logo centred, account actions right. */
.topbar__inner { max-width: 1040px; margin: 0 auto; padding: 0.6rem 1rem; display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: "school brand actions"; align-items: center; gap: 0.75rem; }
.school-logo { grid-area: school; justify-self: start; display: block; width: 56px; height: 56px; border-radius: 14px; background: #fff; object-fit: contain; }
.topbar__inner .brand { grid-area: brand; justify-self: center; }
.topbar__actions { grid-area: actions; justify-self: end; }
@media (max-width: 640px) {
  .topbar__inner { grid-template-areas: "school brand ." "actions actions actions"; }
  .topbar__actions { justify-self: stretch; justify-content: flex-end; }
  .school-logo { width: 46px; height: 46px; }
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand__logo { display: block; height: 44px; width: auto; }
/* Two official logo files: navy on light, white/lilac on dark (client, 2026-09-30).
   Only one is shown, following the same theme rules as the colour tokens. */
.logo--dark { display: none !important; }
:root[data-theme="dark"] .logo--light { display: none !important; }
:root[data-theme="dark"] .logo--dark { display: block !important; }
.topbar__actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.theme-toggle[aria-pressed="true"] { border-color: var(--primary); }
.theme-toggle { width: 2.4rem; min-height: 2.4rem; height: 2.4rem; padding: 0; }
.theme-toggle__icon { font-size: 1.1rem; line-height: 1; }
@media (max-width: 420px) { .brand__logo { height: 36px; } }
.who { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.who__name { font-weight: 600; }
.who form { margin: 0; }

.page { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.page--center .page { display: grid; place-items: center; }
.footer { display: flex; gap: 1.25rem; justify-content: center; padding: 1rem; font-size: 0.95rem; }

/* Panels and layout */
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.panel--narrow { max-width: 520px; }
.panel--sign-in { width: min(100%, 440px); text-align: left; }
.columns { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 860px) { .columns { grid-template-columns: 3fr 2fr; align-items: start; } }
.lead { color: var(--ink-soft); }

/* Sign-in: the logo mark above a friendly greeting */
.back-link { display: inline-flex; align-items: center; gap: 0.4rem; justify-self: start; align-self: start; margin-bottom: 1rem; padding: 0.4rem 0.95rem 0.4rem 0.75rem; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); color: var(--primary); font-weight: 700; text-decoration: none; }
.back-link span { font-size: 1.15rem; line-height: 1; }
.back-link:hover { outline: 2px solid var(--primary); }
.back-arrow { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; margin-bottom: 0.5rem; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 1.25rem; font-weight: 800; text-decoration: none; }
.back-arrow:hover { outline: 2px solid var(--primary); }
.sign-in__mark { display: block; width: 88px; height: 88px; margin: 0 0 0.75rem; }
.panel--sign-in { border-top: 6px solid var(--accent); }

/* Forms */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.field input, .field select {
  width: 100%; min-height: 3rem; padding: 0.6rem 0.9rem; font: inherit; color: var(--ink);
  background: var(--surface); border: 2px solid var(--field-border); border-radius: var(--radius-sm);
}
.field input:focus, .field select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.field--error input, .field--error select { border-color: var(--error); }
.field__help { font-size: 0.93rem; color: var(--ink-soft); margin: 0 0 0.35rem; }
.field__error { color: var(--error); font-weight: 600; margin: 0.35rem 0 0; }
input[name="pin"] { letter-spacing: 0.5em; font-size: 1.4rem; text-align: center; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 2.9rem; padding: 0.55rem 1.2rem; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.button--primary { background: var(--primary); color: var(--primary-ink); }
.button--primary:hover { filter: brightness(1.08); }
.button--quiet { background: var(--primary-soft); color: var(--primary); }
.button--quiet:hover { border-color: var(--primary); }
.button--block { width: 100%; min-height: 3.4rem; font-size: 1.15rem; }
.switch { margin-top: 1.25rem; text-align: center; color: var(--ink-soft); }

/* Notices */
.notice { border-radius: var(--radius-sm); padding: 0.8rem 1rem; margin-bottom: 1rem; }
.notice p { margin: 0; }
.notice--success { background: var(--success-soft); color: var(--success); }
.notice--error { background: var(--error-soft); color: var(--error); font-weight: 600; }
.notice--warning { background: var(--warning-soft); color: var(--ink); }

/* Lists */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.85rem 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.row:first-child { border-top: 0; }
.row__title { font-weight: 700; margin: 0; }
.row__meta { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.row__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.row__actions form { margin: 0; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 0.2rem; padding: 1rem; border-radius: var(--radius-sm); background: var(--primary-soft); border-left: 5px solid var(--sky); color: var(--ink); text-decoration: none; min-height: 5.5rem; }
.tile:hover { outline: 2px solid var(--primary); }
.tile__grade { font-size: 0.9rem; color: var(--ink-soft); }
.tile__name { font-size: 1.3rem; font-weight: 800; }
.tag { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 0.85rem; font-weight: 700; }
.tag--who { font-size: 0.95rem; padding: 0.35rem 0.9rem; }
.tag--off { background: var(--error-soft); color: var(--error); }
.tag--draft { background: var(--warning-soft); color: var(--ink); }
.empty { color: var(--ink-soft); }

.empty-state { text-align: center; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2.5rem 1.5rem; max-width: 560px; margin: 1rem auto; }
.empty-state__art { font-size: 3rem; }

/* One-time sign-in card */
.card { max-width: 420px; background: var(--surface); border: 3px dashed var(--accent); border-radius: var(--radius); padding: 1.5rem; margin: 1rem 0; }
.card__site { margin: 0; }
.card__site img { height: 36px; width: auto; }
.card__name { margin: 0.25rem 0 0; }
.card__class { color: var(--ink-soft); }
.card__creds { display: grid; gap: 0.75rem; margin: 1rem 0; }
.card__creds div { display: flex; justify-content: space-between; align-items: baseline; background: var(--bg); border-radius: var(--radius-sm); padding: 0.6rem 0.9rem; }
.card__creds dt { color: var(--ink-soft); }
.card__creds dd { margin: 0; font-size: 1.6rem; font-weight: 800; letter-spacing: 0.08em; }
.card__tip { font-size: 0.95rem; color: var(--ink-soft); margin: 0; }
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.prose { max-width: 720px; }
.prose ul { padding-left: 1.2rem; }

/* Main navigation (per role) */
.nav { width: 100%; max-width: 1040px; margin: 0 auto; padding: 1rem 1rem 0; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.nav a { padding: 0.45rem 0.9rem; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); color: var(--primary); font-weight: 700; text-decoration: none; }
.nav a:hover { outline: 2px solid var(--primary); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.h1-sub { display: block; font-size: 1rem; font-weight: 600; color: var(--ink-soft); margin-top: 0.3rem; }
.page-actions { margin: -0.2rem 0 1rem; }
.hint { color: var(--ink-soft); font-size: 1.05rem; }
/* Day / month / year lists side by side (English, unlike the browser's date box). */
.field select[name$="_month"], .field select[name$="_day"], .field select[name$="_year"] { width: auto; min-width: 5.5rem; display: inline-block; margin: 0 0.4rem 0.4rem 0; }
.field input[type="file"] { min-height: auto; padding: 0.5rem; }
.field textarea { width: 100%; padding: 0.6rem 0.9rem; font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--field-border); border-radius: var(--radius-sm); }
.field textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.button--danger { background: var(--error-soft); color: var(--error); }
.button--danger:hover { border-color: var(--error); }
.inline-form { display: flex; gap: 0.6rem; align-items: flex-end; flex-wrap: wrap; margin: 1rem 0; }
.inline-form .field { margin: 0; flex: 1 1 220px; }
.danger-zone { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.check { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; }
.chips { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.example { background: var(--bg); border-radius: var(--radius-sm); padding: 0.75rem 1rem; white-space: pre-wrap; }
.card-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card-grid .card { margin: 0; break-inside: avoid; }

/* Landing */
.landing { width: min(100%, 640px); text-align: center; }
.landing__logo { height: 72px; width: auto; margin: 0 auto 0.5rem; display: block; }
.landing .logo--dark { margin: 0 auto 0.5rem; }
.choices { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 1.5rem; }
.choice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; min-height: 11rem; padding: 1.5rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; border: 3px solid transparent; }
.choice:hover { border-color: var(--accent); }
.choice--student { border-top: 8px solid var(--accent); }
.choice--staff { border-top: 8px solid var(--primary); }
.choice__icon { font-size: 3.2rem; line-height: 1; }
.choice__label { font-size: 1.5rem; font-weight: 800; }

/* Consent (first page) */
.consent { width: min(100%, 560px); text-align: center; }
.consent__logos { display: flex; flex-direction: column; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.consent__school { width: 140px; height: 140px; border-radius: 28px; background: #fff; object-fit: contain; box-shadow: var(--shadow); }
.consent__brand { height: 64px; width: auto; }
.consent .logo--dark.consent__brand { margin: 0 auto; }
.consent__form { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; text-align: left; }
.consent__check { display: flex; gap: 0.9rem; align-items: flex-start; cursor: pointer; padding: 0.9rem 1rem; margin-bottom: 1.25rem; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink); font-weight: 700; }
.consent__check input { flex: none; width: 1.6rem; height: 1.6rem; margin: 0.1rem 0 0; accent-color: var(--primary); cursor: pointer; }
.consent__ar { display: block; text-align: right; font-size: 1.1rem; margin-bottom: 0.35rem; }
.consent__en { display: block; font-weight: 600; font-size: 0.95rem; color: var(--ink-soft); }

/* Student board */
.story-board { margin-bottom: 2rem; }
.weeks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.weeks > li { display: flex; flex-direction: column; }
.week { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; min-height: 8.5rem; padding: 1.1rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; border-left: 6px solid var(--accent); }
a.week:hover { outline: 3px solid var(--accent); }
.week--done { border-left-color: var(--success); }
.week--locked { background: #e9ebf0; color: #6b7280; box-shadow: none; border: 2px dashed #b9bfca; filter: grayscale(1); }
:root[data-theme="dark"] .week--locked { background: #1e2535; color: #8b93a6; border-color: #3a4459; }
.week--closed { background: var(--bg); box-shadow: none; border: 2px solid var(--line); border-left: 6px solid var(--field-border); }
.week--closed .week__state { color: var(--ink-soft); }
.week--closed-done { border-left-color: var(--success); }
.week--closed-done .week__state { color: var(--success); }
.tag--off-grey { background: #e9ebf0; color: #6b7280; }
.week__icon { font-size: 2rem; line-height: 1; }
.week__name { font-size: 1.35rem; font-weight: 800; }
.week__title { color: var(--ink-soft); }
.week__state { margin-top: auto; font-weight: 700; color: var(--accent); }
.week--done .week__state { color: var(--success); }
.week--locked .week__state { color: var(--ink-soft); font-weight: 600; }

/* Reading + word tap */
.reading { margin-bottom: 1.25rem; }
.reading__text { font-size: clamp(1.25rem, 3.4vw, 1.5rem); line-height: 2; }
.reading__text p { margin-bottom: 1em; }
.w { font: inherit; color: inherit; background: none; border: 0; padding: 0 0.05em; margin: 0; border-radius: 6px; cursor: pointer; border-bottom: 2px dotted var(--lavender); line-height: inherit; }
.w:hover, .w--active { background: var(--accent-soft); color: var(--accent); }
.word-card { position: absolute; z-index: 20; width: min(320px, calc(100vw - 24px)); background: var(--surface); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(29, 37, 64, 0.25); border-top: 6px solid var(--accent); padding: 1rem 1.1rem 1.1rem; text-align: center; }
.word-card__close { position: absolute; top: 0.4rem; right: 0.5rem; background: none; border: 0; font-size: 1.2rem; color: var(--ink-soft); cursor: pointer; min-width: 2.4rem; min-height: 2.4rem; }
.word-card__picture { display: block; width: 100%; max-height: 180px; object-fit: contain; border-radius: var(--radius-sm); margin-bottom: 0.6rem; background: var(--bg); }
.word-card__word { font-size: 1.6rem; font-weight: 800; margin: 0; }
.word-card__meaning { font-size: 1.5rem; font-weight: 700; color: var(--accent); margin: 0.2rem 0 0.8rem; }
@media (max-width: 600px) {
  .word-card { position: fixed; left: 12px !important; right: 12px; bottom: 12px; top: auto !important; width: auto; }
}

/* Shadowing */
.speed { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.speed [aria-pressed="true"] { border-color: var(--primary); background: var(--primary); color: var(--primary-ink); }
.sentences { list-style: none; padding: 0; margin: 0; }
.sentence { padding: 1rem 0; border-top: 1px solid var(--line); }
.sentence:first-child { border-top: 0; }
.sentence__text { font-size: clamp(1.2rem, 3.2vw, 1.4rem); line-height: 1.7; margin-bottom: 0.6rem; }
.k { border-radius: 6px; padding: 0 0.05em; transition: background 0.1s; }
.k--on { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .k--on { color: #0f1626; }
.sentence__controls { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.tries { color: var(--ink-soft); font-weight: 600; }
.button.is-recording { background: var(--error); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px var(--error-soft); } }
.takes { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.4rem; }
.takes li { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.takes__label { font-weight: 700; min-width: 3.5rem; }
.takes audio, .row audio { max-width: 100%; height: 2.4rem; }
.score { margin-left: auto; min-width: 4.2rem; text-align: center; padding: 0.35rem 0.8rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 1.15rem; }
.score--none { background: var(--bg); color: var(--ink-soft); font-weight: 600; }
.takes__score { font-weight: 800; color: var(--accent); }
.takes__score--none { font-weight: 600; color: var(--ink-soft); }
.sentence__error { color: var(--error); font-weight: 600; margin: 0.5rem 0 0; }

/* Vocabulary review */
.vocab { list-style: none; padding: 0; margin: 1rem 0 0; }
.vocab__item { display: grid; grid-template-columns: 96px 1fr; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.vocab__picture { width: 96px; height: 96px; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--bg); overflow: hidden; color: var(--ink-soft); }
.vocab__picture img { width: 100%; height: 100%; object-fit: cover; }
.vocab__word { font-size: 1.25rem; font-weight: 800; margin: 0 0 0.4rem; }
.vocab__form .field { margin-bottom: 0.6rem; }
.vocab details { margin-bottom: 0.6rem; }
.vocab summary { cursor: pointer; color: var(--primary); font-weight: 600; }
@media (max-width: 420px) { .vocab__item { grid-template-columns: 64px 1fr; } .vocab__picture { width: 64px; height: 64px; } }

/* Progress table */
.table-wrap { overflow-x: auto; }
.progress { border-collapse: collapse; width: 100%; min-width: 420px; }
.progress th, .progress td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); text-align: center; }
.progress th[scope="row"] { text-align: left; white-space: nowrap; }
.progress td.is-done { background: var(--success-soft); }
.progress td.is-open { background: var(--primary-soft); }
.progress__mark { display: block; font-weight: 800; }
.progress__count { font-size: 0.85rem; color: var(--ink-soft); }

/* Enrichment certificate: on screen only (hidden in print below). Fixed brand colours so it
   looks the same in light and dark mode. */
.certificate { max-width: 720px; margin: 0 auto 1.5rem; padding: 0.6rem; border-radius: var(--radius); background: linear-gradient(135deg, #b9a3d0, #e05fa0); }
.certificate__frame { position: relative; background: #fffaf7; color: #2e2f6e; border-radius: calc(var(--radius) - 6px); padding: clamp(1.25rem, 5vw, 2.5rem); text-align: center; border: 2px solid #b9a3d0; }
.certificate__school { position: absolute; top: 0.9rem; left: 0.9rem; width: clamp(48px, 12vw, 72px); height: auto; border-radius: 12px; background: #fff; }
.certificate__logo { height: 48px; width: auto; margin: 0.6rem auto; display: block; }
.certificate__kicker { text-transform: uppercase; letter-spacing: 0.15em; font-weight: 700; color: #8e2c7e; margin: 0; font-size: 0.9rem; }
.certificate__title { font-size: clamp(1.5rem, 5vw, 2.2rem); margin: 0.3rem 0 1rem; color: #2e2f6e; }
.certificate__given { margin: 0; color: #4a4b80; }
.certificate__name { font-size: clamp(1.6rem, 6vw, 2.4rem); font-weight: 800; color: #8e2c7e; margin: 0.2rem 0 0.8rem; border-bottom: 2px solid #e05fa0; display: inline-block; padding: 0 1rem 0.2rem; }
.certificate__score { font-size: 1.3rem; font-weight: 800; margin: 0; }
.certificate__score span { font-weight: 600; color: #4a4b80; }
.certificate__date { color: #4a4b80; margin: 0.4rem 0 0; }
.certificate__flower { position: absolute; right: 1rem; bottom: 0.6rem; font-size: 2.2rem; color: #e05fa0; }

/* Growing plant + streak (student board) */
.growth { display: flex; align-items: center; gap: 1.25rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.25rem; margin-bottom: 1.75rem; }
.plant { width: 220px; height: 128px; flex: none; max-width: 48%; }
/* The lotus of the EngZone logo: magenta centre, lavender and light-blue petals, navy dots. */
.plant__ground { fill: var(--lavender); opacity: 0.35; }
.plant__seed, .plant__dot { fill: var(--primary); }
.plant__stem { fill: none; stroke: var(--primary); stroke-width: 3.5; stroke-linecap: round; }
.plant__leaf { fill: var(--sky); }
.plant__petal--center { fill: #9b2c6e; }
.plant__petal--side { fill: var(--lavender); }
.plant__petal--outer { fill: var(--sky); }
.plant__sparkle { fill: #e05fa0; opacity: 0.8; }
:root[data-theme="dark"] .plant__petal--center { fill: #e08bbd; }
.growth__title { font-size: 1.35rem; font-weight: 800; margin: 0; }
.growth__meta { color: var(--ink-soft); font-weight: 600; margin: 0.15rem 0 0.4rem; }
.streak { display: inline-block; margin: 0 0 0.4rem; padding: 0.3rem 0.85rem; border-radius: 999px; background: #fff1e0; color: #b04a00; font-weight: 800; font-size: 1.1rem; }
:root[data-theme="dark"] .streak { background: #3a2a1a; color: #ffb36b; }
@media (max-width: 520px) { .growth { flex-direction: column; text-align: center; } .plant { max-width: 100%; width: 260px; height: 152px; } }

/* Encouraging message for teachers (Classes page), in the place of the students' garden */
.cheer__flower { width: 96px; height: 96px; flex: none; }
.cheer__text { font-size: 1.2rem; font-weight: 600; line-height: 1.5; color: var(--accent); margin: 0.3rem 0 0; }
:root[data-theme="dark"] .cheer__text { color: #e08bbd; }

/* Student view (shared read-only account): class picker */
.preview-pick { margin-bottom: 1.5rem; }
.preview-pick__row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.preview-pick__row select { flex: 1 1 14rem; min-width: 0; }
.preview-title { margin: 0 0 1rem; }

/* Week score under each card */
.week__score { margin: 0.4rem 0 0; text-align: center; font-weight: 800; color: var(--accent); }
.week__score--none { color: var(--ink-soft); font-weight: 600; }

/* Shadowing: speak loudly notice */
.notice--info { background: var(--primary-soft); color: var(--ink); }
.loud { border-left: 5px solid var(--accent); }

/* Match */
.match { margin-top: 1.25rem; }
.questions { list-style: none; padding: 0; margin: 0; }
.question { padding: 1rem 0; border-top: 1px solid var(--line); }
.question:first-child { border-top: 0; }
.question__prompt { font-size: clamp(1.2rem, 3.2vw, 1.45rem); font-weight: 700; margin-bottom: 0.75rem; }
.question__picture { display: block; width: min(100%, 260px); aspect-ratio: 4 / 3; object-fit: contain; background: var(--bg); border-radius: var(--radius-sm); margin-bottom: 0.75rem; }
.options { display: grid; gap: 0.6rem; }
.options--pictures { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 520px; }
.options--sentences { grid-template-columns: 1fr; max-width: 640px; }
.option { font: inherit; color: var(--ink); background: var(--surface); border: 3px solid var(--line); border-radius: var(--radius-sm); padding: 0.4rem; cursor: pointer; text-align: left; }
.options--sentences .option { padding: 0.75rem 1rem; font-size: 1.1rem; }
.option img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; background: var(--bg); }
.option:hover:not(:disabled) { border-color: var(--primary); }
.option:disabled { cursor: default; }
.option--chosen { border-color: var(--primary); }
.option--right { border-color: var(--success); background: var(--success-soft); }
.option--wrong { border-color: var(--error); background: var(--error-soft); }
.question__result { margin: 0.6rem 0 0; font-weight: 700; min-height: 1.4em; }

/* Leaderboards: everyone grey, the top ones in colour */
.leaderboard { margin-top: 2rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.ranks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.rank { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.9rem; border-radius: var(--radius-sm); background: #eceef2; color: #5f6675; text-decoration: none; font-weight: 700; border: 2px solid transparent; }
:root[data-theme="dark"] .rank { background: #232c40; color: #9aa4ba; }
a.rank:hover { border-color: var(--primary); }
.rank__place { min-width: 2rem; text-align: center; font-size: 1.1rem; }
.rank__name { flex: 1; }
.rank__points { font-variant-numeric: tabular-nums; }
.rank--top { color: #2e2f6e; }
.rank--1 { background: linear-gradient(90deg, #ffe08a, #fff4cc); }
.rank--2 { background: linear-gradient(90deg, #dfe4ee, #f3f5fa); }
.rank--3 { background: linear-gradient(90deg, #f3c7a0, #fbe7d6); }
.rank--4, .rank--5 { background: linear-gradient(90deg, #d9cdf0, #f1ecfa); }
.rank--me { outline: 3px solid var(--accent); }

/* Publish bar on the week editor */
.publish { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 0.75rem 1rem; margin-bottom: 1.25rem; }
.publish p { margin: 0; }
.publish form { margin: 0; }
.publish--draft { border-left: 6px solid #e0a800; }

.progress__score { display: block; font-weight: 800; color: var(--accent); }

/* Match questions editor (teacher) */
.match-editor { margin-top: 1.25rem; }
.mq-list { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: 1rem; }
.mq { border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; display: grid; gap: 0.75rem; }
.mq form { margin: 0; }
.mq__sentence { font-size: 1.2rem; font-weight: 700; margin: 0; }
.mq__pictures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; max-width: 520px; }
.mq__pic { margin: 0; text-align: center; border: 3px solid var(--line); border-radius: var(--radius-sm); padding: 0.35rem; }
.mq__pic img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--bg); border-radius: 8px; display: block; }
.mq__pic figcaption { font-size: 0.9rem; font-weight: 700; color: var(--ink-soft); margin-top: 0.25rem; }
.mq__pic--right { border-color: var(--success); }
.mq__pic--right figcaption { color: var(--success); }
.mq__prompt { width: min(100%, 260px); aspect-ratio: 4 / 3; object-fit: contain; background: var(--bg); border-radius: var(--radius-sm); }
.mq__sentences { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.3rem; }
.mq__right { color: var(--success); font-weight: 800; }
.mq-form { border-top: 1px solid var(--line); padding-top: 1rem; }
.mq-form h3 { margin: 0 0 0.75rem; }
.mq-form__pictures { display: grid; gap: 0 0.75rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.mq-form__right { border: 0; padding: 0; margin: 0 0 1rem; display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.mq-form__right legend { font-weight: 600; margin-bottom: 0.35rem; padding: 0; width: 100%; }
.mq-form__right .check { margin: 0; font-weight: 700; }
.mq-form__right input { width: 1.3rem; height: 1.3rem; accent-color: var(--primary); }

@media print {
  :root { color-scheme: light; }
  .card .logo--light { display: block !important; }
  .card .logo--dark { display: none !important; }
  .topbar, .nav, .footer, .no-print, .notice, .skip-link, .certificate, .leaderboard { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
