/* ============================================================
   MARINE SCIENCES GRADE 10 — SHARED STYLES
   Field Notebook Design System v1.0
   Used by: all topic pages + master hub
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  /* Paper & ink — light mode (default) */
  --paper:        #FAF6EC;
  --paper-2:      #F4EEDB;
  --paper-edge:   #E8DEC0;
  --paper-shadow: rgba(60, 40, 20, 0.08);

  --ink:          #1A2733;
  --ink-soft:     #3D4A57;
  --ink-faint:    #6B7785;
  --pencil:       #2B3640;

  /* Strand colours */
  --oceanography:   #0E5F76;
  --marine-bio:     #4A7C39;
  --marine-eco:     #C75426;
  --humans-ocean:   #6B4FA8;

  /* Functional accents */
  --hook:           #D9534F;
  --highlight:      #F4D03F;
  --bioluminescent: #1FB3A5;
  --depth-blue:     #1E4368;
  --warm-current:   #E07856;
  --cool-current:   #3A7DA8;
  --subtropical:    #C77E3A;

  /* Default strand — overridden per topic via [data-strand] */
  --strand: var(--marine-eco);

  /* Type */
  --display: 'Fraunces', Georgia, serif;
  --body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --hand: 'Caveat', cursive;

  /* Rhythm */
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --max: 72rem;
  --radius: 4px;
  --radius-card: 14px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Strand bindings.
   --strand-fill MUST be set here, next to --strand, and never as
   `--strand-fill: var(--strand)` on :root. A custom property inherits its
   SUBSTITUTED value, so a :root-level alias resolves once against :root's own
   --strand (marine-eco) and then never re-resolves per element — which turns
   every strand on the site coral orange. Measured and caught; do not "simplify"
   this back into one line. */
[data-strand="oceanography"]  { --strand: var(--oceanography); --strand-fill: var(--oceanography); }
[data-strand="marine-bio"]    { --strand: var(--marine-bio);   --strand-fill: var(--marine-bio); }
[data-strand="marine-eco"]    { --strand: var(--marine-eco);   --strand-fill: #B84A20; }
[data-strand="humans-ocean"]  { --strand: var(--humans-ocean); --strand-fill: var(--humans-ocean); }

/* ---------- STRAND USED AS A TEXT BACKGROUND (added 2026-08-09) ----------
   `background: var(--strand); color: var(--paper)` was used in five shared
   components and in every practical's .inv-head. It fails contrast twice over,
   measured:

     mode   strand         paper-text   cream-text
     light  oceanography      6.67          6.67
     light  marine-bio        4.60          4.60
     light  marine-eco        4.12  FAIL    4.12  FAIL
     light  humans-ocean      5.88          5.88
     dark   oceanography      2.53  FAIL    6.67
     dark   marine-bio        3.67  FAIL    4.60
     dark   marine-eco        4.09  FAIL    4.12  FAIL
     dark   humans-ocean      2.87  FAIL    5.88

   Two separate faults:
   1. In night-dive mode --paper flips to dark navy, so every strand fill loses
      its text. Fixed by pinning the text to a FIXED cream — a strand fill is a
      fixed-colour panel (--strand does not change between modes), and the design
      system's own rule says fixed panel -> fixed hex.
   2. Coral orange fails in BOTH modes even against cream. It needs a genuinely
      darker fill, so marine-eco gets a deeper tone for this purpose only.

   --strand stays untouched for borders, rules, accents and SVG strokes. Only use
   --strand-fill where TEXT sits on top of it.

   Measured after the fix, every strand, both modes:
     oceanography 6.67 · marine-bio 4.60 · marine-eco 4.82 · humans-ocean 5.88

   The :root default matches :root's own --strand, which is marine-eco. */
:root                         { --strand-fill: #B84A20; --strand-fill-ink: #FAF6EC; }

/* Dark mode */
[data-mode="dark"] {
  --paper:        #0E1620;
  --paper-2:      #14202E;
  --paper-edge:   #1F2D3D;
  --paper-shadow: rgba(0, 0, 0, 0.4);

  --ink:          #F0EAD9;
  --ink-soft:     #C8BFA8;
  --ink-faint:    #8B9099;
  --pencil:       #B8C0CA;
}

/* ---------- RESET ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(60, 40, 20, 0.04) 1px, transparent 0);
  background-size: 24px 24px;
  transition: background 0.4s var(--ease), color 0.3s var(--ease);
  min-height: 100vh;
}

[data-mode="dark"] body {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.03) 1px, transparent 0);
}

/* Notebook margin line */
body::before {
  content: '';
  position: fixed;
  left: 4.5rem;
  top: 0; bottom: 0;
  width: 1px;
  background: rgba(217, 83, 79, 0.15);
  pointer-events: none;
  z-index: 1;
}

@media (max-width: 900px) { body::before { display: none; } }

::selection { background: var(--highlight); color: var(--ink); }

/* ---------- TOPBAR ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--paper-edge);
  padding: 0.9rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 32px; height: 32px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.85rem;
  font-style: italic;
}

.topbar-progress { flex: 1; max-width: 300px; margin: 0 1rem; }

.progress-track {
  height: 4px;
  background: var(--paper-edge);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--strand);
  transition: width 0.6s var(--ease-out);
}

.progress-label {
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-top: 0.3rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mode-toggle {
  background: transparent;
  border: 1px solid var(--paper-edge);
  color: var(--ink);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.mode-toggle:hover {
  background: var(--paper-2);
  border-color: var(--ink-faint);
}

@media (max-width: 640px) {
  .topbar { gap: 0.5rem; padding: 0.7rem 1rem; }
  .topbar-progress { max-width: 120px; margin: 0 0.5rem; }
  .progress-label { display: none; }
  .brand span:not(.brand-mark) { display: none; }
  .mode-toggle span:not(#modeIcon) { display: none; }
}

/* ---------- LAYOUT ---------- */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem var(--gutter) 6rem;
  position: relative;
  z-index: 2;
}

.section {
  margin-bottom: 4.5rem;
  position: relative;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--hand);
  font-size: 1.4rem;
  color: var(--strand);
  margin-bottom: 0.3rem;
  font-weight: 600;
  transform: rotate(-1.5deg);
}

.section-tag::before {
  content: '';
  width: 28px;
  height: 2px;
  background: var(--strand);
}

.section-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 30;
}

.lead {
  margin-bottom: 1.5rem;
  color: var(--ink-soft);
  max-width: 42rem;
  font-size: 1.02rem;
  line-height: 1.6;
}

/* ---------- TOPIC HEAD ---------- */
.topic-head {
  padding: 2.5rem 0 2rem;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 3rem;
  position: relative;
}

.topic-meta {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  flex-wrap: wrap;
}

.term-badge {
  background: var(--strand-fill);
  color: var(--strand-fill-ink);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius);
  letter-spacing: 0.08em;
}

.strand-badge { display: flex; align-items: center; gap: 0.4rem; }

.strand-dot {
  width: 10px; height: 10px;
  background: var(--strand);
  border-radius: 50%;
}

.topic-number {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(4rem, 12vw, 7rem);
  line-height: 0.9;
  color: var(--ink);
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 60;
  letter-spacing: -0.05em;
}

.topic-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0.3rem 0 1rem;
  font-variation-settings: "opsz" 144, "SOFT" 40;
}

.topic-blurb {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 36rem;
  line-height: 1.55;
}

.topic-blurb strong {
  color: var(--ink);
  background: linear-gradient(transparent 60%, rgba(244, 208, 63, 0.5) 60%);
  font-weight: 600;
}

/* ---------- HOOK ---------- */
.hook {
  background: var(--ink);
  color: var(--paper);
  padding: 2.5rem;
  border-radius: var(--radius-card);
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
}

[data-mode="dark"] .hook {
  background: var(--paper-2);
  color: var(--ink);
  border: 1px solid var(--paper-edge);
}

.hook::before {
  content: '?';
  position: absolute;
  right: -2rem;
  top: -3rem;
  font-family: var(--display);
  font-size: 18rem;
  line-height: 1;
  font-weight: 900;
  font-style: italic;
  color: var(--strand);
  opacity: 0.18;
  pointer-events: none;
}

.hook-label {
  font-family: var(--hand);
  font-size: 1.3rem;
  color: var(--strand);
  margin-bottom: 0.5rem;
  display: inline-block;
  transform: rotate(-2deg);
}

.hook-question {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
  max-width: 36rem;
}

.hook-answer {
  margin-top: 1.2rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease-out), opacity 0.4s var(--ease);
  opacity: 0;
  position: relative;
  z-index: 1;
}

.hook.revealed .hook-answer {
  max-height: 600px;
  opacity: 1;
}

.hook-answer p {
  font-size: 1rem;
  color: rgba(250, 246, 236, 0.85);
  margin-top: 0.8rem;
  max-width: 36rem;
  line-height: 1.6;
}

.hook-answer p + p { margin-top: 0.8rem; }

[data-mode="dark"] .hook-answer p { color: var(--ink-soft); }

.hook-answer strong { color: var(--paper); font-weight: 700; }
[data-mode="dark"] .hook-answer strong { color: var(--ink); }

.hook-reveal-btn {
  margin-top: 1.5rem;
  background: var(--strand-fill);
  color: var(--strand-fill-ink);
  border: none;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s var(--ease);
  position: relative;
  z-index: 1;
}

.hook-reveal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.hook.revealed .hook-reveal-btn { display: none; }

/* ---------- BIG IDEA ---------- */
.big-idea {
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  border-left: 6px solid var(--strand);
  padding: 1.8rem 2rem;
  border-radius: var(--radius-card);
  margin-bottom: 2rem;
  position: relative;
}

.big-idea-label {
  font-family: var(--hand);
  font-size: 1.2rem;
  color: var(--strand);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.big-idea h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.015em;
  margin-bottom: 0.7rem;
  line-height: 1.2;
}

.big-idea p {
  color: var(--ink-soft);
  line-height: 1.65;
}

.big-idea p + p { margin-top: 0.7rem; }

.big-idea strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- CALLOUT ---------- */
.callout {
  background: linear-gradient(135deg, rgba(244, 208, 63, 0.18) 0%, rgba(244, 208, 63, 0.08) 100%);
  border: 1px solid rgba(244, 208, 63, 0.4);
  border-radius: var(--radius-card);
  padding: 1.5rem 1.7rem;
  margin: 2rem 0;
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
}

/* The disc colours below (--highlight, --bioluminescent) are FIXED — they are
   set on :root and are NOT overridden by [data-mode="dark"]. So the glyph on
   top of them must be fixed too. Binding it to var(--ink) or var(--paper)
   flipped it with the theme while the disc stayed put, which measured
   1.25:1 for the yellow disc in night dive and 2.42:1 for the teal disc in
   light study — invisible in one mode each, on 153 callouts across 25 files.
   Fixed dark ink measures 10.09:1 on the yellow and 5.82:1 on the teal, in
   BOTH modes. This is the marker-disc rule: solid disc, dark glyph.
   📌 Do not "restore" var(--ink) here. Found 2026-08-10 on Topic 01. */
.callout-icon {
  width: 44px; height: 44px;
  background: var(--highlight);
  color: #1A2733;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.3rem;
  font-style: italic;
  flex-shrink: 0;
}

.callout-content h4 {
  font-family: var(--hand);
  font-size: 1.4rem;
  color: var(--ink);
  margin-bottom: 0.3rem;
  font-weight: 700;
}

.callout-content p {
  color: var(--ink-soft);
  font-size: 0.96rem;
  line-height: 1.55;
}

.callout-content p + p { margin-top: 0.5rem; }

/* Variant: blue "key fact" */
.callout.fact {
  background: linear-gradient(135deg, rgba(31, 179, 165, 0.15) 0%, rgba(31, 179, 165, 0.05) 100%);
  border-color: rgba(31, 179, 165, 0.4);
}
.callout.fact .callout-icon { background: var(--bioluminescent); color: #1A2733; }

/* ---------- COMPARE GRID ---------- */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.compare-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.compare-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 720px) {
  .compare-grid,
  .compare-grid.cols-2,
  .compare-grid.cols-4 { grid-template-columns: 1fr; }
}

.region-card {
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-card);
  padding: 1.4rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease);
}

.region-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px var(--paper-shadow);
}

.region-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--marker, var(--strand));
}

.region-card[data-region="cool"] { --marker: var(--cool-current); }
.region-card[data-region="warm"] { --marker: var(--warm-current); }
.region-card[data-region="sub"] { --marker: var(--subtropical); }

.region-card .temp,
.region-card .stat-big {
  font-family: var(--hand);
  font-size: 1.5rem;
  color: var(--marker, var(--strand));
  font-weight: 700;
  line-height: 1;
}

.region-card h4 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0.5rem 0 0.4rem;
  letter-spacing: -0.01em;
}

.region-card .sub-meta {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
}

.region-card ul {
  list-style: none;
  margin-top: 0.8rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.region-card ul li {
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--paper-edge);
  display: flex;
  gap: 0.5rem;
}

.region-card ul li:last-child { border-bottom: none; }

.region-card ul li::before {
  content: '→';
  color: var(--marker, var(--strand));
  font-weight: 700;
}

.region-card strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- VOCAB FLIP CARDS ---------- */
.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
  margin-bottom: 2rem;
}

.vocab-card {
  perspective: 1000px;
  height: 160px;
  cursor: pointer;
}

.vocab-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s var(--ease-out);
  transform-style: preserve-3d;
}

.vocab-card.flipped .vocab-inner { transform: rotateY(180deg); }

.vocab-front, .vocab-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-card);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  border: 1px solid var(--paper-edge);
}

.vocab-front { background: var(--paper-2); }

.vocab-back {
  background: var(--ink);
  color: var(--paper);
  transform: rotateY(180deg);
}

[data-mode="dark"] .vocab-back {
  background: var(--strand-fill);
  color: var(--strand-fill-ink);
}

.vocab-term {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ink);
}

.vocab-hint {
  font-family: var(--hand);
  font-size: 1.05rem;
  color: var(--ink-faint);
  margin-top: auto;
}

.vocab-back p { font-size: 0.92rem; line-height: 1.5; }
.vocab-back strong { color: var(--paper); font-weight: 700; }

.vocab-back .vocab-tap {
  font-family: var(--hand);
  font-size: 0.95rem;
  margin-top: auto;
  opacity: 0.7;
}

/* ---------- PROCESS DEMO ---------- */
.process-demo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 720px) { .process-demo { grid-template-columns: 1fr; } }

.process-card {
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  overflow: hidden;
}

.process-card h4 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.process-card .where {
  font-family: var(--hand);
  font-size: 1.1rem;
  color: var(--ink-faint);
  margin-bottom: 1rem;
}

.process-svg {
  width: 100%;
  height: 200px;
  display: block;
  margin-bottom: 1rem;
  background: var(--paper);
  border-radius: var(--radius);
}

.process-card[data-type="up"] h4 { color: var(--cool-current); }
.process-card[data-type="down"] h4 { color: var(--warm-current); }

.process-card p {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

.process-card strong { color: var(--ink); font-weight: 600; }

/* ---------- MAP EXPLORER ---------- */
.map-explorer {
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.map-instructions {
  font-family: var(--hand);
  font-size: 1.3rem;
  color: var(--strand);
  margin-bottom: 0.8rem;
  font-weight: 600;
}

.map-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 720px) { .map-grid { grid-template-columns: 1fr; } }

.map-svg-wrap {
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.map-region {
  cursor: pointer;
  transition: opacity 0.2s var(--ease), transform 0.3s var(--ease-out);
  transform-origin: center;
}

.map-region:hover { opacity: 0.85; }
.map-region.active { filter: brightness(1.1); }

.map-info {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1.2rem;
  min-height: 220px;
  border: 1px dashed var(--paper-edge);
}

.map-info-default {
  color: var(--ink-faint);
  font-style: italic;
  font-size: 0.95rem;
  text-align: center;
  padding-top: 4rem;
  font-family: var(--hand);
  font-size: 1.3rem;
}

.map-info-active h4 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.map-info-active .region-temp,
.map-info-active .region-meta {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.region-temp::before,
.region-meta::before {
  content: '';
  width: 8px; height: 8px;
  background: currentColor;
  border-radius: 50%;
}

.map-info-active p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

.map-info-active ul {
  margin-top: 0.6rem;
  padding-left: 1.2rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.map-info-active strong { color: var(--ink); font-weight: 600; }

/* ---------- HOTSPOT (clickable list of points on a diagram) ---------- */
.hotspot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--strand);
  border: 3px solid var(--paper);
  cursor: pointer;
  position: absolute;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.2s var(--ease);
  z-index: 2;
}

.hotspot::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--strand);
  opacity: 0.5;
  animation: pulse 2.4s ease-out infinite;
}

.hotspot:hover { transform: translate(-50%, -50%) scale(1.15); }
.hotspot.active { background: var(--highlight); }

@keyframes pulse {
  0% { transform: scale(0.85); opacity: 0.5; }
  70%, 100% { transform: scale(1.6); opacity: 0; }
}

/* ---------- QUIZ ---------- */
.quiz {
  background: var(--ink);
  color: var(--paper);
  padding: 2rem;
  border-radius: var(--radius-card);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

[data-mode="dark"] .quiz {
  background: var(--paper-2);
  color: var(--ink);
  border: 1px solid var(--paper-edge);
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quiz-header h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.quiz-counter {
  font-family: var(--hand);
  font-size: 1.2rem;
  color: var(--strand);
}

.quiz-question {
  font-size: 1.15rem;
  margin-bottom: 1.2rem;
  line-height: 1.4;
  font-weight: 500;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.quiz-option {
  background: rgba(250, 246, 236, 0.05);
  border: 2px solid rgba(250, 246, 236, 0.15);
  color: var(--paper);
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--body);
  font-size: 0.97rem;
  text-align: left;
  transition: all 0.2s var(--ease);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

[data-mode="dark"] .quiz-option {
  background: var(--paper);
  border-color: var(--paper-edge);
  color: var(--ink);
}

.quiz-option:hover:not(.correct):not(.wrong) {
  background: rgba(250, 246, 236, 0.1);
  border-color: var(--strand);
  transform: translateX(4px);
}

[data-mode="dark"] .quiz-option:hover:not(.correct):not(.wrong) {
  background: var(--paper-2);
}

.quiz-option .letter {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1.5px solid currentColor;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.quiz-option.correct {
  background: rgba(74, 124, 57, 0.3);
  border-color: var(--marine-bio);
}

.quiz-option.wrong {
  background: rgba(217, 83, 79, 0.25);
  border-color: var(--hook);
}

.quiz-feedback {
  margin-top: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  display: none;
  background: rgba(250, 246, 236, 0.08);
  line-height: 1.5;
}

[data-mode="dark"] .quiz-feedback { background: var(--paper); }

.quiz-feedback.show { display: block; }

.quiz-feedback strong {
  color: var(--strand);
  font-weight: 700;
}

.quiz-next {
  background: var(--strand-fill);
  color: var(--strand-fill-ink);
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 1rem;
  display: none;
  transition: transform 0.2s var(--ease);
}

.quiz-next.show { display: inline-block; }
.quiz-next:hover { transform: translateY(-2px); }

.quiz-complete {
  display: none;
  text-align: center;
  padding: 2rem 0;
}

.quiz-complete.show { display: block; }

.quiz-complete .score {
  font-family: var(--display);
  font-weight: 900;
  font-style: italic;
  font-size: 4rem;
  color: var(--strand);
  line-height: 1;
}

.quiz-complete h3 {
  font-family: var(--display);
  font-size: 1.5rem;
  margin: 0.5rem 0 0.3rem;
}

.quiz-complete p {
  color: rgba(250, 246, 236, 0.75);
  max-width: 32rem;
  margin: 0 auto;
}

[data-mode="dark"] .quiz-complete p { color: var(--ink-soft); }

.quiz-restart {
  background: transparent;
  border: 1.5px solid var(--strand);
  color: var(--strand);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 1.2rem;
  transition: all 0.2s var(--ease);
}

.quiz-restart:hover {
  background: var(--strand-fill);
  color: var(--strand-fill-ink);
}

/* ---------- TOPIC NAV ---------- */
.topic-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 2px solid var(--ink);
  margin-top: 4rem;
  flex-wrap: wrap;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.3rem;
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-card);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s var(--ease);
  flex: 1;
  max-width: 280px;
  min-width: 0;
}

.nav-link:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  transform: translateY(-2px);
}

[data-mode="dark"] .nav-link:hover {
  background: var(--strand-fill);
  border-color: var(--strand-fill);
  color: var(--strand-fill-ink);   /* was inheriting var(--paper) = dark navy */
}

.nav-link.next {
  margin-left: auto;
  text-align: right;
  flex-direction: row-reverse;
}

.nav-link .label {
  font-family: var(--hand);
  font-size: 1rem;
  color: var(--ink-faint);
  display: block;
}

.nav-link .title {
  display: block;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
}

.nav-link:hover .label,
.nav-link:hover .title { color: inherit; }

.nav-link.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* "🔬 Practical for this topic" — the third slot in .topic-nav, sitting
   between prev and next. Strand colour is carried by the border only.
   Text stays on --ink so it flips correctly in night-dive mode; the
   strand hex is a mid-tone and fails contrast as text on dark paper.
   Hover inherits .nav-link:hover, including the dark-mode variant. */
.nav-link.prac {
  border: 2px solid var(--strand);
  /* 320px, not 260 — at 260 the title wraps to two lines and the card
     stands taller than prev/next. */
  flex: 0 1 320px;
  max-width: 320px;
  justify-content: center;
  text-align: center;
}

/* ---------- PRACTICAL SHEETS (Phase P) ---------- */
/* Completion button in .prac-nav. Hidden in print with the rest of the
   nav, so the printed worksheet stays clean. */
/* Outline treatment in both states, deliberately. A strand-filled button
   with var(--paper) text measures 2.5:1 in night-dive mode and 4.1:1 on
   coral orange in light mode — both fail. Ink-on-paper is the one pairing
   the design system guarantees in both modes, so the strand is carried by
   the border and the state by the tick and the border weight. */
.prac-done {
  flex: 1 1 240px;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--body);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}

.prac-done:hover { border-color: var(--strand); }

.prac-done.done {
  border: 2px solid var(--strand);
  font-weight: 700;
}

.prac-done.done::before {
  content: "✓ ";
  font-weight: 800;
}

/* ---------- ANIMATIONS ---------- */
@keyframes float-up {
  0% { transform: translateY(0); opacity: 0.6; }
  100% { transform: translateY(-180px); opacity: 0; }
}

@keyframes float-down {
  0% { transform: translateY(0); opacity: 0.7; }
  100% { transform: translateY(180px); opacity: 0; }
}

@keyframes wave {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-10px); }
}

.bubble { animation: float-up 4s linear infinite; }
.sink-arrow { animation: float-down 3.5s ease-in infinite; }
.wave-anim { animation: wave 6s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- UTILITY ---------- */
.text-soft { color: var(--ink-soft); }
.text-faint { color: var(--ink-faint); }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.text-center { text-align: center; }

/* ---------- HUB / MASTER PAGE GRID ---------- */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.topic-tile {
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-card);
  padding: 1.3rem;
  text-decoration: none;
  color: var(--ink);
  display: block;
  position: relative;
  overflow: hidden;
  transition: all 0.25s var(--ease-out);
}

.topic-tile::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--tile-strand, var(--ink-faint));
}

.topic-tile[data-strand="oceanography"]  { --tile-strand: var(--oceanography); }
.topic-tile[data-strand="marine-bio"]    { --tile-strand: var(--marine-bio); }
.topic-tile[data-strand="marine-eco"]    { --tile-strand: var(--marine-eco); }
.topic-tile[data-strand="humans-ocean"]  { --tile-strand: var(--humans-ocean); }

.topic-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px var(--paper-shadow);
}

.topic-tile.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.tile-num {
  font-family: var(--display);
  font-weight: 900;
  font-style: italic;
  font-size: 2rem;
  color: var(--tile-strand, var(--ink-faint));
  line-height: 1;
  margin-bottom: 0.5rem;
}

.tile-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.tile-strand {
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.tile-status {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--paper-edge);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  color: var(--ink-faint);
}

.topic-tile.completed .tile-status {
  background: var(--marine-bio);
  border-color: var(--marine-bio);
  color: var(--paper);
}

.topic-tile.completed .tile-status::before {
  content: '✓';
  font-weight: 700;
}

/* ============================================================
   ASSESSMENT COMPONENTS — appended for assessment phase
   ============================================================ */

/* ---------- ASSESSMENT HEAD (per-assessment hero) ---------- */
.assessment-head {
  position: relative;
  padding: 2.5rem 0 2rem;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 2.5rem;
}
.assessment-head .topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}
.assessment-head .assessment-label {
  font-family: var(--hand);
  font-size: 1.6rem;
  color: var(--strand);
  display: block;
  margin-bottom: 0.25rem;
}
.assessment-head h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0.4rem 0 0.6rem;
}
.assessment-head h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--strand);
}
.assessment-head .blurb {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 42rem;
  line-height: 1.55;
}

/* ---------- BLOOM BAND ---------- */
.bloom-band {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.4rem;
  margin: 1.5rem 0 2.5rem;
  padding: 0.8rem;
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-card, 14px);
}
.bloom-band-item {
  text-align: center;
  padding: 0.7rem 0.4rem;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
.bloom-band-item .bloom-icon {
  font-size: 1.2rem;
  line-height: 1;
}
.bloom-band-item .bloom-num {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1;
}
.bloom-band-item:hover {
  border-color: var(--strand);
  color: var(--ink);
}
.bloom-band-item.active {
  background: var(--strand-fill);
  border-color: var(--strand-fill);
  color: var(--strand-fill-ink);
}
.bloom-band-item.active .bloom-num,
.bloom-band-item.complete .bloom-num {
  color: inherit;
}
.bloom-band-item.complete {
  background: var(--paper-edge);
  color: var(--ink-soft);
}
.bloom-band-item.complete::after {
  content: ' ✓';
  font-size: 0.9rem;
}
@media (max-width: 720px) {
  .bloom-band { grid-template-columns: repeat(3, 1fr); }
  .bloom-band-item { font-size: 0.6rem; }
}

/* ---------- BLOOM SECTION (group of activities at one level) ---------- */
.bloom-section {
  margin: 3.5rem 0;
  scroll-margin-top: 80px;
}
.bloom-section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed var(--paper-edge);
}
.bloom-section-head .level-num {
  font-family: var(--display);
  font-weight: 900;
  font-style: italic;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--strand);
}
.bloom-section-head h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  margin: 0;
}
.bloom-section-head .verb {
  font-family: var(--hand);
  font-size: 1.2rem;
  color: var(--ink-faint);
}
.bloom-section-desc {
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.55;
  margin-bottom: 1.6rem;
  max-width: 40rem;
}

/* ---------- ACTIVITY CARD ---------- */
.activity-card {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-left: 4px solid var(--strand);
  border-radius: var(--radius-card, 14px);
  padding: 1.6rem 1.4rem;
  margin-bottom: 1.4rem;
  box-shadow: 0 2px 6px var(--paper-shadow);
  transition: border-color 0.2s var(--ease);
}
.activity-card.answered {
  border-left-color: var(--marine-bio);
}
.activity-card.answered-wrong {
  border-left-color: var(--hook);
}
.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}
.activity-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}
.activity-instructions {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-bottom: 1.1rem;
  line-height: 1.55;
}
.activity-body {
  margin: 1rem 0;
}
.activity-feedback {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  background: var(--paper-2);
  border-left: 3px solid var(--strand);
  font-size: 0.95rem;
  display: none;
}
.activity-feedback.show { display: block; }
.activity-feedback.correct { border-left-color: var(--marine-bio); }
.activity-feedback.wrong { border-left-color: var(--hook); }
.activity-submit {
  background: var(--strand-fill);
  color: var(--strand-fill-ink);
  border: none;
  padding: 0.65rem 1.3rem;
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s var(--ease);
}
.activity-submit:hover { opacity: 0.88; }
.activity-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- CHIP (small label pill) ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  color: var(--ink-soft);
  white-space: nowrap;
}
.chip-bloom {
  background: var(--strand-fill);
  border-color: var(--strand-fill);
  color: var(--strand-fill-ink);
}
.chip-type {
  background: var(--paper-2);
  color: var(--ink);
}
.chip-mark-auto {
  background: rgba(74, 124, 57, 0.15);
  border-color: var(--marine-bio);
  color: var(--marine-bio);
}
.chip-mark-rubric {
  background: rgba(199, 84, 38, 0.15);
  border-color: var(--marine-eco);
  color: var(--marine-eco);
}
.chip-mark-human {
  background: rgba(107, 79, 168, 0.15);
  border-color: var(--humans-ocean);
  color: var(--humans-ocean);
}

/* ---------- MCQ OPTIONS ---------- */
.mcq-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.6rem 0 1rem;
  list-style: none;
  padding: 0;
}
.mcq-option {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  background: var(--paper-2);
  border: 1.5px solid var(--paper-edge);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--body);
  font-size: 0.98rem;
  text-align: left;
  color: var(--ink);
  transition: all 0.18s var(--ease);
}
.mcq-option:hover {
  border-color: var(--strand);
  background: var(--paper);
}
.mcq-option .letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--paper-edge);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.mcq-option.selected {
  border-color: var(--strand);
  background: var(--paper);
}
.mcq-option.selected .letter {
  background: var(--strand-fill);
  color: var(--strand-fill-ink);
  border-color: var(--strand);
}
.mcq-option.correct {
  background: rgba(74, 124, 57, 0.15);
  border-color: var(--marine-bio);
}
.mcq-option.correct .letter {
  background: var(--marine-bio);
  color: var(--paper);
  border-color: var(--marine-bio);
}
.mcq-option.wrong {
  background: rgba(217, 83, 79, 0.12);
  border-color: var(--hook);
}
.mcq-option.wrong .letter {
  background: var(--hook);
  color: var(--paper);
  border-color: var(--hook);
}
.mcq-option.locked { pointer-events: none; }

/* ---------- TRUE / FALSE ---------- */
.tf-row {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin: 0.6rem 0 1rem;
}
.tf-buttons {
  display: flex;
  gap: 0.6rem;
}
.tf-btn {
  flex: 1;
  padding: 0.85rem 1rem;
  background: var(--paper-2);
  border: 1.5px solid var(--paper-edge);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  transition: all 0.18s var(--ease);
}
.tf-btn:hover {
  border-color: var(--strand);
  background: var(--paper);
}
.tf-btn.selected {
  background: var(--strand-fill);
  color: var(--strand-fill-ink);
  border-color: var(--strand);
}
.tf-btn.correct {
  background: var(--marine-bio);
  color: var(--paper);
  border-color: var(--marine-bio);
}
.tf-btn.wrong {
  background: var(--hook);
  color: var(--paper);
  border-color: var(--hook);
}
.tf-correction {
  display: none;
  margin-top: 0.4rem;
}
.tf-correction.show { display: block; }
.tf-correction label {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
  font-family: var(--hand);
  font-size: 1.05rem;
}

/* ---------- MATCH GRID ---------- */
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0.6rem 0 1rem;
  position: relative;
}
.match-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.match-col-label {
  font-family: var(--hand);
  font-size: 1.1rem;
  color: var(--ink-faint);
  margin-bottom: 0.3rem;
}
.match-item {
  padding: 0.7rem 0.9rem;
  background: var(--paper-2);
  border: 1.5px solid var(--paper-edge);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.92rem;
  transition: all 0.18s var(--ease);
}
.match-item:hover { border-color: var(--strand); }
.match-item.selected {
  border-color: var(--strand);
  background: var(--paper);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.05);
}
.match-item.matched {
  background: rgba(74, 124, 57, 0.12);
  border-color: var(--marine-bio);
  cursor: default;
}
.match-item.matched::after {
  content: ' ✓';
  color: var(--marine-bio);
  font-weight: 700;
}
.match-item.correct { background: rgba(74, 124, 57, 0.18); border-color: var(--marine-bio); }
.match-item.wrong { background: rgba(217, 83, 79, 0.15); border-color: var(--hook); }

/* ---------- CLOZE / FILL-IN ---------- */
.cloze-blank {
  display: inline-block;
  border: none;
  border-bottom: 2px solid var(--ink);
  background: transparent;
  font-family: var(--hand);
  font-size: 1.15rem;
  color: var(--ink);
  padding: 0.1rem 0.4rem;
  min-width: 100px;
  text-align: center;
  font-weight: 700;
}
.cloze-blank:focus {
  outline: none;
  border-bottom-color: var(--strand);
}
.cloze-blank.correct {
  background: rgba(74, 124, 57, 0.15);
  border-bottom-color: var(--marine-bio);
}
.cloze-blank.wrong {
  background: rgba(217, 83, 79, 0.12);
  border-bottom-color: var(--hook);
}
.cloze-text {
  font-size: 1.05rem;
  line-height: 2;
  color: var(--ink);
}

/* ---------- SEQUENCE / ORDERING ---------- */
.sequence-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.6rem 0 1rem;
  list-style: none;
  padding: 0;
  counter-reset: seq;
}
.sequence-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  background: var(--paper-2);
  border: 1.5px solid var(--paper-edge);
  border-radius: 8px;
  cursor: grab;
  user-select: none;
  counter-increment: seq;
}
.sequence-item::before {
  content: counter(seq);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--strand);
  width: 24px;
  flex-shrink: 0;
}
.sequence-item.dragging { opacity: 0.5; cursor: grabbing; }
.sequence-item.over { border-color: var(--strand); }
.sequence-item .seq-text { flex: 1; }
.sequence-controls {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sequence-btn {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  width: 26px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.7rem;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sequence-btn:hover { background: var(--strand-fill); color: var(--strand-fill-ink); }
.sequence-item.correct { background: rgba(74, 124, 57, 0.12); border-color: var(--marine-bio); }
.sequence-item.wrong { background: rgba(217, 83, 79, 0.10); border-color: var(--hook); }

/* ---------- OPEN RESPONSE (short / long answer) ---------- */
.open-response {
  width: 100%;
  min-height: 5rem;
  padding: 0.9rem 1rem;
  background: var(--paper);
  border: 1.5px solid var(--paper-edge);
  border-radius: 8px;
  font-family: var(--body);
  font-size: 0.98rem;
  color: var(--ink);
  line-height: 1.55;
  resize: vertical;
  background-image: repeating-linear-gradient(
    transparent,
    transparent 1.55em,
    rgba(60, 40, 20, 0.06) 1.55em,
    rgba(60, 40, 20, 0.06) calc(1.55em + 1px)
  );
}
.open-response:focus {
  outline: none;
  border-color: var(--strand);
}
.open-response.long { min-height: 10rem; }

/* ---------- CASE STUDY ---------- */
.case-study {
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  border-left: 5px solid var(--strand);
  border-radius: var(--radius-card, 14px);
  padding: 1.4rem 1.4rem 1.2rem;
  margin: 1rem 0 1.5rem;
}
.case-study-label {
  font-family: var(--hand);
  font-size: 1.2rem;
  color: var(--strand);
  margin-bottom: 0.4rem;
}
.case-study-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0 0 0.6rem;
}
.case-study-body {
  font-size: 0.98rem;
  color: var(--ink);
  line-height: 1.6;
}
.case-study-body p { margin-bottom: 0.8rem; }
.case-study-questions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--paper-edge);
}

/* ---------- DATA TABLE ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.8rem 0 1rem;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.92rem;
}
.data-table th,
.data-table td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--paper-edge);
}
.data-table th {
  background: var(--paper-2);
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
  font-size: 0.88rem;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table caption {
  caption-side: top;
  text-align: left;
  font-family: var(--hand);
  font-size: 1.1rem;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}

/* ---------- CREATIVE BRIEF ---------- */
.creative-brief {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-card, 14px);
  margin: 1rem 0 1.5rem;
  overflow: hidden;
}
.creative-brief-band {
  background: var(--strand-fill);
  color: var(--strand-fill-ink);
  padding: 0.5rem 1rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.creative-brief-body {
  padding: 1.2rem 1.4rem;
}
.creative-brief-prompt {
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.creative-brief-prompt strong { color: var(--strand); }
.creative-attempted {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  padding: 0.7rem 1rem;
  background: var(--paper-2);
  border-radius: 6px;
  font-size: 0.9rem;
}
.creative-attempted input { width: 1.1em; height: 1.1em; }

/* ---------- RUBRIC ---------- */
.rubric {
  margin-top: 1rem;
  background: var(--paper-2);
  border: 1px dashed var(--paper-edge);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
}
.rubric-label {
  font-family: var(--hand);
  font-size: 1.1rem;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
}
.rubric ul { padding: 0; margin: 0; list-style: none; }
.rubric li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--paper-edge);
  font-size: 0.92rem;
}
.rubric li:last-child { border-bottom: none; }
.rubric .crit-name { color: var(--ink); }
.rubric .crit-pts {
  font-family: var(--display);
  font-weight: 700;
  color: var(--strand);
  font-size: 0.95rem;
  white-space: nowrap;
}
.rubric .crit-rate {
  display: flex;
  gap: 0.3rem;
}
.rubric .crit-rate button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--paper-edge);
  background: var(--paper);
  cursor: pointer;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--ink-soft);
  transition: all 0.15s var(--ease);
}
.rubric .crit-rate button:hover { border-color: var(--strand); }
.rubric .crit-rate button.selected {
  background: var(--strand-fill);
  color: var(--strand-fill-ink);
  border-color: var(--strand);
}

/* ---------- EXAM PAPER ---------- */
.exam-paper {
  margin: 4rem 0 3rem;
  padding: 2rem 1.6rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-card, 14px);
  position: relative;
}
.exam-paper::before {
  content: '';
  position: absolute;
  top: 0.5rem; left: 0.5rem; right: 0.5rem; bottom: 0.5rem;
  border: 1px solid var(--paper-edge);
  border-radius: 10px;
  pointer-events: none;
}
.exam-paper-head {
  text-align: center;
  margin-bottom: 1.8rem;
  padding-bottom: 1.2rem;
  border-bottom: 2px solid var(--ink);
}
.exam-paper-head .exam-stamp {
  font-family: var(--hand);
  font-size: 1.4rem;
  color: var(--strand);
  margin-bottom: 0.2rem;
}
.exam-paper-head h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  margin: 0.3rem 0;
  letter-spacing: -0.01em;
}
.exam-paper-head .exam-meta {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-family: var(--hand);
  font-size: 1rem;
}
.exam-section {
  margin: 2.5rem 0;
}
.exam-section-head {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--paper-edge);
}
.exam-section-letter {
  font-family: var(--display);
  font-weight: 900;
  font-size: 2rem;
  line-height: 1;
  color: var(--strand);
  font-style: italic;
}
.exam-section-head h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0;
}
.exam-section-head .marks {
  margin-left: auto;
  font-family: var(--hand);
  font-size: 1.1rem;
  color: var(--ink-faint);
}
.exam-section-desc {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  font-style: italic;
}

/* ---------- MEMO + TEACHER GUIDE (collapsibles) ---------- */
.memo-toggle,
.teacher-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.4rem;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: var(--radius-card, 14px);
  cursor: pointer;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  text-align: left;
  margin: 1rem 0 0;
  letter-spacing: -0.01em;
  transition: opacity 0.2s var(--ease);
}
.memo-toggle:hover,
.teacher-toggle:hover { opacity: 0.9; }
.memo-toggle .toggle-icon,
.teacher-toggle .toggle-icon {
  font-family: var(--body);
  font-size: 1.2rem;
  transition: transform 0.25s var(--ease);
}
.memo-toggle[aria-expanded="true"] .toggle-icon,
.teacher-toggle[aria-expanded="true"] .toggle-icon {
  transform: rotate(45deg);
}
.memo-content,
.teacher-guide {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease);
  background: var(--paper-2);
  border-radius: 0 0 var(--radius-card, 14px) var(--radius-card, 14px);
  margin-top: -8px;
}
.memo-content.open,
.teacher-guide.open {
  max-height: 8000px;
}
.memo-content-inner,
.teacher-guide-inner {
  padding: 1.6rem 1.4rem;
  border: 1px solid var(--paper-edge);
  border-top: none;
  border-radius: 0 0 var(--radius-card, 14px) var(--radius-card, 14px);
}
.memo-item {
  padding: 1rem 0;
  border-bottom: 1px dashed var(--paper-edge);
}
.memo-item:last-child { border-bottom: none; }
.memo-item .memo-q {
  font-weight: 700;
  color: var(--strand);
  margin-bottom: 0.4rem;
  font-family: var(--display);
  font-size: 1rem;
}
.memo-item .memo-a {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ---------- ASSESSMENT PROGRESS ---------- */
.assessment-progress {
  position: sticky;
  top: 70px;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-card, 14px);
  padding: 0.9rem 1.1rem;
  margin: 1.5rem 0 2.5rem;
  z-index: 5;
  box-shadow: 0 4px 12px var(--paper-shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.assessment-progress .progress-track {
  flex: 1;
  min-width: 120px;
  height: 6px;
  background: var(--paper-2);
  border-radius: 3px;
  overflow: hidden;
}
.assessment-progress .progress-fill {
  height: 100%;
  background: var(--strand);
  width: 0%;
  transition: width 0.4s var(--ease);
}
.assessment-progress .progress-stat {
  font-family: var(--hand);
  font-size: 1rem;
  color: var(--ink-soft);
}
.assessment-progress .progress-stat strong {
  color: var(--ink);
  font-family: var(--body);
  font-weight: 700;
}

/* ---------- SCORE SUMMARY ---------- */
.score-summary {
  margin: 3rem 0 2rem;
  padding: 2rem 1.6rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-card, 14px);
  text-align: center;
  display: none;
}
.score-summary.show { display: block; }
.score-summary h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}
.score-summary .score-total {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3rem, 8vw, 5rem);
  line-height: 1;
  color: var(--strand);
  margin: 1rem 0;
}
.score-summary .score-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.8rem;
  margin-top: 1.6rem;
  text-align: left;
}
.score-summary .breakdown-item {
  background: rgba(255,255,255,0.06);
  padding: 0.8rem 1rem;
  border-radius: 8px;
  border-left: 3px solid var(--strand);
}
.score-summary .breakdown-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  opacity: 0.7;
  margin-bottom: 0.3rem;
}
.score-summary .breakdown-value {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.4rem;
}
[data-mode="dark"] .score-summary {
  background: var(--paper-2);
  color: var(--ink);
  border: 1px solid var(--paper-edge);
}

/* ---------- MARKS CHIP ---------- */
.marks-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.78rem;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.marks-chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--strand);
  display: inline-block;
}
.marks-chip.large {
  font-size: 0.95rem;
  padding: 0.3rem 0.8rem;
}
.exam-section-head .marks-chip {
  margin-left: auto;
}
[data-mode="dark"] .marks-chip {
  background: var(--paper-2);
  color: var(--ink);
  border-color: var(--paper-edge);
}

/* ---------- COPY-FOR-AI BUTTON ---------- */
.copy-for-ai {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px dashed var(--paper-edge);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  transition: all 0.18s var(--ease);
  margin-top: 0.6rem;
  position: relative;
}
.copy-for-ai:hover {
  border-color: var(--strand);
  color: var(--strand);
  background: var(--paper-2);
}
.copy-for-ai .copy-icon {
  font-size: 0.9rem;
  line-height: 1;
}
.copy-for-ai.copied {
  border-color: var(--marine-bio);
  color: var(--marine-bio);
  background: rgba(74, 124, 57, 0.08);
}
.copy-for-ai .copy-tooltip {
  position: absolute;
  top: -2.4rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
  font-family: var(--body);
  letter-spacing: normal;
}
.copy-for-ai .copy-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
}
.copy-for-ai.copied .copy-tooltip { opacity: 1; }

/* ---------- COMPLETION COUNTER (next to Finish button) ---------- */
.completion-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  background: var(--paper-2);
  border: 1.5px solid var(--paper-edge);
  border-radius: 8px;
  font-family: var(--hand);
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin-right: 0.8rem;
}
.completion-counter strong {
  font-family: var(--body);
  font-weight: 700;
  color: var(--ink);
}
.completion-counter.ready {
  background: rgba(74, 124, 57, 0.12);
  border-color: var(--marine-bio);
  color: var(--marine-bio);
}
.completion-counter.ready strong { color: var(--marine-bio); }

.finish-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 2rem 0 0;
}

#finishAssessment[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--ink-faint);
}
#finishAssessment:not([disabled]) {
  background: var(--strand-fill);
  color: var(--strand-fill-ink);
}

/* ---------- UNANSWERED FLASH ---------- */
.activity-card.unanswered-flash {
  animation: unanswered-pulse 0.5s var(--ease) 0s 3;
  box-shadow: 0 0 0 3px var(--hook), 0 4px 14px var(--paper-shadow);
}
@keyframes unanswered-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 83, 79, 0); }
  50%      { box-shadow: 0 0 0 4px rgba(217, 83, 79, 0.55); }
}
@media (prefers-reduced-motion: reduce) {
  .activity-card.unanswered-flash { animation: none; box-shadow: 0 0 0 3px var(--hook); }
}

/* ============================================================
   APPENDED 2026-04-28 — STUDENT CONTROL ONBOARD PAGE (Phase A4)
   ============================================================ */

.onboard-head {
  max-width: var(--max);
  margin: 2.5rem auto 1.5rem;
  padding: 0 var(--gutter);
}
.onboard-head h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0.4rem 0 0.8rem;
  font-variation-settings: "opsz" 144, "SOFT" 40;
}
.onboard-head h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--strand);
}
.onboard-blurb {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 36rem;
  margin-top: 0.5rem;
}

.onboard-mode-picker {
  max-width: var(--max);
  margin: 1.5rem auto 1.8rem;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 720px) {
  .onboard-mode-picker { grid-template-columns: 1fr; }
}
.onboard-mode-tab {
  background: var(--paper-2);
  border: 1.5px solid var(--paper-edge);
  border-radius: var(--radius-card);
  padding: 1.2rem 1.4rem;
  text-align: left;
  cursor: pointer;
  font-family: var(--body);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0.2rem 0.9rem;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), background 0.18s var(--ease);
}
.onboard-mode-tab:hover {
  border-color: var(--strand);
  transform: translateY(-1px);
}
.onboard-mode-tab.active {
  background: var(--paper);
  border-color: var(--strand);
  box-shadow: 0 4px 14px var(--paper-shadow);
}
.mode-tab-num {
  grid-row: 1 / 3;
  font-family: var(--display);
  font-weight: 700;
  font-style: italic;
  font-size: 2.2rem;
  color: var(--strand);
  line-height: 1;
  align-self: center;
}
.mode-tab-label {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}
.mode-tab-hint {
  color: var(--ink-faint);
  font-size: 0.88rem;
}

.onboard-panel {
  max-width: var(--max);
  margin: 0 auto 2.5rem;
  padding: 1.8rem var(--gutter) 2rem;
  background: var(--paper);
  border: 1.5px solid var(--paper-edge);
  border-radius: var(--radius-card);
  box-shadow: 0 6px 22px var(--paper-shadow);
}
.onboard-section-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin: 0.2rem 0 0.6rem;
  letter-spacing: -0.015em;
}
.onboard-help {
  color: var(--ink-soft);
  font-size: 0.98rem;
  margin-bottom: 1.4rem;
}
.onboard-help code {
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  font-size: 0.92em;
}

.onboard-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.1rem;
  align-items: end;
}
@media (max-width: 640px) {
  .onboard-form { grid-template-columns: 1fr; }
}
.onboard-field { display: flex; flex-direction: column; gap: 0.35rem; }
.onboard-field-label {
  font-family: var(--hand);
  color: var(--ink-faint);
  font-size: 1.1rem;
}
.onboard-field input {
  font-family: var(--body);
  font-size: 1rem;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--paper-edge);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.onboard-field input:focus {
  outline: none;
  border-color: var(--strand);
  background: var(--paper);
}
.onboard-submit {
  grid-column: 1 / -1;
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--strand-fill);
  color: var(--strand-fill-ink);
  border: none;
  border-radius: var(--radius);
  padding: 0.95rem 1.4rem;
  cursor: pointer;
  margin-top: 0.6rem;
  transition: filter 0.16s var(--ease), transform 0.16s var(--ease);
}
.onboard-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }

.onboard-form-error {
  grid-column: 1 / -1;
  background: rgba(217, 83, 79, 0.12);
  border: 1px solid var(--hook);
  color: var(--hook);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
}

.onboard-importer { margin-top: 0.4rem; }
.onboard-file-pick {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--paper-2);
  border: 1.5px dashed var(--paper-edge);
  border-radius: var(--radius-card);
  padding: 1.4rem 1.4rem;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.onboard-file-pick:hover {
  border-color: var(--strand);
  background: var(--paper);
}
.file-pick-icon { font-size: 1.6rem; }
.file-pick-label { font-weight: 700; color: var(--ink); }
.file-pick-hint { color: var(--ink-faint); font-size: 0.88rem; }
.onboard-import-status {
  margin-top: 0.9rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  color: var(--ink-soft);
}
.onboard-import-status.ok {
  background: rgba(74, 124, 57, 0.12);
  border-color: var(--marine-bio);
  color: var(--marine-bio);
}
.onboard-import-status.error {
  background: rgba(217, 83, 79, 0.12);
  border-color: var(--hook);
  color: var(--hook);
}

.onboard-success {
  max-width: var(--max);
  margin: 1.5rem auto 3rem;
  padding: 1.8rem var(--gutter) 2rem;
  background: var(--paper-2);
  border: 1.5px solid var(--strand);
  border-radius: var(--radius-card);
  box-shadow: 0 6px 22px var(--paper-shadow);
}
.onboard-success-body {
  color: var(--ink);
  font-size: 1.05rem;
  margin: 0.4rem 0 1.2rem;
}
.onboard-save-tip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  background: rgba(244, 208, 63, 0.18);
  border: 1px solid var(--highlight);
  border-radius: var(--radius);
  padding: 0.95rem 1.1rem;
  color: var(--ink);
  margin-bottom: 1rem;
}
.save-tip-icon { font-size: 1.6rem; }
.onboard-save-tip code {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  font-size: 0.92em;
  display: inline-block;
  margin: 0.2rem 0;
}
.onboard-redirect-note {
  font-family: var(--hand);
  color: var(--ink-faint);
  font-size: 1.15rem;
}

/* Topbar profile button (hub-only addition) */
.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  margin-right: 0.6rem;
  border: 1.5px solid var(--paper-edge);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.profile-link:hover {
  border-color: var(--strand);
  background: var(--paper);
}
.profile-link .profile-icon { font-size: 1rem; }

/* Active-student chip (hub-only; shown when MS.getActiveStudent() returns
   a control). Strand-neutral on purpose — the hub itself isn't bound to
   a strand, and this is a quiet status indicator, not a focal point. */
.active-student-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  margin-right: 0.6rem;
  border: 1.5px solid var(--ink-soft);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  position: relative;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.active-student-chip:hover {
  border-color: var(--ink);
  background: var(--paper);
}
.active-student-chip .chip-avatar {
  font-size: 0.95rem;
  line-height: 1;
}
.active-student-chip .chip-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 14rem;
}
.active-student-chip .chip-num {
  font-family: var(--body);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.active-student-chip .chip-num::before { content: '#'; opacity: 0.7; }
.active-student-chip .chip-tooltip {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.32rem 0.55rem;
  border-radius: var(--radius);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.16s var(--ease), transform 0.16s var(--ease);
  z-index: 110;
}
.active-student-chip:hover .chip-tooltip,
.active-student-chip:focus-visible .chip-tooltip {
  opacity: 1;
  transform: translateY(0);
}
@media (max-width: 640px) {
  .active-student-chip .chip-name { display: none; }
  .active-student-chip .chip-num  { display: none; }
  .active-student-chip .chip-initials {
    display: inline-block;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
  }
}
@media (min-width: 641px) {
  .active-student-chip .chip-initials { display: none; }
}

/* ============================================================
   APPENDED 2026-04-28 — RESET ASSESSMENT BUTTON (Phase B1)
   ============================================================ */

.assessment-head {
  position: relative; /* anchor the absolute reset button */
}
.reset-assessment {
  position: absolute;
  top: 1.3rem;
  right: var(--gutter);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1.5px solid var(--hook);
  color: var(--hook);
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.reset-assessment:hover {
  background: var(--hook);
  color: var(--paper);
}
.reset-assessment .reset-icon { font-size: 0.95rem; }
.reset-assessment .reset-tooltip {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: none;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.16s var(--ease), transform 0.16s var(--ease);
}
.reset-assessment:hover .reset-tooltip {
  opacity: 1;
  transform: translateY(0);
}
@media (max-width: 640px) {
  .reset-assessment { position: static; margin-bottom: 0.8rem; }
  .reset-assessment .reset-tooltip { display: none; }
}

/* Confirmation modal */
.modal-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 39, 51, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.18s var(--ease);
}
.modal-confirm-overlay.show { opacity: 1; }
.modal-confirm {
  background: var(--paper);
  border: 1.5px solid var(--paper-edge);
  border-radius: var(--radius-card);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  max-width: 28rem;
  width: 100%;
  padding: 1.6rem 1.6rem 1.4rem;
  transform: translateY(8px);
  transition: transform 0.22s var(--ease);
}
.modal-confirm-overlay.show .modal-confirm { transform: translateY(0); }
.modal-confirm h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  margin: 0.3rem 0 0.6rem;
}
.modal-confirm p { color: var(--ink-soft); margin-bottom: 1.2rem; }
.modal-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.modal-confirm-actions button {
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: filter 0.16s var(--ease), background 0.16s var(--ease);
}
.modal-cancel {
  background: var(--paper-2);
  color: var(--ink);
  border-color: var(--paper-edge);
}
.modal-cancel:hover { background: var(--paper); }
.modal-confirm-go {
  background: var(--hook);
  color: var(--paper);
  border-color: var(--hook);
}
.modal-confirm-go:hover { filter: brightness(1.08); }

/* ============================================================
   APPENDED 2026-04-28 — EXPANDED TEACHER GUIDE (Phase C3)
   ============================================================ */

.teacher-guide-block {
  margin: 1.6rem 0;
  padding: 1.1rem 1.3rem;
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-card);
}
.teacher-guide-block + .teacher-guide-block { margin-top: 1rem; }
.teacher-guide-block h4 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 0 0.6rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.teacher-guide-block h4::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--strand);
  display: inline-block;
}

/* Block 1: Blueprint table */
.blueprint-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-family: var(--body);
}
.blueprint-table thead th {
  text-align: left;
  font-family: var(--hand);
  color: var(--ink-faint);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.4rem 0.6rem;
  border-bottom: 1.5px solid var(--paper-edge);
}
.blueprint-table tbody td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--paper-edge);
  vertical-align: top;
}
.blueprint-table tbody tr:last-child td { border-bottom: none; }
.blueprint-table .col-bloom {
  font-weight: 700;
  color: var(--strand);
  white-space: nowrap;
}
.blueprint-table .col-marks {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink);
}
.blueprint-table .col-mark-class {
  font-family: var(--hand);
  color: var(--ink-faint);
  font-size: 1rem;
}

/* Block 2: Bloom heatmap */
.bloom-heatmap {
  display: flex;
  width: 100%;
  height: 2.4rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
}
.bloom-heatmap-seg {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--paper);
  letter-spacing: 0.02em;
  position: relative;
}
.bloom-heatmap-seg.lower  { background: var(--ink-soft); }
.bloom-heatmap-seg.higher { background: var(--strand); }
.bloom-heatmap-seg.empty  { background: var(--paper-edge); color: var(--ink-faint); font-weight: 500; }
.bloom-heatmap-legend {
  margin-top: 0.5rem;
  display: flex;
  gap: 1.2rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
  flex-wrap: wrap;
}
.bloom-heatmap-legend .legend-swatch {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  margin-right: 0.4rem;
  vertical-align: middle;
}
.bloom-heatmap-legend .legend-swatch.lower  { background: var(--ink-soft); }
.bloom-heatmap-legend .legend-swatch.higher { background: var(--strand); }

/* Block 4: Per-question rubric descriptors */
.rubric-descriptor-card {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-left: 3px solid var(--strand);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin: 0.6rem 0;
}
.rubric-descriptor-card .qid {
  font-family: var(--hand);
  color: var(--ink-faint);
  font-size: 1rem;
  margin-right: 0.5rem;
}
.rubric-descriptor-card .qstem {
  font-weight: 700;
  color: var(--ink);
}
.rubric-descriptor-card p {
  margin-top: 0.4rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

/* Block 5: Misconceptions */
.misconception-list {
  background: rgba(244, 208, 63, 0.18);
  border: 1px solid var(--highlight);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem 0.9rem 1.4rem;
  list-style: none;
  margin: 0.4rem 0;
}
.misconception-list li {
  position: relative;
  padding: 0.3rem 0 0.3rem 1.4rem;
  color: var(--ink);
}
.misconception-list li::before {
  content: '⚠';
  position: absolute;
  left: 0;
  top: 0.25rem;
  color: var(--warm-current);
  font-size: 1rem;
}
.misconception-list li + li {
  border-top: 1px dashed rgba(60, 40, 20, 0.18);
}

/* Block 6 + 7: Recovery / Extension paired cards */
.guide-paths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 720px) {
  .guide-paths { grid-template-columns: 1fr; }
}
.recovery-path,
.extension-path {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}
.recovery-path  { border-top: 3px solid var(--cool-current); }
.extension-path { border-top: 3px solid var(--marine-bio); }
.recovery-path h5,
.extension-path h5 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 0.4rem;
}
.recovery-path ul,
.extension-path ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

/* Block 8: Time guidance */
.time-guidance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
  margin: 0.4rem 0;
}
.time-guidance .time-card {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  text-align: center;
}
.time-guidance .time-card .label {
  display: block;
  font-family: var(--hand);
  color: var(--ink-faint);
  font-size: 1rem;
}
.time-guidance .time-card .mins {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--strand);
  font-variant-numeric: tabular-nums;
}
.time-guidance .time-card.total {
  background: var(--paper-2);
  border-color: var(--strand);
}

/* ============================================================
   TOPIC-PAGE CHROME v2 — added 2026-08-08
   Topics 11+ introduced a lighter topbar and head markup
   (.hub-link / .topbar-tools / .topic-progress / .strand-pill /
   .mode-current) plus a shared .stat-row, but the classes were
   never added here — those pages were rendering unstyled.
   Additive only: topics 01–10 declare their own .stat-row inside
   their page <style> block, which still wins (later in cascade).
   ============================================================ */

/* Back-to-hub link (replaces .brand on topic pages) */
.hub-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 0.2s var(--ease);
}
.hub-link:hover { color: var(--strand); }
.hub-link .hub-arrow {
  color: var(--strand);
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.2s var(--ease-out);
}
.hub-link:hover .hub-arrow { transform: translateX(-3px); }

/* Right-hand cluster: progress + mode toggle */
.topbar-tools {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topic-progress {
  width: clamp(120px, 22vw, 220px);
}
.topic-progress .progress-label {
  display: block;
  margin-top: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mode-toggle .mode-current {
  font-size: 0.95rem;
  line-height: 1;
}

@media (max-width: 640px) {
  .hub-link span:not(.hub-arrow) { display: none; }
  .topic-progress { width: 110px; }
  .topic-progress .progress-label { display: none; }
}

/* Strand pill in the topic head */
.strand-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  border-left: 3px solid var(--strand);
  color: var(--strand);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  letter-spacing: 0.08em;
  font-weight: 700;
}

/* Wide-table scroll wrapper (added 2026-08-08 at Topic 24).
   Wrap any .data-table with 4+ columns in <div class="table-scroll"> so the
   TABLE scrolls sideways on a phone instead of the whole page overflowing. */
.table-scroll { overflow-x: auto; margin: 1rem 0 1.4rem; }
.table-scroll .data-table { min-width: 640px; margin-top: 0; }

/* Vocab flip cards: size to the taller face instead of a fixed 160px.
   The two faces are stacked in the same grid cell rather than absolutely
   positioned, so the card grows to fit the definition on the back — long
   CAPS definitions were previously spilling outside the card. The flip
   itself is unchanged. */
.vocab-card {
  height: auto;
  min-height: 160px;
}
.vocab-inner { display: grid; }
.vocab-front,
.vocab-back {
  position: relative;
  inset: auto;
  grid-area: 1 / 1;
}

/* Shared stat row (was duplicated inline in topics 03–10) */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.4rem 0 1.6rem;
}
.stat-row .stat {
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.stat-row .stat .num {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  color: var(--strand);
  line-height: 1.1;
}
.stat-row .stat .label {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
@media (max-width: 600px) { .stat-row { grid-template-columns: 1fr; } }

/* ============================================================
   PROMOTED SHARED COMPONENTS — Tier 2, 2026-08-09
   .props-grid / .prop-card originated in Topic 06 and are now used by
   Topics 06, 09, 15 and 17. Promoted here on the fourth use rather than
   copied a fourth time. Topic 06 keeps its local copy harmlessly (identical
   rules, later in the cascade); the others now inherit from here.
   ============================================================ */
.props-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.9rem;
  margin: 1.4rem 0 1rem;
}
.prop-card {
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  border-top: 3px solid var(--strand);
  border-radius: var(--radius);
  padding: 0.95rem 1rem 1rem;
}
.prop-card .icon { font-size: 1.5rem; line-height: 1; margin-bottom: 0.4rem; }
.prop-card h4 {
  font-family: var(--display); font-weight: 700; font-size: 1.02rem;
  margin: 0 0 0.3rem; color: var(--strand);
}
.prop-card p { margin: 0; font-size: 0.86rem; line-height: 1.45; color: var(--ink-soft); }
.prop-card .marine {
  display: block; margin-top: 0.5rem; padding-top: 0.45rem;
  border-top: 1px dashed var(--paper-edge);
  font-family: var(--hand); font-size: 0.95rem; color: var(--ink-faint);
}

/* "In the Lab" practical teaser — used by every Tier 2 topic that links a practical. */
.lab-card {
  border: 2px solid var(--strand); border-radius: var(--radius);
  padding: 1.2rem 1.3rem; background: var(--paper-2); margin: 1.2rem 0;
}
.lab-card h4 { margin: 0 0 .5rem; font-size: 1.15rem; }
.lab-list { list-style: none; padding: 0; margin: .8rem 0; }
.lab-list li {
  padding: .45rem 0 .45rem 1.9rem; position: relative;
  font-size: .93rem; line-height: 1.55; border-bottom: 1px dashed var(--paper-edge);
}
.lab-list li:last-child { border-bottom: none; }
.lab-list li::before {
  content: attr(data-n); position: absolute; left: 0; top: .45rem;
  width: 1.3rem; height: 1.3rem; border-radius: 50%;
  background: var(--strand-fill); color: var(--strand-fill-ink);
  font-family: var(--display); font-size: .8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.kit-chip {
  display: inline-block; font-size: .72rem; font-family: var(--body); font-weight: 700;
  padding: .1rem .45rem; border-radius: 999px; margin-left: .3rem; white-space: nowrap;
  background: var(--paper); border: 1px solid var(--paper-edge); color: var(--ink-soft);
}

/* Warning / curriculum-discrepancy flag. */
.unit-flag {
  border-left: 4px solid var(--warm-current); background: var(--paper-2);
  border-radius: var(--radius); padding: .9rem 1.1rem; margin: 1rem 0;
  font-size: .92rem; line-height: 1.6;
}
.unit-flag strong.hdr { display: block; font-family: var(--display); font-size: 1.02rem; margin-bottom: .3rem; }
