/* Source Serif 4 (Adobe, SIL Open Font License 1.1: fonts/SourceSerif4-LICENSE.md) — variable files:
   every weight in one upright and one italic file, the full character set (maths symbols included). */
@font-face { font-family: "Source Serif 4"; src: url("fonts/SourceSerif4Variable-Roman.otf.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("fonts/SourceSerif4Variable-Italic.otf.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }

/* Prepora design tokens and base layout (P5-T01).
   Eye-soothing, minimal and modern for long study hours (learner's requests, 2026-11-12:
   no plain black and white; the light theme feels like an e-ink display, in Forest Green,
   Sage, Pale Green, Cream and Muted Gold). Light: matte cream paper, charcoal ink, flat
   surfaces, thin sage lines. Dark: deep forest tones in the same family.
   Both themes meet WCAG 2.2 AA: text 4.5:1 or more, control edges and focus rings 3:1 or
   more (checked by script; ratios on the P5-T01 card). light-dark() follows the system
   theme; data-theme on <html> overrides it. */
:root {
  color-scheme: light dark;
  --bg: light-dark(#f1eee3, #1c221e); /* cream paper / deep forest */
  --surface: light-dark(#f7f5ed, #232a25);
  --text: light-dark(#2a2f2a, #dde3d6); /* charcoal ink, never black */
  --muted: light-dark(#5a6357, #a2ad9d);
  /* code (P5-T07b): forest, gold, sage-teal; each at least 5.7:1 on --surface */
  --code-keyword: light-dark(#2f5d3a, #9cc8a2);
  --code-string: light-dark(#7a5a14, #d6bc78);
  --code-number: light-dark(#3d6466, #9ccbc6);
  --code-comment: var(--muted);
  --code-name: var(--text);
  --line: light-dark(#7a8672, #74816f); /* sage: edges of controls (3:1) */
  --divider: light-dark(#d5d9c7, #323b34); /* pale sage: decorative lines only */
  --accent: light-dark(#2f5d3a, #9cc8a2); /* forest green / soft sage green */
  --on-accent: light-dark(#f7f5ed, #1c221e);
  --pale: light-dark(#dde8d3, #2c4232); /* pale green: selected state, text selection */
  --mark: light-dark(#ecdfae, #4d4527); /* a highlighter's soft gold (text 7:1 or more) */
  --focus: light-dark(#87691c, #c9ab5c); /* muted gold focus ring */
  --gold: #b39a55; /* muted gold, decorative only */
  --danger: light-dark(#9a3b2c, #e5a090); /* soft brick: errors (6:1 or more) */
  --shadow: light-dark(transparent, rgb(0 0 0 / 0.25)); /* e-ink is flat */

  --font: "Source Serif 4", ui-serif, Georgia, "Noto Serif Bengali", "Noto Sans Bengali", serif; /* body: the learner's choice (2026-11-21), bundled in fonts/ */
  --serif: "Source Serif 4", ui-serif, Georgia, serif; /* headings: Source Serif 4 at its display size (opsz 60 on h1, h2), the learner's choice (2026-11-21) */
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: 2rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --radius: 0.75rem;
  --measure: 70ch;
  --page: 72rem;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--step-0) / 1.6 var(--font);
}
::selection { background: var(--pale); }
a { color: var(--accent); text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
audio:focus, audio:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; } /* its own controls take the focus */
/* Chrome puts focus on a date field's inner parts, so ring the field itself */
input[type="date"]:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
/* room between the lines of all text; headings set their own, tighter */
body { line-height: 1.6; }
h3 { line-height: 1.35; }
h1, h2 { font-family: var(--serif); font-variation-settings: "opsz" 60; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: var(--step-3); line-height: 1.2; margin: 0 0 var(--space-2); }
h2 { font-size: var(--step-1); line-height: 1.3; margin: 0 0 var(--space-2); }
.lead { font-size: var(--step-1); color: var(--muted); margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
code { font-family: var(--mono); font-size: 0.9em; }

button {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: var(--space-2) var(--space-3);
  min-height: 2.75rem;
  cursor: pointer;
}
button:hover, .button:hover { border-color: var(--accent); }
.button { /* a link that looks like a button */
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
}
button.primary, .button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
input[type="email"], input[type="password"], input[type="text"],
input[type="number"], input[type="date"], select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  min-height: 2.75rem;
  width: 100%;
}
label { font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: var(--space-2); }
.stack button { margin-top: var(--space-3); }
.inline { display: inline; margin: 0; }
.auth { max-width: 26rem; margin: var(--space-4) auto; }
.field-error { color: var(--danger); font-size: var(--step--1); margin: 0; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
.notice { border-color: var(--accent); margin-block: var(--space-4); }
.plan { margin: 0; padding-inline-start: var(--space-4); }
.plan li { margin-block: var(--space-2); }
.slot { font-weight: 600; }
.plan .tick { min-height: 1.75rem; padding: 0 var(--space-2); font-size: var(--step--1); }
.page-head { margin-bottom: var(--space-4); }
.page-head p { margin: 0; }
.page-head h1 { margin-block: var(--space-2) var(--space-3); }
.page-head h1:first-child { margin-top: 0; }
.page-head .lead { line-height: 1.5; }
.board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  gap: var(--space-3);
  align-items: start;
}
@media (min-width: 48rem) { .wide { grid-column: 1 / -1; } }
.stat { font-family: var(--serif); font-size: var(--step-2); font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding-block: var(--space-2); border-top: 1px solid var(--divider); }
.list li:first-child { border-top: 0; padding-top: 0; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.bars li { display: grid; gap: var(--space-1); }
progress { width: 100%; height: 0.5rem; accent-color: var(--accent); }
dl.targets { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-3); margin: 0; }
dl.targets dt { color: var(--muted); }
dl.targets dd { margin: 0; font-weight: 600; }
/* Question components (P5-T04) */
.question { display: flex; flex-direction: column; gap: var(--space-3); max-width: min(var(--measure), 100%); } /* never wider than the page: a wide table scrolls in its box (P7-T20) */
.q-meta { margin: 0; }
.badge { display: inline-block; padding: 0 var(--space-2); border: 1px solid var(--line); border-radius: 999px; }
.badge.ok { border-color: var(--accent); color: var(--accent); background: var(--pale); }
.stem p { margin: 0 0 var(--space-2); }
.passage { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius); padding: var(--space-3) var(--space-4); }
.passage p, .sentences p { line-height: 1.75; margin: 0 0 var(--space-3); }
.sentences h3 { margin: 0; }
.q-table { border-collapse: collapse; margin-block: var(--space-2); }
.q-table th, .q-table td { border: 1px solid var(--line); padding: var(--space-1) var(--space-3); text-align: left; }
.q-table th { background: var(--pale); }
.quantities { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr)); gap: var(--space-3); }
.quantities > div { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius); padding: var(--space-3); text-align: center; }
.quantities p { margin: 0; }
.qty { font-family: var(--serif); font-size: var(--step-1); }
.answers { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.answers > legend { padding: 0; margin-bottom: var(--space-1); }
.answer { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 400; min-height: 2.75rem; }
.answer:has(input:checked) { border-color: var(--accent); background: var(--pale); }
.answer input { margin-top: 0.3em; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); flex: none; }
.letter { font-weight: 600; color: var(--muted); min-width: 1.2em; }
.blanks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr)); gap: var(--space-3); }
.fraction { border: 0; margin: 0; padding: 0; display: inline-flex; flex-direction: column; gap: var(--space-2); max-width: 12rem; }
.fraction .bar { border-top: 2px solid var(--text); }
.numeric input { max-width: 14rem; }
.sentence { display: inline; padding: 0.1em 0.05em; border-radius: 0.25em; cursor: pointer; font-weight: 400; }
.sentence input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sentence:hover { background: var(--pale); }
.sentence:has(input:checked) { background: var(--pale); box-shadow: inset 0 -2px 0 var(--accent); }
.sentence:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.feedback { border-top: 1px solid var(--divider); padding-top: var(--space-3); }
.verdict { font-family: var(--serif); font-size: var(--step-1); font-weight: 600; margin: 0 0 var(--space-2); }
.verdict.ok { color: var(--accent); }
.verdict.no { color: var(--danger); }
.steps { padding-inline-start: var(--space-4); }
.q-number { font-size: var(--step-1); margin: 0; }
.code { font-family: var(--mono); font-size: 0.92em; background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius); padding: var(--space-3); margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.mono { font-family: var(--mono); }
textarea { resize: vertical; line-height: 1.5; }
.para-label { color: var(--accent); margin-inline-end: var(--space-1); }
.instructions { font-style: italic; color: var(--muted); margin: 0; }
.choice-list { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius); padding: var(--space-3) var(--space-4); }
.choice-list dl { display: grid; grid-template-columns: auto 1fr; gap: var(--space-1) var(--space-3); margin: 0; }
.choice-list dt { font-weight: 600; color: var(--accent); }
.choice-list dd { margin: 0; }
.select-answer select, .words input { max-width: 28rem; }
.question-form { display: flex; flex-direction: column; gap: var(--space-4); align-items: flex-start; }
/* Practice sessions (P5-T05) */
.tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
.tabs a[aria-current="page"] { background: var(--pale); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.start-form { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; }
.start-form .row { width: 100%; }
.minutes { width: 6rem; }
.session-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.session-head p { margin: 0; }
.timer { font-variant-numeric: tabular-nums; }
.navigator { display: flex; flex-wrap: wrap; gap: var(--space-1); list-style: none; padding: 0; margin: var(--space-2) 0 var(--space-4); }
.nav-q { display: inline-flex; align-items: center; justify-content: center; min-width: 2.25em; min-height: 2.25em; border: 1px solid var(--line); border-radius: 999px; color: var(--text); text-decoration: none; font-variant-numeric: tabular-nums; }
.nav-q.answered { background: var(--pale); }
.nav-q.flagged { box-shadow: inset 0 -3px 0 var(--gold); }
.nav-q.right { border-color: var(--accent); }
.nav-q.wrong { border-color: var(--danger); }
.nav-q[aria-current="step"] { border-width: 2px; border-color: var(--accent); font-weight: 700; }
.actions, .tools { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.tools { margin-top: var(--space-4); }
.report { margin-top: var(--space-4); max-width: var(--measure); }
.report summary { cursor: pointer; color: var(--muted); min-height: 2.75rem; display: flex; align-items: center; }
.report form { display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start; margin-top: var(--space-2); }
.messages { margin-bottom: var(--space-3); }
.message { padding: var(--space-2) var(--space-3); border: 1px solid var(--accent); border-radius: var(--radius); background: var(--pale); margin: 0 0 var(--space-2); }
.message.error { border-color: var(--danger); background: var(--surface); color: var(--danger); }
.review { margin-top: var(--space-4); }
/* Learning modules (P5-T06) */
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.entries li { display: grid; gap: var(--space-1); }
.syllabus + .syllabus { margin-top: var(--space-3); }
/* GRE Quant tools (P5-T07) */
.tool { border: 1px solid var(--divider); border-radius: var(--radius); padding: var(--space-1) var(--space-3); background: var(--surface); max-width: var(--measure); }
.tool > summary { cursor: pointer; font-weight: 600; min-height: 2.75rem; display: flex; align-items: center; }
.calc { display: inline-flex; flex-direction: column; gap: var(--space-2); padding-block: var(--space-2) var(--space-3); }
.calc-display { font-family: var(--mono); font-size: var(--step-1); text-align: right; padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); font-variant-numeric: tabular-nums; }
.calc-keys { display: grid; grid-template-columns: repeat(4, minmax(0, 3.25rem)); gap: var(--space-1); } /* narrower keys on a phone at a large text size (P7-T20) */
.calc-keys button { border-radius: var(--radius); padding: 0; }
.calc-wide { grid-column: 1 / -1; }
.goals { display: flex; flex-direction: column; gap: var(--space-4); align-items: flex-start; }
.goals .card { width: 100%; }
.exam { border: 0; border-top: 1px solid var(--divider); margin: 0; padding: var(--space-3) 0 0; }
.exam > legend { padding: 0; font-family: var(--serif); font-size: var(--step-1); }
.exam:not(:has(> legend input:checked)) .exam-fields { display: none; } /* only chosen exams */
.exam-fields { padding-block: var(--space-2) var(--space-3); }
.choice { border: 0; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.choice > legend { font-weight: 600; padding: 0; margin-bottom: var(--space-1); width: 100%; }
.check { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 400; min-height: 2.75rem; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); gap: var(--space-3); }
.field { display: flex; flex-direction: column; gap: var(--space-1); }
.error {
  color: var(--danger);
  border-inline-start: 3px solid var(--danger);
  padding-inline-start: var(--space-3);
}
button[aria-pressed="true"] {
  background: var(--pale);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* Layout: one centred column; the grid wraps cards to fit any width. */
.wrap { max-width: var(--page); margin-inline: auto; padding-inline: var(--space-3); }
.skip {
  position: absolute;
  left: var(--space-3);
  top: -10rem;
  padding: var(--space-2) var(--space-3);
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius);
}
.skip:focus { top: var(--space-2); }
.site-header { background: var(--surface); border-bottom: 1px solid var(--divider); }
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding-block: var(--space-3);
}
.brand {
  margin-inline-end: auto;
  color: var(--accent);
  font-family: var(--serif);
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand::after { /* a small muted-gold mark */
  content: "";
  display: inline-block;
  width: 0.35em;
  height: 0.35em;
  margin-inline-start: 0.12em;
  border-radius: 50%;
  background: var(--gold);
}
.tracks { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-block: 0;
  padding-block: var(--space-2);
  list-style: none;
}
.site-nav a[aria-current="page"] {
  font-weight: 650;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
}
main { padding-block: var(--space-4) var(--space-5); }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}
.card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: 0 1px 2px var(--shadow), 0 4px 16px var(--shadow);
}
.site-footer {
  border-top: 1px solid var(--divider);
  color: var(--muted);
  font-size: var(--step--1);
  padding-block: var(--space-4);
}
.site-footer p { max-width: var(--measure); margin: 0 0 var(--space-2); }

/* Header (P5-T02a; the learner: "the button is too big at the top"): compact controls —
   one slim segmented track switch, an icon theme button and the account menu. */
.site-header .bar { padding-block: var(--space-2); gap: var(--space-2); }
.site-header button, .site-header .button {
  min-height: 2.25rem;
  padding: 0.25rem 0.85rem;
  font-size: var(--step--1);
}
.tracks { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; }
.site-header .tracks button { border: 0; background: transparent; min-height: 2rem; padding: 0.15rem 0.8rem; }
.site-header .tracks button[aria-pressed="true"] { background: var(--pale); color: var(--accent); }
/* Text size (P7-T20): A−, the size (typed), A+ and reset in one slim pill like the track switch */
.text-size { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; }
.text-size[hidden] { display: none; }
.site-header .text-size button { border: 0; background: transparent; min-height: 2rem; padding: 0.15rem 0.6rem; }
.site-header .text-size button:hover { color: var(--accent); }
.site-header .text-size button[aria-disabled="true"] { color: var(--muted); cursor: default; }
.size-field { display: inline-flex; align-items: center; gap: 0.35rem; padding-inline: 0.35rem; /* clear of the focus ring */ font-size: var(--step--1); font-weight: 400; cursor: text; }
.site-header .size-field input { width: calc(3ch + 0.75rem); min-height: 1.75rem; padding: 0 0.15rem; border-radius: 0.4rem; font-variant-numeric: tabular-nums; text-align: right; appearance: textfield; }
.size-field input::-webkit-inner-spin-button, .size-field input::-webkit-outer-spin-button { appearance: none; margin: 0; }
/* The learner's size scales the content's text (main, the footer and the look-up box) and
   nothing else: the header and the menu keep theirs. Inside them a font size is one of these
   steps or em, never a plain rem (test_the_text_size_control checks the stylesheet). */
main, .site-footer, .lookup {
  --step--1: calc(0.875rem * var(--reading-scale, 1));
  --step-0: calc(1rem * var(--reading-scale, 1));
  --step-1: calc(1.25rem * var(--reading-scale, 1));
  --step-2: calc(1.5rem * var(--reading-scale, 1));
  --step-3: calc(2rem * var(--reading-scale, 1));
}
main, .lookup { font-size: var(--step-0); overflow-wrap: break-word; } /* a long word or address breaks rather than widen the page */
.site-header .theme-toggle.icon { width: 2.25rem; padding: 0; font-size: 1.05rem; line-height: 1; }
.menu { position: relative; }
.menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.25rem;
  padding: 0.15rem 0.7rem 0.15rem 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: var(--step--1);
  cursor: pointer;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { /* a small chevron */
  content: "";
  width: 0.38em;
  height: 0.38em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.12em) rotate(45deg);
}
.menu[open] > summary, .menu > summary:hover { border-color: var(--accent); }
.menu-panel {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 0.4rem);
  z-index: 10;
  min-width: 14rem;
  padding: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px var(--shadow);
}
.menu-panel ul { list-style: none; margin: 0; padding: 0; }
.menu-panel a { display: block; padding: 0.45rem 0.6rem; border-radius: 0.5rem; color: var(--text); text-decoration: none; }
.menu-panel a:hover { background: var(--pale); }
.menu-panel form { margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--divider); }
.menu-panel button { width: 100%; }
.menu-email { margin: 0.25rem 0.6rem var(--space-2); overflow-wrap: anywhere; }
.avatar { width: 1.75rem; height: 1.75rem; border-radius: 50%; object-fit: cover; flex: none; }
.avatar.initial { display: inline-grid; place-items: center; background: var(--pale); color: var(--accent); font-weight: 650; }
.avatar.large { width: 6rem; height: 6rem; }
.pictures { display: flex; gap: var(--space-3); margin-bottom: var(--space-2); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 30rem) { /* a phone: the account menu shows the picture or initial only */
  .me-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* Navigation (the learner: no underlines; only the page you are on gets the gold one). */
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); text-decoration-line: underline; }

/* Profile (P5-T02a) */
.filled { display: grid; gap: var(--space-1); max-width: 22rem; margin-bottom: var(--space-3); }
.filled p { margin: 0; }
progress.slim { height: 0.3rem; }
.avatar.large.initial { font-size: var(--step-3); font-family: var(--serif); }
input[type="file"] { font-size: var(--step--1); max-width: 100%; }
input[type="file"]::file-selector-button {
  font: inherit;
  margin-inline-end: var(--space-3);
  padding: 0.35rem 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { border-color: var(--accent); }
.cropper { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); margin-top: var(--space-3); }
.cropper[hidden] { display: none; }
.crop-view { width: 15rem; height: 15rem; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); touch-action: none; cursor: grab; }
.crop-view:active { cursor: grabbing; }
.crop-controls { display: grid; gap: var(--space-1); flex: 1; min-width: min(16rem, 100%); }
.crop-controls p { margin: 0 0 var(--space-1); }
.crop-controls input[type="range"] { width: 100%; accent-color: var(--accent); }

/* Learn (P5-T06a; the learner: "too congestion, not feeling modern or minimal", no
   underlined chapters): quiet rows, each one the link; the switches compact. */
.entries { gap: 0; }
.entries li { display: block; border-top: 1px solid var(--divider); }
.entries li:first-child { border-top: 0; }
.entry {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
  margin-inline: calc(-1 * var(--space-2));
  padding: var(--space-3) var(--space-2);
  border-radius: 0.5rem;
  color: var(--text);
  text-decoration: none;
}
.entry:hover { background: var(--pale); }
.entry-name { color: var(--accent); font-weight: 600; }
.entry-meta { color: var(--muted); font-size: var(--step--1); }
.chip { display: inline-block; padding: 0 0.55rem; border-radius: 999px; background: var(--pale); color: var(--accent); font-weight: 600; }
.entries progress.slim { display: block; margin: 0 0 var(--space-3); }
.tabs { display: flex; width: fit-content; max-width: 100%; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; }
.tabs .button { min-height: 2rem; padding: 0.15rem 0.85rem; border: 0; font-size: var(--step--1); }
.tabs .button:hover { color: var(--accent); }

/* Progress bars (P5-T06a; the learner: the browser's bordered bar looked "odd and back
   dated"): one slim rounded track with a green fill, everywhere. The value is also in
   words beside every bar. */
progress {
  appearance: none;
  display: block;
  width: 100%;
  height: 0.375rem;
  border: 0;
  border-radius: 999px;
  background: var(--divider);
  color: var(--accent);
  overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--divider); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
progress.slim { height: 0.25rem; }

/* Chapter lessons and the reading log (P5-T06b; the learner: "the lesson list need to
   have some space"). */
.lesson-group + .lesson-group { margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--divider); }
.lesson-group h3 { margin: var(--space-2) 0 0; color: var(--muted); font-family: var(--font); font-size: var(--step--1); font-weight: 650; letter-spacing: 0.02em; }
.lessons { list-style: none; margin: 0; padding: 0; }
.lesson {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  padding-block: var(--space-2);
}
.lesson-text { display: grid; gap: 0.2rem; }
.lesson-meta { color: var(--muted); font-size: var(--step--1); }
.lesson form { margin: 0; }
.lesson button { min-height: 2.25rem; padding: 0.2rem 0.95rem; font-size: var(--step--1); }
.lesson.is-topic .lesson-name { font-weight: 600; }
.lesson.is-done .lesson-name { color: var(--muted); }
.lesson.is-done .lesson-name::before { content: "\2713\00a0"; color: var(--accent); }
button.quiet { border-color: var(--divider); color: var(--muted); }
.lesson-name a { text-decoration-line: none; } /* a written lesson: its colour says it is a link */
.lesson .lesson-text { flex: 1 1 14rem; }

/* A written lesson or a note (P7-T01a): paragraphs at reading width. */
.prose p { margin: 0 0 var(--space-3); max-width: var(--measure); line-height: 1.7; }
.prose p:last-child { margin-bottom: 0; }
.prose h3 { margin: var(--space-3) 0 var(--space-1); }
.prose .steps { margin: 0 0 var(--space-3); max-width: var(--measure); }
.prose .steps li { margin-block: var(--space-1); }
.reading h3 { margin: var(--space-3) 0 var(--space-1); font-size: var(--step--1); color: var(--muted); }
.reading progress { max-width: 22rem; margin-bottom: var(--space-2); }
.reading .log { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.reading .log a { text-decoration: none; }
.reading + .syllabus { margin-top: var(--space-3); }

/* The coding workspace (P5-T07b) */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); } /* long lines scroll inside the editor */
.ws-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.ws-status { margin: 0; color: var(--muted); font-size: var(--step--1); }
.ws-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ws-actions button { min-height: 2.25rem; padding: 0.2rem 1rem; font-size: var(--step--1); }
.code-input { font-family: var(--mono); font-size: 0.9em; width: 100%; }
.workspace .cm-editor { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--code-name); font-size: 0.9em; }
.workspace .cm-editor.cm-focused, .workspace .cm-editor:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.workspace .cm-scroller { min-height: 12rem; max-height: 28rem; font-family: var(--mono); line-height: 1.55; }
.workspace .cm-gutters { background: var(--surface); color: var(--muted); border-right: 1px solid var(--divider); border-radius: var(--radius) 0 0 var(--radius); }
.workspace .cm-activeLine, .workspace .cm-activeLineGutter { background: color-mix(in srgb, var(--pale) 55%, transparent); }
.workspace .cm-cursor { border-left-color: var(--text); }
.workspace .cm-selectionBackground, .workspace .cm-focused .cm-selectionBackground { background: var(--pale) !important; }
.ws-tests { width: 100%; table-layout: fixed; }
.ws-tests th:first-child { width: 3.5rem; }
.ws-tests th:nth-child(2) { width: 46%; }
.ws-tests th:nth-child(3) { width: 18%; }
.ws-tests td { overflow-wrap: anywhere; }
.ws-tests code.pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 0.85em; }
.ws-tests td[data-outcome="passed"] { color: var(--accent); font-weight: 600; }
.ws-tests td[data-outcome="failed"], .ws-tests td[data-outcome="error"], .ws-tests td[data-outcome="timed_out"] { color: var(--danger); font-weight: 600; }
.ws-console { max-height: 18rem; overflow: auto; border: 1px solid var(--divider); border-radius: var(--radius); background: var(--surface); }
.ws-console pre { margin: 0; padding: var(--space-2) var(--space-3); font-family: var(--mono); font-size: 0.85em; white-space: pre-wrap; overflow-wrap: anywhere; }

/* The Reading Lab (P5-T08): passages, a passage beside its question, marks and evidence */
.passage-rows { list-style: none; margin: 0; padding: 0; }
.passage-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3); padding-block: var(--space-3); border-top: 1px solid var(--divider); }
.passage-row:first-child { border-top: 0; padding-top: 0; }
.passage-row h3 { margin: 0 0 var(--space-2); }
.passage-row h3 a { text-decoration-line: none; } /* a list's titles: their colour says they are links */
.passage-row p { margin: 0; }
.passage-row p + p { margin-top: var(--space-1); }
.passage-start { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.question.reading { max-width: 100%; }
.q-side { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; max-width: var(--measure); }
@media (min-width: 60rem) {
  .question.reading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
  .question.reading > .passage { position: sticky; top: var(--space-3); max-height: calc(100vh - 2 * var(--space-3)); overflow: auto; }
}
.mark-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.mark-tools p { margin: 0; }
mark.hl { background: var(--mark); color: inherit; border-radius: 0.2em; }
mark.hl.note { box-shadow: inset 0 -2px 0 var(--focus); }
mark.evidence { background: var(--pale); color: inherit; border-radius: 0.2em; box-shadow: 0 0 0 1px var(--accent); }
.evidence-list { margin: 0; padding-left: var(--space-4); }
.note-form, .mark-list { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--divider); }
.note-form textarea { width: 100%; }
.mark-list h4 { margin: 0 0 var(--space-2); font-weight: 600; }
.mark-list ol { margin: 0; padding-left: var(--space-4); }
.mark-list li { margin-block: var(--space-1); }
.q-figure { margin: 0; }
.q-figure img { max-width: 100%; height: auto; padding: var(--space-2); border-radius: var(--radius); background: #f7f5ed; /* cream in both themes: a diagram keeps its own dark ink */ }
.table-scroll { max-width: 100%; overflow-x: auto; } /* a wide table scrolls in its card, not the page */

/* The Listening Lab (P5-T09): a set on one page under its recording */
.recordings { position: sticky; top: 0; z-index: 1; display: flex; flex-direction: column; gap: var(--space-2); padding-block: var(--space-2); background: var(--bg); border-bottom: 1px solid var(--divider); }
.player { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.player audio { width: min(100%, 28rem); }
.player p { margin: 0; }
.parts ol { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: var(--space-3) 0; padding: 0; }
.part { display: flex; flex-direction: column; gap: var(--space-3); margin-block: var(--space-4); scroll-margin-top: 7em; }
.part h2 { margin: 0; }
.listen-item { scroll-margin-top: 7em; }
.listen-item .actions { align-items: center; }
.seek { min-height: 2rem; padding: 0.1rem 0.6rem; font-size: var(--step--1); }
.transcript ol { list-style: none; margin: 0; padding: 0; }
.transcript li { margin-block: var(--space-2); line-height: 1.7; }
.finish { margin-block: var(--space-4); }

/* The Writing Studio (P5-T10) */
.writing { display: flex; flex-direction: column; gap: var(--space-2); max-width: var(--measure); }
.writing textarea { width: 100%; font-size: 1.05em; line-height: 1.7; }
.writing .actions { align-items: center; }
.prompt p { line-height: 1.7; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2) var(--space-3); margin: 0; }
.facts dt { color: var(--muted); }
.frames { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: var(--space-3) 0 0; }
.frames img { max-width: 100%; height: auto; border-radius: var(--radius); }
pre.log { max-height: 16rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--step--1); }
.facts dd { overflow-wrap: anywhere; }  /* a file name or hash never widens the page */
.notes li { margin-block: var(--space-2); }

/* The Speaking Studio (P5-T11) */
.cue-card { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3) var(--space-4); background: var(--surface); max-width: var(--measure); }
.cue-card p { margin: 0 0 var(--space-2); }
.cue-card ul { margin: 0; padding-left: var(--space-4); }
.recorder { display: flex; flex-direction: column; gap: var(--space-2); }
.recorder textarea { width: 100%; }
.recorder .timer { font-size: 1.25em; }
.voice-pick { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.voice-pick select { max-width: 100%; }
.say-list { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: grid; gap: var(--space-2); }
.say-list li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); } /* wraps at a large text size (P7-T20) */
.say-word { font-family: var(--serif); font-size: 1.2em; min-width: 10rem; }

/* The vocabulary trainer (P5-T12) */
.vocab-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--space-3); margin: 0 0 var(--space-3); }
.vocab-stats dt { font-size: var(--step--1); color: var(--muted); }
.vocab-stats dd { margin: 0; }
.vocab-front { font-family: var(--serif); font-size: var(--step-2); }
.vocab-back summary { cursor: pointer; }
.vocab-search { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-4); }
.word-part h3 { margin-bottom: var(--space-1); }
.example { font-style: italic; color: var(--muted); }

/* Select-to-look-up (P5-T12a) */
.lookup { position: fixed; inset: auto; margin: 0; width: min(22rem, calc(100vw - 16px)); max-height: 60vh; overflow: auto; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 6px 24px rgb(0 0 0 / 18%); }
.lookup-word { font-family: var(--serif); font-size: var(--step-1); font-weight: 600; margin: 0 0 var(--space-2); }
.lookup ol { margin: var(--space-1) 0; padding-left: 1.2rem; }
.lookup p { margin: var(--space-1) 0; }

/* The error notebook (P5-T13) */
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-3); margin-bottom: var(--space-4); }
.filters label { display: block; font-size: var(--step--1); }
.filters select { max-width: 100%; }
.record { min-width: 0; }
/* The review screen (P6-T09): a page beside the lines found on it */
.pages ul { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); list-style: none; padding: 0; margin: 0 0 var(--space-3); }
.pages a { text-decoration-line: none; }
.pages a[aria-current="page"] { font-weight: 600; text-decoration-line: underline; text-decoration-color: var(--focus); text-decoration-thickness: 2px; }
.review { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; margin-bottom: var(--space-4); }
@media (min-width: 48rem) { .review { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .sheet { position: sticky; top: var(--space-3); } }
.sheet { margin: 0; }
.art { position: relative; }
.art img { display: block; width: 100%; height: auto; border: 1px solid var(--divider); border-radius: var(--radius); }
.art svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.art rect { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.art rect.low { stroke: var(--focus); stroke-dasharray: 5 3; }
.art rect.role-other, .art rect.role-explanation { stroke: var(--line); }
.lines-form .line { display: grid; gap: var(--space-2); border: 1px solid var(--divider); border-radius: var(--radius); padding: var(--space-2) var(--space-3) var(--space-3); margin: 0; }
.lines-form .line.check { border-color: var(--focus); }
.lines-form legend { padding: 0 var(--space-1); font-size: var(--step--1); color: var(--muted); }
.lines-form textarea { width: 100%; field-sizing: content; min-height: 2.75rem; }
.lines-form .line button { justify-self: start; margin: 0; font-size: var(--step--1); }
@media (min-width: 80rem) { .lines-form .line { grid-template-columns: 11rem minmax(0, 1fr); } .lines-form .line button { grid-column: 2; } }
.found + .found { border-top: 1px solid var(--divider); margin-top: var(--space-3); padding-top: var(--space-3); }
.found h3 { margin: 0; color: var(--muted); }
.found details { margin-top: var(--space-2); }
.found summary { cursor: pointer; color: var(--accent); }
.found img.figure { display: block; max-width: 100%; height: auto; margin: var(--space-2) 0; border: 1px solid var(--divider); border-radius: var(--radius); }
.edges { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.edges label { display: flex; flex-direction: column; gap: var(--space-1); }
.edges input { width: 7rem; }
.found audio { width: 100%; margin: var(--space-2) 0; }
/* The verification queue (P6-T10) */
.status { font-weight: 600; }
.status.verified { color: var(--accent); }
.status.disputed, .status.rejected { color: var(--focus); }
.checks { margin: var(--space-1) 0; padding-left: var(--space-4); }
.judge { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-top: var(--space-2); }
.judge input[type="text"] { flex: 1 1 14rem; }
