/* The Genius Project: Coursera-style course shell
   Used by the "Predict the World Cup with AI" course:
   the hub (tgp-2026teens-week2.html) and its lesson subpages.
   Loads on top of style.css (reuses --ink, --accent, --warm, --panel, …).
   Design goal: maximum readability. Light theme, high contrast, generous
   spacing. Interactive D3 labs keep their own dark skin from hub.css. */

:root {
  --course-sidebar-w: 300px;
  --course-max: 760px;
  --course-green: #12a150;
  --course-shadow: 0 10px 40px rgba(13, 27, 75, 0.10);
}

/* ================= Layout ================= */
.course-layout {
  display: grid;
  grid-template-columns: var(--course-sidebar-w) minmax(0, 1fr);
  gap: 0;
  align-items: start;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}

/* ---- Sidebar (course outline) ---- */
.course-sidebar {
  position: sticky;
  top: 84px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 24px 22px 24px 0;
  border-right: 1px solid var(--line);
}
.course-sidebar h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin: 0 0 16px;
}
.course-progress-mini {
  height: 8px;
  border-radius: 100px;
  background: var(--panel-2);
  overflow: hidden;
  margin-bottom: 8px;
}
.course-progress-mini span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--course-green));
  transition: width .5s ease;
}
.course-progress-label {
  font-size: 12px;
  color: var(--ink-mid);
  margin: 0 0 20px;
}
.course-outline {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: lesson;
}
.course-outline li { margin: 0 0 4px; }
.course-outline a {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  transition: background .2s;
}
.course-outline a:hover { background: var(--panel); }
.course-outline a.active {
  background: var(--panel-2);
  font-weight: 700;
}
.course-outline a.active::before { border-color: var(--accent); }
.course-outline .lo-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-mid);
  background: #fff;
}
.course-outline a.active .lo-num { border-color: var(--accent); color: var(--accent); }
.course-outline a.done .lo-num {
  background: var(--course-green);
  border-color: var(--course-green);
  color: #fff;
  font-size: 0;
}
.course-outline a.done .lo-num::after { content: '✓'; font-size: 13px; }

/* ---- Locked lessons (sequential courses only) ---- */
.course-outline a.locked {
  color: var(--ink-mid);
  cursor: not-allowed;
  opacity: .72;
}
.course-outline a.locked:hover { background: transparent; }
.course-outline a.locked .lo-lock {
  border-style: dashed;
  border-color: var(--line-strong);
  background: var(--panel-2);
  color: var(--ink-mid);
  font-size: 0;
}
.course-outline a.locked .lo-lock::after { content: '🔒'; font-size: 11px; }
.course-outline a.lock-nudge { animation: lo-shake .3s ease; }
@keyframes lo-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ---- Gate shown when a locked lesson page is opened directly ---- */
.lesson-gate {
  max-width: var(--course-max);
  margin: 24px auto 0;
  padding: 44px 36px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--course-shadow);
}
.lesson-gate-lock {
  width: 68px;
  height: 68px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: var(--panel-2);
  border: 2px solid var(--line);
}
.lesson-gate-lock::after { content: '🔒'; }
.lesson-gate h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(22px, 4vw, 30px);
  color: var(--ink);
  margin: 0 0 12px;
}
.lesson-gate p {
  color: var(--ink-mid);
  font-size: 16px;
  line-height: 1.6;
  max-width: 52ch;
  margin: 0 auto 26px;
}
.lesson-gate p strong { color: var(--ink); }
.lesson-gate-btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 100px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.lesson-gate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(13, 27, 75, 0.18);
}

/* ---- Main lesson column ---- */
.lesson-main {
  padding: 30px 0 60px clamp(16px, 4vw, 48px);
  min-width: 0;
}
.lesson-main > * { max-width: var(--course-max); }
.lesson-main > .figure-wide,
.lesson-main > .viz-stage,
.lesson-main > .lab,
.lesson-main > .play-lab { max-width: 100%; }

/* ---- Reading progress bar (top of viewport) ---- */
.read-progress {
  position: fixed;
  top: 0; left: 0;
  height: 4px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--warm));
  z-index: 120;
  transition: width .1s linear;
}

/* ================= Lesson header ================= */
.lesson-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: var(--panel-2);
  padding: 7px 14px;
  border-radius: 100px;
  margin-bottom: 18px;
}
.lesson-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.08;
  color: var(--ink);
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}
.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13.5px;
  color: var(--ink-mid);
  margin-bottom: 26px;
}
.lesson-meta span { display: inline-flex; align-items: center; gap: 7px; }
.lesson-lede {
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 30px;
  font-weight: 500;
}

/* ================= Body copy ================= */
.lesson-main h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 3.4vw, 30px);
  color: var(--ink);
  margin: 48px 0 16px;
  line-height: 1.2;
  scroll-margin-top: 100px;
}
.lesson-main h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  margin: 32px 0 12px;
}
.lesson-main p,
.lesson-main li {
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--ink);
}
.lesson-main p { margin: 0 0 18px; }
.lesson-main ul, .lesson-main ol { margin: 0 0 20px; padding-left: 24px; }
.lesson-main li { margin-bottom: 9px; }
.lesson-main strong { color: var(--ink); font-weight: 700; }
.lesson-main a:not(.btn):not(.lesson-nav-btn) { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
.lesson-main a:not(.btn):not(.lesson-nav-btn):hover { color: var(--accent); }

/* Step numbers for walkthroughs */
.numbered-steps { counter-reset: step; list-style: none; padding-left: 0; }
.numbered-steps > li {
  position: relative;
  padding-left: 52px;
  margin-bottom: 22px;
  min-height: 36px;
}
.numbered-steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0; top: -2px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 16px;
  display: grid;
  place-items: center;
}

/* ================= Callout boxes (dark, white text) ================= */
.callout {
  border-radius: 16px;
  padding: 22px 26px;
  margin: 26px 0;
  background: #101f57;
  border: 1px solid rgba(255,255,255,.12);
  border-left: 5px solid var(--accent);
  color: #eaf0ff;
}
.callout .callout-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 10px;
  color: #ffffff;
}
.callout .callout-icon { font-size: 20px; line-height: 1; }
.callout p, .callout li { color: #dbe3ff; }
.callout strong { color: #ffffff; }
/* links inside the dark callout boxes: white so they stand out on navy.
   The .lesson-main selector is needed to outweigh the page-wide
   .lesson-main a rule (navy), which would render invisible here. */
.callout a:not(.btn),
.lesson-main .callout a:not(.btn):not(.lesson-nav-btn) {
  color: #ffffff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(255, 255, 255, .6);
}
.callout a:not(.btn):hover,
.lesson-main .callout a:not(.btn):not(.lesson-nav-btn):hover { color: #7ff0d6; }
.callout p:last-child, .callout ul:last-child, .callout ol:last-child { margin-bottom: 0; }
.callout .katex { color: #f3f6ff; }

.callout.tip { border-left-color: #2bf0c8; }
.callout.tip .callout-head { color: #7ff0d6; }
.callout.analogy { border-left-color: #ffc800; }
.callout.analogy .callout-head { color: #ffd75e; }
.callout.warning { border-left-color: #ff6a55; }
.callout.warning .callout-head { color: #ff9d8a; }
.callout.recap { border-left-color: #8ec9ff; }
.callout.recap .callout-head { color: #bcd9ff; }
.callout.resource { border-left-color: #ffc800; }
.callout.resource .callout-head { color: #ffd75e; }
.callout.info { border-left-color: #9d8bff; }
.callout.info .callout-head { color: #c3b8ff; }

/* Challenge resource links + responsive video embed (used on the prediction page) */
.challenge-links { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.challenge-links li { margin: 0; }
.challenge-links a {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 15.5px; word-break: break-word;
  color: #7ff0d6 !important; text-decoration: underline; text-underline-offset: 3px;
}
.challenge-links a:hover { color: #a9f6e4 !important; }
.challenge-links .cl-note { display: block; margin-left: 30px; color: #c7d2f5; font-size: 13px; font-weight: 400; }
.video-embed {
  position: relative; width: 100%; padding-top: 56.25%;
  margin-top: 16px; border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.14); background: #04081f;
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Key-term definition (dark, white text) */
.keyterm {
  border-left: 5px solid var(--accent);
  background: #101f57;
  padding: 20px 24px;
  border-radius: 0 14px 14px 0;
  margin: 24px 0;
  color: #eaf0ff;
}
.keyterm .kt-word {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #ffffff;
  display: block;
  margin-bottom: 6px;
}
.keyterm .kt-word .kt-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #0d1b4b;
  background: #2bf0c8;
  padding: 3px 10px;
  border-radius: 100px;
  margin-left: 8px;
  vertical-align: middle;
}
.keyterm p { margin: 0; font-size: 16px; color: #c7d2f5; line-height: 1.7; }
.keyterm strong { color: #fff; }

/* ================= Figures / images ================= */
.figure {
  margin: 30px 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--course-shadow);
}
.figure img, .figure svg { display: block; width: 100%; height: auto; }
.figure figcaption {
  padding: 12px 20px;
  font-size: 13.5px;
  color: var(--ink-mid);
  background: #fff;
  border-top: 1px solid var(--line);
  line-height: 1.6;
}
.figure.plain { box-shadow: none; }
.svg-scene { display: block; width: 100%; height: auto; background: #0d1b4b; }

/* Flow diagrams (HTML boxes + arrows, text stays crisp & responsive) */
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
  margin: 26px 0;
}
.flow-box {
  flex: 1 1 0;
  min-width: 140px;
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  padding: 18px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}
.flow-box .fb-icon { font-size: 26px; line-height: 1; }
.flow-box .fb-label { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); }
.flow-box .fb-sub { font-size: 13px; color: var(--ink-mid); line-height: 1.5; }
.flow-box.accent { border-color: var(--accent); background: var(--panel); }
.flow-box.model { background: var(--ink); border-color: var(--ink); }
.flow-box.model .fb-label, .flow-box.model .fb-icon { color: #fff; }
.flow-box.model .fb-sub { color: #aab4dd; }
.flow-arrow {
  align-self: center;
  font-size: 24px;
  color: var(--accent);
  font-weight: 700;
  flex: 0 0 auto;
}
.flow.two-panel { gap: 20px; }
.flow.two-panel .flow-box { text-align: left; padding: 22px 24px; }
.flow.two-panel .flow-box .fb-label { font-size: 16px; margin-bottom: 4px; }
.flow.two-panel .flow-box p { font-size: 14.5px; color: var(--ink-mid); margin: 6px 0 0; line-height: 1.6; }
@media (max-width: 560px) {
  .flow:not(.two-panel) { flex-direction: column; }
  .flow:not(.two-panel) .flow-arrow { transform: rotate(90deg); }
}

/* Inline concept diagram on white */
.diagram {
  margin: 26px 0;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}
.diagram svg { display: block; width: 100%; height: auto; }
.diagram .dg-cap {
  font-size: 13.5px;
  color: var(--ink-mid);
  margin-top: 12px;
  text-align: center;
  line-height: 1.6;
}

/* Feature/label data table */
.data-table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 15px; }
.data-table th, .data-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.data-table thead th { background: var(--panel-2); font-family: 'Space Grotesk', sans-serif; font-size: 13px; color: var(--ink); }
.data-table .col-label { background: #fff8e6; font-weight: 700; }
.data-table .th-label { background: #ffe9a6 !important; }
.data-table td.num { font-variant-numeric: tabular-nums; }

/* ================= Formula (KaTeX) on light ================= */
.formula {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 24px;
  margin: 22px 0;
  overflow-x: auto;
}
.formula .katex { color: var(--ink); font-size: 1.1em; }
.formula .katex-display { margin: 0; }
.formula-note { font-size: 14px; color: var(--ink-mid); margin-top: 10px; }

/* ---- Plain-language popup on a presented formula ---- */
.formula-explain-wrap { position: relative; max-width: var(--course-max); }
.formula-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -8px 0 20px;
  cursor: pointer;
  font: 600 12.5px/1 'Space Grotesk', sans-serif;
  color: var(--accent-2);
  background: #fff;
  border: 1px dashed var(--line-strong);
  border-radius: 100px;
  padding: 7px 14px;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.formula-badge:hover,
.formula-explain-wrap.tip-open .formula-badge {
  background: var(--accent);
  border-color: var(--accent);
  border-style: solid;
  color: #fff;
}
.formula-tip {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% - 6px);
  z-index: 40;
  width: min(460px, 92vw);
  background: #0d1b4b;
  color: #eef2ff;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14.5px;
  line-height: 1.6;
  text-align: left;
  box-shadow: 0 16px 44px rgba(13, 27, 75, .40);
}
.formula-tip strong { color: #7ff0d6; font-weight: 700; }
.formula-tip .katex { color: #eef2ff; }
.formula-explain-wrap:hover .formula-tip,
.formula-explain-wrap:focus-within .formula-tip,
.formula-explain-wrap.tip-open .formula-tip { display: block; }
.worked-light {
  background: #0b1443;
  border: 1px solid rgba(255,200,0,.35);
  border-left: 5px solid #ffc800;
  border-radius: 14px;
  padding: 22px 26px;
  margin: 24px 0;
  color: #f3f6ff;
}
.worked-light h5 {
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #ffd75e; margin: 0 0 14px;
}
.worked-light p { font-size: 16px; color: #e7ecff; margin-bottom: 10px; line-height: 1.75; }
.worked-light strong { color: #fff; }
.worked-light .katex { color: #ffffff; }

/* ================= Check-your-understanding ================= */
.cyu {
  border: 2px solid var(--line-strong);
  border-radius: 16px;
  padding: 24px 26px;
  margin: 30px 0;
  background: #fff;
}
.cyu .cyu-tag {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-2); margin-bottom: 10px;
}
.cyu .cyu-q { font-size: 17px; font-weight: 600; color: var(--ink); margin-bottom: 16px; }
.cyu-opts { display: flex; flex-direction: column; gap: 10px; }
.cyu-opt {
  text-align: left;
  padding: 13px 18px;
  border-radius: 10px;
  border: 1.5px solid var(--line-strong);
  background: #fff;
  font-size: 15.5px;
  color: var(--ink);
  cursor: pointer;
  transition: all .18s;
  font-family: inherit;
}
.cyu-opt:hover { border-color: var(--accent); background: var(--panel); }
.cyu-opt.right { border-color: var(--course-green); background: #eefaf1; color: #0b6b34; font-weight: 600; }
.cyu-opt.wrong { border-color: var(--pink); background: #fff1ee; color: #b23a22; }
.cyu-explain { display: none; margin-top: 14px; font-size: 15px; line-height: 1.7; color: var(--ink-mid); }
.cyu-explain strong { color: var(--ink); }
/* tip shown after a wrong pick: encouragement + hint, never the answer */
.cyu-tipbox {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.7;
  font-weight: 600;
  color: #b23a22;
  background: #fff1ee;
  border: 2px solid rgba(255, 106, 85, .45);
  border-radius: 12px;
  padding: 12px 16px;
}

/* ================= Fill-in-the-blank ================= */
.fitb {
  background: #0b1443;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 24px 26px;
  margin: 28px 0;
}
.fitb .fitb-tag {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #7ff0d6; margin-bottom: 12px;
}
.fitb-prose { color: #eaf0ff; font-size: 16.5px; line-height: 2.1; }
.fitb-code {
  font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 14px; color: #e7ecff; white-space: pre-wrap; line-height: 2.3;
  background: #04081f; border-radius: 12px; padding: 18px 20px; overflow-x: auto;
}
.fitb-code .cm { color: #6b78ab; font-style: italic; }
.fitb-code .kw { color: #2bf0c8; }
.fitb-code .st { color: #ffc800; }
.fitb-code .nu { color: #ff9d7a; }
.fitb-code .fn { color: #8ec9ff; }
select.fitb-blank {
  background: #16266b; color: #fff;
  border: 1.5px solid #3a4a8c; border-radius: 8px;
  padding: 3px 8px; font-family: inherit; font-size: .92em; font-weight: 600;
  margin: 0 2px; cursor: pointer;
}
.fitb-code select.fitb-blank { font-family: 'SF Mono', Consolas, monospace; }
select.fitb-blank:focus { outline: none; border-color: #2bf0c8; }
select.fitb-blank.right { border-color: #2bf0c8; background: rgba(43,240,200,.18); color: #b8ffed; }
select.fitb-blank.wrong { border-color: #ff6a55; background: rgba(255,106,85,.18); color: #ffc9bd; }
.fitb-feedback { margin-top: 16px; font-size: 14.5px; color: #aab4dd; line-height: 1.6; min-height: 20px; }
.fitb-feedback.ok { color: #7ff0d6; }

/* ================= Tap-to-categorize ================= */
.sortquiz {
  background: #0b1443;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 24px 26px;
  margin: 28px 0;
}
.sortquiz .sq-tag {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #7ff0d6; margin-bottom: 6px;
}
.sortquiz .sq-lead { color: #cdd6f4; font-size: 15px; margin-bottom: 14px; line-height: 1.6; }
.sq-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.sq-legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: #cdd6f4; font-weight: 600; }
.sq-legend .dot { width: 12px; height: 12px; border-radius: 50%; }
.sq-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.sq-chip {
  padding: 10px 15px; border-radius: 100px;
  border: 2px solid #3a4a8c; background: #16266b; color: #e7ecff;
  cursor: pointer; font-size: 14px; font-weight: 600; font-family: inherit;
  display: inline-flex; gap: 9px; align-items: center; transition: all .15s;
}
.sq-chip .sq-cat { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 100px; background: rgba(255,255,255,.12); }
.sq-chip.uncat .sq-cat { opacity: .55; }
.sq-chip.right { box-shadow: 0 0 0 2px rgba(43,240,200,.4); }
.sq-chip.wrong { box-shadow: 0 0 0 2px rgba(255,106,85,.5); }
.sq-feedback { margin-top: 16px; font-size: 14.5px; color: #aab4dd; min-height: 20px; }
.sq-feedback.ok { color: #7ff0d6; }

/* ================= Estimate slider game ================= */
.estimate { background:#0b1443; border:1px solid rgba(255,255,255,.12); border-radius:16px; padding:24px 26px; margin:28px 0; }
.estimate .est-scenario { color:#eaf0ff; font-size:16px; line-height:1.7; margin-bottom:16px; }
.estimate .est-scenario strong { color:#fff; }
.estimate .est-row { display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.estimate input[type=range] { flex:1; min-width:200px; accent-color:#ffc800; }
.estimate .est-val { font-family:'Space Grotesk',sans-serif; font-weight:800; font-size:26px; color:#ffc800; min-width:70px; text-align:center; }
.estimate .est-feedback { margin-top:16px; font-size:14.5px; color:#aab4dd; line-height:1.6; min-height:20px; }
.estimate .est-feedback.ok { color:#7ff0d6; }

/* ===== Contrast fix: the dark interactive panels (.lab, .sortquiz, .fitb,
   .estimate) always have a dark navy background, but the global
   `strong, b { color: var(--ink) }` rule paints bold words the same navy,
   making them invisible. These panels appear both inside lesson pages
   (.lesson-main) and on the teen-genius hub week pages, so the light-text
   rules must NOT be gated behind .lesson-main. Restore light text so bold
   words, how-to steps and links stay readable on the dark backgrounds.
   Note: .play-lab is a separate, light-background panel and is intentionally
   not matched here (it keeps dark text). ===== */
.lab p,
.lab li,
.lab .howto ol,
.lab .howto li,
.sortquiz p,
.sortquiz li,
.sortquiz .sq-lead,
.fitb p,
.fitb li,
.estimate p,
.estimate li { color: #cdd6f4; }
.lab strong, .lab b,
.lab .howto strong,
.sortquiz strong, .sortquiz b,
.sortquiz .sq-lead strong,
.fitb strong, .fitb b,
.fitb-prose strong,
.estimate strong, .estimate b,
.estimate .est-scenario strong { color: #ffffff; }
.lab a:not(.btn):not(.lab-btn),
.sortquiz a,
.fitb a { color: #7ff0d6; }
/* .play-lab is light: its bold words stay dark for contrast on white */
.play-lab .howto strong, .play-lab .howto b { color: var(--ink); }

/* ===== Runnable code blocks (Run button + pre-generated output) ===== */
.code-block .code-tab .run-btn {
  margin-left: auto;
  background: #2bf0c8; color: #0d1b4b;
  border: none; border-radius: 100px;
  padding: 5px 15px; font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 11.5px; letter-spacing: .04em;
  text-transform: none; cursor: pointer; transition: filter .15s;
}
.code-block .code-tab .run-btn:hover { filter: brightness(1.08); }
.code-output { display: none; background: #04081f; border-top: 1px solid rgba(255,255,255,.1); }
.code-output.show { display: block; }
.code-output .out-label {
  font-family: 'SF Mono', Consolas, monospace; font-size: 10.5px;
  color: #6b78ab; padding: 10px 18px 0; letter-spacing: .06em; text-transform: uppercase;
}
.code-output pre.out-text {
  margin: 0; padding: 6px 18px 16px;
  font-family: 'SF Mono', Consolas, monospace; font-size: 13px;
  color: #9fe8c9; white-space: pre-wrap; line-height: 1.7;
}
.code-output .out-fig { padding: 14px 18px 18px; }
.code-output .out-fig svg { display: block; width: 100%; max-width: 540px; height: auto; margin: 0 auto; background: #fff; border-radius: 10px; }
.code-output .out-fig figcaption { text-align: center; font-size: 12px; color: #6b78ab; margin-top: 8px; }
/* animated line reveal for the chart-animation output */
.out-anim .grow { stroke-dasharray: 1000; stroke-dashoffset: 1000; }
.code-output.show .out-anim.go .grow { animation: growLine 2.2s ease forwards; }
.code-output.show .out-anim.go .dot { animation: popDot .35s ease forwards; opacity: 0; }
@keyframes growLine { to { stroke-dashoffset: 0; } }
@keyframes popDot { to { opacity: 1; } }

/* ================= Go deeper (optional advanced sections) ================= */
.godeeper {
  margin: 34px 0;
  padding: 2px 26px 20px;
  border: 1px solid var(--line);
  border-left: 5px solid #8b6df0;
  border-radius: 16px;
  background: linear-gradient(180deg, #f6f4ff, #ffffff 140px);
}
.godeeper .gd-tag {
  display: inline-flex; align-items: center; gap: 7px;
  margin: 22px 0 2px;
  background: #ece7ff; color: #5a3fc0;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 13px; border-radius: 100px;
}
.godeeper h3 { margin: 12px 0 8px; font-family: 'Space Grotesk', sans-serif; color: var(--ink); font-size: 20px; }
.godeeper p, .godeeper li { color: var(--ink-mid); }
.godeeper .formula { background: #fff; }
.godeeper .mini-note { font-size: 13.5px; color: var(--ink-mid); margin-top: 8px; }

/* ================= Goalkeeper + penalty heat-map composite ================= */
.keeper-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #0a1230;
}
.keeper-scene > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.keeper-scene .keeper-scrim {
  position: absolute; inset: 0;
  background:
    radial-gradient(130% 100% at 50% 34%, rgba(4,8,31,0) 46%, rgba(4,8,31,.62) 100%),
    linear-gradient(180deg, rgba(4,8,31,.28), rgba(4,8,31,0) 30%);
  pointer-events: none;
}
.keeper-scene .keeper-heat {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.keeper-scene .kh-line { stroke: rgba(255,255,255,.4); stroke-width: .5; }
.keeper-scene .kh-frame { stroke: rgba(255,255,255,.7); stroke-width: 1; fill: none; }
.keeper-scene .kh-pct {
  fill: #fff; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 8px;
  paint-order: stroke; stroke: rgba(4,8,31,.65); stroke-width: 1.4px; stroke-linejoin: round;
}
.keeper-scene .keeper-tag {
  position: absolute; left: 14px; bottom: 13px;
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(4,8,31,.74); color: #fff;
  font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600;
  padding: 6px 13px; border-radius: 100px;
  border: 1px solid rgba(255,255,255,.16);
}
.keeper-scene .keeper-legend {
  position: absolute; right: 14px; top: 13px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(4,8,31,.62); color: #cdd6f4;
  font-family: 'Space Grotesk', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 100px;
  border: 1px solid rgba(255,255,255,.14);
}
.keeper-scene .keeper-legend i {
  width: 46px; height: 8px; border-radius: 100px; display: inline-block;
  background: linear-gradient(90deg, #2bc4f0, #7bd66b, #ffc400, #ff7a1a, #ff2a2a);
}
@media (max-width: 560px) {
  .keeper-scene .keeper-legend { display: none; }
  .keeper-scene .kh-pct { font-size: 9px; }
}

/* ================= XP + Certificate ================= */
.xp-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #ffc800, #ff9d2f);
  color: #3a2600; font-weight: 800; font-family: 'Space Grotesk', sans-serif;
  padding: 8px 16px; border-radius: 100px; font-size: 14px;
}
.cert-section { margin: 40px 0; }
.cert-panel {
  border-radius: 20px; padding: 30px; border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, var(--panel-2), var(--panel));
}
.cert-locked { text-align: center; }
.cert-locked .cl-lock { font-size: 44px; margin-bottom: 12px; }
.cert-locked h3 { font-family: 'Space Grotesk', sans-serif; font-size: 22px; color: var(--ink); margin: 0 0 10px; }
.cert-locked p { color: var(--ink-mid); font-size: 15.5px; max-width: 520px; margin: 0 auto 18px; }
.cert-checklist { list-style: none; padding: 0; max-width: 380px; margin: 0 auto; text-align: left; }
.cert-checklist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 15px; color: var(--ink); }
.cert-checklist li .cc-box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line-strong); display: grid; place-items: center; flex-shrink: 0; font-size: 0; }
.cert-checklist li.done .cc-box { background: var(--course-green); border-color: var(--course-green); font-size: 12px; color: #fff; }
.cert-checklist li.done .cc-box::after { content: '✓'; }
.cert-unlocked { display: none; }
.cert-unlocked.show { display: block; }
.cert-unlocked h3 { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 26px; color: var(--ink); margin: 0 0 6px; }
.cert-unlocked > p { color: var(--ink-mid); font-size: 15.5px; margin-bottom: 20px; }
.cert-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.cert-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-mid); flex: 1; min-width: 220px; }
.cert-form input {
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: 10px;
  padding: 12px 14px; font-family: inherit; font-size: 15.5px; color: var(--ink);
}
.cert-form input:focus { outline: none; border-color: var(--accent); }
.cert-meta { display: flex; flex-wrap: wrap; gap: 22px; margin: 22px 0; }
.cert-meta .cm-item { display: flex; flex-direction: column; }
.cert-meta .cm-item b { font-family: 'Space Grotesk', sans-serif; font-size: 20px; color: var(--ink); }
.cert-meta .cm-item span { font-size: 12px; color: var(--ink-dim); letter-spacing: .04em; text-transform: uppercase; }
.cert-preview {
  margin-top: 20px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--course-shadow); background: #fff;
}
.cert-preview svg { display: block; width: 100%; height: auto; }

/* ================= Drag-and-drop code exercise ================= */
.code-dnd { margin: 26px 0; }
/* the ghost lab button lives on the light lesson page here, not on a dark
   .lab panel, so its default faint teal (built for dark) is hard to read.
   Give it a deeper teal that contrasts with the white background. */
.code-dnd .lab-btn.ghost { color: #067a8f; border-color: #067a8f; }
.code-dnd .lab-btn.ghost:hover { background: rgba(6,122,143,.08); }
.code-dnd .dnd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.code-dnd h5 {
  font-family: 'Space Grotesk', sans-serif; font-size: 13px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mid); margin: 0 0 12px;
}
.dnd-bank, .dnd-program {
  min-height: 220px;
  background: #080f38;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dnd-program.over { border-color: #2bf0c8; box-shadow: 0 0 0 2px rgba(43,240,200,.4); }
.dnd-program { counter-reset: dline; }
.dnd-slot {
  min-height: 40px;
  border: 1px dashed rgba(255,255,255,.18);
  border-radius: 8px;
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 30px;
  counter-increment: dline;
}
.dnd-slot::before {
  content: counter(dline);
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 24px;
  display: grid; place-items: center;
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 11px; color: #5f6ba0;
  border-right: 1px solid rgba(255,255,255,.08);
}
.dnd-slot.over { border-color: #2bf0c8; background: rgba(43,240,200,.08); }
.dnd-slot .code-line { width: 100%; margin: 0; box-sizing: border-box; }
.code-line {
  font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 13.5px;
  color: #e7ecff;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 9px 12px 9px 34px;
  cursor: grab;
  white-space: pre;
  position: relative;
  user-select: none;
  touch-action: none;
}
.code-line::before {
  content: '⠿';
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: #5f6ba0; font-size: 13px;
}
.code-line.dragging { opacity: .9; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.code-line .indent { color: transparent; }
.code-line .cm { color: #6b78ab; font-style: italic; }
.code-line .kw { color: #2bf0c8; }
.code-line .st { color: #ffc800; }
.code-line .nu { color: #ff9d7a; }
.code-line .fn { color: #8ec9ff; }
.code-line.right { border-color: var(--course-green); background: rgba(18,161,80,.18); }
.code-line.wrong { border-color: var(--pink); background: rgba(255,106,85,.16); }
.dnd-output {
  margin-top: 16px;
  background: #04081f;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 16px 18px;
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 13.5px;
  color: #9fe8c9;
  white-space: pre-wrap;
  min-height: 40px;
}
.dnd-output .prompt-line { color: #6b78ab; }

/* ================= Lesson footer nav ================= */
.lesson-complete {
  margin: 44px 0 30px;
  padding: 28px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-strong);
  text-align: center;
}
.lesson-complete p { font-size: 15.5px; color: var(--ink-mid); margin: 12px 0 0; }
.mark-done-btn {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 13px 26px;
  border-radius: 100px;
  border: 2px solid var(--course-green);
  background: #fff;
  color: var(--course-green);
  cursor: pointer;
  transition: all .2s;
}
.mark-done-btn:hover { background: var(--course-green); color: #fff; }
.mark-done-btn.done { background: var(--course-green); color: #fff; }

.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 30px;
  border-top: 1px solid var(--line);
  padding-top: 26px;
}
.lesson-nav-btn {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 22px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  max-width: 48%;
  transition: all .2s;
}
.lesson-nav-btn:hover { border-color: var(--accent); background: var(--panel); transform: translateY(-2px); }
.lesson-nav-btn .lnb-dir { font-size: 12px; color: var(--ink-mid); font-weight: 600; letter-spacing: .04em; }
.lesson-nav-btn .lnb-title { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 15px; }
.lesson-nav-btn.next { margin-left: auto; text-align: right; }

/* ================= Course hub landing ================= */
.course-hero {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  margin: 24px auto 40px;
  max-width: 1180px;
  background: #0d1b4b;
  min-height: 340px;
  display: flex;
  align-items: flex-end;
}
.course-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .38; }
/* darkening + blurring scrim between the decorative art and the hero text,
   so bright doodles (speech bubbles, voxel props) never fight the headline */
.course-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(10, 6, 28, .52) 0%, rgba(10, 6, 28, .40) 55%, rgba(10, 6, 28, .30) 100%);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  pointer-events: none;
}
.course-hero .ch-inner { position: relative; z-index: 2; padding: clamp(28px, 5vw, 56px); color: #fff; }
.course-hero h1, .course-hero p { text-shadow: 0 2px 16px rgba(0, 0, 0, .5); }
.course-hero .ch-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.25);
  padding: 8px 16px; border-radius: 100px;
  font-size: 13px; font-weight: 600; margin-bottom: 18px;
}
.course-hero h1 {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: clamp(30px, 5.5vw, 54px); line-height: 1.05; margin: 0 0 14px;
  letter-spacing: -0.02em; max-width: 15ch;
  color: #ffffff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}
.course-hero .ch-badge, .course-hero .ch-stat b { text-shadow: 0 1px 12px rgba(0,0,0,.4); }
.course-hero p { font-size: clamp(15px, 2.2vw, 19px); line-height: 1.6; max-width: 60ch; color: #d5ddff; margin: 0 0 24px; }
.course-hero .ch-stats { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 8px; }
.course-hero .ch-stat { display: flex; flex-direction: column; }
.course-hero .ch-stat b { font-family: 'Space Grotesk', sans-serif; font-size: 24px; }
.course-hero .ch-stat span { font-size: 12.5px; color: #aab4dd; letter-spacing: .04em; }

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  margin: 26px 0;
}
.module-card {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--course-shadow);
  transition: transform .22s, box-shadow .22s;
  display: flex;
  flex-direction: column;
}
.module-card:hover { transform: translateY(-5px); box-shadow: 0 18px 50px rgba(13,27,75,.16); }
.module-card .mc-cover { aspect-ratio: 16 / 9; width: 100%; display: block; background: #0d1b4b; }
.module-card .mc-cover svg { width: 100%; height: 100%; display: block; }
.module-card .mc-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.module-card .mc-kicker {
  font-family: 'Space Grotesk', sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 8px;
}
.module-card h3 { font-family: 'Space Grotesk', sans-serif; font-size: 19px; color: var(--ink); margin: 0 0 8px; line-height: 1.25; }
.module-card p { font-size: 14.5px; line-height: 1.6; color: var(--ink-mid); margin: 0 0 16px; flex: 1; }
.module-card .mc-foot { display: flex; align-items: center; justify-content: space-between; }
.module-card .mc-time { font-size: 13px; color: var(--ink-dim); display: inline-flex; gap: 6px; align-items: center; }
.module-card .mc-go { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 14px; color: var(--accent-2); }

.outcomes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 24px 0; }
.outcome {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 20px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
}
.outcome .oc-icon {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 11px;
  background: #fff; border: 1px solid var(--line); display: grid; place-items: center; font-size: 20px;
}
.outcome p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink); }

/* ================= Responsive ================= */
@media (max-width: 940px) {
  .course-layout { grid-template-columns: 1fr; }
  .course-sidebar {
    position: static; max-height: none; overflow: visible;
    border-right: none; border-bottom: 1px solid var(--line);
    padding: 18px 0; margin-bottom: 10px;
  }
  .course-outline { display: grid; grid-template-columns: 1fr; gap: 2px; }
  .lesson-main { padding-left: 0; }
}
@media (max-width: 640px) {
  .code-dnd .dnd-cols { grid-template-columns: 1fr; }
  .lesson-nav { flex-direction: column; }
  .lesson-nav-btn { max-width: 100%; }
  .lesson-nav-btn.next { text-align: left; }
  .course-hero .ch-stats { gap: 18px; }
}

/* ================================================================
   Pre-Teen Genius add-ons: per-lesson colour themes, a colour "hero
   band" per lesson (kids tell lessons apart by colour, not just
   number), a plain-language glossary box, and slightly bigger/louder
   touch targets for the check-your-understanding component.
   ================================================================ */
[data-theme="green"]  { --lesson-accent: #16a34a; --lesson-tint: #eafaf0; }
[data-theme="blue"]   { --lesson-accent: #2563eb; --lesson-tint: #eef4ff; }
[data-theme="orange"] { --lesson-accent: #ea580c; --lesson-tint: #fff3ea; }
[data-theme="purple"] { --lesson-accent: #9333ea; --lesson-tint: #f6eeff; }
[data-theme="cyan"]   { --lesson-accent: #0891b2; --lesson-tint: #e8f9fc; }
[data-theme="red"]    { --lesson-accent: #dc2626; --lesson-tint: #fff0ef; }
[data-theme="indigo"] { --lesson-accent: #4f46e5; --lesson-tint: #eef0ff; }
[data-theme="amber"]  { --lesson-accent: #d97706; --lesson-tint: #fff7e6; }
[data-theme="pink"]   { --lesson-accent: #db2777; --lesson-tint: #fff0f7; }

.lesson-hero-band { background: var(--lesson-tint, var(--panel)); padding: 30px 0 34px; margin-bottom: 6px; }
.lesson-hero-band .container { max-width: 1280px; }
.lesson-hero-band .lesson-eyebrow { background: #fff; color: var(--lesson-accent, var(--accent-2)); }
.lesson-hero-band .lesson-title,
.lesson-hero-band .lesson-lede { max-width: var(--course-max); }

[data-theme] .keyterm,
[data-theme] .word-box { border-color: var(--lesson-accent); }
[data-theme] .lesson-main h2::before {
  content: ''; display: inline-block; width: 11px; height: 11px; border-radius: 50%;
  background: var(--lesson-accent); margin-right: 10px;
}
[data-theme] .course-outline a.active { background: var(--lesson-tint); }
[data-theme] .course-outline a.active .lo-num { border-color: var(--lesson-accent); color: var(--lesson-accent); }
[data-theme] .mark-done-btn { border-color: var(--lesson-accent); color: var(--lesson-accent); }
[data-theme] .mark-done-btn:hover, [data-theme] .mark-done-btn.done { background: var(--lesson-accent); color: #fff; }
[data-theme] .lesson-complete { background: linear-gradient(135deg, var(--lesson-tint), #fff); border-color: var(--lesson-accent); }
[data-theme] .lesson-nav-btn:hover { border-color: var(--lesson-accent); }
[data-theme] .cyu { border-color: var(--lesson-accent); }
[data-theme] .cyu .cyu-tag { color: var(--lesson-accent); }

/* Plain-language glossary box ("New Word!"), simpler than .keyterm:
   one word, one short sentence, always visible (nothing to click to
   reveal, important for the youngest readers). */
.word-box {
  display: flex; gap: 14px; align-items: flex-start;
  background: #fff; border: 3px solid var(--line-strong); border-radius: 16px;
  padding: 18px 20px; margin: 22px 0;
}
.word-box .wb-emoji { font-size: 30px; line-height: 1; flex-shrink: 0; }
.word-box .wb-tag {
  display: inline-block; font-family: 'Space Grotesk', sans-serif;
  font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  background: var(--lesson-tint, var(--panel-2)); color: var(--lesson-accent, var(--accent-2));
  padding: 4px 10px; border-radius: 100px; margin-bottom: 7px;
}
.word-box .wb-word { display: block; font-family: 'Space Grotesk', sans-serif; font-weight: 800; font-size: 19px; color: var(--ink); margin-bottom: 4px; }
.word-box .wb-def { font-size: 15.5px; color: var(--ink-mid); line-height: 1.65; margin: 0; }

/* Bigger, louder check-your-understanding buttons for younger readers */
.cyu.big .cyu-q { font-family: 'Space Grotesk', sans-serif; font-size: 19px; }
.cyu.big .cyu-opt { font-size: 17px; padding: 16px 20px; font-weight: 600; }

/* Deep-dive link cards (model subpages, bonus challenges) */
.dd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0 26px; }
.dd-card {
  display: flex; flex-direction: column; gap: 4px; padding: 18px 16px;
  background: #0b1443; border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px;
  text-decoration: none; transition: border-color .18s, transform .18s, box-shadow .18s;
}
.dd-card:hover { border-color: #2bf0c8; transform: translateY(-3px); box-shadow: 0 10px 26px rgba(0, 0, 0, .28); }
.dd-card .dd-emoji { font-size: 28px; line-height: 1; }
.dd-card .dd-img { width: 100%; height: 96px; object-fit: cover; border-radius: 10px; display: block; margin-bottom: 4px; }
.dd-card .dd-title { font-family: 'Space Grotesk', sans-serif; font-weight: 800; font-size: 18px; color: #fff; margin-top: 6px; }
.dd-card .dd-sub { font-size: 14px; color: #aab4dd; line-height: 1.5; }
.dd-card .dd-go { font-size: 13px; font-weight: 700; color: #7ff0d6; margin-top: 8px; }
@media (max-width: 720px) { .dd-grid { grid-template-columns: 1fr; } }

/* Hub module cards: a big emoji tile instead of an abstract illustration */
.module-card .mc-cover.emoji-cover {
  aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center;
  font-size: 54px;
}
.lesson-band-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 18px; background: #fff;
  font-size: 32px; margin-bottom: 16px; box-shadow: var(--course-shadow);
}

/* Collapsible sidebar on mobile */
.sidebar-toggle {
  display: none;
  width: 100%;
  text-align: left;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
}
@media (max-width: 940px) {
  .sidebar-toggle { display: block; margin-bottom: 12px; }
  .course-outline.collapsed { display: none; }
  .course-sidebar .course-progress-mini,
  .course-sidebar .course-progress-label,
  .course-sidebar > h4 { display: none; }
}

/* ================================================================
   App Builder course add-ons: section checklists, copy-me prompt
   blocks, question-bank cards, and the certificate signature block.
   Shared by the teen and pre-teen "Build an App with AI" courses.
   ================================================================ */
.gp-checklist {
  background: #fff;
  border: 2px solid var(--lesson-accent, var(--accent-2));
  border-radius: 18px;
  padding: 22px 24px 16px;
  margin: 30px 0;
  box-shadow: var(--course-shadow);
}
.gp-checklist-head {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 12px;
}
.gp-checklist label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink);
  transition: background .15s;
}
.gp-checklist label:hover { background: var(--lesson-tint, var(--panel)); }
.gp-checklist input[type=checkbox] {
  width: 22px; height: 22px; margin-top: 2px; flex: 0 0 22px;
  accent-color: var(--lesson-accent, #12a150);
  cursor: pointer;
}
.gp-checklist input:checked + span { color: var(--ink-mid); text-decoration: line-through; text-decoration-color: rgba(18,161,80,.6); }
.gp-checklist-status { font-size: 13px; font-weight: 600; color: var(--ink-mid); margin: 10px 0 4px; }
.gp-checklist-status.ok { color: var(--course-green); }

.prompt-block {
  background: #101f3d;
  border-radius: 16px;
  margin: 22px 0;
  overflow: hidden;
  box-shadow: var(--course-shadow);
}
.prompt-block .pb-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px;
  background: rgba(255,255,255,.07);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #8ec9ff;
}
.prompt-block .pb-copy {
  border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff;
  border-radius: 100px; padding: 5px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .2s;
}
.prompt-block .pb-copy:hover { background: rgba(255,255,255,.15); }
.prompt-block .pb-copy.copied { background: #12a150; border-color: #12a150; }
.prompt-block .pb-text {
  padding: 18px 20px;
  color: #e7ecff;
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  margin: 0;
  font-family: 'Inter', sans-serif;
}
.prompt-block.weak { background: #3d1f24; }
.prompt-block.weak .pb-head { color: #ffb4a8; }

.ask-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 22px 0; }
.ask-card {
  background: var(--lesson-tint, var(--panel));
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  padding: 16px 18px;
}
.ask-card h4 {
  font-family: 'Space Grotesk', sans-serif; font-size: 14px; margin: 0 0 8px;
  color: var(--lesson-accent, var(--accent-2));
}
.ask-card ul { margin: 0; padding-left: 18px; }
.ask-card li { font-size: 14.5px; line-height: 1.6; color: var(--ink); margin-bottom: 6px; }
