/* Design tokens: see docs/style-guide.md. Change values here, not in the rules below.
   Calm, warm, trustworthy: cream and sand surfaces, a deep sage accent, soft shadows. */
:root {
  --font-body: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --text-sm: 13px; --text-md: 16px; --text-lg: 18px; --text-xl: 22px; --text-display: 30px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px;
  --radius-1: 8px; --radius-2: 14px; --radius-3: 20px; --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(74, 56, 30, .05), 0 6px 20px rgba(74, 56, 30, .06);
  --shadow-2: 0 2px 4px rgba(74, 56, 30, .06), 0 14px 34px rgba(74, 56, 30, .10);
  --color-bg: #faf6f0; --color-surface: #fffdf9; --color-surface-2: #f3ece2; --color-text: #2b2a27;
  --color-muted: #5f5b54; --color-line: #e8dfd2; --color-accent: #2f6e62; --color-accent-text: #ffffff;
  --color-accent-soft: #e3efea; --color-focus: #2f6e62;
  --color-student: #e3efea; --color-student-text: #1f3d36; --color-assistant: #fffdf9;
  --color-success: #2f7a52; --color-warning: #9a5b12; --color-danger: #b0402f;
  --color-success-soft: #eef6f1; --color-warning-soft: #fbf1d6; --color-highlight: #e9b949; --color-on-highlight: #2b2a27;
  --color-panel: #f3ece2; --color-panel-text: #2b2a27; --color-panel-muted: #5f5b54;
  --color-panel-soft: #fffdf9; --color-panel-hover: #e3efea;
  --color-banner: transparent; --color-banner-line: transparent;
  --mode-assignment: #e3efea; --mode-remediation: #fbe9d3; --mode-deepening: #e5e9f6; --mode-broadening: #f1e4f0;
  --mode-exam_preparation: #f8e2da; --mode-discovery: #eef0dc;
  --force-1: #2f6e62; --force-2: #8a4fb0; --force-3: #b5651d; --force-4: #2e64a8; --force-5: #a8324a;
  --badge-template: #7a7468; --badge-model: #2f6e62; --badge-fallback: #9a5b12; --badge-safety: #b0402f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1b1916; --color-surface: #23201c; --color-surface-2: #2d2924; --color-text: #eee8de;
    --color-muted: #a8a094; --color-line: #3a352e; --color-accent: #7fbfae; --color-accent-text: #14211d;
    --color-accent-soft: #24332f; --color-focus: #9fd3c4;
    --color-student: #2a3b36; --color-student-text: #e6f2ee; --color-assistant: #23201c;
    --mode-assignment: #24332f; --mode-remediation: #3a2d1d; --mode-deepening: #262b3a; --mode-broadening: #352734;
    --mode-exam_preparation: #3a2520; --mode-discovery: #2f3122;
    --shadow-1: none; --shadow-2: 0 10px 30px rgba(0, 0, 0, .35);
    --color-success: #7cc79a; --color-warning: #e0a85a; --color-danger: #e08a7a;
    --color-success-soft: #1f3328; --color-warning-soft: #3a2d1d; --color-highlight: #e0b44a;
    --color-panel: #23201c; --color-panel-text: #eee8de; --color-panel-muted: #a8a094;
    --color-panel-soft: #2d2924; --color-panel-hover: #24332f;
    --force-1: #7fbfae; --force-2: #c39be0; --force-3: #e6a46a; --force-4: #8ab4ec; --force-5: #e98a9c;
  }
}

* { box-sizing: border-box; }
/* soft, thin scrollbars in the line colour, in every scrolling area (conversation, cockpit, panels), light and dark */
* { scrollbar-width: thin; scrollbar-color: var(--color-line) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-line); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--color-muted); }
html { background: var(--color-bg); }
body { margin: 0; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; font: var(--text-md)/1.55 var(--font-body);
       background: var(--color-bg); color: var(--color-text); -webkit-font-smoothing: antialiased; }
select, input, button, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--color-muted); }
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: -.005em; }
code { font: 12px/1.4 var(--font-mono); background: var(--color-surface-2); padding: 0 3px; border-radius: 3px; }
[hidden] { display: none !important; }

/* Views: student (calm), teacher and school (test and adjust), reviewer (traces). */
body[data-view="student"] .only-staff, body[data-view="student"] .only-reviewer, body[data-view="student"] .only-teacher,
body[data-view="teacher"] .only-reviewer, body[data-view="reviewer"] .only-teacher,
body:not([data-view="school"]) .only-school, body[data-view="school"] .only-teacher,
body[data-view="school"] .only-reviewer { display: none !important; }
body:not([data-view="student"]) .only-student { display: none !important; }

/* Top bar */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3);
          padding: var(--space-4) var(--space-6); }
.brand { display: flex; align-items: center; gap: var(--space-2); }
.logo { width: 30px; height: 30px; border-radius: 10px; background: var(--color-accent);
        box-shadow: inset -6px -6px 0 rgba(255, 255, 255, .18); }
h1 { font: 600 var(--text-xl)/1.2 var(--font-display); margin: 0; }
.tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--color-muted);
       background: var(--color-surface-2); border-radius: var(--radius-pill); padding: 2px 9px; }
.topbar-right { display: flex; align-items: center; gap: var(--space-4); }
.identity { font-size: var(--text-sm); color: var(--color-muted); }
.online-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; font-size: var(--text-sm);
                 background: var(--color-surface-2); border-color: transparent; color: var(--color-muted); }
.online-toggle .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-muted); }
.online-toggle.on { color: var(--color-accent); background: var(--color-accent-soft); font-weight: 600; }
.online-toggle.on .dot { background: var(--color-success); box-shadow: 0 0 0 3px rgba(47, 122, 82, .18); }
.view-switch { display: inline-flex; border: 0; border-radius: var(--radius-pill); padding: 3px; margin: 0; background: var(--color-surface-2); }
.view-switch label { cursor: pointer; }
.view-switch input { position: absolute; opacity: 0; pointer-events: none; }
.view-switch span { display: inline-block; padding: 5px 14px; border-radius: var(--radius-pill); font-size: var(--text-sm); color: var(--color-muted); }
.view-switch input:checked + span { background: var(--color-surface); color: var(--color-text); font-weight: 600; box-shadow: var(--shadow-1); }
.view-switch input:focus-visible + span { outline: 2px solid var(--color-focus); }

/* Demo bar (teacher and reviewer only) */
.demo-bar { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-3) var(--space-4); margin: 0 var(--space-6);
            padding: var(--space-3) var(--space-4); background: var(--color-surface-2); border-radius: var(--radius-2); }
.demo-bar-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--color-muted); align-self: center; }
.demo-bar label, .subject-pick { display: flex; flex-direction: column; font-size: 12px; color: var(--color-muted); gap: 3px; }
.note { font-size: 12px; color: var(--color-muted); align-self: center; }

select { padding: 7px 34px 7px 12px; border: 1px solid var(--color-line); border-radius: var(--radius-1); background-color: var(--color-surface);
         appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
         background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
button { padding: 8px 16px; border: 1px solid var(--color-line); border-radius: var(--radius-pill); background: var(--color-surface); cursor: pointer;
         transition: background .15s ease, border-color .15s ease; }
button:hover { background: var(--color-surface-2); }
button.primary { background: var(--color-accent); color: var(--color-accent-text); border-color: var(--color-accent); font-weight: 600; }
/* a primary button keeps its own colours on hover, whatever other class it has (.action:hover would make it light) */
button.primary:hover:not(:disabled), button.primary:focus-visible { background: var(--color-accent);
  color: var(--color-accent-text); border-color: var(--color-accent); filter: brightness(1.06); }
button.ghost { border-color: transparent; background: transparent; color: var(--color-muted); padding: 4px 8px; font-size: 13px; }
button.ghost:hover, button.ghost:focus-visible { background: var(--color-surface-2); color: var(--color-text); }
button.secondary { border-color: var(--color-accent); color: var(--color-accent); font-weight: 600; }
button.secondary:hover { background: var(--color-accent-soft); }
button.small { padding: 4px 12px; font-size: 13px; }
button.icon-button { display: inline-flex; align-items: center; justify-content: center; padding: var(--space-2); }
button.icon-button:hover { color: var(--color-text); }
button.link { border: 0; background: none; padding: 0; color: var(--color-accent); font-weight: 600; }
button:disabled, input:disabled, select:disabled { opacity: .5; cursor: not-allowed; }
.error { color: var(--color-danger); margin: var(--space-3) var(--space-6) 0; }

/* Home: what do you want to work on today? */
.home { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-6) max(var(--space-5), calc((100% - 980px) / 2)) var(--space-7); }
.home-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); }
.home-head .display { font-size: var(--text-display); margin: 0; line-height: 1.15; }
.pick-label { font-size: 12px; color: var(--color-muted); }
.dropdown { position: relative; }
.dropdown-button { display: inline-flex; align-items: center; gap: var(--space-3); min-width: 240px; padding: 10px 16px;
                   border-radius: var(--radius-2); background: var(--color-surface); border: 1px solid var(--color-line);
                   box-shadow: var(--shadow-1); font-size: var(--text-md); text-align: left; }
.dropdown-button:hover { background: var(--color-surface); border-color: var(--color-accent); }
.dropdown-value { font-weight: 600; flex: 1; }
.dropdown-note { font-size: 12px; color: var(--color-muted); }
.chevron { width: 8px; height: 8px; border-right: 2px solid var(--color-muted); border-bottom: 2px solid var(--color-muted);
           transform: rotate(45deg) translateY(-2px); transition: transform .15s ease; }
.dropdown-button[aria-expanded="true"] .chevron { transform: rotate(-135deg) translateY(-2px); }
.dropdown-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 100%; margin: 0; padding: var(--space-1);
                 list-style: none; background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-2);
                 box-shadow: var(--shadow-2); max-height: 320px; overflow-y: auto; }
.dropdown-list:focus { outline: none; }
.dropdown.up .dropdown-list { top: auto; bottom: calc(100% + 6px); }
.dropdown-option { display: flex; justify-content: space-between; gap: var(--space-4); padding: 9px 12px; border-radius: var(--radius-1);
                   cursor: pointer; }
.dropdown-option.active { background: var(--color-surface-2); }
.dropdown-option[aria-selected="true"] { font-weight: 600; color: var(--color-accent); }
.env-group { margin-top: var(--space-5); }
.env-group h3 { font-size: var(--text-sm); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--color-muted);
                margin: 0 0 var(--space-3); display: flex; align-items: center; gap: var(--space-2); }
/* D106: line icons only for structure, always next to a label */
.group-icon { flex: none; color: var(--color-accent); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }
.card { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); text-align: left; padding: var(--space-5);
        border: 1px solid var(--color-line); border-radius: var(--radius-3); background: var(--color-surface); box-shadow: var(--shadow-1);
        transition: transform .15s ease, box-shadow .15s ease; min-height: 150px; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); background: var(--color-surface); }
.card-title { font: 600 var(--text-lg)/1.3 var(--font-display); }
.card-desc { font-size: var(--text-sm); color: var(--color-muted); }
.card-foot { margin-top: auto; font-size: 12px; color: var(--color-muted); }
.mode-pill::first-letter, .who::first-letter { text-transform: uppercase; }
.teacher-panel .hint { text-align: left; }
.mode-pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: var(--radius-pill); padding: 2px 10px; background: var(--mode-assignment); }
.mode-pill.remediation { background: var(--mode-remediation); } .mode-pill.deepening { background: var(--mode-deepening); }
.mode-pill.broadening { background: var(--mode-broadening); } .mode-pill.exam_preparation { background: var(--mode-exam_preparation); }
.mode-pill.discovery { background: var(--mode-discovery); }
@media (prefers-reduced-motion: reduce) { .card, .card:hover { transition: none; transform: none; } }

/* Conversation */
.layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); grid-template-rows: minmax(0, 1fr);
          gap: var(--space-5); width: 100%; padding: var(--space-4) var(--space-6); flex: 1; min-height: 0; }
body[data-view="student"] .layout { grid-template-columns: minmax(0, 820px); justify-content: center; }
.chat, .why, .teacher-panel { background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-3);
                              padding: var(--space-5); box-shadow: var(--shadow-1); min-height: 0; min-width: 0; }
.chat { display: flex; flex-direction: column; }
.why, .teacher-panel { overflow-y: auto; }
.chat-head { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-2) var(--space-3); align-items: center;
             padding-bottom: var(--space-2); border-bottom: 1px solid var(--color-line); }
.chat-head #back { width: 40px; height: 40px; padding: 0; border-radius: 50%; color: var(--color-accent); }
.chat-head #back:hover { background: var(--color-accent-soft); color: var(--color-accent); }
.chat-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); min-width: 0; }
.chat-title .display { font-size: var(--text-xl); margin: 0; }
.title-toggle { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-2); border-radius: var(--radius-1); }
.title-toggle:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.title-toggle .chevron { width: 8px; height: 8px; border-right: 2px solid var(--color-muted); border-bottom: 2px solid var(--color-muted);
                         transform: translateY(-3px) rotate(45deg); transition: transform .15s; }
.title-toggle[aria-expanded="true"] .chevron { transform: translateY(1px) rotate(-135deg); }
.title-toggle:hover .chevron { border-color: var(--color-text); }
.chat-meta { flex-basis: 100%; }
.who { margin: 0; color: var(--color-muted); font-size: var(--text-sm); }
.model-chip { margin: var(--space-1) 0 0; color: var(--color-muted); font-size: var(--text-sm); }
.draft-pill { color: var(--color-warning); }
.summary { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: var(--space-2) 0 0; font-size: 12px; }
.summary div { display: flex; gap: var(--space-1); }
.summary dt { color: var(--color-muted); }
.summary dd { margin: 0; font-weight: 600; }

.messages { display: flex; flex-direction: column; gap: var(--space-4); flex: 1; min-height: 0; overflow-y: auto;
            padding: var(--space-5) var(--space-1); scrollbar-gutter: stable; }
.empty { margin: auto; text-align: center; max-width: 420px; color: var(--color-muted); }
.empty .display { color: var(--color-text); font-size: var(--text-xl); margin: 0 0 var(--space-2); }
.bubble { max-width: 82%; padding: var(--space-3) var(--space-4); border-radius: var(--radius-3); white-space: pre-wrap; }
.bubble.student { align-self: flex-end; background: var(--color-student); color: var(--color-student-text); border-bottom-right-radius: 6px; }
.bubble.assistant { align-self: flex-start; background: var(--color-assistant); border: 1px solid var(--color-line); border-bottom-left-radius: 6px; }
body[data-view="reviewer"] .bubble.assistant { cursor: pointer; }
.bubble.assistant.selected { outline: 2px solid var(--color-accent); }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 1px 7px;
         border-radius: 5px; color: #fff; margin-bottom: var(--space-1); white-space: normal; }
.badge.template { background: var(--badge-template); }
.badge.model { background: var(--badge-model); }
.badge.template_fallback { background: var(--badge-fallback); }
.badge.template_safety { background: var(--badge-safety); }
.badge.ai { background: transparent; color: var(--color-accent); padding: 0; }
.badge.knowledge { margin-left: var(--space-2); background: var(--color-accent-soft); color: var(--color-accent); }

.chat-head, .samples, .symbols, .composer, .hint { flex-shrink: 0; }
.samples { display: flex; flex-wrap: nowrap; gap: var(--space-2); justify-content: safe center; margin: var(--space-3) 0 0;
           overflow-x: auto; padding-bottom: var(--space-1); scrollbar-width: thin; }
.samples button { flex: 0 0 auto; font-size: var(--text-sm); padding: 6px 14px; background: var(--color-surface-2); border-color: transparent;
                  white-space: nowrap; }
.samples button:hover { background: var(--color-accent-soft); }
.samples .more-ideas { background: transparent; border: 1px dashed var(--color-line); color: var(--color-muted); }
body:not([data-view="student"]) .samples { justify-content: flex-start; }
.composer[hidden] { display: none; }
.composer { display: flex; gap: var(--space-2); align-items: flex-end; padding: var(--space-2); margin-top: var(--space-2);
            background: var(--color-surface-2); border-radius: var(--radius-3); }
.composer textarea { flex: 1; padding: var(--space-2) var(--space-3); border: 0; background: transparent; resize: none; overflow-y: auto;
                     line-height: 1.5; max-height: 180px; }
.composer textarea:focus-visible { outline: none; }
.composer:focus-within { box-shadow: 0 0 0 2px var(--color-focus); }
.symbols { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-2); }
.symbols button { min-width: 34px; padding: 4px 8px; font-size: var(--text-sm); background: var(--color-surface-2); border-color: transparent; }
.symbols button:hover { background: var(--color-accent-soft); }
.hint { margin: var(--space-2) 0 0; font-size: 13px; color: var(--color-muted); text-align: center; }

.student-turn { align-self: flex-end; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; max-width: 82%; }
.student-turn .bubble { max-width: 100%; }
.spelling { font-size: var(--text-sm); color: var(--color-muted); padding-right: var(--space-2); }
.spelling strong { color: var(--color-text); }
.spelling.fixed { color: var(--color-accent); }
.misspelt { text-decoration: underline wavy; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.reply { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.reply .bubble { max-width: 82%; }
.feedback { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); font-size: var(--text-sm); padding-left: var(--space-2); }
.thumb { padding: 0 6px; border-color: transparent; background: transparent; font-size: 14px; opacity: .5; filter: grayscale(1); }
.thumb:hover { opacity: .9; background: var(--color-surface-2); }
.thumb[aria-pressed="true"] { opacity: 1; filter: none; background: var(--color-accent-soft); }
.reasons { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); width: 100%; margin-top: 2px; }
.chip { font-size: 12px; padding: 2px 11px; }
.chip[aria-pressed="true"] { background: var(--color-accent-soft); border-color: var(--color-accent); }
.thanks { margin-left: var(--space-1); }
.bubble.thinking { display: flex; align-items: center; gap: var(--space-2); color: var(--color-muted); cursor: default; }
.dots { display: inline-flex; gap: 4px; }
.dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--color-accent); animation: pulse 1.3s infinite ease-in-out; }
.dots span:nth-child(2) { animation-delay: .2s; }
.notice.waiting { display: flex; align-items: center; gap: var(--space-2); }
button .dots { margin-left: var(--space-2); vertical-align: middle; }
button .dots span { width: 5px; height: 5px; }
.dots span:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .dots span { animation: none; opacity: .6; } }

/* Rich text: formatted in the browser (format.js), never by a model */
.rich p { margin: 0 0 var(--space-2); }
.rich p:last-child { margin-bottom: 0; }
.rich ul { margin: var(--space-1) 0 var(--space-2); padding-left: 20px; }
.rich li { margin: 2px 0; }
.rich a, .sources a { color: var(--color-accent); text-decoration-thickness: 1px; text-underline-offset: 2px; word-break: break-word; }
.formula { display: inline; padding: 1px .35em; margin: 0 .05em; box-decoration-break: clone; -webkit-box-decoration-break: clone;
           border-radius: 6px; background: var(--color-accent-soft); font-family: var(--font-display); font-size: 1.04em;
           white-space: nowrap; }
.bubble.student .formula { background: rgba(255, 255, 255, .45); }
.f-var { font-style: italic; }
.f-num { font-variant-numeric: tabular-nums; }
.f-unit { font-style: normal; }
.f-op { color: var(--color-muted); }
.cite { display: inline-block; font: 600 10px/1.6 var(--font-body); color: var(--color-accent); background: var(--color-accent-soft);
        border-radius: var(--radius-pill); padding: 0 6px; margin-left: 2px; vertical-align: super; }
.knowledge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--color-warning);
             background: var(--mode-remediation); border-radius: var(--radius-pill); padding: 0 8px; margin-right: 4px; }
.sources { margin-top: var(--space-3); padding-top: var(--space-2); border-top: 1px dashed var(--color-line); font-size: var(--text-sm); }
.sources-title { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
                 color: var(--color-muted); margin-bottom: 2px; }
.sources ul { list-style: none; margin: 0; padding: 0; }
.sources li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-2); padding: 2px 0; }
.sources .cite { vertical-align: baseline; margin: 0; }

.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0 var(--space-1); }
.action { font-size: var(--text-sm); padding: 6px 14px; background: var(--color-surface); border-color: var(--color-line); }
.action:hover { border-color: var(--color-accent); background: var(--color-accent-soft); }
.action.search-link { display: inline-block; text-decoration: none; color: var(--color-accent); border: 1px solid var(--color-line); border-radius: var(--radius-pill); }
.action.primary-soft { background: var(--color-accent-soft); border-color: transparent; color: var(--color-accent); font-weight: 600; }

/* Side panels */
.why h2, .teacher-panel h2 { font: 600 var(--text-lg)/1.3 var(--font-display); margin: 0 0 var(--space-2); }
.why h3, .teacher-panel h3 { font-size: 12px; margin: var(--space-4) 0 var(--space-1); color: var(--color-muted);
                             text-transform: uppercase; letter-spacing: .06em; }
.why ul { margin: 0; padding-left: 18px; }
.why li { margin: 2px 0; }

.field { padding: var(--space-3) 0; border-top: 1px solid var(--color-line); }
.field-head { display: flex; justify-content: space-between; gap: var(--space-2); align-items: baseline; }
.field-name { font-weight: 600; }
.field-path { font-size: 11px; color: var(--color-muted); }
.field-value { margin-top: 2px; }
.value-list { margin: 2px 0 0; padding-left: 18px; }
.value-list li + li { margin-top: 2px; }
.value-list .value-title { font-weight: 500; }
.value-list li::first-letter { text-transform: uppercase; }
.field-meta { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-1); }
.pill { font-size: 12px; border-radius: var(--radius-pill); padding: 1px 9px; background: var(--color-surface-2); color: var(--color-muted); }
.pill.lock { color: var(--color-warning); }
.pill.note { color: var(--color-danger); }
.draft-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0; }
.ask { margin: var(--space-3) 0; padding: var(--space-3); border: 1px solid var(--color-line); border-radius: var(--radius-2); }
.ask-input { width: 100%; box-sizing: border-box; margin-top: var(--space-1); resize: vertical; font: inherit; }
.ask-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.card-new { border-style: dashed; align-items: center; justify-content: center; text-align: center; }
.card-plus { font-size: 28px; line-height: 1; color: var(--color-accent); }
.card.custom { border-color: var(--color-accent); }
.form-card { padding: var(--space-4); border: 1px solid var(--color-line); border-radius: var(--radius-2); background: var(--color-surface); }
.form-card h3 { margin-top: 0; }
.form-row { display: flex; flex-direction: column; gap: 2px; margin-top: var(--space-2); }
.suggestion { padding: var(--space-2) 0; border-top: 1px solid var(--color-line); }
.suggestion p { margin: 0 0 var(--space-1); }
.ask-actions .hint { flex: 1 1 200px; min-width: 0; margin: 0; }
.proposal { margin-top: var(--space-2); }
.proposal-list { margin: var(--space-1) 0 0; padding-left: 18px; font-size: var(--text-sm); }
.proposal-list li { margin-bottom: var(--space-1); }
.draft-results { margin: 0 0 var(--space-2); padding-left: 18px; font-size: var(--text-sm); }
.outcome-applied, .outcome-removed { color: var(--color-success); }
.outcome-capped, .outcome-locked { color: var(--color-warning); }
.outcome-refused { color: var(--color-danger); }
.field-input { margin-top: var(--space-1); max-width: 100%; }
.help-toggle { width: 18px; height: 18px; padding: 0; border-radius: 50%; font-size: 11px; line-height: 16px; vertical-align: 1px;
               color: var(--color-muted); background: transparent; border: 1px solid var(--color-line); }
.lock-toggle { padding: 0 2px; border: 0; background: none; font-size: 12px; line-height: 16px; cursor: pointer; opacity: .45; }
.lock-toggle[aria-pressed="true"], .lock-toggle:hover { opacity: 1; }
.help-toggle[aria-expanded="true"] { color: var(--color-accent); border-color: var(--color-accent); background: var(--color-accent-soft); }
.field-help { margin: var(--space-1) 0 var(--space-2); padding: var(--space-2) var(--space-3); font-size: var(--text-sm);
              background: var(--color-surface-2); border-radius: var(--radius-1); }
.slider { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-1); flex-wrap: wrap; }
.slider input[type="range"] { flex: 1 1 140px; margin: 0; accent-color: var(--color-accent); }
.slider-end { font-size: 11px; color: var(--color-muted); }
.slider-foot { flex-basis: 100%; display: flex; align-items: center; gap: var(--space-1); }
.slider-value { font-size: var(--text-sm); font-weight: 600; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; margin-top: var(--space-1); padding: 2px;
             background: var(--color-surface-2); border-radius: var(--radius-1); max-width: 100%; }
.segmented button { border: 0; background: transparent; padding: 4px 10px; font-size: var(--text-sm); border-radius: 6px; color: var(--color-muted); }
.inherit-reset { border: 0; background: transparent; color: var(--color-muted); padding: 2px 6px; font-size: var(--text-sm); }
.inherit-reset:hover { color: var(--color-text); }
.segmented button[aria-pressed="true"] { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-1); font-weight: 600; }
.multi { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin-top: var(--space-1); font-size: var(--text-sm); }
.teacher-panel input[type="text"], .teacher-panel input[type="number"] { padding: 6px 10px; border: 1px solid var(--color-line);
  border-radius: var(--radius-1); background: var(--color-surface); width: 100%; }
.teacher-panel .group { border: 1px solid var(--color-line); border-radius: var(--radius-2); padding: var(--space-2) var(--space-3);
                        margin-top: var(--space-3); background: var(--color-surface); }
.teacher-panel .group > summary { display: flex; flex-direction: column; gap: 2px; list-style: none; cursor: pointer; margin: 0; }
.teacher-panel .group > summary::-webkit-details-marker { display: none; }
.teacher-panel .group > summary .group-title { font-weight: 600; color: var(--color-text); }
.teacher-panel .group > summary .group-title::before { content: "▸ "; color: var(--color-muted); }
.teacher-panel .group[open] > summary .group-title::before { content: "▾ "; }
.teacher-panel .group > summary .group-summary { font-size: 12px; color: var(--color-muted); }
.teacher-panel .group-more { margin-top: var(--space-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 10px; border-radius: var(--radius-pill);
        background: var(--color-surface-2); border: 1px solid var(--color-line); font-size: 13px; }
.chip-x { border: 0; background: transparent; cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 6px;
          border-radius: var(--radius-pill); color: var(--color-muted); }
.chip-x:hover, .chip-x:focus-visible { background: var(--color-line); color: var(--color-text); }
.teacher-panel .chip-add { min-width: 12em; flex: 1 1 12em; padding: 4px 10px; border: 1px solid var(--color-line);
                           border-radius: var(--radius-pill); font: inherit; font-size: 13px; background: var(--color-surface); }
.chip-button { padding: 4px 12px; font-size: 13px; }
.chip-error { flex-basis: 100%; font-size: 12px; color: var(--color-danger); }
.chip-error:empty { display: none; }
.chip-hint { flex-basis: 100%; font-size: 12px; color: var(--color-muted); }
.teacher-panel .preset { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-2) 0; }
.teacher-panel .preset-label { font-weight: 600; font-size: 13px; }
.teacher-panel .preset-about { flex-basis: 100%; margin: 0; }
.teacher-panel .preset-about:empty { display: none; }
.pill.changed { border: 1px solid var(--color-warning); color: var(--color-warning); }
.teacher-panel .field-why { margin: var(--space-1) 0 0; font-size: 13px; color: var(--color-muted); }
.teacher-panel details summary { cursor: pointer; color: var(--color-muted); margin-top: var(--space-4); }

.footer { padding: var(--space-1) var(--space-6) var(--space-3); }
.banner { margin: 0 auto; max-width: 820px; text-align: center; font-size: 12px; color: var(--color-muted);
          background: var(--color-banner); border: 1px solid var(--color-banner-line); }

@media (max-width: 900px) {
  body { height: auto; min-height: 100dvh; overflow: auto; }
  .home { overflow: visible; }
  .layout { grid-template-columns: 1fr; grid-template-rows: none; padding: var(--space-4); }
  .messages { max-height: 55vh; }
  body[data-view="student"] .layout { grid-template-columns: minmax(0, 1fr); }
  .chat, .why, .teacher-panel { padding: var(--space-4); }
  .chat-title .display { font-size: var(--text-lg); }
  .topbar { gap: var(--space-2); }
  .topbar-right { width: 100%; justify-content: space-between; }
  .topbar, .footer { padding-left: var(--space-4); padding-right: var(--space-4); }
  .demo-bar { margin: 0 var(--space-4); }
  .home { padding: var(--space-5) var(--space-4); }
  .home-head .display { font-size: 24px; }
}

/* Phones: identity on its own line, then the online toggle, then the view switch at full width. */
@media (max-width: 560px) {
  .topbar-right { flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
  .identity { flex: 1 0 100%; }
  .view-switch { display: flex; flex: 1 0 100%; }
  .view-switch label { flex: 1; }
  .view-switch span { display: block; text-align: center; padding: 6px 8px; }
}

/* New learning environment in steps and the teacher's resources (D63-D66) */
.form-card .step { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--color-line); }
.form-card h4 { margin: 0 0 var(--space-2); font-size: 14px; }
.choice { display: flex; gap: var(--space-2); align-items: flex-start; padding: var(--space-1) 0; cursor: pointer; }
.choice input { margin-top: 3px; flex: none; }
.choice input:disabled + .choice-text { opacity: 0.6; }
.choice-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.choice-note { font-size: 12px; }
.notice { margin: var(--space-2) 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-1);
  background: var(--color-surface-2); font-size: 13px; }
.notice.warn { border-left: 3px solid var(--color-warning); }
.notice-title { margin: 0 0 var(--space-1); font-weight: 600; }
.concept-box { margin: var(--space-2) 0 var(--space-3) var(--space-5); }
.concepts { margin-top: var(--space-2); padding: var(--space-3); border: 1px solid var(--color-line);
  border-radius: var(--radius-1); background: var(--color-surface); display: flex; flex-direction: column; gap: var(--space-2); }
.concepts-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.concepts-goal { font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.concept-empty { margin: 0; font-size: 13px; }
/* one control: a field and its own button share a border, so they read as a pair */
.add-group { display: flex; max-width: 360px; border: 1px solid var(--color-line); border-radius: var(--radius-pill);
  background: var(--color-bg); overflow: hidden; }
.add-group:focus-within { border-color: var(--color-accent); box-shadow: 0 0 0 2px var(--color-accent-soft); }
.add-input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; padding: 6px 12px; font: inherit; font-size: 14px; color: var(--color-text); }
.add-input:focus { outline: none; }
.add-button { border: 0; border-left: 1px solid var(--color-line); border-radius: 0; padding: 6px 14px; font-size: 14px; font-weight: 600;
  color: var(--color-accent); background: var(--color-surface); }
.add-button:hover { background: var(--color-accent-soft); }
.resource-form { margin-top: var(--space-2); padding: var(--space-3); border: 1px dashed var(--color-line); border-radius: var(--radius-1); }
#resources h3 { margin: 0; }
#resources .hint { text-align: left; margin: var(--space-2) 0 0; }
.section-toggle { font-weight: 600; color: var(--color-accent); }
.resource-group-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  margin-top: var(--space-5); padding-bottom: var(--space-2); }
.resource-group-head h4 { margin: 0; font-size: var(--text-sm); color: var(--color-muted); text-transform: uppercase; letter-spacing: .04em; }
.resource-group-head button { padding: 4px 12px; font-size: var(--text-sm); }
.resource-empty { margin: 0; font-size: var(--text-sm); }
.resource-list { border-top: 1px solid var(--color-line); }
.resource-list:empty { border-top: 0; }
details.resource { border-bottom: 1px solid var(--color-line); font-size: var(--text-sm); }
details.resource summary { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-1);
  cursor: pointer; list-style: none; border-radius: var(--radius-1); }
details.resource summary::-webkit-details-marker { display: none; }
details.resource summary::before { content: ""; flex: none; width: 6px; height: 6px; border-right: 2px solid var(--color-muted);
  border-bottom: 2px solid var(--color-muted); transform: rotate(-45deg); transition: transform .15s; }
details.resource[open] summary::before { transform: rotate(45deg); }
details.resource summary:hover { background: var(--color-surface-2); }
details.resource summary:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.resource-title { flex: 1; min-width: 0; font-weight: 600; }
.resource-type { flex: none; font-size: 12px; color: var(--color-muted); }
.resource-body { padding: 0 var(--space-1) var(--space-3) calc(var(--space-1) + 6px + var(--space-2)); }
.resource-body p { margin: var(--space-1) 0; }
details.resource .preview { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 600px) { .concept-box { margin-left: 0; } }

.family-note { margin: 0 0 var(--space-3); }
.inline-search { font-weight: 600; color: var(--color-accent); text-decoration: underline; text-underline-offset: 2px; }
.class-programmes { display: flex; flex-direction: column; gap: var(--space-2); }
.class-row { display: grid; grid-template-columns: max-content 1fr; align-items: center; gap: var(--space-2); }
.profile-block { padding: var(--space-3); margin-bottom: var(--space-3); border: 1px solid var(--color-line); border-radius: var(--radius-md); }
.profile-block p { margin: var(--space-1) 0 0; }
.programme-add { display: grid; grid-template-columns: max-content 1fr max-content; gap: var(--space-2); }
.publish-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
/* D69: an environment this class does not have yet */
.card.unlinked { position: relative; background: var(--color-surface-2); cursor: default; }
.card.unlinked > :not(.card-add) { opacity: .55; }
.card.unlinked:hover > :not(.card-add) { opacity: .8; }
.card-add { position: absolute; top: var(--space-3); right: var(--space-3); min-width: 32px; height: 30px; border-radius: var(--radius-pill);
            font-size: var(--text-sm); font-weight: 600; line-height: 1; border: 1px solid var(--color-accent); color: var(--color-accent);
            background: var(--color-surface); display: flex; align-items: center; justify-content: center; padding: 0 12px; }
.card-wrap { position: relative; display: flex; }
.card-wrap > .card { flex: 1; }
.card-remove { border-color: var(--color-line); color: var(--color-muted); font-weight: 500; }
.card-remove:hover:not(:disabled) { border-color: var(--color-text); color: var(--color-text); }
.card-remove:disabled { opacity: .35; cursor: not-allowed; }
.card-trash { border-color: var(--color-line); color: var(--color-muted); }
.card-trash:hover { border-color: var(--color-danger); color: var(--color-danger); background: var(--color-surface); }
/* D97: the trial conversation of a new exercise */
.card-trial { position: absolute; bottom: var(--space-3); right: var(--space-3); font-size: 12px; padding: 2px 10px;
              border-radius: var(--radius-pill); border: 1px solid var(--color-line); background: var(--color-surface); color: var(--color-muted); }
.card-trial.open { border-color: var(--color-danger); color: var(--color-danger); }
.trial-exercise { background: var(--color-surface-2); border-radius: var(--radius-2); padding: var(--space-3); margin: var(--space-3) 0; }
.trial-exercise p { margin: 4px 0; }
.trial-row { border: 1px solid var(--color-line); border-radius: var(--radius-2); padding: var(--space-3); margin: var(--space-3) 0; }
.trial-row.flagged { border-color: var(--color-accent); }
.trial-row.open { border-color: var(--color-danger); }
.trial-row p { margin: 4px 0; }
.trial-reply { white-space: pre-wrap; padding-left: var(--space-3); border-left: 3px solid var(--color-line); }
/* a label, not a link: a small pill next to the outcome */
.trial-flag { display: inline-block; margin-left: var(--space-2); padding: 0 8px; border-radius: var(--radius-pill);
              font-size: 12px; background: var(--color-surface-2); color: var(--color-text); cursor: default; }
.trial-row.open .trial-flag { color: var(--color-danger); }
.trial-edit { border: 0; padding: 0; margin: var(--space-2) 0 0; }
.card-confirm { cursor: default; border-color: var(--color-danger); }
.card-confirm:hover { background: var(--color-surface); }
button.danger { background: var(--color-danger); border-color: var(--color-danger); color: var(--color-accent-text); font-weight: 600; }
button.danger:hover { filter: brightness(1.06); background: var(--color-danger); }

/* Until the script has chosen the first screen (sign-in, home, ...), only the brand shows: no empty home flashes */
body.booting > :not(.topbar), body.booting .topbar-right, body.booting #demo-tag { visibility: hidden; }

/* School deployment (D83, D85): signing in, choosing a password, and the school roster */
body[data-view="roster"] .demo-bar { display: none !important; }
.login { flex: 1; display: grid; place-items: center; padding: var(--space-6) var(--space-4); }
.login-card { display: flex; flex-direction: column; gap: var(--space-3); width: min(420px, 100%); padding: var(--space-6);
              background: var(--color-surface); border-radius: var(--radius-3); box-shadow: var(--shadow-2); }
.login-card .display { margin: 0; font-size: var(--text-xl); }
.login-card .error { margin: 0; }
.login-input { padding: 11px 14px; border: 1px solid var(--color-line); border-radius: var(--radius-1); background: var(--color-bg); }
.roster-code .username { font: var(--text-md)/1.2 var(--font-mono); color: var(--color-muted); }
.roster { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-6) max(var(--space-4), calc((100% - 880px) / 2)) var(--space-7); }
.roster > .display { margin: 0 0 var(--space-2); font-size: var(--text-display); }
.roster .form-card { margin-top: var(--space-5); }
.roster h4 { margin: var(--space-4) 0 var(--space-2); font-size: var(--text-sm); color: var(--color-muted); }
.roster-list { list-style: none; margin: 0; padding: 0; }
.roster-person, .roster-code { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3);
                               padding: var(--space-2) 0; border-bottom: 1px solid var(--color-line); }
.roster-person > span:first-child, .roster-code > span { flex: 1; min-width: 140px; }
.roster-code code { font: var(--text-lg)/1.2 var(--font-mono); letter-spacing: .06em; }
.roster-add { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.roster-input { padding: 8px 10px; border: 1px solid var(--color-line); border-radius: var(--radius-1);
                background: var(--color-surface); max-width: 100%; }
.roster-input { flex: 1; min-width: 180px; }
.roster-class { margin-top: var(--space-3); }
.roster-count { flex: 0 0 5.5rem; min-width: 0; }
.roster-email { margin-top: 0; flex-basis: 100%; }
.roster-email .roster-input { min-width: 220px; }
.student-number { font: var(--text-sm)/1.2 var(--font-mono); letter-spacing: .04em; color: var(--color-muted); }
.student-seat { font-weight: 600; }
.roster-order-box { margin-top: var(--space-3); }
.roster-order-box summary { cursor: pointer; font-size: var(--text-sm); color: var(--color-muted); }
.roster-order { width: 100%; font: var(--text-sm)/1.4 var(--font-mono); }
.confirm-who { margin: 0; font: 700 var(--text-xl)/1.3 var(--font-display, inherit); }
.card-number { font-weight: 700; }
/* D131: login cards to print, two per row, cut along the dashes */
.login-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-3); }
.login-who { align-self: flex-start; }
.login-card-print { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
                    padding: var(--space-3) var(--space-4); border: 1px dashed var(--color-line); border-radius: var(--radius-1);
                    break-inside: avoid; }
.login-card-text { display: flex; flex-direction: column; gap: 2px; }
.login-card-text code { font: var(--text-xl)/1.3 var(--font-mono); letter-spacing: .08em; }
@media print {
  body { height: auto; overflow: visible; }
  body > :not(#roster), .roster > :not(.roster-codes), .roster-codes .ask-actions, .roster-codes .hint { display: none !important; }
  .roster-codes { box-shadow: none; }
  .roster-code { break-inside: avoid; padding: var(--space-4) 0; }
  .login-cards { grid-template-columns: 1fr 1fr 1fr; gap: 0; }
  .login-card-print { border-radius: 0; color: #000; }
}

/* D132: Studie, the live view of a studie and its overview */
.study .form-card { margin-top: var(--space-4); }
.study-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.study-head h3 { margin: 0; }
.study-head p { margin: var(--space-1) 0 0; }
.study-counts { margin: var(--space-3) 0; font-weight: 600; }
.study-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2);
               grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.study-tile { display: flex; flex-direction: column; gap: 4px; padding: var(--space-2) var(--space-3);
              border: 1px solid var(--color-line); border-left-width: 4px; border-radius: var(--radius-1); background: var(--color-surface); }
.study-who { font-weight: 600; overflow-wrap: anywhere; }
.study-status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--color-muted); }
.study-tile.idle { opacity: .7; }
.study-tile.busy { border-left-color: var(--color-accent); }
.study-tile.solved { border-left-color: var(--color-success); background: var(--color-success-soft); }
.study-tile.solved .study-status { color: var(--color-success); }
.study-tile.stuck { border-left-color: var(--color-warning); background: var(--color-warning-soft); }
.study-tile.stuck .study-status { color: var(--color-warning); font-weight: 600; }
.study-choices { border: 0; padding: 0; margin: var(--space-3) 0 0; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); }
.study-choices legend { padding: 0; margin-bottom: var(--space-1); font-size: var(--text-sm); color: var(--color-muted); }
.study-list { list-style: none; margin: 0; padding: 0; }
.study-list li { display: flex; align-items: center; gap: var(--space-3); padding: 6px 0; border-bottom: 1px solid var(--color-line); }
.study-list li > :first-child { flex: 1; }
.study-overview summary { cursor: pointer; }
.study-overview h4 { margin: var(--space-4) 0 var(--space-2); font-size: var(--text-sm); color: var(--color-muted); }

/* D104: the student's own goal, above the conversation; a short celebration when it is reached */
.goal { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3);
        margin: var(--space-3) 0; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-line);
        border-radius: var(--radius-2); background: var(--color-surface); }
.goal-icon { display: inline-flex; color: var(--color-accent); }
.goal-ask { font-weight: 600; }
.goal-count { width: auto; }
.goal-alone { display: inline-flex; align-items: center; gap: var(--space-1); }
.goal-text { display: flex; flex-direction: column; flex: 1 1 12rem; }
.goal-dots { display: inline-flex; gap: 4px; }
.goal-dots span { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--color-accent); }
.goal-dots span.done { background: var(--color-accent); }
.goal-count-done { font-variant-numeric: tabular-nums; color: var(--color-muted); }
.goal.reached { border-color: var(--color-success); background: var(--color-accent-soft); animation: goal-pop .5s ease-out; }
.goal.reached .goal-icon { color: var(--color-success); }
.goal-burst { position: absolute; left: calc(var(--space-4) + 9px); top: 50%; pointer-events: none; }
.goal-burst span { position: absolute; width: 8px; height: 8px; margin: -4px; border-radius: 50%; opacity: 0;
                   background: var(--color-accent); animation: goal-burst 1.2s ease-out forwards; }
.goal-burst span:nth-child(even) { background: var(--color-success); }
.goal-burst span:nth-child(1) { --a: 0deg; }
.goal-burst span:nth-child(2) { --a: 30deg; }
.goal-burst span:nth-child(3) { --a: 60deg; }
.goal-burst span:nth-child(4) { --a: 90deg; }
.goal-burst span:nth-child(5) { --a: 120deg; }
.goal-burst span:nth-child(6) { --a: 150deg; }
.goal-burst span:nth-child(7) { --a: 180deg; }
.goal-burst span:nth-child(8) { --a: 210deg; }
.goal-burst span:nth-child(9) { --a: 240deg; }
.goal-burst span:nth-child(10) { --a: 270deg; }
.goal-burst span:nth-child(11) { --a: 300deg; }
.goal-burst span:nth-child(12) { --a: 330deg; }
@keyframes goal-pop { 0% { transform: scale(.97); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes goal-burst { 0% { opacity: 1; transform: rotate(var(--a)) translateX(0); }
                        100% { opacity: 0; transform: rotate(var(--a)) translateX(72px); } }
@media (prefers-reduced-motion: reduce) { .goal.reached { animation: none; } .goal-burst { display: none; } }

/* class overview for remediation: per goal, how the class did; no red, nothing here is a mistake */
/* wider than the page column on large screens: two columns side by side need the room */
/* the class title like the other groups; each part its own card */
#overview { padding: 0; border: 0; background: transparent; box-shadow: none; }
.overview-goal { display: grid; gap: var(--space-2); margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-line); }
.overview-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); }
.overview-code { font: 12px/1.4 var(--font-mono); color: var(--color-muted); background: var(--color-surface-2);
                 padding: 1px 6px; border-radius: 4px; }
.overview-counts { font-size: var(--text-sm); }
.overview-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--color-line); }
.overview-bar .seg.independent { background: var(--color-accent); }
.overview-bar .seg.with_help { background: var(--color-warning); opacity: .75; }
.overview-bar .seg.stuck { background: var(--color-muted); }
.overview-bar .seg.not_started { background: var(--color-line); }
.overview-need { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); font-size: var(--text-sm); }
.chip.static { cursor: default; }
#overview .hint { text-align: left; margin: 0; }
#review .hint { text-align: left; margin: var(--space-2) 0 0; }
.review-head { display: flex; align-items: center; gap: var(--space-3); }
.review-head h3 { margin: 0; }
.review-head .muted { font-size: var(--text-sm); }
.review-head button { margin-left: auto; }
#review h4 { margin: var(--space-4) 0 0; }
#review .review-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-3); }
#review .review-text { flex: 1 1 320px; min-width: 0; }
#review .review-row .ask-actions { margin-top: 0; }
#review .review-row input { order: 3; flex: 1 1 100%; box-sizing: border-box; margin-top: var(--space-2); }
#review .review-row:has(input) .ask-actions { order: 4; margin-top: var(--space-2); }
.overview-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start;
                 margin-top: 0; }
.overview-col { min-width: 0; }
.overview-col h4 { margin: 0; font-size: var(--text-md); }
.overview-col > .hint { font-size: var(--text-sm); }
.overview-col > p.muted { font-size: var(--text-sm); margin: var(--space-3) 0 0; }
#overview .overview-empty { margin: 0; font-size: var(--text-sm); }
.own-goals-summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-4);
                     padding: var(--space-2) var(--space-3); border-radius: var(--radius-1); background: var(--color-accent-soft);
                     font-size: var(--text-sm); }
.own-goals-summary .goal-icon { color: var(--color-accent); display: inline-flex; }
.own-goals-summary strong { font-size: var(--text-lg); color: var(--color-accent); }
.own-goals { list-style: none; margin: var(--space-3) 0 0; padding: 0; font-size: var(--text-sm); }
.own-goals li { display: grid; grid-template-columns: minmax(5rem, 10rem) 12rem 1fr; align-items: center; gap: var(--space-3);
                padding: var(--space-2) 0; border-bottom: 1px solid var(--color-line); }
.own-goals li:last-child { border-bottom: 0; }
.own-goals-days { display: flex; align-items: center; gap: var(--space-2); }
.own-goals-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.own-goals-alone { justify-self: start; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--color-accent-soft);
                   color: var(--color-accent); font-size: 12px; white-space: nowrap; }
@media (max-width: 560px) { #overview { padding: var(--space-4); } }
@media (max-width: 520px) { .own-goals li { grid-template-columns: minmax(4rem, 1fr) auto; }
                            .own-goals-alone { grid-column: 1 / -1; } }
.goal-followed { font-size: var(--text-sm); }
.goal.folded { padding: 0; border: 0; background: none; margin: var(--space-2) 0; }
.goal-explain { font-size: var(--text-sm); color: var(--color-warning); }
#home-goal { margin-top: var(--space-4); }

/* The task in view once its reply scrolls away: one line, the whole task over the conversation on a tap. It takes no
   room (D181): it floats over the top of the conversation, which keeps its size and does not move */
.task-bar { position: relative; z-index: 6; flex-shrink: 0; height: 0; }
.task-float { position: absolute; top: var(--space-2); left: 0; right: 0;
              animation: task-in .15s ease-out; }
@keyframes task-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .task-float { animation: none; } }
/* With a drawing, photo or other input tool open the conversation is low or gone: the bar takes its row again, so it
   never covers the tool's toolbar */
.chat:has(#input-tool:not([hidden])) .task-bar { height: auto; margin-top: var(--space-2); }
.chat:has(#input-tool:not([hidden])) .task-float { position: relative; top: 0; }
.task-line { display: flex; align-items: center; gap: var(--space-2); width: 100%; min-width: 0; padding: var(--space-2) var(--space-3);
             text-align: left; font-size: var(--text-sm); background: var(--color-surface-2); border-color: transparent;
             box-shadow: var(--shadow-1); }
.sheet-folded { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-1); padding: var(--space-2) var(--space-3);
                text-align: left; font-size: var(--text-sm); background: var(--color-surface-2); border-color: transparent; }
.sheet-folded:hover { background: var(--color-accent-soft); }
.sheet-folded .sheet-open { margin-left: auto; color: var(--color-accent); }
.task-line:hover { background: var(--color-accent-soft); }
.task-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-line .chevron { flex: none; width: 7px; height: 7px; border-right: 2px solid var(--color-muted); border-bottom: 2px solid var(--color-muted);
                      transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.task-bar.open .chevron { transform: translateY(1px) rotate(-135deg); }
.task-full { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; right: 0; max-height: 50vh; overflow-y: auto;
             padding: var(--space-3) var(--space-4); background: var(--color-surface); border: 1px solid var(--color-line);
             border-radius: var(--radius-2); box-shadow: var(--shadow-1); white-space: pre-wrap; }

/* The goal: the challenge as a choice, and one compact row while it counts */
label.goal-alone { padding: 4px 12px 4px 8px; border: 1px solid var(--color-line); border-radius: var(--radius-1); cursor: pointer;
                   font-size: var(--text-sm); }
label.goal-alone input { margin: 0; accent-color: var(--color-accent); }
label.goal-alone:hover { border-color: var(--color-accent); }
label.goal-alone:has(input:checked) { border-color: var(--color-accent); background: var(--color-accent-soft); color: var(--color-accent);
                                      font-weight: 600; }
#goal.active { padding: var(--space-2) var(--space-3); margin: var(--space-2) 0; }
#goal.active .goal-text { flex-direction: row; flex-wrap: wrap; gap: 0 var(--space-2); align-items: baseline; font-size: var(--text-sm); }

/* Bottom of the chat: starters wrap, symbols open from the message box, thumbs readable */
.samples { flex-wrap: wrap; overflow-x: visible; }
.samples button { white-space: normal; text-align: left; }
.symbols-toggle { align-self: center; font-size: var(--text-md); padding: 4px 10px; color: var(--color-muted); }
.symbols-toggle[aria-expanded="true"] { background: var(--color-accent-soft); color: var(--color-accent); }
.symbols button { min-width: 40px; font-size: var(--text-md); padding: 6px 10px; }
.thumb { opacity: .7; }

@media (max-width: 560px) {
  .samples button:nth-child(n+3):not(.more-ideas) { display: none; }  /* two starters on a phone */
  #goal.active .goal-text { display: none; }  /* a chip: target, dots, count */
  #goal.active { flex-wrap: nowrap; }
}
.symbols-toggle { font-size: 15px; font-weight: 600; color: var(--color-text); }
.samples button { flex: 0 1 auto; max-width: 100%; }
/* teachers and reviewers get every test message: one row that scrolls sideways, so the conversation keeps its room */
body:not([data-view="student"]) .samples { flex-wrap: nowrap; overflow-x: auto; }
body:not([data-view="student"]) .samples button { flex: 0 0 auto; white-space: nowrap; max-width: none; }
.symbols-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: var(--text-sm); font-weight: 600;
                  border: 1px solid var(--color-line); border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-text); }
.symbols-toggle:hover { border-color: var(--color-accent); }
.symbols-toggle .symbols-x { font-size: 15px; }
.symbols-toggle[aria-expanded="true"] { background: var(--color-accent-soft); border-color: var(--color-accent); color: var(--color-accent); }
@media (max-width: 560px) { .symbols-toggle .symbols-word { display: none; } }
.symbols-toggle[aria-expanded="false"] { border-color: var(--color-accent); color: var(--color-accent); }

/* D111: correcting a refused draft */
.correction-answer { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0; }
.correction-field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.correction-field .roster-input { min-width: 0; }

/* D112: the maintainers' page */
.maintainer-main { max-width: 900px; margin: 0 auto; padding: var(--space-4) 16px; }
.maintainer-login { max-width: 420px; margin: var(--space-3) 0; }

/* D113: required exercises in remediation */
.required-choice { margin-top: var(--space-2); }
.required-count { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-1) 0 0 var(--space-5); }

/* D114: the method around each exercise */
.method-choice { border: 0; margin: var(--space-2) 0 0; padding: 0; }
.method-choice legend { font-weight: 600; margin-bottom: var(--space-1); }
.way-summary { margin: var(--space-2) 0 0; }
.way { margin-top: var(--space-2); }

/* one short screen for a new opdracht: a line per part */
.sum-list { display: flex; flex-direction: column; border-top: 1px solid var(--color-line); margin: var(--space-2) 0 var(--space-3); }
.sum-row { border-bottom: 1px solid var(--color-line); padding: var(--space-2) 0; }
.sum-head { display: grid; grid-template-columns: 7.5rem 1fr auto; gap: var(--space-2); align-items: baseline; }
.sum-label { font-weight: 600; }
.sum-value { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; min-width: 0; }
.sum-editor { margin: var(--space-2) 0 0 7.5rem; }
.sum-note { font-size: 13px; }
.inline-choice { display: inline-flex; gap: 4px; align-items: baseline; }
.add-student { font-size: 14px; padding: 2px 6px; border: 1px solid var(--color-line); border-radius: var(--radius-pill); background: var(--color-bg); }
@media (max-width: 600px) {
  .sum-head { grid-template-columns: 1fr auto; }
  .sum-value { grid-column: 1 / -1; grid-row: 2; }
  .sum-editor { margin-left: 0; }
}
.about-input { resize: none; overflow: hidden; min-height: 0; }
.about-note { margin-top: 0; font-size: 13px; }

/* Home, per role: a title, a short intro for school and reviewer */
.home-intro { margin: var(--space-2) 0 0; max-width: 46rem; color: var(--color-muted); }

/* Cards: kind, a "start here" and the student's own progress on one line */
.card-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); padding-right: 0; }
.card-wrap .card-top { padding-right: 92px; }
.card-status { font-size: 12px; font-weight: 600; border-radius: var(--radius-pill); padding: 2px 10px; }
.card-status.done { color: var(--color-success); background: var(--color-accent-soft); }
.card-status.busy { color: var(--color-warning); background: var(--mode-remediation); }
.card-next { border-color: var(--color-accent); }
.card-next-pill { font-size: 12px; font-weight: 700; color: var(--color-accent-text); background: var(--color-accent);
  border-radius: var(--radius-pill); padding: 2px 10px; }

/* The teacher's home starts with what needs them */
.attention h3 { margin-bottom: var(--space-2); }
.attention-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.attention-item { display: inline-flex; align-items: center; gap: var(--space-2); padding: 10px 16px; font-weight: 600;
  background: var(--color-surface); border-color: var(--color-line); box-shadow: var(--shadow-1); }
.attention-item.stuck { border-left: 4px solid var(--color-warning); }
.attention-item.review, .attention-item.ideas { border-left: 4px solid var(--color-accent); }
.attention-item:hover { border-color: var(--color-accent); }
.attention-go { color: var(--color-accent); }
.attention-calm { margin: 0; font-size: var(--text-sm); color: var(--color-success); }

/* One student in the class overview */
.overview-need .chip { cursor: pointer; }
.overview-need .chip[aria-pressed="true"] { background: var(--color-accent); color: var(--color-accent-text); border-color: var(--color-accent); }
.overview-student { margin-top: var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--radius-2);
  background: var(--color-surface-2); }
.overview-student-head { display: flex; align-items: center; justify-content: space-between; }
.overview-student ul { list-style: none; margin: var(--space-2) 0; padding: 0; }
.overview-student li { display: flex; align-items: center; gap: var(--space-2); padding: 2px 0; font-size: var(--text-sm); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.status-dot.independent { background: var(--color-accent); }
.status-dot.with_help { background: var(--color-warning); }
.status-dot.stuck { background: var(--color-muted); }

/* Review one at a time */
.review-progress { height: 6px; border-radius: 3px; background: var(--color-line); overflow: hidden; margin-top: var(--space-3); }
.review-progress span { display: block; height: 100%; background: var(--color-accent); transition: width .3s ease; }
.review-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-2); }
.review-keys { font-size: 12px; margin-right: auto; }
.review-done { font-weight: 600; color: var(--color-success); }
#review h4 { font-size: var(--text-sm); color: var(--color-muted); }

/* A student's suggestion: a quiet line after the cards */
.suggest-line { margin: 0; color: var(--color-muted); font-size: var(--text-sm); }

/* The school's home: its settings at a glance */
.school-home-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.school-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-3); margin-top: var(--space-4); }
.school-tile { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); text-align: left; padding: var(--space-4);
  border-radius: var(--radius-2); background: var(--color-surface); box-shadow: var(--shadow-1); }
.school-tile:hover { border-color: var(--color-accent); background: var(--color-surface); }
.school-tile-title { font-weight: 700; }
.school-tile-summary { font-size: var(--text-sm); color: var(--color-muted); }
.school-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); width: 100%; margin-top: auto; padding-top: var(--space-2); }

/* The goal: tap a number; today's goal as a ring that fills */
.goal-counts { display: inline-flex; gap: 4px; }
.goal-chip { min-width: 38px; padding: 5px 12px; font-weight: 600; font-size: var(--text-sm); }
.goal-chip[aria-pressed="true"] { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-text); }
.goal-alone { display: inline-flex; align-items: center; gap: var(--space-2); padding: 4px 10px; font-size: var(--text-sm);
  border-color: transparent; background: transparent; }
.goal-check { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: none;
  border: 2px solid var(--color-accent); border-radius: 4px; font-size: 12px; font-weight: 700; line-height: 1;
  color: var(--color-accent-text); background: var(--color-surface); }
.goal-alone[aria-checked="true"] .goal-check { background: var(--color-accent); }
.goal-alone[aria-checked="true"] { color: var(--color-accent); font-weight: 600; }
.day-goal-line { margin-top: var(--space-1); font-size: var(--text-sm); color: var(--color-muted); }
.day-goal-line .link { font-size: var(--text-sm); }
.goal-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.goal-ring .ring-track { stroke: var(--color-line); }
.goal-ring .ring-fill { stroke: var(--color-accent); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.goal-ring-text { position: absolute; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* A solved exercise: a short celebration, once */
.bubble.assistant.solved { position: relative; border: 2px solid var(--color-success); background: var(--color-accent-soft); }
.solved-tag { display: block; font-weight: 700; color: var(--color-success); margin-bottom: var(--space-1); }
.solved-burst { left: 18px; top: 14px; }

/* Thumbs: on the latest reply and where one was given; on others when the reply is pointed at */
@media (hover: hover) {
  .feedback.quiet { opacity: 0; transition: opacity .15s; }
  .reply:hover .feedback.quiet, .feedback.quiet:focus-within { opacity: 1; }
}
@media (hover: none) { .feedback.quiet { display: none; } }

/* Reviewer: replies no model wrote */
.flagged-note { align-self: stretch; margin: 0 0 var(--space-2); }
.bubble.assistant.flagged { border-left: 4px solid var(--badge-fallback); }

/* Teacher panel: what this environment does, in three lines */
.panel-brief { list-style: none; margin: var(--space-2) 0 var(--space-3); padding: var(--space-3); border-radius: var(--radius-2);
  background: var(--color-accent-soft); font-size: var(--text-sm); }
.panel-brief li + li { margin-top: 2px; }
.teacher-panel details.panel-how summary { margin-top: 0; font-size: var(--text-sm); }

/* Demo bar: one line until opened */
.demo-bar { align-items: center; padding: var(--space-2) var(--space-4); }
.demo-toggle { display: inline-flex; align-items: center; gap: var(--space-2); border: 0; background: none; padding: 2px 4px;
  font-size: var(--text-sm); color: var(--color-text); }
.demo-toggle .chevron { transform: rotate(45deg) translateY(-2px); }
.demo-bar.open .demo-toggle .chevron { transform: rotate(-135deg) translateY(-2px); }
.demo-fields { display: none; flex-basis: 100%; flex-wrap: wrap; align-items: end; gap: var(--space-3) var(--space-4); }
.demo-bar.open .demo-fields { display: flex; }
.demo-fields label { display: flex; flex-direction: column; font-size: 12px; color: var(--color-muted); gap: 3px; }

/* Phones: brand and online on one line, the view switch below; the chat title gets the room */
@media (max-width: 560px) {
  .topbar { flex-wrap: nowrap; padding-top: var(--space-3); padding-bottom: var(--space-2); }
  .topbar { display: grid; grid-template-columns: 1fr auto; }
  .topbar-right { display: contents; }
  .identity { display: none; }
  .online-toggle { grid-column: 2; grid-row: 1; justify-self: end; }
  .view-switch { grid-column: 1 / -1; grid-row: 2; }
  #change-password, #logout { grid-row: 3; }
  .view-switch span { padding: 5px 4px; font-size: 12px; }
  h1 { font-size: var(--text-lg); }
  .goal-ask { flex-basis: 100%; }
}

/* class overview: three cards (stuck, own goals, required), students as buttons */
#overview h3 { margin-bottom: 0; }
#overview .overview-tip { margin: var(--space-1) 0 var(--space-3); }
.overview-col { padding: var(--space-4) var(--space-5); border: 1px solid var(--color-line); border-radius: var(--radius-2);
  background: var(--color-surface); box-shadow: var(--shadow-1); }
.overview-col > .hint { margin: var(--space-1) 0 0; }
.student-chip { display: inline-flex; align-items: center; gap: 2px; padding: 3px 8px 3px 12px; font-size: var(--text-sm);
  border: 1px solid var(--color-accent); color: var(--color-accent); background: var(--color-surface); cursor: pointer; font-weight: 600; }
.student-chip:hover { background: var(--color-accent-soft); }
.student-chip-go { font-size: 15px; line-height: 1; opacity: .7; }
.overview-student { margin: 0 0 var(--space-4); border: 1px solid var(--color-accent); background: var(--color-accent-soft); }
.overview-student li { gap: var(--space-2); }
.overview-student .goal-icon svg { width: 12px; height: 12px; }
.status-dot.req-done { background: var(--color-success); }
.status-dot.req-busy { background: var(--color-warning); }
.status-dot.req-not_started { background: var(--color-line); border: 1px solid var(--color-muted); }
.own-goals-name .student-chip { max-width: 100%; }
@media (max-width: 760px) { .overview-cols { grid-template-columns: minmax(0, 1fr); } }
.overview-col .own-goals li { grid-template-columns: auto 1fr auto; }

/* The school's settings page: groups as a menu, one group at full width */
.settings { padding-left: max(var(--space-5), calc((100% - 1100px) / 2)); padding-right: max(var(--space-5), calc((100% - 1100px) / 2)); }
.settings-back { font-size: var(--text-sm); margin-bottom: var(--space-4); }
.settings-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
.settings-nav-item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); text-align: left;
  border: 0; border-radius: var(--radius-1); background: transparent; padding: 10px 14px; color: var(--color-muted); font-weight: 600; }
.settings-nav-item:hover { background: var(--color-surface-2); color: var(--color-text); }
.settings-nav-item[aria-current="page"] { background: var(--color-surface); color: var(--color-accent); box-shadow: var(--shadow-1); }
.settings-body.teacher-panel { overflow: visible; padding: var(--space-5) var(--space-6); }
.settings-body h2.display { font-size: var(--text-xl); margin: 0; }
.settings-body > .group { border: 0; padding: 0; margin-top: var(--space-3); }
.settings-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3);
  margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-line); }
.settings-actions .draft-actions { margin: 0; }
@media (max-width: 760px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
  .settings-nav-item { white-space: nowrap; }
  .settings-body.teacher-panel { padding: var(--space-4); }
}
.overview-toc { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-4); }
.overview-toc-item { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 14px;
  border-radius: var(--radius-2); background: var(--color-surface); font-weight: 600; text-align: left; }
.overview-toc-item .muted { font-size: 12px; font-weight: 400; }
.overview-toc-item:hover { border-color: var(--color-accent); }
.overview-col { scroll-margin-top: var(--space-4); }
button.remediate { border-color: transparent; background: var(--color-accent-soft); color: var(--color-accent); font-weight: 600; margin-left: var(--space-2); }
button.remediate:hover { background: var(--color-accent); color: var(--color-accent-text); }
.overview-student button.remediate { margin: var(--space-1) 0 0; background: var(--color-accent); color: var(--color-accent-text); }
.settings-ask { margin-bottom: var(--space-5); }
.settings-ask .ask { margin: 0; padding: var(--space-4) var(--space-5); background: var(--color-surface); box-shadow: var(--shadow-1); }
.settings-ask .preset-label { display: block; font-weight: 600; }
.settings-ask .hint { text-align: left; }
.pending-box { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-1); margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4); border: 1px solid var(--color-warning); border-left-width: 4px; border-radius: var(--radius-2);
  background: var(--color-surface); font-size: var(--text-sm); }
.pending-box .muted { font-size: 12px; }
.pending-box button.primary { margin-top: var(--space-2); }
.pending-box button.ghost { align-self: center; }
@media (max-width: 760px) { .pending-box { display: none; } }  /* on a phone the bar under the fields says it */
.pending-box.done { border-color: var(--color-success); }
.pending-box.done strong { color: var(--color-success); }
.pending-box.done button { margin-top: var(--space-2); }
.card-due { font-size: 12px; font-weight: 600; border-radius: var(--radius-pill); padding: 2px 10px; color: var(--color-muted);
  background: var(--color-surface-2); }
.card-due.soon { color: var(--color-warning); background: var(--mode-remediation); }
.sum-editor .hint { text-align: left; }
.card-after-pill { font-size: 12px; font-weight: 700; color: var(--color-accent); border: 1px solid var(--color-accent);
  border-radius: var(--radius-pill); padding: 1px 9px; }
.card-prepares { font-size: var(--text-sm); color: var(--color-accent); font-weight: 600; }
.constants { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); }
.constant-row { display: flex; align-items: center; gap: var(--space-2); }
.teacher-panel .constant-row input[type="text"] { width: auto; }
.teacher-panel input[type="number"].field-input { max-width: 9em; }

/* grounding.show_cited_passages: a cited course passage under a reply; the full note in the teacher's Bronnen */
.sources .source-passage { width: 100%; }
.sources .source-passage summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-2); cursor: pointer; }
.sources .source-passage blockquote, .note-text { margin: var(--space-2) 0; padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--color-line); color: var(--color-text); font-size: var(--text-sm); }
.sources .source-passage blockquote p, .note-text p { margin: 0 0 var(--space-2); }
.sources .source-passage blockquote ul, .note-text ul { margin: 0 0 var(--space-2); padding-left: 1.2em; list-style: disc; }
.sources .source-passage blockquote li { display: list-item; padding: 0; }
.note-text h5 { margin: var(--space-3) 0 var(--space-1); font-size: var(--text-sm); }
.note-text h5:first-child { margin-top: 0; }

/* D129: dictation and read aloud */
.mic { align-self: center; display: inline-flex; align-items: center; padding: 6px 8px; color: var(--color-muted); }
.mic:hover { color: var(--color-accent); }
.mic.recording { color: #fff; background: var(--color-danger); border-color: var(--color-danger); animation: mic-pulse 1.2s ease-in-out infinite; }
.mic-time { align-self: center; font-size: var(--text-sm); color: var(--color-danger); font-variant-numeric: tabular-nums; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 4px rgba(176, 64, 47, .25); } }
@media (prefers-reduced-motion: reduce) { .mic.recording { animation: none; } }
.speak { display: inline-flex; align-items: center; padding: 2px 6px; border-color: transparent; background: transparent;
  color: var(--color-muted); }
.speak:hover { background: var(--color-surface-2); color: var(--color-text); }
.speak[aria-pressed="true"] { background: var(--color-accent-soft); color: var(--color-accent); }
.speak.loading svg { animation: speak-wait 1s ease-in-out infinite; }  /* D141: the server voice is on its way */
@keyframes speak-wait { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .speak.loading svg { animation: none; opacity: .6; } }

/* D135: the Bloom ladder above the conversation and the student's buttons under it */
/* D136: the ladder as dots in the chat head; the student's buttons behind Hulp, next to Symbolen */
.ladder:not([hidden]) { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--color-muted);
  white-space: nowrap; }
.ladder-dots { display: inline-flex; align-items: center; gap: 4px; }
.ladder-dots .dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--color-accent); }
.ladder-dots .dot.done { background: var(--color-accent); opacity: .45; }
.ladder-dots .dot.current { background: var(--color-accent); }
.ladder-dots .star { font-size: 14px; line-height: 1; color: var(--color-line); }
.ladder-dots .star.current, .ladder-dots .star.done { color: var(--color-accent); }
@media (max-width: 560px) { .ladder-text { display: none; } }

/* D138: the student's cockpit next to the conversation, and choices as cards. Tokens only; tiles behave like cards
   (lift and accent border on hover), buttons on the panel like ghost buttons on a dark surface. */
body[data-view="student"].has-cockpit .layout { grid-template-columns: minmax(0, 820px) 320px; }
/* D144: a calm panel beside the conversation: the sand of the task bar, no dark block that pulls the eye away */
.cockpit { background: var(--color-panel); color: var(--color-panel-text); border: 1px solid var(--color-line); border-radius: var(--radius-3);
  padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); min-height: 0; overflow-y: auto; }
.cockpit[hidden] { display: none; }
.cockpit-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.cockpit-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; }
.cockpit-you { font-size: 12px; font-weight: 600; color: var(--color-muted); }
.cockpit-collapse { display: inline-flex; align-items: center; justify-content: center; padding: 6px; border-color: transparent;
  background: transparent; color: var(--color-muted); }
.cockpit-collapse:hover { background: var(--color-panel-soft); color: var(--color-text); }
.cockpit-part { background: var(--color-panel-soft); border: 1px solid var(--color-line); border-radius: var(--radius-2); padding: var(--space-3);
  display: flex; flex-direction: column; gap: var(--space-2); }
.cockpit-part h3, .card-label { margin: 0; font-size: var(--text-sm); font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--color-muted); }
.route { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.route-node { display: flex; align-items: center; gap: var(--space-2); padding: 6px 8px; border-radius: var(--radius-1); color: var(--color-muted); }
.route-node.done { color: var(--color-text); }
.route-node.current { background: var(--color-accent-soft); color: var(--color-text); font-weight: 600; }
.route-dot { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  border: 1px dashed var(--color-muted); }
.route-node.done .route-dot { border: 0; background: var(--color-success-soft); color: var(--color-success); }
.route-node.current .route-dot { border: 0; background: var(--color-accent); color: var(--color-accent-text); }
.route-label { flex: 1; font-size: var(--text-sm); }
.route-goal { font-size: 11px; font-weight: 700; border: 1px solid currentColor; border-radius: var(--radius-pill); padding: 0 8px; }
.route-star { color: var(--color-highlight); display: inline-flex; }
.route-moves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.route-move, .panel-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600;
  font-size: var(--text-sm); background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-1);
  padding: 8px; color: var(--color-text); }
.route-move:hover:not(:disabled), .panel-button:hover:not(:disabled) { border-color: var(--color-accent); background: var(--color-accent-soft); }
.panel-button.outline { border-color: var(--color-accent); color: var(--color-accent); background: transparent; padding: var(--space-3); }
.cockpit-finish { margin-top: auto; }
.help-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.cockpit-note { margin: 0; font-size: 12px; color: var(--color-muted); }
.cockpit-today { display: flex; align-items: center; gap: var(--space-3); }
.cockpit-today > span { display: flex; flex-direction: column; font-size: var(--text-sm); }
.cockpit-today .panel-button { margin-left: auto; padding: 4px 10px; }
.cockpit .goal-ring .ring-track { stroke: var(--color-line); }
.cockpit .goal-ring .ring-fill { stroke: var(--color-accent); }

/* folded: a narrow strip of icons; the conversation gets the room (D144) */
body[data-view="student"].has-cockpit.cockpit-min .layout { grid-template-columns: minmax(0, 820px) 64px; }
.cockpit.min { padding: var(--space-2); align-items: center; gap: var(--space-2); }
.cockpit-rail-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  border-radius: var(--radius-1); border: 1px solid transparent; background: transparent; color: var(--color-text); }
.cockpit-rail-button:hover:not(:disabled) { background: var(--color-accent-soft); border-color: var(--color-accent); }
.cockpit-rail-dots { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--space-1) 0; }
.cockpit-rail-dots span { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--color-muted); }
.cockpit-rail-dots span.current { background: var(--color-accent); border-color: var(--color-accent); }
.cockpit-rail-dots span.done { background: var(--color-success); border-color: var(--color-success); }
.cockpit-rail-sep { width: 32px; border-top: 1px solid var(--color-line); }

/* tiles: a choice with an icon, a label and one line, like a small card */
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-line); border-radius: var(--radius-2);
  padding: var(--space-4) var(--space-3); transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.tile:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--color-accent); background: var(--color-surface); }
.tile-icon { color: var(--color-accent); display: inline-flex; }
.tile-label { font-weight: 600; font-size: var(--text-md); }
.tile-note { font-size: var(--text-sm); color: var(--color-muted); }
.tile.primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-text); }
.tile.primary:hover:not(:disabled) { background: var(--color-accent); filter: brightness(1.06); }
.tile.primary .tile-icon, .tile.primary .tile-note { color: var(--color-accent-text); }
.tile.primary .tile-note { opacity: .85; }
.cockpit .tile.panel-tile { background: var(--color-surface); color: var(--color-text); min-height: 60px; padding: var(--space-2); gap: 4px; }
.cockpit .tile.panel-tile:hover:not(:disabled) { background: var(--color-accent-soft); border-color: var(--color-accent); box-shadow: none; transform: none; }
.tile.panel-tile .tile-icon { color: var(--color-accent); }
.tile.panel-tile .tile-label { font-size: var(--text-sm); }
@media (prefers-reduced-motion: reduce) { .tile, .tile:hover:not(:disabled) { transition: none; transform: none; } }

/* cards: a choice or a result, one at a time */
.choice-card, .card-bubble { display: flex; flex-direction: column; gap: var(--space-4); }
.choice-card { align-self: center; width: min(640px, 100%); margin: var(--space-3) 0; padding: var(--space-6);
  background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-3); box-shadow: var(--shadow-2); }
.sheet { gap: var(--space-3); }
.sheet-off { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2);
  font-size: var(--text-sm); color: var(--color-muted); }
.sheet-part { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); column-gap: var(--space-3); row-gap: 2px; align-items: start; }
.sheet-label { font-weight: 600; padding-top: var(--space-2); }
.sheet-prompt { grid-column: 2; grid-row: 2; font-size: var(--text-sm); color: var(--color-muted); }
@media (max-width: 600px) { .sheet-part { grid-template-columns: minmax(0, 1fr); } .sheet-prompt { grid-column: 1; grid-row: auto; } }
.sheet-input { width: 100%; padding: var(--space-2) var(--space-3); border: 1px solid var(--color-line); border-radius: var(--radius-1);
  background: var(--color-surface-2); color: var(--color-text); font: inherit; resize: vertical; }
.sheet-input:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.sheet-example { padding: var(--space-3) var(--space-4); border-left: 3px solid var(--color-line); background: var(--color-surface-2); font-size: var(--text-sm); }
.sheet-example summary { cursor: pointer; font-weight: 600; }
.sheet-example dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px var(--space-3); margin: var(--space-2) 0 0; }
.sheet-example dt { font-weight: 600; }
.sheet-example dd { margin: 0; }
.choice-question { margin: 0; font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; }
.choice-tiles { display: grid; gap: var(--space-3); }
.choice-tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-tiles.two .tile { align-items: flex-start; text-align: left; }
.choice-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); font-size: var(--text-sm);
  color: var(--color-muted); }
.choice-task { display: flex; flex-direction: column; gap: 4px; background: var(--color-surface-2); border-radius: var(--radius-2);
  padding: var(--space-3) var(--space-4); }
.choice-task p { margin: 0; }
.card-bubble { max-width: min(640px, 100%); box-shadow: var(--shadow-2); }
.card-body { display: flex; flex-direction: column; gap: var(--space-3); }
.check-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.check-title { display: inline-flex; align-items: center; gap: 6px; color: var(--color-accent); font-weight: 600; font-size: var(--text-sm); }
.check-parts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.check-part { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--color-muted); }
.check-bar { height: 6px; border-radius: var(--radius-pill); background: var(--color-line); }
.check-part.ok { color: var(--color-success); }
.check-part.ok .check-bar { background: var(--color-success); }
.check-part.later .check-bar { background: var(--color-warning); }
.check-part.now { color: var(--color-accent); }
.check-part.now .check-bar { background: var(--color-accent-soft); box-shadow: inset 0 0 0 1px var(--color-accent); }
.check-lead { display: flex; align-items: center; gap: var(--space-2); border-radius: var(--radius-1); padding: var(--space-2) var(--space-3);
  background: var(--color-surface-2); }
.check-lead.ok { background: var(--color-success-soft); color: var(--color-success); font-weight: 600; }
.check-lead.intro { background: transparent; padding: 0; color: var(--color-muted); }
.result-head, .success-head { display: flex; align-items: center; gap: var(--space-4); }
.result-score { width: 68px; height: 68px; border-radius: 50%; background: var(--color-accent); color: var(--color-accent-text);
  display: inline-flex; align-items: center; justify-content: center; font-size: var(--text-xl); flex-shrink: 0; }
.result-text { display: flex; flex-direction: column; gap: 2px; }
.result-text strong { font-size: var(--text-xl); font-weight: 600; }
.result-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.result-list li { display: flex; align-items: center; gap: var(--space-2); }
.result-mark { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--color-success-soft); color: var(--color-success); }
.result-list li.later .result-mark { background: var(--color-warning-soft); color: var(--color-warning); }
.success-trophy { width: 60px; height: 60px; border-radius: var(--radius-2); background: var(--color-highlight); color: var(--color-on-highlight);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.success-badges { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.success-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--color-warning-soft); color: var(--color-warning);
  border-radius: var(--radius-pill); padding: 2px 12px; font-size: var(--text-sm); font-weight: 600; }
.next-step { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-3); max-width: 640px; }

@media (max-width: 900px) {
  body[data-view="student"].has-cockpit .layout { grid-template-columns: minmax(0, 1fr); padding-bottom: 80px; }
  .cockpit { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; border-radius: var(--radius-3) var(--radius-3) 0 0; max-height: 72vh;
    padding: var(--space-3) var(--space-4); box-shadow: 0 -10px 30px rgba(0, 0, 0, .12); }
  .cockpit-collapse { display: none; }
  body[data-view="student"].has-cockpit.cockpit-min .layout { grid-template-columns: minmax(0, 1fr); }
  .cockpit-title-button::after { content: "▴"; margin-left: var(--space-2); }
  .cockpit.open .cockpit-title-button::after { content: "▾"; }
  .cockpit:not(.open) > :not(.cockpit-head) { display: none; }
  .choice-tiles.three, .choice-tiles.two { grid-template-columns: minmax(0, 1fr); }
  .choice-tiles .tile { display: grid; grid-template-columns: auto 1fr; column-gap: var(--space-3); row-gap: 2px; align-items: center;
    text-align: left; padding: var(--space-3) var(--space-4); }
  .choice-tiles .tile .tile-icon { grid-row: span 2; }
  .choice-tiles.three .tile { text-align: left; }
  .choice-card { padding: var(--space-4); }
}
.choice-options { display: flex; flex-direction: column; gap: var(--space-2); }
.tile.option { align-items: flex-start; text-align: left; padding: var(--space-3) var(--space-4); font-weight: 600; }
.spot-text { margin: 0; padding: var(--space-3) var(--space-4); border-left: 3px solid var(--color-line); background: var(--color-surface-2);
  border-radius: var(--radius-1); font-style: italic; }
.cockpit-title-button { display: flex; align-items: baseline; gap: var(--space-2); background: none; border: 0; padding: 0; color: inherit;
  text-align: left; }
.cockpit-title-button:hover { background: none; }
.cockpit-rail-goal .goal-ring { transform: scale(.8); }
/* the cockpit's switch: all by yourself, no questions in between */
.cockpit-solo { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--space-3); }
.solo-text { display: flex; flex-direction: column; font-size: var(--text-sm); }
.solo-text span { color: var(--color-muted); }
.switch { position: relative; flex-shrink: 0; width: 46px; height: 26px; padding: 0; border-radius: var(--radius-pill);
  background: var(--color-surface-2); border: 2px solid var(--color-muted); cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--color-muted); box-shadow: var(--shadow-1); transition: transform .15s ease; }
.switch[aria-checked="true"] { background: var(--color-accent); border-color: var(--color-accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--color-surface); }
.switch:hover:not(:disabled) { border-color: var(--color-accent); }
.cockpit-rail-button[aria-pressed="true"] { background: var(--color-accent); color: var(--color-accent-text); }
@media (prefers-reduced-motion: reduce) { .switch::after { transition: none; } }

/* D148, D149: drawing the forces and a photo of work on paper, in a panel above the message box */
.input-tool[hidden] { display: none; }
.input-tool { flex-shrink: 0; scroll-margin-bottom: 80px; margin-top: var(--space-2); padding: var(--space-3); background: var(--color-surface); border: 1px solid var(--color-line);
  border-radius: var(--radius-2); }
.tool-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.tool-close { font-size: 20px; line-height: 1; }
.tool-hint, .tool-tip, .tool-status { margin: var(--space-1) 0 var(--space-2); font-size: var(--text-sm); }
.tool-tip { color: var(--color-muted); }
.tool-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; margin-top: var(--space-2); }
.tool-button[aria-expanded="true"] { background: var(--color-accent-soft); color: var(--color-accent); }
/* one way to answer at a time (D139): while a tool is open, its own send replaces the message box */
.tool-open .composer, .tool-open .symbols, .tool-open .samples { display: none; }
/* the arrows' rows stay next to the drawing (a row breaks within itself when narrow); below it only on a phone */
.force-editor { display: flex; gap: var(--space-3); align-items: flex-start; }
@media (max-width: 560px) {
  .force-editor { flex-wrap: wrap; justify-content: center; }
  .force-editor .force-rows { flex-basis: 100%; }
}
/* the drawing follows the screen's height, so the conversation above stays in view */
.force-editor .force-svg { flex: 0 0 auto; width: min(220px, 100%, 32dvh); height: auto; touch-action: none; cursor: crosshair;
  background: var(--color-surface-2); border-radius: var(--radius-1); }
.force-rows { flex: 1 1 0; display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.force-rows .tool-actions { margin-top: var(--space-1); }
.force-row { display: flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-1); border-radius: var(--radius-1); }
.force-row .force-name { flex: 1 1 auto; min-width: 0; }
.force-name .dropdown-button { min-width: 0; width: 100%; padding: 4px 10px; box-shadow: none; font-size: var(--text-sm);
  border-radius: var(--radius-1); }
.force-name .dropdown-value { font-weight: 400; }
.force-name .dropdown-list { left: 0; right: auto; min-width: 15em; max-height: 280px; }
.force-name .dropdown-option { padding: 6px 10px; }
.force-option { display: inline-flex; align-items: baseline; gap: var(--space-2); }
.force-desc { color: var(--color-muted); font-size: var(--text-sm); }
.dropdown-button .force-desc { display: none; }  /* the button shows the symbol; the list also says what it is */
/* a force is a vector: an arrow above its letter (F⃗ with its index), never the bare size F */
.vector { font-style: italic; white-space: nowrap; }
.vector sub { font-size: 75%; }
.vector-base { position: relative; display: inline-block; line-height: 1; padding-top: .22em; }
.vector-base::after { content: ""; position: absolute; left: 8%; right: 0; top: 0; border-top: 1.5px solid currentColor; }
.vector-base::before { content: ""; position: absolute; right: -1px; top: -2.5px; width: 4px; height: 4px;
  border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); }
.force-row.selected { background: var(--color-accent-soft); }
.force-mark { flex: 0 0 auto; min-width: 2.6em; padding: 2px 6px; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.force-own { flex: 1 1 5em; min-width: 0; padding: 5px 8px; border: 1px solid var(--color-line); border-radius: var(--radius-1);
  background: var(--color-surface); color: var(--color-text); }
.force-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: 2px var(--space-1); }
.force-dirs, .force-length { display: inline-flex; align-items: center; gap: 2px; }
.force-dir, .force-len, .force-remove { min-width: 28px; padding: 2px 6px; font-size: var(--text-md); }
.force-dir[aria-pressed="true"] { background: var(--color-accent); color: var(--color-accent-text); }
.force-length span { min-width: 1.4em; text-align: center; font-variant-numeric: tabular-nums; }
.force-svg .force-object { fill: var(--color-surface); stroke: var(--color-text); stroke-width: 2; }
.force-svg .force-arrow line { stroke: var(--color-accent); stroke-width: 3; }
.force-svg .force-arrow polygon { fill: var(--color-accent); }
.force-svg .force-arrow.selected line { stroke: var(--color-warning); }
.force-svg .force-arrow.selected polygon { fill: var(--color-warning); }
.force-svg text { fill: var(--color-text); font-size: 18px; font-style: italic; }
.force-svg .vector-arrow { fill: none; stroke: var(--color-text); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.force-message { display: flex; flex-direction: column; gap: var(--space-1); }
.force-message .force-svg { width: 170px; height: auto; }
.force-caption { font-size: var(--text-sm); }
.crop-view { margin-top: var(--space-2); }
/* the whole photo always fits, with its buttons below it: limited in height as well as width (aspect kept) */
.crop-canvas { display: block; max-width: 100%; max-height: max(140px, min(36dvh, calc(100dvh - 460px))); width: auto; height: auto; margin: 0 auto;
  touch-action: none; cursor: crosshair; border-radius: var(--radius-1); }
.phone-page .crop-canvas { max-height: 62dvh; }
.qr-box { display: flex; justify-content: center; margin: var(--space-2) 0; }
.qr { width: min(220px, 70vw); height: auto; }
/* the phone page (/foto/<token>): one task, large buttons */
body[data-page="phone"] { height: auto; min-height: 100dvh; overflow: auto; }
.phone-page { max-width: 560px; margin: 0 auto; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.phone-page h1 { font-size: 22px; margin: 0; }
.phone-page p { margin: 0; }
.phone-tip { color: var(--color-muted); font-size: var(--text-sm); }
.phone-take, .phone-actions button { width: 100%; padding: 14px; font-size: 17px; }
.phone-done { padding: var(--space-3); background: var(--color-success-soft); border-radius: var(--radius-2); }

/* D153: the drawing mode takes the conversation's place; the task stays on top */
.drawing-open .messages, .drawing-open .samples { display: none; }
.input-tool.draw-mode { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.draw-head { flex-wrap: wrap; justify-content: flex-start; gap: var(--space-2); }
.draw-head strong { margin-right: auto; }
.draw-grounds, .draw-tools { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border-radius: var(--radius-pill);
  background: var(--color-surface-2); }
.draw-ground, .draw-tool { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; font-size: var(--text-sm); }
.draw-tool svg { width: 16px; height: 16px; }
.draw-ground[aria-pressed="true"], .draw-tool[aria-pressed="true"] { background: var(--color-surface); color: var(--color-accent);
  box-shadow: var(--shadow-1); }
.draw-body { flex: 1 1 auto; min-height: 0; display: flex; gap: var(--space-3); }
.draw-stage { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center;
  background: var(--color-surface-2); border-radius: var(--radius-1); }
.draw-canvas { width: 100%; height: 100%; max-height: 100%; touch-action: none; cursor: crosshair; }
.draw-side { flex: 0 0 290px; display: flex; flex-direction: column; gap: var(--space-1); min-height: 0; overflow-y: auto; }
.draw-side .tool-actions { margin-top: auto; padding-top: var(--space-2); }
.draw-item { flex: 1 1 auto; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.force-name-wrap { flex: 1 1 auto; display: flex; gap: var(--space-1); min-width: 0; }
.axis-field { flex: 1 1 4.5em; }
@media (max-width: 700px) {
  .draw-body { flex-direction: column; }
  .draw-stage { flex: 0 0 auto; height: min(55dvh, 92vw); }
  .draw-side { flex: 0 0 auto; overflow: visible; }
}
.draw-svg .draw-grid line { stroke: var(--color-line); stroke-width: 1; }
.draw-svg .draw-grid line.axis { stroke: var(--color-muted); stroke-width: 1.5; }
.draw-svg .tick { fill: var(--color-muted); font-size: 12px; text-anchor: middle; }
.draw-svg .tick.end { text-anchor: end; }
.draw-svg .axis-name text { fill: var(--color-text); font-size: 14px; font-style: italic; }
.draw-svg .axis-name.end text { text-anchor: end; }
.draw-svg .axis-hit { fill: none; }
.draw-canvas .axis-name { cursor: pointer; outline: none; }
.draw-canvas .axis-hit { fill: var(--color-surface); stroke: var(--color-muted); stroke-width: 1; stroke-dasharray: 3 2; }
.draw-canvas .axis-name:hover .axis-hit, .draw-canvas .axis-name:focus-visible .axis-hit { stroke: var(--color-focus); stroke-width: 2; stroke-dasharray: none; }
.draw-stage { position: relative; overflow: hidden; }
.axis-editor { position: absolute; z-index: 2; display: flex; gap: 4px; padding: 6px; background: var(--color-surface);
  border: 1px solid var(--color-line); border-radius: var(--radius-1); box-shadow: var(--shadow-2); }
.axis-editor .axis-field { width: 5.5em; flex: 0 0 auto; }
.draw-canvas .axis-scale { outline: none; touch-action: none; }
.draw-canvas .axis-scale-x { cursor: ew-resize; }
.draw-canvas .axis-scale-y { cursor: ns-resize; }
.draw-canvas .axis-scale-hit { fill: var(--color-focus); fill-opacity: 0; }
.draw-canvas .axis-scale:hover .axis-scale-hit, .draw-canvas .axis-scale:focus-visible .axis-scale-hit { fill-opacity: 0.08; }
.draw-canvas .axis-scale-icon { opacity: 0; pointer-events: none; transition: opacity 0.12s; }
.draw-canvas .axis-scale-icon circle { fill: var(--color-focus); }
.draw-canvas .axis-scale-icon path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.draw-canvas .axis-scale:hover .axis-scale-icon, .draw-canvas .axis-scale:focus-visible .axis-scale-icon { opacity: 1; }
.axis-editor { flex-wrap: wrap; max-width: calc(100% - 8px); }
.axis-editor .axis-step { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.axis-editor .axis-step .axis-field { width: 4em; }
.draw-svg .draw-surface { stroke: var(--color-muted); stroke-width: 2; stroke-dasharray: 6 4; }
.draw-svg .draw-segment, .draw-svg .draw-line { stroke: var(--color-accent); stroke-width: 2.5; }
.draw-svg .draw-line { stroke-width: 2; }
.draw-svg .draw-circle { fill: none; stroke: var(--color-accent); stroke-width: 2.5; }
.draw-svg .draw-stroke { fill: none; stroke: var(--color-text); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.draw-svg .selected.draw-segment, .draw-svg .selected.draw-line, .draw-svg .selected.draw-circle { stroke: var(--color-warning); }
.draw-svg .draw-point circle { fill: var(--color-accent); }
.draw-svg .draw-point.selected circle { fill: var(--color-warning); }
.draw-svg .draw-point text, .draw-svg .force-label text { fill: var(--color-text); font-size: 16px; font-style: italic; }
.draw-svg .force-object { fill: var(--color-surface); stroke: var(--color-text); stroke-width: 2; }
.draw-svg .force-arrow line { stroke: var(--force, var(--color-accent)); stroke-width: 3; }
.draw-svg .force-arrow polygon { fill: var(--force, var(--color-accent)); }
.draw-svg .force-arrow.selected line { stroke-width: 5; }
.draw-svg .vector-arrow { fill: none; stroke: var(--color-text); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.force-message .draw-svg { width: 200px; height: auto; max-height: 220px; }
.caption-label { color: var(--color-muted); }
.photo-note { margin: var(--space-2) 0 0; padding: var(--space-2) var(--space-3); font-size: var(--text-sm);
  background: var(--color-warning-soft); border-radius: var(--radius-1); }
.draw-svg .axis-arrow { fill: none; stroke: var(--color-muted); stroke-width: 1.5; }
.draw-svg .draw-frame line { stroke: var(--color-muted); stroke-width: 1.5; stroke-dasharray: 8 5; }
.draw-svg .draw-frame path { fill: none; stroke: var(--color-muted); stroke-width: 1.5; }
.draw-svg .draw-frame text { fill: var(--color-muted); font-size: 16px; font-style: italic; }
.draw-svg .draw-anchor { fill: var(--color-surface); stroke: var(--color-text); stroke-width: 1.5; }
.draw-svg .draw-anchor.center { fill: var(--color-text); }
.exact { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-sm); }
.exact .exact-field { width: 5.5em; flex: 0 0 auto; text-align: right; }
.draw-svg .draw-scale-bar path { fill: none; stroke: var(--color-text); stroke-width: 2; }
.draw-svg .draw-scale-bar text { fill: var(--color-text); font-size: 14px; }
/* D153: a finished drawing */
.milestone-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); color: var(--color-success); }
.milestone-icon { display: inline-flex; padding: 4px; border-radius: 50%; background: var(--color-success-soft); }
.draw-svg .force-origin { fill: var(--force, var(--color-accent)); stroke: var(--color-surface); stroke-width: 2; }
.draw-svg .force-arrow.selected .force-origin { r: 6; }
.force-c1 { --force: var(--force-1); } .force-c2 { --force: var(--force-2); } .force-c3 { --force: var(--force-3); }
.force-c4 { --force: var(--force-4); } .force-c5 { --force: var(--force-5); }
.force-mark::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%;
                      background: var(--force, var(--color-accent)); vertical-align: -1px; }

/* D156: the teacher's home as cards or per theme */
.home-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); }
.view-toggle { display: inline-flex; border: 1px solid var(--color-line); border-radius: var(--radius-1); overflow: hidden; background: var(--color-surface); }
.view-option { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 0; background: transparent; padding: 0 14px;
               font-size: var(--text-sm); min-height: 44px; cursor: pointer; color: var(--color-text); }
.view-option:hover { background: var(--color-surface-2); }
.view-option.on, .view-option.on:hover { background: var(--color-accent); color: var(--color-accent-text); }
.theme-status { display: inline-flex; flex-wrap: wrap; gap: var(--space-1); justify-content: flex-end; }
.card-theme { font-size: 12px; color: var(--color-muted); border: 1px solid var(--color-line); border-radius: var(--radius-pill); padding: 1px 9px; }
.by-theme { display: flex; flex-direction: column; gap: var(--space-4); }
.by-theme .hint { margin: 0; }
.theme-group { border: 1px solid var(--color-line); border-radius: var(--radius-2); background: var(--color-surface); overflow: hidden; }
.theme-head { display: flex; justify-content: space-between; gap: var(--space-2); margin: 0; padding: var(--space-2) var(--space-4);
              background: var(--color-surface-2); font-size: var(--text-md); }
.theme-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-2) var(--space-4);
             border-top: 1px solid var(--color-line); }
/* fixed pill and status columns, so the tags line up from row to row */
.theme-open { flex: 1 1 320px; min-width: 0; display: grid; grid-template-columns: minmax(0, 2fr) 10rem minmax(0, 2fr) 10rem; gap: var(--space-3);
              align-items: center; text-align: left; border: 0; background: transparent; padding: var(--space-1) 0; color: var(--color-text); cursor: pointer; }
.theme-open:disabled { cursor: default; opacity: .7; }
.theme-open .mode-pill { justify-self: start; }
.theme-title { font-weight: 600; overflow-wrap: anywhere; }
.theme-desc { font-size: var(--text-sm); overflow-wrap: anywhere; }
.theme-edit { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
@media (max-width: 640px) { .theme-open { grid-template-columns: minmax(0, 1fr) auto; } .theme-desc { grid-column: 1 / -1; } }

/* D157: a new opdracht or verkenning, one question per screen */
.wizard-steps { list-style: none; margin: var(--space-3) 0 var(--space-4); padding: 0; display: grid;
                grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: var(--space-2); }
.wizard-steps li { font-size: var(--text-sm); color: var(--color-muted); padding-top: var(--space-2); border-top: 4px solid var(--color-line); }
.wizard-steps li.done { border-top-color: var(--color-accent); }
.wizard-steps li.now { border-top-color: var(--color-accent); color: var(--color-text); font-weight: 700; }
.wizard-body { display: flex; flex-direction: column; gap: var(--space-3); min-height: 220px; }
.wizard-q { margin: 0; font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; }
.wizard-q.small { font-size: var(--text-lg); }
.wizard-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
/* the wizard is a card as high as the screen allows: only the question scrolls, the buttons are its fixed foot */
.create { display: flex; flex-direction: column; overflow: hidden; padding-bottom: var(--space-5); }
.create .form-card { width: 100%; max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; min-height: 0;
                     max-height: 100%; padding-bottom: 0; overflow: hidden; }
.create .form-card > h3, .create .wizard-steps { flex: none; }
.create .wizard-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px 4px var(--space-4) 2px; }
.wizard-nav { flex: none; margin: 0 calc(-1 * var(--space-4)); padding: var(--space-3) var(--space-4);
              background: var(--color-surface); border-top: 1px solid var(--color-line); }
.wizard-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-3); }
.wizard-tile { display: flex; align-items: flex-start; gap: var(--space-3); text-align: left; padding: var(--space-4); min-height: 88px; cursor: pointer;
               border: 1px solid var(--color-line); border-radius: var(--radius-2); background: var(--color-surface); color: var(--color-text); }
.wizard-tile:hover { border-color: var(--color-accent); }
.wizard-tile-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wizard-tile .muted { font-size: var(--text-sm); }
.wizard-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-pill);
               background: var(--mode-assignment); color: var(--color-text); }
.wizard-icon.mode-remediation { background: var(--mode-remediation); } .wizard-icon.mode-deepening { background: var(--mode-deepening); }
.wizard-icon.mode-broadening { background: var(--mode-broadening); } .wizard-icon.mode-exam_preparation { background: var(--mode-exam_preparation); }
.wizard-icon.mode-discovery { background: var(--mode-discovery); }
.wizard-tile[aria-pressed="true"] { border: 2px solid var(--color-accent); background: var(--color-accent-soft); }
.wizard-for { display: flex; flex-direction: column; gap: var(--space-2); }
.series-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--color-line);
              border-radius: var(--radius-2); background: var(--color-surface); }
.series-row.dropped { opacity: .55; }
.series-row.dropped .series-text > span:first-child { text-decoration: line-through; }
.series-text { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.series-meta { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; font-size: var(--text-sm); color: var(--color-muted); }
.stars { min-width: 4.2em; font-size: 18px; letter-spacing: 2px; color: var(--color-warning); }
.level-rungs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-1); align-items: end; }
.level-rung { display: flex; flex-direction: column; gap: 4px; align-items: stretch; padding: 4px; border: 0; border-radius: var(--radius-1);
              background: transparent; color: var(--color-text); font-size: 12px; text-align: center; cursor: pointer; min-height: 44px; }
.level-rung[aria-pressed="true"] { font-weight: 700; }
.level-rung:disabled { cursor: default; opacity: .6; }
.level-mark { min-height: 1.2em; color: var(--color-muted); }
.level-bar { display: block; border-radius: var(--radius-1); background: var(--color-surface-2); border: 1px dashed var(--color-line); }
.level-bar.on { background: var(--color-accent); border-color: var(--color-accent); }
.help-dots { display: inline-flex; align-items: center; gap: var(--space-2); }
.help-dot { width: 26px; height: 26px; min-height: 26px; padding: 0; border-radius: var(--radius-pill); border: 2px solid var(--color-accent);
            background: var(--color-surface); cursor: pointer; }
.help-dot.on { background: var(--color-accent); }
@media (max-width: 640px) { .level-rungs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* D158: the teacher's material and each goal's details */
.material-tools { display: flex; flex-direction: column; gap: var(--space-2); }
.material-button { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 6px 14px; min-height: 40px;
                   border: 1px solid var(--color-line); border-radius: var(--radius-pill); background: var(--color-surface); }
.material-button:focus-within { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.material { border: 1px solid var(--color-line); border-radius: var(--radius-2); background: var(--color-surface-2); padding: var(--space-3); }
.material-head { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: baseline; }
.material-head .link { margin-left: auto; }
.material-text { margin: var(--space-2) 0; white-space: pre-wrap; font-size: var(--text-sm); max-height: 9em; overflow: hidden; }
.material .hint { margin: 0; }
.details-row { display: flex; flex-direction: column; gap: 4px; margin: 0 0 var(--space-3) calc(13px + var(--space-2)); }
.details-row .muted { font-size: 12px; }
.details-input { min-height: 2.4em; font-size: var(--text-sm); }

/* D192: taking over the teacher's material in the series step */
.import-block { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--color-line);
                border-radius: var(--radius-2); background: var(--color-surface-2); }
.import-block > .wizard-head, .import-block p { margin: 0; }
.import-block > button { align-self: flex-start; }
.check-row { display: flex; gap: var(--space-2); align-items: flex-start; cursor: pointer; }
.check-row input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.import-refused { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--color-line);
                  border-radius: var(--radius-2); background: var(--color-surface); }
.import-text { width: 100%; font: inherit; font-size: var(--text-sm); }
.import-answer { max-width: 16em; font: inherit; }
.import-flag { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; font-size: var(--text-sm); }

/* D158: step 1 as one input: the text box with its photo and file tools, then the themes */
.wizard-for-class { margin: 0; font-size: var(--text-sm); }
.about-box { display: flex; flex-direction: column; border: 1px solid var(--color-line); border-radius: var(--radius-2);
             background: var(--color-surface); overflow: hidden; }
.about-box:focus-within { border-color: var(--color-accent); box-shadow: 0 0 0 2px var(--color-accent-soft); }
.about-box .about-input { border: 0; border-radius: 0; box-shadow: none; background: transparent; resize: vertical;
                          padding: var(--space-3) var(--space-4); margin: 0; }
.about-box .about-input:focus { outline: none; }
.about-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4);
               border-top: 1px solid var(--color-line); background: var(--color-surface-2); }
.about-tools .material-button { min-height: 36px; padding: 4px 12px; font-size: var(--text-sm); }
.about-tools .about-note, .about-tools .reading { margin: 0 0 0 auto; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.about-themes { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }
.about-themes > .muted { font-size: var(--text-sm); }
.grade-pick { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
.grade-pick .view-option { min-height: 36px; min-width: 36px; justify-content: center; border: 1px solid var(--color-line);
                           border-radius: var(--radius-1); }

/* D159: a concept taken away from a goal stays visible, struck through */
.chip.chip-off { opacity: .65; }
.chip.chip-off > span:first-child { text-decoration: line-through; }
.concepts-row .chips { gap: 6px; }
.concepts-row .add-group { display: inline-flex; gap: 4px; }
.concepts-row .add-input { min-width: 9rem; font-size: 13px; padding: 2px 8px; }

.wizard-for-class { display: flex; align-items: center; gap: var(--space-2); }
.class-pick { font: inherit; font-size: var(--text-sm); padding: 4px 8px; border: 1px solid var(--color-line); border-radius: var(--radius-1);
              background: var(--color-surface); color: var(--color-text); min-height: 32px; }

/* a question before something that cannot be undone, instead of the browser's popup */
.confirm-dialog { border: 1px solid var(--color-line); border-radius: var(--radius-3); background: var(--color-surface);
                  color: inherit; box-shadow: var(--shadow-2); padding: var(--space-5); max-width: min(420px, calc(100vw - 32px)); }
.confirm-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.confirm-text { margin: 0 0 var(--space-4); }
.confirm-dialog .ask-actions { display: flex; justify-content: flex-end; gap: var(--space-2); }

/* D193: how the student feels: understanding, then a choice; a one-minute movement break with a figure to follow */
.mood-lead { margin: 0 0 var(--space-3); }
.ahead { display: grid; gap: var(--space-2); margin: var(--space-2) 0 var(--space-3); }
.ahead .choice-question { margin: 0; }
.ahead-own { margin: 0; font-size: var(--text-sm); }
.break-stage { display: flex; align-items: center; gap: var(--space-5); margin: var(--space-2) 0 var(--space-4); }
.break-side { display: grid; gap: var(--space-2); justify-items: start; min-width: 0; }
.break-move { margin: 0; font-size: var(--text-lg); line-height: 1.3; }
.break-timer { position: relative; width: 64px; height: 64px; }
.break-ring { width: 64px; height: 64px; transform: rotate(-90deg); }
.break-ring circle { fill: none; stroke-width: 6; }
.break-ring .track { stroke: var(--color-line); }
.break-ring .done { stroke: var(--color-accent); stroke-linecap: round; stroke-dasharray: 169.65; transition: stroke-dashoffset .25s linear; }
.break-secs { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--text-lg); }
.break-dots { display: flex; gap: 6px; }
.break-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--color-line); }
.break-dots span.now { background: var(--color-highlight); }
.break-dots span.ok { background: var(--color-accent); }
.break-buttons { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.break-list { margin: var(--space-2) 0 0; padding-left: var(--space-5); }
.break-fig { width: 132px; height: auto; flex: none; overflow: visible; }
.break-fig line { stroke: var(--color-accent); stroke-width: 7; stroke-linecap: round; }
.break-fig .break-head { fill: var(--color-accent); }
.break-fig .break-halo { fill: var(--color-accent-soft); }
.break-fig .break-floor { stroke: var(--color-line); stroke-width: 3; }
.break-fig .break-hand { fill: var(--color-accent); }
.break-fig .break-face { fill: var(--color-surface); }
.break-fig .break-smile { fill: none; stroke: var(--color-surface); stroke-width: 1.8; stroke-linecap: round; }
.break-fig .break-roll { display: none; }
.break-fig .break-roll path { fill: none; stroke: var(--color-highlight); stroke-width: 2.4; stroke-linecap: round; }
.break-fig.shoulders .break-roll { display: inline; }
.break-fig.shoulders.moving .break-roll { animation: brk-turn 2.4s linear infinite; }
@keyframes brk-turn { to { transform: rotate(-360deg); } }
.break-fig g { transform-box: view-box; }
.break-fig .arm.l { transform-origin: 49px 50px; transform: rotate(14deg); }
.break-fig .arm.r { transform-origin: 71px 50px; transform: rotate(-14deg); }
.break-fig .leg.l { transform-origin: 54px 88px; }
.break-fig .leg.r { transform-origin: 66px 88px; }
.break-fig .leg.l .shin { transform-origin: 54px 114px; }
.break-fig .leg.r .shin { transform-origin: 66px 114px; }
/* arms up high, a little on the toes */
.break-fig.reach.moving .arm.l { animation: brk-reach-l 4s ease-in-out infinite; }
.break-fig.reach.moving .arm.r { animation: brk-reach-r 4s ease-in-out infinite; }
.break-fig.reach.moving .body { animation: brk-rise 4s ease-in-out infinite; }
@keyframes brk-reach-l { 0%, 100% { transform: rotate(14deg); } 40%, 65% { transform: rotate(168deg); } }
@keyframes brk-reach-r { 0%, 100% { transform: rotate(-14deg); } 40%, 65% { transform: rotate(-168deg); } }
@keyframes brk-rise { 0%, 100% { transform: translateY(0); } 40%, 65% { transform: translateY(-4px); } }
/* shoulders up, back and down */
.break-fig.shoulders.moving .shoulders { animation: brk-roll 2.4s ease-in-out infinite; }
@keyframes brk-roll { 0%, 100% { transform: translate(0, 0); } 30% { transform: translate(0, -6px); }
  60% { transform: translate(0, -3px) scaleX(1.08); } }
.break-fig .shoulders { transform-origin: 60px 50px; }
/* slow squats: the hips go down 14 units while the knees bend 43°, so the feet stay on the floor */
.break-fig.squat.moving .body { animation: brk-squat 4s ease-in-out infinite; }
.break-fig.squat.moving .leg.l { animation: brk-thigh-l 4s ease-in-out infinite; }
.break-fig.squat.moving .leg.r { animation: brk-thigh-r 4s ease-in-out infinite; }
.break-fig.squat.moving .leg.l .shin { animation: brk-shin-l 4s ease-in-out infinite; }
.break-fig.squat.moving .leg.r .shin { animation: brk-shin-r 4s ease-in-out infinite; }
.break-fig.squat.moving .arm.l { animation: brk-squat-arm-l 4s ease-in-out infinite; }
.break-fig.squat.moving .arm.r { animation: brk-squat-arm-r 4s ease-in-out infinite; }
@keyframes brk-squat { 0%, 100% { transform: translateY(0); } 45%, 60% { transform: translateY(14px); } }
@keyframes brk-thigh-l { 0%, 100% { transform: rotate(0); } 45%, 60% { transform: rotate(43deg); } }
@keyframes brk-thigh-r { 0%, 100% { transform: rotate(0); } 45%, 60% { transform: rotate(-43deg); } }
@keyframes brk-shin-l { 0%, 100% { transform: rotate(0); } 45%, 60% { transform: rotate(-86deg); } }
@keyframes brk-shin-r { 0%, 100% { transform: rotate(0); } 45%, 60% { transform: rotate(86deg); } }
@keyframes brk-squat-arm-l { 0%, 100% { transform: rotate(14deg); } 45%, 60% { transform: rotate(80deg); } }
@keyframes brk-squat-arm-r { 0%, 100% { transform: rotate(-14deg); } 45%, 60% { transform: rotate(-80deg); } }
/* done: arms up */
.break[data-phase="done"] .break-fig .arm.l { transform: rotate(150deg); }
.break[data-phase="done"] .break-fig .arm.r { transform: rotate(-150deg); }
@media (max-width: 520px) { .break-stage { gap: var(--space-3); } .break-fig { width: 104px; } }
/* without motion: each move as one still pose */
@media (prefers-reduced-motion: reduce) {
  .break-fig * { animation: none !important; }
  .break-fig.reach .arm.l { transform: rotate(168deg); } .break-fig.reach .arm.r { transform: rotate(-168deg); }
  .break-fig.shoulders .shoulders { transform: translateY(-6px); }
  .break-fig.squat .body { transform: translateY(14px); }
  .break-fig.squat .leg.l { transform: rotate(43deg); } .break-fig.squat .leg.r { transform: rotate(-43deg); }
  .break-fig.squat .leg.l .shin { transform: rotate(-86deg); } .break-fig.squat .leg.r .shin { transform: rotate(86deg); }
  .break-ring .done { transition: none; }
}

/* D195: the pause timer: one calm ring, minutes and seconds */
.pause-stage { display: flex; align-items: center; gap: var(--space-4); margin: var(--space-2) 0 var(--space-4); }
.pause-timer, .pause-timer .break-ring { width: 88px; height: 88px; }
.pause-secs { font-size: var(--text-xl); }
.pause-done { margin: 0; }
.pause > .action { justify-self: start; align-self: flex-start; width: auto; }

/* D196: on a phone the message box gets its own full row; the buttons sit under it, send on the right */
@media (max-width: 560px) {
  .composer { flex-wrap: wrap; }
  .composer textarea { flex: 1 0 100%; }
  .composer #send { margin-left: auto; }
}

/* D196: people to talk to */
.mood-contacts { display: grid; gap: var(--space-2); margin: 0 0 var(--space-3); padding: var(--space-3);
  border-radius: var(--radius-2); background: var(--color-accent-soft); }
.mood-contacts ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); }
.mood-contacts li { display: grid; gap: 1px; }
.mood-contact-name { font-weight: 600; }
.mood-contacts .muted { font-size: var(--text-sm); }

/* D197 (beta): the pause tower, a silent stacking game for the length of the pause */
.beta-tag { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
  color: var(--color-accent); background: var(--color-accent-soft); border-radius: var(--radius-pill); padding: 1px 8px;
  vertical-align: middle; }
.game-top { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-2) 0; }
.game-clock { display: flex; align-items: center; gap: var(--space-2); color: var(--color-muted); font-size: var(--text-sm); }
.game-clock .break-ring { width: 32px; height: 32px; }
.game-left { color: var(--color-text); font-variant-numeric: tabular-nums; }
.game-score { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
.game-score-now { font-size: 26px; font-weight: 600; line-height: 1; }
.game-score-best { font-size: 12px; }
.game-stage { position: relative; height: min(420px, 60vh); min-height: 300px; border-radius: var(--radius-3); overflow: hidden;
  border: 1px solid var(--color-line); background: linear-gradient(var(--color-accent-soft), var(--color-surface));
  touch-action: manipulation; cursor: pointer; user-select: none; -webkit-user-select: none; }
.game-canvas { display: block; width: 100%; height: 100%; }
.game-panel { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--space-4); text-align: center; }
.game-panel[hidden] { display: none !important; }
.game-card { background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-3);
  padding: var(--space-5) var(--space-4); max-width: 320px; display: grid; gap: var(--space-3); box-shadow: var(--shadow-2); cursor: default; }
.game-card h3 { margin: 0; font-size: var(--text-display); line-height: 1.1; }
.game-card p { margin: 0; font-size: 14px; line-height: 1.5; }
.game-card .beta-tag { justify-self: center; }
.game-final { font-size: 52px; font-weight: 600; line-height: 1; color: var(--color-accent); font-variant-numeric: tabular-nums; }
.game-buttons { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; }
.game-buttons .action { width: auto; }
@media (max-width: 520px) {
  .game-card { padding: var(--space-4) var(--space-3); gap: var(--space-2); }
  .game-card h3 { font-size: var(--text-xl); }
  .game-card p { font-size: 13px; line-height: 1.4; }
  .game-final { font-size: 40px; }
}

/* D198: the teacher's home as pages, with the menu on the left; on a phone a tab bar at the bottom */
.home.with-nav { display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: var(--space-6); align-content: start;
  padding-left: max(var(--space-5), calc((100% - 1180px) / 2)); padding-right: max(var(--space-5), calc((100% - 1180px) / 2)); }
.home.with-nav > * { grid-column: 2; min-width: 0; }
.home.with-nav > .teacher-side { grid-column: 1; grid-row: 1 / span 40; align-self: start; position: sticky; top: 0; }
.home.with-nav .home-head > .home-tools:empty { display: none; }
.home.with-nav > .attention:first-of-type { margin-top: 0; }
.teacher-side { display: flex; flex-direction: column; gap: var(--space-4); }
.teacher-picks { display: flex; flex-direction: column; gap: var(--space-3); }
.teacher-picks .subject-pick { display: flex; flex-direction: column; gap: 4px; }
.teacher-picks .dropdown-button { min-width: 0; width: 100%; }
.teacher-picks .dropdown-list { left: 0; right: auto; }
.teacher-nav { display: flex; flex-direction: column; gap: 2px; }
.teacher-nav-item { display: flex; align-items: center; gap: var(--space-3); text-align: left; border: 0; border-radius: var(--radius-1);
  background: transparent; padding: 10px 14px; color: var(--color-muted); font-weight: 600; }
.teacher-nav-item svg { flex: none; }
.teacher-nav-label { flex: 1; }
.teacher-nav-item:hover { background: var(--color-surface-2); color: var(--color-text); }
.teacher-nav-item[aria-current="page"] { background: var(--color-surface); color: var(--color-accent); box-shadow: var(--shadow-1); }
.nav-count { min-width: 22px; padding: 1px 7px; border-radius: var(--radius-pill); background: var(--color-accent); color: var(--color-accent-text);
  font-size: 12px; font-weight: 700; text-align: center; }
@media (max-width: 760px) {
  .home.with-nav { display: block; }
  .home.with-nav > .teacher-side { position: static; margin-bottom: var(--space-4); }
  .teacher-picks { flex-direction: row; flex-wrap: wrap; }
  .teacher-picks .subject-pick { flex: 1 1 10rem; }
  .teacher-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; flex-direction: row; gap: 0;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); background: var(--color-surface); border-top: 1px solid var(--color-line);
    box-shadow: var(--shadow-2); }
  .teacher-nav-item { position: relative; flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 11px; }
  .teacher-nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; text-align: center; }
  .teacher-nav-item[aria-current="page"] { box-shadow: none; background: var(--color-surface-2); }
  .nav-count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; padding: 0 5px; font-size: 11px; }
  body.has-teacher-nav { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
}
#class-learned .hint { text-align: left; }

/* D207: a climate graph drawn in a question card */
.chart-wrap { margin: var(--space-2) 0; background: var(--color-surface); border: 1px solid var(--color-line);
  border-radius: var(--radius-2); padding: var(--space-2); }
.climate-chart { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; }
.climate-chart .chart-title { font-size: 11px; font-weight: 600; fill: var(--color-text); }
.climate-chart .chart-axis { font-size: 10px; fill: var(--color-muted); }
.climate-chart .chart-axis.t { fill: var(--color-danger); }
.climate-chart .chart-axis.n { fill: var(--force-4); }
.climate-chart .chart-grid { stroke: var(--color-line); stroke-width: 1; }
.climate-chart .chart-bar { fill: var(--force-4); opacity: .55; }
.climate-chart .chart-line { fill: none; stroke: var(--color-danger); stroke-width: 2; }
.climate-chart .chart-dot { fill: var(--color-danger); }
.chart-table summary { cursor: pointer; font-size: var(--text-sm); color: var(--color-muted); }

/* D208 (beta): listening and speaking in a question set */
.listen-block { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin: var(--space-2) 0; }
.listen-block .listen-button { display: inline-flex; align-items: center; gap: var(--space-2); width: auto; height: auto;
  padding: 10px 18px; border-radius: var(--radius-pill); background: var(--color-accent); color: var(--color-accent-text);
  font-weight: 600; font-size: var(--text-md); border: 0; }
.listen-block .listen-button svg { width: 20px; height: 20px; }
.audio-speak { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-2) 0; font-size: var(--text-sm); }
.card-body > .beta-tag { justify-self: start; align-self: start; width: fit-content; }
.question-list { margin: 0 0 var(--space-2); padding-left: 0; list-style: none; display: grid; gap: var(--space-1); font-size: var(--text-md); }
.chart-table-wrap { overflow-x: auto; margin-top: var(--space-2); }
.chart-numbers { border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-numbers th, .chart-numbers td { padding: 4px 6px; text-align: right; border-bottom: 1px solid var(--color-line); }
.chart-numbers thead th { color: var(--color-muted); font-weight: 600; }
.chart-numbers tbody th { text-align: left; white-space: nowrap; color: var(--color-muted); }

/* D210: a Punnett square to fill in */
.punnett-block { display: grid; gap: var(--space-2); justify-items: start; margin: var(--space-2) 0; }
.punnett { display: grid; grid-template-columns: repeat(3, 56px); grid-auto-rows: 56px; gap: 4px; }
.punnett input { width: 100%; height: 100%; box-sizing: border-box; text-align: center; font: inherit; font-size: 20px;
  border: 1px solid var(--color-line); border-radius: var(--radius-1); background: var(--color-surface); color: var(--color-text); }
.punnett .punnett-edge { background: var(--color-accent-soft); font-weight: 700; }
.punnett-corner { display: grid; place-items: center; color: var(--color-muted); font-size: 20px; }
.punnett-block .action { width: auto; }
.listen-block .listen-button.loading { opacity: .75; cursor: progress; }
.listen-block .listen-button.loading::after { content: "…"; }
.listen-block .listen-button[aria-pressed="true"]:not(.loading) { box-shadow: 0 0 0 3px var(--color-accent-soft); }
.question-aside { background: var(--color-surface-2); border-radius: var(--radius-2); padding: var(--space-3) var(--space-4); margin: var(--space-2) 0; }
.question-aside p { margin: 0 0 var(--space-2); }
.question-aside p:last-child { margin-bottom: 0; }
