/*
 * styles.css: the one stylesheet. Tokens first, then elements, then each page.
 *
 * Rule (docs/design.md): separate things with typography before boxes. A
 * level of the page is a typeface (display serif for titles, the interface
 * sans for everything else), a size from the scale, a weight, and a color
 * role. Use those before borders, backgrounds, and boxes, and space from the
 * spacing scale, never a one-off value. Light is the default theme; dark is
 * chosen with the switch and stored per browser.
 */

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f0e6;
  --bg-glow: #ebe3d2;
  --surface: #fbf8f2;
  --surface-2: #f1eadd;
  --surface-3: #e8dfcf;
  --line: #e0d6c3;
  --line-strong: #c9bca4;
  --text: #2e2a24;
  --text-strong: #1c1915;
  --muted: #6d6556;
  --faint: #9b927f;
  --accent: #23805f;
  --accent-text: #1c6b4f;
  --accent-soft: #dcefe5;
  --on-accent: #ffffff;
  --blue: #3b5d9c;
  --blue-soft: #e1e8f4;
  --amber: #a06410;
  --amber-soft: #f6e8cf;
  --red: #b0463b;
  --red-soft: #f6e1dc;
  --violet: #6c4fa0;
  --violet-soft: #ebe3f4;
  --shadow: 0 1px 2px rgb(70 50 20 / 6%), 0 6px 20px rgb(70 50 20 / 6%);
  --shadow-pop: 0 10px 30px rgb(70 50 20 / 16%);
  --backdrop: rgb(28 25 21 / 45%);
  --figure-filter: invert(1) hue-rotate(180deg) saturate(1.2);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12161f;
  --bg-glow: #183028;
  --surface: #1a2130;
  --surface-2: #151b27;
  --surface-3: #222b3d;
  --line: #2a3142;
  --line-strong: #3a4459;
  --text: #e6e9f0;
  --text-strong: #f5f7fb;
  --muted: #a9b1c1;
  --faint: #7d8597;
  --accent: #6ef2c0;
  --accent-text: #6ef2c0;
  --accent-soft: #173a2f;
  --on-accent: #10241c;
  --blue: #7aa2ff;
  --blue-soft: #1d2a47;
  --amber: #ffc46b;
  --amber-soft: #3a2e1a;
  --red: #ff8073;
  --red-soft: #3d2220;
  --violet: #c9a7ff;
  --violet-soft: #2e2542;
  --shadow: none;
  --shadow-pop: 0 10px 30px rgb(0 0 0 / 40%);
  --backdrop: rgb(0 0 0 / 60%);
  --figure-filter: none;
}

:root {
  --font-ui:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* Russian with stress marks: Iowan Old Style drops the acute on Cyrillic capitals (Э́, А́). */
  --font-ru: Palatino, "Palatino Linotype", Georgia, "Noto Serif", "Times New Roman", serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.375rem;
  --text-hero: clamp(2.5rem, 6vw, 4.2rem);

  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-body: 1.65;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  --radius: 1rem;
  --radius-sm: 0.6rem;
  --page-max: 76rem;
  --reading-max: 48rem;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 100% -10%, var(--bg-glow) 0%, transparent 60%), var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.5;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent-text);
}

p {
  margin: 0 0 var(--space-3);
}

/* Type levels. A level is a face, a size, a weight, and a color role. */

h1,
h2,
h3 {
  margin: 0;
  color: var(--text-strong);
}

h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
}

h2 {
  font-size: var(--text-lg);
  font-weight: 650;
  line-height: var(--leading-snug);
  margin-bottom: var(--space-3);
}

h3 {
  font-size: var(--text-md);
  font-weight: 650;
  line-height: var(--leading-snug);
  margin: var(--space-5) 0 var(--space-2);
}

.eyebrow,
.kicker {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.kicker {
  color: var(--accent-text);
}

.lede {
  max-width: 44rem;
  color: var(--muted);
  font-size: var(--text-lg);
  line-height: 1.5;
}

.lede-small {
  color: var(--muted);
  font-size: var(--text-base);
  margin: 0;
}

.note {
  color: var(--muted);
  font-size: var(--text-sm);
}

.note.block,
.block {
  display: block;
}

.muted {
  opacity: 0.55;
}

.loading {
  padding: var(--space-6) 0;
}

.alert {
  color: var(--red);
  font-size: var(--text-sm);
  min-height: 1.2rem;
  margin: var(--space-2) 0;
}

.tag {
  display: inline-block;
  margin-left: var(--space-2);
  padding: 0.05rem var(--space-2);
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 600;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--space-4) 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Controls */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--accent);
}

.btn.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
}

.btn.primary:hover {
  filter: brightness(1.06);
}

.btn.small {
  padding: 0.35rem 0.75rem;
  font-size: var(--text-xs);
}

.btn.big {
  font-size: var(--text-md);
  padding: 0.8rem 1.7rem;
}

.btn.danger {
  border-color: var(--red);
  color: var(--red);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.link-button {
  background: none;
  border: 0;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  font-size: var(--text-sm);
  padding: var(--space-2) 0;
}

.chip {
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  font-size: var(--text-sm);
}

.chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}

.chips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

label {
  display: block;
  margin: var(--space-4) 0;
}

label span {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: transparent;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-3) 0;
}

legend {
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

label.rubric-item,
label.check-row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  margin: var(--space-2) 0;
}

label.rubric-item input,
label.check-row input {
  width: auto;
  margin-top: 0.3rem;
  flex: none;
  accent-color: var(--accent);
}

label.check-row span,
label.rubric-item span {
  display: inline;
  margin: 0;
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--text);
}

.rubric-item .prose p {
  margin: 0;
}

.actions,
.nav,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.actions {
  margin-top: var(--space-4);
}

/* Theme switch: a pill with the sun and the moon, the one in use filled. */

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.15rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
}

.theme-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}

.theme-choice svg {
  width: 1.05rem;
  height: 1.05rem;
}

.theme-choice:hover {
  color: var(--text);
}

.theme-choice[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* Bars */

.meter {
  height: 0.55rem;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  margin: var(--space-2) 0;
}

.meter-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.xp-bar {
  height: 0.8rem;
}

.xp-bar .meter-fill {
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

/* Cards and tables */

.card {
  max-width: 30rem;
  margin: var(--space-4) auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow);
}

.learner-main .card,
.panel .card {
  max-width: none;
  margin: 0 0 var(--space-5);
}

.card.narrow,
.panel .card.narrow,
.learner-main .card.narrow {
  max-width: 32rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

th {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
  padding: var(--space-2) var(--space-2);
}

td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  padding: var(--space-3) var(--space-2);
}

/* Tabs: a row of labels on a rule, the open one underlined in the accent. */

.tabs {
  display: flex;
  gap: var(--space-1);
  box-shadow: inset 0 -1px 0 var(--line-strong);
  margin: 0 0 var(--space-4);
  overflow-x: auto;
  overflow-y: hidden;
}

.tab {
  padding: var(--space-3) var(--space-4);
  border-bottom: 3px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
  background: var(--surface-2);
}

.tab[aria-current="page"] {
  color: var(--accent-text);
  border-bottom-color: var(--accent);
}

/* Page heads: title, then tabs, then one line of help, each with room. */

.page-head-block {
  margin-bottom: var(--space-5);
}

.page-head-block h1 {
  margin-bottom: var(--space-4);
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.page-head h1 {
  margin-bottom: var(--space-2);
}

.crumbs {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.crumbs a {
  color: var(--muted);
}

/* Public frame */

.page {
  min-height: 100vh;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
}

.brand {
  color: var(--accent-text);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  font-size: var(--text-xs);
  font-weight: 700;
}

.wrap {
  max-width: 64rem;
  margin: 0 auto;
  padding: var(--space-5) var(--space-5) var(--space-8);
}

.hero h1 {
  font-size: var(--text-hero);
  margin-bottom: var(--space-5);
}

.card h1,
.wrap h1 {
  font-size: var(--text-3xl);
}

.loop {
  margin-top: var(--space-8);
}

.loop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.loop-grid article {
  border-top: 1px solid var(--line-strong);
  padding-top: var(--space-4);
}

.loop-grid h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.loop-grid p {
  color: var(--muted);
}

.turnstile {
  margin: var(--space-3) 0;
}

footer {
  margin-top: var(--space-7);
  color: var(--muted);
  font-size: var(--text-sm);
}

.skip {
  position: absolute;
  left: var(--space-3);
  top: var(--space-2);
  transform: translateY(-150%);
  background: var(--accent);
  color: var(--on-accent);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  z-index: 60;
}

.skip:focus {
  transform: none;
}

/* Learner frame */

.learner-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.learner-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.nav-link {
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
}

.nav-link:hover {
  background: var(--surface-2);
}

.nav-link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.due-badge {
  background: var(--red);
  color: var(--surface);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 0.05rem 0.45rem;
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: var(--text-sm);
  font-weight: 600;
}

.chip-bar {
  width: 4.5rem;
  margin: 0;
  height: 0.45rem;
}

.learner-main {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-8);
}

/* Toasts */

.toasts {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 50;
  max-width: min(22rem, calc(100vw - 2rem));
}

.toast {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  box-shadow: var(--shadow-pop);
  animation: toast-in 0.25s ease-out;
  font-size: var(--text-sm);
}

.toast strong {
  color: var(--text-strong);
  font-size: var(--text-base);
}

.toast span {
  color: var(--muted);
  font-size: var(--text-xs);
}

.toast-quest {
  border-left-color: var(--blue);
}

.toast-achievement {
  border-left-color: var(--amber);
}

.toast-level {
  border-left-color: var(--red);
}

/* Stays until the learner reloads: a page from before a deploy (stale.ts). */
.stale-note {
  position: fixed;
  left: var(--space-4);
  bottom: var(--space-4);
  z-index: 60;
  max-width: min(22rem, calc(100vw - 2rem));
  border-left-color: var(--blue);
  gap: var(--space-2);
}

.stale-note .btn {
  align-self: flex-start;
}

.toast.leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.35s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Today */

.today-head {
  margin-bottom: var(--space-5);
}

.today-head h1 {
  margin-bottom: var(--space-1);
}

.player-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3) var(--space-5);
  align-items: center;
}

.player-level {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 5.5rem;
}

.player-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 500;
  line-height: 1;
  color: var(--accent-text);
}

.player-title {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.player-progress .note {
  margin: 0;
}

.player-stats {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
}

.stat {
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
  color: var(--muted);
  font-size: var(--text-sm);
}

.quest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.quest {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 var(--space-3);
  align-items: center;
}

.quest-text {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  grid-column: 1 / -1;
}

.quest-title {
  font-weight: 600;
}

.quest-xp,
.quest-count {
  color: var(--muted);
  font-size: var(--text-sm);
}

.quest.done .quest-title {
  color: var(--accent-text);
}

.plan h2,
.more h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  margin: var(--space-6) 0 var(--space-4);
}

.plan-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.plan-step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow);
}

.plan-step.done {
  opacity: 0.75;
}

.plan-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  font-size: var(--text-lg);
  color: var(--text-strong);
}

.plan-step p {
  margin: var(--space-1) 0;
}

.stage-line {
  color: var(--accent-text);
  font-size: var(--text-sm);
  font-weight: 600;
}

.course-progress {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.course-progress .meter {
  flex: 1;
}

.more-grid,
.course-grid,
.stat-grid,
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: var(--space-4);
}

.tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.tile strong {
  color: var(--text-strong);
}

a.tile:hover,
.course-card:hover {
  border-color: var(--accent);
}

.tile.disabled {
  opacity: 0.5;
  box-shadow: none;
}

.tile-icon {
  font-size: 1.5rem;
}

.course-card {
  color: var(--text);
  text-decoration: none;
  display: block;
}

.empty-state {
  text-align: center;
  padding: var(--space-7) var(--space-5);
}

/* Course map */

.course-head {
  margin-bottom: var(--space-4);
}

.course-about summary {
  cursor: pointer;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  margin: 0 0 var(--space-3);
}

.course-about p {
  max-width: var(--reading-max);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  align-items: center;
}

.module {
  margin: var(--space-6) 0;
}

.module h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  margin: 0;
}

.module-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
}

.lesson-list {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.lesson-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
}

.lesson-row:last-child {
  border-bottom: 0;
}

.lesson-list.compact .lesson-row {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}

.lesson-row.status-unwritten,
.lesson-row.status-locked {
  background: var(--surface-2);
}

.lesson-row.status-unwritten .lesson-title {
  color: var(--faint);
}

.lesson-link {
  color: var(--text-strong);
  font-weight: 650;
  text-decoration: none;
}

.lesson-link:hover {
  color: var(--accent-text);
}

.lesson-meta {
  text-align: right;
  font-size: var(--text-xs);
}

.status-dot {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
}

.status-dot.status-learned {
  background: var(--accent);
  border-color: var(--accent);
}

.status-dot.status-read {
  background: var(--blue);
  border-color: var(--blue);
}

.status-dot.status-in_progress {
  background: var(--amber);
  border-color: var(--amber);
}

.status-dot.status-available {
  border-color: var(--accent);
}

.status-dot.status-unwritten {
  border-style: dashed;
}

/* Lesson */

.lesson-layout {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.lesson-body {
  min-width: 0;
}

.lesson-body > h1 {
  margin-bottom: var(--space-5);
}

.lesson-outline {
  position: sticky;
  top: 5.5rem;
  font-size: var(--text-sm);
}

.lesson-outline ol {
  padding-left: 1.2rem;
  margin: var(--space-2) 0 var(--space-4);
}

.lesson-outline li {
  margin: var(--space-2) 0;
  color: var(--muted);
}

.lesson-outline li.done::marker {
  content: "✓ ";
  color: var(--accent-text);
}

.lesson-outline li.current a {
  color: var(--accent-text);
  font-weight: 700;
}

.lesson-outline a {
  color: var(--text);
  text-decoration: none;
}

.lesson-outline a:hover {
  text-decoration: underline;
}

.outline-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.stage-bar {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  padding: 0;
  margin: 0 0 var(--space-6);
}

.stage {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: var(--space-2) var(--space-3);
  color: var(--muted);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: 600;
}

.stage-number {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  font-weight: 700;
  font-size: var(--text-xs);
  flex: none;
}

.stage.done {
  color: var(--text);
}

.stage.done .stage-number {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.stage.current {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.goals ul {
  margin: 0;
  padding-left: 1.2rem;
}

.goals li {
  margin: var(--space-1) 0;
}

.lesson-body .card h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  margin-bottom: var(--space-4);
}

.section-head {
  margin-bottom: var(--space-4);
}

.section-head .eyebrow {
  color: var(--accent-text);
}

.reading {
  scroll-margin-top: 5.5rem;
  padding: var(--space-6);
}

.reading .section-head h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}

.guess.folded {
  opacity: 0.85;
}

.check {
  margin-top: var(--space-6);
  border-top: 1px dashed var(--line-strong);
  padding-top: var(--space-5);
}

.check-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: var(--space-3);
}

.prose {
  font-size: var(--text-md);
  line-height: var(--leading-body);
  max-width: var(--reading-max);
}

.prose p {
  margin: 0 0 var(--space-4);
}

.prose strong {
  color: var(--text-strong);
}

.prose h3,
.prose h4,
.prose h5 {
  font-size: var(--text-lg);
  margin: var(--space-5) 0 var(--space-2);
}

.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  width: auto;
  margin: var(--space-3) 0 var(--space-4);
  font-size: var(--text-base);
}

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: var(--space-2) var(--space-3);
  text-transform: none;
  letter-spacing: 0;
  font-size: var(--text-base);
}

.prose th {
  background: var(--surface-2);
  color: var(--text-strong);
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
  margin: 0 0 var(--space-4);
}

.prose li {
  margin: var(--space-1) 0;
}

.prose code {
  background: var(--surface-2);
  border-radius: 0.3rem;
  padding: 0.05rem 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.prose blockquote {
  margin: var(--space-3) 0;
  padding-left: var(--space-4);
  border-left: 3px solid var(--line-strong);
  color: var(--muted);
}

.math code {
  color: var(--muted);
}

.math-display {
  margin: var(--space-4) 0;
  overflow-x: auto;
}

/* Callouts: the title is a small colored label, the box a light tint of the same color. */

.callout {
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-5) 0;
  background: var(--surface-2);
  border-left: 4px solid var(--line-strong);
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout-title {
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin: 0 0 var(--space-2);
  color: var(--muted);
}

.callout-key {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.callout-key .callout-title {
  color: var(--accent-text);
}

.callout-example {
  background: var(--blue-soft);
  border-left-color: var(--blue);
}

.callout-example .callout-title {
  color: var(--blue);
}

.callout-why {
  background: var(--violet-soft);
  border-left-color: var(--violet);
}

.callout-why .callout-title {
  color: var(--violet);
}

.callout-mistake {
  background: var(--red-soft);
  border-left-color: var(--red);
}

.callout-mistake .callout-title {
  color: var(--red);
}

.callout-try {
  background: var(--amber-soft);
  border-left-color: var(--amber);
}

.callout-try .callout-title {
  color: var(--amber);
}

.figure {
  margin: var(--space-5) 0;
}

.figure-art svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  filter: var(--figure-filter);
}

/* A figure that shows colours as they are (data-colour="exact" on its svg,
   content/SCHEMA.md) is never inverted; it draws its own background. */
.figure-art svg[data-colour="exact"] {
  filter: none;
}

.figure figcaption {
  color: var(--muted);
  font-size: var(--text-sm);
  text-align: center;
  margin-top: var(--space-2);
}

.summary h3 {
  font-size: var(--text-lg);
}

.terms dt {
  font-weight: 700;
  color: var(--text-strong);
  margin-top: var(--space-3);
}

.terms dd {
  margin: var(--space-1) 0 0;
}

.references summary {
  cursor: pointer;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-top: var(--space-5);
}

.repair-item {
  border-top: 1px solid var(--line);
  padding: var(--space-5) 0;
}

.repair-item.done {
  opacity: 0.7;
}

.repair-link {
  display: inline-block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
}

.readiness {
  display: grid;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
  font-weight: 600;
}

.listeners {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: var(--space-4);
}

.listeners .check-label {
  width: 100%;
}

.teach-prompt {
  font-weight: 600;
}

.teach-text {
  margin: var(--space-3) 0;
}

.rubric {
  margin: 0 0 var(--space-4);
}

/* Questions */

.question {
  margin: var(--space-2) 0 var(--space-5);
}

.question-stem {
  font-weight: 600;
  color: var(--text-strong);
}

.question-stem p {
  margin-bottom: var(--space-3);
}

.choices {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-3) 0 var(--space-4);
}

.choice {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  font-size: var(--text-md);
}

.choice:hover {
  border-color: var(--accent);
}

.choice[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.typed {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-3) 0 var(--space-4);
  max-width: 26rem;
}

.typed-input {
  font-size: var(--text-lg);
}

.typed-unit {
  color: var(--muted);
}

.confidence {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin: 0 0 var(--space-4);
}

.confidence-label {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-right: var(--space-1);
}

.verdict {
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-3) 0;
  background: var(--surface-2);
  border-left: 4px solid var(--line-strong);
}

.verdict.right {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.verdict.wrong {
  background: var(--red-soft);
  border-left-color: var(--red);
}

.verdict-head {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
  font-weight: 700;
}

.verdict.right .verdict-head {
  color: var(--accent-text);
}

.verdict.wrong .verdict-head {
  color: var(--red);
}

.verdict-line {
  margin: var(--space-1) 0;
}

.verdict-label {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.verdict-why {
  margin-top: var(--space-3);
  font-size: var(--text-base);
}

/* Prove it */

.quiz-head {
  margin-bottom: var(--space-4);
}

.quiz-head h1 {
  margin-bottom: var(--space-2);
}

.quiz-card {
  margin-top: var(--space-4);
}

.quiz-result {
  text-align: center;
}

.quiz-result .actions {
  justify-content: center;
}

.quiz-result .lede {
  margin-left: auto;
  margin-right: auto;
}

.result-emoji {
  font-size: 3rem;
  margin: 0;
}

/* Daily recall */

.recall-progress {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-5);
}

.recall-progress .meter {
  flex: 1;
}

.lightning-streak {
  color: var(--amber);
  font-weight: 700;
  font-size: var(--text-sm);
}

.flash {
  max-width: 42rem;
  margin: 0 auto;
  display: grid;
  gap: var(--space-3);
}

.flash-face {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-6) var(--space-5);
  text-align: center;
  position: relative;
  min-height: 9rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow);
  animation: flash-in 0.25s ease-out;
}

.flash-back {
  border-color: var(--accent);
}

.flash-back.wrong {
  border-color: var(--red);
}

.flash-text {
  font-size: var(--text-xl);
  max-width: none;
  color: var(--text-strong);
}

.flash-text p {
  margin-left: auto;
  margin-right: auto;
}

.flash-source {
  position: absolute;
  top: var(--space-3);
  left: var(--space-4);
  font-size: var(--text-xs);
  margin: 0;
}

.flash-new {
  position: absolute;
  top: var(--space-3);
  right: var(--space-4);
  color: var(--amber);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flash-controls {
  max-width: 42rem;
  margin: var(--space-5) auto 0;
  text-align: center;
}

.flash-controls.typed-recall {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

.grades {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

/* A grade says what happened in the learner's words, in that grade's color. */
.grade {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  align-items: center;
  justify-content: center;
  min-height: 4.5rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-2);
  cursor: pointer;
}

.grade-help {
  font-size: var(--text-md);
  font-weight: 700;
  line-height: var(--leading-snug);
}

.grade-word {
  font-size: var(--text-xs);
  color: var(--faint);
  font-weight: 600;
}

.grade-again .grade-help {
  color: var(--red);
}

.grade-hard .grade-help {
  color: var(--amber);
}

.grade-good .grade-help {
  color: var(--accent-text);
}

.grade-easy .grade-help {
  color: var(--blue);
}

.grade-again:hover {
  border-color: var(--red);
  background: var(--red-soft);
}

.grade-hard:hover {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.grade-good:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.grade-easy:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.grade-note {
  margin-top: var(--space-3);
}

.recall-done {
  text-align: center;
}

.recall-done .actions {
  justify-content: center;
}

@keyframes flash-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
}

/* Progress */

.day-chart {
  display: flex;
  align-items: flex-end;
  gap: var(--space-1);
  height: 9rem;
}

.day-column {
  flex: 1;
  max-width: 2.6rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-1);
}

.day-fill {
  width: 100%;
  background: var(--accent);
  border-radius: 0.3rem 0.3rem 0 0;
  min-height: 4px;
}

.day-label {
  font-size: var(--text-xs);
  color: var(--muted);
}

.achievement {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.achievement strong {
  color: var(--text-strong);
}

.achievement.locked {
  opacity: 0.55;
  background: var(--surface-2);
}

.achievement-icon {
  font-size: 1.6rem;
}

/* Work it out: a pencil-and-paper card, hints one at a time, the worked solution after. */

.paper-head,
.games-head,
.game-head {
  margin-bottom: var(--space-5);
}

.paper-head h1,
.games-head h1 {
  margin-bottom: var(--space-2);
}

.paper-intro {
  text-align: center;
  padding: var(--space-7) var(--space-5);
}

.paper-intro .lede {
  margin: 0 auto var(--space-3);
}

.paper-intro .btn {
  margin-top: var(--space-4);
}

.paper-pencil {
  font-size: 3rem;
  margin: 0 0 var(--space-3);
}

.paper-card {
  margin-top: var(--space-4);
}

.paper-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-3);
}

.paper-top .eyebrow {
  color: var(--accent-text);
  margin: 0;
}

.paper-reminder {
  display: inline-block;
  margin: 0 0 var(--space-4);
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: var(--text-sm);
  font-weight: 700;
}

.paper-hints {
  margin: 0 0 var(--space-4);
}

.hint-list {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-5);
}

.hint {
  color: var(--blue);
  margin-bottom: var(--space-2);
  animation: flash-in 0.25s ease-out;
}

.hint .prose p {
  margin: 0;
}

.solution-label {
  display: block;
  margin-top: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: var(--text-xs);
  font-weight: 700;
}

.paper-call h2 {
  margin-bottom: var(--space-2);
}

/* Prove it review questions: a small label in the review color, nothing louder. */

.quiz-card-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2) var(--space-4);
}

.quiz-card-top .note {
  margin: 0;
}

.review-badge {
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.quiz-card.review {
  border-color: var(--violet);
}

/* Games hub */

.games-course {
  margin-bottom: var(--space-7);
}

.games-course h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 500;
  margin-bottom: var(--space-4);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--space-4);
}

.game-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

a.game-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-pop);
}

.game-tile.game-paper {
  border-top-color: var(--amber);
}

.game-tile.game-clock {
  border-top-color: var(--blue);
}

.game-tile.game-lives {
  border-top-color: var(--red);
}

.game-tile.game-mental {
  border-top-color: var(--violet);
}

.game-tile.disabled {
  opacity: 0.55;
  box-shadow: none;
}

.game-tile-icon {
  font-size: 2.25rem;
  line-height: 1;
}

.game-tile-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--text-strong);
}

.game-tile-help {
  color: var(--muted);
  font-size: var(--text-sm);
}

.game-tile-status {
  margin-top: auto;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.game-tile .btn {
  align-self: flex-start;
}

/* The play screen: score and streak above, the clock as a draining bar, one item in the middle. */

.game-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
}

.game-head h1 {
  margin-bottom: 0;
}

.game-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  margin-bottom: var(--space-3);
}

.hud-score {
  display: flex;
  flex-direction: column;
}

.hud-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.hud-value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  line-height: 1;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.hud-streak {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--muted);
}

.hud-streak.hot {
  color: var(--amber);
}

.hud-streak.hot .hud-flame {
  animation: flame 0.8s ease-in-out infinite alternate;
}

.hud-mult {
  padding: 0 var(--space-2);
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: var(--text-base);
  animation: pop 0.3s ease-out;
}

.hud-lives {
  display: flex;
  gap: var(--space-1);
  font-size: var(--text-2xl);
}

.heart.gone {
  opacity: 0.35;
}

.heart.breaking {
  animation: heart-break 0.6s ease-out;
}

.hud-level {
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  background: var(--violet-soft);
  color: var(--violet);
  font-weight: 700;
}

.game-timer {
  position: relative;
  height: 0.9rem;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  margin-bottom: var(--space-5);
}

.game-timer-fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.game-timer.low .game-timer-fill {
  background: var(--red);
  animation: pulse 0.5s ease-in-out infinite alternate;
}

.game-timer-text {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.game-stage {
  position: relative;
}

.game-arena {
  min-height: 18rem;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.game-arena.flash-right {
  animation: flash-right 0.35s ease-out;
}

.game-arena.shake {
  animation: shake 0.4s ease-in-out;
}

.game-item {
  animation: flash-in 0.18s ease-out;
}

.game-from {
  margin: 0 0 var(--space-2);
}

.game-stem {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: var(--space-5);
}

.game-stem.mental {
  text-align: center;
  font-size: var(--text-3xl);
}

.game-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: var(--space-3);
}

.game-choice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-align: left;
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  border: 2px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-md);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.game-choice:hover:not(:disabled) {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.game-choice.picked {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.game-key {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 0.4rem;
  background: var(--surface-3);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
}

.game-typed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  max-width: 30rem;
}

.game-typed .game-input {
  flex: 1;
  min-width: 8rem;
  font-size: var(--text-xl);
}

.game-mental .game-typed {
  margin: 0 auto;
}

.game-feedback {
  min-height: 1.6rem;
  margin: var(--space-4) 0 0;
  color: var(--red);
  font-weight: 600;
}

.game-feedback.shown {
  animation: flash-in 0.2s ease-out;
}

.game-countdown {
  display: grid;
  place-items: center;
  min-height: 14rem;
}

.countdown-number {
  font-family: var(--font-display);
  font-size: 6rem;
  color: var(--accent-text);
  animation: countdown 0.7s ease-out;
}

.game-floaters {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.floater {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translateX(-50%);
  font-weight: 800;
  white-space: nowrap;
  animation: float-up 1s ease-out forwards;
}

.float-points {
  color: var(--accent-text);
  font-size: var(--text-2xl);
}

.float-combo {
  top: 20%;
  color: var(--amber);
  font-size: var(--text-3xl);
  font-family: var(--font-display);
}

.float-level {
  top: 60%;
  color: var(--violet);
  font-size: var(--text-2xl);
}

.game-result {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: var(--space-7) var(--space-5);
}

.game-result .actions {
  justify-content: center;
}

.game-final-score {
  font-family: var(--font-display);
  font-size: 4.5rem;
  line-height: 1;
  margin: var(--space-3) 0;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.record-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-4);
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 800;
  font-size: var(--text-lg);
  animation: pop 0.5s ease-out;
}

.game-stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-5);
  padding: 0;
  margin: var(--space-5) 0;
  color: var(--muted);
  font-weight: 600;
}

.stat-right {
  color: var(--accent-text);
}

.stat-wrong {
  color: var(--red);
}

.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: -1rem;
  width: 0.55rem;
  height: 0.9rem;
  border-radius: 0.15rem;
  animation-name: confetti-fall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}

.confetti-piece.c1 {
  background: var(--accent);
}

.confetti-piece.c2 {
  background: var(--blue);
}

.confetti-piece.c3 {
  background: var(--amber);
}

.confetti-piece.c4 {
  background: var(--red);
}

.confetti-piece.c5 {
  background: var(--violet);
}

@keyframes flash-right {
  0% {
    box-shadow: 0 0 0 0 var(--accent);
  }
  100% {
    box-shadow: 0 0 0 14px transparent;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-10px);
  }
  40%,
  80% {
    transform: translateX(10px);
  }
}

@keyframes pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  60% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes countdown {
  0% {
    transform: scale(1.8);
    opacity: 0;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes float-up {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -70px) scale(1);
  }
}

@keyframes flame {
  from {
    transform: scale(1) rotate(-6deg);
  }
  to {
    transform: scale(1.25) rotate(6deg);
  }
}

@keyframes heart-break {
  0% {
    transform: scale(1.4);
  }
  50% {
    transform: scale(0.7) rotate(-15deg);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pulse {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.55;
  }
}

@keyframes confetti-fall {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--drift), 30rem) rotate(var(--spin));
    opacity: 0;
  }
}

@media (max-width: 720px) {
  .game-arena {
    padding: var(--space-5) var(--space-4);
    min-height: 15rem;
  }

  .game-hud {
    gap: var(--space-3) var(--space-5);
  }

  .hud-value {
    font-size: var(--text-2xl);
  }

  .game-stem.mental {
    font-size: var(--text-2xl);
  }

  .game-final-score {
    font-size: 3.5rem;
  }
}

/* Motion is decoration. Without it, every change still shows, it just does not move. */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Placement: a chapter's level is a small label in the level's color; the scheme is a checklist. */

.level-chip {
  display: inline-block;
  padding: 0.1rem var(--space-2);
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.level-chip.level-weak {
  background: var(--red-soft);
  color: var(--red);
}

.level-chip.level-developing {
  background: var(--amber-soft);
  color: var(--amber);
}

.level-chip.level-strong {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.module-head .level-chip {
  margin-left: var(--space-2);
}

.course-placement {
  margin-bottom: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.course-placement.due {
  display: block;
  border-left: 4px solid var(--accent);
}

.course-placement.due h2 {
  margin-bottom: var(--space-2);
}

.course-placement p {
  margin: 0 0 var(--space-3);
}

/* A course's goal: the question, then the pace. Type separates the choices, not boxes. */
.course-pace {
  margin-bottom: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.course-pace.due {
  display: block;
  border-left: 4px solid var(--accent);
}

.course-pace h2 {
  margin-bottom: var(--space-1);
}

.course-pace p {
  margin: 0;
}

.course-pace .pace-form {
  flex-basis: 100%;
}

.pace-form fieldset {
  border: 0;
  padding: 0;
  margin: var(--space-2) 0 var(--space-3);
}

.pace-form legend {
  padding: 0;
  margin-bottom: var(--space-2);
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-strong);
}

/* Beats "label.check-row span", which keeps every span of a check row inline. */
label.check-row .pace-choice-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

label.check-row .pace-choice-text .note {
  color: var(--muted);
  font-size: var(--text-sm);
}

.pace-form .pace-date {
  width: auto;
  margin-left: var(--space-6);
}

.plan-step .pace-line {
  margin: var(--space-1) 0;
}

.pace-today {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-strong);
}

.placement-head {
  margin-bottom: var(--space-5);
}

.placement-intro {
  padding: var(--space-6) var(--space-5);
}

.placement-intro .lede {
  margin-bottom: var(--space-3);
}

.placement-card {
  margin-top: var(--space-4);
}

.placement-modules {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
}

.placement-module {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
}

.placement-module-title {
  flex: 1;
  font-weight: 600;
  color: var(--text-strong);
}

.placement-missed {
  margin-top: var(--space-6);
}

.placement-miss {
  margin-bottom: var(--space-4);
}

.paper-points {
  margin: 0 0 var(--space-4);
  font-weight: 700;
}

.paper-proof {
  margin: var(--space-4) 0;
}

.proof-scheme {
  list-style: none;
  padding: 0;
  margin: var(--space-2) 0 var(--space-3);
}

.rubric-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
  cursor: pointer;
}

.rubric-line:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.rubric-points {
  font-weight: 700;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

.proof-total {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--text-strong);
  margin: var(--space-2) 0 var(--space-3);
  font-variant-numeric: tabular-nums;
}

.proof-verdict {
  font-weight: 700;
}

/* Admin frame */

.shell {
  position: relative;
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-5) var(--space-4);
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}

.rail .brand {
  margin-bottom: var(--space-4);
}

.rail-link {
  color: var(--text);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
}

.rail-link:hover {
  background: var(--surface-3);
}

.rail-link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.rail-spacer {
  flex: 1;
}

.panel {
  padding: var(--space-6) var(--space-6) var(--space-8);
  max-width: 90rem;
  min-width: 0;
}

.panel-tools {
  position: absolute;
  top: var(--space-5);
  right: var(--space-6);
}

.panel > h1,
.panel .page-head {
  padding-right: 6rem;
}

.stat-grid {
  margin-bottom: var(--space-5);
}

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.stat-tile.attention {
  border-color: var(--amber);
}

.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 500;
  color: var(--text-strong);
}

.course-cells {
  min-width: 12rem;
}

.course-cell .meter {
  margin-top: var(--space-1);
}

.feed {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feed-item {
  display: grid;
  grid-template-columns: 9rem 9.5rem 1fr 4.5rem 7.5rem;
  gap: var(--space-3);
  align-items: baseline;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
}

.feed-what {
  font-weight: 600;
}

.feed-xp {
  color: var(--accent-text);
  font-weight: 700;
  white-space: nowrap;
}

.feed-when {
  white-space: nowrap;
}

.form-card {
  margin-bottom: var(--space-5);
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0 var(--space-4);
  align-items: start;
}

.grid-form > fieldset,
.grid-form > .alert,
.grid-form > .actions,
.grid-form > .wide {
  grid-column: 1 / -1;
}

/* A lesson draft: the file as it would be saved, in the mono face, unwrapped like the file. */

.draft-text {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  min-height: 24rem;
  white-space: pre;
}

.draft-path {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-strong);
}

.eyebrow.draft-refused {
  color: var(--red);
}

.link-box {
  margin: var(--space-3) 0;
}

.link-row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.link-field {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.admin-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--space-5);
}

.admin-module h3 {
  margin-top: var(--space-4);
}

@media (max-width: 900px) {
  .lesson-layout {
    grid-template-columns: 1fr;
  }

  .lesson-outline {
    position: static;
  }

  .admin-columns {
    grid-template-columns: 1fr;
  }

  .stage-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .grades {
    grid-template-columns: repeat(2, 1fr);
  }

  .feed-item {
    grid-template-columns: 1fr auto;
  }

  .learner-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .player-chip .chip-bar {
    display: none;
  }

  .reading {
    padding: var(--space-5) var(--space-4);
  }
}

@media (max-width: 720px) {
  .loop-grid {
    grid-template-columns: 1fr;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .rail {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail .brand {
    margin-bottom: 0;
  }

  .rail-spacer {
    display: none;
  }

  .top {
    flex-wrap: wrap;
    align-items: center;
  }

  .nav {
    justify-content: flex-end;
  }

  .panel {
    padding: var(--space-5) var(--space-4) var(--space-7);
  }

  .panel-tools {
    top: var(--space-3);
    right: var(--space-4);
  }

  .panel > h1,
  .panel .page-head {
    padding-right: 0;
  }

  h1 {
    font-size: var(--text-2xl);
  }

  .learner-main {
    padding: var(--space-5) var(--space-4) var(--space-7);
  }
}

/* Beside a module title, the chip sits on the title's line, not mid-row. */
.module-head h2 .level-chip {
  margin-left: var(--space-2);
  vertical-align: middle;
}

/*
 * Model help (decision 015). "Explain more" is a line of accent text with a
 * small circled i, not a button box: it sits under something the learner
 * already reads. The explanation it opens is a callout in the violet of
 * "why it matters", left-aligned even on a centred card back. Marked lines
 * lead with a tick or a cross in the verdict colours; the model's comment is
 * the muted line under each.
 */

.ai-more {
  margin: var(--space-3) 0 0;
  text-align: left;
}

.ai-more-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: 0;
  padding: var(--space-1) 0;
  color: var(--accent-text);
  font-size: var(--text-sm);
  font-weight: 650;
  cursor: pointer;
}

.ai-more-button:hover .ai-more-label {
  text-decoration: underline;
}

.ai-more-icon {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border: 1.5px solid currentcolor;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-style: italic;
  font-weight: 700;
  line-height: 1;
}

.ai-more-button[aria-expanded="true"] .ai-more-icon {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.ai-panel {
  margin: var(--space-2) 0 0;
  padding: var(--space-4) var(--space-5);
  border-left: 4px solid var(--violet);
  border-radius: var(--radius-sm);
  background: var(--violet-soft);
  text-align: left;
  max-width: var(--reading-max);
}

.ai-label {
  color: var(--violet);
}

.ai-text {
  font-size: var(--text-base);
}

.ai-wait {
  font-variant-numeric: tabular-nums;
  margin: var(--space-3) 0;
}

.ai-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
}

.ai-feedback .note {
  margin: 0;
}

.ai-vote {
  padding: 0.2rem 0.7rem;
}

.ai-lines {
  list-style: none;
  padding: 0;
  margin: var(--space-2) 0 var(--space-4);
}

.ai-line {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
}

.ai-line-head {
  display: grid;
  grid-template-columns: 1.25rem 1fr auto;
  gap: var(--space-2);
  align-items: baseline;
}

.ai-line-mark {
  font-weight: 800;
  color: var(--red);
}

.ai-line.earned .ai-line-mark {
  color: var(--accent-text);
}

.ai-line-text {
  color: var(--text-strong);
  font-weight: 600;
}

.ai-line-comment {
  margin: var(--space-1) 0 0 calc(1.25rem + var(--space-2));
  color: var(--muted);
  font-size: var(--text-sm);
}

.ai-photos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-3) 0;
}

.ai-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.ai-thumb {
  position: relative;
  margin: 0;
  width: 6rem;
  height: 6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}

.ai-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ai-thumbs-large .ai-thumb {
  width: 14rem;
  height: 18rem;
}

.ai-thumbs-large .ai-thumb img {
  object-fit: contain;
}

.ai-thumb-remove {
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  width: 1.6rem;
  height: 1.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-strong);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.ai-proof-text {
  width: 100%;
}

/* Beats "label.check-row span", which keeps every span of a check row inline. */
label.check-row .ai-switch-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

label.check-row .ai-switch-text .note {
  color: var(--muted);
  font-size: var(--text-sm);
}

.ai-thumbs:empty {
  display: none;
}

.ai-state.on {
  color: var(--accent-text);
  font-weight: 650;
}

.ai-state.off {
  color: var(--red);
  font-weight: 650;
}

.ai-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin: 0 0 var(--space-5);
}

.ai-filters .tabs {
  margin: 0;
}

.ai-filters select {
  width: auto;
  max-width: 20rem;
}

.ai-filters .tab {
  background: none;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  cursor: pointer;
}

.ai-who {
  padding: 0;
  color: var(--text-strong);
  font-weight: 600;
  text-decoration: none;
}

.ai-row-failed td:first-child {
  box-shadow: inset 3px 0 0 var(--red);
}

.ai-status {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ai-status-ok {
  color: var(--accent-text);
}

.ai-status-error,
.ai-status-timeout,
.ai-status-unusable {
  color: var(--red);
}

.ai-status-running,
.ai-status-limited {
  color: var(--amber);
}

.ai-detail {
  background: var(--surface-2);
}

.ai-block {
  margin: var(--space-3) 0;
}

.ai-block summary {
  cursor: pointer;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 650;
}

.ai-pre {
  margin: var(--space-2) 0 0;
  padding: var(--space-3);
  max-height: 28rem;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Audit it: a document's numbered lines, tapped to mark the flaw, then named. */

.audit-head,
.lab-head,
.mistakes-head {
  margin-bottom: var(--space-5);
}

.audit-head h1,
.lab-head h1,
.mistakes-head h1 {
  margin-bottom: var(--space-2);
}

.audit-card,
.lab-card {
  margin-top: var(--space-4);
}

.audit-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--text-strong);
  margin: var(--space-1) 0 var(--space-3);
}

.audit-ask {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-text);
  margin: var(--space-4) 0 var(--space-2);
}

.audit-doc {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.audit-line {
  margin: 0;
}

.audit-line-button {
  display: flex;
  gap: var(--space-3);
  width: 100%;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border: 1px solid transparent;
  border-bottom-color: var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.audit-line-button:hover:not(:disabled) {
  background: var(--surface-2);
}

.audit-line-button[aria-pressed="true"] {
  background: var(--amber-soft);
  border-color: var(--amber);
}

.audit-line-button.flawed {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.audit-line-button.wrong-pick {
  background: var(--red-soft);
  border-color: var(--red);
}

.audit-line-number {
  min-width: 1.5rem;
  color: var(--faint);
  font-weight: 700;
}

.audit-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.audit-options .audit-ask {
  flex-basis: 100%;
}

.audit-option.right {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.audit-option.wrong {
  background: var(--red-soft);
  border-color: var(--red);
}

.audit-count {
  margin: var(--space-2) 0;
}

.audit-card > .btn.primary,
.lab-card > .btn.primary {
  margin-top: var(--space-4);
}

/* Threshold lab: cases on a strip by score, a cut-off to drag, the four counts. */

.lab-goal {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-strong);
  margin: 0 0 var(--space-3);
}

.lab-strip,
.lab-curve {
  width: 100%;
  height: auto;
  display: block;
}

.lab-flag-zone {
  fill: var(--amber-soft);
}

.lab-cut {
  stroke: var(--amber);
  stroke-width: 2;
}

.lab-axis,
.lab-curve-line {
  stroke: var(--line-strong);
  stroke-width: 1.5;
  fill: none;
}

.lab-curve-line {
  stroke: var(--blue);
  stroke-width: 2;
}

.lab-tick,
.lab-legend {
  fill: var(--muted);
  font-size: 12px;
  font-family: var(--font-ui);
}

.lab-tick.end {
  text-anchor: end;
}

.lab-dot.negative {
  fill: var(--surface);
  stroke: var(--blue);
  stroke-width: 1.5;
}

.lab-dot.positive {
  fill: var(--red);
  stroke: var(--red);
}

.lab-dot.flagged {
  stroke-width: 2.5;
}

.lab-curve-dot.best {
  fill: var(--accent);
}

.lab-curve-dot.chosen {
  fill: none;
  stroke: var(--amber);
  stroke-width: 3;
}

.lab-curve-dot.infeasible {
  fill: var(--faint);
}

.lab-slider {
  width: 100%;
  margin: var(--space-3) 0 var(--space-1);
  accent-color: var(--amber);
}

.lab-readout {
  font-size: var(--text-sm);
  color: var(--muted);
  margin: 0 0 var(--space-3);
}

.lab-matrix {
  border-collapse: collapse;
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
}

.lab-matrix th,
.lab-matrix td {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  text-align: center;
}

.lab-matrix th {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.lab-matrix td {
  font-size: var(--text-lg);
  font-weight: 700;
}

.lab-matrix .cell-good {
  color: var(--accent-text);
}

.lab-matrix .cell-bad {
  color: var(--red);
}

.lab-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-2);
}

.lab-link {
  display: flex;
  gap: var(--space-3);
  align-items: baseline;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.lab-item.solved .lab-link {
  border-color: var(--accent);
}

.lab-curve-figure {
  margin: var(--space-4) 0;
}

/* Mistake review: each open miss beside the passage that teaches it. */

.mistake-card {
  margin-top: var(--space-4);
}

.mistake-card.fixed {
  border-color: var(--accent);
}

.mistake-passage {
  margin: var(--space-3) 0;
  color: var(--text);
}

.mistake-passage summary {
  cursor: pointer;
  color: var(--accent-text);
  font-weight: 600;
}

.mistake-flashcard {
  border-top: 1px solid var(--line);
  padding-top: var(--space-3);
  margin-bottom: var(--space-3);
}

.course-tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin: 0 0 var(--space-5);
}

/*
 * Feedback on a passage (decision 019). The button under a selection is a
 * small accent circle with a pencil: an action on what is marked, above the
 * text and below the learner bar. The dialog is the site's one modal: a card
 * on a dimmed page, the marked text as a quote in reading size, then the
 * reasons as rows to pick, each its name and one muted line. The tutor's
 * answer is the violet panel of "explain more".
 */

.report-pin {
  position: absolute;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-pop);
  font-size: var(--text-lg);
  line-height: 1;
  cursor: pointer;
}

.report-pin[hidden] {
  display: none;
}

.report-dialog {
  width: min(36rem, calc(100vw - 2 * var(--space-4)));
  max-height: calc(100vh - 2 * var(--space-5));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-pop);
}

.report-dialog::backdrop {
  background: var(--backdrop);
}

.report-box {
  padding: var(--space-5);
}

.report-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.report-head .eyebrow {
  margin: 0;
}

.report-close {
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--muted);
  font-size: var(--text-xl);
  line-height: 1;
  cursor: pointer;
}

.report-close:hover {
  color: var(--text-strong);
}

.report-title {
  margin: var(--space-2) 0 var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-xl);
}

.report-quote {
  max-height: 12rem;
  overflow: auto;
  margin: 0 0 var(--space-5);
  padding: var(--space-1) 0 var(--space-1) var(--space-4);
  border-left: 3px solid var(--line-strong);
  color: var(--text);
  font-size: var(--text-md);
}

.report-quote p {
  margin: 0 0 var(--space-1);
}

.report-reasons {
  display: grid;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding: 0;
  border: 0;
}

.report-reasons legend {
  padding: 0;
}

/* A reason row is a label, so the form labels' margin and span styles are undone here. */
.report-reason {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
}

.report-reason:hover {
  border-color: var(--line-strong);
}

.report-reason:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.report-reason input {
  margin: 0;
  accent-color: var(--accent);
}

.report-reason span {
  margin: 0;
}

.report-reason-icon {
  font-size: var(--text-lg);
}

.report-reason-words {
  display: grid;
}

.report-reason-name {
  color: var(--text-strong);
  font-size: var(--text-base);
  font-weight: 600;
}

.report-reason-help {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 400;
}

.report-comment-label {
  display: grid;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  color: var(--muted);
  font-size: var(--text-sm);
}

.report-comment-label[hidden] {
  display: none;
}

.report-comment {
  width: 100%;
  resize: vertical;
}

.report-actions {
  justify-content: flex-end;
}

.report-thanks {
  margin: var(--space-4) 0;
  color: var(--text-strong);
  font-size: var(--text-md);
}

.report-sent-note {
  margin: var(--space-2) 0 var(--space-4);
}

.report-ask {
  margin: 0 0 var(--space-4);
}

.report-ask .report-quote {
  margin-bottom: var(--space-2);
}

.report-ask-text {
  margin: 0 0 var(--space-2);
  color: var(--text-strong);
  font-weight: 600;
}

.report-answer {
  max-width: none;
  margin: 0;
}

.report-answer .alert {
  margin: 0 0 var(--space-2);
}

/* The admin's Feedback page: a card per report, the reason as a coloured eyebrow. */

.report-list {
  display: grid;
  gap: var(--space-4);
}

.report-item .report-quote {
  max-height: none;
  margin-bottom: var(--space-3);
}

.report-item.resolved {
  background: var(--surface-2);
  box-shadow: none;
}

.report-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3);
}

.report-item-head .note {
  margin: 0;
}

.report-reason-tag {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.report-reason-tag-unclear {
  color: var(--blue);
}

.report-reason-tag-mistake {
  color: var(--red);
}

.report-reason-tag-other {
  color: var(--violet);
}

.report-where {
  margin: var(--space-2) 0 0;
}

.report-file {
  margin: var(--space-1) 0 var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.report-comment-text {
  margin: 0 0 var(--space-3);
}

.report-comment-text .eyebrow {
  display: inline;
}

.report-tutor {
  margin: 0 0 var(--space-3);
}

.report-item-actions {
  justify-content: flex-end;
  margin-top: var(--space-2);
}

.report-item-actions .note {
  margin: 0;
}

/* Russian protocol (decision 020): the day, a card at a time, Russian set large. */

.russian .ru-head {
  max-width: 40rem;
  margin: 0 auto;
}

.ru-stage {
  max-width: 40rem;
  margin: 0 auto;
}

.ru-stage .card,
.ru-today .card {
  max-width: 40rem;
}

.ru-today {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.ru-plan-list {
  margin: 0 0 var(--space-4);
  padding-left: 1.2rem;
  font-size: var(--text-md);
}

.ru-settings {
  max-width: 40rem;
  margin: var(--space-4) auto 0;
}

.ru-settings select {
  width: auto;
  display: inline-block;
  margin-left: var(--space-2);
}

.ru-card {
  display: grid;
  gap: var(--space-3);
}

.ru-progress {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.ru-progress .meter {
  flex: 1;
}

.ru-letter {
  font-family: var(--font-ru);
  font-size: var(--text-3xl);
  color: var(--text-strong);
  margin: 0;
}

.ru-big {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.ru-word-big {
  font-family: var(--font-ru);
  font-size: var(--text-2xl);
  color: var(--text-strong);
}

.ru-meaning {
  color: var(--text-strong);
  margin: 0;
}

.ru-line {
  font-family: var(--font-ru);
  font-size: var(--text-xl);
  color: var(--text-strong);
  margin: 0;
  line-height: 1.5;
}

.ru-inline .ru-line {
  font-size: var(--text-base);
}

.russian [lang="ru"],
.russian .ru-mixed {
  font-family: var(--font-ru);
}

.ru-word-known {
  cursor: pointer;
  border-bottom: 1px dotted var(--line-strong);
}

.ru-word-known:hover,
.ru-word-known:focus {
  color: var(--accent-text);
  outline: none;
}

.ru-gloss {
  margin: var(--space-1) 0 0;
  color: var(--accent-text);
}

.ru-example {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.ru-example .ru-glossed {
  flex: 1;
}

.ru-voice {
  display: inline-flex;
  gap: var(--space-1);
}

.ru-play {
  min-width: 2.4rem;
}

.ru-recorder {
  display: inline-flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.ru-back {
  display: grid;
  gap: var(--space-2);
  border-top: 1px solid var(--line);
  padding-top: var(--space-3);
}

.ru-type {
  display: grid;
  gap: var(--space-2);
}

.ru-input {
  font-family: var(--font-ru);
  font-size: var(--text-xl);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-strong);
}

.ru-keys-help {
  margin: 0;
}

.ru-keys-toggle {
  justify-self: start;
}

.ru-keys {
  display: grid;
  gap: var(--space-1);
}

.ru-key-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.ru-key {
  min-width: 2.2rem;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--text-md);
  cursor: pointer;
}

.ru-key-wide {
  min-width: 4.5rem;
}

.ru-status {
  margin: 0;
  font-weight: 600;
}

.ru-status.right {
  color: var(--accent-text);
}

.ru-status.wrong {
  color: var(--red);
}

.ru-choices {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.ru-options {
  display: grid;
  gap: var(--space-2);
}

.ru-option {
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
}

.ru-pair .ru-option {
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
}

.ru-option.ru-right {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.ru-option.ru-wrong {
  border-color: var(--red);
  background: var(--red-soft);
}

.ru-read-list {
  display: grid;
  gap: var(--space-3);
}

.ru-read-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.ru-dialogue {
  display: grid;
  gap: var(--space-4);
}

.ru-dialogue-line {
  display: grid;
  gap: var(--space-1);
}

.ru-dialogue-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.ru-who {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
}

.ru-translation summary,
.ru-rule summary {
  cursor: pointer;
  color: var(--muted);
}

.ru-comment {
  width: 100%;
  font: inherit;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.ru-checkin {
  display: grid;
  gap: var(--space-3);
}

.ru-words td,
.ru-words th {
  padding: var(--space-2) var(--space-3);
  text-align: left;
}

.admin-russian-learner {
  max-width: none;
}

.admin-russian-checkins {
  padding-left: 1.2rem;
}

/* Russian play (decision 021): where to start, goals, games, practice, achievements. */

.ru-play {
  max-width: 40rem;
  margin: var(--space-6) auto 0;
}

.ru-play h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.ru-play .game-grid {
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
}

.ru-onboarding,
.ru-goals {
  display: grid;
  gap: var(--space-3);
}

.ru-goals .quest {
  grid-template-columns: 1fr 6rem auto;
}

.ru-game {
  min-height: 24rem;
}

.ru-game-hud {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.ru-game-hud .hud-score {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--text-strong);
  margin-left: auto;
}

.ru-arena {
  display: grid;
  gap: var(--space-3);
  min-height: 12rem;
  justify-content: stretch;
  align-content: center;
}

.ru-score {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--accent-text);
  margin: 0;
}

.game-feedback.ru-good {
  color: var(--accent-text);
}

.game-feedback.ru-bad {
  color: var(--red);
}

.game-choice.ru-right {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.ru-stress-word {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-ru);
  font-size: var(--text-2xl);
  color: var(--text-strong);
}

.ru-stress-vowel {
  font: inherit;
  min-width: 2.6rem;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-strong);
  cursor: pointer;
}

.ru-stress-vowel:hover:not(:disabled) {
  border-color: var(--accent);
}

.ru-stress-vowel.ru-right {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.ru-genders .game-choice {
  flex: 1;
}

.ru-dont-know {
  color: var(--muted);
}

.ru-arena .game-choices {
  width: 100%;
  max-width: none;
  grid-template-columns: 1fr;
}

.ru-arena .ru-genders {
  grid-template-columns: repeat(3, 1fr);
}

.ru-arena > * {
  justify-self: stretch;
}

/*
 * Community (decision 022). The same tokens and the same rule: type before
 * boxes. A box is for something the reader acts on: a step to take, a
 * question to answer, a stage to edit, an attempt to decide.
 */

/*
 * The community's frames. The owner's rail is the admin's, with its links in
 * a group and sign-out beside the light and dark switch, so that on a phone
 * the three lie in one row over the links instead of the switch floating
 * over them. Every rule here names a community class; the course site's
 * admin rail keeps its own.
 */

.community-rail-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.community-rail-tools {
  display: grid;
}

.community-rail-tools .theme-switch {
  position: absolute;
  top: var(--space-5);
  right: var(--space-6);
}

.community-shell .panel > :first-child {
  padding-right: 6rem;
}

.community-bar-status {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-strong);
}

.community-bar-status:empty {
  display: none;
}

/* Beside sign-out on a wide screen; a row of its own on a phone. */
.community-bar-links {
  margin-left: auto;
}

.community-bar-status.is-short {
  color: var(--red);
}

label .community-hint {
  display: block;
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--muted);
}

@media (max-width: 720px) {
  .community-shell .rail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    padding: var(--space-3) var(--space-4);
  }

  .community-shell .rail .brand {
    min-width: 0;
  }

  .community-rail-tools {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: var(--space-2);
  }

  .community-rail-tools .theme-switch {
    position: static;
  }

  .community-rail-links {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .community-shell .panel > :first-child {
    padding-right: 0;
  }

  /* The brand gives way first: it may wrap onto two lines before sign-out leaves the row. */
  .community-bar {
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-3);
    padding: var(--space-3) var(--space-4);
  }

  .community-bar > .brand {
    flex: 1 1 0;
    min-width: 0;
  }

  .community-bar > .nav {
    flex: none;
    flex-wrap: nowrap;
  }

  .community-bar-status,
  .community-bar-links {
    order: 3;
    flex-basis: 100%;
  }

  .community-bar-links {
    margin-left: 0;
  }
}

.community-apply,
.community-program,
.community-member {
  max-width: var(--reading-max);
}

.community-member section {
  margin-top: var(--space-8);
}

/* A section outranks what it holds: the stage titles and the rules' own headings are text-lg. */
.community-member section > h2 {
  font-size: var(--text-xl);
}

.community-steps,
.community-stages,
.community-questions,
.community-answers,
.community-week-list,
.community-courses,
.community-list,
.community-log,
.community-options {
  list-style: none;
  margin: 0;
  padding: 0;
}

.community-steps {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.community-step {
  display: grid;
  grid-template-columns: var(--space-6) 1fr;
  gap: var(--space-1) var(--space-3);
  align-items: baseline;
}

.community-step > :not(.community-step-number) {
  grid-column: 2;
  justify-self: start;
}

.community-step-number {
  grid-row: span 4;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--faint);
}

.community-step-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-strong);
}

.community-step.is-current .community-step-number {
  color: var(--accent-text);
}

.community-step.is-locked .community-step-title {
  color: var(--muted);
  font-weight: 400;
}

.community-step-intro {
  margin: 0;
  max-width: var(--reading-max);
}

.community-step-facts,
.community-step-state {
  font-size: var(--text-sm);
  color: var(--muted);
}

.community-step-state.is-passed {
  color: var(--accent-text);
  font-weight: 600;
}

.community-step-state.is-failed {
  color: var(--red);
  font-weight: 600;
}

.community-questions {
  display: grid;
  gap: var(--space-4);
  margin: var(--space-5) 0;
}

.community-question {
  display: grid;
  gap: var(--space-2);
}

/* The question's number and points on the left, its save status on the right, on one line. */
.community-question-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
}

.community-question-top .eyebrow {
  margin: 0;
}

.community-question .question-stem {
  margin: 0;
}

.community-question .choices label.check-row:last-child {
  margin-bottom: 0;
}

.community-question textarea,
.community-question input[type="text"] {
  width: 100%;
}

.community-submit-ask {
  flex-basis: 100%;
  margin: 0;
  color: var(--text-strong);
}

/* Interview times: a choice of one, by day; the day is a label, the times are rows. */
.community-slot-days {
  border: 0;
  padding: 0;
  margin: var(--space-5) 0 0;
}

.community-slot-days legend {
  padding: 0;
  margin-bottom: var(--space-2);
}

.community-slot-day {
  margin-top: var(--space-4);
}

.community-slot-day-name {
  margin: 0 0 var(--space-1);
  font-weight: 600;
  color: var(--text-strong);
}

.community-slot-day label.check-row {
  margin: var(--space-1) 0;
  font-variant-numeric: tabular-nums;
}

.community-list {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

.community-list li {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  align-items: baseline;
}

/* An action under a page head, such as Invite someone, stands apart from the help line. */
.community-shell .page-head-block > .btn {
  margin-top: var(--space-4);
}

.community-warnings {
  margin: 0;
  padding-left: var(--space-5);
}

.community-warnings li + li {
  margin-top: var(--space-1);
}

.community-people-who {
  overflow-wrap: anywhere;
}

.community-people-seen {
  white-space: nowrap;
}

/* On a phone each person is a block: the name and email, then where they stand and when seen. */
@media (max-width: 720px) {
  .community-people thead {
    display: none;
  }

  .community-people tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-1) var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--line);
  }

  .community-people td {
    display: block;
    border: 0;
    padding: 0;
  }

  .community-people .community-people-who {
    grid-column: 1 / -1;
  }

  .community-people .community-people-seen {
    color: var(--muted);
    text-align: right;
  }
}

.community-list-main {
  font-weight: 600;
  color: var(--text-strong);
}

.community-call-time {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text-strong);
  margin: 0 0 var(--space-2);
}

.community-score {
  font-weight: 600;
  color: var(--text-strong);
}

.community-answers {
  display: grid;
  gap: var(--space-4);
  margin: var(--space-4) 0;
}

.community-answer {
  border-top: 1px solid var(--line);
  padding-top: var(--space-3);
}

.community-options li {
  color: var(--muted);
}

.community-options li.is-chosen {
  color: var(--text-strong);
  font-weight: 600;
}

.community-response {
  white-space: pre-wrap;
  max-width: var(--reading-max);
}

.community-points {
  width: 5rem;
}

.community-decision {
  margin-top: var(--space-5);
}

.community-log li {
  display: grid;
  grid-template-columns: 9rem 12rem 1fr auto;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
}

.community-log-action {
  font-weight: 600;
  color: var(--text-strong);
}

/* A stage's place in the order leads its title, in the display face, as on the applicant's path. */
.community-stage-title {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.community-stage-number {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--faint);
}

.community-stage-title a {
  color: var(--text-strong);
}

.community-slot-rows {
  margin-top: 0;
}

/* Under a day's name the times are plain, so the day leads and the times read as its list. */
.community-slot-rows .community-list-main {
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  color: var(--text);
}

h3.community-slot-day-name {
  margin: var(--space-4) 0 var(--space-1);
  font-size: var(--text-base);
}

.community-archived {
  margin-top: var(--space-6);
}

.community-archived summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}

.community-rules-text {
  width: 100%;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.community-preview {
  margin-top: var(--space-5);
}

.community-program {
  max-width: none;
}

.community-years {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--space-5) var(--space-6);
  margin: var(--space-5) 0 var(--space-6);
}

.community-term h2 {
  font-size: var(--text-lg);
  margin: 0 0 var(--space-2);
}

.community-courses {
  display: grid;
  gap: var(--space-2);
}

/* A course's code sits in a column of its own, so titles line up even when one wraps. */
.community-course {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  column-gap: var(--space-2);
  align-items: baseline;
  text-decoration: none;
}

.community-course > :not(.community-course-code) {
  grid-column: 2;
}

.community-course-code {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-text);
}

.community-course-title {
  color: var(--text-strong);
}

.community-course:hover .community-course-title {
  text-decoration: underline;
}

.community-courses:not(.compact) {
  margin: var(--space-4) 0 var(--space-6);
}

.community-courses:not(.compact) .community-course-title {
  font-size: var(--text-lg);
}

.community-about {
  margin-top: var(--space-6);
}

/* A course's weeks, under its title: a label and a row of numbers. */
.community-weeks {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
  margin: 0 0 var(--space-5);
}

.community-weeks .eyebrow {
  margin: 0;
}

.community-week-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.community-week-list .chip {
  display: inline-block;
  min-width: 2.25rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* A week's four parts, as links within the page, under its title. */
.community-week-parts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: 0 0 var(--space-6);
  font-size: var(--text-sm);
  font-weight: 600;
}

.community-pager {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}

/* A part opened by its link lands below the sticky bar, not under it. */
.community-week-part {
  margin-bottom: var(--space-7);
  scroll-margin-top: calc(var(--space-8) + var(--space-4));
}

.community-doc-title {
  font-family: var(--font-display);
}

@media (max-width: 700px) {
  .community-log li {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }
}

/* An empty alert inside a list item or a card holds no room; it opens when it has words. */
.community-stage .alert:empty,
.community-question .alert:empty,
.community-list .alert:empty,
.community-step .alert:empty,
.community-answer .alert:empty {
  min-height: 0;
  margin: 0;
}
