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

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bcd-bg-surface, #ffffff);
  color: var(--bcd-fg-text, #2c3e50);
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 20% 50%, rgba(var(--bcd-navy-rgb, 0,61,124),0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255,107,53,0.04) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(var(--bcd-navy-rgb, 0,61,124),0.03) 0%, transparent 50%);
  animation: bgFloat 20s ease-in-out infinite;
}
@keyframes bgFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-20px, -20px) scale(1.05); }
  66%      { transform: translate(20px, -10px) scale(0.95); }
}

.top-banner {
  background: var(--bcd-bg-surface, rgba(255,255,255,0.97));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 20px 60px;
  border-bottom: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.1);
  position: sticky; top: 0; z-index: 1001;
  box-shadow: 0 2px 20px rgba(0,61,124,0.06);
}
.top-banner-content {
  display: flex; align-items: center; gap: 20px;
  max-width: 1600px; margin: 0 auto;
}
.biochem-logo { height: 50px; transition: transform 0.3s ease; }
.biochem-logo:hover { transform: scale(1.05); }
.banner-reset-btn {
  margin-left: auto;
  font-size: 12px; font-weight: 600; letter-spacing: 0.3px;
  color: var(--bcd-fg-text-2, #5a6c7d);
  background: var(--bcd-bg-surface, #ffffff);
  border: 1px solid var(--bcd-bd-line, #e2e8f0);
  border-radius: 6px;
  padding: 7px 13px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.2s ease;
}
.banner-reset-btn:hover {
  color: #FF6B35;
  border-color: #FF6B35;
  background: var(--bcd-bg-warm, #fff7f3);
}
.banner-reset-btn .reset-icon { font-size: 14px; line-height: 1; }

.auth-chip {
  margin-left: auto;
  display: none;  /* shown by JS only when logged in */
  align-items: center; gap: 10px;
  font-size: 12px; color: var(--bcd-fg-navy, #003D7C);
  background: var(--bcd-bg-tint, #f1f6fb);
  border: 1px solid var(--bcd-bd-line, #d6e4f0);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: inherit;
}
.auth-chip .auth-chip-name { font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-chip .auth-chip-sep { color: var(--bcd-fg-text-3, #9bb3c9); }
.auth-chip .auth-chip-logout {
  background: none; border: none; padding: 0;
  color: var(--bcd-fg-red, #c0392b); font-weight: 600; font-size: 12px;
  cursor: pointer; font-family: inherit;
}
.auth-chip .auth-chip-logout:hover { text-decoration: underline; }
/* When chip is shown, push the reset button back into its old slot */
.auth-chip[data-shown="1"] ~ .banner-reset-btn { margin-left: 12px; }

.nav-bar {
  background: var(--bcd-bg-surface, rgba(255,255,255,0.98));
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 2px 20px rgba(0,61,124,0.08);
}
.nav-bar-content { max-width: 1600px; margin: 0 auto; padding: 0 60px; }
.nav-links { display: flex; list-style: none; gap: 15px; }
.nav-links > li > a {
  display: block; text-decoration: none; color: var(--bcd-fg-navy, #003D7C);
  font-size: 13px; font-weight: 500; padding: 22px 10px;
  white-space: nowrap; letter-spacing: 0.2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-links > li > a:hover { color: #FF6B35; }

.module-hero {
  max-width: 1600px; margin: 0 auto;
  padding: 50px 60px 30px;
}
.module-hero h1 {
  font-size: 42px; font-weight: 800; color: var(--bcd-fg-navy, #003D7C);
  line-height: 1.15; margin-bottom: 12px;
}
.module-hero .subtitle {
  font-size: 19px; color: var(--bcd-fg-text-2, #5a6c7d); font-weight: 400; max-width: 760px;
}

/* ── Three-column layout (subnav | content | code terminal) ─────── */
.module-grid {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px 48px 80px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}
/* Hide the Python scratchpad on pre/post-test pages so the assessment
   measures recall, not scratchpad use. Toggled in the per-page-kind
   hook in showPage(). */
.module-grid.no-scratchpad {
  grid-template-columns: 240px minmax(0, 1fr);
}
.module-grid.no-scratchpad .scratchpad-panel {
  display: none;
}

/* ── Right-column coding terminal (Pyodide scratchpad) ──────────── */
/* Visual language mirrors .subnav: white card, navy/orange accents,
   in-card header strip, inset editor, orange primary Run button,
   charcoal output pane nested inside the card. */
.scratchpad-panel {
  position: sticky; top: 90px;
  background: var(--bcd-bg-surface, #ffffff);
  color: var(--bcd-fg-text, #2c3e50);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,61,124,0.10);
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.08);
}
.scratchpad-header {
  display: flex; align-items: center; gap: 10px;
  background: var(--bcd-bg-surface, #ffffff);
  padding: 18px 20px 14px;
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.08);
}
.scratchpad-header .scratchpad-title {
  flex: 1;
  color: #FF6B35;
  display: flex; flex-direction: column; gap: 3px;
}
.scratchpad-header .scratchpad-title small {
  font-family: 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 10px; font-weight: 500; letter-spacing: 0.3px;
  text-transform: none;
  color: var(--bcd-fg-text-2, #5a6c7d);
}
.scratchpad-status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 6px rgba(148,163,184,0.6);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.scratchpad-status-dot.loading { background: #f59e0b; box-shadow: 0 0 8px rgba(245,158,11,0.7); animation: scratchpadPulse 1.2s ease-in-out infinite; }
.scratchpad-status-dot.ready   { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.7); }
.scratchpad-status-dot.running { background: #60a5fa; box-shadow: 0 0 8px rgba(96,165,250,0.7); animation: scratchpadPulse 0.8s ease-in-out infinite; }
.scratchpad-status-dot.error   { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,0.7); }
@keyframes scratchpadPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.scratchpad-collapse-btn {
  background: var(--bcd-bg-surface, #ffffff);
  color: var(--bcd-fg-navy, #003D7C);
  border: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.18);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.scratchpad-collapse-btn:hover { background: rgba(var(--bcd-navy-rgb, 0,61,124),0.06); border-color: rgba(var(--bcd-navy-rgb, 0,61,124),0.30); }
.scratchpad-editor {
  flex: 1 1 auto;
  min-height: 120px;
  width: calc(100% - 36px);
  margin: 14px 18px 0;
  background: var(--bcd-bg-tint, #f8fafc);
  color: var(--bcd-fg-text, #1a202c);
  border: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.10);
  border-radius: 10px;
  outline: 0;
  padding: 14px 16px;
  font-family: 'JetBrains Mono', Menlo, Monaco, Consolas, 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.55;
  resize: none;
  tab-size: 4;
  -moz-tab-size: 4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.scratchpad-editor::placeholder { color: var(--bcd-fg-text-3, #94a3b8); }
.scratchpad-editor:focus {
  background: var(--bcd-bg-surface, #ffffff);
  border-color: #FF6B35;
  box-shadow: 0 0 0 3px rgba(255,107,53,0.12);
}
.scratchpad-toolbar {
  display: flex; gap: 10px;
  padding: 12px 18px;
  background: var(--bcd-bg-surface, #ffffff);
}
.scratchpad-run-btn, .scratchpad-clear-btn {
  font-family: inherit;
  font-size: 13px; font-weight: 700; letter-spacing: 0.3px;
  padding: 9px 18px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.scratchpad-run-btn {
  background: linear-gradient(135deg, #FF6B35 0%, #ff8555 100%);
  color: white;
  flex: 1;
  box-shadow: 0 4px 14px rgba(255,107,53,0.25);
}
.scratchpad-run-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(255,107,53,0.35); }
.scratchpad-run-btn:disabled { opacity: 0.55; cursor: wait; }
.scratchpad-clear-btn {
  background: var(--bcd-bg-surface, #ffffff);
  color: var(--bcd-fg-navy, #003D7C);
  border: 1.5px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.25);
}
.scratchpad-clear-btn:hover { background: rgba(var(--bcd-navy-rgb, 0,61,124),0.06); transform: translateY(-1px); border-color: rgba(var(--bcd-navy-rgb, 0,61,124),0.40); }
.scratchpad-output {
  margin: 0;
  padding: 14px 16px;
  background: var(--bcd-bg-surface, #ffffff);
  color: var(--bcd-fg-text, #1a202c);
  font-family: 'JetBrains Mono', Menlo, Monaco, Consolas, 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.scratchpad-output:empty::before {
  content: '# Output will appear here. Press Run ▶ or Ctrl/Cmd+Enter in the editor.';
  color: var(--bcd-fg-text-3, #94a3b8);
  opacity: 1;
}
.scratchpad-output .scratchpad-err  { color: var(--bcd-fg-red, #c53030); }
.scratchpad-output .scratchpad-info { color: var(--bcd-fg-text-2, #5a6c7d); }
.scratchpad-output img.scratchpad-fig {
  display: block;
  max-width: 100%;
  margin: 8px 0;
  background: var(--bcd-bg-surface, #ffffff);
  border-radius: 6px;
  border: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.10);
}
.scratchpad-output canvas {
  display: block;
  max-width: 100%;
  margin: 8px 0;
  background: var(--bcd-bg-surface, #ffffff);
  border-radius: 6px;
  border: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.10);
}
.scratchpad-panel.collapsed .scratchpad-io,
.scratchpad-panel.collapsed .scratchpad-editor,
.scratchpad-panel.collapsed .scratchpad-toolbar { display: none; }

/* ── v5.5: Figure lightbox — click a Graph-tab thumbnail to open full-size ── */
.figlightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 32px; background: rgba(15,23,42,0.72);
  animation: figLightboxIn 0.18s ease-out;
}
.figlightbox[hidden] { display: none; }
.figlightbox-card {
  position: relative; background: var(--bcd-bg-surface, #fff);
  border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,0.45);
  max-width: 94vw; max-height: 92vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.figlightbox-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 11px 16px;
  border-bottom: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.10);
}
.figlightbox-title { font-family: inherit; font-size: 14px; font-weight: 700; color: var(--bcd-fg-navy, #003D7C); }
.figlightbox-close {
  background: var(--bcd-bg-tint, #f8fafc); border: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.18);
  border-radius: 8px; width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1; color: var(--bcd-fg-navy, #003D7C); cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.figlightbox-close:hover { background: rgba(211,47,47,0.10); border-color: rgba(211,47,47,0.40); color: var(--bcd-fg-red, #D32F2F); }
.figlightbox-body {
  padding: 18px; overflow: auto; background: var(--bcd-bg-surface, #fbfdff);
  display: flex; align-items: center; justify-content: center;
}
.figlightbox-body img { max-width: 100%; max-height: calc(92vh - 64px); display: block; border-radius: 6px; }
@keyframes figLightboxIn { from { opacity: 0; } to { opacity: 1; } }

/* ── v5.7: Tabbed output region (Terminal / Files / Graph) above the editor ── */
.scratchpad-io {
  margin: 2px 18px 18px;
  border: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.10);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bcd-bg-surface, #ffffff);
  /* Flex within the panel so the output region shrinks with the card and
     scrolls inside its own bounds (never clipped by the panel's max-height).
     Capped so it can't crowd out the editor on tall screens. */
  flex: 1 1 auto;
  min-height: 150px;
  max-height: 340px;
  display: flex;
  flex-direction: column;
}
.out-tabs {
  flex: 0 0 auto;
  display: flex; gap: 4px;
  padding: 6px;
  background: var(--bcd-bg-tint, #f1f5f9);
  border-bottom: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.08);
}
.out-tab {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 10px;
  border: 0; border-radius: 7px;
  background: transparent; color: var(--bcd-fg-text-2, #5a6c7d);
  position: relative;
  font-family: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.2px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.out-tab svg { width: 15px; height: 15px; }
.out-tab:hover { color: var(--bcd-fg-navy, #003D7C); }
.out-tab.active { background: var(--bcd-bg-surface, #ffffff); color: var(--bcd-fg-navy, #003D7C); box-shadow: 0 1px 6px rgba(0,61,124,0.12); }
.out-tab .out-tab-pill {
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: rgba(var(--bcd-navy-rgb, 0,61,124),0.10); color: var(--bcd-fg-navy, #003D7C);
  font-size: 10px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.out-tab .out-tab-pill:empty { display: none; }
.out-tab.active .out-tab-pill { background: #FF6B35; color: #ffffff; }
.out-tab.has-new::after {
  content: ''; position: absolute; top: 5px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: linear-gradient(135deg, #FF6B35 0%, #ff8555 100%);
  box-shadow: 0 0 0 2px #f1f5f9;
  animation: workspaceNewPulse 1.5s ease-out infinite;
}
.out-tab.active.has-new::after { box-shadow: 0 0 0 2px #ffffff; }
.out-body {
  flex: 1 1 auto;
  min-height: 0;          /* let it shrink so overflow-y can scroll, never clip */
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bcd-bg-surface, #ffffff);
}
.out-pane { display: block; }
.out-pane[hidden] { display: none; }

/* Files pane */
.out-files { padding: 12px; }
.out-files-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.out-files-hint { flex: 1; font-size: 11px; color: var(--bcd-fg-text-2, #5a6c7d); line-height: 1.4; }
.out-files-hint code {
  font-family: 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 10.5px; background: var(--bcd-bg-tint, #f8fafc); border: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.10);
  border-radius: 4px; padding: 1px 5px; color: var(--bcd-fg-navy, #003D7C);
}
.out-files .workspace-files-list { flex-direction: column; }
.out-files .workspace-file-chip { display: flex; width: 100%; cursor: pointer; }
.out-files .workspace-file-chip .meta { flex: 1; }
.out-files .workspace-file-chip.open { border-color: rgba(255,107,53,0.55); background: var(--bcd-bg-surface, #ffffff); }
.ws-preview {
  margin: -2px 0 8px;
  border: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.12);
  border-radius: 9px; overflow: auto; max-height: 200px;
  background: var(--bcd-bg-surface, #ffffff);
}
.ws-preview table {
  border-collapse: collapse; width: 100%;
  font-family: 'JetBrains Mono', Menlo, Consolas, monospace; font-size: 11.5px;
}
.ws-preview th {
  background: #003D7C; color: #ffffff; padding: 6px 10px; text-align: left;
  position: sticky; top: 0; white-space: nowrap;
}
.ws-preview td { padding: 5px 10px; border-bottom: 1px solid var(--bcd-bd-line, #eef2f7); white-space: nowrap; }
.ws-preview tr:nth-child(even) td { background: var(--bcd-bg-tint, #f8fafc); }
.ws-preview pre {
  margin: 0; padding: 10px 12px;
  font-family: 'JetBrains Mono', Menlo, Consolas, monospace; font-size: 11.5px;
  white-space: pre; color: var(--bcd-fg-text, #1a202c);
}
.ws-preview-note {
  padding: 6px 10px; font-size: 10.5px; color: var(--bcd-fg-text-2, #5a6c7d);
  border-top: 1px solid var(--bcd-bd-line, #eef2f7); background: var(--bcd-bg-tint, #f8fafc);
}

/* Graph pane */
.out-graph { padding: 12px; }
.scratchpad-fig-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.scratchpad-fig-thumb {
  width: 160px; border: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.14); border-radius: 9px;
  overflow: hidden; background: var(--bcd-bg-surface, #ffffff);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.scratchpad-fig-thumb:hover { border-color: #FF6B35; box-shadow: 0 4px 14px rgba(0,61,124,0.12); transform: translateY(-2px); }
.scratchpad-fig-thumb img { width: 100%; display: block; background: var(--bcd-bg-surface, #fff); cursor: pointer; }
.scratchpad-fig-thumb .cap {
  padding: 4px 4px 4px 8px; font-size: 11px; font-weight: 700; color: var(--bcd-fg-navy, #003D7C);
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  font-family: inherit;
}
.scratchpad-fig-thumb .fig-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scratchpad-fig-thumb .fig-actions { display: inline-flex; gap: 1px; flex-shrink: 0; }
.scratchpad-fig-thumb .icon-btn {
  background: transparent; border: 0;
  width: 24px; height: 24px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--bcd-fg-text-2, #5a6c7d); cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.scratchpad-fig-thumb .icon-btn:hover { background: rgba(var(--bcd-navy-rgb, 0,61,124),0.10); color: var(--bcd-fg-navy, #003D7C); }
.scratchpad-fig-thumb .icon-btn.fig-remove:hover { color: var(--bcd-fg-red, #D32F2F); background: rgba(211,47,47,0.08); }
.scratchpad-fig-thumb .icon-btn svg { width: 13px; height: 13px; }
.out-graph-empty {
  padding: 26px 14px; text-align: center; color: var(--bcd-fg-text-3, #94a3b8); font-size: 12px; line-height: 1.6;
}
.out-graph-empty[hidden] { display: none; }
.out-graph-empty code {
  font-family: 'JetBrains Mono', Menlo, Consolas, monospace; font-size: 11px;
  background: var(--bcd-bg-tint, #f8fafc); border: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.10); border-radius: 4px; padding: 1px 5px; color: var(--bcd-fg-navy, #003D7C);
}

/* ── Workspace files (Pyodide virtual FS) — rendered inside the Files tab.
   Upload CSV/TSV/TXT into Pyodide's /home/pyodide so open() works, click a
   file to preview it, and download anything the student's code writes. */
.workspace-upload-btn {
  font-family: inherit;
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
  background: var(--bcd-bg-surface, #ffffff);
  color: var(--bcd-fg-navy, #003D7C);
  border: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.25);
  border-radius: 6px;
  padding: 5px 11px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.workspace-upload-btn:hover {
  background: rgba(var(--bcd-navy-rgb, 0,61,124),0.06);
  border-color: rgba(var(--bcd-navy-rgb, 0,61,124),0.40);
  transform: translateY(-1px);
}
.workspace-upload-btn svg { width: 12px; height: 12px; }
.workspace-files-list {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.workspace-files-empty {
  font-size: 12px; color: var(--bcd-fg-text-3, #94a3b8);
  font-style: italic;
  padding: 4px 0;
  line-height: 1.5;
}
.workspace-files-empty code {
  font-family: 'JetBrains Mono', Menlo, Consolas, monospace;
  font-style: normal;
  font-size: 11px;
  background: var(--bcd-bg-tint, #f8fafc);
  border: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.10);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--bcd-fg-navy, #003D7C);
}
.workspace-file-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bcd-bg-tint, #f8fafc);
  border: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.10);
  border-radius: 8px;
  padding: 6px 6px 6px 10px;
  font-family: 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--bcd-fg-text, #1a202c);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.workspace-file-chip:hover {
  border-color: rgba(var(--bcd-navy-rgb, 0,61,124),0.25);
  box-shadow: 0 2px 8px rgba(0,61,124,0.06);
}
.workspace-file-chip .file-icon {
  width: 14px; height: 14px; flex-shrink: 0; color: var(--bcd-fg-navy, #003D7C);
}
.workspace-file-chip .meta {
  display: flex; flex-direction: column; gap: 1px; line-height: 1.2;
}
.workspace-file-chip .name { font-weight: 600; color: var(--bcd-fg-navy, #003D7C); }
.workspace-file-chip .size { font-size: 10px; color: var(--bcd-fg-text-2, #5a6c7d); font-weight: 500; letter-spacing: 0.2px; }
.workspace-file-chip .actions {
  display: inline-flex; gap: 2px; margin-left: 2px;
}
.workspace-file-chip .icon-btn {
  background: transparent;
  border: 0;
  width: 24px; height: 24px;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--bcd-fg-text-2, #5a6c7d);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.workspace-file-chip .icon-btn:hover {
  background: rgba(var(--bcd-navy-rgb, 0,61,124),0.10);
  color: var(--bcd-fg-navy, #003D7C);
}
.workspace-file-chip .icon-btn.remove:hover {
  color: var(--bcd-fg-red, #D32F2F);
  background: rgba(211,47,47,0.08);
}
.workspace-file-chip .icon-btn svg { width: 13px; height: 13px; }
.workspace-file-chip.is-new {
  border-color: rgba(255,107,53,0.40);
  animation: workspaceNewPulse 1.8s ease-out;
}
.workspace-file-chip .badge-new {
  position: absolute; top: -8px; right: 10px;
  background: linear-gradient(135deg, #FF6B35 0%, #ff8555 100%);
  color: white;
  font-family: inherit;
  font-size: 9px; font-weight: 700; letter-spacing: 0.8px;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(255,107,53,0.30);
}
@keyframes workspaceNewPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,107,53,0.45); }
  60%  { box-shadow: 0 0 0 10px rgba(255,107,53,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,107,53,0); }
}

.subnav {
  position: sticky; top: 90px;
  background: var(--bcd-bg-surface, white);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,61,124,0.10);
  padding: 22px 16px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}
.subnav-title {
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: #FF6B35;
  padding: 0 8px 12px; border-bottom: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.08);
  margin-bottom: 8px;
}
.subnav-item {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  color: var(--bcd-fg-text, #2c3e50); font-size: 14px; font-weight: 500;
  padding: 10px 12px; margin: 2px 0;
  border-radius: 8px;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  line-height: 1.35;
}
.subnav-item:hover {
  background: rgba(var(--bcd-navy-rgb, 0,61,124),0.08);
  color: var(--bcd-fg-navy, #003D7C);
  transform: translateX(3px);
  box-shadow: 0 2px 8px rgba(0,61,124,0.08);
}
.subnav-item.active {
  background: rgba(var(--bcd-navy-rgb, 0,61,124),0.08);
  color: var(--bcd-fg-navy, #003D7C);
  border-left-color: #FF6B35;
  font-weight: 600;
}
.subnav-item-sub {
  font-size: 13px; padding-left: 26px; color: var(--bcd-fg-text-2, #5a6c7d);
}
.subnav-num {
  display: inline-block; min-width: 22px;
  color: #FF6B35; font-weight: 600; font-size: 12px;
}
.subnav-empty { font-size: 13px; color: var(--bcd-fg-text-3, #888); padding: 8px; }

.module-content {
  background: var(--bcd-bg-surface, white);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,61,124,0.10);
  padding: 40px 52px;
  min-width: 0;
}

/* ── Pages ───────────────────────────────────────────────────── */
.page {
  display: none;
  animation: pageFadeIn 0.35s ease-out;
}
.page.active { display: block; }
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-progress-bar {
  width: 100%; height: 4px;
  background: rgba(var(--bcd-navy-rgb, 0,61,124),0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 14px;
}
.page-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #003D7C 0%, #FF6B35 100%);
  transition: width 0.4s ease;
}
.page-meta {
  font-size: 12px; font-weight: 600;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: #FF6B35;
  margin-bottom: 10px;
}

.section-title {
  font-size: 30px; font-weight: 700; color: var(--bcd-fg-navy, #003D7C);
  margin: 4px 0 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.12);
  line-height: 1.2;
}
.subsection-title {
  font-size: 26px; font-weight: 700; color: var(--bcd-fg-navy, #003D7C);
  margin: 4px 0 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.12);
  line-height: 1.25;
}
.page-body p { margin: 14px 0; font-size: 16px; }
.module-list { margin: 14px 0 14px 24px; }
.module-list li { margin: 8px 0; font-size: 16px; }

/* Inline highlights authored in Word via font colour
   (NUS blue #003D7C, NUS orange #FF6B35, accent red #D32F2F) */
.hl-blue   { color: var(--bcd-fg-navy, #003D7C); }
.hl-orange { color: #FF6B35; }
.hl-red    { color: var(--bcd-fg-red, #D32F2F); }

/* Superscript/subscript authored in Word. line-height:0 keeps a raised
   exponent from stretching the line it sits on, which is what the browser
   default does to a paragraph of prose. */
sup, sub { font-size: 0.75em; line-height: 0; position: relative; vertical-align: baseline; }
sup { top: -0.5em; }
sub { bottom: -0.25em; }

.module-figure { margin: 28px 0; text-align: center; }
.module-figure img {
  max-width: 100%; height: auto;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,61,124,0.12);
}
.module-figure figcaption {
  margin-top: 10px; font-size: 14px; color: var(--bcd-fg-text-2, #5a6c7d); font-style: italic;
}
.module-figure-missing {
  border: 2px dashed rgba(220,38,38,0.4);
  border-radius: 10px; padding: 24px;
}
.figure-missing { color: var(--bcd-fg-red, #991b1b); font-family: monospace; font-size: 13px; }

/* ── Page video (full-width, replaces right rail) ─────────────── */
.page-video {
  margin: 32px 0;
  background: var(--bcd-bg-surface, white);
  border-radius: 14px;
  box-shadow: 0 10px 32px rgba(0,61,124,0.14);
  overflow: hidden;
  border: 2px solid rgba(255,107,53,0.20);
}
.page-video-frame {
  position: relative; width: 100%; padding-bottom: 56.25%;
  background: #000;
}
.page-video-frame iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: 0;
}

/* ── Reflect cards ────────────────────────────────────────────── */
.reflect-card {
  background: linear-gradient(135deg, var(--bcd-bg-warm, #fff8f3) 0%, var(--bcd-bg-surface, #fff) 100%);
  border: 2px solid rgba(255,107,53,0.25);
  border-radius: 14px;
  padding: 24px 28px;
  margin: 32px 0;
  box-shadow: 0 6px 20px rgba(255,107,53,0.08);
}
.reflect-header {
  display: inline-block;
  background: linear-gradient(135deg, #FF6B35 0%, #ff8555 100%);
  color: white; padding: 4px 14px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 12px;
}
.reflect-question {
  font-size: 17px; font-weight: 600; color: var(--bcd-fg-navy, #003D7C); margin-bottom: 16px;
}
.reflect-loading { color: var(--bcd-fg-text-3, #888); font-style: italic; font-weight: 400; }
/* CSS only, because the class is written into the page at BUILD time and
   removed by three different handlers -- an element that starts in the loading
   state before any script runs cannot be given its spinner by script. The
   pseudo-element goes away with the class. */
.reflect-loading::before {
  content: ''; display: inline-block; width: 11px; height: 11px;
  margin-right: 8px; vertical-align: -1px;
  border: 2px solid #888; border-right-color: transparent; border-radius: 50%;
  animation: reflectSpin 0.65s linear infinite;
}
@keyframes reflectSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .reflect-loading::before { animation: none; opacity: 0.5; }
}
.reflect-input {
  width: 100%;
  border: 1.5px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.2);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: inherit; font-size: 15px;
  resize: vertical; background: var(--bcd-bg-surface, white);
}
.reflect-input:focus {
  outline: none; border-color: #FF6B35;
  box-shadow: 0 0 0 3px rgba(255,107,53,0.15);
}
.reflect-submit {
  margin-top: 12px;
  background: linear-gradient(135deg, #FF6B35 0%, #ff8555 100%);
  color: white; border: 0;
  padding: 10px 22px; border-radius: 8px;
  font-weight: 600; font-size: 14px; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.reflect-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255,107,53,0.30);
}
.reflect-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.reflect-feedback {
  margin-top: 18px; padding: 16px 18px;
  background: var(--bcd-bg-surface, white);
  border-left: 4px solid var(--bcd-bd-navy, #003D7C);
  border-radius: 6px; font-size: 15px; line-height: 1.6;
}
.reflect-feedback strong { color: var(--bcd-fg-navy, #003D7C); }

/* ── v4.0 assessment & engagement cards ──────────────────────── */
/* ---- one-off custom apps ([APP:] marker, 2026-08-27) ----
   The chrome the builder puts round an app fragment. These pages define NO CSS
   custom properties (measured: one page had exactly one, --flip, and 93 literal
   uses of #003D7C), so every colour here is a literal hex and the design digest
   tells Claude the same. `.card` does not exist on these courses, so
   .card--app is styled standalone rather than as a modifier. */
.card--app {
  margin: 28px 0;
  padding: 20px 24px;
  background: var(--bcd-bg-surface, white);
  border: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.12);
  border-left: 4px solid #FF6B35;
  border-radius: 10px;
}
.card--app > :first-child { margin-top: 0; }
.card--app > :last-child  { margin-bottom: 0; }
.app__caption {
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.10);
  font-size: 0.9em; color: var(--bcd-fg-text-2, #5a6c7d);
}

/* ---- [TABLE:] data tables (2026-09-08) ----
   Structure the student READS, so deliberately not a .card: no border box, no
   shadow, no tag chip. A table earns its authority from alignment and two
   rules, and chrome round it would say "answer me". Literal hex throughout —
   these pages define no CSS custom properties. */
.lesson-table-figure { margin: 28px 0; }
/* Wide content scrolls in its OWN box. Without this a six-column table widens
   the page and the prose beside it scrolls sideways too. */
.lesson-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lesson-table {
  border-collapse: collapse; width: 100%; min-width: 320px;
  font-size: 15px; line-height: 1.5; color: var(--bcd-fg-text, #2c3e50);
}
.lesson-table caption {
  caption-side: top; text-align: left;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--bcd-fg-navy, #003D7C);
  padding: 0 0 10px;
}
.lesson-table thead th {
  text-align: left; vertical-align: bottom;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--bcd-fg-navy, #003D7C);
  background: rgba(var(--bcd-navy-rgb, 0,61,124),0.04);
  border-bottom: 2px solid var(--bcd-bd-navy, #003D7C);
  padding: 10px 14px;
}
.lesson-table td, .lesson-table tbody th {
  padding: 10px 14px; vertical-align: top;
  border-bottom: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.10);
}
.lesson-table tbody th { text-align: left; font-weight: 700; color: var(--bcd-fg-navy, #003D7C); }
.lesson-table tbody tr:last-child td,
.lesson-table tbody tr:last-child th { border-bottom: 2px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.18); }
/* Zebra FIRST, hover second: the two selectors have equal specificity, so
   source order is the only thing that lets a hover be seen on a striped row. */
.lesson-table--zebra tbody tr:nth-child(even) td,
.lesson-table--zebra tbody tr:nth-child(even) th { background: rgba(var(--bcd-navy-rgb, 0,61,124),0.025); }
.lesson-table tbody tr:hover td,
.lesson-table tbody tr:hover th { background: rgba(255,107,53,0.06); }
.lesson-table--compact thead th,
.lesson-table--compact td,
.lesson-table--compact tbody th { padding: 6px 10px; font-size: 14px; }
/* A column whose every body cell is a number. Right-aligned with tabular
   figures so the decimal points line up down the page — decided by the builder
   from the content, never asked of the author. */
.lesson-table .lt-num { text-align: right; font-variant-numeric: tabular-nums; }
.lesson-table code { font-size: 0.9em; }
.lesson-table__note {
  margin-top: 10px;
  font-size: 14px; color: var(--bcd-fg-text-2, #5a6c7d); font-style: italic;
}

/* ---- [CALLOUT:] note / warning / pro-tip boxes (2026-09-21) ----
   A CONTAINER the student READS, so like the tables above it is deliberately
   not a .card: a card is something you answer. It is a rule, a tint and a
   heading and nothing else — the content inside keeps its own styling, which
   is exactly what lets a box hold a widget without restyling it. Literal hex
   throughout; these pages define no CSS custom properties. */
.callout {
  margin: 20px 0; padding: 14px 16px 14px 18px;
  border-left: 4px solid #5b8def;
  border-radius: 0 6px 6px 0;
  background: rgba(91,141,239,0.08);
}
.callout__title {
  margin: 0 0 6px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--bcd-fg-blue, #2f5fc0);
}
/* The content inside is ordinary lesson content and keeps its own margins,
   except at the two ends where the box supplies the padding. */
.callout__body { margin: 0; }
.callout__body > :first-child { margin-top: 0; }
.callout__body > :last-child { margin-bottom: 0; }
/* Accent on the rule, a DARKER ink on the title. Using the accent for both —
   as med-chem does today — puts 12.5px uppercase amber on near-white at about
   2.2:1, which fails WCAG AA outright. */
.callout--note { border-left-color: #5b8def; background: rgba(91,141,239,0.08); }
.callout--note .callout__title { color: var(--bcd-fg-blue, #2f5fc0); }
.callout--warning { border-left-color: #f59e0b; background: rgba(245,158,11,0.10); }
.callout--warning .callout__title { color: var(--bcd-fg-amber, #a35f05); }
.callout--tip { border-left-color: var(--bcd-bd-navy, #003D7C); background: rgba(var(--bcd-navy-rgb, 0,61,124),0.06); }
.callout--tip .callout__title { color: var(--bcd-fg-navy, #003D7C); }
.callout--key { border-left-color: #FF6B35; background: rgba(255,107,53,0.08); }
.callout--key .callout__title { color: var(--bcd-fg-amber, #c2410c); }
.callout--mistake { border-left-color: #c94f4f; background: rgba(201,79,79,0.10); }
.callout--mistake .callout__title { color: var(--bcd-fg-red, #a33a3a); }

.assess-card {
  background: var(--bcd-bg-surface, white);
  border: 2px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.18);
  border-radius: 14px;
  padding: 24px 28px;
  margin: 28px 0;
  box-shadow: 0 4px 14px rgba(0,61,124,0.06);
}
.assess-header {
  display: inline-block;
  padding: 4px 14px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 14px;
  color: white;
}
.pretest-header   { background: linear-gradient(135deg, #5b8def 0%, #7da3f5 100%); }
.posttest-header  { background: linear-gradient(135deg, #2ea36b 0%, #4cc285 100%); }
.misconception-header { background: linear-gradient(135deg, #c94f4f 0%, #e07070 100%); }
.predict-header   { background: linear-gradient(135deg, #8458b3 0%, #a474d4 100%); }
.muddiest-header  { background: linear-gradient(135deg, #5a5a5a 0%, #7a7a7a 100%); }
.rating-header    { background: linear-gradient(135deg, #003D7C 0%, #0052a3 100%); }

.assess-intro {
  font-size: 15px; color: var(--bcd-fg-text, #333); line-height: 1.65;
  background: rgba(var(--bcd-navy-rgb, 0,61,124),0.05);
  border-left: 3px solid var(--bcd-bd-navy, #003D7C);
  padding: 14px 18px; border-radius: 6px;
  margin-bottom: 24px;
}

/* MCQ shared (pre, post, misconception) */
.mcq-stem {
  font-size: 16px; font-weight: 600; color: var(--bcd-fg-navy, #003D7C);
  margin-bottom: 14px; line-height: 1.5;
}
.mcq-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.mcq-option {
  display: flex; align-items: flex-start; gap: 10px;
  text-align: left; width: 100%;
  background: var(--bcd-bg-surface, white);
  border: 1.5px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.18);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: inherit; font-size: 15px; color: var(--bcd-fg-text, #222);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.10s;
}
.mcq-option:hover { border-color: var(--bcd-bd-navy, #003D7C); background: rgba(var(--bcd-navy-rgb, 0,61,124),0.04); }
.mcq-option.selected {
  border-color: var(--bcd-bd-navy, #003D7C); background: rgba(var(--bcd-navy-rgb, 0,61,124),0.12);
  box-shadow: 0 0 0 3px rgba(0,61,124,0.15);
  font-weight: 500;
}
.mcq-option.correct {
  border-color: #2ea36b; background: rgba(46,163,107,0.10);
}
.mcq-option.incorrect {
  border-color: #c94f4f; background: rgba(201,79,79,0.10);
}
.mcq-option:disabled { cursor: default; }
.mcq-letter { font-weight: 700; color: var(--bcd-fg-navy, #003D7C); flex-shrink: 0; }
.mcq-text { flex: 1; }
.mcq-submit {
  background: linear-gradient(135deg, #003D7C 0%, #0052a3 100%);
  color: white; border: 0;
  padding: 10px 22px; border-radius: 8px;
  font-weight: 600; font-size: 14px; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.mcq-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,61,124,0.25);
}
.mcq-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.mcq-feedback {
  margin-top: 16px; padding: 14px 16px;
  border-left: 4px solid var(--bcd-bd-navy, #003D7C);
  background: rgba(var(--bcd-navy-rgb, 0,61,124),0.04);
  border-radius: 6px; font-size: 14px; line-height: 1.6;
}
.mcq-feedback.is-correct { border-left-color: #2ea36b; background: rgba(46,163,107,0.06); }
.mcq-feedback.is-incorrect { border-left-color: #c94f4f; background: rgba(201,79,79,0.06); }

/* Confidence slider */
.confidence-statement {
  font-size: 15px; color: var(--bcd-fg-navy, #003D7C); font-weight: 600;
  margin-bottom: 14px; line-height: 1.5;
}
.confidence-scale {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.confidence-anchor {
  font-size: 12px; color: var(--bcd-fg-text-2, #666); flex-shrink: 0; max-width: 110px;
}
.confidence-buttons { display: flex; gap: 6px; }
.confidence-btn {
  width: 42px; height: 42px;
  background: var(--bcd-bg-surface, white);
  border: 1.5px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.20);
  border-radius: 8px;
  font-family: inherit; font-size: 15px; font-weight: 700;
  color: var(--bcd-fg-navy, #003D7C); cursor: pointer;
  transition: all 0.15s;
}
.confidence-btn:hover { border-color: var(--bcd-bd-navy, #003D7C); background: rgba(var(--bcd-navy-rgb, 0,61,124),0.06); }
.confidence-btn.selected {
  background: #003D7C; color: white; border-color: var(--bcd-bd-navy, #003D7C);
  box-shadow: 0 4px 12px rgba(0,61,124,0.30);
}
.confidence-btn:disabled { cursor: default; }

/* Predict-then-reveal */
.predict-prompt {
  font-size: 16px; font-weight: 600; color: var(--bcd-fg-navy, #003D7C);
  margin-bottom: 14px; line-height: 1.5;
}
.predict-input {
  width: 100%;
  border: 1.5px solid rgba(132,88,179,0.30);
  border-radius: 8px;
  padding: 12px 14px; font-family: inherit; font-size: 15px;
  resize: vertical; background: var(--bcd-bg-surface, white);
}
.predict-input:focus {
  outline: none; border-color: #8458b3;
  box-shadow: 0 0 0 3px rgba(132,88,179,0.15);
}
.predict-reveal-btn {
  margin-top: 12px;
  background: linear-gradient(135deg, #8458b3 0%, #a474d4 100%);
  color: white; border: 0;
  padding: 10px 22px; border-radius: 8px;
  font-weight: 600; font-size: 14px; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.predict-reveal-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(132,88,179,0.30);
}
.predict-reveal-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.predict-reveal {
  margin-top: 16px; padding: 16px 18px;
  background: rgba(132,88,179,0.06);
  border-left: 4px solid #8458b3;
  border-radius: 6px; font-size: 15px; line-height: 1.65; color: var(--bcd-fg-text, #222);
}
.predict-reveal strong { color: var(--bcd-fg-purple, #8458b3); }

/* Muddiest point */
.muddiest-prompt {
  font-size: 16px; font-weight: 600; color: var(--bcd-fg-navy, #003D7C);
  margin-bottom: 14px; line-height: 1.5;
}
.muddiest-input {
  width: 100%;
  border: 1.5px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.20);
  border-radius: 8px;
  padding: 12px 14px; font-family: inherit; font-size: 15px;
  resize: vertical; background: var(--bcd-bg-surface, white);
}
.muddiest-input:focus {
  outline: none; border-color: var(--bcd-bd-navy, #003D7C);
  box-shadow: 0 0 0 3px rgba(0,61,124,0.15);
}
.muddiest-submit {
  margin-top: 12px;
  background: linear-gradient(135deg, #5a5a5a 0%, #7a7a7a 100%);
  color: white; border: 0;
  padding: 10px 22px; border-radius: 8px;
  font-weight: 600; font-size: 14px; cursor: pointer;
}
.muddiest-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(90,90,90,0.30);
}
.muddiest-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.muddiest-ack {
  margin-top: 14px; font-size: 14px; color: #2ea36b; font-weight: 600;
}

/* Module rating */
.rating-question {
  font-size: 15px; font-weight: 600; color: var(--bcd-fg-navy, #003D7C);
  margin: 16px 0 10px 0;
}
.rating-stars { display: flex; gap: 6px; }
.rating-star {
  background: none; border: 0;
  font-size: 32px; color: var(--bcd-fg-star-off, #ddd); cursor: pointer;
  padding: 4px 6px;
  transition: color 0.15s, transform 0.10s;
}
.rating-star:hover { color: #ffb84d; transform: scale(1.10); }
.rating-star.selected { color: #FF6B35; }
.nps-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.nps-btn {
  width: 38px; height: 38px;
  background: var(--bcd-bg-surface, white);
  border: 1.5px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.20);
  border-radius: 8px;
  font-family: inherit; font-size: 14px; font-weight: 700;
  color: var(--bcd-fg-navy, #003D7C); cursor: pointer;
  transition: all 0.15s;
}
.nps-btn:hover { border-color: var(--bcd-bd-navy, #003D7C); background: rgba(var(--bcd-navy-rgb, 0,61,124),0.06); }
.nps-btn.selected {
  background: #003D7C; color: white; border-color: var(--bcd-bd-navy, #003D7C);
}
.rating-submit {
  margin-top: 16px;
  background: linear-gradient(135deg, #003D7C 0%, #0052a3 100%);
  color: white; border: 0;
  padding: 10px 22px; border-radius: 8px;
  font-weight: 600; font-size: 14px; cursor: pointer;
}
.rating-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,61,124,0.30);
}
.rating-submit:disabled { opacity: 0.55; cursor: not-allowed; }
/* v6.x: glow nudge — once the learner fills the muddiest point or the
   rating, the matching Submit button pulses twice then holds a steady
   ring, so it is hard to leave without clicking. Manual submit only —
   nothing about telemetry changes. prefers-reduced-motion drops the
   pulse but keeps the steady ring. */
.muddiest-submit.glow-nudge,
.rating-submit.glow-nudge {
  box-shadow: 0 0 0 3px rgba(255,107,53,0.40), 0 4px 16px rgba(255,107,53,0.32);
  animation: glowNudge 1.3s ease-in-out 2;
}
@keyframes glowNudge {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,107,53,0.40), 0 4px 16px rgba(255,107,53,0.32); }
  50%      { box-shadow: 0 0 0 7px rgba(255,107,53,0.22), 0 7px 24px rgba(255,107,53,0.58); }
}
@media (prefers-reduced-motion: reduce) {
  .muddiest-submit.glow-nudge,
  .rating-submit.glow-nudge { animation: none; }
}
.rating-ack {
  margin-top: 14px; font-size: 14px; color: #2ea36b; font-weight: 600;
}

/* ── v5.1 coding-exercise cards ───────────────────────────────── */
.code-card {
  background: linear-gradient(135deg, var(--bcd-bg-tint, #f7fafc) 0%, var(--bcd-bg-surface, #ffffff) 100%);
  border: 2px solid rgba(48, 105, 152, 0.22);
  box-shadow: 0 6px 20px rgba(48, 105, 152, 0.08);
}
.code-header {
  color: var(--bcd-fg-text, #1a202c);
}
.code-header--type    { background: linear-gradient(135deg, #ffd43b 0%, #fab005 100%); color: var(--bcd-fg-text, #1a202c); }
.code-header--predict { background: linear-gradient(135deg, #4dabf7 0%, #228be6 100%); color: white; }
.code-header--debug   { background: linear-gradient(135deg, #ff8787 0%, #e03131 100%); color: white; }
.code-header--explain { background: linear-gradient(135deg, #63e6be 0%, #0ca678 100%); color: white; }

.code-instructions {
  font-size: 14px; color: var(--bcd-fg-text-2, #4a5568); line-height: 1.6;
  margin-bottom: 14px;
}
.code-instructions strong { color: var(--bcd-fg-text, #1a202c); }

.code-ref-label, .code-editor-label {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--bcd-fg-text-2, #718096); margin: 14px 0 6px;
}

code {
  font-family: 'JetBrains Mono', Menlo, Consolas, 'Courier New', monospace;
  font-size: 0.9em;
  background: var(--bcd-bg-tint, #f1f5f9);
  color: var(--bcd-fg-text, #0f172a);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--bcd-bd-line, #e2e8f0);
}

.code-ref {
  font-family: 'JetBrains Mono', Menlo, Consolas, 'Courier New', monospace;
  font-size: 13px; line-height: 1.55;
  background: #0f172a; color: #e2e8f0;
  padding: 14px 16px; border-radius: 8px;
  overflow-x: auto;
  white-space: pre;
  border: 1px solid #1e293b;
}
.code-ref code { font-family: inherit; font-size: inherit; color: inherit; background: none; padding: 0; border: none; border-radius: 0; }

/* Plain [CODE:] marker — read-only example block, no card chrome */
.code-block { margin: 18px 0; }
.code-block > .code-ref { margin: 0; }

.code-editor {
  width: 100%;
  min-height: 120px;
  font-family: 'JetBrains Mono', Menlo, Consolas, 'Courier New', monospace;
  font-size: 13px; line-height: 1.55;
  background: var(--bcd-bg-surface, #ffffff); color: var(--bcd-fg-text, #1a202c);
  border: 1.5px solid rgba(48, 105, 152, 0.30);
  border-radius: 8px;
  padding: 12px 14px;
  resize: vertical;
  tab-size: 4;
  -moz-tab-size: 4;
  white-space: pre;
}
.code-editor:focus {
  outline: none; border-color: #228be6;
  box-shadow: 0 0 0 3px rgba(34, 139, 230, 0.18);
}
.code-editor--prose {
  font-family: inherit; font-size: 15px;
  line-height: 1.6; white-space: pre-wrap;
  min-height: 90px;
}
.code-editor--prediction {
  font-family: 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 13px; min-height: 80px;
}

.code-actions {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px;
}
.code-run, .code-submit, .code-reveal, .code-hint-toggle {
  border: 0; border-radius: 8px;
  padding: 10px 20px;
  font-family: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.code-run {
  background: linear-gradient(135deg, #228be6 0%, #1c7ed6 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(34, 139, 230, 0.25);
}
.code-submit {
  background: linear-gradient(135deg, #003D7C 0%, #0052a3 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 61, 124, 0.22);
}
.code-reveal {
  background: var(--bcd-bg-surface, white); color: var(--bcd-fg-blue, #228be6);
  border: 1.5px solid rgba(34, 139, 230, 0.45);
}
.code-hint-toggle {
  background: var(--bcd-bg-surface, white); color: var(--bcd-fg-red, #e03131);
  border: 1.5px solid rgba(224, 49, 49, 0.45);
}
.code-run:hover:not(:disabled),
.code-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 61, 124, 0.28);
}
.code-reveal:hover:not(:disabled),
.code-hint-toggle:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(34, 139, 230, 0.06);
}
.code-run:disabled, .code-submit:disabled,
.code-reveal:disabled, .code-hint-toggle:disabled,
.code-regen:disabled, .code-reset:disabled {
  opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none;
}

/* v5.4: Regenerate / flip / reset row sits below the main actions and
   uses softer colours so it reads as a tutor-side affordance, not the
   primary submit. */
.code-actions--regen {
  margin-top: 8px; padding-top: 10px;
  border-top: 1px dashed rgba(var(--bcd-navy-rgb, 0,61,124),0.18);
  align-items: center;
}
.code-regen, .code-reset {
  border: 0; border-radius: 8px;
  padding: 8px 16px;
  font-family: inherit; font-weight: 600; font-size: 13px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.code-regen {
  background: linear-gradient(135deg, #7048e8 0%, #5f3dc4 100%);
  color: white;
  box-shadow: 0 3px 10px rgba(112, 72, 232, 0.22);
}
.code-regen--flip {
  background: linear-gradient(135deg, #0ca678 0%, #087f5b 100%);
  box-shadow: 0 3px 10px rgba(12, 166, 120, 0.22);
}
.code-regen:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(112, 72, 232, 0.30);
}
.code-regen--flip:hover:not(:disabled) {
  box-shadow: 0 6px 16px rgba(12, 166, 120, 0.30);
}
.code-reset {
  background: transparent; color: var(--bcd-fg-text-2, #495057);
  border: 1px dashed rgba(73, 80, 87, 0.45);
  font-weight: 500;
}
.code-reset:hover:not(:disabled) {
  background: rgba(73, 80, 87, 0.06);
}
.code-regen-status {
  margin-top: 10px;
  font-size: 13px; font-style: italic;
  color: var(--bcd-fg-text-2, #495057);
}
.code-regen-status--loading { color: var(--bcd-fg-blue, #1c7ed6); }
.code-regen-status--success { color: var(--bcd-fg-green, #2b8a3e); }
.code-regen-status--error   { color: var(--bcd-fg-red, #c92a2a); font-style: normal; font-weight: 600; }

/* Output panel for the flipped TYPE_CODE challenge — lighter than the
   green run-output panel because nothing has been executed yet. */
.code-ref--output {
  background: var(--bcd-bg-warm, #fff8e1);
  border-left: 4px solid #f59f00;
  color: var(--bcd-fg-amber, #5c3c00);
}
.code-hint-line {
  margin: 8px 0 0;
  font-size: 13px; color: var(--bcd-fg-text-2, #495057);
}

.code-output {
  margin-top: 14px; padding: 14px 16px;
  font-family: 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.55;
  background: #052e16; color: #bbf7d0;
  border-left: 4px solid #22c55e;
  border-radius: 6px;
  white-space: pre-wrap; word-break: break-word;
  max-height: 320px; overflow-y: auto;
}
.code-output.is-error {
  background: #450a0a; color: #fecaca;
  border-left-color: #ef4444;
}
.code-output.is-loading {
  background: #1e293b; color: #cbd5e1; border-left-color: #64748b;
  font-style: italic;
  /* An indeterminate sweep along the top edge. A grading run is usually quick
     and there is no fraction to report, so this says "working" and claims
     nothing more. position/overflow are set here rather than on .code-output
     so a box that is NOT loading keeps exactly the geometry it had. */
  position: relative; overflow: hidden;
}
.code-output.is-loading::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #FF6B35, transparent);
  animation: codeOutSweep 1.2s ease-in-out infinite;
}
@keyframes codeOutSweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  /* Not merely stopped mid-sweep: parked as a static rule so the box still
     reads as busy without moving. */
  .code-output.is-loading::before {
    animation: none; background: #FF6B35; opacity: 0.55;
  }
}

.code-feedback {
  margin-top: 14px; padding: 14px 16px;
  background: var(--bcd-bg-surface, white);
  border-left: 4px solid var(--bcd-bd-navy, #003D7C);
  border-radius: 6px; font-size: 14px; line-height: 1.6;
}
.code-feedback.is-correct { border-left-color: #2ea36b; background: rgba(46,163,107,0.06); }
/* v5.8: offline (no-LLM) build hides every AI-only control. */
body.no-llm .code-regen,
body.no-llm .code-actions--regen,
body.no-llm [onclick*="askParsonsHint"] { display: none !important; }
.predict-your-guess { margin-top: 8px; font-size: 14px; color: var(--bcd-fg-text-2, #4a5568); }
.code-feedback.is-incorrect { border-left-color: #c94f4f; background: rgba(201,79,79,0.06); }
.code-feedback strong { color: var(--bcd-fg-navy, #003D7C); }

.code-hints {
  margin-top: 12px; padding: 12px 16px;
  background: rgba(224, 49, 49, 0.06);
  border-left: 3px solid #e03131;
  border-radius: 6px;
}
.code-hints-label {
  font-size: 12px; font-weight: 700; color: var(--bcd-fg-red, #c92a2a);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.code-hints-list { margin: 0; padding-left: 20px; font-size: 14px; color: var(--bcd-fg-text, #2c3e50); }
.code-hint { margin: 4px 0; }
.code-hint--correct { font-weight: 600; color: var(--bcd-fg-text, #1a202c); }

/* ── v5.3 worked example w/ fading ───────────────────────────── */
.code-header--worked  { background: linear-gradient(135deg, #ffa8a8 0%, #fa5252 100%); color: white; }
.code-header--primm   { background: linear-gradient(135deg, #9775fa 0%, #5f3dc4 100%); color: white; }
.code-header--parsons { background: linear-gradient(135deg, #74c0fc 0%, #1971c2 100%); color: white; }

.worked-card .worked-progress,
.primm-card .primm-progress {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 10px 0 16px;
}
.worked-pip, .primm-pip {
  font-size: 12px; font-weight: 700; letter-spacing: 0.4px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(var(--bcd-navy-rgb, 0,61,124),0.06);
  color: var(--bcd-fg-text-2, #6b7280); border: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.12);
  text-transform: uppercase;
  cursor: not-allowed; user-select: none;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.primm-pip.is-reached:not(.is-done):not(.is-active) {
  background: rgba(95, 61, 196, 0.08);
  color: var(--bcd-fg-purple, #5f3dc4); border-color: rgba(95, 61, 196, 0.30);
}
.worked-pip.is-done, .primm-pip.is-done {
  background: rgba(46, 163, 107, 0.12); color: var(--bcd-fg-green, #1a7845);
  border-color: rgba(46, 163, 107, 0.35);
}
.worked-pip.is-done::before, .primm-pip.is-done::before {
  content: "✓ "; font-weight: 800;
}
.worked-pip.is-active, .primm-pip.is-active {
  background: linear-gradient(135deg, #003D7C 0%, #0052a3 100%);
  color: white; border-color: transparent;
  box-shadow: 0 3px 8px rgba(0, 61, 124, 0.22);
}
.primm-pip.is-reached, .primm-pip.is-done, .primm-pip.is-active {
  cursor: pointer;
}
.primm-pip.is-reached:hover:not(.is-active),
.primm-pip.is-done:hover:not(.is-active) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.primm-pip:focus-visible {
  outline: 2px solid #5f3dc4; outline-offset: 2px;
}

.worked-problem {
  font-size: 14.5px; line-height: 1.55; color: var(--bcd-fg-text, #1a202c);
  background: rgba(250, 82, 82, 0.06);
  border-left: 3px solid #fa5252;
  padding: 10px 14px; border-radius: 6px;
  margin: 12px 0 14px;
}
.worked-stage {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed rgba(var(--bcd-navy-rgb, 0,61,124),0.18);
}
.worked-stage[hidden] { display: none; }
.worked-stage-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: #fa5252;
  margin-bottom: 8px;
}
.worked-narration-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--bcd-fg-text-2, #718096);
  margin: 14px 0 6px;
}
.worked-narration {
  margin: 0 0 6px 20px; padding: 0;
  font-size: 14px; line-height: 1.6; color: var(--bcd-fg-text, #2c3e50);
}
.worked-narration li { margin: 4px 0; }
.worked-indep-prompt {
  font-size: 14.5px; line-height: 1.55; color: var(--bcd-fg-text, #1a202c);
  background: rgba(250, 82, 82, 0.06);
  border-left: 3px solid #fa5252;
  padding: 10px 14px; border-radius: 6px;
  margin: 10px 0 12px;
}

/* ── v5.3 PRIMM ──────────────────────────────────────────────── */
.primm-phase {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed rgba(95, 61, 196, 0.25);
}
.primm-phase[hidden] { display: none; }
.primm-phase-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--bcd-fg-purple, #5f3dc4);
  margin-bottom: 8px;
}
.primm-question {
  font-size: 14.5px; line-height: 1.55; color: var(--bcd-fg-text, #1a202c);
  background: rgba(95, 61, 196, 0.07);
  border-left: 3px solid #5f3dc4;
  padding: 10px 14px; border-radius: 6px;
  margin: 10px 0 12px;
}
.primm-continue {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px dashed rgba(95, 61, 196, 0.25);
  display: flex; justify-content: flex-end;
}
.primm-continue[hidden] { display: none; }
.primm-continue-btn {
  background: linear-gradient(135deg, #9775fa 0%, #5f3dc4 100%) !important;
  font-weight: 700;
}

/* ── v5.3 Parsons problem ────────────────────────────────────── */
.parsons-prompt {
  font-size: 14.5px; line-height: 1.55; color: var(--bcd-fg-text, #1a202c);
  background: rgba(25, 113, 194, 0.06);
  border-left: 3px solid #1971c2;
  padding: 10px 14px; border-radius: 6px;
  margin: 10px 0 14px;
}
.parsons-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 12px 0 14px;
}
@media (max-width: 720px) {
  .parsons-columns { grid-template-columns: 1fr; }
}
.parsons-column {
  min-width: 0;
}
.parsons-column-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--bcd-fg-blue, #1971c2);
  margin-bottom: 6px;
}
.parsons-bank, .parsons-solution {
  list-style: none;
  margin: 0; padding: 8px;
  min-height: 140px;
  background: var(--bcd-bg-tint, #f8fafc);
  border: 2px dashed rgba(25, 113, 194, 0.35);
  border-radius: 8px;
  overflow: hidden;
  box-sizing: border-box;
}
.parsons-solution {
  background: var(--bcd-bg-tint, #eff6ff);
  border-style: solid;
}
.parsons-bank.is-drag-over, .parsons-solution.is-drag-over {
  background: rgba(25, 113, 194, 0.10);
  border-color: #1971c2;
}
.parsons-line {
  display: flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.5;
  background: var(--bcd-bg-surface, #ffffff);
  border: 1px solid rgba(25, 113, 194, 0.28);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 6px 0;
  cursor: grab;
  user-select: none;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}
.parsons-line:hover {
  background: var(--bcd-bg-tint, #f0f9ff);
  box-shadow: 0 3px 8px rgba(25, 113, 194, 0.15);
}
.parsons-line.is-dragging {
  opacity: 0.4; cursor: grabbing;
}
.parsons-line code {
  font-family: inherit; background: none; padding: 0;
  color: var(--bcd-fg-text, #1a202c);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
  flex: 1 1 auto;
}
.parsons-grip {
  color: var(--bcd-fg-text-3, #94a3b8); font-size: 14px; flex-shrink: 0;
}
.parsons-line.is-correct {
  background: rgba(46, 163, 107, 0.12);
  border-color: #2ea36b;
}
.parsons-line.is-incorrect {
  background: rgba(201, 79, 79, 0.10);
  border-color: #c94f4f;
}
.parsons-empty-hint {
  color: var(--bcd-fg-text-3, #94a3b8); font-style: italic; font-size: 13px;
  padding: 12px; text-align: center;
  border: none; background: transparent; cursor: default;
}

/* ── v4.1 results page ───────────────────────────────────────── */
.results-header { background: linear-gradient(135deg, #003D7C 0%, #2ea36b 100%); }
.results-pending {
  font-size: 14px; color: var(--bcd-fg-text-3, #888); font-style: italic;
}
.results-headline {
  font-size: 18px; color: var(--bcd-fg-navy, #003D7C); line-height: 1.55; margin-bottom: 10px;
}
.results-headline strong { color: #2ea36b; font-size: 22px; }
.results-delta-line { font-size: 15px; margin-bottom: 12px; }
.results-delta-up { color: #2ea36b; font-weight: 700; }
.results-delta-down { color: var(--bcd-fg-red, #c94f4f); font-weight: 700; }
.results-delta-flat { color: var(--bcd-fg-text-3, #888); font-weight: 600; }

.result-item {
  padding: 14px 0;
  border-bottom: 1px dashed rgba(var(--bcd-navy-rgb, 0,61,124),0.15);
}
.result-item:last-child { border-bottom: 0; }
.result-item-stem {
  font-size: 15px; font-weight: 600; color: var(--bcd-fg-navy, #003D7C);
  margin-bottom: 8px; line-height: 1.45;
}
.result-item-row {
  font-size: 14px; line-height: 1.55; margin: 4px 0; color: var(--bcd-fg-text, #333);
}
.result-label {
  display: inline-block; min-width: 160px;
  font-weight: 600; color: var(--bcd-fg-text-2, #555);
}
.result-mark {
  display: inline-block; width: 22px; text-align: center;
  font-weight: 700;
}
.result-mark.correct { color: #2ea36b; }
.result-mark.incorrect { color: var(--bcd-fg-red, #c94f4f); }
.result-mark.missing { color: var(--bcd-fg-text-3, #aaa); }
.result-text { color: var(--bcd-fg-text, #222); }
.result-correct-row {
  background: rgba(46,163,107,0.08);
  border-left: 3px solid #2ea36b;
  padding: 6px 10px; border-radius: 4px; margin-top: 6px;
}

.conf-result-item {
  padding: 12px 0;
  border-bottom: 1px dashed rgba(var(--bcd-navy-rgb, 0,61,124),0.15);
}
.conf-result-item:last-child { border-bottom: 0; }
.conf-result-statement {
  font-size: 15px; font-weight: 600; color: var(--bcd-fg-navy, #003D7C);
  margin-bottom: 8px;
}
.conf-result-row {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.conf-pill {
  background: rgba(var(--bcd-navy-rgb, 0,61,124),0.08);
  color: var(--bcd-fg-navy, #003D7C); font-weight: 600; font-size: 13px;
  padding: 4px 12px; border-radius: 14px;
}
.conf-delta-up { color: #2ea36b; font-weight: 700; font-size: 14px; }
.conf-delta-down { color: var(--bcd-fg-red, #c94f4f); font-weight: 700; font-size: 14px; }
.conf-delta-flat { color: var(--bcd-fg-text-3, #888); font-weight: 600; font-size: 13px; }

/* ── Pagination controls ──────────────────────────────────────── */
.page-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.10);
}
.page-nav-btn {
  background: linear-gradient(135deg, #003D7C 0%, #0052a3 100%);
  color: white; border: 0;
  padding: 14px 28px; border-radius: 10px;
  font-family: inherit;
  font-weight: 600; font-size: 15px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 4px 14px rgba(0,61,124,0.20);
}
.page-nav-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,61,124,0.28);
}
.page-nav-btn:disabled {
  opacity: 0.35; cursor: not-allowed;
  background: #94a3b8;
  box-shadow: none;
}
.page-nav-btn.next {
  background: linear-gradient(135deg, #FF6B35 0%, #ff8555 100%);
  box-shadow: 0 4px 14px rgba(255,107,53,0.25);
}
.page-nav-btn.next:hover:not(:disabled) {
  box-shadow: 0 8px 22px rgba(255,107,53,0.35);
}
.page-nav-indicator {
  font-size: 14px; font-weight: 600; color: var(--bcd-fg-text-2, #5a6c7d);
}
.page-nav-indicator strong { color: var(--bcd-fg-navy, #003D7C); }

@media (max-width: 1180px) {
  /* v6.0: keep the scratchpad docked side-by-side down to 1024px by
     slimming the rails; the lesson column stays comfortably readable.
     The floating bottom-sheet only takes over below 1024 (next query). */
  .module-grid {
    grid-template-columns: 210px minmax(0, 1fr) 320px;
    gap: 24px;
    padding: 20px 28px 60px;
  }
  .module-content { padding: 32px 36px; }
  .module-hero { padding: 40px 36px 24px; }
  .top-banner { padding: 20px 36px; }
  .nav-bar-content { padding: 0 36px; }
}
@media (max-width: 1024px) {
  .module-grid,
  .module-grid.no-scratchpad {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 20px 24px 60px;
  }
  /* v6.0: below 1024 the scratchpad leaves the column flow and becomes a
     bottom sheet opened by the floating button; off-screen until opened. */
  .scratchpad-panel {
    position: fixed;
    left: 0; right: 0; bottom: 0; top: auto;
    width: auto; max-width: none; margin: 0;
    max-height: 85dvh;
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.32s cubic-bezier(.4,0,.2,1), visibility 0.32s;
    z-index: 1180;
  }
  .scratchpad-panel.floating-open { transform: translateY(0); visibility: visible; }
  .scratchpad-editor { min-height: 150px; max-height: 30dvh; }
  .scratch-fab { display: inline-flex !important; }
  /* v5.9: the section nav becomes a left slide-in drawer behind the
     hamburger in the sticky mobile top bar. */
  .subnav {
    position: fixed;
    top: 0; left: 0;
    width: min(82vw, 320px);
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    padding-top: 56px;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(.4,0,.2,1), visibility 0.3s;
    z-index: 1200;
    overflow-y: auto;
  }
  .subnav.open { transform: translateX(0); visibility: visible; box-shadow: 0 10px 40px rgba(0,0,0,0.28); }
  .mobile-topbar { display: flex !important; }
  .module-content { padding: 32px 28px; }
  .module-hero { padding: 32px 24px 16px; }
  .module-hero h1 { font-size: 32px; }
  .top-banner { padding: 16px 24px; }
  /* v6.1: keep every banner control (incl. the Settings gear) reachable on
     narrow screens — wrap instead of overflowing off the right edge. */
  .top-banner-content { flex-wrap: wrap; gap: 12px; }
  .nav-bar-content { padding: 0 16px; }
  .nav-links { overflow-x: auto; gap: 8px; }
  .nav-links > li > a { font-size: 12px; padding: 18px 8px; }
  .section-title { font-size: 26px; }
  .subsection-title { font-size: 22px; }
}
@media (max-width: 640px) {
  .module-hero h1 { font-size: 26px; }
  .module-hero .subtitle { font-size: 16px; }
  .module-content { padding: 24px 20px; }
  .section-title { font-size: 22px; }
  .subsection-title { font-size: 19px; }
  .page-nav { flex-wrap: wrap; }
  .page-nav-btn { padding: 12px 20px; font-size: 14px; }
}

/* ── v5.9: responsive chrome — hamburger drawer + floating scratchpad ── */
/* Sticky bar with the hamburger; only shown <=1024 (see media query). */
.mobile-topbar {
  display: none;
  position: sticky; top: 0;
  z-index: 1050;
  align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--bcd-bg-surface, rgba(255,255,255,0.92));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.10);
}
.hamburger-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex-shrink: 0;
  background: var(--bcd-bg-surface, #fff); border: 1.5px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.18);
  border-radius: 10px; color: var(--bcd-fg-navy, #003D7C); font-size: 20px; line-height: 1;
  cursor: pointer; transition: all 0.2s;
}
.hamburger-btn:hover { border-color: #FF6B35; color: #FF6B35; }
.mobile-topbar-title {
  font-size: 14px; font-weight: 700; color: var(--bcd-fg-navy, #003D7C);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Shared dim backdrop behind the open drawer / sheet. */
.overlay-backdrop {
  position: fixed; inset: 0;
  background: rgba(var(--bcd-navy-rgb, 0,61,124),0.45);
  z-index: 1090; border: 0; cursor: pointer;
  opacity: 0; transition: opacity 0.28s;
}
.overlay-backdrop.show { opacity: 1; }
.overlay-backdrop[hidden] { display: none; }
/* Floating action button — draggable, opens the scratchpad sheet. */
.scratch-fab {
  display: none;            /* shown at <=1024 via the media query above */
  position: fixed; right: 20px; bottom: 20px;
  align-items: center; gap: 8px;
  padding: 13px 18px;
  background: linear-gradient(135deg, #003D7C, #00529b);
  color: #fff; border: 0; border-radius: 999px;
  font-family: inherit; font-size: 14px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,61,124,0.40);
  cursor: grab; z-index: 1060; touch-action: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.scratch-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(0,61,124,0.50); }
.scratch-fab.dragging { cursor: grabbing; transition: none; opacity: 0.92; }
.scratch-fab.dragging:hover { transform: none; }
.scratch-fab.is-hidden { display: none !important; }
.scratch-fab-ico { font-size: 16px; font-weight: 800; letter-spacing: -1px; }
/* Close button shown only when the scratchpad is a floating sheet. */
.scratch-sheet-close {
  display: none;
  background: var(--bcd-bg-surface, #fff); border: 1.5px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.18);
  border-radius: 8px; width: 34px; height: 34px;
  color: var(--bcd-fg-navy, #003D7C); font-size: 18px; cursor: pointer; flex-shrink: 0;
}
.scratch-sheet-close:hover { border-color: #FF6B35; color: #FF6B35; }
.scratchpad-panel.floating-open .scratch-sheet-close { display: inline-flex; align-items: center; justify-content: center; }
.scratchpad-panel.floating-open { box-shadow: 0 -10px 40px rgba(0,61,124,0.25); }
body.no-scroll { overflow: hidden; }

/* ── v6.1: Settings gear + popover (core-owned so it exists on every lesson,
   GIF lessons included). The GIF injector appends its toggle into #gpPopItems. ── */
.gp-gear-wrap { position: relative; margin-left: auto; display: inline-flex; align-items: center; }
.gp-gear { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; background: var(--bcd-bg-surface, #fff);
  border: 1px solid var(--bcd-bd-line, #e2e8f0); border-radius: 8px; padding: 7px 12px; color: var(--bcd-fg-text-2, #5a6c7d);
  font: 600 12px 'Inter', sans-serif; transition: all .2s ease; }
.gp-gear:hover { color: #FF6B35; border-color: #FF6B35; background: var(--bcd-bg-warm, #fff7f3); }
.gp-gear.open { color: var(--bcd-fg-navy, #003D7C); border-color: var(--bcd-bd-line, #cdd7e5); background: var(--bcd-bg-tint, #f8fafc); }
.gp-gear svg { width: 15px; height: 15px; display: block; }
.gp-pop { position: absolute; top: calc(100% + 10px); right: 0; width: 300px; background: var(--bcd-bg-surface, #fff);
  border: 1px solid var(--bcd-bd-line, #e2e8f0); border-radius: 14px; box-shadow: 0 16px 40px rgba(0,61,124,.18);
  padding: 6px; z-index: 1102; }
.gp-pop[hidden] { display: none; }
.gp-pop h4 { font: 700 11px 'Inter', sans-serif; letter-spacing: .6px; text-transform: uppercase;
  color: var(--bcd-fg-text-3, #9aa6b6); padding: 12px 12px 8px; margin: 0; }
.gp-pop-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; }
.gp-pop-item:hover { background: var(--bcd-bg-tint, #f8fafc); }
.gp-pop-item[hidden] { display: none; }
.gp-pop-txt { flex: 1; }
.gp-pop-txt b { font: 600 14px 'Inter', sans-serif; color: var(--bcd-fg-navy, #003D7C); display: block; }
.gp-pop-txt small { color: var(--bcd-fg-text-2, #5a6c7d); font-size: 11.5px; line-height: 1.4; display: block; margin-top: 2px; }
.gp-pop-note { border-top: 1px solid var(--bcd-bd-line, #eef2f7); color: var(--bcd-fg-text-3, #9aa6b6); font-size: 11px; padding: 9px 12px 7px; }
.gp-switch { position: relative; width: 46px; height: 26px; flex: 0 0 auto; }
.gp-switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.gp-slider { position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; transition: .2s; pointer-events: none; }
.gp-slider:before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  background: var(--bcd-bg-surface, #fff); border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.gp-switch input:checked + .gp-slider { background: #FF6B35; }
.gp-switch input:checked + .gp-slider:before { transform: translateX(20px); }
/* View segmented control */
.vm-seg { display: flex; gap: 4px; padding: 8px 12px 4px; }
.vm-seg-btn { flex: 1; cursor: pointer; border: 1px solid var(--bcd-bd-line, #e2e8f0); background: var(--bcd-bg-surface, #fff); border-radius: 8px;
  padding: 8px 4px; color: var(--bcd-fg-text-2, #5a6c7d); font: 600 11px 'Inter', sans-serif; display: flex;
  flex-direction: column; align-items: center; gap: 4px; transition: all .15s ease; }
.vm-seg-btn svg { width: 18px; height: 18px; display: block; }
.vm-seg-btn:hover { border-color: var(--bcd-bd-line, #cdd7e5); color: var(--bcd-fg-navy, #003D7C); background: var(--bcd-bg-tint, #f8fafc); }
.vm-seg-btn[aria-pressed="true"] { border-color: #FF6B35; color: var(--bcd-fg-navy, #003D7C); background: var(--bcd-bg-warm, #fff7f3);
  box-shadow: 0 2px 8px rgba(255,107,53,.15); }
@media (max-width: 640px) { .gp-gear .gp-gear-label { display: none; } }

/* ── v6.1: manual View overrides. data-vm on <html> beats the auto media
   queries via attribute specificity; 'auto' sets no attribute (queries rule). ── */
/* COMPUTER — force the 3-column desktop layout */
html[data-vm="desktop"] .module-grid { grid-template-columns: 240px minmax(0, 1fr) 360px; padding: 20px 48px 80px; }
html[data-vm="desktop"] .module-grid.no-scratchpad { grid-template-columns: 240px minmax(0, 1fr); }
html[data-vm="desktop"] .module-content { padding: 40px 52px; }
html[data-vm="desktop"] .scratchpad-panel { position: sticky; top: 90px; left: auto; right: auto; bottom: auto;
  width: auto; max-width: none; margin: 0; max-height: calc(100vh - 110px); border-radius: 16px;
  transform: none; visibility: visible; z-index: auto; }
html[data-vm="desktop"] .subnav { position: sticky; top: 90px; left: auto; width: auto; height: auto;
  max-height: calc(100vh - 110px); border-radius: 16px; padding: 22px 16px; transform: none;
  visibility: visible; box-shadow: 0 8px 32px rgba(0,61,124,0.10); }
html[data-vm="desktop"] .mobile-topbar { display: none !important; }
html[data-vm="desktop"] .scratch-fab { display: none !important; }

/* TABLET — force 2 columns (nav + content), scratchpad as the floating sheet */
html[data-vm="tablet"] .module-grid,
html[data-vm="tablet"] .module-grid.no-scratchpad { grid-template-columns: 220px minmax(0, 1fr); padding: 20px 32px 60px; }
html[data-vm="tablet"] .module-content { padding: 32px 40px; }
html[data-vm="tablet"] .subnav { position: sticky; top: 90px; left: auto; width: auto; height: auto;
  max-height: calc(100vh - 110px); border-radius: 16px; padding: 22px 16px; transform: none;
  visibility: visible; box-shadow: 0 8px 32px rgba(0,61,124,0.10); }
html[data-vm="tablet"] .mobile-topbar { display: none !important; }
html[data-vm="tablet"] .scratchpad-panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto;
  width: auto; max-width: none; margin: 0; max-height: 85dvh; border-radius: 18px 18px 0 0;
  transform: translateY(100%); visibility: hidden;
  transition: transform 0.32s cubic-bezier(.4,0,.2,1), visibility 0.32s; z-index: 1180; }
html[data-vm="tablet"] .scratchpad-panel.floating-open { transform: translateY(0); visibility: visible; }
html[data-vm="tablet"] .scratchpad-editor { min-height: 150px; max-height: 30dvh; }
html[data-vm="tablet"] .scratch-fab:not(.is-hidden) { display: inline-flex !important; }

/* PHONE — force single column + hamburger drawer + floating sheet */
html[data-vm="phone"] .module-grid,
html[data-vm="phone"] .module-grid.no-scratchpad { grid-template-columns: minmax(0, 1fr); padding: 20px 24px 60px; }
html[data-vm="phone"] .module-content { padding: 24px 20px; }
html[data-vm="phone"] .subnav { position: fixed; top: 0; left: 0; width: min(82vw, 320px); height: 100dvh;
  max-height: none; border-radius: 0; padding-top: 56px; transform: translateX(-100%); visibility: hidden;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1), visibility 0.3s; z-index: 1200; overflow-y: auto; }
html[data-vm="phone"] .subnav.open { transform: translateX(0); visibility: visible; box-shadow: 0 10px 40px rgba(0,0,0,0.28); }
html[data-vm="phone"] .mobile-topbar { display: flex !important; }
html[data-vm="phone"] .scratchpad-panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto;
  width: auto; max-width: none; margin: 0; max-height: 85dvh; border-radius: 18px 18px 0 0;
  transform: translateY(100%); visibility: hidden;
  transition: transform 0.32s cubic-bezier(.4,0,.2,1), visibility 0.32s; z-index: 1180; }
html[data-vm="phone"] .scratchpad-panel.floating-open { transform: translateY(0); visibility: visible; }
html[data-vm="phone"] .scratchpad-editor { min-height: 150px; max-height: 30dvh; }
html[data-vm="phone"] .scratch-fab:not(.is-hidden) { display: inline-flex !important; }
@media (max-width: 640px) {
  .scratch-fab { right: 14px; bottom: 14px; padding: 12px; }
  .scratch-fab .scratch-fab-label { display: none; }
}

/* ── v4.4: content rewrite shimmer ── */
.rewrite-shimmer {
  position: relative;
  pointer-events: none;
}
.rewrite-shimmer::before {
  content: 'Personalising content for you…';
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 10px 16px;
  background: linear-gradient(90deg, var(--bcd-bg-tint, #e8eef5) 25%, var(--bcd-bg-tint, #f0f4fa) 50%, var(--bcd-bg-tint, #e8eef5) 75%);
  background-size: 200% 100%;
  animation: shimmerSlide 1.5s ease-in-out infinite;
  color: var(--bcd-fg-navy, #003D7C);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 6px;
  z-index: 5;
  text-align: center;
}
.rewrite-shimmer > * { opacity: 0.35; transition: opacity 0.3s; }
@keyframes shimmerSlide { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

.page-body.rewrite-done { animation: fadeInContent 0.4s ease; }
@keyframes fadeInContent { from{opacity:0.5} to{opacity:1} }

/* ── v5.0: skip-to-content link ──────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: #003D7C;
  color: #fff;
  padding: 12px 24px;
  border-radius: 0 0 8px 8px;
  z-index: 10000;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* ── v5.0: screen-reader only utility ────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── v5.0: focus-visible ring for keyboard navigation ────────── */
a:focus-visible,
button:focus-visible,
.mcq-option:focus-visible,
.subnav-item:focus-visible,
.confidence-btn:focus-visible,
.nps-btn:focus-visible,
.rating-star:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #FF6B35;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── v5.0: MCQ checkmark on selected option ──────────────────── */
.mcq-checkmark {
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(var(--bcd-navy-rgb, 0,61,124),0.15);
  font-size: 14px;
  font-weight: 800;
  color: var(--bcd-fg-navy, #003D7C);
  flex-shrink: 0;
}
.mcq-option.selected .mcq-checkmark {
  display: flex;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* ── v5.0: helper text below page navigation ─────────────────── */
.page-nav-helper {
  text-align: center;
  font-size: 13px;
  color: var(--bcd-fg-text-3, #94a3b8);
  margin-top: 10px;
  min-height: 20px;
  font-weight: 500;
  transition: opacity 0.2s;
}

/* ── v5.0: time remaining indicator ──────────────────────────── */
.time-remaining-bar {
  text-align: center;
  font-size: 12px;
  color: var(--bcd-fg-text-3, #94a3b8);
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 8px 0 4px;
}

/* ── v5.0: mobile close button in nav ────────────────────────── */
.mobile-close-btn {
  display: none;
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: 2px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.15);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  color: var(--bcd-fg-navy, #003D7C);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 1002;
  transition: all 0.2s;
}
.mobile-close-btn:hover {
  background: var(--bcd-bg-tint, #f1f5f9);
  border-color: #FF6B35;
  color: #FF6B35;
}
@media (max-width: 1024px) {
  .mobile-close-btn { display: flex; }
}

/* ── v5.0: results context paragraph ─────────────────────────── */
.results-context {
  margin-top: 16px;
  font-size: 14px;
  color: var(--bcd-fg-text-2, #555);
  line-height: 1.6;
  background: rgba(46, 163, 107, 0.06);
  border-left: 3px solid #2ea36b;
  padding: 12px 16px;
  border-radius: 6px;
}

/* ── v5.1: Canvas integration — completed-page tick on subnav ── */
.subnav-item.canvas-done::after {
  content: ' ✓';
  color: #2ea36b;
  font-weight: 700;
  margin-left: 4px;
}
#bridgingResumeBanner button:focus-visible {
  outline: 2px solid #FF6B35;
  outline-offset: 2px;
}

/* ── Local-storage notice toast (first visit + reset entry point) ── */
.storage-notice {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 2000;
  max-width: 360px;
  background: var(--bcd-bg-surface, #ffffff);
  border: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.14);
  border-left: 4px solid #FF6B35;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,61,124,0.18);
  padding: 18px 20px 16px;
  font-size: 13.5px; line-height: 1.55;
  color: var(--bcd-fg-text, #2c3e50);
  animation: storageNoticeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes storageNoticeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.storage-notice-out {
  animation: storageNoticeOut 0.25s ease forwards;
}
@keyframes storageNoticeOut {
  to { opacity: 0; transform: translateY(20px); }
}
.storage-notice-title {
  font-size: 13px; font-weight: 700; color: var(--bcd-fg-navy, #003D7C);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.storage-notice-title::before {
  content: "💾"; font-size: 16px;
}
.storage-notice-body {
  color: var(--bcd-fg-text-2, #475569); font-size: 13px; line-height: 1.55;
  margin-bottom: 14px;
}
.storage-notice-actions {
  display: flex; gap: 8px; align-items: center;
}
.storage-notice-btn {
  font-family: inherit;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.2px;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.storage-notice-btn.primary {
  background: #003D7C;
  color: #fff;
  border: 1px solid var(--bcd-bd-navy, #003D7C);
}
.storage-notice-btn.primary:hover {
  background: #002a56;
  border-color: #002a56;
}
.storage-notice-btn.secondary {
  background: var(--bcd-bg-surface, #fff);
  color: #FF6B35;
  border: 1px solid #FF6B35;
}
.storage-notice-btn.secondary:hover {
  background: var(--bcd-bg-warm, #fff7f3);
}
@media (max-width: 640px) {
  .storage-notice {
    left: 16px; right: 16px; bottom: 16px;
    max-width: none;
  }
}

/* Confirm dialog used for the destructive reset action */
.storage-confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,30,60,0.55);
  z-index: 2100;
  display: flex; align-items: center; justify-content: center;
  animation: storageNoticeIn 0.2s ease;
}
.storage-confirm-box {
  background: var(--bcd-bg-surface, #fff);
  border-radius: 14px;
  padding: 28px 30px 22px;
  max-width: 420px; width: calc(100% - 40px);
  box-shadow: 0 24px 60px rgba(0,30,60,0.35);
}
.storage-confirm-title {
  font-size: 18px; font-weight: 800; color: var(--bcd-fg-navy, #003D7C);
  margin-bottom: 10px;
}
.storage-confirm-body {
  font-size: 14px; color: var(--bcd-fg-text-2, #475569); line-height: 1.6;
  margin-bottom: 20px;
}
.storage-confirm-body ul {
  margin: 8px 0 0 18px; padding: 0; color: var(--bcd-fg-text-2, #475569);
}
.storage-confirm-actions {
  display: flex; gap: 10px; justify-content: flex-end;
}

/* --- site footer: support / contact line (matches dashboard footer) --- */
footer.site-foot {
  max-width: 1600px; margin: 0 auto;
  padding: 24px clamp(20px, 5vw, 48px) 44px;
  font-size: 12px; color: var(--bcd-fg-text-3, #94a3b8);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  border-top: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.06);
}
footer.site-foot .foot-contact { color: var(--bcd-fg-text-2, #5a6c7d); }
footer.site-foot .foot-contact strong { color: var(--bcd-fg-navy, #003D7C); font-weight: 600; }
footer.site-foot a.foot-mail {
  color: var(--bcd-fg-navy, #003D7C); font-weight: 600; text-decoration: none;
  border-bottom: 1px solid rgba(var(--bcd-navy-rgb, 0,61,124),0.25);
  transition: color 0.2s ease, border-color 0.2s ease;
}
footer.site-foot a.foot-mail:hover { color: #FF6B35; border-bottom-color: #FF6B35; }
footer.site-foot a.foot-mail:focus-visible { outline: 2px solid #FF6B35; outline-offset: 2px; }
/* On narrow screens the floating "</> Python" FAB (fixed, bottom-right) would
   overlap the contact line at the page bottom — give the footer room to clear it.
   Placed AFTER the base rule so it wins by source order (see build-docx-lock note). */
@media (max-width: 1024px) {
  footer.site-foot { padding-bottom: 92px; }
}
/* === BRIDGING CHAT WIDGET v1 (do not edit without updating all three course builders) === */
/* Tutor chat FAB — mirrors the .scratch-fab pill but sits above it on the
   left so the two floating buttons never overlap. NUS blue base, orange
   accent for the unread dot, matching the page's existing palette. */
.bchat-fab {
  position: fixed; right: 20px; bottom: 84px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 18px;
  background: linear-gradient(135deg, #003D7C, #00529b);
  color: #fff; border: 0; border-radius: 999px;
  font-family: inherit; font-size: 14px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,61,124,0.40);
  cursor: pointer; z-index: 1065;
  touch-action: none;
  transition: transform 0.15s, box-shadow 0.15s;
  animation: bchatBob 3.5s ease-in-out infinite;
}
.bchat-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(0,61,124,0.50); }
.bchat-fab[hidden] { display: none !important; }
/* Unread dot — orange, only shown when tutor replies arrive with panel closed */
.bchat-fab-dot {
  position: absolute; top: -3px; right: -3px;
  width: 13px; height: 13px; border-radius: 50%;
  background: #FF6B35; border: 2px solid #fff;
  display: none;
}
.bchat-fab.has-unread .bchat-fab-dot { display: block; }
/* v2 micro-animation + unread glow. The bob and the glow must be declared
   together (comma-separated) in the unread state — a second `animation`
   shorthand would silently cancel the first, so the FAB would stop bobbing. */
@keyframes bchatBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
@keyframes bchatGlow {
  0%, 100% { box-shadow: 0 10px 30px rgba(0,61,124,0.40), 0 0 0 0 rgba(255,107,53,0); }
  50%      { box-shadow: 0 10px 30px rgba(0,61,124,0.40), 0 0 18px 4px rgba(255,107,53,0.75); }
}
.bchat-fab.has-unread {
  animation: bchatBob 3.5s ease-in-out infinite, bchatGlow 1.6s ease-in-out infinite;
}
/* While dragging, stop all animation so no residual transform offsets the
   pointer-driven left/top. Placed after .has-unread so it wins on equal
   specificity. */
.bchat-fab.bchat-dragging { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .bchat-fab, .bchat-fab.has-unread { animation: none; }
  .bchat-fab.has-unread { box-shadow: 0 10px 30px rgba(0,61,124,0.40), 0 0 16px 3px rgba(255,107,53,0.65); }
}
@media (max-width: 640px) {
  .bchat-fab { right: 14px; bottom: 76px; }
}

/* Slide-up panel */
.bchat-panel {
  position: fixed; right: 20px; bottom: 84px;
  width: 360px; max-width: calc(100vw - 32px);
  height: 520px; max-height: calc(100vh - 120px);
  display: flex; flex-direction: column;
  background: var(--bcd-bg-surface, #fff); border: 1px solid var(--bcd-bd-line, #d6e4f0); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,61,124,0.30);
  z-index: 1070; overflow: hidden;
  opacity: 0; transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.bchat-panel.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.bchat-panel[hidden] { display: none !important; }
@media (max-width: 640px) {
  .bchat-panel {
    right: 8px; left: 8px; bottom: 8px; width: auto;
    max-width: none; height: auto; top: 8px; max-height: none;
  }
}
.bchat-head {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 16px;
  background: linear-gradient(135deg, #003D7C, #00529b);
  color: #fff; flex-shrink: 0;
}
.bchat-head-title { font-weight: 700; font-size: 14px; flex: 1; }
.bchat-head-title small { display: block; font-weight: 500; font-size: 11px; opacity: 0.85; margin-top: 1px; }
.bchat-close {
  background: rgba(255,255,255,0.15); border: 0; border-radius: 8px;
  width: 30px; height: 30px; color: #fff; font-size: 18px;
  cursor: pointer; flex-shrink: 0; line-height: 1;
}
.bchat-close:hover { background: rgba(255,255,255,0.30); }
.bchat-notice {
  padding: 9px 14px; font-size: 11.5px; line-height: 1.45;
  color: var(--bcd-fg-text-2, #5a6b7f); background: var(--bcd-bg-tint, #f1f6fb); border-bottom: 1px solid var(--bcd-bd-line, #e2ecf5);
  flex-shrink: 0;
}
.bchat-log {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bcd-bg-tint, #f8fafc);
}
.bchat-empty {
  color: var(--bcd-fg-text-3, #94a3b8); font-size: 13px; text-align: center;
  margin: auto; padding: 20px; line-height: 1.5;
}
.bchat-bubble {
  max-width: 82%; padding: 9px 13px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.5;
  white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
}
.bchat-bubble.student {
  align-self: flex-end;
  background: linear-gradient(135deg, #003D7C, #00529b); color: #fff;
  border-bottom-right-radius: 4px;
}
.bchat-bubble.tutor {
  align-self: flex-start;
  background: var(--bcd-bg-surface, #fff); color: var(--bcd-fg-text, #1e293b); border: 1px solid var(--bcd-bd-line, #e2ecf5);
  border-bottom-left-radius: 4px;
}
.bchat-bubble.pending { opacity: 0.6; }
.bchat-meta {
  font-size: 10px; color: var(--bcd-fg-text-3, #94a3b8); margin-top: 3px;
  padding: 0 4px;
}
.bchat-meta.student { align-self: flex-end; }
.bchat-meta.tutor { align-self: flex-start; }
.bchat-inputbar {
  display: flex; gap: 8px; padding: 10px;
  border-top: 1px solid var(--bcd-bd-line, #e2ecf5); background: var(--bcd-bg-surface, #fff); flex-shrink: 0;
}
.bchat-input {
  flex: 1; resize: none; font-family: inherit; font-size: 13.5px;
  padding: 9px 11px; border: 1.5px solid var(--bcd-bd-line, #d6e4f0); border-radius: 10px;
  max-height: 96px; line-height: 1.4; color: var(--bcd-fg-text, #1e293b);
}
.bchat-input:focus { outline: none; border-color: var(--bcd-bd-navy, #003D7C); }
.bchat-send {
  flex-shrink: 0; align-self: flex-end;
  background: linear-gradient(135deg, #003D7C, #00529b); color: #fff;
  border: 0; border-radius: 10px; padding: 9px 15px;
  font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
  transition: opacity 0.15s;
}
.bchat-send:hover { opacity: 0.92; }
.bchat-send:disabled { opacity: 0.5; cursor: not-allowed; }
.bchat-gate {
  margin: auto; padding: 24px 20px; text-align: center;
  color: var(--bcd-fg-text-2, #5a6b7f); font-size: 13px; line-height: 1.55;
}
/* === END BRIDGING CHAT WIDGET v1 === */

/* BRIDGING-LESSON-SKIN v1 */
/* Lesson skin (BRIDGING-LESSON-SKIN v1), 2026-09-24. Inserted after each lesson
   page's own stylesheet by lesson_skin/lesson_skin.py.

   The course page's design, carried onto the lessons: white ground, slate text,
   NUS navy for headings and buttons, the lessons' orange #FF6B35 for the ACTIVE
   item and the progress bars only, green for done. Buttons are navy (white on
   the old orange Next button was 2.8:1); small orange labels became slate text
   beside an orange dot; the orange TEXT used for key terms (hl-orange, 2.8:1)
   became a highlighter mark behind dark text.

   Two token sets:
     --bc-*   this skin's own design tokens, defined for light AND dark.
     --bcd-*  dark values for the builder's own colours. Defined ONLY in dark
              mode; tokenize_css() wrote every mapped literal in the builder's
              stylesheet as var(--bcd-..., <literal>), so in light mode the
              literal is what renders.
   Dark mode is set by the theme script as data-theme="dark" on <html>, from the
   student's choice (bc_theme_v1, shared with the course page) or the device.

   Specificity notes. The builder's rules come first, so a plain selector here
   wins at equal specificity. Its html[data-vm=...] rules (Settings > View) need
   matching html[data-vm] selectors. Blocks injected AFTER this sheet (GIF
   player, loading notices, status strip) are beaten with a :root prefix, and
   elements scripts build with inline styles (sign-in box, resume banner) need
   !important. Layout rules that differ by width live inside media queries so
   they never override the builder's narrow-screen layout by accident. */

:root{
  --bc-bg:#FFFFFF; --bc-surface:#FFFFFF; --bc-tint:#EEF2F7; --bc-hover:#F8FAFC; --bc-seg-on:#FFFFFF;
  --bc-line:#E2E8F0; --bc-line-soft:#EEF2F7; --bc-track:#E2E8F0; --bc-ring:#CDD7E5;
  --bc-text:#2C3E50; --bc-text-2:#5A6C7D; --bc-text-3:#5A6C7D;
  --bc-navy:#003D7C; --bc-primary:#003D7C; --bc-primary-2:#0052A3; --bc-on-primary:#FFFFFF;
  --bc-accent:#FF6B35; --bc-ok:#2EA36B; --bc-on-ok:#FFFFFF; --bc-focus:#003D7C;
  --bc-bar:linear-gradient(90deg,#003D7C 0%,#FF6B35 100%);
  --bc-card-shadow:0 1px 2px rgba(0,61,124,0.05),0 4px 16px rgba(0,61,124,0.05);
  --bc-panel-shadow:0 1px 2px rgba(0,61,124,0.06),0 12px 36px rgba(0,61,124,0.10);
  --bc-head-shadow:0 2px 20px rgba(0,61,124,0.06); --bc-btn-shadow:0 4px 14px rgba(0,61,124,0.18);
  --bc-pop-shadow:0 16px 48px rgba(0,30,70,0.16);
  --bc-code-bg:#F6F8FB; --bc-code-line:#E2E8F0; --bc-code-text:#1F2D3D;
  --bc-term-bg:#0F1B2D; --bc-term-text:#E7EDF5; --bc-term-dim:#A9B8CC;
  --bc-hl:rgba(255,107,53,0.20); --bc-red:#C62828; --bc-ok-text:#1D7A4E; --bc-bad-text:#C62828;
  --bc-warn-bg:#FFF6F1; --bc-warn-line:#FFD9C7; --bc-warn-ico:#C2410C;
  --bc-info-bg:#F2F6FB; --bc-note-line:#CFE0F5;
  --bc-backdrop:rgba(7,17,31,0.45);
  --bc-head-h:64px; --bc-bar-h:52px;
  /* one width for every row, so the logo, the title, the section bar and the
     lesson column share a left edge: 760 lesson + 44 gap + 340 scratchpad */
  --bc-wrap:1208px;
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bc-bg:#0B1220; --bc-surface:#101A2C; --bc-tint:#14233B; --bc-hover:#16233A; --bc-seg-on:#25365A;
  --bc-line:#26354F; --bc-line-soft:#1C2A42; --bc-track:#26364F; --bc-ring:#3E506D;
  --bc-text:#E7EDF5; --bc-text-2:#B4C1D3; --bc-text-3:#8C9CB2;
  --bc-navy:#A9CBF2; --bc-primary:#A9CBF2; --bc-primary-2:#C4DBF6; --bc-on-primary:#07111F;
  --bc-accent:#FF6B35; --bc-ok:#4CC285; --bc-on-ok:#07111F; --bc-focus:#A9CBF2;
  --bc-bar:linear-gradient(90deg,#A9CBF2 0%,#FF6B35 100%);
  --bc-card-shadow:none; --bc-panel-shadow:none; --bc-head-shadow:none; --bc-btn-shadow:none;
  --bc-pop-shadow:0 18px 48px rgba(0,0,0,0.45);
  --bc-code-bg:#0E1728; --bc-code-line:#26354F; --bc-code-text:#E7EDF5;
  --bc-term-bg:#070E1A; --bc-term-text:#E7EDF5; --bc-term-dim:#A9B8CC;
  --bc-hl:rgba(255,107,53,0.30); --bc-red:#FF8A80; --bc-ok-text:#6FD3A0; --bc-bad-text:#FF8A80;
  --bc-warn-bg:#231812; --bc-warn-line:#5A3422; --bc-warn-ico:#FF9A6B;
  --bc-info-bg:#122036; --bc-note-line:#2A4468;
  --bc-backdrop:rgba(0,0,0,0.55);
  /* the builder's own colours, remapped (see tokenize_css in lesson_skin.py) */
  --bcd-bg-surface:#101A2C; --bcd-bg-tint:#152238; --bcd-bg-warm:#241812;
  --bcd-navy-rgb:169,203,242;
  --bcd-fg-navy:#A9CBF2; --bcd-fg-text:#E7EDF5; --bcd-fg-text-2:#B4C1D3; --bcd-fg-text-3:#8C9CB2;
  --bcd-fg-red:#FF8A80; --bcd-fg-purple:#C8B6FF; --bcd-fg-blue:#8CC4FF; --bcd-fg-amber:#FFB36B;
  --bcd-fg-green:#6FD3A0; --bcd-fg-star-off:#3E506D;
  --bcd-bd-line:#26354F; --bcd-bd-navy:#A9CBF2;
}

/* ---------- base ---------- */
html{scroll-padding-top:calc(var(--bc-head-h) + var(--bc-bar-h) + 16px)}
body{background:var(--bc-bg);color:var(--bc-text);font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
  -webkit-font-smoothing:antialiased;line-height:1.65}
body::before{display:none}
.bc-ico{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
/* No programming ligatures anywhere code is shown: students must see >= and ==
   exactly as they type them, never as one glyph. */
code,kbd,pre,textarea,.code-ref,.code-editor,.scratchpad-editor,.scratchpad-output,.parsons-line,.xterm{
  font-variant-ligatures:none;font-feature-settings:"liga" 0,"calt" 0}
:focus-visible,a:focus-visible,button:focus-visible,.mcq-option:focus-visible,.subnav-item:focus-visible,
.confidence-btn:focus-visible,.nps-btn:focus-visible,.rating-star:focus-visible,[tabindex]:focus-visible{
  outline:2px solid var(--bc-focus);outline-offset:2px;border-radius:6px}
.skip-link{background:var(--bc-primary);color:var(--bc-on-primary)}
[hidden]{display:none!important}

/* ---------- header (the course page's) ---------- */
.top-banner{position:sticky;top:0;z-index:1001;background:var(--bc-bg);border-bottom:1px solid var(--bc-line);
  box-shadow:var(--bc-head-shadow);padding:0;backdrop-filter:none;-webkit-backdrop-filter:none}
.top-banner-content{max-width:var(--bc-wrap);margin:0 auto;padding:0 32px;height:var(--bc-head-h);display:flex;align-items:center;gap:20px;flex-wrap:nowrap}
.bc-brand{display:flex;align-items:center;gap:14px;flex:none;min-width:0;text-decoration:none}
.bc-brand .biochem-logo{height:34px;width:auto;display:block;transition:none}
.bc-brand .biochem-logo:hover{transform:none}
.bc-logo-dark{display:none!important}
:root[data-theme="dark"] .bc-logo-light{display:none!important}
:root[data-theme="dark"] .bc-logo-dark{display:block!important}
.bc-product{font-size:15px;font-weight:600;color:var(--bc-text);padding-left:14px;border-left:1px solid var(--bc-line);white-space:nowrap}
.bc-actions{margin-left:auto;display:flex;align-items:center;gap:8px}
.bc-quiet{display:inline-flex;align-items:center;gap:6px;font-size:14px;color:var(--bc-text-2);padding:8px 10px;border-radius:8px;text-decoration:none}
.bc-quiet:hover{background:var(--bc-hover);color:var(--bc-text)}
.bc-icon-btn{width:40px;height:40px;display:grid;place-items:center;border-radius:10px;border:1px solid var(--bc-line);
  background:transparent;color:var(--bc-text-2);cursor:pointer;flex:none;padding:0}
.bc-icon-btn:hover{background:var(--bc-hover);color:var(--bc-text)}
/* Settings: the builder's gear, shown as an icon button */
.gp-gear-wrap{margin-left:0}
.gp-gear{width:40px;height:40px;padding:0;justify-content:center;border-radius:10px;border:1px solid var(--bc-line);
  background:transparent;color:var(--bc-text-2)}
.gp-gear:hover,.gp-gear.open{color:var(--bc-text);border-color:var(--bc-line);background:var(--bc-hover)}
.gp-gear .gp-gear-label{display:none}
.gp-gear svg{width:17px;height:17px}
.gp-pop{background:var(--bc-surface);border-color:var(--bc-line);box-shadow:var(--bc-pop-shadow);z-index:1300}
.gp-pop h4,.gp-pop-note{color:var(--bc-text-2)}
.gp-pop-item:hover{background:var(--bc-hover)}
.gp-pop-txt b{color:var(--bc-text)} .gp-pop-txt small{color:var(--bc-text-2)}
.vm-seg-btn{background:var(--bc-surface);border-color:var(--bc-line);color:var(--bc-text-2)}
.vm-seg-btn:hover{border-color:var(--bc-ring);color:var(--bc-text);background:var(--bc-hover)}
.vm-seg-btn[aria-pressed="true"]{border-color:var(--bc-navy);color:var(--bc-text);background:var(--bc-tint);box-shadow:none}
.gp-switch input:checked + .gp-slider{background:var(--bc-primary)}
/* Account: initials button and a menu holding the name, Reset and Log out */
.auth-chip{position:relative;margin-left:0;padding:0;background:none;border:0;border-radius:0;gap:0}
.bc-avatar{width:36px;height:36px;border-radius:50%;border:0;padding:0;background:var(--bc-primary);color:var(--bc-on-primary);
  font:600 14px Inter,system-ui,sans-serif;display:grid;place-items:center;cursor:pointer}
.bc-avatar:hover{filter:brightness(1.1)}
.bc-menu{position:absolute;right:0;top:calc(100% + 10px);width:260px;background:var(--bc-surface);border:1px solid var(--bc-line);
  border-radius:14px;box-shadow:var(--bc-pop-shadow);padding:8px;z-index:1300}
.bc-menu-who{padding:10px 12px 12px;margin:0 0 6px;border-bottom:1px solid var(--bc-line-soft)}
.bc-menu-k{display:block;font-size:12px;color:var(--bc-text-2)}
.auth-chip .auth-chip-name{display:block;max-width:none;font-size:15px;font-weight:600;color:var(--bc-text);white-space:normal;overflow-wrap:anywhere}
.bc-menu .bc-menu-item,.bc-menu .banner-reset-btn,.bc-menu .auth-chip-logout{display:flex;align-items:center;gap:10px;width:100%;margin:0;
  text-align:left;padding:10px 12px;border:0;border-radius:8px;background:none;font:500 14px Inter,system-ui,sans-serif;
  letter-spacing:0;color:var(--bc-text);cursor:pointer;text-decoration:none}
.bc-menu .bc-menu-item:hover{background:var(--bc-hover);color:var(--bc-text);border-color:transparent}
.bc-menu .reset-icon{width:18px;text-align:center;color:var(--bc-text-2);font-size:15px}
.bc-menu .bc-ico{color:var(--bc-text-2)}
/* 2026-09-30: the email under the name, and Log out beside the avatar. On
   phones the header has no room for it (measured), so there Log out is the
   one inside the menu. */
.bc-menu-email{display:block;font-size:13.5px;color:var(--bc-text-2);margin-top:2px;overflow-wrap:anywhere}
.auth-chip .bc-out{margin-left:8px;min-height:36px;padding:0 14px;border:1px solid var(--bc-line);border-radius:10px;
  background:transparent;color:var(--bc-text);font:600 14px Inter,system-ui,sans-serif;cursor:pointer;white-space:nowrap}
.auth-chip .bc-out:hover{background:var(--bc-hover)}

/* ---------- lesson title block ---------- */
.module-hero{max-width:var(--bc-wrap);margin:0 auto;padding:28px 32px 0;display:grid;grid-template-columns:minmax(0,760px) 340px;gap:0 44px;align-items:end}
.module-hero::after{content:"";grid-column:1/-1;border-bottom:1px solid var(--bc-line)}
.bc-back{display:inline-flex;align-items:center;gap:6px;font-size:14px;color:var(--bc-text-2);text-decoration:none;margin-bottom:16px}
.bc-back:hover{color:var(--bc-text);text-decoration:underline;text-underline-offset:3px}
.bc-back .bc-ico{width:16px;height:16px}
.bc-eyebrow{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--bc-text-2);margin:0}
.bc-dot{width:8px;height:8px;border-radius:50%;background:var(--bc-accent);flex:none}
.module-hero h1{font-size:38px;line-height:1.12;font-weight:700;letter-spacing:-0.03em;color:var(--bc-navy);margin:10px 0 0;max-width:26ch}
.module-hero .subtitle{font-size:17px;color:var(--bc-text-2);margin-top:10px}
.bc-facts{display:flex;flex-wrap:wrap;gap:4px 18px;margin:14px 0 26px;padding:0;list-style:none;font-size:14px;color:var(--bc-text-2)}
.bc-facts b{color:var(--bc-text);font-weight:600}
.bc-lprog{padding-bottom:30px}
.bc-lprog-top{display:flex;justify-content:space-between;align-items:baseline;gap:12px;font-size:14px;color:var(--bc-text-2);margin-bottom:10px}
.bc-lprog-top b{font-size:15px;color:var(--bc-text);font-weight:600;font-variant-numeric:tabular-nums}
.bc-bar{display:block;height:8px;border-radius:99px;background:var(--bc-track);overflow:hidden}
.bc-bar>i{display:block;height:100%;width:0;border-radius:inherit;background:var(--bc-bar);transition:width .3s}
.bc-lprog-note{font-size:13px;color:var(--bc-text-2);margin:10px 0 0}

/* ---------- section bar (the section menu, at every width) ---------- */
.mobile-topbar,html[data-vm] .mobile-topbar{display:block!important;position:sticky;top:var(--bc-head-h);z-index:1000;padding:0;
  background:var(--bc-bg);border-bottom:1px solid var(--bc-line);backdrop-filter:none;-webkit-backdrop-filter:none}
.bc-secbar-in{max-width:var(--bc-wrap);margin:0 auto;padding:0 32px;height:var(--bc-bar-h);display:flex;align-items:center}
.mobile-topbar .hamburger-btn{display:flex;align-items:center;gap:10px;width:100%;max-width:760px;height:44px;margin-left:-10px;padding:0 12px 0 10px;
  border:0;border-radius:10px;background:none;color:var(--bc-text);font:inherit;font-size:15px;line-height:1.2;cursor:pointer;text-align:left}
.mobile-topbar .hamburger-btn:hover{background:var(--bc-hover);color:var(--bc-text);border-color:transparent}
.mobile-topbar .hamburger-btn .bc-ico{color:var(--bc-text-2)}
.bc-chev{margin-left:auto;transition:transform .2s}
.hamburger-btn[aria-expanded="true"] .bc-chev{transform:rotate(180deg)}
.bc-sec-count{flex:none;font:600 12.5px "JetBrains Mono",ui-monospace,monospace;color:var(--bc-text-2);background:var(--bc-tint);border-radius:6px;padding:3px 7px}
.mobile-topbar .mobile-topbar-title{font-size:15px;font-weight:600;color:var(--bc-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.bc-sec-line{position:absolute;left:0;right:0;bottom:-1px;height:2px}
.bc-sec-line>i{display:block;height:100%;width:0;background:var(--bc-bar);transition:width .3s}

/* The builder's #subnav, opened by the section bar as a drop-down panel. */
.subnav,html[data-vm] .subnav{position:fixed;top:var(--bc-menu-top,calc(var(--bc-head-h) + var(--bc-bar-h)));
  left:max(8px,calc((100vw - var(--bc-wrap)) / 2 + 20px));right:auto;bottom:auto;
  width:min(760px,calc(100vw - 32px));height:auto;max-height:min(70vh,620px);overflow-y:auto;
  margin:0;padding:16px 16px 18px;border-radius:0 0 16px 16px;background:var(--bc-surface);border:1px solid var(--bc-line);border-top:0;
  box-shadow:var(--bc-pop-shadow);z-index:1200;transform:translateY(-8px);opacity:0;visibility:hidden;
  transition:opacity .18s ease,transform .18s ease,visibility .18s}
.subnav.open,html[data-vm] .subnav.open{transform:none;opacity:1;visibility:visible;box-shadow:var(--bc-pop-shadow)}
.subnav-title{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;
  color:var(--bc-text-2);padding:4px 8px 10px;margin:0 44px 6px 0;border-bottom:0}
.subnav-title::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--bc-accent)}
.mobile-close-btn{display:flex!important;top:10px;right:12px;width:36px;height:36px;border:1px solid var(--bc-line);border-radius:10px;
  background:transparent;color:var(--bc-text-2);font-size:20px}
.mobile-close-btn:hover{background:var(--bc-hover);border-color:var(--bc-line);color:var(--bc-text)}
.time-remaining-bar{text-align:left;padding:0 8px 8px;color:var(--bc-text-2);font-size:13px}
.time-remaining-bar:empty{display:none}
.subnav-item{position:relative;display:flex;gap:10px;align-items:flex-start;width:100%;margin:1px 0;padding:10px 12px;border:0;border-left:0;
  border-radius:10px;background:none;color:var(--bc-text-2);font-size:15px;font-weight:500;line-height:1.4;text-align:left}
.subnav-item:hover{background:var(--bc-hover);color:var(--bc-text);transform:none;box-shadow:none}
.subnav-item.active{background:var(--bc-tint);color:var(--bc-text);font-weight:600}
.subnav-item.active::before{content:"";position:absolute;left:0;top:9px;bottom:9px;width:3px;border-radius:3px;background:var(--bc-accent)}
.subnav-item-sub{padding-left:30px;font-size:14px}
.subnav-num{flex:none;min-width:34px;font:500 12.5px/1.75 "JetBrains Mono",ui-monospace,monospace;color:var(--bc-text-2)}
/* A finished section: the page's own tick, shown as a green check. */
.subnav-item.canvas-done::after{content:"";flex:none;margin-left:auto;width:18px;height:18px;border-radius:50%;background:var(--bc-ok)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.3l2.6 2.6 5.2-5.5' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat;
  margin-top:1px}
.overlay-backdrop{background:var(--bc-backdrop);z-index:1150}

/* ---------- layout ---------- */
.module-grid,html[data-vm] .module-grid{max-width:var(--bc-wrap);margin:0 auto;padding:32px 32px 96px;gap:44px;justify-content:start}
.module-content,html[data-vm] .module-content{background:transparent;border-radius:0;box-shadow:none;padding:0;min-width:0;
  width:100%;max-width:760px;margin:0;display:flex;flex-direction:column}
.module-content > .page{order:0}
.module-content > .page-nav-helper{order:1}
.module-content > .page-nav{order:2}
@media (min-width:1025px){
  .module-grid{grid-template-columns:minmax(0,760px) 340px}
  /* test pages hide the scratchpad; the column stays where it was */
  .module-grid.no-scratchpad{grid-template-columns:minmax(0,760px) 340px}
  .scratchpad-panel{position:sticky;top:calc(var(--bc-head-h) + var(--bc-bar-h) + 24px);
    max-height:calc(100vh - var(--bc-head-h) - var(--bc-bar-h) - 24px - 96px)}
}
html[data-vm="desktop"] .module-grid,html[data-vm="desktop"] .module-grid.no-scratchpad{grid-template-columns:minmax(0,760px) 340px}
html[data-vm="tablet"] .module-grid,html[data-vm="tablet"] .module-grid.no-scratchpad,
html[data-vm="phone"] .module-grid,html[data-vm="phone"] .module-grid.no-scratchpad{grid-template-columns:minmax(0,760px)}
html[data-vm="desktop"] .scratchpad-panel{top:calc(var(--bc-head-h) + var(--bc-bar-h) + 24px);
  max-height:calc(100vh - var(--bc-head-h) - var(--bc-bar-h) - 24px - 96px);border-radius:18px}
@media (max-width:1024px){
  .module-grid,.module-grid.no-scratchpad{grid-template-columns:minmax(0,1fr);padding:28px 24px 96px}
}

/* ---------- pages ---------- */
.page{animation:none}
.page-progress-bar{display:none}
.page-meta{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--bc-text-2);margin-bottom:10px}
.page-meta::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--bc-accent);flex:none}
.section-title,.subsection-title{font-size:30px;line-height:1.2;font-weight:700;letter-spacing:-0.022em;color:var(--bc-navy);
  margin:6px 0 22px;padding:0;border:0}
.page-body{color:var(--bc-text)}
.page-body p{font-size:16.5px;line-height:1.72;margin:0 0 16px}
.module-list{list-style:none;margin:0 0 18px;padding:0}
.module-list li{position:relative;padding-left:22px;margin:0 0 9px;font-size:16.5px;line-height:1.65}
.module-list li::before{content:"";position:absolute;left:4px;top:.66em;width:6px;height:6px;border-radius:50%;background:var(--bc-navy);opacity:.75}
ol.module-list{counter-reset:bcl}
ol.module-list li{counter-increment:bcl;padding-left:28px}
ol.module-list li::before{content:counter(bcl) ".";width:auto;height:auto;border-radius:0;background:none;top:0;left:0;opacity:1;
  font-weight:600;color:var(--bc-text-2);font-size:.95em}
.page-body strong,.module-list strong{font-weight:600;color:var(--bc-text)}
.hl-orange{color:var(--bc-text);font-weight:600;background:linear-gradient(transparent 58%,var(--bc-hl) 58%);padding:0 .08em}
.hl-blue{color:var(--bc-navy);font-weight:600}
.hl-red{color:var(--bc-red);font-weight:600}
code{font-size:.86em;background:var(--bc-code-bg);border:1px solid var(--bc-code-line);border-radius:6px;padding:.08em .38em;color:var(--bc-code-text)}
.code-ref{background:var(--bc-code-bg);color:var(--bc-code-text);border:1px solid var(--bc-code-line);border-radius:12px;
  padding:16px 20px;font-size:14px;line-height:1.7;tab-size:4}
.code-ref code{background:none;border:0;padding:0;color:inherit}
.code-block{margin:4px 0 22px}
.code-ref--output{background:var(--bc-warn-bg);color:var(--bc-text);border:1px solid var(--bc-warn-line);border-left:4px solid var(--bc-accent)}
.module-figure{margin:6px 0 26px}
.module-figure img{border-radius:12px;box-shadow:none;border:1px solid var(--bc-line);background:#FFFFFF}
.module-figure figcaption{font-style:normal;font-size:14px;color:var(--bc-text-2)}
.page-video{border:1px solid var(--bc-line);box-shadow:none;border-radius:14px;background:var(--bc-surface)}
/* Callouts: a tint, an orange or navy rule, a plain dark title. */
.callout{position:relative;margin:8px 0 24px;padding:18px 22px;border:1px solid var(--bc-note-line);border-left:1px solid var(--bc-note-line);
  border-radius:14px;background:var(--bc-info-bg)}
.callout::before{content:"";position:absolute;left:-1px;top:14px;bottom:14px;width:3px;border-radius:0 3px 3px 0;background:var(--bc-navy)}
.callout__title,.callout--note .callout__title,.callout--warning .callout__title,.callout--tip .callout__title,
.callout--key .callout__title,.callout--mistake .callout__title{display:flex;align-items:center;gap:10px;margin:0 0 8px;
  font-size:16px;font-weight:600;letter-spacing:0;text-transform:none;color:var(--bc-text)}
.callout__title::before{content:"";flex:none;width:8px;height:8px;border-radius:50%;background:var(--bc-navy)}
.callout--warning,.callout--key,.callout--mistake{background:var(--bc-warn-bg);border-color:var(--bc-warn-line)}
.callout--warning::before,.callout--key::before{background:var(--bc-accent)}
.callout--warning .callout__title::before,.callout--key .callout__title::before{background:var(--bc-accent)}
.callout--mistake::before,.callout--mistake .callout__title::before{background:var(--bc-red)}
.callout__body,.callout__body p,.callout__body li{font-size:15.5px}
.callout .module-list li{font-size:15.5px}
.lesson-table{color:var(--bc-text)}
.lesson-table caption{color:var(--bc-text);font-size:14px;letter-spacing:0;text-transform:none}
.lesson-table thead th{color:var(--bc-text);background:var(--bc-tint);border-bottom:1px solid var(--bc-line);text-transform:none;letter-spacing:0;font-size:13.5px}
.lesson-table td,.lesson-table tbody th{border-bottom:1px solid var(--bc-line-soft)}
.card--app{border:1px solid var(--bc-line);border-left:3px solid var(--bc-accent);border-radius:14px;background:var(--bc-surface)}

/* ---------- widget cards ---------- */
.assess-card{background:var(--bc-surface);border:1px solid var(--bc-line);border-radius:16px;padding:22px 24px;margin:8px 0 26px;box-shadow:var(--bc-card-shadow)}
.code-card{background:var(--bc-surface);border:1px solid var(--bc-line);box-shadow:var(--bc-card-shadow)}
/* Every kind label (pre-test, try it out, Parsons...) is slate text beside an
   orange dot, not a coloured chip. */
.assess-header,.reflect-header,.pretest-header,.posttest-header,.misconception-header,.predict-header,.muddiest-header,.rating-header,
.results-header,.code-header,.code-header--type,.code-header--predict,.code-header--debug,.code-header--explain,.code-header--worked,
.code-header--primm,.code-header--parsons{display:flex;align-items:center;gap:8px;margin:0 0 12px;padding:0;border-radius:0;background:none;
  color:var(--bc-text-2);font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;box-shadow:none}
/* Code cards carry their title in the label ("Parsons problem · Check enrolment
   eligibility..."), so they read in sentence case, not shouted in capitals. */
.code-header,.code-header--type,.code-header--predict,.code-header--debug,.code-header--explain,.code-header--worked,
.code-header--primm,.code-header--parsons{text-transform:none;letter-spacing:0;font-size:13.5px;line-height:1.4}
.assess-header::before,.reflect-header::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--bc-accent);flex:none}
.assess-intro{font-size:15.5px;line-height:1.65;color:var(--bc-text);background:var(--bc-info-bg);border:0;border-left:0;border-radius:14px;padding:18px 20px;margin:0 0 22px}
.assess-intro strong{color:var(--bc-text)}
#pretestRestoredNotice,#posttestRestoredNotice{background:var(--bc-info-bg)!important;border:1px solid var(--bc-note-line)!important;
  color:var(--bc-text)!important;border-radius:14px!important}
/* MCQ */
.mcq-stem,.confidence-statement,.predict-prompt,.muddiest-prompt,.rating-question,.reflect-question{color:var(--bc-text);font-weight:600;font-size:17px;line-height:1.45}
.mcq-stem{margin-bottom:16px}
.mcq-options{gap:10px}
.mcq-option{align-items:center;gap:14px;padding:12px 14px;border:1.5px solid var(--bc-line);border-radius:12px;background:var(--bc-surface);
  color:var(--bc-text);font-size:16px;line-height:1.45}
.mcq-option:hover{border-color:var(--bc-ring);background:var(--bc-hover)}
.mcq-letter{flex:none;min-width:32px;height:32px;padding:0 6px;border-radius:9px;display:grid;place-items:center;border:1.5px solid var(--bc-line);
  font:600 13px "JetBrains Mono",ui-monospace,monospace;color:var(--bc-text-2);background:var(--bc-surface)}
.mcq-option.selected{border-color:var(--bc-navy);background:var(--bc-tint);box-shadow:none;font-weight:500}
.mcq-option.selected .mcq-letter{background:var(--bc-primary);border-color:var(--bc-primary);color:var(--bc-on-primary)}
/* The selected option is marked by its filled letter. The old check mark on a
   selected pre-test option read as "correct", which it never meant. */
.mcq-checkmark,.mcq-option.selected .mcq-checkmark{display:none}
.mcq-option:disabled:hover{border-color:var(--bc-line);background:var(--bc-surface)}
.mcq-option.selected:disabled:hover{border-color:var(--bc-navy);background:var(--bc-tint)}
.mcq-option.correct{border-color:var(--bc-ok)} .mcq-option.incorrect{border-color:var(--bc-bad-text)}
/* Confidence: five equal buttons, the two anchors underneath. */
.confidence-scale{display:grid;grid-template-columns:1fr 1fr;grid-template-areas:"b b" "l r";gap:8px 12px}
.confidence-buttons{grid-area:b;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.confidence-anchor{max-width:none;font-size:13.5px;color:var(--bc-text-2)}
.confidence-scale>.confidence-anchor:first-child{grid-area:l}
.confidence-scale>.confidence-anchor:last-child{grid-area:r;text-align:right}
.confidence-btn,.nps-btn{width:auto;height:auto;min-height:48px;border:1.5px solid var(--bc-line);border-radius:10px;background:var(--bc-surface);
  color:var(--bc-text);font:600 16px "JetBrains Mono",ui-monospace,monospace}
.nps-btn{min-height:40px;min-width:40px;font-size:14px}
.confidence-btn:hover,.nps-btn:hover{border-color:var(--bc-ring);background:var(--bc-hover)}
.confidence-btn.selected,.nps-btn.selected{background:var(--bc-primary);border-color:var(--bc-primary);color:var(--bc-on-primary);box-shadow:none}
.rating-star{color:var(--bc-ring)} .rating-star:hover{color:var(--bc-accent)} .rating-star.selected{color:var(--bc-accent)}
/* Inputs */
.reflect-input,.predict-input,.muddiest-input,.code-editor{border:1px solid var(--bc-line);border-radius:12px;background:var(--bc-surface);color:var(--bc-text);padding:12px 14px}
.code-editor{background:var(--bc-code-bg);color:var(--bc-code-text);font-size:14px}
.code-editor--prose{background:var(--bc-surface);color:var(--bc-text)}
.reflect-input:focus,.predict-input:focus,.muddiest-input:focus,.code-editor:focus{outline:2px solid var(--bc-focus);outline-offset:1px;border-color:var(--bc-line);box-shadow:none}
.code-instructions{font-size:15px;color:var(--bc-text-2);line-height:1.6}
.code-instructions strong{color:var(--bc-text)}
.code-ref-label,.code-editor-label,.worked-narration-label,.parsons-column-label,.worked-stage-label,.primm-phase-label{
  font-size:13px;font-weight:600;letter-spacing:0;text-transform:none;color:var(--bc-text-2);margin:14px 0 6px}
/* Buttons: navy primary, outlined secondary. */
.mcq-submit,.rating-submit,.muddiest-submit,.reflect-submit,.predict-reveal-btn,.code-run,.code-submit,.primm-continue-btn,.storage-notice-btn.primary{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:0 16px;border:1px solid transparent;border-radius:10px;
  background:linear-gradient(135deg,var(--bc-primary) 0%,var(--bc-primary-2) 100%)!important;color:var(--bc-on-primary);
  font:600 14px Inter,system-ui,sans-serif;box-shadow:var(--bc-btn-shadow)}
.code-reveal,.code-hint-toggle,.storage-notice-btn.secondary{display:inline-flex;align-items:center;min-height:40px;padding:0 16px;border-radius:10px;
  background:transparent;color:var(--bc-text);border:1px solid var(--bc-line);font:600 14px Inter,system-ui,sans-serif}
.mcq-submit:hover:not(:disabled),.rating-submit:hover:not(:disabled),.muddiest-submit:hover:not(:disabled),.reflect-submit:hover:not(:disabled),
.predict-reveal-btn:hover:not(:disabled),.code-run:hover:not(:disabled),.code-submit:hover:not(:disabled){transform:none;filter:brightness(1.08);box-shadow:var(--bc-btn-shadow)}
.code-reveal:hover:not(:disabled),.code-hint-toggle:hover:not(:disabled),.storage-notice-btn.secondary:hover{transform:none;background:var(--bc-hover)}
.muddiest-ack,.rating-ack{color:var(--bc-text);font-weight:500}
/* Output and feedback */
.code-output{background:var(--bc-term-bg);color:var(--bc-term-text);border:0;border-left:0;border-radius:12px;padding:14px 18px;font-size:14px}
.code-output.is-error{background:var(--bc-term-bg);color:#FFB4AB;box-shadow:inset 3px 0 0 #FF8A80}
.code-output.is-loading{background:var(--bc-term-bg);color:var(--bc-term-dim)}
.code-feedback,.mcq-feedback,.reflect-feedback,.predict-reveal{background:var(--bc-tint);border:0;border-left:0;border-radius:12px;color:var(--bc-text);padding:14px 16px}
.code-feedback.is-correct,.mcq-feedback.is-correct{background:var(--bc-tint);box-shadow:inset 3px 0 0 var(--bc-ok)}
.code-feedback.is-incorrect,.mcq-feedback.is-incorrect{background:var(--bc-tint);box-shadow:inset 3px 0 0 var(--bc-bad-text)}
.code-feedback strong,.reflect-feedback strong,.predict-reveal strong{color:var(--bc-text)}
.code-hints{background:var(--bc-warn-bg);border-left:0;border-radius:12px;box-shadow:inset 3px 0 0 var(--bc-accent)}
.code-hints-label{color:var(--bc-text-2);letter-spacing:.06em}
.code-hints-list,.code-hint--correct{color:var(--bc-text)}
/* Reflect */
.reflect-card{background:var(--bc-surface);border:1px solid var(--bc-line);border-radius:16px;padding:22px 24px;margin:8px 0 26px;box-shadow:var(--bc-card-shadow)}
.reflect-loading{color:var(--bc-text-2)}
/* Worked example and PRIMM */
.worked-pip,.primm-pip{border-radius:99px;background:transparent;color:var(--bc-text-2);border:1px solid var(--bc-line);text-transform:none;letter-spacing:0;font-weight:500;font-size:13px}
.worked-pip.is-active,.primm-pip.is-active{background:var(--bc-primary);color:var(--bc-on-primary);border-color:var(--bc-primary);box-shadow:none}
.worked-pip.is-done,.primm-pip.is-done{background:transparent;color:var(--bc-text);border-color:var(--bc-ok)}
.worked-pip.is-done::before,.primm-pip.is-done::before{color:var(--bc-ok-text)}
.worked-problem,.worked-indep-prompt,.primm-question,.parsons-prompt{background:var(--bc-info-bg);border-left:0;border-radius:12px;color:var(--bc-text);
  padding:12px 16px;font-size:15px}
.worked-stage,.primm-phase{border-top:1px solid var(--bc-line-soft)}
.worked-narration{color:var(--bc-text);font-size:15px}
/* Parsons */
.parsons-bank,.parsons-solution{background:var(--bc-hover);border:1.5px dashed var(--bc-line);border-radius:14px;padding:10px}
.parsons-solution{background:var(--bc-surface);border-color:var(--bc-ring)}
.parsons-bank.is-drag-over,.parsons-solution.is-drag-over{background:var(--bc-tint);border-color:var(--bc-navy)}
.parsons-line{background:var(--bc-surface);border:1px solid var(--bc-line);border-radius:10px;padding:9px 12px;box-shadow:0 1px 2px rgba(0,30,70,.05)}
.parsons-line:hover{background:var(--bc-surface);border-color:var(--bc-ring);box-shadow:none}
/* Wrapped code in a Parsons line keeps a hanging indent, so one line of code
   never reads as two. */
.parsons-line code{color:var(--bc-code-text);font-size:13px;padding:0 0 0 2ch;text-indent:-2ch;background:none;border:0;border-radius:0}
.parsons-grip{color:var(--bc-text-3)}
.parsons-line.is-correct{background:var(--bc-surface);border-color:var(--bc-ok);box-shadow:inset 3px 0 0 var(--bc-ok)}
.parsons-line.is-incorrect{background:var(--bc-surface);border-color:var(--bc-bad-text);box-shadow:inset 3px 0 0 var(--bc-bad-text)}
.parsons-empty-hint{color:var(--bc-text-2)}
/* Results */
.results-pending{color:var(--bc-text-2)}
.results-headline{color:var(--bc-text);font-size:17px}
.results-headline strong{color:var(--bc-text);font-size:22px}
.results-delta-up{color:var(--bc-ok-text)} .results-delta-down{color:var(--bc-bad-text)} .results-delta-flat{color:var(--bc-text-2)}
.results-context{background:var(--bc-tint);border-left:0;border-radius:12px;color:var(--bc-text-2);font-size:15px}
.result-item,.conf-result-item{border-bottom:1px solid var(--bc-line-soft)}
.result-item-stem,.conf-result-statement{color:var(--bc-text)}
.result-item-row,.result-text{color:var(--bc-text)}
.result-label{color:var(--bc-text-2);font-weight:500}
.result-mark.correct{color:var(--bc-ok-text)} .result-mark.incorrect{color:var(--bc-bad-text)} .result-mark.missing{color:var(--bc-text-2)}
.result-correct-row{background:var(--bc-info-bg);border-left:0;border-radius:10px;box-shadow:inset 3px 0 0 var(--bc-navy);padding:8px 12px}
.conf-pill{background:var(--bc-tint);color:var(--bc-text);font:500 13px "JetBrains Mono",ui-monospace,monospace}
.conf-delta-up{color:var(--bc-ok-text)} .conf-delta-down{color:var(--bc-bad-text)} .conf-delta-flat{color:var(--bc-text-2)}

/* ---------- previous / next ---------- */
.page-nav{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;margin-top:0;padding-top:24px;border-top:1px solid var(--bc-line)}
.page-nav-indicator{display:none}
.page-nav-btn{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:2px;min-height:64px;padding:10px 18px;border-radius:12px;
  border:1px solid var(--bc-line);background:var(--bc-surface);color:var(--bc-text);box-shadow:none;font:600 15.5px/1.3 Inter,system-ui,sans-serif;
  text-align:left;min-width:0;cursor:pointer}
.page-nav-btn:hover:not(:disabled){transform:none;box-shadow:none;background:var(--bc-hover)}
.page-nav-btn.prev:disabled{visibility:hidden}
.page-nav-btn.next{grid-column:2;align-items:flex-end;text-align:right;border-color:transparent;
  background:linear-gradient(135deg,var(--bc-primary) 0%,var(--bc-primary-2) 100%);color:var(--bc-on-primary);box-shadow:var(--bc-btn-shadow)}
.page-nav-btn.next:hover:not(:disabled){background:linear-gradient(135deg,var(--bc-primary) 0%,var(--bc-primary-2) 100%);filter:brightness(1.08);box-shadow:var(--bc-btn-shadow)}
.page-nav-btn:disabled{opacity:1}
.page-nav-btn.next:disabled{background:var(--bc-tint);color:var(--bc-text-2);box-shadow:none;cursor:not-allowed;filter:none}
/* With a section name (set by the skin script as data-sub), the button's own
   text becomes the small label and the name sits under it in bold. */
.page-nav-btn[data-sub]{font-size:12.5px;font-weight:500}
.page-nav-btn.next[data-sub]{color:var(--bc-on-primary)}
.page-nav-btn.prev[data-sub]{color:var(--bc-text-2)}
.page-nav-btn[data-sub]::after{content:attr(data-sub);display:block;max-width:100%;font-size:15.5px;font-weight:600;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.page-nav-btn.prev[data-sub]::after{color:var(--bc-text)}
.page-nav-helper{text-align:left;min-height:0;margin:28px 0 14px;font-size:14.5px;font-weight:400;color:var(--bc-text);line-height:1.55}
.page-nav-helper:empty{display:none}
.page-nav-helper.bc-warn{background:var(--bc-warn-bg);border:1px solid var(--bc-warn-line);border-radius:12px;padding:12px 14px 12px 40px;position:relative}
.page-nav-helper.bc-warn::before{content:"!";position:absolute;left:14px;top:12px;width:18px;height:18px;border-radius:50%;
  background:var(--bc-warn-ico);color:var(--bc-bg);font:700 12px/18px Inter,sans-serif;text-align:center}
.page-nav-helper:not(.bc-warn){color:var(--bc-text-2)}

/* ---------- scratchpad ---------- */
.scratchpad-panel{background:var(--bc-surface);color:var(--bc-text);border:1px solid var(--bc-line);border-radius:18px;box-shadow:var(--bc-panel-shadow)}
.scratchpad-header{background:var(--bc-surface);padding:14px 16px 12px;border-bottom:1px solid var(--bc-line-soft);text-transform:none;letter-spacing:0;font-size:14.5px}
.scratchpad-header .scratchpad-title{color:var(--bc-text);font-weight:600;font-size:14.5px;min-width:0}
.scratchpad-header .scratchpad-title small{color:var(--bc-text-2);font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.scratchpad-status-dot{width:8px;height:8px;box-shadow:none}
.scratchpad-collapse-btn,.scratch-sheet-close{background:transparent;color:var(--bc-text);border:1px solid var(--bc-line);border-radius:10px;
  font:600 13px Inter,system-ui,sans-serif;letter-spacing:0;padding:6px 12px}
.scratchpad-collapse-btn:hover,.scratch-sheet-close:hover{background:var(--bc-hover);border-color:var(--bc-line);color:var(--bc-text)}
.scratchpad-editor{background:var(--bc-code-bg);color:var(--bc-code-text);border:1px solid var(--bc-code-line);border-radius:12px;font-size:13.5px}
.scratchpad-editor:focus{background:var(--bc-code-bg);border-color:var(--bc-code-line);box-shadow:none;outline:2px solid var(--bc-focus);outline-offset:-1px}
.scratchpad-toolbar{background:var(--bc-surface)}
.scratchpad-run-btn{background:linear-gradient(135deg,var(--bc-primary) 0%,var(--bc-primary-2) 100%);color:var(--bc-on-primary);
  box-shadow:var(--bc-btn-shadow);border-radius:10px;font-size:14px;letter-spacing:0}
.scratchpad-run-btn:hover:not(:disabled){transform:none;filter:brightness(1.08);box-shadow:var(--bc-btn-shadow)}
.scratchpad-clear-btn{background:transparent;color:var(--bc-text);border:1px solid var(--bc-line);border-radius:10px;font-size:14px;letter-spacing:0}
.scratchpad-clear-btn:hover{background:var(--bc-hover);transform:none;border-color:var(--bc-line)}
.scratchpad-io{background:var(--bc-surface);border:1px solid var(--bc-line);border-radius:12px}
.out-tabs{background:var(--bc-surface);border-bottom:1px solid var(--bc-line-soft);padding:0 6px;gap:2px}
.out-tab{flex:0 0 auto;border-radius:0;padding:9px 10px;color:var(--bc-text-2);font-size:13px;font-weight:500;letter-spacing:0;
  border-bottom:2px solid transparent;margin-bottom:-1px;background:transparent}
.out-tab:hover{color:var(--bc-text)}
.out-tab.active{background:transparent;color:var(--bc-text);border-bottom-color:var(--bc-navy);box-shadow:none;font-weight:600}
.out-tab.active .out-tab-pill{background:var(--bc-primary);color:var(--bc-on-primary)}
.out-body{background:var(--bc-surface)}
/* The builder's #94a3b8 empty-state text is 2.6:1 on white. */
.out-graph-empty,.workspace-files-empty{color:var(--bc-text-3)}
/* The terminal pane is a dark terminal in both themes. */
.out-body:has(> .scratchpad-output:not([hidden])){background:var(--bc-term-bg)}
.scratchpad-output{background:var(--bc-term-bg);color:var(--bc-term-text);font-size:13.5px;min-height:100%}
.scratchpad-output:empty::before{color:var(--bc-term-dim)}
.scratchpad-output .scratchpad-err{color:#FFB4AB}
.scratchpad-output .scratchpad-info{color:var(--bc-term-dim)}
/* Bash's start screen is already a dark terminal, so its navy glow stays navy
   in dark mode. tokenize_css() turns navy washes light blue, which lifted the
   glow enough to drop the grey note under it to 3.2:1. */
:root[data-theme="dark"] .sp2-start{background:radial-gradient(420px 240px at 50% 32%,rgba(0,61,124,0.28),transparent 70%),#0d1117}
.scratch-fab,.bchat-fab{background:linear-gradient(135deg,var(--bc-primary) 0%,var(--bc-primary-2) 100%);color:var(--bc-on-primary);
  box-shadow:0 10px 30px rgba(0,61,124,0.30);font-weight:600;animation:none}
:root[data-theme="dark"] .scratch-fab,:root[data-theme="dark"] .bchat-fab{box-shadow:0 10px 30px rgba(0,0,0,0.45)}
.bchat-fab:hover,.scratch-fab:hover{transform:none;filter:brightness(1.08)}
.bchat-fab.has-unread{animation:none;box-shadow:0 0 0 3px var(--bc-accent),0 10px 30px rgba(0,61,124,0.30)}
.bchat-fab-dot{border-color:var(--bc-surface)}
@media (min-width:1025px){
  /* the chat button sits UNDER the docked scratchpad column, not on top of it */
  .bchat-fab{bottom:24px;right:max(20px,calc((100vw - var(--bc-wrap)) / 2 + 32px))}
  .bchat-panel{bottom:84px;right:max(20px,calc((100vw - var(--bc-wrap)) / 2 + 32px))}
}
html[data-vm="tablet"] .bchat-fab,html[data-vm="phone"] .bchat-fab{bottom:84px;right:20px}
.scratchpad-panel.floating-open{box-shadow:0 -10px 40px rgba(0,30,70,0.25)}

/* ---------- chat panel ---------- */
.bchat-panel{background:var(--bc-surface);border:1px solid var(--bc-line);border-radius:18px;box-shadow:var(--bc-pop-shadow)}
.bchat-head{background:var(--bc-surface);color:var(--bc-text);border-bottom:1px solid var(--bc-line-soft);padding:14px 16px}
.bchat-head-title{color:var(--bc-text);font-weight:600;font-size:15px}
.bchat-head-title small{color:var(--bc-text-2);opacity:1;font-size:13px}
.bchat-close{background:transparent;border:1px solid var(--bc-line);color:var(--bc-text-2);border-radius:10px;width:34px;height:34px}
.bchat-close:hover{background:var(--bc-hover);color:var(--bc-text)}
.bchat-notice{background:var(--bc-hover);color:var(--bc-text-2);border-bottom:1px solid var(--bc-line-soft);font-size:13px}
.bchat-log{background:var(--bc-surface)}
.bchat-empty{color:var(--bc-text-2)}
.bchat-bubble.student{background:var(--bc-primary);color:var(--bc-on-primary)}
.bchat-bubble.tutor{background:var(--bc-tint);color:var(--bc-text);border:0}
.bchat-meta{color:var(--bc-text-2)}
.bchat-inputbar{background:var(--bc-surface);border-top:1px solid var(--bc-line-soft)}
.bchat-input{background:var(--bc-surface);color:var(--bc-text);border:1px solid var(--bc-line)}
.bchat-input:focus{outline:2px solid var(--bc-focus);outline-offset:1px;border-color:var(--bc-line)}
.bchat-send{background:linear-gradient(135deg,var(--bc-primary),var(--bc-primary-2));color:var(--bc-on-primary);font-weight:600}

/* ---------- notices, dialogs, footer ---------- */
.storage-notice{background:var(--bc-surface);color:var(--bc-text);border:1px solid var(--bc-line);border-left:3px solid var(--bc-navy);box-shadow:var(--bc-pop-shadow)}
.storage-notice-title{color:var(--bc-text);letter-spacing:.04em}
.storage-notice-title::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--bc-accent)}
.storage-notice-body{color:var(--bc-text-2)}
.storage-confirm-overlay{background:var(--bc-backdrop)}
.storage-confirm-box{background:var(--bc-surface);color:var(--bc-text);border:1px solid var(--bc-line);border-radius:18px}
.storage-confirm-title{color:var(--bc-navy)} .storage-confirm-body,.storage-confirm-body ul{color:var(--bc-text-2)}
.figlightbox-card{background:var(--bc-surface)}
.figlightbox-body{background:#FFFFFF}
footer.site-foot{max-width:var(--bc-wrap);border-top:1px solid var(--bc-line);color:var(--bc-text-2);font-size:13px;padding:28px 32px 96px}
footer.site-foot .foot-contact{color:var(--bc-text-2)}
footer.site-foot .foot-contact strong{color:var(--bc-text)}
footer.site-foot a.foot-mail{color:var(--bc-text-2);font-weight:500;border-bottom-color:var(--bc-line)}
footer.site-foot a.foot-mail:hover{color:var(--bc-text);border-bottom-color:var(--bc-text-2)}
/* the cookie bar's white-on-orange Accept button was 2.8:1 */
#bridgingCookieAccept{background:#FFFFFF!important;color:#003D7C!important}
/* Welcome-back banner (built by script, inline styles) */
#bridgingResumeBanner{max-width:calc(var(--bc-wrap) - 64px)!important;margin:16px auto 0!important;background:var(--bc-warn-bg)!important;
  border:1px solid var(--bc-warn-line)!important;border-radius:12px!important;color:var(--bc-text)!important}
#bridgingResumeBanner button:first-of-type{background:var(--bc-primary)!important;color:var(--bc-on-primary)!important;border-radius:8px!important}
#bridgingResumeBanner button:nth-of-type(2){background:transparent!important;color:var(--bc-text)!important;border:1px solid var(--bc-line)!important;border-radius:8px!important}
#bridgingResumeBanner button:nth-of-type(3){color:var(--bc-text-2)!important}
#bridgingResumeBanner button:focus-visible{outline:2px solid var(--bc-focus)}

/* ---------- blocks injected after this sheet ---------- */
/* sign-in box (built by script with inline styles): dark mode only */
:root[data-theme="dark"] #bridgingAuthOverlay{background:rgba(3,8,16,0.82)!important}
:root[data-theme="dark"] #bridgingAuthOverlay > div{background:var(--bc-surface)!important;color:var(--bc-text)!important;border:1px solid var(--bc-line)}
:root[data-theme="dark"] #bridgingAuthOverlay h2,:root[data-theme="dark"] #bridgingAuthOverlay label,
:root[data-theme="dark"] #bridgingAuthOverlay b{color:var(--bc-navy)!important}
:root[data-theme="dark"] #bridgingAuthOverlay p,:root[data-theme="dark"] #bridgingAuthOverlay span{color:var(--bc-text-2)!important}
:root[data-theme="dark"] #bridgingAuthOverlay input{background:var(--bc-bg)!important;color:var(--bc-text)!important;border-color:var(--bc-line)!important}
:root[data-theme="dark"] #bridgingAuthOverlay button{border-color:var(--bc-line)!important}
:root[data-theme="dark"] #bridgingAuthOverlay button[id$="Btn"]{background:var(--bc-primary)!important;color:var(--bc-on-primary)!important}
:root[data-theme="dark"] #bridgingAuthOverlay #authTabRegister,:root[data-theme="dark"] #bridgingAuthOverlay #authTabLogin,
:root[data-theme="dark"] #bridgingAuthOverlay #authPinBack{background:transparent!important;color:var(--bc-text-2)!important}
:root[data-theme="dark"] #bridgingAuthOverlay a{color:var(--bc-navy)!important}
:root[data-theme="dark"] #bridgingAuthOverlay div[style*="FFF4EE"]{background:var(--bc-warn-bg)!important;border-color:var(--bc-warn-line)!important}
:root[data-theme="dark"] #bridgingAuthOverlay div[style*="background:#f"]{background:var(--bc-tint)!important;border-color:var(--bc-line)!important}
/* status strip (injected; inline colours) */
:root[data-theme="dark"] [data-bridging-status="degraded"]{background:#2A2110!important;color:#F5D48A!important;border-bottom-color:#5A4520!important}
:root[data-theme="dark"] [data-bridging-status="outage"]{background:#2C1414!important;color:#FFB4AB!important;border-bottom-color:#5C2A2A!important}
/* announcement pop-up (announcement.js adds its own stylesheet at run time,
   after this one, hence :root). Navy OK button and navy links: its
   white-on-orange button and orange link text were 2.8:1. */
:root .nus-ann-overlay{background:var(--bc-backdrop)}
:root .nus-ann-card{background:var(--bc-surface);box-shadow:var(--bc-pop-shadow)}
:root .nus-ann-title,:root .nus-ann-body h3,:root .nus-ann-body h4,:root .nus-ann-contact b{color:var(--bc-navy)}
:root .nus-ann-body{color:var(--bc-text)}
:root .nus-ann-body figcaption,:root .nus-ann-contact,:root .nus-ann-contact-ic{color:var(--bc-text-2)}
:root .nus-ann-body a,:root .nus-ann-contact a{color:var(--bc-navy);text-decoration:underline;text-underline-offset:2px}
:root .nus-ann-x{background:var(--bc-tint);color:var(--bc-text-2)}
:root .nus-ann-x:hover{background:var(--bc-hover);color:var(--bc-text)}
:root .nus-ann-foot{border-top-color:var(--bc-line-soft)}
:root .nus-ann-ok{background:var(--bc-primary);color:var(--bc-on-primary);box-shadow:var(--bc-btn-shadow)}
:root[data-theme="dark"] .nus-ann-body img{background:#FFFFFF}
/* loading notices (BRIDGING-LOADING-UI): light as shipped, dark here */
:root[data-theme="dark"] .bcl-toast,:root[data-theme="dark"] #bclChip{background:var(--bc-surface);color:var(--bc-text);border-color:var(--bc-line);box-shadow:var(--bc-pop-shadow)}
:root[data-theme="dark"] #bclChip b,:root[data-theme="dark"] .bcl-bar-label{color:var(--bc-navy)}
:root[data-theme="dark"] .bcl-bar-pct,:root[data-theme="dark"] .bcl-bar-note{color:var(--bc-text-2)}
:root[data-theme="dark"] .bcl-bar-track{background:var(--bc-track)}
:root[data-theme="dark"] .bcl-skel{background:linear-gradient(90deg,#16233A 25%,#1C2B45 50%,#16233A 75%);background-size:200% 100%}
:root[data-theme="dark"] .bcl-saved{color:var(--bc-ok-text);background:rgba(76,194,133,0.12)}
:root[data-theme="dark"] .bcl-saved.is-pending{color:#FFB36B;background:rgba(255,107,53,0.14)}
:root[data-theme="dark"] .bcl-bar.is-done .bcl-bar-pct{color:var(--bc-ok-text)}
:root[data-theme="dark"] .bcl-bar.is-fail .bcl-bar-pct,:root[data-theme="dark"] .bcl-bar.is-fail .bcl-bar-note{color:#FF8A80}
/* The save notices say "saved on this device and sent to your account". The
   write has no reply, so the loading block's tick (and green rule) would claim
   more than is known: on lesson pages an "ok" notice gets a plain dot. */
:root .bcl-toast.is-ok{border-left-color:var(--bc-navy)}
:root .bcl-toast.is-ok .bcl-toast-ico{font-size:0;width:8px;height:8px;border-radius:50%;background:var(--bc-accent);margin-top:8px}
/* Notices sit ABOVE the floating chat and scratchpad buttons, never on them. */
:root .bcl-toast{bottom:88px}
.storage-notice{bottom:88px}
@media (max-width:1024px){ :root .bcl-toast,.storage-notice{bottom:140px} }
/* GIF player (injected by inject_gifplayer_clientside.py). The GIFs are white
   pictures, so they sit on a white card in both themes. */
:root .gp-stage{border-radius:12px;background:#FFFFFF;border:1px solid var(--bc-line)}
:root .gp-btn,:root .gp-speed{background:var(--bc-surface);color:var(--bc-text);border-color:var(--bc-line)}
:root .gp-btn:hover{background:var(--bc-hover);border-color:var(--bc-ring)}
:root .gp-play{background:var(--bc-primary);border-color:var(--bc-primary);color:var(--bc-on-primary)}
:root .gp-play:hover{background:var(--bc-primary);filter:brightness(1.08)}
:root .gp-count,:root .gp-loading{color:var(--bc-text-2)}
:root .gp-offer{background:var(--bc-surface);border-color:var(--bc-line);border-left-color:var(--bc-accent);color:var(--bc-text)}
:root .gp-offer-txt b{color:var(--bc-text)} :root .gp-offer-txt small{color:var(--bc-text-2)}
:root .gp-act{background:linear-gradient(135deg,var(--bc-primary) 0%,var(--bc-primary-2) 100%);color:var(--bc-on-primary)}
:root .gp-ghost{background:transparent;color:var(--bc-text);border-color:var(--bc-line)}
:root .gp-ghost:hover{background:var(--bc-hover);color:var(--bc-text);border-color:var(--bc-line)}
:root .gp-gear{width:40px;height:40px;padding:0;justify-content:center;border-radius:10px;border:1px solid var(--bc-line);background:transparent;color:var(--bc-text-2)}
:root .gp-gear:hover,:root .gp-gear.open{color:var(--bc-text);border-color:var(--bc-line);background:var(--bc-hover)}
:root .gp-pop{background:var(--bc-surface);border-color:var(--bc-line);box-shadow:var(--bc-pop-shadow)}
:root .gp-pop h4,:root .gp-pop-note{color:var(--bc-text-2)} :root .gp-pop-note{border-top-color:var(--bc-line-soft)}
:root .gp-pop-item:hover{background:var(--bc-hover)}
:root .gp-pop-txt b{color:var(--bc-text)} :root .gp-pop-txt small{color:var(--bc-text-2)}
:root .gp-switch input:checked + .gp-slider{background:var(--bc-primary)}
:root[data-theme="dark"] .gp-slider{background:var(--bc-ring)}
:root[data-theme="dark"] .module-figure img,:root[data-theme="dark"] .gp-stage img{background:#FFFFFF}

/* ---------- narrow screens ---------- */
@media (max-width:1080px){ .bc-product{display:none} }
@media (max-width:1024px){
  .module-hero{grid-template-columns:1fr;gap:0}
  .bc-lprog{padding-bottom:26px}
  .bc-hero-main + .bc-lprog{margin-top:-6px}
  .scratchpad-panel{border-radius:18px 18px 0 0;border-bottom:0}
  .bchat-fab{bottom:84px}
}
@media (max-width:760px){
  :root{--bc-head-h:56px}
  .top-banner-content{padding:0 16px;gap:10px}
  .bc-brand .biochem-logo{height:26px}
  .bc-status{display:none}
  .auth-chip .bc-out{display:none}
  .module-hero{padding:20px 16px 0}
  .module-hero h1{font-size:26px}
  .bc-facts,.bc-lprog-note{display:none}
  .bc-hero-main{padding-bottom:18px}
  .bc-lprog{padding-bottom:20px}
  .bc-hero-main + .bc-lprog{margin-top:0}
  .bc-eyebrow{margin-top:0}
  .bc-secbar-in{padding:0 16px}
  .module-grid,.module-grid.no-scratchpad,html[data-vm] .module-grid{padding:24px 16px 120px}
  .section-title,.subsection-title{font-size:25px;margin-bottom:18px}
  .page-body p,.module-list li{font-size:16px}
  .assess-card,.reflect-card{padding:18px 16px;border-radius:14px}
  .code-ref{padding:14px;font-size:13.5px;border-radius:10px}
  .page-nav-btn{padding:10px 14px;min-height:60px}
  .page-nav-btn[data-sub]::after{font-size:14.5px}
  .subnav{width:calc(100vw - 16px);border-radius:0 0 14px 14px}
  footer.site-foot{padding:24px 16px 120px}
  #bridgingResumeBanner{margin:12px 16px 0!important}
}
@media (max-width:420px){
  .confidence-anchor{font-size:12.5px}
  .mcq-option{gap:12px;padding:11px 12px}
  .mcq-letter{min-width:28px;height:28px}
  .nps-buttons{display:grid;grid-template-columns:repeat(6,minmax(0,1fr))}
}
@media (max-width:370px){ .bc-brand .biochem-logo{height:22px} }
@media (prefers-reduced-motion: reduce){
  .subnav,.bc-bar>i,.bc-sec-line>i,.bc-chev{transition:none}
}

.gifplayer-cs[hidden],.gp-bar[hidden],.gp-img[hidden],.gp-canvas[hidden],.gp-loading[hidden],
.gp-offer[hidden],.gp-gear-wrap[hidden],.gp-pop[hidden]{display:none !important}
.gp-stage{position:relative;display:block;border-radius:12px;overflow:hidden;background:#fff}
.gp-stage .gp-img,.gp-stage .gp-canvas{display:block;width:100%;height:auto;margin:0 auto}
.gp-bar{display:flex;align-items:center;gap:.5rem;margin-top:.7rem;flex-wrap:wrap;justify-content:center}
.gp-btn{cursor:pointer;border:1px solid #e2e8f0;background:#fff;border-radius:9px;width:42px;height:38px;
  display:inline-flex;align-items:center;justify-content:center;color:#003D7C;user-select:none;
  -webkit-user-select:none;touch-action:none;transition:all .15s ease}
.gp-btn:hover{background:#f8fafc;border-color:#cdd7e5}
.gp-btn svg{width:17px;height:17px;display:block}
.gp-btn:focus-visible{outline:2px solid #FF6B35;outline-offset:2px}
.gp-rev:active,.gp-fwd:active{background:#FF6B35;border-color:#FF6B35;color:#fff}
.gp-play{background:#003D7C;border-color:#003D7C;color:#fff}
.gp-play:hover{background:#0a4f96}
.gp-scrub{flex:1 1 180px;min-width:130px;height:5px;cursor:pointer;accent-color:#FF6B35}
.gp-speed{height:38px;border:1px solid #e2e8f0;border-radius:9px;background:#fff;color:#2c3e50;
  padding:0 .5rem;cursor:pointer;font:500 13px 'Inter',sans-serif}
.gp-count{font:600 12.5px 'Inter',sans-serif;font-variant-numeric:tabular-nums;color:#5a6c7d;
  min-width:64px;text-align:right}
.gp-loading{font-size:13px;color:#5a6c7d;margin-top:.55rem;text-align:center}
/* one-time offer */
.gp-offer{position:fixed;left:18px;bottom:18px;z-index:1100;max-width:430px;display:flex;gap:14px;
  align-items:center;flex-wrap:wrap;background:#fff;border:1px solid #e2e8f0;border-left:3px solid #FF6B35;
  border-radius:14px;padding:15px 17px;box-shadow:0 10px 30px rgba(0,61,124,.16)}
.gp-offer-txt{flex:1 1 220px}
.gp-offer-txt b{color:#003D7C;font:700 15px 'Inter',sans-serif}
.gp-offer-txt small{display:block;color:#5a6c7d;margin-top:3px;font-size:12.5px;line-height:1.5}
.gp-offer-txt small b{font-size:inherit}
.gp-offer-btns{display:flex;gap:8px}
.gp-act{cursor:pointer;border-radius:8px;border:none;color:#fff;padding:9px 15px;
  font:600 13.5px 'Inter',sans-serif;background:linear-gradient(135deg,#FF6B35 0%,#ff8555 100%);
  box-shadow:0 4px 12px rgba(255,107,53,.28);transition:filter .15s}
.gp-act:hover{filter:brightness(1.05)}
.gp-ghost{background:#fff;color:#003D7C;border:1px solid #e2e8f0;box-shadow:none}
.gp-ghost:hover{border-color:#FF6B35;color:#FF6B35;background:#fff7f3;filter:none}
/* Settings button in the banner (next to the user name) */
.gp-gear-wrap{position:relative;margin-left:auto;display:inline-flex;align-items:center}
.gp-gear{display:inline-flex;align-items:center;gap:7px;cursor:pointer;background:#fff;border:1px solid #e2e8f0;
  border-radius:8px;padding:7px 12px;color:#5a6c7d;font:600 12px 'Inter',sans-serif;transition:all .2s ease}
.gp-gear:hover{color:#FF6B35;border-color:#FF6B35;background:#fff7f3}
.gp-gear.open{color:#003D7C;border-color:#cdd7e5;background:#f8fafc}
.gp-gear svg{width:15px;height:15px;display:block}
.gp-pop{position:absolute;top:calc(100% + 10px);right:0;width:300px;background:#fff;border:1px solid #e2e8f0;
  border-radius:14px;box-shadow:0 16px 40px rgba(0,61,124,.18);padding:6px;z-index:1102}
.gp-pop h4{font:700 11px 'Inter',sans-serif;letter-spacing:.6px;text-transform:uppercase;color:#9aa6b6;
  padding:12px 12px 8px;margin:0}
.gp-pop-item{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:10px}
.gp-pop-item:hover{background:#f8fafc}
.gp-pop-txt{flex:1}
.gp-pop-txt b{font:600 14px 'Inter',sans-serif;color:#003D7C;display:block}
.gp-pop-txt small{color:#5a6c7d;font-size:11.5px;line-height:1.4;display:block;margin-top:2px}
.gp-pop-note{border-top:1px solid #eef2f7;color:#9aa6b6;font-size:11px;padding:9px 12px 7px}
.gp-switch{position:relative;width:46px;height:26px;flex:0 0 auto}
.gp-switch input{opacity:0;width:100%;height:100%;margin:0;cursor:pointer}
.gp-slider{position:absolute;inset:0;background:#cbd5e1;border-radius:999px;transition:.2s;pointer-events:none}
.gp-slider:before{content:"";position:absolute;width:20px;height:20px;left:3px;top:3px;background:#fff;
  border-radius:50%;transition:.2s;box-shadow:0 1px 3px rgba(0,0,0,.25)}
.gp-switch input:checked + .gp-slider{background:#FF6B35}
.gp-switch input:checked + .gp-slider:before{transform:translateX(20px)}
@media (max-width:768px){.gp-offer{display:none !important}}
