/* ============================================
   ADAPTIVE — Design System
   ============================================ */

:root {
  /* Neutrals — warm-cool white */
  --bg: oklch(0.995 0.003 250);
  --bg-soft: oklch(0.98 0.005 250);
  --bg-muted: oklch(0.965 0.006 250);
  --surface: #ffffff;
  --line: oklch(0.92 0.006 250);
  --line-soft: oklch(0.95 0.005 250);

  /* Ink */
  --ink: oklch(0.18 0.02 265);
  --ink-2: oklch(0.32 0.02 265);
  --ink-3: oklch(0.5 0.015 265);
  --ink-4: oklch(0.65 0.012 265);

  /* Accents */
  /*--indigo: oklch(0.55 0.18 270);
  --indigo-soft: oklch(0.95 0.04 270);
  --indigo-deep: oklch(0.42 0.19 270);*/

  --indigo: oklch(0.55 0.2 310);
  --indigo-soft: oklch(0.96 0.04 310);
  --indigo-deep: oklch(0.42 0.2 310);


  --mint: oklch(0.78 0.12 165);
  --mint-soft: oklch(0.96 0.04 165);
  --amber: oklch(0.82 0.13 80);
  --amber-soft: oklch(0.97 0.04 80);
  --rose: oklch(0.7 0.16 20);
  --rose-soft: oklch(0.96 0.03 20);

  /* Aliases for learn-page CSS */
  --border:    oklch(0.93 0.005 250);
  --surface-1: #ffffff;
  --surface-2: oklch(0.98 0.005 250);
  --ink-1:     oklch(0.18 0.02 265);

  /* Type */
  --font-sans: 'Inter', -apple-system, system-ui, sans-serif;
  --font-serif: 'Inter', -apple-system, sans-serif; /*'Instrument Serif', Georgia, serif;*/
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Radius & shadow */
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow-xs: 0 1px 2px rgba(20, 24, 50, 0.04);
  --shadow-sm: 0 2px 8px rgba(20, 24, 50, 0.04), 0 1px 2px rgba(20, 24, 50, 0.03);
  --shadow: 0 8px 28px -12px rgba(20, 24, 50, 0.10), 0 2px 6px rgba(20, 24, 50, 0.04);
  --shadow-lg: 0 24px 48px -16px rgba(20, 24, 50, 0.14), 0 4px 12px rgba(20, 24, 50, 0.06);
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  /*-webkit-font-smoothing: antialiased;*/
  letter-spacing: -0.005em;
}

body {
  background:
    radial-gradient(ellipse 1200px 600px at 80% -10%, oklch(0.95 0.04 270 / 0.5), transparent 60%),
    radial-gradient(ellipse 800px 500px at 0% 100%, oklch(0.96 0.04 165 / 0.4), transparent 60%),
    var(--bg);
  min-height: 100vh;
}

.serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.02em; }
.mono { font-family: var(--font-mono); font-feature-settings: 'ss01'; }

h1, h2, h3, h4 { letter-spacing: -0.025em; font-weight: 600; }

.text-ink { color: var(--ink) !important; }
.text-ink-2 { color: var(--ink-2) !important; }
.text-ink-3 { color: var(--ink-3) !important; }
.text-ink-4 { color: var(--ink-4) !important; }

/* ===== Layout ===== */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

@media (max-width: 991px) {
  .app-shell { grid-template-columns: 1fr; }
}

/* ===== Sidebar ===== */
.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.brand-logo { width: 50px; height: 50px; }

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-reg { font-size: 11.5px; color: var(--ink-4); }

.logout-form { margin: 0; }
.logout-btn { padding: 4px; }
.logout-icon { width: 14px; height: 14px; color: var(--ink-4); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 24px;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--ink) 0%, var(--indigo) 100%);
  display: grid; place-items: center;
  color: white;
  position: relative;
  overflow: hidden;
}
.brand-mark::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.4), transparent 50%);
}
.brand-name {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: -0.02em;
}
.brand-name em { font-style: italic; color: var(--indigo); }

.nav-section-label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 16px 12px 8px;
  font-weight: 500;
}

.nav-link-custom {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  position: relative;
}
.nav-link-custom:hover {
  background: var(--bg-muted);
  color: var(--ink);
}
.nav-link-custom.active {
  background: var(--ink);
  color: white;
}
.nav-link-custom.active .nav-icon { color: white; }
.nav-link-custom .nav-icon {
  width: 18px; height: 18px;
  color: var(--ink-3);
  flex-shrink: 0;
}
.nav-link-custom .badge-pill {
  margin-left: auto;
  font-size: 10.5px;
  padding: 2px 7px;
  background: var(--indigo-soft);
  color: var(--indigo-deep);
  border-radius: 999px;
  font-weight: 600;
}
.nav-link-custom.active .badge-pill {
  background: rgba(255,255,255,0.15);
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px;
  border-radius: 12px;
  cursor: pointer;
}
.user-card:hover { background: var(--bg-muted); }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--mint));
  display: grid; place-items: center;
  color: white; font-weight: 600; font-size: 13px;
  flex-shrink: 0;
}

/* ===== Main ===== */
.main {
  padding: 0;
  overflow-x: hidden;
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.search {
  flex: 1; max-width: 480px;
  position: relative;
}
.search input {
  width: 100%;
  background: var(--bg-muted);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 14px 9px 38px;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  transition: all 0.2s;
}
.search input:focus {
  background: white;
  border-color: var(--line);
  box-shadow: var(--shadow-xs);
}
.search input::placeholder { color: var(--ink-4); }
.search-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--ink-4);
}

.topbar-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  display: grid; place-items: center;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.icon-btn:hover { background: var(--bg-muted); }
.icon-btn .dot-notif {
  position: absolute; top: 8px; right: 8px;
  width: 7px; height: 7px;
  background: var(--indigo);
  border-radius: 50%;
  border: 2px solid white;
}

/* ===== Mobile header & responsive nav ===== */
.mobile-topbar {
  display: none;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 35;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

@media (max-width: 991px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    max-width: calc(100vw - 48px);
    z-index: 45;
    transform: translateX(-110%);
    transition: transform 0.22s ease;
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-topbar {
    display: flex;
  }

  .topbar {
    display: none;
  }

  .main {
    min-width: 0;
  }

  .page {
    padding: 20px 16px;
  }
}

.page {
  padding: 32px;
  display: none;
  animation: fadeUp 0.45s cubic-bezier(.2,.8,.2,1);
}
.page.active { display: block; }

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

/* ===== Page header ===== */
.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--indigo-deep);
  font-weight: 600;
  background: var(--indigo-soft);
  padding: 5px 11px;
  border-radius: 999px;
}
.page-eyebrow .pulse-dot {
  width: 6px; height: 6px;
  background: var(--indigo);
  border-radius: 50%;
  position: relative;
}
.page-eyebrow .pulse-dot::after {
  content: '';
  position: absolute; inset: -3px;
  background: var(--indigo);
  border-radius: 50%;
  opacity: 0.3;
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(0.7); opacity: 0.5; }
  100% { transform: scale(2.4); opacity: 0; }
}

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.05;
  margin: 12px 0 6px;
  letter-spacing: -0.025em;
  font-weight: 400;
}
.page-title em { font-style: /*italic*/ normal; color: var(--indigo); }
.page-sub {
  color: var(--ink-3);
  font-size: 15px;
  max-width: 600px;
}

/* ===== Cards ===== */
.card-x {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-xs);
  transition: all 0.25s ease;
}
.card-x:hover { box-shadow: var(--shadow-sm); border-color: oklch(0.88 0.008 250); }
.card-x.flush { padding: 0; overflow: hidden; }
.card-x.dark {
  background: var(--ink);
  color: white;
  border-color: transparent;
}
.card-x.dark .text-ink-3 { color: oklch(0.7 0.02 265) !important; }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.card-title {
  font-size: 13px; font-weight: 600;
  color: var(--ink-2);
  letter-spacing: -0.005em;
  display: flex; align-items: center; gap: 8px;
}
.card-title .icon { width: 15px; height: 15px; color: var(--ink-4); }

/* ===== Buttons ===== */
.btn-x {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-x.primary {
  background: var(--ink);
  color: white;
}
.btn-x.primary:hover { background: oklch(0.12 0.02 265); transform: translateY(-1px); }
.btn-x.ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--line);
}
.btn-x.ghost:hover { background: var(--bg-muted); }
.btn-x.indigo {
  background: var(--indigo);
  color: white;
}
.btn-x.indigo:hover { background: var(--indigo-deep); }
.btn-x .icon { width: 15px; height: 15px; }
.btn-x.lg { padding: 13px 22px; font-size: 14.5px; }
.btn-x.sm { padding: 7px 12px; font-size: 12.5px; }

/* ===== Mastery Ring ===== */
.mastery-ring {
  position: relative;
  width: 220px; height: 220px;
}
.mastery-ring svg { transform: rotate(-90deg); }
.mastery-ring .track { stroke: var(--bg-muted); }
.mastery-ring .fill {
  stroke: url(#ringGrad);
  stroke-linecap: round;
  transition: stroke-dashoffset 1.8s cubic-bezier(.2,.8,.2,1);
}
.mastery-ring .center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.mastery-num {
  font-family: var(--font-serif);
  font-size: 56px; line-height: 1;
  letter-spacing: -0.03em;
}
.mastery-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-top: 6px;
  font-weight: 500;
}

/* ===== Stat tile ===== */
.stat {
  display: flex; flex-direction: column; gap: 6px;
}
.stat-value {
  font-family: var(--font-serif);
  font-size: 36px; line-height: 1;
  letter-spacing: -0.025em;
}
.stat-label {
  font-size: 12px;
  color: var(--ink-3);
}
.stat-delta {
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--mint);
  font-weight: 600;
}
.stat-delta.down { color: var(--rose); }

/* ===== Topic row ===== */
.topic-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.topic-row:last-child { border-bottom: none; }
.topic-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--bg-muted);
  display: grid; place-items: center;
  color: var(--ink-2);
}
.topic-icon .icon { width: 16px; height: 16px; }
.topic-name { font-weight: 500; font-size: 14px; }
.topic-meta { font-size: 12px; color: var(--ink-4); }

.bar {
  width: 90px; height: 6px;
  background: var(--bg-muted);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--indigo), var(--mint));
  border-radius: 999px;
}

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.005em;
}
.chip.mint { background: var(--mint-soft); color: oklch(0.42 0.1 165); }
.chip.indigo { background: var(--indigo-soft); color: var(--indigo-deep); }
.chip.amber { background: var(--amber-soft); color: oklch(0.45 0.13 70); }
.chip.rose { background: var(--rose-soft); color: oklch(0.45 0.16 20); }
.chip.ghost { background: var(--bg-muted); color: var(--ink-2); }

/* ===== Recommendation card ===== */
.rec-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  background: white;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.rec-card:hover {
  border-color: var(--indigo);
  box-shadow: 0 0 0 4px var(--indigo-soft), var(--shadow-sm);
  transform: translateY(-2px);
}
.rec-card .rec-confidence {
  position: absolute;
  top: 14px; right: 14px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--ink-4);
}
.rec-thumb {
  width: 100%; height: 110px;
  border-radius: 10px;
  margin-bottom: 14px;
  background:
    repeating-linear-gradient(45deg, oklch(0.95 0.005 250), oklch(0.95 0.005 250) 8px, oklch(0.97 0.005 250) 8px, oklch(0.97 0.005 250) 16px);
  display: grid; place-items: center;
  color: var(--ink-4);
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ===== Quiz ===== */
.quiz-progress {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0;
}
.quiz-step-bar {
  flex: 1; height: 4px;
  background: var(--bg-muted);
  border-radius: 999px;
  overflow: hidden;
  display: flex; gap: 3px;
}
.quiz-step-bar .seg {
  flex: 1; height: 100%;
  background: var(--bg-muted);
  border-radius: 999px;
  transition: background 0.4s;
}
.quiz-step-bar .seg.done { background: var(--ink); }
.quiz-step-bar .seg.current {
  background: linear-gradient(90deg, var(--ink), var(--indigo));
}

.quiz-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 40px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.quiz-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--indigo), var(--mint));
}

.quiz-q-num {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-4);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.quiz-question {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.25;
  margin: 14px 0 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: white;
  cursor: pointer;
  transition: all 0.18s;
  font-size: 15px;
  color: var(--ink);
  text-align: left;
  width: 100%;
}
.quiz-option:hover {
  border-color: var(--ink-3);
  background: var(--bg-soft);
}
.quiz-option.selected {
  border-color: var(--indigo);
  background: var(--indigo-soft);
  box-shadow: 0 0 0 3px oklch(0.55 0.18 270 / 0.1);
}
.quiz-option .opt-key {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--bg-muted);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  flex-shrink: 0;
  font-weight: 600;
  transition: all 0.18s;
}
.quiz-option.selected .opt-key {
  background: var(--indigo);
  color: white;
}
.quiz-option .opt-text { padding-top: 3px; }

.quiz-meta-bar {
  display: flex; gap: 24px; flex-wrap: wrap;
  padding: 16px 22px;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  margin-top: 24px;
  font-size: 12.5px;
}
.quiz-meta-bar .item { display: flex; align-items: center; gap: 8px; color: var(--ink-3); }
.quiz-meta-bar .item .icon { width: 14px; height: 14px; }
.quiz-meta-bar .item strong { color: var(--ink); font-weight: 600; }

/* ===== Difficulty signal ===== */
.difficulty {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.difficulty .bar-mini {
  width: 4px; border-radius: 1px;
  background: var(--line);
}
.difficulty .bar-mini.on { background: var(--ink); }
.difficulty .bar-mini.h1 { height: 6px; }
.difficulty .bar-mini.h2 { height: 9px; }
.difficulty .bar-mini.h3 { height: 12px; }
.difficulty .bar-mini.h4 { height: 15px; }

/* ===== Result page ===== */
.result-hero {
  background: var(--ink);
  color: white;
  border-radius: var(--r-xl);
  padding: 48px;
  position: relative;
  overflow: hidden;
}
.result-hero > * { position: relative; z-index: 1; }

.score-arc {
  width: 280px; height: 280px;
  position: relative;
}
.score-arc svg { transform: rotate(-90deg); overflow: visible; }
.score-arc .center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-num {
  font-family: var(--font-serif);
  font-size: 84px; line-height: 1;
  letter-spacing: -0.04em;
}
.score-num small { font-size: 32px; opacity: 0.5; }

.kpi {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r);
  padding: 18px;
}
.kpi-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: oklch(0.7 0.02 265);
  margin-bottom: 8px;
}
.kpi-value {
  font-family: var(--font-serif);
  font-size: 32px;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* ===== Concept grid ===== */
.concept {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-radius: 10px;
  background: white;
  border: 1px solid var(--line);
  font-size: 13.5px;
}
.concept .name { display: flex; align-items: center; gap: 10px; }
.concept .dot { width: 8px; height: 8px; border-radius: 50%; }
.concept .dot.mastered { background: var(--mint); }
.concept .dot.review { background: var(--amber); }
.concept .dot.struggle { background: var(--rose); }

/* ===== Knowledge graph ===== */
.kgraph {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 20% 30%, oklch(0.96 0.02 270), transparent 40%),
    radial-gradient(circle at 80% 70%, oklch(0.96 0.03 165), transparent 40%),
    var(--bg-soft);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
}

.kgraph .node {
  position: absolute;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-xs);
  transform: translate(-50%, -50%);
}
.kgraph .node .dot { width: 8px; height: 8px; border-radius: 50%; }
.kgraph .node.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

/* ===== Heatmap calendar ===== */
.heatmap {
  display: grid;
  grid-template-columns: repeat(26, 1fr);
  gap: 3px;
}
.heatmap .cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--bg-muted);
}
.heatmap .cell.l1 { background: oklch(0.92 0.04 270); }
.heatmap .cell.l2 { background: oklch(0.82 0.08 270); }
.heatmap .cell.l3 { background: oklch(0.7 0.13 270); }
.heatmap .cell.l4 { background: var(--indigo-deep); }

/* ===== AI Insight banner ===== */
.ai-banner {
  display: flex;
  gap: 16px;
  padding: 18px 22px;
  background: linear-gradient(135deg, var(--ink) 0%, oklch(0.22 0.05 270) 100%);
  color: white;
  border-radius: var(--r);
  position: relative;
  overflow: hidden;
}
.ai-banner > * { position: relative; z-index: 1; }
.ai-banner .ai-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--indigo), var(--mint));
  display: grid; place-items: center;
  flex-shrink: 0;
}
.ai-banner .ai-icon .icon { width: 18px; height: 18px; color: white; }
.ai-banner h4 {
  font-size: 14px; margin: 0 0 4px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.ai-banner p { font-size: 13px; margin: 0; color: oklch(0.85 0.01 265); line-height: 1.55; }

.ai-tag {
  font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase;
  background: linear-gradient(90deg, var(--indigo), var(--mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.error-box { margin: 16px; }

.mobile-topbar .brand-name { font-size: 18px; margin-left: 10px; }


/* Scrim */
.scrim {
  display: none;
  position: fixed; inset: 0;
  background: rgba(20,24,50,0.3);
  z-index: 40;
  backdrop-filter: blur(2px);
}
.scrim.show { display: block; }

/* Utility */
.divider-x { height: 1px; background: var(--line-soft); margin: 18px 0; }
.icon { width: 18px; height: 18px; stroke-width: 1.75; }
[data-lucide] { width: 18px; height: 18px; stroke-width: 1.75; }

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* ===== Breadcrumbs ===== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 12px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    margin-bottom: 24px;
    box-shadow: var(--shadow-xs);
}
.course-strip {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 24px;
  box-shadow: var(--shadow-xs);
}
.breadcrumb-item {
    font-size: 12.5px;
    color: var(--ink-3);
    display: flex;
    align-items: center;
    gap: 6px;
}
    .breadcrumb-item strong {
        color: var(--ink);
        font-weight: 600;
    }
.sep { color: var(--ink-4); font-size: 11px; }

.stat-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px;
  background: var(--bg-muted);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-2);
}
.stat-chip strong { color: var(--ink); font-weight: 600; }
.stat-chip .icon { width: 13px; height: 13px; color: var(--ink-3); }

/* Mastery Ring adjustment */
.mastery-ring .center .mastery-num small { font-size: 24px; color: var(--ink-4); }

/* Topic row specific override */
.topic-row .topic-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-row .topic-meta { font-size: 11.5px; color: var(--ink-4); }

/* ===== Lesson stages rail ===== */
.lesson-rail {
  display: flex; flex-direction: column; gap: 4px;
}
.lesson-stage {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px; align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.lesson-stage:hover { background: var(--bg-muted); }
.lesson-stage.current {
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.lesson-stage .stage-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-muted);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  position: relative;
}
.lesson-stage.done .stage-dot { background: var(--mint); color: white; }
.lesson-stage.current .stage-dot { background: var(--indigo); color: white; box-shadow: 0 0 0 4px var(--indigo-soft); }
.lesson-stage .stage-name { font-size: 13.5px; font-weight: 500; }
.lesson-stage .stage-meta { font-size: 11.5px; color: var(--ink-4); }
.lesson-stage .stage-time { font-size: 11px; color: var(--ink-4); font-family: var(--font-mono); }
.lesson-rail::before {
  content: ''; position: absolute;
  /* connector handled via outer */
}
.lesson-stages {
  position: relative;
}
.lesson-stages::before {
  content: '';
  position: absolute;
  left: 24px; top: 30px; bottom: 30px;
  width: 1px;
  background: var(--line);
  z-index: 0;
}
.lesson-stage > * { position: relative; z-index: 1; }

/* ===== Challenge level meter ===== */
.challenge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 11px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
}
.challenge .bars {
  display: flex; align-items: flex-end; gap: 2px;
}
.challenge .bars span {
  width: 3px; border-radius: 1px;
  background: var(--line);
}
.challenge .bars span.on { background: var(--indigo); }
.challenge .bars span:nth-child(1) { height: 6px; }
.challenge .bars span:nth-child(2) { height: 9px; }
.challenge .bars span:nth-child(3) { height: 12px; }
.challenge .bars span:nth-child(4) { height: 15px; }

/* ===== Inline answer feedback ===== */
.quiz-option.correct {
  border-color: var(--mint);
  background: var(--mint-soft);
}
.quiz-option.correct .opt-key {
  background: var(--mint); color: white;
}
.quiz-option.incorrect {
  border-color: var(--rose);
  background: var(--rose-soft);
}
.quiz-option.incorrect .opt-key { background: var(--rose); color: white; }

.feedback-card {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--bg-soft);
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 14px;
}
.feedback-card.correct { background: var(--mint-soft); border-color: oklch(0.85 0.08 165); }
.feedback-card .fb-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--mint);
  color: white;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.feedback-card .fb-title {
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: oklch(0.42 0.1 165);
  margin-bottom: 4px;
}
.feedback-card .fb-body {
  font-size: 13.5px; color: var(--ink-2); line-height: 1.55;
}
.feedback-card .fb-body em { font-style: italic; color: var(--ink); font-weight: 500; }

/* ===== Question media ===== */
.q-media {
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(45deg, oklch(0.95 0.005 250), oklch(0.95 0.005 250) 8px, oklch(0.97 0.005 250) 8px, oklch(0.97 0.005 250) 16px);
  display: grid; place-items: center;
  color: var(--ink-4);
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  aspect-ratio: 4 / 3;
  margin-bottom: 18px;
}

/* ===== Radar chart ===== */
.radar-card { padding: 22px; }
.radar-wrap {
  position: relative;
  display: grid; place-items: center;
}
.radar-wrap svg { width: 100%; max-width: 360px; height: auto; }
.radar-legend {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  margin-top: 10px; font-size: 12px; color: var(--ink-3);
}
.radar-legend .swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: middle; }

/* ===== Intervention modal ===== */
.modal-x-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 24, 50, 0.45);
  backdrop-filter: blur(6px);
  z-index: 60;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-x-backdrop.show { display: flex; animation: fadeUp 0.25s; }
.modal-x {
  background: white;
  border-radius: var(--r-xl);
  max-width: 520px; width: 100%;
  padding: 36px 36px 28px;
  box-shadow: var(--shadow-lg);
  position: relative;
  text-align: center;
  border: 1px solid var(--line);
}
.modal-x .modal-glyph {
  width: 56px; height: 56px;
  margin: 0 auto 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--indigo-soft), var(--mint-soft));
  display: grid; place-items: center;
  color: var(--indigo-deep);
}
.modal-x h3 {
  font-family: var(--font-serif);
  font-size: 28px;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  font-weight: 400;
}
.modal-x p {
  color: var(--ink-3);
  font-size: 14.5px;
  line-height: 1.55;
  max-width: 380px;
  margin: 0 auto 24px;
}
.modal-x .modal-actions {
  display: flex; gap: 10px;
  justify-content: center;
}
.modal-x .modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px;
  border: 0; background: transparent;
  border-radius: 8px;
  color: var(--ink-4);
  cursor: pointer;
}
.modal-x .modal-close:hover { background: var(--bg-muted); color: var(--ink); }


.up-next-container { display: flex; justify-content: space-between; align-items: center; background: oklch(0.97 0.01 270); border-radius: 8px; padding: 11px 14px; margin-bottom: 12px; }
.up-next-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--indigo); margin-bottom: 3px; }
.up-next-title { font-size: 14px; font-weight: 600; color: var(--ink); }

.fs-13 { font-size: 13px; }
.fs-18 { font-size: 18px; }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.text-ink-sub { color: var(--ink-4); }
.text-ink-light { color: white; }
.p-20-22 { padding: 20px 22px; }
.bg-ink-gradient { background: oklch(0.18 0.06 270); }
.br-14 { border-radius: 14px; }
.fs-14-5 { font-size: 14.5px; }
.line-h-1-35 { line-height: 1.35; }
.mb-6 { margin-bottom: 6px; }
.line-h-1-45 { line-height: 1.45; }
.flex-1 { flex: 1; }
.min-w-160 { min-width: 160px; }
.bg-amber-rose { background: linear-gradient(90deg,var(--amber),var(--rose)); }
.flex-1 { flex: 1; }
.mr-6 { margin-right: 6px; }
.justify-center { justify-content: center; }
.lucide-icon-sm { width: 13px; height: 13px; }
.lucide-icon-md { width: 24px; height: 24px; }
.my-courses-empty-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 16px; }
.my-courses-empty-desc { color: var(--ink-3); font-size: 14px; }
.my-courses-brand-mark { width: 40px; height: 40px; }
.my-courses-code { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--ink-4); }
.my-courses-title { font-weight: 600; color: var(--ink); font-size: 15px; }
.my-courses-chip-paused { background: var(--amber-soft); color: var(--amber); }
.my-courses-chip-completed { background: var(--mint-soft); color: var(--mint); }
.my-courses-mastery-label { font-size: 12px; color: var(--ink-3); }
.my-courses-mastery-value { font-size: 13px; font-weight: 600; color: var(--ink); }
.my-courses-bar-completed { background: var(--mint); }
.my-courses-concept-name { font-size: 13.5px; color: var(--ink-2); display: flex; align-items: center; }
.my-courses-activity-name { font-size: 13px; color: var(--ink-4); display: flex; align-items: center; }
.my-courses-completed-text { font-size: 13px; color: var(--ink-3); margin-bottom: 16px; }
.my-courses-completed-link { color: var(--indigo); font-weight: 500; }
.my-courses-btn-ghost { color: var(--ink-3); }
.my-courses-add-card { border: 2px dashed var(--line); padding: 40px; cursor: pointer; transition: border-color .2s; }
.my-courses-add-card:hover { border-color: var(--indigo); }
.my-courses-add-icon-wrapper { background: var(--bg-muted); padding: 16px; border-radius: 50%; margin-bottom: 16px; }
.my-courses-add-title { font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.my-courses-add-desc { font-size: 13px; color: var(--ink-4); max-width: 200px; }

.card-sub-title { font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: oklch(0.65 0.10 270); font-weight: 600; margin-bottom: 10px; }

.btn-active { background: var(--ink); color: white; border-color: var(--ink); }

.rec-card { 
    background: var(--surface); 
    border: 1px solid var(--line); 
    border-radius: var(--r); 
    padding: 20px; 
    transition: transform 0.2s;
}
.rec-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.rec-confidence { font-size: 11px; color: var(--ink-4); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 4px; }
.rec-thumb { font-size: 11px; color: var(--ink-3); margin-bottom: 8px; }
.difficulty { display: flex; gap: 2px; }
.bar-mini { width: 6px; height: 12px; background: var(--bg-muted); border-radius: 2px; }
.bar-mini.on { background: var(--ink-2); }
.bar-mini.h1.on { background: var(--mint); }
.bar-mini.h2.on { background: var(--mint); }
.bar-mini.h3.on { background: var(--amber); }
.bar-mini.h4.on { background: var(--rose); }

.ai-tag { font-size: 10px; font-weight: 600; text-transform: uppercase; background: var(--bg-soft); padding: 2px 6px; border-radius: 4px; margin-left: 8px; color: var(--ink-3); }
.divider-x { border-top: 1px solid var(--line); margin: 16px 0; }
.radar-legend { display: flex; gap: 16px; justify-content: center; font-size: 12px; color: var(--ink-3); margin-top: 12px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 6px; }
.bg-indigo-deep { background: var(--indigo-deep); }


.topic-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: white;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.topic-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.topic-card.recommended {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-soft);
}
.topic-card .ribbon {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--indigo);
  color: white;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 600;
  z-index: 2;
}
.topic-card .thumb {
  height: 110px;
  background:
    repeating-linear-gradient(45deg, var(--indigo-soft), var(--indigo-soft) 8px, oklch(0.97 0.02 270) 8px, oklch(0.97 0.02 270) 16px);
  display: grid; place-items: center;
  color: var(--indigo-deep);
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.topic-card .body {
  padding: 14px 16px;
}
.topic-card .body h6 { font-size: 14px; font-weight: 600; margin-bottom: 6px; line-height: 1.35; }
.topic-card .body .meta { font-size: 12px; color: var(--ink-4); display: flex; gap: 10px; align-items: center; }
.topic-card .body .actions {
  display: flex; gap: 8px; margin-top: 12px;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}
.topic-card .body .actions a {
  flex: 1; text-align: center;
  font-size: 12.5px; font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding: 6px;
  border-radius: 6px;
  transition: background 0.15s;
}
.topic-card .body .actions a:hover { background: var(--bg-muted); color: var(--ink); }

/* Slide-in for cards */
.slide-up { animation: fadeUp 0.5s cubic-bezier(.2,.8,.2,1) backwards; }
.slide-up.d1 { animation-delay: 0.05s; }
.slide-up.d2 { animation-delay: 0.1s; }
.slide-up.d3 { animation-delay: 0.15s; }
.slide-up.d4 { animation-delay: 0.2s; }

/* ===== Hint area — R-15 ===== */
.hint-area { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.hint-btn  { align-self: flex-start; gap: 6px; }
.hint-reveal,
.hint-block {
  border-radius: var(--r);
  border: 1px solid oklch(0.88 0.06 80);
  background: var(--amber-soft);
  padding: 12px 14px;
}
.hint-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: oklch(0.52 0.1 80); margin-bottom: 6px;
}
.hint-text { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.hint-block.info { background: var(--indigo-soft); border-color: oklch(0.82 0.08 270); }
.hint-block.info .hint-label { color: var(--indigo-deep); }

/* ===== Feedback card — incorrect variant — R-16 ===== */
.feedback-card.incorrect { background: var(--rose-soft); border-color: oklch(0.88 0.06 20); }
.feedback-card .fb-icon.incorrect { background: var(--rose); }
.feedback-card .fb-title.incorrect { color: oklch(0.42 0.12 20); }
.fb-section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink-4); margin-bottom: 4px;
}

/* ===== Diagnostic progress strip — R-17 ===== */
.diag-progress-strip {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  background: var(--indigo-soft);
  border-bottom: 1px solid oklch(0.90 0.04 310);
  margin-bottom: 4px;
}
.diag-label {
  font-size: 12.5px; font-weight: 600; color: var(--indigo-deep); white-space: nowrap;
}
.diag-bar-track {
  flex: 1; height: 6px; background: oklch(0.88 0.06 310);
  border-radius: 99px; overflow: hidden;
}
.diag-bar-fill {
  height: 100%; background: var(--indigo);
  border-radius: 99px; transition: width 0.4s ease;
}

/* ===== Prerequisite block — R-18 ===== */
.prereq-block {
  border-radius: var(--r);
  border: 1px solid oklch(0.84 0.06 310);
  background: var(--indigo-soft);
  padding: 12px 14px;
}
.prereq-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--indigo-deep); margin-bottom: 4px;
}
.prereq-topic { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.slide-up.d5 { animation-delay: 0.25s; }

/* ===== Learn page ===== */
.learn-course-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1.5rem; padding: 1.5rem 0 1.25rem;
  border-bottom: 1px solid var(--border); margin-bottom: 1.5rem;
}
.learn-course-label {
  font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--indigo); margin-bottom: .35rem;
}
.learn-title {
    font-family: var(--font-serif); /*'Instrument Serif', serif;*/
    font-size: 1.75rem;
    line-height: 1.2;
    color: var(--ink-1);
    margin: 0;
}

/* Course tabs */
.learn-course-tabs {
  display: flex; gap: .375rem; flex-wrap: wrap;
  padding: 1rem 0 .75rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem;
}
.learn-course-tab {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .75rem; border-radius: 99px; border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600; color: var(--ink-3);
  text-decoration: none; background: var(--surface-1); transition: all .15s;
}
.learn-course-tab:hover { background: var(--surface-2); color: var(--ink-1); }
.learn-course-tab.active { background: var(--indigo-soft); border-color: var(--indigo); color: var(--indigo-deep); }
.tab-label { font-weight: 400; color: inherit; font-size: 11.5px; }

/* Topic accordion list */
.learn-topic-list { display: flex; flex-direction: column; gap: .75rem; }

.learn-topic-item {
  border: 1px solid oklch(0.93 0.005 250); border-radius: var(--r);
  background: var(--surface-1); overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.learn-topic-item.open { border-color: oklch(0.78 0.02 250); box-shadow: 0 2px 8px rgba(20,24,50,0.06); }
.learn-topic-item.highlighted { border-color: oklch(0.72 0.06 250); box-shadow: 0 2px 12px rgba(20,24,50,0.08); }

.learn-topic-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .875rem 1.1rem;
  background: none; border: none; cursor: pointer; text-align: left;
}
.learn-topic-toggle:hover { background: var(--surface-2); }
.learn-topic-toggle-left { display: flex; align-items: center; gap: .875rem; flex: 1; min-width: 0; }
.learn-topic-toggle-right { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }

.learn-topic-meta { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.learn-topic-code { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--indigo); }
.learn-topic-title { font-size: 14px; font-weight: 600; color: var(--ink-1); }
.learn-topic-desc { font-size: 12.5px; color: var(--ink-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40ch; }
.learn-material-count { display: flex; align-items: center; gap: .25rem; font-size: 12px; color: var(--ink-4); }
.toggle-chevron { transition: transform .2s ease; }
.learn-topic-item.open .toggle-chevron { transform: rotate(180deg); }

/* Collapsible body */
.learn-topic-body {
  display: none;
  border-top: 1px solid var(--border);
}
.learn-topic-item.open .learn-topic-body { display: block; }

/* Material rows */
.learn-material-list { list-style: none; padding: 0; margin: 0; }
.learn-material-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.1rem; border-bottom: 1px solid var(--border);
}
.learn-material-row:last-of-type { border-bottom: none; }
.material-icon-wrap {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.chip-indigo { background: var(--indigo-soft); color: var(--indigo-deep); }
.chip-mint   { background: oklch(0.94 0.06 165); color: oklch(0.35 0.12 165); }
.chip-rose   { background: oklch(0.95 0.04 20);  color: oklch(0.40 0.14 20); }
.chip-amber  { background: oklch(0.96 0.06 80);  color: oklch(0.40 0.12 80); }
.chip-ghost  { background: var(--surface-2); color: var(--ink-3); }
.material-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.material-title { font-size: 13.5px; font-weight: 500; color: var(--ink-1); }
.material-actions { display: flex; gap: .375rem; flex-shrink: 0; }

/* Inline body text */
.material-body-row { display: block; }
.material-body {
  padding: .75rem 1.1rem .75rem 3.85rem;
  font-size: 13.5px; color: var(--ink-3); line-height: 1.65;
  background: oklch(0.97 0.01 310);
  white-space: pre-wrap;
}

/* Topic footer */
.learn-topic-footer {
  display: flex; justify-content: flex-end;
  padding: .625rem 1.1rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

/* ===== Utility classes ===== */
.icon-sm { width: 13px; height: 13px; }
.max-w-600 { max-width: 600px; }
.p-28 { padding: 28px; }
.mt-14 { margin-top: 14px; }
.mb-20 { margin-bottom: 20px; }
.fs-36 { font-size: 36px; }
.fs-16 { font-size: 16px; }
.fs-13 { font-size: 13px; }
.fs-18 { font-size: 18px; }
.fs-12 { font-size: 12px; }
.h-100 { height: 100%; }
.dashed-border { border: 1px dashed var(--line); }
.text-hint { font-size: 14px; color: var(--ink-3); margin-bottom: 20px; line-height: 1.6; }
.text-ink-light { color: oklch(0.88 0.04 270); margin-bottom: 4px; line-height: 1.6; }
.text-ink-sub { font-size: 12px; color: oklch(0.55 0.06 270); margin: 0; }

/* ===== Progress page ===== */
.progress-table-row {
  display: grid;
  grid-template-columns: 1fr 80px 80px 70px;
  gap: 10px; align-items: center;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line-soft);
}
.progress-table-row:last-child { border-bottom: none; }
.progress-table-header {
  display: grid;
  grid-template-columns: 1fr 80px 80px 70px;
  gap: 10px;
  padding: 8px 22px;
  background: var(--bg-soft);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.progress-table-header span {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ink-4);
}
.p-20-22 { padding: 20px 22px; }
.bg-ink-gradient { background: oklch(0.18 0.06 270); }
.br-14 { border-radius: 14px; }
.card-sub-title { font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: oklch(0.65 0.10 270); font-weight: 600; margin-bottom: 10px; }
.bg-amber-rose { background: linear-gradient(90deg,var(--amber),var(--rose)); }
.w-100 { width: 100%; }
.h-auto { height: auto; }
.flex-grow-1 { flex-grow: 1; }
.text-mint-deep { color: oklch(0.42 0.1 165); }
.text-indigo { color: var(--indigo); }
.text-mint { color: var(--mint); }
.bg-mint { background: var(--mint); }
.bold { font-weight: 600; }
.h-3 { height: 3px; }

/* Charts */
.grid-lines { stroke: oklch(0.95 0.005 250); stroke-width: 1; }
.trend-line { fill: none; stroke: oklch(0.55 0.18 270); stroke-width: 2.5; stroke-linecap: round; }
.trend-curve-b { fill: none; stroke: oklch(0.78 0.12 165); stroke-width: 2; stroke-linecap: round; }
.trend-curve-c { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 4 4; }
.y-labels { font-family: var(--font-mono); font-size: 10px; fill: var(--ink-4); }
.chart-footer { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--ink-4); }

.radar-rings { fill: none; stroke: oklch(0.92 0.006 250); stroke-width: 1; }
.radar-rings .dashed { stroke-dasharray: 3 3; }
.radar-axes { stroke: oklch(0.92 0.006 250); stroke-width: 1; }
.radar-avg { fill: oklch(0.92 0.006 250); fill-opacity: 0.5; stroke: oklch(0.7 0.012 265); stroke-width: 1.5; stroke-dasharray: 4 4; }
.radar-you { fill: url(#radarFill); stroke: oklch(0.55 0.18 270); stroke-width: 2; }
.radar-dots { fill: oklch(0.55 0.18 270); }
.radar-labels { font-family: var(--font-sans); font-size: 11px; fill: var(--ink-2); text-anchor: middle; font-weight: 500; }
.avg-swatch { background: oklch(0.85 0.008 265); outline: 1px dashed oklch(0.7 0.012 265); outline-offset: -1px; }

/* Topic list */
.topic-list-container { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.topic-row-custom { display: grid; grid-template-columns: 20px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; }
.topic-row-custom.next-topic { background: oklch(0.97 0.01 270); border-radius: 8px; }
.topic-title-custom { font-size: 13.5px; line-height: 1.3; }
.up-next-chip { display: inline-block; font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; background: var(--indigo-soft); color: var(--indigo); border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
