/* Lessonflow. Plain CSS, no framework.
   Aim: calm and readable on a shared screen. One spacing scale, one accent,
   very few lines; space separates things, not borders. */

/* The colours of the journey's painted maps (2026-11-27): parchment, olive ink, moss, river teal,
   autumn red. Dark mode is off for now (theme.js). */
:root {
  --bg: #f3eee2;
  --surface: #fbf8f0;
  --fg: #2b2a22;
  --muted: #6b6650;
  --faint: #9a9478;
  --line: #e0d8c4;
  --accent: #2e6b73;
  --accent-soft: #e2eeec;
  --ok: #4a7a3c;
  --ok-soft: #e8efdc;
  --wrong: #a8432f;
  --note-soft: #ece5d3;
  --draft: #9a6200;
  --draft-soft: #fbf0db;
  --live: #ff9500;            /* the live lesson: the student's pointer, their field, the teacher's typing */
  --btn: #fbf8f0;             /* buttons: the surface colour (darker ones were tried and reverted, 2026-11-27) */
  --btn-hover: #fbf8f0;
  --live-soft: #fff1d6;
  --live-fg: #8a5200;
  color-scheme: light;

  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem;
  --s6: 2.25rem; --s7: 3.5rem; --s8: 5rem;

  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "DejaVu Sans Mono", Menlo, monospace;
}
/* Dark: the system's choice, unless the viewer picked one with the toggle (theme.js). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161715; --surface: #1f201e; --fg: #e9e8e4; --muted: #a8a59f; --faint: #7d7a74;
    --line: #2f302d; --accent: #8bbbe0; --accent-soft: #1f2b36; --ok: #86c9a0; --ok-soft: #1c2a21;
    --wrong: #ec9a87; --note-soft: #262622; --draft: #e5b25e; --draft-soft: #33291a;
    --live-soft: #3a2a10; --live-fg: #ffc266; color-scheme: dark; --btn: #1f201e; --btn-hover: #1f201e;
  }
}
:root[data-theme="dark"] {
    --bg: #161715; --surface: #1f201e; --fg: #e9e8e4; --muted: #a8a59f; --faint: #7d7a74;
    --line: #2f302d; --accent: #8bbbe0; --accent-soft: #1f2b36; --ok: #86c9a0; --ok-soft: #1c2a21;
    --wrong: #ec9a87; --note-soft: #262622; --draft: #e5b25e; --draft-soft: #33291a;
    --live-soft: #3a2a10; --live-fg: #ffc266; color-scheme: dark; --btn: #1f201e; --btn-hover: #1f201e;
}

/* base */
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* even where a style sets display (buttons) */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 18px/1.6 var(--font); }
main { margin: 0 auto; padding: var(--s6) 16px var(--s8); }
main.reading { max-width: 44rem; }
main.wide { max-width: 78rem; }
main.narrow { max-width: 24rem; }
a { color: var(--accent); text-underline-offset: .15em; }
h1, h2, h3 { line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 2rem; margin: 0 0 var(--s2); }
h2 { font-size: 1.4rem; margin: var(--s6) 0 var(--s4); }
h3 { font-size: 1.1rem; margin: var(--s5) 0 var(--s3); }
p { margin: 0 0 var(--s3); }
code, .mono { font-family: var(--mono); font-size: .86em; }
.sub { color: var(--muted); font-weight: 400; font-size: .7em; margin-left: var(--s2); }
.meta, .note, .empty { color: var(--muted); font-size: .9rem; }
.note { max-width: 40rem; }
.alert { color: var(--wrong); background: var(--draft-soft); border-radius: var(--radius); padding: var(--s3) var(--s4); }
.alert ul { margin: var(--s2) 0 0; padding-left: var(--s5); }

/* top bar: quiet, it is on the shared screen too */
nav.top { display: flex; align-items: center; gap: var(--s5); padding: var(--s3) var(--s5);
  font-size: .88rem; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }   /* above every sticky part of a page (word pools, review headings) */
nav.top a { color: var(--muted); text-decoration: none; }
nav.top a:hover { color: var(--fg); }
nav.top a[aria-current="page"] { color: var(--fg); font-weight: 650; box-shadow: inset 0 -2px 0 var(--accent); padding-bottom: 2px; }   /* the page you are on */
nav.top .home { color: var(--fg); font-weight: 650; }
.nav-links { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; margin-left: auto; }
.seg { display: inline-flex; gap: 2px; background: var(--note-soft); border-radius: 999px; padding: 2px; }
.seg a { padding: 1px var(--s3); border-radius: 999px; }
.seg a.on { background: var(--surface); color: var(--fg) !important; box-shadow: 0 0 0 1px var(--line); }
.toggle.on { color: var(--draft) !important; }

/* buttons */
button, a.button, summary.button, span.button { font: inherit; font-size: .85rem; line-height: 1.2; white-space: nowrap; padding: var(--s2) var(--s4);
  border: 1px solid var(--line); border-radius: 999px; background: var(--btn); color: var(--fg);
  cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, a.button:hover, summary.button:hover, a:hover > span.button { border-color: var(--faint); background: var(--btn-hover); }
button.primary, a.button.primary, summary.button.primary, span.button.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); }
button.primary:hover, a.button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
button.quiet { background: transparent; border-color: var(--line); color: var(--fg); }
button.quiet:hover { color: var(--fg); border-color: var(--accent); }
button.danger { color: var(--wrong); }

.badge { display: inline-block; font-size: .72rem; line-height: 1.5; padding: 0 var(--s2); border-radius: 999px;
  background: var(--note-soft); color: var(--muted); vertical-align: middle; font-weight: 500; }
.badge.draft { background: var(--draft-soft); color: var(--draft); }
.badge.approved { background: var(--ok-soft); color: var(--ok); }

/* tree */
ul.tree { list-style: none; padding: 0; margin: var(--s5) 0; }
ul.tree li { padding: var(--s3) 0 var(--s3) calc(var(--depth) * var(--s6)); }
ul.tree li + li { border-top: 1px solid var(--line); }
.node-line { display: flex; gap: var(--s3); align-items: baseline; }
.node-line .title { font-size: 1.1rem; }
.node-meta { color: var(--muted); font-size: .85rem; }
.is-stub .title { color: var(--faint); }

/* teaching view */
.lesson-head { margin-bottom: var(--s6); }
.outcome { color: var(--muted); font-size: 1.05rem; }
nav.jump { display: flex; gap: var(--s5); font-size: .88rem; margin-top: var(--s4); }
nav.jump a { color: var(--muted); text-decoration: none; }
nav.jump a:hover { color: var(--accent); }
h2.part { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em;
  color: var(--faint); margin: var(--s8) 0 var(--s2); }
section.point > h2 { margin-top: var(--s5); }
section.point + section.point { margin-top: var(--s7); }

.prose p { margin: 0 0 var(--s3); }
.prose p:last-child { margin-bottom: 0; }
.prose .label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--faint); margin: var(--s4) 0 var(--s1); }
.prose .formula { display: inline-block; background: var(--accent-soft); color: var(--fg); border-radius: 8px;
  padding: var(--s2) var(--s4); margin: var(--s2) 0 var(--s4); font-weight: 550; }
.prose .formula span { color: var(--accent); font-weight: 600; margin-right: var(--s2); font-size: .85em; }
.prose .correction s { color: var(--wrong); text-decoration-thickness: 1px; }
.prose .correction .arrow { color: var(--faint); margin: 0 var(--s1); }
.prose .correction .why { display: block; color: var(--muted); font-size: .9em; }

article.core { background: var(--surface); border-radius: var(--radius); padding: var(--s5) var(--s5) var(--s4);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 0 0 1px var(--line); font-size: 1.06rem; }

.blocks { margin-top: var(--s4); display: grid; gap: var(--s2); }
details.block { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); }
details.block > summary { list-style: none; cursor: pointer; padding: var(--s3) var(--s4); display: grid;
  grid-template-columns: 1rem minmax(0, 1fr); column-gap: var(--s2); align-items: baseline; }
details.block > summary::-webkit-details-marker { display: none; }
details.block > summary::before { content: "+"; color: var(--faint); font-weight: 600; grid-row: 1 / span 2; }
details.block[open] > summary::before { content: "–"; }
.block-type { font-weight: 600; font-size: .92rem; }
.preview { grid-column: 2; color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.block[open] .preview { display: none; }
details.block:hover { box-shadow: 0 0 0 1px var(--faint); }
.block-body { padding: 0 var(--s4) var(--s4) calc(var(--s4) + 1rem + var(--s2)); }
.block-body .reveals { margin-top: var(--s3); }

.group { margin: var(--s6) 0; }
.group h3 { display: flex; align-items: center; gap: var(--s3); }
.step-no { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--note-soft); color: var(--muted); font-size: .8rem; font-weight: 600; }
.instruction { color: var(--muted); margin: var(--s4) 0 var(--s2); }
ol.items { margin: 0; padding-left: 1.8rem; }
ol.items > li { padding: var(--s3) 0 var(--s3) var(--s2); }
ol.items > li + li { border-top: 1px solid var(--line); }
ol.items > li::marker { color: var(--faint); font-weight: 600; }
.prompt { font-size: 1.12rem; margin: 0 0 var(--s2); }

/* reveal pills: closed pills sit in a row; an open one takes the full width */
.reveals { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s2); margin-top: var(--s2); }
details.reveal > summary { list-style: none; cursor: pointer; font-size: .78rem; font-weight: 500;
  color: var(--muted); padding: 2px var(--s3); border-radius: 999px; background: var(--note-soft); user-select: none; }
details.reveal > summary::-webkit-details-marker { display: none; }
details.reveal > summary:hover { color: var(--fg); }
details.reveal[open] { flex-basis: 100%; }
details.reveal[open] > summary { display: inline-block; }
details.reveal .panel { margin-top: var(--s2); padding: var(--s3) var(--s4); border-radius: 8px; font-size: .95rem; }
details.answer .panel { background: var(--ok-soft); }
details.answer[open] > summary { background: var(--ok-soft); color: var(--ok); }
details.polish .panel { background: var(--note-soft); font-style: italic; }
details.teacher .panel { background: var(--accent-soft); }
details.teacher[open] > summary { background: var(--accent-soft); color: var(--accent); }
ul.accepted { list-style: none; margin: 0; padding: 0; }
ul.accepted li { font-weight: 550; }
ul.accepted li + li { margin-top: var(--s1); }
.why { color: var(--muted); margin: var(--s2) 0 0; }
.open-label { color: var(--muted); font-style: italic; }
.k { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-right: var(--s2); }
.targets { margin: var(--s2) 0 0; display: flex; flex-wrap: wrap; gap: var(--s1); }
.targets span { font-family: var(--mono); font-size: .75rem; background: var(--surface); border-radius: 4px; padding: 0 var(--s2); }
.reveals .badge { align-self: center; }

/* review */
.page-head { margin-bottom: var(--s5); }
.table-wrap { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); }
table.review { border-collapse: collapse; width: 100%; font-size: .88rem; }
table.review th { text-align: left; font-weight: 600; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--faint); padding: var(--s3) var(--s3); border-bottom: 1px solid var(--line); }
table.review td { padding: var(--s4) var(--s3); vertical-align: top; border-bottom: 1px solid var(--line); }
table.review tr:last-child td { border-bottom: 0; }
table.review td.content { max-width: 46rem; }
table.review td.content > div + div { margin-top: var(--s1); }
table.review td.actions { width: 7.5rem; }
table.review td.actions > * { display: block; width: 100%; margin-bottom: var(--s2); text-align: center;
  font-size: .8rem; padding: 3px var(--s3); }
.prose.compact p { margin-bottom: var(--s2); }
.prose.compact .formula { margin: var(--s1) 0 var(--s2); padding: var(--s1) var(--s3); }
.prose.compact .label { margin: var(--s2) 0 0; }
tr.status-retired { opacity: .5; }
.teacher-note { background: var(--accent-soft); padding: var(--s1) var(--s2); border-radius: 6px; }
table.review .small { font-size: .8rem; }
table.review .muted { color: var(--muted); }
ul.error { color: var(--wrong); margin: var(--s2) 0 0; padding-left: var(--s4); }

/* forms */
form.edit > div:not(.actions) { margin-bottom: var(--s5); }
form.edit label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: var(--s1); }
form.edit textarea, form.edit select, form.login input, form.profile-form input {
  width: 100%; font: inherit; font-size: 1rem; padding: var(--s3); background: var(--surface); color: var(--fg);
  border: 1px solid var(--line); border-radius: 8px; }
form.edit textarea:focus, form.login input:focus, form.profile-form input:focus, form.edit select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
form.edit ul { list-style: none; padding: 0; margin: 0; }
form.edit ul label { color: var(--fg); font-size: .95rem; display: flex; gap: var(--s2); padding: var(--s1) 0; }
form.edit .helptext, form.edit .errorlist { font-size: .85rem; color: var(--wrong); }
div.actions { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; margin: var(--s4) 0; }
form.login label { display: block; margin-bottom: var(--s4); font-size: .9rem; color: var(--muted); }
form.login input { margin-top: var(--s1); }

/* print view: outline beside the sheet, parts switched in place */
main.print-page { max-width: 70rem; }
.print-layout { display: grid; grid-template-columns: 16rem minmax(0, 44rem); gap: var(--s6); align-items: start; }
.outline { position: sticky; top: calc(var(--nav-h, 3.4rem) + 1rem); max-height: calc(100vh - 5rem); overflow: auto; font-size: .86rem;
  background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); padding: var(--s4); }
.outline-actions { display: flex; gap: var(--s2); margin-bottom: var(--s3); }
.outline-opts { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); padding: var(--s3) 0; border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line); margin-bottom: var(--s3); }
.outline-opts select { font: inherit; padding: 1px var(--s1); border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); }
.outline label { display: flex; gap: var(--s2); align-items: baseline; cursor: pointer; padding: 2px 0; }
.outline .row { display: flex; gap: var(--s2); align-items: center; padding: 2px 0; }
.outline .row a { color: var(--fg); text-decoration: none; flex: 1; min-width: 0; }
.outline .row a:hover { color: var(--accent); text-decoration: underline; }
.outline .row.top a { font-weight: 600; }
.outline .note { font-size: .8rem; margin: 0 0 var(--s3); }
ul.tree-toggles, ul.tree-toggles ul { list-style: none; margin: 0; padding: 0; }
ul.tree-toggles ul { padding-left: var(--s5); }
ul.tree-toggles > li + li { margin-top: var(--s3); }
[data-part] { scroll-margin-top: 5rem; }
[data-part]:target > .part-head { animation: flash 1.6s ease-out; border-radius: 6px; }
@keyframes flash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.sub-head { display: block; color: var(--faint); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; margin-top: var(--s2); }
.count { color: var(--faint); font-size: .8em; margin-left: auto; }

.pack .eyebrow { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin: var(--s6) 0 var(--s2); }
.pack .eyebrow label { display: inline-flex; gap: var(--s2); align-items: center; cursor: pointer; }
.tick { display: inline-flex; margin-right: var(--s3); vertical-align: middle; cursor: pointer; }
.tick input, .outline input[type=checkbox], .eyebrow input { accent-color: var(--accent); width: 1rem; height: 1rem; }
.pack .part.is-off > :not(.part-head) { display: none; }
.pack .part.is-off > .part-head { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--line); }
.pack .part.is-off > .part-head input { text-decoration: none; }
.key-actions { margin-bottom: var(--s5); }

@media (max-width: 60rem) {
  .print-layout { grid-template-columns: 1fr; }
  .outline { position: static; max-height: none; }
}

/* print pack: what the student gets */
.pack h1 { margin-bottom: var(--s6); }
.pack section { margin-bottom: var(--s6); }
.pack .block-print { margin-top: var(--s4); padding-left: var(--s4); border-left: 2px solid var(--line); }
.pack .pl { color: var(--muted); font-style: italic; margin-top: var(--s2); }
.pack .exercise h3 { margin-bottom: var(--s1); }
.pack .exercise .instruction { margin: var(--s3) 0 var(--s2); }
.pack ol { padding-left: 1.8rem; margin: 0 0 var(--s4); }
.pack ol > li { padding: var(--s2) 0; }
.pack ol > li::marker { color: var(--muted); font-weight: 600; }
.pack .write { height: 2rem; border-bottom: 1px dashed var(--line); margin-top: var(--s1); }
.pack .write.tall { height: 9rem; }
.key .ans { font-weight: 600; }
.key .or { color: var(--faint); }
.key .why { font-size: .92rem; }

@media (max-width: 40rem) {
  body { font-size: 17px; }
  main { padding-top: var(--s5); }
  article.core { padding: var(--s4); }
  table.review thead { display: none; }
  table.review, table.review tbody, table.review tr, table.review td { display: block; width: 100%; }
  table.review tr { border-bottom: 1px solid var(--line); padding: var(--s3) var(--s4); }
  table.review td { border: 0; padding: var(--s1) 0; }
  table.review td.actions > * { display: inline-block; width: auto; margin-right: var(--s2); }
}

@media print {
  :root { --bg: #fff; --surface: #fff; --fg: #000; --muted: #444; --faint: #777; --line: #c8c8c8;
    --accent-soft: #f0f0f0; --note-soft: #f4f4f4; }
  @page { size: A4; margin: 17mm 16mm; }
  body { font-size: 11.5pt; line-height: 1.5; }
  nav.top, .no-print { display: none !important; }
  .is-off { display: none !important; }
  .print-layout { display: block; }
  main, main.reading { max-width: none; padding: 0; }
  .pack h1 { font-size: 18pt; margin-bottom: 10mm; }
  .pack h2 { font-size: 13.5pt; margin-top: 8mm; }
  .pack h3 { font-size: 12pt; break-after: avoid; }
  .pack .instruction { break-after: avoid; }
  .pack li, .pack .prose p, .prose .formula { break-inside: avoid; }
  .prose .formula { border: 1px solid var(--line); }
}

/* a further instruction inside the same step: lighter, aligned with the text */
.group h3.run { font-weight: 600; font-size: 1rem; color: var(--muted); margin-top: var(--s5); padding-left: calc(1.7rem + var(--s3)); }
.pack h3.run { font-weight: 600; font-size: .95rem; color: var(--muted); margin-top: var(--s4); }

.notice { font-size: .88rem; color: var(--draft); background: var(--draft-soft); border-radius: 8px;
  padding: var(--s2) var(--s4); margin: var(--s4) 0 0; display: inline-block; }
.notice.drafts { color: var(--muted); background: var(--note-soft); }
.notice.grown { color: var(--fg); background: var(--ok-soft); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.notice.grown .button { margin-left: auto; }
tr.is-new { box-shadow: inset 4px 0 0 var(--ok); }
.notice a { color: inherit; font-weight: 600; margin-left: var(--s2); }

/* a sub-tick under a switched-off parent has no effect: show that */
ul.tree-toggles li:has(> .row input:not(:checked)) > ul { opacity: .4; }

/* review, grouped like the node */
.rv-section { margin: var(--s7) 0; scroll-margin-top: 4.5rem; }
.rv-head { display: flex; align-items: baseline; gap: var(--s4); border-bottom: 1px solid var(--line); margin-bottom: var(--s4); }
.rv-head h2 { margin: 0 0 var(--s2); }
.rv-head form { margin-left: auto; }
.rv-sub { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin: var(--s5) 0 var(--s3); }
.rv-step { margin: var(--s4) 0; }
.rv-step h4 { display: flex; align-items: center; gap: var(--s3); font-size: .95rem; text-transform: none; letter-spacing: 0; color: var(--fg); margin: 0 0 var(--s2); }
.rv-step.empty h4 { color: var(--faint); font-weight: 500; }
.rv-step h4 .add { margin-left: auto; }
a.add { font-size: .82rem; font-weight: 500; text-decoration: none; color: var(--accent); }
a.add:hover { text-decoration: underline; }
.add-links { display: flex; gap: var(--s5); margin: var(--s3) 0 0; }
table.review td.id { width: 6.5rem; }
table.review td.origin { width: 8rem; }
table.review td.status { width: 5.5rem; }
.meta-line { display: flex; gap: var(--s2); font-size: .75rem; color: var(--faint); }
.meta-line:empty { display: none; }
.inline-form { display: flex; gap: var(--s3); max-width: 36rem; }
.inline-form input { flex: 1; font: inherit; font-size: .95rem; padding: var(--s2) var(--s3); border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--fg); }

.rv-step h4 .count { margin-left: 0; }
form.edit div:has(> input[type=checkbox]) { display: flex; flex-direction: row-reverse; justify-content: flex-end;
  align-items: center; gap: var(--s2); }
form.edit div:has(> input[type=checkbox]) label { margin: 0; color: var(--fg); font-size: .95rem; }
form.edit fieldset { border: 0; padding: 0; margin: 0; }
form.edit legend { font-size: .85rem; color: var(--muted); margin-bottom: var(--s1); padding: 0; }

/* structured explanations (prose filter) */
.prose ul { margin: var(--s1) 0 var(--s3); padding-left: 1.25rem; }
.prose li { margin: var(--s1) 0; padding-left: var(--s1); }
.prose li::marker { color: var(--faint); }
.prose strong { font-weight: 650; color: var(--fg); }
.prose .example { border-left: 2px solid var(--accent-soft); padding-left: var(--s3); margin-left: 1px; }
.prose.compact ul { margin: 0 0 var(--s2); }
@media print { .prose .example { border-left-color: #ccc; } }

/* review: select several pieces */
table.review td.sel { width: 2rem; padding-right: 0; }
td.sel input, .select-all input { accent-color: var(--accent); width: 1rem; height: 1rem; cursor: pointer; }
.select-all { display: inline-flex; margin-right: var(--s3); vertical-align: middle; }
.rv-sub .select-all { margin-right: var(--s2); }
.bulk-bar { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; gap: var(--s3);
  margin: var(--s6) 0 0; padding: var(--s3) var(--s4); background: var(--surface); border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -1px 0 var(--line), 0 -6px 18px rgba(0,0,0,.06); }
.bulk-bar .bulk-count { margin-right: auto; color: var(--muted); font-size: .9rem; }
.bulk-bar:not(.active) button[name=status] { opacity: .45; pointer-events: none; }
.bulk-bar.active .bulk-count { color: var(--fg); font-weight: 600; }

.packs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: var(--s4) 0; }
.packs .k { margin-right: var(--s2); }
button.pack { display: inline-flex; align-items: baseline; gap: var(--s2); border-radius: 8px; padding: var(--s1) var(--s3); }
button.pack span { color: var(--muted); font-size: .8rem; }
button.pack.on { background: var(--accent-soft); border-color: var(--accent); }

/* prepare: single exercises, students */
.pack li.item { position: relative; }
.pack li.item > .tick { position: absolute; left: -3.2rem; top: .55rem; }
.pack li.item.is-off { opacity: .4; list-style: none; }
.pack li.item.is-off .write { display: none; }
.seen { font-size: .7rem; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 0 var(--s2); margin-right: var(--s2); vertical-align: middle; }
.for-student { border-bottom: 1px solid var(--line); padding-bottom: var(--s3); margin-bottom: var(--s3); }
.for-student label { display: flex; gap: var(--s2); align-items: center; }
.for-student select { font: inherit; padding: 1px var(--s1); border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); flex: 1; }
.for-student .outline-actions { margin: var(--s3) 0 0; }
.for-student form { display: inline; }
@media print { .pack li.item.is-off { display: none !important; } }

/* lessons */
.eyebrow-line { color: var(--muted); font-size: .9rem; margin-bottom: var(--s1); }
.lesson-actions { display: flex; gap: var(--s3); margin-top: var(--s3); }
.recorder { margin-top: var(--s3); padding: var(--s3); background: var(--surface); border-radius: 8px; box-shadow: 0 0 0 1px var(--line); }
.recorder .results { display: flex; gap: var(--s2); align-items: center; }
.recorder button.result.on.right { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.recorder button.result.on.partly { background: var(--draft-soft); border-color: var(--draft); color: var(--draft); }
.recorder button.result.on.wrong { background: #f9e6e2; border-color: var(--wrong); color: var(--wrong); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .recorder button.result.on.wrong { background: #3a201c; } }
:root[data-theme="dark"] .recorder button.result.on.wrong { background: #3a201c; }
.recorder .saved { font-size: .75rem; color: var(--faint); margin-left: auto; }
.pattern-ticks { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); margin-top: var(--s2); font-size: .82rem; color: var(--muted); }
.pattern-ticks label { display: inline-flex; gap: var(--s1); align-items: center; cursor: pointer; }
.pattern-ticks .known { color: var(--fg); font-weight: 500; }
.pattern-ticks .known::after { content: "•"; color: var(--wrong); margin-left: 2px; }
.rec-error { color: var(--wrong); font-size: .85rem; margin: var(--s2) 0 0; }
.progress-row { display: grid; grid-template-columns: minmax(0, 1fr) 8rem 3rem auto; gap: var(--s3); align-items: center; padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.bar { height: .5rem; background: var(--note-soft); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }
.pct { font-variant-numeric: tabular-nums; text-align: right; }
ul.mistakes { list-style: none; padding: 0; }
ul.mistakes li { display: flex; justify-content: space-between; padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
/* an unticked exercise keeps its tick, so it can be switched back on in place */
.pack li.item.is-off > .tick { display: inline-flex !important; }

/* student access and answers */
.key-once { background: var(--ok-soft); border-radius: var(--radius); padding: var(--s4); margin-bottom: var(--s4); }
.key-once .key { font-size: 1.3rem; letter-spacing: .04em; user-select: all; background: var(--surface); padding: var(--s2) var(--s3); border-radius: 6px; display: inline-block; }
.answer-box .prompt { margin-bottom: var(--s2); }
.answer-box input[name=text], .answer-box input[name=why], .answer-box textarea {
  width: 100%; font: inherit; padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--fg); margin-top: var(--s1); }
.answer-box .gap { display: inline-block; min-width: 3.5rem; border-bottom: 2px solid var(--accent); text-align: center; color: var(--accent); font-weight: 600; margin: 0 var(--s1); }
.choices { display: flex; gap: var(--s2); flex-wrap: wrap; margin: var(--s2) 0; }
.choice { position: relative; }
.choice input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; }   /* anchored, or it pushes the page sideways */
.choice span { display: inline-block; padding: var(--s2) var(--s4); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; background: var(--surface); }
.choice input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.send-row { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s2); }
.sent { color: var(--ok); font-size: .85rem; }
.your { color: var(--muted); }
.verdict { font-weight: 600; }
.verdict.right { color: var(--ok); } .verdict.partly { color: var(--draft); } .verdict.wrong { color: var(--wrong); }
.live-answer:empty { display: none; }
.live-answer { margin-bottom: var(--s2); font-size: .95rem; }
.hint { font-size: .75rem; border-radius: 999px; padding: 0 var(--s2); margin-left: var(--s2); }
.hint.match { background: var(--ok-soft); color: var(--ok); }
.hint.differs { background: var(--draft-soft); color: var(--draft); }
.for-student.editing p { font-size: .88rem; margin-bottom: var(--s2); }
.pack .core-print > .part-head { margin-top: 0; }

/* Fill the lesson */
form.fill { border-bottom: 1px solid var(--line); padding-bottom: var(--s3); margin-bottom: var(--s3); }
.fill-title { font-weight: 650; margin: 0 0 var(--s2); }
form.fill fieldset { border: 0; padding: 0; margin: 0 0 var(--s3); }
form.fill legend { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 0; margin-bottom: var(--s1); }
form.fill label { padding: 1px 0; }
.pack-choices, .step-choices { display: flex; flex-wrap: wrap; gap: var(--s1); margin: var(--s1) 0 var(--s1) 1.4rem; }
label.chip { padding: 0; }
label.chip { position: relative; }
label.chip input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; }
label.chip span { display: inline-block; padding: 1px var(--s2); border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; cursor: pointer; }
label.chip span em { font-style: normal; color: var(--faint); margin-left: 2px; }
label.chip input:checked + span { background: var(--accent-soft); border-color: var(--accent); }
label.chip input:focus-visible + span { outline: 2px solid var(--accent); }
form.fill .per input { width: 3.5rem; font: inherit; padding: 1px var(--s1); border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--fg); }


/* Prepare: builder on screen, sheet on paper (and in preview) */
main.print-page { max-width: 58rem; }
@media screen {
  .sheet-wrap { display: none; }
  body.preview .sheet-wrap { display: block; margin-top: var(--s7); padding-top: var(--s5); border-top: 2px dashed var(--line); }
}
.builder-head h1 { margin-bottom: var(--s3); }
.builder-bar { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; }
.builder-bar form { display: inline; }
.builder-bar .who select { font: inherit; padding: var(--s1) var(--s2); border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); }
.bar-gap { flex: 1; }
.builder-opts { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); font-size: .85rem; color: var(--muted); margin: var(--s3) 0 var(--s4); }
.builder-opts select { font: inherit; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--fg); }
details.fill-all, details.panel { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); margin: var(--s3) 0; }
details.fill-all > summary, details.panel > summary { list-style: none; cursor: pointer; padding: var(--s3) var(--s4); display: flex; gap: var(--s3); align-items: baseline; }
details.fill-all > summary::-webkit-details-marker, details.panel > summary::-webkit-details-marker { display: none; }
details.fill-all > summary::before, details.panel > summary::before { content: "▸"; color: var(--faint); width: 1rem; }
details[open].fill-all > summary::before, details[open].panel > summary::before { content: "▾"; }
details.fill-all > summary { font-weight: 600; }
details.fill-all form.fill { padding: 0 var(--s4) var(--s4) calc(var(--s4) + 1.75rem); border: 0; margin: 0; }
form.fill fieldset { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); align-items: center; }
form.fill legend { width: 100%; }
.pack-choices { margin: 0; display: inline-flex; flex-wrap: wrap; gap: var(--s1); }
.actions-row { display: flex; gap: var(--s2); }
.panel-name { font-weight: 650; font-size: 1.05rem; }
.panel-sum { color: var(--muted); font-size: .88rem; }
.panel-body { padding: 0 var(--s4) var(--s4) calc(var(--s4) + 1.75rem); }
.panel-body .line { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: baseline; padding: var(--s2) 0; border-top: 1px solid var(--line); font-size: .92rem; }
.panel-body .line > .k { width: 6.5rem; flex: none; }
.versions { display: inline-flex; flex-wrap: wrap; gap: var(--s1) var(--s3); align-items: baseline; }
.versions label, .btype label { display: inline-flex; gap: var(--s1); align-items: baseline; cursor: pointer; }
.btypes { display: grid; gap: var(--s1); flex: 1; }
.btype { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); align-items: baseline; }
.btype .bname { min-width: 11rem; }

.repeats { font-size: .8rem; color: var(--draft); background: var(--draft-soft); border-radius: 6px; padding: var(--s1) var(--s2); margin: 0 0 var(--s2); }
.dup, .sim { font-size: .72rem; color: var(--draft); background: var(--draft-soft); border-radius: 999px; padding: 0 var(--s2); }
.src { font-size: .72rem; color: var(--faint); }
.counter { display: inline-flex; align-items: center; gap: var(--s2); }
.counter button { width: 1.9rem; height: 1.9rem; padding: 0; border-radius: 50%; font-size: 1rem; }
.counter strong { min-width: 1.4rem; text-align: center; font-size: 1.05rem; }
ul.ex-rows { list-style: none; margin: var(--s2) 0 0; padding: 0; }
.ex-row { display: grid; grid-template-columns: 1.6rem 1.7rem minmax(0, 1fr) auto; gap: var(--s2); align-items: baseline; padding: var(--s1) 0; font-size: .95rem; }
.ex-row .step-no { width: 1.4rem; height: 1.4rem; font-size: .7rem; }
.ex-row .tags { display: inline-flex; gap: var(--s1); align-items: baseline; }
.ex-row.is-off { display: none; }
.panel.show-pool .ex-row.is-off { display: grid; opacity: .5; }
.panel.show-pool .ex-row.is-off:hover { opacity: .85; }
.pool-toggle { margin-top: var(--s2); font-size: .82rem; }
@media (max-width: 40rem) {
  .panel-body, details.fill-all form.fill { padding-left: var(--s4); }
  .panel-body .line > .k { width: 100%; }
  .ex-row { grid-template-columns: 1.6rem 1.7rem minmax(0, 1fr); }
  .ex-row .tags { grid-column: 3; }
}

.sheet-actions { display: flex; gap: var(--s2); margin-bottom: var(--s5); }


/* Prepare: what is chosen shows its content */
.block-line { border-top: 1px solid var(--line); padding: var(--s2) 0; }
.block-line .line { border-top: 0; padding: var(--s1) 0; }
.chosen-text { margin: var(--s2) 0 var(--s2) 6.5rem; padding: var(--s3) var(--s4); background: var(--bg);
  border-radius: 8px; border-left: 3px solid var(--accent-soft); font-size: .9rem; max-height: 16rem; overflow: auto; }
.btypes { display: grid; gap: var(--s1); margin-left: 6.5rem; }
.btype-head { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); align-items: baseline; }
.btype:not(.is-on) .btype-head .versions { display: none; }
.btype:not(.is-on) .bname { color: var(--muted); }
.btype.is-on { padding: var(--s1) 0; }
.btype.is-on .bname { font-weight: 600; }
.btype .chosen-text { margin-left: 1.6rem; }
ol.check-list { margin: var(--s1) 0 var(--s2) 6.5rem; font-size: .9rem; padding-left: 1.4rem; }
ol.check-list .src { margin-left: var(--s2); }
@media (max-width: 40rem) {
  .chosen-text, .btypes, ol.check-list { margin-left: 0; }
}

/* branches and coverage */
ul.covs { list-style: none; padding: 0; margin: 0 0 var(--s3); }
ul.covs.nested { margin: var(--s1) 0 var(--s3) var(--s5); }
li.cov { padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.cov-head { display: flex; gap: var(--s3); align-items: baseline; flex-wrap: wrap; }
.cov-num { margin-left: auto; font-size: .88rem; }
.cov-pct { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 3rem; text-align: right; }
li.cov .bar { margin: var(--s1) 0; }
.branches-panel { margin-bottom: var(--s5); }

/* the tree as a graph */
.graph { position: relative; width: 100%; max-height: 70vh; overflow: auto; background: var(--surface); border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--line); }
.graph.small { max-height: 20rem; }
.graph svg { display: block; }
.graph-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin: 0 0 var(--s2); font-size: .85rem; }
.graph-bar .seg a { cursor: pointer; }
.g-link { fill: none; stroke: var(--faint); stroke-opacity: .55; stroke-width: 1.4; transition: opacity .15s; }
.g-link.related { stroke-dasharray: 4 4; }
.g-link.after { stroke-width: 1; }
.g-arrow { fill: var(--faint); }
.g-node { transition: opacity .15s; }
.g-node .g-back { fill: var(--surface); }
.g-node .g-fill { fill: var(--accent); opacity: .85; }
.g-node .g-ring { fill: none; stroke: var(--faint); stroke-width: 1.6; }
.g-node.visited .g-ring { stroke: var(--accent); stroke-width: 2; }
.g-node.current .g-ring { stroke: var(--accent); stroke-width: 3.5; }
.g-node.stub .g-ring { stroke-dasharray: 3 3; }
.g-node.link { cursor: pointer; }
.g-node.link:hover .g-ring, .g-node.link:focus .g-ring { stroke: var(--accent); stroke-width: 3; }
.g-node:focus { outline: none; }
.g-label { font-size: 13px; fill: var(--muted); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.graph.small .g-label { font-size: 10px; }
.g-node.current .g-label, .g-node.visited .g-label { fill: var(--fg); font-weight: 600; }
.graph:has(.g-node.visited) .g-node:not(.visited):not(.current) { opacity: .55; }
svg.focus .g-node:not(.near), svg.focus .g-link:not(.near) { opacity: .15; }
svg.focus .g-link.near { stroke: var(--accent); }
details.list-view { margin-top: var(--s5); }
details.list-view > summary { cursor: pointer; color: var(--muted); }
details.mini-tree { margin: var(--s3) 0; }
details.mini-tree > summary { cursor: pointer; color: var(--muted); font-size: .88rem; margin-bottom: var(--s2); }

/* lesson lists */
ul.lesson-list { list-style: none; padding: 0; margin: 0; }
.lesson-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); background: var(--surface);
  border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); margin-bottom: var(--s2); }
.lr-main { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0 var(--s3); flex: 1; text-decoration: none; color: var(--fg); min-width: 0; }
.lr-date { color: var(--muted); font-size: .88rem; grid-row: span 2; align-self: center; }
.lr-node { font-weight: 600; }
.lr-meta { color: var(--muted); font-size: .82rem; }
.lr-main:hover .lr-node { color: var(--accent); }
.lr-actions { display: flex; gap: var(--s2); align-items: center; }
/* Card sets have no date column: title and count stacked, full width. */
.card-sets .lr-main { display: flex; flex-direction: column; gap: 2px; }
.card-sets .lesson-row { flex-wrap: nowrap; }
@media (max-width: 40rem) {
  .lesson-row { flex-wrap: wrap; }
  .graph { max-height: 60vh; }
}

/* narrow screens: bars and link rows wrap instead of widening the page */
.bulk-bar, nav.jump, .builder-bar, .lesson-actions, .sheet-actions, .add-links { flex-wrap: wrap; }
@media (max-width: 40rem) {
  .bulk-bar .bulk-count { width: 100%; }
  nav.jump { gap: var(--s2) var(--s4); }
}

/* students: check a part */
.check-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin: var(--s3) 0 var(--s5) 1.8rem; }
.check-sum strong { color: var(--fg); }
.check-sum { color: var(--muted); font-size: .9rem; }
.verdict-slot { display: inline; }
.mark { font-size: .82rem; font-weight: 600; border-radius: 999px; padding: 1px var(--s2); }
.mark.right { color: var(--ok); background: var(--ok-soft); }
.mark.wrong { color: var(--wrong); background: var(--draft-soft); }
.mark.open { color: var(--muted); background: var(--note-soft); font-weight: 500; }
.check-row button:disabled { opacity: .45; cursor: default; }
.check-wait { color: var(--faint); font-size: .85rem; }
.check-wait:empty { display: none; }

/* Student lesson page. Three levels and no more: the page heading
   (Explanation, Exercises), a card per section or part with its heading in
   a tinted bar, and the exercises inside. Input and Send share one line.
   Inputs keep at least 16px text, or phones zoom in when they get focus. */
main.me .me-head { margin-bottom: var(--s5); }
main.me .me-card { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line);
  padding: 0 var(--s5) var(--s4); margin-bottom: var(--s5); overflow: clip; }
/* clip, not hidden (2026-11-28): hidden makes each card a scroll box, and the
   word pool (position: sticky) then stayed inside its card instead of
   following the screen on the student's page. clip cuts the corners the same. */
main.me .me-card > .prose:first-child { padding-top: var(--s4); }
main.me .me-card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3);
  margin: 0 calc(-1 * var(--s5)) var(--s4); padding: var(--s3) var(--s5);
  background: var(--accent-soft); border-bottom: 1px solid var(--line); }
main.me .me-card-head h2 { margin: 0; font-size: 1.3rem; flex: 1 1 auto; }
main.me .me-card { margin-bottom: var(--s6); }
main.watching { margin-left: auto; margin-right: auto; box-shadow: 0 0 0 1px var(--line); }
/* a kind of exercise inside a section: a sub-heading, then the items */
main.me .me-sub { margin-top: var(--s5); padding-top: var(--s3); border-top: 1px solid var(--line); }
main.me .me-card-head + .me-sub { margin-top: 0; padding-top: 0; border-top: 0; }
main.me .me-sub-head { font-size: 1rem; font-weight: 650; margin: 0 0 var(--s1); color: var(--accent); }
main.me .part-sec { color: var(--muted); font-size: .85rem; }
main.me .run-instr { font-weight: 650; margin: var(--s4) 0 0; }
main.me ol.items { padding-left: 1.6rem; }
main.me ol.items > li { padding: var(--s3) 0 var(--s3) var(--s1); }
main.me .answer-box .prompt { margin-bottom: var(--s2); }
main.me .choices { gap: var(--s1); margin: 0 0 var(--s2); }
main.me .choice span { padding: 1px var(--s3); font-size: .92rem; }
main.me .answer-box .gap { min-width: 2.5rem; }
main.me .answer-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
main.me .answer-row input[name], main.me .answer-row textarea {
  flex: 1 1 8rem; min-width: 0; width: auto; margin: 0; font-size: .92rem; padding: var(--s1) var(--s2); }
main.me .answer-row.long textarea { flex-basis: 100%; }
main.me .answer-row button { padding: var(--s1) var(--s4); }
main.me .verdict-slot:empty { display: none; }
main.me .answer-row .sent { font-weight: 700; }
main.me details.reveal > summary { display: inline-block; }
main.me .check-row { margin: var(--s2) 0 0; padding-top: var(--s3); border-top: 1px solid var(--line); }
/* extra explanation blocks: quiet rows inside the section's card */
main.me .me-more { margin-top: var(--s4); border-top: 1px solid var(--line); }
main.me details.me-block { border-bottom: 1px solid var(--line); }
main.me details.me-block:last-child { border-bottom: 0; }
main.me details.me-block > summary { list-style: none; cursor: pointer; padding: var(--s2) 0; font-weight: 600;
  font-size: .95rem; color: var(--accent); }
main.me details.me-block > summary::-webkit-details-marker { display: none; }
main.me details.me-block > summary::before { content: "+"; display: inline-block; width: 1.2rem; color: var(--faint); }
main.me details.me-block[open] > summary::before { content: "–"; }
main.me details.me-block > .prose { padding: 0 0 var(--s3) 1.2rem; }
main.me details.me-block > details.reveal { margin: 0 0 var(--s3) 1.2rem; }

/* fieldset that only groups (the student preview disables a whole answer box with it) */
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain:disabled .choice span, fieldset.plain:disabled input, fieldset.plain:disabled button { cursor: default; }
.preview-note { background: var(--accent-soft); border-radius: var(--radius); padding: var(--s2) var(--s4); font-size: .9rem; margin: var(--s4) 0; }

/* Review: generate more exercises for a section */
.grow-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: 0 0 var(--s3);
  padding: var(--s2) var(--s3); background: var(--note-soft); border-radius: 8px; font-size: .9rem; }
.grow-form .k { font-weight: 600; }
.grow-form select, .grow-form input[type=number] { font: inherit; padding: 2px var(--s1); max-width: 100%; }
.grow-form input[type=number] { width: 4rem; }
.grow-busy { display: none; color: var(--muted); }
.grow-busy.htmx-request { display: inline; }
.grow-out { flex-basis: 100%; }
.grow-out:empty { display: none; }

/* Student page: mixed practice */
.mix-form fieldset { border: 0; padding: 0; margin: 0 0 var(--s3); display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); }
.mix-form legend { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: var(--s1); }
.mix-form label { font-size: .92rem; }
.mix-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); }
.mix-row input[type=number] { width: 4.5rem; font: inherit; }

/* Review: flags, "Flagged only", keyboard */
ul.flags { list-style: none; padding: 0; margin: 0 0 var(--s1); display: flex; flex-wrap: wrap; gap: var(--s1); }
ul.flags li { font-size: .75rem; color: var(--draft); background: var(--draft-soft); border-radius: 999px; padding: 0 var(--s2); }
.review-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); font-size: .85rem; color: var(--muted); }
.review-tools button[aria-pressed="true"] { background: var(--draft-soft); border-color: var(--draft); }
kbd { font-family: var(--mono); font-size: .8em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--surface); }
body.only-flagged tr[id^=piece-]:not(.flagged) { display: none; }
body.only-flagged .rv-step:not(:has(tr.flagged)) { display: none; }
tr.is-current { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Prepare: one counter per step inside a section */
.step-counters { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: var(--s1) var(--s4); margin: var(--s2) 0 var(--s3); }
.step-counter { display: flex; align-items: center; gap: var(--s2); font-size: .88rem; }
.step-counter .step-label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-counter [data-step-of] { white-space: nowrap; min-width: 2.6rem; }
.step-counter.is-empty .step-label { color: var(--muted); }
.counter.small button { width: 1.6rem; height: 1.6rem; font-size: .9rem; }
.counter.small strong { min-width: 1.1rem; font-size: .95rem; }

/* Review: compact rows, click to select, sticky step headings */
table.review td { padding: var(--s2) var(--s3); }
table.review td.actions { width: 9rem; white-space: nowrap; }
table.review td.actions > * { display: inline-block; width: auto; margin: 0 var(--s1) var(--s1) 0; }
table.review td.actions button.primary { padding: 3px var(--s3); font-size: .8rem; }
.row-link { background: none; border: 0; padding: 0; font: inherit; font-size: .8rem; color: var(--muted); text-decoration: underline; text-underline-offset: .15em; cursor: pointer; }
.row-link.danger { color: var(--wrong); }
tr[id^=piece-]:has(input.pick) { cursor: pointer; }
tr.is-picked td { background: var(--accent-soft); }
.rv-step h4 { position: sticky; top: calc(var(--nav-h, 3.4rem) + 4px); z-index: 1; background: var(--bg); padding: var(--s2) 0; }
.rv-step h4 .step-sec { color: var(--faint); font-weight: 500; font-size: .8rem; }
.bulk-select { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s1); color: var(--muted); font-size: .85rem; }
.bulk-select button { font-size: .8rem; padding: 3px var(--s3); }      /* the small size */
.lv { font-size: .7rem; font-weight: 600; color: var(--faint); border: 1px solid var(--line); border-radius: 4px; padding: 0 3px; vertical-align: 1px; }

/* Annotation (annotate.js): a layer over the page and a toolbar in the corner */
body.has-annot { position: relative; }
.annot-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.annot-layer.active { pointer-events: auto; }
.annot-layer[data-tool="pen"], .annot-layer[data-tool="laser"] { cursor: crosshair; }
.annot-layer[data-tool="text"] { cursor: text; }
.annot-layer[data-tool="eraser"] { cursor: cell; }
.annot-layer svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.annot-layer path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.annot-layer[data-tool="eraser"] path { cursor: pointer; }
.annot-live { stroke-opacity: .85; }
.annot-laser { --laser: #ff3b30; stroke: var(--laser); stroke-width: 7; stroke-opacity: .7; filter: drop-shadow(0 0 4px var(--laser)); }
.annot-note, .annot-input { position: absolute; font: 650 1rem/1.3 var(--font); max-width: 22rem; white-space: pre-wrap;
  padding: 0 2px; transform: translate(-2px, -50%); }
/* a note is text in its colour, with a halo of the page's background so it reads on anything */
.annot-note { background: transparent; text-shadow: 0 0 3px var(--bg), 0 0 3px var(--bg), 0 0 6px var(--bg); }
.annot-layer[data-tool="text"] .annot-note { cursor: text; outline: 1px dashed currentColor; outline-offset: 2px; }
.annot-input { background: var(--surface); color: var(--fg); border: 2px solid var(--accent); border-radius: 6px; padding: 2px 8px; min-width: 12rem; }
.annot-layer g rect { fill-opacity: .35; }
.annot-layer[data-tool="eraser"] rect, .annot-layer[data-tool="eraser"] .annot-note { cursor: pointer; }
.annot-input { border-color: var(--accent); min-width: 10rem; }
.annot-bar { position: fixed; left: 16px; bottom: 16px; z-index: 6; display: flex; align-items: center; gap: var(--s2);
  background: var(--surface); border-radius: 999px; box-shadow: 0 2px 10px rgba(0,0,0,.18), 0 0 0 1px var(--line); padding: 4px; }
.annot-tools { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; padding-right: 6px; }
.annot-tools[hidden] { display: none; }
.annot-bar button { padding: 5px 11px; font-size: .85rem; cursor: pointer; }
.annot-bar button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.annot-bar button:disabled { opacity: .35; cursor: default; }
.annot-bar button.on:hover { color: var(--surface); }
.annot-bar button.on { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.annot-open { width: 2.4rem; height: 2.4rem; padding: 0 !important; border-radius: 50%; font-size: 1.1rem !important; }
.annot-colors { position: relative; display: inline-flex; margin: 0 2px; }
.annot-palette { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); display: flex; gap: 4px;
  background: var(--surface); border-radius: 999px; padding: 4px; box-shadow: 0 2px 10px rgba(0,0,0,.2), 0 0 0 1px var(--line); }
.annot-swatch { width: 1.3rem; height: 1.3rem; padding: 0 !important; border-radius: 50%; background: var(--c); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.annot-palette button { width: 1.25rem; height: 1.25rem; padding: 0 !important; border-radius: 50%; background: var(--c); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.annot-palette button.on { box-shadow: 0 0 0 2px var(--fg); background: var(--c); }
.annot-palette button:hover, .annot-swatch:hover { transform: scale(1.15); }
@media print { .annot-bar { display: none; } }
.annot-saved { font-size: .75rem; color: var(--muted); padding: 0 4px; }
.annot-saved.bad { color: var(--wrong); font-weight: 600; }
.me-actions { margin: 0 0 var(--s4); }
@media print {
  .no-print, nav.top { display: none !important; }
  .annot-layer { display: block; }
  main.me .me-card { break-inside: avoid-page; box-shadow: none; border: 1px solid #ccc; }
}

/* Live lesson: who else is here */
.presence { display: inline-block; white-space: nowrap; font-size: .75rem; color: var(--muted); background: var(--note-soft); border-radius: 999px; padding: 1px var(--s2); margin-left: var(--s2); }
.presence.here { color: var(--ok); background: var(--ok-soft); font-weight: 600; }
.presence.here::before { content: "● "; }
.teacher-here { position: fixed; top: 3.9rem; right: var(--s3); white-space: nowrap; z-index: 7; margin: 0;
  background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok); border-radius: 999px; padding: 2px var(--s3); font-size: .85rem; font-weight: 600; }
.teacher-here::before { content: "● "; }
@media print { .teacher-here, .presence { display: none !important; } }

/* Watch page: where the student is */
.watch-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.watch-band { position: absolute; border: 2px solid var(--accent); border-radius: 10px; background: color-mix(in srgb, var(--accent) 6%, transparent); transition: top .15s, height .15s; }
.watch-dot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px rgba(255,149,0,.3); transition: left .06s linear, top .06s linear; }
.answer-box.is-focus { outline: 2px solid var(--live); outline-offset: 4px; border-radius: 6px; }
.answer-box.is-typing input, .answer-box.is-typing textarea { background: var(--live-soft); color: var(--fg); }
.watch-key { white-space: nowrap; }
.wk-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--live); vertical-align: middle; }
.wk-band { display: inline-block; width: 16px; height: 10px; border: 2px solid var(--accent); border-radius: 3px; vertical-align: middle; margin-left: var(--s2); }

/* Taking over: the teacher's controls on Watch, what the student sees */
.live-panel { position: fixed; right: 16px; bottom: 16px; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s3);
  max-width: calc(100vw - 32px); background: var(--surface); border-radius: 999px; box-shadow: 0 2px 10px rgba(0,0,0,.18), 0 0 0 1px var(--line);
  padding: 4px var(--s3) 4px 4px; font-size: .85rem; }
.live-panel label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; cursor: pointer; }
.live-panel button { padding: 5px 12px; font-size: .85rem; }
.their-open { flex-basis: 100%; display: grid; gap: 4px; padding-bottom: var(--s2); border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.their-open[hidden] { display: none; }
.live-panel:has(.their-open:not([hidden])) { border-radius: 14px; padding: var(--s2) var(--s3); }   /* a box, not a pill, while it lists things */
.their-open-head { margin: 0; font-size: .75rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.their-open-row { display: flex; align-items: center; gap: var(--s2); font-size: .85rem; }
.their-open-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16rem; }
.live-panel .their-open-row button { padding: 2px 9px; font-size: .8rem; }
.answer-box { position: relative; }
.show-btn { position: absolute; right: 0; top: -2px; padding: 1px var(--s2) !important; font-size: .72rem !important; opacity: .55; }
.show-btn:hover { opacity: 1; }
.answer-box.by-you .answer-row::after { content: "entered by you"; font-size: .75rem; color: var(--muted); }
.by-teacher { font-size: .75rem; color: var(--muted); font-style: italic; }
.answer-box.teacher-typing input, .answer-box.teacher-typing textarea { background: var(--live-soft); color: var(--fg); outline: 2px dashed var(--live); }
.answer-box.teacher-typing::before { content: "your teacher is typing"; position: absolute; right: 0; top: -1.1rem; font-size: .72rem; color: var(--live-fg); }
li.teacher-shows { animation: teacher-shows 2.2s ease-out; border-radius: 8px; }
@keyframes teacher-shows { 0%, 40% { box-shadow: 0 0 0 4px var(--live); background: var(--live-soft); } 100% { box-shadow: 0 0 0 4px transparent; background: transparent; } }
.teacher-toast { position: fixed; bottom: 4.2rem; left: 50%; transform: translateX(-50%); z-index: 7; margin: 0; max-width: calc(100vw - 32px); width: max-content; text-align: center;
  background: var(--fg); color: var(--bg); border-radius: 999px; padding: var(--s1) var(--s4); font-size: .85rem; }
@media print { .show-btn, .teacher-toast { display: none !important; } }

.theme-toggle { font-size: 1rem !important; padding: 2px var(--s2) !important; }
.theme-corner { position: fixed; top: var(--s3); right: var(--s3); }

/* Edge arrows: to the student's screen (Watch), to the exercise the teacher guides to (student) */
.edge-arrow { position: fixed; left: 50%; transform: translateX(-50%); z-index: 8; white-space: nowrap;
  background: var(--accent); color: var(--surface); border: 0; border-radius: 999px; padding: var(--s1) var(--s4) !important;
  font-size: .88rem !important; font-weight: 650; box-shadow: 0 3px 12px rgba(0,0,0,.25); cursor: pointer; }
.edge-arrow[data-edge="top"] { top: 4.2rem; }
.edge-arrow[data-edge="bottom"] { bottom: var(--s5); }
body:has(.live-panel) .edge-arrow[data-edge="bottom"] { bottom: calc(var(--panel-h, 44px) + 28px); }   /* above Watch's live panel (live-teacher.js sets its height) */
.edge-arrow.guide-arrow { background: var(--live); color: #1e1e1e; animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(-50%) scale(1.06); } }
li.guide-target { box-shadow: 0 0 0 3px var(--live); border-radius: 8px; }
.show-btn.guide-btn { right: 3.6rem; }
@media print { .edge-arrow { display: none !important; } }

/* Student's page: where the teacher is working (an arrow, only while they act) */
.edge-arrow.teacher-arrow { background: var(--accent); }

/* Student's page: "come here" from the teacher, the student decides */
.invite-card { position: fixed; left: 50%; bottom: 4.2rem; transform: translateX(-50%); z-index: 9; width: min(22rem, calc(100vw - 32px));
  background: var(--surface); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.25), 0 0 0 2px var(--accent); padding: var(--s3) var(--s4); text-align: center; }
.invite-card p { margin: 0 0 var(--s2); font-weight: 600; }
@media print { .live-panel, .invite-card { display: none !important; } }
.annot-keys { position: absolute; left: 0; bottom: calc(100% + 8px); width: 17rem; background: var(--surface); border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,.2), 0 0 0 1px var(--line); padding: var(--s3); font-size: .85rem; }
.annot-keys ul { list-style: none; margin: var(--s2) 0; padding: 0; display: grid; gap: 2px; }
.annot-keys li button { width: 100%; display: flex; justify-content: space-between; border-radius: 6px !important; padding: 3px 8px !important; }
.annot-keys li button.waiting { border-color: var(--accent); background: var(--accent-soft); }
.annot-keys-msg:empty { display: none; }
.annot-keys-msg { color: var(--accent); margin: 0 0 var(--s2); }
/* an exercise's own context ("Past", "We booked a table"): beside it, not a heading */
.context { font-size: .82rem; font-style: italic; color: var(--muted); margin: 0 0 2px; }

/* "I need help": the student's button, the teacher's cards */
.help-stack { position: fixed; top: 4.2rem; right: 16px; z-index: 9; display: grid; gap: var(--s2); width: min(20rem, calc(100vw - 32px)); }
.help-card { background: var(--surface); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,.2), 0 0 0 2px var(--live); padding: var(--s2) var(--s3); font-size: .88rem; }
.help-card p { margin: 0 0 var(--s2); font-weight: 600; }
.help-card button { padding: 3px var(--s3); font-size: .82rem; margin-right: var(--s1); }
li.needs-help { box-shadow: 0 0 0 3px var(--live); border-radius: 8px; }
@media print { .help-float, .help-stack { display: none !important; } }
.help-float, .word-float, .share-float { display: flex; flex-direction: column; align-items: flex-end; gap: var(--s2); }
.help-open { border-radius: 999px; padding: var(--s2) var(--s4) !important; font-weight: 650; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.help-open.asked { background: var(--live-soft); border-color: var(--live); color: var(--live-fg); }
.help-panel { width: min(19rem, calc(100vw - 32px)); background: var(--surface); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.25), 0 0 0 1px var(--line); padding: var(--s3); font-size: .9rem; }
.help-title { font-weight: 650; margin: 0 0 var(--s2); }
.help-where { display: grid; gap: 2px; margin-bottom: var(--s2); }
.help-panel textarea { width: 100%; font: inherit; font-size: .92rem; border: 1px solid var(--line); border-radius: 8px; padding: var(--s1) var(--s2); background: var(--surface); color: var(--fg); }
.help-actions { margin: var(--s2) 0 0; }
.help-status:empty { display: none; }
.help-status { margin: var(--s1) 0 0; color: var(--accent); }
.help-note { font-weight: 400 !important; font-style: italic; }
body.help-picking li:has(.answer-box) { cursor: pointer; outline: 2px dashed var(--live); outline-offset: 4px; border-radius: 6px; }
li.help-picked { box-shadow: 0 0 0 3px var(--live); border-radius: 8px; }

/* Focused review: one step's drafts as large cards */
.focus-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-top: var(--s3); }
.focus-cards { display: grid; gap: var(--s3); margin: var(--s4) 0; }
.focus-card { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); padding: var(--s3) var(--s4); }
.focus-card.is-current { box-shadow: 0 0 0 2px var(--accent); }
.focus-card.flagged.status-draft { box-shadow: 0 0 0 1px var(--draft); }
.focus-card.flagged.status-draft.is-current { box-shadow: 0 0 0 2px var(--draft); }
.focus-prompt { font-size: 1.15rem; margin: 0 0 var(--s2); }
.focus-answer { font-weight: 600; margin: 0 0 var(--s1); }
.focus-why { color: var(--muted); font-size: .9rem; margin: 0 0 var(--s1); }
.focus-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s2); }
.focus-done { margin: 0; color: var(--muted); display: flex; align-items: center; gap: var(--s2); font-size: .9rem; }
.focus-done span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.focus-card.status-approved { padding: var(--s2) var(--s4); box-shadow: none; background: var(--ok-soft); }
.focus-rest { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin: var(--s5) 0; }
.focus-nav .keys, .focus-actions .small { font-size: .8rem; }

/* Vocabulary bank */
.word-add { position: absolute; z-index: 9; padding: 3px var(--s3) !important; font-size: .82rem !important; font-weight: 650;
  background: var(--accent); color: var(--surface); border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.words-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-top: var(--s3); }
.words-actions input { font: inherit; padding: 4px var(--s2); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--fg); }
.word-list { list-style: none; padding: 0; margin: var(--s4) 0; display: grid; gap: var(--s2); }
.word { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); padding: var(--s2) var(--s3); }
.word.unchecked { box-shadow: 0 0 0 1px var(--draft); }
.word p { margin: 0; }
.word-form { display: grid; grid-template-columns: minmax(5rem, 8rem) 1fr 1.2fr 1.4fr auto; gap: var(--s2); align-items: center; }
.word-form input { font: inherit; font-size: .9rem; padding: 3px var(--s2); border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--fg); min-width: 0; }
.word-text { font-weight: 650; }
.word-meta { font-size: .8rem; color: var(--muted); margin-top: 2px !important; }
.word-remove { margin-top: 2px; }
@media (max-width: 40rem) { .word-form { grid-template-columns: 1fr; } }

/* Reading lessons: the making form */
.reading-form { display: grid; gap: var(--s3); }
.rf-row { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: flex-end; }
.rf-row label { display: grid; gap: 2px; font-size: .85rem; color: var(--muted); }
.rf-row label.grow { flex: 1 1 16rem; }
.rf-row select, .rf-row input { font: inherit; font-size: .95rem; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px var(--s2); }
.rf-cats { display: flex; flex-wrap: wrap; gap: var(--s1); }
.rf-cats legend { font-size: .85rem; color: var(--muted); margin-bottom: var(--s1); }
.rf-topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--s3); background: var(--note-soft); border-radius: var(--radius); padding: var(--s3); }
.rf-topics fieldset { display: grid; gap: 2px; font-size: .92rem; }
.rf-topics legend { font-weight: 650; }
.rf-own { display: block; margin-top: var(--s2); }
.rf-own input { width: min(100%, 32rem); }
.here-now { display: inline-flex; align-items: center; gap: var(--s2); margin-left: var(--s3); color: var(--ok, #23854a); font-size: 0.9rem; }
.here-now::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: currentColor; }
/* Simulations: the tutor's lines (blue) and the student's turns (green), as in the scripted PDFs. */
.tutor-line { background: var(--tutor-bg, #e8eff6); border-left: 3px solid var(--tutor-edge, #4a7bb0); padding: var(--s2) var(--s3); margin: 0 0 var(--s2); border-radius: 4px; }
.tutor-line .role { display: block; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--tutor-edge, #4a7bb0); }
.tutor-line p { margin: 0.15rem 0 0; }
.your-turn-label { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ok, #23854a); margin: var(--s2) 0 0.15rem; }
.table-wrap { overflow-x: auto; margin: var(--s2) 0 var(--s3); }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.table-wrap th, .table-wrap td { border: 1px solid var(--line, #d5dde0); padding: 0.35rem 0.6rem; text-align: left; vertical-align: top; }
.table-wrap th { background: var(--accent-soft, #e6f0f0); font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --tutor-bg: #1d2a38; --tutor-edge: #7fa9d6; } }
:root[data-theme="dark"] { --tutor-bg: #1d2a38; --tutor-edge: #7fa9d6; }
.sim-plan { display: block; }
.sim-plan textarea { display: block; width: 100%; margin-top: var(--s2); font-family: ui-monospace, "DejaVu Sans Mono", monospace; font-size: 0.9rem; line-height: 1.45; }
/* The teaching page (Watch): the student's page at their width on the left, the teacher's notes,
   answers and result buttons in the margin beside each part, so the student's layout (and with it
   marks, laser, Follow me and Come here) is the same on both screens. When the margin is too narrow
   (live-teacher.js sets body.notes-inline), they sit under each part instead. */
/* Centred on the screen; moved left only as far as the margin column (25rem) needs. --lw is the
   student's width (live-teacher.js), 44rem until they report it. */
main.watching.teaching { --lw: 44rem; overflow: visible; margin-right: auto;
  margin-left: max(var(--s4), min(calc((100vw - var(--lw)) / 2), calc(100vw - var(--lw) - 25rem - var(--s4)))); }
.teaching .me-card, .teaching ol.items > li { position: relative; }
.teaching .t-extra { position: absolute; left: calc(100% + 32px); top: 0; width: 440px; font-size: 0.9rem; }
.teaching .t-core { left: calc(100% + 8px); top: var(--s3); }
.teaching .t-extra:hover, .teaching .t-extra:focus-within { z-index: 6; }
.teaching .t-extra .panel { background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 4px 14px rgb(0 0 0 / 0.08); }
body.notes-inline .teaching .t-extra { position: static; width: auto; margin-top: var(--s2); }
body.notes-inline main.watching.teaching { margin-left: auto; }
.teaching.me .me-card { overflow: visible; }
.teaching.me .me-card-head { border-radius: var(--radius) var(--radius) 0 0; }
.choices.stacked { flex-direction: column; align-items: flex-start; }
.chip.cooling > span:first-of-type { opacity: 0.65; }
.chip .cool { margin-left: 0.35rem; font-size: 0.72rem; color: var(--draft); background: var(--draft-soft); border-radius: 999px; padding: 0 0.4rem; }
.recent-panel { margin: var(--s3) 0; }
table.recent { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
table.recent th, table.recent td { text-align: left; padding: 0.25rem 0.5rem; border-bottom: 1px solid var(--line); }
table.recent tr.cooling td:first-child { color: var(--draft); }
/* My journey: one card of overall numbers, then a card per part (same look as lesson sections). */
.journey { margin: var(--s3) 0 var(--s5); }
.j-overall { display: flex; flex-wrap: wrap; background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line);
  margin-bottom: var(--s4); }
.j-stat { flex: 1 1 7rem; padding: var(--s3) var(--s4); border-right: 1px solid var(--line); }
.j-stat:last-child { border-right: 0; }
.j-stat strong { display: block; font-size: 1.35rem; line-height: 1.2; }
.j-stat span { color: var(--muted); font-size: .82rem; }
.j-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: var(--s4); }
.j-card { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.j-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4);
  background: var(--accent-soft); border-bottom: 1px solid var(--line); }
.j-head h3 { margin: 0; font-size: 1.05rem; }
.j-head span { color: var(--muted); font-size: .82rem; }
.j-rows { list-style: none; padding: 0 var(--s4); margin: 0; }
.j-rows li { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.j-rows li:last-child { border-bottom: 0; }
.j-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.j-label { font-weight: 600; }
.j-detail { color: var(--muted); font-size: .86rem; }
.j-meter { display: flex; align-items: center; gap: var(--s2); flex: 0 0 auto; }
.j-bar { width: 5rem; height: 0.45rem; background: var(--note-soft); border-radius: 999px; overflow: hidden; }
.j-bar span { display: block; height: 100%; background: var(--ok); }
.j-share { font-size: .82rem; min-width: 2.4rem; text-align: right; color: var(--muted); }

/* ---- Standards (UI pass 2026-11-21; docs/UI.md) --------------------------------------------------
   Buttons: one shape in two sizes (normal, .small) and three looks (default, .primary, .quiet), the
   same for <button> and <a class="button">. Section labels (h2.part) in the accent colour with a rule,
   so they stand out without competing with the page title. The top bar never wraps its main links. */
a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); }
a.button.quiet { background: transparent; border-color: var(--line); color: var(--fg); }
a.button.quiet:hover { color: var(--fg); border-color: var(--accent); }
button.small, a.button.small { font-size: .8rem; padding: 3px var(--s3); }
h2.part { color: var(--accent); font-size: .82rem; font-weight: 700; letter-spacing: .1em;
  border-top: 1px solid var(--line); padding-top: var(--s4); margin-top: var(--s6); }
nav.top > a, nav.top > .home { white-space: nowrap; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin: var(--s3) 0; }
.toolbar .seg a { color: var(--muted); text-decoration: none; }
.toolbar .seg a:hover { color: var(--fg); }
.grow-form select { max-width: 16rem; }
/* Segmented toggles look the same everywhere (top bar, toolbars, the tree's layout switch). */
.seg { font-size: .88rem; }
.seg a { color: var(--muted); text-decoration: none; }
.seg a:hover { color: var(--fg); }
/* The student's floating contents (toc.js): left of the page on wide windows, a button on narrow ones. */
.toc { position: fixed; z-index: 3; font-size: .88rem; }
.toc ol { list-style: none; margin: 0; padding: var(--s2); background: var(--surface); border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--line), 0 6px 20px rgb(0 0 0 / 0.06); max-height: 70vh; overflow-y: auto; }
.toc li { margin: 2px 0; }
.toc a { display: block; padding: 0.35rem 0.6rem; border-radius: 8px; color: var(--muted); text-decoration: none;
  transition: transform .15s, box-shadow .15s, background .15s; }
.toc a:hover { color: var(--fg); background: var(--note-soft); }
.toc a.current { color: var(--fg); font-weight: 600; background: var(--accent-soft); transform: translateX(4px);
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.10); }
.toc a.done::after { content: " ✓"; color: var(--ok); }
@media (min-width: 1120px) {
  .toc { top: 5.5rem; width: 14rem; left: max(var(--s4), calc(50% - 352px - 15rem)); }
  .toc-toggle { display: none; }
}
@media (max-width: 1119px) {
  .toc { top: calc(var(--nav-h, 3.6rem) + .6rem); right: var(--s3); }
  .toc ol { display: none; margin-top: var(--s1); min-width: 14rem; }
  .toc.open ol { display: block; }
  .toc-toggle { box-shadow: 0 2px 8px rgb(0 0 0 / 0.08); }
}
@media print { .toc { display: none; } }
/* "?": an explanation that opens over the page instead of a paragraph always shown. */
details.hint { display: inline-block; position: relative; vertical-align: middle; margin-left: var(--s1); }
details.hint > summary { list-style: none; cursor: pointer; width: 1.35rem; height: 1.35rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line); letter-spacing: 0; text-transform: none; }
details.hint > summary::-webkit-details-marker { display: none; }
details.hint[open] > summary { background: var(--accent); color: var(--surface); }
details.hint > .hint-body { position: absolute; z-index: 9; top: calc(100% + 6px); left: 0; width: min(26rem, 80vw);
  background: var(--surface); color: var(--fg); padding: var(--s3) var(--s4); border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgb(0 0 0 / 0.12); font-size: .9rem; font-weight: 400; line-height: 1.5; }
details.hint > .hint-body p { margin: 0 0 var(--s2); }
details.hint > .hint-body p:last-child { margin: 0; }
details.hint.flip > .hint-body { left: auto; right: 0; }
details.hint.mini { margin-left: 2px; }
details.hint.mini > summary { width: 1.1rem; height: 1.1rem; font-size: .68rem; }
details.hint.mini > .hint-body { width: min(16rem, 70vw); font-size: .85rem; left: auto; right: 0; }   /* marks sit at the end of a line */
/* A long list folded to one line that says what it holds. */
details.fold > summary { cursor: pointer; color: var(--muted); font-size: .9rem; padding: var(--s1) 0; }
details.fold > summary strong { color: var(--fg); font-weight: 600; }
details.fold[open] > summary { margin-bottom: var(--s2); }
/* The student page's practice lessons: two compact cards. */
.practice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: var(--s4); margin: var(--s3) 0 var(--s5); }
.practice-card { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); padding: var(--s3) var(--s4) var(--s4); }
.practice-card h3 { margin: 0 0 var(--s2); font-size: 1.05rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: var(--s1); margin: var(--s2) 0; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 2px var(--s3); font-size: .9rem; margin-bottom: var(--s2); }
.practice-card .mix-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-top: var(--s2); font-size: .9rem; }
.practice-card .mix-row input[type=number] { width: 4.2rem; }
/* The student's lessons as bubbles, grouped by main topic. */
.areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--s4); margin: var(--s3) 0; }
.area { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); padding: var(--s3) var(--s4) var(--s4); }
.area h3 { margin: 0 0 var(--s2); font-size: 1rem; color: var(--accent); }
.bubbles { display: flex; flex-wrap: wrap; gap: var(--s2); }
.bubble { display: inline-flex; align-items: center; gap: var(--s2); padding: 0.4rem 0.8rem; border-radius: 999px; text-decoration: none;
  color: var(--fg); background: var(--bg); box-shadow: 0 0 0 1px var(--line); font-size: .9rem; max-width: 100%;
  transition: transform .12s, box-shadow .12s; }
.bubble:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px var(--accent), 0 3px 10px rgb(0 0 0 / 0.08); }
.b-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-date { color: var(--muted); font-size: .78rem; }
.b-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; flex: 0 0 auto; vertical-align: middle; }
.bubble.open .b-dot, .open-dot { box-shadow: inset 0 0 0 2px var(--accent); }
.bubble.done .b-dot, .done-dot { background: var(--ok); }
.small { font-size: .82rem; }
.muted { color: var(--muted); }
.b-date { white-space: nowrap; }
.practice-card .chip span, .practice-card label.chip > span { font-size: .8rem; }
.tries { font-size: .82rem; letter-spacing: .08em; color: var(--muted); background: var(--note-soft); border-radius: 999px; padding: 0 .45rem; }
.mark.shown { display: block; margin-top: var(--s1); color: var(--fg); background: var(--draft-soft); border-radius: 6px; padding: 2px var(--s2); font-size: .9rem; }
/* The topic list under the grammar tree: an area per family, a card per topic. */
.topic-areas { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }
.topic-cards { display: flex; flex-direction: column; gap: var(--s2); }
.topic-card { display: grid; grid-template-columns: 1fr auto; gap: 0 var(--s2); padding: var(--s2) var(--s3); border-radius: 10px;
  background: var(--bg); box-shadow: 0 0 0 1px var(--line); transition: transform .12s, box-shadow .12s; }
.topic-card:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px var(--accent), 0 3px 10px rgb(0 0 0 / 0.08); }
.topic-card.branch { margin-left: var(--s4); }
.topic-card.stub { opacity: .7; border: 1px dashed var(--line); box-shadow: none; }
.tc-title { font-weight: 600; color: var(--fg); text-decoration: none; }
.tc-title:hover { color: var(--accent); }
.tc-meta { grid-column: 1; color: var(--muted); font-size: .8rem; }
.tc-review { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: .8rem; color: var(--muted); }
.tc-rel { grid-column: 1 / -1; color: var(--faint); font-size: .76rem; }
.topic-bubbles { display: flex; flex-direction: column; gap: var(--s2); margin-bottom: var(--s2); }
.tb-family { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1); }
.tb-name { font-size: .75rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin-right: var(--s1); }
.practice-card .topic-bubbles .chip span { font-size: .8rem; }
/* Chosen chips stand out; an open topic list gets the whole width. */
label.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--surface); }
label.chip input:checked + span .cool { color: var(--draft); }
.practice-card:has(details.fold[open]) { grid-column: 1 / -1; }
/* Reading: the text beside the questions (readref.js). */
.text-btn { display: block; margin: var(--s3) 0 0 auto; }
.para-ref { position: relative; font-size: .75rem; padding: 0 .4rem; margin-right: .35rem; border-radius: 999px; vertical-align: 1px;
  background: var(--accent-soft); border: 1px solid var(--line); color: var(--accent); cursor: pointer; }
.para-tip { display: none; position: absolute; z-index: 9; left: 0; top: calc(100% + 6px); width: min(26rem, 80vw); white-space: normal;
  text-align: left; font-size: .9rem; line-height: 1.5; color: var(--fg); background: var(--surface); padding: var(--s3);
  border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgb(0 0 0 / 0.12); }
.para-ref:hover .para-tip, .para-ref:focus .para-tip { display: block; }
.text-panel { display: none; position: fixed; z-index: 4; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 8px 30px rgb(0 0 0 / 0.12); }
body.text-open .text-panel { display: flex; flex-direction: column; }
.text-panel header { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s2) var(--s4); border-bottom: 1px solid var(--line); }
.tp-body { overflow-y: auto; padding: var(--s3) var(--s4); line-height: 1.6; }
.tp-body mark.wl { background: var(--accent-soft); color: inherit; border-bottom: 2px solid var(--accent); border-radius: 3px; padding: 0 2px; }
.word-pool .wp-find { margin-left: auto; }
.tp-body p.hl { background: var(--draft-soft); border-radius: 6px; padding: var(--s1) var(--s2); }
@media (min-width: 1000px) {
  .text-panel { top: 4.5rem; right: var(--s4); bottom: var(--s4); width: min(30rem, 40vw); border-radius: var(--radius); }
  body.text-open main.reading.me { margin-left: max(var(--s4), calc(100vw - min(30rem, 40vw) - 44rem - 3 * var(--s4))); margin-right: 0; }
  body.text-open .toc { display: none; }
}
@media (max-width: 999px) {
  .text-panel { left: 0; right: 0; bottom: 0; height: 48vh; border-radius: var(--radius) var(--radius) 0 0; }
  body.text-open main { padding-bottom: 50vh; }
}
/* "Give to…": a small menu of students. */
details.give-menu { display: inline-block; position: relative; }
details.give-menu > summary { list-style: none; cursor: pointer; }
details.give-menu > summary::-webkit-details-marker { display: none; }
.give-list { position: absolute; z-index: 8; right: 0; top: calc(100% + 4px); min-width: 11rem; display: flex; flex-direction: column;
  background: var(--surface); padding: var(--s1); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgb(0 0 0 / 0.12); }
.give-list button { text-align: left; justify-content: flex-start; }
.give-list button:hover { background: var(--accent-soft); color: var(--fg); }
.toolbar details.give-menu .give-list, .review-tools details.give-menu .give-list { left: 0; right: auto; }
.new-lesson { grid-column: 1 / -1; }
.new-lesson select { flex: 1 1 18rem; min-width: 0; max-width: 100%; }
details.give-menu > summary.button { display: inline-block; font-size: .8rem; line-height: 1.2; padding: 3px var(--s3); white-space: nowrap;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--fg); }
details.give-menu > summary.button.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); }
details.give-menu[open] > summary.button { box-shadow: 0 0 0 2px var(--accent-soft); }
.practice-card select { font: inherit; font-size: .9rem; padding: var(--s1) var(--s2); border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); }
/* Flashcards */
.study { max-width: 34rem; }
.study-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s3); }
.study-count { color: var(--muted); font-size: .88rem; }
.flashcard { background: var(--surface); border-radius: 16px; box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgb(0 0 0 / 0.07);
  min-height: 13rem; padding: var(--s5); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: var(--s3);
  text-align: center; cursor: pointer; user-select: none; }
.fc-front, .fc-back { display: flex; flex-direction: column; gap: var(--s2); align-items: center; }
.fc-back[hidden] { display: none; }
.fc-word { font-size: 2rem; font-weight: 650; }
.fc-meaning { font-size: 1.3rem; color: var(--accent); font-weight: 600; }
.fc-example { color: var(--muted); font-style: italic; }
.fc-write { display: flex; gap: var(--s2); margin-top: var(--s3); }
.fc-write[hidden] { display: none; }
.fc-write input { flex: 1; font: inherit; padding: var(--s2) var(--s3); border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); }
.fc-result { min-height: 1.5rem; margin: var(--s2) 0; }
.fc-actions { display: flex; gap: var(--s2); justify-content: center; }
/* Come here, on the student's page: a light chip with the arrow (live-student.js). */
.come-chip { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 9; display: flex; align-items: center; gap: var(--s2);
  background: var(--surface); padding: var(--s2) var(--s2) var(--s2) var(--s4); border-radius: 999px; font-size: .9rem;
  box-shadow: 0 0 0 1px var(--accent), 0 6px 20px rgb(0 0 0 / 0.12); max-width: calc(100vw - 32px); }
.come-chip[hidden] { display: none; }
@media print { .come-chip { display: none !important; } }

/* Teach live: one Evaluate per exercise in the margin; its panel holds the answer, the notes,
   Right / Partly / Wrong with mistake ticks, and Bring them here. */
.teaching .t-extra { width: 22rem; }
.teaching details.evaluate { position: relative; }
.teaching details.evaluate > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: var(--s2);
  font-size: .8rem; padding: 3px var(--s3); border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--fg); }
.teaching details.evaluate > summary::-webkit-details-marker { display: none; }
.teaching details.evaluate > summary.judged.right { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.teaching details.evaluate > summary.judged.partly { border-color: var(--draft); color: var(--draft); background: var(--draft-soft); }
.teaching details.evaluate > summary.judged.wrong { border-color: var(--wrong); color: var(--wrong); }
.teaching details.evaluate > summary .live-answer { display: contents; }
.teaching details.evaluate > summary .live-answer > :not(.tries) { display: none; }
.teaching .eval-panel { position: absolute; z-index: 8; left: 0; top: calc(100% + 6px); width: 22rem; display: flex; flex-direction: column; gap: var(--s2);
  background: var(--surface); padding: var(--s3); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgb(0 0 0 / 0.12); }
.teaching .eval-panel .recorder { margin: 0; padding: 0; box-shadow: none; background: none; }
.teaching .eval-panel .pattern-ticks { max-height: 9rem; overflow-y: auto; font-size: .85rem; }
.eval-answer p { margin: 0 0 var(--s1); }
.eval-answer .k { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; margin-right: var(--s1); }
.eval-answer .why { color: var(--muted); font-size: .88rem; }
.eval-notes { font-size: .88rem; background: var(--accent-soft); border-radius: 8px; padding: var(--s2) var(--s3); }
[data-bring].on { background: var(--accent); color: var(--surface); border-color: var(--accent); }
body.notes-inline .teaching .eval-panel { position: static; width: auto; margin-top: var(--s2); }
.teaching fieldset[disabled] .answer-row > button { display: none; }      /* Send only while "Type for them" is on */
.come-chip { bottom: 4rem; white-space: nowrap; }
.come-chip span { overflow: hidden; text-overflow: ellipsis; }
/* Student page: the new-lesson card with three tabs (radio inputs, no script needed). */
.new-lesson-card { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); padding: var(--s3) var(--s4) var(--s4); margin: var(--s3) 0 var(--s5); }
.new-lesson-card h2 { margin: 0 0 var(--s2); font-size: 1.15rem; }
.tabs { display: flex; flex-wrap: wrap; gap: var(--s1); }
.tabs > input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tabs > label { padding: var(--s1) var(--s3); border-radius: 999px; cursor: pointer; color: var(--muted); font-size: .9rem; border: 1px solid transparent; }
.tabs > input:checked + label { background: var(--accent-soft); color: var(--fg); border-color: var(--accent); font-weight: 600; }
.tabs > input:focus-visible + label { outline: 2px solid var(--accent); }
.tab-body { display: none; flex-basis: 100%; min-width: 0; max-width: 100%; margin-top: var(--s3); }
#nl-existing:checked ~ .tab-body[data-for="nl-existing"], #nl-generate:checked ~ .tab-body[data-for="nl-generate"],
#nl-mix:checked ~ .tab-body[data-for="nl-mix"] { display: block; }
.nl-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin: var(--s2) 0; }
.nl-row select, .mix-any select { font: inherit; font-size: .9rem; padding: var(--s1) var(--s2); border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); flex: 1 1 18rem; min-width: 0; }
.mix-any select { flex: 0 0 auto; }
.nl-num { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.nl-num input { width: 3.6rem; font: inherit; color: var(--fg); padding: 2px var(--s2); border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-align: center; }
/* Mix: the source chips, how many, and the two buttons on one line, all small (2026-11-28). */
.mix-any .nl-row { flex-wrap: nowrap; }
.mix-any .nl-row .chip-row { margin: 0; flex-wrap: nowrap; }
.mix-any .nl-go { display: flex; gap: var(--s2); margin-left: auto; }
@media (max-width: 40rem) { .mix-any .nl-row { flex-wrap: wrap; } .mix-any .nl-go { margin-left: 0; } }
.mix-grammar, .mix-reading { margin: var(--s2) 0; padding-left: var(--s3); border-left: 3px solid var(--accent-soft); }
.mix-any:has(input[name=source][value=grammar]:checked) .mix-reading,
.mix-any:has(input[name=source][value=reading]:checked) .mix-grammar { display: none; }
/* The lessons table */
.lessons-table th[data-sort] { cursor: pointer; white-space: nowrap; }
.lessons-table th[data-sort]::after { content: " ↕"; color: var(--faint); font-size: .75em; }
.lessons-table th.asc::after { content: " ↑"; color: var(--accent); }
.lessons-table th.desc::after { content: " ↓"; color: var(--accent); }
.lessons-table td a { color: var(--fg); font-weight: 600; text-decoration: none; }
.lessons-table td a:hover { color: var(--accent); }
.kind-tag { font-size: .75rem; border-radius: 999px; padding: 0 .5rem; background: var(--note-soft); color: var(--muted); }
.kind-tag.reading { background: var(--accent-soft); color: var(--accent); }
.kind-tag.simulation { background: var(--ok-soft); color: var(--ok); }
.row-actions { text-align: right; }
details.fold.more { margin: var(--s3) 0; padding: var(--s2) var(--s3); background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); }
.nl-row > select { width: auto; }
.word-list td, .word-list th { padding: .3rem .5rem; }
/* What they have had (student page): a thin bar per type for the weighted share. */
table.had-table { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.had-table th, table.had-table td { text-align: left; padding: .3rem .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.had-table tr.muted td { color: var(--faint); }
.share-bar { display: inline-block; width: 4rem; height: .45rem; border-radius: 999px; background: var(--line); vertical-align: middle; overflow: hidden; }
.share-bar > span { display: block; height: 100%; width: var(--w); background: var(--accent); }
/* The Mix preview: what it picked, by topic or pack. */
.mix-group { padding: 0 var(--s4) var(--s3); }
ol.mix-rows { padding-left: 1.6rem; margin: var(--s2) 0 0; }
ol.mix-rows > li { padding: var(--s1) 0; border-bottom: 1px solid var(--line); }
ol.mix-rows > li:last-child { border-bottom: 0; }
ol.mix-rows .cool { margin-left: var(--s2); font-size: .72rem; color: var(--draft); background: var(--draft-soft); border-radius: 999px; padding: 0 .4rem; }
.toolbar form { display: inline; }
/* Sharing where the student is (live lessons): one line on the student's pages. */
.sharing-line { margin: var(--s4) 0; color: var(--muted); }
.sharing-line form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.sharing-line form[hidden] { display: none; }
.sharing-state { color: var(--draft); }
.sharing-state[hidden] { display: none; }
/* Students' floating tools, bottom right: (in a lesson) sharing and Help, and "+ Word" everywhere. */
.float-dock { position: fixed; right: 16px; bottom: 16px; z-index: 8; display: flex; flex-direction: column; align-items: flex-end; gap: var(--s2); }
@media print { .float-dock { display: none !important; } }
.wf-panel { width: min(19rem, calc(100vw - 32px)); background: var(--surface); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.25), 0 0 0 1px var(--line); padding: var(--s3); font-size: .9rem; }
.wf-panel[hidden] { display: none; }
.wf-panel input { display: block; width: 100%; font: inherit; font-size: .92rem; border: 1px solid var(--line); border-radius: 8px; padding: var(--s1) var(--s2); margin-bottom: var(--s2); background: var(--surface); color: var(--fg); }
.wf-panel .help-status.bad { color: var(--wrong); }
.wf-panel p.muted { margin: var(--s2) 0 0; }
.share-pill { display: inline-flex; align-items: center; gap: var(--s2); border-radius: 999px; font-size: .78rem; padding: 3px var(--s3) !important; background: var(--surface); color: var(--muted); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.share-pill .sp-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--ok); }
.share-pill.off .sp-dot { background: var(--faint); }
.float-dock .teacher-here { position: static; margin: 0; }
.float-dock .teacher-here[hidden] { display: none; }
/* Reading and Simulations forms: three calm steps, one input style; step 3 waits for topics. */
.reading-form { gap: var(--s4); }
/* Each step of the reading and simulation forms is a panel (the teacher, 2026-11-26: the forms looked flat and crowded). */
.rf-step { display: grid; gap: var(--s3); padding: var(--s4); background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.rf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.rf-grid label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
.rf-grid select { font: inherit; font-size: .95rem; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px var(--s2); width: 100%; }
.rf-grid .rf-wide { grid-column: 1 / -1; }
@media (max-width: 40rem) { .rf-grid { grid-template-columns: 1fr 1fr; } }
.rf-size { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.rf-toggle span { font-size: .85rem; }
.rf-also { display: flex; flex-wrap: wrap; gap: var(--s1); align-items: center; color: var(--muted); }
.rf-step[hidden] { display: none; }
.rf-label { margin: 0; font-weight: 650; font-size: .95rem; display: flex; align-items: baseline; gap: var(--s2); }
.rf-label > span:first-child { display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: .75rem; }
.rf-label .muted { font-weight: 400; }
.rf-note { margin: 0; color: var(--muted); font-size: .82rem; }
.rf-row > button { align-self: flex-end; }
.rf-row input { min-width: 0; width: 100%; }
.rf-go { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.rf-cats label.chip span { font-size: .78rem; color: var(--muted); }
.rf-cats label.chip input:checked + span { color: var(--surface); }
.rf-note [data-later-show] { text-decoration: underline; text-underline-offset: 2px; color: var(--accent); padding: 0 var(--s1) !important; }
/* Listening (speak.js): a bar above a reading text or dialogue; the line being read is marked. */
.listen-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); padding: var(--s4) 0 var(--s3); margin-bottom: var(--s4); border-bottom: 1px solid var(--line); }   /* room from the header and from the text below */
.listen-bar[hidden] { display: none; }
.listen-bar [data-listen-play].on { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.speaking { background: var(--draft-soft); border-radius: 6px; box-shadow: 0 0 0 4px var(--draft-soft); }
.prose.listen-hidden { filter: blur(6px); user-select: none; pointer-events: none; }
.say-btn { border: 0; background: none; cursor: pointer; padding: 0 4px; font-size: 1rem; color: var(--accent); }
body:not(.can-speak) .say-btn { display: none; }
.flashcard { position: relative; }
.fc-say { position: absolute; top: var(--s2); right: var(--s2); }
.fc-say[hidden] { display: none; }
.flashcard.gap .fc-word { font-size: 1.25rem; font-weight: 500; line-height: 1.5; text-align: center; }
.mark.almost { color: var(--draft); background: var(--draft-soft); }
/* The streak card (lessons/streak.py); the water is drawn by water.js. */
.streak-card { display: flex; align-items: center; gap: var(--s4); background: var(--surface); border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--line); padding: var(--s3) var(--s4); margin: var(--s3) 0 var(--s5); }
.sk-main { flex: 1; min-width: 0; }
.sk-count { margin: 0; font-size: 1.05rem; }
.sk-count strong { font-size: 1.7rem; color: var(--accent); margin-right: 2px; }
.sk-say { margin: var(--s1) 0 var(--s2); color: var(--muted); font-size: .92rem; }
.sk-strip { display: grid; grid-template-columns: repeat(28, 1fr); gap: 3px; max-width: 28rem; }
.sk-strip span { aspect-ratio: 1; border-radius: 3px; background: var(--line); }
.sk-strip span.on { background: var(--accent); }
.sk-strip span.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.sk-week { margin: var(--s2) 0 0; color: var(--muted); display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); align-items: center; }
.sk-goal { display: inline; }
.sk-goal select { font: inherit; font-size: .85rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--fg); padding: 0 2px; }

.sk-goal label { font-size: .85rem; color: var(--muted); display: inline; }
.row-form { display: inline; }
.read-timer { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); padding: var(--s2) 0 0; }
/* 2026-11-26: the floating tools side by side at the bottom; each panel opens above its button.
   Presence and the sharing switch sit in the top right corner instead. */
.float-dock { flex-direction: row; align-items: flex-end; }
.help-float, .word-float { position: relative; }
.help-panel, .wf-panel { position: absolute; right: 0; bottom: calc(100% + 8px); }
.live-corner { position: fixed; top: calc(var(--nav-h, 3.6rem) + .6rem); right: var(--s3); z-index: 7; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: var(--s2); max-width: calc(100vw - 2 * var(--s3)); }
.live-corner .teacher-here { position: static; margin: 0; }
.live-corner .teacher-here[hidden] { display: none; }
@media (max-width: 1119px) { body.has-live-corner .toc { top: calc(var(--nav-h, 3.6rem) + 3rem); } }
@media print { .live-corner { display: none !important; } }
.word-text-edit { font-weight: 650; font: inherit; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--fg); padding: 2px 4px; min-width: 8rem; }
.word-text-edit:hover, .word-text-edit:focus { border-color: var(--line); background: var(--surface); }
.listen-bar [data-hide-there].on { background: var(--draft-soft); border-color: var(--draft); color: var(--draft); }
.listen-bar [data-hide-there].asked { box-shadow: 0 0 0 3px var(--live); }
.listen-bar [hidden] { display: none; }
.rf-profile { display: block; margin: var(--s1) 0; }
.profile-form input { width: 100%; }
/* The journey road (lessons/road.py, _road.html): stretches of five lessons, the scene from their
   topics, the colours from the season. Scenery symbols take their colours from these variables. */
.road-defs { position: absolute; width: 0; height: 0; }
.road { display: grid; gap: 0; border-radius: var(--radius); overflow: hidden; box-shadow: 0 0 0 1px var(--line); margin: var(--s3) 0; }
.road-stretch { position: relative; }
.road-svg { display: block; width: 100%; height: auto; }
.road-name { position: absolute; left: var(--s3); top: var(--s2); margin: 0; font-size: .75rem; font-weight: 650; letter-spacing: .04em;
  text-transform: uppercase; color: var(--r-label); background: var(--r-pill); padding: 2px var(--s2); border-radius: 999px; z-index: 1; }
.road-stretch { --ground: #dcebc8; --crown: #5d9a4a; --pine: #2f6b45; --trunk: #7a5234; --blossom: transparent; --snow: transparent;
  --wall: #f3e6cf; --wall-dark: #8aa0b4; --roof: #b5523b; --window: #f6d36b; --rock: #8b8f99; --peak: #f4f6f8; --stone: #b9b2a4;
  --sail: #ffffff; --water: #3b8fc4; --sea: #6db3dd; --far: #b8c9d6; --road: #e9dcc0; --road-edge: #c9b48e;
  --r-label: #33463a; --r-pill: rgb(255 255 255 / .75); }
.season-spring { --ground: #e2f0cf; --crown: #79b562; --blossom: #f5a9c6; }
.season-summer { --ground: #cfe6b0; --crown: #4f9440; --window: #ffe08a; }
.season-autumn { --ground: #efe1c4; --crown: #d98b3a; --pine: #4b6b3f; --blossom: #c0562f; --far: #c9b9a6; }
.season-winter { --ground: #eef3f7; --crown: #6c8e7c; --pine: #3e6356; --snow: #ffffff; --roof: #8e4a3c; --road: #f8fbfd; --road-edge: #c4d3de;
  --sea: #8fb8d1; --far: #d6e2ea; --peak: #ffffff; }
:root[data-theme="dark"] .road-stretch { filter: brightness(.78) saturate(.9); --r-pill: rgb(0 0 0 / .45); --r-label: #e8efe9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .road-stretch { filter: brightness(.78) saturate(.9); --r-pill: rgb(0 0 0 / .45); --r-label: #e8efe9; } }
.r-ground { fill: var(--ground); }
.r-sea { fill: var(--sea); }
.r-far { fill: var(--far); }
.r-road-edge { fill: none; stroke: var(--road-edge); stroke-width: 30; stroke-linecap: round; }
.r-road { fill: none; stroke: var(--road); stroke-width: 24; stroke-linecap: round; }
.r-road-dash { fill: none; stroke: var(--road-edge); stroke-width: 2; stroke-dasharray: 6 10; }
.r-stop { cursor: pointer; }
/* Stops are small flat stepping stones on the road, not coins (the teacher, 2026-11-26). */
.r-stop .r-shadow { fill: rgb(0 0 0 / .12); }
.r-stop .r-dot { fill: #f4efe4; stroke: #8a7a62; stroke-width: 2; transition: r .15s; }
.r-stop.done .r-dot { fill: #e8f2e9; stroke: #4e8a5d; }
.r-stop.started .r-dot { fill: #fff; stroke: var(--accent); stroke-dasharray: 3 3; }
.r-stop:hover .r-dot, .r-stop:focus .r-dot { r: 14; stroke-width: 2.5; }
.r-mark { fill: #4e8a5d; font: 700 11px system-ui, sans-serif; text-anchor: middle; pointer-events: none; }
.r-stop.started .r-mark { fill: var(--accent); }
.r-art { opacity: .95; }
.r-label, .r-date { font: 600 14px system-ui, sans-serif; fill: #1e2a33; paint-order: stroke; stroke: var(--ground); stroke-width: 5px; stroke-linejoin: round; }
.r-date { font-weight: 400; font-size: 12px; fill: #4c5b66; }
.r-label.left, .r-date.left { text-anchor: end; }
.r-stop:hover .r-label { fill: var(--accent); }
.r-here-text { font: 700 12px system-ui, sans-serif; fill: var(--accent); text-anchor: middle; paint-order: stroke; stroke: var(--ground); stroke-width: 4px; }
.r-start { font: 600 12px system-ui, sans-serif; fill: #4c5b66; text-anchor: middle; letter-spacing: .1em; text-transform: uppercase; }
/* The student home: open lessons as a to-do list. */
ul.todo-list { list-style: none; padding: 0; margin: var(--s2) 0 var(--s5); display: grid; gap: var(--s2); }
a.todo, .todo-list .todo { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t b" "m b" "bar bar"; gap: 2px var(--s3); align-items: center;
  padding: var(--s3) var(--s4); background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); color: var(--fg); text-decoration: none; }
a.todo:hover { box-shadow: 0 0 0 2px var(--accent); }
.todo-title { grid-area: t; font-weight: 650; }
.todo-meta { grid-area: m; color: var(--muted); font-size: .85rem; }
.todo .button { grid-area: b; }
.todo-bar { grid-area: bar; height: 4px; border-radius: 999px; background: var(--line); margin-top: var(--s2); overflow: hidden; }
.todo-bar > span { display: block; height: 100%; background: var(--accent); }
/* Today: the teacher's home. */
table.today-students { border-collapse: collapse; width: 100%; font-size: .92rem; }
table.today-students th, table.today-students td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t-streak { white-space: nowrap; }
.today-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--s3); margin: var(--s5) 0; }
.today-card { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); padding: var(--s3) var(--s4); }
.today-card h3 { margin: 0 0 var(--s2); font-size: 1rem; }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s1); }
.live-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--ok); }
.help-count { color: var(--live-fg, var(--accent)); }
.toolbar a.button + a.button { margin-left: var(--s1); }
main.reading.wide-today { max-width: 60rem; }
.listen-none { color: var(--draft); flex-basis: 100%; }
/* The sharing switch carries presence: a full green light while the teacher is here (live.js sets
   body.live-other-here), an empty ring otherwise. */
.share-pill .sp-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); transition: background .3s, box-shadow .3s; }
body.live-other-here .share-pill .sp-dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft), 0 0 8px var(--ok); }
body.live-other-here .share-pill { color: var(--fg); }
.spend { margin: 0 0 var(--s2); }
.meter { height: 3px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); }
.key-card { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); padding: var(--s3) var(--s4); margin: var(--s3) 0; }
.key-card h3 { margin: 0 0 var(--s1); font-size: 1rem; }
.key-form { display: flex; flex-wrap: wrap; gap: var(--s2); }
.key-form input { flex: 1 1 12rem; font: inherit; font-size: .9rem; padding: 4px var(--s2); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--fg); }
/* "The text": floating while a section that belongs to a reading text is on screen (readref.js). */
.text-float { position: fixed; left: 16px; bottom: 16px; z-index: 8; border-radius: 999px; padding: var(--s2) var(--s4) !important;
  font-weight: 650; box-shadow: 0 2px 10px rgba(0,0,0,.18); background: var(--surface); }
.text-float[hidden] { display: none; }
body.text-open .text-float { background: var(--accent); color: var(--surface); border-color: var(--accent); }
@media print { .text-float { display: none !important; } }
/* Calls and replies from the teacher on any student page (studenthome.js); help cards on any teacher page. */
.call-chip { bottom: 5rem; }
.reply-bubble { position: fixed; right: 16px; bottom: 4.5rem; z-index: 9; max-width: min(22rem, calc(100vw - 32px)); background: var(--surface);
  border-radius: var(--radius); padding: var(--s3) var(--s4); box-shadow: 0 0 0 2px var(--accent), 0 8px 24px rgb(0 0 0 / .15); }
.reply-bubble[hidden] { display: none; }
.rb-who { margin: 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 650; }
.rb-text { margin: var(--s1) 0 var(--s2); }
.hh-reply { display: flex; gap: var(--s1); margin: var(--s1) 0; }
.hh-reply input { flex: 1; min-width: 0; font: inherit; font-size: .85rem; padding: 2px var(--s2); border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--fg); }
.hh-row { display: flex; flex-wrap: wrap; gap: var(--s1); align-items: center; }
.hh-row select { font: inherit; font-size: .82rem; max-width: 12rem; }
.live-dot { flex: none; vertical-align: middle; }
/* The water (water.js) in its places: the streak card, the top bar, Today, the companion, loading. */
.streak-card .streak-water { width: 120px; height: 120px; flex: none; }
@media (max-width: 30rem) { .streak-card .streak-water { width: 80px; height: 80px; } }
.mini-water { width: 26px; height: 26px; vertical-align: middle; }
.water-pet { position: fixed; z-index: 7; width: 120px; height: 104px; touch-action: none; user-select: none; }
.water-pet canvas { width: 100%; height: 100%; cursor: grab; display: block; }
.water-pet.dragging canvas { cursor: grabbing; }
.pet-fold { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; padding: 0 !important; border-radius: 50%; font-size: .9rem; line-height: 1;
  opacity: 0; transition: opacity .2s; }
.water-pet:hover .pet-fold, .pet-fold:focus { opacity: 1; }
.water-pet.folded { width: 88px; height: 88px; }   /* curled round the corner ball; placed by pet.js */
/* Folded, the drop holds Help and + Word: they hide under it and come out on hover. */
body.pet-holds .float-dock { opacity: 0; pointer-events: none; transform: translateY(10px) scale(.9); transition: opacity .18s, transform .18s; }
body.pet-holds.pet-reveal .float-dock { opacity: 1; pointer-events: auto; transform: none; }
body.pet-holds .float-dock:focus-within { opacity: 1; pointer-events: auto; transform: none; }
.pet-tip { position: fixed; z-index: 9; max-width: 15rem; background: var(--surface); color: var(--fg); padding: var(--s2) var(--s3);
  border-radius: 12px 12px 2px 12px; box-shadow: 0 0 0 1px var(--line), 0 6px 18px rgb(0 0 0 / 0.12); font-size: .88rem; line-height: 1.4; }
.pet-tip[hidden] { display: none; }
.water-pet.folded .pet-fold { display: none; }
.water-pet.folded canvas { cursor: pointer; }
@media print { .water-pet { display: none !important; } }
.busy-water { display: inline-flex; align-items: center; gap: var(--s2); margin: var(--s2) 0 0 var(--s2); vertical-align: middle; color: var(--muted); font-size: .85rem; }
.busy-water canvas { width: 34px; height: 44px; }

/* "Choose and say why": one line at the start says the reason is optional (2026-11-26). */
.why-note { margin: -0.2rem 0 0.6rem; font-size: 0.9rem; color: var(--muted); }

/* ---- The approval page (tree/approve.html, 2026-11-26) ---- */
.ap-section { border-top: 1px solid var(--line, #ddd); padding: 0.4rem 0; }
.ap-section > summary, .ap-step > summary { display: flex; align-items: baseline; gap: 0.8rem; cursor: pointer; list-style: none; }
.ap-section > summary::-webkit-details-marker, .ap-step > summary::-webkit-details-marker { display: none; }
.ap-section > summary::before, .ap-step > summary::before { content: "▸"; color: var(--muted); width: 1em; }
.ap-section[open] > summary::before, .ap-step[open] > summary::before { content: "▾"; }
.ap-section > summary h2, .ap-step > summary h3 { margin: 0.3rem 0; }
.ap-step { margin: 0.2rem 0 0.2rem 1.2rem; }
.ap-count { color: var(--muted); font-size: 0.9rem; }
.ap-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; margin: 0.5rem 0 1rem; }
@media (max-width: 900px) { .ap-cols { grid-template-columns: 1fr; } }
.ap-colhead { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 0 0 0.4rem; display: flex; gap: 0.6rem; align-items: center; }
.ap-in-use { border-left: 3px solid var(--ok, #2e7d4f); padding-left: 0.8rem; }
.ap-decide { border-left: 3px solid var(--warn, #b7791f); padding-left: 0.8rem; }
.ap-card { background: var(--surface); border: 1px solid var(--line, #ddd); border-radius: 6px; padding: 0.6rem 0.8rem; margin-bottom: 0.5rem; }
.ap-in-use .ap-card[data-show-stack] { cursor: pointer; }
.ap-in-use .ap-card.selected { outline: 2px solid var(--accent); }
.ap-card.ap-arrived { outline: 2px solid var(--accent); }
.ap-stack.many { border: 1px dashed var(--muted); border-radius: 8px; padding: 0.4rem 0.5rem 0.1rem; margin-bottom: 0.8rem; }
.ap-stack.many > .ap-card + .ap-card { margin-top: -0.1rem; }
.ap-why { margin: 0 0 0.3rem; color: var(--muted); }
.ap-tick { display: block; margin: 0 0 0.3rem; font-size: 0.85rem; color: var(--muted); }
.ap-key { margin: 0.3rem 0 0; }
.ap-alts { color: var(--accent); }
.ap-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: 0.4rem; }
.ap-actions form { display: inline; margin: 0; }
.ap-retired .ap-card { opacity: 0.85; border-style: dashed; }
.ap-retired-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: 0.6rem; margin: 0.5rem 0 1rem; }
.ap-replaces { margin: 0 0 0.3rem; }
.ap-card .answer-box fieldset[disabled] { opacity: 1; }
.ap-card .answer-box { font-size: 0.95rem; }
.ap-card .answer-box .choice span { padding: 0.2rem 0.7rem; }
.ap-card .answer-box input[name=why] { display: none; }          /* the reason is shown under the card */
.ap-card .answer-box input[name=text], .ap-card .answer-box textarea { padding: 0.3rem 0.5rem; }
.ap-section:last-of-type { margin-bottom: 5rem; }                /* room for the bar at the bottom */
/* Marks: automatic until the teacher releases theirs (2026-11-26). */
.mark.auto { color: var(--muted); font-size: 0.85rem; }
.mark.teacher { font-weight: 600; }
.mark.teacher.right { color: var(--ok); }
.mark.teacher.wrong { color: var(--danger, #b3261e); }
.release-form { display: inline-flex; gap: 0.5rem; align-items: center; margin: 0; }
.ap-card[data-select-card] { cursor: pointer; }
.ap-card.is-picked { outline: 2px solid var(--accent); background: var(--accent-soft); }
.ap-in-use .ap-card.focused { box-shadow: 0 0 0 2px var(--warn, #b7791f); }
.ap-colhead label { display: inline-flex; gap: 0.4rem; align-items: center; cursor: pointer; }
/* "Why" folded away until wanted (2026-11-26); write-the-form exercises show the base verb. */
.why-fold { display: inline-block; }
.why-fold > summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; list-style: none; }
.why-fold > summary::-webkit-details-marker { display: none; }
.why-fold > summary::before { content: "+ "; }
.why-fold[open] > summary::before { content: "− "; }
.why-fold[open] { display: block; flex-basis: 100%; }
.why-fold input { width: 100%; margin-top: 0.3rem; }
.prompt .base { color: var(--accent); font-style: italic; }
/* Word pool (pool.js): the words of a group, sticky above its exercises. */
.word-pool { position: sticky; top: calc(var(--nav-h, 3.4rem) + 4px); z-index: 1; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.6rem; margin: 0.4rem 0 0.8rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06); }
.word-pool .wp-label { font-size: 0.8rem; color: var(--muted); margin-right: 0.3rem; }
.word-pool .wp-word { padding: 0.2rem 0.7rem; border-radius: 999px; }
.word-pool:not(:has(.wp-word:not([hidden])))::after { content: "All words used."; color: var(--muted); font-size: 0.85rem; }
.answer-box.pool-target input[data-pool-word] { outline: 2px solid var(--accent); }
input[data-pool-word][readonly] { cursor: pointer; }
/* The answer field as the gap in the sentence (write the form, word pool). */
.answer-box input.gap-input, main.me .answer-box input.gap-input {
  display: inline-block; width: auto; min-width: 4rem; max-width: 100%; margin: 0 var(--s1); padding: 0 var(--s1);
  font: inherit; font-weight: 600; color: var(--accent); text-align: center; background: transparent;
  border: 0; border-bottom: 2px solid var(--accent); border-radius: 0; }
.answer-box input.gap-input:focus { outline: none; background: var(--accent-soft, rgba(0,0,0,.04)); }
.answer-box input.gap-input::placeholder { color: var(--muted); font-weight: 400; font-size: .85em; }
.answer-box input.gap-input[data-pool-word] { cursor: pointer; }
@supports (field-sizing: content) { .answer-box input.gap-input { field-sizing: content; } }
/* Conflicting versions: side by side, one kept (2026-11-26). */
.ap-all { margin: 0.8rem 0 1rem; }
.ap-conflict { border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.8rem; margin: 0 0 0.8rem; }
.ap-conflict legend { font-weight: 600; padding: 0 0.3rem; }
.ap-versions { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.6rem; }
.ap-version { display: block; border: 1px solid var(--line); border-radius: 6px; padding: 0.5rem 0.7rem; cursor: pointer; background: var(--surface); }
.ap-version:has(input:checked) { outline: 2px solid var(--accent); background: var(--accent-soft); }
.ap-version input { margin-right: 0.4rem; }

/* Students page: here now as cards, the rest as a table (2026-11-26). */
.here-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
.here-card { border: 1px solid var(--ok); background: var(--ok-soft); border-radius: 8px; padding: 0.5rem 0.8rem; }
.here-card p { margin: 0.2rem 0; }
.students-table td { vertical-align: top; }
.students-table .trend { color: var(--accent); }

/* Reading form: the text's size as grey lines (5.2). */
.size-box { max-width: 704px; padding: 0.6rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.size-line { display: block; height: 0.5rem; margin: 0.45rem 0; background: var(--line); border-radius: 3px; }
.size-line.short { width: 60%; margin-bottom: 1rem; }
.rf-size { flex-wrap: wrap; align-items: center; }
.rf-size .rf-size-preview { flex-basis: 100%; }
.rf-size .size-box { width: min(704px, 100%); box-sizing: border-box; }
.rf-size [data-size-out] { flex-basis: 100%; }

/* Doing exercises again (PLAN.md 3.6): a quiet button under a part. */
.again-form { margin: var(--s2) 0 0; text-align: right; }
.me-head .again-form { text-align: left; margin: var(--s1) 0 0; }

/* Word help on click (wordhelp.js): a small card under the word. */
.word-help { position: absolute; z-index: 20; background: var(--surface); color: var(--fg); border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgb(0 0 0 / 0.14); padding: var(--s2) var(--s3) var(--s3); font-size: .92rem; }
.word-help header { display: flex; align-items: center; gap: var(--s2); }
.word-help header strong { font-size: 1.05rem; }
.word-help .wh-x { margin-left: auto; }
.word-help .wh-senses { margin: var(--s2) 0; padding-left: 1.2rem; }
.word-help .wh-senses li { margin-bottom: var(--s1); }
.word-help .wh-pl summary { cursor: pointer; color: var(--accent); font-size: .88rem; }
.word-help .wh-source { font-size: .7rem; color: var(--muted); margin: var(--s2) 0; }

/* Topic bubbles (bubbles.js): a glass per topic, water up to how much is done. */
.bubbles { width: 100%; }
.bubbles-svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.bubbles-stage { position: relative; }
.bubbles-water { position: absolute; left: 0; top: 0; pointer-events: none; }
.bubbles-svg.on-water { position: relative; }
.bubbles-svg.on-water .b-glass { fill: transparent; }
.bubbles-svg.on-water .b-rim { stroke: transparent; }
.bubbles-svg.on-water .bubble.current .b-rim, .bubbles-svg.on-water a.bubble:hover .b-rim, .bubbles-svg.on-water a.bubble:focus .b-rim { stroke: var(--accent); }
.bubble .b-glass { fill: var(--surface); }
.bubble .b-water { fill: color-mix(in srgb, var(--accent) 55%, #5fb3e6); opacity: .85; animation: b-flow 3s linear infinite; }
.bubble .b-water.back { fill: #8fd0f2; opacity: .55; animation-duration: 4.5s; animation-direction: reverse; }
.bubble .b-bob { animation: b-bob 3.2s ease-in-out infinite; }
@keyframes b-flow { from { transform: translateX(0); } to { transform: translateX(var(--wl)); } }
@keyframes b-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .bubble .b-water, .bubble .b-bob { animation: none; } }
.bubble .b-rim { fill: none; stroke: color-mix(in srgb, var(--accent) 45%, var(--line)); stroke-width: 1.5; }
.bubble.current .b-rim { stroke: var(--accent); stroke-width: 3; }
.bubble .b-pct { text-anchor: middle; font-size: 13px; font-weight: 650; fill: var(--fg); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.bubble .b-title { text-anchor: middle; font-size: 11.5px; fill: var(--muted); }
a.bubble { cursor: pointer; }
a.bubble:hover .b-rim, a.bubble:focus .b-rim { stroke: var(--accent); stroke-width: 2.5; }
a.bubble:hover .b-title { fill: var(--fg); }

/* Lists as cards (the teacher, 2026-11-26: no tables for lists; the grammar
   topic cards are the model). A grid that wraps; each card: a title line with
   a chip, meta lines, actions at the bottom. */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: var(--s3); margin: var(--s2) 0 var(--s5); padding: 0; list-style: none; }
.card { display: flex; flex-direction: column; gap: 2px; padding: var(--s3) var(--s3) var(--s3); border-radius: 10px;
  background: var(--surface); box-shadow: 0 0 0 1px var(--line); transition: transform .12s, box-shadow .12s; min-width: 0; }
.card:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px var(--accent), 0 3px 10px rgb(0 0 0 / 0.08); }
.card .c-head { display: flex; align-items: baseline; gap: var(--s2); }
.card .c-title { font-weight: 650; color: var(--fg); text-decoration: none; overflow-wrap: anywhere; word-break: break-word; min-width: 0; flex: 1 1 auto; }
.card .c-head { min-width: 0; }   /* a long title wraps in its column on every browser (2026-11-29) */
.card a.c-title:hover { color: var(--accent); }
.card .c-chip { margin-left: auto; white-space: nowrap; font-size: .72rem; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 0 var(--s2); }
.card .c-chip.live { color: var(--ok); background: var(--ok-soft); }
.card .c-chip.warn { color: var(--draft); background: var(--draft-soft); }
.card .c-meta { color: var(--muted); font-size: .84rem; }
.card .c-meta strong { color: var(--fg); font-weight: 600; }
.card .c-bar { height: 4px; border-radius: 2px; background: var(--bg); margin: var(--s1) 0; overflow: hidden; }
.card .c-bar span { display: block; height: 100%; background: var(--accent); }
.card .c-actions { margin-top: auto; padding-top: var(--s2); display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.card .c-actions form { display: inline; margin: 0; }
.card canvas.mini-water { width: 16px; height: 16px; vertical-align: -3px; }

/* Approval stacks: what a version changed, and the version in use kept short (it is on the left). */
.ap-changed { background: var(--bg); border-radius: 6px; padding: var(--s1) var(--s2); margin: 0 0 var(--s2); }
.ap-changed p { margin: 2px 0; }
.ap-changed ins { text-decoration: none; background: var(--ok-soft); color: var(--ok); border-radius: 3px; padding: 0 2px; font-weight: 600; }
.ap-changed del { background: var(--draft-soft); color: var(--draft); border-radius: 3px; padding: 0 2px; }
.ap-stack .ap-card.ap-compact { padding: var(--s1) var(--s3); opacity: .85; }
.ap-stack .ap-card.ap-compact .answer-box .choices, .ap-stack .ap-card.ap-compact .why-fold,
.ap-stack .ap-card.ap-compact .ap-actions, .ap-stack .ap-card.ap-compact .ap-key .muted { display: none; }
.made-cards .unit-parts { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); margin-top: var(--s1); }
.made-cards .row-form { display: inline-flex; align-items: center; gap: var(--s1); margin: 0; }

/* The Visible / On my own switch sits in the student's top bar, by the theme toggle. */
nav.top .share-float { display: inline-flex; }
nav.top .share-pill { box-shadow: none; border: 1px solid var(--line); }
nav.top .share-float + .theme-toggle { margin-left: 0; }
@media (max-width: 40rem) {
  nav.top .share-pill [data-share-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  nav.top .share-pill { padding: 6px 8px !important; }
}

/* Sort, group and filter bar over card lists (lists.js). */
.list-bar { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; margin: var(--s2) 0 0; font-size: .85rem; color: var(--muted); }
.list-bar label { display: inline-flex; align-items: center; gap: var(--s1); }
.list-bar select { font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 2px var(--s2); }
.list-bar .list-count { margin-left: auto; }
.list-bar .list-search { font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 3px var(--s2); width: min(16rem, 100%); }
.cat-chips { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: var(--s1); }
.cat-chip { font: inherit; font-size: .8rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px var(--s2); cursor: pointer; }
.cat-chip:hover { color: var(--fg); border-color: var(--accent); }
.cat-chip[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft, var(--note-soft)); border-color: var(--accent); font-weight: 600; }
.cards > .list-group-head { grid-column: 1 / -1; list-style: none; margin: var(--s3) 0 0; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.cards > .card[hidden] { display: none; }
/* A closed hint takes no room (it widened phone pages); the form grid never grows past its column. */
details.hint:not([open]) > .hint-body { display: none; }
details.hint > .hint-body { max-width: calc(100vw - 2rem); }
.rf-grid label { min-width: 0; }
.rf-grid select { min-width: 0; max-width: 100%; }
.list-bar select { max-width: min(14rem, 70vw); text-overflow: ellipsis; }

/* Word mode (wordhelp.js): the cursor says a click looks a word up. */
.word-mode-toggle { font-size: .8rem !important; font-weight: 700; padding: 2px var(--s2) !important; border-radius: 6px; }
.word-mode-toggle[aria-pressed="true"] { background: var(--accent); color: var(--surface) !important; }
body.word-mode main, body.word-mode .text-panel { cursor: help; }
body.word-mode main a, body.word-mode main button, body.word-mode main input, body.word-mode main label, body.word-mode main textarea { cursor: auto; }
/* Settings as cards (the teacher, 2026-11-26: it did not match the other pages). */
.settings-cards { grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); }
.settings-form { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: flex-end; }
.settings-form label { display: grid; gap: 4px; font-size: .8rem; color: var(--muted); flex: 1 1 8rem; }
.settings-form input { font: inherit; font-size: .92rem; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px var(--s2); flex: 1 1 10rem; min-width: 0; }
.settings-form label input { width: 100%; }
.word-help .wh-ipa { margin: 2px 0 0; font-family: "Charis SIL", "Doulos SIL", "DejaVu Sans", serif; color: var(--muted); }

/* A student's page for the teacher (2026-11-27): head, New lesson by kind, what to teach next, grammar, about. */
.st-head .st-now { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: var(--s2) 0 0; }
.st-card { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); padding: var(--s3) var(--s4) var(--s4); margin: var(--s4) 0; }
.st-card > h2 { margin: 0 0 var(--s2); font-size: 1.15rem; display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.st-card > h2 .muted { font-weight: 400; }
.st-now .c-chip { font-size: .8rem; padding: 2px var(--s2); border-radius: 999px; background: var(--note-soft); color: var(--muted); }
.st-now .c-chip.live { background: var(--ok-soft); color: var(--ok); }
.about-grid p, .about-grid .nl-row { font-size: .9rem; }
.st-card h3 { margin: var(--s3) 0 var(--s1); font-size: 1rem; }
.st-card h3:first-child { margin-top: 0; }
.new-lesson-card > h2 { margin-bottom: var(--s3); }
.nl-kinds { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s2); }
@media (max-width: 40rem) { .nl-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nl-kinds > input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nl-kinds > label { display: flex; flex-direction: column; gap: 2px; padding: var(--s2) var(--s3); border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); transition: border-color .15s, background .15s; }
.nl-kinds > label strong { font-size: .95rem; }
.nl-kinds > label span { font-size: .78rem; color: var(--muted); }
.nl-kinds > label em { font-style: normal; font-size: .72rem; font-weight: 650; color: var(--ok); }
.nl-kinds > label:hover { border-color: var(--accent); }
.nl-kinds > input:checked + label { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.nl-kinds > input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.nl-panel { display: none; margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); }
.new-lesson-card:has(#nk-grammar:checked) .nl-panel[data-for="nk-grammar"],
.new-lesson-card:has(#nk-reading:checked) .nl-panel[data-for="nk-reading"],
.new-lesson-card:has(#nk-simulation:checked) .nl-panel[data-for="nk-simulation"],
.new-lesson-card:has(#nk-mix:checked) .nl-panel[data-for="nk-mix"],
.new-lesson-card:has(#nk-words:checked) .nl-panel[data-for="nk-words"] { display: block; }
.nl-panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-bottom: var(--s2); }
.pick-search { font: inherit; font-size: .9rem; padding: var(--s1) var(--s2); border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); width: min(18rem, 100%); }
.pick-list { list-style: none; margin: 0; padding: 0; max-height: 22rem; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.pick-list > li[hidden] { display: none; }
.pick-fam { position: sticky; top: 0; z-index: 1; background: var(--bg); padding: var(--s1) var(--s3); font-size: .75rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); }
.pick { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title act" "note act"; align-items: center; column-gap: var(--s3);
  padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); }
.pick:last-child { border-bottom: 0; }
.pick:hover { background: var(--accent-soft); }
.pick-title { grid-area: title; font-weight: 600; }
.pick-note { grid-area: note; font-size: .8rem; color: var(--muted); }
.pick > button, .pick-done { grid-area: act; }
.pick-done { font-size: .78rem; color: var(--faint); }
.pick.given .pick-title { color: var(--muted); font-weight: 500; }
.next-line { margin: 0 0 var(--s3); }
.type-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); margin: 0 0 var(--s2); }
@media (max-width: 30rem) { .type-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.type-tile { display: grid; gap: 3px; padding: var(--s2) var(--s3); border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-size: .85rem; }
.type-tile .tt-name { font-weight: 650; font-size: .95rem; }
.type-tile .share-bar { width: 100%; }
.type-tile .tt-num, .type-tile .tt-last { color: var(--muted); }
.type-tile .tt-pause { font-size: .78rem; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.type-tile.suggested { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); background: var(--ok-soft); }
.type-tile.paused { opacity: .55; }
.type-tile.none .share-bar > span { background: var(--faint); }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--s4); }
.about-grid form.edit { display: grid; gap: var(--s2); align-content: start; }
.about-grid form.edit h3 { margin: 0; }
.about-grid textarea, .about-grid input[name=about] { width: 100%; }

/* Flashcards on a student's words page: what the cards show, chosen before the model writes them. */
.flash-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin: var(--s3) 0; padding: var(--s2) var(--s3);
  background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); }
.flash-form .ff-title { font-weight: 650; }
.fc-explain { display: block; font-size: .95rem; color: var(--muted); margin-top: var(--s1); }

/* Kept at hand (tray.js): 📌 on parts, the tray at the left edge. */
.pin-btn { margin-left: var(--s2); padding: 0 6px !important; font-size: .85rem; line-height: 1.6; border-radius: 999px; background: transparent; border: 1px solid transparent; opacity: .45; cursor: pointer; filter: grayscale(1); }
.pin-btn:hover, .pin-btn:focus-visible { opacity: 1; border-color: var(--line); filter: none; }
.pin-btn.on { opacity: 1; filter: none; border-color: var(--accent); background: var(--accent-soft); }
.me-card-head .pin-btn { margin-left: auto; }
.pin-tray { position: fixed; left: 16px; bottom: 70px; z-index: 8; }
body:has(.annot-bar) .pin-tray { bottom: 122px; }
.pin-tray .tray-body { width: min(24rem, 86vw); max-height: 60vh; overflow-y: auto; overflow-x: hidden; box-sizing: border-box; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.18); padding: var(--s2) var(--s3); }
.pin-tray .tray-body[hidden] { display: none; }
/* The dock at the bottom left: The text and Kept, faint until the corner is hovered (always shown on touch). */
.left-dock { position: fixed; left: 16px; bottom: 16px; z-index: 8; display: flex; gap: var(--s2); padding: 4px; border-radius: 999px; }
body:has(.annot-bar) .left-dock { bottom: 68px; }
.dock-btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; min-width: 40px; padding: 0 9px !important; border-radius: 999px !important;
  background: var(--surface); box-shadow: 0 2px 10px rgba(0,0,0,.16); opacity: .55; transition: opacity .2s; }
.dock-btn[hidden] { display: none; }
.dock-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; flex: none; }
.dock-btn .dock-count:not(:empty) { margin-left: 4px; font-size: .75rem; color: var(--surface); background: var(--accent); border-radius: 999px; padding: 0 6px; }
.left-dock:hover .dock-btn, .left-dock:focus-within .dock-btn, .dock-btn[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .dock-btn { opacity: 1; } }
.dock-tip { position: fixed; z-index: 10; max-width: 16rem; display: grid; gap: 2px; background: var(--surface); color: var(--fg); padding: var(--s2) var(--s3);
  border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgb(0 0 0 / 0.12); font-size: .85rem; line-height: 1.45; }
.dock-tip[hidden] { display: none; }
.dock-tip span { color: var(--muted); }
body.text-open .left-dock .dock-btn:first-child { opacity: 1; color: var(--accent); }
.tray-text { display: flex; align-items: center; gap: var(--s2); padding: var(--s1) 0 var(--s2); font-weight: 600; }
.tray-text svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.tray-text span { flex: 1; }
.tray-head { margin: 0 0 var(--s2); font-weight: 650; }
.tray-item { border-top: 1px solid var(--line); padding: var(--s1) 0; }
.tray-item > summary { display: flex; align-items: center; gap: var(--s2); cursor: pointer; font-size: .9rem; }
.tray-item .tray-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-item .tray-who { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.tray-item summary button { padding: 0 8px !important; }
.tray-copy { font-size: .9rem; padding: var(--s1) 0 var(--s2); min-width: 0; overflow-wrap: anywhere; }
.tray-copy ul, .tray-copy ol { padding-left: 1.2rem; }
.tray-copy .me-card, .tray-copy section { box-shadow: none; padding: 0; margin: 0; background: none; }
.tray-copy h3 { font-size: .95rem; margin: var(--s2) 0 var(--s1); }
.tray-links { display: grid; gap: 4px; }
.tray-go { text-align: left; font-size: .8rem !important; padding: 2px 8px !important; white-space: normal; overflow-wrap: anywhere; width: 100%; border-radius: 8px !important; }
@media print { .pin-tray, .pin-btn { display: none !important; } }

/* Lists of lessons and material (lists.js, 2026-11-27): one bordered list of rows like the New lesson
   lists, sticky group headings, Search / Group / Sort / Filters above. Applies by data-list, before the script runs. */
ul.cards[data-list] { display: block; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin: var(--s2) 0 var(--s5); }
ul.cards[data-list] > .card { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s3); row-gap: 1px; align-items: center;
  padding: var(--s2) var(--s3); border-radius: 0; box-shadow: none; background: none; border-bottom: 1px solid var(--line); transform: none; }
ul.cards[data-list] > .card:last-child { border-bottom: 0; }
ul.cards[data-list] > .card:hover { transform: none; box-shadow: none; background: var(--accent-soft); }
ul.cards[data-list] > .card > * { grid-column: 1; }
ul.cards[data-list] > .card > .c-actions { grid-column: 2; grid-row: 1 / span 8; margin: 0; padding: 0; flex-wrap: nowrap; }
ul.cards[data-list] > .card .c-head { gap: var(--s2); }
ul.cards[data-list] > .card .c-title { font-size: 1rem; }
ul.cards[data-list] > .card .c-bar { max-width: 18rem; margin: 3px 0 1px; }
ul.cards[data-list] > .list-group-head { position: sticky; top: calc(var(--nav-h, 3.4rem)); z-index: 1; margin: 0; padding: var(--s1) var(--s3);
  background: var(--bg); border-bottom: 1px solid var(--line); font-size: .75rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.new-lesson-card ul.cards[data-list] { max-height: 24rem; overflow-y: auto; margin-bottom: var(--s2); }
.new-lesson-card ul.cards[data-list] > .list-group-head { top: 0; }
.list-bar { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; font-size: .85rem; color: var(--muted); margin: var(--s2) 0 0; }
.list-bar .lb-pick { display: inline-flex; align-items: center; gap: var(--s1); }
.list-bar select { font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px var(--s2); max-width: 11rem; }
.list-bar .list-search { flex: 1 1 12rem; max-width: 18rem; }
.list-filter-btn { border-radius: 999px !important; }
.list-filter-btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.list-filters { flex-basis: 100%; display: grid; gap: var(--s2); padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.list-filters[hidden] { display: none; }
.lf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s1); }
.lf-name { width: 5.5rem; font-size: .75rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.lf-chip { font: inherit; font-size: .8rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px var(--s2); cursor: pointer; }
.lf-chip:hover { color: var(--fg); border-color: var(--accent); }
.lf-chip[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.lf-clear { justify-self: start; }
@media (max-width: 40rem) { ul.cards[data-list] > .card { grid-template-columns: 1fr; } ul.cards[data-list] > .card > .c-actions { grid-column: 1; grid-row: auto; padding-top: var(--s1); } }

/* Facts on a student's card (Students, Today): a label column and its value, a line between (2026-11-27). */
.card .c-facts { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr); margin: var(--s1) 0 0; font-size: .84rem; }
.card .c-facts dt, .card .c-facts dd { margin: 0; padding: 4px 0; border-top: 1px solid var(--line); }
.card .c-facts dt { font-size: .7rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-top: 6px; }
.card .c-facts dd { color: var(--fg); }
.card .c-facts .c-doing { display: flex; flex-wrap: wrap; gap: 2px var(--s3); }
/* About them: blocks under small labels, lines between; your notes in a panel of their own. */
.ab-label { margin: 0 0 var(--s1) !important; font-size: .75rem !important; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ab-label .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.ab-block + .ab-block { border-top: 1px solid var(--line); margin-top: var(--s3); padding-top: var(--s3); }
.ab-block p { margin: var(--s1) 0; }
.about-grid .ab-notes { background: var(--bg); border-radius: 12px; padding: var(--s3); border: 1px solid var(--line); }
.about-grid .ab-notes .ab-label + textarea { margin-bottom: var(--s2); }

/* Rows: the actions sit in one column at the right, the same width in every row. */
ul.cards[data-list] > .card > .c-actions { min-width: 7.5rem; justify-content: flex-end; }
.lf-how { gap: var(--s2) var(--s4); }
.lf-how .lb-pick { display: inline-flex; align-items: center; gap: var(--s1); }
.lf-how select { font: inherit; font-size: .85rem; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px var(--s2); }
.lf-how .lf-name { width: auto; }

/* Tiles on top of a list (lists.js data-tiles), in the New lesson card's style. */
.kind-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: var(--s2); margin: var(--s2) 0 var(--s1); }
.kind-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: var(--s2) var(--s3) !important; border-radius: 12px !important; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); text-align: left; font: inherit; color: var(--fg); transition: border-color .15s, background .15s; }
.kind-tile strong { font-size: .95rem; }
.kind-tile span { font-size: .78rem; color: var(--muted); }
.kind-tile:hover { border-color: var(--accent); }
.kind-tile[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.areas > .area[hidden] { display: none; }
.topic-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: var(--s2); margin: var(--s2) 0 var(--s3); }
a.topic-tile { text-decoration: none; }
.topic-tile .share-bar { width: 100%; margin: 4px 0 2px; }
.topic-tile.current { border-color: var(--accent); }
.kind-tiles { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
.kind-tile strong { overflow-wrap: anywhere; line-height: 1.3; }

/* A tiled section in one lighter panel, like the New lesson card (2026-11-27): tiles on the panel's
   surface in the page's tone, the list under them. Names wrap, never cut. */
.tile-panel { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); padding: var(--s3) var(--s4) var(--s4); margin: var(--s2) 0 var(--s5); }
.tile-panel > .kind-tiles { margin-top: 0; padding-bottom: var(--s3); border-bottom: 1px solid var(--line); margin-bottom: var(--s2); }
.tile-panel > ul.cards[data-list] { margin-bottom: 0; }
.tile-panel .areas { margin-top: var(--s3); }
.kind-tile, .kind-tile strong, .kind-tile span { white-space: normal; overflow: visible; text-overflow: clip; }
.card .c-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* one short line on a student's card */
/* One page width everywhere (the teacher, 2026-11-27): the width of a student's page. The login box,
   print pages and Watch (the student's own width) keep theirs. */
main.wide, main.reading.wide-today, main:not([class]), main[class=""] { max-width: 44rem; }

/* Generate: topics / scenes as a plain two-column list of tick boxes (2026-11-27), then one row:
   your own, Suggest, Write it myself. */
.rf-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px var(--s4); padding: 0; margin: var(--s2) 0 var(--s3); background: none; border: 0; }
.rf-cats label.chip { display: flex; align-items: center; gap: var(--s2); padding: 4px 0; cursor: pointer; }
.rf-cats label.chip input { position: static; opacity: 1; width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent); }
.rf-cats label.chip span { display: inline; padding: 0; border: 0; background: none; color: var(--fg); font-size: .92rem; text-align: left; }
.rf-cats label.chip input:checked + span { background: none; color: var(--fg); font-weight: 600; }
.rf-cats label.chip span.cool { margin-left: var(--s1); font-size: .68rem; font-weight: 400; background: var(--draft-soft); color: var(--draft); border-radius: 999px; padding: 0 5px; }
@media (max-width: 30rem) { .rf-cats { grid-template-columns: 1fr; } }
.make-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: var(--s4); }
.rf-own { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.rf-own input { flex: 1 1 14rem; font: inherit; font-size: .95rem; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px var(--s2); }

/* The student's pages: cards to study as a tile; one panel nested in another loses its own frame. */
.study-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: var(--s2); margin: var(--s2) 0 var(--s4); }
a.kind-tile { text-decoration: none; }
.kind-tile.is-done { cursor: default; color: var(--muted); }
.tile-panel > .study-tiles { margin: 0; }
.tile-panel .tile-panel { background: none; box-shadow: none; padding: 0; margin: 0; }
.history-blocks > section > h2.part:first-child { margin-top: var(--s2); }
.todo-more { margin-top: var(--s2); }
.rf-label { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.rf-label details.hint { margin-left: 0; }
/* The mark after Check sits next to the answer (2026-11-27): where the field is inside the sentence
   (gaps, word pools, forms), the sentence and the row under it are one line. */
main.me .answer-box:has(.prompt input) .prompt { display: inline; }
main.me .answer-box:has(.prompt input) .answer-row { display: inline-flex; margin-left: var(--s2); vertical-align: baseline; }
/* "?" stays small and next to its title, never a line of its own. */
details.hint { vertical-align: 0.1em; }
h1 details.hint > summary, h2 details.hint > summary { width: 1.2rem; height: 1.2rem; font-size: .72rem; }
/* Wide: the page takes the whole screen (theme.js, the ⇔ in the top bar); Watch keeps the student's width. */
:root[data-width="wide"] main:not(.narrow):not(.print-page):not(.watching) { max-width: min(100%, 110rem); }
:root[data-width="wide"] .width-toggle { color: var(--accent); }

/* A student's page (2026-11-27): New lesson | Given as tiles; the New lesson card sits inside the block. */
.student-main .new-lesson-card { background: none; box-shadow: none; padding: 0; margin: 0; }
.pause-form { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); }
.pause-form label { display: inline-flex; gap: 4px; align-items: center; }

/* Student side (2026-11-27): Lesson history | Your journey as tabs; + N more as a tile; the cards tiles. */
.page-tabs { display: flex; gap: var(--s4); margin: var(--s4) 0 var(--s3); border-bottom: 1px solid var(--line); }
.page-tabs a { font-size: 1.6rem; font-weight: 750; color: var(--faint); text-decoration: none; padding-bottom: var(--s1); }
.page-tabs a[aria-current="page"] { color: var(--fg); box-shadow: inset 0 -3px 0 var(--accent); }
.page-tabs a:hover { color: var(--fg); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.todo-more > summary.more-tile { list-style: none; display: inline-flex; margin: var(--s2) 0; width: 12rem; }
.todo-more > summary.more-tile::-webkit-details-marker { display: none; }
.todo-more[open] > summary.more-tile strong::after { content: " ▴"; }
.pick-tile { cursor: default; }
.pick-tile .pick-n { display: flex; align-items: center; gap: var(--s1); margin-top: 4px; }
.pick-tile .pick-n input { width: 3.6rem; font: inherit; padding: 2px 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--fg); }
main.grammar-full .graph { max-height: none; }

/* Tiles the same size everywhere (2026-11-27): New lesson kinds and list tiles alike. */
.nl-kinds > label, .kind-tile { min-height: 4.2rem; box-sizing: border-box; justify-content: flex-start; }
.nl-kinds > label.suggested { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
.nl-kinds > input:checked + label.suggested { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 2px var(--ok-soft); }
.next-box { display: inline-block; font-size: .72rem; font-weight: 650; padding: 1px 7px; border-radius: 4px; background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok); vertical-align: .15em; }
details.hint.bulb > summary { background: none; font-size: .95rem; width: auto; height: auto; }
.st-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kind-tile.live-tile { border-color: var(--ok); background: var(--ok-soft); }

/* Lessons · Journey · Grammar tree: one segmented switch (2026-11-27). */
.seg-tabs { display: inline-flex; gap: 4px; padding: 4px; margin: var(--s4) 0 var(--s3); background: var(--surface); border-radius: 999px; box-shadow: 0 0 0 1px var(--line); }
.seg-tabs a { padding: var(--s2) var(--s4); border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 650; }
.seg-tabs a:hover { color: var(--fg); background: var(--bg); }
.seg-tabs a[aria-current="page"] { background: var(--accent); color: var(--surface); }
/* Cards: the two tiles full width, bigger. */
.cards-tiles { grid-template-columns: 1fr !important; }
.cards-tiles .kind-tile { min-height: 5.5rem; padding: var(--s3) var(--s4) !important; }
.cards-tiles .kind-tile strong { font-size: 1.15rem; }
.cards-tiles .kind-tile span { font-size: .9rem; }
/* The top bar's right side: closer together. */
nav.top { gap: var(--s4); }
.list-bar .list-new { margin-left: auto; }
.list-bar .list-new + .list-count { margin-left: var(--s2); }
.mix-options { margin-top: var(--s2); }
.mix-any .nl-row { gap: var(--s2) var(--s3); }

/* The student's Visible switch as a ring only (2026-11-27): green ring visible, grey ring on their own;
   the words stay for screen readers; a soft glow while the teacher is there. */
nav.top .share-pill { padding: 6px !important; border: 0; background: none; box-shadow: none; }
nav.top .share-pill [data-share-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
nav.top .share-pill .sp-dot { width: .8rem; height: .8rem; background: transparent !important; box-shadow: inset 0 0 0 2px var(--ok) !important; }
nav.top .share-pill.off .sp-dot { box-shadow: inset 0 0 0 2px var(--faint) !important; }
body.live-other-here nav.top .share-pill:not(.off) .sp-dot { box-shadow: inset 0 0 0 2px var(--ok), 0 0 6px var(--ok) !important; }
.more-btn { margin-left: var(--s2); vertical-align: .1em; text-transform: none; letter-spacing: 0; }

/* The students' bottom-right dock (2026-11-27): Help, Aa (look up words), + Word as round icons,
   faint until the corner is pointed at, like the bottom-left dock (The text, Kept). */
.float-dock .dock-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0 !important;
  border-radius: 999px !important; background: var(--surface); box-shadow: 0 2px 10px rgba(0,0,0,.16); opacity: .55; transition: opacity .2s;
  font-weight: 700; font-size: .9rem; color: var(--fg); }
.float-dock .dock-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.float-dock:hover .dock-icon, .float-dock:focus-within .dock-icon, .float-dock .dock-icon[aria-expanded="true"], .float-dock .dock-icon[aria-pressed="true"] { opacity: 1; }
.float-dock .dock-icon[aria-pressed="true"] { background: var(--accent); color: var(--surface); }
.float-dock .dock-icon.asked { color: var(--ok); box-shadow: 0 0 0 2px var(--ok), 0 2px 10px rgba(0,0,0,.16); opacity: 1; }
@media (hover: none) { .float-dock .dock-icon { opacity: 1; } }
/* The top right: one tight row of small controls. */
nav.top .theme-toggle, nav.top .share-pill { width: 32px; height: 32px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; }

/* The painted road (2026-11-27): items by kind, coloured by how it went; labels with a halo on the painting. */
.road-stretch.painted .road-svg { display: block; width: 100%; height: auto; }
.r-item.tier-gold { --item: #e0b04a; }
.r-item.tier-silver { --item: #d4d6d8; }
.r-item.tier-bronze { --item: #b47a46; }
.r-item.tier-none { --item: #f3eee2; }
.r-item.unfinished { opacity: .75; }
.road-stretch.painted .r-label, .road-stretch.painted .r-date { paint-order: stroke; stroke: rgba(251,248,240,.92); stroke-width: 4px; stroke-linejoin: round; }
.road-stretch.painted a.r-stop:hover .r-item { filter: drop-shadow(0 0 4px #fff); }
.road-spirit { position: absolute; width: 64px; height: 56px; margin: -46px 0 0 -32px; z-index: 3; cursor: pointer; }
.road-spirit canvas { width: 100%; height: 100%; display: block; }

/* Where two painted pictures meet (2026-11-27): drifting mist over the join, a wooden bridge
   where one path ends and the next begins; the bridge games come here. */
.road-crossing { position: relative; height: 0; z-index: 3; pointer-events: none; }
.road-crossing .mist { position: absolute; left: 0; right: 0; top: -80px; height: 160px;
  background: radial-gradient(ellipse 60% 50% at 30% 50%, rgba(243,238,226,.95), rgba(243,238,226,0) 70%),
              radial-gradient(ellipse 55% 45% at 75% 45%, rgba(243,238,226,.9), rgba(243,238,226,0) 70%),
              linear-gradient(to bottom, rgba(243,238,226,0), rgba(243,238,226,.85) 40%, rgba(243,238,226,.85) 60%, rgba(243,238,226,0));
  background-size: 140% 100%, 140% 100%, 100% 100%; animation: mist-drift 18s ease-in-out infinite alternate; }
@keyframes mist-drift { from { background-position: 0% 0, 100% 0, 0 0; } to { background-position: 100% 0, 0% 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { .road-crossing .mist { animation: none; } }
.road-crossing .bridge { position: absolute; top: -34px; width: 150px; height: 75px; margin-left: -75px; }
.bridge .b-deck { fill: #8a5a34; stroke: #2b2a22; stroke-width: 2; stroke-linejoin: round; }
.bridge .b-post { fill: none; stroke: #5a3a22; stroke-width: 3; stroke-linecap: round; }
.bridge .b-rail { fill: none; stroke: #2b2a22; stroke-width: 2.4; stroke-linecap: round; }
.road-life { position: absolute; pointer-events: none; z-index: 1; }
.road-crossing + .road-stretch.painted .road-name { top: 90px; }   /* the place's name below the mist */

/* The journey, one place at a time (2026-11-27): the title and what was collected on the picture itself. */
.journey-world { position: relative; margin-top: var(--s3); }
.journey-banner { position: absolute; z-index: 4; top: 14px; left: 50%; transform: translateX(-50%); text-align: center; pointer-events: none;
  background: rgba(251,248,240,.9); border: 1px solid #c9b48e; border-radius: 10px; padding: 6px 18px 8px; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.journey-banner h1 { margin: 0; font-size: 1.25rem; letter-spacing: .02em; }
.journey-count { margin: 2px 0 0; font-size: .78rem; color: var(--muted); display: flex; gap: var(--s2); justify-content: center; }
.journey-world .road-stretch[hidden], .journey-world .road-crossing { display: none; }
.journey-world .road-stretch { animation: place-in .9s ease both; }
.journey-world .road-stretch.from-above { animation-name: place-down; }
@keyframes place-in { from { opacity: 0; transform: translateY(40px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes place-down { from { opacity: 0; transform: translateY(-40px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.journey-nav { display: flex; justify-content: center; gap: var(--s2); margin: var(--s2) 0; }
.journey-world .road-name { top: auto; bottom: 10px; }
@media (prefers-reduced-motion: reduce) { .journey-world .road-stretch { animation: none; } }
.water-pet.wandering { transition: left 6s ease-in-out, top 6s ease-in-out; }
.water-pet .pet-pin { position: absolute; top: 2px; right: 28px; width: 22px; height: 22px; padding: 0 !important; font-size: .7rem; opacity: 0; transition: opacity .15s; filter: grayscale(1); }
.water-pet:hover .pet-pin, .water-pet .pet-pin.on { opacity: 1; }
.water-pet .pet-pin.on { filter: none; }
.water-pet.folded .pet-pin { display: none; }

/* The world's own look for words on the journey (2026-11-27): parchment signs, brown ink, a book face. */
.world-sign { font-family: Georgia, "Times New Roman", serif; color: #3b2a1a; background: linear-gradient(#f6ead0, #e6d2a6);
  border: 2px solid #6b4a2a; border-radius: 6px; box-shadow: 0 3px 0 #4a3220, 0 6px 14px rgba(0,0,0,.35); }
.journey-banner { padding: 6px 20px 8px; }
.journey-banner h1 { font-family: inherit; font-size: 1.35rem; font-weight: 700; letter-spacing: .03em; color: #3b2a1a; }
.journey-count { color: #3b2a1a; font-size: .85rem; gap: var(--s3); }
.journey-count span { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.journey-count svg { width: 18px; height: 18px; }
.journey-world .road-name { top: auto !important; bottom: 12px !important; font-family: Georgia, serif; color: #3b2a1a; background: linear-gradient(#f6ead0, #e6d2a6);
  border: 1.5px solid #6b4a2a; text-transform: none; letter-spacing: .02em; font-size: .8rem; }
.journey-go { position: absolute; left: 50%; transform: translateX(-50%); z-index: 4; padding: 5px 16px !important; font-size: .9rem; cursor: pointer; }
.journey-go:hover { background: linear-gradient(#fbf1dc, #ecdab3); }
.journey-go.earlier { bottom: 46px; }
.journey-go.now { top: 92px; }
.journey-nav { display: none; }
/* The corner tools fold into a small water ball; the companion never sits on them. */
.float-dock { align-items: center; }
.float-dock .dock-ball { width: 46px; height: 46px; padding: 0 !important; border: 0; background: none; box-shadow: none; cursor: pointer; order: 9; }
.float-dock .dock-ball canvas { width: 100%; height: 100%; display: block; }
.float-dock .dock-icon { display: none; }
.float-dock:hover .dock-icon, .float-dock.open .dock-icon, .float-dock:focus-within .dock-icon { display: inline-flex; }
body.pet-holds .float-dock { opacity: 1 !important; pointer-events: auto !important; transform: none !important; }
/* The companion's pin only while it is pointed at. */
.water-pet .pet-pin.on { opacity: 0; }
.water-pet:hover .pet-pin { opacity: .8; }
.road-stretch.painted .r-label, .road-stretch.painted .r-date { font-family: Georgia, "Times New Roman", serif; fill: #3b2a1a; }   /* the world's book face */

/* Fantasy signs (2026-11-27), offline faces only: the title a parchment scroll with curled ends and a
   gold-and-brown double rim; the way buttons dark wooden signs; names in small capitals. In the corners,
   so nothing covers the path and its items. */
.world-scroll, .world-wood, .journey-world .road-name, .road-stretch.painted .r-label {
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", Georgia, serif; font-variant: small-caps; letter-spacing: .04em; }
.journey-banner.world-scroll { left: 16px; transform: none; top: 14px; position: absolute; z-index: 4; padding: 8px 26px 10px; text-align: center;
  color: #3b2a1a; background: radial-gradient(ellipse at 50% 40%, #fbf0d6 0%, #efdcb0 70%, #e2c88f 100%);
  border: 2px solid #6b4a2a; outline: 2px solid #c9a24a; outline-offset: -6px; border-radius: 4px;
  box-shadow: 0 4px 0 #4a3220, 0 8px 18px rgba(0,0,0,.4); }
.journey-banner.world-scroll::before, .journey-banner.world-scroll::after { content: ""; position: absolute; top: -6px; bottom: -6px; width: 14px;
  background: linear-gradient(90deg, #b8935a, #f3e2b8 45%, #a8824a); border: 2px solid #6b4a2a; border-radius: 8px; }
.journey-banner.world-scroll::before { left: -12px; }
.journey-banner.world-scroll::after { right: -12px; }
.journey-banner.world-scroll h1 { font-family: inherit; font-size: 1.3rem; margin: 0; }
.world-wood { position: absolute; z-index: 4; color: #f6e7c4; background: linear-gradient(#7a5434, #5a3a22); border: 2px solid #3a2414;
  outline: 1.5px solid #c9a24a; outline-offset: -5px; border-radius: 5px; box-shadow: 0 3px 0 #2a180c, 0 6px 14px rgba(0,0,0,.45);
  padding: 6px 16px !important; font-size: .95rem; cursor: pointer; text-shadow: 0 1px 0 #2a180c; }
.world-wood:hover { background: linear-gradient(#8a6040, #664328); color: #fff3d6; }
.journey-go { left: auto; transform: none; }
.journey-go.earlier { right: 16px; bottom: 16px; top: auto; }
.journey-go.now { right: 16px; top: 16px; bottom: auto; }
.journey-world .road-name { left: 16px !important; bottom: 16px !important; background: linear-gradient(#f6ead0, #e6d2a6); color: #3b2a1a;
  border: 1.5px solid #6b4a2a; outline: 1px solid #c9a24a; outline-offset: -4px; padding: 3px 12px; font-size: .85rem; }
.road-stretch.painted .r-label { font-size: 15px; font-weight: 700; fill: #2a1a0c; stroke: rgba(246,234,208,.95); stroke-width: 5px; }
.road-stretch.painted .r-date { font-size: 11px; fill: #4a3220; }
/* The corner drop; the folded companion just above it, never on it; pointing at either opens the tools. */
.float-dock .dock-ball { width: 46px; height: 46px; }
body.pet-reveal .float-dock .dock-icon { display: inline-flex; }

/* An item's card on the journey (2026-11-27): a small parchment with its name, title, date and result. */
.road-card.world-scroll { position: absolute; z-index: 5; width: 15rem; padding: 10px 16px 12px; text-align: left; font-variant: normal; letter-spacing: 0; }
.road-card[hidden] { display: none; }
.road-card strong { display: block; font-variant: small-caps; letter-spacing: .04em; font-size: 1.05rem; padding-right: 18px; }
.road-card-title { margin: 2px 0; font-size: .88rem; line-height: 1.3; }
.road-card-meta { margin: 0 0 8px; font-size: .8rem; color: #5a4430; }
.road-card-open.world-wood { position: static; display: inline-block; text-decoration: none; font-size: .85rem; padding: 3px 12px !important; }
.road-card-close { position: absolute; top: 4px; right: 6px; border: 0; background: none; box-shadow: none; padding: 0 4px !important; font-size: 1.1rem; color: #5a4430; cursor: pointer; }
.road-card.world-scroll { color: #3b2a1a; background: radial-gradient(ellipse at 50% 40%, #fbf0d6 0%, #efdcb0 70%, #e2c88f 100%);
  border: 2px solid #6b4a2a; outline: 2px solid #c9a24a; outline-offset: -6px; border-radius: 4px; box-shadow: 0 4px 0 #4a3220, 0 8px 18px rgba(0,0,0,.4); }

/* A long generation finished while the teacher was elsewhere (2026-11-27). */
.made-ready { max-width: var(--page, 60rem); margin: var(--s3) auto 0; padding: var(--s2) var(--s3); background: var(--ok-soft); border-radius: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.made-ready.failed { background: var(--note-soft); }
.made-ready.busy { background: var(--accent-soft); }

/* A job's waiting page (lessons/jobs.py): the glass of water and the time, then the result. */
.job-wait { display: grid; gap: var(--s3); justify-items: start; }
.job-wait .busy-water { margin: 0; }
.job-wait ul { margin: 0; }

/* Spots in the pictures (2026-11-27): an invisible round button over the painted thing, a soft glow on hover. */
.spot { position: absolute; z-index: 3; border: 0 !important; background: transparent !important; box-shadow: none !important; border-radius: 50%; padding: 0 !important; cursor: pointer; }
.spot:hover, .spot:focus-visible { background: radial-gradient(circle, rgba(255,240,180,.28), rgba(255,240,180,0) 70%) !important; }
.spot-note.world-scroll { position: absolute; z-index: 5; max-width: 15rem; padding: 8px 14px 10px; font-variant: normal; letter-spacing: 0; font-size: .9rem; line-height: 1.35;
  color: #3b2a1a; background: radial-gradient(ellipse at 50% 40%, #fbf0d6 0%, #efdcb0 70%, #e2c88f 100%);
  border: 2px solid #6b4a2a; outline: 2px solid #c9a24a; outline-offset: -6px; border-radius: 4px; box-shadow: 0 4px 0 #4a3220, 0 8px 18px rgba(0,0,0,.4); }
.spot-note p { margin: 0 0 4px; }
.spot-note .spot-more { font-style: italic; }
.spot-note .spot-show.world-wood { position: static; font-size: .8rem; padding: 2px 10px !important; }
.spot-bit { position: absolute; z-index: 4; pointer-events: none; width: 6px; height: 6px; border-radius: 50%; animation: spot-fly 1.6s ease-out forwards; }
.spot-bit.spore { background: rgba(255,250,220,.9); box-shadow: 0 0 6px rgba(255,250,200,.9); }
.spot-bit.leaf { width: 9px; height: 5px; background: #e0b030; border-radius: 60% 0; animation-duration: 2.2s; animation-timing-function: ease-in; }
@keyframes spot-fly { from { transform: translate(0, 0) rotate(0); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) rotate(260deg); opacity: 0; } }

/* The reading form, tidied (2026-11-27): hints inside their field, topic picks as tiles, notes behind "?". */
.rf-hint { font-size: .75rem; color: var(--faint); }
.rf-hint:empty { display: none; }
.rf-size [data-size-out] { flex-basis: auto; }
.rf-size .rf-size-preview { flex-basis: auto; }
.rf-size .rf-size-preview[open] { flex-basis: 100%; }
.rf-size-preview > summary.chip, .recent-panel > summary.chip { list-style: none; cursor: pointer; display: inline-flex; font-size: .85rem; }
.rf-size-preview > summary::-webkit-details-marker, .recent-panel > summary::-webkit-details-marker { display: none; }
.recent-panel { background: none; box-shadow: none; padding: 0; border: 0; }
.recent-panel > .panel-body { margin-top: var(--s2); }
.rf-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: var(--s4); }
.rf-part { display: grid; gap: var(--s2); align-content: start; }
.rf-part-head { display: grid; gap: 4px; font-weight: 650; font-size: .9rem; }
.rf-part-head input { font: inherit; font-weight: 400; font-size: .95rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px var(--s2); }
.rf-picks { display: grid; gap: 6px; }
.rf-pick { display: block; cursor: pointer; }
.rf-pick input { position: absolute; opacity: 0; pointer-events: none; }
.rf-pick span { display: block; padding: 6px 10px; border-radius: 8px; background: var(--bg); box-shadow: 0 0 0 1px var(--line); font-size: .88rem; line-height: 1.3; }
.rf-pick:hover span { box-shadow: 0 0 0 1px var(--accent); }
.rf-pick input:checked + span { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); font-weight: 600; }
.rf-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.rf-go .hint { display: inline-block; }
/* Review: counts as chips, the less used buttons quieter. */
.rv-counts { display: flex; flex-wrap: wrap; gap: var(--s1); margin: var(--s1) 0 var(--s2); }
.rv-counts .quiet-chip { background: none; box-shadow: 0 0 0 1px var(--line); color: var(--muted); text-decoration: none; }
.review-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.review-tools .rv-more { display: inline-flex; flex-wrap: wrap; gap: var(--s1); margin-left: var(--s2); }
details.rf-size-preview > summary, details.panel.recent-panel > summary { display: inline-flex; align-items: center; padding: 3px 12px; border-radius: 999px;
  background: var(--surface); box-shadow: 0 0 0 1px var(--line); font-size: .82rem; color: var(--muted); cursor: pointer; }
details.rf-size-preview > summary:hover, details.panel.recent-panel > summary:hover { color: var(--fg); box-shadow: 0 0 0 1px var(--accent); }
details.panel.recent-panel { background: none !important; box-shadow: none !important; border: 0 !important; padding: 0 !important; }
.rf-size { gap: var(--s2); }
.rv-counts .c-chip { font-size: .78rem; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 1px 10px; box-shadow: 0 0 0 1px var(--line); }
.rv-counts .c-chip.live { color: var(--ok); background: var(--ok-soft); box-shadow: none; }
.rv-counts .c-chip.warn { color: var(--draft); background: var(--draft-soft); box-shadow: none; }
.review-tools { margin: var(--s2) 0; }

/* The week ahead on Today (2026-11-27): one row per day, the lessons in time order. */
.week-days { list-style: none; margin: 0 0 var(--s5); padding: var(--s2) var(--s4); background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); }
.week-day { display: grid; grid-template-columns: 7.5rem 1fr; gap: var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--line); }
.week-day:first-child { border-top: 0; }
.week-day .wd { color: var(--muted); font-size: .88rem; padding-top: 2px; }
.week-day.is-today .wd { color: var(--accent); font-weight: 700; }
.week-day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.week-day li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2); }
.week-day .wt { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 3rem; }
.week-day a { text-decoration: none; }
.week-day .wl { color: var(--muted); font-size: .88rem; }
.week-day .wl:hover { color: var(--accent); }
.week-day .wl.next::before { content: "next: "; color: var(--faint); }
.week-day .wl.none { color: var(--wrong); }
.slot-list { list-style: none; margin: 0 0 var(--s2); padding: 0; display: grid; gap: 2px; }
.slot-list li { display: flex; align-items: center; gap: var(--s2); }
.slot-add input[type=time] { width: 7rem; }
.slot-add input[type=number] { width: 4.5rem; }

.spend-note { max-width: var(--page, 60rem); margin: var(--s3) auto 0; padding: var(--s1) var(--s3); border-radius: 10px; background: var(--note-soft); color: var(--muted); font-size: .85rem; }

.rf-picks-2 { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.sim-plan { display: grid; gap: var(--s2); }
.sim-plan .hint { display: inline-block; }
.slot-add select { width: auto; flex: 0 0 auto; }
.slot-add { flex-wrap: wrap; align-items: center; }
.week-empty { padding: var(--s3) var(--s4); background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); margin: 0 0 var(--s5); }
.more-link { margin: var(--s2) 0 var(--s5); }
.card.is-here { box-shadow: 0 0 0 2px var(--ok); }

/* Lessons: Given | Make (2026-11-27), a two-part switch above the kind tiles. */
.sides { display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 var(--s3); background: var(--note-soft); border-radius: 999px; }
.sides a { padding: 5px 18px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem; }
.sides a:hover { color: var(--fg); }
.sides a[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
/* Made so far | Given under a kind on Lessons (2026-11-29): the same pill, with buttons. */
.sides button { padding: 5px 18px !important; border: 0 !important; border-radius: 999px !important; background: none !important; box-shadow: none !important;
  color: var(--muted); font-weight: 600; font-size: .92rem; cursor: pointer; }
.sides button:hover { color: var(--fg); }
.sides button[aria-selected="true"] { background: var(--surface) !important; color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.12) !important; }
.below-sides { margin-top: var(--s2); }
.prepared { margin-top: var(--s5); }

/* Two lesson-style rows side by side (the student's cards, 2026-11-27). */
.todo-list.two-up { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--s2); }
.todo-list.two-up .todo.is-done { opacity: .7; }
.page-foot { margin-top: var(--s6, 3rem); text-align: center; font-size: .88rem; }
.page-foot a { color: var(--muted); }

/* Make: the same compact tiles in a light panel as Given (2026-11-27). */
.make-panel { padding: var(--s3); }
.make-panel .make-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: var(--s2); margin: 0; }
.make-panel .kind-tile { min-height: 0; padding: var(--s2) var(--s3); }
.todo-list.two-up + .todo-list.two-up, .todo-list.two-up { margin-bottom: var(--s4); }

/* 2026-11-27 evening round. */
.st-head h1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s3); }
.st-status { font-size: .85rem; font-weight: 500; color: var(--muted); }
.st-status.here { color: var(--ok); text-decoration: none; padding: 2px 10px; border-radius: 999px; background: var(--ok-soft); }
.st-head-links { margin: var(--s1) 0 0; }
.remind { margin: var(--s2) 0 0; color: var(--wrong); font-size: .88rem; }
.page-head h1 .sides { margin: 0 0 0 var(--s3); vertical-align: middle; font-size: 1rem; }
.page-head h1 .sides a { font-size: .9rem; }
h2.part .small-sides { margin: 0 0 0 var(--s2); padding: 2px; vertical-align: middle; text-transform: none; letter-spacing: 0; }
h2.part .small-sides a { padding: 2px 12px; font-size: .8rem; }
.make-panel { margin-bottom: var(--s3); }
.make-panel .kind-tile span { display: block; font-size: .8rem; color: var(--muted); }
.make-panel .kind-tiles { border: 0; padding: 0; }
.make-panel + .rv-section, .make-panel + section { margin-top: 0; }
.slot-add select { width: auto; }

/* 2026-11-27, late: chips instead of sentences. */
.lesson-chips, .word-stats, .slot-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: var(--s1) 0 var(--s2); }
.lesson-chips .c-chip, .word-stats .c-chip, .slot-list .c-chip, .ab-block .c-chip { font-size: .78rem; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 2px 10px; box-shadow: 0 0 0 1px var(--line); text-decoration: none; white-space: nowrap; }
.lesson-chips .c-chip.live, .ab-block .c-chip.live { color: var(--ok); background: var(--ok-soft); box-shadow: none; }
.c-chip.warn { color: var(--wrong) !important; }
.c-chip.slot { display: inline-flex; align-items: center; gap: 4px; color: var(--fg); }
.c-chip.slot form { display: inline; margin: 0; }
.chip-x { border: 0 !important; background: none !important; box-shadow: none !important; padding: 0 2px !important; color: var(--faint); cursor: pointer; font-size: .9rem; line-height: 1; }
.chip-x:hover { color: var(--wrong); }
.more-menu { display: inline-block; position: relative; }
.more-menu > summary { list-style: none; cursor: pointer; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu .more-list { position: absolute; z-index: 6; top: calc(100% + 4px); left: 0; display: grid; gap: 2px; padding: 6px; min-width: 14rem;
  background: var(--surface); border-radius: 10px; box-shadow: 0 0 0 1px var(--line), 0 8px 20px rgba(0,0,0,.12); }
.more-menu .more-list > *, .more-menu .more-list form button { justify-content: flex-start; text-align: left; width: 100%; }
.lesson-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.toolbar .small-sides { margin: 0; }
.toolbar-end { display: inline-flex; flex-wrap: wrap; gap: var(--s1); margin-left: auto; }
.jump.few { display: none; }
.flash-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.flash-form .hint { display: inline-block; }

.slot-list form.c-chip.slot { margin: 0; display: inline-flex; flex-wrap: nowrap; }
.slot-add { display: flex; flex-wrap: nowrap; gap: 4px; align-items: center; }
.slot-add select { font-size: .82rem; padding: 2px 4px; min-width: 0; }
.slot-add button { flex: 0 0 auto; }
.ab-label .hint { display: inline-block; }

.small-sides { padding: 2px; }
.small-sides a { padding: 2px 12px; font-size: .8rem; }
.lesson-head .toolbar { margin-top: var(--s2); }

/* A student's words for the teacher (2026-11-27): numbers, what to nudge, compact rows. */
.nudge { display: grid; gap: var(--s3); margin-bottom: var(--s5); }
.set-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); overflow: hidden; font-size: .88rem; }
.set-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.set-table td { padding: 7px 12px; border-top: 1px solid var(--line); }
.set-table tr:first-child td { border-top: 0; }
.set-table td:nth-child(n+2) { font-variant-numeric: tabular-nums; width: 4.5rem; }
.set-table .set-bar { width: 8rem; }
.set-table .c-bar { display: block; height: 6px; border-radius: 3px; background: var(--note-soft); overflow: hidden; }
.set-table .c-bar span { display: block; height: 100%; background: var(--ok); }
.set-table .untouched td:first-child { color: var(--fg); }
.set-table .c-chip { font-size: .7rem; padding: 0 8px; border-radius: 999px; background: var(--bg); box-shadow: 0 0 0 1px var(--line); }
.words-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-bottom: var(--s3); }
.words-add { display: flex; gap: 4px; }
.words-add input { width: 16rem; }
.more-list.wide { min-width: 24rem; padding: var(--s3); gap: var(--s3); right: 0; left: auto; }
.more-list .wordset-fold { margin: 0; }
.wrows { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); }
.wrow { border-top: 1px solid var(--line); }
.wrow:first-child { border-top: 0; }
.wrow summary { display: grid; grid-template-columns: minmax(8rem, 1fr) 2fr auto; gap: var(--s3); align-items: center; padding: 8px 14px; cursor: pointer; list-style: none; }
.wrow summary::-webkit-details-marker { display: none; }
.wrow summary:hover { background: var(--bg); }
.wrow.unchecked .w-word::after { content: " •"; color: var(--wrong); }
.w-mean { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-chips { display: flex; gap: 4px; }
.w-chips .c-chip { font-size: .72rem; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 0 8px; box-shadow: 0 0 0 1px var(--line); }
.w-chips .c-chip.live { color: var(--ok); background: var(--ok-soft); box-shadow: none; }
.w-chips .c-chip.warn { color: var(--wrong); }
.wrow .word-form { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px 14px 12px; }
.wrow .word-form input { font: inherit; font-size: .9rem; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.wrow .word-actions { grid-column: 1 / -1; display: flex; gap: 6px; }
.w-context { grid-column: 1 / -1; margin: 0; font-size: .82rem; color: var(--faint); font-style: italic; }
.wrow summary { grid-template-columns: 11rem minmax(0, 1fr) auto; }
.page-head h1 a { color: inherit; text-decoration: none; }
.page-head h1 a:hover { color: var(--accent); }

.todo .pick-n-input { width: 3.5rem; font: inherit; font-size: .85rem; padding: 0 4px; border: 1px solid var(--line); border-radius: 6px; }
.todo-list form.todo button { grid-area: b; }
.c-chip:empty { display: none; }

/* Review rows (2026-11-27): the content gets the room; model and prompt in the id's hover title. */
table.review { width: 100%; table-layout: auto; }
table.review td.content { width: 100%; min-width: 16rem; }
table.review td.id { width: 4.5rem; white-space: nowrap; }
table.review td.status { width: 1%; white-space: nowrap; }
/* Approve or To draft, Edit, Retire side by side, never one per line (the teacher, 2026-11-29). */
table.review td.actions { width: 1%; white-space: nowrap; }
table.review td.actions > * { display: inline-block; width: auto; margin: 0 4px 4px 0; vertical-align: middle; }
table.review td.actions button { font-size: .8rem; padding: 2px 10px; }
/* The review page's Generate exercises: one tidy row in the same style as the other forms. */
.grow-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: var(--s2) var(--s3); background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); }
.grow-form select, .grow-form input[type=number] { font: inherit; font-size: .85rem; padding: 3px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); max-width: 14rem; }
.grow-form input[type=number] { width: 3.5rem; }
.grow-form .k { font-size: .75rem; }
.grow-form button.primary { font-size: .85rem; padding: 3px 14px; }
.review-tools [data-only-flagged] { white-space: nowrap; }

/* A student's words, answering: are they practising, how far are they, what to nudge (2026-11-27). */
.wstat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: var(--s3); margin: var(--s3) 0 var(--s5); }
.wstat { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); padding: var(--s3) var(--s4); display: grid; gap: var(--s2); align-content: start; }
.wstat h3 { margin: 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.wstat.has-nudge { box-shadow: 0 0 0 1px var(--line), inset 3px 0 0 var(--wrong); }
.wstat-line { margin: 0; font-size: .88rem; color: var(--muted); }
.wstat-line strong { color: var(--fg); }
.wstat-line.ok { color: var(--ok); font-weight: 600; }
.wstat-big { margin: 0; font-size: .9rem; color: var(--muted); }
.wstat-big strong { font-size: 1.8rem; color: var(--fg); margin-right: 4px; }
.wstat .c-bar, .set-row .c-bar { display: block; height: 6px; border-radius: 3px; background: var(--note-soft); overflow: hidden; }
.wstat .c-bar span, .set-row .c-bar span { display: block; height: 100%; background: var(--ok); }
.days7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; height: 3.4rem; align-items: end; }
.d7 { display: grid; grid-template-rows: 1fr auto; height: 100%; text-align: center; }
.d7-bar { align-self: end; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.d7-day { font-size: .65rem; color: var(--faint); }
.nudges { margin: 0; padding-left: 1.1rem; font-size: .88rem; display: grid; gap: 4px; }
.set-rows, .wrows { list-style: none; margin: 0 0 var(--s5); padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) 6.5rem 9rem; gap: var(--s3); align-items: center; padding: 9px 14px; border-top: 1px solid var(--line); font-size: .9rem; }
.set-row:first-child { border-top: 0; }
.sr-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-when { color: var(--faint); font-size: .8rem; margin-left: 4px; }
.sr-status { font-size: .78rem; color: var(--muted); }
.status-not-started .sr-status { color: var(--wrong); }
.status-done .sr-status { color: var(--ok); }
.sr-bar { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; }
.sr-n { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.w-state { font-size: .78rem; color: var(--muted); justify-self: end; }
.w-state.state-known { color: var(--ok); }
.w-state.state-to-check { color: var(--wrong); }

/* Controls and buttons in rows (2026-11-27): a label beside each control; buttons in their own row. */
.ctl-row, .btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin: var(--s2) 0; }
.btn-row { gap: var(--s2); }
.ctl { display: inline-flex; align-items: center; gap: 8px; }
.ctl-k { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ctl select, .ctl input { font: inherit; font-size: .88rem; padding: 3px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--fg); max-width: 18rem; }
.ctl input[type=number] { width: 4rem; }
.ctl .sides { margin: 0; }
.rv-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); margin: var(--s2) 0; }
.rv-top .rv-counts { margin: 0; }
.rv-packs { display: inline-block; position: relative; }
.rv-packs > summary { list-style: none; cursor: pointer; }
.rv-packs > summary::-webkit-details-marker { display: none; }
.rv-packs[open] .packs { position: absolute; z-index: 6; top: calc(100% + 4px); left: 0; min-width: 22rem; max-height: 60vh; overflow: auto; background: var(--surface); padding: var(--s2); border-radius: 10px; box-shadow: 0 0 0 1px var(--line), 0 8px 20px rgba(0,0,0,.12); }
.grow-form { margin: var(--s3) 0; padding: var(--s3) var(--s4); gap: var(--s2) var(--s3); }
.grow-title { flex-basis: 100%; margin: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.grow-form .grow-busy, .grow-form .grow-out { flex-basis: 100%; }
/* Lesson facts: each value with what it is. */
.facts { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin: var(--s2) 0 var(--s3); }
.facts > div { display: grid; gap: 1px; }
.facts dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.facts dd a { color: inherit; }
.facts .presence.here { color: var(--ok); }
/* "Right now" reads like the other values beside it, not as a pill (2026-11-28). */
.facts dd.presence { font-size: inherit; line-height: inherit; background: none; padding: 0; margin: 0; border-radius: 0; color: var(--muted); }
/* "More" sits on the same line as the buttons beside it. */
.lesson-actions > details.more-menu { display: flex; }
/* Pages where the text is read closely open wide (review, approve). */
main.always-wide { max-width: min(100%, 96rem) !important; }

/* Which words: chips coloured by state (due / learning / new / known). */
.wchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--s4); }
.set-rows .wchips { padding: 4px 14px 12px; margin: 0; }
.wchip, .wk { font-size: .82rem; padding: 2px 10px; border-radius: 999px; background: var(--bg); box-shadow: 0 0 0 1px var(--line); color: var(--fg); }
.wchip.due, .wk.due { background: #f6e2dc; box-shadow: 0 0 0 1px #e3b5a8; color: #7a2e1e; }
.wchip.learning, .wk.learning { background: var(--accent-soft); box-shadow: 0 0 0 1px #b9d6d2; }
.wchip.known, .wk.known { background: var(--ok-soft); box-shadow: 0 0 0 1px #c5d8b4; color: #34572a; }
.wchip.new, .wk.new { color: var(--muted); }
.w-key { display: inline-flex; gap: 4px; margin-left: var(--s2); vertical-align: middle; text-transform: none; letter-spacing: 0; font-weight: 400; }
.w-key .wk { font-size: .68rem; padding: 0 8px; }
.set-rows details > summary { list-style: none; cursor: pointer; }
.set-rows details > summary::-webkit-details-marker { display: none; }
.set-rows details > summary:hover { background: var(--bg); }
.set-rows > li { border-top: 1px solid var(--line); }
.set-rows > li:first-child { border-top: 0; }
.set-rows .set-row { border-top: 0; }

summary.button { display: inline-flex; align-items: center; cursor: pointer; list-style: none; }
summary.button::-webkit-details-marker { display: none; }
summary.button.small { font-size: .8rem; padding: 3px 12px; }
summary.button.quiet { background: transparent; border-color: var(--line); color: var(--fg); }
/* The top bar's small tools stay plain (the teacher: no big buttons up there). */
nav.top button.quiet, nav.top form button { border-color: transparent; background: transparent; }
nav.top button.quiet:hover, nav.top form button:hover { border-color: var(--line); }

/* Buttons in rows: one look, outlined, the same size (2026-11-27). */
span.button.small, a.button.small, button.small, summary.button.small { font-size: .8rem; padding: 3px 12px; }
.focus-row { background: var(--accent-soft); }
.focus-row .wchips { background: var(--surface); }
/* Inputs beside buttons look like every other input. */
.words-add input { font: inherit; font-size: .88rem; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--fg); width: 16rem; }

/* Tracing journey paths (2026-11-27). */
.trace { display: flex; flex-wrap: wrap; gap: var(--s5); align-items: flex-start; }
.trace-pic { position: relative; width: min(600px, 100%); aspect-ratio: 3 / 4; cursor: crosshair; user-select: none; }
.trace-pic img, .trace-pic svg { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: var(--radius); }
.trace-pic .t-old { fill: none; stroke: #e33; stroke-width: 3; stroke-dasharray: 8 6; opacity: .8; }
.trace-pic .t-new { fill: none; stroke: #1ad; stroke-width: 4; }
.trace-pic .t-dots circle { fill: #1ad; stroke: #fff; stroke-width: 2; }
.trace-side { display: grid; gap: var(--s2); min-width: 16rem; }
.trace-name { margin: 0; font-size: 1.1rem; }

.sk-words { margin: 2px 0; font-size: .9rem; color: var(--muted); }
.sk-words strong { color: var(--fg); }
/* An item's card shown on hover (smaller, no buttons until clicked). */
.road-card.peek .road-card-open, .road-card.peek .road-card-close { display: none; }
.road-card.peek { pointer-events: none; }

/* ---- The journey's creatures, games, satchel and full screen (2026-11-27) ---- */
.creature-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.creature { position: absolute; pointer-events: auto; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; cursor: pointer; border-radius: 0; }
.creature canvas { width: 100%; height: 100%; display: block; }
.creature:focus-visible { outline: 2px dashed #f6ead0; }
.creature-say.world-scroll { position: absolute; z-index: 6; max-width: 15rem; padding: 8px 14px 10px; font-variant: normal; letter-spacing: 0; font-size: .92rem; line-height: 1.35;
  color: #3b2a1a; background: radial-gradient(ellipse at 50% 40%, #fbf0d6 0%, #efdcb0 70%, #e2c88f 100%);
  border: 2px solid #6b4a2a; outline: 2px solid #c9a24a; outline-offset: -6px; border-radius: 10px; box-shadow: 0 4px 0 #4a3220, 0 8px 18px rgba(0,0,0,.4); animation: say-in .25s ease-out; }
.creature-say p { margin: 0 0 4px; }
.creature-say .cs-more { font-style: italic; }
.cs-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cs-btn.world-wood { position: static; font-size: .8rem; padding: 2px 10px !important; }
@keyframes say-in { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
/* games */
/* The games' overlay (2026-11-29): sized by the height actually visible (dvh; vh only where dvh is unknown),
   so on a phone the end of the list and the buttons are never under the browser's bars; if the panel is
   still taller, the overlay scrolls too, and margin: auto centres it only while it fits. */
.jg-overlay { position: fixed; inset: 0; z-index: 60; display: flex; background: rgba(16, 20, 28, .62); backdrop-filter: blur(3px);
  height: 100vh; height: 100dvh; padding: 2vh 2vw calc(2vh + env(safe-area-inset-bottom, 0px)); box-sizing: border-box;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.jg-panel.world-scroll { position: relative; margin: auto; width: min(46rem, 100%); max-height: 96vh; max-height: calc(96dvh - env(safe-area-inset-bottom, 0px)); overflow: auto;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 18px 26px 16px; text-align: center; font-variant: normal; letter-spacing: 0;
  color: #3b2a1a; background: radial-gradient(ellipse at 50% 30%, #fbf0d6 0%, #efdcb0 70%, #e2c88f 100%);
  border: 2px solid #6b4a2a; outline: 2px solid #c9a24a; outline-offset: -7px; border-radius: 8px; box-shadow: 0 6px 0 #4a3220, 0 18px 40px rgba(0,0,0,.5); }
.jg-head h2 { font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif; font-variant: small-caps; letter-spacing: .05em; margin: 0; font-size: 1.6rem; }
.jg-how { margin: 2px 0 10px; color: #5a4430; }
.jg-close { position: sticky; top: 0; float: right; z-index: 2; margin: -10px -18px 0 0; width: 2.2rem; height: 2.2rem; border: 1px solid #c9a24a !important; border-radius: 50% !important;
  background: #f6e9c8 !important; box-shadow: 0 1px 3px rgba(0,0,0,.25) !important; font-size: 1.4rem; line-height: 1; color: #5a4430; padding: 0 !important; }
.jg-foot { margin: 10px 0 0; font-size: .85rem; color: #5a4430; min-height: 1.2em; }
.jg-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 10px; }
.jg-row .world-wood, .jg-end .world-wood { position: static; }
.jg-prompt.world-wood { position: static; display: inline-block; max-width: 90%; font-size: 1.05rem; padding: 8px 18px !important; cursor: default; }
.jg-sky { position: relative; height: min(52vh, 26rem); margin-top: 10px; border-radius: 10px; overflow: hidden;
  background: linear-gradient(#b9d8e8, #e9f0dc); box-shadow: inset 0 0 0 2px #6b4a2a; }
.season-autumn .jg-sky { background: linear-gradient(#f3c98a, #f6e7c4); }
.season-winter .jg-sky { background: linear-gradient(#a9bdd6, #eef3f8); }
.season-summer .jg-sky { background: linear-gradient(#1f2b4a, #3e4f72); }
.jg-token { position: absolute; top: 0; width: 9rem; padding: 10px 6px !important; border: 2px solid #10284d !important; font-weight: 700; font-size: .95rem; color: #10284d;
  border-radius: 60% 10% 60% 10% !important; background: #f2a64a !important; box-shadow: 0 3px 0 rgba(16,40,77,.35) !important; cursor: pointer; white-space: normal; }
.season-spring .jg-token { background: #fbe0ea !important; border-radius: 70% 20% 70% 20% !important; }
.season-winter .jg-token { background: #ffffff !important; border-radius: 50% !important; }
.season-summer .jg-token { background: #fff3a0 !important; border-radius: 50% !important; box-shadow: 0 0 18px #ffe46b !important; }
.jg-token.caught { background: #9fd06e !important; transform: scale(1.15) !important; transition: transform .2s; }
.jg-token.wrong { animation: jg-shake .35s; }
.jg-token.missed { background: #f6e7c4 !important; outline: 3px solid #c8322b; }
@keyframes jg-shake { 25% { margin-left: -6px; } 75% { margin-left: 6px; } }
.jg-lanterns { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 12px; margin-top: 8px; }
.jg-lantern { position: relative; min-height: 6.5rem; padding: 26px 8px 10px !important; border: 2px solid #10284d !important; border-radius: 30px 30px 12px 12px !important;
  background: linear-gradient(#5a4330, #3e2d1f) !important; color: transparent !important; cursor: pointer; white-space: normal; transition: background .3s, box-shadow .3s; }
.jg-lantern::before { content: ""; position: absolute; top: -9px; left: 50%; width: 22px; height: 12px; margin-left: -11px; border: 2px solid #10284d; border-bottom: 0; border-radius: 12px 12px 0 0; }
.jg-flame { position: absolute; top: 8px; left: 50%; width: 10px; height: 14px; margin-left: -5px; border-radius: 50% 50% 45% 45%; background: #6a5a4a; }
.jg-lantern.open, .jg-lantern.lit { background: linear-gradient(#fff3c4, #f2c14e) !important; color: #3b2a1a !important; }
.jg-lantern.open .jg-flame, .jg-lantern.lit .jg-flame { background: #e8632f; box-shadow: 0 0 10px #ffb347; }
.jg-lantern.lit { box-shadow: 0 0 22px #ffd36b, 0 0 0 2px #c9a24a !important; }
.jg-text { display: block; font-size: .9rem; line-height: 1.3; }
.jg-text.word { font-weight: 700; font-size: 1.05rem; }
.jg-river { display: grid; grid-template-columns: 3rem 1fr 3rem; height: 5.5rem; margin: 8px 0 12px; border-radius: 10px; overflow: hidden;
  background: repeating-linear-gradient(100deg, #3f86b8 0 18px, #4f98c8 18px 36px); box-shadow: inset 0 0 0 2px #10284d; }
.jg-bank { background: linear-gradient(#8db04a, #5e7d2c); border-right: 2px solid #10284d; }
.jg-bank.right { border-right: 0; border-left: 2px solid #10284d; }
.jg-deck { display: flex; align-items: center; gap: 3px; padding: 0 3px; }
.jg-deck.wobble { animation: jg-shake .4s; }
.jg-plank { flex: 1; height: 2.4rem; border-radius: 3px; border: 2px dashed rgba(255,255,255,.45); }
.jg-plank.laid { border: 2px solid #10284d; background: linear-gradient(#b07a46, #7a4f2a); animation: say-in .3s; }
.jg-question { font-size: 1.1rem; margin: 6px 0; }
.jg-option.world-wood { font-size: 1rem; padding: 6px 18px !important; }
.jg-option.wrong { opacity: .45; }
.jg-end { padding: 10px 0; }
.jg-score { font-size: 2.2rem; font-weight: 700; margin: 0; font-family: "Palatino Linotype", Palatino, Georgia, serif; }
.jg-say { margin: 4px 0; font-size: 1.05rem; }
.jg-best { margin: 0; color: #5a4430; font-size: .85rem; }
/* satchel and full screen */
.journey-banner { pointer-events: auto; }
.satchel { display: inline-flex; align-items: center; gap: 3px; margin-top: 4px; padding: 2px 10px !important; border: 1.5px solid #6b4a2a !important; border-radius: 999px !important;
  background: rgba(255,255,255,.35) !important; color: #3b2a1a !important; font-weight: 700; font-size: .85rem; cursor: pointer; }
.satchel svg { width: 20px; height: 20px; }
.satchel-list.world-scroll { position: absolute; z-index: 7; top: 110px; left: 16px; width: 17rem; padding: 10px 16px 12px; font-variant: normal; letter-spacing: 0; text-align: left;
  color: #3b2a1a; background: radial-gradient(ellipse at 50% 40%, #fbf0d6 0%, #efdcb0 70%, #e2c88f 100%);
  border: 2px solid #6b4a2a; outline: 2px solid #c9a24a; outline-offset: -6px; border-radius: 6px; box-shadow: 0 4px 0 #4a3220, 0 8px 18px rgba(0,0,0,.4); }
.satchel-list[hidden] { display: none; }
.satchel-list h3 { margin: 0 0 6px; font-family: "Palatino Linotype", Palatino, Georgia, serif; font-variant: small-caps; }
.satchel-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.satchel-list li { display: flex; gap: 8px; align-items: center; }
.satchel-list li svg { width: 30px; height: 30px; flex: none; }
.satchel-list p { margin: 0; font-size: .9rem; }
.trinket-defs { position: absolute; }
.journey-full.world-wood { position: absolute; z-index: 4; right: 16px; bottom: 62px; font-size: .85rem; padding: 4px 12px !important; }
:is(.journey-world:fullscreen, .journey-world.as-full) { background: #14130f; display: grid; place-items: center; overflow: hidden; margin: 0; }
:is(.journey-world:fullscreen, .journey-world.as-full) .road-stretch:not([hidden]) { width: min(100vw, 75vh); height: auto; margin: 0 auto; }
:is(.journey-world:fullscreen, .journey-world.as-full) .road-stretch svg.road-svg { width: 100%; height: auto; }
:is(.journey-world:fullscreen, .journey-world.as-full) .journey-banner, :is(.journey-world:fullscreen, .journey-world.as-full) .journey-go, :is(.journey-world:fullscreen, .journey-world.as-full) .journey-full, :is(.journey-world:fullscreen, .journey-world.as-full) .satchel-list { position: fixed; }
.jg-lantern .jg-text { background: none !important; box-shadow: none !important; border: 0 !important; padding: 0 !important; visibility: hidden; }
.jg-lantern.open .jg-text, .jg-lantern.lit .jg-text { visibility: visible; }
.jg-prompt.world-wood, .jg-option.world-wood, .cs-btn.world-wood { font-variant: normal; letter-spacing: 0; text-transform: none; }
.jg-prompt.world-wood { font-size: 1.15rem; }

/* spot reactions */
.spot-bit.petal { width: 7px; height: 5px; background: #f7d6e0; border-radius: 60% 0; animation-duration: 2s; }
.spot-fx { position: absolute; z-index: 4; pointer-events: none; border-radius: 50%; }
.spot-fx.ripple { border: 2px solid rgba(255,255,255,.8); animation: fx-ripple 1.5s ease-out forwards; }
.spot-fx.glow { background: radial-gradient(circle, rgba(255,230,150,.75), rgba(255,230,150,0) 65%); animation: fx-glow 1.5s ease-out forwards; }
.spot-fx.knock { box-shadow: inset 0 0 0 3px rgba(255,244,214,.9); animation: fx-knock .55s ease-out 2; }
.spot-fx.rocking { border: 0; animation: fx-glow 1.3s ease-out forwards; background: radial-gradient(circle, rgba(255,255,255,.35), transparent 60%); }
@keyframes fx-ripple { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
@keyframes fx-glow { 0% { opacity: 0; transform: scale(.6); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.2); } }
@keyframes fx-knock { 0%, 100% { transform: scale(1); opacity: .2; } 50% { transform: scale(1.08); opacity: 1; } }
.trace-pic .t-preview { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.trace-pic .t-spot { fill: rgba(255, 230, 150, .25); stroke: #ffe08a; stroke-width: 3; }
.trace-pic .t-spot-label { fill: #fff; font: 700 14px sans-serif; text-anchor: middle; paint-order: stroke; stroke: #10284d; stroke-width: 3px; }
.spot-kinds { display: flex; flex-wrap: wrap; gap: 6px; max-width: 22rem; }
.page-head h1 .hint { display: inline-block; }

/* closer and further: the frame stays, the picture grows inside it */
.journey-world .road { aspect-ratio: 3 / 4; overflow: hidden; display: block; overscroll-behavior: contain; }
.journey-world .road-stretch { width: calc(100% * var(--zoom, 1)); }
.journey-world.zoomed .road { cursor: grab; }
.journey-world .road.panning { cursor: grabbing; user-select: none; }
.journey-zoom { position: absolute; z-index: 4; right: 16px; bottom: 108px; display: flex; flex-direction: column; gap: 6px; }
.journey-zoom .world-wood { position: static; width: 2.2rem; height: 2.2rem; padding: 0 !important; font-size: 1.2rem; line-height: 1; }
.journey-zoom .world-wood:disabled { opacity: .45; cursor: default; }
:is(.journey-world:fullscreen, .journey-world.as-full) .road { width: min(100vw, 75vh); margin: 0 auto; }
:is(.journey-world:fullscreen, .journey-world.as-full) .road-stretch:not([hidden]) { width: calc(100% * var(--zoom, 1)); }
:is(.journey-world:fullscreen, .journey-world.as-full) .journey-zoom { position: fixed; }

/* ---- The journey's games, redrawn (2026-11-27) ---- */
.journey-play.world-wood { position: absolute; z-index: 4; right: 16px; bottom: 154px; font-size: .9rem; padding: 4px 12px !important; }
.journey-zoom { bottom: 196px; }
:is(.journey-world:fullscreen, .journey-world.as-full) .journey-play { position: fixed; }
.jg-panel.world-scroll { width: min(48rem, 100%); }
.pl-critter { display: block; pointer-events: none; }
.pl-spirit { position: absolute; pointer-events: none; transition: left .35s ease, top .35s ease; z-index: 2; }
.small-wood.world-wood { font-size: .8rem; padding: 3px 12px !important; }
/* choose */
.pl-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 12px; margin-top: 6px; }
.pl-card { display: grid; justify-items: center; gap: 4px; padding: 10px 12px !important; white-space: normal !important; border-radius: 12px !important;
  background: linear-gradient(#fbf3de, #efdcb0) !important; border: 2px solid #6b4a2a !important; box-shadow: 0 3px 0 #4a3220 !important; color: #3b2a1a !important; cursor: pointer; text-align: center; }
.pl-card:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #4a3220 !important; }
.pl-card strong { font-family: "Palatino Linotype", Palatino, Georgia, serif; font-variant: small-caps; font-size: 1.1rem; letter-spacing: .03em; }
.pl-card span { font-size: .8rem; line-height: 1.3; color: #5a4430; }
/* feed */
.feed-meadow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; min-height: 15rem; padding: 10px 10px 0; border-radius: 12px;
  background: linear-gradient(#cfe6b0 0%, #9fc46e 70%, #84ad55 100%); box-shadow: inset 0 0 0 2px #6b4a2a; align-items: end; }
.season-autumn .feed-meadow { background: linear-gradient(#f3d79a, #d7a95a 70%, #c08a3e); }
.season-winter .feed-meadow { background: linear-gradient(#e8f0f8, #cfdbe8 70%, #b9c9da); }
.feed-slot { display: grid; justify-items: center; align-content: end; gap: 4px; cursor: pointer; transition: transform .6s ease, opacity .6s; }
.feed-slot.arriving { transform: translateX(60px); opacity: 0; }
.feed-slot.leaving { transform: translateX(120px); opacity: 0; }
.feed-slot.fed .pl-critter { animation: pl-hop .5s ease 2; }
.feed-slot.huff { animation: jg-shake .4s; }
.feed-ask.world-scroll { position: relative; margin: 0; padding: 6px 10px !important; font-size: .85rem; line-height: 1.3; max-width: 12rem; border-radius: 10px; font-variant: normal; letter-spacing: 0; }
.feed-tray { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 12px; margin-top: 10px; border-radius: 12px;
  background: linear-gradient(#9b6a3c, #7a4f2a); box-shadow: inset 0 0 0 2px #10284d, 0 3px 0 #4a3220; }
.feed-word { padding: 6px 14px !important; border-radius: 999px !important; border: 2px solid #10284d !important; background: #f6ead0 !important; color: #3b2a1a !important;
  font-weight: 700; cursor: grab; box-shadow: 0 2px 0 rgba(16,40,77,.4) !important; }
.feed-word.picked { background: #f2c14e !important; transform: translateY(-3px); }
@keyframes pl-hop { 50% { transform: translateY(-14px); } }
/* stones */
.stones-prompt { font-size: 1.15rem; margin: 2px 0; }
.stones-cloze { font-style: italic; color: #5a4430; margin: 0 0 8px; min-height: 1.2em; }
.stones-river { position: relative; display: grid; grid-template-columns: 3.5rem 1fr 3.5rem; height: 8rem; border-radius: 12px; overflow: visible;
  background: repeating-linear-gradient(100deg, #3f86b8 0 18px, #4f98c8 18px 36px); box-shadow: inset 0 0 0 2px #10284d; margin: 26px 0 10px; }
.stones-bank { background: linear-gradient(#8db04a, #5e7d2c); border-radius: 12px 0 0 12px; box-shadow: inset -2px 0 0 #10284d; }
.stones-bank.right { border-radius: 0 12px 12px 0; box-shadow: inset 2px 0 0 #10284d; }
.stones-row { display: flex; align-items: center; justify-content: space-evenly; gap: 4px; padding: 0 6px; }
.stone { width: 2.4rem; height: 2rem; border-radius: 45% 45% 40% 40%; border: 2px dashed rgba(255,255,255,.45); display: grid; place-items: center;
  font: 700 1.1rem Georgia, serif; color: #3b2a1a; transition: transform .3s, background .3s; transform: translateY(10px); }
.stone.gap { visibility: hidden; }
.stone.up { border: 2px solid #10284d; background: linear-gradient(#c9c2b2, #9a9282); transform: none; box-shadow: 0 4px 0 rgba(16,40,77,.35); }
.stone.splash { animation: jg-shake .35s; border-color: #fff; }
.stones-tiles { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.stone-tile { width: 2.4rem; height: 2.4rem; padding: 0 !important; border-radius: 10px !important; border: 2px solid #10284d !important; background: #f6ead0 !important;
  color: #3b2a1a !important; font: 700 1.1rem Georgia, serif; box-shadow: 0 2px 0 rgba(16,40,77,.4) !important; }
.pl-spirit.hop { animation: pl-hop .35s ease; }
/* river */
.river-prompt.world-wood { position: static; display: inline-block; max-width: 95%; padding: 6px 16px !important; font-size: 1rem; cursor: default; white-space: normal; }
.river-wrap { position: relative; margin-top: 10px; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 2px #10284d; touch-action: none; }
.river-canvas { display: block; width: 100%; aspect-ratio: 640 / 420; }
.river-wrap .pl-spirit { transition: none; }
/* lantern night */
.night-sky { position: relative; padding: 18px 12px 14px; border-radius: 12px; overflow: hidden; background: linear-gradient(#0f1a33, #23345c 70%, #3b4a6b); box-shadow: inset 0 0 0 2px #10284d; }
.star { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; opacity: .6; animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .15; } }
.night-grid { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 16px 12px; }
.lantern { position: relative; min-height: 6.4rem; padding: 26px 8px 10px !important; white-space: normal !important; border: 2px solid #10284d !important; border-radius: 30px 30px 14px 14px !important;
  background: linear-gradient(#4a3a2a, #2e2318) !important; color: transparent !important; cursor: pointer; transition: background .3s, box-shadow .4s, transform 1.2s ease; }
.l-hook { position: absolute; top: -10px; left: 50%; width: 22px; height: 12px; margin-left: -11px; border: 2px solid #c9a24a; border-bottom: 0; border-radius: 12px 12px 0 0; }
.l-flame { position: absolute; top: 8px; left: 50%; width: 10px; height: 14px; margin-left: -5px; border-radius: 50% 50% 45% 45%; background: #5a4a3a; }
.l-text { display: block; visibility: hidden; font-size: .9rem; line-height: 1.3; }
.l-text.l-word { font-weight: 700; font-size: 1.05rem; }
.lantern.open, .lantern.lit { background: linear-gradient(#fff3c4, #f2b84e) !important; color: #3b2a1a !important; }
.lantern.open .l-text, .lantern.lit .l-text { visibility: visible; }
.lantern.open .l-flame, .lantern.lit .l-flame { background: #e8632f; box-shadow: 0 0 12px #ffb347; }
.lantern.lit { box-shadow: 0 0 28px #ffd36b !important; transform: translateY(-10px); animation: float-up 3s ease-in-out infinite; }
@keyframes float-up { 50% { transform: translateY(-16px); } }
/* hide and seek, on the picture */
.seek-layer { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.hider { position: absolute; pointer-events: auto; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; border-radius: 50% !important; cursor: pointer; }
.hider .pl-critter { position: absolute; left: 50%; bottom: 20%; width: 80% !important; height: 80% !important; transform: translate(-50%, 30%) scale(.2); opacity: 0; transition: transform .35s cubic-bezier(.3,1.6,.5,1), opacity .2s; }
.hider-rustle { position: absolute; inset: 20%; border-radius: 50%; background: radial-gradient(circle, rgba(255,240,180,.55), rgba(255,240,180,0) 70%); animation: rustle 2.4s ease-in-out infinite; }
@keyframes rustle { 0%, 100% { transform: scale(.8) rotate(0); opacity: .5; } 50% { transform: scale(1.1) rotate(8deg); opacity: 1; } }
.hider-word.world-scroll { position: absolute; left: 50%; top: -6px; transform: translate(-50%, -100%); padding: 2px 10px !important; white-space: nowrap; font-size: .85rem; font-weight: 700;
  opacity: 0; transition: opacity .2s; font-variant: normal; letter-spacing: 0; border-radius: 8px; }
.hider.peek .pl-critter, .hider.found .pl-critter { transform: translate(-50%, 0) scale(1); opacity: 1; }
.hider.peek .hider-word, .hider.found .hider-word { opacity: 1; }
.hider.peek .hider-rustle, .hider.found .hider-rustle { display: none; }
.hider.found .hider-word { background: #d8eebc !important; }
.seek-bar.world-scroll { position: absolute; z-index: 6; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(30rem, 86%); padding: 8px 18px 10px; text-align: center;
  color: #3b2a1a; background: radial-gradient(ellipse at 50% 40%, #fbf0d6 0%, #efdcb0 70%, #e2c88f 100%);
  border: 2px solid #6b4a2a; outline: 2px solid #c9a24a; outline-offset: -6px; border-radius: 8px; box-shadow: 0 4px 0 #4a3220, 0 8px 18px rgba(0,0,0,.4); font-variant: normal; letter-spacing: 0; }
.seek-bar strong { font-family: "Palatino Linotype", Palatino, Georgia, serif; font-variant: small-caps; font-size: 1.1rem; }
.seek-ask { margin: 4px 0; font-size: 1rem; }
.seek-foot { margin: 0; font-size: .82rem; color: #5a4430; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.seek-foot .world-wood { position: static; font-size: .8rem; padding: 3px 10px !important; }
.jg-end .pl-critter { margin: 0 auto; }

.feed-ask.world-scroll, .hider-word.world-scroll { color: #3b2a1a; background: #f6ead0; border: 2px solid #6b4a2a; box-shadow: 0 2px 0 #4a3220; }
.feed-ask.world-scroll::after { content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -6px; border: 6px solid transparent; border-top-color: #6b4a2a; border-bottom: 0; }
.river-prompt.world-wood { font-variant: normal; letter-spacing: 0; text-transform: none; }
.pl-card .pl-critter { width: 84px !important; height: 84px !important; }
.lantern .l-text { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }

/* The top bar (2026-11-29). The ball is the home link (the student's own water, with their streak).
   Wide: the items in .nav-menu join the bar (display: contents) and order puts them where they always
   were: sections, Settings | page links, the small controls, Log out on the right; no ☰.
   Phone: one row: ball, sections, the small controls, ☰; the page's own link, Settings and Log out
   open under ☰ (topbar.js), closing on a tap outside or Esc. */
nav.top .home { display: inline-flex; align-items: center; gap: 8px; position: relative; }
nav.top .brand-ball { width: 28px; height: 28px; flex: none; display: block; }
nav.top a.home[aria-current="page"] { box-shadow: none; }
nav.top a.home[aria-current="page"] .brand-name { box-shadow: inset 0 -2px 0 var(--accent); }
nav.top .word-mode-toggle[aria-pressed="true"] { background: var(--accent) !important; border-color: var(--accent) !important; color: var(--surface) !important; }
.nav-menu-btn { display: none !important; }
@media (min-width: 40.01rem) {
  nav.top .brand-ball { display: none; }   /* a computer: the name only (2026-11-29) */
  nav.top .nav-menu { display: contents; }
  nav.top .nav-settings { order: 1; }
  nav.top .nav-links { order: 2; }
  nav.top > .share-float { order: 3; }
  nav.top > .word-mode-toggle { order: 4; }
  nav.top .nav-menu > .width-toggle { order: 5; }
  nav.top .nav-about { order: 6; }
  nav.top .nav-menu > form { order: 7; }
  nav.top > .share-float, nav.top > .word-mode-toggle, nav.top .nav-menu > .width-toggle, nav.top .nav-menu > form { margin-left: calc(-1 * var(--s3)); }
}
@media (max-width: 40rem) {
  nav.top { flex-wrap: nowrap; gap: var(--s3); padding: var(--s2) 14px; }
  nav.top > a { white-space: nowrap; padding: var(--s1) 0; }
  nav.top .brand-name { display: none; }
  nav.top .home { margin-right: 2px; }
  nav.top a.home[aria-current="page"] .brand-ball { filter: drop-shadow(0 2px 0 var(--accent)); }
  nav.top > .share-float, nav.top > .word-mode-toggle, nav.top > .nav-menu-btn { margin-left: auto; }   /* the first of them goes right */
  nav.top > .share-float ~ .word-mode-toggle, nav.top > .share-float ~ .nav-menu-btn, nav.top > .word-mode-toggle ~ .nav-menu-btn { margin-left: 0; }
  .nav-menu-btn { display: inline-flex !important; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0 !important; font-size: 1.15rem; flex: none; }
  nav.top .nav-menu { display: none; position: absolute; right: 10px; top: calc(100% + 4px); z-index: 30; min-width: 12rem; max-width: calc(100vw - 20px);
    flex-direction: column; align-items: stretch; gap: 0; padding: var(--s1) 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.14); }
  nav.top .nav-menu.open { display: flex; }
  nav.top .nav-menu .nav-links { display: flex; flex-direction: column; align-items: stretch; gap: 0; margin: 0; }
  nav.top .nav-menu .nav-links:empty { display: none; }
  nav.top .nav-menu .nav-links:not(:empty) { border-bottom: 1px solid var(--line); padding-bottom: var(--s1); margin-bottom: var(--s1); }
  nav.top .nav-menu a, nav.top .nav-menu form button { display: block; width: 100%; text-align: left; padding: 10px 16px !important; color: var(--fg);
    border: 0 !important; border-radius: 0 !important; background: none !important; font: inherit; font-size: .95rem; box-shadow: none; }
  nav.top .nav-menu a:hover, nav.top .nav-menu form button:hover { background: var(--accent-soft) !important; }
  nav.top .nav-menu a[aria-current="page"] { font-weight: 650; box-shadow: inset 3px 0 0 var(--accent); }
  nav.top .nav-menu > .width-toggle { display: none; }
  nav.top .nav-menu > form { margin: 0; }
}
}

/* The journey filling the window where the browser has no full screen (an
   iPhone; journey-games.js): above the top bar and the corner tools, the page
   underneath does not scroll. Games open above it (.jg-overlay, z-index 60). */
.journey-world.as-full { position: fixed; inset: 0; z-index: 50; width: 100vw; height: 100vh; height: 100dvh; }
body.journey-full { overflow: hidden; }

/* The login (2026-11-28): fields and the button the same height, Privacy a quiet link on the button's line. */
form.login input { padding: var(--s2) var(--s3); min-height: 2.75rem; }
form.login .login-go { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s2); }
form.login .login-go button { min-height: 2.75rem; padding: 0 var(--s5); }
form.login .login-privacy { font-size: .85rem; color: var(--muted); }
form.login .login-privacy:hover { color: var(--fg); }

/* Choice bubbles (2026-11-28): soft corners instead of round ends, so a
   second line of text has room and nothing is cut when it is chosen. */
.choice span, main.me .choice span { border-radius: 14px; white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
main.me .choice span { padding: 3px var(--s3); line-height: 1.35; }

/* The Listen row on a phone (2026-11-28): Listen, ■, slower, Hide text and
   The text on one line; smaller buttons so it fits a card on a 390 px screen. */
.listen-bar .listen-stop { padding: 3px 9px; }
@media (max-width: 40rem) {
  .listen-bar { gap: 6px; padding: var(--s3) 0 var(--s2); }
  .listen-bar button.small, .listen-bar label.small { font-size: .78rem; padding: 3px 8px; }
  .listen-bar label.small { padding: 3px 2px; display: inline-flex; align-items: center; gap: 3px; }
  .listen-bar label.small input { margin: 0; }
  .listen-bar .text-btn { margin: 0; }
  .listen-bar [data-listen-play] .lb { display: none; }
}

/* The journey on a phone (2026-11-28): a smaller title scroll, and the
   buttons (closer / further, Games, Full screen) in a row under the picture
   instead of on it. In full screen they stay on the picture. */
.journey-controls { display: contents; }
@media (max-width: 40rem) {
  /* The row hangs under the picture (top: 100%), so the world keeps the
     picture's height and the signs on it (Earlier places) stay in place. */
  .journey-world:not(:fullscreen):not(.as-full) { margin-bottom: 3.8rem; }
  .journey-world:not(:fullscreen):not(.as-full) .journey-controls { position: absolute; top: calc(100% + 10px); left: 0; right: 0;
    display: flex; align-items: center; gap: var(--s2); }
  .journey-world:not(:fullscreen):not(.as-full) .journey-controls > * { position: static; }
  .journey-world:not(:fullscreen):not(.as-full) .journey-zoom { flex-direction: row; }
  .journey-world:not(:fullscreen):not(.as-full) .journey-play { margin-left: auto; }
  .journey-banner.world-scroll { top: 10px; left: 14px; padding: 3px 16px 5px; }
  .journey-banner.world-scroll::before, .journey-banner.world-scroll::after { width: 10px; top: -4px; bottom: -4px; }
  .journey-banner.world-scroll::before { left: -8px; }
  .journey-banner.world-scroll::after { right: -8px; }
  .journey-banner.world-scroll h1 { font-size: .95rem; }
  .journey-banner .journey-count { font-size: .72rem; gap: var(--s2); }
  .journey-banner .journey-count svg { width: 14px; height: 14px; }
  .journey-banner .satchel { margin-top: 2px; padding: 0 8px !important; font-size: .75rem; }
  .journey-banner .satchel svg { width: 14px; height: 14px; }
}


/* "As they see it" on a phone (asview.js): everything but the header hidden,
   the page in a 390 x 780 frame shaped like a phone. */
.as-view-switch { margin-top: var(--s2); }
body.as-phone main > :not(.as-keep) { display: none !important; }
.as-phone-frame { display: none; }
body.as-phone .as-phone-frame { display: flex; justify-content: center; margin: var(--s4) 0; }
.as-phone-frame iframe { width: 410px; max-width: 100%;   /* 390 inside the 10 px edge */ height: 780px; max-height: 80vh; border: 10px solid #2b2a22; border-radius: 28px;
  background: var(--bg); box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.seg button { border: 0; background: transparent; padding: 1px var(--s3); border-radius: 999px; font-size: .85rem; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 0 0 1px var(--line); }

/* The journey in full screen on a phone (2026-11-28): the same row as on the
   page, at the bottom of the screen under the picture (− +, Games, Leave full
   screen); Earlier places / Back to now just above it, not on the controls. */
@media (max-width: 40rem) {
  :is(.journey-world:fullscreen, .journey-world.as-full) .journey-controls { position: fixed; z-index: 6; left: 12px; right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: var(--s2); }
  :is(.journey-world:fullscreen, .journey-world.as-full) .journey-controls > * { position: static; }
  :is(.journey-world:fullscreen, .journey-world.as-full) .journey-zoom { flex-direction: row; }
  :is(.journey-world:fullscreen, .journey-world.as-full) .journey-play { margin-left: auto; }
  :is(.journey-world:fullscreen, .journey-world.as-full) .journey-go.earlier { right: 12px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}

/* The corner tools' panels on a phone (Help, Add a word): above the corner
   buttons, across the screen, never off its edge (they were anchored to
   their icon in the row, and Help opened half off the left side). */
@media (max-width: 40rem) {
  .float-dock .help-panel, .float-dock .wf-panel { position: fixed; left: 12px; right: 12px; bottom: 76px; width: auto; z-index: 9; }
}

/* Phone (2026-11-28 sweep): rows that were one line and ran past the screen. */
@media (max-width: 40rem) {
  .rv-step h4, .btn-row { flex-wrap: wrap; row-gap: var(--s1); }
}
/* Grid columns that grew to their longest line on a phone (2026-11-28 sweep):
   allowed to shrink, so the long line is cut with "…" or wraps instead. */
.focus-cards, .trace-side { grid-template-columns: minmax(0, 1fr); }
.trace-side { max-width: 100%; }
@media (max-width: 40rem) { .trace-side { min-width: 0; width: 100%; } }
.spot-kinds button { white-space: normal; text-align: left; max-width: 100%; }   /* long spot names wrap on a phone */

/* Below 1120 px the Contents pill floats under the top bar, where the word
   pool sticks too: the pool sticks just below the pill instead of under it
   (2026-11-28: it covered the right side of the pool on a phone). */
@media (max-width: 1119px) {
  body:has(.toc) .word-pool { top: calc(var(--nav-h, 3.6rem) + 3.1rem); }
  body.has-live-corner:has(.toc) .word-pool { top: calc(var(--nav-h, 3.6rem) + 5.6rem); }
}

/* The journey's title scroll (2026-11-28): its counts are links (lessons by
   kind, words learned); in full screen journey-games.js puts it on the picture. */
.journey-count a { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: inherit; text-decoration: none; border-radius: 6px; padding: 0 3px; }
.journey-count a:hover, .journey-count a:focus-visible { background: rgba(59, 42, 26, .1); }
