/* ── CEH v13 Study Lab — r3b3Lli0us_kID ── */
/* Custom cybersec theme: dark + cyan/emerald accents */

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

:root {
  --bg:        #0a0e17;
  --bg2:       #111827;
  --bg3:       #1e293b;
  --border:    #1e3a5f;
  --text:      #e2e8f0;
  --text-muted:#64748b;
  --accent:    #06b6d4;
  --accent2:   #22d3ee;
  --green:     #10b981;
  --green2:    #34d399;
  --red:       #ef4444;
  --yellow:    #f59e0b;
  --purple:    #a78bfa;
  --code-bg:   #0f172a;
  --sidebar-w: 280px;
  --topbar-h:  52px;
  --radius:    8px;
  --font:      'Inter', system-ui, sans-serif;
  --mono:      'JetBrains Mono', 'Courier New', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  overflow-x: hidden;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── TOPBAR ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: none; align-items: center; gap: 12px;
  padding: 0 16px;
}
.topbar-title { flex: 1; font-size: 14px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topbar-title .brand { color: var(--accent); font-weight: 700; }
.topbar-title .sep { color: var(--text-muted); margin: 0 4px; }

.menu-btn, .search-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 6px; border-radius: 6px;
  display: flex; flex-direction: column; gap: 4px; align-items: center;
  transition: color .2s, background .2s;
}
.menu-btn:hover, .search-btn:hover { color: var(--text); background: var(--bg3); }
.menu-btn span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 1px; transition: transform .2s, opacity .2s; }
.menu-btn.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── SIDEBAR ── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 90;
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: transform .3s ease;
}
.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.logo { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.logo-bracket { color: var(--accent); font-family: var(--mono); font-size: 22px; font-weight: 700; }
.logo-text { color: var(--text); font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: 3px; }
.subtitle { font-size: 11px; color: var(--text-muted); letter-spacing: .5px; }

.sidebar-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.sidebar-search svg { color: var(--text-muted); flex-shrink: 0; }
.sidebar-search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-family: var(--font); font-size: 13px;
}
.sidebar-search input::placeholder { color: var(--text-muted); }

.sidebar-nav-section { padding: 4px 0; }
.nav-section-label {
  padding: 10px 16px 6px;
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted);
}
.module-nav { flex: 1; overflow-y: auto; }

.nav-item { border-bottom: 1px solid transparent; }
.nav-module-btn {
  width: 100%; background: none; border: none;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 16px; cursor: pointer;
  color: var(--text-muted); font-family: var(--font); font-size: 13px; font-weight: 500;
  text-align: left; transition: color .15s, background .15s;
  border-left: 3px solid transparent;
}
.nav-module-btn:hover { color: var(--text); background: var(--bg3); }
.nav-item.active .nav-module-btn { color: var(--text); border-left-color: var(--accent); background: rgba(6,182,212,.08); }
.nav-num { font-family: var(--mono); font-size: 11px; color: var(--accent); min-width: 22px; flex-shrink: 0; }
.nav-title { flex: 1; }
.nav-badge {
  font-size: 10px; font-family: var(--mono); color: var(--text-muted);
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 1px 6px; white-space: nowrap;
}
.nav-badge.done { color: var(--green); border-color: var(--green); background: rgba(16,185,129,.1); }
.nav-progress-bar { height: 2px; background: var(--bg3); margin: 0 16px 4px; border-radius: 1px; overflow: hidden; }
.nav-progress-fill { height: 100%; background: var(--green); border-radius: 1px; transition: width .4s ease; }

/* ── NAV ACTION BUTTONS ── */
.nav-action-btn {
  width: 100%; background: none; border: none;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; cursor: pointer;
  color: var(--text-muted); font-family: var(--font); font-size: 13px; font-weight: 500;
  text-align: left; transition: color .15s, background .15s;
}
.nav-action-btn:hover { color: var(--accent2); background: var(--bg3); }
.nav-action-btn.active { color: var(--accent); background: rgba(6,182,212,.08); }
.nav-action-btn svg { flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.progress-summary { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.reset-btn {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  font-size: 11px; font-family: var(--font); padding: 4px 10px; border-radius: 4px;
  cursor: pointer; transition: all .2s;
}
.reset-btn:hover { border-color: var(--red); color: var(--red); }

/* ── MAIN ── */
.main { margin-left: var(--sidebar-w); min-height: 100vh; transition: margin-left .3s ease; }
.content-area { max-width: 820px; margin: 0 auto; padding: 48px 40px 120px; }

/* ── OVERLAY ── */
.overlay {
  display: none; position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,.6); backdrop-filter: blur(2px);
}
.overlay.show { display: block; }

/* ── READING PROGRESS ── */
.reading-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 3px; background: linear-gradient(90deg, var(--accent), var(--green));
  width: 0; transition: width .1s;
}

/* ── LANDING ── */
.landing { padding-top: 20px; animation: fadeIn .3s ease; }
.landing-badge {
  display: inline-block; padding: 4px 14px; border-radius: 20px;
  background: rgba(6,182,212,.1); border: 1px solid rgba(6,182,212,.3);
  color: var(--accent2); font-size: 12px; font-weight: 600;
  font-family: var(--mono); letter-spacing: .5px; margin-bottom: 20px;
}
.landing-title { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; line-height: 1.15; margin-bottom: 16px; }
.landing-sub { color: var(--text-muted); font-size: 16px; max-width: 560px; margin-bottom: 32px; line-height: 1.6; }

/* ── LANDING STATS ── */
.landing-stats { display: flex; gap: 14px; margin-bottom: 32px; flex-wrap: wrap; }
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  flex: 1; min-width: 100px; text-align: center;
}
.stat-num { font-family: var(--mono); font-size: 24px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }

/* ── LANDING ACTIONS ── */
.landing-actions { display: flex; gap: 12px; margin-bottom: 48px; flex-wrap: wrap; }
.action-btn {
  padding: 12px 28px; border-radius: var(--radius);
  font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .2s; border: none;
}
.action-btn.primary {
  background: var(--accent); color: #0a0e17;
}
.action-btn.primary:hover { background: var(--accent2); transform: translateY(-1px); }
.action-btn.secondary {
  background: transparent; color: var(--text); border: 1px solid var(--border);
}
.action-btn.secondary:hover { border-color: var(--accent); color: var(--accent); }

.grid-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; color: var(--text-muted); }

/* ── MODULE GRID ── */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.module-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  cursor: pointer; transition: border-color .2s, transform .15s, background .2s;
  display: block;
}
.module-card:hover { border-color: var(--accent); background: var(--bg3); transform: translateY(-2px); }
.card-number { font-family: var(--mono); font-size: 11px; color: var(--accent); margin-bottom: 8px; }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; line-height: 1.4; }
.card-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
.card-bar { height: 2px; background: var(--bg3); border-radius: 1px; overflow: hidden; margin-bottom: 4px; }
.card-bar-fill { height: 100%; background: var(--green); border-radius: 1px; transition: width .4s ease; }
.card-pct { font-size: 10px; color: var(--text-muted); font-family: var(--mono); }

/* ── MODULE VIEW ── */
.module-view { animation: fadeIn .25s ease; }
.back-btn {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  font-size: 12px; font-family: var(--font); padding: 5px 12px; border-radius: 6px;
  cursor: pointer; margin-bottom: 20px; transition: all .2s;
}
.back-btn:hover { border-color: var(--text-muted); color: var(--text); }
.module-meta-row { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.module-num-badge { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.module-title-h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 700; line-height: 1.2; }
.module-submeta { color: var(--text-muted); font-size: 13px; margin-bottom: 14px; }
.source-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.source-pill {
  font-size: 11px; font-family: var(--mono);
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text-muted); padding: 2px 8px; border-radius: 4px;
}

/* ── SECTION BLOCK ── */
.section-block { margin-bottom: 48px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.section-block:last-of-type { border-bottom: none; }
.section-block.read .section-title { color: var(--text-muted); }
.section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.section-title { font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
.mark-read-btn {
  flex-shrink: 0; background: none; border: 1px solid var(--border);
  color: var(--text-muted); font-size: 11px; font-family: var(--font);
  padding: 4px 10px; border-radius: 4px; cursor: pointer;
  transition: all .2s; white-space: nowrap;
}
.mark-read-btn:hover { border-color: var(--green); color: var(--green); }
.mark-read-btn.read { border-color: var(--green); color: var(--green); background: rgba(16,185,129,.1); }

/* ── CONTENT TYPOGRAPHY ── */
.section-body h3 { font-size: 1rem; font-weight: 600; color: var(--accent2); margin: 24px 0 10px; }
.section-body h4 { font-size: .9rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin: 20px 0 8px; }
.section-body p { margin-bottom: 14px; color: #c9d1d9; }
.section-body strong { color: var(--text); }
.section-body em { color: var(--text-muted); font-style: italic; }
.section-body ul, .section-body ol { padding-left: 20px; margin-bottom: 14px; }
.section-body li { margin-bottom: 5px; color: #c9d1d9; }
.section-body li strong { color: var(--text); }
.section-body a { color: var(--accent); text-decoration: none; }
.section-body a:hover { text-decoration: underline; }
.section-body hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

/* ── TABLES ── */
.section-body table {
  width: 100%; border-collapse: collapse; margin: 18px 0 22px;
  font-size: 13.5px; overflow: hidden; border-radius: 6px;
  border: 1px solid var(--border);
}
.section-body th {
  background: var(--bg3); color: var(--text); font-weight: 600;
  padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border);
  font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
}
.section-body td { padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.section-body tr:last-child td { border-bottom: none; }
.section-body tr:hover td { background: rgba(6,182,212,.04); }

/* ── CODE ── */
.section-body pre {
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin: 14px 0 20px;
  overflow-x: auto; position: relative;
}
.section-body pre code {
  font-family: var(--mono); font-size: 13px; color: #c9d1d9; line-height: 1.6;
  background: none; padding: 0; border: none; border-radius: 0;
}
.section-body code {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--bg3); color: var(--accent2);
  padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--border);
}
.copy-btn {
  position: absolute; top: 8px; right: 8px;
  background: var(--bg3); border: 1px solid var(--border); color: var(--text-muted);
  font-size: 11px; font-family: var(--font); padding: 3px 8px; border-radius: 4px;
  cursor: pointer; transition: all .2s; opacity: 0;
}
pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--text); border-color: var(--text-muted); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

/* ── CALLOUT BLOCKS ── */
.callout {
  border-left: 3px solid var(--accent); background: rgba(6,182,212,.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 16px; margin: 16px 0; font-size: 14px;
}
.callout.info { border-color: var(--purple); background: rgba(167,139,250,.06); }
.callout.success { border-color: var(--green); background: rgba(16,185,129,.06); }
.callout.warn { border-color: var(--yellow); background: rgba(245,158,11,.06); }
.callout.danger { border-color: var(--red); background: rgba(239,68,68,.06); }

/* ── MODULE NAV FOOTER ── */
.module-nav-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 60px; padding-top: 28px; border-top: 1px solid var(--border); gap: 12px;
}
.nav-arrow {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font); font-size: 13px; font-weight: 500;
  padding: 10px 16px; border-radius: var(--radius); cursor: pointer;
  transition: all .2s; flex: 1; max-width: 260px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-arrow:hover { border-color: var(--accent); background: var(--bg3); }
.nav-arrow.next { margin-left: auto; justify-content: flex-end; text-align: right; }

/* ── QUIZ / EXAM VIEW ── */
.quiz-view { animation: fadeIn .25s ease; }

.quiz-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 32px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 12px;
}
.quiz-title { font-size: 1.4rem; font-weight: 700; }
.quiz-meta { display: flex; gap: 16px; align-items: center; }
.quiz-timer {
  font-family: var(--mono); font-size: 16px; font-weight: 600;
  color: var(--accent); padding: 6px 14px;
  background: rgba(6,182,212,.1); border: 1px solid rgba(6,182,212,.3);
  border-radius: var(--radius);
}
.quiz-timer.warning { color: var(--yellow); border-color: var(--yellow); background: rgba(245,158,11,.1); }
.quiz-timer.danger { color: var(--red); border-color: var(--red); background: rgba(239,68,68,.1); }
.quiz-counter { font-size: 13px; color: var(--text-muted); font-family: var(--mono); }

.quiz-progress-bar { height: 4px; background: var(--bg3); border-radius: 2px; margin-bottom: 32px; overflow: hidden; }
.quiz-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: 2px; transition: width .3s ease; }

/* ── QUESTION CARD ── */
.question-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; margin-bottom: 24px;
}
.question-num { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-bottom: 12px; }
.question-text { font-size: 15px; line-height: 1.7; margin-bottom: 20px; color: var(--text); }
.question-module-tag {
  display: inline-block; font-size: 10px; font-family: var(--mono);
  background: var(--bg3); border: 1px solid var(--border); color: var(--text-muted);
  padding: 2px 8px; border-radius: 4px; margin-bottom: 12px;
}

.option-list { list-style: none; padding: 0; }
.option-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; margin-bottom: 8px;
  background: var(--bg3); border: 2px solid transparent;
  border-radius: var(--radius); cursor: pointer;
  transition: all .15s; font-size: 14px;
}
.option-item:hover { border-color: var(--border); background: rgba(30,58,95,.5); }
.option-item.selected { border-color: var(--accent); background: rgba(6,182,212,.08); }
.option-item.correct { border-color: var(--green); background: rgba(16,185,129,.08); }
.option-item.wrong { border-color: var(--red); background: rgba(239,68,68,.08); }
.option-letter {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--border);
  flex-shrink: 0; transition: all .15s;
}
.option-item.selected .option-letter { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.option-item.correct .option-letter { background: var(--green); color: var(--bg); border-color: var(--green); }
.option-item.wrong .option-letter { background: var(--red); color: white; border-color: var(--red); }
.option-text { flex: 1; padding-top: 3px; }

.explanation {
  margin-top: 16px; padding: 14px 16px;
  background: rgba(16,185,129,.06); border-left: 3px solid var(--green);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px; color: #c9d1d9; display: none;
}
.explanation.show { display: block; }

/* ── QUIZ NAVIGATION ── */
.quiz-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 24px; gap: 12px;
}
.quiz-btn {
  padding: 10px 24px; border-radius: var(--radius);
  font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .2s; border: none;
}
.quiz-btn.primary { background: var(--accent); color: var(--bg); }
.quiz-btn.primary:hover { background: var(--accent2); }
.quiz-btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.quiz-btn.secondary:hover { border-color: var(--accent); color: var(--accent); }
.quiz-btn:disabled { opacity: .4; cursor: not-allowed; }
.quiz-btn.danger { background: var(--red); color: white; }
.quiz-btn.danger:hover { opacity: .9; }

/* ── QUESTION MAP ── */
.question-map {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0;
}
.qmap-dot {
  width: 32px; height: 32px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  background: var(--bg3); border: 1px solid var(--border);
  cursor: pointer; transition: all .15s; color: var(--text-muted);
}
.qmap-dot:hover { border-color: var(--accent); }
.qmap-dot.answered { background: rgba(6,182,212,.15); border-color: var(--accent); color: var(--accent); }
.qmap-dot.current { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.qmap-dot.correct { background: rgba(16,185,129,.2); border-color: var(--green); color: var(--green); }
.qmap-dot.wrong { background: rgba(239,68,68,.2); border-color: var(--red); color: var(--red); }

/* ── RESULTS VIEW ── */
.results-view { animation: fadeIn .3s ease; }
.results-header { text-align: center; margin-bottom: 40px; }
.results-score {
  font-family: var(--mono); font-size: 72px; font-weight: 700;
  margin: 16px 0 8px;
}
.results-score.pass { color: var(--green); }
.results-score.fail { color: var(--red); }
.results-verdict { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.results-detail { color: var(--text-muted); font-size: 14px; }

.results-breakdown {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px; margin: 32px 0;
}
.breakdown-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; text-align: center;
}
.breakdown-num { font-family: var(--mono); font-size: 28px; font-weight: 700; }
.breakdown-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; }

/* ── PRACTICE MODE SELECTOR ── */
.practice-selector {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px; margin-top: 20px;
}
.practice-module-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; cursor: pointer;
  transition: all .2s;
}
.practice-module-card:hover { border-color: var(--accent); background: var(--bg3); }
.practice-module-card .pm-num { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.practice-module-card .pm-title { font-size: 13px; font-weight: 600; margin: 6px 0 4px; }
.practice-module-card .pm-count { font-size: 11px; color: var(--text-muted); }

/* ── SEARCH OVERLAY ── */
.search-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(10,14,23,.9); backdrop-filter: blur(8px);
  flex-direction: column; align-items: center; padding-top: 80px;
}
.search-overlay.show { display: flex; }
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px; width: min(600px, 90vw);
}
.search-box svg { color: var(--text-muted); flex-shrink: 0; }
.search-box input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-family: var(--font); font-size: 16px;
}
.search-box input::placeholder { color: var(--text-muted); }
#searchClose { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; }
.search-results {
  width: min(600px, 90vw); margin-top: 12px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; max-height: 60vh; overflow-y: auto;
}
.search-result-item {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg3); }
.sr-module { font-size: 11px; color: var(--accent); margin-bottom: 3px; }
.sr-section { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.sr-snip { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.sr-snip mark { background: rgba(6,182,212,.25); color: var(--accent2); border-radius: 2px; }
.search-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* ── BACK TO TOP ── */
.back-top {
  position: fixed; bottom: 24px; right: 24px; z-index: 50;
  background: var(--bg2); border: 1px solid var(--border); color: var(--text-muted);
  width: 40px; height: 40px; border-radius: 50%; font-size: 16px;
  cursor: pointer; display: none; align-items: center; justify-content: center;
  transition: all .2s; box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.back-top.show { display: flex; }
.back-top:hover { color: var(--text); border-color: var(--accent); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .topbar { display: flex; }
  .sidebar { top: var(--topbar-h); transform: translateX(-100%); z-index: 95; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding-top: var(--topbar-h); }
  .content-area { padding: 28px 20px 80px; }
  .module-grid { grid-template-columns: 1fr 1fr; }
  .module-nav-footer { flex-direction: column; }
  .nav-arrow { max-width: 100%; }
  .landing-stats { gap: 8px; }
  .stat-card { padding: 12px; min-width: 70px; }
  .stat-num { font-size: 20px; }
  .question-card { padding: 20px; }
}

@media (max-width: 480px) {
  .module-grid, .practice-selector { grid-template-columns: 1fr; }
  .section-body pre { font-size: 12px; }
  .copy-btn { opacity: 1; }
  .landing-stats { flex-direction: row; flex-wrap: wrap; }
  .stat-card { flex: 1 1 40%; }
}

/* ── ANIMATIONS ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
