@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400..800&display=swap');

/* Data Visualization with AI — course styles.
   Dark theme, high contrast, accessible controls, responsive layout. */

:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #16243d;
  --ink: #f1f5f9;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --line: #334155;
  --blue: #38bdf8;
  --blue-d: #0284c7;
  --teal: #14b8a6;
  --teal-l: #2dd4bf;
  --indigo: #6366f1;
  --green: #22c55e;
  --green-l: #4ade80;
  --red: #ef4444;
  --amber: #f59e0b;
  --purple: #a855f7;
  --cyan: #06b6d4;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 40px 20px;
  line-height: 1.75;
}

.wrap { max-width: 820px; margin: 0 auto; }

h1 {
  font-size: 32px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #38bdf8, #2dd4bf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.25;
}

h2 { font-size: 22px; margin-top: 36px; margin-bottom: 12px; color: var(--soft); }
h3 { font-size: 18px; color: var(--ink); margin-top: 24px; margin-bottom: 8px; }
p, li { color: var(--soft); font-size: 15px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: var(--ink); }
em { color: #e2e8f0; }

code.tok {
  background: #0b1324;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 13.5px;
  color: #7dd3fc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.meta { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }
.back { display: inline-block; margin-bottom: 22px; color: var(--blue); font-weight: 500; }
.back:hover { text-decoration: underline; }

.callout {
  background: var(--panel);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 20px 0;
  color: var(--soft);
}

.anchor {
  background: linear-gradient(135deg, #16243d, #0f2942);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 18px 0;
  color: var(--soft);
  font-size: 14.5px;
}
.anchor .tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  color: #7dd3fc;
  margin-bottom: 4px;
}

.payoff {
  background: #062c26;
  border-left: 4px solid var(--teal-l);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 20px 0;
  color: #ccfbf1;
  font-size: 14.5px;
}
.payoff .tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--teal-l);
  margin-bottom: 4px;
}

/* Code card for R / Quarto / ggplot2 snippets */
.codecard {
  background: #0b1222;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 20px 0;
}
.codecard .tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  color: #7dd3fc;
  margin-bottom: 8px;
}
.codecard pre {
  margin: 0;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #e2e8f0;
}
.codecard pre .c { color: #64748b; }
.codecard pre .k { color: #38bdf8; }
.codecard pre .s { color: #2dd4bf; }
.codecard pre .f { color: #a855f7; }
.codecard .note { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }

/* Lesson card lists for index.html */
.pillar-head {
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  margin-top: 32px;
  margin-bottom: 10px;
}

.lesson-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 14px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color .2s, transform .15s;
}
.lesson-card:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
  text-decoration: none;
}
.lesson-card .num {
  display: inline-block;
  background: var(--panel-2);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.lesson-card h3 {
  margin: 4px 0 6px;
  font-size: 18px;
  color: var(--ink);
}
.lesson-card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}
.lesson-card.done {
  border-color: var(--teal);
}
.lesson-card.done .num {
  background: #0f2942;
  color: var(--teal-l);
}
.lesson-card .check {
  color: var(--green-l);
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
}

.capstone-card {
  background: linear-gradient(135deg, #13233b 0%, #0f172a 100%);
  border: 2px solid var(--teal);
}

/* Interactive Activities */
.activity {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
}
.activity-label {
  display: block;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 12px;
}
.activity-fallback { color: var(--muted); font-size: 13.5px; }

/* Control Sliders & Buttons */
.control { margin-bottom: 14px; }
.control label {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--soft);
  margin-bottom: 6px;
}
.control label .val {
  color: var(--blue);
  font-weight: 700;
  font-family: ui-monospace, monospace;
}
.control input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: var(--blue);
  color: #04222e;
  transition: background .15s, opacity .15s;
}
.btn:hover:not(:disabled) { opacity: .9; }
.btn-primary {
  background: var(--blue);
  color: #04222e;
}
.btn-primary:hover { opacity: 0.9; }
.btn-secondary {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: #28374d; }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Stat Readouts */
.readout {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  flex: 1 1 140px;
}
.stat .k {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
}
.stat .v {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  font-family: ui-monospace, monospace;
}
.stat .v.good { color: var(--green-l); }
.stat .v.bad { color: #fca5a5; }
.stat .v.hl { color: var(--blue); }

/* Sort & Choice Boxes */
.sort-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
}
.sort-text {
  font-size: 14.5px;
  color: var(--ink);
  margin-bottom: 10px;
}
.sort-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sort-btn {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--soft);
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
}
.sort-btn:hover { border-color: var(--blue); color: var(--ink); }
.sort-btn.correct { background: #064e3b; border-color: var(--green-l); color: #a7f3d0; }
.sort-btn.wrong { background: #7f1d1d; border-color: var(--red); color: #fecaca; }
.sort-btn.truth { border-color: var(--green-l); color: var(--green-l); }
.sort-mark {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.4;
}
.sort-mark.ok { color: var(--green-l); }
.sort-mark.no { color: #fca5a5; }

.sort-score {
  background: #0f2942;
  border: 1px solid var(--blue);
  border-radius: 8px;
  padding: 14px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--soft);
}

/* Inline Reveal Boxes */
.prediction-card {
  background: #111c33;
  border: 1px solid #1e3a8a;
  border-radius: 10px;
  padding: 16px 18px;
  margin: 18px 0;
}
.prediction-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #93c5fd;
}
.reveal-btn {
  margin-top: 10px;
  background: #1e3a8a;
  color: #dbeafe;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.reveal-btn:hover { background: #2563eb; }
.reveal-content {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #1e3a8a;
  color: #e0f2fe;
  font-size: 14px;
}

/* AI Audit Cards */
.ai-audit-card {
  background: #18122b;
  border: 1px solid #4338ca;
  border-radius: 10px;
  padding: 16px 18px;
  margin: 20px 0;
}
.ai-badge {
  display: inline-block;
  background: #4338ca;
  color: #e0e7ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.ai-prompt-box {
  background: #0f0c24;
  border: 1px solid #312e81;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 8px 0;
  font-size: 13.5px;
  color: #a5b4fc;
  font-family: ui-monospace, monospace;
}
.ai-output-box {
  background: #241c42;
  border-left: 3px solid #818cf8;
  border-radius: 4px;
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 14px;
  color: #f1f5f9;
}

.canvas-hold {
  width: 100%;
  overflow-x: auto;
  margin: 12px 0;
  display: flex;
  justify-content: center;
}
canvas {
  background: #0b1324;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.feedback {
  background: var(--panel);
  border-left: 3px solid var(--blue);
  padding: 10px 14px;
  border-radius: 4px;
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--soft);
}

/* Inline WebR labs */
.r-lab-host {
  border-left: 4px solid var(--cyan);
}
.r-lab-note {
  background: #0b1324;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--soft);
  font-size: 13.5px;
}
.r-editor {
  width: 100%;
  min-height: 230px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #07111f;
  color: #e2e8f0;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  outline: none;
}
.r-editor:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .18);
}
.r-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.btn.secondary {
  background: #24324a;
  color: var(--soft);
}
.btn.secondary:hover:not(:disabled) {
  background: #2d3f5e;
}
.btn:disabled {
  cursor: not-allowed;
  opacity: .62;
}
.r-status {
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0;
}
.r-output {
  min-height: 120px;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  background: #020817;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #dbeafe;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.geogebra-lab-host { border-color: rgba(14,165,233,.42); background: linear-gradient(135deg, rgba(14,165,233,.11), rgba(124,58,237,.09)); }
.geogebra-commands { margin-top: 12px; }
.strand-note { border: 1px solid rgba(14,165,233,.35); border-radius: 16px; padding: 16px; background: rgba(14,165,233,.08); color: #dbeafe; }




.geogebra-frame { width: 100%; min-height: 500px; border: 1px solid rgba(148,163,184,.32); border-radius: 14px; background: #fff; margin: 14px 0; }
.geogebra-tasks { margin: 12px 0 12px 20px; color: #dbeafe; }
.geogebra-tasks li { margin: 6px 0; }
@media (max-width: 720px) { .geogebra-frame { min-height: 420px; } }

/* Module 1 data-type lab */
.data-type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 16px 0 22px; }
.type-card { background: #0b1324; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.type-card h3 { margin-top: 0; color: #7dd3fc; }
.type-rule { color: #e2e8f0; margin-bottom: 8px; }
.type-warning { background: rgba(245, 158, 11, .12); border-left: 3px solid var(--amber); border-radius: 6px; color: #fde68a; padding: 8px 10px; font-size: 13px; }
.data-type-question .sort-btn { flex: 1 1 170px; }
.dictionary-table { display: grid; gap: 1px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 14px 0; background: var(--line); }
.dictionary-row { display: grid; grid-template-columns: 1.1fr .9fr 1.15fr 1.15fr 1.1fr; gap: 1px; background: var(--line); }
.dictionary-row > div { background: #0b1324; color: var(--soft); padding: 10px; font-size: 13px; }
.dictionary-head > div { background: #0f2942; color: #bfdbfe; font-weight: 700; }
.dictionary-row .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #7dd3fc; }
.hidden { display: none; }
@media (max-width: 760px) { .dictionary-row { grid-template-columns: 1fr; } .dictionary-head { display: none; } }

/* ---------------------------------------------------------------
   Course shell primitives.
   These classes are used by every module page but were previously
   unstyled, which left the reveal cards permanently open, the KPI
   strip as run-on text, and the quiz buttons as default light-grey
   browser controls on a dark page.
   --------------------------------------------------------------- */
.lead { font-size: 16.5px; color: var(--soft); margin: 0 0 22px; line-height: 1.7; }
.small { font-size: 13px; color: var(--muted); }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.kpi {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 10px;
  padding: 12px 14px;
}
.kpi strong {
  font-size: 11.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #7dd3fc;
}
.kpi span { font-size: 13.5px; color: var(--soft); line-height: 1.55; }

.reveal-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 18px 0;
}
.reveal-card > p:first-of-type { margin-top: 0; }
/* Hidden until the learner commits to a prediction. */
.reveal-answer {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: #e0f2fe;
  font-size: 14px;
  line-height: 1.65;
}
.reveal-card.open .reveal-answer { display: block; }

.checklist { display: grid; gap: 8px; margin: 12px 0; }
.checklist label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--soft);
  cursor: pointer;
}
.checklist label:hover { border-color: var(--blue); color: var(--ink); }
.checklist input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--blue);
}

.mastery {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
}
.mastery-status { font-size: 13.5px; font-weight: 600; margin: 14px 0; }
.mastery-status.ready { color: var(--green-l); }
.mastery-status.not-ready { color: var(--amber); }

.choice {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 44px;
  margin-top: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--soft);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}
.choice:hover { border-color: var(--blue); color: var(--ink); }
.choice.correct { background: #064e3b; border-color: var(--green-l); color: #a7f3d0; }
.choice.wrong { background: #7f1d1d; border-color: var(--red); color: #fecaca; }

.tool-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
}

pre.code {
  margin: 12px 0 0;
  padding: 14px;
  overflow-x: auto;
  background: #07111f;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #e2e8f0;
}

.module-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.module-nav .back { margin-bottom: 0; }

/* ---------------------------------------------------------------
   Module 1 interactive labs
   --------------------------------------------------------------- */
.lab { margin: 18px 0; }
.lab-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.lab-reset {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 6px;
  padding: 6px 12px;
  min-height: 36px;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.lab-reset:hover { border-color: var(--blue); color: var(--ink); }
.sort-mark.retry { color: var(--amber); }
.sort-btn.spent { opacity: .45; }

/* Question triage */
.triage-tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 9px;
  border-radius: 20px;
  background: #0f2942;
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.repair-note {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 3px solid var(--teal-l);
  border-radius: 6px;
  background: rgba(20, 184, 166, .1);
  color: #ccfbf1;
  font-size: 13px;
}

/* Dictionary builder */
.dict-build .dictionary-row select {
  width: 100%;
  background: #0b1324;
  color: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  min-height: 40px;
  font-family: inherit;
  font-size: 12.5px;
}
.dict-build .dictionary-row select:focus { border-color: var(--blue); outline: none; }
.dict-build .dictionary-row select.correct { border-color: var(--green-l); color: #a7f3d0; }
.dict-build .dictionary-row select.wrong { border-color: var(--red); color: #fecaca; }
@media (max-width: 760px) {
  .dict-build .dictionary-row > div::before {
    content: attr(data-col);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
}

/* Dirty-data audit table */
.dirty-table { width: 100%; overflow-x: auto; margin: 14px 0; }
.dirty-table table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dirty-table th, .dirty-table td {
  border: 1px solid var(--line);
  padding: 7px 9px;
  text-align: left;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.dirty-table th { background: #0f2942; color: #bfdbfe; font-weight: 700; }
.dirty-table td { background: #0b1324; color: var(--soft); }
.dirty-table tr.flag td { background: #14203a; }
.dirty-table tr.solved td { background: #08261f; }
.dirty-table .na { color: #fca5a5; }

/* AI cleaning log */
.verdict-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.verdict-btn {
  flex: 1 1 130px;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--soft);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.verdict-btn:hover { border-color: var(--blue); color: var(--ink); }
.verdict-btn.correct { background: #064e3b; border-color: var(--green-l); color: #a7f3d0; }
.verdict-btn.wrong { background: #7f1d1d; border-color: var(--red); color: #fecaca; }
.ai-step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--indigo);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
}
.ai-step .quoted {
  margin: 6px 0 0;
  padding: 9px 12px;
  border-radius: 6px;
  background: #0f0c24;
  border: 1px solid #312e81;
  color: #c7d2fe;
  font-size: 13.5px;
}
.log-out {
  width: 100%;
  min-height: 150px;
  margin-top: 12px;
  padding: 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #020817;
  color: #dbeafe;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
}

/* Missingness explorer */
.explorer-note { color: var(--muted); font-size: 13px; margin-top: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 10px 0 0; font-size: 12.5px; color: var(--soft); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.legend i.kept { background: var(--blue); }
.legend i.dropped { background: transparent; border: 2px solid var(--amber); }
.legend i.miss { background: var(--red); }
.legend i.faint { background: rgba(148, 163, 184, .5); }
/* One swatch per campus in the Module 3 shape lab, matched to the panel ink. */
.legend i.campus-a { background: var(--blue); }
.legend i.campus-b { background: #4ade80; }
.legend i.campus-c { background: var(--amber); }

/* Specification-curve toggles (Module 8 multiverse explorer) */
.spec-checks { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.spec-checks label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 190px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--soft);
  font-size: 13.5px;
  cursor: pointer;
}
.spec-checks label:hover { border-color: var(--blue); color: var(--ink); }
.spec-checks input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--blue); flex: none; }
details.data-alt { margin-top: 12px; }
details.data-alt summary { cursor: pointer; color: var(--blue); font-size: 13px; }
details.data-alt table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12.5px; }
details.data-alt th, details.data-alt td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; color: var(--soft); }
details.data-alt th { background: #0f2942; color: #bfdbfe; }

/* Segmented control — a representation is a choice among four kinds, not a
   position on a scale, so it gets radio semantics rather than a slider. */
.seg-control { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.seg-label { font-size: 13px; color: var(--soft); }
.seg-group { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-btn {
  background: #0f2942; color: #bfdbfe; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer;
  font-family: inherit;
}
.seg-btn:hover { border-color: var(--blue); }
.seg-btn.on { background: var(--blue); color: #04121f; border-color: var(--blue); font-weight: 600; }
.seg-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Group-comparison thumbnails inside the effect-size lab. */
.case-chart { margin-bottom: 10px; }
.case-chart canvas { border-radius: 8px; border: 1px solid var(--line); display: block; }
.case-note { display: block; }
.case-stat {
  display: block; margin-top: 4px; font-family: ui-monospace, monospace;
  font-size: 12px; color: var(--soft);
}

/* Track swatches for the Module 4 confounding lab. */
.legend i.track-a { background: var(--blue); }
.legend i.track-b { background: #4ade80; }
.legend i.track-c { background: var(--amber); }
.legend i.track-d { background: #f472b6; }

/* Inline module capstone submission */
.capstone-submit-form {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}
.capstone-submit-form label {
  display: grid;
  gap: 6px;
  color: var(--soft);
  font-size: 13.5px;
  font-weight: 700;
}
.capstone-submit-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #07111f;
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
  line-height: 1.55;
}
.capstone-submit-form textarea:focus {
  outline: 2px solid rgba(56,189,248,.35);
  border-color: var(--blue);
}
.capstone-grade-result { white-space: normal; }
.capstone-grade-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.capstone-grade-columns h4 {
  margin: 4px 0 6px;
  color: var(--ink);
}
.capstone-note {
  color: var(--amber);
  font-size: 13px;
}
