/* StudyOS — Design System */
/* Palette: Deep Navy base + Electric Indigo + signal colors */

:root {
  --bg-void: #07090f;
  --bg-base: #0d1117;
  --bg-surface: #161b27;
  --bg-raised: #1e2638;
  --bg-hover: #242d42;

  --indigo: #4f6ef7;
  --indigo-dim: #3355d4;
  --indigo-glow: rgba(79, 110, 247, 0.2);

  --text-primary: #e8edf5;
  --text-secondary: #8b96b0;
  --text-muted: #4a5568;

  --critical: #ef4444;
  --important: #f97316;
  --moderate: #eab308;
  --mastered: #22c55e;
  --reference: #3b82f6;

  --border: rgba(255,255,255,0.07);
  --border-active: rgba(79,110,247,0.4);

  --radius: 10px;
  --radius-lg: 16px;
  --radius-sm: 6px;

  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
  --nav-width: 220px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-void);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Typography ── */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; }
h1 { font-size: 28px; letter-spacing: -0.5px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); }

code { font-family: var(--font-mono); font-size: 13px; background: var(--bg-raised); padding: 2px 6px; border-radius: 4px; }
cite.source-ref { font-style: normal; font-size: 12px; color: var(--indigo); opacity: 0.8; }

/* ── Layout ── */
.app-shell {
  display: grid;
  grid-template-columns: var(--nav-width) 1fr;
  grid-template-rows: 100vh;
  overflow: hidden;
}

/* ── Sidebar Navigation ── */
.sidebar {
  background: var(--bg-base);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 10;
}

.sidebar-logo {
  padding: 20px 16px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--indigo), #8b5cf6);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-section {
  padding: 12px 8px 4px;
}

.nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  user-select: none;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
}

.nav-item:hover { background: var(--bg-surface); color: var(--text-primary); }
.nav-item.active { background: var(--indigo-glow); color: var(--indigo); }
.nav-item.active .nav-icon { color: var(--indigo); }

.nav-icon { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; }

.nav-badge {
  margin-left: auto;
  background: var(--critical);
  color: white;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
}

.nav-course-item {
  padding: 7px 12px 7px 24px;
  font-size: 13px;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 12px 8px;
  border-top: 1px solid var(--border);
}

/* ── Main Content Area ── */
.main-area {
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-void);
}

.page { display: none; padding: 32px; max-width: 1100px; }
.page.active { display: block; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.page-title { font-size: 26px; letter-spacing: -0.4px; }
.page-subtitle { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }

/* ── Cards ── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.15s;
}

.card:hover { border-color: var(--border-active); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.stat-value { font-size: 32px; font-weight: 700; font-family: var(--font-display); line-height: 1; }
.stat-label { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  font-family: var(--font-body);
  white-space: nowrap;
}

.btn-primary { background: var(--indigo); color: white; }
.btn-primary:hover { background: var(--indigo-dim); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,110,247,0.3); }
.btn-ghost { background: var(--bg-raised); color: var(--text-primary); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-danger { background: var(--critical); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 9px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.form-input, .form-select, .form-textarea {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--indigo); box-shadow: 0 0 0 2px var(--indigo-glow); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b96b0' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

/* ── Tabs ── */
.tabs { display: flex; gap: 2px; background: var(--bg-surface); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 20px; width: fit-content; }
.tab { padding: 7px 16px; border-radius: 5px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text-secondary); transition: all 0.15s; user-select: none; }
.tab.active { background: var(--bg-raised); color: var(--text-primary); }
.tab:hover:not(.active) { color: var(--text-primary); }

/* ── Section Headers ── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 16px; font-weight: 600; }

/* ── Priority Indicators ── */
.importance-critical { color: var(--critical); padding: 4px 0; }
.importance-important { color: var(--important); padding: 4px 0; }
.importance-moderate { color: var(--moderate); padding: 4px 0; }
.importance-mastered { color: var(--mastered); padding: 4px 0; }

.priority-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-critical { background: var(--critical); }
.dot-important { background: var(--important); }
.dot-moderate { background: var(--moderate); }
.dot-mastered { background: var(--mastered); }
.dot-reference { background: var(--reference); }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-indigo { background: var(--indigo-glow); color: var(--indigo); border: 1px solid rgba(79,110,247,0.3); }
.badge-green { background: rgba(34,197,94,0.1); color: var(--mastered); border: 1px solid rgba(34,197,94,0.2); }
.badge-red { background: rgba(239,68,68,0.1); color: var(--critical); border: 1px solid rgba(239,68,68,0.2); }
.badge-orange { background: rgba(249,115,22,0.1); color: var(--important); border: 1px solid rgba(249,115,22,0.2); }
.badge-yellow { background: rgba(234,179,8,0.1); color: var(--moderate); border: 1px solid rgba(234,179,8,0.2); }
.badge-gray { background: var(--bg-raised); color: var(--text-secondary); border: 1px solid var(--border); }

/* ── Content Area ── */
.content-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.rendered-content { line-height: 1.8; }
.rendered-content h1, .rendered-content h2, .rendered-content h3, .rendered-content h4 { margin: 20px 0 8px; }
.rendered-content h1:first-child, .rendered-content h2:first-child { margin-top: 0; }
.rendered-content p { margin-bottom: 12px; }
.rendered-content ul.md-list { padding-left: 20px; margin-bottom: 12px; }
.rendered-content .md-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.rendered-content .md-table td { border: 1px solid var(--border); padding: 8px 12px; font-size: 14px; }
.rendered-content .md-table tr:first-child td { background: var(--bg-raised); font-weight: 600; }
.rendered-content strong { color: var(--text-primary); }
.rendered-content cite.source-ref { display: inline-block; margin-left: 4px; }

/* ── Flashcard UI ── */
.flashcard-viewport {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 0;
}

.flashcard-scene {
  perspective: 1000px;
  width: 600px;
  max-width: 100%;
  height: 320px;
  margin-bottom: 28px;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.flashcard-scene.flipped .flashcard-inner { transform: rotateY(180deg); }

.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}

.flashcard-front {
  background: var(--bg-surface);
  border: 2px solid var(--border-active);
}

.flashcard-back {
  background: linear-gradient(135deg, #1a2340, #0d1b38);
  border: 2px solid rgba(79,110,247,0.4);
  transform: rotateY(180deg);
}

.card-question { font-size: 22px; font-family: var(--font-display); font-weight: 600; }
.card-answer { font-size: 16px; line-height: 1.6; }
.card-hint { font-size: 12px; color: var(--text-muted); margin-top: 12px; }

.rating-buttons { display: flex; gap: 12px; }
.rating-btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s;
}
.rating-again { background: rgba(239,68,68,0.15); color: var(--critical); border: 1px solid rgba(239,68,68,0.3); }
.rating-hard { background: rgba(249,115,22,0.15); color: var(--important); border: 1px solid rgba(249,115,22,0.3); }
.rating-good { background: rgba(79,110,247,0.15); color: var(--indigo); border: 1px solid rgba(79,110,247,0.3); }
.rating-easy { background: rgba(34,197,94,0.15); color: var(--mastered); border: 1px solid rgba(34,197,94,0.3); }
.rating-btn:hover { transform: translateY(-2px); }

.flashcard-meta { display: flex; gap: 12px; color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }
.flashcard-progress { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }

/* ── Study Mode Toggles ── */
.study-mode-bar {
  display: flex;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  margin-bottom: 24px;
}

.mode-btn {
  flex: 1;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  font-family: var(--font-body);
}
.mode-btn.active { background: var(--indigo); color: white; }
.mode-btn:hover:not(.active) { background: var(--bg-raised); color: var(--text-primary); }

/* ── Document List ── */
.doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.doc-item:hover { border-color: var(--border-active); }
.doc-icon { font-size: 20px; width: 32px; text-align: center; flex-shrink: 0; }
.doc-info { flex: 1; min-width: 0; }
.doc-title { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.doc-list { display: flex; flex-direction: column; gap: 8px; }

/* ── Exam UI ── */
.question-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.question-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.q-number { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.q-text { font-size: 16px; font-weight: 500; line-height: 1.5; }
.q-options { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.q-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
}
.q-option:hover { border-color: var(--indigo); background: var(--indigo-glow); }
.q-option.selected { border-color: var(--indigo); background: var(--indigo-glow); color: var(--indigo); }
.q-option.correct { border-color: var(--mastered); background: rgba(34,197,94,0.1); color: var(--mastered); }
.q-option.incorrect { border-color: var(--critical); background: rgba(239,68,68,0.1); color: var(--critical); }
.q-textarea { width: 100%; margin-top: 10px; }
.level-badge { font-size: 11px; padding: 2px 8px; border-radius: 4px; color: white; font-weight: 600; }

/* ── Search ── */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.search-input { flex: 1; }
.search-results { display: flex; flex-direction: column; gap: 10px; }
.search-hit {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.search-hit-source { font-size: 11px; color: var(--indigo); margin-bottom: 6px; }
.search-hit-text { font-size: 14px; line-height: 1.5; }
.search-highlight { background: rgba(234,179,8,0.25); border-radius: 2px; padding: 0 2px; }

/* ── Dashboard ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.study-today-card {
  background: linear-gradient(135deg, var(--bg-surface), #1a2340);
  border: 1px solid var(--border-active);
  border-radius: var(--radius);
  padding: 20px;
}

.today-suggestion {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
  margin-top: 10px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}
.today-suggestion:hover { border-color: var(--indigo); }

/* ── Knowledge Map ── */
.map-container {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  min-height: 300px;
  overflow: auto;
}
.map-container svg { max-width: 100%; }

/* ── Upload Zone ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-surface);
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--indigo); background: var(--indigo-glow); }
.upload-zone-icon { font-size: 40px; display: block; margin-bottom: 12px; }
.upload-zone-text { color: var(--text-secondary); font-size: 14px; }

/* ── Progress Bars ── */
.progress-bar {
  height: 6px;
  background: var(--bg-raised);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s;
}

/* ── Week Selector ── */
.week-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.week-chip {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
  background: var(--bg-surface);
  color: var(--text-secondary);
  transition: all 0.15s;
}
.week-chip:hover, .week-chip.active { border-color: var(--indigo); color: var(--indigo); background: var(--indigo-glow); }

/* ── Mastery Ring ── */
.mastery-rings { display: flex; gap: 8px; }
.mastery-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 14px;
  transform: translateY(8px);
  opacity: 0;
  transition: all 0.2s;
  z-index: 9999;
  max-width: 340px;
  box-shadow: var(--shadow);
}
.toast.show { transform: none; opacity: 1; }
.toast-success { border-color: var(--mastered); }
.toast-error { border-color: var(--critical); }
.toast-info { border-color: var(--indigo); }

/* ── Spinner ── */
.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  backdrop-filter: blur(4px);
}
.spinner-box { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.spinner-ring {
  width: 44px; height: 44px;
  border: 3px solid var(--bg-raised);
  border-top-color: var(--indigo);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-msg { color: var(--text-secondary); font-size: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9997;
  backdrop-filter: blur(4px);
}
.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}
.modal-box h3 { margin-bottom: 10px; }
.modal-box p { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ── Mobile ── */
.menu-toggle { display: none; }

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

  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    width: var(--nav-width);
    transition: left 0.25s;
    z-index: 100;
  }
  .sidebar.open { left: 0; }

  .menu-toggle {
    display: flex;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 101;
    padding: 8px;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 18px;
  }

  .page { padding: 20px 16px; padding-top: 60px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .flashcard-scene { height: 260px; }
  .flashcard-scene { width: 100%; }
  .rating-buttons { flex-wrap: wrap; }
}

/* ── Empty States ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.6; }
.empty-title { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-desc { font-size: 14px; max-width: 320px; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-raised); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-hover); }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Loading Pulse ── */
.pulse { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── Mermaid theme override ── */
.mermaid { background: transparent !important; }

/* ── Drag to resize ── */
.course-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.course-pill:hover { background: var(--bg-surface); color: var(--text-primary); }
.course-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Week Section Folders ── */
.week-section-header {
  user-select: none;
  transition: background 0.15s;
  border-radius: var(--radius-sm);
  padding: 10px 8px !important;
  margin: 0 -8px;
}
.week-section-header:hover { background: var(--bg-surface); }

/* ── Chapter Picker Checkbox ── */
input[type="checkbox"] {
  accent-color: var(--indigo);
}

/* ── Exam Range Pills ── */
.exam-range-row input { font-size: 13px !important; }

/* ── Light Mode ── */
[data-theme="light"] {
  --bg-void: #f0f2f7;
  --bg-base: #ffffff;
  --bg-surface: #f8f9fc;
  --bg-raised: #eef0f6;
  --bg-hover: #e4e7f0;

  --indigo: #3b55d4;
  --indigo-dim: #2a3fb8;
  --indigo-glow: rgba(59, 85, 212, 0.1);

  --text-primary: #0f1117;
  --text-secondary: #4a5168;
  --text-muted: #9ba3bc;

  --border: rgba(0,0,0,0.09);
  --border-active: rgba(59,85,212,0.35);

  --critical: #dc2626;
  --important: #ea580c;
  --moderate: #ca8a04;
  --mastered: #16a34a;
  --reference: #2563eb;
}

[data-theme="light"] .sidebar {
  background: #ffffff;
  border-right-color: rgba(0,0,0,0.09);
}

[data-theme="light"] .nav-item:hover {
  background: #f0f2f7;
}

[data-theme="light"] .flashcard-back {
  background: linear-gradient(135deg, #e8ecf8, #dce3f5);
  border-color: rgba(59,85,212,0.3);
}

[data-theme="light"] .spinner-overlay {
  background: rgba(255,255,255,0.75);
}

[data-theme="light"] .modal-box {
  background: #ffffff;
}

[data-theme="light"] .upload-zone {
  background: #f8f9fc;
}

[data-theme="light"] .study-today-card {
  background: linear-gradient(135deg, #f0f4ff, #e8eeff);
}

[data-theme="light"] .mermaid svg {
  background: transparent;
}

[data-theme="light"] code {
  background: #eef0f6;
  color: #0f1117;
}

[data-theme="light"] .search-highlight {
  background: rgba(202, 138, 4, 0.25);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #d1d5e0;
}
