/* ═══════════════════════════════════════════════════════════════════════
   SoloCogs - Unit Quiz Shell stylesheet
   ────────────────────────────────────────────────────────────────────────
   Shared by bioenergetics-quiz.html, ecology-quiz.html, homeostasis-quiz.html,
   infection-quiz.html, inheritance-quiz.html, organisation-quiz.html.

   Extracted 2026-05-16 from the duplicated <style> block that sat at the
   top of each unit-quiz page. The 5 newer pages were byte-identical;
   infection-quiz had a one-line box-sizing reorder (harmless to normalise);
   organisation-quiz was missing the last ~5KB of self-assess + theme-solo
   tweaks (those late additions now apply uniformly).
   ═══════════════════════════════════════════════════════════════════════ */
body { background: var(--off-white); }

/* ── LOADING ── */
.quiz-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 1rem;
  color: var(--text-light);
  font-size: 14px;
}
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--bio);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── QUIZ SHELL ── */
/* Page-level: lock body to viewport so only the inner question area can scroll.
   This makes the working-area genuinely a fixed rectangle on screen - nav, sidebar,
   and RAG/Continue buttons stay put while the question content scrolls inside. */
/* Body lock applies ONLY while the quiz is active - not on intro/results.
   Driven by JS adding/removing .quiz-active so the lock can't leak into other states. */
body.quiz-active {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.quiz-active > nav { flex-shrink: 0; }
.quiz-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.quiz-header { flex-shrink: 0; }

/* ── QUIZ GRID LAYOUT (Phase A8.8) ── */
/* Two-column grid: progress sidebar | quiz body - same pattern as the resource. */
.quiz-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.75rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 1rem;
  box-sizing: border-box;
  flex: 1;                                /* fills available space inside .quiz-shell */
  min-height: 0;                          /* lets children scroll properly */
  width: 100%;
  overflow: hidden;
}

/* ── SIDE PROGRESS TRACKER (now an in-flow sidebar, matching the resource) ── */
#progress-tracker-wrap {
  background: var(--solo-bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.07);
  /* overflow: visible so the Cogs mascot can sit beside the rail without clipping -
     each child handles its own rounded-corner clipping below. */
  overflow: visible;
  height: fit-content;
  align-self: start;
  position: sticky;
  top: 1rem;
}
.tracker-header {
  background:
    radial-gradient(ellipse 220px 120px at 50% 0%, rgba(45, 212, 191, 0.18) 0%, transparent 70%),
    linear-gradient(135deg, var(--solo-navy) 0%, #0F172A 100%);
  padding: 0.85rem 1rem 0.7rem;
  border-radius: 14px 14px 0 0;
}
.tracker-header-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.65);
  margin-bottom: 0.25rem;
}
.tracker-header-title {
  font-family: var(--solo-font-head);
  font-size: 1rem;
  color: white;
  line-height: 1.25;
}
.tracker-body {
  padding: 0.95rem 0.75rem 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.tracker-title {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 2px;
}
.tracker-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  align-items: center;
}
.tracker-node {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11.5px;
  font-family: var(--solo-font-body);
  transition: background 0.3s, color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.tracker-node.done {
  background: var(--navy);
  color: white;
}
.tracker-node.current {
  background: var(--navy);
  color: white;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.35), 0 0 12px rgba(15, 23, 42, 0.4);
  transform: scale(1.08);
}
.tracker-finish {
  font-size: 22px;
  margin-top: 4px;
  line-height: 1;
}
.tracker-cogs {
  position: absolute;
  left: 50%;
  margin-left: 26px;
  top: 0;
  transform: translateY(-50%);
  pointer-events: none;
  transition: top 0.55s cubic-bezier(.4,1.4,.55,1);
  filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.25));
}
/* Tracker Cogs is now a STATIC silhouette walking the rail - the
   spinning gear was conflicting with the persistent helper Cogs in
   the bottom-right corner (loaded via solo-cogs.js on this page).
   We keep the celebration spin on completion as a finish-line treat. */
.tracker-cogs-gear {
  transform-box: fill-box;
}
.tracker-cogs.celebrating {
  animation: tracker-cogs-celebrate 0.9s ease-in-out 2;
}
@keyframes tracker-cogs-celebrate {
  0%, 100% { transform: translateY(-50%) scale(1) rotate(0deg); }
  50%      { transform: translateY(-50%) scale(1.4) rotate(360deg); }
}

/* The top 0/10 progress strip has been removed - the side tracker
   shows progress at every viewport now. On mobile the sidebar
   collapses above the question card instead of beside it. */
@media (max-width: 1100px) {
  .quiz-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1rem;
  }
  /* Mobile sidebar: a compact horizontal strip above the question
     so the student still sees progress without losing screen space. */
  #progress-tracker-wrap {
    width: 100%;
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.4rem;
  }
  .tracker-header { display: none; }     /* the header lives in the question card already */
  .tracker-body   { padding: 0; }
  .tracker-title  { display: none; }
  .tracker-rail {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    height: auto;
    padding: 0;
  }
  .tracker-node {
    width: 26px; height: 26px;
    font-size: 12px;
    flex-shrink: 0;
  }
  .tracker-finish {
    font-size: 1.1rem;
    flex-shrink: 0;
  }
  /* On mobile the walking Cogs sits below the rail rather than
     left of it - a vertical pos doesn't make sense in a horizontal
     strip. updateTracker() still controls his position via top/left,
     so we let it do its thing and just shrink him. */
  .tracker-cogs {
    width: 28px; height: 28px;
    margin-left: 0;
  }
  .tracker-cogs svg { width: 100%; height: 100%; }
}

/* Phones (< 640px): a 30-circle strip is overkill at this width and
   eats vertical space the student needs for the question. Collapse to
   a slim track with Cogs as the only visible marker; numbers shrink
   to 18px so a 30-question quiz still fits in 360px without overflow. */
@media (max-width: 640px) {
  #progress-tracker-wrap {
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.3rem;
    background: linear-gradient(180deg, var(--solo-bg-elevated, #FFFFFF) 0%, var(--solo-bg, #F8FAFC) 100%);
    border-radius: 10px;
  }
  .tracker-rail { gap: 2px; }
  .tracker-node {
    width: 18px; height: 18px;
    font-size: 10px;
    border-width: 1.5px;
  }
  /* Hide the finish trophy in the strip - it just adds clutter at
     this width. Cogs walks; that's enough signal. */
  .tracker-finish { display: none; }
  .tracker-cogs { width: 22px; height: 22px; }
}

/* ── PROGRESS HEADER ── */
.quiz-header {
  background: var(--navy);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.quiz-header-inner {
  max-width: 1100px;                      /* matches .quiz-grid below so the access-bar lines up with the question column */
  margin: 0 auto;
  padding: 0 1.5rem;
  box-sizing: border-box;
}
/* Push the access-bar buttons over by the sidebar width + grid gap so
   they start where the question card starts. Below 1100px the grid
   collapses to one column, so the offset goes too. */
.colour-picker-bar { padding-left: calc(220px + 1.75rem); }
@media (max-width: 1100px) {
  .colour-picker-bar { padding-left: 0; }
}

/* ── COLOUR PICKER ── */
.colour-picker-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 2px;
}
.colour-picker-label {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  margin-right: 4px;
}
.colour-swatch {
  /* WCAG 2.5.5 minimum: 44x44 hit area. The visible swatch stays compact
     via a centred coloured circle; the surrounding transparent border
     supplies the rest of the tap target. */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 12px solid transparent;     /* invisible padding ring */
  background-clip: padding-box;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  flex-shrink: 0;
}
.colour-swatch:hover  { transform: scale(1.2); border-color: rgba(255,255,255,0.6); }
.colour-swatch.active { border-color: #fff; outline: 2px solid #222; outline-offset: 1px; transform: scale(1.2); }

/* Access-bar buttons next to the bg swatches: mute Cogs, stop motion,
   open calculator. Same visual weight as Cell Biology's access bar. */
.colour-picker-bar { flex-wrap: wrap; row-gap: 6px; }
.ab-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.20); margin: 0 4px; flex-shrink: 0; }
.ab-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px; /* PILL - locked button-shape rule */
  padding: 4px 10px;
  color: white;
  font-size: 12px;
  font-family: var(--solo-font-body, inherit);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.ab-btn:hover { background: rgba(255,255,255,0.20); }
.ab-btn.is-on {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.45);
}
.ab-btn.muted { opacity: .55; }
/* SoloCalc's default floating FAB is replaced by the in-bar button. */
.sc-fab { display: none !important; }

/* Stop-movement: pause every Cogs animation when this body class is on.
   Sounds and bubbles still work; this kills only motion. */
body.bq-cogs-still .tracker-cogs,
body.bq-cogs-still .tracker-cogs *,
body.bq-cogs-still .solo-cogs-host,
body.bq-cogs-still .solo-cogs-host * {
  animation: none !important;
  transition: none !important;
}

/* Results-page picker (light variant) */
.results-bg-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1.5rem 0;
}
.results-bg-label {
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-right: 4px;
}
.results-bg-picker .colour-swatch { border-color: var(--border); }
.results-bg-picker .colour-swatch:hover { border-color: var(--text-mid); }
.results-bg-picker .colour-swatch.active { border-color: var(--solo-heading-color, var(--navy)); outline-color: var(--solo-heading-color, var(--navy)); }
/* ── READING OVERLAY (Phase A8.9) - coloured-sheet effect over the WORKING AREA only ──
   Centred rectangle that sits above the content, with mix-blend-mode multiply.
   Stays below the top blue nav bar, doesn't cover the side progress tracker. */
#reading-overlay {
  position: fixed;
  top: var(--nav-bottom, 60px);                  /* JS sets --nav-bottom to the live nav.height for pixel-perfect alignment */
  left: 50%;
  transform: translateX(-50%);
  width: min(1080px, calc(100vw - 40px));        /* rectangle around the working area */
  bottom: 0;                                      /* extends to viewport bottom */
  pointer-events: none;
  z-index: 99999;
  mix-blend-mode: multiply;
  background: #ffffff; /* darkmode-ok */
  transition: background 0.2s ease;
}
@media (max-width: 768px) {
  /* On mobile, overlay just covers the working area below the nav */
  #reading-overlay { width: calc(100vw - 16px); }
}
.quiz-unit-label {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.quiz-subject-badge {
  background: var(--bio);
  color: white;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 4px;
}
.quiz-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.quiz-progress-bg {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: var(--bio);
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}
.quiz-progress-text {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  white-space: nowrap;
  min-width: 44px;
  text-align: right;
}

/* ── QUIZ BODY ── */
.quiz-body {
  display: flex;
  flex-direction: column;
  padding: 0;                             /* outer padding handled by .quiz-grid */
  max-width: 820px;                       /* a touch wider so options don't feel cramped */
  height: 100%;                           /* fills the grid column - flex chain handles sizing */
  min-height: 0;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
/* Question content is the scrollable child - RAG panel and nav stay pinned below */
#question-area {
  flex: 1;
  overflow-y: auto;
  min-height: 0;                          /* required for flex children to scroll properly */
  padding-right: 6px;                     /* small gutter so the scrollbar doesn't kiss content */
  scroll-behavior: smooth;
  /* Slim, polite scrollbar */
  scrollbar-width: thin;
}
#question-area::-webkit-scrollbar { width: 8px; }
#question-area::-webkit-scrollbar-thumb { background: rgba(27,58,107,0.18); border-radius: 4px; }
#question-area::-webkit-scrollbar-thumb:hover { background: rgba(27,58,107,0.35); }
.quiz-nav { flex-shrink: 0; margin-top: 0.75rem; }
@media (max-width: 768px) {
  /* Mobile: revert to natural flow - fixed-height boxes are more friction than help on small screens */
  body.quiz-active { height: auto; overflow: visible; display: block; }
  .quiz-shell { flex: none; min-height: auto; overflow: visible; }
  .quiz-grid { flex: none; overflow: visible; padding: 1rem; }
  .quiz-body { height: auto; min-height: calc(100dvh - 200px); }
  #question-area { overflow-y: visible; min-height: 0; padding-right: 0; }
}
/* Subtle fade-in on each new question - matches the resource's .rs-card animation */
.question-card {
  animation: questionFadeIn 0.28s ease;
}
@keyframes questionFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Cogs mascot: on the quiz pages, lift him off the viewport corner so
   his feet sit roughly level with the bottom of the side progress
   tracker - keeps him visible without crowding the Check-answer button. */
@media (min-width: 1101px) {
  body.quiz-active .solo-cogs-host { right: 220px; bottom: 200px; }
}

/* ── QUESTION CARD ── */
.question-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(27,58,107,0.09);
  margin-bottom: 1.25rem;
}
.question-card-header {
  background: var(--bio);
  padding: 0.875rem 1.5rem;
  min-height: 64px;                       /* matches .tracker-header height so question body and tracker body align */
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}
.question-card-header-left { font-size: 12px; color: rgba(255,255,255,0.85); font-weight: 500; }
.question-card-header-right { display: flex; align-items: center; gap: 12px; }
.question-type-label { font-size: 10px; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.06em; }
.btn-read-aloud {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px; /* PILL - locked button-shape rule */
  padding: 4px 10px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-read-aloud:hover { background: rgba(255,255,255,0.25); }
.btn-read-aloud.reading { background: rgba(255,255,255,0.3); border-color: rgba(255,255,255,0.6); }
.btn-read-aloud svg { flex-shrink: 0; }
.question-card-body { padding: 1.5rem; }
.question-text { font-size: 15px; font-weight: 500; color: var(--solo-heading-color, var(--navy)); line-height: 1.65; margin-bottom: 1.25rem; }
.question-marks { font-size: 12px; color: var(--text-light); font-weight: 400; }

/* ── MCQ ── */
.mcq-options { display: flex; flex-direction: column; gap: 8px; }
.mcq-option {
  padding: 10px 18px;
  border-radius: 999px;        /* PILL - locked button-shape rule */
  border: 1.5px solid var(--border);
  font-size: 13px;
  color: var(--text-mid);
  background: var(--card-bg, var(--off-white));
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
.mcq-option:hover:not(:disabled) { border-color: var(--bio); background: var(--bio-pale); color: var(--bio); }
.mcq-option.selected { border-color: var(--bio); background: var(--bio-pale); color: var(--bio); font-weight: 600; }
.mcq-option.correct { border-color: var(--bio); background: var(--bio-pale); color: var(--bio); font-weight: 600; }
.mcq-option.incorrect { border-color: #e05252; background: #fef0f0; color: #a32d2d; }

/* ── TRUE/FALSE ── */
.tf-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tf-btn {
  padding: 14px 22px;
  border-radius: 999px;        /* PILL - locked button-shape rule */
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--card-bg, var(--off-white));
  color: var(--text-mid);
  font-family: inherit;
}
.tf-btn:hover { border-color: var(--solo-mastery-deep); background: var(--teal-pale); color: var(--solo-mastery-deep); }
.tf-btn.selected { border-color: var(--solo-mastery-deep); background: var(--teal-pale); color: var(--solo-mastery-deep); }
.tf-statement {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.6;
  font-style: italic;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--off-white);
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* ── TICK BOXES ── */
.tick-options { display: flex; flex-direction: column; gap: 8px; }
.tick-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  color: var(--text-mid);
  background: var(--off-white);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.tick-option:hover { border-color: var(--solo-mastery-deep); }
.tick-option.selected { border-color: var(--solo-mastery-deep); background: var(--teal-pale); color: var(--solo-heading-color, var(--navy)); }
.tick-box {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
  background: var(--white);
  transition: all 0.15s;
}
.tick-option.selected .tick-box {
  background: var(--solo-mastery-deep);
  border-color: var(--solo-mastery-deep);
  color: white;
}
.tick-hint { font-size: 11px; color: var(--text-light); margin-top: 8px; }

/* ── WRITTEN ── */
.written-helper {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-bottom: 8px;
  background: var(--off-white, #F8FAFC);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
}
.written-helper-group { display: inline-flex; gap: 4px; align-items: center; }
.written-helper-sep   { color: var(--text-light, #94A3B8); font-weight: 600; }
.written-helper-btn {
  appearance: none;
  background: var(--solo-bg-elevated);
  border: 1.5px solid var(--border, #E2E8F0);
  border-radius: 999px;
  padding: 4px 10px;
  min-height: 28px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.1;
  color: var(--solo-heading-color, var(--navy, #0F172A));
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.written-helper-btn:hover { border-color: var(--teal, #14B8A6); color: var(--teal, #14B8A6); }
.written-helper-btn:focus-visible { outline: 2px solid var(--teal, #14B8A6); outline-offset: 1px; }
.written-helper-btn sup { font-size: .8em; }

.written-area {
  width: 100%;
  min-height: 100px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--solo-heading-color, var(--navy));
  background: var(--off-white);
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  line-height: 1.6;
  transition: border-color 0.15s;
}
.written-area:focus { outline: none; border-color: var(--solo-mastery-deep); }
.model-answer-box {
  background: var(--bio-pale);
  border: 1px solid #c8ddc8;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}
.model-answer-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--bio);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.model-answer-text { font-size: 13px; color: var(--text-mid); line-height: 1.6; }
.self-assess-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.self-assess-btn {
  padding: 6px 14px;
  border-radius: 999px; /* PILL - locked button-shape rule */
  border: 1.5px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  background: var(--white);
  transition: all 0.15s;
}
.self-assess-btn[data-val="correct"]:hover,
.self-assess-btn[data-val="correct"].selected { background: var(--bio-pale); border-color: var(--bio); color: var(--bio); }
.self-assess-btn[data-val="partial"]:hover,
.self-assess-btn[data-val="partial"].selected { background: var(--sand-pale); border-color: #e8dcc8; color: #8a6020; }
.self-assess-btn[data-val="incorrect"]:hover,
.self-assess-btn[data-val="incorrect"].selected { background: #fef0f0; border-color: #f0c8c8; color: #a32d2d; }
.tutor-flag {
  font-size: 11px;
  color: var(--solo-mastery-deep);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── GAP FILL ── */
.gap-wordbank {
  background: var(--card-bg, var(--off-white));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 1rem;
}
.gap-wordbank-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.gap-wordbank-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.word-chip {
  padding: 4px 12px;
  border-radius: 5px;
  border: 1.5px solid var(--border);
  font-size: 12px;
  color: var(--text-mid);
  background: var(--white);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.word-chip:hover:not(.used) { border-color: var(--solo-heading-color, var(--navy)); color: var(--solo-heading-color, var(--navy)); }
.word-chip.used { opacity: 0.3; cursor: default; pointer-events: none; }
.gap-sentence { font-size: 14px; color: var(--text-mid); line-height: 2.6; }
.gap-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  height: 26px;
  border-bottom: 2px dashed var(--navy);
  margin: 0 3px;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--bio);
  cursor: pointer;
  vertical-align: middle;
  transition: all 0.15s;
  position: relative;
}
.gap-slot:hover { border-color: var(--solo-mastery-deep); }
.gap-slot.filled { border-style: solid; border-color: var(--bio); cursor: grab; }
.gap-slot.filled:active { cursor: grabbing; }
.gap-slot.empty { color: transparent; }
.gap-slot.drag-over { background: rgba(42,127,127,0.15) !important; border-color: var(--solo-mastery-deep); border-style: solid; transform: scale(1.05); }
.gap-slot.dragging { opacity: 0.4; }
.word-chip:not(.used) { cursor: grab; }
.word-chip:not(.used):active { cursor: grabbing; }
.word-chip.dragging { opacity: 0.4; transform: scale(0.95); }
.gap-wordbank.drag-over { background: rgba(42,127,127,0.08); border-color: var(--solo-mastery-deep); }

/* ── MATCH UP ── */
.match-up-grid { display: flex; flex-direction: column; gap: 8px; }
.match-up-row { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; align-items: center; }
.match-up-term {
  padding: 8px 12px;
  background: var(--navy);
  color: white;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}
.match-up-select {
  padding: 8px 10px;
  border-radius: 7px;
  border: 1.5px solid var(--border);
  font-size: 12px;
  color: var(--text-mid);
  background: var(--off-white);
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.15s;
}
.match-up-select:focus { outline: none; border-color: var(--solo-mastery-deep); }

/* ── NAV AREA ── */
.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}
.btn-skip {
  font-size: 13px;
  color: var(--text-light);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 8px 0;
  font-family: inherit;
}
.btn-skip:hover { color: var(--text-mid); }
.btn-check {
  background: var(--green, #3a7d44);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-check:hover:not(:disabled) { background: #2d6435; }
.btn-check:disabled { background: var(--border); color: var(--text-light); cursor: not-allowed; }

/* ── RAG SECTION (now lives INSIDE the question card) ── */
/* Visually it's a continuation of the white card with a soft divider above -
   not a separate teal panel. Scrolls with the card content. */
.rag-section {
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem 1.25rem;
  background: var(--white);
}
.rag-title { font-size: 13px; font-weight: 600; color: var(--solo-mastery-deep); margin-bottom: 10px; }
.rag-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.rag-btn {
  padding: 8px 12px;
  border-radius: 999px; /* PILL - locked button-shape rule */
  border: 1.5px solid;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: opacity 0.15s, box-shadow 0.15s;
}
.rag-btn:hover { opacity: 0.85; }
.rag-btn.selected { box-shadow: 0 0 0 2px rgba(0,0,0,0.18); }
.rag-green { background: var(--bio-pale); border-color: #c8ddc8; color: var(--bio); }
.rag-yellow { background: var(--sand-pale); border-color: #e8dcc8; color: #8a6020; }
.rag-red { background: #fef0f0; border-color: #f0c8c8; color: #a32d2d; }
.rag-skip-btn { background: var(--off-white); border-color: var(--border); color: var(--text-light); }
.rag-hint { font-size: 11px; color: var(--text-light); line-height: 1.5; }

/* ── RESULTS ── */
.results-shell { max-width: 720px; margin: 0 auto; padding: 2rem 1.5rem; }
.results-top { text-align: center; padding: 1.5rem 0 1rem; }
.results-complete-badge {
  display: inline-block;
  background: var(--bio-pale);
  color: var(--bio);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
  margin-bottom: 8px;
}
.results-unit-title { font-family: var(--solo-font-head); font-size: 1.8rem; color: var(--solo-heading-color, var(--navy)); margin-bottom: 4px; }
.results-unit-sub { font-size: 13px; color: var(--text-mid); }
.results-score-card {
  background: var(--navy);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
}
.results-bar { display: flex; gap: 3px; height: 8px; border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.results-stats { display: flex; gap: 16px; font-size: 11px; color: rgba(255,255,255,0.7); }
.results-flags-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.results-flags-header {
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.results-flag {
  border-bottom: 1px solid var(--border);
}
.results-flag:last-child { border-bottom: none; }
.results-flag-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.875rem 1.5rem;
  cursor: pointer;
  user-select: none;
}
.results-flag-header:hover { background: var(--off-white); }
.results-flag-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.results-flag-title { font-size: 13px; font-weight: 600; flex: 1; }
.results-flag-chevron { font-size: 11px; color: var(--text-light); transition: transform 0.2s; flex-shrink: 0; }
.results-flag.open .results-flag-chevron { transform: rotate(90deg); }
.results-flag-body {
  display: none;
  padding: 0 1.5rem 1rem 2.5rem;
}
.results-flag.open .results-flag-body { display: block; }
.results-flag-desc { font-size: 12px; color: var(--text-mid); line-height: 1.5; margin-bottom: 8px; }

/* ── Phase C2 - Command-word fluency panel ────────────────────────── */
.results-fluency-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.5rem 1.25rem;
  margin-bottom: 1.25rem;
}
.results-fluency-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.results-fluency-sub { font-size: 12px; color: var(--text-mid); margin-bottom: 12px; line-height: 1.4; }
.cmd-fluency-rows { display: flex; flex-direction: column; gap: 8px; }
.cmd-fluency-row {
  display: grid;
  grid-template-columns: 90px 1fr 50px 110px;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.cmd-fluency-name  { font-weight: 600; color: var(--solo-heading-color, var(--navy)); }
.cmd-fluency-bar   { background: var(--off-white); border-radius: 4px; height: 8px; overflow: hidden; border: 1px solid var(--border); }
.cmd-fluency-bar-fill { height: 100%; transition: width 0.4s ease; border-radius: 3px; }
.cmd-fluency-count { color: var(--text-mid); font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.cmd-fluency-status {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 3px 6px;
  border-radius: 6px;
}
/* Status colours match the rest of the results page palette */
.cmd-fluency-strong.cmd-fluency-bar-fill { background: var(--bio); }
.cmd-fluency-mixed.cmd-fluency-bar-fill  { background: #c8a020; }
.cmd-fluency-weak.cmd-fluency-bar-fill   { background: #e05252; }
.cmd-fluency-status.cmd-fluency-strong { background: var(--bio-pale); color: var(--bio); }
.cmd-fluency-status.cmd-fluency-mixed  { background: var(--sand-pale); color: #8a6020; }
.cmd-fluency-status.cmd-fluency-weak   { background: #fef0f0;          color: #a32d2d; }

@media (max-width: 600px) {
  .cmd-fluency-row { grid-template-columns: 80px 1fr 50px; }
  .cmd-fluency-status { display: none; }   /* on small screens, the bar colour conveys status */
}

.results-target {
  background: var(--teal-pale);
  border: 1px solid #c0e0e0;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.results-target-label { font-size: 12px; font-weight: 600; color: var(--solo-mastery-deep); margin-bottom: 6px; }
.results-target-text { font-size: 13px; color: var(--text-mid); line-height: 1.6; }
.results-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.results-note { font-size: 11px; color: var(--text-light); font-style: italic; margin-top: 1.25rem; line-height: 1.6; }

/* ── FLAG QUESTION LISTS ── */
.flag-questions { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.flag-q-item { display: flex; align-items: flex-start; gap: 8px; }
.flag-q-arrow { font-size: 12px; color: var(--text-light); flex-shrink: 0; margin-top: 1px; }
.flag-q-content { flex: 1; min-width: 0; }
.flag-q-text { font-size: 12px; color: var(--solo-heading-color, var(--navy)); line-height: 1.5; font-style: italic; }
.flag-q-reveal { display: none; margin-top: 5px; padding: 6px 10px; background: var(--white); border-radius: 6px; border: 1px solid var(--border); }
.show-answers .flag-q-reveal { display: block; }
.flag-q-given { font-size: 11px; color: var(--text-mid); margin-bottom: 3px; }
.flag-q-given strong { color: var(--solo-heading-color, var(--navy)); }
.flag-q-correct { font-size: 11px; color: var(--bio); font-weight: 500; }
.flag-q-correct strong { color: var(--bio); }
.flag-q-subtopic { display: inline-block; font-size: 10px; font-weight: 600; font-style: normal; background: var(--off-white); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; margin-left: 6px; color: var(--text-mid); vertical-align: middle; text-decoration: none; transition: all 0.15s; cursor: pointer; }
/* Phase B - small "X/Y" fractional marks badge shown next to multi-mark questions on the results review */
.flag-q-marks { display: inline-block; font-size: 10px; font-weight: 700; font-style: normal; background: var(--navy); color: white; border-radius: 4px; padding: 1px 6px; margin-left: 4px; vertical-align: middle; letter-spacing: 0.02em; }
a.flag-q-subtopic:hover { background: var(--bio-pale); border-color: var(--bio); color: var(--bio); }
a.flag-q-subtopic:focus-visible { outline: 2px solid var(--bio); outline-offset: 2px; }

/* ── SHOW ANSWERS TOGGLE ── */
.btn-show-answers {
  background: var(--solo-bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mid);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  margin-bottom: 1.25rem;
  display: block;
  width: 100%;
  text-align: center;
}
.btn-show-answers:hover { border-color: var(--solo-heading-color, var(--navy)); color: var(--solo-heading-color, var(--navy)); }
.btn-show-answers.active { border-color: var(--solo-heading-color, var(--navy)); color: var(--solo-heading-color, var(--navy)); background: var(--off-white); }

/* ─── SOLO 2027 OVERRIDES ─────────────────────────────────
   Re-point legacy CSS variables to Solo brand values so the existing quiz
   UI inherits the new palette without rewriting selectors. Then patch a
   few components (header, check button, results card) with Solo polish. */
body.theme-solo {
  --navy:        #1E293B;
  --teal-pale:   #CCFBF1;
  --bio:         #14B8A6;
  --bio-pale:    #CCFBF1;
  --sand-pale:   #FEF3C7;
  --white:       #FFFFFF;
  --off-white:   #F8FAFC;
  --text-mid:    #334155;
  --text-light:  #64748B;
  --border:      #E2E8F0;

  background: var(--solo-bg);
  font-family: var(--solo-font-body);
  color: var(--solo-text);
}
body.theme-solo .quiz-header {
  background: var(--solo-navy);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
body.theme-solo .quiz-subject-badge {
  background: var(--solo-mastery);
  color: #FFFFFF;
  text-shadow: 0 1px 1px rgba(15,23,42,0.15);
  font-family: var(--solo-font-head);
}
body.theme-solo .quiz-progress-fill { background: var(--solo-mastery); }
body.theme-solo .question-card-header { background: var(--solo-mastery-deep); }
body.theme-solo .question-card-header-left,
body.theme-solo .question-type-label { font-family: var(--solo-font-head); }
body.theme-solo .question-text {
  font-family: var(--solo-font-head);
  font-weight: 500;
  color: var(--solo-heading-color, var(--solo-navy));
  letter-spacing: -0.005em;
}
body.theme-solo .mcq-option,
body.theme-solo .tf-btn,
body.theme-solo .tick-option,
body.theme-solo .word-chip,
body.theme-solo .match-up-select,
body.theme-solo .self-assess-btn,
body.theme-solo .btn-show-answers,
body.theme-solo .rag-btn,
body.theme-solo .btn-check {
  font-family: var(--solo-font-head);
}
body.theme-solo .written-area { font-family: var(--solo-font-body); }
body.theme-solo .btn-check {
  background: var(--solo-mastery);
  color: #FFFFFF;
  text-shadow: 0 1px 1px rgba(15,23,42,0.15);
  font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
  transition: transform var(--solo-fast) var(--solo-ease),
              box-shadow var(--solo-fast) var(--solo-ease);
}
body.theme-solo .btn-check:hover:not(:disabled) {
  background: var(--solo-mastery);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(45, 212, 191, 0.35);
}
body.theme-solo .btn-check:disabled {
  background: var(--solo-divider);
  color: var(--solo-text-soft);
  text-shadow: none;
}
body.theme-solo .results-unit-title {
  font-family: var(--solo-font-head);
  font-weight: 700;
  color: var(--solo-heading-color, var(--solo-navy));
  letter-spacing: -0.02em;
}
body.theme-solo .results-score-card { background: var(--solo-navy); }
body.theme-solo .results-flags-card { box-shadow: var(--solo-shadow-1); }
body.theme-solo .rag-yellow {
  background: var(--solo-confidence-pale);
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--solo-confidence-deep);
}
body.theme-solo .self-assess-btn[data-val="partial"]:hover,
body.theme-solo .self-assess-btn[data-val="partial"].selected {
  background: var(--solo-confidence-pale);
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--solo-confidence-deep);
}
body.theme-solo .colour-picker-label { font-family: var(--solo-font-head); }
