/* ═══════════════════════════════════════════════════════════════════════════════
   System Design Quiz Trainer — Styles
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── Reset & Variables ─────────────────────────────────────────────────────── */

:root {
  --bg: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-hover: #F5F5F5;
  --bg-active: #EBEBEB;
  --text: #111111;
  --text-secondary: #555555;
  --text-muted: #888888;
  --border: #DDDDDD;
  --border-light: #EEEEEE;
  --accent: #111111;
  --accent-light: #333333;
  --primary: #111111;
  --primary-hover: #333333;
  --primary-light: #F0F0F0;
  --success: #1a8754;
  --success-light: #d4edda;
  --danger: #dc3545;
  --danger-light: #f8d7da;
  --warning: #ffc107;
  --warning-light: #fff3cd;
 --info: #555555;
  --info-light: #F0F0F0;
  --radius: 0px;
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --radius-xs: 0px;
  --shadow: none;
  --shadow-md: none;
  --shadow-lg: none;
  --transition: 200ms ease;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas, monospace;

  /* ─── SD Domain Colors ─── */
  --sd-fundamentals: #2563EB;
  --sd-data: #059669;
  --sd-architecture: #7C3AED;
  --sd-communication: #0891B2;
  --sd-scaling: #DC2626;
  --sd-ml: #C026D3;
  --sd-reliability: #D97706;
  --sd-cross: #64748B;
}

/* ─── Mind Map Container ──────────────────────────────────────────────── */

.mindmap-container {
  width: 100%;
  height: calc(100vh - 120px);
  min-height: 400px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  position: relative;
}

#screen-mindmap {
  padding: 0 12px;
}

/* .mindmap-header removed in 0084 */

/* ─── Mind Map Node Styles (0048: SD Theme) ──────────────────────────── */

.mm-node {
  padding: 4px 10px;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: default;
  line-height: 1.4;
  contain: layout style;
}

/* ─── Performance: CSS containment (0052, fixed 0091) ──────────────────── */
/* contain:layout removed — it caused coordinate-calculation bugs during zoom
   (getBoundingClientRect / offsetTop values become wrong inside a layout-
   containment boundary when the inner .map-canvas is CSS-transformed). */
.mindmap-container { contain: style; overflow: hidden; }

/* ─── Level-of-Detail (0052) ──────────────────────────────────────────── */
.mm-lod-minimal .mm-label,
.mm-lod-minimal .mm-icon,
.mm-lod-minimal .mm-badge,
.mm-lod-minimal .mm-play-badge { display: none !important; }
.mm-lod-minimal .mm-node { min-width: 12px; min-height: 12px; padding: 2px; border-radius: 50%; }

.mm-lod-medium .mm-icon,
.mm-lod-medium .mm-badge,
.mm-lod-medium .mm-play-badge { display: none !important; }
.mm-lod-medium .mm-label { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Viewport culling helper (0052) */
.mm-culled { visibility: hidden !important; }

.mm-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.mm-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.mm-badge {
  font-size: 12px;
  background: var(--text-muted);
  color: var(--bg);
  border-radius: 0;
  padding: 0 5px;
  margin-left: 4px;
  line-height: 1.6;
}

/* ── Node type sizing (AC-3: domain largest, detail smallest) ────────── */

.mm-domain {
  font-size: 16px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 0;
  border-width: 2px;
}

.mm-service {
  font-size: 14px;
  font-weight: 500;
  padding: 4px 10px;
}

.mm-feature {
  font-size: 12px;
  font-weight: 400;
  padding: 3px 8px;
}

.mm-detail {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
  padding: 2px 6px;
  border-radius: 0;
}

/* ── Category colors — domain backgrounds: light=border differentiation, dark=subtle fills ── */

.mm-domain.mm-cat-fundamentals { background: var(--sd-fundamentals); color: #fff; border: 2px solid var(--sd-fundamentals); border-style: solid; }
.mm-domain.mm-cat-storage { background: var(--sd-data); color: #fff; border: 2px solid var(--sd-data); }
.mm-domain.mm-cat-database { background: var(--sd-architecture); color: #fff; border: 2px solid var(--sd-architecture); }
.mm-domain.mm-cat-networking { background: var(--sd-communication); color: #fff; border: 2px solid var(--sd-communication); }
.mm-domain.mm-cat-security { background: var(--sd-scaling); color: #fff; border: 2px solid var(--sd-scaling); }
.mm-domain.mm-cat-ml { background: var(--sd-ml); color: #fff; border: 2px solid var(--sd-ml); }
.mm-domain.mm-cat-management { background: var(--sd-reliability); color: #fff; border: 2px solid var(--sd-reliability); }
.mm-domain.mm-cat-cross { background: var(--sd-cross); color: #fff; border: 2px solid var(--sd-cross); }

[data-theme="dark"] .mm-domain.mm-cat-fundamentals { background: var(--sd-fundamentals); color: #fff; border-color: var(--sd-fundamentals); border-style: solid; }
[data-theme="dark"] .mm-domain.mm-cat-storage { background: var(--sd-data); color: #fff; border-color: var(--sd-data); border-style: solid; }
[data-theme="dark"] .mm-domain.mm-cat-database { background: var(--sd-architecture); color: #fff; border-color: var(--sd-architecture); border-style: solid; }
[data-theme="dark"] .mm-domain.mm-cat-networking { background: var(--sd-communication); color: #fff; border-color: var(--sd-communication); border-style: solid; }
[data-theme="dark"] .mm-domain.mm-cat-security { background: var(--sd-scaling); color: #fff; border-color: var(--sd-scaling); border-style: solid; }
[data-theme="dark"] .mm-domain.mm-cat-ml { background: var(--sd-ml); color: #fff; border-color: var(--sd-ml); border-style: solid; }
[data-theme="dark"] .mm-domain.mm-cat-management { background: var(--sd-reliability); color: #fff; border-color: var(--sd-reliability); border-style: solid; }
[data-theme="dark"] .mm-domain.mm-cat-cross { background: var(--sd-cross); color: #fff; border-color: var(--sd-cross); border-style: solid; }

/* ── Category colors — service borders (AC-1) ────────────────────────── */

.mm-service.mm-cat-fundamentals { border-left: 3px solid var(--sd-fundamentals); }
.mm-service.mm-cat-storage { border-left: 3px solid var(--sd-data); }
.mm-service.mm-cat-database { border-left: 3px solid var(--sd-architecture); }
.mm-service.mm-cat-networking { border-left: 3px solid var(--sd-communication); }
.mm-service.mm-cat-security { border-left: 3px solid var(--sd-scaling); }
.mm-service.mm-cat-ml { border-left: 3px solid var(--sd-ml); }
.mm-service.mm-cat-management { border-left: 3px solid var(--sd-reliability); }
.mm-service.mm-cat-cross { border-left: 3px solid var(--sd-cross); }

/* ── Category colors — feature tint ───────────────────────────────────── */

.mm-feature.mm-cat-fundamentals { border-left: 2px solid color-mix(in srgb, var(--sd-fundamentals), transparent 60%); }
.mm-feature.mm-cat-storage { border-left: 2px solid color-mix(in srgb, var(--sd-data), transparent 60%); }
.mm-feature.mm-cat-database { border-left: 2px solid color-mix(in srgb, var(--sd-architecture), transparent 60%); }
.mm-feature.mm-cat-networking { border-left: 2px solid color-mix(in srgb, var(--sd-communication), transparent 60%); }
.mm-feature.mm-cat-security { border-left: 2px solid color-mix(in srgb, var(--sd-scaling), transparent 60%); }
.mm-feature.mm-cat-ml { border-left: 2px solid color-mix(in srgb, var(--sd-ml), transparent 60%); }
.mm-feature.mm-cat-management { border-left: 2px solid color-mix(in srgb, var(--sd-reliability), transparent 60%); }

/* ── Weak area red glow (AC-4: score < 0.6) ──────────────────────────── */

.mm-weak {
  box-shadow: 0 0 8px var(--sd-scaling);
  border-color: var(--sd-scaling);
}

/* ── Exam weight scaling for domain nodes ─────────────────────────────── */

/* Node weight scale — use font-size/padding so SVG connectors stay aligned
   (CSS transform: scale() shifts the visual position but leaves offsetLeft /
   offsetTop unchanged, causing connector-line misalignment during zoom). */
.mm-scale-lg { font-size: 1.08em; padding: 5px 12px; }
.mm-scale-md { font-size: 1.04em; padding: 4px 11px; }

/* ── Play badge for clickable video nodes (0049) ─────────────────────── */

.mm-play-badge {
  font-size: 12px;
  margin-left: 4px;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.mm-playable {
  cursor: pointer;
}

.mm-playable:hover {
  box-shadow: none;
}

.mm-playable:hover .mm-play-badge {
  opacity: 1;
}

/* ── Quiz Overlay — Mastery Encoding (0050) ───────────────────────────── */
.mm-mastery-high {
  border: 2.5px solid #27ae60 !important;
  opacity: 1;
}
.mm-mastery-medium {
  border: 2px solid #f1c40f !important;
  opacity: 0.92;
}
.mm-mastery-low {
  border: 2px solid #e74c3c !important;
  box-shadow: 0 0 6px rgba(231, 76, 60, 0.4);
}
.mm-mastery-none {
  border: 1.5px dashed var(--border) !important;
  opacity: 0.85;
}

/* ── Quiz Tooltip (0050) ──────────────────────────────────────────────── */
.mm-quiz-tooltip {
  position: fixed;
  z-index: 10000;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  box-shadow: none;
  padding: 12px 16px;
  min-width: 220px;
  max-width: 320px;
  font-size: 0.88rem;
  color: var(--text);
  pointer-events: auto;
  transform: translateX(-50%);
}
.mm-quiz-tooltip.hidden {
  display: none;
}
.mm-tip-title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.mm-tip-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.mm-tip-stat {
  margin: 4px 0;
  line-height: 1.4;
}
.mm-tip-quiz-link {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm, 4px);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}
.mm-tip-quiz-link:hover {
  background: var(--info);
}

/* ── Search (now inside .mm-controls per 0084) ─────────────────────── */
.mm-search {
  display: flex;
  align-items: center;
  gap: 8px;
}
#mm-search-input {
  flex: 1;
  max-width: 400px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 4px);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}
#mm-search-input:focus {
  border-color: var(--accent);
  box-shadow: none;
}
.mm-search-count {
  font-size: 0.82rem;
  color: var(--text-secondary, #888);
  white-space: nowrap;
}
/* ── Filters (now inside .mm-controls per 0080) ─────────────────────── */
.mm-filters {
  display: flex;
  gap: 6px;
  padding: 0;
  margin-left: auto;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.mm-filter-btn {
  font-size: 0.82rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm, 4px);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.mm-filter-btn:hover {
  background: var(--surface-hover, #eee);
}
.mm-filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
/* Dimmed node class for search/filter results */
.mm-dimmed {
  opacity: 0.15 !important;
  transition: opacity 0.2s;
}
.mm-search-highlight {
  outline: 2px solid var(--accent) !important;
  outline-offset: 2px;
  opacity: 1 !important;
}

/* ── Legacy mindmap-node classes (backward compat) ────────────────────── */

.mindmap-node {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text);
}

.mindmap-node-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.mindmap-node[data-category="fundamentals"] { border-left: 3px solid var(--sd-fundamentals); }
.mindmap-node[data-category="storage"] { border-left: 3px solid var(--sd-data); }
.mindmap-node[data-category="database"] { border-left: 3px solid var(--sd-architecture); }
.mindmap-node[data-category="networking"] { border-left: 3px solid var(--sd-communication); }
.mindmap-node[data-category="security"] { border-left: 3px solid var(--sd-scaling); }
.mindmap-node[data-category="ml"] { border-left: 3px solid var(--sd-ml); }
.mindmap-node[data-category="management"] { border-left: 3px solid var(--sd-reliability); }

[data-theme="dark"] {
  --bg: #111111;
  --bg-card: #1A1A1A;
  --bg-hover: #222222;
  --bg-active: #2A2A2A;
  --text: #F0F0F0;
  --text-secondary: #AAAAAA;
  --text-muted: #777777;
  --border: #333333;
  --border-light: #222222;
  --accent: #F0F0F0;
  --accent-light: #DDDDDD;
  --primary: #F0F0F0;
  --primary-hover: #DDDDDD;
  --primary-light: #222222;
  --success: #3fb950;
  --success-light: #0d2818;
  --danger: #f85149;
  --danger-light: #2d1215;
  --warning: #d29922;
  --warning-light: #2d2208;
  --info: #555555;
  --info-light: #222222;
  --radius: 0px;
  --shadow: none;
  --shadow-md: none;
  --shadow-lg: none;

  /* Dark mode: keep subtle domain colors for navigation */
  --sd-fundamentals: #5B8DEF;
  --sd-data: #34D399;
  --sd-architecture: #A78BFA;
  --sd-communication: #22D3EE;
  --sd-scaling: #F87171;
  --sd-ml: #E879F9;
  --sd-reliability: #FBBF24;
  --sd-cross: #94A3B8;
}

[data-theme="dark"] .action-card--primary { --action-accent: #FF6B78; }
[data-theme="dark"] .action-card--mindmap { --action-accent: #5B8DEF; }
[data-theme="dark"] .action-card--video { --action-accent: #4FD1C5; }
[data-theme="dark"] .action-card--smart { --action-accent: #FF9A76; }
[data-theme="dark"] .action-card--catalog { --action-accent: #C77DFF; }
[data-theme="dark"] .action-card--cards { --action-accent: #FFD166; }

/* ── Dark theme mind map adjustments (AC-5) ──────────────────────────── */
[data-theme="dark"] .mm-node {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}
[data-theme="dark"] .mindmap-container {
  background: var(--bg);
  border-color: var(--border);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button { color: inherit; }

html { font-size: 16px; scroll-behavior: smooth; overscroll-behavior-y: none; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

/* ─── Screen Transitions ────────────────────────────────────────────────────── */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen:not(.hidden) {
  animation: fadeIn 0.4s ease;
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 0;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ─── Container ─────────────────────────────────────────────────────────────── */

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ─── Header ────────────────────────────────────────────────────────────────── */

.header {
  background: var(--text);
  color: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: none;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--bg);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  /* 92.3 — Allow title flex area to shrink without overflowing */
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

/* 92.1/92.2 — Title truncation so it never pushes other header elements */
.logo-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo:hover { text-decoration: none; }
.logo:active { opacity: 0.8; }
.logo:focus-visible { outline: 2px solid var(--bg); outline-offset: 3px; border-radius: 0; }
.logo-icon { display: inline-flex; align-items: center; }
.logo-icon .icon { width: 1.4rem; height: 1.4rem; }
.logo-sub { color: color-mix(in srgb, var(--bg) 70%, transparent); font-weight: 600; }

/* ─── Header Back Button (87.3) ─────────────────────────────────────────────── */

.header-back {
  color: rgba(255, 255, 255, 0.9);
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.header-back-label {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.header-actions { display: flex; gap: 8px; flex-shrink: 0; }  /* 92.3 — never shrink action buttons */

/* ─── Mobile header button labels (87.1) ────────────────────────────────────── */

.btn-label {
  display: none;
  font-size: 0.75rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.75);
  pointer-events: none;
}

.progress-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg);
}

.progress-badge:empty { display: none; }

/* ─── Score Display ─────────────────────────────────────────────────────────── */

.score-display {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  flex-shrink: 0;  /* 92.3 — keep scores fixed, let title shrink */
}

.score-display-item {
  font-variant-numeric: tabular-nums;
}

.score-display-streak {
  color: var(--text);
}

/* ─── Compact Header ───────────────────────────────────────────────────────── */

.header--compact .header-inner {
  height: 44px;
}

.header--compact .logo {
  font-size: 0.95rem;
}

.header--compact .logo-icon .icon {
  width: 1.1rem;
  height: 1.1rem;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
}
.btn-secondary:hover { background: var(--bg-active); }

.btn-ghost {
  background: transparent;
  color: inherit;
  border: none;
}
.btn-ghost:hover { background: rgba(255,255,255,.1); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-light); }

/* ─── Hero ──────────────────────────────────────────────────────────────────── */

.hero {
  text-align: left;
  padding: 48px 0 32px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--text);
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background-clip: unset;
}

.text-accent { color: var(--text); }

.hero-sub {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

/* ─── Quick Actions ─────────────────────────────────────────────────────────── */

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.action-card {
  background: var(--bg);
  border: 2px solid var(--text);
  border-radius: 0;
  padding: 24px;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition);
  font-family: var(--font);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-card:hover {
  background: var(--bg-hover);
}

.action-card--primary { --action-accent: #E63946; }
.action-card--mindmap { --action-accent: #1D3557; }
.action-card--video { --action-accent: #2A9D8F; }
.action-card--smart { --action-accent: #E76F51; }
.action-card--catalog { --action-accent: #6A0572; }
.action-card--cards { --action-accent: #A16207; }

.action-card--primary:hover {}

.action-card--quick {}
.action-card--weak {}

.action-icon {
  display: none;
}

.action-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-bottom: 12px;
  flex-shrink: 0;
  background: var(--action-accent, var(--text));
}

.action-label {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.action-desc {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.action-card--primary .action-desc { color: var(--text-muted); }

/* ─── CTA Stripe ────────────────────────────────────────────────────────────── */

.cta-stripe {
  display: block;
  width: 100%;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: 16px 0;
  border: none;
  cursor: pointer;
  margin: 32px 0;
  font-family: var(--font);
}
.cta-stripe:hover { opacity: 0.85; }

/* ─── Section Title ─────────────────────────────────────────────────────────── */

.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Quiz Grid ─────────────────────────────────────────────────────────────── */

.quiz-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 32px;
}

.quiz-row {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: background var(--transition);
  box-shadow: none;
}

.quiz-row:hover {
  background: var(--bg-hover);
}

.quiz-row-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.quiz-row-info { flex: 1; min-width: 0; }

.quiz-row-title {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quiz-row-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  margin-top: 2px;
}

.quiz-row-progress {
  flex-shrink: 0;
  width: 60px;
}

.mini-progress {
  height: 4px;
  background: var(--border);
  border-radius: 0;
  overflow: hidden;
}

.mini-progress-fill {
  height: 100%;
  background: var(--text);
  border-radius: 0;
  transition: width 0.3s ease;
}

.quiz-row-score {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* ─── Quiz Top Bar ──────────────────────────────────────────────────────────── */

.quiz-top-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 56px;
  z-index: 90;
  box-shadow: none;
}

.quiz-progress-info {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex: 1;
  justify-content: center;
}

.quiz-timer {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.quiz-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
}

.quiz-progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

/* ─── Question Card ─────────────────────────────────────────────────────────── */

.quiz-container { padding-top: 24px; padding-bottom: 80px; }

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 28px;
  box-shadow: none;
  margin-bottom: 20px;
}

.question-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 0;
  border: 1px solid var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: transparent;
}

.badge-category { color: var(--text-secondary); }
.badge-section { color: var(--text-secondary); }
.badge-type { color: var(--text-muted); }

[data-theme="dark"] .badge-section { color: var(--text-secondary); }

.question-text {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 24px;
}

.question-text p { margin-bottom: 12px; }
.question-text img { border-radius: var(--radius-sm); margin: 8px 0; }
.question-text code {
  background: var(--bg-hover);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.question-text pre {
  background: var(--bg-hover);
  padding: 12px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 8px 0;
}
.question-text ul, .question-text ol {
  margin: 8px 0 8px 24px;
}

/* ─── Mermaid Diagrams ──────────────────────────────────────────────────────── */

.mermaid-container {
  margin: 16px 0;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow-x: auto;
  text-align: center;
}
.mermaid-container svg {
  max-width: 100%;
  height: auto;
}
.mermaid-fallback {
  text-align: left;
  white-space: pre-wrap;
  font-size: 0.85em;
  color: var(--text-secondary);
}

/* ─── Answers ───────────────────────────────────────────────────────────────── */

.answers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.answer-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.5;
  width: 100%;
  color: var(--text);
}

.answer-btn:hover:not(.answer-btn--disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
}

.answer-btn--selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.answer-btn--correct {
  border: 2px solid var(--success) !important;
  background: var(--success-light) !important;
}

.answer-btn--wrong {
  border: 2px solid var(--danger) !important;
  background: var(--danger-light) !important;
}

.answer-btn--disabled {
  cursor: default;
  opacity: 0.88;
}

.answer-btn--disabled:not(.answer-btn--correct):not(.answer-btn--wrong):not(.answer-btn--selected) {
  opacity: 0.5;
}

.answer-letter {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 1px;
}

.answer-btn--selected .answer-letter {
  background: var(--text);
  color: var(--bg);
}

.answer-btn--correct .answer-letter {
  background: var(--success);
  color: #fff;
}

.answer-btn--wrong .answer-letter {
  background: var(--danger);
  color: #fff;
}

.answer-content { flex: 1; }
.answer-content p { margin-bottom: 4px; }
.answer-content p:last-child { margin-bottom: 0; }

/* diff highlights for differing words across answers */
.diff-hl {
  background: rgba(255, 193, 7, 0.25);
  color: inherit;
  border-radius: 0;
  padding: 1px 2px;
  font-weight: 600;
}
.answer-btn--correct .diff-hl {
  background: rgba(40, 167, 69, 0.22);
}
.answer-btn--wrong .diff-hl {
  background: rgba(220, 53, 69, 0.22);
}
[data-theme="dark"] .diff-hl {
  background: rgba(255, 193, 7, 0.30);
}
[data-theme="dark"] .answer-btn--correct .diff-hl {
  background: rgba(40, 167, 69, 0.30);
}
[data-theme="dark"] .answer-btn--wrong .diff-hl {
  background: rgba(220, 53, 69, 0.30);
}

.answer-indicator {
  flex-shrink: 0;
  font-size: 1.1rem;
  margin-top: 2px;
}

/* ─── Confidence Row ────────────────────────────────────────────────────────── */

.confidence-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 0;
}

.confidence-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-right: 4px;
}

.confidence-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--info);
  background: var(--bg-card);
  color: var(--info);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.confidence-btn:hover {
  border-color: var(--info);
  background: var(--info);
  color: #fff;
}

.confidence-btn--selected {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

/* ─── Explanation ───────────────────────────────────────────────────────────── */

.explanation {
  margin-top: 20px;
  padding: 20px;
  background: var(--info-light);
  border-radius: 0;
  border-left: 4px solid var(--info);
}

[data-theme="dark"] .explanation {
  background: var(--info-light);
}

.explanation-title {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  color: var(--info);
}

.explanation-text {
  font-size: 0.93rem;
  line-height: 1.7;
}

.explanation-text p { margin-bottom: 8px; }
.explanation-text p:last-child { margin-bottom: 0; }
.explanation-text a { word-break: break-all; }

.feedbacks {
  margin-top: 12px;
  font-size: 0.87rem;
}

.feedback-item {
  padding: 8px 0;
  border-top: 1px solid var(--border-light);
}

.feedback-item strong { color: var(--text); }

/* ─── Quiz Nav ──────────────────────────────────────────────────────────────── */

.quiz-nav {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.question-nav-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.nav-dot {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  color: var(--text-muted);
}

.nav-dot:hover { border-color: var(--primary); }
.nav-dot--current { border-color: var(--primary); background: var(--primary-light); color: var(--text); font-weight: 800; }
.nav-dot--answered { background: var(--bg-active); color: var(--text); }
.nav-dot--correct { background: var(--success-light); border-color: var(--success); color: var(--success); }
.nav-dot--wrong { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }

/* ─── Results ───────────────────────────────────────────────────────────────── */

#screen-results .container { padding-top: 40px; padding-bottom: 40px; }

.results-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 40px;
  text-align: center;
  box-shadow: none;
}

.results-icon { font-size: 3rem; margin-bottom: 8px; }

.results-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 24px;
}

.results-score { margin-bottom: 24px; }

.score-circle {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto;
}

.score-ring {
  transform: rotate(-90deg);
  width: 140px;
  height: 140px;
}

.score-ring-bg { stroke: var(--border); }

.score-ring-fg {
  stroke: var(--success);
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.score-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: 800;
}

.results-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 20px;
}

.stat { text-align: center; }

.stat-num {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.results-pass {
  font-size: 1rem;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: 0;
  display: inline-block;
  margin-bottom: 24px;
}

.results-pass--pass { background: var(--success-light); color: var(--success); font-weight: 900; }
.results-pass--fail { background: var(--danger-light); color: var(--danger); font-weight: 400; }

.results-breakdown {
  text-align: left;
  margin: 24px 0;
}

.breakdown-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.87rem;
}

.breakdown-label { flex: 1; }

.breakdown-bar {
  width: 120px;
  height: 6px;
  background: var(--border);
  border-radius: 0;
  overflow: hidden;
}

.breakdown-bar-fill {
  height: 100%;
  border-radius: 0;
  transition: width 0.5s ease;
}

.breakdown-score {
  width: 48px;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ─── Bonus Tags ────────────────────────────────────────────────────────────── */

.bonus-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 16px 0;
}

.bonus-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 0;
  border: 1px solid var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  animation: slideInRight 0.4s ease both;
}

.bonus-tag--speed { background: #e3f2fd; color: #1565c0; }
.bonus-tag--streak { background: #e8f5e9; color: #2e7d32; }
.bonus-tag--pb { background: #f3e5f5; color: #7b1fa2; }
.bonus-tag--thorough { background: #fff3e0; color: #e65100; }

[data-theme="dark"] .bonus-tag--speed { background: #1e3a5f; color: #64b5f6; }
[data-theme="dark"] .bonus-tag--streak { background: #1b5e20; color: #81c784; }
[data-theme="dark"] .bonus-tag--pb { background: #4a148c; color: #ce93d8; }
[data-theme="dark"] .bonus-tag--thorough { background: #3e2723; color: #ffb74d; }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.results-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Progress Screen ───────────────────────────────────────────────────────── */

#screen-progress .container { padding-top: 32px; padding-bottom: 40px; }

.progress-overview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 24px;
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  text-align: center;
}

.progress-stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  display: block;
}

.progress-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.progress-projection {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 20px 24px;
  margin-bottom: 32px;
  font-size: 0.88rem;
}

.progress-projection-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.progress-projection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 24px;
}

.progress-projection-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.progress-projection-label {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.progress-projection-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.progress-projection-placeholder {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}

.progress-projection-complete {
  text-align: center;
  font-weight: 700;
  padding: 8px 0;
}

.progress-categories {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
}

.progress-cat-row {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-cat-name { flex: 1; font-weight: 600; font-size: 0.9rem; }

.progress-cat-bar {
  width: 100px;
  height: 6px;
  background: var(--border);
  border-radius: 0;
  overflow: hidden;
}

.progress-cat-bar-fill {
  height: 100%;
  background: var(--success);
  border-radius: 0;
}

.progress-cat-pct {
  width: 40px;
  text-align: right;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.progress-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ─── Action Dropdowns (0112, 0115) ─────────────────────────────────────────── */

.action-dropdown-wrap {
  position: relative;
}

.action-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  min-width: 200px;
  z-index: 100;
  padding: 4px 0;
  animation: action-dd-in .12s ease-out;
}
@keyframes action-dd-in {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.action-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.action-dropdown-item:hover {
  background: var(--bg-hover);
}
.action-dropdown-item .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ─── Video Training Action Card (0098) ─────────────────────────────────────── */

.action-card--video {
  background: var(--bg);
  color: var(--text);
  border-color: var(--text);
}

/* ─── Video Training Screen (0098) ──────────────────────────────────────────── */

.vt-header {
  text-align: center;
  margin-bottom: 24px;
  padding-top: 16px;
}

.vt-progress-info {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
}

.vt-topic-counter {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.vt-phase-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  background: var(--bg-hover);
  padding: 2px 10px;
  border-radius: 0;
}

.vt-topic-name {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0;
}

/* Empty state */
.vt-empty {
  text-align: center;
  padding: 60px 20px;
}

.vt-empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.vt-empty p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Video phase */
.vt-video-phase {
  max-width: 800px;
  margin: 0 auto;
}

.vt-video-info {
  margin-bottom: 12px;
}

.vt-lecture-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.vt-video-wrapper {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  background: #000;
  margin-bottom: 16px;
}

.vt-video-player {
  width: 100%;
  display: block;
  max-height: 480px;
}

.vt-video-playlist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.vt-playlist-btn {
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.vt-playlist-btn--active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.vt-video-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 8px 0;
}

/* Quiz phase */
.vt-quiz-phase {
  max-width: 720px;
  margin: 0 auto;
}

.vt-quiz-progress {
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.vt-quiz-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Topic transition */
.vt-transition {
  text-align: center;
  padding: 60px 20px;
}

.vt-transition-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  color: var(--success);
}

.vt-transition-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.vt-transition-score {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.vt-transition-next {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Session summary */
.vt-summary {
  text-align: center;
  padding: 40px 20px;
}

.vt-summary-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  color: var(--warning);
}

.vt-summary-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 24px;
}

.vt-summary-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.vt-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.vt-stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.vt-stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.vt-summary-breakdown {
  max-width: 500px;
  margin: 0 auto 24px;
  text-align: left;
}

.vt-breakdown-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.vt-breakdown-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 10px 14px;
  border-radius: 0;
  margin-bottom: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.vt-breakdown-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-right: auto;
}

.vt-breakdown-score {
  font-size: 0.85rem;
  font-weight: 600;
}

.vt-row--good .vt-breakdown-score { color: var(--success); }
.vt-row--ok .vt-breakdown-score { color: var(--warning); }
.vt-row--weak .vt-breakdown-score { color: var(--danger); }

/* ─── 0102: Service-Level Bayesian VT Enhancements ─────────────────────────── */

/* Domain header in VT screen */
.vt-domain-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.vt-domain-name {
  font-weight: 600;
  color: var(--text);
}
.vt-service-status {
  padding: 0.15rem 0.5rem;
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 600;
}
.vt-status--critical {
  background: color-mix(in srgb, var(--danger) 15%, var(--bg-card));
  color: var(--danger);
}
.vt-status--moderate {
  background: color-mix(in srgb, var(--warning) 15%, var(--bg-card));
  color: var(--warning);
}
.vt-status--mastered {
  background: color-mix(in srgb, var(--success) 15%, var(--bg-card));
  color: var(--success);
}

/* Tier source badges */
.vt-tier-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 0;
  margin-left: 0.5rem;
}
.vt-badge-failed {
  background: color-mix(in srgb, var(--danger) 15%, var(--bg-card));
  color: var(--danger);
}
.vt-badge-related {
  background: color-mix(in srgb, var(--warning) 15%, var(--bg-card));
  color: var(--warning);
}
.vt-badge-explore {
  background: var(--bg-hover);
  color: var(--text-muted);
}

/* Transition Bayesian mastery */
.vt-transition-bayesian {
  margin: 0.75rem 0;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.vt-mastery-label {
  color: var(--text-muted);
  font-weight: 500;
}
.vt-mastery-before {
  color: var(--text-muted);
  text-decoration: line-through;
}
.vt-mastery-after {
  font-weight: 700;
  color: var(--text);
}
.vt-improvement--up { color: var(--success); font-weight: 700; }
.vt-improvement--down { color: var(--danger); font-weight: 700; }
.vt-status-badge {
  padding: 0.1rem 0.4rem;
  border-radius: 0;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Summary: Tier breakdown grid */
.vt-summary-tier-breakdown {
  margin: 1rem 0;
}
.vt-tier-grid {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.vt-tier-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  background: var(--card-bg);
  border-radius: 0;
  border: 1px solid var(--border);
  min-width: 80px;
}
.vt-tier-score {
  font-size: 0.85rem;
  font-weight: 600;
}

/* Summary: Domain group headers */
.vt-domain-group-header {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
  padding: 0.5rem 0 0.25rem;
  margin-top: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Summary: Bayesian delta in breakdown row */
.vt-breakdown-bayesian {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
  margin-right: 0.5rem;
}

/* Summary: Tier breakdown in row */
.vt-breakdown-tiers {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

/* ─── 0103: Smart Quiz ─────────────────────────────────────────────────────── */

/* Home — Smart Quiz action card */
.action-card--smart {
  background: var(--bg);
  color: var(--text);
  border-color: var(--text);
}
.action-card--smart:hover { background: var(--bg-hover); }
.action-card--smart .action-desc { color: var(--text-muted); }

/* Config Screen */
.sq-config-section {
  margin-bottom: 1.25rem;
}
.sq-config-label {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.5rem;
}
.sq-strategy-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.sq-strategy-btn {
  padding: 0.5rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: border-color 0.2s, background 0.2s;
}
.sq-strategy-btn:hover {
  border-color: var(--accent);
}
.sq-strategy-btn--active {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
}

/* Quiz Config Icon Colors (0107) */
.sq-btn-icon { vertical-align: -0.15em; margin-right: 0.25rem; flex-shrink: 0; }
.sq-icon--accent { color: var(--accent); }
.sq-icon--danger { color: var(--danger); }
.sq-icon--warning { color: var(--warning); }
.sq-icon--info { color: var(--info); }

.sq-count-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sq-slider {
  flex: 1;
  accent-color: var(--accent);
}
.sq-toggles-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.sq-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.sq-preset-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.sq-preset-btn {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 0.8rem;
  transition: border-color 0.2s;
}
.sq-preset-btn:hover {
  border-color: var(--accent);
}

/* Domain/Service List */
.sq-domain-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}
.sq-domain-item {
  border-bottom: 1px solid var(--border);
}
.sq-domain-item:last-child { border-bottom: none; }
.sq-domain-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 0.85rem;
}
.sq-domain-header:hover {
  background: var(--bg-hover);
}
.sq-domain-toggle {
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s;
}
.sq-domain-toggle .icon {
  width: 0.75rem;
  height: 0.75rem;
}
.sq-domain-toggle.sq-expanded {
  transform: rotate(90deg);
}
.sq-domain-check,
.sq-service-check,
.sq-toggle input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 1rem;
  height: 1rem;
  margin: 0 0.25rem 0 0;
  border: 2px solid var(--text);
  border-radius: 2px;
  background: var(--bg);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  vertical-align: middle;
}
.sq-domain-check:checked,
.sq-service-check:checked,
.sq-toggle input[type="checkbox"]:checked {
  background: var(--text);
}
.sq-domain-check:checked::after,
.sq-service-check:checked::after,
.sq-toggle input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 0;
  width: 6px;
  height: 9px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.sq-domain-check:focus-visible,
.sq-service-check:focus-visible,
.sq-toggle input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
.sq-domain-check:hover,
.sq-service-check:hover,
.sq-toggle input[type="checkbox"]:hover {
  border-color: var(--text-muted);
}
.sq-domain-check:disabled,
.sq-service-check:disabled,
.sq-toggle input[type="checkbox"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.sq-domain-stats {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}
.sq-domain-mean {
  font-weight: 600;
  margin-left: 0.5rem;
}
.sq-service-list {
  padding-left: 1.5rem;
  display: none;
}
.sq-service-list.sq-expanded { display: block; }
.sq-service-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
}
.sq-service-item:hover {
  background: var(--bg-hover);
}
.sq-svc-status {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sq-svc-status--critical { background: var(--danger); }
.sq-svc-status--moderate { background: var(--warning); }
.sq-svc-status--mastered { background: var(--success); }
.sq-svc-status--unseen { background: var(--text-muted); opacity: 0.4; }
.sq-svc-attempts {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Empty warning */
.sq-empty-warning {
  text-align: center;
  padding: 1.5rem;
  background: color-mix(in srgb, var(--warning) 8%, transparent);
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

/* Config actions */
.sq-config-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}
.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1.05rem;
}

/* In-quiz: domain colour strip */
.sq-domain-strip {
  height: 4px;
  border-radius: 0;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid var(--text);
  background: transparent;
}

/* In-quiz: service badge with mastery dot */
.sq-service-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-hover);
  color: var(--text);
  font-size: 0.75rem;
}
.sq-mastery-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.sq-mastery-dot--critical { background: var(--danger); }
.sq-mastery-dot--moderate { background: var(--warning); }
.sq-mastery-dot--mastered { background: var(--success); }
.sq-mastery-dot--unseen { background: var(--text-muted); opacity: 0.4; }

/* In-quiz: tier badge */
.sq-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 0;
}
.sq-tier-badge .icon { width: 0.8rem; height: 0.8rem; }
.sq-tier--failed { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.sq-tier--low-sample { background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning); }
.sq-tier--unseen { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }

/* Adaptation indicator */
.sq-adapting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--accent);
  padding: 0.25rem 0;
  animation: sq-pulse 1.5s ease-in-out;
}
.sq-adapting-icon { width: 0.9rem; height: 0.9rem; }
@keyframes sq-pulse {
  0%, 100% { opacity: 0; }
  30%, 70% { opacity: 1; }
}

/* Results: Smart Quiz service breakdown */
.sq-results {
  text-align: left;
  max-width: 560px;
  margin: 1.5rem auto;
}
.sq-results-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.sq-summary-stat {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.sq-summary-stat strong {
  display: block;
  font-size: 1.1rem;
}
.sq-domain-group {
  margin-bottom: 1rem;
}
.sq-domain-group-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent);
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
.sq-svc-result-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
}
.sq-svc-result-name {
  font-weight: 600;
  min-width: 120px;
}
.sq-svc-result-before {
  color: var(--text-muted);
}
.sq-svc-result-after {
  font-weight: 700;
}
.sq-svc-result-delta {
  font-weight: 700;
  font-size: 0.8rem;
}
.sq-delta--up { color: var(--success); }
.sq-delta--down { color: var(--danger); }
.sq-svc-result-shift {
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  border-radius: 0;
  background: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success);
  font-weight: 600;
}
.sq-svc-result-ci {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.sq-svc-result-score {
  margin-left: auto;
  font-weight: 600;
}
.sq-results-recommendation {
  margin-top: 1rem;
  padding: 1rem;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
}
.sq-rec-title {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.sq-rec-title .icon { width: 1rem; height: 1rem; }
.sq-rec-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}
.sq-rec-item .icon { width: 0.85rem; height: 0.85rem; color: var(--danger); }

/* Progress: Service Mastery Heatmap */
.sq-heatmap-section {
  margin-top: 1.5rem;
}
.sq-heatmap {
  overflow-x: auto;
  margin-bottom: 1rem;
}
.sq-heatmap-grid {
  display: grid;
  gap: 2px;
  font-size: 0.75rem;
}
.sq-heatmap-domain {
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  min-width: 120px;
}
.sq-heatmap-cell {
  width: 24px;
  height: 24px;
  border-radius: 0;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sq-heatmap-cell--critical { background: color-mix(in srgb, var(--danger) 60%, var(--bg-card)); }
.sq-heatmap-cell--moderate { background: color-mix(in srgb, var(--warning) 60%, var(--bg-card)); }
.sq-heatmap-cell--mastered { background: color-mix(in srgb, var(--success) 60%, var(--bg-card)); }
.sq-heatmap-cell--unseen { background: var(--bg-hover); }
.sq-heatmap-cell[title]:hover {
  outline: 2px solid var(--accent);
  z-index: 1;
}
.sq-heatmap-domain-row {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 2px;
}

/* Heatmap Interactive (0116) */
.sq-heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.sq-heatmap-legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.sq-heatmap-dot {
  width: 12px;
  height: 12px;
  border-radius: 0;
  flex-shrink: 0;
}
.sq-heatmap-dot--critical { background: color-mix(in srgb, var(--danger) 60%, var(--bg-card)); }
.sq-heatmap-dot--moderate { background: color-mix(in srgb, var(--warning) 60%, var(--bg-card)); }
.sq-heatmap-dot--mastered { background: color-mix(in srgb, var(--success) 60%, var(--bg-card)); }
.sq-heatmap-dot--unseen   { background: var(--bg-hover); }
.sq-heatmap-domain--click {
  cursor: pointer;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
}
.sq-heatmap-domain--click:hover {
  background: var(--bg-hover);
  color: var(--accent);
}
.sq-heatmap-cell--active {
  outline: 2px solid var(--accent);
  box-shadow: none;
  z-index: 2;
}

/* Heatmap Detail Panel — 117: inline after the clicked row */
.sq-heatmap-detail {
  margin: 0.5rem 0;
  animation: sq-detail-in 0.25s ease-out;
}
.sq-heatmap-detail.hidden { display: none; }
@keyframes sq-detail-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sq-detail-card {
  padding: 1rem 1.25rem;
  border-radius: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--text);
  box-shadow: none;
}
.sq-detail--critical { border-left-color: var(--danger); }
.sq-detail--moderate { border-left-color: var(--warning); }
.sq-detail--mastered { border-left-color: var(--success); }
.sq-detail--unseen   { border-left-color: var(--text-tertiary); }
.sq-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.sq-detail-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.3;
}
.sq-detail-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}
.sq-detail-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}
.sq-detail-close:hover { color: var(--text-primary); }
.sq-detail-score {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.sq-detail-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-hover);
  border-radius: 0;
  overflow: hidden;
  max-width: 200px;
}
.sq-detail-bar-fill {
  height: 100%;
  border-radius: 0;
  transition: width 0.3s ease;
}
.sq-detail-bar--critical { background: var(--danger); }
.sq-detail-bar--moderate { background: var(--warning); }
.sq-detail-bar--mastered { background: var(--success); }
.sq-detail-bar--unseen   { background: var(--text-tertiary); }
.sq-detail-pct {
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 38px;
  color: var(--text-primary);
}
.sq-detail-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 0;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.sq-detail-badge--critical { background: color-mix(in srgb, var(--danger) 14%, var(--bg-card)); color: var(--danger); }
.sq-detail-badge--moderate { background: color-mix(in srgb, var(--warning) 14%, var(--bg-card)); color: color-mix(in srgb, var(--warning) 85%, #000); }
.sq-detail-badge--mastered { background: color-mix(in srgb, var(--success) 14%, var(--bg-card)); color: var(--success); }
.sq-detail-badge--unseen   { background: var(--bg-hover); color: var(--text-tertiary); }
.sq-detail-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}
.sq-detail-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.sq-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.sq-detail-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
@media (max-width: 600px) {
  .sq-detail-card { padding: 0.85rem 1rem; }
  .sq-detail-bar { max-width: 140px; }
}

/* 120 — Heatmap detail: video list (file:// only) */
.sq-detail-videos {
  margin-top: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
}
.sq-detail-videos-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.sq-detail-video-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
}
.sq-detail-video-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.5rem;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--text-primary);
  transition: background 0.15s;
}
.sq-detail-video-item:hover {
  background: var(--bg-hover);
}
.sq-detail-video-item .icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--accent);
}
.sq-detail-video-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sq-detail-video-time {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ─── 0105: Video Catalog ──────────────────────────────────────────────────── */

/* Home — Video Catalog action card */
.action-card--catalog {}

/* Overview */
.vc-overview {
  margin-bottom: 1.5rem;
}
.vc-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.vc-stat-completed { color: var(--success); font-weight: 600; }
.vc-stat-partial { color: var(--warning); font-weight: 600; }

/* Stacked progress bar */
.vc-progress-bar {
  height: 10px;
  border-radius: 0;
  background: var(--bg-hover);
  overflow: hidden;
  display: flex;
}
.vc-bar-completed { background: var(--success); }
.vc-bar-partial { background: var(--warning); }
.vc-prediction {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vc-prediction.hidden { display: none; }

/* Section accordions */
.vc-section {
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0;
  overflow: hidden;
  background: var(--bg-card);
}
.vc-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--bg-hover);
  border: none;
  width: 100%;
  text-align: left;
  color: var(--text-primary);
}
.vc-section-header:hover { background: color-mix(in srgb, var(--accent) 8%, var(--bg-hover)); }
.vc-section-chevron {
  transition: transform 0.2s;
  flex-shrink: 0;
}
.vc-section.vc-expanded .vc-section-chevron { transform: rotate(90deg); }
.vc-section-title { flex: 1; }
.vc-section-count {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
}
.vc-section-duration {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.vc-section-body {
  display: none;
  padding: 0;
}
.vc-section.vc-expanded .vc-section-body { display: block; }

/* Lecture rows */
.vc-lecture {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}
.vc-lecture:hover { background: var(--bg-hover); }
.vc-lecture-num {
  width: 2rem;
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
}
.vc-lecture-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vc-lecture-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 0;
  white-space: nowrap;
  flex-shrink: 0;
}
.vc-badge-completed { background: color-mix(in srgb, var(--success) 20%, var(--bg-card)); color: var(--success); }
.vc-badge-partial { background: color-mix(in srgb, var(--warning) 20%, var(--bg-card)); color: var(--warning); }
.vc-badge-unwatched { background: var(--bg-hover); color: var(--text-muted); }
.vc-lecture-play {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent);
  transition: background 0.15s;
}
.vc-lecture-play:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.vc-lecture-duration {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.vc-lecture-quiz {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 0;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}
.vc-lecture-quiz:hover {
  background: color-mix(in srgb, var(--accent) 80%, #000);
  transform: scale(1.05);
}
.vc-quiz-count {
  font-size: 0.7rem;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.vc-section-quiz-count {
  font-size: 0.75rem;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}
.vc-stat-duration {
  font-variant-numeric: tabular-nums;
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  /* 87.1 — Show labels below header action icons on mobile */
  .btn-label { display: block; }

  .header-actions .btn {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
    gap: 2px;
  }

  /* 87.3 — Hide back label text on mobile (arrow only) */
  .header-back-label { display: none; }

  /* 97.2 — Extend header background above the fold to prevent gap on mobile */
  .header::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 0;
    right: 0;
    height: 100px;
    background: inherit;
    z-index: -1;
  }

  /* 92.1 — Reduce title font-size on mobile so it fits comfortably */
  .logo { font-size: 0.9rem; gap: 6px; }
  .logo-icon .icon { width: 1.1rem; height: 1.1rem; }

}

@media (max-width: 375px) {
  /* 92.2 — On very narrow screens hide 'Quiz Trainer' sub-text */
  .logo-sub { display: none; }
}

@media (max-width: 640px) {
  .hero h1 { font-size: clamp(1.5rem, 8vw, 2rem); }
  .hero { padding: 32px 0 24px; }

  .quick-actions {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .action-card {
    padding: 20px 16px;
    min-height: 140px;
  }

  .quiz-row-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .quiz-row-meta {
    flex-wrap: wrap;
    row-gap: 2px;
  }

  .question-card { padding: 20px 16px; }

  .quiz-nav { flex-direction: column; }
  .quiz-nav .btn { width: 100%; }

  .results-stats { gap: 16px; }
  .results-card { padding: 24px 16px; }

  .progress-overview {
    grid-template-columns: repeat(2, 1fr);
  }

  .quiz-row { padding: 12px 16px; gap: 10px; }

  .nav-dot { width: 30px; height: 30px; font-size: 0.75rem; }

  /* 0098 — Video training responsive */
  .vt-video-actions { flex-direction: column; }
  .vt-quiz-actions { flex-direction: column; }
  .vt-summary-stats { gap: 16px; }
  .vt-video-player { max-height: 280px; }
  .vt-playlist-btn { max-width: 100%; }
}

/* ─── Lecture Reference ─────────────────────────────────────────────────── */
.lecture-ref {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.lecture-ref-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.lecture-ref-icon { font-size: 1.1rem; flex-shrink: 0; }

.lecture-ref-title {
  flex: 1;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.lecture-ref-watch {
  flex-shrink: 0;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 0;
  background: var(--text);
  color: var(--bg) !important;
  border: 1px solid var(--text);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lecture-ref-watch:hover {
  background: var(--primary-hover);
  color: var(--bg) !important;
  border-color: var(--primary-hover);
}

.lecture-ref-excerpt {
  margin: 0;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--card-bg));
  border-radius: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
  font-style: italic;
  max-height: 120px;
  overflow: hidden;
  position: relative;
}

.lecture-ref-excerpt::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 32px;
  background: linear-gradient(transparent, color-mix(in srgb, var(--accent) 6%, var(--card-bg)));
  pointer-events: none;
}

/* ─── Video Player Modal ─────────────────────────────────────────────────── */
.video-modal {
  max-width: 860px;
  width: 92%;
  padding: 0;
  overflow: hidden;
  text-align: left;
}

.video-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.video-modal-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-player {
  display: block;
  width: 100%;
  max-height: 60vh;
  background: #000;
}

/* ─── Modal ────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: modalFadeIn 0.18s ease;
}

.modal-overlay.hidden { display: none; }

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border: 2px solid var(--text);
  border-radius: 0;
  padding: 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: none;
  animation: modalSlideIn 0.2s ease;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.modal-message {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.modal-actions .btn {
  min-width: 100px;
}

/* ─── SVG Icon System (outline/stroke-based) ─────────────────────────────── */
.icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.125em;
  display: inline-block;
  flex-shrink: 0;
}
.icon-sm { width: 0.75em; height: 0.75em; }
.icon-lg { width: 1.5em; height: 1.5em; }
.icon-xl { width: 2em; height: 2em; }
.icon-action { width: 1.25em; height: 1.25em; }
/* Semantic color overrides */
.icon-green { color: var(--success); }
.icon-yellow { color: var(--warning); }
.icon-red { color: var(--danger); }
.icon-muted { color: var(--text-muted); }
.icon-accent { color: var(--accent); }

/* ─── Review Mode Banner ─────────────────────────────────────────────────── */
.review-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.9rem;
}
.review-banner.hidden { display: none !important; }
[data-theme="dark"] .review-banner { background: var(--text); color: var(--bg); }

/* ═══ Progressive Disclosure & Navigation (0058, 0084) ══════════════════ */
.mm-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  flex-wrap: wrap;
}
.mm-controls-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.mm-controls-center {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
  min-width: 0;
}
.mm-controls-center .mm-search {
  flex: 1;
  max-width: 400px;
  min-width: 120px;
}
.mm-controls-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
/* ── Sticky Compact Header (0077) ─────────────────────────────────────── */
/* ─── Unified Bottom Toolbar (0088) ──────────────────────────────────────── */

.mm-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}

.mm-bottom-bar.hidden { display: none; }

[data-theme="dark"] .mm-bottom-bar {
  background: rgba(17, 17, 17, 0.9);
  border-top-color: var(--border);
}

.mm-bar-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  gap: 2px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  white-space: nowrap;
}

.mm-bar-btn:hover { background: var(--hover-bg, rgba(0,0,0,0.06)); }
.mm-bar-btn:active { opacity: 0.75; }
.mm-bar-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.mm-bar-btn .icon { width: 18px; height: 18px; stroke: currentColor; fill: none; }

.mm-bar-filter.active {
  background: rgba(var(--primary-rgb, 17,17,17), 0.15);
  color: var(--primary);
  border-color: currentColor;
}

/* Mobile search overlay (0088) */
.mm-search-mobile {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--card-bg, #fff);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}

.mm-search-mobile.hidden { display: none; }

.mm-search-mobile input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

[data-theme="dark"] .mm-search-mobile {
  background: var(--bg-card);
  border-bottom-color: var(--border);
}
[data-theme="dark"] .mm-search-mobile input {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border);
}

/* Breadcrumb */
.mm-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 16px;
  font-size: 0.82rem;
  color: var(--text-secondary, #888);
  min-height: 24px;
  flex-wrap: wrap;
}
.mm-breadcrumb:empty { display: none; }
.mm-breadcrumb-item {
  cursor: pointer;
  color: var(--accent, #111);
  text-decoration: none;
  white-space: nowrap;
}
.mm-breadcrumb-item:hover { text-decoration: underline; }
.mm-breadcrumb-sep { color: var(--text-tertiary, #aaa); margin: 0 2px; }
.mm-breadcrumb-current { color: var(--text, #111); font-weight: 600; }

/* Mini-map */
.mm-minimap {
  position: absolute;
  bottom: 80px;
  right: 12px;
  width: 180px;
  height: 120px;
  border: 1px solid var(--border, #ddd);
  border-radius: 0;
  background: var(--bg, #fff);
  overflow: hidden;
  z-index: 20;
  box-shadow: none;
  cursor: pointer;
}
.mm-minimap canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.mm-minimap-viewport {
  position: absolute;
  border: 2px solid var(--text, #111);
  background: rgba(17, 17, 17, 0.08);
  border-radius: 0;
  pointer-events: auto;   /* allow drag-to-pan (0066 redo) */
  cursor: grab;
  transition: left 0.05s ease, top 0.05s ease, width 0.15s ease, height 0.15s ease;
}
.mm-minimap-viewport:active { cursor: grabbing; }
[data-theme="dark"] .mm-minimap {
  background: var(--bg-card);
  border-color: var(--border);
}

/* ─── Mobile Touch Support (0060) ─────────────────────────────────────── */

/* Touch-action on mindmap container */
.mindmap-container { touch-action: none; }

/* Mobile breadcrumb compact */
.mm-breadcrumb-compact {
  display: none;
  font-size: 0.75rem;
  padding: 4px 8px;
  background: var(--card-bg, #fff);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  /* Full-screen mind map — leave room for bottom bar (~62px) */
  #screen-mindmap { padding: 0 !important; }
  #mindmap-container { height: calc(100vh - 56px - 62px) !important; min-height: 0 !important; }

  /* Hide desktop top controls, minimap button, and minimap on mobile */
  .mm-toolbar, #mm-controls, .mm-minimap, #mm-bar-minimap, #mm-minimap { display: none !important; }

  .mm-search input { width: 100%; }

  /* Compact breadcrumb */
  .mm-breadcrumb { display: none !important; }
  .mm-breadcrumb-compact { display: block; }

  /* Controls wrap on mobile (0084) */
  .mm-controls { flex-wrap: wrap; gap: 6px; }
  .mm-controls-center { flex-basis: 100%; order: 3; }
  .mm-controls-center .mm-search { max-width: 100%; }
  .mm-controls-right { flex-wrap: wrap; }

  /* Bottom bar responsive */
  .mm-bottom-bar { gap: 4px; padding: 6px 8px; }
  .mm-bar-btn { min-width: 44px; min-height: 44px; padding: 3px 6px; font-size: 0.75rem; }
}

[data-theme="dark"] .mm-breadcrumb-compact { background: var(--bg-card); border-color: var(--border); color: var(--text); }

/* ─── Node Inspector Panel (0062) ─────────────────────────────────────── */

.mm-node-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-left: 1px solid var(--border);
  box-shadow: none;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease-out;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.mm-node-panel.open { transform: translateX(0); }
.mm-node-panel.hidden { display: none; }

.mm-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#mm-panel-close {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mm-panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.mm-panel-body {
  padding: 16px;
  flex: 1;
  overflow-y: auto;
}

/* Mastery ring */
.mm-panel-mastery {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.mm-mastery-ring { flex-shrink: 0; }
.mm-mastery-label { font-size: 1.1rem; font-weight: 600; }

/* Stats grid */
.mm-panel-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.mm-stat-item {
  background: var(--hover-bg, #f5f5f5);
  border-radius: 0;
  padding: 10px;
  text-align: center;
}
.mm-stat-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text, #111);
}
.mm-stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary, #777);
  margin-top: 2px;
}

/* Children breakdown */
.mm-panel-children h4,
.mm-panel-questions h4 {
  font-size: 0.85rem;
  margin: 12px 0 8px;
  color: var(--text-secondary, #666);
}
.mm-panel-children ul,
.mm-panel-questions ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mm-panel-children li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  cursor: pointer;
  border-radius: 0;
}
.mm-panel-children li:hover { background: var(--hover-bg, #f0f0f0); }
.mm-child-name { flex: 1; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-child-bar {
  width: 60px;
  height: 6px;
  background: #e0e0e0;
  border-radius: 0;
  overflow: hidden;
}
.mm-child-bar-fill { height: 100%; border-radius: 0; }
.mm-child-pct { font-size: 0.75rem; color: var(--text-secondary, #777); width: 36px; text-align: right; }

/* Question list */
.mm-question-list li {
  padding: 4px 0;
  font-size: 0.82rem;
  color: var(--text-secondary, #555);
}

/* Panel actions */
.mm-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.mm-panel-actions .btn { width: 100%; justify-content: center; }

/* Google Search fallback button (0076) */
.btn-google-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-hover);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  margin-top: 10px;
  justify-content: center;
}
.btn-google-search:hover {
  background: var(--text, #111);
  color: var(--bg, #fff);
  border-color: var(--text, #111);
}
.mm-panel-actions .btn-google-search { width: 100%; margin-top: 0; }

/* Video button in panel (0067) */
#mm-panel-video {
  background: var(--text, #111);
  color: var(--bg, #fff);
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
#mm-panel-video:hover {
  background: var(--text-secondary, #555);
}

/* Dark mode */
[data-theme="dark"] .mm-node-panel {
  background: rgba(17, 17, 17, 0.95);
  border-left-color: var(--border);
  box-shadow: none;
}
[data-theme="dark"] .mm-panel-header { border-bottom-color: var(--border); }
[data-theme="dark"] .mm-stat-item { background: var(--bg-hover); }
[data-theme="dark"] .mm-stat-value { color: var(--text); }
[data-theme="dark"] .mm-child-bar { background: var(--border); }

/* Mobile: bottom sheet */
@media (max-width: 768px) {
  .mm-node-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 60vh;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    transform: translateY(100%);
    box-shadow: none;
  }
  .mm-node-panel.open { transform: translateY(0); }
}

/* ── Weak Area Highlight (0069) ──────────────────────────────────────── */

.mm-weak-highlight {
  outline: 2.5px solid #e74c3c !important;
  outline-offset: 3px;
  opacity: 1 !important;
  animation: mm-weak-pulse 2s ease-in-out infinite;
  position: relative;
  z-index: 5;
}

.mm-weak-critical {
  outline-color: #c0392b !important;
  box-shadow: 0 0 8px rgba(192, 57, 43, 0.4);
  animation: mm-weak-pulse-critical 1.5s ease-in-out infinite;
}

.mm-weak-warning {
  outline-color: #e67e22 !important;
  box-shadow: 0 0 6px rgba(230, 126, 34, 0.3);
}

.mm-weak-parent {
  opacity: 0.8 !important;
  border-left: 3px solid #e74c3c !important;
}

@keyframes mm-weak-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(231, 76, 60, 0.4); }
  50% { box-shadow: 0 0 12px rgba(231, 76, 60, 0.6); }
}

@keyframes mm-weak-pulse-critical {
  0%, 100% { box-shadow: 0 0 8px rgba(192, 57, 43, 0.4); }
  50% { box-shadow: 0 0 16px rgba(192, 57, 43, 0.6); }
}

[data-theme="dark"] .mm-weak-highlight {
  outline-color: #ff6b6b !important;
}

[data-theme="dark"] .mm-weak-critical {
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.4);
}

.mm-panel-weak-detail h4 {
  font-size: 0.95rem;
  margin: 0.5rem 0 0.25rem;
  color: #e74c3c;
}

.mm-weak-tip {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

[data-theme="dark"] .mm-panel-weak-detail h4 {
  color: #ff6b6b;
}

/* ── Flashcard Training Home Section (0070) ────────────────────────── */

.flashcard-section {
  display: none;
}

.btn-cards-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: var(--text, #111);
  color: var(--bg, #fff);
  border: none;
  border-radius: 0;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: none;
}

.btn-cards-primary:hover {
  transform: translateY(-2px);
  box-shadow: none;
}

.btn-cards-icon {
  font-size: 1.5rem;
}

.btn-cards-text {
  display: block;
  font-size: 1.1rem;
}

.btn-cards-sub {
  display: block;
  font-size: 0.8rem;
  opacity: 0.9;
}

[data-theme="dark"] .btn-cards-primary {
  background: var(--text, #F0F0F0);
  box-shadow: none;
}

[data-theme="dark"] .btn-cards-primary:hover {
  box-shadow: none;
}

/* ── Flashcard Training Screen (0070) ────────────────────────────────── */

.card-screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

#card-progress {
  font-size: 0.9rem;
  color: var(--text-muted, #888);
}

.card-empty-state,
.card-complete-state {
  text-align: center;
  padding: 3rem 1.5rem;
  font-size: 1.1rem;
  color: var(--text-muted, #888);
}

.card-empty-state p,
.card-complete-state p {
  margin-bottom: 1.5rem;
}

.card-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  perspective: 1200px;
}

.card-flip {
  width: 100%;
  max-width: 640px;
  min-height: 300px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

.card-flip.flipped {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  backface-visibility: hidden;
  border-radius: 0;
  padding: 2rem;
  box-shadow: none;
  background: var(--card-bg, #fff);
  min-height: 300px;
  overflow-y: auto;
}

.card-front {
  position: relative;
}

.card-back {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  transform: rotateY(180deg);
}

.card-front .card-question {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text, #333);
}

.card-front .card-question p {
  margin: 0 0 0.5rem;
}

.card-front .card-question img {
  max-width: 100%;
  height: auto;
  border-radius: 0;
}

.card-front .card-options {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.card-front .card-options li {
  padding: 0.5rem 0.75rem;
  margin: 0.25rem 0;
  background: var(--bg-alt, #f5f5f5);
  border-radius: 0;
  font-size: 0.95rem;
}

.card-front .card-options li p {
  margin: 0;
  display: inline;
}

.card-back h4 {
  margin: 0 0 0.5rem;
  color: var(--accent, #111);
}

.card-back .card-answer {
  font-weight: 600;
  color: var(--success, #16a34a);
  margin-bottom: 1rem;
}

.card-back .card-answer p {
  display: inline;
  margin: 0;
}

.card-back .card-explanation {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted, #666);
  max-height: 400px;
  overflow-y: auto;
}

.card-back .card-explanation img {
  max-width: 100%;
  height: auto;
  border-radius: 0;
  margin: 0.5rem 0;
}

.card-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
}

.btn-show-answer {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  background: var(--text, #111);
  color: var(--bg, #fff);
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-show-answer:hover {
  background: var(--text-secondary, #555);
}

.card-rating-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.card-rate {
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0;
  cursor: pointer;
  color: var(--text);
  background: transparent;
  font-weight: 600;
  transition: background 0.15s;
}

.card-rate:hover {
  background: var(--bg-hover);
}

.card-rate-again { border-width: 2px; border-color: #ef4444; background: #ef4444; color: #fff; }
.card-rate-hard  { border-width: 1px; border-color: #f59e0b; background: #f59e0b; color: #fff; }
.card-rate-good  { border-width: 1px; border-color: #22c55e; background: #22c55e; color: #fff; }
.card-rate-easy  { border-width: 1px; border-color: #3b82f6; background: #3b82f6; color: #fff; }

.card-rate .card-rate-interval {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.85;
  margin-top: 2px;
}

[data-theme="dark"] .card-front,
[data-theme="dark"] .card-back {
  background: var(--bg-card, #1A1A1A);
  box-shadow: none;
}

[data-theme="dark"] .card-front .card-options li {
  background: var(--bg-hover, #222);
}

@media (max-width: 768px) {
  .card-container {
    padding: 1rem 0.5rem;
  }
  .card-flip {
    max-width: 100%;
    min-height: 250px;
  }
  .card-front,
  .card-back {
    padding: 1.25rem;
    min-height: 250px;
  }
  .card-rate {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
  .btn-show-answer {
    width: 100%;
    padding: 1rem;
  }
}

/* ─── Flashcard Analytics Dashboard (0072) ──────────────────────────────── */
.cards-summary { padding: 16px; max-width: 480px; margin: 0 auto; }
.deck-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.deck-stat {
  text-align: center;
  padding: 12px 8px;
  border-radius: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.deck-stat-count {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
}
.deck-stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  margin-top: 2px;
}
.deck-stat-due .deck-stat-count { color: #4a90d9; }
.deck-stat-new .deck-stat-count { color: #4a90d9; }
.deck-stat-learning .deck-stat-count { color: #e6a23c; }
.deck-stat-mature .deck-stat-count { color: #67c23a; }
.deck-stat-lapsed .deck-stat-count { color: #f56c6c; }

.deck-stats-grid .deck-stat:nth-child(4),
.deck-stats-grid .deck-stat:nth-child(5) {
  grid-column: span 1;
}
/* Center the last row if only 2 items */
.deck-stats-grid {
  justify-items: center;
}
.deck-stats-grid .deck-stat { width: 100%; }

.deck-retention { margin-bottom: 16px; }
.deck-retention-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.retention-trend { font-size: 1rem; }
.deck-retention-stats {
  display: flex;
  gap: 8px;
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: var(--text-muted, #888);
}
.retention-divider { opacity: 0.4; }

.deck-chart-bar {
  display: flex;
  height: 18px;
  border-radius: 0;
  overflow: hidden;
  background: var(--border, #e0e0e0);
}
.chart-seg { height: 100%; transition: width 0.3s; min-width: 0; }
.chart-seg-again { background: #f56c6c; }
.chart-seg-hard { background: #e6a23c; }
.chart-seg-good { background: #67c23a; }
.chart-seg-easy { background: #4a90d9; }

.deck-streak {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.streak-icon { font-size: 1.2rem; }
.streak-count { font-weight: 700; font-size: 1.1rem; }
.streak-label { color: var(--text-muted, #888); font-size: 0.85rem; }
.btn-start-review { width: 100%; padding: 14px; font-size: 1rem; }

/* Session progress bar */
.session-progress { padding: 8px 16px; max-width: 480px; margin: 0 auto 8px; }
.session-progress-bar {
  height: 6px;
  border-radius: 0;
  background: var(--border, #e0e0e0);
  overflow: hidden;
  margin-bottom: 6px;
}
.session-progress-fill {
  height: 100%;
  border-radius: 0;
  background: var(--text, #111);
  transition: width 0.3s;
  width: 0%;
}
.session-progress-info {
  font-size: 0.8rem;
  color: var(--text-muted, #888);
  display: flex;
  gap: 4px;
  align-items: center;
}
.session-time-est { margin-left: auto; }
.session-rating-dist {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  font-size: 0.75rem;
}
.session-dist {
  display: flex;
  align-items: center;
  gap: 3px;
}
.session-dist::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.session-dist-again::before { background: #f56c6c; }
.session-dist-hard::before { background: #e6a23c; }
.session-dist-good::before { background: #67c23a; }
.session-dist-easy::before { background: #4a90d9; }

/* ─── Successive Relearning (0046) ──────────────────────────────────────────── */

.card-criterion {
  display: inline-flex;
  gap: 4px;
  margin-left: 8px;
  align-items: center;
}
.criterion-dot {
  width: 10px;
  height: 10px;
  border: 2px solid var(--border, #ccc);
  background: transparent;
  display: inline-block;
}
.criterion-dot.criterion-hit {
  background: #67c23a;
  border-color: #67c23a;
}

.session-criterion-info {
  font-size: 0.8rem;
  color: var(--text-muted, #888);
  margin-top: 4px;
}

.session-summary {
  text-align: center;
  padding: 1.5rem;
}
.session-summary h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}
.session-summary-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 1rem;
}
.session-summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.session-summary-count {
  font-size: 1.5rem;
  font-weight: 600;
}
.session-summary-label {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  margin-top: 2px;
}
.session-summary-next {
  font-size: 0.85rem;
  color: var(--text-muted, #888);
  margin-bottom: 1rem;
}

/* ─── FSRS Settings (0047) ──────────────────────────────────────────────────── */

.fsrs-settings {
  margin: 12px 0;
  padding: 12px 16px;
  background: var(--card-bg, #f5f5f5);
  border-radius: 10px;
}
.fsrs-setting-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary, #222);
  display: block;
  margin-bottom: 6px;
}
.fsrs-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--border-color, #ddd);
  outline: none;
}
.fsrs-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-color, #4f46e5);
  cursor: pointer;
}
.fsrs-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-color, #4f46e5);
  cursor: pointer;
  border: none;
}
.fsrs-retention-hint {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  margin-top: 4px;
}
.fsrs-personalization {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--success-color, #10b981);
}
.fsrs-personalization-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success-color, #10b981);
  margin-right: 4px;
}

/* ─── USP Banner (SD-0043) ──────────────────────────────────────────────────── */

.usp-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.usp-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.usp-pill .icon {
  width: 14px;
  height: 14px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .usp-banner {
    gap: 6px;
    margin-bottom: 16px;
  }
  .usp-pill {
    font-size: 0.7rem;
    padding: 3px 9px;
  }
}

/* ─── Mascot & Emotional Design (0048) ──────────────────────────────────────── */

/* Warm accent tokens */
:root {
  --warm-amber: #F59E0B;
  --warm-coral: #F97316;
  --warm-gold: #EAB308;
  --warm-glow: rgba(245, 158, 11, 0.12);
}
[data-theme="dark"] {
  --warm-amber: #FBBF24;
  --warm-coral: #FB923C;
  --warm-gold: #FACC15;
  --warm-glow: rgba(251, 191, 36, 0.08);
}

/* Mascot container */
.mascot-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  min-height: 56px;
  transition: opacity var(--transition);
}
.mascot-container.mascot-hidden { display: none; }

.mascot-svg {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}
.mascot-svg-lg {
  width: 80px;
  height: 80px;
}

/* Owl colors — warm palette */
.mascot-body { fill: var(--warm-amber); stroke: var(--warm-coral); stroke-width: 1.5; }
.mascot-ear { fill: var(--warm-coral); stroke: none; }
.mascot-eye-bg { fill: #FFFFFF; stroke: #333333; stroke-width: 1; }
.mascot-pupil { fill: #222222; transition: transform 0.3s ease; }
.mascot-beak { fill: var(--warm-coral); stroke: none; }
.mascot-wing { fill: var(--warm-gold); stroke: var(--warm-coral); stroke-width: 1; transition: transform 0.3s ease; }
.mascot-mouth { stroke: #333333; stroke-width: 1.5; stroke-linecap: round; fill: none; }
.mascot-mouth-encourage { fill: #333333; stroke: none; display: none; }
.mascot-mouth-happy { display: block; }

/* Expression states */
.mascot--encourage .mascot-mouth-happy { display: none; }
.mascot--encourage .mascot-mouth-encourage { display: block; }
.mascot--encourage .mascot-pupil { transform: translateY(2px); }

.mascot--celebrate .mascot-wing-l { animation: mascot-wing-flap-l 0.4s ease 3; }
.mascot--celebrate .mascot-wing-r { animation: mascot-wing-flap-r 0.4s ease 3; }
.mascot--celebrate .mascot-pupil { transform: scale(0.7); }

.mascot--thinking .mascot-pupil { transform: translateX(3px) translateY(-2px); }
.mascot--thinking .mascot-mouth-happy { d: path("M34,55 Q40,55 46,55"); }

.mascot--helpful .mascot-pupil { transform: translateY(2px); }
.mascot--helpful .mascot-mouth-happy { display: none; }
.mascot--helpful .mascot-mouth-encourage { display: block; }

/* Wing flap animation */
@keyframes mascot-wing-flap-l {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-20deg) translateX(-3px); }
}
@keyframes mascot-wing-flap-r {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(20deg) translateX(3px); }
}

/* Mascot message bubble */
.mascot-message {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  max-width: 280px;
  padding: 6px 10px;
  background: var(--warm-glow);
  border-left: 3px solid var(--warm-amber);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.mascot-message:empty { display: none; }
.mascot-message.mascot-message--visible { opacity: 1; display: block; }

/* Celebration overlay */
.mascot-celebration {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  animation: mascot-celebrate-in 0.4s ease;
  pointer-events: none;
}
.mascot-celebration.hidden { display: none; }
.mascot-celebration-content {
  text-align: center;
  animation: mascot-celebrate-bounce 0.6s ease;
}
.mascot-celebration-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-top: 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

@keyframes mascot-celebrate-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes mascot-celebrate-bounce {
  0% { transform: scale(0.5) translateY(40px); }
  60% { transform: scale(1.15) translateY(-10px); }
  100% { transform: scale(1) translateY(0); }
}

/* Mascot toggle in settings */
.mascot-toggle {
  padding: 6px 0;
  margin-top: 4px;
}
.mascot-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.mascot-toggle-label input[type="checkbox"] {
  accent-color: var(--warm-amber);
}

/* Warm accent on study screens */
#screen-quiz .question-card,
#screen-cards .card-container {
  border-top: 3px solid var(--warm-amber);
}
#screen-quiz .quiz-progress-fill {
  background: linear-gradient(90deg, var(--warm-amber), var(--warm-coral));
}

/* ═══════════════════════════════════════════════════════════════════════════════
   0049: Mixed Retrieval Formats — Typed-answer & Free-recall
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Format badge colour variants */
.badge-format { text-transform: uppercase; letter-spacing: 0.5px; }
.badge-format--mc { border-color: var(--primary); color: var(--primary); }
.badge-format--typed { border-color: var(--warning); color: var(--warning); }
.badge-format--free-recall { border-color: #9c27b0; color: #9c27b0; }

/* Typed-answer */
.typed-answer-container { margin-top: 16px; }
.typed-answer-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.typed-answer-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--text);
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}
.typed-answer-input:focus {
  outline: none;
  border-color: var(--primary);
}
.typed-answer-input:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.typed-answer-result {
  margin-top: 12px;
  padding: 12px 16px;
  font-size: 0.93rem;
  font-weight: 600;
}
.typed-answer-result--correct {
  background: var(--success-light);
  color: var(--success);
  border-left: 4px solid var(--success);
}
.typed-answer-result--wrong {
  background: var(--danger-light);
  color: var(--danger);
  border-left: 4px solid var(--danger);
}
.typed-answer-correct {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
}
.typed-answer-self-eval {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Free-recall */
.free-recall-container { margin-top: 16px; }
.free-recall-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.free-recall-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--text);
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}
.free-recall-input:focus {
  outline: none;
  border-color: #9c27b0;
}
.free-recall-input:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.free-recall-correct {
  margin-top: 12px;
  padding: 16px;
  background: var(--info-light);
  border-left: 4px solid var(--info);
  font-size: 0.93rem;
  line-height: 1.7;
}
.free-recall-correct-title {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  color: var(--info);
}
.free-recall-self-eval {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.free-recall-self-eval-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.free-recall-eval-btn {
  min-width: 120px;
}

/* Adaptive scaffolding banner */
.adaptive-banner {
  margin-bottom: 12px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--warning-light, rgba(255,193,7,0.12));
  color: var(--warning);
  border-left: 3px solid var(--warning);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ═══ 0050: Interleaved Practice & Confusion Pairs  ═══ */

/* Interleaved Practice action card */
.action-card--interleaved .action-dot { background: var(--accent, #7c3aed); }
.action-card--interleaved:hover .action-dot,
.action-card--interleaved:focus .action-dot { box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.18); }

/* Confusion Pairs in Progress Dashboard */
.confusion-pairs-section { margin: 24px 0; }
.confusion-pairs-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 12px 0;
}
.confusion-pairs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.confusion-pair-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.confusion-pair-name {
  font-size: 0.88rem;
  font-weight: 500;
  flex: 1;
  min-width: 80px;
}
.confusion-pair-pct {
  font-size: 0.82rem;
  font-weight: 600;
  min-width: 36px;
  text-align: center;
}
.confusion-pair-pct--weak { color: var(--danger); }
.confusion-pair-vs {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ─── WOOP Goal Setting (SD-0051) ──────────────────────────────────────── */
.action-card--woop .action-dot { background: var(--accent); }
.woop-plan-card {
  padding: 16px 20px;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 24px;
  background: var(--bg-card);
}
.woop-plan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.woop-plan-title {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.woop-plan-wish {
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.woop-plan-ifthen {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.88rem;
}
.woop-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 520px;
  width: 90%;
  margin: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.woop-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.woop-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.woop-step-dot--active {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.woop-step-dot--done {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}
.woop-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px 0;
  font-size: 1.2rem;
}
.woop-prompt {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 0.92rem;
}
.woop-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.woop-input {
  width: 100%;
  padding: 8px 10px;
  margin-top: 4px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
}
.woop-input:focus {
  border-color: var(--accent);
  outline: none;
}
.woop-textarea {
  width: 100%;
  min-height: 80px;
  padding: 8px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  resize: vertical;
  background: var(--bg);
  color: var(--text);
}
.woop-textarea:focus {
  border-color: var(--accent);
  outline: none;
}
.woop-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}
.woop-notify-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 0.85rem;
}
.woop-notify-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.woop-time-input {
  width: auto;
  max-width: 110px;
}
.woop-session-reminder {
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  text-align: center;
  font-size: 0.85rem;
  transition: opacity 0.3s;
}
.woop-review-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.woop-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}
.woop-review-plan {
  margin: 16px 0;
  padding: 12px;
  background: var(--bg-active);
  border-radius: var(--radius);
}
.woop-review-question {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 12px 0 0;
}

/* ─── Pretesting Before Instruction (SD-0052) ──────────────────────────── */
.pretest-banner {
  padding: 8px 16px;
  background: var(--info, #3b82f6);
  color: #fff;
  text-align: center;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.pretest-banner .icon { width: 16px; height: 16px; }
.pretest-results-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.pretest-results-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.pretest-study-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  background: var(--bg-card);
}
.pretest-study-card--correct {
  border-color: var(--success);
}
.pretest-q-num {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.pretest-q {
  font-size: 0.95rem;
  margin-bottom: 12px;
  line-height: 1.5;
}
.pretest-explanation {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-active, var(--bg));
  border-left: 3px solid var(--success);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.88rem;
  line-height: 1.6;
}
.pretest-results-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: center;
}
.pretest-improvement-section {
  margin-top: 16px;
}
.pretest-improvement-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pretest-improvement-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.pretest-improvement-name {
  font-weight: 500;
  flex: 1;
}
.pretest-improvement-scores {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ─── SRL Scaffolding (0053) ────────────────────────────────────────── */
.srl-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.srl-card {
  background: var(--bg-card); padding: 24px; max-width: 480px; width: 100%;
  border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
.srl-card h3 { margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.srl-plan-options { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.srl-option {
  padding: 12px; border: 2px solid var(--border); border-radius: 8px;
  cursor: pointer; text-align: left; background: var(--bg);
  display: flex; align-items: center; gap: 8px; font-size: 0.95rem;
  transition: border-color 0.2s, background 0.2s;
}
.srl-option:hover { border-color: var(--accent); }
.srl-option--selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.srl-input {
  width: 100%; padding: 10px; margin: 4px 0 12px;
  border: 2px solid var(--border); border-radius: 8px; font-family: var(--font);
  background: var(--bg); color: var(--text);
}
.srl-textarea {
  width: 100%; padding: 8px; border: 2px solid var(--border); border-radius: 8px;
  resize: vertical; font-family: var(--font); background: var(--bg); color: var(--text);
  margin-top: 4px;
}
.srl-checkin-card {
  background: var(--bg-card); padding: 24px; max-width: 420px; width: 100%;
  text-align: center; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
.srl-checkin-card h4 { margin: 0 0 8px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.srl-confidence-row { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.srl-conf-btn {
  padding: 10px 18px; border: 2px solid var(--border); border-radius: 8px;
  cursor: pointer; font-size: 0.9rem; background: var(--bg); color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}
.srl-conf-btn:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.srl-rating-row { display: flex; gap: 4px; margin-top: 8px; }
.srl-rate-btn {
  width: 40px; height: 40px; border: 2px solid var(--border); border-radius: 8px;
  cursor: pointer; font-weight: 700; font-size: 1rem;
  background: var(--bg); color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}
.srl-rate-btn:hover { border-color: var(--accent); }
.srl-rate-btn--selected { border-color: var(--accent); background: var(--accent); color: #fff; }
.srl-prereq-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.srl-prereq-item {
  padding: 8px 12px; border: 1px solid var(--accent); border-radius: 8px;
  color: var(--accent); display: flex; align-items: center; gap: 6px; font-size: 0.9rem;
}
.srl-dismiss-btn { margin-top: 12px; }
.srl-card label { display: block; margin: 12px 0 4px; font-size: 0.9rem; color: var(--text-muted); }

/* ─── 0054: Calibration Dashboard ──────────────────────────────────────── */
.calibration-section     { margin-top: 32px; }
.calibration-score       { font-size: 1.25rem; margin-bottom: 16px; }
.calibration-grid        { display: flex; flex-direction: column; gap: 4px; }
.calibration-row         { display: flex; align-items: center; gap: 8px; }
.calibration-label       { width: 60px; text-align: right; font-size: 0.8rem; color: var(--text-muted); }
.calibration-cell        { flex: 1; height: 28px; position: relative; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.calibration-bar         { height: 100%; transition: width 0.3s; }
.calibration-cell--blindspot .calibration-bar { background: var(--danger); }
.calibration-cell--strength .calibration-bar  { background: var(--info, #3b82f6); }
.calibration-cell--ok .calibration-bar        { background: var(--success); }
.calibration-pct         { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 0.75rem; color: var(--text); }
.calibration-alert       { padding: 8px 12px; margin-top: 12px; border-left: 3px solid; border-radius: 4px; }
.calibration-alert--danger { border-color: var(--danger); color: var(--danger); }
.calibration-alert--info   { border-color: var(--info, #3b82f6); color: var(--info, #3b82f6); }
.calibration-trend-title { margin-top: 16px; font-size: 0.95rem; }
.calibration-trend       { display: flex; align-items: flex-end; gap: 2px; height: 80px; position: relative; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.trend-bar               { flex: 1; background: var(--accent); min-width: 4px; border-radius: 2px 2px 0 0; transition: height 0.3s; }
.trend-reference         { position: absolute; bottom: 75%; left: 0; right: 0; border-top: 1px dashed var(--text-muted); opacity: 0.4; pointer-events: none; }
.calibration-reward      { margin-top: 12px; padding: 8px 12px; background: var(--bg); border: 1px solid var(--success); border-radius: 8px; color: var(--success); display: flex; align-items: center; gap: 6px; }

/* ─── 0055: Adaptive Worked Examples ───────────────────────────────────── */
.expertise-badge         { display: inline-block; padding: 2px 8px; font-size: 0.75rem; font-weight: 700; border-radius: 4px; }
.expertise-badge--l1     { border: 1px solid var(--info, #3b82f6); color: var(--info, #3b82f6); }
.expertise-badge--l2     { border: 1px solid var(--accent); color: var(--accent); }
.expertise-badge--l3     { border: 1px solid var(--warning, #f59e0b); color: var(--warning, #f59e0b); }
.expertise-badge--l4     { border: 1px solid var(--success); color: var(--success); }
.worked-example-header   { font-weight: 700; margin-bottom: 8px; color: var(--text-muted); }
.completion-blanks       { margin: 12px 0; }
.completion-blank        { display: inline-block; width: 80px; border-bottom: 2px dashed var(--border); margin: 0 4px; text-align: center; }
.completion-hint         { color: var(--text-muted); font-style: italic; }
.hint-btn                { padding: 6px 12px; border: 1px dashed var(--accent); color: var(--accent); background: none; cursor: pointer; margin-top: 8px; border-radius: 4px; }
.hint-btn:hover          { background: var(--bg); }
.hint-panel              { padding: 8px 12px; background: var(--bg); border-left: 3px solid var(--info, #3b82f6); margin-top: 8px; color: var(--text-muted); font-style: italic; }
.deliberate-error-banner { padding: 12px; margin: 8px 0; border: 2px solid var(--warning, #f59e0b); border-radius: 8px; background: var(--bg); }
.deliberate-error-text   { margin-top: 6px; color: var(--text-muted); font-size: 0.9rem; }

/* ─── 0056: Scenario-Based Learning ────────────────────────────────────── */
.scenario-context        { padding: 12px 16px; border-left: 3px solid var(--accent); margin-bottom: 16px; font-style: italic; line-height: 1.5; display: flex; align-items: flex-start; gap: 8px; background: color-mix(in srgb, var(--accent) 8%, var(--bg)); border-radius: 0 8px 8px 0; }
.scenario-context .icon  { flex-shrink: 0; margin-top: 2px; }
.scenario-consequence    { padding: 10px 14px; border-left: 3px solid var(--danger); margin-bottom: 10px; background: color-mix(in srgb, var(--danger) 6%, var(--bg)); border-radius: 0 6px 6px 0; font-size: 0.9rem; }

/* ─── 0057: Productive Failure ─────────────────────────────────────────── */
.pf-screen              { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg); z-index: 100; overflow-y: auto; padding: 24px; }
.pf-card                { max-width: 720px; margin: 0 auto; }
.pf-header              { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; font-weight: 700; margin-bottom: 16px; flex-wrap: wrap; }
.pf-badge               { font-size: 0.75rem; padding: 2px 8px; border: 1px solid var(--info); color: var(--info); border-radius: 4px; margin-left: auto; }
.pf-question            { font-size: 1.1rem; line-height: 1.6; margin-bottom: 16px; }
.pf-instruction         { color: var(--text-muted); margin-bottom: 12px; }
.pf-choices             { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.pf-choice              { display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.pf-choice:hover        { border-color: var(--accent); }
.pf-explanation-input   { width: 100%; min-height: 60px; padding: 8px; border: 2px solid var(--border); border-radius: 6px; margin-bottom: 16px; font-family: inherit; font-size: 0.95rem; box-sizing: border-box; background: var(--bg); color: var(--fg); }
.pf-submit, .pf-continue { width: 100%; }
.pf-contrast-title      { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.pf-contrast-grid       { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.pf-contrast-item       { padding: 12px; border-left: 4px solid; border-radius: 0 6px 6px 0; }
.pf-match-correct       { border-color: var(--success); background: color-mix(in srgb, var(--success) 5%, var(--bg)); }
.pf-missed              { border-color: var(--warning); background: color-mix(in srgb, var(--warning) 5%, var(--bg)); }
.pf-wrong-pick          { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 5%, var(--bg)); }
.pf-correct-skip        { border-color: var(--success); opacity: 0.7; }
.pf-contrast-label      { font-weight: 700; font-size: 0.85rem; margin-bottom: 4px; }
.pf-contrast-text       { line-height: 1.5; }
.pf-contrast-why        { margin-top: 8px; font-size: 0.85rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 8px; }
.pf-expert-solution     { margin-top: 24px; padding: 16px; border: 2px solid var(--accent); border-radius: 8px; }
.pf-expert-solution h4  { margin: 0 0 8px; }
.pf-mermaid             { margin: 16px 0; }

/* ─── 0058: Self-Explanation Prompts ───────────────────────────────────── */
.se-prompt              { margin-top: 16px; padding: 16px; border: 2px solid var(--accent); border-radius: 8px; background: var(--card-bg); }
.se-header              { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1rem; margin-bottom: 8px; }
.se-hint                { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 12px; }
.se-input               { width: 100%; padding: 8px; border: 2px solid var(--border); border-radius: 6px; font-family: inherit; font-size: 0.9rem; resize: vertical; box-sizing: border-box; background: var(--bg); color: var(--fg); }
.se-input:focus         { border-color: var(--accent); outline: none; }
.se-actions             { display: flex; gap: 8px; margin-top: 12px; }
.se-feedback            { margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 6px; }
.se-score               { font-size: 1rem; margin-bottom: 8px; }
.se-missing             { font-size: 0.85rem; color: var(--text-muted); }
.se-tag                 { display: inline-block; padding: 2px 6px; margin: 2px; border: 1px solid var(--accent); border-radius: 4px; font-size: 0.8rem; }
.se-great               { color: var(--success); font-weight: 700; }

/* ─── 0059: Session Timer & Wakeful Rest (Pomodoro) ────────────────────── */
.pomodoro-timer         { font-family: 'SF Mono', ui-monospace, monospace; font-size: 0.9rem; padding: 2px 8px; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; user-select: none; }
.pomodoro-timer:hover   { border-color: var(--accent); }
.pomodoro-urgent        { color: var(--warning); border-color: var(--warning); animation: pom-pulse 1s ease-in-out infinite; }
.pomodoro-paused        { opacity: 0.5; }
.pomodoro-blocks        { font-size: 0.8rem; color: var(--text-muted); margin-left: 4px; }
@keyframes pom-pulse    { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.pom-rest-screen        { position: fixed; inset: 0; background: var(--bg); z-index: 200; display: flex; align-items: center; justify-content: center; }
.pom-rest-screen.hidden { display: none; }
.pom-rest-card          { text-align: center; max-width: 400px; padding: 48px 32px; }
.pom-rest-badge         { font-size: 0.75rem; padding: 2px 8px; border: 1px solid var(--accent); color: var(--accent); border-radius: 4px; margin-bottom: 16px; display: inline-block; }
.pom-rest-instruction   { color: var(--text-muted); line-height: 1.6; margin: 16px 0; }
.pom-breathing          { margin: 32px 0; }
.pom-breath-circle      { width: 80px; height: 80px; border-radius: 50%; border: 2px solid var(--accent); margin: 0 auto 12px; animation: pom-breathe 6s ease-in-out infinite; }
@keyframes pom-breathe  { 0%,100% { transform: scale(0.8); opacity: 0.5; } 50% { transform: scale(1.2); opacity: 1; } }
.pom-rest-countdown     { font-family: 'SF Mono', ui-monospace, monospace; font-size: 2rem; margin: 16px 0; }

/* ─── 0060: Dual Coding & Multimodal Diagrams ─────────────────────────────── */
.de-overlay             { position: fixed; inset: 0; z-index: 9000; background: var(--bg); overflow-y: auto; display: flex; flex-direction: column; }
.de-overlay.hidden      { display: none; }
.de-header              { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--border); }
.de-header h2           { flex: 1; margin: 0; font-size: 1.25rem; }
.de-badge               { background: var(--accent); color: #fff; padding: 2px 10px; border-radius: 12px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }
.de-layout              { display: flex; flex: 1; min-height: 0; }
.de-palette             { width: 200px; padding: 16px; border-right: 1px solid var(--border); overflow-y: auto; flex-shrink: 0; }
.de-palette h4          { margin: 0 0 12px; font-size: 0.85rem; text-transform: uppercase; color: var(--text-muted); }
.de-palette-grid        { display: flex; flex-direction: column; gap: 6px; }
.de-palette-hint        { font-size: 0.75rem; color: var(--text-muted); margin-top: 12px; line-height: 1.4; }
.de-component           { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); cursor: grab; font-size: 0.8rem; transition: background 0.15s; }
.de-component:hover     { background: var(--bg-alt); }
.de-component svg       { width: 16px; height: 16px; flex-shrink: 0; }
.de-canvas              { flex: 1; position: relative; min-height: 400px; background: var(--bg-alt); overflow: hidden; }
.de-canvas-placeholder  { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.9rem; pointer-events: none; }
.de-node                { position: absolute; display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; border: 2px solid var(--border); background: var(--bg); cursor: pointer; font-size: 0.8rem; user-select: none; transition: border-color 0.15s, box-shadow 0.15s; z-index: 1; }
.de-node:hover          { border-color: var(--accent); }
.de-node--selected      { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.25); }
.de-node svg            { width: 14px; height: 14px; }
.de-actions             { display: flex; gap: 12px; justify-content: center; padding: 16px; border-top: 1px solid var(--border); }
.de-comparison          { padding: 24px; max-width: 720px; margin: 0 auto; }
.de-comparison h3       { margin: 0 0 12px; }
.de-score               { font-size: 0.95rem; margin: 4px 0; }
.de-score strong        { color: var(--accent); }
.de-missing             { color: var(--text-muted); font-style: italic; margin-top: 8px; }
.de-ref-diagram         { margin-top: 16px; }
.de-ref-diagram h4      { margin: 0 0 8px; font-size: 0.9rem; }
.de-prompt              { margin-top: 24px; }
.de-prompt-card         { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 12px; padding: 20px; text-align: center; }
.de-prompt-card strong  { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.de-prompt-card p       { color: var(--text-muted); margin: 8px 0 16px; }
.de-prompt-card svg     { vertical-align: -2px; margin-right: 6px; }
@media (max-width: 700px) {
  .de-layout            { flex-direction: column; }
  .de-palette           { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .de-palette-grid      { flex-direction: row; flex-wrap: wrap; }
  .de-canvas            { min-height: 300px; }
}

/* ─── 0063: Exam Readiness Heatmap ────────────────────────────────────────── */
.rh-header         { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.rh-overall        { text-align: right; }
.rh-pct            { font-size: 2rem; font-weight: 700; color: var(--accent); display: block; }
.rh-label          { font-size: 0.75rem; color: var(--text-muted); }
.rh-difficulty     { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); }
.rh-grid           { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 16px; }
.rh-cell           { padding: 12px; border-left: 4px solid; border-radius: var(--radius); }
.rh-green          { border-color: var(--success); background: color-mix(in srgb, var(--success) 8%, var(--bg)); }
.rh-yellow         { border-color: var(--warning); background: color-mix(in srgb, var(--warning) 8%, var(--bg)); }
.rh-red            { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--bg)); }
.rh-cell-label     { font-weight: 600; font-size: 0.85rem; margin-bottom: 4px; }
.rh-cell-pct       { font-size: 1.2rem; font-weight: 700; }
.rh-cell-coverage  { font-size: 0.75rem; color: var(--text-muted); }
.rr-list           { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.rr-item           { display: flex; align-items: start; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; }
.rr-mastered       { border-color: var(--success); }
.rr-focus          { border-color: var(--warning); }
.rr-weak           { border-color: var(--danger); }
.rh-trend-svg      { width: 100%; max-width: 400px; height: 120px; }
.rh-projection     { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; }

/* ─── 0065: Streak Mechanics ──────────────────────────────────────────────── */
.streak-widget      { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 12px 16px; border: 2px solid var(--accent); border-radius: var(--radius); margin: 16px 0; }
.streak-display     { display: flex; align-items: center; gap: 8px; }
.streak-count       { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.streak-label       { font-size: 0.85rem; color: var(--text-muted); }
.streak-progress    { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-muted); }
.streak-bar         { width: 80px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.streak-fill        { height: 100%; background: var(--accent); transition: width 0.3s; }
.streak-done        { display: flex; align-items: center; gap: 4px; color: var(--success); font-size: 0.85rem; font-weight: 600; }
.streak-meta        { display: flex; gap: 12px; font-size: 0.75rem; color: var(--text-muted); }
.streak-freeze-avail { color: var(--info, var(--accent)); }

.streak-calendar    { margin-top: 24px; }
.sc-grid            { display: grid; grid-template-columns: repeat(13, 1fr); gap: 2px; }
.sc-cell            { aspect-ratio: 1; border-radius: 2px; }
.sc-level-0         { background: var(--border); }
.sc-level-1         { background: color-mix(in srgb, var(--accent) 25%, var(--bg)); }
.sc-level-2         { background: color-mix(in srgb, var(--accent) 55%, var(--bg)); }
.sc-level-3         { background: var(--accent); }
