﻿@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600&family=Nunito:wght@400;600&display=swap');

/* â”€â”€ Auth overlay â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#auth-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  pointer-events: auto;
}

#auth-overlay.hidden {
  display: none !important;
  pointer-events: none !important;
}

#auth-modal {
  background: #fff;
  border-radius: 20px;
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.2);
  text-align: center;
}

.auth-logo {
  font-size: 2.6rem;
  margin-bottom: 8px;
}

.auth-heading {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 4px;
}

.auth-sub {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 20px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.auth-tab.active {
  background: #fff;
  color: #4f46e5;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form input,
.auth-form select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s;
  color: #1e293b;
  background: #f8fafc;
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: #4f46e5;
  background: #fff;
}

#signup-extras {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dob-row {
  display: grid;
  grid-template-columns: 1fr 2fr 1.5fr;
  gap: 8px;
}

.dob-row select {
  width: 100%;
}

.auth-error {
  font-size: 0.82rem;
  color: #dc2626;
  min-height: 1em;
  text-align: left;
}

.auth-message {
  font-size: 0.82rem;
  min-height: 1em;
  text-align: left;
  padding: 0.4rem 0;
}
.auth-message.auth-error   { color: #dc2626; }
.auth-message.auth-success { color: #16a34a; }

.auth-link {
  display: block;
  text-align: center;
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: #6c63ff;
  text-decoration: none;
  cursor: pointer;
}
.auth-link:hover { text-decoration: underline; }

/* ── Password field wrapper + visibility toggle ── */
.pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pw-wrap input {
  flex: 1;
  padding-right: 3.2rem;   /* room for toggle */
}
.pw-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6c63ff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
  user-select: none;
}
.pw-toggle:hover  { background: #f0f0ff; }
.pw-toggle:focus  { outline: 2px solid #6c63ff; outline-offset: 2px; }

/* ── Password strength meter ── */
#pw-strength {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 2px 0 2px;
}
.strength-bars {
  display: flex;
  gap: 3px;
  flex: 1;
}
.strength-bar {
  height: 4px;
  flex: 1;
  background: #e5e7eb;
  border-radius: 2px;
  transition: background 0.22s ease;
}
.strength-label {
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 3.2rem;
  text-align: right;
  letter-spacing: 0.02em;
}

/* ── Field-level inline error ── */
.field-error {
  font-size: 0.78rem;
  color: #dc2626;
  margin: 0 0 2px;
  min-height: 0;
  line-height: 1.3;
}

/* ── Submit button loading spinner ── */
.btn-primary {
  position: relative;
  transition: color 0.15s, background 0.15s;
}
.btn-primary:disabled:not(.loading) {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-primary.loading {
  color: transparent !important;
  pointer-events: none;
}
.btn-primary.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: _bspin 0.65s linear infinite;
}
@keyframes _bspin { to { transform: rotate(360deg); } }

/* ── Terms / Privacy agree checkbox ── */
.agree-label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.82rem;
  color: #374151;
  cursor: pointer;
  line-height: 1.45;
  margin: 0.25rem 0 0.1rem;
}
.agree-label input[type="checkbox"] {
  margin-top: 0.18rem;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: #6c63ff;
  cursor: pointer;
}
.agree-label a {
  color: #6c63ff;
  text-decoration: underline;
}
.agree-label a:hover { color: #4f46e5; }

/* ── App footer ── */
.app-footer {
  text-align: center;
  padding: 1.25rem 1rem;
  font-size: 0.78rem;
  color: #9ca3af;
  border-top: 1px solid #e5e7eb;
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 0.6rem;
}
.app-footer a {
  color: #6c63ff;
  text-decoration: none;
}
.app-footer a:hover { text-decoration: underline; }
.app-footer-sep { color: #d1d5db; }

/* ── Email verification banner ── */
#verification-banner {
  background: #fef3c7;
  border-bottom: 1px solid #f59e0b;
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #78350f;
  gap: 0.75rem;
}
#verification-banner a {
  color: #6c63ff;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.banner-close {
  background: none;
  border: none;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: #78350f;
  padding: 0 0.2rem;
  flex-shrink: 0;
}
.banner-close:hover { opacity: 0.6; }

/* ── Verification result toast (fixed, above everything) ── */
#verify-toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 99999;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  transition: opacity 0.4s ease;
}
#verify-toast.toast-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #34d399;
}
#verify-toast.toast-error {
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #f87171;
}

/* â”€â”€ Header additions â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.header-username {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4f46e5;
}

.btn-logout {
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-logout:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

/* â”€â”€ Admin panel â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.admin-panel {
  border: 1.5px solid #fde68a;
  background: #fffbeb;
}

.admin-panel .dashboard-title { color: #92400e; }

.admin-section {
  margin-bottom: 12px;
}

.admin-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #92400e;
  margin-bottom: 5px;
}

.admin-row {
  display: flex;
  gap: 6px;
}

.admin-input {
  flex: 1;
  padding: 6px 10px;
  border: 1.5px solid #fde68a;
  border-radius: 8px;
  font-size: 0.85rem;
  background: #fff;
  outline: none;
  color: #1e293b;
}

.admin-select {
  flex: 1;
  padding: 6px 10px;
  border: 1.5px solid #fde68a;
  border-radius: 8px;
  font-size: 0.85rem;
  background: #fff;
  outline: none;
  color: #1e293b;
}

.btn-admin {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  background: #f59e0b;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-admin:hover { background: #d97706; }

.btn-admin-danger {
  width: 100%;
  background: #ef4444;
  padding: 7px;
}

.btn-admin-analytics {
  width: 100%;
  background: #4f46e5;
  padding: 7px;
}
.btn-admin-analytics:hover { background: #4338ca; }

.btn-admin-danger:hover { background: #dc2626; }

.admin-msg {
  font-size: 0.8rem;
  font-weight: 600;
  color: #059669;
  min-height: 1em;
  margin-top: 4px;
}

/* â”€â”€ Reset & Base â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #f0f4ff;
  color: #1e293b;
  min-height: 100vh;
  padding: 12px 16px 60px;
}

/* â”€â”€ Page wrap (constrains the header) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.page-wrap {
  max-width: 1400px;
  margin: 0 auto;
  margin-bottom: 12px;
}

/* â”€â”€ Container (flex row â€” left + right panels) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 20px;
  align-items: stretch;
  /* height drives the flex children so concept card can fill */
  min-height: calc(100vh - 92px); /* 12px body-top + 56px header + 12px gap + 12px body-bot */
}

/* â”€â”€ Header (compact single row) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 20px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-logo { font-size: 1.3rem; line-height: 1; }

.header-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #4f46e5;
  white-space: nowrap;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-center select {
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.header-center select:focus {
  border-color: #4f46e5;
}

.class-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px;
  font-size: 0.82rem; font-weight: 600;
  color: #4f46e5;
  background: #eef2ff;
  border: 1.5px solid #c7d2fe;
  border-radius: 8px;
  white-space: nowrap; user-select: none;
  cursor: default;
  pointer-events: none;
}

.header-right { flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════════════════
   Phase Nav — Global Navigation Drawer
   ══════════════════════════════════════════════════════════════════════════ */

/* Hamburger button */
.nav-hamburger {
  display: flex; flex-direction: column; gap: 5px;
  justify-content: center; align-items: center;
  width: 38px; height: 38px; padding: 8px;
  background: none; border: 1.5px solid transparent; border-radius: 8px;
  cursor: pointer; flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.nav-hamburger:hover { background: #f1f5f9; border-color: #e2e8f0; }
.nav-hamburger:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }

.nav-ham-bar {
  width: 18px; height: 2px;
  background: #334155; border-radius: 2px; display: block;
}

/* Backdrop overlay */
.nav-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.35); z-index: 900;
  backdrop-filter: blur(2px);
}
.nav-overlay.active { display: block; }

/* Drawer panel */
.nav-drawer {
  position: fixed; left: 0; top: 0; bottom: 0; width: 272px;
  background: #ffffff; z-index: 901;
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.12);
  transform: translateX(-100%);
  transition: transform 0.18s ease-out;
  display: flex; flex-direction: column;
  visibility: hidden; pointer-events: none;
}
.nav-drawer.open {
  transform: translateX(0);
  visibility: visible; pointer-events: auto;
}

.nav-drawer-header {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1.5px solid #f1f5f9; flex-shrink: 0;
}
.nav-drawer-logo { font-size: 1.3rem; line-height: 1; }
.nav-drawer-title {
  font-size: 0.95rem; font-weight: 800; color: #4f46e5; flex: 1;
}
.nav-close-btn {
  width: 32px; height: 32px; min-height: 32px; border-radius: 8px;
  border: 1.5px solid transparent; background: none;
  font-size: 1rem; color: #64748b; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.13s, color 0.13s;
}
.nav-close-btn:hover { background: #f1f5f9; color: #1e293b; border-color: #e2e8f0; }
.nav-close-btn:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }

/* Nav item list */
.nav-items {
  list-style: none; padding: 10px 8px; margin: 0; flex: 1; overflow-y: auto;
}
.nav-items li { margin: 2px 0; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: none; background: none; cursor: pointer;
  font-size: 0.88rem; font-weight: 500; color: #334155;
  text-align: left; min-height: 44px;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover { background: #f1f5f9; color: #1e293b; }
.nav-item:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }
.nav-item.active {
  background: #eef2ff; color: #4f46e5; font-weight: 700;
}
.nav-item-icon { font-size: 1.05rem; width: 22px; text-align: center; flex-shrink: 0; }
.nav-item-label { flex: 1; }
.nav-item-logout { margin-top: 2px; }
.nav-item-logout:hover { background: #fef2f2; color: #dc2626; }

.nav-sep {
  height: 1px; background: #f1f5f9;
  margin: 6px 8px !important; pointer-events: none;
}

@media (max-width: 600px) {
  .nav-drawer { width: 80vw; }
}

/* Profile panel */
.pf-back-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 0 16px; border-bottom: 1.5px solid #f1f5f9; margin-bottom: 20px;
}
.pf-back-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.85rem; font-weight: 600; color: #4f46e5;
  padding: 6px 10px; border-radius: 8px; min-height: 36px;
  transition: background 0.13s;
}
.pf-back-btn:hover { background: #eef2ff; }
.pf-back-btn:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }
.pf-page-title { font-size: 1rem; font-weight: 700; color: #1e293b; }
.pf-card {
  background: #f8fafc; border: 1.5px solid #e2e8f0;
  border-radius: 14px; padding: 20px; margin-bottom: 16px;
}
.pf-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: #eef2ff; display: flex; align-items: center;
  justify-content: center; font-size: 1.6rem; margin-bottom: 12px;
}
.pf-name { font-size: 1.05rem; font-weight: 800; color: #1e293b; margin-bottom: 4px; }
.pf-stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.pf-stat {
  background: #fff; border: 1.5px solid #e2e8f0; border-radius: 10px;
  padding: 8px 14px; text-align: center;
}
.pf-stat-val { font-size: 1.05rem; font-weight: 800; color: #4f46e5; }
.pf-stat-lbl { font-size: 0.7rem; color: #64748b; margin-top: 2px; }

/* Settings panel */
.st-back-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 0 16px; border-bottom: 1.5px solid #f1f5f9; margin-bottom: 20px;
}
.st-back-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.85rem; font-weight: 600; color: #4f46e5;
  padding: 6px 10px; border-radius: 8px; min-height: 36px;
  transition: background 0.13s;
}
.st-back-btn:hover { background: #eef2ff; }
.st-back-btn:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }
.st-page-title { font-size: 1rem; font-weight: 700; color: #1e293b; }
.st-card {
  background: #f8fafc; border: 1.5px solid #e2e8f0;
  border-radius: 14px; padding: 20px; margin-bottom: 16px;
}
.st-section-label {
  font-size: 0.75rem; font-weight: 700; color: #64748b;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px;
}
.st-setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid #f1f5f9;
}
.st-setting-row:last-child { border-bottom: none; }
.st-setting-lbl { font-size: 0.87rem; font-weight: 600; color: #334155; }
.st-setting-val { font-size: 0.84rem; color: #64748b; }
.st-hint { font-size: 0.76rem; color: #94a3b8; margin-top: 10px; }

/* ── Admin Analytics Dashboard Modal ── */
.aa-modal {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.72); display: flex;
  align-items: stretch; justify-content: center;
  padding: 0;
}
.aa-modal-inner {
  background: #f8fafc; width: 100%; max-width: 1100px;
  display: flex; flex-direction: column; overflow: hidden;
  position: relative;
}
.aa-header {
  display: flex; align-items: center; justify-content: space-between;
  background: #1e293b; color: #f1f5f9;
  padding: 14px 20px; gap: 16px; flex-shrink: 0;
}
.aa-header-left  { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.aa-header-right { display: flex; align-items: center; gap: 8px;  flex-shrink: 0; }
.aa-header-icon  { font-size: 1.3rem; }
.aa-header-title { font-size: 1rem; font-weight: 700; }
.aa-generated-at { font-size: 0.72rem; color: #94a3b8; white-space: nowrap; }
.aa-refresh-btn, .aa-close-btn {
  background: none; border: none; color: #94a3b8; font-size: 1.1rem;
  cursor: pointer; padding: 6px 8px; border-radius: 6px; line-height: 1;
  min-height: 36px; min-width: 36px;
}
.aa-refresh-btn:hover, .aa-close-btn:hover { background: rgba(255,255,255,0.08); color: #f1f5f9; }
.aa-refresh-btn:focus-visible, .aa-close-btn:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }

.aa-tabs {
  display: flex; background: #1e293b; border-bottom: 2px solid #334155;
  padding: 0 20px; gap: 0; flex-shrink: 0;
}
.aa-tab {
  padding: 10px 18px; font-size: 0.82rem; font-weight: 600;
  color: #94a3b8; background: none; border: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color 0.13s, border-color 0.13s; min-height: 44px;
}
.aa-tab:hover { color: #e2e8f0; }
.aa-tab.active { color: #818cf8; border-bottom-color: #818cf8; }
.aa-tab:focus-visible { outline: 2px solid #4f46e5; outline-offset: -2px; }

.aa-body { flex: 1; overflow-y: auto; padding: 20px; }

.aa-loading {
  text-align: center; padding: 60px 20px;
  color: #94a3b8; font-size: 0.9rem;
}

/* Overview grid */
.aa-overview-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.aa-card {
  background: #fff; border: 1.5px solid #e2e8f0; border-radius: 12px;
  padding: 16px 14px; text-align: center;
}
.aa-card-val {
  font-size: 2rem; font-weight: 800; color: #1e293b; line-height: 1.1;
}
.aa-card-lbl {
  font-size: 0.73rem; font-weight: 600; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px;
}
.aa-card.highlight { border-color: #818cf8; background: #eef2ff; }
.aa-card.highlight .aa-card-val { color: #4f46e5; }
.aa-card.warn { border-color: #fbbf24; background: #fffbeb; }
.aa-card.warn .aa-card-val { color: #d97706; }

/* Users table */
.aa-toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 14px;
}
.aa-search {
  flex: 1; min-width: 180px;
  padding: 8px 12px; font-size: 0.83rem;
  border: 1.5px solid #e2e8f0; border-radius: 8px; outline: none;
  background: #fff;
}
.aa-search:focus { border-color: #4f46e5; }
.aa-filter {
  padding: 8px 10px; font-size: 0.82rem;
  border: 1.5px solid #e2e8f0; border-radius: 8px; outline: none;
  background: #fff; cursor: pointer;
}
.aa-filter:focus { border-color: #4f46e5; }

.aa-table-wrap { overflow-x: auto; border-radius: 10px; border: 1.5px solid #e2e8f0; }
.aa-table {
  width: 100%; border-collapse: collapse; font-size: 0.8rem; min-width: 760px;
}
.aa-table th {
  background: #f1f5f9; color: #475569; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 10px 10px; text-align: left; white-space: nowrap;
  border-bottom: 1.5px solid #e2e8f0; cursor: pointer; user-select: none;
}
.aa-table th:hover { background: #e2e8f0; }
.aa-table th[aria-sort="ascending"]::after  { content: " ▲"; }
.aa-table th[aria-sort="descending"]::after { content: " ▼"; }
.aa-table td {
  padding: 9px 10px; border-bottom: 1px solid #f1f5f9;
  color: #334155; white-space: nowrap; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis;
}
.aa-table tr:last-child td { border-bottom: none; }
.aa-table tr:hover td { background: #f8fafc; }
.aa-table tr.aa-row-click { cursor: pointer; }

.aa-status-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 0.7rem; font-weight: 700;
}
.aa-status-badge.active-today { background: #dcfce7; color: #16a34a; }
.aa-status-badge.active-week  { background: #fef9c3; color: #854d0e; }
.aa-status-badge.inactive     { background: #fee2e2; color: #dc2626; }

.aa-verified-yes { color: #16a34a; font-weight: 700; }
.aa-verified-no  { color: #94a3b8; }

/* Pagination */
.aa-pagination {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; flex-wrap: wrap; gap: 10px;
}
.aa-page-info { font-size: 0.78rem; color: #64748b; }
.aa-page-btns { display: flex; gap: 6px; }
.aa-page-btn {
  padding: 6px 12px; font-size: 0.78rem; font-weight: 600;
  border: 1.5px solid #e2e8f0; border-radius: 7px; background: #fff;
  color: #334155; cursor: pointer; min-height: 32px;
}
.aa-page-btn:hover:not(:disabled) { background: #f1f5f9; }
.aa-page-btn.active { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.aa-page-btn:disabled { opacity: 0.4; cursor: default; }

/* Timeline */
.aa-timeline { display: flex; flex-direction: column; gap: 0; }
.aa-tl-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid #f1f5f9;
}
.aa-tl-item:last-child { border-bottom: none; }
.aa-tl-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #818cf8;
  margin-top: 6px; flex-shrink: 0;
}
.aa-tl-body { flex: 1; min-width: 0; }
.aa-tl-user { font-size: 0.86rem; font-weight: 700; color: #1e293b; }
.aa-tl-event { font-size: 0.78rem; color: #64748b; }
.aa-tl-time { font-size: 0.72rem; color: #94a3b8; margin-top: 2px; }

/* Inactive section */
.aa-inactive-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.aa-inactive-card {
  background: #fff; border: 1.5px solid #e2e8f0; border-radius: 12px;
  padding: 16px 14px;
}
.aa-inactive-card-hdr {
  font-size: 0.72rem; font-weight: 700; color: #ef4444;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px;
}
.aa-inactive-card-count {
  font-size: 2rem; font-weight: 800; color: #1e293b; line-height: 1;
}
.aa-inactive-card-sub { font-size: 0.75rem; color: #94a3b8; margin-top: 4px; }
.aa-inactive-names {
  margin-top: 10px; font-size: 0.77rem; color: #475569;
  list-style: none; padding: 0; max-height: 120px; overflow-y: auto;
}
.aa-inactive-names li { padding: 2px 0; border-bottom: 1px solid #f8fafc; }

/* Student detail */
.aa-detail-overlay {
  position: absolute; inset: 0; background: rgba(15,23,42,0.55);
  z-index: 10; display: flex; align-items: stretch; justify-content: flex-end;
}
.aa-detail-panel {
  background: #fff; width: min(480px, 100%); display: flex;
  flex-direction: column; overflow: hidden;
}
.aa-detail-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1.5px solid #f1f5f9;
  flex-shrink: 0; background: #f8fafc;
}
.aa-detail-back {
  background: none; border: none; font-size: 0.83rem; font-weight: 600;
  color: #4f46e5; cursor: pointer; padding: 6px 10px; border-radius: 6px;
  min-height: 36px;
}
.aa-detail-back:hover { background: #eef2ff; }
.aa-detail-back:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }
.aa-detail-title { font-size: 0.9rem; font-weight: 700; color: #1e293b; }
.aa-detail-body { flex: 1; overflow-y: auto; padding: 18px; }

/* Detail rows */
.aa-detail-row { display: flex; justify-content: space-between; padding: 7px 0;
                 border-bottom: 1px solid #f8fafc; font-size: 0.82rem; }
.aa-detail-lbl { color: #64748b; font-weight: 600; }
.aa-detail-val { color: #1e293b; font-weight: 700; text-align: right; }
.aa-detail-section-title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: #94a3b8; margin: 16px 0 6px;
}
.aa-readonly-notice {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px;
  font-size: 0.75rem; color: #15803d; font-weight: 600; margin-bottom: 14px;
}

@media (max-width: 640px) {
  .aa-overview-grid { grid-template-columns: repeat(2, 1fr); }
  .aa-tabs { padding: 0 8px; }
  .aa-tab { padding: 10px 10px; font-size: 0.77rem; }
  .aa-body { padding: 12px; }
}

/* ── Coming Soon Page ── */
.cs-page {
  max-width: 600px; margin: 0 auto;
  padding: 32px 28px 28px; text-align: center;
}
.cs-header {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin-bottom: 20px;
}
.cs-subject-icon { font-size: 2.8rem; line-height: 1; }
.cs-title {
  font-size: 1.55rem; font-weight: 700; color: #1e293b; margin: 0;
}
.cs-coming-label {
  display: inline-block; padding: 3px 14px; border-radius: 20px;
  background: #fef3c7; color: #92400e; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; margin: 0;
}
.cs-desc {
  font-size: 0.9rem; color: #475569; line-height: 1.65;
  margin: 0 0 24px; text-align: left;
}
.cs-actions {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 28px;
}
.cs-back-btn {
  padding: 10px 20px; border-radius: 10px; font-size: 0.875rem; font-weight: 600;
  border: 1.5px solid #e2e8f0; background: #f8fafc; color: #334155;
  cursor: pointer; transition: background 0.15s;
  min-height: 44px;
}
.cs-back-btn:hover { background: #f1f5f9; }
.cs-back-btn:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }
.cs-continue-btn {
  padding: 10px 20px; border-radius: 10px; font-size: 0.875rem; font-weight: 600;
  border: none; background: #4f46e5; color: #fff;
  cursor: pointer; transition: background 0.15s;
  min-height: 44px;
}
.cs-continue-btn:hover { background: #4338ca; }
.cs-continue-btn:focus-visible { outline: 2px solid #4f46e5; outline-offset: 3px; }
.cs-preview-section {
  border-top: 1.5px solid #f1f5f9; padding-top: 20px; text-align: center;
}
.cs-preview-heading {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: #94a3b8; margin: 0 0 12px;
}
.cs-preview-cards {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}
.cs-preview-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 20px; border-radius: 12px;
  background: #f8fafc; border: 1.5px solid #e2e8f0;
  min-width: 110px; cursor: default; user-select: none;
}
.cs-preview-icon { font-size: 1.6rem; }
.cs-preview-label { font-size: 0.8rem; font-weight: 600; color: #64748b; }

/* ── Learning Page Breadcrumb ── */
.lp-breadcrumb {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 12px; margin-bottom: 4px;
  border-bottom: 1.5px solid #f1f5f9; flex-wrap: wrap;
}
.lp-bc-back {
  background: none; border: none; cursor: pointer;
  font-size: 0.84rem; font-weight: 600; color: #4f46e5;
  padding: 5px 10px; border-radius: 8px; min-height: 36px;
  white-space: nowrap; transition: background 0.13s;
  flex-shrink: 0;
}
.lp-bc-back:hover { background: #eef2ff; }
.lp-bc-back:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }
.lp-bc-trail {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.81rem; color: #64748b; flex-wrap: wrap;
}
.lp-bc-crumb { color: #94a3b8; }
.lp-bc-active { color: #1e293b; font-weight: 600; }
.lp-bc-sep { color: #cbd5e1; font-size: 0.75rem; }



/* â”€â”€ Rating pill â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #4338ca;
  font-size: 0.82rem;
  font-weight: 700;
}

#rating-pill .rating-value {
  font-weight: 800;
}

/* â”€â”€ 2-column layout â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.left-panel {
  flex: 7;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* concept-box sizes to its content */
.left-panel > #concept-box {
  align-self: flex-start;
  width: 100%;
}

.right-panel {
  flex: 3;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 220px;
  max-width: 360px;
  position: sticky;
  top: 24px;
  align-self: flex-start;
}

@media (max-width: 900px) {
  .container { flex-direction: column; }
  .right-panel { position: static; max-width: 100%; }
}

/* â”€â”€ Card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.card {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

/* Sidebar cards get tighter padding */
.sidebar-card {
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.card-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 12px;
}

/* â”€â”€ Welcome card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.welcome-card {
  border: 2px dashed #c7d2fe;
  background: linear-gradient(135deg, #f5f3ff 0%, #eff6ff 100%);
  box-shadow: none;
}

.welcome-inner {
  text-align: center;
  padding: 40px 20px;
}

.welcome-emoji {
  font-size: 3.5rem;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.welcome-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #4f46e5;
  margin-bottom: 10px;
}

.welcome-sub {
  font-size: 1rem;
  color: #64748b;
  line-height: 1.6;
}

.welcome-sub strong { color: #4f46e5; }

/* â”€â”€ Concept box â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#concept-box {
  border-top: 4px solid #4f46e5;
  display: flex;
  flex-direction: column;
}

#concept-box #concept-explanation {
  overflow-y: visible;
}

#concept-box h3 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #4f46e5;
  margin-bottom: 16px;
}

#concept-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 14px;
  line-height: 1.3;
}

#concept-explanation {
  font-size: 1.05rem;
  line-height: 1.85;
  color: #334155;
  margin-bottom: 20px;
}

#concept-example {
  margin-bottom: 22px;
}

.adaptive-subheading {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f59e0b;
  margin-bottom: 10px;
}

/* â”€â”€ Question card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#question-text {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.65;
  color: #1e293b;
  min-height: 2em;
}

.meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.meta-tag {
  padding: 4px 12px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 500;
}

/* â”€â”€ Difficulty badge â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.difficulty-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  margin-bottom: 14px;
}

.difficulty-badge.easy      { background: #dcfce7; color: #15803d; }
.difficulty-badge.medium    { background: #fef9c3; color: #854d0e; }
.difficulty-badge.challenge { background: #ede9fe; color: #5b21b6; }

/* â”€â”€ Answer input â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#answer-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 1.05rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  color: #1e293b;
  background: #f8fafc;
}

#answer-input:focus {
  border-color: #4f46e5;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79,70,229,0.1);
}

/* â”€â”€ Buttons â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  font-size: 0.98rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn:active   { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: #4f46e5;
  color: #fff;
  width: 100%;
  margin-top: 14px;
  box-shadow: 0 4px 14px rgba(79,70,229,0.3);
}

.btn-primary:hover:not(:disabled) {
  background: #4338ca;
  box-shadow: 0 6px 20px rgba(79,70,229,0.4);
}

.btn-start {
  background: #10b981;
  color: #fff;
  width: 100%;
  box-shadow: 0 4px 14px rgba(16,185,129,0.3);
}

.btn-start:hover:not(:disabled) {
  background: #059669;
  box-shadow: 0 6px 20px rgba(16,185,129,0.4);
}

.btn-next {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.9rem;
  padding: 11px 22px;
  margin-top: 18px;
  border-radius: 10px;
}

.btn-next:hover:not(:disabled) { background: #e2e8f0; }

/* â”€â”€ Result banner â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.result-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.result-banner.correct {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.result-banner.incorrect {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.result-banner .icon { font-size: 1.3rem; }

/* â”€â”€ Solution block â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.solution-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 10px;
}

#tutor-response {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Mini Lesson Renderer (AI Teacher 5.0) ──────────────────────────────── */
.mini-lesson {
  padding: 8px 0 24px;
}

.ml-pattern-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #6B7280;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.ml-concept-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 16px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.ml-visual {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.ml-visual-pre {
  font-family: 'Courier New', Consolas, monospace;
  font-size: 0.84rem;
  line-height: 1.65;
  color: #374151;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.ml-key-idea {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-left: 3px solid #F59E0B;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.ml-key-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.ml-key-text {
  font-size: 0.93rem;
  font-weight: 600;
  color: #92400E;
  margin: 0;
  line-height: 1.55;
}

.ml-pattern-card {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
}

.ml-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.ml-pattern-card .ml-section-label { color: #3B82F6; }

.ml-pattern-text {
  font-size: 0.91rem;
  color: #1E40AF;
  margin: 0;
  line-height: 1.6;
  font-weight: 500;
}

.ml-example-card {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
}

.ml-example-card .ml-section-label { color: #6B7280; }

.ml-example-text {
  font-size: 0.88rem;
  color: #374151;
  margin: 0;
  line-height: 1.75;
}

.ml-remember-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-left: 3px solid #22C55E;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 4px;
}

.ml-remember-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.ml-remember-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: #15803D;
  margin: 0;
  line-height: 1.5;
}

.ml-generic-block {
  background: #F9FAFB;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 14px;
}

.ml-generic-block .ml-section-label { color: #9CA3AF; }

.ml-fallback-text {
  font-size: 0.92rem;
  color: #374151;
  line-height: 1.8;
  white-space: pre-wrap;
}

/* ── LE-2: Place Value Chart ─────────────────────────────────────────────── */

.pvc-wrapper {
  display: flex;
  justify-content: center;
  padding: 32px 20px;
  background: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 100%);
  border: 1px solid #DBEAFE;
  border-radius: 16px;
  margin-bottom: 28px;
}

.pvc {
  display: inline-flex;
  flex-direction: column;
  gap: 0;
  font-variant-numeric: tabular-nums;
}

.pvc-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.pvc-label-row { margin-bottom: 4px; }
.pvc-carry-row { min-height: 20px; margin-bottom: 2px; }

.pvc-op-space {
  width: 32px;
  flex-shrink: 0;
}

.pvc-operator {
  width: 32px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #4B5563;
  flex-shrink: 0;
  line-height: 1;
  padding-top: 2px;
}

.pvc-label {
  width: 56px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9CA3AF;
  transition: color 0.2s ease;
}

.pvc-label--highlight {
  color: #1D4ED8;
  font-weight: 900;
}

.pvc-carry-cell {
  width: 56px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: transparent;
  transition: color 0.25s ease, transform 0.25s ease;
}

.pvc-carry-cell--visible {
  color: #D97706;
  animation: carryReveal 0.3s ease;
}

@keyframes carryReveal {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pvc-digit {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}

.pvc-digit--empty { color: transparent; }

.pvc-digit--highlight {
  background: #DBEAFE;
  color: #1D4ED8;
}

.pvc-digit--hidden { color: transparent !important; }

.pvc-result-digit {
  color: #059669;
  font-weight: 800;
}

.pvc-result-digit.pvc-digit--highlight {
  background: #D1FAE5;
  color: #047857;
}

.pvc-divider {
  height: 2px;
  background: #374151;
  border-radius: 1px;
  margin: 6px 0 6px 32px;
}

/* ── LE-2: Enhanced Skill Card ───────────────────────────────────────────── */

.skill-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  padding-left: 12px;
  border-left: 3px solid #4F46E5;
}

/* ── LE-2: Observation Card ─────────────────────────────────────────────── */

.obs-card {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-left: 3px solid #F59E0B;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.obs-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.obs-icon { font-size: 1rem; }

.obs-title {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #B45309;
}

.obs-list {
  margin: 0;
  padding: 0 0 0 4px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.obs-item {
  font-size: 0.92rem;
  font-weight: 600;
  color: #92400E;
  line-height: 1.5;
  padding-left: 14px;
  position: relative;
}

.obs-item::before {
  content: '→';
  position: absolute;
  left: 0;
  color: #F59E0B;
  font-weight: 700;
}

/* ── LE-2: Rule Card ────────────────────────────────────────────────────── */

.rule-card {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-left: 3px solid #3B82F6;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.rule-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #3B82F6;
  margin-bottom: 8px;
}

.rule-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1E40AF;
  margin: 0;
  line-height: 1.6;
}

/* ── LE-2: Interactive Example ──────────────────────────────────────────── */

.ie-card {
  border: 1px solid #E5E7EB;
  border-top: 3px solid #4F46E5;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
  background: #FFFFFF;
}

.ie-step { display: none; }
.ie-step--active { display: block; }

.ie-pvc {
  display: flex;
  justify-content: center;
  padding: 28px 20px 20px;
  background: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 100%);
}

.ie-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: #374151;
  text-align: center;
  padding: 14px 20px 18px;
  line-height: 1.65;
  min-height: 100px;
}

.ie-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid #F3F4F6;
  background: #FAFAFA;
}

.ie-progress {
  font-size: 0.75rem;
  font-weight: 600;
  color: #9CA3AF;
  letter-spacing: 0.03em;
}

.ie-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #4F46E5;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.ie-btn:hover { background: #4338CA; }
.ie-btn:active { transform: scale(0.97); }
.ie-btn:disabled {
  background: #DCFCE7;
  color: #16A34A;
  cursor: default;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .ie-btn { transition: none; }
  .pvc-carry-cell--visible { animation: none; }
}

/* ── LE-2: Remember Card ─────────────────────────────────────────────────── */

.remember-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-left: 3px solid #22C55E;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.remember-icon { font-size: 1rem; flex-shrink: 0; padding-top: 2px; }

.remember-text {
  font-size: 1rem;
  font-weight: 700;
  color: #15803D;
  margin: 0;
  line-height: 1.55;
}

/* ── LE-2: Common Mistake Card ──────────────────────────────────────────── */

.mistake-card {
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-left: 3px solid #F97316;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.mistake-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #C2410C;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.mistake-text {
  font-size: 0.88rem;
  color: #7C2D12;
  margin: 0;
  line-height: 1.65;
}

/* ── LE-2: Text-based example (fallback) ────────────────────────────────── */

.text-example-card {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 14px;
}

.text-example-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6B7280;
  margin-bottom: 8px;
}

.text-example-body {
  font-size: 0.88rem;
  color: #374151;
  margin: 0;
  line-height: 1.75;
}

/* ── LE-2: Responsive PVC ───────────────────────────────────────────────── */

@media (max-width: 400px) {
  .pvc-digit { width: 44px; height: 44px; font-size: 1.45rem; }
  .pvc-label { width: 44px; }
  .pvc-carry-cell { width: 44px; }
  .pvc-result-digit { width: 44px; height: 44px; font-size: 1.45rem; }
  .pvc-operator { width: 26px; }
  .pvc-op-space { width: 26px; }
}

/* ── LE-2.2: Hero Chart Entrance Animation ──────────────────────────────── */

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

.pvc-wrapper--hero .pvc-digit {
  animation: digitEnter 0.4s ease backwards;
}

.pvc-wrapper--hero .pvc > div:nth-child(3) .pvc-digit { animation-delay: 0.05s; }
.pvc-wrapper--hero .pvc > div:nth-child(4) .pvc-digit { animation-delay: 0.15s; }

@media (prefers-reduced-motion: reduce) {
  .pvc-wrapper--hero .pvc-digit { animation: none; }
}

/* ── LE-2.2: Rule Column Sequence Visual ────────────────────────────────── */

.rule-sequence {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.rseq-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.rseq-num {
  font-size: 0.58rem;
  font-weight: 800;
  color: #93C5FD;
  letter-spacing: 0.05em;
}

.rseq-col {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #DBEAFE;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #1E40AF;
}

.rseq-arrow {
  font-size: 1rem;
  color: #93C5FD;
  margin-top: 10px;
}

/* ── LE-2.2: Interactive Example Equation Visual ────────────────────────── */

.ie-eq {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0 auto;
  line-height: 1;
}

.ie-eq-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9CA3AF;
}

.ie-eq-math {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ie-eq-digit {
  font-size: 2.1rem;
  font-weight: 700;
  color: #111827;
  min-width: 38px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ie-eq-sym {
  font-size: 1.5rem;
  font-weight: 400;
  color: #9CA3AF;
}

.ie-eq-unknown { color: #D1D5DB; }

.ie-eq-answer {
  color: #059669;
  font-weight: 800;
}

.ie-eq-carry-in { color: #D97706; }

.ie-eq-carry-note {
  font-size: 0.82rem;
  font-weight: 600;
  color: #D97706;
  margin-top: 2px;
}

/* ── Phase 6: Pattern Header ─────────────────────────────────────────────── */
#pattern-header {
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.ph-name {
  font-weight: 700;
  color: #1E3A8A;
}

.ph-sep {
  color: #93C5FD;
  font-size: 0.75rem;
}

.ph-practice {
  color: #4B5563;
  font-size: 0.8rem;
}

.ph-mastery {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.ph-bar {
  font-family: 'Courier New', Consolas, monospace;
  font-size: 0.82rem;
  color: #3B82F6;
  letter-spacing: 0.04em;
}

.ph-pct {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1D4ED8;
  min-width: 30px;
}

/* ── Phase 6: Compact Wrong-Answer Feedback ─────────────────────────────── */
.compact-wrong-answer {
  padding: 14px 18px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-left: 3px solid #EF4444;
  border-radius: 10px;
}

.cwa-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #B91C1C;
  margin-bottom: 6px;
}

.cwa-body {
  font-size: 0.88rem;
  color: #7F1D1D;
  line-height: 1.5;
}

/* ── Visual Solution Playback ─────────────────────────────────────────────── */
.vsp-card {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  padding: 20px 24px 24px;
  animation: vsp-fade-in 0.3s ease both;
}
@keyframes vsp-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.vsp-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #E5E7EB;
}
.vsp-header-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.vsp-header-answer {
  font-family: 'Courier New', Consolas, monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: #DC2626;
}

.vsp-flow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.vsp-expr {
  font-family: 'Courier New', Consolas, monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: #111827;
  text-align: center;
  padding: 8px 0;
  animation: vsp-rise 0.35s ease both;
  word-break: break-word;
}
.vsp-expr--start { color: #374151; }
.vsp-expr--final {
  color: #059669;
  font-size: 1.45rem;
}

@keyframes vsp-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Main flow stays centered; the helper lane occupies the right half of the
   row via equal flex spacers either side of the arrow, so the arrow's
   horizontal position never shifts whether or not a row has a helper. */
.vsp-transition {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 6px 0;
  min-height: 34px;
}
.vsp-transition-spacer {
  flex: 1 1 0;
}
.vsp-arrow {
  font-size: 1.2rem;
  color: #9CA3AF;
  flex: 0 0 auto;
  margin: 0 14px;
}
.vsp-helper-lane {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.vsp-helper-lane:empty { visibility: hidden; }

/* ── Textbook line renderer (expression/fraction/percentage/equation/
   geometry flows) — stacked, left-aligned working lines with the helper
   chip beside the relevant line, the way a textbook writes it out. ── */
.vsp-textbook {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 100%;
  margin: 0 auto;
}
.vsp-tb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 5px 0;
}
.vsp-tb-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: 'Courier New', Consolas, monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: #111827;
}
.vsp-tb-eq {
  flex: 0 0 auto;
  color: #9CA3AF;
  min-width: 0.7em;
  text-align: center;
}
.vsp-tb-eq--blank { visibility: hidden; }
.vsp-tb-text { word-break: break-word; }
.vsp-tb-line--final .vsp-tb-text { color: #059669; }
.vsp-tb-helper { flex: 0 0 auto; }

.vsp-final {
  margin-top: 18px;
  padding: 14px 18px;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.vsp-final-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #059669;
}
.vsp-final-value {
  font-family: 'Courier New', Consolas, monospace;
  font-size: 1.8rem;
  font-weight: 800;
  color: #047857;
  word-break: break-word;
}

/* Micro-helper chips — small, visual, never a paragraph */
.vsp-chip {
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #3730A3;
  max-width: 210px;
  text-align: center;
}
.vsp-chip-line { font-weight: 600; }
.vsp-chip-sub {
  color: #6366F1;
  font-size: 0.73rem;
  margin-top: 3px;
}
.vsp-chip-big {
  font-size: 1rem;
  font-weight: 700;
  color: #4338CA;
}
/* Compact carry_chip: "13 -> 1 ten + 3 ones", write/carry colour-coded. */
.vsp-chip--carry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
}
.vsp-carry-sum { font-size: 1.05rem; font-weight: 800; color: #4338CA; }
.vsp-carry-arrow { font-size: 0.72rem; color: #9CA3AF; line-height: 1; }
.vsp-carry-split { display: flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 700; }
.vsp-carry-piece { padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
.vsp-carry-piece--carry { color: #B45309; background: #FEF3C7; }
.vsp-carry-piece--write { color: #047857; background: #D1FAE5; }
.vsp-carry-plus { color: #9CA3AF; }
.vsp-chip--borrow { background: #FEF3C7; border-color: #FDE68A; }
.vsp-chip--borrow .vsp-carry-sum { color: #B45309; }
.vsp-chip--sum { background: #ECFDF5; border-color: #A7F3D0; }
.vsp-chip--sum .vsp-chip-big { color: #059669; }
.vsp-chip--percent,
.vsp-chip--simplify { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; }
.vsp-chip--simplify .vsp-chip-arrow,
.vsp-chip--percent .vsp-chip-arrow { color: #EA580C; }
.vsp-chip--partwhole { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.vsp-chip--decimal { background: #F5F3FF; border-color: #DDD6FE; color: #5B21B6; }
.vsp-chip--primefactors { background: #EEF2FF; border-color: #C7D2FE; color: #3730A3; }

/* ── Class 6 Completion Pack 1: fractions, decimals, data handling ────────── */
.vsp-chip--commondenom { background: #EEF2FF; border-color: #C7D2FE; color: #3730A3; }
.vsp-chip--commondenom .vsp-chip-big { color: #4338CA; }
.vsp-chip--equivfraction { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; }
.vsp-chip--equivfraction .vsp-chip-arrow { color: #EA580C; }
.vsp-chip--orderedfraction { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.vsp-chip--divisiondecimal { background: #F5F3FF; border-color: #DDD6FE; color: #5B21B6; }
.vsp-chip--decimalplacevalue { background: #F5F3FF; border-color: #DDD6FE; color: #5B21B6; }
.vsp-chip--rangehighlight { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.vsp-chip--modefrequency { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.vsp-chip--modefrequency .vsp-chip-big { color: #059669; }
.vsp-chip--ordereddata { background: #EEF2FF; border-color: #C7D2FE; color: #3730A3; }
.vsp-chip--medianmiddle { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; }
.vsp-chip--medianmiddle .vsp-chip-big { color: #C2410C; }
.vsp-chip--remainingquantity { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }

/* ── Class 6 Completion Pack 2: integers, equations, mensuration, ratio,
     fractions, safe table/graph reading ─────────────────────────────────── */
.vsp-chip--signrule { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; }
.vsp-chip--phrasetoexpr { background: #EEF2FF; border-color: #C7D2FE; color: #3730A3; }
.vsp-chip--phrasetoexpr .vsp-chip-arrow { color: #6366F1; }
.vsp-chip--perimeter { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.vsp-chip--square-diagram { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.vsp-chip--reciprocal { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; }
.vsp-chip--reciprocal .vsp-chip-arrow { color: #EA580C; }
.vsp-chip--tablehighlight { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.vsp-chip--tablehighlight .vsp-chip-big { color: #059669; }
.vsp-chip--difference { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.vsp-rect-diagram--boundary { border-width: 2.5px; border-style: dashed; }
.vsp-chip--rational { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.vsp-chip--rational .vsp-chip-sub { color: #059669; }

.vsp-chip--numberline { background: #F5F3FF; border-color: #DDD6FE; color: #5B21B6; padding-bottom: 22px; }
.vsp-numberline-track { position: relative; height: 2px; background: #C4B5FD; margin: 18px 8px 20px; }
.vsp-numberline-zero { position: absolute; top: -6px; transform: translateX(-50%); font-size: 11px; color: #7C3AED; }
.vsp-numberline-point { position: absolute; top: -3px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.vsp-numberline-dot { width: 8px; height: 8px; border-radius: 50%; background: #7C3AED; display: block; }
.vsp-numberline-label { font-size: 11px; color: #5B21B6; white-space: nowrap; margin-top: 12px; }

.vsp-chip--balancescale { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.vsp-balance-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.vsp-balance-pan { background: #DBEAFE; border-radius: 6px; padding: 4px 8px; font-size: 12px; }
.vsp-balance-fulcrum { font-size: 16px; color: #2563EB; }

.vsp-chip--solutioncheck { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.vsp-chip--solutioncheck .vsp-chip-big { color: #059669; }

/* ── Topic Pack 1 chips ────────────────────────────────────────────────── */
.vsp-chip--samedenom { background: #EEF2FF; border-color: #C7D2FE; color: #3730A3; }
.vsp-chip--fractionbar { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.vsp-chip--ratiosimplify { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; }
.vsp-chip--ratiosimplify .vsp-chip-arrow { color: #EA580C; }
.vsp-chip--equation { background: #F5F3FF; border-color: #DDD6FE; color: #5B21B6; }
.vsp-chip--formula { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; }
.vsp-chip--formula .vsp-chip-big { color: #C2410C; }
.vsp-chip--rectangle { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }

/* ── Topic Pack 2 chips ────────────────────────────────────────────────── */
.vsp-chip--currency { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.vsp-chip--currency .vsp-chip-arrow { color: #059669; }
.vsp-chip--moneydiff { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.vsp-chip--moneydiff .vsp-chip-line + .vsp-chip-line { margin-top: 2px; }
.vsp-chip--percentrate { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; }
.vsp-chip--cancelfactor { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; }
.vsp-chip--cancelfactor .vsp-chip-arrow { color: #EA580C; }
.vsp-chip--unitary { background: #F5F3FF; border-color: #DDD6FE; color: #5B21B6; }
.vsp-chip--unitary .vsp-chip-line + .vsp-chip-line { margin-top: 2px; }
.vsp-chip--avggroup { background: #EEF2FF; border-color: #C7D2FE; color: #3730A3; }
.vsp-chip--sumchip { background: #ECFDF5; border-color: #A7F3D0; }
.vsp-chip--sumchip .vsp-chip-big { color: #059669; }
.vsp-chip--unit { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.vsp-chip--fractionofqty { background: #EEF2FF; border-color: #C7D2FE; color: #3730A3; }
.vsp-chip--decimalalign { background: #F5F3FF; border-color: #DDD6FE; color: #5B21B6; }
.vsp-chip-mono {
  font-family: 'Courier New', Consolas, monospace;
  text-align: right;
  display: inline-block;
}

/* ── Topic Pack 3 chips ────────────────────────────────────────────────── */
.vsp-chip--liketerms { background: #EEF2FF; border-color: #C7D2FE; color: #3730A3; }
.vsp-chip--liketermsgroup { background: #EEF2FF; border-color: #C7D2FE; color: #3730A3; }
.vsp-chip--distributive { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; }
.vsp-chip--commonfactor { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; }
.vsp-chip--righttriangle { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.vsp-chip--square { background: #F5F3FF; border-color: #DDD6FE; color: #5B21B6; }
.vsp-chip--sqrt { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.vsp-chip--triangleangle { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.vsp-chip--straightline { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.vsp-chip--circle { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
/* Class 6 Number Play — Supercells (1D row). */
.vsp-chip--numberrow { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; max-width: 320px; }
.vsp-numrow { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 6px; }
.vsp-numrow-cell { padding: 3px 8px; border-radius: 6px; background: #FFFFFF; border: 1px solid #A7F3D0; font-weight: 600; font-size: 0.78rem; }
.vsp-numrow-cell--super { background: #059669; border-color: #059669; color: #FFFFFF; }
.vsp-chip--coordpoints { background: #EEF2FF; border-color: #C7D2FE; color: #3730A3; }
.vsp-chip--coordpoints .vsp-chip-line + .vsp-chip-line { margin-top: 2px; }
.vsp-chip--riserun { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }

/* ── Topic Pack 4 chips ────────────────────────────────────────────────── */
.vsp-chip--exponentadd { background: #EEF2FF; border-color: #C7D2FE; color: #3730A3; }
.vsp-chip--exponentmultiply { background: #EEF2FF; border-color: #C7D2FE; color: #3730A3; }
.vsp-chip--exponentsubtract { background: #EEF2FF; border-color: #C7D2FE; color: #3730A3; }
.vsp-chip--binomialsquare { background: #F5F3FF; border-color: #DDD6FE; color: #5B21B6; }
.vsp-chip--diffsquares { background: #F5F3FF; border-color: #DDD6FE; color: #5B21B6; }
.vsp-chip--factorpair { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; }
.vsp-chip--splitmiddle { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; }
.vsp-chip--commonbinomial { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; }
.vsp-chip--zeroproduct { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.vsp-chip--valuechange { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }

/* ── Topic Pack 5 chips ────────────────────────────────────────────────── */
.vsp-chip--trigtriangle { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.vsp-chip--trigratio { background: #EEF2FF; border-color: #C7D2FE; color: #3730A3; }
.vsp-chip--distanceformula { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.vsp-chip--midpoint { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.vsp-chip--slopeintercept { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; }
.vsp-chip--pointslope { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; }

/* Small geometry cues — proportion hints, never a scale drawing or an
   interactive diagram (kept intentionally tiny per VSP scope). */
.vsp-triangle-diagram {
  width: 0;
  height: 0;
  border-left: 26px solid transparent;
  border-bottom: 26px solid #60A5FA;
  margin: 4px auto 6px;
}
.vsp-circle-diagram {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #60A5FA;
  background: #DBEAFE;
  margin: 4px auto 6px;
}

/* Class 7 Triangle and Its Properties: real labelled triangle diagrams
   (triangle_angles_chip / triangle_sides_chip) — a fixed, non-proportional
   shape (like the icons above) but with each row's actual given/highlighted
   values overlaid as SVG text, not just a decorative silhouette. */
.vsp-chip--triangle { text-align: center; }
.vsp-tri-svg {
  width: 120px;
  height: 90px;
  margin: 2px auto 4px;
  overflow: visible;
}
.vsp-tri-shape {
  fill: #DBEAFE;
  stroke: #60A5FA;
  stroke-width: 2;
}
.vsp-tri-label {
  font-size: 11px;
  fill: #1E3A8A;
  font-family: inherit;
}
.vsp-tri-label--hi {
  fill: #B45309;
  font-weight: 700;
}
.vsp-tri-rightmark {
  fill: none;
  stroke: #1E3A8A;
  stroke-width: 1.5;
}
.vsp-tri-ext-ray {
  stroke: #B45309;
  stroke-width: 1.5;
  stroke-dasharray: 3 2;
}

/* Class 8 Introduction to Graphs visual-quality pass: real plotted
   coordinate-plane diagrams (coordinate_grid_chip, plotted_point_chip,
   line_graph_chip, distance_time_graph_chip) — a genuinely data-driven
   axes + point/line plot (via _vspGraphSvgBody), not a decorative shape or
   a bare text label. */
.vsp-chip--coordinategrid,
.vsp-chip--plottedpoint,
.vsp-chip--linegraph,
.vsp-chip--distancetimegraph { text-align: center; }
.vsp-graph-svg {
  width: 110px;
  height: 94px;
  margin: 2px auto 4px;
  overflow: visible;
}
.vsp-graph-axis {
  stroke: #94A3B8;
  stroke-width: 1;
}
.vsp-graph-axislabel {
  font-size: 9px;
  fill: #64748B;
  font-family: inherit;
}
.vsp-graph-line {
  stroke: #60A5FA;
  stroke-width: 2;
}
.vsp-graph-point {
  fill: #1E3A8A;
  stroke: #DBEAFE;
  stroke-width: 1;
}

/* Class 6 Symmetry: real SVG shape diagrams (line_of_symmetry_chip,
   mirror_fold_check_chip, rotation_order_chip) built on
   _vspRegularShapeSvgBody — a genuine shape outline + symmetry axes/arc,
   not a decorative silhouette. */
.vsp-chip--symmetrylines,
.vsp-chip--mirrorfold,
.vsp-chip--rotationorder,
.vsp-chip--blockletter,
.vsp-chip--gridarea,
.vsp-chip--dotarray,
.vsp-chip--shapepattern { text-align: center; }
.vsp-blockletter-glyph {
  font-size: 64px;
  font-weight: 700;
  font-family: Arial, Helvetica, sans-serif;
  fill: #1E3A8A;
}
.vsp-grid-cell {
  fill: #DBEAFE;
  stroke: #60A5FA;
  stroke-width: 1;
}
.vsp-dot {
  fill: #1E3A8A;
}
.vsp-sym-svg {
  width: 110px;
  height: 110px;
  margin: 2px auto 4px;
  overflow: visible;
}
.vsp-sym-shape {
  fill: #DBEAFE;
  stroke: #60A5FA;
  stroke-width: 2;
}
.vsp-sym-axis {
  stroke: #B45309;
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}
.vsp-sym-axis--valid {
  stroke: #15803D;
  stroke-dasharray: 4 3;
}
.vsp-sym-axis--invalid {
  stroke: #B91C1C;
  stroke-dasharray: 2 2;
}
.vsp-sym-rotarc {
  stroke: #7C3AED;
  stroke-width: 2;
  marker-end: none;
}

.vsp-part-boxes,
.vsp-fraction-bar {
  display: flex;
  gap: 3px;
  justify-content: center;
  margin: 7px 0 5px;
  flex-wrap: wrap;
}
.vsp-part-box,
.vsp-bar-seg {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #DBEAFE;
  border: 1px solid #93C5FD;
}
.vsp-part-box--selected {
  background: #3B82F6;
  border-color: #2563EB;
  animation: vsp-pop 0.3s ease both;
}
.vsp-bar-seg--filled {
  background: #6EE7B7;
  border-color: #10B981;
  animation: vsp-pop 0.3s ease both;
}
@keyframes vsp-pop {
  from { transform: scale(0.5); opacity: 0.4; }
  to   { transform: scale(1); opacity: 1; }
}

/* Small rectangle cue — a proportion hint, not a scale drawing */
.vsp-rect-diagram {
  position: relative;
  margin: 6px auto 4px;
  border: 2px solid #60A5FA;
  border-radius: 3px;
  background: #DBEAFE;
}
.vsp-rect-label {
  position: absolute;
  font-size: 0.68rem;
  font-weight: 700;
  color: #1E40AF;
  white-space: nowrap;
}
.vsp-rect-label--top {
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
}
.vsp-rect-label--side {
  left: -8px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
}

/* ── Vertical column grid — column_operation (e.g. 245 + 678) ──────────────
   A real vertical-addition layout: carries above, operands stacked, ruled
   line, result row. Built from script.meta.vertical (see registry.js);
   animation-delay only staggers the reveal right-to-left (solving order) —
   the paused end state already shows the full worked column sum. */
.vsp-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.vsp-vgrid {
  display: inline-grid;
  row-gap: 2px;
  column-gap: 4px;
  font-family: 'Courier New', Consolas, monospace;
  font-weight: 800;
}
.vsp-vrow { display: contents; }
.vsp-vsign {
  grid-column: 1;
  text-align: center;
  color: #374151;
  font-size: 1.3rem;
  align-self: center;
}
.vsp-vcell {
  text-align: center;
  font-size: 1.3rem;
  color: #111827;
  padding: 2px 0;
}
.vsp-vrow--carry .vsp-vcell {
  font-size: 0.85rem;
  font-weight: 800;
  color: #B45309;
  min-height: 1.1em;
}
.vsp-vcarry--show { animation: vsp-carry-pop 0.4s ease both; }
.vsp-vrule { grid-column: 1 / -1; border-top: 2.5px solid #111827; margin: 2px 0 4px; }
.vsp-vrow--result .vsp-vcell { color: #059669; font-size: 1.4rem; }
.vsp-vcell--active { animation: vsp-vreveal 0.4s ease both; }
.vsp-vdot { font-weight: 900; }
@keyframes vsp-vreveal {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes vsp-carry-pop {
  from { opacity: 0; transform: translateY(4px) scale(0.7); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Long division bracket — long_division (Class 6) ────────────────────── */
.vsp-longdiv {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: 'Courier New', Consolas, monospace;
}
.vsp-ld-grid {
  display: inline-grid;
  row-gap: 0;
}
.vsp-ld-cell {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: #111827;
}
.vsp-ld-quotient .vsp-ld-cell { color: #059669; }
.vsp-ld-main { display: flex; align-items: flex-start; gap: 6px; }
.vsp-ld-divisor { font-size: 1.3rem; font-weight: 800; color: #111827; padding-top: 2px; }
.vsp-ld-bracket {
  border-top: 2.5px solid #111827;
  border-left: 2.5px solid #111827;
  padding: 2px 4px 0 6px;
}
.vsp-ld-steps {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.75rem;
  color: #64748B;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 8px 12px;
  max-width: 90%;
}

@media (prefers-reduced-motion: reduce) {
  .vsp-card, .vsp-expr, .vsp-part-box--selected, .vsp-bar-seg--filled,
  .vsp-vcarry--show, .vsp-vcell--active { animation: none !important; }
}

/* ── Mobile: stack arrow + helper instead of squeezing them side by side ── */
@media (max-width: 480px) {
  .vsp-card { padding: 16px 16px 18px; }
  .vsp-expr { font-size: 1.1rem; }
  .vsp-expr--final { font-size: 1.25rem; }
  .vsp-final-value { font-size: 1.4rem; }
  .vsp-transition {
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
  }
  .vsp-transition-spacer { display: none; }
  .vsp-arrow { margin: 0; }
  .vsp-helper-lane { justify-content: center; width: 100%; }
  .vsp-chip { max-width: 90%; }

  .vsp-tb-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .vsp-tb-line { font-size: 1.05rem; }
  .vsp-tb-helper { margin-left: 0; }

  .vsp-vsign { font-size: 1.05rem; }
  .vsp-vcell { font-size: 1.05rem; }
  .vsp-vrow--result .vsp-vcell { font-size: 1.15rem; }
}

/* â”€â”€ Interactive Simulation â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sim-toggle-btn {
  padding: 8px 16px;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  background: #F9FAFB;
  color: #374151;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.sim-toggle-btn:hover { background: #E5E7EB; }
.sim-toggle-active {
  background: #4F46E5 !important;
  color: #fff !important;
  border-color: #4F46E5 !important;
}
.sim-choice-btn {
  width: 100%;
  padding: 12px 16px;
  background: #fff;
  border: 2px solid #E5E7EB;
  border-radius: 10px;
  font-size: 0.95rem;
  color: #1F2937;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.sim-choice-btn:hover  { border-color: #4F46E5; background: #EEF2FF; }
.sim-choice-correct    { border-color: #22C55E !important; background: #F0FDF4 !important; }
.sim-choice-wrong      { border-color: #EF4444 !important; background: #FEF2F2 !important; }

/* â”€â”€ Step cards (solution + concept example) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.step-card {
  background: #f8fafc;
  border-left: 4px solid #4f46e5;
  border-radius: 0 10px 10px 0;
  padding: 10px 14px;
  margin-bottom: 8px;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(8px);
  animation: stepIn 0.35s ease forwards;
}

@keyframes stepIn {
  to { opacity: 1; transform: translateY(0); }
}

.step-number {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #4f46e5;
  margin-bottom: 4px;
}

.step-text {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #1e293b;
  white-space: pre-wrap;
}

/* â”€â”€ Feedback card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#feedback-card { display: none; }
#feedback-card.correct   { border-top: 4px solid #10b981; }
#feedback-card.incorrect { border-top: 4px solid #ef4444; }

/* â”€â”€ Progress hint â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.progress-hint,
#progress-hint {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1d4ed8;
  margin-top: 14px;
}

/* â”€â”€ Error card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#error-card {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 14px;
  padding: 16px 20px;
  color: #b91c1c;
  font-size: 0.9rem;
  display: none;
}

/* â”€â”€ Practice section â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#practice-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#practice-section.hidden { display: none; }

/* â”€â”€ Level Progress (Wood â†’ Diamond) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.level-progress {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.level-progress h4 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #94a3b8;
  margin-bottom: 10px;
}

.levels {
  display: flex;
  gap: 5px;
}

.level {
  flex: 1;
  padding: 6px 4px;
  border-radius: 20px;
  font-size: 10.5px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  transition: transform 0.15s;
}

.level.completed {
  background: #d1fae5;
  color: #065f46;
}

.level.current {
  background: #dbeafe;
  color: #1e40af;
  font-weight: 800;
  box-shadow: 0 0 0 2px #93c5fd;
  transform: scale(1.05);
}

.level.locked {
  background: #f3f4f6;
  color: #9ca3af;
}

/* â”€â”€ Roadmap (right sidebar) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.roadmap-container {
  overflow-x: auto;
  padding: 10px 0 6px;
  scrollbar-width: thin;
  scrollbar-color: #c7d2fe #f1f5f9;
}

.roadmap-container::-webkit-scrollbar { height: 4px; }
.roadmap-container::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 999px; }
.roadmap-container::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 999px; }

.roadmap {
  display: flex;
  align-items: flex-start;
  gap: 0;
  min-width: max-content;
}

/* â”€â”€ Node â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 72px;
  cursor: default;
  padding: 6px 4px;
  border-radius: 14px;
  transition: background 0.2s;
}

.node.completed,
.node.current {
  cursor: pointer;
}

.node.completed:hover,
.node.current:hover {
  background: rgba(79,70,229,0.05);
}

.node.active {
  background: rgba(79,70,229,0.08);
}

.node.active.completed {
  background: rgba(16,185,129,0.08);
}

/* Node label (plain div â€” the second child) */
.node > div:not(.circle) {
  font-size: 0.65rem;
  font-weight: 600;
  color: #64748b;
  text-align: center;
  white-space: nowrap;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node.current   > div:not(.circle) { color: #4338ca; font-weight: 700; }
.node.completed > div:not(.circle) { color: #059669; }
.node.locked    > div:not(.circle) { color: #adb5bd; }

/* â”€â”€ Circle â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.node:hover    .circle { transform: scale(1.08); }
.node.active   .circle { transform: scale(1.18) !important; }

.circle.completed {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(5,150,105,0.35);
}

.circle.current {
  background: linear-gradient(135deg, #60a5fa 0%, #4f46e5 100%);
  color: #fff;
  box-shadow: 0 0 10px rgba(59,130,246,0.8);
  animation: node-bounce 1.6s ease-in-out infinite,
             node-pulse  2s   ease-in-out infinite;
}

/* When active, stop bounce but keep glow */
.node.active .circle.current {
  animation: node-pulse 2s ease-in-out infinite;
}

.circle.locked {
  background: #d1d5db;
  color: #9ca3af;
}

/* â”€â”€ Admin skip button (roadmap node) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.btn-skip-topic {
  display: block;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 0.6rem;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-skip-topic:hover:not(:disabled) { background: #fde68a; }
.btn-skip-topic:disabled { opacity: 0.5; cursor: not-allowed; }

/* â”€â”€ Connector line â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.line {
  width: 40px;
  height: 4px;
  flex-shrink: 0;
  border-radius: 2px;
  background: #e2e8f0;
  margin-top: 22px;   /* (44px circle / 2) - (4px line / 2) = 20px + 2px node padding */
  align-self: flex-start;
  position: relative;
  overflow: hidden;
}

.line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to right,
    transparent 0px, transparent 6px,
    rgba(255,255,255,0.5) 6px, rgba(255,255,255,0.5) 10px
  );
}

.line.done {
  background: linear-gradient(to right, #34d399, #10b981);
}

.line.done::after { display: none; }

/* â”€â”€ Roadmap finish flag â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.roadmap-finish {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px 6px 6px 10px;
  font-size: 1.8rem;
  line-height: 1;
}

.finish-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: #4f46e5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.roadmap-loading {
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 14px 0;
}

/* â”€â”€ Roadmap animations â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@keyframes node-bounce {
  0%, 100% { transform: translateY(0); }
  45%       { transform: translateY(-7px); }
  65%       { transform: translateY(-3px); }
}

@keyframes node-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(59,130,246,0.8); }
  50%       { box-shadow: 0 0 20px rgba(59,130,246,1), 0 0 0 6px rgba(59,130,246,0.15); }
}

/* â”€â”€ Dashboard title â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.dashboard-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
}

/* â”€â”€ Leaderboard â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  transition: background 0.15s;
}

.lb-row:hover { background: #f1f5f9; }

.lb-rank { font-size: 1.2rem; width: 32px; text-align: center; flex-shrink: 0; }
.lb-name { flex: 1; font-weight: 600; font-size: 0.92rem; color: #1e293b; }
.lb-rating { font-size: 0.85rem; font-weight: 700; color: #64748b; white-space: nowrap; }

.lb-row.gold   { background: #fffbeb; border: 1px solid #fde68a; }
.lb-row.silver { background: #f8fafc; border: 1px solid #e2e8f0; }
.lb-row.bronze { background: #fff7f2; border: 1px solid #fed7aa; }

.lb-row.gold   .lb-name { color: #92400e; }
.lb-row.silver .lb-name { color: #334155; }
.lb-row.bronze .lb-name { color: #9a3412; }

.lb-row.gold   .lb-rating { color: #b45309; }
.lb-row.silver .lb-rating { color: #475569; }
.lb-row.bronze .lb-rating { color: #c2410c; }

/* â”€â”€ Progress dashboard â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.overall-accuracy {
  text-align: center;
  margin-bottom: 20px;
}

.accuracy-number {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  color: #4f46e5;
}

.accuracy-label {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.progress-bar-fill.strong { background: #10b981; }
.progress-bar-fill.medium { background: #f59e0b; }
.progress-bar-fill.weak   { background: #ef4444; }

.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 10px;
}

.topic-row { margin-bottom: 12px; }

.topic-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.topic-name { font-size: 0.88rem; font-weight: 500; color: #334155; }
.topic-pct  { font-size: 0.82rem; font-weight: 700; }

.topic-pct.strong { color: #10b981; }
.topic-pct.medium { color: #f59e0b; }
.topic-pct.weak   { color: #ef4444; }

.weak-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }

.weak-badge {
  padding: 3px 11px;
  border-radius: 999px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-size: 0.78rem;
  font-weight: 600;
}

.no-data {
  text-align: center;
  color: #94a3b8;
  font-size: 0.88rem;
  padding: 10px 0;
}

.divider {
  border: none;
  border-top: 1px solid #f1f5f9;
  margin: 16px 0;
}

/* â”€â”€ Concept SVG visual â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.concept-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0 18px;
}
.concept-visual svg {
  filter: drop-shadow(0 2px 8px rgba(79,70,229,0.12));
  overflow: visible;
}

/* â”€â”€ Concept teaching diagram containers (AI-generated, chord/circle diagrams) */
._cpt-diagram {
  flex-shrink: 0;
  width: 220px;
  min-width: 220px;
}
._cpt-diagram svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
@keyframes draw {
  to { stroke-dashoffset: 0; }
}
@keyframes svgFadeIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

/* â”€â”€ Step-by-step example â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.step-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 10px;
}
.step-counter {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.3px;
}
.step-buttons { display: flex; gap: 8px; }

.btn-step {
  padding: 5px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.btn-step-auto           { background: #e0e7ff; color: #4338ca; }
.btn-step-auto.playing   { background: #fee2e2; color: #dc2626; }
.btn-step-auto:hover     { opacity: 0.8; }
.btn-step-next           { background: #4f46e5; color: #fff; }
.btn-step-next:hover:not(:disabled) { background: #4338ca; }
.btn-step-next:disabled  { opacity: 0.4; cursor: not-allowed; }

.step-item {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-left: 3px solid #e2e8f0;
  border-radius: 0 8px 8px 0;
  background: #f8fafc;
  font-size: 0.95rem;
  line-height: 1.8;
  color: #334155;
  white-space: pre-wrap;
}
.step-item.visible {
  opacity: 1;
  transform: translateY(0);
}
.step-item.active-step {
  border-left-color: #4f46e5;
  background: #f5f3ff;
}

/* Single-block fallback (no steps) */
.example-plain {
  background: #f8fafc;
  border-left: 4px solid #c7d2fe;
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 0.95rem;
  line-height: 1.9;
  color: #334155;
  white-space: pre-wrap;
  margin-bottom: 4px;
}

/* â”€â”€ Highlight spans â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.hl-num {
  background: #fef3c7;
  color: #92400e;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
}
.hl-key {
  background: #dcfce7;
  color: #15803d;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  font-style: italic;
}

/* â”€â”€ Skeleton loader â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 6px;
  height: 1.2em;
  display: block;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* â”€â”€ Spinner â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* â”€â”€ Fade-in â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease forwards; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Math Power-Up â€” panel + components
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

#mathpowerup-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* â”€â”€ Header card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mp-header-card {
  border-top: 4px solid #f59e0b;
}

.mp-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.mp-header-info {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.mp-technique-source {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #f59e0b;
  margin-bottom: 4px;
}

.mp-technique-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.2;
  margin-bottom: 4px;
}

.mp-technique-concept {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.4;
  margin-bottom: 6px;
}

.mp-technique-counter {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.btn-mp-nav {
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-mp-nav:hover:not(:disabled) {
  background: #e0e7ff;
  border-color: #a5b4fc;
  color: #4338ca;
}

.btn-mp-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* â”€â”€ Stage buttons (right panel) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mp-stage-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mp-stage-btn {
  width: 100%;
  padding: 9px 14px;
  text-align: left;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.mp-stage-btn.active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.08);
}

.mp-stage-btn:hover:not(.active) {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

/* â”€â”€ Teaching card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mp-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #94a3b8;
  margin-bottom: 12px;
  margin-top: 4px;
}

.mp-explanation {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 6px;
}

.mp-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f8fafc;
  border-left: 3px solid #4f46e5;
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #334155;
}

.mp-step-num {
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #4f46e5;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.mp-step-text { flex: 1; }

/* â”€â”€ Worked examples â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mp-examples { margin-top: 20px; }

.mp-example {
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid #e2e8f0;
}

.mp-example-problem {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
}

.mp-example-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 8px;
}

.mp-example-step {
  font-size: 0.88rem;
  color: #475569;
  padding: 5px 0;
  border-bottom: 1px dashed #e2e8f0;
  line-height: 1.6;
}

.mp-example-step:last-child { border-bottom: none; }

.mp-example-answer {
  font-size: 0.88rem;
  color: #059669;
  font-weight: 700;
  padding-top: 8px;
  border-top: 1.5px solid #d1fae5;
  margin-top: 4px;
}

/* â”€â”€ Practice area â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#mp-practice-area {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#mp-question-text {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.65;
  color: #1e293b;
  min-height: 2em;
}

#mp-answer-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 1.05rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  color: #1e293b;
  background: #f8fafc;
}

#mp-answer-input:focus {
  border-color: #4f46e5;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79,70,229,0.1);
}

#mp-feedback-card { display: none; }
#mp-feedback-card.correct   { border-top: 4px solid #10b981; }
#mp-feedback-card.incorrect { border-top: 4px solid #ef4444; }

#mp-error-card {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 14px;
  padding: 16px 20px;
  color: #b91c1c;
  font-size: 0.9rem;
  display: none;
}

/* â”€â”€ Techniques Progress (right panel) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mp-progress-summary {
  text-align: center;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.mp-progress-count {
  font-size: 2.2rem;
  font-weight: 800;
  color: #f59e0b;
  line-height: 1;
}

.mp-progress-total {
  font-size: 1.1rem;
  color: #94a3b8;
  font-weight: 600;
}

.mp-progress-label {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.mp-tech-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 7px;
  transition: background 0.15s;
  cursor: pointer;
}

.mp-tech-row:hover { background: #f8fafc; }

.mp-tech-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #94a3b8;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.mp-tech-row.done .mp-tech-icon {
  background: #d1fae5;
  color: #059669;
}

.mp-tech-name {
  flex: 1;
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-tech-row.done .mp-tech-name {
  color: #059669;
  font-weight: 600;
}

.mp-tech-row.active-tech {
  background: #eff6ff;
}

.mp-tech-row.active-tech .mp-tech-name {
  color: #1d4ed8;
  font-weight: 700;
}

/* â”€â”€ Futuristic Simulation Theme â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.futuristic-panel {
  background: #0f172a !important; /* Slate 900 */
  border: 1px solid #334155 !important;
  border-radius: 20px !important;
  box-shadow: 0 0 40px rgba(79, 70, 229, 0.15) !important;
  color: #f1f5f9 !important;
  overflow: hidden;
}

.futuristic-header {
  background: linear-gradient(90deg, #4f46e5, #7c3aed) !important;
  padding: 16px 24px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.futuristic-body {
  padding: 24px 30px 30px !important;
  background: #0f172a !important;
}

.futuristic-visual-box {
  background: rgba(30, 41, 59, 0.5) !important;
  border: 1px solid #334155 !important;
  border-radius: 16px !important;
  padding: 24px !important;
  margin-bottom: 20px !important;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.2) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.futuristic-state-card {
  background: #1e293b !important; /* Slate 800 */
  border-radius: 12px !important;
  padding: 14px 18px !important;
  margin-bottom: 18px !important;
  border-left: 4px solid #818cf8 !important;
  color: #cbd5e1 !important;
  font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
  font-size: 0.9rem !important;
  line-height: 1.6 !important;
}

.futuristic-question {
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  color: #f8fafc !important;
  margin-bottom: 20px !important;
  line-height: 1.5 !important;
}

.futuristic-choices-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
}

@media (max-width: 640px) {
  .futuristic-choices-grid {
    grid-template-columns: 1fr !important;
  }
}

.futuristic-choice-btn {
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  color: #f1f5f9 !important;
  border-radius: 12px !important;
  padding: 16px 20px !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-align: left !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.futuristic-choice-btn:hover {
  background: #334155 !important;
  border-color: #6366f1 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.futuristic-choice-btn.sim-choice-correct {
  background: rgba(34, 197, 94, 0.15) !important;
  border-color: #22c55e !important;
  color: #4ade80 !important;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.1);
}

.futuristic-choice-btn.sim-choice-wrong {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: #ef4444 !important;
  color: #f87171 !important;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
}

.futuristic-input-group {
  display: flex !important;
  gap: 10px !important;
  align-items: center !important;
}

.futuristic-input {
  flex: 1 !important;
  background: #1e293b !important;
  border: 2px solid #334155 !important;
  color: #f1f5f9 !important;
  padding: 12px 16px !important;
  border-radius: 12px !important;
  font-size: 1rem !important;
  transition: all 0.2s;
}

.futuristic-input:focus {
  border-color: #6366f1 !important;
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.futuristic-submit-btn {
  padding: 12px 24px !important;
  background: #6366f1 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: all 0.2s;
}

.futuristic-submit-btn:hover {
  background: #4f46e5 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.futuristic-feedback {
  margin-top: 20px !important;
  padding: 14px 18px !important;
  border-radius: 12px !important;
  font-size: 0.95rem !important;
  line-height: 1.6 !important;
  min-height: 50px !important;
}

.futuristic-next-btn {
  background: #22c55e !important;
  color: #fff !important;
  padding: 14px 28px !important;
  border: none !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}

.futuristic-next-btn:hover {
  background: #16a34a !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

/* â”€â”€ ACTIVE TEACHING CANVAS & THINKING ENGINE â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.thinking-canvas {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
}

.canvas-main-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 350px;
    border-bottom: 1px solid #f1f5f9;
}

@media (max-width: 768px) {
    .canvas-main-split {
        grid-template-columns: 1fr;
    }
    .equation-area {
        border-left: none !important;
        border-top: 1px solid #f1f5f9;
    }
}

.visual-area {
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    position: relative;
}

.equation-area {
    padding: 30px;
    background: #ffffff;
    border-left: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
}

/* ── Phase 5.5B: Adaptive Dashboard (refined UX) ─────────────────────────── */

/* Override welcome-card dashed border when showing dashboard */
.welcome-card.dashboard-mode {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Greeting bar (Row 0) ── */
.dash-greeting {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 20px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.dash-greeting-left { display: flex; flex-direction: column; gap: 8px; }

.dash-hello {
  font-size: 1.2rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.2;
}

.dash-greeting-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.dash-greeting-time {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
  padding-top: 2px;
}

/* ── 2-column responsive grid ── */
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ── Promotion + Insights 2-col (3:2 ratio) ── */
.dash-grid-promo-insight {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 14px;
}

@media (max-width: 680px) {
  .dash-grid-2 { grid-template-columns: 1fr; }
  .dash-grid-promo-insight { grid-template-columns: 1fr; }
}

/* ── Individual widget card ── */
.dash-widget {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Section label inside a widget */
.dash-widget-label {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: #64748b;
  margin-bottom: 10px;
}

/* ── Badges ── */
.dash-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.dash-badge-class  { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.dash-badge-stage  { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.dash-badge-rating { background: #fefce8; color: #92400e; border: 1px solid #fde68a; }

/* ── Focus Today card (full-width, primary action) ── */
.dash-focus {
  border-color: #f97316;
  border-width: 2px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 65%);
}

.dash-focus .dash-widget-label { color: #c2410c; }

.dash-focus-content {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.dash-focus-left  { flex: 1; min-width: 180px; }
.dash-focus-right { display: flex; align-items: center; }

.dash-focus-topic {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 4px;
}

.dash-focus-reason {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 12px;
  line-height: 1.4;
}

.dash-focus-mastery {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-focus-bar-track {
  flex: 1;
  height: 8px;
  background: #fed7aa;
  border-radius: 999px;
  overflow: hidden;
  max-width: 140px;
}

.dash-focus-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f97316 0%, #ef4444 100%);
  transition: width 0.6s ease;
  min-width: 3px;
}

.dash-focus-mastery-pct {
  font-size: 0.8rem;
  font-weight: 700;
  color: #c2410c;
  white-space: nowrap;
}

/* ── Action buttons ── */
.btn-dash {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px 18px;
  min-height: 44px;
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  margin-top: 12px;
  text-align: center;
}

.btn-dash:active { transform: scale(0.97); }

.btn-dash:focus-visible {
  outline: 3px solid #6366f1;
  outline-offset: 3px;
}

.btn-dash-primary {
  background: #7c3aed;
  color: #fff;
  box-shadow: 0 4px 12px rgba(124,58,237,0.25);
}
.btn-dash-primary:hover { background: #6d28d9; box-shadow: 0 6px 16px rgba(124,58,237,0.35); }

.btn-dash-review {
  background: #f59e0b;
  color: #fff;
  box-shadow: 0 4px 12px rgba(245,158,11,0.25);
}
.btn-dash-review:hover { background: #d97706; box-shadow: 0 6px 16px rgba(245,158,11,0.35); }

.btn-dash-focus {
  background: #f97316;
  color: #fff;
  box-shadow: 0 4px 12px rgba(249,115,22,0.30);
  width: auto;
  min-width: 140px;
  white-space: nowrap;
}
.btn-dash-focus:hover { background: #ea6f0a; box-shadow: 0 6px 16px rgba(249,115,22,0.40); }

/* ── Continue Learning ── */
.dash-continue-concept {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 3px;
}

.dash-continue-meta {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.4;
}

/* ── Today's Review ── */
.dash-review-count {
  font-size: 2.4rem;
  font-weight: 900;
  color: #d97706;
  line-height: 1;
  margin-bottom: 2px;
}

.dash-review-sub {
  font-size: 0.8rem;
  color: #475569;
}

/* ── Promotion Goal ── */
.dash-promo-stages {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  flex-wrap: wrap;
}

.dash-promo-from  { color: #475569; }
.dash-promo-arrow { color: #a5b4fc; font-size: 0.9rem; }
.dash-promo-to    { color: #4f46e5; }

.dash-promo-track {
  height: 10px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.dash-promo-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%);
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 3px;
}

.dash-promo-motivation {
  font-size: 0.82rem;
  color: #4f46e5;
  font-weight: 700;
  line-height: 1.4;
}

.dash-promo-sub {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
}

.dash-promo-complete {
  font-size: 0.95rem;
  font-weight: 700;
  color: #10b981;
  text-align: center;
  padding: 14px 0;
}

/* ── Learning Insights ── */
.dash-insight-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #f1f5f9;
}
.dash-insight-row:last-child { border-bottom: none; padding-bottom: 0; }

.dash-insight-icon { font-size: 0.95rem; flex-shrink: 0; margin-top: 2px; }

.dash-insight-text { flex: 1; min-width: 0; }

.dash-insight-label {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 1px;
}

.dash-insight-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-insight-pct {
  font-size: 0.73rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 1px;
}
.dash-insight-pct-good { background: #dcfce7; color: #15803d; }
.dash-insight-pct-warn { background: #fef9c3; color: #92400e; }
.dash-insight-pct-bad  { background: #fee2e2; color: #b91c1c; }

/* ── Statistics strip ── */
.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 680px) {
  .dash-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.dash-stat {
  text-align: center;
  padding: 10px 4px;
  border-radius: 10px;
  background: #f8fafc;
}

.dash-stat-num {
  font-size: 1.7rem;
  font-weight: 800;
  color: #4f46e5;
  line-height: 1;
  margin-bottom: 5px;
  transition: color 0.3s;
  min-height: 1.7rem;
}

.dash-stat-num.stat-good { color: #15803d; }
.dash-stat-num.stat-warn { color: #92400e; }
.dash-stat-num.stat-bad  { color: #b91c1c; }

.dash-stat-lbl {
  font-size: 0.68rem;
  color: #475569;
  font-weight: 600;
  line-height: 1.35;
}

/* ── Empty / loading states ── */
.dash-loading-placeholder { min-height: 40px; }

.dash-skeleton {
  height: 14px;
  width: 100%;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: dash-shimmer 1.4s infinite;
  display: block;
}

@keyframes dash-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.dash-empty-state {
  text-align: center;
  padding: 8px 0 4px;
}

.dash-empty-emoji { font-size: 1.8rem; margin-bottom: 6px; line-height: 1; }

.dash-empty-text {
  font-size: 0.82rem;
  color: #475569;
  font-weight: 500;
  line-height: 1.55;
}

.dash-empty-cta {
  font-size: 0.78rem;
  color: #7c3aed;
  font-weight: 700;
  margin-top: 4px;
}

/* Fade-in for stat numbers when they load */
@keyframes dash-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0);   }
}
.dash-stat-animate { animation: dash-fadein 0.25s ease; }

/* legacy alias kept for old-dash-info-row usage (greeting bar uses .dash-greeting-badges) */
.dash-info-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }

/* ── Phase 5.5C: Polish sprint additions ─────────────────────────────────── */

/* ── Asymmetric 2:3 grid (Achievement+Promo, Snapshot+Insights) ── */
.dash-grid-2-3 {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 14px;
}
/* backwards-compat alias kept for tests */
.dash-grid-promo-insight { display: grid; grid-template-columns: 2fr 3fr; gap: 14px; }

@media (max-width: 680px) {
  .dash-grid-2-3           { grid-template-columns: 1fr; }
  .dash-grid-promo-insight { grid-template-columns: 1fr; }
}

/* ── Widget hover elevation ── */
.dash-widget {
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.dash-widget:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.09);
  transform: translateY(-1px);
}
/* Focus card keeps its own hover: orange glow */
.dash-focus:hover {
  box-shadow: 0 6px 20px rgba(249,115,22,0.18);
}

/* ── Review card: time estimate ── */
.dash-review-time {
  font-size: 1.25rem;
  font-weight: 800;
  color: #64748b;
  line-height: 1;
  margin-top: 2px;
}
.dash-review-time-lbl {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
}
.dash-review-pair {
  display: flex;
  gap: 18px;
  align-items: flex-end;
  margin-bottom: 2px;
}

/* ── Recent Achievement card ── */
.dash-achievement {
  border-color: #c7d2fe;
  background: linear-gradient(135deg, #eef2ff 0%, #ffffff 60%);
}
.dash-achievement .dash-widget-label { color: #4338ca; }

.dash-achieve-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 6px;
  display: block;
}
.dash-achieve-text {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.3;
}
.dash-achieve-sub {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 3px;
  font-weight: 500;
}
.dash-achieve-first {
  font-size: 0.85rem;
  color: #4338ca;
  font-weight: 600;
  line-height: 1.4;
}

/* ── Session Snapshot (Today) ── */
.dash-snapshot { }   /* inherits .dash-widget */

.dash-snapshot-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid #f8fafc;
  font-size: 0.82rem;
  color: #1e293b;
  font-weight: 600;
}
.dash-snapshot-item:last-child { border-bottom: none; }

.dash-snapshot-icon {
  font-size: 0.85rem;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}
.dash-snapshot-zero {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
  line-height: 1.5;
  padding: 4px 0;
}

/* ── Staggered card entrance animation ── */
@keyframes dash-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}
.dashboard > * {
  animation: dash-rise 0.22s ease both;
}
.dashboard > *:nth-child(1) { animation-delay: 0.00s; }
.dashboard > *:nth-child(2) { animation-delay: 0.04s; }
.dashboard > *:nth-child(3) { animation-delay: 0.08s; }
.dashboard > *:nth-child(4) { animation-delay: 0.12s; }
.dashboard > *:nth-child(5) { animation-delay: 0.16s; }
.dashboard > *:nth-child(6) { animation-delay: 0.20s; }

/* ── Reduced motion: disable all animations ── */
@media (prefers-reduced-motion: reduce) {
  .dash-skeleton              { animation: none; background: #e2e8f0; }
  .dash-promo-fill            { transition: none; }
  .dash-focus-bar-fill        { transition: none; }
  .dash-stat-animate          { animation: none; }
  .btn-dash                   { transition: background 0.1s; }
  .dash-widget                { transition: none; }
  .dash-widget:hover          { transform: none; }
  .dashboard > *              { animation: none; }
  @keyframes dash-rise        { from { opacity: 1; } }
  @keyframes dash-fadein      { from { opacity: 1; } }
  @keyframes dash-shimmer     { 0% { background-position: 0 0; } }
}

/* ── Smooth focus ring for keyboard navigation ── */
.dash-widget:focus-within {
  outline: none;
}

/* ── Dashboard scroll container on very small heights ── */
@media (max-height: 500px) {
  .dashboard { gap: 10px; }
  .dash-widget { padding: 12px 16px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Phase 5.5B.1 — Why You're Seeing This Card
   ══════════════════════════════════════════════════════════════════════════ */

.why-card {
  background: #fefce8;
  border: 1.5px solid #fde68a;
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 0.18s ease;
}
.why-card:focus-within { box-shadow: 0 0 0 3px rgba(251,191,36,0.3); }

/* ── Header (always visible) ── */
.why-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  padding: 11px 16px;
  cursor: pointer;
  text-align: left;
  color: inherit;
}
.why-header:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: -2px;
  border-radius: 10px;
}

.why-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex: 1;
}
.why-icon { font-size: 0.95rem; }

.why-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.why-badge-ready   { background: #dcfce7; color: #166534; }
.why-badge-stretch { background: #fef3c7; color: #92400e; }
.why-badge-support { background: #fce7f3; color: #9d174d; }

.why-chevron {
  font-size: 0.85rem;
  color: #a16207;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
.why-card.collapsed .why-chevron { transform: rotate(-90deg); }

/* ── Body (collapsible) ── */
.why-body {
  padding: 0 16px 14px;
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.22s ease, opacity 0.18s ease;
  opacity: 1;
}
.why-card.collapsed .why-body {
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
}
.why-body > * { overflow: hidden; }

/* ── Reason text ── */
.why-reason {
  font-size: 0.88rem;
  color: #78350f;
  line-height: 1.55;
  margin-bottom: 10px;
  font-weight: 500;
}

/* ── Meta row (mastery, difficulty, last practiced) ── */
.why-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.why-meta-chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  min-width: 72px;
}
.why-meta-label {
  font-size: 0.66rem;
  font-weight: 700;
  color: #a16207;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.why-meta-value {
  font-size: 0.93rem;
  font-weight: 800;
  color: #92400e;
  line-height: 1.2;
}
.why-meta-value.good  { color: #166534; }
.why-meta-value.ok    { color: #92400e; }
.why-meta-value.weak  { color: #9d174d; }

/* ── Journey text (progress connection) ── */
.why-journey {
  font-size: 0.8rem;
  color: #a16207;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.why-journey::before {
  content: '→';
  font-weight: 900;
  flex-shrink: 0;
}

/* ── Reduced motion (why-card + AFB + analytics + review) ── */
@media (prefers-reduced-motion: reduce) {
  .why-chevron        { transition: none; }
  .why-body           { transition: none; }
  .why-card           { transition: none; }
  .afb-mastery-panel  { animation: none; }
  .afb-impact-panel   { animation: none; }
  .afb-streak-panel   { animation: none; }
  .afb-bar-fill       { transition: none; }
  .afb-rec-btn        { transition: none; }
  .afb-rec-btn:hover  { transform: none; }
  .an-skeleton         { animation: none; }
  .an-insight-item     { animation: none; }
  .an-stage-bar-fill   { transition: none; }
  .an-topic-bar-fill   { transition: none; }
  .an-recommendation   { transition: none; }
  .an-recommendation:hover { transform: none; }
  .an-topic-chevron    { transition: none; }
  .rv-skeleton         { animation: none; }
  .rv-celebration      { animation: none; }
  .rv-completion       { animation: none; }
  .rv-queue-item       { animation: none; }
  .rv-sb-fill          { transition: none; }
  .rv-start-btn:hover  { transform: none; }
  .rv-comp-btn:hover   { transform: none; }
  .rv-ach-item:hover   { transform: none; }
  .rv-queue-bar-fill   { transition: none; }
  .nav-drawer          { transition: none; }
  .nav-item            { transition: none; }
  .nav-hamburger       { transition: none; }
  .nav-close-btn       { transition: none; }
  .pf-back-btn         { transition: none; }
  .st-back-btn         { transition: none; }
  .lp-bc-back          { transition: none; }
  .cs-back-btn         { transition: none; }
  .cs-continue-btn     { transition: none; }
  /* LX-1: Learning Moments */
  .lx-moment           { animation: none !important; }
  .lx-carry-row        { animation: none !important; }
  .lx-celebrate-emoji  { animation: none !important; }
  .lx-col-digit        { transition: none !important; }
  .lx-next-btn         { transition: none !important; }
  .lx-dot              { transition: none !important; }
}

/* ── Responsive ── */
@media (max-width: 560px) {
  .why-meta-row { gap: 6px; }
  .why-meta-chip { min-width: 60px; padding: 4px 8px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Phase 5.5B.2 — Adaptive Answer Experience
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Mastery Panel (Phase 1 & 2) ── */
.afb-mastery-panel {
  margin: 10px 0 8px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  animation: afb-rise 0.18s ease both;
}
.card.correct  .afb-mastery-panel { background: #f0fdf4; border-color: #bbf7d0; }
.card.incorrect .afb-mastery-panel { background: #fef2f2; border-color: #fecaca; }

.afb-mastery-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.afb-mastery-before,
.afb-mastery-after  { font-size: 1.35rem; font-weight: 900; line-height: 1; }
.afb-mastery-before { color: #64748b; }
.afb-mastery-after.up   { color: #16a34a; }
.afb-mastery-after.down { color: #dc2626; }
.afb-mastery-after.same { color: #64748b; }
.afb-mastery-arrow { font-size: 1.1rem; color: #94a3b8; }
.afb-mastery-delta {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
}
.afb-mastery-delta.up   { background: #dcfce7; color: #166534; }
.afb-mastery-delta.down { background: #fee2e2; color: #991b1b; }
.afb-mastery-delta.same { background: #f1f5f9; color: #475569; }

.afb-mastery-label {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 3px;
}

.afb-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.afb-chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 9px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
}
.afb-chip-label { font-size: 0.63rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; }
.afb-chip-value { font-size: 0.85rem; font-weight: 800; color: #1e293b; line-height: 1.2; }

/* Mastery bar (animated fill) */
.afb-bar-track {
  height: 5px;
  background: #e2e8f0;
  border-radius: 9px;
  overflow: hidden;
  margin: 8px 0 0;
}
.afb-bar-fill {
  height: 100%;
  border-radius: 9px;
  transition: width 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: linear-gradient(90deg, #22c55e, #16a34a);
}
.card.incorrect .afb-bar-fill { background: linear-gradient(90deg, #f87171, #dc2626); }

/* ── Action Row for incorrect (Phase 2) ── */
.afb-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 8px;
}
.afb-btn {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  background: #fff;
  color: #374151;
  min-height: 36px;
  transition: background 0.14s, border-color 0.14s;
}
.afb-btn:hover { background: #f8fafc; border-color: #94a3b8; }
.afb-btn:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }
.afb-btn-primary {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.afb-btn-primary:hover { background: #dbeafe; }

/* ── Impact Panel (Phase 3) ── */
.afb-impact-panel {
  margin: 6px 0;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 9px;
  border: 1px solid #e2e8f0;
  animation: afb-rise 0.20s ease 0.05s both;
}
.afb-impact-title {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 6px;
}
.afb-impact-item {
  font-size: 0.80rem;
  color: #1e293b;
  font-weight: 600;
  padding: 2px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.afb-impact-check { color: #16a34a; font-weight: 900; }

/* ── Streak Panel (Phase 5) ── */
.afb-streak-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
  border: 1px solid #fde68a;
  border-radius: 9px;
  margin: 6px 0;
  font-size: 0.87rem;
  font-weight: 800;
  color: #78350f;
  animation: afb-pop 0.24s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ── Adaptive Recommendation (Phase 4) ── */
.afb-recommendation {
  margin: 8px 0 4px;
}
.afb-rec-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.16s, transform 0.12s;
}
.afb-rec-btn:hover { background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%); transform: translateY(-1px); }
.afb-rec-btn:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 2px; }
.afb-rec-btn.green { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); }
.afb-rec-btn.green:hover { background: linear-gradient(135deg, #16a34a 0%, #15803d 100%); }
.afb-rec-sub { font-size: 0.72rem; font-weight: 600; opacity: 0.85; }

/* ── Animations ── */
@keyframes afb-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes afb-pop {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .afb-mastery-before,
  .afb-mastery-after { font-size: 1.15rem; }
  .afb-rec-btn { font-size: 0.85rem; padding: 10px 12px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Phase 5.5C — Mastery & Analytics
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Analytics button in header ── */
.btn-analytics {
  padding: 6px 12px;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 8px;
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.14s;
  white-space: nowrap;
  min-height: 32px;
}
.btn-analytics:hover { background: #dbeafe; }
.btn-analytics.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn-analytics:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }

/* ── Analytics wrapper ── */
#analytics-section {
  padding: 0 0 32px;
}

/* ── Back bar ── */
.an-back-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
}
.an-back-btn {
  background: none;
  border: none;
  color: #6366f1;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
  min-height: 32px;
}
.an-back-btn:hover { color: #4f46e5; }
.an-back-btn:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }
.an-report-title { font-size: 1.05rem; font-weight: 800; color: #1e293b; }
.an-report-meta  { font-size: 0.80rem; color: #64748b; margin-left: auto; }

/* ── Section heading ── */
.an-section-title {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
  margin: 20px 0 8px;
}

/* ── Summary grid (Section 1) ── */
.an-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}
.an-stat {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.an-stat-label { font-size: 0.63rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; }
.an-stat-value { font-size: 1.25rem; font-weight: 900; color: #1e293b; line-height: 1.2; }
.an-stat-sub   { font-size: 0.72rem; color: #64748b; }
.an-stat.accent { background: #eff6ff; border-color: #bfdbfe; }
.an-stat.accent .an-stat-value { color: #1d4ed8; }
.an-stat.green  { background: #f0fdf4; border-color: #bbf7d0; }
.an-stat.green  .an-stat-value { color: #15803d; }
.an-stat.amber  { background: #fffbeb; border-color: #fde68a; }
.an-stat.amber  .an-stat-value { color: #92400e; }

/* ── Activity row (7-day dots) ── */
.an-activity-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 8px 0 4px;
  flex-wrap: wrap;
}
.an-activity-label { font-size: 0.72rem; color: #64748b; margin-right: 6px; font-weight: 600; }
.an-day-dot {
  width: 14px; height: 14px;
  border-radius: 3px;
  background: #e2e8f0;
  flex-shrink: 0;
  position: relative;
}
.an-day-dot.active { background: #22c55e; }
.an-day-dot.today  { background: #6366f1; }
.an-day-dot[title]::after {
  content: attr(title);
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.6rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.an-day-dot:hover::after { opacity: 1; }

/* ── Stage progress (Section 2) ── */
.an-stages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.an-stage-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.an-stage-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  width: 100px;
  flex-shrink: 0;
}
.an-stage-name.current { color: #1e293b; }
.an-stage-bar-track {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 9px;
  overflow: hidden;
}
.an-stage-bar-fill {
  height: 100%;
  border-radius: 9px;
  background: linear-gradient(90deg, #6366f1, #4f46e5);
  transition: width 0.5s ease;
}
.an-stage-bar-fill.done { background: linear-gradient(90deg, #22c55e, #16a34a); }
.an-stage-bar-fill.locked { background: #cbd5e1; }
.an-stage-pct {
  font-size: 0.78rem;
  font-weight: 800;
  color: #475569;
  width: 38px;
  text-align: right;
  flex-shrink: 0;
}
.an-stage-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.an-stage-badge.current { background: #eff6ff; color: #1d4ed8; }
.an-stage-badge.done    { background: #dcfce7; color: #166534; }
.an-stage-badge.locked  { background: #f1f5f9; color: #94a3b8; }

/* ── Topic mastery (Section 3+4) ── */
.an-topic-list { display: flex; flex-direction: column; gap: 4px; }
.an-topic-row {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.14s;
}
.an-topic-row:focus-within { box-shadow: 0 0 0 2px #a5b4fc; }
.an-topic-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  min-height: 44px;
}
.an-topic-header:focus-visible { outline: 2px solid #6366f1; outline-offset: -2px; }
.an-topic-name { font-size: 0.87rem; font-weight: 700; color: #1e293b; flex: 1; }
.an-topic-bar-wrap {
  flex: 1;
  max-width: 110px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 9px;
  overflow: hidden;
}
.an-topic-bar-fill {
  height: 100%;
  border-radius: 9px;
  background: linear-gradient(90deg, #6366f1, #4f46e5);
  transition: width 0.45s ease;
}
.an-topic-bar-fill.good   { background: linear-gradient(90deg, #22c55e, #16a34a); }
.an-topic-bar-fill.warn   { background: linear-gradient(90deg, #f59e0b, #d97706); }
.an-topic-bar-fill.danger { background: linear-gradient(90deg, #f87171, #dc2626); }
.an-topic-pct { font-size: 0.80rem; font-weight: 800; color: #475569; width: 34px; text-align: right; flex-shrink: 0; }
.an-topic-meta { font-size: 0.68rem; color: #94a3b8; white-space: nowrap; flex-shrink: 0; }
.an-topic-chevron { font-size: 0.70rem; color: #94a3b8; flex-shrink: 0; transition: transform 0.2s; }
.an-topic-row.open .an-topic-chevron { transform: rotate(180deg); }

/* ── Concept list (inside topic) ── */
.an-concept-list {
  padding: 0 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid #f1f5f9;
  display: none;
}
.an-topic-row.open .an-concept-list { display: flex; }
.an-concept-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #f8fafc;
}
.an-concept-item:last-child { border-bottom: none; }
.an-concept-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.an-concept-dot.mastered { background: #22c55e; }
.an-concept-dot.partial  { background: #f59e0b; }
.an-concept-dot.weak     { background: #f87171; }
.an-concept-name { font-size: 0.82rem; color: #334155; flex: 1; }
.an-concept-pct  { font-size: 0.75rem; font-weight: 700; color: #64748b; flex-shrink: 0; }
.an-concept-badge {
  font-size: 0.63rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  flex-shrink: 0;
}
.an-concept-badge.review { background: #fef3c7; color: #92400e; }
.an-concept-badge.done   { background: #dcfce7; color: #166534; }
.an-concept-practice-btn {
  font-size: 0.70rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  min-height: 26px;
  flex-shrink: 0;
}
.an-concept-practice-btn:hover { background: #dbeafe; }
.an-concept-practice-btn:focus-visible { outline: 2px solid #6366f1; outline-offset: 1px; }

/* ── Insights (Section 5) ── */
.an-insights { display: flex; flex-direction: column; gap: 8px; }
.an-insight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  font-size: 0.84rem;
  color: #334155;
  font-weight: 500;
  animation: an-fade 0.2s ease both;
}
.an-insight-item.positive { background: #f0fdf4; border-color: #bbf7d0; }
.an-insight-item.warning  { background: #fffbeb; border-color: #fde68a; }
.an-insight-item.info     { background: #eff6ff; border-color: #bfdbfe; }
.an-insight-icon { font-size: 1rem; flex-shrink: 0; }

/* ── Strengths & Weaknesses (Section 7) ── */
.an-sw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.an-sw-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
}
.an-sw-card.strengths { background: #f0fdf4; border-color: #bbf7d0; }
.an-sw-card.weaknesses { background: #fef2f2; border-color: #fecaca; }
.an-sw-title { font-size: 0.70rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; margin-bottom: 8px; }
.an-sw-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  gap: 8px;
}
.an-sw-item:last-child { border-bottom: none; }
.an-sw-name { font-size: 0.80rem; color: #334155; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-sw-pct  { font-size: 0.78rem; font-weight: 800; flex-shrink: 0; }
.an-sw-pct.strong { color: #16a34a; }
.an-sw-pct.weak   { color: #dc2626; }
.an-sw-practice {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid #bfdbfe;
  background: #fff;
  color: #1d4ed8;
  cursor: pointer;
  min-height: 22px;
  flex-shrink: 0;
}

/* ── Milestones (Section 9) ── */
.an-milestones {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.an-milestones::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: #e2e8f0;
}
.an-milestone-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  position: relative;
}
.an-milestone-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  z-index: 1;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
}
.an-milestone-dot.earned { background: #fef3c7; border-color: #fde68a; }
.an-milestone-dot.next   { background: #eff6ff; border-color: #bfdbfe; border-style: dashed; }
.an-milestone-text { font-size: 0.84rem; color: #334155; font-weight: 600; }
.an-milestone-sub  { font-size: 0.72rem; color: #94a3b8; }

/* ── Recommendation (Section 8) ── */
.an-recommendation {
  margin-top: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  min-height: 56px;
  border: none;
  width: 100%;
  transition: background 0.15s, transform 0.12s;
  color: #fff;
}
.an-recommendation:hover { background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%); transform: translateY(-1px); }
.an-recommendation:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 3px; }
.an-rec-main { font-size: 0.95rem; font-weight: 800; }
.an-rec-sub  { font-size: 0.75rem; font-weight: 600; opacity: 0.82; }
.an-rec-arrow { font-size: 1.3rem; flex-shrink: 0; }

/* ── Empty state ── */
.an-empty {
  text-align: center;
  padding: 28px 16px;
  color: #94a3b8;
  font-size: 0.88rem;
  font-weight: 500;
}

/* ── Loading skeleton ── */
.an-skeleton {
  background: #e2e8f0;
  border-radius: 6px;
  height: 14px;
  margin: 6px 0;
  animation: an-shimmer 1.5s infinite;
}
@keyframes an-shimmer {
  0%   { opacity: 1; }
  50%  { opacity: 0.5; }
  100% { opacity: 1; }
}

/* ── Animation ── */
@keyframes an-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Mobile ── */
@media (max-width: 540px) {
  .an-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .an-sw-grid      { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Phase 5.5D — Review Experience & Achievements
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Header button ── */
.btn-review-hub {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid #3b82f6;
  background: transparent;
  color: #3b82f6;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
}
.btn-review-hub:hover { background: #3b82f6; color: #fff; }
.btn-review-hub.active { background: #3b82f6; color: #fff; }
.btn-review-hub:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }

/* ── Review Hub page ── */
.rv-back-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.rv-back-btn {
  background: none;
  border: none;
  color: #3b82f6;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.15s;
  min-height: 44px;
}
.rv-back-btn:hover { background: rgba(59,130,246,0.08); }
.rv-back-btn:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }
.rv-page-title { font-size: 1.15rem; font-weight: 700; color: #1e293b; }

/* ── Section title ── */
.rv-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin: 20px 0 10px;
}

/* ── Today's Review summary card ── */
.rv-hub-card {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  padding: 20px;
  margin-bottom: 14px;
}
.rv-hub-card.all-caught-up {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac;
  text-align: center;
  padding: 28px 20px;
}
.rv-caught-up-emoji { font-size: 2rem; margin-bottom: 8px; }
.rv-caught-up-title { font-size: 1.05rem; font-weight: 700; color: #15803d; margin-bottom: 4px; }
.rv-caught-up-sub   { font-size: 0.85rem; color: #4ade80; }

.rv-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.rv-stat {
  text-align: center;
  padding: 10px 6px;
  background: #f8fafc;
  border-radius: 10px;
}
.rv-stat-val  { font-size: 1.4rem; font-weight: 800; color: #1e293b; line-height: 1; }
.rv-stat-val.amber { color: #d97706; }
.rv-stat-val.green { color: #059669; }
.rv-stat-lbl  { font-size: 0.72rem; color: #64748b; margin-top: 2px; }
.rv-start-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  min-height: 44px;
}
.rv-start-btn:hover { background: #2563eb; transform: translateY(-1px); }
.rv-start-btn:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.rv-start-btn:disabled { background: #94a3b8; cursor: not-allowed; transform: none; }

/* ── Daily Goal ── */
.rv-goal-card {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1.5px solid #fbbf24;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.rv-goal-icon { font-size: 1.5rem; flex-shrink: 0; }
.rv-goal-label { font-size: 0.72rem; font-weight: 700; color: #92400e; text-transform: uppercase; letter-spacing: 0.05em; }
.rv-goal-text  { font-size: 0.92rem; font-weight: 600; color: #1e293b; }

/* ── Review Queue list ── */
.rv-queue-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.rv-queue-item {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  animation: rv-fadein 0.2s ease both;
}
.rv-queue-item.tier-1 { border-left: 3px solid #ef4444; }
.rv-queue-item.tier-2 { border-left: 3px solid #f59e0b; }
.rv-queue-item.tier-3 { border-left: 3px solid #6366f1; }
.rv-queue-item.tier-4 { border-left: 3px solid #94a3b8; }
.rv-queue-concept { font-weight: 600; font-size: 0.88rem; color: #1e293b; }
.rv-queue-sub     { font-size: 0.75rem; color: #64748b; margin-top: 2px; }
.rv-queue-reason  {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.rv-queue-reason.urgent   { background: #fee2e2; color: #dc2626; }
.rv-queue-reason.warn     { background: #fef3c7; color: #d97706; }
.rv-queue-reason.maintain { background: #ede9fe; color: #7c3aed; }
.rv-queue-reason.steady   { background: #f1f5f9; color: #64748b; }
.rv-queue-bar-wrap { margin-top: 6px; }
.rv-queue-bar-track { height: 4px; background: #e2e8f0; border-radius: 2px; }
.rv-queue-bar-fill  { height: 4px; border-radius: 2px; background: #3b82f6; transition: width 0.4s ease; }

/* ── Achievement grid ── */
.rv-ach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.rv-ach-item {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  transition: transform 0.15s;
}
.rv-ach-item.earned {
  border-color: #fbbf24;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}
.rv-ach-item:hover.earned { transform: translateY(-2px); }
.rv-ach-emoji { font-size: 1.5rem; margin-bottom: 4px; }
.rv-ach-name  { font-size: 0.72rem; font-weight: 700; color: #1e293b; }
.rv-ach-desc  { font-size: 0.65rem; color: #64748b; margin-top: 2px; }
.rv-ach-item.locked .rv-ach-emoji { filter: grayscale(1) opacity(0.4); }
.rv-ach-item.locked .rv-ach-name  { color: #94a3b8; }

/* ── Session History ── */
.rv-history-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.rv-history-item {
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.rv-history-dot  { width: 8px; height: 8px; border-radius: 50%; background: #3b82f6; flex-shrink: 0; }
.rv-history-text { font-size: 0.83rem; color: #475569; flex: 1; }
.rv-history-acc  { font-size: 0.78rem; font-weight: 600; color: #059669; }

/* ── Session progress bar (shown during active review in practice area) ── */
.rv-session-bar {
  background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.rv-sb-label  { color: #93c5fd; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; flex-shrink: 0; }
.rv-sb-prog   { color: #fff; font-size: 0.88rem; font-weight: 700; flex-shrink: 0; }
.rv-sb-bar    { flex: 1; min-width: 60px; height: 6px; background: rgba(255,255,255,0.2); border-radius: 3px; }
.rv-sb-fill   { height: 6px; border-radius: 3px; background: #60a5fa; transition: width 0.4s ease; }
.rv-sb-acc    { color: #a5f3fc; font-size: 0.78rem; font-weight: 600; flex-shrink: 0; }
.rv-sb-motive { color: #bfdbfe; font-size: 0.75rem; font-style: italic; width: 100%; margin-top: 2px; }

/* ── Review Completion screen ── */
.rv-completion {
  background: #fff;
  border-radius: 16px;
  border: 1.5px solid #e2e8f0;
  padding: 28px 24px;
  margin-bottom: 14px;
  text-align: center;
  animation: rv-fadein 0.3s ease;
}
.rv-completion-emoji { font-size: 2.8rem; margin-bottom: 8px; }
.rv-completion-title { font-size: 1.3rem; font-weight: 800; color: #1e293b; margin-bottom: 6px; }
.rv-completion-sub   { font-size: 0.88rem; color: #64748b; margin-bottom: 20px; }
.rv-completion-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.rv-cs-item  { background: #f8fafc; border-radius: 10px; padding: 12px 8px; }
.rv-cs-val   { font-size: 1.3rem; font-weight: 800; color: #1e293b; }
.rv-cs-val.green { color: #059669; }
.rv-cs-val.amber { color: #d97706; }
.rv-cs-lbl   { font-size: 0.72rem; color: #64748b; margin-top: 2px; }
.rv-completion-motivation {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: #15803d;
  font-weight: 500;
  margin-bottom: 16px;
}
.rv-completion-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.rv-comp-btn {
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  min-height: 44px;
}
.rv-comp-btn.primary { background: #3b82f6; color: #fff; }
.rv-comp-btn.primary:hover { background: #2563eb; transform: translateY(-1px); }
.rv-comp-btn.secondary { background: #f1f5f9; color: #475569; }
.rv-comp-btn.secondary:hover { background: #e2e8f0; }
.rv-comp-btn:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }

/* ── Celebration toast ── */
.rv-celebration {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1.5px solid #334155;
  border-radius: 16px;
  padding: 16px 20px;
  max-width: 320px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  animation: rv-slide-up 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.rv-cel-icon  { font-size: 1.5rem; flex-shrink: 0; }
.rv-cel-title { font-size: 0.88rem; font-weight: 700; color: #f8fafc; }
.rv-cel-sub   { font-size: 0.78rem; color: #94a3b8; margin-top: 2px; }
.rv-cel-close {
  background: none; border: none; color: #64748b;
  font-size: 1rem; cursor: pointer; padding: 0; margin-left: auto; flex-shrink: 0;
  min-height: 32px; min-width: 24px;
}
.rv-cel-close:hover { color: #94a3b8; }

/* ── Empty state ── */
.rv-empty {
  text-align: center;
  padding: 24px 16px;
  color: #94a3b8;
  font-size: 0.88rem;
}

/* ── Skeleton ── */
.rv-skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  border-radius: 8px;
  animation: rv-shimmer 1.4s infinite;
}

/* ── Animations ── */
@keyframes rv-fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes rv-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes rv-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes rv-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ── Mobile ── */
@media (max-width: 540px) {
  .rv-stats-row         { grid-template-columns: repeat(3, 1fr); }
  .rv-ach-grid          { grid-template-columns: repeat(2, 1fr); }
  .rv-completion-stats  { grid-template-columns: repeat(3, 1fr); }
  .rv-celebration       { bottom: 12px; right: 12px; left: 12px; max-width: none; }
}

.eq-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 16px;
}

.eq-content {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    color: #1e293b;
    line-height: 1.6;
}

.teaching-controls {
    padding: 24px 30px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.narration-text {
    font-size: 1.05rem;
    color: #334155;
    line-height: 1.5;
    min-height: 3rem;
    transition: opacity 0.3s;
}

.step-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.step-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
}

.step-btn.next-primary {
    background: #4f46e5;
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}

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

.step-dots {
    display: flex; gap: 8px; justify-content: center;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: background 0.3s;
}

.step-dot.active {
    background: #4f46e5;
    transform: scale(1.2);
}

/* Animations */
@keyframes emerge {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.emerging {
    animation: emerge 0.4s forwards;
    display: inline-block;
}

.teaching-highlight {
    filter: drop-shadow(0 0 8px rgba(79,70,229,0.6));
    stroke: #4f46e5 !important;
    stroke-width: 3px !important;
    transition: all 0.5s ease;
}

.active-traversal {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw_thinking 1.5s linear forwards;
    stroke: #f59e0b !important;
    stroke-width: 4px !important;
}

@keyframes draw_thinking {
    to { stroke-dashoffset: 0; }
}

.fade-out { opacity: 0; }
.fade-in { opacity: 1; }

.morphing-out {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s;
}

.morphing-in {
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s;
}

/* ── Interactive Teaching Layout (CIT) ────────────────────────────────────── */
.cit-wrap {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.cit-left {
  flex: 0 0 280px;
  background: #f5f4ef;
  border-radius: 14px;
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}
.cit-diagram { width: 100%; }
.cit-diagram svg {
  width: 100% !important;
  height: auto !important;
  max-height: 250px;
  display: block;
}
.cit-caption {
  font-size: 0.84rem;
  color: #4b5563;
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}
.cit-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cit-step {
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.cit-step.active {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.12);
}
.cit-step-hd {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
}
.cit-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.cit-step.active .cit-step-num {
  background: #4f46e5;
  color: #fff;
}
.cit-step-title {
  font-weight: 700;
  font-size: 0.93rem;
  color: #111827;
  line-height: 1.3;
}
.cit-step-sub {
  font-size: 0.81rem;
  color: #6b7280;
  margin-top: 2px;
}
.cit-step-bd {
  display: none;
  padding: 0 14px 14px 54px;
  font-size: 0.88rem;
  color: #374151;
  line-height: 1.65;
}
.cit-step.active .cit-step-bd { display: block; }
.cit-pill {
  display: inline-block;
  margin-top: 9px;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 13px;
  border-radius: 100px;
}
.cit-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
}
.cit-dots { display: flex; gap: 7px; align-items: center; }
.cit-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  transition: background 0.2s;
}
.cit-dot.active { background: #6366f1; }
.cit-nav-btns { display: flex; gap: 10px; }
.cit-btn {
  padding: 9px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid #d1d5db;
  background: #fff;
  color: #374151;
  transition: all 0.18s;
}
.cit-btn:hover { background: #f9fafb; border-color: #9ca3af; }
.cit-btn.cit-primary {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}
.cit-btn.cit-primary:hover { background: #4338ca; border-color: #4338ca; }
@media (max-width: 680px) {
  .cit-wrap { flex-direction: column; }
  .cit-left { flex: none; width: 100%; min-height: 220px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LX-1 — Presentation Layer 2.0: Learning Moments
   Design principle: the student experiences moments, not sections.
   The hero visual IS the teacher. One idea per moment. Never two.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Stage container ───────────────────────────────────────────────────────── */
.lx-stage {
  background: #0f172a;
  border-radius: 16px;
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid rgba(255,255,255,0.07);
}

/* ── Progress dots ─────────────────────────────────────────────────────────── */
.lx-progress-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 14px 20px 0;
}
.lx-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  transition: background 0.3s, transform 0.3s;
  flex-shrink: 0;
}
.lx-dot--active {
  background: #6366f1;
  transform: scale(1.5);
}
.lx-dot--done {
  background: rgba(99,102,241,0.45);
}

/* ── Viewport (moment stage) ───────────────────────────────────────────────── */
.lx-scene-viewport {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 24px;
}

/* ── Individual moment ─────────────────────────────────────────────────────── */
.lx-moment {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: lx-rise 0.38s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes lx-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Tiny label above hero — gives cognitive context without competing */
.lx-moment-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 18px;
  text-align: center;
}

/* ── Hero area — the teacher ───────────────────────────────────────────────── */
.lx-hero {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 160px;
}

/* ── Caption — brief text anchor below hero ────────────────────────────────── */
.lx-caption {
  margin-top: 18px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.6);
  text-align: center;
  max-width: 420px;
  line-height: 1.6;
}

/* ── Controls ──────────────────────────────────────────────────────────────── */
.lx-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.lx-back-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.45);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.lx-back-btn:hover:not(:disabled) {
  border-color: rgba(255,255,255,0.35);
  color: rgba(255,255,255,0.75);
}
.lx-back-btn:disabled {
  opacity: 0.22;
  cursor: not-allowed;
}
.lx-next-btn {
  background: #6366f1;
  border: none;
  color: #fff;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.lx-next-btn:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}
.lx-next-btn--finish {
  background: #10b981;
}
.lx-next-btn--finish:hover {
  background: #059669;
}

/* ═══ Moment type variants ═══════════════════════════════════════════════════ */

/* FOCUS — problem appears, all attention here */
.lx-moment--focus .lx-hero {
  min-height: 200px;
}
.lx-focus-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #f1f5f9;
  text-align: center;
  line-height: 1.35;
  max-width: 480px;
}

/* OBSERVE — visual dominates, minimal text */
.lx-moment--observe .lx-hero {
  min-height: 200px;
}
.lx-visual-pre {
  font-family: 'Courier New', monospace;
  font-size: 0.88rem;
  color: #e2e8f0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px;
  padding: 18px 20px;
  overflow-x: auto;
  white-space: pre;
  max-width: 100%;
  line-height: 1.6;
}

/* UNDERSTAND — insight with indigo accent */
.lx-moment--understand .lx-hero {
  background: rgba(99,102,241,0.07);
  border: 1px solid rgba(99,102,241,0.22);
  border-radius: 14px;
  padding: 24px 28px;
  min-height: 120px;
}
.lx-key-icon {
  font-size: 1.7rem;
  margin-bottom: 10px;
  display: block;
}
.lx-key-text {
  font-size: 1rem;
  font-weight: 600;
  color: #c7d2fe;
  line-height: 1.6;
  text-align: center;
  margin: 0;
}

/* DISCOVER — pattern with amber accent */
.lx-moment--discover .lx-hero {
  background: rgba(245,158,11,0.07);
  border: 1px solid rgba(245,158,11,0.22);
  border-radius: 14px;
  padding: 24px 28px;
  min-height: 120px;
}
.lx-pattern-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f59e0b;
  margin-bottom: 12px;
  display: block;
}
.lx-pattern-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fde68a;
  text-align: center;
  line-height: 1.55;
  margin: 0;
}

/* PRACTICE — worked example */
.lx-moment--practice .lx-hero {
  align-items: flex-start;
  padding: 0;
}
.lx-example-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 10px;
  display: block;
}
.lx-example-content {
  font-size: 0.9rem;
  color: #e2e8f0;
  line-height: 1.75;
}

/* REMEMBER — green accent */
.lx-moment--remember .lx-hero {
  background: rgba(16,185,129,0.07);
  border: 1px solid rgba(16,185,129,0.22);
  border-radius: 14px;
  padding: 24px 28px;
  min-height: 120px;
}
.lx-remember-icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
  display: block;
}
.lx-remember-text {
  font-size: 0.95rem;
  color: #a7f3d0;
  line-height: 1.6;
  text-align: center;
  margin: 0;
}

/* CELEBRATE — positive, bright */
.lx-moment--celebrate .lx-hero {
  min-height: 180px;
}
.lx-celebrate-emoji {
  font-size: 3.2rem;
  display: block;
  margin-bottom: 14px;
  animation: lx-pop 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes lx-pop {
  from { transform: scale(0.3); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.lx-celebrate-msg {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f5f9;
  text-align: center;
  margin-bottom: 6px;
}
.lx-celebrate-answer {
  font-family: 'Courier New', monospace;
  font-size: 2rem;
  letter-spacing: 0.04em;
}
.lx-celebrate-sub {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.5);
  text-align: center;
}

/* ═══ Column Addition Hero ═══════════════════════════════════════════════════
   The flagship teaching moment: column addition with spotlighting.
   Each column glows in turn. Carry rises. No text explains — the motion does.
   ═══════════════════════════════════════════════════════════════════════════ */
.lx-col-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-family: 'Courier New', monospace;
}
.lx-carry-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  animation: lx-carry-rise 0.45s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes lx-carry-rise {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.lx-carry-label {
  font-size: 0.72rem;
  color: rgba(245,158,11,0.6);
  letter-spacing: 0.06em;
}
.lx-carry-digits {
  font-size: 1.3rem;
  color: #f59e0b;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.lx-col-row {
  font-size: 3rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.12em;
  line-height: 1.15;
  display: flex;
  align-items: baseline;
}
.lx-col-row--b { position: relative; }
.lx-col-op {
  margin-right: 8px;
  color: rgba(255,255,255,0.35);
}
.lx-col-row--ans {
  color: #6366f1;
  letter-spacing: 0.12em;
  margin-top: 4px;
}
.lx-col-line {
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.25);
  margin: 6px 0;
  border-radius: 1px;
}
.lx-col-digit {
  display: inline-block;
  transition: color 0.35s, opacity 0.35s, text-shadow 0.35s, transform 0.35s;
}
.lx-col-digit--focus {
  color: #818cf8;
  text-shadow: 0 0 22px rgba(99,102,241,0.75);
  transform: scale(1.15);
}
.lx-col-digit--dim {
  opacity: 0.18;
}
.lx-ones-sum {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: 'Courier New', monospace;
  font-size: 3rem;
  font-weight: 700;
}
.lx-ones-a, .lx-ones-b { color: #f1f5f9; }
.lx-ones-op, .lx-ones-eq { color: rgba(255,255,255,0.35); }
.lx-ones-result {
  color: #6366f1;
  text-shadow: 0 0 20px rgba(99,102,241,0.5);
}
.lx-carry-note {
  margin-top: 16px;
  font-size: 1rem;
  color: rgba(255,255,255,0.65);
  text-align: center;
}
.lx-carry-highlight {
  color: #f59e0b;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .lx-col-row  { font-size: 2.2rem; }
  .lx-ones-sum { font-size: 2.2rem; }
  .lx-scene-viewport { padding: 16px; min-height: 220px; }
  .lx-focus-title { font-size: 1.3rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Question-time mathematical figures (Pass 18A)
   ───────────────────────────────────────────────────────────────────────────
   The figure sits inside #question-card, between the question text and the
   meta tags, so it is on screen while the student answers. It is populated
   only from a verified specification (question_visual_registry.js) and stays
   display:none whenever no verified visual exists.

   Colours are exposed as custom properties because the SVG builders reference
   var(--qv-ink) / var(--qv-accent); that keeps theme handling in CSS rather
   than duplicated across every renderer.
   ═══════════════════════════════════════════════════════════════════════════ */

#question-visual {
  --qv-ink: #1f2937;
  --qv-muted: #6b7280;
  --qv-accent: #4f46e5;
  --qv-surface: #ffffff;
  margin: 14px 0 4px;
  padding: 10px 8px 6px;
  background: var(--qv-surface);
  border: 1px solid rgba(100, 116, 139, 0.22);
  border-radius: 10px;
  /* A figure must never dominate the viewport or push the answer input off
     screen — capped rather than left to grow with the SVG's aspect ratio. */
  max-width: 460px;
  margin-inline: auto;
}

#question-visual .qv-svg {
  display: block;
  width: 100%;
  /* Stable viewBox + width-driven height: the figure scales as a whole instead
     of clipping, so 375px needs no separate layout.

     `height: auto` alone, WITHOUT a max-height clamp. An earlier max-height of
     260px combined with `overflow: visible` let a tall figure paint outside the
     question card entirely — the height box was clamped while the content kept
     its intrinsic aspect ratio and simply spilled. It only showed once Areas
     Related to Circles introduced figures with large filled regions; the
     sparse, wide height-and-distance diagrams hid it. Aspect ratio is capped by
     the shared 340x210 viewBox, so height cannot run away. */
  height: auto;
  /* Everything is authored inside the viewBox (asserted by test), so clipping
     at the boundary is a safety net, never something a correct figure hits. */
  overflow: hidden;
}

/* Labels must stay legible when the SVG scales down on a narrow screen. */
#question-visual .qv-svg text {
  font-family: inherit;
  paint-order: stroke;
  stroke: var(--qv-surface);
  stroke-width: 2.5px;
  stroke-linejoin: round;
}

@media (max-width: 420px) {
  #question-visual {
    margin-left: -4px;
    margin-right: -4px;
    padding: 8px 4px 4px;
  }
  /* No max-height here either — see the note on .qv-svg above. */
}

@media (prefers-color-scheme: dark) {
  #question-visual {
    --qv-ink: #e5e7eb;
    --qv-muted: #9ca3af;
    --qv-accent: #a5b4fc;
    --qv-surface: #111827;
    border-color: rgba(148, 163, 184, 0.3);
  }
}

:root[data-theme="dark"] #question-visual {
  --qv-ink: #e5e7eb;
  --qv-muted: #9ca3af;
  --qv-accent: #a5b4fc;
  --qv-surface: #111827;
  border-color: rgba(148, 163, 184, 0.3);
}

:root[data-theme="light"] #question-visual {
  --qv-ink: #1f2937;
  --qv-muted: #6b7280;
  --qv-accent: #4f46e5;
  --qv-surface: #ffffff;
  border-color: rgba(100, 116, 139, 0.22);
}

@media print {
  #question-visual {
    --qv-ink: #000000;
    --qv-muted: #444444;
    --qv-accent: #000000;
    --qv-surface: #ffffff;
    break-inside: avoid;
    border-color: #999999;
  }
}


/* ── Structured-proof widget (Pass 19C) ─────────────────────────────────── */
.sp-page { max-width: 760px; margin: 0 auto; padding: 16px; }
.sp-badge { font-size: 0.7em; background:#fee2e2; color:#b91c1c; padding:2px 8px;
  border-radius: 999px; vertical-align: middle; }
.sp-auth-msg { color:#b91c1c; }
.sp-question { background:#f8fafc; border:1px solid #e2e8f0; border-radius:8px;
  padding:10px 12px; margin:10px 0; }
.sp-widget { display:flex; flex-direction:column; gap:12px; }
.sp-head .sp-target { font-weight:700; }
.sp-head .sp-given { color:#475569; }
.sp-pool-cards { display:flex; flex-wrap:wrap; gap:8px; }
.sp-card { min-height:44px; padding:8px 12px; border:1px solid #cbd5e1;
  border-radius:8px; background:#fff; cursor:pointer; text-align:left; font:inherit; }
.sp-card:focus-visible, .sp-btn:focus-visible, .sp-mini:focus-visible,
.sp-reason:focus-visible { outline:3px solid #6366f1; outline-offset:2px; }
.sp-steps { list-style:decimal; padding-left:22px; display:flex; flex-direction:column; gap:8px; }
.sp-step { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.sp-step-text { flex:1 1 200px; }
.sp-reason { min-height:44px; font:inherit; max-width:100%; }
.sp-step-ctl { display:flex; gap:4px; }
.sp-mini { min-width:44px; min-height:44px; border:1px solid #cbd5e1; border-radius:8px;
  background:#fff; cursor:pointer; font:inherit; }
.sp-note { flex-basis:100%; font-size:0.9em; }
.sp-cat-valid { color:#059669; } .sp-cat-wrong_reason { color:#b45309; }
.sp-cat-needs_earlier_step { color:#b45309; } .sp-cat-distractor { color:#b91c1c; }
.sp-cat-redundant { color:#64748b; } .sp-cat-unknown { color:#b91c1c; }
.sp-actions { display:flex; flex-wrap:wrap; gap:8px; }
.sp-btn { min-height:44px; padding:8px 14px; border:1px solid #6366f1; border-radius:8px;
  background:#6366f1; color:#fff; cursor:pointer; font:inherit; }
.sp-btn.sp-reset, .sp-btn.sp-surrender { background:#fff; color:#334155; border-color:#cbd5e1; }
.sp-feedback.sp-ok { color:#059669; font-weight:600; }
.sp-feedback.sp-warn { color:#b45309; }
.sp-hints .sp-hint-line { background:#eef2ff; border-radius:6px; padding:6px 10px; margin:4px 0; }
.sp-solution { border-top:1px dashed #cbd5e1; padding-top:8px; }
@media (max-width: 480px) {
  .sp-step { flex-direction:column; align-items:stretch; }
  .sp-reason { width:100%; }
  .sp-actions .sp-btn { flex:1 1 45%; }
}
