:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #dbeafe;
  --green: #10b981;
  --green-light: #d1fae5;
  --orange: #f59e0b;
  --orange-light: #fef3c7;
  --red: #ef4444;
  --red-light: #fee2e2;
  --purple: #8b5cf6;
  --purple-light: #ede9fe;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.08), 0 10px 10px -5px rgba(0,0,0,.03);
  /* Fixed tokens for surfaces that are intentionally always dark (sidebar, toasts,
     the landing page's dark section) regardless of light/dark theme. */
  --ink: #111827;
  --paper: #ffffff;
  --paper-muted: #9ca3af;
}
[data-theme="dark"] {
  --white: #1a1f2e;
  --gray-50: #12151f;
  --gray-100: #1e2433;
  --gray-200: #2a3142;
  --gray-300: #3a4257;
  --gray-400: #7c8493;
  --gray-500: #9aa1ae;
  --gray-600: #b0b8c4;
  --gray-700: #ccd2db;
  --gray-800: #e2e6ec;
  --gray-900: #f3f4f6;
  /* *-light tint vars intentionally NOT overridden here — they pair with hardcoded
     dark text colors (e.g. #065f46) throughout the app, so keeping them light
     preserves contrast; they just read as pastel chips against the dark page. */
  --shadow: 0 4px 6px -1px rgba(0,0,0,.4), 0 2px 4px -1px rgba(0,0,0,.3);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -2px rgba(0,0,0,.3);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.5), 0 10px 10px -5px rgba(0,0,0,.3);
}
* { margin:0; padding:0; box-sizing:border-box; }
html, body { overflow-x:hidden; max-width:100%; }
body { font-family:'DM Sans',sans-serif; background:var(--gray-50); color:var(--gray-900); transition:background .2s,color .2s; }

/* ── PAGES ── */
.page { display:none; min-height:100vh; }
.page.active { display:block; }
#dashboard.active { display:flex; }

/* ── LANDING ── */
#landing { background:var(--gray-50); flex-direction:column; align-items:center; justify-content:center; min-height:100vh; gap:16px; }
#landing.active { display:flex; }
.auth-forgot { text-align:right; margin:-10px 0 18px; font-size:13px; }
.auth-forgot a { color:var(--blue); cursor:pointer; }
.auth-about-link { text-align:center; }
.auth-about-link a { color:var(--gray-400); font-size:13px; cursor:pointer; }
.auth-about-link a:hover { color:var(--gray-600); }
.land-nav {
  display:flex; align-items:center; justify-content:space-between;
  padding:20px 64px; border-bottom:1px solid var(--gray-200);
  position:sticky; top:0; background:var(--white); z-index:100;
}
.land-logo { font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:24px; color:var(--blue); line-height:1.2; letter-spacing:-.02em; }
.land-tagline { font-size:12px; color:var(--gray-500); font-weight:500; margin-top:2px; }
.land-nav-links { display:flex; gap:28px; align-items:center; }
.land-nav-links a {
  text-decoration:none; color:var(--gray-600); font-weight:500;
  font-size:15px; transition:.2s;
}
.land-nav-links a:hover { color:var(--blue); }
.btn { display:inline-flex; align-items:center; gap:8px; padding:10px 22px; border-radius:var(--radius); font-family:'DM Sans',sans-serif; font-weight:600; font-size:14px; cursor:pointer; border:none; transition:.2s; }
.btn:disabled { opacity:.4; cursor:not-allowed; pointer-events:none; }
.btn-primary { background:var(--blue); color:#fff; }
.btn-primary:hover { background:var(--blue-dark); transform:translateY(-1px); }
.btn-outline { background:transparent; color:var(--blue); border:2px solid var(--blue); }
.btn-outline:hover { background:var(--blue-light); }
.btn-lg { padding:16px 36px; font-size:16px; border-radius:14px; }

.hero {
  display:flex; align-items:center; justify-content:space-between;
  padding:90px 64px 80px; max-width:1200px; margin:0 auto;
}
.hero-left { max-width:540px; }
.hero h1 {
  font-family:'DM Serif Display',serif; font-size:58px; line-height:1.12;
  color:var(--gray-900); margin-bottom:22px;
}
.hero h1 span { color:var(--blue); }
.hero p { font-size:18px; line-height:1.7; color:var(--gray-600); margin-bottom:36px; }
.hero-cta { display:flex; gap:14px; flex-wrap:wrap; }

.hero-card {
  background:var(--white); border-radius:var(--radius-lg); padding:32px;
  box-shadow:var(--shadow-lg); border:1px solid var(--gray-100);
  width:340px; flex-shrink:0;
}
.hero-card-head { display:flex; align-items:center; gap:12px; margin-bottom:24px; }
.avatar { width:40px; height:40px; border-radius:99px; background:var(--blue-light); display:flex; align-items:center; justify-content:center; font-size:18px; }
.hero-card-head strong { font-size:15px; display:block; }
.hero-card-head span { font-size:12px; color:var(--gray-500); }
.chat-bubble {
  padding:12px 16px; border-radius:12px; font-size:14px; line-height:1.6;
  margin-bottom:10px; max-width:90%;
}
.chat-bubble.ai { background:var(--blue-light); color:var(--blue-dark); border-radius:4px 12px 12px 12px; }
.chat-bubble.user { background:var(--gray-100); margin-left:auto; border-radius:12px 4px 12px 12px; }
.chat-input-demo {
  display:flex; gap:8px; align-items:center; margin-top:16px;
  background:var(--gray-50); border-radius:10px; padding:10px 14px; border:1px solid var(--gray-200);
  font-size:13px; color:var(--gray-400);
}

.stats-row {
  display:flex; justify-content:center; gap:48px; padding:50px 64px;
  background:var(--gray-50); border-top:1px solid var(--gray-200);
}
.stat-item { text-align:center; }
.stat-item strong { font-family:'DM Serif Display',serif; font-size:36px; color:var(--blue); display:block; }
.stat-item span { font-size:14px; color:var(--gray-500); }

.features-section { padding:80px 64px; max-width:1200px; margin:0 auto; }
.section-label { font-size:13px; font-weight:600; color:var(--blue); text-transform:uppercase; letter-spacing:.08em; margin-bottom:12px; }
.section-title { font-family:'DM Serif Display',serif; font-size:40px; color:var(--gray-900); margin-bottom:16px; }
.section-sub { font-size:16px; color:var(--gray-500); max-width:480px; line-height:1.7; margin-bottom:52px; }

.features-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:24px; }
.feat-card {
  background:var(--white); border-radius:var(--radius-lg); padding:28px;
  border:1px solid var(--gray-200); transition:.25s;
}
.feat-card:hover { border-color:var(--blue); box-shadow:var(--shadow-md); transform:translateY(-4px); }
.feat-icon { font-size:28px; margin-bottom:16px; }
.feat-card h3 { font-size:17px; font-weight:600; margin-bottom:8px; }
.feat-card p { font-size:14px; color:var(--gray-500); line-height:1.7; }

.land-footer {
  background:var(--ink); color:var(--paper-muted); text-align:center;
  padding:40px; font-size:14px; border-top:1px solid rgba(255,255,255,.07);
}
.land-footer span { color:var(--blue); font-weight:600; }

/* ── AUTH ── */
#auth { background:var(--gray-50); align-items:center; justify-content:center; min-height:100vh; }
#auth.active { display:flex; }
.auth-card {
  background:var(--white); border-radius:var(--radius-lg); padding:48px 40px;
  width:420px; box-shadow:var(--shadow-lg); border:1px solid var(--gray-200);
}
.auth-logo { font-family:'Space Grotesk',sans-serif; font-weight:700; letter-spacing:-.02em; font-size:22px; color:var(--blue); }
.auth-tagline { font-size:13px; color:var(--gray-500); font-weight:500; }
.landing-brand { text-align:center; }
.landing-brand .auth-logo { font-size:28px; }
.student-count-badge { margin-top:14px; font-size:13px; color:var(--gray-500); }
.student-count-badge strong { color:var(--blue); font-weight:700; }
.auth-card h2 { font-size:22px; font-weight:700; margin-bottom:6px; }
.auth-card p { font-size:14px; color:var(--gray-500); margin-bottom:32px; }
.role-tabs { display:flex; background:var(--gray-100); border-radius:10px; padding:4px; margin-bottom:28px; }
.role-tab {
  flex:1; padding:9px; border-radius:8px; border:none; background:transparent;
  font-family:'DM Sans',sans-serif; font-size:13px; font-weight:500;
  color:var(--gray-500); cursor:pointer; transition:.2s;
}
.role-tab.active { background:var(--white); color:var(--blue); font-weight:600; box-shadow:var(--shadow); }
.form-group { margin-bottom:18px; }
.form-group label { display:block; font-size:13px; font-weight:600; color:var(--gray-700); margin-bottom:6px; }
.form-group input, .form-group select {
  width:100%; padding:11px 14px; border:1.5px solid var(--gray-200);
  border-radius:var(--radius); font-family:'DM Sans',sans-serif; font-size:14px;
  color:var(--gray-800); background:var(--white); transition:.2s; outline:none;
}
.form-group input:focus, .form-group select:focus { border-color:var(--blue); box-shadow:0 0 0 3px rgba(37,99,235,.1); }
.auth-submit {
  width:100%; padding:14px; background:var(--blue); color:#fff;
  border:none; border-radius:var(--radius); font-family:'DM Sans',sans-serif;
  font-size:15px; font-weight:600; cursor:pointer; margin-top:8px; transition:.2s;
}
.auth-submit:hover { background:var(--blue-dark); }
.auth-switch { text-align:center; margin-top:20px; font-size:14px; color:var(--gray-500); }
.auth-switch a { color:var(--blue); font-weight:600; cursor:pointer; }
.auth-back { display:inline-flex; align-items:center; gap:6px; color:var(--gray-500); font-size:13px; cursor:pointer; margin-bottom:20px; }

/* ── DASHBOARD SHELL ── */
#dashboard { min-height:100vh; }
.sidebar {
  width:240px; background:var(--ink); padding:28px 0; display:flex;
  flex-direction:column; position:fixed; top:0; left:0; height:100vh; z-index:50;
}
.sidebar-logo { font-family:'Space Grotesk',sans-serif; font-weight:700; letter-spacing:-.02em; font-size:20px; color:var(--paper); padding:0 24px 28px; border-bottom:1px solid rgba(255,255,255,.08); }
.sidebar-nav { flex:1; padding:20px 12px; display:flex; flex-direction:column; gap:4px; }
.sidebar-item {
  display:flex; align-items:center; gap:12px; padding:11px 14px;
  border-radius:10px; color:var(--paper-muted); font-size:14px; font-weight:500;
  cursor:pointer; transition:.2s; text-decoration:none;
}
.sidebar-item:hover, .sidebar-item.active { background:rgba(255,255,255,.08); color:var(--paper); }
.sidebar-item.active { background:var(--blue); color:var(--paper); }
.sidebar-item .icon { font-size:18px; width:22px; text-align:center; }
.sidebar-bottom { padding:16px 12px; border-top:1px solid rgba(255,255,255,.08); }

.main-area { margin-left:240px; flex:1; }
.topbar {
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 36px; background:var(--white); border-bottom:1px solid var(--gray-200);
  position:sticky; top:0; z-index:40;
}
.topbar h1 { font-size:20px; font-weight:700; }
.topbar-right { display:flex; align-items:center; gap:16px; }
.mobile-menu-btn {
  display:none; width:36px; height:36px; border-radius:var(--radius); border:1px solid var(--gray-200);
  background:var(--gray-50); color:var(--gray-700); cursor:pointer; font-size:18px; margin-right:14px; flex-shrink:0;
}
.sidebar-backdrop { display:none; }
.theme-toggle {
  width:36px; height:36px; border-radius:99px; border:1px solid var(--gray-200);
  background:var(--gray-50); cursor:pointer; font-size:16px; display:flex;
  align-items:center; justify-content:center; transition:.2s;
}
.theme-toggle:hover { background:var(--gray-100); }
.user-chip {
  display:flex; align-items:center; gap:10px; background:var(--gray-50);
  border:1px solid var(--gray-200); padding:7px 14px; border-radius:99px;
  font-size:13px; font-weight:500; cursor:pointer;
}
.user-chip .avatar-sm { width:28px; height:28px; border-radius:99px; background:var(--blue-light); display:flex; align-items:center; justify-content:center; font-size:13px; }

.dash-panel { display:none; padding:36px; }
.dash-panel.active { display:block; }

/* ── HOME PANEL ── */
.greeting { margin-bottom:32px; }
.greeting h2 { font-size:26px; font-weight:700; margin-bottom:4px; }
.greeting p { font-size:15px; color:var(--gray-500); }
.home-banner {
  padding:14px 20px; border-radius:var(--radius); font-size:14px; font-weight:500;
  margin-bottom:14px; cursor:default;
}
.home-banner.risk { background:var(--orange-light); color:#92400e; }
.home-banner.countdown { background:var(--blue-light); color:var(--blue-dark); cursor:pointer; }
.home-banner.countdown-prompt { background:var(--gray-100); color:var(--gray-600); cursor:pointer; }
.kpi-row { display:grid; grid-template-columns:repeat(4,1fr); gap:20px; margin-bottom:32px; }
.kpi {
  background:var(--white); border-radius:var(--radius-lg); padding:24px;
  border:1px solid var(--gray-200); box-shadow:var(--shadow);
}
.kpi-label { font-size:12px; font-weight:600; color:var(--gray-500); text-transform:uppercase; letter-spacing:.05em; margin-bottom:10px; }
.kpi-value { font-size:32px; font-weight:700; color:var(--gray-900); margin-bottom:4px; }
.kpi-sub { font-size:12px; color:var(--green); font-weight:500; }
.two-col { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
.panel-card {
  background:var(--white); border-radius:var(--radius-lg); padding:24px;
  border:1px solid var(--gray-200); box-shadow:var(--shadow);
}
.panel-card h3 { font-size:16px; font-weight:600; margin-bottom:18px; }
.activity-item {
  display:flex; align-items:center; gap:14px; padding:10px 0;
  border-bottom:1px solid var(--gray-100);
}
.activity-item:last-child { border-bottom:none; }
.act-icon { width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }
.act-info { flex:1; }
.act-info strong { font-size:14px; display:block; }
.act-info span { font-size:12px; color:var(--gray-500); }
.act-score { font-size:14px; font-weight:600; color:var(--blue); }
.progress-bar-wrap { margin-bottom:14px; }
.progress-label { display:flex; justify-content:space-between; font-size:13px; font-weight:500; margin-bottom:6px; }
.progress-track { height:8px; background:var(--gray-100); border-radius:99px; overflow:hidden; }
.progress-fill { height:100%; border-radius:99px; transition:.6s; }

/* ── ACHIEVEMENTS ── */
.badges-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:14px; }
.badge-item {
  border:1.5px solid var(--gray-200); border-radius:var(--radius); padding:16px 14px;
  text-align:center; transition:.2s;
}
.badge-item.earned { border-color:var(--blue-light); background:var(--blue-light); }
.badge-item.locked { opacity:.45; filter:grayscale(1); }
.badge-item .badge-icon { font-size:30px; margin-bottom:8px; }
.badge-item .badge-label { font-size:13px; font-weight:700; margin-bottom:4px; }
.badge-item .badge-desc { font-size:11px; color:var(--gray-500); line-height:1.5; }

/* ── PRACTICE PANEL ── */
.subject-picker { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:28px; }
.subj-btn {
  padding:9px 18px; border-radius:99px; border:2px solid var(--gray-200);
  background:var(--white); color:var(--gray-700); font-family:'DM Sans',sans-serif; font-size:13px;
  font-weight:600; cursor:pointer; transition:.2s;
}
.subj-btn.active, .subj-btn:hover { border-color:var(--blue); color:var(--blue); background:var(--blue-light); }
.question-card {
  background:var(--white); border-radius:var(--radius-lg); padding:36px;
  border:1px solid var(--gray-200); box-shadow:var(--shadow); max-width:720px;
}
.q-meta { display:flex; gap:10px; align-items:center; margin-bottom:20px; }
.q-badge {
  padding:4px 12px; border-radius:99px; font-size:12px; font-weight:600;
}
.q-badge.math { background:var(--blue-light); color:var(--blue); }
.q-badge.science { background:var(--green-light); color:var(--green); }
.q-badge.logic { background:var(--purple-light); color:var(--purple); }
.q-badge.reading { background:var(--orange-light); color:var(--orange); }
.q-badge.vocab { background:#fce7f3; color:#db2777; }
.q-badge.tj { background:#fef3c7; color:#92400e; }
.q-badge.acl { background:#dbeafe; color:var(--blue); }
.q-number { font-size:13px; color:var(--gray-400); font-weight:500; }
.q-text { font-size:18px; font-weight:600; line-height:1.6; margin-bottom:28px; color:var(--gray-900); white-space:pre-line; }
.options { display:flex; flex-direction:column; gap:12px; margin-bottom:28px; }
.option-btn {
  display:flex; align-items:center; gap:14px; padding:16px 20px;
  border:2px solid var(--gray-200); border-radius:var(--radius); background:var(--white);
  color:var(--gray-900);
  font-family:'DM Sans',sans-serif; font-size:15px; cursor:pointer; transition:.2s;
  text-align:left;
}
.option-btn:hover { border-color:var(--blue); background:var(--blue-light); }
.option-btn.correct { border-color:var(--green); background:var(--green-light); color:#065f46; }
.option-btn.wrong { border-color:var(--red); background:var(--red-light); color:#7f1d1d; }
.option-btn.selected { border-color:var(--blue); background:var(--blue-light); }
.option-letter {
  width:30px; height:30px; border-radius:99px; background:var(--gray-100);
  display:flex; align-items:center; justify-content:center; font-size:13px;
  font-weight:700; flex-shrink:0;
}
.q-actions { display:flex; gap:12px; }
.feedback-box {
  margin-top:20px; padding:18px 20px; border-radius:var(--radius);
  font-size:14px; line-height:1.7; display:none;
}
.feedback-box.correct { background:var(--green-light); color:#065f46; border:1px solid #a7f3d0; }
.feedback-box.wrong { background:var(--red-light); color:#7f1d1d; border:1px solid #fca5a5; }
.feedback-box.active { display:block; }
.feedback-actions { display:flex; gap:12px; margin-top:16px; }

/* ── ASK TUTOR DRAWER ── */
.tutor-drawer {
  position:fixed; top:0; right:0; width:380px; max-width:100vw; height:100vh;
  background:var(--white); border-left:1px solid var(--gray-200); box-shadow:var(--shadow-lg);
  display:flex; flex-direction:column; transform:translateX(100%); transition:transform .25s ease;
  z-index:300;
}
.tutor-drawer.open { transform:translateX(0); }
.tutor-drawer-header {
  padding:18px 20px; border-bottom:1px solid var(--gray-200);
  display:flex; align-items:center; justify-content:space-between;
}
.tutor-drawer-header h3 { font-size:15px; }
.tutor-drawer-close {
  background:none; border:none; cursor:pointer; font-size:18px; color:var(--gray-500);
  width:32px; height:32px; border-radius:99px; transition:.2s;
}
.tutor-drawer-close:hover { background:var(--gray-100); color:var(--gray-900); }

/* ── AI TUTOR ── */
.tutor-wrap { display:grid; grid-template-columns:1fr 360px; gap:24px; height:calc(100vh - 90px); }
.chat-area {
  background:var(--white); border-radius:var(--radius-lg); border:1px solid var(--gray-200);
  display:flex; flex-direction:column; overflow:hidden;
}
.chat-header { padding:18px 24px; border-bottom:1px solid var(--gray-200); display:flex; align-items:center; gap:12px; }
.chat-header .status { width:8px; height:8px; border-radius:99px; background:var(--green); }
.chat-header strong { font-size:15px; }
.chat-header span { font-size:12px; color:var(--gray-500); }
.chat-messages { flex:1; overflow-y:auto; padding:24px; display:flex; flex-direction:column; gap:16px; }
.msg { display:flex; gap:12px; align-items:flex-start; }
.msg.user { flex-direction:row-reverse; }
.msg-avatar { width:34px; height:34px; border-radius:99px; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:16px; }
.msg.ai .msg-avatar { background:var(--blue-light); }
.msg.user .msg-avatar { background:var(--gray-100); }
.msg-body { max-width:75%; }
.msg-bubble {
  padding:12px 16px; border-radius:12px; font-size:14px; line-height:1.7;
}
.msg.ai .msg-bubble { background:var(--blue-light); color:var(--gray-800); border-radius:4px 12px 12px 12px; }
.msg.user .msg-bubble { background:var(--blue); color:#fff; border-radius:12px 4px 12px 12px; }
.msg-time { font-size:11px; color:var(--gray-400); margin-top:4px; }
.msg.user .msg-time { text-align:right; }
.chat-input-bar {
  padding:16px 20px; border-top:1px solid var(--gray-200);
  display:flex; gap:10px; align-items:flex-end;
}
.chat-input {
  flex:1; padding:12px 16px; border:1.5px solid var(--gray-200);
  border-radius:var(--radius); font-family:'DM Sans',sans-serif; font-size:14px;
  resize:none; outline:none; transition:.2s; min-height:48px; max-height:120px;
}
.chat-input:focus { border-color:var(--blue); }
.send-btn {
  width:44px; height:44px; border-radius:var(--radius); background:var(--blue);
  border:none; cursor:pointer; display:flex; align-items:center; justify-content:center;
  color:white; font-size:18px; flex-shrink:0; transition:.2s;
}
.send-btn:hover { background:var(--blue-dark); }

.tutor-sidebar { display:flex; flex-direction:column; gap:16px; overflow-y:auto; }
.quick-topics .topic-pill {
  display:inline-flex; padding:8px 14px; border-radius:99px; font-size:12px;
  font-weight:600; background:var(--gray-100); color:var(--gray-600);
  cursor:pointer; margin:4px; transition:.2s; border:none; font-family:'DM Sans',sans-serif;
}
.quick-topics .topic-pill:hover { background:var(--blue-light); color:var(--blue); }
.typing-indicator { display:flex; gap:4px; align-items:center; padding:4px 0; }
.dot { width:7px; height:7px; border-radius:99px; background:var(--blue); animation:bounce .8s infinite; }
.dot:nth-child(2) { animation-delay:.15s; }
.dot:nth-child(3) { animation-delay:.3s; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }

/* ── TESTS PANEL ── */
.tests-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; margin-bottom:32px; }
.test-card {
  background:var(--white); border-radius:var(--radius-lg); padding:28px;
  border:1px solid var(--gray-200); box-shadow:var(--shadow); cursor:pointer; transition:.25s;
}
.test-card:hover { border-color:var(--blue); transform:translateY(-3px); box-shadow:var(--shadow-md); }
.test-card .test-icon { font-size:36px; margin-bottom:16px; }
.test-card h3 { font-size:16px; font-weight:600; margin-bottom:6px; }
.test-card p { font-size:13px; color:var(--gray-500); margin-bottom:16px; line-height:1.6; }
.test-meta { display:flex; gap:12px; flex-wrap:wrap; }
.test-tag {
  padding:4px 10px; border-radius:99px; font-size:11px; font-weight:600;
  background:var(--gray-100); color:var(--gray-600);
}

/* ── ACTIVE QUIZ ── */
.quiz-header {
  display:flex; align-items:center; justify-content:space-between; margin-bottom:28px;
}
.quiz-progress { flex:1; max-width:320px; }
.quiz-timer {
  display:flex; align-items:center; gap:8px; font-size:18px; font-weight:700;
  color:var(--blue);
}
.quiz-timer.warning { color:var(--red); }
.quiz-container { max-width:760px; }

/* ── PROGRESS PANEL ── */
.progress-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:24px; margin-bottom:28px; }
.score-ring-wrap { display:flex; align-items:center; justify-content:center; flex-direction:column; padding:24px 0; }
.score-ring { position:relative; width:140px; height:140px; }
.score-ring svg { transform:rotate(-90deg); }
.score-ring .ring-bg { fill:none; stroke:var(--gray-100); stroke-width:12; }
.score-ring .ring-fill { fill:none; stroke:var(--blue); stroke-width:12; stroke-linecap:round; transition:1.2s; stroke-dasharray:380; stroke-dashoffset:380; }
.score-number { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; flex-direction:column; }
.score-number strong { font-size:30px; font-weight:700; }
.score-number span { font-size:12px; color:var(--gray-500); }
.heatmap { display:grid; grid-template-columns:repeat(7,1fr); gap:4px; }
.heat-cell {
  aspect-ratio:1; border-radius:4px; background:var(--gray-100);
  transition:.3s;
}
.heat-cell.l1 { background:#bfdbfe; }
.heat-cell.l2 { background:#93c5fd; }
.heat-cell.l3 { background:#60a5fa; }
.heat-cell.l4 { background:#3b82f6; }
.heat-cell.l5 { background:#1d4ed8; }

/* ── LEADERBOARD ── */
.lb-row {
  display:flex; align-items:center; gap:16px; padding:14px 20px;
  border-radius:var(--radius); margin-bottom:8px; background:var(--white);
  border:1px solid var(--gray-200); transition:.2s;
}
.lb-row:hover { border-color:var(--blue-light); }
.lb-row.you { background:var(--blue-light); border-color:var(--blue); }
.lb-rank { width:28px; text-align:center; font-weight:700; font-size:15px; color:var(--gray-400); }
.lb-rank.gold { color:#f59e0b; font-size:20px; }
.lb-rank.silver { color:#9ca3af; font-size:18px; }
.lb-rank.bronze { color:#92400e; font-size:18px; }
.lb-name { flex:1; font-size:14px; font-weight:600; }
.lb-school { font-size:12px; color:var(--gray-500); }
.lb-score { font-size:15px; font-weight:700; color:var(--blue); }
.lb-badge { font-size:18px; }

/* TOASTS */
.toast {
  position:fixed; bottom:28px; right:28px; background:var(--ink); color:var(--paper);
  padding:14px 22px; border-radius:var(--radius); font-size:14px; font-weight:500;
  box-shadow:var(--shadow-lg); z-index:999; transform:translateY(80px); opacity:0;
  transition:transform .3s, opacity .3s; max-width:340px;
}
.toast.show { transform:translateY(0); opacity:1; }
.toast.success { background:#065f46; }
.toast.error { background:#7f1d1d; }

/* CELEBRATIONS */
.celebration-toast {
  position:fixed; top:28px; left:50%; transform:translate(-50%,-120%);
  background:var(--white); border:1px solid var(--gray-200); box-shadow:var(--shadow-lg);
  border-radius:var(--radius-lg); padding:16px 24px; display:flex; align-items:center; gap:14px;
  z-index:1000; opacity:0; transition:transform .4s ease, opacity .4s ease;
}
.celebration-toast.show { transform:translate(-50%,0); opacity:1; }
.celebration-icon { font-size:36px; }
.celebration-label { color:var(--blue); font-weight:700; font-size:16px; }
.confetti-piece {
  position:fixed; top:-20px; width:9px; height:9px; z-index:999;
  animation:confetti-fall linear forwards; pointer-events:none;
}
@keyframes confetti-fall {
  to { transform:translateY(110vh) rotate(540deg); opacity:.3; }
}

/* LOADING */
.spinner { width:20px; height:20px; border:2px solid rgba(255,255,255,.3); border-top-color:white; border-radius:99px; animation:spin .7s linear infinite; display:inline-block; }
@keyframes spin { to{transform:rotate(360deg)} }

/* RESPONSIVE */
@media(max-width:1100px) {
  .kpi-row { grid-template-columns:repeat(2,1fr); }
  .features-grid { grid-template-columns:repeat(2,1fr); }
  .tests-grid { grid-template-columns:repeat(2,1fr); }
  .tutor-wrap { grid-template-columns:1fr; height:auto; }
  .tutor-sidebar { display:none; }
}
@media(max-width:768px) {
  .hero { flex-direction:column; padding:48px 24px; text-align:center; }
  .hero h1 { font-size:38px; }
  .hero-card { width:100%; }
  .hero-cta { justify-content:center; }
  .land-nav { flex-direction:column; align-items:flex-start; gap:14px; padding:16px 24px; }
  .land-nav-links { width:100%; justify-content:space-between; gap:12px; }
  .features-section, .stats-row { padding:48px 24px; }
  .features-grid { grid-template-columns:1fr; }
  .stats-row { flex-wrap:wrap; gap:28px; }
  .stats-row .stat-item { flex:1 1 40%; }

  /* Dashboard sidebar becomes an off-canvas drawer, opened via the hamburger button */
  .sidebar { transform:translateX(-240px); transition:transform .25s ease; z-index:300; }
  .sidebar.open { transform:translateX(0); }
  .sidebar-backdrop.show { display:block; position:fixed; inset:0; background:rgba(17,24,39,.6); z-index:250; }
  .mobile-menu-btn { display:block; }
  .main-area { margin-left:0; }
  .kpi-row { grid-template-columns:1fr 1fr; }
  .progress-grid { grid-template-columns:1fr; }
  .two-col { grid-template-columns:1fr; }
  .tests-grid { grid-template-columns:1fr; }
  .quiz-header { flex-wrap:wrap; gap:14px; }
  .quiz-progress { max-width:100%; flex-basis:100%; order:1; }
  .quiz-timer { order:2; }
  .quiz-header .btn { order:3; margin-left:0 !important; }
}
