:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --primary-glow: rgba(99,102,241,0.3);
  --secondary: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #0b0f1a;
  --bg-surface: #111827;
  --bg-card: #1a2235;
  --bg-card-hover: #1e293b;
  --border: #1e3a5f;
  --border-light: #2a3f5f;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --sidebar-w: 280px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* Sidebar */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w); background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 200; transition: transform .3s ease;
  overflow-y: auto;
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.sidebar-logo { display: flex; align-items: center; gap: .6rem; cursor: pointer; }
.logo-icon { font-size: 1.5rem; }
.logo-text { font-size: 1.25rem; font-weight: 800; color: var(--text); }
.logo-accent { color: var(--primary-light); }
.sidebar-close { display: none; background: none; border: none; color: var(--text-muted); font-size: 1.25rem; cursor: pointer; }
.sidebar-nav { flex: 1; padding: .75rem 0; }
.nav-divider {
  padding: .6rem 1.25rem .3rem; font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim);
}
.nav-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1.25rem; color: var(--text-muted); text-decoration: none;
  font-size: .88rem; font-weight: 500; transition: all .15s ease;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(99,102,241,0.08); color: var(--text); }
.nav-item.active { background: rgba(99,102,241,0.12); color: var(--primary-light); border-left-color: var(--primary); }
.nav-icon { width: 1.5rem; text-align: center; font-size: .85rem; opacity: .8; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 150; }
.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.progress-mini { display: flex; align-items: center; gap: .75rem; }
.progress-mini-bar { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress-mini-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 2px; transition: width .5s ease; }
.progress-mini-text { font-size: .7rem; color: var(--text-dim); white-space: nowrap; }

/* Main Content */
.main-content { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* Top Bar */
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 2rem; background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.hamburger { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; }
.topbar-title h1 { font-size: 1.15rem; font-weight: 700; }
.topbar-subtitle { font-size: .75rem; color: var(--text-dim); }
.topbar-actions { margin-left: auto; display: flex; gap: .5rem; }

/* Content Area */
.content-area { flex: 1; padding: 2rem; max-width: 1200px; width: 100%; margin: 0 auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .6rem 1.2rem; border-radius: var(--radius-sm);
  font-size: .88rem; font-weight: 600; cursor: pointer;
  border: none; transition: all .2s ease; font-family: inherit;
  white-space: nowrap;
}
.btn-sm { padding: .4rem .8rem; font-size: .8rem; }
.btn-lg { padding: .85rem 1.75rem; font-size: 1rem; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 4px 14px var(--primary-glow); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--primary-glow); }
.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--border-light); }
.btn-success { background: linear-gradient(135deg, var(--success), #059669); color: #fff; }
.btn-success:hover { transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid transparent; }
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.btn-outline { background: transparent; color: var(--primary-light); border: 1px solid var(--primary); }
.btn-outline:hover { background: rgba(99,102,241,0.1); }

/* Dashboard */
.dashboard-hero {
  text-align: center; padding: 3rem 2rem;
  background: radial-gradient(ellipse at top, rgba(99,102,241,0.12), transparent 70%);
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  margin-bottom: 2rem;
}
.dashboard-hero h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: .5rem; }
.hero-gradient { background: linear-gradient(135deg, var(--primary-light), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.dashboard-hero p { color: var(--text-muted); max-width: 600px; margin: 0 auto 1.5rem; }
.hero-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* Stats Grid */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; text-align: center;
}
.stat-card .stat-number { font-size: 1.75rem; font-weight: 800; }
.stat-card .stat-number.primary { color: var(--primary-light); }
.stat-card .stat-number.success { color: var(--success); }
.stat-card .stat-number.warning { color: var(--warning); }
.stat-card .stat-label { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }

/* Section Titles */
.section-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.section-title .count { font-size: .8rem; font-weight: 500; color: var(--text-dim); background: var(--bg-card); padding: .15rem .5rem; border-radius: 4px; }

/* Chapters Grid */
.chapters-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem;
}
.chapter-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  cursor: pointer; transition: all .2s ease;
  display: flex; flex-direction: column;
}
.chapter-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.chapter-num {
  display: inline-block; width: 2rem; height: 2rem; line-height: 2rem;
  text-align: center; border-radius: 6px;
  background: rgba(99,102,241,0.15); color: var(--primary-light);
  font-weight: 700; font-size: .85rem; margin-bottom: .75rem;
}
.chapter-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: .35rem; }
.chapter-card .chapter-desc { font-size: .82rem; color: var(--text-muted); margin-bottom: .75rem; flex: 1; }
.chapter-meta { display: flex; gap: 1rem; font-size: .75rem; color: var(--text-dim); }
.chapter-meta span { display: flex; align-items: center; gap: .25rem; }

/* Chapter Detail View */
.chapter-detail { animation: fadeIn .3s ease; }
.chapter-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap;
}
.chapter-header-left h2 { font-size: 1.5rem; font-weight: 700; }
.chapter-header-left .chapter-subtitle { color: var(--text-muted); font-size: .9rem; }
.chapter-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.chapter-tabs {
  display: flex; gap: .25rem; margin-bottom: 1.5rem;
  background: var(--bg-card); border-radius: var(--radius-sm);
  padding: .25rem; overflow-x: auto;
}
.chapter-tab {
  padding: .5rem 1rem; border-radius: 6px; font-size: .82rem;
  font-weight: 600; cursor: pointer; white-space: nowrap;
  color: var(--text-muted); transition: all .15s ease; border: none; background: none; font-family: inherit;
}
.chapter-tab:hover { color: var(--text); }
.chapter-tab.active { background: var(--primary); color: #fff; }
.tab-content { display: none; animation: fadeIn .25s ease; }
.tab-content.active { display: block; }

/* Notes Content */
.notes-content { max-width: 850px; }
.note-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem; margin-bottom: 1.25rem;
}
.note-section h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .75rem; color: var(--primary-light); }
.note-section h4 { font-size: .95rem; font-weight: 600; margin: 1rem 0 .5rem; color: var(--secondary); }
.note-section p, .note-section li { font-size: .88rem; color: var(--text-muted); line-height: 1.7; margin-bottom: .5rem; }
.note-section ul, .note-section ol { padding-left: 1.25rem; }
.note-section li { margin-bottom: .35rem; }
.note-section strong { color: var(--text); }
.note-formula {
  background: rgba(6,182,212,0.08); border-left: 3px solid var(--secondary);
  padding: .75rem 1rem; margin: .75rem 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-mono); font-size: .88rem; color: var(--secondary); overflow-x: auto;
}
.note-highlight {
  background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.2);
  padding: .75rem 1rem; margin: .75rem 0; border-radius: var(--radius-sm);
  font-size: .85rem; color: var(--text);
}
.note-diagram {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem; margin: 1rem 0;
  text-align: center; overflow-x: auto;
}
.note-diagram svg { max-width: 100%; height: auto; }
.note-diagram .diagram-caption { font-size: .75rem; color: var(--text-dim); margin-top: .5rem; }
.note-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .85rem; }
.note-table th, .note-table td { padding: .6rem .75rem; border: 1px solid var(--border); text-align: left; }
.note-table th { background: rgba(99,102,241,0.1); color: var(--primary-light); font-weight: 600; }
.note-table td { color: var(--text-muted); }
.note-tip { background: rgba(16,185,129,0.08); border-left: 3px solid var(--success); padding: .75rem 1rem; margin: .75rem 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .85rem; color: var(--success); }
.note-warning { background: rgba(245,158,11,0.08); border-left: 3px solid var(--warning); padding: .75rem 1rem; margin: .75rem 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .85rem; color: var(--warning); }

/* Video Resources */
.video-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem;
}
.video-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  transition: all .2s ease;
}
.video-card:hover { border-color: var(--primary); }
.video-card .video-topic { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); margin-bottom: .35rem; }
.video-card h4 { font-size: .95rem; font-weight: 600; margin-bottom: .5rem; }
.video-card p { font-size: .82rem; color: var(--text-muted); margin-bottom: .75rem; }
.video-card .video-link {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--danger); font-weight: 600; font-size: .85rem; text-decoration: none;
  padding: .35rem .75rem; border-radius: var(--radius-sm);
  border: 1px solid rgba(239,68,68,0.3); transition: all .15s ease;
}
.video-card .video-link:hover { background: rgba(239,68,68,0.1); }

/* Flashcards Grid */
.flashcards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem;
}
.flashcard {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  transition: all .2s ease;
}
.flashcard:hover { border-color: var(--secondary); }
.flashcard-topic { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--primary-light); margin-bottom: .5rem; }
.flashcard-concept { font-size: 1rem; font-weight: 700; margin-bottom: .75rem; }
.flashcard-detail { font-family: var(--font-mono); font-size: .82rem; color: var(--secondary); background: rgba(0,0,0,0.3); padding: .75rem; border-radius: var(--radius-sm); border-left: 3px solid var(--secondary); }

/* MCQ Practice List */
.mcq-list { display: flex; flex-direction: column; gap: .75rem; }
.mcq-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; cursor: pointer;
  transition: all .2s ease;
}
.mcq-item:hover { border-color: var(--border-light); }
.mcq-item .mcq-q { font-weight: 500; font-size: .9rem; margin-bottom: .5rem; }
.mcq-item .mcq-meta { font-size: .75rem; color: var(--text-dim); display: flex; gap: 1rem; }

/* Past Papers */
.past-paper-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.past-paper-card h3 { font-size: 1.05rem; font-weight: 600; }
.past-paper-card p { font-size: .82rem; color: var(--text-muted); }

/* Progress Tracker */
.progress-chapter {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: .75rem;
}
.progress-chapter-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.progress-chapter-header h4 { font-size: .9rem; font-weight: 600; }
.progress-chapter-header .progress-pct { font-size: .85rem; font-weight: 700; color: var(--primary-light); }
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 3px; transition: width .5s ease; }

/* Quiz Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 300; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); animation: fadeIn .2s ease;
}
.modal {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); max-height: 90vh; overflow-y: auto;
  animation: slideUp .3s ease;
}
.quiz-modal { width: min(95vw, 900px); display: flex; flex-direction: column; }
.results-modal { width: min(95vw, 700px); padding: 2rem; }
.image-modal { width: min(95vw, 800px); padding: 1rem; background: transparent; border: none; text-align: center; }
.image-modal img { max-width: 100%; height: auto; border-radius: var(--radius); }

.quiz-modal-header {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
}
.quiz-modal-info { flex: 1; }
.quiz-modal-info h2 { font-size: 1rem; font-weight: 700; }
.quiz-badges { display: flex; gap: .4rem; margin-top: .2rem; }
.badge { font-size: .65rem; font-weight: 700; padding: .15rem .5rem; border-radius: 4px; }
.badge-primary { background: rgba(99,102,241,0.2); color: var(--primary-light); }
.badge-secondary { background: rgba(6,182,212,0.15); color: var(--secondary); }
.quiz-timer { display: flex; align-items: center; gap: .4rem; font-family: var(--font-mono); font-size: 1rem; font-weight: 700; color: var(--warning); }
.modal-close-btn { color: var(--text-muted); }
.quiz-progress-track { height: 4px; background: var(--border); }
.quiz-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); transition: width .3s ease; }
.quiz-modal-body {
  display: grid; grid-template-columns: 1fr 180px; gap: 1rem;
  padding: 1.5rem; flex: 1; min-height: 300px;
}
@media (max-width: 700px) {
  .quiz-modal-body { grid-template-columns: 1fr; }
  .quiz-palette { order: -1; max-height: 120px; overflow-y: auto; }
}
.quiz-question-area { display: flex; flex-direction: column; }
.question-number { font-size: .75rem; font-weight: 600; color: var(--text-dim); margin-bottom: .5rem; }
.question-text { font-size: 1.05rem; font-weight: 500; margin-bottom: 1.25rem; line-height: 1.6; }
.options-list { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.option-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .8rem 1rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all .15s ease; font-size: .9rem;
}
.option-item:hover { border-color: var(--border-light); background: rgba(255,255,255,0.03); }
.option-item.selected { border-color: var(--primary); background: rgba(99,102,241,0.1); color: var(--primary-light); }
.option-item.correct { border-color: var(--success); background: rgba(16,185,129,0.1); color: var(--success); }
.option-item.wrong { border-color: var(--danger); background: rgba(239,68,68,0.1); color: var(--danger); }
.option-letter {
  width: 1.75rem; height: 1.75rem; display: flex; align-items: center; justify-content: center;
  border-radius: 4px; font-weight: 700; font-size: .8rem;
  background: rgba(255,255,255,0.05); color: var(--text-muted); flex-shrink: 0;
}
.option-item.selected .option-letter { background: var(--primary); color: #fff; }
.option-item.correct .option-letter { background: var(--success); color: #fff; }
.option-item.wrong .option-letter { background: var(--danger); color: #fff; }
.explanation-box {
  background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius-sm); padding: 1rem; margin-top: .5rem;
}
.explanation-header { font-size: .8rem; font-weight: 700; color: var(--success); margin-bottom: .35rem; }
.explanation-text { font-size: .85rem; color: var(--text-muted); line-height: 1.6; }

/* Quiz Palette */
.quiz-palette { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem; }
.palette-header { display: flex; justify-content: space-between; font-size: .75rem; font-weight: 600; margin-bottom: .5rem; color: var(--text-dim); }
.palette-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: .3rem; }
.palette-item {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 4px; font-size: .7rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: rgba(0,0,0,0.3); color: var(--text-muted); transition: all .1s ease;
}
.palette-item.current { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.palette-item.answered { background: var(--success); color: #fff; border-color: var(--success); }
.palette-legend { display: flex; gap: .5rem; margin-top: .5rem; font-size: .65rem; color: var(--text-dim); flex-wrap: wrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .2rem; }
.dot-answered { background: var(--success); }
.dot-current { background: var(--primary); }
.dot-unanswered { background: var(--border); }

.quiz-modal-footer {
  display: flex; align-items: center; gap: .5rem;
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
}
.quiz-modal-footer .btn:first-child { margin-right: auto; }
.quiz-modal-footer .btn:last-child { margin-left: auto; }

/* Results Modal */
.results-header { text-align: center; margin-bottom: 1.5rem; }
.results-icon { font-size: 3rem; margin-bottom: .5rem; }
.results-header h2 { font-size: 1.5rem; font-weight: 800; }
.results-header p { color: var(--text-muted); }
.results-score { display: flex; align-items: center; gap: 2rem; justify-content: center; margin-bottom: 1.5rem; flex-wrap: wrap; }
.score-circle-big {
  width: 120px; height: 120px; border-radius: 50%;
  border: 6px solid var(--primary); display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.3);
}
.score-big { font-size: 1.5rem; font-weight: 800; }
.score-details { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.score-detail-item { background: var(--bg-card); padding: .75rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.score-detail-item span { display: block; font-size: .7rem; color: var(--text-dim); }
.score-detail-item strong { font-size: 1rem; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.results-review { max-height: 300px; overflow-y: auto; margin-bottom: 1rem; }
.review-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: .5rem; font-size: .82rem; }
.review-item.correct { border-left: 3px solid var(--success); }
.review-item.wrong { border-left: 3px solid var(--danger); }
.review-item .r-q { font-weight: 500; margin-bottom: .25rem; }
.review-item .r-a { font-size: .78rem; color: var(--text-muted); }
.results-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Responsive */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .hamburger { display: block; }
}
@media (max-width: 640px) {
  .content-area { padding: 1rem; }
  .dashboard-hero { padding: 2rem 1rem; }
  .dashboard-hero h1 { font-size: 1.5rem; }
  .chapters-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .chapter-tabs { gap: .15rem; }
  .chapter-tab { padding: .4rem .6rem; font-size: .75rem; }
  .quiz-modal-body { grid-template-columns: 1fr; }
  .quiz-palette { max-height: 100px; overflow-y: auto; }
  .topbar { padding: .65rem 1rem; }
  .topbar-title h1 { font-size: 1rem; }
  .results-score { flex-direction: column; }
  .video-grid { grid-template-columns: 1fr; }
  .flashcards-grid { grid-template-columns: 1fr; }
  .score-details { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}