/* ============================================================
   JEE PYQ Explorer — style.css (Redesigned Premium Dark Theme)
   Inspired by Marks App reference design
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;700&family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ── Design Tokens ───────────────────────────────────────── */
:root {
  --bg-base:        #000000;
  --bg-surface:     #000000;
  --bg-elevated:    #0a0a0a;
  --bg-hover:       #161616;
  --bg-active:      #ffffff;

  --border-subtle:  #1f1f1f;
  --border-muted:   #2e2e2e;
  --border-accent:  #3e3e3e;
  --border-focus:   #ffffff;

  --text-primary:   #ffffff;
  --text-secondary: #888888;
  --text-muted:     #666666;
  --text-accent:    #ffffff;

  --blue:    #0070f3;
  --cyan:    #00dfd8;
  --orange:  #f5a623;
  --green:   #10b981;
  --purple:  #7928ca;
  --pink:    #ff007f;
  --red:     #e00;
  --yellow:  #f5a623;
  --teal:    #50e3c2;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --radius-pill: 9999px;

  --topnav-h:  60px;
  --bnav-h:    68px;
  --t: 120ms ease;

  --shadow-card: none;
  --shadow-elevated: none;
  --shadow-float: 0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-glow-blue: 0 0 0 1px var(--blue);
}

/* ── Reset & Texture ────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 15px;
  scroll-behavior: smooth;
  background: var(--bg-base);
}
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
h1, h2, h3, h4 { font-weight: 750; letter-spacing: -0.02em; }

/* Sleek Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ── Utility ────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Screen Layout ───────────────────────────────────────── */
.screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  animation: screenIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.screen.hidden { display: none !important; }

/* ── Top Navigation ─────────────────────────────────────── */
.topnav {
  position: sticky; top: 0; z-index: 100;
  height: var(--topnav-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.topnav__brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.topnav__breadcrumbs {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 0;
}
.bc-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  background: linear-gradient(135deg, var(--green), #2e7d32);
  border-radius: 6px;
  margin-right: 4px;
  flex-shrink: 0;
}
.bc-logo svg { width: 10px; height: 10px; }
.bc-item {
  color: var(--text-secondary);
  transition: color var(--t);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
@media (max-width: 580px) {
  .bc-item {
    max-width: 90px;
    font-size: 0.78rem;
  }
  .breadcrumbs { gap: 4px; }
}
.bc-item.active {
  color: var(--text-primary);
  font-weight: 700;
}
.bc-sep {
  color: var(--text-muted);
  font-size: 0.75rem;
  user-select: none;
  opacity: 0.5;
}
.brand-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.62rem;
}
.meta-tag {
  color: var(--text-muted);
  font-weight: 500;
}
.meta-tag.accent {
  color: var(--cyan);
  font-weight: 700;
}
.meta-dot {
  width: 3px;
  height: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  opacity: 0.5;
}
.topnav__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Speed counters in header */
.speed-counters-minimal {
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border-muted);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 4px;
}
.speed-counters-minimal .sp-sep {
  color: var(--text-muted);
  opacity: 0.5;
}
@media (max-width: 480px) {
  .speed-counters-minimal {
    font-size: 0.62rem;
    padding: 3px 6px;
  }
}

.test-progress-bar-wrap.absolute-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
  border-radius: 0;
}

/* ── Icons & Avatars ────────────────────────────────────── */
.btn-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-muted);
  color: var(--text-secondary);
  background: var(--bg-elevated);
  transition: all var(--t);
  flex-shrink: 0;
}
.btn-icon:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
  background: var(--bg-hover);
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 800; color: #fff;
  cursor: pointer; flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--bg-base);
}

/* ── Navigation Drawer ───────────────────────────────────── */
.drawer-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.drawer-overlay.open { display: block; }
.drawer {
  position: fixed; top: 0; left: -300px; bottom: 0;
  width: 280px; z-index: 210;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column;
  transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}
.drawer.open { left: 0; }

.drawer__header-back {
  padding: 16px 16px 8px;
  flex-shrink: 0;
}
.drawer__brand-info {
  padding: 4px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle);
}
.drawer__brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.drawer__brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
}
.drawer__brand-subtitle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-family: 'Geist Mono', monospace;
}
.drawer__brand-subtitle .sep {
  color: var(--text-muted);
  opacity: 0.4;
}
.drawer__subjects {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
  flex: 1;
}

/* Subject navigation items */
.subject-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  text-align: left; width: 100%;
  transition: all var(--t);
  color: var(--text-secondary);
  position: relative;
}
.subject-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}
.subject-item.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}
.subject-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--blue);
  border-radius: 0 3px 3px 0;
}
.subject-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex-shrink: 0;
  transition: all var(--t);
}
.subject-icon.physics   { background: rgba(255, 152, 0, 0.15); color: var(--orange); }
.subject-icon.chemistry { background: rgba(76, 175, 80, 0.15); color: var(--green); }
.subject-icon.math      { background: rgba(74, 158, 255, 0.15); color: var(--blue); }
.subject-icon.maker     { background: rgba(240, 98, 146, 0.15); color: var(--pink); }
.subject-icon.analysis  { background: rgba(179, 136, 255, 0.15); color: var(--purple); }

.subject-item.active .subject-icon.physics   { background: rgba(255, 152, 0, 0.25); }
.subject-item.active .subject-icon.chemistry { background: rgba(76, 175, 80, 0.25); }
.subject-item.active .subject-icon.math      { background: rgba(74, 158, 255, 0.25); }
.subject-item.active .subject-icon.maker     { background: rgba(240, 98, 146, 0.25); }
.subject-item.active .subject-icon.analysis  { background: rgba(179, 136, 255, 0.25); }


.subject-info { flex: 1; min-width: 0; }
.subject-name {
  font-size: 0.88rem; font-weight: 650; color: inherit; display: block;
}
.subject-count {
  font-size: 0.62rem; color: var(--text-muted); display: block;
  font-family: 'Geist Mono', monospace; margin-top: 1px;
}
.subject-item.active .subject-count { color: var(--text-secondary); }
.subject-arrow {
  color: var(--text-muted); flex-shrink: 0;
  transition: all var(--t); opacity: 0.5;
}
.subject-item.active .subject-arrow { color: var(--text-secondary); opacity: 0.8; }
.subject-item:hover .subject-arrow { opacity: 0.8; }

/* Sidebar progress */
.sidebar__progress {
  padding: 14px; margin: 8px 10px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle); flex-shrink: 0;
}
.progress-label {
  display: flex; justify-content: space-between;
  font-size: 0.7rem; color: var(--text-secondary); margin-bottom: 8px; font-weight: 600;
}
.progress-pct {
  color: var(--text-primary); font-weight: 700;
  font-family: 'Geist Mono', monospace;
}
.progress-bar-track {
  height: 4px; background: rgba(255, 255, 255, 0.06);
  border-radius: 2px; overflow: hidden; margin-bottom: 12px;
}
.progress-bar-fill {
  height: 100%; background: var(--blue);
  border-radius: 2px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.progress-subjects { display: flex; flex-direction: column; gap: 6px; }
.ps-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.66rem; color: var(--text-secondary);
}
.ps-item span:nth-child(2) { flex: 1; }
.ps-val {
  font-weight: 600; color: var(--text-primary);
  font-family: 'Geist Mono', monospace;
}
.ps-dot { width: 6px; height: 6px; border-radius: 50%; }
.physics-dot   { background: var(--orange); }
.chemistry-dot { background: var(--green); }
.math-dot      { background: var(--blue); }

/* ── Home Body ──────────────────────────────────────────── */
.home-body {
  flex: 1; overflow-y: auto;
  padding: 16px 16px calc(var(--bnav-h) + 24px);
  display: flex; flex-direction: column; gap: 14px;
}

/* Horizontal pill row (mobile) */
.subject-pill-row {
  display: flex; gap: 6px;
  overflow-x: auto; scrollbar-width: none;
  padding-bottom: 2px;
}
.subject-pill-row::-webkit-scrollbar { display: none; }
.subject-pill {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-muted);
  font-size: 0.78rem; font-weight: 600;
  color: var(--text-secondary); background: var(--bg-elevated);
  transition: all var(--t);
  white-space: nowrap;
}
.subject-pill:hover {
  border-color: var(--border-accent); color: var(--text-primary);
}
.subject-pill.active {
  background: var(--text-primary);
  border-color: var(--text-primary); color: var(--bg-base);
  font-weight: 700;
}

/* Headers */
.content-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 10px;
}
.page-title {
  font-size: 1.15rem; font-weight: 800; color: var(--text-primary);
  letter-spacing: -0.02em;
}
.page-subtitle {
  font-size: 0.7rem; color: var(--text-secondary);
  font-family: 'Geist Mono', monospace; margin-top: 2px;
}
.content-header__right { display: flex; gap: 6px; }

.btn-ghost {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; font-size: 0.74rem; font-weight: 600;
  border: 1px solid var(--border-muted); border-radius: var(--radius-sm);
  color: var(--text-secondary); background: var(--bg-elevated);
  transition: all var(--t);
}
.btn-ghost:hover {
  border-color: var(--border-accent); color: var(--text-primary);
  background: var(--bg-hover);
}
.btn-ghost.accent-ghost {
  border-color: rgba(244, 67, 54, 0.2);
  color: var(--pink);
  background: rgba(244, 67, 54, 0.05);
}
.btn-ghost.accent-ghost:hover {
  border-color: var(--pink);
  background: rgba(244, 67, 54, 0.1);
}

/* ── Filter & Search Bar ─────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.filter-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; font-size: 0.72rem; font-weight: 650;
  border: 1px solid var(--border-muted); border-radius: var(--radius-sm);
  color: var(--text-secondary); background: var(--bg-elevated);
  transition: all var(--t);
}
.filter-btn:hover {
  border-color: var(--border-accent); color: var(--text-primary);
}
.filter-scroll {
  display: flex; gap: 5px; overflow-x: auto;
  scrollbar-width: none; flex: 1;
}
.filter-scroll::-webkit-scrollbar { display: none; }

.chip {
  padding: 5px 12px; font-size: 0.7rem; font-weight: 600;
  border: 1px solid var(--border-muted); border-radius: var(--radius-pill);
  color: var(--text-secondary); background: transparent;
  transition: all var(--t); white-space: nowrap;
  flex-shrink: 0;
}
.chip:hover {
  border-color: var(--border-accent); color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}
.chip.active {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(74, 158, 255, 0.08);
  font-weight: 700;
}

.btn-sort {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; font-size: 0.72rem; font-weight: 650;
  border: 1px solid var(--border-muted); border-radius: var(--radius-sm);
  color: var(--text-secondary); transition: all var(--t);
}
.btn-sort:hover {
  border-color: var(--border-accent); color: var(--text-primary);
}

/* Search bar */
.search-bar-wrap {
  margin-bottom: 2px;
  animation: slideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.search-input-container {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-surface); border: 1px solid var(--border-muted);
  border-radius: var(--radius-md); padding: 10px 14px;
  transition: border-color var(--t);
}
.search-input-container:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}
.search-input-container input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text-primary); font-size: 0.84rem; font-weight: 500;
}
.search-input-container input::placeholder { color: var(--text-muted); }
.search-icon { color: var(--text-secondary); flex-shrink: 0; }
.btn-clear-search {
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center;
}
.btn-clear-search:hover { color: var(--text-primary); }

.result-count-line {
  font-size: 0.68rem; color: var(--text-muted);
  font-family: 'Geist Mono', monospace; font-weight: 500;
}

/* ── Chapter List & Items ────────────────────────────────── */
.chapter-list { display: flex; flex-direction: column; gap: 6px; }
.chapter-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--t);
  position: relative;
}
.chapter-item:hover, .chapter-item:focus-visible {
  background: var(--bg-hover);
  border-color: var(--border-accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}
.chapter-item:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}
.chapter-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}
.chapter-icon.orange  { background: rgba(255, 152, 0, 0.15); color: var(--orange); }
.chapter-icon.green   { background: rgba(76, 175, 80, 0.15); color: var(--green); }
.chapter-icon.blue    { background: rgba(74, 158, 255, 0.15); color: var(--blue); }
.chapter-icon.purple  { background: rgba(179, 136, 255, 0.15); color: var(--purple); }
.chapter-icon.yellow  { background: rgba(255, 193, 7, 0.15); color: var(--yellow); }
.chapter-icon.teal    { background: rgba(38, 166, 154, 0.15); color: var(--teal); }
.chapter-icon.red     { background: rgba(244, 67, 54, 0.15); color: var(--red); }
.chapter-icon.pink    { background: rgba(240, 98, 146, 0.15); color: var(--pink); }

.chapter-item__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
  gap: 16px;
}
@media (max-width: 580px) {
  .chapter-item__body {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
.chapter-name-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.chapter-name {
  font-size: 0.9rem; font-weight: 700; color: var(--text-primary);
}

.ctag {
  font-family: 'Geist Mono', monospace; font-size: 0.58rem; font-weight: 700;
  padding: 2px 7px; border-radius: var(--radius-pill); text-transform: uppercase;
  letter-spacing: 0.3px;
}
.weak-tag {
  border: 1px solid rgba(244, 67, 54, 0.3);
  color: var(--red);
  background: rgba(244, 67, 54, 0.08);
}
.hot-tag {
  border: 1px solid rgba(255, 152, 0, 0.3);
  color: var(--orange);
  background: rgba(255, 152, 0, 0.08);
}

.chapter-item__stats-inline { display: flex; gap: 12px; margin-top: 3px; }
.stat-pill {
  font-size: 0.66rem; color: var(--text-muted);
  font-family: 'Geist Mono', monospace; font-weight: 500;
}
.stat-pill b { color: var(--text-secondary); font-weight: 600; }
.stat-pill.accent-pill b { color: var(--cyan); }
.chapter-arrow {
  color: var(--text-muted); flex-shrink: 0;
  transition: all var(--t); opacity: 0.4;
}
.chapter-item:hover .chapter-arrow {
  transform: translateX(3px); color: var(--text-secondary); opacity: 0.8;
}

.bottom-nav {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 440px;
  height: var(--bnav-h);
  z-index: 190;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  padding: 0 6px;
  box-shadow: var(--shadow-float);
}
.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  height: calc(var(--bnav-h) - 16px);
  margin: 0 2px;
  transition: all var(--t);
  position: relative;
}
.bnav-item:hover {
  color: var(--text-secondary);
}
.bnav-item.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
}
.bnav-item.active::after {
  content: '';
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 16px; height: 2px;
  background: var(--blue);
  border-radius: 2px;
}

/* ── Screen: Topics Grid ─────────────────────────────────── */
.screen-body {
  flex: 1; overflow-y: auto;
  padding: 16px 16px calc(var(--bnav-h) + 24px);
  display: flex; flex-direction: column; gap: 14px;
}
.syllabus-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.schip {
  padding: 6px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-muted); background: var(--bg-elevated);
  font-size: 0.74rem; font-weight: 600; color: var(--text-secondary);
  transition: all var(--t);
}
.schip:hover {
  border-color: var(--border-accent); color: var(--text-primary);
}
.schip.active {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(74, 158, 255, 0.08);
  font-weight: 700;
}

.mode-cards {
  display: flex;
  flex-direction: row;
  gap: 10px;
}
@media(max-width: 580px) {
  .mode-cards {
    flex-direction: column;
  }
}
.mode-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  cursor: pointer;
  text-align: left;
  transition: all var(--t);
  flex: 1;
  box-shadow: var(--shadow-card);
}
.mode-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  background: var(--bg-hover);
  box-shadow: var(--shadow-elevated);
}
.test-card {
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.08), rgba(74, 158, 255, 0.02));
  border-color: rgba(74, 158, 255, 0.15);
}
.test-card:hover {
  border-color: rgba(74, 158, 255, 0.35);
  box-shadow: 0 8px 24px rgba(74, 158, 255, 0.12);
}
.speed-card {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.08), rgba(255, 152, 0, 0.02));
  border-color: rgba(255, 152, 0, 0.15);
}
.speed-card:hover {
  border-color: rgba(255, 152, 0, 0.35);
  box-shadow: 0 8px 24px rgba(255, 152, 0, 0.12);
}

.mode-card__icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.test-card  .mode-card__icon { background: rgba(74, 158, 255, 0.12); color: var(--blue); }
.speed-card .mode-card__icon { background: rgba(255, 152, 0, 0.12); color: var(--orange); }
.mode-card__info { flex: 1; }
.mode-card__name {
  font-size: 0.95rem; font-weight: 750; display: block; color: var(--text-primary);
}
.mode-card__desc {
  font-size: 0.7rem; color: var(--text-muted); display: block; margin-top: 3px;
}

.topics-section-label {
  font-size: 0.62rem; font-weight: 700; color: var(--text-muted);
  letter-spacing: 1.2px; text-transform: uppercase; padding-left: 2px;
  font-family: 'Geist Mono', monospace;
  margin-top: 8px;
}

.topic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media(max-width: 580px) { .topic-grid { grid-template-columns: 1fr; } }

.topic-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--t);
  position: relative;
}
.topic-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}
.topic-card.must-do { border-color: rgba(244, 67, 54, 0.2); }
.topic-card.must-do:hover { border-color: var(--red); }
.topic-title {
  font-size: 0.84rem; font-weight: 700; color: var(--text-primary); line-height: 1.35;
}
.topic-qs {
  font-size: 0.66rem; color: var(--text-muted); margin-top: 3px;
  font-family: 'Geist Mono', monospace;
}
.must-do-badge {
  font-size: 0.56rem; font-family: 'Geist Mono', monospace; font-weight: 700;
  padding: 2px 7px; border-radius: var(--radius-pill);
  border: 1px solid rgba(244, 67, 54, 0.3); color: var(--red);
  background: rgba(244, 67, 54, 0.06); flex-shrink: 0;
}
.topic-arrow {
  color: var(--text-muted); flex-shrink: 0;
  transition: all var(--t); opacity: 0.4;
}
.topic-card:hover .topic-arrow {
  transform: translateX(2px); color: var(--text-secondary); opacity: 0.8;
}

/* ── Screen: Test Mode ──────────────────────────────────── */
.test-topnav { gap: 10px; }
.test-progress-bar-wrap {
  flex: 1; height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px; overflow: hidden;
}
.test-progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: width 0.3s ease;
}
.test-timer {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.76rem; font-weight: 700; font-family: 'Geist Mono', monospace;
  border: 1px solid var(--border-muted); border-radius: var(--radius-sm);
  padding: 4px 10px; background: var(--bg-elevated);
  color: var(--text-primary);
}
.test-timer.warning {
  color: var(--orange); border-color: rgba(255, 152, 0, 0.3);
  background: rgba(255, 152, 0, 0.06);
}
.test-timer.danger {
  color: var(--red); border-color: rgba(244, 67, 54, 0.3);
  background: rgba(244, 67, 54, 0.06);
  animation: pulse 1s infinite;
}

.test-body {
  flex: 1; overflow-y: auto;
  padding: 16px 16px 100px;
  display: flex; flex-direction: column; gap: 14px;
}
.test-q-meta {
  display: flex; flex-direction: column; gap: 8px;
}
.test-q-num-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 8px;
}
.test-q-label {
  font-size: 0.74rem; color: var(--text-secondary);
  font-family: 'Geist Mono', monospace; font-weight: 600;
}
.test-q-badges { display: flex; gap: 6px; }
.qbadge {
  font-family: 'Geist Mono', monospace; font-size: 0.6rem;
  font-weight: 600; padding: 3px 8px; border-radius: var(--radius-pill);
}
.year-badge {
  background: rgba(74, 158, 255, 0.08);
  border: 1px solid rgba(74, 158, 255, 0.2);
  color: var(--blue);
}
.chapter-badge {
  background: rgba(179, 136, 255, 0.08);
  border: 1px solid rgba(179, 136, 255, 0.2);
  color: var(--purple);
}

.test-q-actions { display: flex; gap: 6px; }
.q-action-btn {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.7rem; font-weight: 600; color: var(--text-secondary);
  padding: 5px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-muted); background: var(--bg-elevated);
  transition: all var(--t);
}
.q-action-btn:hover {
  border-color: var(--border-accent); color: var(--text-primary);
}
.q-action-btn.marked {
  color: var(--yellow); border-color: rgba(255, 193, 7, 0.3);
  background: rgba(255, 193, 7, 0.06);
}

.test-question-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 20px 18px;
}
.test-question-text {
  font-size: 0.9rem; line-height: 1.7; color: var(--text-primary); font-weight: 400;
}

.test-options { display: flex; flex-direction: column; gap: 8px; }
.option-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle); background: var(--bg-surface);
  text-align: left; width: 100%; transition: all var(--t);
}
.option-btn:hover {
  border-color: var(--border-accent);
  background: var(--bg-hover);
}
.option-btn.selected {
  border-color: var(--blue);
  background: rgba(74, 158, 255, 0.06);
}
.option-btn.correct {
  border-color: var(--green) !important;
  background: rgba(76, 175, 80, 0.06);
}
.option-btn.wrong {
  border-color: var(--red) !important;
  background: rgba(244, 67, 54, 0.06);
}

.opt-label {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.74rem; font-weight: 700; font-family: 'Geist Mono', monospace;
  background: var(--bg-elevated); color: var(--text-muted);
  border: 1px solid var(--border-muted);
  transition: all var(--t);
}
.option-btn.selected .opt-label {
  background: var(--blue); color: #fff; border-color: var(--blue);
}
.option-btn.correct .opt-label {
  background: var(--green); color: #fff; border-color: var(--green);
}
.option-btn.wrong .opt-label {
  background: var(--red); color: #fff; border-color: var(--red);
}
.opt-text { font-size: 0.84rem; font-weight: 500; color: var(--text-secondary); }
.option-btn.selected .opt-text,
.option-btn.correct .opt-text,
.option-btn.wrong .opt-text { color: var(--text-primary); }

/* Numerical Container */
.test-numerical-container {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 20px 18px;
}
.num-input-wrap { display: flex; flex-direction: column; gap: 8px; }
.num-input-label {
  font-size: 0.78rem; color: var(--text-secondary); font-weight: 600;
}
.numerical-input {
  background: var(--bg-elevated) !important;
  border: 1.5px solid var(--border-muted) !important;
  border-radius: var(--radius-sm); padding: 14px 16px;
  color: var(--text-primary) !important; font-size: 1.1rem; font-weight: 700;
  outline: none; font-family: 'Geist Mono', monospace; letter-spacing: 0.5px;
  box-shadow: none !important;
  transition: all var(--t);
}
.numerical-input:focus {
  border-color: var(--blue) !important;
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.12) !important;
}

/* Palette */
.q-palette-wrap {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 12px;
}
.q-palette-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 10px;
}
.q-palette-header > span {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.palette-legend { display: flex; align-items: center; gap: 6px; }
.palette-legend span { font-size: 0.6rem; color: var(--text-muted); }
.pl-dot { width: 6px; height: 6px; border-radius: 50%; }
.pl-dot.answered  { background: var(--blue); }
.pl-dot.marked    { background: var(--yellow); }
.pl-dot.unanswered{ background: var(--border-muted); }

.q-palette { display: flex; flex-wrap: wrap; gap: 6px; }
.palette-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  font-size: 0.72rem; font-weight: 700; font-family: 'Geist Mono', monospace;
  border: 1px solid var(--border-muted); background: var(--bg-elevated);
  color: var(--text-muted); transition: all var(--t);
}
.palette-btn:hover {
  border-color: var(--border-accent); color: var(--text-primary);
}
.palette-btn.active {
  border-color: var(--blue); color: var(--blue); font-weight: 800;
  background: rgba(74, 158, 255, 0.08);
}
.palette-btn.answered {
  background: rgba(74, 158, 255, 0.1);
  border-color: var(--blue); color: var(--blue);
}
.palette-btn.marked {
  background: rgba(255, 193, 7, 0.1);
  border-color: var(--yellow); color: var(--yellow);
}

/* Test Footer */
.test-footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 12px 16px; display: flex; align-items: center; gap: 8px;
  background: rgba(26, 29, 35, 0.95);
  border-top: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); z-index: 50;
}
.test-nav-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 0.78rem; font-weight: 700;
  border: 1px solid var(--border-muted); color: var(--text-secondary);
  background: var(--bg-elevated); transition: all var(--t);
}
.test-nav-btn:hover {
  border-color: var(--border-accent); color: var(--text-primary);
}
.test-nav-btn.primary {
  background: var(--blue); color: #fff; border-color: var(--blue);
}
.test-nav-btn.primary:hover { opacity: 0.9; }

.test-submit-btn {
  flex: 1; padding: 12px; border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--blue); color: #fff; border: none;
  transition: all var(--t);
}
.test-submit-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── Screen: Test Result ────────────────────────────────── */
.result-body {
  flex: 1; overflow-y: auto; padding: 28px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}
.result-score-ring {
  position: relative; width: 140px; height: 140px;
}
.ring-svg { width: 100%; height: 100%; }
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.ring-score {
  font-size: 2.4rem; font-weight: 850; color: var(--text-primary); line-height: 1;
}
.ring-label {
  font-size: 0.7rem; color: var(--text-muted); font-weight: 600;
  font-family: 'Geist Mono', monospace;
}

.result-title { font-size: 1.25rem; font-weight: 800; text-align: center; }
.result-sub {
  font-size: 0.7rem; color: var(--text-muted); text-align: center;
  font-family: 'Geist Mono', monospace;
}

.result-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  width: 100%; max-width: 380px;
}
.rstat {
  padding: 14px; border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle); text-align: center;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bg-surface);
}
.rstat-val {
  font-size: 1.5rem; font-weight: 850;
  font-family: 'Geist Mono', monospace;
}
.rstat.correct  { border-color: rgba(76, 175, 80, 0.2); }
.rstat.wrong    { border-color: rgba(244, 67, 54, 0.2); }
.rstat.skipped  { border-color: rgba(255, 193, 7, 0.2); }
.rstat.accuracy { border-color: rgba(74, 158, 255, 0.2); }
.rstat.correct  .rstat-val { color: var(--green); }
.rstat.wrong    .rstat-val { color: var(--red); }
.rstat.skipped  .rstat-val { color: var(--yellow); }
.rstat.accuracy .rstat-val { color: var(--blue); }
.rstat-label {
  font-size: 0.62rem; color: var(--text-muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.result-actions {
  display: flex; flex-direction: column; gap: 8px;
  width: 100%; max-width: 380px;
}
.result-btn {
  padding: 13px; border-radius: var(--radius-md);
  font-size: 0.82rem; font-weight: 700; text-align: center;
  transition: all var(--t); border: 1px solid transparent;
}
.result-btn.primary {
  background: var(--blue); color: #fff;
}
.result-btn.primary:hover { opacity: 0.9; transform: translateY(-1px); }
.result-btn.secondary {
  background: var(--bg-surface); border-color: var(--border-subtle);
  color: var(--text-secondary);
}
.result-btn.secondary:hover {
  border-color: var(--border-accent); color: var(--text-primary);
}
.result-btn.ghost { color: var(--text-muted); font-weight: 600; }
.result-btn.ghost:hover { color: var(--text-secondary); }

/* ── Screen: Speedrun Card Flow ──────────────────────────── */
.sr-progress-track {
  height: 3px; background: rgba(255, 255, 255, 0.04);
}
.sr-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--orange), var(--yellow));
  transition: width 0.4s ease;
  border-radius: 0 2px 2px 0;
}
.sr-body {
  padding: 16px 16px calc(90px + 16px);
  display: flex; flex-direction: column; gap: 14px;
}
.sr-card-wrap { flex: 1; display: flex; flex-direction: column; }
.sr-card {
  flex: 1; display: flex; flex-direction: column;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); overflow: hidden; min-height: 340px;
  box-shadow: var(--shadow-card);
}
.sr-face {
  display: flex; flex-direction: column; gap: 12px;
  padding: 20px; flex: 1;
}
.sr-face.hidden { display: none; }
.sr-face-tag {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  font-size: 0.6rem; font-weight: 700; font-family: 'Geist Mono', monospace;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: rgba(74, 158, 255, 0.08); border: 1px solid rgba(74, 158, 255, 0.2);
  color: var(--blue);
}
.solution-tag {
  background: rgba(76, 175, 80, 0.08); border-color: rgba(76, 175, 80, 0.2);
  color: var(--green);
}
.sr-year-badge {
  display: inline-flex; font-size: 0.64rem; font-family: 'Geist Mono', monospace;
  font-weight: 600; padding: 3px 8px; border-radius: var(--radius-pill);
  background: var(--bg-elevated); border: 1px solid var(--border-muted);
  align-self: flex-start; color: var(--text-secondary);
}
.sr-question-text {
  font-size: 0.9rem; line-height: 1.7; color: var(--text-primary);
  flex: 1; font-weight: 400;
}
.sr-options-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sr-opt {
  font-size: 0.74rem; color: var(--text-secondary);
  padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle); background: var(--bg-elevated);
}
.sr-opt b {
  color: var(--text-primary); margin-right: 5px;
  font-family: 'Geist Mono', monospace;
}

.sr-reveal-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; border-radius: var(--radius-md);
  background: var(--blue); border: none; color: #fff;
  font-size: 0.84rem; font-weight: 700; transition: all var(--t); margin-top: auto;
}
.sr-reveal-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* Solution face back */
.sr-answer-highlight {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(76, 175, 80, 0.05);
  border: 1px solid rgba(76, 175, 80, 0.2);
}
.sr-answer-label {
  font-size: 0.66rem; font-weight: 700; color: var(--green);
  text-transform: uppercase; font-family: 'Geist Mono', monospace;
}
.sr-answer-val {
  font-size: 0.84rem; font-weight: 600; color: var(--text-primary);
}

.sr-solution-text {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 0.84rem; line-height: 1.65; color: var(--text-secondary);
  background: var(--bg-elevated); padding: 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.sr-solution-text strong { color: var(--text-primary); }

.sr-self-rate { margin-top: auto; }
.sr-rate-label {
  font-size: 0.66rem; color: var(--text-muted); font-weight: 700;
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px;
}
.sr-rate-btns { display: flex; gap: 8px; }
.sr-rate-btn {
  flex: 1; padding: 10px 4px; border-radius: var(--radius-md);
  font-size: 0.76rem; font-weight: 700; border: 1px solid;
  transition: all var(--t);
}
.sr-rate-btn.hard {
  border-color: rgba(244, 67, 54, 0.2); color: var(--red);
  background: rgba(244, 67, 54, 0.04);
}
.sr-rate-btn.okay {
  border-color: rgba(255, 193, 7, 0.2); color: var(--yellow);
  background: rgba(255, 193, 7, 0.04);
}
.sr-rate-btn.easy {
  border-color: rgba(76, 175, 80, 0.2); color: var(--green);
  background: rgba(76, 175, 80, 0.04);
}
.sr-rate-btn:hover { transform: translateY(-2px); }
.sr-rate-btn.hard:hover { background: rgba(244, 67, 54, 0.1); border-color: rgba(244, 67, 54, 0.35); }
.sr-rate-btn.okay:hover { background: rgba(255, 193, 7, 0.1); border-color: rgba(255, 193, 7, 0.35); }
.sr-rate-btn.easy:hover { background: rgba(76, 175, 80, 0.1); border-color: rgba(76, 175, 80, 0.35); }

.sr-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
  background: rgba(26, 29, 35, 0.95);
  border-top: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); z-index: 50;
}
.sr-nav-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 750;
  border: 1px solid var(--border-muted);
  color: var(--text-secondary); background: var(--bg-elevated);
  transition: all var(--t);
}
.sr-nav-btn:hover {
  border-color: var(--border-accent); color: var(--text-primary);
}
.sr-nav-btn.primary {
  flex: 1; justify-content: center;
  background: var(--blue); color: #fff; border-color: var(--blue);
}
.sr-nav-btn.primary:hover { opacity: 0.9; }
.sr-nav-center {
  font-size: 0.72rem; font-weight: 700; color: var(--text-muted);
  font-family: 'Geist Mono', monospace;
}

/* ── Screen: Stats Analysis ──────────────────────────────── */
.stats-body { padding-bottom: calc(var(--bnav-h) + 24px); }
.stats-overview-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.s-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 18px 14px; text-align: center;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow-card);
}
.s-card-num {
  font-size: 2rem; font-weight: 850; color: var(--text-primary);
  font-family: 'Geist Mono', monospace;
}
.s-card-label {
  font-size: 0.62rem; color: var(--text-muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.stats-subjects {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 16px 14px;
  display: flex; flex-direction: column; gap: 16px;
}
.stat-sub-row { display: flex; flex-direction: column; gap: 6px; }
.stat-sub-info {
  display: flex; justify-content: space-between;
  font-size: 0.78rem; font-weight: 600;
}
.stat-sub-info span:first-child { color: var(--text-primary); }
.stat-sub-info span:last-child {
  color: var(--text-muted); font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
}
.stat-sub-bar-track {
  height: 5px; background: rgba(255, 255, 255, 0.05);
  border-radius: 3px; overflow: hidden;
}
.stat-sub-bar-fill {
  height: 100%; border-radius: 3px; width: 0%;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.physics-bar { background: linear-gradient(90deg, var(--orange), #ffb74d); }
.chemistry-bar { background: linear-gradient(90deg, var(--green), #66bb6a); }
.math-bar { background: linear-gradient(90deg, var(--blue), #64b5f6); }

.empty-state-text {
  font-size: 0.74rem; color: var(--text-muted); text-align: center;
  padding: 24px 16px; background: var(--bg-surface);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  line-height: 1.5; width: 100%;
}
.weak-chapters-list {
  display: flex; flex-direction: column; gap: 6px; width: 100%;
}
.weak-chapter-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 14px 16px;
  transition: all var(--t);
}
.weak-chapter-row:hover {
  background: var(--bg-hover);
  border-color: var(--border-accent);
}
.weak-chapter-name {
  font-size: 0.8rem; font-weight: 700; color: var(--text-primary);
}
.weak-chapter-meta { display: flex; align-items: center; gap: 6px; }
.weak-chapter-rating {
  font-size: 0.62rem; font-family: 'Geist Mono', monospace; font-weight: 600;
  padding: 3px 8px; border-radius: var(--radius-pill);
  border: 1px solid rgba(244, 67, 54, 0.25); color: var(--red);
  background: rgba(244, 67, 54, 0.05);
}

.test-history-list {
  display: flex; flex-direction: column; gap: 6px; width: 100%;
}
.history-item {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 14px 16px;
  transition: all var(--t);
}
.history-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-accent);
}
.history-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.history-title {
  font-size: 0.8rem; font-weight: 700; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-details {
  font-size: 0.64rem; color: var(--text-muted);
  font-family: 'Geist Mono', monospace;
}
.history-score-wrap {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
.history-score {
  font-size: 1.1rem; font-weight: 850; color: var(--text-primary);
  font-family: 'Geist Mono', monospace;
}
.history-score.high { color: var(--green); }
.history-score.med { color: var(--yellow); }
.history-score.low { color: var(--red); }
.history-pct {
  font-size: 0.6rem; color: var(--text-muted); font-weight: 600;
  font-family: 'Geist Mono', monospace;
}

/* Review solution container inside test mode */
.test-solution-card {
  animation: slideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Keyframe Animations ────────────────────────────────── */
@keyframes screenIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes rippleAnim {
  to { transform: scale(2.2); opacity: 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
@keyframes checkPop {
  0% { transform: scale(0.8); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.chapter-item {
  animation: fadeUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.topic-card {
  animation: fadeUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.mode-card {
  animation: fadeUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.chapter-item:nth-child(1) { animation-delay: 0.02s; }
.chapter-item:nth-child(2) { animation-delay: 0.04s; }
.chapter-item:nth-child(3) { animation-delay: 0.06s; }
.chapter-item:nth-child(4) { animation-delay: 0.08s; }
.chapter-item:nth-child(5) { animation-delay: 0.10s; }
.chapter-item:nth-child(6) { animation-delay: 0.12s; }
.chapter-item:nth-child(7) { animation-delay: 0.14s; }
.chapter-item:nth-child(8) { animation-delay: 0.16s; }

.topic-card:nth-child(1) { animation-delay: 0.02s; }
.topic-card:nth-child(2) { animation-delay: 0.04s; }
.topic-card:nth-child(3) { animation-delay: 0.06s; }
.topic-card:nth-child(4) { animation-delay: 0.08s; }

/* ── Responsive Viewports ────────────────────────────────── */
@media(min-width: 768px) {
  .screen#screen-home { flex-direction: column; }
  .home-body { padding-bottom: calc(var(--bnav-h) + 24px); }

  .topic-grid { grid-template-columns: repeat(3, 1fr); }
  .test-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .sr-options-preview { grid-template-columns: repeat(4, 1fr); }
}

@media(min-width: 1024px) {
  #btn-menu { display: none; }

  .screen#screen-home {
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-rows: var(--topnav-h) 1fr;
  }
  .screen#screen-home .topnav { grid-column: 1 / -1; }
  .screen#screen-home .drawer {
    position: sticky; top: var(--topnav-h);
    height: calc(100dvh - var(--topnav-h));
    left: 0; width: 280px; transform: none;
    border-right: 1px solid var(--border-subtle);
    display: flex;
  }
  .screen#screen-home .drawer-overlay { display: none !important; }
  .bottom-nav { display: none !important; }
  .screen#screen-home .home-body { padding-bottom: 20px; }
  .screen#screen-home .subject-pill-row { display: none; }

  .topic-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Desktop Floating Dock ─────────────────────────────── */
.desktop-floating-dock {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 10px 24px;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-float);
  z-index: 100;
}
.fdock-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--t);
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.fdock-btn:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}
.fdock-sep {
  width: 1px;
  height: 16px;
  background: var(--border-subtle);
}
@media (min-width: 1024px) {
  .desktop-floating-dock {
    display: flex;
  }
}

/* ── Selection & Focus ────────────────────────────────────── */
::selection {
  background: rgba(74, 158, 255, 0.3);
  color: var(--text-primary);
}

/* ── MathJax Override ─────────────────────────────────────── */
mjx-container {
  font-size: 100% !important;
  overflow-x: auto;
}

/* ============================================================
   TEST MAKER & TEST ANALYSER — NEW PREMIUM STYLES
   ============================================================ */

/* ── Test Maker Screen ───────────────────────────────────── */
.maker-body {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
  padding-bottom: calc(var(--bnav-h) + 120px) !important;
}

/* Stepper progress */
.maker-stepper {
  margin-bottom: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}
.step-progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}
.step-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.step-labels {
  display: flex;
  justify-content: space-between;
}
.step-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--t);
}
.step-label.active {
  color: var(--blue);
  font-weight: 800;
}

/* Choice Cards & Grids */
.exam-grid, .subject-select-grid, .source-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 10px;
}
.source-grid {
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 580px) {
  .exam-grid, .subject-select-grid {
    grid-template-columns: 1fr;
  }
  .source-grid {
    grid-template-columns: 1fr;
  }
}

.select-card {
  position: relative;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all var(--t);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 80px;
}
.select-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-hover);
  transform: translateY(-1px);
}
.select-card.active {
  border-color: var(--blue);
  background: rgba(74, 158, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}
.select-card__check {
  position: absolute;
  top: 8px; right: 8px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: all var(--t);
}
.select-card.active .select-card__check {
  opacity: 1;
  transform: scale(1);
}
.select-card__title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}
.select-card__desc {
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-top: 4px;
  pointer-events: none;
}

/* Subject selection specific icons */
.subject-card__icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.subject-card__icon.physics { background: rgba(255, 152, 0, 0.1); color: var(--orange); }
.subject-card__icon.chemistry { background: rgba(76, 175, 80, 0.1); color: var(--green); }
.subject-card__icon.math { background: rgba(74, 158, 255, 0.1); color: var(--blue); }

.source-card__icon {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

/* Switch Row toggle switch */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.switch-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.switch-emoji { font-size: 1.15rem; }
.switch-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background-color: rgba(255,255,255,0.08);
  transition: .3s; border-radius: 24px;
  border: 1px solid var(--border-muted);
}
.slider:before {
  position: absolute; content: "";
  height: 16px; width: 16px; left: 3px; bottom: 3px;
  background-color: var(--text-secondary);
  transition: .3s; border-radius: 50%;
}
.toggle-switch input:checked + .slider {
  background-color: var(--blue);
}
.toggle-switch input:checked + .slider:before {
  transform: translateX(18px);
  background-color: #ffffff;
}

/* Collapsible Accordions for Subject chapter loading */
.maker-subjects-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.accordion-subject-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--t);
}
.accordion-subject-row.open {
  border-color: var(--border-accent);
}
.accordion-subject-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.acc-subject-badge {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex-shrink: 0;
}
.acc-subject-badge.physics { background: rgba(255, 152, 0, 0.15); color: var(--orange); }
.acc-subject-badge.chemistry { background: rgba(76, 175, 80, 0.15); color: var(--green); }
.acc-subject-badge.math { background: rgba(74, 158, 255, 0.15); color: var(--blue); }

.acc-subject-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.acc-subject-name { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }
.acc-subject-count { font-size: 0.68rem; color: var(--text-muted); font-family: 'Geist Mono', monospace; }

.btn-show-units {
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--blue);
  background: rgba(74, 158, 255, 0.08);
  border: 1px solid rgba(74, 158, 255, 0.15);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t);
}
.btn-show-units:hover {
  background: rgba(74, 158, 255, 0.15);
  border-color: var(--blue);
}

.accordion-subject-content {
  padding: 16px;
  background: rgba(0, 0, 0, 0.12);
  border-top: 1px solid var(--border-subtle);
  max-height: 400px;
  overflow-y: auto;
}

/* Units and chapters lists */
.unit-section {
  margin-bottom: 20px;
}
.unit-section:last-child { margin-bottom: 0; }
.unit-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 10px;
}
.unit-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.unit-checkbox-input {
  cursor: pointer;
  width: 15px; height: 15px;
}
.unit-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-primary);
}
.unit-chapter-count {
  font-size: 0.66rem;
  color: var(--text-muted);
  font-family: 'Geist Mono', monospace;
  margin-left: 6px;
}
.btn-toggle-unit {
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
}
.btn-toggle-unit:hover { color: var(--text-primary); }

.chapter-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media(max-width:580px){
  .chapter-checkbox-grid { grid-template-columns: 1fr; }
}
.chapter-checkbox-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  transition: all var(--t);
  user-select: none;
}
.chapter-checkbox-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-accent);
}
.chapter-checkbox-card.checked {
  border-color: var(--blue);
  background: rgba(74, 158, 255, 0.04);
}
.chapter-check-input {
  width: 14px; height: 14px;
  cursor: pointer;
}
.chapter-check-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.2;
}
.chapter-checkbox-card.checked .chapter-check-label {
  color: var(--text-primary);
}

/* Number of Questions count select */
.qs-count-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 10px;
}
@media (max-width: 580px) {
  .qs-count-row { grid-template-columns: repeat(3, 1fr); }
}
.qs-count-pill {
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.qs-count-pill:hover {
  border-color: var(--border-accent);
  background: var(--bg-hover);
}
.qs-count-pill.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
}
.premium-badge {
  font-size: 0.68rem;
}

/* Duration card controls */
.duration-adjuster-card {
  margin-top: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.duration-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}
.btn-duration-adj {
  width: 44px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-muted);
  background: var(--bg-elevated);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t);
  color: var(--text-primary);
}
.btn-duration-adj:hover {
  background: var(--bg-hover);
  border-color: var(--border-accent);
}
.duration-display {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--blue);
  min-width: 90px;
  text-align: center;
}
.duration-sub-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: 'Geist Mono', monospace;
}

/* Stepper Navigation buttons */
.maker-nav-row {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.maker-nav-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 750;
  cursor: pointer;
  text-align: center;
  transition: all var(--t);
}
.maker-nav-btn.primary {
  background: var(--blue);
  color: #fff;
}
.maker-nav-btn.primary:hover {
  background: #3b88e0;
}
.maker-nav-btn.secondary {
  background: transparent;
  border: 1px solid var(--border-muted);
  color: var(--text-secondary);
}
.maker-nav-btn.secondary:hover {
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
}

/* Bottom floating preview/start bar */
.test-preview-dock {
  position: fixed;
  bottom: calc(var(--bnav-h) + 30px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 680px;
  background: rgba(33, 37, 43, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-float);
  z-index: 90;
}
@media (max-width: 580px) {
  .test-preview-dock {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    bottom: calc(var(--bnav-h) + 20px);
  }
}
.dock-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dock-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dock-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.dock-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
}
.dock-pill.exam-pill {
  background: rgba(74, 158, 255, 0.1);
  color: var(--blue);
}
.dock-pill.sub-pill {
  background: rgba(255, 255, 255, 0.06);
}

.btn-start-test-maker {
  padding: 10px 24px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--t);
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.25);
}
.btn-start-test-maker:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(74, 158, 255, 0.4);
}


/* ── Test Analyser Dashboard ────────────────────────────── */
.analyzer-container {
  display: flex;
  flex: 1;
  background: var(--bg-base);
  height: calc(100vh - var(--topnav-h));
  overflow: hidden;
}
@media (max-width: 768px) {
  .analyzer-container {
    flex-direction: column;
  }
}

/* Sticky Sidebar menu on Desktop */
.analyzer-sidebar {
  width: 260px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 16px 8px;
}
@media (max-width: 768px) {
  .analyzer-sidebar {
    display: none;
  }
}

.analyzer-sidebar__header {
  padding: 4px 12px 14px;
  display: flex;
  flex-direction: column;
}
.analyzer-sidebar__title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.analyzer-sidebar__sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: 'Geist Mono', monospace;
  margin-top: 2px;
}

.toggle-pill-row {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
  margin: 0 8px 16px;
}
.toggle-pill {
  flex: 1;
  padding: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--t);
  text-align: center;
}
.toggle-pill.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.analyzer-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 650;
  transition: all var(--t);
  text-align: left;
  cursor: pointer;
}
.menu-item:hover {
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
}
.menu-item.active {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
}
.menu-icon { font-size: 0.95rem; }

/* Scrollable Horizontal pills on Mobile */
.analyzer-mobile-tabs {
  display: none;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 12px;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.analyzer-mobile-tabs::-webkit-scrollbar { display: none; }
@media (max-width: 768px) {
  .analyzer-mobile-tabs { display: flex; }
}
.mobile-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-muted);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
}
.mobile-tab.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* Main Dashboard content display panel */
.analyzer-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 24px;
}
@media (max-width: 768px) {
  .analyzer-content {
    padding: 16px 16px calc(var(--bnav-h) + 20px);
  }
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-shrink: 0;
}
@media (max-width: 580px) {
  .panel-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
}
.panel-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.panel-actions {
  display: flex;
  gap: 8px;
}
@media(max-width: 580px) {
  .panel-actions {
    flex-direction: column;
  }
}
.panel-btn {
  padding: 8px 16px;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--t);
}
.panel-btn.primary {
  background: var(--blue);
  color: #fff;
}
.panel-btn.primary:hover { background: #3b88e0; }
.panel-btn.secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  color: var(--text-secondary);
}
.panel-btn.secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.panel-view-container {
  flex: 1;
}
.panel-view {
  animation: fadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Overall Jumbo Score card layout */
.score-card-jumbo {
  position: relative;
  background: linear-gradient(135deg, rgba(33, 37, 43, 0.95), rgba(40, 44, 52, 0.95));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  overflow: hidden;
}
@media (max-width: 580px) {
  .score-card-jumbo {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
}

.score-card-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sc-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sc-score-ratio {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.sc-score-num {
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.sc-score-den {
  font-size: 1.3rem;
  font-weight: 650;
  color: var(--text-muted);
}

.score-card-subjects {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sc-sub-score {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.sc-sub-score b { color: var(--text-primary); font-weight: 700; font-family: 'Geist Mono', monospace; }
.sc-sub-color {
  width: 8px; height: 8px; border-radius: 50%;
}


/* 3x2 metrics dashboard grid */
.analyzer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 992px) {
  .analyzer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 580px) {
  .analyzer-grid {
    grid-template-columns: 1fr;
  }
}

.metrics-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 100px;
}
.mcard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.mcard-title {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.mcard-info-icon {
  font-size: 0.74rem;
  cursor: help;
  color: var(--text-muted);
  opacity: 0.6;
}
.mcard-info-icon:hover { opacity: 1; }
.mcard-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.mcard-value sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}
.mcard-btn {
  position: absolute;
  bottom: 12px; right: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--blue);
  background: rgba(74, 158, 255, 0.08);
  border: 1px solid rgba(74, 158, 255, 0.15);
  cursor: pointer;
  transition: all var(--t);
}
.mcard-btn:hover {
  background: rgba(74, 158, 255, 0.15);
  transform: translateY(-0.5px);
}

/* Learnings notes logs card */
.learnings-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.learnings-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.learnings-icon { font-size: 1.3rem; }
.learnings-title-wrap { display: flex; flex-direction: column; }
.learnings-title { font-size: 0.9rem; font-weight: 750; color: var(--text-primary); }
.learnings-sub { font-size: 0.68rem; color: var(--text-muted); margin-top: 1px; }

.learnings-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.learning-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1.5px solid var(--border-subtle);
  padding: 6px 4px;
  transition: border-color var(--t);
}
.learning-input-wrap:focus-within {
  border-color: var(--blue);
}
.learning-plus {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.86rem;
}
.learning-input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: inherit;
}
.learning-input-field::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}


/* ── Dynamic panels details visual charts ────────────────── */
.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.panel-card:last-child { margin-bottom: 0; }
.panel-card__title {
  font-size: 0.88rem;
  font-weight: 750;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* Performance compare bars */
.perf-stat-row {
  margin-bottom: 16px;
}
.perf-stat-row:last-child { margin-bottom: 0; }
.perf-stat-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.perf-stat-label-left { font-weight: 700; color: var(--text-primary); }
.perf-bars-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.perf-bar-track {
  height: 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.perf-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.perf-bar-fill.user {
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}
.perf-bar-fill.avg {
  background: var(--text-muted);
}
.perf-bar-fill.topper {
  background: linear-gradient(90deg, var(--purple), var(--pink));
}
.perf-legend-indicator {
  display: flex;
  gap: 14px;
  font-size: 0.68rem;
  margin-top: 10px;
  color: var(--text-secondary);
}
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-color { width: 8px; height: 8px; border-radius: 50%; }

/* Score potential stats list */
.potential-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.potential-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
}
.potential-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.potential-emoji { font-size: 1.15rem; }
.potential-text-wrap { display: flex; flex-direction: column; }
.potential-title { font-size: 0.8rem; font-weight: 750; color: var(--text-primary); }
.potential-desc { font-size: 0.66rem; color: var(--text-muted); margin-top: 1px; }
.potential-val {
  font-size: 0.95rem;
  font-weight: 800;
  font-family: 'Geist Mono', monospace;
}
.potential-val.pos { color: var(--green); }
.potential-val.neg { color: var(--red); }

/* Difficulty cards rows */
.diff-chart-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.diff-chart-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.diff-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 700;
}
.diff-label-easy { color: var(--green); }
.diff-label-medium { color: var(--yellow); }
.diff-label-hard { color: var(--red); }
.diff-ratio { color: var(--text-secondary); font-family: 'Geist Mono', monospace; }

/* Question journey sequence grid */
.journey-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 0;
}
.journey-node {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--t);
  font-family: 'Geist Mono', monospace;
  position: relative;
  user-select: none;
}
.journey-node:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.journey-node.correct {
  background: rgba(76, 175, 80, 0.12);
  border-color: var(--green);
  color: var(--green);
}
.journey-node.wrong {
  background: rgba(244, 67, 54, 0.12);
  border-color: var(--red);
  color: var(--red);
}
.journey-node.skipped {
  background: rgba(255,255,255,0.02);
  border-color: var(--text-muted);
  color: var(--text-secondary);
}
.journey-node.marked::after {
  content: '';
  position: absolute;
  top: 2px; right: 2px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--orange);
}

/* Time analytics bars */
.time-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media(max-width: 580px) {
  .time-stat-grid { grid-template-columns: 1fr; }
}
.time-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.time-stat-icon {
  font-size: 1.6rem;
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.03);
}
.time-stat-info { display: flex; flex-direction: column; }
.time-stat-label { font-size: 0.68rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; }
.time-stat-value { font-size: 1.15rem; font-weight: 800; color: var(--text-primary); font-family: 'Geist Mono', monospace; }

/* Subject movement timeline items */
.timeline-track {
  position: relative;
  padding-left: 24px;
  border-left: 2px dashed var(--border-subtle);
  margin-left: 8px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.timeline-item {
  position: relative;
}
.timeline-dot {
  position: absolute;
  left: -29px; top: 3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border-focus);
  box-shadow: 0 0 0 4px var(--bg-base);
}
.timeline-dot.physics { background: var(--orange); }
.timeline-dot.chemistry { background: var(--green); }
.timeline-dot.math { background: var(--blue); }

.timeline-content {
  display: flex;
  flex-direction: column;
}
.timeline-header {
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--text-primary);
}
.timeline-time {
  font-size: 0.66rem;
  color: var(--text-muted);
  font-family: 'Geist Mono', monospace;
  margin-top: 1px;
}

/* Qs by Qs Analysis list items */
.qs-analysis-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qs-analysis-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  transition: all var(--t);
}
.qs-analysis-row:hover {
  background: var(--bg-hover);
  border-color: var(--border-accent);
}
.qs-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.qs-num-badge {
  width: 28px; height: 28px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-family: 'Geist Mono', monospace;
}
.qs-num-badge.correct { background: rgba(76, 175, 80, 0.15); color: var(--green); }
.qs-num-badge.wrong { background: rgba(244, 67, 54, 0.15); color: var(--red); }
.qs-num-badge.skipped { background: rgba(255,255,255,0.05); color: var(--text-secondary); }

.qs-meta-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.qs-text-preview {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qs-tags {
  display: flex;
  gap: 6px;
  margin-top: 3px;
  font-size: 0.62rem;
  color: var(--text-muted);
}
.qs-tag {
  font-family: 'Geist Mono', monospace;
}
.qs-tag-time { color: var(--cyan); }
.qs-tag-diff { text-transform: capitalize; }
.qs-tag-diff.easy { color: var(--green); }
.qs-tag-diff.medium { color: var(--yellow); }
.qs-tag-diff.hard { color: var(--red); }

.qs-btn-view-sol {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--blue);
  border: 1px solid rgba(74, 158, 255, 0.15);
  background: rgba(74, 158, 255, 0.06);
  padding: 5px 10px;
  border-radius: 4px;
  transition: all var(--t);
  flex-shrink: 0;
}
.qs-analysis-row:hover .qs-btn-view-sol {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* ── Segmented Exam Switcher ────────────────────────────── */
.exam-toggle-segmented {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
}
.segmented-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  transition: all var(--t);
  font-family: inherit;
}
.segmented-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}
.segmented-btn.active {
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.segmented-btn.active[data-exam="JEE_Advanced"] {
  background: var(--purple);
}

.mobile-exam-switcher-row {
  display: flex;
  justify-content: center;
  padding: 12px 16px 4px 16px;
}
.mobile-exam-switcher-row .exam-toggle-segmented {
  width: 100%;
}
.mobile-exam-switcher-row .segmented-btn {
  flex: 1;
  text-align: center;
}

@media(min-width: 1024px) {
  .mobile-exam-switcher-row {
    display: none;
  }
}

/* ── Difficulty Slider Card ────────────────────────────── */
.difficulty-adjuster-card {
  margin-top: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
   box-sizing: border-box;
}

/* ── Test Status Bar ────────────────────────────────────── */
.test-status-bar {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.tsb-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.tsb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.answered-dot { background: var(--blue); }
.marked-dot { background: var(--yellow); }
.unanswered-dot { background: var(--border-muted); }
.tsb-count {
  font-family: 'Geist Mono', monospace;
  font-weight: 800;
  color: var(--text-primary);
  min-width: 16px;
  text-align: center;
}
.tsb-jump-btn {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--blue);
  background: rgba(74, 158, 255, 0.08);
  border: 1px solid rgba(74, 158, 255, 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
}
.tsb-jump-btn:hover {
  background: rgba(74, 158, 255, 0.15);
  border-color: var(--blue);
}

/* ── Option Reveal Animation ── */
.option-btn {
  animation: fadeUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.option-btn:nth-child(1) { animation-delay: 0.02s; }
.option-btn:nth-child(2) { animation-delay: 0.04s; }
.option-btn:nth-child(3) { animation-delay: 0.06s; }
.option-btn:nth-child(4) { animation-delay: 0.08s; }

/* ── Result screen confetti-like badge ── */
.result-badge-icon {
  font-size: 3.5rem;
  line-height: 1;
  animation: fadeInScale 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Improve test palette responsiveness ── */
@media(max-width: 480px) {
  .test-status-bar {
    gap: 8px;
    padding: 8px 10px;
  }
  .tsb-jump-btn {
    width: 100%;
    margin-left: 0;
    text-align: center;
  }
  .tsb-item {
    font-size: 0.65rem;
  }
}

.light-mode {
  --bg-base: #ffffff;
  --bg-surface: #ffffff;
  --bg-elevated: #fafafa;
  --bg-hover: #eaeaea;
  --border-subtle: #eaeaea;
  --border-muted: #dddddd;
  --border-accent: #cccccc;
  --border-focus: #000000;
  --text-primary: #000000;
  --text-secondary: #666666;
  --text-muted: #888888;
  --text-accent: #000000;
  --blue: #0070f3;
  --green: #10b981;
  --red: #e00;
  --orange: #f5a623;
}


/* ============================================================
   DASHBOARD COMPONENTS — Premium App-like Design
   ============================================================ */

/* ── Nav Group Label in Sidebar ───────────────────────────── */
.nav-group-label {
  display: block;
  font-size: 0.58rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 6px 14px 4px;
  font-family: 'Geist Mono', monospace;
  opacity: 0.7;
}

/* Bookmarks icon color */
.subject-icon.bookmarks {
  background: rgba(255, 193, 7, 0.15);
  color: var(--yellow);
}
.subject-item.active .subject-icon.bookmarks {
  background: rgba(255, 193, 7, 0.25);
}

/* ── Dashboard Section Container ──────────────────────────── */
.dash-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dash-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dash-section__title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.dash-chapters-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  gap: 14px;
}
.dash-chapters-section .content-header {
  margin-top: 4px;
}
.dash-chapters-section .filter-bar {
  background: var(--bg-elevated);
}

/* ── Dashboard Hero Banner ────────────────────────────────── */
.dash-hero {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  overflow: hidden;
  min-height: 180px;
  display: flex;
  align-items: center;
}
.dash-hero__bg-decor,
.dash-hero__bg-decor-2 {
  display: none !important;
}
.dash-hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}
.dash-hero__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-hero__label {
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blue);
  border: 1px solid var(--border-muted);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-family: 'Geist Mono', monospace;
}
.dash-hero__title {
  font-size: 1.5rem;
  font-weight: 850;
  color: var(--text-primary);
  line-height: 1.3;
  letter-spacing: -0.03em;
}
.dash-hero__gradient-text {
  color: var(--text-primary);
}
.dash-hero__sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 480px;
}
.dash-hero__counters {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  width: fit-content;
}
.dash-hero__counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.dash-hero__counter-num {
  font-size: 1.3rem;
  font-weight: 850;
  color: var(--text-primary);
  font-family: 'Geist Mono', monospace;
  line-height: 1;
}
.dash-hero__counter-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dash-hero__counter-sep {
  width: 1px;
  height: 28px;
  background: var(--border-subtle);
}

/* ── Dashboard Quick Stats Row ────────────────────────────── */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.dash-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--t);
  box-shadow: var(--shadow-card);
}
.dash-stat-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}
.dash-stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dash-stat-value {
  font-size: 1.35rem;
  font-weight: 850;
  color: var(--text-primary);
  font-family: 'Geist Mono', monospace;
  line-height: 1;
}
.dash-stat-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .dash-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 400px) {
  .dash-stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .dash-stat-card {
    padding: 12px 10px;
    gap: 8px;
  }
  .dash-stat-icon {
    width: 34px; height: 34px;
  }
  .dash-stat-value {
    font-size: 1.1rem;
  }
}

/* ── Dashboard Quick Action Cards ─────────────────────────── */
.dash-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.dash-action-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-align: left;
  cursor: pointer;
  transition: all var(--t);
  overflow: hidden;
}
.dash-action-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-hover);
}
/* Clean left border accent (hidden in minimalist mode) */
.dash-action-border {
  display: none !important;
}
.cyan-accent, .pink-accent {
  border-color: var(--border-subtle);
  background: var(--bg-elevated);
}
.cyan-accent:hover, .pink-accent:hover {
  border-color: var(--border-accent);
  background: var(--bg-hover);
}
.dash-action-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.dash-action-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.dash-action-arrow {
  font-size: 1.3rem;
  font-weight: 400;
  opacity: 0.5;
  transition: all var(--t);
}
.dash-action-card:hover .dash-action-arrow {
  opacity: 1;
  transform: translateX(3px);
}
.dash-action-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.45;
}
.dash-action-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.66rem;
  color: var(--text-muted);
  font-family: 'Geist Mono', monospace;
  font-weight: 600;
  margin-top: 4px;
}
.dash-action-meta svg {
  flex-shrink: 0;
}
.dash-action-icon-wrap {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--t);
}
.cyan-glow {
  background: rgba(74, 158, 255, 0.08);
  color: var(--blue);
  border: 1px solid rgba(74, 158, 255, 0.15);
}
.pink-glow {
  background: rgba(240, 98, 146, 0.08);
  color: var(--pink);
  border: 1px solid rgba(240, 98, 146, 0.15);
}
.dash-action-card:hover .cyan-glow {
  background: rgba(74, 158, 255, 0.15);
  box-shadow: 0 0 20px rgba(74, 158, 255, 0.15);
}
.dash-action-card:hover .pink-glow {
  background: rgba(240, 98, 146, 0.15);
  box-shadow: 0 0 20px rgba(240, 98, 146, 0.15);
}

@media (max-width: 768px) {
  .dash-actions-row {
    grid-template-columns: 1fr;
  }
  .dash-action-card {
    padding: 18px 16px;
  }
}

/* ── Dashboard Subject Progress Cards ─────────────────────── */
.dash-subject-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.dash-subject-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all var(--t);
  box-shadow: var(--shadow-card);
}
.dash-subject-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}
.dash-subject-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-subject-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.physics-bg { background: rgba(255, 152, 0, 0.12); }
.chem-bg    { background: rgba(76, 175, 80, 0.12); }
.math-bg    { background: rgba(74, 158, 255, 0.12); }
.dash-subject-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dash-subject-name {
  font-size: 0.85rem;
  font-weight: 750;
  color: var(--text-primary);
}
.dash-subject-count {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-family: 'Geist Mono', monospace;
  font-weight: 500;
}
.dash-subject-pct {
  font-size: 0.9rem;
  font-weight: 850;
  color: var(--text-primary);
  font-family: 'Geist Mono', monospace;
  flex-shrink: 0;
}
.dash-subject-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}
.dash-subject-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.phy-fill  { background: linear-gradient(90deg, #ff9800, #ffb74d); }
.chem-fill { background: linear-gradient(90deg, #4caf50, #66bb6a); }
.math-fill { background: linear-gradient(90deg, #4a9eff, #64b5f6); }

@media (max-width: 768px) {
  .dash-subject-cards {
    grid-template-columns: 1fr;
  }
}

/* ── Dashboard Recent Activity ────────────────────────────── */
.dash-recent {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 36px 20px;
  background: var(--bg-surface);
  border: 1px dashed rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  text-align: center;
}
.dash-empty-state p {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 280px;
}
.dash-recent-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--t);
}
.dash-recent-item:hover {
  border-color: var(--border-accent);
  background: var(--bg-hover);
}
.dash-recent-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.dash-recent-icon.test-type {
  background: rgba(74, 158, 255, 0.1);
}
.dash-recent-icon.speedrun-type {
  background: rgba(255, 152, 0, 0.1);
}
.dash-recent-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dash-recent-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-recent-meta {
  font-size: 0.64rem;
  color: var(--text-muted);
  font-family: 'Geist Mono', monospace;
}
.dash-recent-score {
  font-size: 1.1rem;
  font-weight: 850;
  font-family: 'Geist Mono', monospace;
  flex-shrink: 0;
}
.dash-recent-score.high { color: var(--green); }
.dash-recent-score.med  { color: var(--yellow); }
.dash-recent-score.low  { color: var(--red); }

/* ── Dashboard Animations ─────────────────────────────────── */
.dash-hero {
  animation: fadeInScale 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.dash-stats-row {
  animation: fadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.05s;
}
.dash-actions-row {
  animation: fadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.1s;
}
.dash-section {
  animation: fadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.15s;
}
.dash-stat-card:nth-child(1) { animation: fadeUp 0.3s cubic-bezier(0.16,1,0.3,1) both; animation-delay: 0.06s; }
.dash-stat-card:nth-child(2) { animation: fadeUp 0.3s cubic-bezier(0.16,1,0.3,1) both; animation-delay: 0.09s; }
.dash-stat-card:nth-child(3) { animation: fadeUp 0.3s cubic-bezier(0.16,1,0.3,1) both; animation-delay: 0.12s; }
.dash-stat-card:nth-child(4) { animation: fadeUp 0.3s cubic-bezier(0.16,1,0.3,1) both; animation-delay: 0.15s; }

/* ── Dashboard Responsive ─────────────────────────────────── */
@media (max-width: 580px) {
  .dash-hero {
    padding: 22px 18px;
    min-height: 140px;
  }
  .dash-hero__title {
    font-size: 1.15rem;
  }
  .dash-hero__counters {
    gap: 10px;
    padding: 10px 12px;
  }
  .dash-hero__counter-num {
    font-size: 1rem;
  }
  .dash-action-icon-wrap {
    width: 40px; height: 40px;
  }
  .dash-action-icon-wrap svg {
    width: 20px; height: 20px;
  }
  .dash-chapters-section {
    padding: 14px;
  }
}

/* ── Home body gap adjustment for dashboard ───────────────── */
.home-body {
  gap: 16px;
}

/* ── Toast animation keyframes ────────────────────────────── */
@keyframes slideToastIn {
  from { opacity: 0; transform: translateX(30px) scale(0.96); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes slideToastOut {
  to { opacity: 0; transform: translateX(30px) scale(0.96); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Homepage & Notebook Features ───────────────────────── */
.landing-hero {
  animation: fadeInScale 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.section-title-premium {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
  position: relative;
  display: inline-block;
}
.section-title-premium::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 24px; height: 2px;
  background: var(--blue);
  border-radius: 2px;
}
.exam-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.exam-landing-card {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 20px;
  cursor: pointer;
  overflow: hidden;
  transition: all var(--t);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.exam-landing-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-hover);
}
.exam-landing-card.main-card,
.exam-landing-card.adv-card,
.exam-landing-card.maker-card {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
}
.exam-landing-card.main-card:hover,
.exam-landing-card.adv-card:hover,
.exam-landing-card.maker-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-hover);
  box-shadow: none;
}
.card-glow-effect,
.blue-glow,
.purple-glow,
.pink-glow {
  display: none !important;
}
.card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.exam-card-tag {
  font-family: 'Geist Mono', monospace;
  font-size: 0.58rem;
  font-weight: 800;
  color: var(--blue);
  background: rgba(74, 158, 255, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  width: fit-content;
  text-transform: uppercase;
}
.exam-card-tag.adv {
  color: var(--purple);
  background: rgba(179, 136, 255, 0.1);
}
.exam-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 4px;
}
.exam-card-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-top: 4px;
}
.exam-card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.card-meta-detail {
  font-family: 'Geist Mono', monospace;
  font-size: 0.64rem;
  color: var(--text-muted);
}
.card-meta-dot {
  width: 3px; height: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  opacity: 0.5;
}
.card-arrow-wrap {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: all var(--t);
  flex-shrink: 0;
}
.exam-landing-card:hover .card-arrow-wrap {
  background: var(--text-primary);
  color: var(--bg-base);
  border-color: var(--text-primary);
  transform: translateX(4px);
}
.btn-premium-sm {
  display: flex; align-items: center; justify-content: center;
  padding: 6px 14px; font-size: 0.74rem; font-weight: 700;
  border-radius: var(--radius-sm);
  background: var(--text-primary);
  color: var(--bg-base);
  border: 1px solid var(--text-primary);
  transition: all var(--t);
}
.btn-premium-sm:hover {
  background: transparent;
  color: var(--text-primary);
}

.notebooks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.notebook-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--t);
}
.notebook-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.notebook-card-icon {
  font-size: 1.8rem;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.notebook-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notebook-card-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notebook-card-qs {
  font-family: 'Geist Mono', monospace;
  font-size: 0.64rem;
  color: var(--text-secondary);
}
.notebook-card-date {
  font-size: 0.62rem;
  color: var(--text-muted);
}
.btn-delete-notebook {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all var(--t);
}
.btn-delete-notebook:hover {
  background: rgba(244, 67, 54, 0.15);
  color: var(--red);
}

/* Notebook Modal Styles */
.notebook-modal {
  animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: translate(-50%, -45%) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Notebook view list styles */
.notebook-question-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.notebook-note-card {
  background: rgba(255, 193, 7, 0.03);
  border: 1px dashed rgba(255, 193, 7, 0.25);
  border-radius: var(--radius-md);
  padding: 12px;
  position: relative;
}
.notebook-note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--orange);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.notebook-note-text {
  font-size: 0.8rem;
  color: var(--text-primary);
  line-height: 1.4;
  white-space: pre-wrap;
}
.notebook-note-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}
.btn-note-action {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--t);
}
.btn-note-action:hover {
  color: var(--text-primary);
}
.btn-note-action.delete {
  color: var(--red);
  opacity: 0.8;
}
.btn-note-action.delete:hover {
  opacity: 1;
}

/* Styles for Notebook selector/adder inside modal */
#notebook-select {
  transition: border-color var(--t);
}
#notebook-select:focus {
  border-color: var(--border-focus);
}

.exam-landing-card.maker-card:hover {
  border-color: var(--border-accent);
}

/* Notebook Tags Selection & Filters */
.tag-pill {
  transition: all var(--t) !important;
}
.tag-pill:hover {
  border-color: var(--border-focus) !important;
  color: var(--text-primary) !important;
}
.tag-pill.active[data-tag="tricky"] { background: rgba(244, 67, 54, 0.15) !important; border-color: #f44336 !important; color: #f44336 !important; }
.tag-pill.active[data-tag="hard"] { background: rgba(255, 152, 0, 0.15) !important; border-color: #ff9800 !important; color: #ff9800 !important; }
.tag-pill.active[data-tag="easy"] { background: rgba(76, 175, 80, 0.15) !important; border-color: #4caf50 !important; color: #4caf50 !important; }
.tag-pill.active[data-tag="theoretical"] { background: rgba(33, 150, 243, 0.15) !important; border-color: #2196f3 !important; color: #2196f3 !important; }
.tag-pill.active[data-tag="conceptual"] { background: rgba(156, 39, 176, 0.15) !important; border-color: #9c27b0 !important; color: #9c27b0 !important; }

/* Filter tag buttons */
.filter-tag-btn {
  transition: all var(--t) !important;
}
.filter-tag-btn:hover {
  border-color: var(--border-focus) !important;
}
.filter-tag-btn.active[data-tag="all"] { background: var(--border-accent) !important; border-color: var(--blue) !important; color: var(--blue) !important; }
.filter-tag-btn.active[data-tag="tricky"] { background: rgba(244, 67, 54, 0.15) !important; border-color: #f44336 !important; color: #f44336 !important; }
.filter-tag-btn.active[data-tag="hard"] { background: rgba(255, 152, 0, 0.15) !important; border-color: #ff9800 !important; color: #ff9800 !important; }
.filter-tag-btn.active[data-tag="easy"] { background: rgba(76, 175, 80, 0.15) !important; border-color: #4caf50 !important; color: #4caf50 !important; }
.filter-tag-btn.active[data-tag="theoretical"] { background: rgba(33, 150, 243, 0.15) !important; border-color: #2196f3 !important; color: #2196f3 !important; }
.filter-tag-btn.active[data-tag="conceptual"] { background: rgba(156, 39, 176, 0.15) !important; border-color: #9c27b0 !important; color: #9c27b0 !important; }

/* Notebook dynamic tag badges */
.qbadge.tag-badge-tricky { background: rgba(244, 67, 54, 0.12); color: #f44336; border: 1px solid rgba(244, 67, 54, 0.2); }
.qbadge.tag-badge-hard { background: rgba(255, 152, 0, 0.12); color: #ff9800; border: 1px solid rgba(255, 152, 0, 0.2); }
.qbadge.tag-badge-easy { background: rgba(76, 175, 80, 0.12); color: #4caf50; border: 1px solid rgba(76, 175, 80, 0.2); }
.qbadge.tag-badge-theoretical { background: rgba(33, 150, 243, 0.12); color: #2196f3; border: 1px solid rgba(33, 150, 243, 0.2); }
.qbadge.tag-badge-conceptual { background: rgba(156, 39, 176, 0.12); color: #9c27b0; border: 1px solid rgba(156, 39, 176, 0.2); }

/* MARKS Tests Landing & Custom Library Cards */
.tests-landing-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus) !important;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

.custom-test-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}
.custom-test-card:hover {
  border-color: var(--border-focus);
  background: var(--bg-elevated);
}
.custom-test-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.custom-test-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-primary);
}
.custom-test-meta {
  font-size: 0.76rem;
  color: var(--text-secondary);
}
.custom-test-cta {
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  background: transparent;
  border: none;
  transition: all 0.2s ease;
}
.custom-test-cta.attempt {
  color: var(--blue);
}
.custom-test-cta.attempt:hover {
  color: var(--text-accent);
}
.custom-test-cta.analysis {
  color: var(--green);
}
.custom-test-cta.analysis:hover {
  color: #81c784;
}

.filter-tag-btn.active[data-filter="all"] { background: var(--border-accent) !important; border-color: var(--blue) !important; color: var(--blue) !important; }
.filter-tag-btn.active[data-filter="attempted"] { background: rgba(76, 175, 80, 0.15) !important; border-color: #4caf50 !important; color: #4caf50 !important; }
.filter-tag-btn.active[data-filter="not_attempted"] { background: rgba(255, 152, 0, 0.15) !important; border-color: #ff9800 !important; color: #ff9800 !important; }

@media (max-width: 480px) {
  .custom-test-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }
  .custom-test-cta {
    align-self: flex-end;
  }
}

