/* practice.html styles (moved out of the page unchanged, 4 Nov 2026) */
/* ============================================
   Practice Page — Horizontal Single-Problem Layout
   ============================================ */

/* Override page transition for standalone */
body { opacity: 1; animation: none; margin: 0; }

/* The three levels have no colours of their own since 10 Nov 2026 (no medals): the old names resolve to the unit's accent
   until the rules that use them are pruned. */
:root {
  --bronze: var(--accent, #2563eb);
  --bronze-light: var(--accent-light, #eff6ff);
  --bronze-badge: var(--accent-light, #eff6ff);
  --silver: var(--accent, #2563eb);
  --silver-light: var(--accent-light, #eff6ff);
  --silver-badge: var(--accent-light, #eff6ff);
  --gold: var(--accent, #2563eb);
  --gold-light: var(--accent-light, #eff6ff);
  --gold-badge: var(--accent-light, #eff6ff);
  --success: #16a34a;
  --success-light: #f0fdf4;
  --error: #dc2626;
  --error-light: #fef2f2;
  --practice-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --panel-bg: #f5f2ed;
  --panel-width: 360px;
  --header-height: 60px;
}

/* ===== HEADER OVERRIDES FOR PRACTICE LAYOUT ===== */
.page-header {
  position: relative;
  left: auto;
  right: auto;
  z-index: 900;
  padding: 0.75rem 1.5rem 0.75rem calc(var(--panel-width) + 1.25rem);
  background: linear-gradient(to right,
    var(--panel-bg) calc(var(--panel-width) - 1px),
    var(--border-light, #e8e4df) calc(var(--panel-width) - 1px),
    var(--border-light, #e8e4df) var(--panel-width),
    #fff var(--panel-width)) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid var(--border-light, #e8e4df);
}
.page-header-inner {
  max-width: none;
  margin: 0;
}

/* The global stylesheet pulls the StudyVault wordmark out of the header
   and pins it to the top-left gutter on wide viewports (>=1400px). On the
   practice page the left "gutter" is occupied by the method/passage panel,
   so the fixed brand sits ON TOP of the panel content and obscures the
   method card whenever the panel scrolls. Force the brand back into the
   header-inner flex flow on this page. */
@media (min-width: 1400px) {
  .page-header-inner:not(:has(.admin-nav)) .header-brand {
    position: static;
    transform: none;
  }
}

/* ===== MASTHEAD: wordmark in the gutter, lesson identity in its place =====
   The StudyVault wordmark drops into the left gutter (over the panel column),
   and the spot it used to hold — the start of the main strip — now carries the
   lesson title and its "Lesson X of Y" pill. ID-scoped so it beats the global
   >=1400 wordmark-pin rules and never leaks to other pages. */
#practice-page .header-brand {
  position: absolute;
  left: calc(var(--panel-width) / 2);
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}
/* Anchor the absolute wordmark to the whole header (so left:1.5rem lands in
   the gutter), not to header-inner, which is relative and starts past the
   gutter. Desktop only — mobile keeps the wordmark in the flex flow. */
@media (min-width: 901px) {
  #practice-page .page-header-inner { position: static; }
}
.header-lesson {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  min-width: 0;
  margin-right: auto;
}
.header-lesson-title {
  font-family: var(--font-read,'Literata',Georgia,serif);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary, #2d2a26);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 44vw;
}
.header-lesson-pill {
  flex-shrink: 0;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent, #2563eb);
  background: var(--accent-light, #eff6ff);
  padding: 0.22em 0.7em;
  border-radius: 999px;
  white-space: nowrap;
}
body.dark-mode .header-lesson-title { color: var(--sv-night-ink); }
/* Mobile has no gutter — put the wordmark back in flow and drop the title,
   keeping just the pill so the header stays uncluttered. */
@media (max-width: 900px) {
  #practice-page .header-brand { position: relative; left: auto; top: auto; transform: none; }   /* relative, not static: the wordmark's wider tap area (reskin.css) must stay on the wordmark, not cover the menu button */
  .header-lesson-title { display: none; }
}

/* Panel toggle button (mobile) */
.panel-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-light, #ddd);
  background: #fff;
  cursor: pointer;
  color: var(--text-secondary, #5a5651);
  flex-shrink: 0;
  margin-left: auto;
}

.panel-toggle-btn svg {
  width: 16px;
  height: 16px;
}

/* ===== FULL-VIEWPORT LAYOUT ===== */
.practice-layout {
  display: flex;
  height: 100vh;
  height: 100dvh;
}

/* ===== LEFT PANEL ===== */
.practice-panel {
  width: var(--panel-width);
  flex-shrink: 0;
  background: var(--panel-bg);
  border-right: 1px solid var(--border-light, #e8e4df);
  overflow-y: auto;
  padding: 0.75rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.3s;
}

.practice-panel:hover {
  scrollbar-color: var(--accent, #2563eb) transparent;
}

.practice-panel::-webkit-scrollbar { width: 4px; }
.practice-panel::-webkit-scrollbar-track { background: transparent; }
.practice-panel::-webkit-scrollbar-thumb { background: transparent; border-radius: 2px; }
.practice-panel:hover::-webkit-scrollbar-thumb { background: var(--accent, #2563eb); }

.panel-section {
  background: #fff;
  border: 1px solid var(--border-light, #e8e4df);
  border-radius: 16px;
  padding: 1.15rem;
}

.panel-section-title {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #6b665f);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.panel-section-title svg {
  width: 12px;
  height: 12px;
  color: var(--accent, #2563eb);
}

/* Method steps in panel */
.panel-method-title {
  font-family: var(--font-read,'Literata',Georgia,serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #2d2a26);
  margin-bottom: 0.65rem;
  line-height: 1.3;
}

.panel-method-content {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-secondary, #5a5651);
  margin-bottom: 0.85rem;
  overflow-x: hidden;
  word-wrap: break-word;
}
.panel-method-content p { margin: 0 0 0.4rem; }
.panel-method-content .katex { font-size: 0.85em; }

/* Vocab table collapsible — keeps MFL method cards compact by default */
.method-card-vocab {
  margin: 0.5rem 0;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  background: rgba(0,0,0,0.015);
  overflow: hidden;
}
.method-card-vocab > summary {
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-primary, #2d2a26);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  user-select: none;
}
.method-card-vocab > summary::-webkit-details-marker { display: none; }
.method-card-vocab > summary::before {
  content: "▸";
  font-size: 0.7rem;
  transition: transform 0.15s ease;
  color: var(--accent, #0369a1);
}
.method-card-vocab[open] > summary::before { transform: rotate(90deg); }
.method-card-vocab > summary:hover { background: rgba(0,0,0,0.04); }
.method-card-vocab table {
  margin: 0;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
}
.method-card-vocab table th,
.method-card-vocab table td {
  padding: 0.25rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.method-card-vocab table th {
  background: rgba(0,0,0,0.03);
  font-weight: 600;
}
.method-card-vocab table tr:last-child td { border-bottom: none; }

.panel-method-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: panel-step;
}

.panel-method-steps li {
  counter-increment: panel-step;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0;
  margin-bottom: 0.6rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-primary, #2d2a26);
}

.panel-method-steps li:last-child {
  margin-bottom: 0;
}

/* Step content must be ONE flex item — mixed text + KaTeX + <strong>
   otherwise shatters into interleaved flex columns */
.panel-method-steps li .step-body,
.method-modal-steps li .step-body {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: break-word;
}
#panel-method .tier-intro-example { font-size: 0.82rem; padding: 0.7rem 0.85rem; }
/* The side panel is too narrow for a label column: two columns left the
   prose in a ~30-character gutter. Stack the label above its step so the
   content gets the full width and shares one left edge. */
#panel-method .tier-intro-example-step {
  display: block;
  margin-bottom: 0.7rem;
}
#panel-method .tier-intro-example-step .tie-label {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.64rem;
}
#panel-method .tier-intro-example-step .tie-content { padding-left: 0; }
.tier-intro-example-step .tie-content { min-width: 0; overflow-wrap: break-word; }

.panel-method-steps li::before {
  content: counter(panel-step);
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--accent, #2563eb);
  background: var(--accent-light, #eff6ff);
  border-radius: 50%;
}

/* Exam context */

/* Related videos — collapsible dropdown (matches lesson page sidebar) */
.panel-section .sidebar-collapsible {
  border: 1px solid var(--border-light, #e0dcd7);
  border-radius: 10px;
  overflow: hidden;
}
.panel-section .sidebar-collapsible-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: none;
  border: none;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary, #2d2a26);
  cursor: pointer;
  transition: background 0.2s ease;
}
.panel-section .sidebar-collapsible-toggle:hover {
  background: var(--accent-light, #eff6ff);
}
.panel-section .sidebar-collapsible-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.panel-section .sidebar-collapsible.open .sidebar-collapsible-icon {
  transform: rotate(180deg);
}
.panel-section .sidebar-collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.panel-section .sidebar-collapsible.open .sidebar-collapsible-content {
  max-height: 500px;
  overflow: visible;
}
.panel-section .sidebar-media-item {
  display: block;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  border-top: 1px solid rgba(0,0,0,0.05);
  transition: background 0.2s ease;
}
.panel-section .sidebar-media-item:hover {
  background: var(--accent-light, #eff6ff);
}
.panel-section .sidebar-media-item strong {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary, #2d2a26);
  line-height: 1.3;
}
.panel-section .sidebar-media-item span {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted, #6b665f);
  line-height: 1.3;
}

/* View worked examples link in sidebar */
.panel-learn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent, #2563eb);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.5rem 0 0;
  transition: opacity 0.2s ease;
}

.panel-learn-link:hover {
  opacity: 0.75;
}

.panel-learn-link svg {
  width: 13px;
  height: 13px;
}

/* Topic pills */
.topic-links-group {
  margin-bottom: 0.6rem;
}

.topic-links-group:last-child {
  margin-bottom: 0;
}

.topic-links-label {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted, #6b665f);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.topic-pill {
  display: inline-block;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--accent, #2563eb);
  background: var(--accent-light, #eff6ff);
  border: 1px solid var(--accent-badge, #dbeafe);
  padding: 0.2em 0.55em;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.2s ease;
}

.topic-pill:hover {
  background: var(--accent-badge, #dbeafe);
}

/* ===== MAIN AREA ===== */
.practice-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  background: #faf8f5;
  padding-top: 0;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.3s;
}
.practice-main:hover {
  scrollbar-color: var(--accent, #2563eb) transparent;
}
.practice-main::-webkit-scrollbar { width: 4px; }
.practice-main::-webkit-scrollbar-track { background: transparent; }
.practice-main::-webkit-scrollbar-thumb { background: transparent; border-radius: 2px; }
.practice-main:hover::-webkit-scrollbar-thumb { background: var(--accent, #2563eb); }

/* ===== SCORE/STREAK BAR (replaces topbar centre/right) ===== */
.practice-score-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.5rem;
  border-bottom: 1px solid var(--border-light, #e8e4df);
  background: #fff;
  flex-shrink: 0;
}

.score-bar-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.3em 0.85em;
  border-radius: 999px;
  transition: all 0.3s var(--practice-ease);
}

.score-bar-tier-badge.tier-is-bronze { color: var(--bronze); background: var(--bronze-badge); }
.score-bar-tier-badge.tier-is-silver { color: var(--silver); background: var(--silver-badge); }
.score-bar-tier-badge.tier-is-gold   { color: var(--gold); background: var(--gold-badge); }

.score-bar-tier-badge svg {
  width: 12px;
  height: 12px;
}

.score-bar-streak {
  display: none;
  align-items: center;
  gap: 0.25rem;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ea580c;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  padding: 0.2em 0.65em;
  border-radius: 999px;
  animation: streak-pulse 0.4s var(--practice-ease);
}

.score-bar-streak.visible { display: inline-flex; }

.score-bar-a11y {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.score-bar-a11y .passage-overlay-group {
  gap: 0.35rem;
}
.score-bar-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.score-bar-examples-btn {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent, #2563eb);
  background: none;
  border: 1px solid var(--accent, #2563eb);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  margin-left: 0.5rem;
}
.score-bar-examples-btn:hover {
  background: var(--accent, #2563eb);
  color: #fff;
}

@keyframes streak-pulse {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== CONTENT VIEWPORT (holds learn + practice views) ===== */
.content-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.content-view {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem;
  overflow-y: auto;
  transition: opacity 0.35s ease, transform 0.5s var(--practice-ease);
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.content-view:hover {
  scrollbar-color: var(--accent, #2563eb) transparent;
}
.content-view::-webkit-scrollbar { width: 4px; }
.content-view::-webkit-scrollbar-track { background: transparent; }
.content-view::-webkit-scrollbar-thumb { background: transparent; border-radius: 2px; }
.content-view:hover::-webkit-scrollbar-thumb { background: var(--accent, #2563eb); }

.content-view.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(30px);
}

.content-view.hidden-left {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-30px);
}

/* ===== LEARN MODE ===== */
.learn-card {
  background: #fff;
  border: 1px solid var(--border-light, #e8e4df);
  border-radius: 16px;
  padding: 2.5rem 3rem;
  max-width: 640px;
  width: 100%;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  position: relative;
}

.learn-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.learn-counter {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #6b665f);
}

.learn-difficulty {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2em 0.6em;
  border-radius: 999px;
}

.learn-difficulty.diff-bronze { color: var(--bronze); background: var(--bronze-badge); }
.learn-difficulty.diff-silver { color: var(--silver); background: var(--silver-badge); }
.learn-difficulty.diff-gold   { color: var(--gold); background: var(--gold-badge); }

.learn-question {
  font-family: var(--font-read,'Literata',Georgia,serif);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary, #2d2a26);
  margin-bottom: 1.5rem;
  text-align: center;
}

.learn-steps-area {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.learn-step {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.5s var(--practice-ease), opacity 0.4s ease, padding 0.3s ease;
  padding: 0;
}

.learn-step.revealed {
  max-height: 260px;
  opacity: 1;
  padding: 0.55rem 0;
  margin-bottom: 0.35rem;
}

.learn-step.is-answer.revealed {
  background: var(--success-light);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

.learn-step-label {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #6b665f);
  margin-bottom: 0.2rem;
}

.learn-step.is-answer .learn-step-label {
  color: var(--success);
}

.learn-step-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-primary, #2d2a26);
}

.learn-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* .learn-reveal-btn, .learn-next-btn, .learn-back-btn: the site's one button (css/buttons.css, job S3-02) */
.learn-reveal-btn svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 0.3rem;
}


/* ===== PRACTICE MODE ===== */
.problem-stage {
  max-width: 560px;
  width: 100%;
  position: relative;
}

.problem-card {
  background: #fff;
  border: 1px solid var(--border-light, #e8e4df);
  border-radius: 16px;
  padding: 2.5rem 2.5rem 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.problem-card.card-correct {
  border-color: #86efac;
  box-shadow: 0 4px 20px rgba(22,163,74,0.08);
}

.problem-card.card-incorrect {
  border-color: #fca5a5;
  box-shadow: 0 4px 20px rgba(220,38,38,0.08);
}

.problem-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.problem-number-label {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted, #6b665f);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.problem-tier-pill {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2em 0.6em;
  border-radius: 999px;
}

.problem-calc-pill {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15em 0.5em;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.problem-calc-pill.calc-no {
  color: #b45309;
  background: #fef3c7;
}
.problem-calc-pill.calc-yes {
  color: #0f766e;
  background: #ccfbf1;
}

.problem-tier-pill.pill-bronze { color: var(--bronze); background: var(--bronze-badge); }
.problem-tier-pill.pill-silver { color: var(--silver); background: var(--silver-badge); }
.problem-tier-pill.pill-gold   { color: var(--gold); background: var(--gold-badge); }

.learn-passage-label {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #6b665f);
  margin-top: 1rem;
}
/* a whole extract under a worked example: read like a page, not a pull quote (Tom, 18 Oct 2026: centred bold
   italic in a box that scrolled inside the page) */
.learn-full-passage, .learn-question .rs-quote { text-align: left; font-weight: 400; }
.learn-question .rs-quote { font-style: normal; font-size: 1.02rem; line-height: 1.85; }

/* Everything in the question card shares one centred axis and a measure.
   This line used to be right-aligned, which read as detached from the card
   and made a third alignment in a stack of three. */
.problem-tier-desc {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.78rem;
  color: var(--text-muted, #6b665f);
  text-align: center;
  max-width: 36rem;
  margin: -0.35rem auto 1.1rem;
  text-wrap: pretty;
}

/* Tier intro card — one rung's method, taught at the moment it's needed */
.tier-intro-title {
  font-family: var(--font-read,'Literata',Georgia,serif);
  font-size: 1.35rem;
  margin: 0.25rem 0 0.75rem;
}
.tier-intro-steps {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}
.tier-intro-steps li {
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: 0.5rem;
}
.tier-intro-example {
  border: 1px solid var(--border, #e8e4de);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 1.1rem;
  font-size: 0.92rem;
}
.tier-intro-example-q {
  font-family: var(--font-read,'Literata',Georgia,serif);
  font-weight: 700;
  font-size: 1.02rem;
  margin-bottom: 0.6rem;
}
.tier-intro-example-step {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
  align-items: baseline;
}
/* Fixed basis, not `0 0 auto` with a min-width: sized to its own text,
   every label was a different width and the content column started at a
   different x on each row, which read as ragged. */
.tier-intro-example-step .tie-label {
  flex: 0 0 7rem;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.35;
  color: var(--text-muted, #6b665f);
}
.tier-intro-example-step .tie-content p { margin: 0; }
.tier-intro-example-step.is-answer .tie-content { font-weight: 700; }

/* Guided walk — micro-steps the student types, checked one at a time */
.guided-display {
  font-family: var(--font-read,'Literata',Georgia,serif);
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  margin: 0.25rem 0 1rem;
  line-height: 1.55;
}
.guided-step { margin-bottom: 0.55rem; }
.guided-say {
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 1rem 0 0.55rem;
}
.guided-box-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-family: var(--font-read,'Literata',Georgia,serif);
  font-size: 1.08rem;
  padding-left: 0.5rem;
}
/* Unit hint after a walk-step box (e.g. "billion litres", "(a decimal)"), so
   the student knows the scale to type. Muted, to read as a label not prose. */
.gb-post {
  color: var(--text-muted, #6b665f);
  font-size: 0.98rem;
  white-space: nowrap;
}
body.dark-mode .gb-post { color: var(--sv-night-sec); }
.guided-input {
  width: 4.2rem;
  padding: 0.35rem 0.4rem;
  border: 1.5px solid var(--border, #ddd6cc);
  border-radius: 8px;
  font-size: 1rem;
  text-align: center;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
}
.guided-input:focus { outline: none; border-color: var(--accent, #2563eb); }
.guided-input.guided-right { border-color: #16a34a; background: #f0fdf4; }
.guided-input.guided-wrong { border-color: #dc2626; animation: gshake 0.3s; }
.guided-input.guided-shown { border-color: #d97706; background: #fffbeb; }
.guided-go {
  border: none;
  background: var(--accent, #2563eb);
  color: #fff;
  border-radius: 8px;
  padding: 0.38rem 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
}
.guided-tick { color: #16a34a; font-weight: 700; font-size: 1.05rem; }
/* Choice steps — a categorical decision the student clicks rather than typing a
   code number. Buttons sit where the input box would be. */
.guided-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-left: 0.4rem;
  margin-top: 0.15rem;
  align-items: center;
}
.guided-choice {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 1.5px solid var(--border, #ddd6cc);
  background: #fff;
  color: var(--text-primary, #2d2a26);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.guided-choice:hover:not(:disabled) { border-color: var(--accent, #2563eb); background: var(--accent-light, #eff6ff); }
.guided-choice:disabled { cursor: default; }
.guided-choice.guided-choice-right { border-color: #16a34a; background: #f0fdf4; color: #166534; font-weight: 600; }
.guided-choice.guided-choice-wrong { border-color: #dc2626; background: #fef2f2; animation: gshake 0.3s; }
.guided-choice.guided-choice-shown { border-color: #d97706; background: #fffbeb; }
body.dark-mode .guided-choice { background: var(--sv-night-card); border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .guided-choice:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-light, #1a2040); }
body.dark-mode .guided-choice.guided-choice-right { background: #0a2e1a; color: #86efac; border-color: #166534; }
body.dark-mode .guided-choice.guided-choice-shown { background: #332d1f; border-color: #b45309; }
.guided-hint { font-size: 0.82rem; color: #b45309; margin: 0.35rem 0 0 0.5rem; }
.guided-done { font-size: 0.85rem; color: #16a34a; margin: 0.35rem 0 0 0.5rem; }
/* .guided-skip: the site's quiet button (css/buttons.css) in its own row since job S5-23 (".guided-skip-row" below) */
.problem-walk-link {
  display: block;
  text-align: center;
  margin-top: 0.7rem;
  font-size: 0.82rem;
  color: var(--text-muted, #6b665f);
}
.guided-prefill-note { font-style: italic; color: var(--text-muted, #6b665f); }
.guided-step-prefilled { opacity: 0.82; }

/* ===== PINNED QUESTION HEAD =====
   The walk/example question stays in view while the steps reveal and the card
   scrolls, so a student never has to scroll back up to re-read what they're
   answering. The head is opaque and lifts a soft shadow once it's pinned. */
.guided-card-head, .learn-card-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
  padding-bottom: 0.85rem;
  margin-bottom: 0.4rem;
  transition: box-shadow 0.2s ease;
}
/* A long extract or a tall inline chart can't own the whole viewport when
   pinned — cap the head and let it scroll inside the pinned zone so there's
   always room for the steps below. */
/* 48vh was leaving ~200px of the column empty while cutting the question in
   half on any card carrying an image — score extracts, OS maps. Measured at
   960/800/720 viewport heights: the action buttons stay on screen at 64vh, so
   60vh is safe and lets most cards be read without scrolling at all. */
.guided-card-head { max-height: 58vh; overflow-y: auto; }
.learn-card-head { max-height: 60vh; overflow-y: auto; }
.guided-card-head.is-stuck, .learn-card-head.is-stuck {
  box-shadow: 0 12px 14px -12px rgba(0,0,0,0.25);
}
/* Capped and scrollable is fine; capped and SILENT is not. Without a cue the
   last visible line looks like the question ends there — an extract with a
   score image or a map overflows often enough that students read a truncated
   sentence and answer the wrong thing. Fade the bottom edge whenever there is
   more below, and drop it the moment they reach the end. */
.guided-card-head::after, .learn-card-head::after {
  content: ''; display: block; position: sticky; bottom: 0;
  height: 42px; margin-top: -42px; pointer-events: none;
  opacity: 0; transition: opacity 0.2s ease;
  background: linear-gradient(to top, #fff 22%, rgba(255,255,255,0));
}
.guided-card-head.has-more::after, .learn-card-head.has-more::after { opacity: 1; }
body.dark-mode .guided-card-head, body.dark-mode .learn-card-head { background: var(--sv-night-card); }
body.dark-mode .guided-card-head::after, body.dark-mode .learn-card-head::after {
  background: linear-gradient(to top, var(--sv-night-card) 22%, color-mix(in srgb, var(--sv-night-card) 0%, transparent));
}
@media (prefers-reduced-motion: reduce) {
  .guided-card-head::after, .learn-card-head::after { transition: none; }
}
/* phones: the page itself scrolls, so the question and its extract sit in the page like text. A pinned, capped
   head made the extract a box that scrolled inside the scrolling page behind a fade (Tom, 18 Oct 2026). */
@media (max-width: 700px) {
  .guided-card-head, .learn-card-head { position: static; max-height: none; overflow: visible; box-shadow: none; }
  .guided-card-head::after, .learn-card-head::after { display: none; }
}
.guided-actions .problem-check-btn { margin-top: 0.6rem; }
.guided-actions .guided-secondary { display: flex; margin: 0.65rem auto 0; }   /* its look is the site's one button (css/buttons.css, job S3-02): here only where it sits */
@keyframes gshake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.problem-equation {
  font-family: var(--font-read,'Literata',Georgia,serif);
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  /* centred display type needs a short measure, or the rags go wild and a
     two-sentence question looks accidental */
  max-width: 28rem;
  margin: 0 auto 0.75rem;
  min-height: 2.5rem;
  line-height: 1.32;
  text-wrap: balance;
}
/* the instruction sentence, split out by formatDisplay */
.problem-equation .q-instr { display: block; margin-top: 0.5em; }

/* Inline diagram figures (exam-style) inside problem and guided displays */
/* Exam-style diagram figures only. KaTeX draws a radical sign, and several
   other stretchy symbols, as a tiny inline <svg>; this rule used to catch
   those too and force them to display:block at width:100% on their own
   line, which knocked the surd out of the formula and left a gap where the
   root should be. Tom found it on a gold question: 5^2 + [gap]49 over 2^3.
   :not(.katex *) is not a thing, so exclude by ancestor instead. */
.problem-equation > svg,
.problem-equation .problem-figure svg,
.guided-display > svg,
.guided-display .problem-figure svg {
  display: block;
  margin: 0.35rem auto;
  max-width: 280px;
  width: 100%;
  height: auto;
}
/* Do NOT add a counter-rule for .katex svg here. KaTeX positions its
   radicals with display:block and width:100% inside a sized wrapper;
   overriding those draws the surd's tail straight through the digits.
   Restricting the figure rule to direct children is the whole fix. */
.figure-caption {
  display: block;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted, #6b665f);
  text-align: center;
  margin-bottom: 0.4rem;
}

.problem-hint {
  font-size: 0.82rem;
  color: var(--text-muted, #6b665f);
  font-style: italic;
  text-align: center;
  max-width: 32rem;
  margin: 0 auto 1.25rem;
  text-wrap: pretty;
}
/* the unit the answer is given in, beside the box */
.problem-answer-unit {
  font-family: var(--font-read,'Literata',Georgia,serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted, #6b665f);
  margin-left: 0.55rem;
  white-space: nowrap;
}
body.dark-mode .problem-answer-unit { color: var(--sv-night-sec); }

/* Equation hint toggle (science practice — recall equation reveal) */
.equation-hint-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--accent, #2563eb);
  background: none;
  border: 1.5px dashed var(--accent, #2563eb);
  border-radius: 8px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  margin: 0 auto 0.75rem;
  transition: background 0.2s, border-color 0.2s;
  font-family: inherit;
}
.equation-hint-toggle:hover {
  background: rgba(37, 99, 235, 0.06);
}
.equation-hint-toggle svg {
  width: 14px; height: 14px;
  transition: transform 0.25s ease;
}
.equation-hint-toggle.open svg {
  transform: rotate(180deg);
}
.equation-hint-content {
  display: none;
  text-align: center;
  font-size: 1.05rem;
  color: var(--text-primary, #2d2a26);
  background: rgba(37, 99, 235, 0.05);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  margin-bottom: 0.75rem;
  animation: eqFadeIn 0.25s ease;
}
.equation-hint-content.visible { display: block; }
@keyframes eqFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.dark-mode .equation-hint-toggle {
  color: #60a5fa;
  border-color: #60a5fa;
}
.dark-mode .equation-hint-toggle:hover {
  background: rgba(96, 165, 250, 0.1);
}
.dark-mode .equation-hint-content {
  background: rgba(96, 165, 250, 0.08);
  color: var(--sv-night-ink);
}

.problem-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 1.25rem 0;
  flex-wrap: wrap;
}

.problem-inputs label {
  font-family: var(--font-read,'Literata',Georgia,serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary, #5a5651);
}

.problem-input {
  width: 5.5rem;
  padding: 0.55rem 0.65rem;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  border: 2px solid var(--border-light, #e8e4df);
  border-radius: 10px;
  background: var(--panel-bg);
  color: var(--text-primary, #2d2a26);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.problem-input:focus {
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #fff;
}

.problem-input.input-correct {
  border-color: var(--success);
  background: var(--success-light);
}

.problem-input.input-incorrect {
  border-color: var(--error);
  background: var(--error-light);
}

.problem-input-wide {
  width: 8rem;
}

.mc-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.mc-option {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.6rem 1rem;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.9rem;
  text-align: left;
  border: 1.5px solid var(--border-light, #e0dcd7);
  border-radius: 10px;
  background: var(--bg-body, #faf8f5);
  color: var(--text-primary, #2d2a26);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.mc-letter {
  flex: 0 0 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent, #7c3aed);
  background: var(--accent-light, #f5f3ff);
  border-radius: 50%;
}
.mc-option.selected .mc-letter { background: var(--accent, #7c3aed); color: #fff; }
body.dark-mode .mc-letter { background: var(--accent-badge, #202a4a); }

.mc-option:hover {
  border-color: var(--accent, #7c3aed);
  background: var(--accent-light, #f5f3ff);
}

.mc-option.selected {
  border-color: var(--accent, #7c3aed);
  background: var(--accent-badge, #ede9fe);
  font-weight: 600;
}

.mc-option:disabled {
  cursor: default;
  opacity: 0.7;
}

.problem-input-separator {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted, #6b665f);
}

/* Fraction input */
.fraction-input {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto;
}
.fraction-input .fraction-label {
  font-family: var(--font-read,'Literata',Georgia,serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary, #5a5651);
}
.fraction-input .fraction-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.fraction-num, .fraction-den {
  width: 4rem;
  padding: 0.35rem 0.5rem;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
  border: 1.5px solid var(--border-light, #e0dcd7);
  border-radius: 8px;
  background: var(--bg-body, #faf8f5);
  color: var(--text-primary, #2d2a26);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.fraction-num:focus, .fraction-den:focus {
  border-color: var(--accent, #7c3aed);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
  background: #fff;
}
.fraction-num.input-correct, .fraction-den.input-correct {
  border-color: var(--success);
  background: var(--success-light);
}
.fraction-num.input-incorrect, .fraction-den.input-incorrect {
  border-color: var(--error);
  background: var(--error-light);
}
.fraction-line {
  width: 4.5rem;
  height: 2px;
  background: var(--text-primary, #2d2a26);
  margin: 2px 0;
}

/* Standard form input */
.standard-form-input {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  margin: 0 auto;
  font-family: var(--font-read,'Literata',Georgia,serif);
  font-size: 1.2rem;
}
.sf-a {
  width: 4rem;
  padding: 0.35rem 0.5rem;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
  border: 1.5px solid var(--border-light, #e0dcd7);
  border-radius: 8px;
  background: var(--bg-body, #faf8f5);
  color: var(--text-primary, #2d2a26);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.sf-multiply {
  color: var(--text-primary, #2d2a26);
  font-weight: 500;
}
.sf-n {
  width: 2.5rem;
  padding: 0.25rem 0.4rem;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  border: 1.5px solid var(--border-light, #e0dcd7);
  border-radius: 6px;
  background: var(--bg-body, #faf8f5);
  color: var(--text-primary, #2d2a26);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.sf-a:focus, .sf-n:focus {
  border-color: var(--accent, #7c3aed);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
  background: #fff;
}
.sf-a.input-correct, .sf-n.input-correct {
  border-color: var(--success);
  background: var(--success-light);
}
.sf-a.input-incorrect, .sf-n.input-incorrect {
  border-color: var(--error);
  background: var(--error-light);
}

.problem-check-btn {
  display: flex;
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
}   /* its look is the site's one button (css/buttons.css, job S3-02): here only where it sits */

/* Feedback area */
.problem-feedback-area {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--practice-ease);
}

.problem-feedback-area.shown {
  max-height: 800px;
}

.feedback-box {
  margin-top: 1.25rem;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.feedback-box.feedback-correct {
  background: var(--success-light);
  border: 1px solid #bbf7d0;
}

.feedback-box.feedback-incorrect {
  background: var(--error-light);
  border: 1px solid #fecaca;
}

.feedback-icon {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.feedback-correct .feedback-icon {
  background: #dcfce7;
  color: var(--success);
}

.feedback-incorrect .feedback-icon {
  background: #fee2e2;
  color: var(--error);
}

.feedback-icon svg {
  width: 14px;
  height: 14px;
}

.feedback-body {
  flex: 1;
  min-width: 0;
}

.feedback-title {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.feedback-correct .feedback-title { color: var(--success); }
.feedback-incorrect .feedback-title { color: var(--error); }

.feedback-text {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-primary, #2d2a26);
}
.feedback-simplify {
  font-size: 0.78rem;
  margin-top: 0.4rem;
  padding: 0.4rem 0.6rem;
  background: #fef3c7;
  border-radius: 6px;
  color: var(--text-primary, #2d2a26);
}

.misconception-tip {
  background: #fef3c7;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-primary, #2d2a26);
}

.misconception-tip strong {
  color: #b45309;
}

.correct-answer-text {
  margin-top: 0.5rem;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary, #5a5651);
}

/* Why the answer is the answer. Neutral, not amber: it is teaching, not a
   warning, and it appears on correct answers too. */
.feedback-why {
  margin-top: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: rgba(0, 0, 0, 0.035);
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-secondary, #5a5651);
}
.feedback-why strong { color: var(--text-primary, #2d2a26); }

/* Next button (appears after checking) */
.problem-next-area {
  text-align: center;
  margin-top: 1rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--practice-ease);
}

.problem-next-area.shown {
  max-height: 80px;
}

/* .problem-next-btn: the site's main button (css/buttons.css, job S3-02) */

/* Tier progress bar (below card) */
.tier-progress {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tier-progress-track {
  flex: 1;
  height: 8px;
  background: var(--border-lighter, #e8e4df);
  border-radius: 999px;
  overflow: hidden;
}

.tier-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s var(--practice-ease);
  min-width: 0;
}

.tier-progress-fill.fill-bronze { background: var(--bronze); }
.tier-progress-fill.fill-silver { background: var(--silver); }
.tier-progress-fill.fill-gold   { background: var(--gold); }

/* ===== TIER TRANSITION CELEBRATION ===== */
.tier-celebration {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.tier-celebration.active {
  opacity: 1;
  pointer-events: auto;
}

.celebration-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  padding: 1rem 2.5rem;
  border-radius: 16px;
  animation: celebration-pop 0.6s var(--practice-ease) forwards;
}

.celebration-badge.cele-bronze { color: var(--bronze); background: var(--bronze-badge); }
.celebration-badge.cele-silver { color: var(--silver); background: var(--silver-badge); }
.celebration-badge.cele-gold   { color: var(--gold); background: var(--gold-badge); }

.celebration-badge svg {
  width: 28px;
  height: 28px;
}

.celebration-sub {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted, #6b665f);
  margin-top: 0.75rem;
  animation: celebration-fade 0.5s 0.3s ease forwards;
  opacity: 0;
}

@keyframes celebration-pop {
  0% { opacity: 0; transform: scale(0.5); }
  60% { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes celebration-fade {
  to { opacity: 1; }
}

/* ===== FINAL SUMMARY OVERLAY ===== */
.summary-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1.5rem;
}

.summary-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.summary-modal {
  background: #fff;
  border-radius: 20px;
  padding: 2.5rem 3rem;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  text-align: center;
  animation: summary-in 0.5s var(--practice-ease) forwards;
  transform: translateY(20px);
  opacity: 0;
}

.summary-overlay.active .summary-modal {
  opacity: 1;
  transform: translateY(0);
}

@keyframes summary-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.summary-score {
  font-family: var(--font-read,'Literata',Georgia,serif);
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent, #2563eb);
  line-height: 1;
  margin-bottom: 0.25rem;
}

/* Tier-fail modal — reuses .summary-overlay + .summary-modal */
.tier-fail-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 0.85rem;
  border-radius: 50%;
  background: rgba(234, 88, 12, 0.12);
  color: #c2410c;
}
.tier-fail-icon svg { width: 1.8rem; height: 1.8rem; }
.tier-fail-heading {
  font-family: var(--font-read,'Literata',Georgia,serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary, #2d2a26);
  margin-bottom: 0.6rem;
}
.tier-fail-score {
  font-family: var(--font-read,'Literata',Georgia,serif);
  font-size: 2.4rem;
  font-weight: 800;
  color: #c2410c;
  line-height: 1;
  margin-bottom: 0.3rem;
}
.tier-fail-sub {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--text-secondary, #5a5651);
  margin-bottom: 1.4rem;
}

.summary-label {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--text-secondary, #5a5651);
  margin-bottom: 1.5rem;
}

.summary-tiers {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.summary-tier-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.summary-tier-name {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  width: 3.5rem;
  text-align: right;
  flex-shrink: 0;
}

.summary-tier-name.stn-bronze { color: var(--bronze); }
.summary-tier-name.stn-silver { color: var(--silver); }
.summary-tier-name.stn-gold   { color: var(--gold); }

.summary-tier-bar {
  flex: 1;
  height: 10px;
  background: var(--border-lighter, #e8e4df);
  border-radius: 999px;
  overflow: hidden;
}

.summary-tier-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s var(--practice-ease);
}

.summary-tier-fill.stf-bronze { background: var(--bronze); }
.summary-tier-fill.stf-silver { background: var(--silver); }
.summary-tier-fill.stf-gold   { background: var(--gold); }

.summary-tier-count {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted, #6b665f);
  width: 2.5rem;
  flex-shrink: 0;
}

.summary-message {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-secondary, #5a5651);
  margin-bottom: 1.5rem;
}

.summary-message strong {
  color: var(--accent, #2563eb);
}

.summary-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* .summary-btn (primary, secondary): the site's main and second buttons (css/buttons.css, job S3-02) */

/* ===== PROBLEM SLIDE TRANSITIONS ===== */
.problem-card.slide-out-left {
  animation: slideOutLeft 0.35s var(--practice-ease) forwards;
}

.problem-card.slide-in-right {
  animation: slideInRight 0.4s var(--practice-ease) forwards;
}

@keyframes slideOutLeft {
  to {
    opacity: 0;
    transform: translateX(-60px);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== METHOD MODAL ===== */
.method-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1.5rem;
}

.method-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.method-modal {
  background: #fff;
  border-radius: 20px;
  padding: 1.75rem 2rem 1.5rem;
  max-width: 680px;
  width: calc(100% - 2rem);
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  opacity: 1;
  transition: opacity 0.25s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--accent, #2563eb) transparent;
}
.method-modal::-webkit-scrollbar { width: 4px; }
.method-modal::-webkit-scrollbar-track { background: transparent; }
.method-modal::-webkit-scrollbar-thumb { background: var(--accent, #2563eb); border-radius: 2px; }

.method-modal-overlay.dismissing .method-modal {
  opacity: 0;
}

.method-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-light, #e8e4df);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #6b665f);
  transition: background 0.2s ease, color 0.2s ease;
}

.method-modal-close:hover {
  background: var(--panel-bg);
  color: var(--text-primary, #2d2a26);
}

.method-modal-close svg {
  width: 16px;
  height: 16px;
}

.method-modal-title {
  font-family: var(--font-read,'Literata',Georgia,serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary, #2d2a26);
  margin-bottom: 0.65rem;
  padding-right: 2rem;
  line-height: 1.3;
}

.method-modal-content {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary, #5a5651);
  margin-bottom: 0.85rem;
}

.method-modal-steps-label {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #6b665f);
  margin-bottom: 0.4rem;
}

.method-modal-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  counter-reset: modal-step;
}

.method-modal-steps li {
  counter-increment: modal-step;
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  padding: 0.5rem 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-primary, #2d2a26);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.method-modal-steps li:last-child {
  border-bottom: none;
}

.method-modal-steps li::before {
  content: counter(modal-step);
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent, #2563eb);
  background: var(--accent-light, #eff6ff);
  border-radius: 50%;
}

.method-modal-go-btn {
  display: block;
  width: 100%;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent, #2563eb);
  border: none;
  padding: 0.85em 1.5em;
  border-radius: 12px;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.1s ease;
}

.method-modal-go-btn:hover {
  filter: brightness(0.92);
}

.method-modal-go-btn:active {
  transform: scale(0.97);
}

/* ===== HEADER NAV PILLS ===== */
.header-nav-pill {
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  color: var(--accent, #2563eb) !important;
  background: var(--accent-light, #eff6ff);
  padding: 0.25em 0.75em;
  border-radius: 8px;
  border: 1px solid var(--accent-badge, #dbeafe);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease;
}
.header-nav-pill:hover {
  background: var(--accent-badge, #dbeafe);
}

/* ===== HEADER LESSON PILL ===== */
.header-lesson-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent, #2563eb);
  background: var(--accent-light, #eff6ff);
  padding: 0.2em 0.65em;
  border-radius: 999px;
  white-space: nowrap;
}

/* ===== TUTORIAL TOOLTIPS ===== */

/* Highlight flash for sidebar method card */
@keyframes method-card-flash {
  0% { box-shadow: 0 0 0 0 var(--accent, #2563eb); }
  30% { box-shadow: 0 0 0 4px var(--accent-light, #eff6ff); border-color: var(--accent, #2563eb); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ===== MODE PROMPT ===== */
/* ===== LOADING STATE ===== */
.practice-loading-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 2rem;
}

.practice-loading-inner {
  max-width: 400px;
  width: 100%;
}

/* ===== ERROR STATE ===== */
.practice-error-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 2rem;
  text-align: center;
}

/* Hidden elements for loader compatibility */
.legacy-hidden { display: none !important; }

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 900px) {
  .page-header {
    padding-left: 1.5rem;
    background: rgba(255,255,255,0.72) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
  }
  body.dark-mode .page-header {
    background: rgba(28,27,25,0.72) !important;
  }

  .practice-panel {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    z-index: 850;
    transform: translateX(-100%);
    transition: transform 0.35s var(--practice-ease);
    box-shadow: none;
    padding-top: 1.25rem;
  }

  .practice-panel.panel-open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.12);
  }

  .panel-toggle-btn {
    display: flex;
  }

  .panel-overlay {
    position: fixed;
    inset: 0;
    z-index: 840;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .panel-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }

  .practice-main {
    width: 100%;
  }

  .learn-card {
    padding: 1.75rem 1.5rem;
  }

  .problem-card {
    padding: 1.75rem 1.5rem 1.5rem;
  }

  .problem-equation {
    font-size: 1.35rem;
  }

  .content-view {
    padding: 1.25rem;
  }

  .practice-score-bar {
    padding: 0.5rem 1rem;
  }

  .score-bar-a11y {
    display: none !important;
  }

  .method-modal {
    padding: 2rem 1.5rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .problem-inputs {
    flex-direction: column;
    gap: 0.5rem;
  }

  .problem-input {
    width: 100%;
  }

  .problem-input-separator {
    display: none;
  }

  .fraction-num, .fraction-den {
    width: 3.5rem;
  }
  .fraction-line {
    width: 4rem;
  }

  .sf-a {
    width: 3.5rem;
  }
  .sf-n {
    width: 2.2rem;
  }

  .summary-modal {
    padding: 2rem 1.5rem;
  }
}

/* ===== CHART.JS CONTAINER ===== */
.problem-chart-container {
  width: 100%;
  max-width: 400px;
  max-height: 200px;
  margin: 0 auto 0.75rem;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid var(--border-lighter, #e8e4df);
  border-radius: 12px;
}
.problem-chart-container canvas {
  width: 100% !important;
  max-height: 180px !important;
}

/* Chart in passage panel (Geography Skills etc.) */
.chart-panel-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem;
  flex: 1;
  overflow: hidden;
}
.chart-panel-body canvas {
  max-width: 100%;
  max-height: 100%;
}
.chart-panel-body img {
  cursor: zoom-in;
}

/* Map-first layout. A map IS the question in Geography Skills, so when one
   is showing it takes the larger share of the split and fills its panel
   instead of floating in centred dead space. Desktop only: below 900px the
   columns stack into tabs and the map already gets the full width. */
@media (min-width: 901px) {
  .practice-passage-area.passage-area--map { flex: 1.6; }
}
/* Map + its zoom affordance are centred as one group. Left to its own
   flex:1 the body pushed the hint to the panel's bottom edge, where a
   900px-tall viewport clipped it. */
.chart-panel-body--map {
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  min-height: 0;
}
/* Width-fill only. Forcing height:100% too makes the element taller than
   the map, letterboxing inside it and pushing the zoom hint out of the
   clipped panel. object-fit:contain never crops, which maps require. */
.chart-panel-body--map img {
  width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}
/* Ordnance Survey OpenData attribution line under the map (required). */
.map-os-attrib {
  font-size: 0.68rem;
  line-height: 1.3;
  color: var(--text-muted, #6b665f);
  text-align: right;
  width: 100%;
  margin-top: 0.15rem;
}
.map-zoom-hint {
  flex-shrink: 0;
  text-align: center;
  padding: 0 1rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #8a7e72;
}
.map-zoom-hint button {
  background: none;
  border: none;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
}
.map-zoom-hint button:hover { background: rgba(0,0,0,0.04); text-decoration: underline; }
body.dark-mode .map-zoom-hint { color: var(--sv-night-sec); }
body.dark-mode .map-zoom-hint button:hover { background: rgba(255,255,255,0.06); }

/* ===== ZOOMABLE IMAGE VIEWER ===== */
.lb-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.9);
  display: flex; align-items: center; justify-content: center;
}
.lb-stage {
  position: absolute; inset: 0;
  overflow: hidden;
  touch-action: none;               /* we own pinch and drag */
  cursor: grab;
  display: flex; align-items: center; justify-content: center;
}
.lb-stage:active { cursor: grabbing; }
.lb-img {
  transform-origin: center center;
  will-change: transform;
  max-width: none; max-height: none;   /* scale is ours, not the browser's */
  user-select: none; -webkit-user-drag: none;
}
.lb-bar {
  position: absolute; bottom: max(1rem, env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.35rem 0.45rem;
  background: rgba(28,26,24,0.92);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  box-shadow: 0 6px 22px rgba(0,0,0,0.4);
}
.lb-btn {
  min-width: 34px; height: 34px; padding: 0 0.6rem;
  border: none; border-radius: 8px;
  background: transparent; color: #f0ece4;
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lb-btn:hover { background: rgba(255,255,255,0.14); }
.lb-close { font-size: 1.15rem; }
.lb-level {
  min-width: 2.6rem; text-align: center;
  color: #cfc7bb; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.lb-hint {
  position: absolute; top: max(1rem, env(safe-area-inset-top)); left: 50%;
  transform: translateX(-50%);
  padding: 0.4rem 0.8rem; border-radius: 999px;
  background: rgba(28,26,24,0.85); color: #e8e4df;
  font-size: 0.74rem; pointer-events: none;
  transition: opacity 0.6s ease;
}

/* ===== POP-OUT CALCULATOR ===== */
/* Offset left of the help/bug FAB stack, which sits at right:16px. */
.calc-fab {
  position: fixed; right: 76px; bottom: 1rem; z-index: 900;
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  background: #fff; color: #2d2a26;
  border: 1px solid #d6cfc4; border-radius: 999px;
  font-family: inherit; font-size: 0.78rem; font-weight: 600;
  cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.10);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.calc-fab:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,0.14); }
.calc-fab[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.calc-float {
  position: fixed; right: 76px; bottom: 3.9rem; z-index: 901;
  width: 244px; max-width: calc(100vw - 2rem);
  background: #f9f6f0; border: 1px solid #d6cfc4; border-radius: 14px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.20);
  overflow: hidden; display: none;
}
.calc-float.open { display: block; }
/* our own title bar replaces both of renderCalculatorTool's headings */
.calc-float .passage-header,
.calc-float .stats-tool-title { display: none; }
.calc-float-bar {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.5rem 0.4rem 0.55rem;
  background: rgba(0,0,0,0.04);
  border-bottom: 1px solid #e4ded4;
  cursor: grab;
  touch-action: none;        /* let us own the drag gesture on touch */
  user-select: none;
}
.calc-float-bar:active { cursor: grabbing; }
.calc-float-grip { color: #b3a99c; font-size: 0.8rem; letter-spacing: -2px; }
.calc-float-title {
  flex: 1; font-size: 0.66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em; color: #8a7e72;
}
.calc-float-btn {
  width: 22px; height: 22px; padding: 0;
  border: none; background: none; cursor: pointer;
  border-radius: 6px; color: #8a7e72;
  font-size: 0.95rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.calc-float-btn:hover { background: rgba(0,0,0,0.08); color: #2d2a26; }
.calc-float.minimised { width: auto; }
.calc-float.minimised .calc-float-body { display: none; }
body.dark-mode .calc-float-bar { background: rgba(255,255,255,0.05); border-bottom-color: var(--sv-night-line); }
body.dark-mode .calc-float-grip { color: color-mix(in srgb, var(--sv-night-line) 60%, var(--sv-night-mut)); }
body.dark-mode .calc-float-title, body.dark-mode .calc-float-btn { color: var(--sv-night-sec); }
body.dark-mode .calc-float-btn:hover { background: rgba(255,255,255,0.10); color: var(--sv-night-ink); }
.calc-float .stats-tool { padding: 0.5rem 0.7rem 0.75rem; }
@media (max-width: 900px) {
  .calc-fab { right: 68px; bottom: 4.6rem; }   /* clear tab bar + FAB stack */
  .calc-float { right: 12px; bottom: 7.4rem; }
  .calc-fab-txt { display: none; }
}
body.dark-mode .calc-fab { background: var(--sv-night-card); color: var(--sv-night-ink); border-color: var(--sv-night-line); }
body.dark-mode .calc-float { background: var(--sv-night-card); border-color: var(--sv-night-line); }
/* the keypad itself had no dark treatment: white display, white keys */
body.dark-mode .calc-display { background: var(--sv-night-page); border-color: var(--sv-night-line); }
body.dark-mode .calc-value { color: var(--sv-night-ink); }
body.dark-mode .calc-expr { color: var(--sv-night-sec); }
body.dark-mode .calc-btn {
  background: color-mix(in srgb, var(--sv-night-card) 82%, var(--sv-night-line)); border-color: var(--sv-night-line); color: var(--sv-night-ink);
}
body.dark-mode .calc-btn:hover { background: color-mix(in srgb, var(--sv-night-card) 60%, var(--sv-night-line)); }
body.dark-mode .calc-btn:active { background: var(--sv-night-line); }
body.dark-mode .calc-btn.calc-op { background: color-mix(in srgb, var(--sv-night-card) 82%, var(--sv-night-line)); color: var(--sv-night-sec); }
body.dark-mode .calc-btn.calc-op:hover { background: color-mix(in srgb, var(--sv-night-card) 60%, var(--sv-night-line)); }
body.dark-mode .calc-btn.calc-clear { color: #e08a7a; }

/* ===== RULER TOOL ===== */
.ruler-container {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  overflow: hidden;
}
.ruler-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  cursor: crosshair !important;
  user-select: none;
  -webkit-user-drag: none;
}
.ruler-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.ruler-point {
  cursor: pointer;
  pointer-events: all;
}
.ruler-line {
  stroke-dasharray: 6 4;
}
.ruler-badge {
  position: absolute;
  background: #2d2a26;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  margin-top: -8px;
}
.ruler-hint {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(45,42,38,0.85);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
}
.ruler-btn {
  position: absolute;
  background: rgba(45,42,38,0.85);
  color: #fff;
  border: none;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
}
.ruler-btn:hover { background: rgba(45,42,38,1); }
.ruler-reset { top: 0.5rem; right: 0.5rem; display: none; }
.ruler-fullscreen { top: 0.5rem; left: 0.5rem; }

/* ===== STATISTICS TOOLS (passage panel) ===== */
.stats-tool {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  gap: 0.75rem;
}
.stats-tool-title {
  font-family: var(--font-read,'Literata',Georgia,serif);
  font-size: 1rem;
  font-weight: 600;
  color: #2d2a26;
  margin-bottom: 0.25rem;
}
.stats-tool-hint {
  font-size: 0.78rem;
  color: #6b665f;
  line-height: 1.4;
}

/* Number Sorter */
.sorter-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem;
  background: #fff;
  border: 2px dashed #d6cfc4;
  border-radius: 12px;
  transition: border-color 0.2s;
}
.sorter-chips.drag-over { border-color: var(--accent, #2563eb); }
.sorter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 0.5rem 0.75rem;
  background: #f5f0ea;
  border: 1px solid #d6cfc4;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #2d2a26;
  cursor: grab;
  user-select: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.sorter-chip:active, .sorter-chip.dragging {
  cursor: grabbing;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  background: #fff;
  z-index: 10;
}
.sorter-chip.placed { background: #dcfce7; border-color: #86efac; }
.sorter-result {
  text-align: center;
  padding: 0.5rem;
  background: #f0f9ff;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #1e40af;
  font-weight: 500;
  display: none;
  align-items: center;
  justify-content: center;
}
.sorter-result.visible {
  display: flex;
}

/* Running Total */
.running-values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.running-val {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 0.45rem 0.6rem;
  background: #f5f0ea;
  border: 1px solid #d6cfc4;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #2d2a26;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.running-val:hover { background: #ede8e0; }
.running-val.added {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
.running-val.added:hover { background: #bbf7d0; }
.running-display {
  background: #fff;
  border: 1px solid #d6cfc4;
  border-radius: 10px;
  padding: 0.75rem;
  text-align: center;
}
.running-sum {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2d2a26;
  font-family: var(--font-read,'Literata',Georgia,serif);
}
.running-meta {
  font-size: 0.78rem;
  color: #6b665f;
  margin-top: 0.2rem;
}
.running-divide-btn {
  display: block;
  width: 100%;
  padding: 0.6rem;
  border: none;
  border-radius: 8px;
  background: var(--accent, #2563eb);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.15s;
}
.running-divide-btn:hover { opacity: 0.85; }
.running-divide-btn:disabled { opacity: 0.4; cursor: default; }
.running-result {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #166534;
  padding: 0.4rem;
}

/* Tally Counter */
.tally-items {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.tally-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: #fff;
  border: 1px solid #e8e4df;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}
.tally-row:hover { background: #f9f6f0; }
.tally-row.is-max { background: #dcfce7; border-color: #86efac; }
.tally-label {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  color: #2d2a26;
}
.tally-marks {
  font-size: 0.82rem;
  color: #6b665f;
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tally-count {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent, #2563eb);
}
.tally-result {
  text-align: center;
  padding: 0.5rem;
  font-size: 0.85rem;
  color: #1e40af;
  font-weight: 500;
  background: #f0f9ff;
  border-radius: 8px;
}

/* Calculator */
.calc-display {
  background: #fff;
  border: 1px solid #d6cfc4;
  border-radius: 10px;
  padding: 0.75rem;
  text-align: right;
  font-family: var(--font-read,'Literata',Georgia,serif);
  min-height: 3.5rem;
}
.calc-expr {
  font-size: 0.78rem;
  color: #6b665f;
  min-height: 1.2em;
  word-break: break-all;
}
.calc-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #2d2a26;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}
.calc-btn {
  padding: 0.65rem 0;
  border: 1px solid #d6cfc4;
  border-radius: 8px;
  background: #fff;
  font-size: 1rem;
  font-weight: 600;
  color: #2d2a26;
  cursor: pointer;
  transition: background 0.1s;
  text-align: center;
}
.calc-btn:hover { background: #f5f0ea; }
.calc-btn:active { background: #ede8e0; }
.calc-btn.calc-op { background: #f5f0ea; color: var(--accent, #2563eb); }
.calc-btn.calc-op:hover { background: #ede8e0; }
.calc-btn.calc-eq { background: var(--accent, #2563eb); color: #fff; border-color: transparent; }
.calc-btn.calc-eq:hover { opacity: 0.85; }
.calc-btn.calc-clear { color: #dc2626; }

/* Range Finder */
.range-values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.range-val {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 0.5rem 0.75rem;
  background: #f5f0ea;
  border: 1.5px solid #d6cfc4;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #2d2a26;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}
.range-val:hover { background: #ede8e0; }
.range-val.is-high { background: #fee2e2; border-color: #f87171; color: #991b1b; }
.range-val.is-low { background: #dbeafe; border-color: #60a5fa; color: #1e3a5f; }
.range-slots {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}
.range-slot {
  flex: 1;
  text-align: center;
  padding: 0.6rem;
  background: #fff;
  border: 1.5px solid #d6cfc4;
  border-radius: 10px;
}
.range-slot-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.3rem;
}
.range-slot-label.high { color: #dc2626; }
.range-slot-label.low { color: #2563eb; }
.range-slot-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #2d2a26;
  font-family: var(--font-read,'Literata',Georgia,serif);
  min-height: 1.5em;
}
.range-calc {
  text-align: center;
  padding: 0.6rem;
  background: #f0f9ff;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #1e40af;
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.range-mode-btns {
  display: flex;
  gap: 0.4rem;
}
.range-mode-btn {
  flex: 1;
  padding: 0.5rem;
  border: 1.5px solid #d6cfc4;
  border-radius: 8px;
  background: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.range-mode-btn:hover { background: #f5f0ea; }
.range-mode-btn.active-high { background: #fee2e2; border-color: #f87171; color: #991b1b; }
.range-mode-btn.active-low { background: #dbeafe; border-color: #60a5fa; color: #1e3a5f; }

/* ===== MAP LIGHTBOX ===== */
.map-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  cursor: zoom-out;
  padding: 1.5rem;
}
.map-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}
.map-lightbox img {
  max-width: 95vw;
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  object-fit: contain;
}
.map-lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2001;
}
.problem-equation img {
  cursor: zoom-in;
}

/* ===== ENGLISH LANGUAGE: PASSAGE PANEL ===== */

.practice-columns{display:flex;flex:1;overflow:hidden}
.practice-passage-area{flex:1;min-width:0;overflow:hidden;background:#f9f6f0;border-right:1px solid #d6cfc4;display:flex;flex-direction:column}
.passage-a11y-bar{display:flex;align-items:center;gap:0.5rem;padding:0.5rem 1.25rem;border-bottom:1px solid rgba(0,0,0,0.06);flex-shrink:0;background:rgba(0,0,0,0.02);flex-wrap:wrap;justify-content:center}
.passage-a11y-mobile{display:none}
@media(max-width:900px){.passage-a11y-mobile{display:flex}}
.passage-a11y-btn{display:flex;align-items:center;gap:0.3rem;padding:0.25rem 0.55rem;border:1px solid #d6cfc4;border-radius:6px;background:white;cursor:pointer;color:#5a5651;font-size:0.72rem;font-weight:600;font-family:inherit;transition:all 0.15s}
.passage-a11y-btn:hover{border-color:var(--accent);color:var(--accent)}
.passage-a11y-btn[aria-pressed="true"]{background:var(--accent);color:white;border-color:var(--accent)}
.passage-a11y-btn svg{width:13px;height:13px}
.passage-overlay-group{display:flex;align-items:center;gap:0.3rem}
.passage-overlay-label{font-size:0.62rem;color:#766d63;font-weight:600;text-transform:uppercase;letter-spacing:0.04em}
.passage-overlay-btn{width:22px;height:22px;border-radius:50%;border:2px solid #d6cfc4;cursor:pointer;padding:0;transition:border-color 0.2s,transform 0.1s;display:flex;align-items:center;justify-content:center;background:white}
.passage-overlay-btn:hover{transform:scale(1.15)}
.passage-overlay-btn.active{border-color:#2d2a26;box-shadow:0 0 0 2px white,0 0 0 3.5px #2d2a26}
.passage-overlay-btn svg{width:12px;height:12px;color:#999}
.passage-header{padding:1rem 1.5rem 0.5rem;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}
.passage-header-label{font-size:0.65rem;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;color:#8a7e72}
.passage-header-badge{font-size:0.62rem;font-weight:600;color:var(--accent);background:var(--accent-light,#f5f3ff);padding:0.15em 0.55em;border-radius:999px}
.passage-body{padding:1.25rem 2rem 1.5rem;flex:1;overflow:hidden;position:relative}
.passage-body .passage-text{font-family: var(--font-read,'Literata',Georgia,serif);font-size:1rem;line-height:2;color:#3d3630;font-style:normal;text-align:left;transition:font-size 0.3s ease}
.passage-body .passage-text p{margin:0 0 0.9em}.passage-body .passage-text p:last-child{margin-bottom:0}
.learn-full-passage .rs-quote{white-space:pre-line}
/* two texts side by side: no drop capital, or it lands on the first label's "S" */
.passage-body .passage-text:has(> .passage-part)::first-letter{font-size:inherit;font-weight:inherit;color:inherit}
body.dark-mode .passage-body .passage-text:has(> .passage-part)::first-letter{color:inherit}
.passage-part+.passage-part{margin-top:1.6em;padding-top:1.2em;border-top:1px solid rgba(61,54,48,0.14)}
.passage-part-label{font-family:'Schibsted Grotesk', system-ui, sans-serif;font-style:normal;font-size:0.7rem;font-weight:600;letter-spacing:0.06em;text-transform:uppercase;line-height:1.5;color:#6b665f;margin-bottom:0.5em}
body.dark-mode .passage-part+.passage-part{border-top-color:rgba(224,216,208,0.16)}
.passage-body .passage-text::first-letter{font-size:1.4em;font-weight:600;color:#5a5651}
.passage-quote-highlight{background:rgba(124,58,237,0.18);border-bottom:2px solid var(--accent,#7c3aed);padding:1px 2px;border-radius:3px;box-shadow:0 0 0 2px rgba(124,58,237,0.1);box-decoration-break:clone;-webkit-box-decoration-break:clone}
.passage-footer{padding:0.5rem 1.5rem 0.75rem;font-size:0.65rem;color:#766d63;border-top:1px solid rgba(0,0,0,0.06);flex-shrink:0;text-align:right}
/* overlays on passage */
.practice-passage-area.overlay-yellow{background-color:#fef9c3}
.practice-passage-area.overlay-blue{background-color:#dbeafe}
.practice-passage-area.overlay-pink{background-color:#fce7f3}
.practice-passage-area.overlay-green{background-color:#dcfce7}
.practice-passage-area.overlay-peach{background-color:#fed7aa}
.practice-passage-area.overlay-aqua{background-color:#cffafe}
/* Mobile passage tab toggle */
.mobile-passage-tabs{display:none}
@media(max-width:900px){
  .mobile-passage-tabs{display:flex;gap:0;border-bottom:1px solid var(--border-light,#e8e4df);background:#fff;flex-shrink:0}
  .mobile-passage-tab{flex:1;padding:0.55rem 0;font-family:'Schibsted Grotesk', system-ui, sans-serif;font-size:0.78rem;font-weight:600;text-align:center;background:none;border:none;border-bottom:2.5px solid transparent;color:var(--text-muted,#8a8580);cursor:pointer;transition:color 0.2s,border-color 0.2s;position:relative}
  .mobile-passage-tab.active{color:var(--accent,#2563eb);border-bottom-color:var(--accent,#2563eb)}
  .mobile-passage-tab-dot{position:absolute;top:6px;right:calc(50% - 28px);width:7px;height:7px;border-radius:50%;background:var(--accent,#7c3aed);display:none}
  .mobile-passage-tab-dot.visible{display:block;animation:tab-dot-pulse 1s ease-in-out 2}
  @keyframes tab-dot-pulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:0.6;transform:scale(1.4)}}
  body.dark-mode .mobile-passage-tabs{background:var(--sv-night-card);border-color:var(--sv-night-line)}
  .practice-columns{flex-direction:column;overflow:hidden}
  .practice-passage-area{width:100%!important;border-right:none;border-bottom:none;flex:1;overflow-y:auto}
  .practice-columns.mobile-tab-question .practice-passage-area{display:none!important}
  .practice-columns.mobile-tab-extract .content-viewport{display:none!important}
  .passage-body{padding:0.75rem 1rem 1rem;overflow-y:auto}
}

/* ===== ENGLISH LANGUAGE: INPUT TYPES ===== */
/* Traffic Light */
.tl-statements{display:flex;flex-direction:column;gap:0.5rem;margin-bottom:0.5rem}
.tl-stmt{display:flex;align-items:center;gap:0.5rem;padding:0.5rem 0.75rem;background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;font-size:0.82rem;transition:all 0.15s}
.tl-stmt .stmt-text{flex:1}
.tl-btns{display:flex;gap:0.25rem}
.tl-btn{width:28px;height:28px;border-radius:50%;border:2px solid #ddd;background:white;cursor:pointer;font-size:0;transition:all 0.15s;flex-shrink:0}
.tl-btn:hover{transform:scale(1.1)}
.tl-btn.green:hover,.tl-btn.green.selected{background:var(--success);border-color:var(--success)}
.tl-btn.amber:hover,.tl-btn.amber.selected{background:#f59e0b;border-color:#f59e0b}
.tl-btn.red:hover,.tl-btn.red.selected{background:var(--error);border-color:var(--error)}
.tl-stmt.result-correct{border-color:var(--success);background:var(--success-light)}
.tl-stmt.result-incorrect{border-color:var(--error);background:var(--error-light)}
.tl-legend{display:flex;gap:1rem;margin-bottom:0.5rem;font-size:0.72rem;color:#6b665f}
.tl-legend span{display:flex;align-items:center;gap:0.3rem}
.tl-legend .dot{width:12px;height:12px;border-radius:50%}
.tl-legend .dot.g,.tl-legend .dot-green{background:var(--success)}.tl-legend .dot.a,.tl-legend .dot-amber{background:#f59e0b}.tl-legend .dot.r,.tl-legend .dot-red{background:var(--error)}
/* more than three categories: each row names its choice (22 Sep 2026) */
.tl-stmt--named{flex-wrap:wrap;row-gap:0.4rem}
.tl-stmt--named .stmt-text{flex:1 1 55%;min-width:12rem}
.tl-select{flex:1 1 13rem;max-width:100%;font:inherit;font-size:0.8rem;padding:0.35rem 0.5rem;border:2px solid #ddd;border-radius:8px;background:#fff;color:inherit;cursor:pointer}
.tl-select:focus-visible{outline:2px solid var(--accent,#7c3aed);outline-offset:1px}
.tl-select[data-c=green]{border-color:var(--success)}.tl-select[data-c=amber]{border-color:#f59e0b}.tl-select[data-c=red]{border-color:var(--error)}
.tl-select[data-c=blue]{border-color:#2563eb}.tl-select[data-c=purple]{border-color:#7c3aed}.tl-select[data-c=teal]{border-color:#0d9488}.tl-select[data-c=orange]{border-color:#ea580c}.tl-select[data-c=pink]{border-color:#db2777}
.tl-select:disabled{cursor:default;opacity:1}
body.dark-mode .tl-select{background:var(--sv-night-card);color:var(--sv-night-ink)}
body.dark-mode .tl-select:not([data-c]){border-color:var(--sv-night-line)}
.tl-legend .dot-blue{background:#2563eb}.tl-legend .dot-purple{background:#7c3aed}.tl-legend .dot-teal{background:#0d9488}.tl-legend .dot-orange{background:#ea580c}.tl-legend .dot-pink{background:#db2777}
.tl-btn.tl-c-green:hover,.tl-btn.tl-c-green.selected{background:var(--success);border-color:var(--success)}
.tl-btn.tl-c-amber:hover,.tl-btn.tl-c-amber.selected{background:#f59e0b;border-color:#f59e0b}
.tl-btn.tl-c-red:hover,.tl-btn.tl-c-red.selected{background:var(--error);border-color:var(--error)}
.tl-btn.tl-c-blue:hover,.tl-btn.tl-c-blue.selected{background:#2563eb;border-color:#2563eb}
.tl-btn.tl-c-purple:hover,.tl-btn.tl-c-purple.selected{background:#7c3aed;border-color:#7c3aed}
.tl-btn.tl-c-teal:hover,.tl-btn.tl-c-teal.selected{background:#0d9488;border-color:#0d9488}
.tl-btn.tl-c-orange:hover,.tl-btn.tl-c-orange.selected{background:#ea580c;border-color:#ea580c}
.tl-btn.tl-c-pink:hover,.tl-btn.tl-c-pink.selected{background:#db2777;border-color:#db2777}
/* Highlight Evidence */
.hl-passage{line-height:2;font-family: var(--font-read,'Literata',Georgia,serif);font-size:0.92rem;user-select:none;-webkit-user-select:none}
.hl-para{margin:0 0 0.75em}.hl-para:last-child{margin-bottom:0}
.hw{cursor:pointer;padding:1px 0;border-radius:2px;transition:background 0.1s}
.hw:hover{background:rgba(124,58,237,0.08)}
.hw.selected{background:rgba(124,58,237,0.2);border-bottom:2px solid var(--accent,#7c3aed)}
.hw.correct{background:rgba(22,163,74,0.2);border-bottom:2px solid var(--success)}
.hw.incorrect{background:rgba(220,38,38,0.15);border-bottom:2px solid var(--error)}
.hw.was-answer{border-bottom:2px dashed var(--success)}
/* Connotation Picker */
.cp-chips{display:flex;flex-wrap:wrap;gap:0.4rem;margin-top:0.5rem}
.cp-chip{padding:0.4rem 0.85rem;border:2px solid #e5e7eb;border-radius:8px;cursor:pointer;font-size:0.82rem;font-weight:500;background:white;transition:all 0.15s;user-select:none}
.cp-chip:hover{border-color:#c4b5fd}
.cp-chip.selected{border-color:var(--accent,#7c3aed);background:var(--accent-light,#f5f3ff);color:var(--accent,#7c3aed)}
.cp-chip.result-correct{border-color:var(--success);background:var(--success-light);color:#166534}
.cp-chip.result-incorrect{border-color:var(--error);background:var(--error-light);color:#991b1b}
.cp-chip.result-missed{border-color:#f59e0b;background:#fffbeb;color:#92400e}
/* Evidence Match */
.em-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
.em-col-label{font-size:0.65rem;font-weight:700;text-transform:uppercase;letter-spacing:0.04em;color:#6b665f;margin-bottom:0.4rem}
.em-item{padding:0.5rem 0.75rem;border:2px solid #e5e7eb;border-radius:10px;font-size:0.78rem;cursor:pointer;transition:all 0.15s;margin-bottom:0.4rem;position:relative}
.em-item:hover{border-color:#c4b5fd}
.em-item.active{border-color:var(--accent,#7c3aed);background:var(--accent-light,#f5f3ff)}
.em-item.paired{opacity:0.85}
.em-pair-badge{position:absolute;top:-6px;right:-6px;width:20px;height:20px;border-radius:50%;color:white;font-size:0.65rem;font-weight:700;display:flex;align-items:center;justify-content:center}
.em-item.result-correct{border-color:var(--success);background:var(--success-light)}
.em-item.result-incorrect{border-color:var(--error);background:var(--error-light)}
.pair-c-0{background:#7c3aed}.pair-c-1{background:#0891b2}.pair-c-2{background:#ea580c}.pair-c-3{background:#16a34a}
/* AI Mark / AI Write */
.rs-quote{font-family: var(--font-read,'Literata',Georgia,serif);font-style:italic;font-size:1rem;padding:0.75rem 1rem;background:var(--accent-light,#f5f3ff);border-radius:10px;margin-bottom:0.75rem}
.rs-textarea{width:100%;border:1px solid #ddd;border-radius:10px;padding:0.65rem 0.85rem;font-size:0.88rem;font-family:inherit;resize:vertical;min-height:80px;transition:border-color 0.15s;box-sizing:border-box}
.rs-textarea:focus{outline:none;border-color:#c4b5fd;box-shadow:0 0 0 2px rgba(124,58,237,0.08)}
.ai-badge{font-size:0.65rem;color:#6b665f;margin-top:0.35rem;font-style:italic}
.ai-spinner{display:inline-block;width:14px;height:14px;border:2px solid #e5e7eb;border-top-color:var(--accent,#7c3aed);border-radius:50%;animation:aispin 0.6s linear infinite;vertical-align:-2px;margin-right:0.3rem}
@keyframes aispin{to{transform:rotate(360deg)}}
/* Misleading Summary */
.ms-summary{font-size:0.85rem;line-height:1.7;background:#f9fafb;border:1px solid var(--border-light,#e8e4df);border-radius:12px;padding:1rem 1.25rem;margin-top:0.5rem}
.ms-instructions{font-size:0.78rem;color:#6b665f;margin-bottom:0.25rem}
.ms-span{cursor:pointer;padding:1px 2px;border-radius:3px;transition:all 0.15s}
.ms-span:hover{background:rgba(124,58,237,0.06)}
.ms-span.flagged{background:rgba(220,38,38,0.1);text-decoration-color:var(--error)}
.ms-span.result-correct-flag{background:rgba(22,163,74,0.15);text-decoration-color:var(--success)}
.ms-span.result-missed{background:rgba(245,158,11,0.15);text-decoration-color:#f59e0b}
.ms-span.result-wrong-flag{background:rgba(220,38,38,0.1);text-decoration-color:var(--error)}
/* Reorder */
.reorder-items{display:flex;flex-direction:column;gap:0.4rem}
.reorder-item{display:flex;align-items:center;gap:0.5rem;padding:0.55rem 0.75rem;background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;font-size:0.82rem;cursor:pointer;transition:all 0.15s;user-select:none}
.reorder-item:hover{border-color:#c4b5fd}
.reorder-num{width:22px;height:22px;border-radius:50%;background:#e5e7eb;color:#6b665f;font-size:0.65rem;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:all 0.15s}
.reorder-item.numbered .reorder-num{background:var(--accent,#7c3aed);color:white}
.reorder-item.result-correct{border-color:var(--success);background:var(--success-light)}
.reorder-item.result-incorrect{border-color:var(--error);background:var(--error-light)}
/* Improve Sentence */
.improve-original{font-family: var(--font-read,'Literata',Georgia,serif);font-style:italic;padding:0.75rem 1rem;background:#fef2f2;border-radius:10px;margin-bottom:0.75rem;font-size:0.95rem}
/* Spot Error */
.spot-text{font-size:0.88rem;line-height:1.8;margin-top:0.5rem}
/* line breaks in the text are kept: a question about letter FORMAT ("Hi headteacher,"
   on its own line) was printed as one run-on block, hiding the thing it tested */
.spot-text{white-space:pre-line}
/* no underline under every word: a word is marked when it is tapped (job S5-27, 158.4) */
.spot-token{cursor:pointer;padding:1px 0;border-radius:3px;transition:all 0.15s}
.spot-token:hover{background:rgba(124,58,237,0.06)}
.spot-token.flagged{background:rgba(220,38,38,0.12);text-decoration:line-through;text-decoration-color:var(--error)}
.spot-token.result-correct{background:rgba(22,163,74,0.15)}
.spot-token.result-missed{background:rgba(245,158,11,0.15)}
.spot-token.result-wrong{background:rgba(220,38,38,0.1)}
/* Accent Bar (shared). A key is 44px with 8px to the next at every size, as every button of the site (css/buttons.css):
   a tablet had 30px keys 4px apart (job S5-13); a phone's keys were made 44px by job S3-10 (the 600px block below) */
.accent-bar{display:flex;flex-wrap:wrap;gap:8px;margin:0.5rem 0}
.accent-btn{flex:none;width:44px;height:44px;border:1px solid #e5e7eb;border-radius:10px;background:white;cursor:pointer;font-size:1.1rem;font-weight:500;transition:all 0.12s;padding:0}
.accent-btn:hover{border-color:var(--accent,#7c3aed);background:var(--accent-light,#f5f3ff)}
/* Vocab Match */
.vm-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
.vm-col-label{font-size:0.65rem;font-weight:700;text-transform:uppercase;letter-spacing:0.04em;color:#6b665f;margin-bottom:0.4rem}
.vm-item{padding:0.5rem 0.75rem;border:2px solid #e5e7eb;border-radius:10px;font-size:0.82rem;cursor:pointer;transition:all 0.2s;margin-bottom:0.4rem;user-select:none;text-align:center}
.vm-item:hover{border-color:#c4b5fd}
.vm-item.vm-selected{border-color:var(--accent,#7c3aed);background:var(--accent-light,#f5f3ff)}
.vm-item.vm-correct{border-color:var(--success);background:var(--success-light);animation:vm-flash 0.4s ease}
.vm-item.vm-wrong{border-color:var(--error);background:var(--error-light);animation:shake 0.3s ease}
.vm-item.vm-matched{opacity:0.3;pointer-events:none;transform:scale(0.95)}
.vm-matched-list{margin-top:0.75rem}
.vm-matched-pair{display:flex;align-items:center;gap:0.5rem;font-size:0.78rem;padding:0.25rem 0;color:#6b665f}
.vm-mp-left{font-weight:600;color:var(--text-primary,#2d2a26)}
.vm-mp-arrow{color:#c4b5fd}
.vm-mp-right{color:var(--text-primary,#2d2a26)}
@keyframes vm-flash{0%{transform:scale(1)}50%{transform:scale(1.04)}100%{transform:scale(1)}}
@keyframes shake{0%,100%{transform:translateX(0)}20%{transform:translateX(-4px)}40%{transform:translateX(4px)}60%{transform:translateX(-3px)}80%{transform:translateX(3px)}}
/* Gap Fill */
.gf-english{font-size:0.85rem;color:#6b665f;margin-bottom:0.5rem;padding:0.5rem 0.75rem;background:#f9fafb;border-radius:8px}
.gf-english-label{font-weight:600;color:var(--text-primary,#2d2a26)}
.gf-sentence{font-size:0.95rem;line-height:2.2;margin-bottom:0.5rem}
.gf-gap{display:inline-block;min-width:60px;border-bottom:2px dashed #c4b5fd;padding:2px 6px;margin:0 2px;cursor:pointer;text-align:center;font-weight:600;transition:all 0.15s;border-radius:4px}
.gf-gap.gf-active{border-bottom-color:var(--accent,#7c3aed);background:var(--accent-light,#f5f3ff)}
.gf-gap.gf-filled{border-bottom-style:solid;color:var(--accent,#7c3aed)}
.gf-gap.gf-correct{border-bottom-color:var(--success);background:var(--success-light);color:#166534}
.gf-gap.gf-wrong{border-bottom-color:var(--error);background:var(--error-light);color:#991b1b}
.gf-input{border:none;border-bottom:2px dashed #c4b5fd;padding:2px 6px;font-size:0.92rem;font-family:inherit;width:80px;text-align:center;background:transparent;outline:none;transition:border-color 0.15s}
.gf-input:focus{border-bottom-color:var(--accent,#7c3aed);border-bottom-style:solid}
.gf-input.gf-correct{border-bottom-color:var(--success);color:#166534}
.gf-input.gf-wrong{border-bottom-color:var(--error);color:#991b1b}
.gf-bank{display:flex;flex-wrap:wrap;gap:0.35rem;margin-top:0.5rem}
.gf-chip{padding:0.35rem 0.75rem;border:1px solid #e5e7eb;border-radius:8px;cursor:pointer;font-size:0.82rem;font-weight:500;background:white;transition:all 0.15s;user-select:none}
.gf-chip:hover{border-color:var(--accent,#7c3aed);background:var(--accent-light,#f5f3ff)}
.gf-chip.gf-used{opacity:0.35;pointer-events:none}
.gf-rule-tag{display:inline-block;background:var(--accent-light,#f5f3ff);color:var(--accent,#7c3aed);font-size:0.7rem;font-weight:600;padding:0.15rem 0.5rem;border-radius:10px;margin-left:0.25rem}
/* Translate */
.tr-direction{display:flex;align-items:center;gap:0.5rem;margin-bottom:0.75rem}
.tr-badge{display:inline-block;padding:0.25rem 0.6rem;background:#f1f5f9;border-radius:8px;font-size:0.78rem;font-weight:600}
.tr-arrow{color:#6b665f;font-size:1rem}
.tr-source{font-family: var(--font-read,'Literata',Georgia,serif);font-size:1rem;padding:0.75rem 1rem;background:var(--accent-light,#f5f3ff);border-radius:10px;margin-bottom:0.75rem}
.tr-hints{font-size:0.8rem;margin-bottom:0.5rem}
.tr-hints summary{cursor:pointer;color:var(--accent,#7c3aed);font-weight:500}
.tr-hints ul{margin:0.3rem 0 0 1rem;color:#6b665f}
/* Dictation */
.dt-audio-area{display:flex;align-items:center;gap:0.75rem;margin-bottom:0.75rem}
.dt-play-btn{width:48px;height:48px;border-radius:50%;border:2px solid var(--accent,#7c3aed);background:white;color:var(--accent,#7c3aed);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all 0.15s;flex-shrink:0}
.dt-play-btn:hover{background:var(--accent-light,#f5f3ff)}
.dt-play-btn.dt-disabled{opacity:0.35;cursor:not-allowed}
.dt-play-count{font-size:0.78rem;color:#6b665f}
.dt-diff{line-height:1.8;margin:0.5rem 0}
.dt-word-correct{color:var(--success);font-weight:500}
.dt-word-wrong{color:var(--error);font-weight:500;text-decoration:line-through}
.dt-word-missing{color:#f59e0b;font-weight:500;text-decoration:underline;text-decoration-style:dashed}
.dt-word-extra{color:#6b665f;text-decoration:line-through}
/* Sentence Builder */
.sb-english{font-size:0.85rem;color:#6b665f;margin-bottom:0.5rem;padding:0.5rem 0.75rem;background:#f9fafb;border-radius:8px}
.sb-english-label{font-weight:600;color:var(--text-primary,#2d2a26)}
.sb-answer-zone{min-height:48px;border:2px dashed #e5e7eb;border-radius:12px;padding:0.5rem;display:flex;flex-wrap:wrap;gap:0.35rem;margin-bottom:0.75rem;transition:border-color 0.15s}
.sb-answer-zone:empty::before{content:'Tap words to build the sentence';color:#c4b5fd;font-size:0.78rem;padding:0.25rem}
.sb-placed-tile{padding:0.35rem 0.7rem;background:var(--accent-light,#f5f3ff);border:1px solid var(--accent,#7c3aed);border-radius:8px;font-size:0.82rem;cursor:pointer;transition:all 0.15s;user-select:none}
.sb-placed-tile:hover{background:rgba(124,58,237,0.12)}
.sb-placed-tile.sb-correct-tile{border-color:var(--success);background:var(--success-light);color:#166534}
.sb-placed-tile.sb-wrong-tile{border-color:var(--error);background:var(--error-light);color:#991b1b}
.sb-tile-bank{display:flex;flex-wrap:wrap;gap:0.35rem;margin-bottom:0.5rem}
.sb-tile{padding:0.35rem 0.7rem;border:1px solid #e5e7eb;border-radius:8px;cursor:pointer;font-size:0.82rem;font-weight:500;background:white;transition:all 0.15s;user-select:none}
.sb-tile:hover{border-color:var(--accent,#7c3aed);background:var(--accent-light,#f5f3ff)}
.sb-tile.sb-used{opacity:0.3;pointer-events:none}
.sb-tile.sb-distractor-reveal{border-color:#f59e0b;background:#fffbeb;opacity:0.7;text-decoration:line-through}
.sb-clear-btn{margin-top:0.25rem}   /* a quiet button (css/buttons.css, job S3-02) */
/* Spot & Correct */
.sc-sentence{font-size:0.95rem;line-height:2;margin-bottom:0.5rem}
.sc-word{cursor:pointer;padding:1px 3px;border-radius:3px;transition:all 0.15s}
.sc-word:hover{background:rgba(124,58,237,0.06)}
.sc-word.sc-selected{background:rgba(220,38,38,0.15);border-bottom:2px solid var(--error);font-weight:600}
.sc-word.sc-wrong-select{animation:shake 0.3s ease}
.sc-correction{margin-top:0.75rem;padding:0.75rem;background:#f9fafb;border-radius:10px;border:1px solid #e5e7eb}
.sc-correction-label{font-size:0.78rem;font-weight:600;color:#6b665f;display:block;margin-bottom:0.35rem}
.sc-correction-input{width:100%;border:1px solid #ddd;border-radius:8px;padding:0.5rem 0.75rem;font-size:0.88rem;font-family:inherit;box-sizing:border-box;transition:border-color 0.15s}
.sc-correction-input:focus{outline:none;border-color:var(--accent,#7c3aed);box-shadow:0 0 0 2px rgba(124,58,237,0.08)}
/* Role Play */
.rp-scenario{display:flex;gap:0.75rem;padding:0.75rem 1rem;background:var(--accent-light,#f5f3ff);border:1px solid #e5e7eb;border-radius:12px;margin-bottom:0.75rem;align-items:flex-start}
.rp-icon{font-size:1.5rem;flex-shrink:0}
.rp-scenario-text{font-size:0.88rem;line-height:1.5}
.rp-bullets{display:flex;flex-direction:column;gap:0.75rem;margin-bottom:0.5rem}
.rp-bullet{display:flex;gap:0.75rem;align-items:flex-start}
.rp-bullet-num{width:24px;height:24px;border-radius:50%;background:var(--accent,#7c3aed);color:white;font-size:0.7rem;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:0.1rem}
.rp-bullet-content{flex:1}
.rp-prompt{font-size:0.85rem;font-weight:500;margin-bottom:0.35rem}
.rp-note{font-size:0.72rem;color:#6b665f;font-style:italic;margin-bottom:0.35rem}
.rp-input{width:100%;border:1px solid #e5e7eb;border-radius:8px;padding:0.5rem 0.75rem;font-size:0.85rem;font-family:inherit;box-sizing:border-box;transition:border-color 0.15s}
.rp-input:focus{outline:none;border-color:var(--accent,#7c3aed);box-shadow:0 0 0 2px rgba(124,58,237,0.08)}
.rp-model-answers{border-top:1px solid #e5e7eb;padding-top:0.5rem;margin-top:0.5rem}
@media(max-width:600px){
  .vm-grid{grid-template-columns:1fr}
  .sb-tile-bank{gap:0.25rem}
  .sb-tile,.sb-placed-tile{font-size:0.78rem;padding:0.3rem 0.55rem}
}
/* Question text (vs maths equation) */
.problem-question-text{font-family:'Schibsted Grotesk', system-ui, sans-serif!important;font-size:1rem!important;font-weight:600!important;text-align:left!important;line-height:1.5!important}
.problem-question-hint{font-size:0.78rem;color:#6b665f;margin-bottom:0.5rem;font-style:italic}
@media(max-width:600px){
  .em-grid{grid-template-columns:1fr}
  .tl-legend{flex-wrap:wrap;gap:0.5rem}
}

/* ===== DARK MODE TOGGLE BUTTON ===== */
/* The report and tour buttons arrive as position:fixed buttons from bug-reporter.js and the tour; js adopts them into
   the Lesson Tools (#score-bar-utils, in the "Reading and help" section), where each is a row with its name. An id
   selector and !important: bug-reporter.js adds its own stylesheet to <head> at run time, after these rules. */
#score-bar-utils > * {
  position: static !important; inset: auto !important; transform: none !important; box-shadow: none !important;
  display: flex !important; align-items: center; justify-content: flex-start; gap: 0.7rem;
  width: auto !important; height: auto !important; min-width: 0 !important; min-height: 44px !important; margin: 0 -0.4rem !important; padding: 0 0.4rem !important;
  border: 0 !important; border-radius: 8px !important; background: transparent !important; cursor: pointer; text-align: left;
  font: 500 0.94rem 'Schibsted Grotesk', system-ui, sans-serif !important; color: var(--text-primary, #2d2a26) !important;
}
#score-bar-utils > *:hover { background: rgba(60, 45, 20, 0.05) !important; }
#score-bar-utils svg { flex: 0 0 auto; width: 18px !important; height: 18px !important; color: var(--text-secondary, #5a5651); }
#score-bar-utils > * > span:not(.sr-only) { display: none !important; }
#score-bar-utils > .bugr-fab::after { content: 'Report a problem'; }
#score-bar-utils > .sv-tour-replay::after { content: 'Show me around'; }   /* svName('tour'), js/util.js */
body.dark-mode #score-bar-utils > * { color: var(--sv-night-ink) !important; }

.dark-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-light, #e8e4df);
  background: transparent;
  cursor: pointer;
  color: var(--text-muted, #6b665f);
  flex-shrink: 0;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  padding: 0;
}
.dark-mode-toggle:hover {
  color: var(--accent, #2563eb);
  border-color: var(--accent, #2563eb);
}
.dark-mode-toggle svg { width: 16px; height: 16px; }
.dark-mode-toggle[aria-pressed="true"] {
  color: #fbbf24;
  border-color: #fbbf24;
  background: rgba(251,191,36,0.1);
}

/* ===== DARK MODE ===== */
body.dark-mode {
  --bg-body: var(--sv-night-page);
  --bg-card: var(--sv-night-card);
  --text-primary: var(--sv-night-ink);
  --text-secondary: var(--sv-night-sec);
  --text-muted: var(--sv-night-mut);
  --border-light: var(--sv-night-line);
  --border-lighter: var(--sv-night-linel);
  --panel-bg: var(--sv-night-card);
  --success-light: #0a2e1a;
  --error-light: #2e1a1a;
  background-color: var(--bg-body);
  color: var(--text-primary);
}
body.dark-mode .page-header {
  background: linear-gradient(to right,
    var(--sv-night-card) calc(var(--panel-width) - 1px),
    var(--sv-night-line) calc(var(--panel-width) - 1px),
    var(--sv-night-line) var(--panel-width),
    var(--sv-night-card) var(--panel-width)) !important;
  border-bottom-color: var(--sv-night-line);
}
body.dark-mode .practice-main { background: var(--sv-night-page); }
body.dark-mode .practice-panel { background: var(--sv-night-card); }
body.dark-mode .panel-section { background: var(--sv-night-card); border-color: var(--sv-night-line); }
body.dark-mode .practice-score-bar { background: var(--sv-night-card); border-color: var(--sv-night-line); }
body.dark-mode .problem-card { background: var(--sv-night-card); border-color: var(--sv-night-line); box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
body.dark-mode .problem-card.card-correct { border-color: #166534; box-shadow: 0 4px 20px rgba(22,163,74,0.12); }
body.dark-mode .problem-card.card-incorrect { border-color: #991b1b; box-shadow: 0 4px 20px rgba(220,38,38,0.12); }
body.dark-mode .learn-card { background: var(--sv-night-card); border-color: var(--sv-night-line); box-shadow: 0 2px 12px rgba(0,0,0,0.2); }
body.dark-mode .learn-step.is-answer.revealed { background: #0a2e1a; border-left-color: #166534; }
body.dark-mode .summary-modal { background: var(--sv-night-card); box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
body.dark-mode .method-modal { background: var(--sv-night-card); box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
body.dark-mode .method-modal-close { background: var(--sv-night-card); border-color: var(--sv-night-line); }
body.dark-mode .problem-input { background: var(--sv-night-page); border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .problem-input:focus { background: var(--sv-night-card); }
/* The guided walks use .guided-input, which had no dark rule, so every box
   in a walk rendered as a stark white block on the dark card. */
body.dark-mode .guided-input {
  background: var(--sv-night-page); border-color: color-mix(in srgb, var(--sv-night-line) 60%, var(--sv-night-mut)); color: var(--sv-night-ink);
}
body.dark-mode .guided-input:focus { background: var(--sv-night-card); border-color: var(--accent); }
body.dark-mode .guided-input:disabled { background: color-mix(in srgb, var(--sv-night-card) 60%, var(--sv-night-line)); color: var(--sv-night-sec); }
/* Tier badges kept their light parchment fill against the dark bar. */
body.dark-mode .score-bar-tier-badge.tier-is-bronze { background: rgba(180,83,9,0.22); color: #e8b384; }
body.dark-mode .score-bar-tier-badge.tier-is-silver { background: rgba(148,163,184,0.20); color: #cbd5e1; }
body.dark-mode .score-bar-tier-badge.tier-is-gold   { background: rgba(202,138,4,0.22); color: #f0cf7a; }
/* practice-loader sets this pill's colour and background inline from the
   unit accent, which is a light-background badge tint, so it washed out to
   unreadable on the dark bar. Inline styles need !important to override. */
body.dark-mode #header-unit-label {
  background: rgba(255,255,255,0.10) !important;
  color: var(--sv-night-ink) !important;
}
body.dark-mode .score-bar-examples-btn { border-color: var(--sv-night-line); color: var(--sv-night-sec); }
body.dark-mode .score-bar-examples-btn:hover { border-color: var(--accent); color: var(--accent); }
body.dark-mode .mc-option { background: var(--sv-night-page); border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .mc-option:hover { background: var(--accent-light, #1a2040); }
body.dark-mode .mc-option.selected { background: var(--accent-badge, #202a4a); }
body.dark-mode .fraction-num, body.dark-mode .fraction-den { background: var(--sv-night-page); border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .fraction-num:focus, body.dark-mode .fraction-den:focus { background: var(--sv-night-card); }
body.dark-mode .sf-a, body.dark-mode .sf-n { background: var(--sv-night-page); border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .sf-a:focus, body.dark-mode .sf-n:focus { background: var(--sv-night-card); }
body.dark-mode .panel-toggle-btn { background: var(--sv-night-card); border-color: var(--sv-night-line); color: var(--sv-night-sec); }
body.dark-mode .feedback-correct { background: #0a2e1a; border-color: #166534; }
body.dark-mode .feedback-incorrect { background: #2e1a1a; border-color: #991b1b; }
body.dark-mode .feedback-correct .feedback-icon { background: #14532d; }
body.dark-mode .feedback-incorrect .feedback-icon { background: #7f1d1d; }
body.dark-mode .misconception-tip { background: #332d1f; border-left-color: #d97706; }
body.dark-mode .misconception-tip strong { color: #fbbf24; }
body.dark-mode .feedback-simplify { background: #332d1f; border-left-color: #d97706; }
body.dark-mode .feedback-why { background: rgba(255,255,255,0.055); }
body.dark-mode .problem-chart-container { background: var(--sv-night-card); border-color: var(--sv-night-line); }
body.dark-mode .tier-progress-track { background: var(--sv-night-line); }
body.dark-mode .summary-tier-bar { background: var(--sv-night-line); }
body.dark-mode .problem-calc-pill.calc-no { color: #fbbf24; background: #332d1f; }
body.dark-mode .problem-calc-pill.calc-yes { color: #5eead4; background: #042f2e; }
body.dark-mode .method-modal-steps li { border-bottom-color: rgba(255,255,255,0.06); }
body.dark-mode .panel-method-content { border-bottom-color: rgba(255,255,255,0.06); }
body.dark-mode .panel-method-steps li { border-bottom-color: rgba(255,255,255,0.06); }
body.dark-mode .sidebar-collapsible { border-color: var(--sv-night-line); }
body.dark-mode .sidebar-collapsible-toggle { color: var(--sv-night-ink); }
body.dark-mode .sidebar-collapsible-toggle:hover { background: var(--accent-light, #1a2040); }
body.dark-mode .sidebar-media-item { border-top-color: rgba(255,255,255,0.05); }
body.dark-mode .sidebar-media-item:hover { background: var(--accent-light, #1a2040); }
body.dark-mode .sidebar-media-item strong { color: var(--sv-night-ink); }
body.dark-mode .sidebar-media-item span { color: var(--sv-night-mut); }
/* Passage panel dark mode */
body.dark-mode .practice-passage-area { background: var(--sv-night-card); border-right-color: var(--sv-night-line); }
body.dark-mode .passage-body .passage-text { color: var(--sv-night-ink); }
body.dark-mode .passage-body .passage-text::first-letter { color: var(--sv-night-sec); }
body.dark-mode .passage-header-label { color: var(--sv-night-sec); }
body.dark-mode .passage-footer { color: var(--sv-night-mut); border-top-color: rgba(255,255,255,0.06); }
body.dark-mode .passage-a11y-bar { border-bottom-color: rgba(255,255,255,0.06); background: rgba(255,255,255,0.02); }
body.dark-mode .passage-a11y-btn { background: var(--sv-night-card); border-color: var(--sv-night-line); color: var(--sv-night-sec); }
body.dark-mode .passage-overlay-btn { background: var(--sv-night-card); border-color: var(--sv-night-line); }
body.dark-mode .passage-overlay-btn.active { border-color: var(--sv-night-ink); box-shadow: 0 0 0 2px var(--sv-night-card), 0 0 0 3.5px var(--sv-night-ink); }
body.dark-mode .passage-overlay-label { color: var(--sv-night-mut); }
body.dark-mode .passage-quote-highlight { background: rgba(124,58,237,0.25); }
/* Passage overlays in dark mode */
body.dark-mode .practice-passage-area.overlay-yellow { background-color: #2e2b1a; }
body.dark-mode .practice-passage-area.overlay-blue   { background-color: #1a2030; }
body.dark-mode .practice-passage-area.overlay-pink   { background-color: #2e1a26; }
body.dark-mode .practice-passage-area.overlay-green  { background-color: #1a2e1f; }
body.dark-mode .practice-passage-area.overlay-peach  { background-color: #2e241a; }
body.dark-mode .practice-passage-area.overlay-aqua   { background-color: #1a2a2e; }
/* English input types dark mode */
body.dark-mode .tl-stmt { background: var(--sv-night-card); border-color: var(--sv-night-line); }
body.dark-mode .tl-btn { background: var(--sv-night-card); border-color: color-mix(in srgb, var(--sv-night-line) 60%, var(--sv-night-mut)); }
body.dark-mode .tl-legend { color: var(--sv-night-mut); }
body.dark-mode .tl-stmt.result-correct { background: #0a2e1a; border-color: #166534; }
body.dark-mode .tl-stmt.result-incorrect { background: #2e1a1a; border-color: #991b1b; }
body.dark-mode .cp-chip { background: var(--sv-night-card); border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .cp-chip:hover { border-color: #7c3aed; }
body.dark-mode .cp-chip.result-correct { background: #0a2e1a; border-color: #166534; color: #86efac; }
body.dark-mode .cp-chip.result-incorrect { background: #2e1a1a; border-color: #991b1b; color: #fca5a5; }
body.dark-mode .cp-chip.result-missed { background: #332d1f; border-color: #b45309; color: #fbbf24; }
body.dark-mode .em-item { border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .em-item:hover { border-color: #7c3aed; }
body.dark-mode .em-item.active { background: var(--accent-light, #1a2040); }
body.dark-mode .em-item.result-correct { background: #0a2e1a; border-color: #166534; }
body.dark-mode .em-item.result-incorrect { background: #2e1a1a; border-color: #991b1b; }
body.dark-mode .rs-quote { background: var(--accent-light, #1a2040); }
body.dark-mode .rs-textarea { background: var(--sv-night-page); border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .rs-textarea:focus { border-color: #7c3aed; }
body.dark-mode .ms-summary { background: var(--sv-night-card); border-color: var(--sv-night-line); }
body.dark-mode .reorder-item { background: var(--sv-night-card); border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .reorder-item:hover { border-color: #7c3aed; }
body.dark-mode .reorder-num { background: var(--sv-night-line); color: var(--sv-night-mut); }
body.dark-mode .reorder-item.result-correct { background: #0a2e1a; border-color: #166534; }
body.dark-mode .reorder-item.result-incorrect { background: #2e1a1a; border-color: #991b1b; }
body.dark-mode .improve-original { background: #2e1a1a; border-left-color: #991b1b; }
body.dark-mode .spot-text { color: var(--sv-night-ink); }
body.dark-mode .hl-passage { color: var(--sv-night-ink); }
body.dark-mode .hw:hover { background: rgba(124,58,237,0.15); }
body.dark-mode .ms-instructions { color: var(--sv-night-mut); }
body.dark-mode .ai-badge { color: var(--sv-night-mut); }
body.dark-mode .problem-question-hint { color: var(--sv-night-mut); }
body.dark-mode .em-col-label { color: var(--sv-night-mut); }
/* New language input types dark mode */
body.dark-mode .accent-btn { background: var(--sv-night-card); border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .accent-btn:hover { border-color: #7c3aed; background: var(--accent-light, #1a2040); }
body.dark-mode .vm-item { background: var(--sv-night-card); border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .vm-item:hover { border-color: #7c3aed; }
body.dark-mode .vm-item.vm-selected { background: var(--accent-light, #1a2040); }
body.dark-mode .vm-item.vm-correct { background: #0a2e1a; border-color: #166534; }
body.dark-mode .vm-item.vm-wrong { background: #2e1a1a; border-color: #991b1b; }
body.dark-mode .vm-col-label { color: var(--sv-night-mut); }
body.dark-mode .vm-mp-left, body.dark-mode .vm-mp-right { color: var(--sv-night-ink); }
body.dark-mode .gf-english { background: var(--sv-night-card); color: var(--sv-night-sec); }
body.dark-mode .gf-english-label { color: var(--sv-night-ink); }
body.dark-mode .gf-gap { border-bottom-color: color-mix(in srgb, var(--sv-night-line) 60%, var(--sv-night-mut)); }
body.dark-mode .gf-gap.gf-active { border-bottom-color: #7c3aed; background: var(--accent-light, #1a2040); }
body.dark-mode .gf-gap.gf-filled { color: #c4b5fd; }
body.dark-mode .gf-gap.gf-correct { background: #0a2e1a; border-bottom-color: #166534; color: #86efac; }
body.dark-mode .gf-gap.gf-wrong { background: #2e1a1a; border-bottom-color: #991b1b; color: #fca5a5; }
body.dark-mode .gf-input { border-bottom-color: color-mix(in srgb, var(--sv-night-line) 60%, var(--sv-night-mut)); color: var(--sv-night-ink); }
body.dark-mode .gf-input:focus { border-bottom-color: #7c3aed; }
body.dark-mode .gf-input.gf-correct { border-bottom-color: #166534; color: #86efac; }
body.dark-mode .gf-input.gf-wrong { border-bottom-color: #991b1b; color: #fca5a5; }
body.dark-mode .gf-chip { background: var(--sv-night-card); border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .gf-chip:hover { border-color: #7c3aed; }
body.dark-mode .gf-rule-tag { background: var(--accent-light, #1a2040); }
body.dark-mode .tr-badge { background: var(--sv-night-card); color: var(--sv-night-ink); }
body.dark-mode .tr-source { background: var(--accent-light, #1a2040); }
body.dark-mode .tr-hints summary { color: #c4b5fd; }
body.dark-mode .tr-hints ul { color: var(--sv-night-mut); }
body.dark-mode .dt-play-btn { background: var(--sv-night-card); border-color: #7c3aed; color: #c4b5fd; }
body.dark-mode .dt-play-btn:hover { background: var(--accent-light, #1a2040); }
body.dark-mode .dt-speed-btn { background: var(--sv-night-card); border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .dt-speed-btn:hover { border-color: #7c3aed; }
body.dark-mode .sb-english { background: var(--sv-night-card); color: var(--sv-night-sec); }
body.dark-mode .sb-english-label { color: var(--sv-night-ink); }
body.dark-mode .sb-answer-zone { border-color: var(--sv-night-line); }
body.dark-mode .sb-answer-zone:empty::before { color: color-mix(in srgb, var(--sv-night-line) 60%, var(--sv-night-mut)); }
body.dark-mode .sb-placed-tile { background: var(--accent-light, #1a2040); border-color: #7c3aed; color: var(--sv-night-ink); }
body.dark-mode .sb-placed-tile.sb-correct-tile { background: #0a2e1a; border-color: #166534; color: #86efac; }
body.dark-mode .sb-placed-tile.sb-wrong-tile { background: #2e1a1a; border-color: #991b1b; color: #fca5a5; }
body.dark-mode .sb-tile { background: var(--sv-night-card); border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .sb-tile:hover { border-color: #7c3aed; }
body.dark-mode .sb-tile.sb-distractor-reveal { background: #332d1f; border-color: #b45309; }
body.dark-mode .sc-sentence { color: var(--sv-night-ink); }
body.dark-mode .sc-word:hover { background: rgba(124,58,237,0.15); }
body.dark-mode .sc-word.sc-selected { background: rgba(220,38,38,0.2); }
body.dark-mode .sc-correction { background: var(--sv-night-card); border-color: var(--sv-night-line); }
body.dark-mode .sc-correction-input { background: var(--sv-night-page); border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .sc-correction-input:focus { border-color: #7c3aed; }
body.dark-mode .rp-scenario { background: var(--accent-light, #1a2040); border-color: var(--sv-night-line); }
body.dark-mode .rp-scenario-text { color: var(--sv-night-ink); }
body.dark-mode .rp-prompt { color: var(--sv-night-ink); }
body.dark-mode .rp-note { color: var(--sv-night-mut); }
body.dark-mode .rp-input { background: var(--sv-night-page); border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .rp-input:focus { border-color: #7c3aed; }
body.dark-mode .rp-model-answers { border-top-color: var(--sv-night-line); }
body.dark-mode .score-bar-streak { background: #431407; border-color: #7c2d12; }
body.dark-mode img { filter: brightness(0.9); }
/* Map lightbox */
body.dark-mode .map-lightbox-close { background: color-mix(in srgb, var(--sv-night-card) 90%, transparent); color: var(--sv-night-ink); }
/* Skeleton loading */
body.dark-mode .skeleton-line, body.dark-mode .skeleton-hero { background: var(--sv-night-line); }
@media(max-width:900px){
  body.dark-mode .practice-passage-area { border-bottom-color: var(--sv-night-line); }
}

/* ===== LANGUAGE PRACTICE: SHARED ANIMATIONS ===== */
@keyframes vm-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
@keyframes lang-slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes vm-match-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ===== LANGUAGE PRACTICE: SHARED RULE TAG ===== */
.lang-rule-tag {
  display: inline-block; font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem; border-radius: 20px;
  background: var(--accent-light, #f5f3ff); color: var(--accent, #7c3aed);
}

/* ===== 1. VOCAB MATCH (.vm-*) ===== */
.vm-col-label {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: #6b665f; margin-bottom: 0.4rem;
}
.vm-col { display: flex; flex-direction: column; gap: 0.4rem; }
.vm-item {
  padding: 0.5rem 0.85rem; border: 2px solid #e5e7eb; border-radius: 20px;
  font-size: 0.82rem; font-weight: 500; cursor: pointer;
  background: white; transition: all 0.15s; user-select: none; text-align: center;
}
.vm-item:hover { border-color: #c4b5fd; }
.vm-item.selected {
  border-color: var(--accent, #7c3aed); background: var(--accent-light, #f5f3ff);
  color: var(--accent, #7c3aed);
}
.vm-item.correct {
  border-color: var(--success); background: var(--success-light); color: #166534;
  animation: vm-match-pop 0.3s var(--practice-ease);
}
.vm-item.wrong {
  border-color: var(--error); background: var(--error-light); color: #991b1b;
  animation: vm-shake 0.4s var(--practice-ease);
}
.vm-item.matched {
  opacity: 0.35; transform: scale(0.95); pointer-events: none;
  transition: opacity 0.35s var(--practice-ease), transform 0.35s var(--practice-ease);
}

/* ===== 2. GAP FILL (.gf-*) ===== */
.gf-english {
  padding: 0.65rem 1rem; background: #eff6ff; border-radius: 10px; font-size: 0.88rem; margin-bottom: 0.75rem;
  color: #1e40af;
}
.gf-sentence {
  font-size: 0.92rem; line-height: 2; font-family: var(--font-read,'Literata',Georgia,serif);
}
.gf-gap {
  display: inline-block; min-width: 100px; border-bottom: 2px dashed #c4b5fd;
  padding: 0 0.25rem 2px; margin: 0 2px; vertical-align: baseline;
  transition: border-color 0.15s, background 0.15s;
}
.gf-gap.filled { border-bottom-color: var(--accent, #7c3aed); background: var(--accent-light, #f5f3ff); }
.gf-gap.correct { border-bottom-color: var(--success); background: var(--success-light); }
.gf-gap.wrong { border-bottom-color: var(--error); background: var(--error-light); }
.gf-input {
  display: inline-block; min-width: 100px; border: none; border-bottom: 2px dashed #c4b5fd;
  background: transparent; font-family: inherit; font-size: inherit;
  padding: 0 0.25rem 2px; outline: none; color: #2d2a26;
  transition: border-color 0.15s, background 0.15s;
}
.gf-input:focus { border-bottom-color: var(--accent, #7c3aed); background: rgba(124,58,237,0.04); }
.gf-input.correct { border-bottom-color: var(--success); background: var(--success-light); color: #166534; }
.gf-input.wrong { border-bottom-color: var(--error); background: var(--error-light); color: #991b1b; }
.gf-bank {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem;
  padding: 0.6rem; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 12px;
}
.gf-chip {
  padding: 0.35rem 0.75rem; border: 1.5px solid #e5e7eb; border-radius: 8px;
  font-size: 0.8rem; font-weight: 500; cursor: pointer; background: white;
  transition: all 0.15s; user-select: none;
}
.gf-chip:hover { border-color: var(--accent, #7c3aed); background: var(--accent-light, #f5f3ff); }
.gf-chip.used {
  opacity: 0.4; text-decoration: line-through; pointer-events: none;
  background: #f1f5f9; border-color: #e2e8f0;
}
.gf-rule-tag {
  display: inline-block; font-size: 0.58rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.12rem 0.4rem; border-radius: 20px;
  background: #f5f3ff; color: #7c3aed;
}

/* ===== 3. TRANSLATE (.tr-*) ===== */
.tr-direction {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.75rem; font-size: 0.78rem; color: #6b665f;
}
.tr-direction .tr-arrow { font-size: 0.9rem; color: #c4b5fd; }
.tr-source {
  padding: 0.75rem 1rem; font-size: 1rem; font-weight: 600;
  border-radius: 10px; margin-bottom: 0.75rem;
  background: var(--accent-light, #f5f3ff); color: #2d2a26;
}
.tr-hints {
  padding: 0.5rem 0.75rem; background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 10px; font-size: 0.78rem; color: #92400e;
  margin-bottom: 0.5rem; display: none;
}
.tr-hints.visible { display: block; animation: lang-slide-down 0.25s var(--practice-ease); }
.tr-model {
  padding: 0.65rem 1rem; background: var(--success-light); border-radius: 10px;
  font-size: 0.88rem; margin-top: 0.5rem; color: #166534;
  animation: lang-slide-down 0.3s var(--practice-ease);
}
.tr-model-label {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--success); margin-bottom: 0.2rem;
}

/* ===== 4. DICTATION (.dt-*) ===== */
.dt-diff {
  line-height: 2; font-size: 0.88rem; margin-top: 0.5rem;
  font-family: var(--font-read,'Literata',Georgia,serif);
}
.diff-correct {
  background: rgba(22,163,74,0.15); padding: 1px 3px; border-radius: 3px;
}
.diff-wrong {
  background: rgba(220,38,38,0.15); text-decoration: line-through;
  text-decoration-color: var(--error); padding: 1px 3px; border-radius: 3px;
  color: #991b1b;
}
.diff-missing {
  background: rgba(245,158,11,0.15); font-style: italic;
  padding: 1px 3px; border-radius: 3px; color: #92400e;
}

/* ===== 5. SENTENCE BUILDER (.sb-*) ===== */
.sb-english {
  padding: 0.65rem 1rem; background: #eff6ff; border-radius: 10px; font-size: 0.88rem; margin-bottom: 0.75rem;
  color: #1e40af;
}
.sb-zone {
  min-height: 56px; border: 2px dashed #d4d0cc; border-radius: 12px;
  padding: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.35rem;
  align-items: center; transition: border-color 0.2s, background 0.2s;
  margin-bottom: 0.75rem; position: relative;
}
.sb-zone.active {
  border-color: var(--accent, #7c3aed); background: var(--accent-light, #f5f3ff);
}
.sb-zone.wrong-zone {
  border-color: var(--error); border-style: solid; background: var(--error-light);
}
.sb-zone-placeholder {
  color: #b8b3ae; font-size: 0.8rem; font-style: italic;
  pointer-events: none; user-select: none;
}
.sb-bank {
  display: flex; flex-wrap: wrap; gap: 0.4rem; min-height: 40px;
  padding: 0.6rem; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 12px;
}
.sb-tile {
  padding: 0.4rem 0.8rem; border: 1.5px solid #e5e7eb; border-radius: 10px;
  font-size: 0.82rem; font-weight: 500; cursor: pointer; background: white;
  transition: all 0.15s, transform 0.1s; user-select: none;
}
.sb-tile:hover { border-color: #c4b5fd; transform: translateY(-1px); }
.sb-tile:active { transform: scale(0.96); }
.sb-tile.used {
  opacity: 0.3; pointer-events: none;
}
.sb-tile.wrong-tile {
  border-color: var(--error); background: var(--error-light); color: #991b1b;
}

/* ===== 6. SPOT & CORRECT (.sc-*) ===== */
.sc-word {
  padding: 0.15rem 0.35rem; border: 2px solid transparent; border-radius: 6px;
  cursor: pointer; transition: all 0.15s; user-select: none;
}
.sc-word:hover { background: rgba(124,58,237,0.06); }
.sc-word.selected {
  border-color: var(--accent, #7c3aed); background: var(--accent-light, #f5f3ff);
}
.sc-word.wrong-pick {
  animation: vm-shake 0.4s var(--practice-ease);
}
.sc-correction {
  display: none; margin-top: 0.5rem;
}
.sc-correction.visible {
  display: block; animation: lang-slide-down 0.3s var(--practice-ease);
}
.sc-rule-tag {
  display: inline-block; font-size: 0.58rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.12rem 0.4rem; border-radius: 20px;
  background: #f5f3ff; color: #7c3aed;
}

/* ===== 7. ROLE PLAY (.rp-*) ===== */
.rp-scenario {
  background: linear-gradient(135deg, var(--accent-light, #f5f3ff) 0%, #f9fafb 100%);
  border: 1px solid #e5e7eb; border-radius: 14px;
  padding: 1rem 1.25rem; margin-bottom: 0.75rem;
}
.rp-input {
  width: 100%; border: 1px solid #ddd; border-radius: 10px;
  padding: 0.55rem 0.75rem; font-size: 0.85rem; font-family: inherit;
  transition: border-color 0.15s; box-sizing: border-box; color: #2d2a26;
}
.rp-input:focus { outline: none; border-color: #c4b5fd; box-shadow: 0 0 0 2px rgba(124,58,237,0.08); }
.rp-model-label {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--success); margin-bottom: 0.25rem;
}
.rp-model-note {
  font-size: 0.7rem; color: #6b665f; margin-top: 0.25rem; font-style: italic;
}

/* ===== LANGUAGE PRACTICE: DARK MODE ===== */
/* Shared */
body.dark-mode .lang-rule-tag { background: var(--accent-light, #1a2040); }
/* Vocab Match */
body.dark-mode .vm-item { background: var(--sv-night-card); border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .vm-item:hover { border-color: #7c3aed; }
body.dark-mode .vm-item.selected { background: var(--accent-light, #1a2040); }
body.dark-mode .vm-item.correct { background: #0a2e1a; border-color: #166534; color: #86efac; }
body.dark-mode .vm-item.wrong { background: #2e1a1a; border-color: #991b1b; color: #fca5a5; }
body.dark-mode .vm-item.matched { opacity: 0.25; }
body.dark-mode .vm-col-label { color: var(--sv-night-mut); }
/* Gap Fill */
body.dark-mode .gf-english { background: #1a2040; color: #93c5fd; }
body.dark-mode .gf-gap { border-bottom-color: color-mix(in srgb, var(--sv-night-line) 60%, var(--sv-night-mut)); }
body.dark-mode .gf-gap.filled { border-bottom-color: var(--accent, #7c3aed); background: var(--accent-light, #1a2040); }
body.dark-mode .gf-gap.correct { border-bottom-color: #166534; background: #0a2e1a; }
body.dark-mode .gf-gap.wrong { border-bottom-color: #991b1b; background: #2e1a1a; }
body.dark-mode .gf-input { color: var(--sv-night-ink); border-bottom-color: color-mix(in srgb, var(--sv-night-line) 60%, var(--sv-night-mut)); }
body.dark-mode .gf-input:focus { border-bottom-color: var(--accent, #7c3aed); background: rgba(124,58,237,0.08); }
body.dark-mode .gf-input.correct { border-bottom-color: #166534; background: #0a2e1a; color: #86efac; }
body.dark-mode .gf-input.wrong { border-bottom-color: #991b1b; background: #2e1a1a; color: #fca5a5; }
body.dark-mode .gf-bank { background: var(--sv-night-card); border-color: var(--sv-night-line); }
body.dark-mode .gf-chip { background: var(--sv-night-card); border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .gf-chip:hover { border-color: #7c3aed; background: var(--accent-light, #1a2040); }
body.dark-mode .gf-chip.used { background: var(--sv-night-page); border-color: var(--sv-night-linel); color: var(--sv-night-mut); }
body.dark-mode .gf-rule-tag { background: #1a2040; color: #c4b5fd; }
/* Translate */
body.dark-mode .tr-source { background: var(--accent-light, #1a2040); color: var(--sv-night-ink); }
body.dark-mode .tr-hints { background: #332d1f; border-color: #5c4b1f; color: #fbbf24; }
body.dark-mode .tr-model { background: #0a2e1a; border-left-color: #166534; color: #86efac; }
body.dark-mode .tr-model-label { color: #4ade80; }
body.dark-mode .tr-direction { color: var(--sv-night-mut); }
/* Dictation */
body.dark-mode .dt-speed-btn { background: var(--sv-night-card); border-color: var(--sv-night-line); color: var(--sv-night-sec); }
body.dark-mode .dt-speed-btn:hover { border-color: #7c3aed; }
body.dark-mode .dt-speed-btn.active { background: var(--accent, #7c3aed); color: white; }
body.dark-mode .diff-correct { background: rgba(22,163,74,0.25); }
body.dark-mode .diff-wrong { background: rgba(220,38,38,0.25); color: #fca5a5; }
body.dark-mode .diff-missing { background: rgba(245,158,11,0.2); color: #fbbf24; }
/* Sentence Builder */
body.dark-mode .sb-english { background: #1a2040; color: #93c5fd; }
body.dark-mode .sb-zone { border-color: var(--sv-night-line); }
body.dark-mode .sb-zone.active { border-color: var(--accent, #7c3aed); background: var(--accent-light, #1a2040); }
body.dark-mode .sb-zone.wrong-zone { border-color: #991b1b; background: #2e1a1a; }
body.dark-mode .sb-zone-placeholder { color: var(--sv-night-mut); }
body.dark-mode .sb-bank { background: var(--sv-night-card); border-color: var(--sv-night-line); }
body.dark-mode .sb-tile { background: var(--sv-night-card); border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .sb-tile:hover { border-color: #7c3aed; }
body.dark-mode .sb-tile.used { opacity: 0.2; }
body.dark-mode .sb-tile.wrong-tile { background: #2e1a1a; border-color: #991b1b; color: #fca5a5; }
/* Spot & Correct */
body.dark-mode .sc-word { color: var(--sv-night-ink); }
body.dark-mode .sc-word:hover { background: rgba(124,58,237,0.12); }
body.dark-mode .sc-word.selected { background: var(--accent-light, #1a2040); }
body.dark-mode .sc-rule-tag { background: #1a2040; color: #c4b5fd; }
/* Role Play */
body.dark-mode .rp-scenario { background: linear-gradient(135deg, var(--accent-light, #1a2040) 0%, var(--sv-night-card) 100%); border-color: var(--sv-night-line); }
body.dark-mode .rp-input { background: var(--sv-night-page); border-color: var(--sv-night-line); color: var(--sv-night-ink); }
body.dark-mode .rp-input:focus { border-color: #7c3aed; }
body.dark-mode .rp-model-label { color: #4ade80; }
body.dark-mode .rp-model-note { color: var(--sv-night-mut); }

/* ===== LANGUAGE PRACTICE: MOBILE ===== */
@media(max-width:600px) {
  .rp-scenario { padding: 0.75rem 1rem; }
  .sb-tile { padding: 0.35rem 0.65rem; font-size: 0.78rem; }
  .tr-source { font-size: 0.92rem; }
}

/* ===== PRINT ===== */
/* the section and step labels were 10.4px at every size (responsive pass, 10 Sep 2026) */
.panel-section-title,.method-modal-steps-label,.learn-step-label,.learn-difficulty,.problem-number-label,.problem-tier-pill,.vm-col-label,.calc-float-title{font-size:.72rem}
#panel-method .tier-intro-example-step .tie-label,.tier-intro-example-step .tie-label{font-size:.72rem}
@media (max-width: 900px){
  /* the section and step labels were 10px on a phone */
  .panel-section-title,.method-modal-steps-label,.learn-step-label,.learn-difficulty{font-size:.74rem}
  #panel-method .tier-intro-example-step .tie-label,.tier-intro-example-step .tie-label{font-size:.76rem}
}
@media print {
  .page-header, .practice-panel, .practice-score-bar, .problem-check-btn, .problem-next-btn, .learn-actions { display: none; }
  .practice-layout { height: auto; padding-top: 0; }
  .content-viewport { position: static; }
  .content-view { position: static; padding: 1rem; }
}

/* ---- phones (8 Nov 2026, the phone pass): as the dashboard, lessons and browse: text 15px or more (labels in capitals
   13.5px) and every control 44px or more, the main buttons 48px; the method card's words and vocabulary readable.
   Nothing moves or goes. Desktop unchanged ---- */
@media (max-width:700px){
  html:root body .header-lesson-pill,html:root body .method-modal-steps-label,html:root body .panel-section-title{font-size:.84rem}
  /* the menu */
  html:root body .header-nav.open a:where(:not(.sv-btn)){display:flex;align-items:center;min-height:48px;font-size:.94rem}
  html:root body .header-nav.open .svtimer{min-width:48px;min-height:48px}
  /* the start, the score bar, next and the summary */
  html:root body .guided-go{min-width:44px;min-height:44px}   /* 44, not 48: it stays on the line beside the answer box */
  html:root body .guided-box-row{column-gap:8px}
  /* the method card and the reference panel */
  html:root body .method-modal-close{min-width:44px;min-height:44px}
  html:root body .method-modal p,html:root body .method-modal li{font-size:1rem}
  html:root body .step-body,html:root body .method-modal th,html:root body .method-modal td,html:root body .method-modal summary,
  html:root body #practice-panel p,html:root body #practice-panel li,html:root body #practice-panel th,html:root body #practice-panel td,html:root body #practice-panel summary{font-size:.94rem}
  html:root body #panel-method .tier-intro-example-step .tie-label,html:root body .tier-intro-example-step .tie-label{font-size:.84rem}   /* in capitals */
  /* the logo link, the score bar's buttons (their own rules use ids) and the map's close */
  html:root body .header-brand{display:inline-flex;align-items:center;min-height:44px}
  /* the labels in capitals: practice.html sets them to .7rem with !important */
  html:root body .header-lesson-pill,html:root body .learn-difficulty,html:root body .problem-tier-pill,html:root body .problem-calc-pill,
  html:root body .passage-header-badge{font-size:.84rem !important}
  html:root body .map-lightbox-close{min-width:44px;min-height:44px}
  /* worked examples and the questions */
  html:root body .learn-step-label,html:root body .learn-passage-label,html:root body .learn-difficulty,
  html:root body .problem-number-label,html:root body .problem-tier-pill,html:root body .vm-col-label{font-size:.84rem}
  html:root body .learn-counter{font-size:.94rem}
  html:root body .problem-question-hint{font-size:.94rem}
  html:root body .vm-item{min-height:48px;font-size:1rem}
  html:root body .summary-label,html:root body .summary-tier-name{font-size:.94rem}
  html:root body .summary-tier-count{font-size:.94rem;width:auto;min-width:2.5rem}
  html:root body .tier-fail-sub,html:root body .celebration-sub{font-size:.94rem}
  html:root body .hw{font-size:1rem}   /* the words of a 'hold a word' passage */
  /* the reference panel's worked example: its maths was .85em of the text (12.8px) */
  html:root body #panel-method .tier-intro-example{font-size:.94rem}
  html:root body .panel-method-content .katex,html:root body .panel-method-content .katex-display{font-size:1em}
  /* the controls that appear later: next example, the passage tabs and reader, the walk-through link, the equation, the calculator */
  html:root body .mobile-passage-tab,html:root body .passage-a11y-btn,html:root body .equation-hint-toggle{min-height:44px;font-size:.94rem}
  html:root body .problem-walk-link{display:inline-flex;align-items:center;min-height:44px;font-size:.94rem}
  /* the calculator: its button 48px, the bar's buttons 44px, the keys 48px and 8px apart */
  html:root body .calc-fab{min-width:48px;min-height:48px;justify-content:center}
  html:root body .calc-fab span,html:root body .calc-float-grip{font-size:.94rem}
  html:root body .calc-float-title{font-size:.84rem}
  html:root body .calc-float{width:min(300px,calc(100vw - 2rem))}
  html:root body .calc-float-btn{width:44px;height:44px;font-size:1.2rem}
  html:root body .calc-float-bar{gap:8px;padding-block:.15rem}
  html:root body .calc-grid{gap:8px}
  html:root body .calc-btn{min-height:48px}
  /* a practice lesson that cannot be found: the way back */
  html:root body #practice-error a{min-height:44px;line-height:44px}
}

/* ============================================================================================================
   THE LESSON SHELL (10 Nov 2026, the redesign. Tom: "its the UI/UX and aesthetics that I think are the problem")
   A practice lesson now reads as a StudyVault lesson: its name on the page, one route (Guide, Examples, Questions)
   with one status line, the Lesson Tools panel, a calm answer card, and on a phone one button between the question
   and what it is about. The rules below win over the older ones above. Gone with this pass: the score bar's badge
   and buttons, the pop-up guide, the medal colours (the levels are named in js/util.js, svLevelName).
   Site rules kept: no pill shapes, no coloured side stripes, no caption lines under controls, phone targets 44px+.
   ============================================================================================================ */
.sv-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- the page fills the screen under the header; the footer waits below the fold ---- */
#practice-page { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
body:has(#practice-page:not([style*="none"])) { overflow: hidden; overflow: clip; }   /* each stage scrolls inside itself; clip: a script that brings a step into view must not move the page */
body:has(#practice-page:not([style*="none"]))::before { max-height: 100dvh; }   /* the painted light at the top is 660px tall: on a shorter screen it made the page taller than the screen */
#practice-page .page-header { flex-shrink: 0; }
#practice-page .practice-layout { flex: 1 1 auto; min-height: 0; height: auto; }
#practice-page .practice-main { background: var(--bg, #faf8f5); }

/* ---- type, as on the lesson pages: Schibsted Grotesk for questions and controls, the reading face for extracts ---- */
.header-lesson-title, .panel-method-title, .tier-intro-title, .summary-score, .tier-fail-heading, .tier-fail-score,
.stats-tool-title, .learn-question, .guided-display, .problem-equation, .guided-box-row, .problem-inputs label,
.problem-answer-unit, .fraction-input .fraction-label, .standard-form-input, .running-sum, .calc-display,
.range-slot-value { font-family: 'Schibsted Grotesk', system-ui, sans-serif; }
.header-lesson-title { font-weight: 600; letter-spacing: -0.005em; }
.learn-question, .guided-display, .problem-equation { font-weight: 650; letter-spacing: -0.01em; }
.learn-question .rs-quote, .learn-full-passage { font-family: var(--font-read, 'Literata', Georgia, serif); font-weight: 400; letter-spacing: 0; }
/* labels are words in the label grey, never a filled shape */
.header-lesson-pill, .learn-difficulty, .problem-tier-pill, .problem-calc-pill, .passage-header-badge {
  background: transparent !important; border: 0 !important; padding: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif; font-size: 0.8rem !important; font-weight: 600 !important;
  letter-spacing: 0.01em !important; text-transform: none; color: var(--text-muted, #6b665f) !important;
}
.header-lesson-pill { font-size: 0.7rem !important; font-weight: 700 !important; letter-spacing: 0.1em !important; text-transform: uppercase; }   /* as the lesson pages' header: "LESSON 1 OF 8" */
body.dark-mode :is(.header-lesson-pill, .learn-difficulty, .problem-tier-pill, .problem-calc-pill, .passage-header-badge) { color: var(--sv-night-sec) !important; }
/* chips, tags and small buttons are rounded rectangles */
.topic-pill, .header-nav-pill, .lb-bar, .lb-btn, .lb-hint, .cp-chip, .gf-chip, .lang-rule-tag, .vm-item, .gf-rule-tag, .sc-rule-tag { border-radius: 8px !important; }
/* a long question head is not a box inside the page (Tom, 18 Oct 2026) */
.guided-card-head.sv-free, .learn-card-head.sv-free { position: static; max-height: none; overflow: visible; box-shadow: none; }
.guided-card-head.sv-free::after, .learn-card-head.sv-free::after { display: none; }
.learn-reveal-btn, .learn-next-btn, .learn-back-btn { white-space: nowrap; }
@media (pointer: coarse) {
  .passage-a11y-btn, .guided-go, .guided-input { min-height: 44px; }
  .passage-overlay-group { gap: 0.55rem; }
  .passage-overlay-btn { width: 32px; height: 32px; }
}

/* ---- the lesson's name and the route ---- */
.pr-head { flex-shrink: 0; width: 100%; max-width: 780px; margin: 0 auto; padding: 1.5rem 2rem 0; box-sizing: border-box; }
.practice-main:has(.practice-passage-area[style*="flex"]) .pr-head { max-width: none; }
.pr-eyebrow { display: none; margin: 0 0 0.25rem; font: 500 0.94rem/1.3 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-muted, #6b665f); }   /* a laptop's header names the unit */
.pr-h1 { margin: 0; font: 700 1.7rem/1.18 'Schibsted Grotesk', system-ui, sans-serif; letter-spacing: -0.018em; color: var(--text-primary, #2d2a26); text-wrap: balance; }
.pr-route { list-style: none; display: flex; align-items: center; margin: 1rem 0 0; padding: 0; }
.pr-route li { display: flex; align-items: center; }
.pr-route li[hidden] { display: none; }
.pr-route li:not([hidden]) ~ li:not([hidden])::before { content: ''; width: 2.25rem; height: 1.5px; margin: 0 0.75rem; background: var(--border-light, #d9d4cc); }
.pr-step { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 500 0.95rem 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-muted, #6b665f); -webkit-tap-highlight-color: transparent; }
.pr-step-mark, .pr-prog-mark { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid #c9c3ba; display: grid; place-items: center;
  font: 700 0.8rem 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-muted, #6b665f); background: transparent; box-sizing: border-box; }
.pr-step-mark svg, .pr-prog-mark svg { width: 13px; height: 13px; }
.pr-step:hover .pr-step-name { color: var(--text-primary, #2d2a26); }
.pr-step.is-done .pr-step-mark, .pr-prog-row.is-done .pr-prog-mark { border-color: var(--accent, #2563eb); color: var(--accent, #2563eb); }
.pr-step.is-current { cursor: default; color: var(--text-primary, #2d2a26); font-weight: 700; }
.pr-step.is-current .pr-step-mark, .pr-prog-row.is-current .pr-prog-mark { background: var(--accent, #2563eb); border-color: var(--accent, #2563eb); color: #fff; }
.pr-step:focus-visible, .pr-prog-row:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 3px; border-radius: 8px; }
/* the status line: the level, the question, the score, and a bar that can be seen */
.pr-status { display: flex; align-items: center; gap: 1rem; margin-top: 0.55rem; min-height: 28px; }
.pr-status[hidden] { display: none; }
.pr-status-text { font: 500 0.92rem 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-secondary, #5a5651); white-space: nowrap; }
.pr-status-text b { font-weight: 700; color: var(--text-primary, #2d2a26); }
#practice-page .score-bar-streak { display: none; background: none; border: 0; padding: 0; border-radius: 0; animation: none; font: 600 0.86rem 'Schibsted Grotesk', system-ui, sans-serif; color: var(--accent, #2563eb); white-space: nowrap; }
#practice-page .score-bar-streak.visible { display: inline; }
#practice-page .pr-status .tier-progress { flex: 1 1 auto; margin: 0; padding: 0; max-width: none; width: auto; }
#practice-page .pr-status .tier-progress-track { height: 6px; border-radius: 3px; background: #e6e1d9; overflow: hidden; }
#practice-page .pr-status .tier-progress-fill { height: 100%; border-radius: 3px; background: var(--accent, #2563eb); transition: width 0.5s var(--practice-ease); }
body.dark-mode .pr-h1 { color: var(--sv-night-ink); }
body.dark-mode .pr-eyebrow, body.dark-mode .pr-step, body.dark-mode .pr-status-text { color: var(--sv-night-sec); }
body.dark-mode .pr-step.is-current, body.dark-mode .pr-status-text b, body.dark-mode .pr-step:hover .pr-step-name { color: var(--sv-night-ink); }
body.dark-mode .pr-step-mark, body.dark-mode .pr-prog-mark { border-color: color-mix(in srgb, var(--sv-night-line) 60%, var(--sv-night-mut)); color: var(--sv-night-sec); }
body.dark-mode #practice-page .pr-status .tier-progress-track { background: var(--sv-night-line); }
body.dark-mode #practice-page .practice-main { background: var(--sv-night-page); }

/* the old score bar keeps only the extract's reading tools (a laptop, when an extract shows) */
#practice-page .practice-score-bar { display: none; border-bottom: 0; background: transparent; padding: 0.5rem 2rem 0; justify-content: flex-start; }
#practice-page .practice-main:has(.practice-passage-area[style*="flex"]) .practice-score-bar:has(.score-bar-a11y:not([style*="none"])) { display: flex; }
#practice-page .score-bar-a11y { justify-content: flex-start; flex: 0 1 auto; }

/* ---- the cards: wider, larger type, one soft shadow ---- */
#practice-page .content-view { padding: 1.25rem 2rem 2.5rem; }
#practice-page .problem-stage { width: 100%; max-width: 716px; }
#practice-page .practice-columns:has(.practice-passage-area[style*="flex"]) .problem-stage { max-width: 600px; }
#practice-page .learn-card, #practice-page .problem-card { width: 100%; max-width: 716px; border-radius: 16px; border: 1px solid var(--border-light, #e8e4df);
  box-shadow: 0 1px 2px rgba(60, 45, 20, 0.04), 0 12px 32px -18px rgba(60, 45, 20, 0.22); }
#practice-page .problem-card.card-correct, #practice-page .problem-card.card-incorrect { border-color: var(--border-light, #e8e4df); }
#practice-page .learn-question { font-size: 1.32rem; line-height: 1.32; text-align: left; margin-bottom: 1.25rem; text-wrap: pretty; }
#practice-page .learn-question.is-long { font-size: 1.08rem; font-weight: 600; line-height: 1.45; letter-spacing: 0; }
#practice-page .learn-step-content, #practice-page .mc-text, #practice-page .feedback-body { font-size: 1rem; }
#practice-page .learn-counter, #practice-page .problem-number-label { font: 600 0.8rem 'Schibsted Grotesk', system-ui, sans-serif; letter-spacing: 0.01em; text-transform: none; color: var(--text-muted, #6b665f); }
body.dark-mode #practice-page .learn-card, body.dark-mode #practice-page .problem-card { border-color: var(--sv-night-line); box-shadow: none; }

/* the guide, as the first stage */
.pr-guide-body { margin: 0.25rem 0 1.5rem; }
#practice-page .pr-guide-body .panel-method-title { font-size: 1.32rem; font-weight: 650; letter-spacing: -0.01em; line-height: 1.3; margin: 0 0 0.75rem; color: var(--text-primary, #2d2a26); }
#practice-page .pr-guide-body .panel-method-content { font-family: var(--font-read, 'Literata', Georgia, serif); font-size: 1.04rem; line-height: 1.65; color: var(--text-primary, #2d2a26); }
#practice-page .pr-guide-body .panel-method-steps { font-size: 1rem; line-height: 1.5; margin-top: 1rem; }
#practice-page .pr-guide-body .panel-method-steps li { padding: 0.55rem 0; }
#practice-page .pr-guide-body :is(th, td, summary, .step-body) { font-size: 1rem; }
body.dark-mode #practice-page .pr-guide-body :is(.panel-method-title, .panel-method-content) { color: var(--sv-night-ink); }
/* while the guide shows in the page, a laptop's side panel does not show the same card again */
@media (min-width: 901px) { body[data-stage="guide"] #panel-method { display: none !important; } }

/* ---- after an answer: a calm card; red marks only on what was wrong; try again beside next ---- */
#practice-page .feedback-box, #practice-page .feedback-box.feedback-incorrect, #practice-page .feedback-box.feedback-correct {
  background: var(--bg-card, #fff); border: 1px solid var(--border-light, #e8e4df); border-radius: 12px; color: var(--text-primary, #2d2a26); }
#practice-page .feedback-body, #practice-page .feedback-text, #practice-page .correct-answer-text, #practice-page .feedback-why,
#practice-page .misconception-tip, #practice-page .feedback-simplify { color: var(--text-primary, #2d2a26); }
#practice-page .feedback-title { font: 700 1.02rem 'Schibsted Grotesk', system-ui, sans-serif; }
#practice-page .misconception-tip, #practice-page .feedback-simplify { background: var(--bg, #faf8f5); border: 0; border-radius: 8px; }
body.dark-mode #practice-page .feedback-box { background: var(--sv-night-card); border-color: var(--sv-night-line); }
body.dark-mode #practice-page :is(.feedback-body, .feedback-text, .correct-answer-text, .feedback-why, .misconception-tip, .feedback-simplify) { color: var(--sv-night-ink); }
body.dark-mode #practice-page :is(.misconception-tip, .feedback-simplify) { background: var(--sv-night-page); }
#practice-page .problem-next-area.shown { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }
.problem-retry-btn[hidden], .problem-next-btn[hidden] { display: none; }   /* Try again: a second button, Next question: the main one (css/buttons.css) */

#practice-page .vm-col-label { text-transform: none; letter-spacing: 0.01em; font-weight: 600; }

/* the end of a level: a tick, no medal */
#practice-page .celebration-badge { background: var(--bg-card, #fff); color: var(--text-primary, #2d2a26); border: 1px solid var(--border-light, #e8e4df); border-radius: 12px; box-shadow: 0 16px 40px -20px rgba(60, 45, 20, 0.35); }
#practice-page .celebration-badge svg { color: var(--accent, #2563eb); }
#practice-page .tier-celebration { background: rgba(250, 248, 245, 0.92); border-radius: 16px; }   /* the question under it is done: it does not show through the words */
body.dark-mode #practice-page .tier-celebration { background: rgba(28, 26, 24, 0.92); }
#practice-page .celebration-sub { font-size: 0.97rem; }
/* "Next: Build" on its own line inside the box (job S1-07) */
#practice-page .celebration-badge { display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; column-gap: 0.5rem; row-gap: 0.15rem; }
#practice-page .celebration-badge .celebration-sub { grid-column: 1 / -1; margin-top: 0; text-align: center; font-weight: 500; }
#practice-page .summary-tier-name { color: var(--text-primary, #2d2a26); min-width: 5.2rem; text-align: left; }
#practice-page .summary-tier-fill { background: var(--accent, #2563eb); }
body.dark-mode #practice-page .summary-tier-name, body.dark-mode #practice-page .celebration-badge { color: var(--sv-night-ink); }
body.dark-mode #practice-page .celebration-badge { background: var(--sv-night-card); border-color: var(--sv-night-line); }

/* ---- Lesson Tools ---- */
#practice-page .practice-panel { gap: 0; padding: 1rem 1.25rem 1.5rem; }
#practice-page .practice-panel .panel-section { padding: 1rem 0; border: 0; border-bottom: 1px solid var(--border-light, #e2ddd5); background: none; border-radius: 0; box-shadow: none; }
#practice-page .practice-panel .panel-section:last-child, #practice-page .practice-panel .pr-ways:empty { border-bottom: 0; }
#practice-page .practice-panel .pr-ways:empty { display: none; }
#practice-page .practice-panel .panel-section-title { font: 600 0.8rem 'Schibsted Grotesk', system-ui, sans-serif; letter-spacing: 0.01em; text-transform: none; color: var(--text-muted, #6b665f); margin-bottom: 0.6rem; }
#practice-page .practice-panel .panel-section-title svg { display: none; }
.pr-tools-head { display: none; }
.pr-progress-list { display: flex; flex-direction: column; gap: 2px; }
.pr-prog-row { display: flex; align-items: center; gap: 0.7rem; min-height: 40px; padding: 0.2rem 0.4rem; margin: 0 -0.4rem; border: 0; border-radius: 8px; background: none; text-align: left;
  font: 500 0.94rem 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-secondary, #5a5651); }
button.pr-prog-row { cursor: pointer; }
button.pr-prog-row:hover { background: rgba(60, 45, 20, 0.05); }
.pr-prog-row.is-current .pr-prog-name { font-weight: 700; color: var(--text-primary, #2d2a26); }
.pr-prog-note { margin-left: auto; font-size: 0.84rem; color: var(--text-muted, #6b665f); white-space: nowrap; }
/* a level, under Questions (job S2-01): set in, a small mark (a tick when passed, filled while it is the one being done) */
.pr-prog-row.is-level { padding-left: calc(0.4rem + 26px + 0.7rem); min-height: 34px; font-size: 0.9rem; gap: 0.55rem; }
.pr-prog-row.is-level .pr-prog-mark { width: 18px; height: 18px; }
.pr-prog-row.is-level .pr-prog-mark svg { width: 10px; height: 10px; }
#practice-page .pr-settings .dark-mode-toggle, #practice-page .pr-settings .bugr-fab, #practice-page .pr-settings .sv-tour-replay {
  position: static; display: flex; align-items: center; justify-content: flex-start; gap: 0.7rem; width: auto; min-width: 0; height: auto; min-height: 44px; padding: 0 0.4rem; margin: 0 -0.4rem;
  border: 0; border-radius: 8px; background: none; box-shadow: none; cursor: pointer; text-align: left; transform: none; inset: auto;
  font: 500 0.94rem 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-primary, #2d2a26); }
#practice-page .pr-settings .dark-mode-toggle:hover { background: rgba(60, 45, 20, 0.05); }
#practice-page .pr-settings :is(.dark-mode-toggle, .bugr-fab, .sv-tour-replay) svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--text-secondary, #5a5651); }
#practice-page #rd-practice-btn::after { content: 'Text size and font'; }
#practice-page .pr-settings { display: flex; flex-direction: column; }
#practice-page .pr-settings .score-bar-utils { display: flex !important; flex-direction: column; gap: 0; margin: 0; }
#practice-page .practice-panel:focus { outline: none; }
/* a laptop's panel is read beside the work: its words are not small print */
#practice-page .practice-panel .panel-method-title { font-size: 1.02rem; line-height: 1.35; }
#practice-page .practice-panel :is(.panel-method-content, .panel-method-steps, .step-body, .tier-intro-example) { font-size: 0.92rem; line-height: 1.55; }
/* the company's footer sits at the foot of the tools */
#practice-page .practice-panel .sv-legal-footer { margin: 0; padding: 1rem 0 0; border: 0; text-align: left; }
#practice-page .practice-panel .sv-legal-footer p { font-size: 0.8rem; line-height: 1.7; }
body.dark-mode .pr-prog-row, body.dark-mode .pr-prog-note { color: var(--sv-night-sec); }
body.dark-mode :is(.pr-prog-row.is-current .pr-prog-name), body.dark-mode #practice-page .pr-settings :is(.dark-mode-toggle, .bugr-fab, .sv-tour-replay) { color: var(--sv-night-ink); }
body.dark-mode #practice-page .practice-panel .panel-section, body.dark-mode #practice-page .tier-intro-example { border-color: var(--sv-night-line); }

/* ---- a phone (and a narrow window): the tools open from the header's menu button; one column; thumb-sized ---- */
@media (max-width: 900px) {
  #practice-page .mobile-menu-btn { display: flex; align-items: center; justify-content: center; margin-left: auto; min-width: 44px; min-height: 44px; z-index: auto; }
  #practice-page .page-header-inner > .header-nav { display: none; }
  #practice-page .practice-panel { top: 0; left: auto; right: 0; width: min(88vw, 380px); z-index: 960; transform: translateX(105%); padding: 0 1.25rem calc(1.5rem + env(safe-area-inset-bottom)); }
  #practice-page .practice-panel.panel-open { transform: translateX(0); box-shadow: -8px 0 32px rgba(40, 28, 12, 0.18); }
  #practice-page .panel-overlay { z-index: 950; }
  .pr-tools-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 2; min-height: 60px; margin: 0 -1.25rem; padding: 0 0.75rem 0 1.25rem;
    background: var(--panel-bg, #f5f2ed); border-bottom: 1px solid var(--border-light, #e2ddd5); }
  .pr-tools-title { font: 700 1.05rem 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-primary, #2d2a26); }
  /* .pr-tools-close: the system's 44px close (sv-btn sv-quiet sv-icon, css/buttons.css; job S3-04) */
  body.dark-mode .pr-tools-head { background: var(--sv-night-card); border-color: var(--sv-night-line); }
  body.dark-mode .pr-tools-title { color: var(--sv-night-ink); }
  .pr-prog-row { min-height: 46px; font-size: 1rem; }
  #practice-page .pr-settings :is(.dark-mode-toggle, .bugr-fab, .sv-tour-replay) { min-height: 48px; font-size: 1rem; }
  /* the header's links, moved into the tools by route.js */
  #practice-page .pr-ways .header-nav { position: static; display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: auto; height: auto; padding: 0; background: none; box-shadow: none; transform: none; transition: none; }
  #practice-page .pr-ways .header-nav a:where(:not(.sv-btn)) { display: flex; align-items: center; width: auto; min-height: 48px; padding: 0 0.4rem; margin-left: -0.4rem; border-radius: 8px; font: 500 1rem 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-primary, #2d2a26); background: none; }
  #practice-page .pr-ways .header-nav a.nav-lesson-pill { align-self: stretch; margin: 0.25rem 0 0; }   /* the main button (css/buttons.css) */
  #practice-page .pr-ways .header-nav .svtimer-wrap { align-self: stretch; }
  #practice-page .pr-ways .header-nav .svtimer { width: 100%; justify-content: flex-start; gap: 0.7rem; min-height: 48px; padding: 0 0.4rem; margin-left: -0.4rem; border-radius: 8px; }
  #practice-page .pr-ways .header-nav .svtimer::after { content: 'Focus timer'; font: 500 1rem 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-primary, #2d2a26); }   /* in a list of named rows the stopwatch has its name too */
  body.dark-mode #practice-page .pr-ways .header-nav .svtimer::after { color: var(--sv-night-ink); }
  #practice-page .pr-ways .header-nav, #practice-page .pr-ways .header-nav a { border: 0; }
  #practice-page .pr-ways .header-nav::before, #practice-page .pr-ways .header-nav a::before { content: none; }   /* the header's dividers have no place in a list */
  body.dark-mode #practice-page .pr-ways .header-nav a:not(.nav-lesson-pill) { color: var(--sv-night-ink); }

  .pr-head { padding: 0.9rem 1rem 0; }
  .pr-h1 { font-size: 1.36rem; }
  .pr-eyebrow { display: block; }
  .pr-route { margin-top: 0.6rem; justify-content: space-between; }
  .pr-route li:not([hidden]) ~ li:not([hidden]) { flex: 1 1 auto; }
  .pr-route li:not([hidden]) ~ li:not([hidden])::before { flex: 1 1 auto; width: auto; min-width: 0.75rem; margin: 0 0.5rem; }
  .pr-step { font-size: 0.97rem; gap: 0.4rem; }
  .pr-status { margin-top: 0.15rem; gap: 0.75rem; min-height: 32px; }
  .pr-status-text { font-size: 0.94rem; }
  #practice-page .content-view { padding: 0.75rem 1rem 1.5rem; }
  #practice-page .learn-card, #practice-page .problem-card { padding: 1.25rem 1.1rem 1.25rem; }
  #practice-page .learn-question { font-size: 1.2rem; }
  #practice-page .learn-question.is-long { font-size: 1.04rem; }
  .learn-actions { flex-direction: column; align-items: stretch; gap: 0.6rem; }
  .learn-actions > button { width: 100%; }
  .problem-retry-btn, #practice-page .problem-next-btn { flex: 1 1 0; padding-inline: 0.75rem; white-space: nowrap; }

  /* the question, or what it is about: one button at the foot, in reach of the thumb */
  #practice-page .mobile-passage-tabs { order: 5; display: flex; gap: 0; flex-shrink: 0; padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom)); background: var(--bg-card, #fff); border: 0; border-top: 1px solid var(--border-light, #e8e4df); }
  #practice-page .mobile-passage-tab { position: relative; flex: 1 1 auto; min-height: 48px; padding: 0 1rem; border: 1.5px solid var(--accent, #2563eb); border-radius: 12px; background: transparent; color: var(--accent, #2563eb);
    font: 650 1rem 'Schibsted Grotesk', system-ui, sans-serif; }
  #practice-page .mobile-passage-tab.active { display: none; }
  #practice-page #mobile-tab-question { background: var(--accent, #2563eb); color: #fff; }
  #practice-page .mobile-passage-tab-dot { top: 8px; right: 12px; }
  body.dark-mode #practice-page .mobile-passage-tabs { background: var(--sv-night-card); border-color: var(--sv-night-line); }
  .practice-columns.mobile-tab-extract .practice-passage-area { animation: pr-sheet-up 0.32s var(--practice-ease); }

  /* match the pairs: the two lists side by side, every pair on one screen */
  #practice-page .vm-grid { grid-template-columns: 1fr 1fr; gap: 0.6rem; width: 100%; }
  #practice-page .vm-item { padding: 0.4rem 0.5rem; min-height: 46px; display: flex; align-items: center; justify-content: center; font-size: 0.97rem; line-height: 1.2; }
  #practice-page .vm-col { gap: 8px; }
}
@keyframes pr-sheet-up { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .practice-columns.mobile-tab-extract .practice-passage-area { animation: none; } }

/* a laptop: the reading tools' buttons in the side panel are quiet rows; the extract and the question share the width */
@media (min-width: 901px) {
  #practice-page .mobile-menu-btn { display: none; }
  #practice-page .practice-columns:has(.practice-passage-area[style*="flex"]) .content-view { justify-content: flex-start; }
}
/* an embedded practice lesson (the welcome page's sample) has no header: the name and the route stay */
html.sv-embed .pr-head { padding-top: 1rem; }
@media (max-width: 900px) { #score-bar-utils > * { min-height: 48px !important; font-size: 1rem !important; } }

/* a phone: every target a thumb's size (44px or more, 8px from the next) and every word 15px or more, at every stage of
   the route. Measured by scripts/tests/walks/app_targets_walk.py --practice. */
@media (max-width: 900px) {
  #practice-page .learn-counter, #practice-page .learn-difficulty, #practice-page .problem-number-label, #practice-page .problem-tier-pill,
  #practice-page .vm-col-label, #practice-page .panel-section-title, #practice-page .passage-header-badge, #practice-page .passage-footer,
  #practice-page .problem-walk-link, #practice-page .tl-legend, #practice-page .tl-legend span, #practice-page .tl-stmt,
  #practice-page .stmt-text, #practice-page .feedback-box p, #practice-page .feedback-box li, #practice-page .step-body,
  #practice-page .vm-matched-pair { font-size: 0.94rem; }
  #practice-page .passage-header-label { font-size: 0.84rem; }
  #practice-page .mc-letter { font-size: 0.94rem; }
  /* these three carry an older phone rule marked !important (.84rem, when they were capitals) */
  #practice-page .learn-difficulty, #practice-page .problem-tier-pill, #practice-page .problem-calc-pill, #practice-page .passage-header-badge { font-size: 0.94rem !important; }
  #practice-page .practice-panel .panel-section-title, #practice-page .practice-panel :is(.panel-method-content, .panel-method-steps, .step-body, .tier-intro-example) { font-size: 0.94rem; }
  #practice-page .problem-walk-link { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 0.4rem; }
  #practice-page .pr-progress-list { gap: 8px; }
  body.dark-mode #practice-page .page-header { background: color-mix(in srgb, var(--sv-night-page) 92%, transparent) !important; }   /* the laptop's dark header is split where the tools column ends: a phone has no such column */
  #practice-page .pr-prog-row { min-height: 48px; }
  #practice-page .pr-prog-row.is-level { min-height: 40px; }   /* not a button: no tap target to keep */
  /* sort each statement (explicit or implicit...): the choices are thumb-sized and go under a long statement */
  #practice-page .tl-stmt { flex-wrap: wrap; row-gap: 8px; }
  #practice-page .tl-stmt .stmt-text { flex: 1 1 9rem; }
  #practice-page .tl-btns { gap: 8px; margin-left: auto; }
  #practice-page .tl-btn { width: 44px; height: 44px; }
  /* the page tints over an extract: the swatch keeps its size, the tap area is a thumb's */
  #practice-page .passage-overlay-group { gap: 16px; }
  #practice-page .passage-overlay-btn { position: relative; width: 32px; height: 32px; }
  #practice-page .passage-overlay-btn::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; }
}

/* ==================== A PHONE: ONE SCREEN, ONE BAR OF ACTIONS (10 Nov 2026) ====================
   Tom: "on the app it should feel like an app ... big tappable buttons, everything on one screen more or less, as
   little scrolling as possible". By width only (600px and less), so the app and a phone's browser are the same page.
   A tablet and a laptop keep the layout above: these pieces are not shown there.
     top     the header; past the guide the lesson's name and the steps give way to ONE slim line (the full name and
             the route are in the Lesson Tools);
     middle  the task. Only this region scrolls, and only when the content cannot fit;
     foot    one bar of actions (js/practice/route.js draws it; its buttons press the page's own, which are not shown). */
.pr-bar, .pr-sheet, .pr-legal-btn, .pr-tools-lesson, .pr-status.is-examples { display: none; }

@media (max-width: 600px) {
  /* ---- the top ---- */
  #practice-page .page-header { padding-top: 4px; padding-bottom: 4px; }
  .pr-head { padding: 0.6rem 0.75rem 0; }
  .pr-h1 { font-size: 1.24rem; }
  .pr-route { margin-top: 0.4rem; }
  body:is([data-stage="examples"], [data-stage="questions"]) .pr-head { padding-top: 0.3rem; }
  body:is([data-stage="examples"], [data-stage="questions"]) .pr-head :is(.pr-eyebrow, .pr-h1, .pr-route) { display: none; }
  .pr-status { margin-top: 0; min-height: 36px; }
  .pr-status.is-examples { display: flex; }
  .pr-status.is-examples :is(.score-bar-streak, .tier-progress) { display: none; }
  .pr-status .pr-status-q { display: none; }   /* "Start · 3 of 8": the word "question" is for a wider line */

  /* ---- the middle ---- */
  #practice-page .content-view { padding: 0.4rem 0.75rem 0.5rem; }
  #practice-page .learn-card, #practice-page .problem-card { padding: 0.75rem 0.9rem 0.75rem; }
  #practice-page .problem-inputs { margin: 0.5rem 0 0.25rem; }
  #practice-page .problem-equation { margin-bottom: 0.5rem; font-size: 1.12rem; }
  #practice-page .guided-display { font-size: 1.08rem; }
  #practice-page .vm-matched-list:empty { margin: 0; }
  #practice-page .vm-col-label { margin-bottom: 0; }
  #practice-page .problem-stage { padding-bottom: var(--pr-sheet-h, 0px); }
  /* the slim line says the stage, the level and the question's number: the card does not say them again */
  #practice-page #current-problem-card :is(#problem-number-label, #problem-tier-pill), #practice-page :is(#learn-card, #guide-card) .learn-card-header { display: none; }
  #practice-page #current-problem-card .problem-card-header { min-height: 0; margin-bottom: 0.25rem; justify-content: center; }
  #practice-page #current-problem-card .problem-card-header:not(:has(.problem-calc-pill:not(:empty))) { display: none; }

  /* the page's own action buttons are pressed by the bar (route.js) and are not shown. They stay in the page, so
     everything that enables, renames or replaces them still works. */
  #practice-page :is(#problem-check-btn, #problem-next-area, #tier-intro-btn, #learn-actions, #guide-card .learn-actions, .guided-go, #guided-actions > button, #guided-skip-row, .mobile-passage-tabs) {
    position: absolute !important; visibility: hidden !important; width: 0 !important; height: 0 !important; min-width: 0 !important; min-height: 0 !important;
    margin: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; }

  /* answers and fields: rows a thumb can hit */
  #practice-page .mc-options { gap: 8px; }
  #practice-page .mc-option { min-height: 52px; margin: 0; }
  #practice-page #problem-inputs-area :is(input[type="text"], input[type="number"], input[type="tel"], input:not([type]), select), #practice-page .guided-input { min-height: 52px; font-size: 1.06rem; }
  #practice-page #problem-inputs-area textarea { font-size: 1rem; }
  #practice-page .vm-item { min-height: 48px; margin-bottom: 0; }

  /* ---- the foot: one bar (the site's one bar, css/bar.css: its look, its buttons, the guide's dots; job S3-03) ---- */
  #practice-page .pr-bar { flex: 0 0 auto; order: 6; }
  /* an end-of-level card is open: the bar under it is not an action now, so it is out of sight */
  body:has(#tier-fail-overlay.active) #practice-page .pr-bar,
  body:has(#summary-overlay.active) #practice-page .pr-bar { visibility: hidden; }
  #tier-fail-overlay .summary-btn, #summary-overlay .summary-btn { display: flex; width: 100%; }

  /* ---- what the page says about an answer: a sheet over the lower part of the question ---- */
  /* its look is the site's one sheet (.sv-sheet-inline, css/sheet.css; job S3-04): here only where it sits */
  #practice-page .pr-sheet { display: block; position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; max-height: 64%; overflow-y: auto; overscroll-behavior: contain;
    padding: 0.85rem 1rem 0.9rem; }
  #practice-page .pr-sheet[hidden] { display: none; }
  #practice-page .pr-sheet .problem-feedback-area { max-height: none; opacity: 1; margin: 0; padding: 0; overflow: visible; transform: none; }
  #practice-page .pr-sheet .feedback-box { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }

  /* ---- Lesson Tools: the lesson's name; the company's footer behind one row ---- */
  .pr-tools-lesson { display: block; padding: 0.9rem 0 0.1rem; }
  .pr-tools-lesson span { display: block; font: 500 0.94rem 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-muted, #6b665f); }
  .pr-tools-lesson strong { display: block; margin-top: 0.1rem; font: 700 1.18rem/1.25 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-primary, #2d2a26); }
  body.dark-mode .pr-tools-lesson strong { color: var(--sv-night-ink); }
  .pr-legal-btn { display: flex; align-items: center; width: calc(100% + 0.8rem); min-height: 48px; margin: 0.5rem -0.4rem 0; padding: 0 0.4rem; border: 0; border-radius: 8px; background: none; cursor: pointer;
    font: 500 1rem 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-primary, #2d2a26); text-align: left; }
  body.dark-mode .pr-legal-btn { color: var(--sv-night-ink); }
  #practice-page .practice-panel .sv-legal-footer { display: none; }
  #practice-page .practice-panel.legal-open .sv-legal-footer { display: block; }
}
/* a small phone (360 x 640): the same screen, a little closer, so seven pairs or four options still fit */
@media (max-width: 600px) and (max-height: 700px) {
  #practice-page .page-header { padding-top: 2px; padding-bottom: 2px; }
  .pr-status { min-height: 32px; }
  #practice-page .vm-item { min-height: 44px; }
  #practice-page .content-view { padding: 0.3rem 0.75rem 0.3rem; }
  #practice-page .learn-card, #practice-page .problem-card { padding: 0.6rem 0.8rem 0.6rem; }
  #practice-page .problem-equation { margin-bottom: 0.3rem; }
}

/* ==================== A PHONE: THE CARD USES THE SCREEN (job S3-03, 20 Nov 2026) ====================
   The card starts at the top and reaches down to the bar, or to the sheet while an answer's feedback is up, so no
   empty band of page lies between the question and the action under the thumb. A long card grows and the middle
   scrolls, as before. A tablet and a laptop are not changed. */
@media (max-width: 600px) {
  #practice-page .content-view { flex-direction: column; align-items: stretch; justify-content: flex-start; }
  #practice-page :is(.problem-stage, #learn-card, #guide-card) { flex: 1 0 auto; }
  #practice-page .problem-stage { display: flex; flex-direction: column; }
  #practice-page .problem-stage > .problem-card { flex: 1 0 auto; }
}

/* ---- the lesson's tools (job S5-16, 20 Nov 2026) ----
   The three steps are the site's quiet buttons (css/buttons.css: route.js gives them sv-btn sv-quiet), so a step that can
   be pressed looks it; a level under Questions stays a line of the list (116.3). Here only where they sit and their marks.
   In the drawer (900px and less) the guide card is not printed again under the steps: the Guide step opens it, and the
   tools come next (116.2, 116.4; a laptop keeps the card beside the work). The ways out are rows of one kind, each with
   its icon, Next lesson among them (117.1, 117.4; route.js wayRows). */
#practice-page .pr-progress-list { gap: 6px; }
#practice-page .pr-prog-step { justify-content: flex-start; gap: 0.7rem; width: 100%; padding: 0 0.6rem; text-align: left; }
.pr-prog-step.is-done .pr-prog-mark { border-color: var(--accent, #2563eb); color: var(--accent, #2563eb); }
.pr-prog-step.is-current .pr-prog-mark { background: var(--accent, #2563eb); border-color: var(--accent, #2563eb); color: #fff; }
.pr-prog-step.is-current .pr-prog-name { font-weight: 750; }
#practice-page .pr-prog-row.is-level { margin: 0; padding-left: calc(0.6rem + 26px + 0.7rem); }
@media (max-width: 900px) {
  #practice-page .practice-panel #panel-method { display: none !important; }
  #practice-page .pr-prog-row.is-level { font-size: 0.94rem; }   /* a level's name 15px on a phone, as every word there */
  #practice-page .pr-ways .header-nav a:is(:first-child, #nav-unit-overview, #nav-next-lesson)::before { content: ''; flex: 0 0 auto; width: 18px; height: 18px; margin-right: 0.7rem;
    position: static; inset: auto; transform: none;   /* not the header's divider */
    background: var(--text-secondary, #5a5651); -webkit-mask: var(--pr-way-icon) center / contain no-repeat; mask: var(--pr-way-icon) center / contain no-repeat; }
  #practice-page .pr-ways .header-nav a:first-child { --pr-way-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E"); }
  #practice-page .pr-ways .header-nav a#nav-unit-overview { --pr-way-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7'/%3E%3Crect x='14' y='3' width='7' height='7'/%3E%3Crect x='14' y='14' width='7' height='7'/%3E%3Crect x='3' y='14' width='7' height='7'/%3E%3C/svg%3E"); }
  #practice-page .pr-ways .header-nav a#nav-next-lesson { --pr-way-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='5 4 15 12 5 20 5 4'/%3E%3Cline x1='19' y1='5' x2='19' y2='19'/%3E%3C/svg%3E"); }
  body.dark-mode #practice-page .pr-ways .header-nav a:is(:first-child, #nav-unit-overview, #nav-next-lesson)::before { background: var(--sv-night-sec); }
  /* Next lesson: a row like the others here (a laptop's header keeps its main button), and no arrow */
  #practice-page .pr-ways .header-nav a#nav-next-lesson { display: flex; align-items: center; gap: 0; min-height: 48px; margin: 0 0 0 -0.4rem; padding: 0 0.4rem; border-radius: 8px;
    background: none; color: var(--text-primary, #2d2a26); font: 500 1rem 'Schibsted Grotesk', system-ui, sans-serif; filter: none; }
  #practice-page .pr-ways .header-nav a#nav-next-lesson .nav-arrow { display: none; }
  body.dark-mode #practice-page .pr-ways .header-nav a#nav-next-lesson { color: var(--sv-night-ink); }
  #practice-page .pr-ways .svtimer.icon .dial { width: 18px; height: 18px; }   /* the stopwatch the size of the other icons */
  #practice-page .pr-ways .svtimer.icon .dial .arcsvg { width: 13px; height: 13px; }
}

/* ==================== THE TOP OF A PHONE SCREEN (job S3-01, 20 Nov 2026) ====================
   The top said too much: the logo, "LESSON 1 OF 8" (printed into the menu button at 360px), the menu, the account
   circle, the unit, the title and the steps, with "Questions" at the screen's edge and the timer's orange badge over the
   logo. Now the count is in the Lesson Tools (#pr-tools-count), a running timer has its own place in the header
   row (js/timer.js), and the three steps fit a 360px screen with the page's margin at both ends. A tablet and a laptop keep
   the count in the header. */
.pr-tools-count { display: none; }
@media (max-width: 600px) {
  #practice-page .header-lesson-pill { display: none; }
  /* one row that fits 360px with a session's time in it: the site's 16px edges (as the one page header), 8px between */
  #practice-page .page-header { padding-left: 1rem; padding-right: 1rem; }
  #practice-page .page-header-inner { gap: 0.5rem; }
  #practice-page .page-header-inner > .sv-hdr-av { margin-left: 0; }
  #practice-page .pr-tools-count { display: block; margin: 0.1rem 0 0; font: 500 0.94rem 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-muted, #6b665f); }
  .pr-route li:not([hidden]) ~ li:not([hidden])::before { min-width: 0.5rem; margin: 0 0.35rem; }
  .pr-step { gap: 0.3rem; font-size: 0.94rem; }
  .pr-step-mark { width: 24px; height: 24px; }
}

/* ==================== ONE COUNT ON A SCREEN (job S3-05, 20 Nov 2026) ====================
   The status line is the one count of a level ("Start · 3 of 8"; at its end "Start · 7 of 8 right"), and its bar shows
   the same place. So the lesson's count is in the Lesson Tools at every size (never in the header), the card does not
   say "Q3" or the level again, the extract has no "Q 1 of 2", and there is no running score or "3 in a row"
   (js/practice/state-render.js levelPlace). The card's head holds only the calculator label, centred, and folds away
   when there is none. */
@media (min-width: 601px) {
  #practice-page .pr-tools-count { display: block; margin: 0.25rem 0 0; font: 500 0.94rem 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-muted, #6b665f); }
  #practice-page #current-problem-card .problem-card-header { justify-content: center; }
  #practice-page #current-problem-card .problem-card-header:not(:has(.problem-calc-pill:not(:empty))) { display: none; }
}

/* ==================== THE FEEDBACK PANEL (job S3-06, 20 Nov 2026) ====================
   After Check the marks go on the pupil's OWN rows: a small tick on a right choice, a small cross on a wrong one, on the
   choice itself and with no words (Tom's answer 3 of 18 Nov 2026), in a calm green and a soft brick (the quick quiz's
   two colours). The right choice the pupil did not make is the answer: a dashed green edge and a tick; it waits while a
   second go is on offer (js/practice/route.js SHOWS_ANSWER). A row left blank has no mark. A reason that belongs to a row
   is written in that row (.pr-row-answer), so the sheet stays short and does not cover the answer. The panel itself: a
   small mark and the title in the text's colour; no red border, red cross and red words together (118.6). */
#practice-page {
  --pr-ok: #3e7d58; --pr-ok-ink: #2c5940; --pr-ok-bg: color-mix(in srgb, #3e7d58 10%, var(--bg-card, #fff));
  --pr-no: #b06a5c; --pr-no-ink: #7c3434; --pr-no-bg: color-mix(in srgb, #a04848 7%, var(--bg-card, #fff));
  --pr-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  --pr-cross: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
}
body.dark-mode #practice-page { --pr-ok: #5d9c78; --pr-ok-ink: #9fd3b4; --pr-ok-bg: #1c2f24; --pr-no: #c08a7c; --pr-no-ink: #f0b3a3; --pr-no-bg: #33231f; }

/* the panel: a small calm mark, the title in the text's colour */
#practice-page .feedback-title, #practice-page .feedback-correct .feedback-title, #practice-page .feedback-incorrect .feedback-title { color: var(--text-primary, #2d2a26); }
body.dark-mode #practice-page .feedback-title { color: var(--sv-night-ink); }
#practice-page .feedback-icon { width: 1.5rem; height: 1.5rem; margin-top: 0.05rem; }
#practice-page .feedback-icon svg { width: 13px; height: 13px; }
#practice-page .feedback-correct .feedback-icon { background: var(--pr-ok-bg); color: var(--pr-ok); }
#practice-page .feedback-incorrect .feedback-icon { background: var(--pr-no-bg); color: var(--pr-no); }
#practice-page .feedback-body p { margin: 0.3rem 0 0; }
#practice-page .feedback-body .pr-fb-item { color: var(--text-primary, #2d2a26); }
#practice-page .feedback-body .pr-fb-right { color: var(--pr-ok-ink); font-weight: 700; }
#practice-page .feedback-body .pr-fb-answer { position: relative; padding-left: 1.5em; font-weight: 650; color: var(--text-primary, #2d2a26); }
#practice-page .feedback-body .pr-fb-answer::before { content: ""; position: absolute; left: 0; top: 0.2em; width: 1em; height: 1em; background: var(--pr-ok);
  -webkit-mask: var(--pr-tick) center / contain no-repeat; mask: var(--pr-tick) center / contain no-repeat; }
#practice-page .feedback-body .pr-fb-meaning { color: var(--text-muted, #6b665f); font-style: italic; }
#practice-page .feedback-body .pr-fb-order { margin: 0.3rem 0 0; padding-left: 1.6em; }
#practice-page .feedback-body .pr-fb-order li { margin: 0.2rem 0; padding-left: 0.2em; }
body.dark-mode #practice-page .feedback-body :is(.pr-fb-item, .pr-fb-answer) { color: var(--sv-night-ink); }

/* a choice, a row, a chip, a tile or a gap: right, wrong, the answer not chosen, left blank */
#practice-page :is(.mc-option.result-correct, .tl-stmt.result-correct, .cp-chip.result-correct, .em-item.result-correct, .reorder-item.result-correct,
  .sb-placed-tile.sb-correct-tile, .gf-gap.gf-correct) {
  border-color: var(--pr-ok); background: var(--pr-ok-bg); color: var(--pr-ok-ink); opacity: 1; }
#practice-page :is(.mc-option.result-incorrect, .tl-stmt.result-incorrect, .cp-chip.result-incorrect, .em-item.result-incorrect, .reorder-item.result-incorrect,
  .sb-placed-tile.sb-wrong-tile, .gf-gap.gf-wrong) {
  border-color: var(--pr-no); background: var(--pr-no-bg); color: var(--pr-no-ink); opacity: 1; }
#practice-page :is(.mc-option.was-answer, .cp-chip.result-missed) { border-color: var(--pr-ok); border-style: dashed; background: var(--bg-card, #fff); color: var(--text-primary, #2d2a26); opacity: 1; }
#practice-page :is(.tl-stmt.result-blank, .em-item.result-blank) { border-color: var(--border-light, #d9d4cc); border-style: dashed; background: var(--bg-card, #fff); }
body.dark-mode #practice-page :is(.mc-option.was-answer, .cp-chip.result-missed, .tl-stmt.result-blank, .em-item.result-blank) { background: transparent; color: var(--sv-night-ink); }
#practice-page .mc-option:is(.result-correct, .result-incorrect, .was-answer) .mc-letter { background: transparent; color: inherit; }
#practice-page .tl-stmt { flex-wrap: wrap; }
/* the small mark, on the choice itself: a tick or a cross ("" / "...": the words are for a screen reader only). The shared
   look has no weight (:where), so the tick, the cross and their words below always win over it */
#practice-page :where(.mc-option.result-correct, .tl-stmt.result-correct, .cp-chip.result-correct, .em-item.result-correct, .reorder-item.result-correct,
  .sb-placed-tile.sb-correct-tile, .gf-gap.gf-correct, .mc-option.was-answer, .cp-chip.result-missed, .sc-word.result-correct,
  .hw.correct:not(:has(+ .hw-sp.correct)), .hw.was-answer:not(:has(+ .hw-sp.was-answer)), .ms-span.result-correct-flag, .ms-span.result-missed,
  .spot-token.result-correct, .spot-token.result-missed)::after,
#practice-page :where(.mc-option.result-incorrect, .tl-stmt.result-incorrect, .cp-chip.result-incorrect, .em-item.result-incorrect, .reorder-item.result-incorrect,
  .sb-placed-tile.sb-wrong-tile, .gf-gap.gf-wrong, .hw.incorrect:not(:has(+ .hw-sp.incorrect)), .ms-span.result-wrong-flag, .spot-token.result-wrong)::after {
  content: ""; display: inline-block; flex: none; width: 0.95em; height: 0.95em; margin-left: 0.35em; vertical-align: -0.12em; text-decoration: none;
  background: var(--pr-ok); -webkit-mask: var(--pr-tick) center / contain no-repeat; mask: var(--pr-tick) center / contain no-repeat; }
#practice-page :is(.mc-option.result-correct, .tl-stmt.result-correct, .cp-chip.result-correct, .em-item.result-correct, .reorder-item.result-correct,
  .sb-placed-tile.sb-correct-tile, .gf-gap.gf-correct, .sc-word.result-correct, .hw.correct:not(:has(+ .hw-sp.correct)), .ms-span.result-correct-flag, .spot-token.result-correct)::after { content: ""; content: "" / "right"; }
#practice-page :is(.mc-option.was-answer, .cp-chip.result-missed, .hw.was-answer:not(:has(+ .hw-sp.was-answer)), .ms-span.result-missed, .spot-token.result-missed)::after { content: ""; content: "" / "the answer"; }
#practice-page :is(.mc-option.result-incorrect, .tl-stmt.result-incorrect, .cp-chip.result-incorrect, .em-item.result-incorrect, .reorder-item.result-incorrect,
  .sb-placed-tile.sb-wrong-tile, .gf-gap.gf-wrong, .hw.incorrect:not(:has(+ .hw-sp.incorrect)), .ms-span.result-wrong-flag, .spot-token.result-wrong)::after {
  content: ""; content: "" / "not right"; background: var(--pr-no); -webkit-mask-image: var(--pr-cross); mask-image: var(--pr-cross); }
#practice-page :is(.mc-option, .tl-stmt, .reorder-item):is(.result-correct, .result-incorrect, .was-answer)::after { margin-left: auto; width: 1.1em; height: 1.1em; }
#practice-page .tl-stmt:is(.result-correct, .result-incorrect)::after { margin-left: 0.5rem; align-self: center; }
/* a claim of "match the evidence" is a block that may carry its answer under it: its mark goes first, on its first line */
#practice-page #current-problem-card .em-item:is(.result-correct, .result-incorrect)::after { content: none; }
#practice-page .em-item:is(.result-correct, .result-incorrect)::before { content: ""; content: "" / "right"; display: inline-block; width: 0.95em; height: 0.95em; margin-right: 0.4em; vertical-align: -0.12em;
  background: var(--pr-ok); -webkit-mask: var(--pr-tick) center / contain no-repeat; mask: var(--pr-tick) center / contain no-repeat; }
#practice-page .em-item.result-incorrect::before { content: ""; content: "" / "not right"; background: var(--pr-no); -webkit-mask-image: var(--pr-cross); mask-image: var(--pr-cross); }

/* words in a text: right, wrong, the answer not chosen */
#practice-page :is(.hw.correct, .ms-span.result-correct-flag, .spot-token.result-correct, .sc-word.result-correct) { background: var(--pr-ok-bg); color: var(--pr-ok-ink); border-bottom-color: var(--pr-ok); text-decoration-color: var(--pr-ok); }
#practice-page :is(.hw.incorrect, .ms-span.result-wrong-flag, .spot-token.result-wrong) { background: var(--pr-no-bg); color: var(--pr-no-ink); border-bottom-color: var(--pr-no); text-decoration-color: var(--pr-no); }
#practice-page :is(.hw.was-answer, .ms-span.result-missed, .spot-token.result-missed) { background: transparent; border-bottom: 2px dashed var(--pr-ok); text-decoration-color: var(--pr-ok); }
#practice-page .spot-token.result-missed, #practice-page .ms-span.result-missed { text-decoration: none; }
#practice-page .sc-word.result-correct { border-bottom: 2px solid var(--pr-ok); }
/* an error's fix, written after the wrong word with the answer (159.2); the wrong word is struck through */
#practice-page .spot-fix { display: none; }
#practice-page .spot-fix.pr-answer-on { display: inline; margin-left: 0.3em; font-weight: 700; color: var(--pr-ok-ink); }
#practice-page .spot-token:has(+ .spot-fix.pr-answer-on) { text-decoration: line-through; text-decoration-color: var(--pr-no); }
/* typed answers: the box's edge says right or wrong, calmly */
#practice-page :is(.problem-input, .fraction-num, .fraction-den, .sf-a, .sf-n).input-incorrect { border-color: var(--pr-no); background: var(--pr-no-bg); color: var(--pr-no-ink); }
#practice-page :is(.problem-input, .fraction-num, .fraction-den, .sf-a, .sf-n).input-correct { border-color: var(--pr-ok); background: var(--pr-ok-bg); color: var(--pr-ok-ink); }
#practice-page .gf-input.gf-correct { border-bottom-color: var(--pr-ok); color: var(--pr-ok-ink); }
#practice-page .gf-input.gf-wrong { border-bottom-color: var(--pr-no); color: var(--pr-no-ink); }
/* dictation: the pupil's own words, the wrong ones struck through in the soft brick */
#practice-page .dt-word-correct { color: var(--pr-ok-ink); }
#practice-page .dt-word-wrong { color: var(--pr-no-ink); text-decoration-color: var(--pr-no); }

/* the answer of one row, in that row (shown with the answer) */
#practice-page .pr-row-answer { display: none; }
#practice-page .pr-row-answer.pr-answer-on { display: block; flex: 1 1 100%; order: 9; position: relative; margin-top: 0.45rem; padding-left: 1.45em; text-align: left;
  font: 400 0.94rem/1.45 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-primary, #2d2a26); }
#practice-page .pr-row-answer.pr-answer-on::before { content: ""; position: absolute; left: 0; top: 0.22em; width: 1em; height: 1em; background: var(--pr-ok);
  -webkit-mask: var(--pr-tick) center / contain no-repeat; mask: var(--pr-tick) center / contain no-repeat; }
#practice-page .pr-row-answer strong { color: var(--pr-ok-ink); }
body.dark-mode #practice-page .pr-row-answer.pr-answer-on { color: var(--sv-night-ink); }

/* match the pairs, every pair made: each right word beside its left word, in the calm green, not faded (167.2) */
#practice-page .vm-item.vm-done { opacity: 1; transform: none; border-color: var(--pr-ok); background: var(--pr-ok-bg); color: var(--pr-ok-ink); }

/* a level not passed: the score in the text's colour and a calmer size; it was the largest thing, in red-orange (128.2) */
#practice-page .tier-fail-score { font-size: 1.6rem; font-weight: 700; color: var(--text-primary, #2d2a26); }
body.dark-mode #practice-page .tier-fail-score { color: var(--sv-night-ink); }
/* a row's right place in the order, a small dashed green circle after its cross (161.2), shown with the answer */
#practice-page .reorder-right { display: none; }
#practice-page .reorder-right.pr-answer-on { display: inline-flex; order: 2; flex: none; align-items: center; justify-content: center; width: 24px; height: 24px; margin-left: 0.45rem;
  border: 1.5px dashed var(--pr-ok); border-radius: 50%; box-sizing: border-box; font: 700 0.8rem 'Schibsted Grotesk', system-ui, sans-serif; color: var(--pr-ok-ink); }
/* the reasons of a type with several, behind one quiet "Why?" (english-check.js fbWhy): the sheet stays one line */
#practice-page .feedback-body .pr-fb-why-btn { margin-top: 0.5rem; }
#practice-page .feedback-body .pr-fb-why { margin-top: 0.3rem; }
#practice-page .feedback-body .pr-fb-why[hidden] { display: none; }

/* ==================== ONE HINT, BEHIND A BUTTON (job S3-08, 20 Nov 2026) ====================
   Under the answer, two quiet buttons of the site (css/buttons.css), side by side: "Hint" (ONE hint: the question's
   own, or the level's rule, with the equation where it helps; js/practice/state-render.js practiceHint) and "Show me
   how" (the walk-through; it was the grey line "Stuck? Do this one with me instead"). They stay in the card on a phone:
   they are not the action of the moment, which is in the bar. The hint opens under them. A role play's notes under each
   task wait for the same button. After a wrong answer, "Show me how" is a button in the panel too. */
#practice-page .pr-help { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0.9rem 0 0; }
#practice-page .pr-help[hidden] { display: none; }
#practice-page .problem-hint { max-width: 32rem; margin: 0.6rem auto 0; padding: 0.65rem 0.9rem; border-radius: 10px; background: var(--sv-tint, rgba(91, 70, 50, 0.07));
  font: 400 1rem/1.5 'Schibsted Grotesk', system-ui, sans-serif; font-style: normal; color: var(--text-primary, #2d2a26); text-align: left; }
#practice-page .problem-hint[hidden] { display: none; }
#practice-page .problem-hint .problem-hint-eq { text-align: center; font-size: 1.08rem; }
#practice-page .problem-hint .problem-hint-eq + .problem-hint-text { margin-top: 0.4rem; }
#practice-page .problem-hint .problem-hint-text { margin: 0; }
body.dark-mode #practice-page .problem-hint { color: var(--sv-night-ink); }
#practice-page .rp-note { display: none; }
#practice-page #current-problem-card.pr-hint-open .rp-note { display: block; }
#practice-page .pr-fb-acts { margin-top: 0.7rem; }

/* ==================== THE EXTRACT SHEET (job S3-07, 20 Nov 2026; Tom's decision 13 of 17 Nov 2026) ====================
   No button swaps a phone's screen between the question and what it is about. A new extract is first its own screen,
   read before its questions (the bar: "Start the questions"); during them the extract, the chart, the map or the tools
   is the site's one sheet (css/sheet.css, js/sheet.js) docked at the foot over the bar (js/practice/passage-ui.js
   svDock): its head (the handle, the name of what it holds, and a close while it is up) stays in view; it rises to half
   the room with the question in view above it, or to all of it under the status line. It scrolls as one, so it keeps
   its place. The reading tools are in the Lesson Tools on a phone (route.js placeReading). A tablet and a laptop keep
   their layout; at every size the extract has no large first letter (127.7) and no "Source Extract" foot (115.4). */
#practice-page .passage-body .passage-text::first-letter { font-size: inherit; font-weight: inherit; color: inherit; }

@media (max-width: 600px) {
  /* the extract carries no row of tools, and its head is its title (in the sheet's own words, not in capitals) */
  #practice-page .practice-passage-area .passage-a11y-mobile, #practice-page .practice-passage-area > .passage-header { display: none; }
  #practice-page .pr-dock-name { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; min-height: 44px; margin: 0; padding: 0; border: 0;
    background: none; color: inherit; font: inherit; text-align: left; cursor: inherit; -webkit-tap-highlight-color: transparent; }
  #practice-page .pr-dock-name .sv-sheet-title { flex: 0 1 auto; color: var(--text-primary, #2d2a26); }
  body.dark-mode #practice-page .pr-dock-name .sv-sheet-title { color: var(--sv-night-ink); }
  #practice-page .pr-dock-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent, #2563eb); }
  #practice-page .pr-dock-dot[hidden] { display: none; }

  /* the extract read first: the head is its title, with no handle and no close; the text under it scrolls */
  #practice-page .practice-columns.mobile-tab-extract .pr-dock-head { position: static; margin: 0; padding: 0.75rem 1rem 0; background: none; cursor: default; touch-action: auto; }
  #practice-page .practice-columns.mobile-tab-extract .pr-dock-head :is(.sv-sheet-grip, .pr-dock-x) { display: none; }
  #practice-page .practice-columns.mobile-tab-extract .pr-dock-name { cursor: default; }
  #practice-page .practice-columns.mobile-tab-extract .practice-passage-area { animation: none; }

  /* the sheet, docked at the foot over the bar: its height is one of three rests (svDock), or the finger's while it is dragged */
  #practice-page .practice-columns.mobile-tab-question .practice-passage-area.pr-dock[style*="flex"] { display: block !important; }
  #practice-page .practice-passage-area.pr-dock { inset: auto 0 var(--pr-dock-b, 0px) 0 !important; height: var(--pr-dock-h, 60px) !important; max-height: none !important;
    z-index: 40; padding-bottom: 12px !important; transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1); animation: none; }
  #practice-page .practice-passage-area.pr-dock[data-rest="peek"] { overflow: hidden !important; }
  #practice-page .practice-passage-area.pr-dock.pr-dock-drag { transition: none; }
  #practice-page .pr-dock .pr-dock-head { margin-bottom: 0; padding-top: 14px; padding-bottom: 10px; }   /* its name 8px or more from the bar's buttons */
  #practice-page .pr-dock-name:disabled { opacity: 1; color: inherit; cursor: default; }
  #practice-page .pr-dock .pr-dock-name .sv-sheet-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #practice-page .pr-dock[data-rest="peek"] .pr-dock-x { display: none; }
  #practice-page .pr-dock .passage-body { overflow: visible; padding: 0.25rem 0 0.5rem; }
  #practice-page .pr-dock :is(.chart-panel-body, .stats-tool) { overflow: visible; padding-left: 0; padding-right: 0; }
  /* the question keeps its room above the sheet's head; the answer's own sheet rises above it too */
  #practice-page .practice-columns:has(> .pr-dock) .content-viewport { margin-bottom: var(--pr-dock-room, var(--pr-dock-peek, 60px)); }
  /* the tools in the sheet: their name is its head's; the calculator's keys a thumb's size (44px), its display slimmer */
  #practice-page .pr-dock .stats-tool-title { display: none; }
  #practice-page .pr-dock .calc-display { min-height: 0; padding: 0.4rem 0.75rem; }
  #practice-page .pr-dock .calc-btn { min-height: 44px; padding: 0; }

  /* the reading tools in the Lesson Tools: Read aloud a row as the others, the page colours a row of swatches (no label) */
  #practice-page .pr-settings .score-bar-a11y:not([style*="none"]) { display: flex !important; flex-direction: column; align-items: stretch; gap: 4px; margin: 0 0 4px; }
  #practice-page .pr-settings .passage-a11y-btn { display: flex; align-items: center; gap: 0.7rem; min-height: 48px; padding: 0 0.4rem; margin: 0 -0.4rem; border: 0; border-radius: 8px;
    background: none; font: 500 1rem 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-primary, #2d2a26); }
  #practice-page .pr-settings .passage-a11y-btn svg { width: 18px; height: 18px; color: var(--text-secondary, #5a5651); }
  #practice-page .pr-settings .passage-a11y-btn[aria-pressed="true"] { background: none; color: var(--accent, #2563eb); }
  #practice-page .pr-settings .passage-a11y-btn[aria-pressed="true"] svg { color: currentColor; }
  body.dark-mode #practice-page .pr-settings .passage-a11y-btn { color: var(--sv-night-ink); }
  #practice-page .pr-settings .score-bar-a11y .passage-overlay-group { flex-wrap: wrap; justify-content: flex-start; gap: 16px; padding: 8px 0; }
}
@media (max-width: 600px) and (prefers-reduced-motion: reduce) { #practice-page .practice-passage-area.pr-dock { transition: none; } }

/* ==================== TYPING ON A PHONE (job S3-10, 20 Nov 2026) ====================
   With the keyboard up the bar stays on it and the field stays in view: practice.html asks the browser to shrink the
   page for the keyboard (interactive-widget=resizes-content); a browser that shrinks only what is visible gives the
   page the visible height (--pr-kb, js/practice/route.js keyboard). Two short answers sit in one row; a writing box
   fills the card and grows as the pupil types (js/util.js svGrow), with the question's marks and the words written
   under it; accent keys are a thumb's size and, while their field is typed in, sit in one row on the bar. A field's
   text is 16px or more, so a phone never zooms in on it. A tablet and a laptop keep their fields. */
#practice-page .pr-write-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
#practice-page .pr-words { font-style: normal; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 600px) {
  #practice-page { height: calc(100vh - var(--pr-kb, 0px)); height: calc(100dvh - var(--pr-kb, 0px)); }
  #practice-page :is(#problem-inputs-area, .guided-card) :is(input:not([type="hidden"]), textarea) { font-size: max(16px, 1.06rem); }
  #practice-page #problem-inputs-area textarea { font-size: max(16px, 1rem); }

  /* two short answers side by side: "x = [ ] and y = [ ]", "x = [ ] or x = [ ]" (134.3, 136.1, 136.4) */
  #practice-page .problem-inputs:has(> #problem-input-b) { flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 8px; }
  #practice-page .problem-inputs:has(> #problem-input-b) > .problem-input { flex: 1 1 0; width: auto; min-width: 0; }
  #practice-page .problem-inputs:has(> #problem-input-b) > label { flex: none; white-space: nowrap; font-size: 1.06rem; }
  #practice-page .problem-inputs:has(> #problem-input-b) > .problem-input-separator { display: inline; flex: none; font-size: 1rem; }

  /* a writing box fills the card down to the bar; its marks and its words under it (162.5, 163.1, 163.2, 164.2) */
  #practice-page #current-problem-card:has(#problem-inputs-area > .rs-textarea) { display: flex; flex-direction: column; }
  #practice-page #problem-inputs-area:has(> .rs-textarea) { flex: 1 1 auto; flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  #practice-page #problem-inputs-area > .rs-textarea { flex: 1 1 auto; min-height: 7.5rem; line-height: 1.5; resize: none; }
  #practice-page #problem-inputs-area > .rs-textarea.rs-write { min-height: 11rem; }

  /* accent keys a thumb's size (173.1); while their field is typed in they are the bar's first row, on the keyboard and
     never scrolled away from the lower boxes (176.4; route.js typing moves them there and back) */
  #practice-page .accent-bar { gap: 8px; }
  #practice-page .accent-btn { flex: none; width: 44px; height: 44px; border-radius: 10px; font-size: 1.1rem; }
  #practice-page #pr-bar > .accent-bar { order: -2; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    margin: 0 -12px; padding: 0 12px 2px; }
}

/* ==================== A LEVEL PASSED, THE NEXT LEVEL, THE LESSON'S END (job S5-24, 20 Nov 2026) ====================
   A level passed: "Start level passed" in its white box, and ONE button, "Next level" ("Finish" after the last): it no
   longer goes by itself after 1.5 seconds, and the question under it is out of sight (not seen through: 126.4, Tom on
   126). On a phone the bar's one button presses it (route.js actions), so the box does not show its own. A level's first
   question says where the pupil is in one line under the status line (#pr-level-line, route.js). The lesson's end: a
   small tick by each level passed and its score, no bars (130.6); "Next lesson" the main button (130.1), the questions
   missed one press away (130.3), "Do the lesson again" and "Home" quiet (130.5). */
#practice-page .tier-celebration { background: var(--bg, #faf8f5); }
body.dark-mode #practice-page .tier-celebration { background: var(--sv-night-page); }
#practice-page .celebration-sub:empty { display: none; }
#practice-page .celebration-badge .celebration-next { grid-column: 1 / -1; justify-self: center; margin-top: 0.9rem; }
.pr-level-line { margin: 0.15rem 0 0; font: 500 0.94rem/1.35 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-secondary, #5a5651); }
.pr-level-line[hidden] { display: none; }
body.dark-mode .pr-level-line { color: var(--sv-night-sec); }

#practice-page .summary-tier-row { display: grid; grid-template-columns: 22px auto 1fr; align-items: center; column-gap: 0.6rem; }
#practice-page .summary-tier-row[hidden] { display: none; }
#practice-page .summary-tier-mark { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; color: var(--pr-ok, #3e7d58); }
#practice-page .summary-tier-mark svg { width: 18px; height: 18px; }
#practice-page .summary-tier-count { justify-self: end; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-secondary, #5a5651); }
body.dark-mode #practice-page .summary-tier-count { color: var(--sv-night-sec); }
#practice-page .summary-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
#practice-page .summary-quiet { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
#practice-page .summary-quiet .summary-btn { flex: 1 1 auto; width: auto; white-space: nowrap; }
#practice-page .summary-main[hidden], #practice-page .summary-missed[hidden] { display: none; }
#practice-page .summary-modal:has(.summary-missed:not([hidden])) { max-height: calc(100dvh - 3rem); overflow-y: auto; overscroll-behavior: contain; }
#practice-page .summary-missed-list { display: flex; flex-direction: column; gap: 12px; text-align: left; }
#practice-page .summary-missed-card { display: block; margin: 0; padding: 0.9rem 1rem; border: 1px solid var(--border-light, #e8e4df); border-radius: 12px; box-shadow: none;
  opacity: 1; transform: none; animation: none; }
#practice-page .summary-missed-said { margin-top: 0.6rem; }
#practice-page .summary-missed #summary-missed-back { width: 100%; margin-top: 12px; }
body.dark-mode #practice-page .summary-missed-card { border-color: var(--sv-night-line); }

@media (max-width: 600px) {
  #practice-page #celebration-next { position: absolute !important; visibility: hidden !important; width: 0 !important; height: 0 !important; min-width: 0 !important; min-height: 0 !important;
    margin: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; }
  body:has(#tier-celebration.active) #practice-page :is(.practice-passage-area.pr-dock, .pr-sheet) { visibility: hidden; }   /* the level is done: no extract, no answer sheet over the box */
  body:has(#summary-overlay.active) #practice-page .practice-passage-area.pr-dock { visibility: hidden; }   /* as the bar under the lesson's end */
  #practice-page .summary-modal:has(.summary-missed:not([hidden])) { padding: 1.25rem 1rem; }
}

/* ==================== THE GUIDE AND THE EXAMPLES (job S5-23, 20 Nov 2026) ====================
   The guide's list has plain numbers, not circles: its circles 1 to 5 looked like the route's 1 to 3 just above them
   (112.3). An example with an extract: the task is pinned at the top at every size (a phone's head was not pinned, and the
   extract sat inside it, so the task scrolled away); the extract is under it; ONE step shows at a time, at the foot of
   the view with a laptop's buttons, and its words are marked in the extract (114.1, 114.3; js/practice/modes.js
   learnMarkStep). A worked sum with no extract keeps its lines, each building on the one before. A walk-through's way
   back to the question ("Answer it myself", 120.2) is a quiet button of the site; a phone's bar presses it. */
#practice-page .panel-method-steps li::before { content: counter(panel-step) "."; display: block; flex: none; width: auto; min-width: 1.3em; height: auto;
  background: none; border-radius: 0; font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-secondary, #5a5651); }

#practice-page .learn-extract { margin: 0 0 0.75rem; }
#practice-page .learn-extract[hidden] { display: none; }
#practice-page .learn-extract .learn-passage-label { margin-top: 0; }
#practice-page .learn-extract-text { margin: 0.4rem 0 0; font-style: normal; font-weight: 400; font-size: 1.02rem; line-height: 1.85; text-align: left; white-space: pre-line; }
#practice-page .learn-card.has-extract .learn-card-head { position: sticky; top: 0; max-height: none; overflow: visible; box-shadow: 0 -0.6rem 0 var(--bg-card, #fff); }
#practice-page .learn-card.has-extract .learn-card-head.is-stuck { box-shadow: 0 -0.6rem 0 var(--bg-card, #fff), 0 12px 14px -12px rgba(0, 0, 0, 0.25); }
#practice-page .learn-card.has-extract .learn-card-head::after { display: none; }
#practice-page .learn-card.has-extract .learn-question { margin-bottom: 0.25rem; }
#practice-page .learn-card.has-extract .learn-foot { position: sticky; bottom: 0; z-index: 3; background: var(--bg-card, #fff); }
#practice-page .learn-card.has-extract .learn-foot:has(.learn-step.revealed) { box-shadow: 0 -12px 14px -12px rgba(0, 0, 0, 0.25); }
#practice-page .learn-card.has-extract .learn-steps-area { max-height: 45vh; overflow-y: auto; overscroll-behavior: contain; }
#practice-page .learn-card.has-extract .learn-step.is-past { display: none; }
#practice-page .learn-step.revealed { max-height: 80vh; }   /* a long answer is not cut at 260px */
#practice-page .learn-mark { padding: 0; color: inherit; }   /* no padding: a full stop after the marked words keeps its place */

#practice-page .guided-skip-row { display: flex; justify-content: center; margin-top: 0.75rem; }
#practice-page .guided-skip-row:empty { display: none; }
#practice-page .guided-skip-row .guided-skip { margin: 0; }

/* ==================== MATHS QUESTION TYPES (job S5-25, 20 Nov 2026) ====================
   A bare sum has "Work out" above it (141.4); its fractions are set at the text's size (state-render.js practiceDisplay,
   141.2). The two boxes of a fraction are 12px apart (141.3). Standard form: the power's box looks like a power,
   smaller and raised beside the 10, while its touch area stays a thumb's (52 x 44px): the field is that size and its
   drawn box sits 6px inside a clear border (143.1, 143.3, 144.4). The right answer is set as maths too (check.js
   practiceAnswerHtml: 137.5, 142.3, 144.3). */
#practice-page .pr-workout { display: block; margin: 0 auto 0.35rem; font: 600 0.94rem/1.3 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-secondary, #5a5651); letter-spacing: 0; }
#practice-page .problem-equation .katex .mfrac { margin: 0 0.08em; }
#practice-page .fraction-input .fraction-line { margin: 5px 0; }

#practice-page .standard-form-input { display: inline-flex; align-items: flex-end; gap: 0; margin: 0 auto; font: 600 1.25rem/1 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-primary, #2d2a26); }
#practice-page #problem-inputs-area .standard-form-input .sf-a { width: 5.5rem; min-height: 52px; height: 52px; margin-top: 24px; padding: 0 0.5rem; font-size: 1.2rem; }
#practice-page .standard-form-input .sf-multiply { padding: 0 0.1rem 15px 0.55rem; font-weight: 600; white-space: nowrap; }
#practice-page #problem-inputs-area .standard-form-input .sf-n { align-self: flex-start; box-sizing: border-box; width: 52px; min-width: 52px; height: 44px; min-height: 44px;
  margin: 0 0 0 -0.1rem; padding: 0; border: 6px solid transparent !important; border-radius: 13px; background-clip: padding-box;
  box-shadow: inset 0 0 0 1.5px var(--border-light, #e0dcd7); font-size: 16px; font-weight: 600; text-align: center; }
#practice-page #problem-inputs-area .standard-form-input .sf-n:focus { box-shadow: inset 0 0 0 2px var(--accent, #7c3aed); }
#practice-page #problem-inputs-area .standard-form-input .sf-n.input-correct { box-shadow: inset 0 0 0 2px var(--pr-ok); }
#practice-page #problem-inputs-area .standard-form-input .sf-n.input-incorrect { box-shadow: inset 0 0 0 2px var(--pr-no); }

/* ==================== SCIENCE CALCULATIONS AND CHARTS (job S5-26, 20 Nov 2026) ====================
   One look with the rest of the app (Tom on 123 and 124: "messy", "different fonts, weights, styles"): Schibsted
   Grotesk on every word and key; "Answer =" and its field on one row, the unit inside the field's right end (124.3);
   "No calculator" a small label just above the answer, no longer the card's title (123.4; a question that allows a
   calculator shows the calculator, not its name); a chemical equation kept whole (138.3). The calculator has brackets,
   a power and standard form (121.3) and one heading (121.2). A chart has a title, the app's colours, a line at every
   step and the room the width allows (125.1, 125.4 to 125.6; js/practice/passage.js practiceDrawChart); on a tablet it
   sits in the card above the question. */
#practice-page #current-problem-card > .problem-calc-pill { display: block; margin: 0.15rem 0 0.1rem; text-align: center; font-size: 0.94rem !important; font-weight: 500 !important; }
#practice-page .pr-chem { display: inline-block; }
#practice-page .pr-chem-side { white-space: nowrap; }

#practice-page .problem-inputs:has(> .pr-field) { flex-wrap: nowrap; }
#practice-page .pr-field { position: relative; display: inline-flex; align-items: center; flex: 0 1 calc(8rem + var(--pr-unit-w, 0px)); min-width: 0; }
#practice-page .pr-field > .problem-input { width: 100%; padding-right: calc(var(--pr-unit-w, 0px) + 1.35rem); }
#practice-page .pr-field > .problem-answer-unit { position: absolute; right: 0.9rem; top: 50%; transform: translateY(-50%); margin: 0; pointer-events: none;
  font: 500 0.94rem/1.2 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-muted, #6b665f); white-space: nowrap; }
#practice-page .problem-inputs:has(> .pr-field) > label { white-space: nowrap; }
@media (max-width: 600px) {
  #practice-page .problem-inputs:has(> .pr-field) { flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 10px; }
  #practice-page .problem-inputs > .pr-field { flex: 1 1 auto; }
}

#practice-page .pr-calc .calc-grid { grid-template-columns: repeat(5, 1fr); }
#practice-page .pr-calc .calc-btn { font-family: 'Schibsted Grotesk', system-ui, sans-serif; }
#practice-page .pr-calc .calc-btn.calc-eq { grid-column: span 3; }
#practice-page .pr-calc .calc-value sup { font-size: 0.66em; line-height: 0; vertical-align: 0.55em; }
#practice-page .pr-calc .calc-expr { font-size: 0.94rem; }   /* the sum after =: 15px, as every word on a phone */
#practice-page .pr-calc .calc-expr sup { font-size: 0.8em; line-height: 0; vertical-align: 0.5em; }
#practice-page .pr-calc .calc-value { overflow-wrap: anywhere; }
#practice-page .pr-calc .calc-display { margin-bottom: 0.5rem; }

#practice-page .pr-chart-title { margin: 0 0 0.5rem; font: 650 1rem/1.35 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-primary, #2d2a26); text-align: center; text-wrap: balance; }
#practice-page .pr-chart-box { position: relative; width: 100%; height: clamp(220px, 62vw, 340px); }
#practice-page .pr-chart-body { flex-direction: column; align-items: stretch; justify-content: center; padding: 1rem 1.25rem; }
#practice-page .pr-chart-body .pr-chart-box { height: min(56vh, 420px); }
#practice-page .problem-chart-container { max-width: none; max-height: none; margin: 0 0 1.1rem; padding: 0; background: none; border: 0; border-radius: 0; }   /* no box in the card's box */
#practice-page .problem-chart-container canvas { max-height: none !important; }
#practice-page .problem-chart-container .pr-chart-box { height: clamp(220px, 42vw, 340px); }
@media (max-width: 600px) {
  #practice-page .pr-dock .pr-chart-body { padding: 0.25rem 0 0.5rem; }
  #practice-page .pr-dock .pr-chart-body .pr-chart-box { height: clamp(210px, 60vw, 300px); }
}

/* ==================== ENGLISH QUESTION TYPES (job S5-27, 20 Nov 2026) ====================
   The look of the inputs, not what they store (js/practice/english-inputs.js). One line says how to answer (.pr-how,
   the question's hint line). Sort each statement: the choices are buttons with their words, in a row under the
   statement (145.1, 145.2). Mark a sentence: two taps, one run of colour (148.2, 149.2). Choose every answer and spot
   the wrong summaries: full-width rows with a tick box (150.2, 155.3). Match the evidence: the quote sits under its claim
   (153.4, 154.2). Spot the errors: no underline until a word is tapped, and larger words (158.4). Put in order: the rows
   move into the order chosen and an empty circle shows the next number faintly (160.2, 161.3). Writing: the sentence to
   improve in a plain box (162.2), the marks under the box in plain type (163.4, 164.6), a long task's first sentence as
   its heading and the rest in plain words (164.1). After an answer the "Clear" buttons go. A choice that is CHOSEN is in
   the lesson's colour; right and wrong keep the feedback panel's own marks (job S3-06). Colours are the site's tokens,
   so the night look follows. */

/* sort each statement */
#practice-page .tl-stmt.tl-stmt--words { align-items: flex-start; row-gap: 10px; padding: 0.75rem 0.85rem; }
#practice-page .tl-stmt--words .stmt-text { flex: 1 1 0; min-width: 0; font-size: 1rem; line-height: 1.45; }
#practice-page .tl-stmt--words::after { order: 1; }
#practice-page .tl-stmt--words .tl-btns { order: 2; flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
#practice-page .tl-stmt--words .pr-row-answer { order: 9; }
#practice-page .tl-stmt .tl-btn { flex: 1 1 0; min-width: min(7.5rem, 100%); width: auto; height: auto; min-height: 44px; margin: 0; padding: 0.45rem 0.75rem;
  box-sizing: border-box; border: 1.5px solid var(--border-light, #e0dcd7); border-radius: 10px; background: var(--bg-card, #fff); color: var(--text-primary, #2d2a26);
  font: 600 0.97rem/1.25 'Schibsted Grotesk', system-ui, sans-serif; text-align: center; transform: none; cursor: pointer; }
#practice-page .tl-stmt .tl-btn:hover { transform: none; background: var(--bg-card, #fff); border-color: var(--accent, #7c3aed); }
#practice-page .tl-stmt .tl-btn.selected { border: 2px solid var(--accent, #7c3aed); background: var(--accent-badge, #ede9fe); color: var(--text-primary, #2d2a26); font-weight: 700; }

/* mark a sentence: the first word waits with a ring; the spaces between marked words are marked too */
#practice-page .hl-passage { -webkit-touch-callout: none; touch-action: manipulation; }
#practice-page .hl-passage .hw { border-radius: 0; }
#practice-page :where(.hw, .hw-sp).selected { background: color-mix(in srgb, var(--accent, #7c3aed) 20%, transparent); border-bottom: 2px solid var(--accent, #7c3aed); }
#practice-page .hw.hl-first { outline: 2px solid var(--accent, #7c3aed); outline-offset: 1px; border-radius: 3px; }
#practice-page .hw-sp { padding: 1px 0; }
#practice-page .hw-sp.correct { background: var(--pr-ok-bg); border-bottom: 2px solid var(--pr-ok); }
#practice-page .hw-sp.incorrect { background: var(--pr-no-bg); border-bottom: 2px solid var(--pr-no); }
#practice-page .hw-sp.was-answer { background: transparent; border-bottom: 2px dashed var(--pr-ok); }
@media (max-width: 700px) { html:root body .hw-sp { font-size: 1rem; } }   /* as the words (.hw), so a space is a word's space */

/* rows with a tick box: choose every answer, the summaries */
/* the lists fill the card's width, whatever the length of their words */
#practice-page :is(.tl-statements, .cp-chips, .ms-summary.ms-rows, .em-grid, .reorder-items, .rp-bullets, .rp-steps) { width: 100%; box-sizing: border-box; }
#practice-page .cp-chips { flex-direction: column; flex-wrap: nowrap; gap: 8px; }
#practice-page .ms-summary.ms-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 0.25rem; padding: 0; border: 0; background: none; }
#practice-page :is(.cp-chip, .ms-rows .ms-span) { display: flex; align-items: center; gap: 0.75rem; width: 100%; min-height: 48px; margin: 0; padding: 0.6rem 0.85rem;
  box-sizing: border-box; border: 1.5px solid var(--border-light, #e0dcd7); background: var(--bg-card, #fff); color: var(--text-primary, #2d2a26);
  font: 500 0.97rem/1.4 'Schibsted Grotesk', system-ui, sans-serif; text-align: left; text-decoration: none; cursor: pointer; }
#practice-page .ms-rows .ms-span { border-radius: 8px; }
#practice-page :is(.cp-chip, .ms-rows .ms-span) .pr-row-text { flex: 1 1 auto; min-width: 0; }
#practice-page :is(.cp-chip.selected, .ms-rows .ms-span.flagged):not(.result-correct):not(.result-incorrect) { border-color: var(--accent, #7c3aed); background: var(--accent-light, #f5f3ff); }
#practice-page :is(.cp-chip, .ms-rows .ms-span)::after { margin-left: auto; }
#practice-page .pr-tickbox { flex: none; position: relative; width: 22px; height: 22px; box-sizing: border-box; border: 2px solid var(--text-muted, #8a857c); border-radius: 6px; background: var(--bg-card, #fff); }
#practice-page :is(.cp-chip.selected, .ms-span.flagged, .ms-span.result-correct-flag, .ms-span.result-wrong-flag) .pr-tickbox { border-color: var(--accent, #7c3aed); background: var(--accent, #7c3aed); }
#practice-page :is(.cp-chip.selected, .ms-span.flagged, .ms-span.result-correct-flag, .ms-span.result-wrong-flag) .pr-tickbox::after { content: ""; position: absolute; inset: 2px; background: #fff;
  -webkit-mask: var(--pr-tick) center / contain no-repeat; mask: var(--pr-tick) center / contain no-repeat; }
#practice-page .ms-rows .ms-span.result-correct-flag { border-color: var(--pr-ok); }
#practice-page .ms-rows .ms-span.result-wrong-flag { border-color: var(--pr-no); }
#practice-page .ms-rows .ms-span.result-missed { border-color: var(--pr-ok); border-style: dashed; background: var(--bg-card, #fff); }

/* match the evidence: the claim waiting for a quote is marked; a made pair is the quote under its claim */
#practice-page .em-item { font-size: 0.97rem; line-height: 1.45; }
#practice-page .em-item.paired { opacity: 1; }
#practice-page .em-claim .em-made { display: block; margin-top: 0.45rem; padding: 0.45rem 0.65rem; border-radius: 8px; background: var(--sv-tint, rgba(91, 70, 50, 0.07));
  font-family: var(--font-read, 'Literata', Georgia, serif); font-style: italic; font-size: 0.94rem; color: var(--text-primary, #2d2a26); }
#practice-page .em-quote.paired, #practice-page .em-quotes.em-all-used { display: none; }

/* spot the errors: plain words until one is tapped, then it is marked; larger words (Tom on 158) */
#practice-page .spot-text { font-size: 1.06rem; line-height: 2; }
#practice-page .spot-token.flagged { background: var(--accent-light, #f5f3ff); color: var(--text-primary, #2d2a26); text-decoration: none; box-shadow: inset 0 -2px 0 var(--accent, #7c3aed); }

/* put in order: rows a thumb can hit, the next number faint in an empty circle */
#practice-page .reorder-item { min-height: 48px; font-size: 0.97rem; line-height: 1.4; }
#practice-page .reorder-item .reorder-text { flex: 1 1 auto; min-width: 0; }
#practice-page .reorder-num { width: 26px; height: 26px; font-size: 0.94rem; }
#practice-page .reorder-num:empty::before { content: attr(data-next); opacity: 0.4; }
#practice-page .ro-clear { margin-top: 0.5rem; }

/* writing */
#practice-page .improve-original { border: 1px solid var(--border-light, #e8e4df); background: var(--bg-body, #faf8f5); color: var(--text-primary, #2d2a26); }
#practice-page .ai-badge.pr-write-foot { margin-top: 0.45rem; font-style: normal; font-size: 0.94rem; color: var(--text-secondary, #5a5651); }
#practice-page .problem-equation .pr-q-more { display: block; margin-top: 0.45rem; font-weight: 400; font-size: 0.97rem; line-height: 1.5; letter-spacing: 0; }
#practice-page .problem-equation:has(> .pr-q-marks) { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; width: 100%; box-sizing: border-box; }
#practice-page .pr-q-marks { flex: none; font: 500 0.94rem 'Schibsted Grotesk', system-ui, sans-serif; color: var(--text-secondary, #5a5651); white-space: nowrap; }

/* after the answer is marked: nothing left to clear */
#practice-page .problem-card:is(.card-correct, .card-incorrect) :is(.ro-clear, .em-clear) { display: none; }
#practice-page .problem-card:is(.card-correct, .card-incorrect) .reorder-num:empty::before { content: none; }

/* ==================== LANGUAGE QUESTION TYPES AND LATIN (job S5-28, 20 Nov 2026) ====================
   Each type says how to answer in one line (.pr-how). Word buttons are a thumb's size, 8px apart (168.2, 170.2) and do
   not give the first and last word away (170.4: an ordinary word's first letter is small on the button, a sentence's
   end mark is not shown; .pr-tile-small, .pr-tile-off). Match the pairs: a made pair keeps full-strength words on its
   green (167.3), and the line over the pairs counts them or says "Not a pair" (166.2). The empty sentence line in the
   text's grey, the card's full width (170.3). Dictation: "Slower" is the site's quiet button (173.2). Spot the error:
   the words are buttons (177.2). Role play: one task at a time, its numbers under it (176.3). */
.pr-tile-small { text-transform: lowercase; }
.pr-tile-off { display: none; }
#practice-page :is(.gf-chip, .sb-tile, .sb-placed-tile) { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: 0;
  padding: 0.35rem 0.85rem; box-sizing: border-box; font-size: 1rem; line-height: 1.2; }
#practice-page :is(.gf-bank, .sb-tile-bank) { gap: 8px; }
#practice-page .sb-answer-zone { width: 100%; box-sizing: border-box; gap: 8px; min-height: 60px; align-items: center; }
#practice-page .sb-answer-zone:empty::before { content: attr(data-empty); padding: 0 0.25rem; color: var(--text-secondary, #5a5651); font-size: 0.94rem; }
/* after the answer is marked: no "Clear" and no task's "Next" (171.5); a right sentence needs no word bank (172.2) */
#practice-page .problem-card:is(.card-correct, .card-incorrect) :is(.sb-clear-btn, .rp-next) { display: none; }
#practice-page .problem-card.card-correct .sb-tile-bank { display: none; }

/* match the pairs */
#practice-page .vm-item.vm-matched { opacity: 1; transform: none; border-color: var(--pr-ok); background: var(--pr-ok-bg); color: var(--pr-ok-ink); }
#practice-page .pr-how.vm-not { color: var(--pr-no-ink, #7c3434); font-weight: 600; }

/* dictation */
#practice-page .dt-audio-area { flex-wrap: wrap; }
#practice-page .dt-play-count { font-size: 0.94rem; color: var(--text-secondary, #5a5651); }   /* "You can listen twice": 15px, as every word on a phone */
#practice-page .dt-audio-area .dt-slower { margin-left: auto; }

/* spot the error: the words as buttons, the sentence's meaning above them */
#practice-page #problem-inputs-area > :is(.pr-how, .sc-sentence) { flex: 1 1 100%; }   /* each on a row of its own: the inputs are a wrapping row */
#practice-page #problem-inputs-area > .pr-how { text-align: center; }
#practice-page #problem-inputs-area > .sc-correction { flex: 0 1 28rem; }
#practice-page .sc-sentence { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; line-height: 1.3; }
#practice-page .sc-word { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: 0; padding: 0.3rem 0.75rem;
  box-sizing: border-box; border: 1.5px solid var(--border-light, #e0dcd7); border-radius: 10px; background: var(--bg-card, #fff); color: var(--text-primary, #2d2a26);
  font: 500 1.06rem/1.2 var(--font-read, 'Literata', Georgia, serif); cursor: pointer; }
#practice-page .sc-word.sc-selected:not(.result-correct) { border-color: var(--accent, #7c3aed); background: var(--accent-light, #f5f3ff); font-weight: 600; }

/* role play: one task at a time */
#practice-page .rp-bullet.rp-off { display: none; }
#practice-page .rp-bullets:has(+ .rp-steps) .rp-bullet-num { display: none; }   /* the numbers under the task say which it is */
#practice-page .rp-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 0.85rem; }
#practice-page .rp-step { flex: none; width: 44px; height: 44px; padding: 0; border: 1.5px solid var(--border-light, #e0dcd7); border-radius: 50%; background: var(--bg-card, #fff);
  color: var(--text-secondary, #5a5651); font: 700 0.97rem 'Schibsted Grotesk', system-ui, sans-serif; cursor: pointer; }
#practice-page .rp-step.is-done { border: 2px solid var(--accent, #7c3aed); color: var(--accent, #7c3aed); }
#practice-page .rp-step.is-on { border-color: var(--accent, #7c3aed); background: var(--accent, #7c3aed); color: #fff; }
#practice-page .rp-steps .rp-next { margin-left: auto; }
#practice-page #current-problem-card.rp-not-last #problem-check-btn { display: none; }
@media (max-width: 600px) {
  /* the bar presses Next (js/practice/route.js actions) */
  #practice-page #rp-next-btn { position: absolute !important; visibility: hidden !important; width: 0 !important; height: 0 !important; min-width: 0 !important; min-height: 0 !important;
    margin: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; }
}
