/* ===== DESIGN TOKENS ===== */
:root, [data-theme="light"] {
  --bg: #f5f5f0;
  --surface: #eeeee8;
  --surface-2: #e6e6df;
  --border: #d0d0c8;
  --text: #1a1a18;
  --text-muted: #6b6b64;
  --text-faint: #9e9e96;
  --accent: #00b368;
  --accent-hover: #009957;
  --accent-dim: #00b36820;
  --accent-glow: #00b36840;
  --code-bg: #ddddd6;
  --code-border: #c8c8c0;
  --card-bg: #eeeee8;
  --card-hover: #e6e6df;
  --sidebar-bg: #eaeae3;
  --header-bg: #f5f5f0ee;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.1);
  --quiz-correct: #2e7d32;
  --quiz-wrong: #c62828;
  --track-1: #00b368;
  --track-2: #0091ea;
  --track-3: #ff6d00;
  --track-4: #aa00ff;
  --track-5: #00bfa5;
  --track-6: #d50000;
  --track-7: #ffd600;
  --track-8: #6200ea;
}

[data-theme="dark"] {
  --bg: #0e100f;
  --surface: #171a18;
  --surface-2: #1e221f;
  --border: #2a2e2b;
  --text: #d0d4d1;
  --text-muted: #7a7e7b;
  --text-faint: #4a4e4b;
  --accent: #00e47a;
  --accent-hover: #00c96b;
  --accent-dim: #00e47a18;
  --accent-glow: #00e47a30;
  --code-bg: #131613;
  --code-border: #252a27;
  --card-bg: #161918;
  --card-hover: #1c201e;
  --sidebar-bg: #111311;
  --header-bg: #0e100fee;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
  --quiz-correct: #4caf50;
  --quiz-wrong: #ef5350;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}
body {
  min-height: 100dvh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent-dim); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ===== HEADER ===== */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 12px;
  max-width: 100%; padding: 0 16px; height: 52px;
}
.menu-toggle { display: none; padding: 6px; border-radius: 6px; }
.menu-toggle:hover { background: var(--surface); }
.logo { display: flex; align-items: center; gap: 8px; }
.logo-text { font-weight: 650; font-size: 16px; letter-spacing: -0.02em; }
.header-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.search-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 13px;
  transition: all 0.15s;
}
.search-trigger:hover { border-color: var(--accent); color: var(--text); }
.search-hint { display: flex; gap: 3px; }
.search-hint kbd {
  display: inline-block; padding: 1px 5px; border-radius: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-family: inherit; font-size: 11px; line-height: 1.5;
}
.xp-badge {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  background: var(--accent-dim); font-size: 13px; font-weight: 600;
  color: var(--accent);
}
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
  transition: background 0.15s;
}
.theme-toggle:hover { background: var(--surface); }
.overall-progress-bar {
  height: 2px; background: var(--border);
}
.overall-progress-fill {
  height: 100%; background: var(--accent);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== LAYOUT ===== */
.layout {
  display: flex; min-height: 100dvh; padding-top: 54px;
}
.sidebar {
  position: fixed; top: 54px; left: 0; bottom: 0;
  width: 260px; overflow-y: auto;
  background: var(--sidebar-bg); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar-nav { flex: 1; padding: 12px 8px; }
.sidebar-footer {
  padding: 12px; border-top: 1px solid var(--border);
  background: var(--sidebar-bg);
}
.main {
  flex: 1; margin-left: 260px;
  padding: 32px 40px 64px;
  max-width: 900px;
}

/* ===== SIDEBAR NAV ===== */
.nav-track { margin-bottom: 4px; }
.nav-track-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 550; text-align: left;
  transition: background 0.15s; color: var(--text);
}
.nav-track-btn:hover { background: var(--surface); }
.nav-track-btn.active { background: var(--accent-dim); color: var(--accent); }
.nav-track-icon {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 6px;
  font-size: 13px; flex-shrink: 0;
}
.nav-track-progress {
  margin-left: auto; font-size: 11px;
  color: var(--text-faint); font-weight: 500;
}
.nav-lessons { padding-left: 42px; overflow: hidden; max-height: 0; transition: max-height 0.3s; }
.nav-lessons.open { max-height: 2000px; }
.nav-lesson-btn {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 5px 8px; border-radius: 6px;
  font-size: 12.5px; text-align: left; color: var(--text-muted);
  transition: all 0.15s;
}
.nav-lesson-btn:hover { color: var(--text); background: var(--surface); }
.nav-lesson-btn.completed { color: var(--accent); }
.nav-lesson-btn.active-lesson { color: var(--accent); font-weight: 550; }
.nav-lesson-check {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.nav-lesson-btn.completed .nav-lesson-check {
  background: var(--accent); border-color: var(--accent);
}
.nav-lesson-check svg { display: none; }
.nav-lesson-btn.completed .nav-lesson-check svg { display: block; }
.nav-quiz-btn {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 5px 8px; border-radius: 6px;
  font-size: 12.5px; font-weight: 550; text-align: left;
  color: var(--text-faint); transition: all 0.15s;
  margin-top: 2px;
}
.nav-quiz-btn:hover { color: var(--text); background: var(--surface); }
.nav-quiz-btn.completed { color: var(--accent); }

/* ===== LEVEL DISPLAY ===== */
.level-display { text-align: center; }
.level-label {
  display: block; font-size: 13px; font-weight: 650;
  color: var(--accent); margin-bottom: 6px;
}
.level-progress {
  height: 6px; background: var(--border); border-radius: 3px;
  overflow: hidden; margin-bottom: 4px;
}
.level-progress-fill {
  height: 100%; background: var(--accent); border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.level-xp { font-size: 11px; color: var(--text-faint); }

/* ===== WELCOME ===== */
.welcome { max-width: 780px; }
.welcome-hero { text-align: center; margin-bottom: 40px; }
.welcome-icon { margin: 0 auto 20px; }
.welcome-hero h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  font-weight: 750; letter-spacing: -0.03em; line-height: 1.1;
  margin-bottom: 8px;
}
.welcome-subtitle {
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  color: var(--accent); font-weight: 500; margin-bottom: 12px;
}
.welcome-desc {
  font-size: 15px; color: var(--text-muted);
  max-width: 560px; margin: 0 auto; line-height: 1.7;
}
.track-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px; margin-bottom: 36px;
}
.track-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; cursor: pointer;
  transition: all 0.2s;
}
.track-card:hover {
  border-color: var(--accent); background: var(--card-hover);
  transform: translateY(-1px); box-shadow: var(--shadow-md);
}
.track-card-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.track-card-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.track-card-title { font-size: 15px; font-weight: 650; line-height: 1.3; }
.track-card-desc {
  font-size: 13px; color: var(--text-muted); line-height: 1.55;
  margin-bottom: 12px;
}
.track-card-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-faint);
}
.track-card-progress-bar {
  flex: 1; height: 4px; background: var(--border);
  border-radius: 2px; margin-left: 12px; overflow: hidden;
}
.track-card-progress-fill {
  height: 100%; border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.welcome-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.stat-card {
  text-align: center; padding: 16px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 10px;
}
.stat-number {
  display: block; font-size: 28px; font-weight: 750;
  color: var(--accent); letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ===== TRACK VIEW ===== */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 8px; margin-bottom: 20px;
  font-size: 13px; color: var(--text-muted);
  transition: all 0.15s;
}
.back-btn:hover { background: var(--surface); color: var(--text); }
.track-header { margin-bottom: 28px; }
.track-header h2 {
  font-size: clamp(1.4rem, 1.2rem + 1vw, 1.8rem);
  font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px;
}
.track-header-desc { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 14px; }
.track-progress-wrap { display: flex; align-items: center; gap: 10px; }
.track-progress-bar {
  flex: 1; height: 6px; background: var(--border);
  border-radius: 3px; overflow: hidden;
}
.track-progress-fill { height: 100%; border-radius: 3px; transition: width 0.5s; }
.track-progress-label { font-size: 12px; color: var(--text-faint); font-weight: 550; white-space: nowrap; }
.track-lessons { display: flex; flex-direction: column; gap: 6px; }
.lesson-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 10px;
  background: var(--card-bg); border: 1px solid var(--border);
  cursor: pointer; transition: all 0.15s;
}
.lesson-card:hover {
  border-color: var(--accent); background: var(--card-hover);
}
.lesson-card.completed { opacity: 0.75; }
.lesson-card-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 650; color: var(--text-muted); flex-shrink: 0;
}
.lesson-card.completed .lesson-card-num {
  background: var(--accent); color: var(--bg);
}
.lesson-card-title { font-size: 14px; font-weight: 550; }
.lesson-card-xp {
  margin-left: auto; font-size: 12px; color: var(--accent);
  font-weight: 600; white-space: nowrap;
}
.quiz-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 10px;
  background: var(--accent-dim); border: 1px solid var(--accent);
  cursor: pointer; transition: all 0.15s; margin-top: 8px;
}
.quiz-card:hover { background: var(--accent-glow); }
.quiz-card-icon { font-size: 20px; }
.quiz-card-title { font-size: 14px; font-weight: 650; color: var(--accent); }
.quiz-card-meta { margin-left: auto; font-size: 12px; color: var(--accent); font-weight: 500; }

/* ===== LESSON VIEW ===== */
.lesson-article { max-width: 720px; }
.lesson-article h1 {
  font-size: clamp(1.3rem, 1rem + 1.2vw, 1.7rem);
  font-weight: 720; letter-spacing: -0.02em; margin-bottom: 6px;
  line-height: 1.2;
}
.lesson-track-label {
  display: inline-block; font-size: 12px; font-weight: 600;
  color: var(--accent); margin-bottom: 16px;
  padding: 2px 8px; border-radius: 4px; background: var(--accent-dim);
}
.lesson-article h2 {
  font-size: 18px; font-weight: 650; margin-top: 32px; margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.lesson-article h3 {
  font-size: 15px; font-weight: 650; margin-top: 24px; margin-bottom: 8px;
}
.lesson-article p {
  margin-bottom: 14px; color: var(--text); line-height: 1.7;
  max-width: 68ch;
}
.lesson-article ul, .lesson-article ol {
  margin-bottom: 14px; padding-left: 20px;
}
.lesson-article li {
  margin-bottom: 6px; line-height: 1.6;
}
.lesson-article strong { font-weight: 600; }
.lesson-article em { font-style: italic; color: var(--text-muted); }

/* Code blocks */
.code-block {
  position: relative; margin: 16px 0;
  background: var(--code-bg); border: 1px solid var(--code-border);
  border-radius: 10px; overflow: hidden;
}
.code-block-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px; background: var(--surface-2);
  border-bottom: 1px solid var(--code-border);
  font-size: 11.5px; color: var(--text-faint); font-weight: 550;
}
.copy-btn {
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); transition: all 0.15s;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent); }
.code-block pre {
  padding: 14px 16px; overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px; line-height: 1.6;
  scrollbar-width: thin;
}
.code-block code { font-family: inherit; }
.inline-code {
  font-family: 'JetBrains Mono', monospace; font-size: 0.88em;
  background: var(--code-bg); border: 1px solid var(--code-border);
  padding: 1px 5px; border-radius: 4px;
}

/* Callout */
.callout {
  padding: 14px 16px; margin: 16px 0;
  border-radius: 10px; border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  font-size: 14px; line-height: 1.6;
}
.callout-title {
  font-weight: 650; margin-bottom: 4px;
  font-size: 13px; color: var(--accent);
}

/* Table */
.lesson-table {
  width: 100%; margin: 16px 0; border-collapse: collapse;
  font-size: 13.5px;
}
.lesson-table th {
  text-align: left; padding: 8px 12px;
  background: var(--surface-2); border-bottom: 2px solid var(--border);
  font-weight: 600; font-size: 12.5px; color: var(--text-muted);
}
.lesson-table td {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
}

/* Complete button */
.complete-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 24px; border-radius: 10px;
  background: var(--accent); color: var(--bg);
  font-size: 14px; font-weight: 650; margin-top: 24px;
  transition: all 0.2s;
}
.complete-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.complete-btn:disabled {
  opacity: 0.5; cursor: default; transform: none;
}
.lesson-nav {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border);
}
.lesson-nav-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; font-weight: 550; color: var(--text-muted);
  transition: all 0.15s;
}
.lesson-nav-btn:hover { border-color: var(--accent); color: var(--text); }

/* ===== QUIZ VIEW ===== */
.quiz-content { max-width: 680px; }
.quiz-content h2 {
  font-size: 22px; font-weight: 700; margin-bottom: 6px;
}
.quiz-track-label {
  display: inline-block; font-size: 12px; font-weight: 600;
  color: var(--accent); margin-bottom: 20px;
  padding: 2px 8px; border-radius: 4px; background: var(--accent-dim);
}
.quiz-progress {
  font-size: 13px; color: var(--text-muted); margin-bottom: 24px;
}
.quiz-question {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px; margin-bottom: 16px;
}
.quiz-question-text {
  font-size: 15px; font-weight: 600; margin-bottom: 16px; line-height: 1.5;
}
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-option {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; text-align: left; font-size: 14px; line-height: 1.5;
  transition: all 0.15s;
}
.quiz-option:hover { border-color: var(--accent); }
.quiz-option.selected { border-color: var(--accent); background: var(--accent-dim); }
.quiz-option.correct { border-color: var(--quiz-correct); background: rgba(46,125,50,0.12); }
.quiz-option.wrong { border-color: var(--quiz-wrong); background: rgba(198,40,40,0.12); }
.quiz-option.disabled { pointer-events: none; }
.quiz-option-letter {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 650; flex-shrink: 0;
}
.quiz-option.correct .quiz-option-letter { background: var(--quiz-correct); color: #fff; border-color: var(--quiz-correct); }
.quiz-option.wrong .quiz-option-letter { background: var(--quiz-wrong); color: #fff; border-color: var(--quiz-wrong); }
.quiz-explanation {
  margin-top: 12px; padding: 12px; border-radius: 8px;
  background: var(--surface); font-size: 13px; color: var(--text-muted);
  line-height: 1.6; border-left: 3px solid var(--accent);
}
.quiz-btn-row { display: flex; gap: 10px; margin-top: 20px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 24px; border-radius: 10px;
  background: var(--accent); color: var(--bg);
  font-size: 14px; font-weight: 650; transition: all 0.2s;
}
.btn-primary:hover { background: var(--accent-hover); }
.quiz-results {
  text-align: center; padding: 40px 20px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px;
}
.quiz-results-score {
  font-size: 48px; font-weight: 750; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.quiz-results-label { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.quiz-results-xp {
  font-size: 18px; font-weight: 650; color: var(--accent); margin-top: 12px;
}

/* ===== SEARCH MODAL ===== */
.search-modal {
  display: none; position: fixed; inset: 0; z-index: 200;
  align-items: flex-start; justify-content: center; padding-top: 15vh;
}
.search-modal.open { display: flex; }
.search-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}
.search-modal-content {
  position: relative; width: 100%; max-width: 560px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  overflow: hidden; margin: 0 16px;
}
.search-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.search-input-wrap input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 15px; color: var(--text);
}
.search-esc {
  font-size: 11px; padding: 2px 6px; border-radius: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-faint);
}
.search-results { max-height: 400px; overflow-y: auto; padding: 8px; }
.search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  transition: background 0.1s;
}
.search-result-item:hover { background: var(--surface-2); }
.search-result-track {
  font-size: 11px; padding: 1px 6px; border-radius: 4px;
  background: var(--accent-dim); color: var(--accent); font-weight: 600;
  white-space: nowrap;
}
.search-result-title { font-size: 14px; font-weight: 550; }
.search-no-results {
  padding: 24px; text-align: center;
  font-size: 14px; color: var(--text-muted);
}

/* ===== LEVEL UP MODAL ===== */
.level-modal {
  display: none; position: fixed; inset: 0; z-index: 300;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
}
.level-modal.open { display: flex; }
.level-modal-content {
  text-align: center; padding: 40px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg);
  max-width: 380px; margin: 0 16px;
  animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalPop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.level-modal-emoji { font-size: 56px; margin-bottom: 16px; }
.level-modal-content h2 {
  font-size: 22px; font-weight: 750; margin-bottom: 8px;
}
.level-modal-content p {
  font-size: 14px; color: var(--text-muted); margin-bottom: 20px;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 250;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-md); font-size: 14px;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 340px;
}
@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast-icon { font-size: 20px; flex-shrink: 0; }
.toast-text { font-weight: 550; }
.toast-xp { color: var(--accent); font-weight: 650; font-size: 13px; }

/* ===== CONFETTI ===== */
#confettiCanvas {
  position: fixed; inset: 0; z-index: 400;
  pointer-events: none;
}

/* ===== MOBILE ===== */
@media (max-width: 820px) {
  .menu-toggle { display: flex; }
  .search-hint { display: none; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 90; width: 280px;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; padding: 24px 16px 48px; }
  .track-grid { grid-template-columns: 1fr; }
  .welcome-stats { grid-template-columns: repeat(2, 1fr); }
  .lesson-nav { flex-direction: column; }
}
@media (max-width: 480px) {
  .welcome-hero h1 { font-size: 1.6rem; }
  .stat-number { font-size: 22px; }
}

/* Syntax tokens (manual highlight classes) */
.tok-kw { color: #c678dd; }
.tok-str { color: #98c379; }
.tok-cm { color: #5c6370; font-style: italic; }
.tok-fn { color: #61afef; }
.tok-num { color: #d19a66; }
.tok-op { color: #56b6c2; }
.tok-var { color: #e06c75; }
.tok-type { color: #e5c07b; }

[data-theme="light"] .tok-kw { color: #7c3aed; }
[data-theme="light"] .tok-str { color: #16a34a; }
[data-theme="light"] .tok-cm { color: #9ca3af; }
[data-theme="light"] .tok-fn { color: #2563eb; }
[data-theme="light"] .tok-num { color: #d97706; }
[data-theme="light"] .tok-op { color: #0891b2; }
[data-theme="light"] .tok-var { color: #dc2626; }
[data-theme="light"] .tok-type { color: #ca8a04; }
