/* ==========================================================================
   CAT Mastery - Material Design System
   Clean, modern, Material-inspired dark theme
   ========================================================================== */

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

:root {
  /* Material Dark Surface Colors */
  --md-sys-surface: #1c1b1f;
  --md-sys-surface-dim: #141318;
  --md-sys-surface-bright: #3b3a3f;
  --md-sys-surface-container-lowest: #0f0e13;
  --md-sys-surface-container-low: #1a1920;
  --md-sys-surface-container: #1e1d24;
  --md-sys-surface-container-high: #29282e;
  --md-sys-surface-container-highest: #343239;
  --md-sys-surface-tint: #d0bcff;

  /* Material Primary */
  --md-sys-primary: #6a5acd;       /* softer indigo */
  --md-sys-primary-light: #8b7beb;
  --md-sys-primary-container: #4a3f8a;
  --md-sys-on-primary: #ffffff;
  --md-sys-on-primary-container: #e8dfff;

  /* Material Secondary */
  --md-sys-secondary: #10b981;     /* emerald */
  --md-sys-secondary-container: #065f46;
  
  /* Tertiary / Accent */
  --md-sys-tertiary: #0ea5e9;      /* sky blue */
  --md-sys-tertiary-container: #075985;

  /* Error */
  --md-sys-error: #ef4444;
  --md-sys-error-container: #7f1d1d;

  /* Neutral */
  --md-sys-on-surface: #e6e1e5;
  --md-sys-on-surface-variant: #cac4d0;
  --md-sys-outline: #938f99;
  --md-sys-outline-variant: #49454f;

  /* Elevation (Material shadows) */
  --md-elevation-1: 0 1px 3px 1px rgba(0,0,0,0.15), 0 1px 2px 0 rgba(0,0,0,0.3);
  --md-elevation-2: 0 2px 6px 2px rgba(0,0,0,0.15), 0 1px 2px 0 rgba(0,0,0,0.3);
  --md-elevation-3: 0 4px 8px 3px rgba(0,0,0,0.15), 0 1px 3px 0 rgba(0,0,0,0.3);
  --md-elevation-4: 0 6px 12px 4px rgba(0,0,0,0.2), 0 2px 4px 0 rgba(0,0,0,0.3);
  --md-elevation-5: 0 8px 16px 6px rgba(0,0,0,0.2), 0 4px 8px 0 rgba(0,0,0,0.3);

  /* Shape (border-radius) */
  --md-shape-xs: 4px;
  --md-shape-sm: 8px;
  --md-shape-md: 12px;
  --md-shape-lg: 16px;
  --md-shape-xl: 24px;
  --md-shape-full: 9999px;

  /* Typography scale */
  --md-font: 'Inter', system-ui, -apple-system, sans-serif;
  --md-font-mono: 'JetBrains Mono', monospace;
  --md-label-sm: 0.75rem;
  --md-label-md: 0.875rem;
  --md-body-md: 1rem;
  --md-body-lg: 1.125rem;
  --md-title-sm: 1rem;
  --md-title-md: 1.25rem;
  --md-title-lg: 1.5rem;
  --md-headline-sm: 1.75rem;
  --md-headline-md: 2rem;
  --md-headline-lg: 2.5rem;

  /* Transition tokens */
  --md-duration: 0.2s;
  --md-easing: cubic-bezier(0.2, 0, 0, 1);

  /* Legacy aliases – keep existing variable names */
  --bg-main: var(--md-sys-surface-dim);
  --bg-surface: var(--md-sys-surface-container);
  --bg-card: var(--md-sys-surface-container);
  --bg-card-hover: var(--md-sys-surface-container-high);
  --primary: var(--md-sys-primary);
  --primary-light: var(--md-sys-primary-light);
  --primary-glow: rgba(106, 90, 205, 0.2);
  --accent: var(--md-sys-tertiary);
  --accent-glow: rgba(14, 165, 233, 0.2);
  --success: var(--md-sys-secondary);
  --success-glow: rgba(16, 185, 129, 0.1);
  --danger: var(--md-sys-error);
  --text-color: var(--md-sys-on-surface);
  --text-muted: var(--md-sys-on-surface-variant);
  --text-dim: var(--md-sys-outline);
  --border: var(--md-sys-outline-variant);
  --border-hover: var(--md-sys-outline);
  --border-color: var(--md-sys-outline-variant);
  --radius-sm: var(--md-shape-sm);
  --radius-md: var(--md-shape-md);
  --radius-lg: var(--md-shape-lg);
  --radius-full: var(--md-shape-full);
  --shadow-sm: var(--md-elevation-1);
  --shadow-md: var(--md-elevation-2);
  --shadow-lg: var(--md-elevation-3);
  --shadow-xl: var(--md-elevation-4);
  --glass-bg: var(--md-sys-surface-container);
  --glass-border: var(--md-sys-outline-variant);
  --bg-color: var(--md-sys-surface-dim);
}

/* ==========================================================================
   Base / Reset
   ========================================================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg-main);
  color: var(--text-color);
  font-family: var(--md-font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--md-sys-primary); color: white; }

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--md-font);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-color);
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ==========================================================================
   Layout: App Container
   ========================================================================== */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* ==========================================================================
   Sidebar – Material Navigation Drawer
   ========================================================================== */
.sidebar {
  width: 280px;
  background: var(--md-sys-surface-container);
  border-right: 1px solid var(--md-sys-outline-variant);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 12px;
  transition: width 0.3s var(--md-easing), padding 0.3s var(--md-easing);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 8px;
}

.sidebar-header .logo { display: flex; align-items: center; gap: 12px; margin: 0; padding: 0; }

.sidebar-collapse-btn {
  position: absolute;
  right: -12px;
  top: 50vh;
  transform: translateY(-50%);
  width: 24px; height: 32px;
  background: var(--md-sys-surface-container-high);
  border: 1px solid var(--md-sys-outline-variant);
  border-radius: 0 var(--md-shape-xs) var(--md-shape-xs) 0;
  color: var(--md-sys-on-surface-variant);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.3s var(--md-easing);
  z-index: 101;
  box-shadow: var(--md-elevation-2);
}
.sidebar-collapse-btn:hover {
  background: var(--md-sys-primary);
  color: white;
  border-color: var(--md-sys-primary);
}

.sidebar.collapsed .sidebar-collapse-btn { transform: translateY(-50%) rotate(180deg); }
.sidebar.collapsed { width: 72px; padding: 16px 8px; }

/* Collapsed hide text */
.sidebar .logo h2,
.sidebar .tab-item span,
.sidebar .nav-title,
.sidebar .btn-daily span,
.sidebar .btn-browse span,
.sidebar .daily-badge-dot,
.sidebar .stats-info p,
.sidebar .active-topic-info {
  transition: opacity 0.2s ease, visibility 0.2s ease, max-width 0.2s ease;
  opacity: 1; visibility: visible; white-space: nowrap; max-width: 200px;
}
.sidebar.collapsed .logo h2,
.sidebar.collapsed .tab-item span,
.sidebar.collapsed .nav-title,
.sidebar.collapsed .btn-daily span,
.sidebar.collapsed .btn-browse span,
.sidebar.collapsed .daily-badge-dot,
.sidebar.collapsed .stats-info p,
.sidebar.collapsed .active-topic-info {
  opacity: 0; visibility: hidden; max-width: 0; overflow: hidden; pointer-events: none;
  margin: 0 !important; padding: 0 !important;
}
.sidebar.collapsed .logo { justify-content: center; margin-bottom: 32px; }
.sidebar.collapsed .tab-item { padding: 10px; justify-content: center; gap: 0; }
.sidebar.collapsed .tab-icon { width: 22px; height: 22px; }
.sidebar.collapsed .btn-daily,
.sidebar.collapsed .btn-browse { padding: 10px; justify-content: center; width: 44px; margin: 0 auto 8px; gap: 0; }
.sidebar.collapsed .stats-footer { border: none; }
.sidebar.collapsed .stats-info span { font-size: 1rem; }
.sidebar.collapsed .sidebar-header { justify-content: center; }

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--md-sys-primary), var(--md-sys-tertiary));
  border-radius: var(--md-shape-sm);
  position: relative;
  flex-shrink: 0;
}
.logo-icon::after {
  content: '';
  position: absolute; inset: 2px;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 6px;
}
.logo h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.03em;
}
.logo h2 span { color: var(--md-sys-primary-light); }

/* Sidebar Nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  gap: 8px;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--md-sys-outline-variant); border-radius: 10px; }

.nav-section { margin-bottom: 16px; }
.nav-title {
  font-size: var(--md-label-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--md-sys-outline);
  margin-bottom: 8px;
  padding: 0 12px;
}

.tabs-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }

.tab-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--md-shape-md);
  color: var(--md-sys-on-surface-variant);
  font-weight: 600;
  font-size: var(--md-label-md);
  cursor: pointer;
  transition: all var(--md-duration) var(--md-easing);
  border: none;
  position: relative;
}
.tab-item:hover { background: var(--md-sys-surface-container-high); color: var(--md-sys-on-surface); }
.tab-item.active {
  background: rgba(106, 90, 205, 0.12);
  color: var(--md-sys-primary-light);
}
.tab-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--md-sys-primary);
  border-radius: 0 3px 3px 0;
}
.tab-icon { width: 20px; height: 20px; flex-shrink: 0; transition: transform var(--md-duration) var(--md-easing); }
.tab-item:hover .tab-icon { transform: translateX(2px); }

.btn-daily, .btn-browse {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; width: 100%;
  background: none;
  border: 1px solid var(--md-sys-outline-variant);
  border-radius: var(--md-shape-md);
  color: var(--md-sys-on-surface);
  font-weight: 600;
  font-size: var(--md-label-md);
  cursor: pointer;
  transition: all var(--md-duration) var(--md-easing);
  margin-bottom: 6px;
}
.btn-daily:hover, .btn-browse:hover {
  background: var(--md-sys-surface-container-high);
  border-color: var(--md-sys-outline);
}
.btn-daily svg, .btn-browse svg { color: var(--md-sys-primary-light); flex-shrink: 0; }

.daily-badge-dot {
  width: 6px; height: 6px;
  background: var(--md-sys-tertiary);
  border-radius: 50%;
  margin-left: auto;
}

.active-topic-info {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--md-sys-surface-container-low);
  border-radius: var(--md-shape-sm);
  border: 1px solid var(--md-sys-outline-variant);
}
.active-topic-info .label {
  display: block;
  font-size: 0.65rem; color: var(--md-sys-outline);
  text-transform: uppercase; font-weight: 700;
  margin-bottom: 2px;
}
.active-topic-info .name { display: block; font-weight: 700; color: white; margin-bottom: 4px; }
.active-topic-info .year-label { font-size: 0.8rem; color: var(--md-sys-on-surface-variant); }

/* Stats Footer */
.stats-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--md-sys-outline-variant);
}
.stats-info { text-align: center; }
.stats-info span {
  font-size: 1.25rem; font-weight: 800; color: white;
  font-family: var(--md-font);
}
.stats-info p {
  font-size: 0.7rem; color: var(--md-sys-outline);
  text-transform: uppercase; font-weight: 700; letter-spacing: 0.05em;
}
.guest-stats { text-align: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--md-sys-outline-variant); }
.guest-stats span { font-size: 1rem; font-weight: 800; color: var(--md-sys-tertiary); }
.guest-stats p {
  font-size: 0.65rem; color: var(--md-sys-outline);
  text-transform: uppercase; font-weight: 700; letter-spacing: 0.05em; margin-top: 2px;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Top Navigation Bar */
.top-nav {
  height: 72px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(20, 19, 24, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--md-sys-outline-variant);
  position: sticky;
  top: 0;
  z-index: 90;
  gap: 16px;
}

/* Search */
.search-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--md-sys-surface-container-low);
  border: 1px solid var(--md-sys-outline-variant);
  padding: 8px 16px;
  border-radius: var(--md-shape-full);
  width: 100%;
  max-width: 420px;
  transition: all var(--md-duration) var(--md-easing);
}
.search-wrap:focus-within {
  background: var(--md-sys-surface-container);
  border-color: var(--md-sys-primary);
  box-shadow: 0 0 0 3px rgba(106, 90, 205, 0.15);
}
.search-wrap input {
  background: none; border: none; color: var(--md-sys-on-surface);
  font-size: 0.9rem; font-weight: 500; width: 100%; outline: none;
}
.search-wrap input::placeholder { color: var(--md-sys-outline); }

.menu-toggle {
  display: none;
  background: none; border: 1px solid var(--md-sys-outline-variant);
  color: var(--md-sys-on-surface);
  width: 40px; height: 40px;
  border-radius: var(--md-shape-sm);
  cursor: pointer;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-close-btn {
  display: none;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--md-sys-outline-variant);
  color: var(--md-sys-on-surface);
  width: 36px; height: 36px;
  border-radius: var(--md-shape-sm);
  cursor: pointer;
  align-items: center; justify-content: center;
  font-size: 1.2rem;
}

.user-pill {
  width: 40px; height: 40px;
  border-radius: var(--md-shape-sm);
  background: var(--md-sys-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: white; font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--md-duration) var(--md-easing);
  flex-shrink: 0;
}
.user-pill:hover {
  background: var(--md-sys-primary-light);
  box-shadow: 0 0 0 4px rgba(106, 90, 205, 0.2);
}

/* Content View */
.content-view {
  padding: 32px 40px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.view-header { margin-bottom: 32px; }

.title-block h1 {
  font-size: var(--md-headline-lg);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  background: linear-gradient(to bottom right, #fff 40%, var(--md-sys-on-surface-variant));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.15;
}
.title-block p {
  font-size: var(--md-body-lg);
  color: var(--md-sys-on-surface-variant);
  max-width: 560px;
  font-weight: 450;
}

/* ==========================================================================
   Question Cards – Material Elevated Cards
   ========================================================================== */
.question-card {
  background: var(--md-sys-surface-container);
  border: 1px solid var(--md-sys-outline-variant);
  border-radius: var(--md-shape-lg);
  padding: 28px;
  margin-bottom: 24px;
  transition: all 0.3s var(--md-easing);
  box-shadow: var(--md-elevation-1);
  position: relative;
}
.question-card:hover {
  background: var(--md-sys-surface-container-high);
  box-shadow: var(--md-elevation-3);
}

.q-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.badge {
  padding: 4px 12px;
  border-radius: var(--md-shape-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--md-sys-surface-container-low);
  border: 1px solid var(--md-sys-outline-variant);
  color: var(--md-sys-on-surface-variant);
}
.badge-id { color: var(--md-sys-tertiary); border-color: rgba(14,165,233,0.3); background: rgba(14,165,233,0.08); }
.badge-year { color: var(--md-sys-primary-light); border-color: rgba(106,90,205,0.3); background: rgba(106,90,205,0.08); }
.badge-accent { color: var(--md-sys-tertiary); border-color: rgba(14,165,233,0.3); background: rgba(14,165,233,0.08); }
.badge-completed { color: var(--md-sys-secondary); border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.08); }

.q-body { margin-bottom: 24px; }
.q-stem { font-size: var(--md-body-lg); line-height: 1.7; color: var(--md-sys-on-surface); font-weight: 450; }
.q-stem p { margin-bottom: 14px; }
.q-instr { font-size: 0.9rem; color: var(--md-sys-on-surface-variant); margin-top: 12px; padding: 12px; background: var(--md-sys-surface-container-low); border-radius: var(--md-shape-sm); border-left: 3px solid var(--md-sys-primary); }

/* Options Grid – Material Choice Chips */
.options-grid { display: flex; flex-direction: column; gap: 8px; }

.option-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--md-sys-surface-container-low);
  border: 1px solid var(--md-sys-outline-variant);
  border-radius: var(--md-shape-md);
  cursor: pointer;
  transition: all var(--md-duration) var(--md-easing);
}
.option-item:hover {
  background: var(--md-sys-surface-container-high);
  border-color: var(--md-sys-outline);
}
.option-marker {
  width: 28px; height: 28px; min-width: 28px;
  border-radius: var(--md-shape-xs);
  background: var(--md-sys-surface-container);
  border: 1px solid var(--md-sys-outline-variant);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--md-sys-on-surface-variant);
  font-size: 0.8rem;
}
.option-item.selected {
  background: rgba(106, 90, 205, 0.08);
  border-color: var(--md-sys-primary);
}
.option-item.selected .option-marker { background: var(--md-sys-primary); border-color: var(--md-sys-primary); color: white; }
.option-item.correct { background: rgba(16,185,129,0.08); border-color: var(--md-sys-secondary); }
.option-item.incorrect { background: rgba(239,68,68,0.08); border-color: var(--md-sys-error); }
.option-item.correct .option-marker { background: var(--md-sys-secondary); border-color: var(--md-sys-secondary); color: white; }
.option-item.incorrect .option-marker { background: var(--md-sys-error); border-color: var(--md-sys-error); color: white; }

/* TITA Input */
.tita-wrapper { margin-top: 8px; }
.tita-input {
  width: 100%;
  background: var(--md-sys-surface-container-low);
  border: 2px solid var(--md-sys-outline-variant);
  border-radius: var(--md-shape-md);
  padding: 14px 20px;
  color: var(--md-sys-on-surface);
  font-size: var(--md-body-lg);
  font-weight: 600;
  font-family: var(--md-font-mono);
  outline: none;
  transition: all var(--md-duration) var(--md-easing);
}
.tita-input:focus {
  border-color: var(--md-sys-primary);
  background: var(--md-sys-surface-container);
  box-shadow: 0 0 0 3px rgba(106,90,205,0.15);
}
.tita-input.correct { border-color: var(--md-sys-secondary); background: rgba(16,185,129,0.05); }
.tita-input.incorrect { border-color: var(--md-sys-error); background: rgba(239,68,68,0.05); }

/* Question Footer */
.q-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 1px solid var(--md-sys-outline-variant);
  padding-top: 20px;
  margin-top: 8px;
}
.feedback-msg {
  padding: 10px 16px;
  border-radius: var(--md-shape-sm);
  font-size: var(--md-label-md);
  font-weight: 600;
}
.feedback-msg.correct { background: rgba(16,185,129,0.1); color: var(--md-sys-secondary); border: 1px solid rgba(16,185,129,0.2); }
.feedback-msg.incorrect { background: rgba(239,68,68,0.1); color: var(--md-sys-error); border: 1px solid rgba(239,68,68,0.2); }
.ans-key-reveal {
  background: var(--md-sys-surface-container-low);
  padding: 16px 20px;
  border-radius: var(--md-shape-sm);
  border: 1px dashed var(--md-sys-outline);
  font-weight: 700;
  font-size: var(--md-label-md);
}
.val-pill {
  color: var(--md-sys-tertiary); font-size: var(--md-title-sm);
  margin-left: 8px; font-family: var(--md-font-mono);
}
.solution-reveal { margin-top: 8px; }
.solution-block {
  background: var(--md-sys-surface-container-low);
  border-radius: var(--md-shape-md);
  padding: 24px;
  border: 1px solid var(--md-sys-outline-variant);
}
.sol-title {
  font-size: 0.75rem; text-transform: uppercase;
  color: var(--md-sys-primary-light); margin-bottom: 12px;
  font-weight: 800; letter-spacing: 0.08em;
}
.sol-text { color: var(--md-sys-on-surface-variant); font-size: var(--md-body-md); line-height: 1.8; }
.q-action-btns { display: flex; justify-content: flex-end; gap: 12px; }

/* ==========================================================================
   Buttons – Material Design 3
   ========================================================================== */
.btn-premium {
  background: var(--md-sys-primary);
  color: var(--md-sys-on-primary);
  border: none;
  padding: 10px 24px;
  border-radius: var(--md-shape-full);
  font-weight: 700;
  font-size: var(--md-label-md);
  cursor: pointer;
  transition: all var(--md-duration) var(--md-easing);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--md-elevation-1);
  font-family: var(--md-font);
  line-height: 1;
  position: relative;
  overflow: hidden;
}
.btn-premium::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--md-duration) var(--md-easing);
}
.btn-premium:hover::after { background: rgba(255,255,255,0.08); }
.btn-premium:active::after { background: rgba(255,255,255,0.12); }
.btn-premium:hover { box-shadow: var(--md-elevation-2); }
.btn-premium:active { box-shadow: var(--md-elevation-1); }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--md-sys-outline-variant);
  box-shadow: none;
  color: var(--md-sys-on-surface);
}
.btn-secondary:hover { background: var(--md-sys-surface-container-high); border-color: var(--md-sys-outline); }
.btn-secondary::after { display: none; }

.btn-danger-glow {
  background: var(--md-sys-error) !important;
  box-shadow: 0 2px 12px rgba(239,68,68,0.25);
}
.btn-danger-glow:hover { background: #dc2626 !important; box-shadow: 0 4px 20px rgba(239,68,68,0.35); }

/* ==========================================================================
   Loader / Spinner
   ========================================================================== */
.loader-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  gap: 16px;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--md-sys-outline-variant);
  border-top-color: var(--md-sys-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Empty State
   ========================================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  text-align: center;
}
.empty-state h1 { margin-bottom: 8px; }
.empty-state p { max-width: 420px; line-height: 1.6; color: var(--md-sys-on-surface-variant); }

/* ==========================================================================
   Modals – Material Design
   ========================================================================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-overlay.open {
  display: flex;
}
.modal-card {
  width: 90%; max-width: 800px;
  background: var(--md-sys-surface-container);
  border-radius: var(--md-shape-xl);
  border: 1px solid var(--md-sys-outline-variant);
  padding: 32px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--md-elevation-5);
}
.mini-modal { max-width: 480px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.modal-header h2 { font-size: var(--md-title-lg); font-weight: 700; letter-spacing: -0.02em; }
.close-btn {
  width: 40px; height: 40px;
  border-radius: var(--md-shape-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--md-sys-outline-variant);
  color: var(--md-sys-on-surface);
  cursor: pointer;
  transition: all var(--md-duration) var(--md-easing);
  font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
}
.close-btn:hover { background: var(--md-sys-surface-container-high); transform: rotate(90deg); }

/* ==========================================================================
   Topic Grid / Cards
   ========================================================================== */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.topic-card {
  padding: 24px;
  background: var(--md-sys-surface-container-low);
  border-radius: var(--md-shape-md);
  border: 1px solid var(--md-sys-outline-variant);
  cursor: pointer;
  transition: all var(--md-duration) var(--md-easing);
}
.topic-card:hover {
  background: var(--md-sys-surface-container-high);
  border-color: var(--md-sys-primary);
  box-shadow: var(--md-elevation-2);
}
.topic-card h4 { font-size: var(--md-title-sm); margin-bottom: 8px; }
.topic-card .count {
  font-size: 0.75rem; font-weight: 700;
  color: var(--md-sys-tertiary);
  background: rgba(14,165,233,0.08);
  padding: 3px 10px; border-radius: var(--md-shape-full);
}
.year-item {
  padding: 12px 20px;
  background: var(--md-sys-surface-container-low);
  border-radius: var(--md-shape-md);
  border: 1px solid var(--md-sys-outline-variant);
  cursor: pointer;
  font-weight: 600;
  text-align: center;
  transition: all var(--md-duration) var(--md-easing);
}
.year-item:hover {
  background: var(--md-sys-surface-container-high);
  border-color: var(--md-sys-primary);
}
.year-item.active {
  background: var(--md-sys-primary);
  border-color: var(--md-sys-primary);
  color: white;
}

/* ==========================================================================
   Header (home page hero)
   ========================================================================== */
.home-view-container { max-width: 1000px; margin: 0 auto; padding-top: 32px; }
.home-hero-section { text-align: center; padding: 20px 0 32px; }

.start-practice-btn {
  font-size: var(--md-title-sm) !important;
  padding: 16px 48px !important;
  margin: 0 auto 24px !important;
  width: fit-content;
  animation: ctaPulse 2.5s ease-in-out infinite;
  border-radius: var(--md-shape-full) !important;
  letter-spacing: 0.02em;
  position: relative;
}
.start-practice-btn::before {
  content: '';
  position: absolute; inset: -4px;
  border-radius: var(--md-shape-full);
  background: linear-gradient(135deg, var(--md-sys-primary), var(--md-sys-primary-light), var(--md-sys-primary));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
  animation: ctaRing 3s ease-in-out infinite;
}
.start-practice-btn:hover::before { opacity: 1; }
.start-practice-btn:hover { transform: scale(1.03); box-shadow: var(--md-elevation-4) !important; }
.start-practice-btn:active { transform: scale(0.98); }

@keyframes ctaPulse {
  0% { box-shadow: 0 0 6px var(--primary-glow), 0 0 0 0 rgba(106,90,205,0.1); }
  50% { box-shadow: 0 0 20px var(--primary-glow), 0 0 0 8px rgba(106,90,205,0.05); }
  100% { box-shadow: 0 0 6px var(--primary-glow), 0 0 0 0 rgba(106,90,205,0.1); }
}
@keyframes ctaRing {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.02); }
}

.guest-login-info { text-align: center; margin-bottom: 16px; }
.guest-login-info p { font-size: var(--md-label-md); color: var(--md-sys-on-surface-variant); margin: 0; line-height: 1.8; }

/* ===== Home Hero Section ===== */
.home-hero-title-block { text-align: center; margin-bottom: 2.5rem; }
.home-welcome-title {
  font-size: var(--md-headline-lg);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 30%, var(--md-sys-primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}
.home-hero-subtitle {
  font-size: var(--md-body-lg);
  max-width: 640px;
  margin: 0.75rem auto 0;
  color: var(--md-sys-on-surface-variant);
  font-weight: 450;
  line-height: 1.7;
}

/* ===== Home Feature Cards ===== */
.home-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin: 2.5rem 0;
}
@media (max-width: 640px) { .home-features-grid { grid-template-columns: 1fr; gap: 1rem; } }

.feature-item {
  position: relative;
  border-radius: var(--md-shape-lg);
  padding: 1.75rem;
  padding-top: calc(1.75rem + 4px);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}
.feature-item:nth-child(1) { animation-delay: 0.05s; }
.feature-item:nth-child(2) { animation-delay: 0.12s; }
.feature-item:nth-child(3) { animation-delay: 0.19s; }
.feature-item:nth-child(4) { animation-delay: 0.26s; }
.feature-item:nth-child(5) { animation-delay: 0.33s; }

.feature-item::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: var(--md-shape-lg) var(--md-shape-lg) 0 0;
}
.feature-item::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: var(--md-shape-lg);
  border: 1px solid var(--md-sys-outline-variant);
  pointer-events: none;
  transition: border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-item:nth-child(1) { background: linear-gradient(180deg, rgba(106,90,205,0.07), var(--md-sys-surface-container) 50%); }
.feature-item:nth-child(1)::before { background: linear-gradient(90deg, var(--md-sys-primary), #a78bfa); }
.feature-item:nth-child(1):hover { box-shadow: 0 0 32px rgba(106,90,205,0.12), var(--md-elevation-3); transform: translateY(-2px); }
.feature-item:nth-child(1):hover::after { border-color: rgba(106,90,205,0.35); }

.feature-item:nth-child(2) { background: linear-gradient(180deg, rgba(14,165,233,0.07), var(--md-sys-surface-container) 50%); }
.feature-item:nth-child(2)::before { background: linear-gradient(90deg, #0ea5e9, #7dd3fc); }
.feature-item:nth-child(2):hover { box-shadow: 0 0 32px rgba(14,165,233,0.12), var(--md-elevation-3); transform: translateY(-2px); }
.feature-item:nth-child(2):hover::after { border-color: rgba(14,165,233,0.35); }

.feature-item:nth-child(3) { background: linear-gradient(180deg, rgba(251,191,36,0.07), var(--md-sys-surface-container) 50%); }
.feature-item:nth-child(3)::before { background: linear-gradient(90deg, #fbbf24, #fde68a); }
.feature-item:nth-child(3):hover { box-shadow: 0 0 32px rgba(251,191,36,0.12), var(--md-elevation-3); transform: translateY(-2px); }
.feature-item:nth-child(3):hover::after { border-color: rgba(251,191,36,0.35); }

.feature-item:nth-child(4) { background: linear-gradient(180deg, rgba(16,185,129,0.07), var(--md-sys-surface-container) 50%); }
.feature-item:nth-child(4)::before { background: linear-gradient(90deg, #10b981, #6ee7b7); }
.feature-item:nth-child(4):hover { box-shadow: 0 0 32px rgba(16,185,129,0.12), var(--md-elevation-3); transform: translateY(-2px); }
.feature-item:nth-child(4):hover::after { border-color: rgba(16,185,129,0.35); }

.feature-item:nth-child(5) { background: linear-gradient(180deg, rgba(212,163,115,0.07), var(--md-sys-surface-container) 50%); }
.feature-item:nth-child(5)::before { background: linear-gradient(90deg, #d4a373, #e8c99b); }
.feature-item:nth-child(5):hover { box-shadow: 0 0 32px rgba(212,163,115,0.12), var(--md-elevation-3); transform: translateY(-2px); }
.feature-item:nth-child(5):hover::after { border-color: rgba(212,163,115,0.35); }

.feature-icon {
  width: 48px; height: 48px;
  border-radius: var(--md-shape-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9rem;
  margin-bottom: 0.35rem;
  position: relative;
  z-index: 1;
}
.feature-icon.qa {
  background: linear-gradient(135deg, rgba(106,90,205,0.18), rgba(106,90,205,0.06));
  border: 1px solid rgba(106,90,205,0.3);
  color: #a78bfa;
  box-shadow: 0 0 16px rgba(106,90,205,0.08);
}
.feature-icon.dilr {
  background: linear-gradient(135deg, rgba(14,165,233,0.18), rgba(14,165,233,0.06));
  border: 1px solid rgba(14,165,233,0.3);
  color: #7dd3fc;
  box-shadow: 0 0 16px rgba(14,165,233,0.08);
}
.feature-icon.varc {
  background: linear-gradient(135deg, rgba(251,191,36,0.18), rgba(251,191,36,0.06));
  border: 1px solid rgba(251,191,36,0.3);
  color: #fcd34d;
  box-shadow: 0 0 16px rgba(251,191,36,0.08);
}
.feature-icon.dict {
  background: linear-gradient(135deg, rgba(16,185,129,0.18), rgba(16,185,129,0.06));
  border: 1px solid rgba(16,185,129,0.3);
  color: #6ee7b7;
  box-shadow: 0 0 16px rgba(16,185,129,0.08);
}
.feature-icon.extension {
  background: linear-gradient(135deg, rgba(212,163,115,0.18), rgba(212,163,115,0.06));
  border: 1px solid rgba(212,163,115,0.3);
  color: #e8c99b;
  box-shadow: 0 0 16px rgba(212,163,115,0.08);
}
.feature-icon svg { width: 22px; height: 22px; }

.feature-item h3 {
  font-size: var(--md-title-sm);
  font-weight: 700;
  margin: 0;
  color: var(--md-sys-on-surface);
  position: relative;
  z-index: 1;
}
.feature-item p {
  font-size: var(--md-body-sm);
  line-height: 1.7;
  color: var(--md-sys-on-surface-variant);
  margin: 0;
  position: relative;
  z-index: 1;
}

.feature-ext-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: var(--md-label-md);
  font-weight: 600;
  color: var(--accent-gold) !important;
  text-decoration: none !important;
  transition: color 0.2s, gap 0.2s;
  position: relative;
  z-index: 1;
}
.feature-ext-link:hover {
  color: var(--md-sys-primary-light) !important;
  gap: 8px;
}

/* ---- Extension Banner ---- */
.extension-banner {
  position: relative;
  background: linear-gradient(135deg, #1a0f2e 0%, #0d1b2a 30%, #1b2838 60%, #162032 100%);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--md-shape-lg);
  padding: 24px 28px;
  margin-bottom: 2rem;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.08), 0 4px 24px rgba(0,0,0,0.3);
  animation: extBannerGlow 3s ease-in-out infinite;
}
@keyframes extBannerGlow {
  0%, 100% { box-shadow: 0 0 40px rgba(139, 92, 246, 0.08), 0 4px 24px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 0 60px rgba(139, 92, 246, 0.15), 0 4px 32px rgba(0,0,0,0.35); }
}
.extension-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #8b5cf6, #d4a373, #3b82f6, #8b5cf6);
  background-size: 300% 100%;
  animation: extBannerShimmer 4s linear infinite;
}
@keyframes extBannerShimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
.extension-banner::after {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
  pointer-events: none;
}
.extension-banner-glow {
  position: absolute;
  bottom: -60%; left: -10%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(212, 163, 115, 0.1) 0%, transparent 70%);
  pointer-events: none;
}
.extension-banner-content {
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  z-index: 1;
}
.extension-banner-icon {
  flex-shrink: 0;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(212, 163, 115, 0.2));
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: var(--md-shape-md);
  color: #c4b5fd;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}
.extension-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.extension-banner-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.extension-banner-title-row strong {
  color: #f0eaff;
  font-size: var(--md-title-sm);
  font-weight: 700;
}
.extension-banner-live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
  animation: livePulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(52, 211, 153, 0.6); }
  50% { opacity: 0.6; box-shadow: 0 0 16px rgba(52, 211, 153, 0.8); }
}
.extension-banner-text > span {
  color: #b8b0c8;
  font-size: var(--md-body-sm);
  line-height: 1.6;
}
.extension-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.extension-install-btn {
  white-space: nowrap;
  font-size: var(--md-label-md) !important;
  padding: 10px 22px !important;
  border-radius: var(--md-shape-full) !important;
  background: linear-gradient(135deg, #8b5cf6, #a78bfa) !important;
  color: #fff !important;
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.extension-install-btn:hover {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6) !important;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4) !important;
  transform: translateY(-1px);
}
.extension-dismiss-btn {
  background: none;
  border: none;
  color: #8b8099;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--md-shape-sm);
  transition: all 0.2s;
  line-height: 1;
}
.extension-dismiss-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
}
@media (max-width: 640px) {
  .extension-banner-content { flex-direction: column; align-items: flex-start; }
  .extension-banner-actions { width: 100%; justify-content: flex-end; }
}

/* ---- How It Works Steps (inside banner) ---- */
.ext-how-steps {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(139, 92, 246, 0.15);
}
.ext-how-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b8099;
  margin-bottom: 12px;
}
.ext-steps-row {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.ext-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 8px;
  font-size: 0.75rem;
  color: #c4b5fd;
  font-weight: 600;
  white-space: nowrap;
}
.ext-step-num {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.25);
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 800;
  color: #a78bfa;
  flex-shrink: 0;
}
.ext-step-arrow {
  color: #5a5070;
  font-size: 0.7rem;
  padding: 0 4px;
  flex-shrink: 0;
}
.ext-how-note {
  margin-top: 10px;
  font-size: 0.72rem;
  color: #6b6280;
  font-style: italic;
}

/* ---- Video Embed ---- */
.ext-video-wrap {
  margin-bottom: 2rem;
}
.ext-video-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8b8099;
  margin-bottom: 10px;
}
.ext-video-container {
  position: relative;
  width: 100%;
  max-width: 640px;
  border-radius: var(--md-shape-lg);
  overflow: hidden;
  border: 1px solid rgba(139, 92, 246, 0.2);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.ext-video-container iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
@media (max-width: 640px) {
  .ext-steps-row { gap: 4px; }
  .ext-step { padding: 5px 8px; font-size: 0.68rem; }
  .ext-step-arrow { padding: 0 2px; font-size: 0.6rem; }
}

.dashboard-teaser {
  background: var(--md-sys-surface-container);
  border: 1px solid var(--md-sys-outline-variant);
  border-radius: var(--md-shape-xl);
  padding: 36px;
  margin: 48px 0;
  transition: all 0.3s var(--md-easing);
}
.dashboard-teaser:hover {
  border-color: var(--md-sys-primary);
  box-shadow: var(--md-elevation-3);
}
.dashboard-teaser h2 {
  font-size: var(--md-title-lg);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  text-align: center;
  background: linear-gradient(to bottom right, #fff 40%, var(--md-sys-on-surface-variant));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.teaser-content { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
@media (max-width: 768px) { .teaser-content { grid-template-columns: 1fr; gap: 24px; } }

.teaser-visual {
  background: var(--md-sys-surface-container-low);
  border: 1px solid var(--md-sys-outline-variant);
  border-radius: var(--md-shape-lg);
  padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.teaser-visual-row { display: flex; align-items: center; gap: 12px; }
.teaser-bar { flex: 1; height: 10px; background: var(--md-sys-outline-variant); border-radius: var(--md-shape-full); overflow: hidden; }
.teaser-bar-fill { height: 100%; border-radius: var(--md-shape-full); background: linear-gradient(90deg, var(--md-sys-primary), var(--md-sys-tertiary)); }
.teaser-bar-label { font-size: 0.75rem; color: var(--md-sys-on-surface-variant); font-weight: 600; min-width: 60px; }
.teaser-mock-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--md-sys-surface-container-low); border-radius: var(--md-shape-sm); border: 1px solid var(--md-sys-outline-variant); }
.teaser-mock-score { font-size: 1.1rem; font-weight: 800; color: var(--md-sys-primary-light); }
.teaser-mock-label { font-size: 0.8rem; color: var(--md-sys-on-surface-variant); }

.teaser-bullets { display: flex; flex-direction: column; gap: 12px; }
.teaser-bullet-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
  background: var(--md-sys-surface-container-low);
  border: 1px solid var(--md-sys-outline-variant);
  border-radius: var(--md-shape-md);
  transition: all var(--md-duration) var(--md-easing);
}
.teaser-bullet-item:hover { background: var(--md-sys-surface-container-high); border-color: var(--md-sys-primary); }
.teaser-bullet-icon {
  width: 40px; height: 40px; min-width: 40px;
  border-radius: var(--md-shape-sm);
  display: flex; align-items: center; justify-content: center;
  background: rgba(106,90,205,0.1); border: 1px solid rgba(106,90,205,0.2);
  color: var(--md-sys-primary-light);
}
.teaser-bullet-text { font-size: var(--md-label-md); font-weight: 600; }

.home-cta-section {
  background: radial-gradient(circle at top right, rgba(106,90,205,0.12), transparent),
              radial-gradient(circle at bottom left, rgba(14,165,233,0.08), transparent),
              var(--md-sys-surface-container);
  border: 1px solid var(--md-sys-primary);
  padding: 48px 36px;
  border-radius: var(--md-shape-xl);
  text-align: center;
  margin-top: 64px;
}
.home-cta-section h2 { font-size: var(--md-headline-sm); margin-bottom: 12px; }
.home-cta-section p { font-size: var(--md-body-lg); color: var(--md-sys-on-surface-variant); margin-bottom: 24px; }

/* ==========================================================================
   Question Groups (Passage / Set)
   ========================================================================== */
.question-group-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 80px;
  width: 100%;
}
.passage-card {
  position: sticky;
  top: 72px;
  height: 40vh;
  width: 100%;
  overflow-y: auto;
  background: var(--md-sys-surface-container);
  border-radius: 0 0 var(--md-shape-lg) var(--md-shape-lg);
  border: 1px solid var(--md-sys-outline-variant);
  border-top: none;
  padding: 28px 36px;
  box-shadow: var(--md-elevation-3);
  z-index: 35;
  margin-bottom: 16px;
}
.passage-card::-webkit-scrollbar { width: 6px; }
.passage-card::-webkit-scrollbar-thumb { background: var(--md-sys-outline-variant); border-radius: 10px; }
.passage-header { margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--md-sys-outline-variant); display: flex; justify-content: space-between; align-items: center; }
.passage-content { font-size: var(--md-body-md); line-height: 1.8; color: var(--md-sys-on-surface-variant); }
.passage-content p { margin-bottom: 14px; }
.group-questions-list { display: flex; flex-direction: column; gap: 24px; width: 100%; }
.question-card.grouped { min-height: 35vh; margin-bottom: 80px; }
.question-card.standalone { margin-bottom: 48px; width: 100%; }

/* ==========================================================================
   Daily Challenge Page
   ========================================================================== */
.daily-header-container { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.daily-section-tabs {
  display: flex; gap: 6px;
  background: var(--md-sys-surface-container-low);
  padding: 4px;
  border-radius: var(--md-shape-full);
  border: 1px solid var(--md-sys-outline-variant);
}
.daily-tab {
  padding: 8px 20px;
  border: none; background: transparent;
  color: var(--md-sys-on-surface-variant);
  font-weight: 700; font-size: 0.85rem;
  cursor: pointer;
  border-radius: var(--md-shape-full);
  transition: all var(--md-duration) var(--md-easing);
}
.daily-tab.active { background: var(--md-sys-primary); color: white; }
.daily-tab-count { font-size: 0.7rem; background: rgba(0,0,0,0.2); padding: 1px 7px; border-radius: 6px; margin-left: 4px; }

.btn-history {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 18px;
  background: var(--md-sys-surface-container);
  border: 1px solid var(--md-sys-outline-variant);
  border-radius: var(--md-shape-full);
  color: var(--md-sys-on-surface);
  font-weight: 600; font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--md-duration) var(--md-easing);
}
.btn-history:hover { background: var(--md-sys-surface-container-high); border-color: var(--md-sys-outline); }

.daily-date-row { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.daily-date-badge {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; font-weight: 700;
  color: var(--md-sys-tertiary);
  background: rgba(14,165,233,0.08);
  padding: 6px 14px;
  border-radius: var(--md-shape-full);
  width: fit-content;
  border: 1px solid rgba(14,165,233,0.2);
}

.daily-section-divider {
  display: flex; align-items: center; gap: 20px;
  margin: 40px 0 24px;
  padding: 24px;
  background: var(--md-sys-surface-container-low);
  border-radius: var(--md-shape-md);
  border-left: 3px solid var(--md-sys-primary);
}
.daily-section-icon {
  width: 48px; height: 48px; min-width: 48px;
  border-radius: var(--md-shape-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: var(--md-label-md);
  background: var(--md-sys-surface-container);
  border: 1px solid var(--md-sys-outline-variant);
}
.daily-section-icon.qa { color: var(--md-sys-primary-light); background: rgba(106,90,205,0.1); }
.daily-section-icon.dilr { color: var(--md-sys-tertiary); background: rgba(14,165,233,0.1); }
.daily-section-icon.varc { color: var(--md-sys-error); background: rgba(239,68,68,0.1); }
.daily-section-info h3 { font-size: var(--md-title-md); margin-bottom: 4px; }
.daily-section-info p { font-size: 0.85rem; color: var(--md-sys-on-surface-variant); }

/* ==========================================================================
   Mock Timer / Sectional Mocks
   ========================================================================== */
.mock-timer-bar {
  position: sticky; top: 72px; z-index: 85;
  background: var(--md-sys-surface-container);
  border-bottom: 1px solid var(--md-sys-outline-variant);
  padding: 12px 32px;
  display: none; align-items: center; gap: 24px;
  backdrop-filter: blur(12px);
  margin: -32px -40px 32px -40px;
}
.timer-timer {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--md-font-mono);
  font-size: var(--md-title-md);
  font-weight: 700;
  color: var(--md-sys-primary-light);
  min-width: 100px;
}
.timer-progress { flex: 1; height: 6px; background: var(--md-sys-outline-variant); border-radius: var(--md-shape-full); overflow: hidden; }
.progress-fill { height: 100%; background: var(--md-sys-primary); width: 100%; transition: width 1s linear; }

.mock-config-view {
  max-width: 700px; margin: 0 auto; padding: 32px;
  background: var(--md-sys-surface-container);
  border-radius: var(--md-shape-lg);
  border: 1px solid var(--md-sys-outline-variant);
}
.mock-start-hero-btn { width: 100%; padding: 16px; font-size: var(--md-title-sm); margin-bottom: 32px; }
.mock-topic-options-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.topic-checkbox-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--md-sys-surface-container-low); border: 1px solid var(--md-sys-outline-variant); border-radius: var(--md-shape-sm); cursor: pointer; transition: all var(--md-duration) var(--md-easing); }
.topic-checkbox-item:hover { background: var(--md-sys-surface-container-high); border-color: var(--md-sys-outline); }
.topic-checkbox-item.checked { border-color: var(--md-sys-primary); background: rgba(106,90,205,0.08); }
.checkbox-circle { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--md-sys-outline-variant); position: relative; }
.topic-checkbox-item.checked .checkbox-circle { border-color: var(--md-sys-primary); background: var(--md-sys-primary); }
.topic-checkbox-item.checked .checkbox-circle::after { content: ''; position: absolute; inset: 4px; background: white; border-radius: 50%; }

/* Mock Filter Bar */
.mock-filter-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; padding: 10px 20px; background: var(--md-sys-surface-container-low); border: 1px solid var(--md-sys-outline-variant); border-radius: var(--md-shape-md); }
.mock-filter-label { font-size: 0.75rem; font-weight: 700; color: var(--md-sys-outline); text-transform: uppercase; letter-spacing: 0.05em; margin-right: 12px; padding-right: 12px; border-right: 1px solid var(--md-sys-outline-variant); white-space: nowrap; }
.mock-filter-option { padding: 6px 16px; border-radius: var(--md-shape-full); background: transparent; border: 1px solid var(--md-sys-outline-variant); color: var(--md-sys-on-surface-variant); font-size: 0.8rem; font-weight: 700; cursor: pointer; transition: all var(--md-duration) var(--md-easing); }
.mock-filter-option:hover:not(.disabled) { border-color: var(--md-sys-outline); color: var(--md-sys-on-surface); background: var(--md-sys-surface-container-high); }
.mock-filter-option.active { background: var(--md-sys-primary); border-color: var(--md-sys-primary); color: white; }
.mock-filter-option.disabled { opacity: 0.35; cursor: not-allowed; }
.mock-filter-login-note { font-size: 0.7rem; color: var(--md-sys-primary); margin-left: auto; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; padding: 4px 14px; background: rgba(106,90,205,0.08); border: 1px solid rgba(106,90,205,0.2); border-radius: var(--md-shape-full); text-decoration: none; font-weight: 600; }
.mock-filter-login-note:hover { background: rgba(106,90,205,0.15); }

/* Mock Analysis */
.mock-analysis-card { background: var(--md-sys-surface-container); border-radius: var(--md-shape-lg); border: 1px solid var(--md-sys-outline-variant); padding: 36px; margin-bottom: 48px; }
.analysis-main-score { display: flex; align-items: center; justify-content: space-around; gap: 32px; margin-bottom: 32px; flex-wrap: wrap; }
.score-circle { width: 160px; height: 160px; border-radius: 50%; border: 6px solid var(--md-sys-primary); display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(106,90,205,0.05); }
.score-val { font-size: 3.5rem; font-weight: 800; color: white; line-height: 1; }
.score-label { font-size: 0.75rem; text-transform: uppercase; font-weight: 700; color: var(--md-sys-outline); }
.stats-mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat-box-item { padding: 20px; border-radius: var(--md-shape-sm); background: var(--md-sys-surface-container-low); text-align: center; min-width: 100px; }
.stat-box-item .val { display: block; font-size: var(--md-title-md); font-weight: 800; color: white; margin-bottom: 2px; }
.stat-box-item .lbl { font-size: 0.7rem; font-weight: 700; color: var(--md-sys-outline); text-transform: uppercase; }
.stat-box-item.green { border-bottom: 3px solid var(--md-sys-secondary); }
.stat-box-item.red { border-bottom: 3px solid var(--md-sys-error); }
.stat-box-item.gray { border-bottom: 3px solid var(--md-sys-outline); }
.analysis-footer-row { display: flex; justify-content: center; gap: 32px; padding-top: 24px; border-top: 1px solid var(--md-sys-outline-variant); }
.footer-stat { color: var(--md-sys-on-surface-variant); font-size: var(--md-body-md); }
.footer-stat strong { color: var(--md-sys-on-surface); }

/* ==========================================================================
   History List
   ========================================================================== */
.history-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; background: var(--md-sys-surface-container-low); border: 1px solid var(--md-sys-outline-variant); border-radius: var(--md-shape-md); cursor: pointer; transition: all var(--md-duration) var(--md-easing); }
.history-item:hover { background: var(--md-sys-surface-container-high); border-color: var(--md-sys-primary); }
.history-date { font-weight: 700; color: var(--md-sys-on-surface); font-size: var(--md-label-md); }
.history-count { font-size: 0.8rem; color: var(--md-sys-on-surface-variant); font-weight: 600; }
.history-group-header { font-size: 0.75rem; font-weight: 700; color: var(--md-sys-outline); text-transform: uppercase; letter-spacing: 0.08em; padding: 8px 4px 4px; }

.btn-load-history { padding: 8px 16px; background: var(--md-sys-primary); color: white; border: none; border-radius: var(--md-shape-full); font-size: 0.8rem; font-weight: 700; cursor: pointer; transition: all var(--md-duration) var(--md-easing); opacity: 0; }
.history-item:hover .btn-load-history { opacity: 1; }
.btn-load-history:hover { background: var(--md-sys-primary-light); }
@media (max-width: 576px) { .btn-load-history { opacity: 1; padding: 6px 12px; font-size: 0.7rem; } .history-item { padding: 12px 16px; } }

/* ==========================================================================
   Year Pills
   ========================================================================== */
.year-pill { padding: 8px 20px; border-radius: var(--md-shape-full); background: var(--md-sys-surface-container-low); border: 1px solid var(--md-sys-outline-variant); color: var(--md-sys-on-surface-variant); font-weight: 700; cursor: pointer; transition: all var(--md-duration) var(--md-easing); }
.year-pill.active { background: var(--md-sys-primary); border-color: var(--md-sys-primary); color: white; }

/* ==========================================================================
   Dictionary Popup
   ========================================================================== */
.dictionary-popup {
  position: absolute;
  z-index: 1000;
  width: 320px;
  background: var(--md-sys-surface-container);
  border: 1px solid var(--md-sys-outline-variant);
  border-radius: var(--md-shape-lg);
  box-shadow: var(--md-elevation-4);
  overflow: hidden;
  animation: slideUp 0.2s ease-out;
}
.dict-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--md-sys-surface-container-high); border-bottom: 1px solid var(--md-sys-outline-variant); }
.dict-word { font-weight: 700; font-size: var(--md-title-sm); color: var(--md-sys-primary-light); text-transform: capitalize; }
.dict-actions { display: flex; gap: 8px; align-items: center; }
.dict-save-btn { background: transparent; border: none; color: var(--md-sys-on-surface-variant); cursor: pointer; padding: 4px; border-radius: var(--md-shape-xs); transition: all var(--md-duration) var(--md-easing); display: flex; align-items: center; justify-content: center; }
.dict-save-btn:hover { color: #f59e0b; background: rgba(245,158,11,0.1); }
.dict-save-btn.saved { color: #f59e0b; }
.dict-close { background: transparent; border: none; color: var(--md-sys-on-surface-variant); font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 2px 6px; border-radius: var(--md-shape-xs); transition: all var(--md-duration) var(--md-easing); }
.dict-close:hover { color: var(--md-sys-on-surface); background: rgba(255,255,255,0.1); }
.dict-content { padding: 16px; max-height: 250px; overflow-y: auto; }
.dict-part-of-speech { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; color: var(--md-sys-outline); margin-bottom: 4px; letter-spacing: 0.05em; }
.dict-definition { font-size: 0.85rem; color: var(--md-sys-on-surface); line-height: 1.5; margin-bottom: 10px; }
.dict-example { font-size: 0.8rem; font-style: italic; color: var(--md-sys-on-surface-variant); background: var(--md-sys-surface-container-low); padding: 6px 10px; border-radius: var(--md-shape-xs); margin-top: -6px; margin-bottom: 10px; }
.dict-loading, .dict-error, .dict-no-result { padding: 14px 16px; text-align: center; color: var(--md-sys-on-surface-variant); }
.dict-error { color: var(--md-sys-error); }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--md-sys-surface-container);
  color: var(--md-sys-on-surface);
  padding: 10px 20px;
  border-radius: var(--md-shape-md);
  box-shadow: var(--md-elevation-4);
  border: 1px solid var(--md-sys-outline-variant);
  z-index: 2000;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.35s var(--md-easing);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--md-sys-primary); }
.toast.error { border-left: 3px solid var(--md-sys-error); }

/* ==========================================================================
   Bookmarks UI
   ========================================================================== */
.btn-bookmark {
  background: transparent; border: none;
  color: var(--md-sys-on-surface-variant);
  cursor: pointer; padding: 4px;
  border-radius: var(--md-shape-xs);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--md-duration) var(--md-easing);
  margin-left: auto;
}
.btn-bookmark:hover { color: var(--md-sys-primary-light); transform: scale(1.1); }
.btn-bookmark.bookmarked { color: var(--md-sys-primary); }
.btn-bookmark.bookmarked svg { fill: var(--md-sys-primary); }

.bookmark-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.bookmark-modal-content {
  background: var(--md-sys-surface-container);
  border: 1px solid var(--md-sys-outline-variant);
  border-radius: var(--md-shape-lg);
  padding: 24px;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--md-elevation-5);
}
.bookmark-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.bookmark-modal-header h3 { margin: 0; font-size: var(--md-title-md); }
.bookmark-modal-close { background: none; border: none; color: var(--md-sys-outline); cursor: pointer; font-size: 1.3rem; }
.bookmark-modal-close:hover { color: var(--md-sys-on-surface); }
.bookmark-groups-list { max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.bookmark-group-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--md-sys-surface-container-low); border: 1px solid var(--md-sys-outline-variant); border-radius: var(--md-shape-sm); cursor: pointer; color: var(--md-sys-on-surface); transition: all var(--md-duration) var(--md-easing); }
.bookmark-group-item:hover { background: var(--md-sys-surface-container-high); border-color: var(--md-sys-primary); }
.bookmark-group-item.active { border-color: var(--md-sys-primary); background: rgba(106,90,205,0.08); }
.new-group-input { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--md-sys-outline-variant); }
.new-group-input input { flex: 1; background: var(--md-sys-surface-container-low); border: 1px solid var(--md-sys-outline-variant); border-radius: var(--md-shape-sm); padding: 8px 14px; color: var(--md-sys-on-surface); }
.new-group-input input:focus { border-color: var(--md-sys-primary); outline: none; }

/* ==========================================================================
   Virtual Cards / Grid Overrides
   ========================================================================== */
.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 16px 0;
}
.vocab-card {
  background: var(--md-sys-surface-container);
  border: 1px solid var(--md-sys-outline-variant);
  border-radius: var(--md-shape-lg);
  padding: 20px;
  position: relative;
  transition: all 0.3s var(--md-easing);
  box-shadow: var(--md-elevation-1);
}
.vocab-card:hover { box-shadow: var(--md-elevation-3); border-color: rgba(106,90,205,0.3); }
.vocab-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.vocab-word { font-size: var(--md-title-md); font-weight: 700; color: var(--md-sys-on-surface); text-transform: capitalize; }
.vocab-delete-btn { background: transparent; border: none; color: var(--md-sys-on-surface-variant); cursor: pointer; padding: 4px; border-radius: var(--md-shape-xs); transition: all var(--md-duration) var(--md-easing); opacity: 0; }
.vocab-card:hover .vocab-delete-btn { opacity: 1; }
.vocab-delete-btn:hover { color: var(--md-sys-error); background: rgba(239,68,68,0.1); }
.vocab-pos { display: inline-block; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; background: rgba(106,90,205,0.1); color: var(--md-sys-primary-light); padding: 2px 8px; border-radius: var(--md-shape-xs); margin-bottom: 10px; }
.vocab-def { font-size: 0.9rem; color: var(--md-sys-on-surface-variant); line-height: 1.6; margin-bottom: 10px; }
.vocab-ex { font-size: 0.85rem; font-style: italic; color: var(--md-sys-outline); line-height: 1.5; padding-left: 10px; border-left: 2px solid var(--md-sys-outline-variant); }
.vocab-date { font-size: 0.7rem; color: var(--md-sys-outline); margin-top: 12px; display: block; }

/* ==========================================================================
   Dashboard Styles
   ========================================================================== */
.dashboard-container { max-width: 1100px; margin: 0 auto; padding: 24px 32px; }
.auth-view { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 70vh; }
.auth-card { background: var(--md-sys-surface-container); padding: 32px; border-radius: var(--md-shape-xl); border: 1px solid var(--md-sys-outline-variant); width: 100%; max-width: 400px; box-shadow: var(--md-elevation-3); }
.auth-card h2 { margin-bottom: 20px; text-align: center; font-size: var(--md-title-lg); }
.auth-card input { width: 100%; padding: 12px 16px; margin-bottom: 16px; background: var(--md-sys-surface-container-low); border: 1px solid var(--md-sys-outline-variant); color: var(--md-sys-on-surface); border-radius: var(--md-shape-sm); font-family: var(--md-font); }
.auth-card input:focus { border-color: var(--md-sys-primary); outline: none; box-shadow: 0 0 0 3px rgba(106,90,205,0.12); }

.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--md-sys-outline-variant); }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
@media (max-width: 768px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-card { background: var(--md-sys-surface-container); padding: 24px; border-radius: var(--md-shape-lg); border: 1px solid var(--md-sys-outline-variant); box-shadow: var(--md-elevation-1); }
.dash-card h3 { margin-bottom: 16px; font-size: var(--md-title-md); }

.stats-row { display: flex; justify-content: space-around; text-align: center; gap: 16px; }
.stat-item { padding: 8px 16px; }
.stat-item .val { font-size: var(--md-headline-sm); font-weight: 700; color: var(--md-sys-primary-light); display: block; }
.stat-item .lbl { color: var(--md-sys-on-surface-variant); font-size: 0.85rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--md-sys-outline-variant); }
th { color: var(--md-sys-on-surface-variant); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

/* Activity Grid / Heatmap */
.activity-grid { min-height: 100px; overflow-x: auto; padding-bottom: 8px; }
.activity-grid.legacy { display: grid; grid-template-columns: repeat(52, 1fr); gap: 3px; }
.activity-col { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.activity-cell { width: 12px; height: 12px; background: var(--md-sys-outline-variant); border-radius: 2px; }
.activity-cell[data-level="1"] { background: #0e4429; }
.activity-cell[data-level="2"] { background: #006d32; }
.activity-cell[data-level="3"] { background: #26a641; }
.activity-cell[data-level="4"] { background: #39d353; }

/* Section Progress */
.qa-icon { background: linear-gradient(135deg, rgba(106,90,205,0.2), rgba(106,90,205,0.05)); color: var(--md-sys-primary-light); }
.dilr-icon { background: linear-gradient(135deg, rgba(14,165,233,0.2), rgba(14,165,233,0.05)); color: var(--md-sys-tertiary); }
.varc-icon { background: linear-gradient(135deg, rgba(239,68,68,0.2), rgba(239,68,68,0.05)); color: var(--md-sys-error); }
.section-progress-card { padding: 16px; background: var(--md-sys-surface-container-low); border: 1px solid var(--md-sys-outline-variant); border-radius: var(--md-shape-md); }

.pwd-wrap { position: relative; width: 100%; margin-bottom: 16px; }
.pwd-wrap input { margin-bottom: 0; padding-right: 40px; }
.pwd-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--md-sys-on-surface-variant); cursor: pointer; padding: 0; display: flex; align-items: center; transition: color var(--md-duration); width: 20px; height: 20px; }
.pwd-toggle:hover { color: var(--md-sys-on-surface); }

/* Topic Strength */
.topic-filter-btn { padding: 6px 16px; border-radius: var(--md-shape-full); border: 1px solid var(--md-sys-outline-variant); background: transparent; color: var(--md-sys-on-surface-variant); cursor: pointer; font-size: 0.8rem; font-weight: 600; transition: all var(--md-duration) var(--md-easing); }
.topic-filter-btn:hover { border-color: var(--md-sys-primary); color: var(--md-sys-on-surface); }
.topic-filter-btn.active { background: var(--md-sys-primary); border-color: var(--md-sys-primary); color: white; }
.topic-row { padding: 14px 20px; background: var(--md-sys-surface-container-low); border: 1px solid var(--md-sys-outline-variant); border-radius: var(--md-shape-md); transition: all var(--md-duration) var(--md-easing); }
.topic-row:hover { background: var(--md-sys-surface-container-high); }
.topic-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.topic-name { font-weight: 600; font-size: 0.85rem; }
.topic-section-badge { font-size: 0.65rem; padding: 2px 8px; border-radius: var(--md-shape-full); font-weight: 700; margin-left: 6px; }
.topic-section-badge.section-qa { background: rgba(106,90,205,0.12); color: var(--md-sys-primary-light); }
.topic-section-badge.section-dilr { background: rgba(14,165,233,0.12); color: var(--md-sys-tertiary); }
.topic-section-badge.section-varc { background: rgba(239,68,68,0.12); color: var(--md-sys-error); }
.topic-strength-badge { font-size: 0.7rem; padding: 2px 10px; border-radius: var(--md-shape-full); font-weight: 700; flex-shrink: 0; }
.topic-strength-badge.weak { background: rgba(239,68,68,0.12); color: var(--md-sys-error); }
.topic-strength-badge.average { background: rgba(251,191,36,0.12); color: #fbbf24; }
.topic-strength-badge.strong { background: rgba(16,185,129,0.12); color: var(--md-sys-secondary); }
.topic-bar-wrap { height: 5px; background: var(--md-sys-outline-variant); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.topic-bar { height: 100%; border-radius: 3px; transition: width 0.6s ease; background: linear-gradient(90deg, var(--md-sys-error), #fbbf24, var(--md-sys-secondary)); }
.topic-row-footer { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--md-sys-on-surface-variant); }

/* Guest Preview */
#guest-preview .dash-card { max-width: 550px; margin-left: auto; margin-right: auto; }
#guest-preview .dash-card h2 { font-size: var(--md-title-md); }
#guest-preview .dash-header h1 { opacity: 0.5; }

/* Nav Actions */
.nav-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Heatmap legend */
#heatmap-stats { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--md-sys-outline-variant); }

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
.animate-fade-in { animation: fadeIn 0.5s var(--md-easing) forwards; }
.animate-slide-in { animation: slideInRight 0.4s var(--md-easing) forwards; }

/* ==========================================================================
   Custom Scrollbar
   ========================================================================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--md-sys-outline-variant); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--md-sys-outline); background-clip: content-box; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .sidebar { position: fixed; left: -300px; transition: left 0.3s var(--md-easing); box-shadow: 20px 0 60px rgba(0,0,0,0.4); }
  .sidebar.open { left: 0; }
  .hide-on-mobile { display: none !important; }
  .top-nav { padding: 0 20px; }
  .content-view { padding: 24px 20px; }
  .menu-toggle { display: flex; }
  .sidebar-close-btn { display: flex; }
}
@media (max-width: 768px) {
  .title-block h1 { font-size: var(--md-headline-md); }
  .passage-card { position: relative; top: 0; height: auto; max-height: 350px; border-radius: var(--md-shape-lg); padding: 20px; }
  .question-card { padding: 20px; }
  .question-card.grouped { min-height: auto; margin-bottom: 24px; }
  .daily-header-container { flex-direction: column; align-items: flex-start; }
  .daily-section-tabs { width: 100%; overflow-x: auto; }
  .daily-date-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .mock-timer-bar { padding: 10px 16px; gap: 12px; flex-direction: column; align-items: flex-start; margin: -24px -20px 24px -20px; }
  .timer-timer { font-size: var(--md-title-sm); }
  .analysis-main-score { gap: 24px; }
  .score-circle { width: 120px; height: 120px; }
  .score-val { font-size: 2.5rem; }
  .stats-mini-grid { grid-template-columns: 1fr; }
  .dashboard-container { padding: 16px; }
  .dash-header { flex-direction: column; gap: 12px; }
  .dash-card { padding: 20px; }
  .content-view { padding: 20px 16px; }
  .bookmarks-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .nudge-modal { padding: 32px 20px 24px !important; margin: 16px; }
  .nudge-title { font-size: var(--md-title-md); }
  .nudge-body { font-size: 0.9rem; }
  .home-cta-section { padding: 32px 20px; }
  .home-cta-section h2 { font-size: var(--md-title-md); }
}
