/* ================================================================
   NEET-UG CBT TEST RUNNER - DESIGN SYSTEM & STYLESHEET
   Reference: ajmbbs archive style standards
   Theme: Light Theme by default, Clean, No Emojis, Button Symmetry,
   Mobile-Optimized & Fluid Responsive Layout
   ================================================================ */

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

:root {
  /* Default: Clean High-Contrast Light Theme */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-surface-subtle: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  
  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-strong: #94a3b8;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-inverse: #ffffff;
  
  /* Modern Deep Navy & Royal Blue Brand Palette (Reference App Style) */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-active: #1e40af;
  --primary-subtle: #eff6ff;
  --primary-border: #bfdbfe;
  --primary-rgb: 37, 99, 235;

  --brand-navy: #0b1329;
  --brand-navy-card: #0f172a;

  /* NTA Official CBT Status Palette */
  --nta-not-visited: #94a3b8;
  --nta-not-visited-bg: #f1f5f9;
  --nta-not-answered: #dc2626;
  --nta-not-answered-bg: #fee2e2;
  --nta-answered: #16a34a;
  --nta-answered-bg: #dcfce7;
  --nta-review: #7c3aed;
  --nta-review-bg: #f3e8ff;
  --nta-answered-review: #7c3aed;

  /* Subject Accent Badges */
  --bio-badge-bg: #ecfdf5;
  --bio-badge-text: #047857;
  --bio-badge-border: #a7f3d0;

  --phy-badge-bg: #eff6ff;
  --phy-badge-text: #1d4ed8;
  --phy-badge-border: #bfdbfe;

  --chem-badge-bg: #fffbeb;
  --chem-badge-text: #b45309;
  --chem-badge-border: #fde68a;

  /* Elevation Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Optional Dark Theme Mode */
body.dark-mode {
  --bg-app: #03020d;
  --bg-surface: #0b0f17;
  --bg-surface-elevated: #111827;
  --bg-surface-subtle: #1e293b;
  --bg-surface-hover: #334155;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-strong: rgba(255, 255, 255, 0.25);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #64748b;
  --text-inverse: #03020d;
  
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-active: #2563eb;
  --primary-subtle: rgba(59, 130, 246, 0.15);
  --primary-border: rgba(59, 130, 246, 0.35);

  --brand-navy: #060b18;
  --brand-navy-card: #0f172a;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.6);
}

/* ================================================================
   BASE & RESET
   ================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: 'Outfit', 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* ================================================================
   LAYOUT CONTAINERS
   ================================================================ */
.app-container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 24px 20px;
}

@media (max-width: 640px) {
  .app-container {
    padding: 16px 14px;
  }
}

/* ================================================================
   HEADER & NAVBAR (SLEEK DARK MODERN STYLE - SCREENSHOT 3 & 4 MATCH)
   ================================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0b1329;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: all var(--transition-normal);
}

body.dark-mode .site-header {
  background: #060b18;
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 18px;
}

@media (max-width: 640px) {
  .nav-bar {
    height: 56px;
    padding: 0 14px;
  }
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

.brand-emblem-svg {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb 0%, #1e1b4b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.brand-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  letter-spacing: -0.015em;
}

.brand-cbt-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.25);
  border: 1px solid rgba(147, 197, 253, 0.3);
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-action-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.header-action-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.25);
}

.header-user-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  border: 2px solid #38bdf8;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
  transition: all var(--transition-fast);
}

.header-user-avatar-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
}

/* Strict Single Icon Visibility Controls */
.theme-toggle-btn .theme-icon-sun {
  display: none !important;
}
.theme-toggle-btn .theme-icon-moon {
  display: block !important;
}

body.dark-mode .theme-toggle-btn .theme-icon-sun {
  display: block !important;
}
body.dark-mode .theme-toggle-btn .theme-icon-moon {
  display: none !important;
}

/* ================================================================
   SLIDE-IN NAVIGATION DRAWER (SCREENSHOT 2 & 4 REPLICATION)
   ================================================================ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.app-drawer {
  position: fixed;
  top: 0;
  right: -360px;
  width: 340px;
  max-width: 86vw;
  height: 100vh;
  background: #ffffff;
  z-index: 999;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
  transition: right 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 24px 0 0 24px;
}

body.dark-mode .app-drawer {
  background: #0f172a;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.app-drawer.active {
  right: 0;
}

/* Drawer User Profile Banner (Screenshot 2) */
.drawer-profile-card {
  background: linear-gradient(135deg, #090e1a 0%, #172554 100%);
  padding: 28px 22px 22px;
  border-radius: 0 0 24px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  position: relative;
}

.drawer-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.drawer-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
  border: 2px solid #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3);
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-avatar-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.drawer-user-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.01em;
}

.drawer-user-email {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #60a5fa;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: gap 0.15s ease;
}

.drawer-profile-link:hover {
  gap: 9px;
  color: #93c5fd;
}

.drawer-content {
  padding: 20px 16px 30px;
  display: flex;
  flex-direction: column;
}

.drawer-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 12px 6px;
}

.drawer-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 14px;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
}

.drawer-nav-item:hover {
  background: var(--bg-surface-subtle);
}

.drawer-nav-item.active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

body.dark-mode .drawer-nav-item.active {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
}

.drawer-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drawer-icon-box.blue { background: #eff6ff; color: #2563eb; }
.drawer-icon-box.purple { background: #f5f3ff; color: #7c3aed; }
.drawer-icon-box.teal { background: #f0fdf4; color: #059669; }
.drawer-icon-box.amber { background: #fffbeb; color: #d97706; }
.drawer-icon-box.cyan { background: #ecfeff; color: #0891b2; }
.drawer-icon-box.indigo { background: #eef2ff; color: #4f46e5; }
.drawer-icon-box.green { background: #f0fdf4; color: #16a34a; }
.drawer-icon-box.pink { background: #fdf2f8; color: #db2777; }
.drawer-icon-box.orange { background: #fff7ed; color: #ea580c; }

body.dark-mode .drawer-icon-box {
  background: rgba(255, 255, 255, 0.08) !important;
}

.drawer-footer-btn-wrap {
  margin-top: 14px;
  padding: 0 10px;
}

.drawer-signout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.drawer-signout-btn:hover {
  background: #fecaca;
  color: #b91c1c;
}

body.dark-mode .drawer-signout-btn {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.3);
  color: #f87171;
}

/* ================================================================
   BUTTONS (SYMMETRY, EQUAL DIMENSIONS & NO-EMOJIS)
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  box-sizing: border-box;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 0.82rem;
}

.btn-lg {
  height: 46px;
  padding: 0 22px;
  font-size: 0.96rem;
  font-weight: 700;
}

/* Button Variants */
.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 4px rgba(var(--primary-rgb), 0.2);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--bg-surface-subtle);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}
.btn-secondary:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--border-medium);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-secondary);
  border-color: var(--border-medium);
}
.btn-outline:hover {
  background-color: var(--bg-surface-subtle);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-danger-outline {
  background-color: transparent;
  color: #dc2626;
  border-color: #fca5a5;
}
.btn-danger-outline:hover {
  background-color: #fee2e2;
  border-color: #ef4444;
}

.btn-purple {
  background-color: var(--nta-review-bg);
  color: var(--nta-review);
  border-color: #ddd6fe;
}
.btn-purple:hover {
  background-color: #ede9fe;
  border-color: #c4b5fd;
}

.btn-group-symmetrical {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 640px) {
  .btn-group-symmetrical {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    gap: 8px;
  }
  .btn-group-symmetrical .btn {
    width: 100%;
    padding: 0 10px;
    font-size: 0.84rem;
  }
}

/* ================================================================
   HOME HERO SECTION (SCREENSHOT 3: SKY GRADIENT & METRIC BANNER)
   ================================================================ */
.hero-app-banner {
  background: linear-gradient(180deg, #38bdf8 0%, #2563eb 100%);
  border-radius: 24px;
  padding: 22px 22px 26px;
  color: #ffffff;
  margin-bottom: 28px;
  box-shadow: 0 10px 25px -4px rgba(37, 99, 235, 0.25);
  position: relative;
  overflow: hidden;
}

body.dark-mode .hero-app-banner {
  background: linear-gradient(180deg, #1e3a8a 0%, #0f172a 100%);
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.4);
}

.hero-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.hero-goal-pill {
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #ffffff;
  user-select: none;
  transition: all var(--transition-fast);
}

.hero-goal-pill:hover {
  background: rgba(255, 255, 255, 0.32);
}

.goal-label {
  font-size: 0.72rem;
  opacity: 0.9;
  font-weight: 500;
}

.goal-target {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hero-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.counsellor-pill-btn {
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.counsellor-pill-btn:hover {
  background: rgba(255, 255, 255, 0.32);
}

.user-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: #ffffff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition-fast);
}

.user-avatar-circle:hover {
  transform: scale(1.05);
}

/* Hero Twin Cards (Screenshot 3 Style) */
.hero-twin-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 520px) {
  .hero-twin-cards {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

.hero-twin-card {
  border-radius: 18px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.hero-twin-card:hover {
  transform: translateY(-2px);
}

.card-compete {
  background: linear-gradient(135deg, #0c1833 0%, #172554 100%);
  box-shadow: 0 6px 16px rgba(12, 24, 51, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.card-doubt {
  background: linear-gradient(135deg, #042f2e 0%, #064e3b 100%);
  box-shadow: 0 6px 16px rgba(4, 47, 46, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.twin-card-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.twin-card-title {
  font-family: 'Outfit', 'Poppins', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.01em;
}

.twin-card-sub {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.3;
}

.twin-card-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
}

/* Featured PYQ Card inside Hero */
.hero-pyq-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 20px -2px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-primary);
}

body.dark-mode .hero-pyq-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-pyq-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -2px rgba(0, 0, 0, 0.15);
}

.hero-pyq-title {
  font-family: 'Outfit', 'Poppins', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.015em;
}

body.dark-mode .hero-pyq-title {
  color: #f8fafc;
}

.hero-pyq-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.84rem;
  color: #64748b;
}

.pyq-metric-bold {
  font-weight: 700;
  color: #334155;
}

body.dark-mode .pyq-metric-bold {
  color: #cbd5e1;
}

.pyq-sep {
  color: #cbd5e1;
}

.hero-pyq-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body.dark-mode .hero-pyq-icon-badge {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
}

/* ================================================================
   TOPIC WISE QUESTION BANKS (SCREENSHOT 3 STYLE)
   ================================================================ */
.topic-banks-header {
  margin-bottom: 14px;
}

.topic-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.topic-search-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: 14px;
  padding: 0 14px;
  height: 46px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
}

.topic-search-box:focus-within {
  border-color: #2563eb;
}

.search-input-icon {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.topic-search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 0.90rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-left: 10px;
}

.tool-square-btn {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.tool-square-btn:hover {
  background: var(--bg-surface-subtle);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* Horizontal Scrollable Subject Tabs (Screenshot 3 Underline Style) */
.subject-horizontal-tabs {
  display: flex;
  align-items: center;
  gap: 22px;
  overflow-x: auto;
  border-bottom: 1.5px solid #e2e8f0;
  margin-bottom: 18px;
  padding-bottom: 0;
  scrollbar-width: none;
}

body.dark-mode .subject-horizontal-tabs {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.subject-horizontal-tabs::-webkit-scrollbar {
  display: none;
}

.subj-tab-pill {
  padding: 8px 4px 10px;
  border: none !important;
  border-bottom: 2.5px solid transparent !important;
  background: transparent !important;
  color: #64748b;
  font-weight: 600;
  font-size: 0.94rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  user-select: none;
  border-radius: 0 !important;
}

.subj-tab-pill:hover {
  color: #0f172a;
}

body.dark-mode .subj-tab-pill:hover {
  color: #ffffff;
}

.subj-tab-pill.active {
  color: #2563eb !important;
  border-bottom-color: #2563eb !important;
  font-weight: 800;
}

body.dark-mode .subj-tab-pill.active {
  color: #60a5fa !important;
  border-bottom-color: #60a5fa !important;
}

/* Sleek Topic Cards Stack (Screenshot 3 Style) */
.topic-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.topic-card-item {
  background: #ffffff;
  border: 1.5px solid #edf2f7;
  border-radius: 20px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.03);
}

body.dark-mode .topic-card-item {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.4);
}

.topic-card-item:hover {
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -2px rgba(37, 99, 235, 0.12);
}

.topic-card-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1;
}

.topic-card-tile {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.tile-phy {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}

.tile-bio {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.tile-chem {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

body.dark-mode .tile-phy {
  background: rgba(217, 119, 6, 0.2);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

body.dark-mode .tile-bio {
  background: rgba(5, 150, 105, 0.2);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
}

body.dark-mode .tile-chem {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
}

.topic-card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.topic-badge-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topic-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-pill-sub {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-weight: 600;
  display: inline-block;
  margin-top: 3px;
  max-width: fit-content;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-card-arrow {
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.topic-card-item:hover .topic-card-arrow {
  color: #2563eb;
  transform: translateX(4px);
}

/* ================================================================
   PAPERS & TESTS LIST (SCREENSHOT 4 STYLE)
   ================================================================ */
.papers-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.papers-tag-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.papers-year-label {
  font-family: 'Outfit', 'Poppins', sans-serif;
  font-size: 1.20rem;
  font-weight: 800;
  color: var(--text-primary);
}

.badge-new-pill {
  background: #ef4444;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.papers-count-sub {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.paper-rows-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.paper-row-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.paper-row-card:hover {
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.paper-row-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.paper-row-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.paper-row-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.btn-paper-start {
  border-radius: var(--radius-full);
  font-weight: 700;
  padding: 0 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ================================================================
   CARDS & SECTIONS
   ================================================================ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.section-container {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-family: 'Outfit', 'Poppins', sans-serif;
  font-size: 1.30rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.section-description {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin-top: 3px;
}

/* ================================================================
   HOME SECTION 1: COMPACT CLEAN SUBJECT CARDS
   ================================================================ */
.compact-subject-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 820px) {
  .compact-subject-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.compact-subject-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.compact-subject-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.compact-subject-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.compact-subject-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.badge-bio {
  background: var(--bio-badge-bg);
  color: var(--bio-badge-text);
  border: 1px solid var(--bio-badge-border);
}

.badge-phy {
  background: var(--phy-badge-bg);
  color: var(--phy-badge-text);
  border: 1px solid var(--phy-badge-border);
}

.badge-chem {
  background: var(--chem-badge-bg);
  color: var(--chem-badge-text);
  border: 1px solid var(--chem-badge-border);
}

.compact-subject-name {
  font-family: 'Outfit', 'Poppins', sans-serif;
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.compact-subject-meta {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ================================================================
   HOME SECTION 2: FULL LENGTH MOCK TESTS
   ================================================================ */
.full-mock-banner {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
  border: 1.5px solid var(--primary-border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-sm);
}

body.dark-mode .full-mock-banner {
  background: linear-gradient(135deg, #0b0f17 0%, #0d1e24 100%);
  border-color: rgba(45, 212, 191, 0.25);
}

.mock-specs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 768px) {
  .mock-specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.spec-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  text-align: center;
}

.spec-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.spec-label {
  font-size: 0.70rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 3px;
}

/* ================================================================
   HOME SECTION 3: CUSTOM TEST OPTION CARD
   ================================================================ */
.home-custom-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.home-custom-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

/* ================================================================
   VIEW: DEDICATED SUBJECT PAGE (CHAPTERS BROWSER)
   ================================================================ */
.subject-page-header {
  margin-bottom: 24px;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.breadcrumb-link {
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}

.breadcrumb-link:hover {
  text-decoration: underline;
}

.subject-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.subject-class-tabs {
  display: flex;
  gap: 6px;
}

.class-filter-btn {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.80rem;
  font-weight: 700;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.class-filter-btn.active {
  background: var(--primary-subtle);
  color: var(--primary);
  border-color: var(--primary-border);
}

/* Chapter List Container (Clean & Sleek Thin Cards) */
.chapter-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.chapter-list-item {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.chapter-list-item:hover {
  border-color: var(--primary);
  background: var(--bg-surface);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.chapter-list-main {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.chapter-list-left-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.chapter-list-num {
  font-family: 'Outfit', 'Poppins', monospace, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  min-width: 32px;
  text-align: center;
}

.chapter-list-class {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
}

.chapter-list-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chapter-list-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0;
}

.chapter-list-sub {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chapter-list-action {
  flex-shrink: 0;
}

.chapter-solve-btn {
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
}

@media (max-width: 600px) {
  .chapter-list-item {
    padding: 10px 14px;
    gap: 10px;
  }

  .chapter-list-main {
    gap: 10px;
  }

  .chapter-list-num {
    font-size: 0.76rem;
    padding: 2px 6px;
    min-width: 28px;
  }

  .chapter-list-class {
    display: none;
  }

  .chapter-list-name {
    font-size: 0.90rem;
  }

  .chapter-list-sub {
    font-size: 0.72rem;
  }

  .chapter-solve-btn {
    padding: 5px 12px;
    font-size: 0.78rem;
  }
}

/* ================================================================
   VIEW: DEDICATED CUSTOM TEST BUILDER PAGE
   ================================================================ */
.builder-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

@media (max-width: 960px) {
  .builder-layout {
    grid-template-columns: 1fr;
  }
}

.builder-step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 14px;
}

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.step-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.subject-pill-selectors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 540px) {
  .subject-pill-selectors {
    grid-template-columns: 1fr;
  }
}

.subject-checkbox-label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.90rem;
  transition: all var(--transition-fast);
  user-select: none;
}

.subject-checkbox-label:hover {
  border-color: var(--primary-border);
}

.subject-checkbox-label.selected {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: var(--primary);
}

.chapter-checklist-box {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  background: var(--bg-app);
}

.chapter-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 6px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.86rem;
  cursor: pointer;
  user-select: none;
}

.chapter-check-item:last-child {
  border-bottom: none;
}

.chapter-check-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.builder-summary-card {
  position: sticky;
  top: 84px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.summary-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.88rem;
}

.summary-metric-label {
  color: var(--text-secondary);
}

.summary-metric-val {
  font-weight: 700;
  color: var(--text-primary);
}

/* ================================================================
   MODAL: PRE-TEST MODE SELECTOR (BEAUTIFIED & NARROW-SCREEN SAFE)
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  max-width: 520px;
  width: 100%;
  padding: 28px 26px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  transform: scale(0.96);
  transition: transform var(--transition-normal);
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .modal-dialog {
    padding: 20px 16px;
    border-radius: 20px;
  }
}

.modal-overlay.active .modal-dialog {
  transform: scale(1);
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.015em;
}

.modal-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 22px;
  line-height: 1.5;
}

.mode-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 480px) {
  .mode-cards-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.mode-card-choice {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  padding: 16px 16px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  user-select: none;
  position: relative;
}

body.dark-mode .mode-card-choice {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}

.mode-card-choice:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

body.dark-mode .mode-card-choice:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Selected Mode Card: Clean High-Contrast Dark Navy / Royal Blue Outline (NO GREEN!) */
.mode-card-choice.selected {
  border: 2px solid #0f172a !important;
  background: #f8fafc !important;
  box-shadow: 0 6px 18px -3px rgba(15, 23, 42, 0.08) !important;
}

body.dark-mode .mode-card-choice.selected {
  border-color: #3b82f6 !important;
  background: rgba(59, 130, 246, 0.12) !important;
  box-shadow: 0 6px 18px -3px rgba(0, 0, 0, 0.5) !important;
}

.mode-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mode-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mode-card-choice.selected .mode-card-title {
  color: #0f172a !important;
  font-weight: 800;
}

body.dark-mode .mode-card-choice.selected .mode-card-title {
  color: #60a5fa !important;
}

.mode-radio-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

body.dark-mode .mode-radio-circle {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.2);
}

.mode-card-choice.selected .mode-radio-circle {
  border-color: #0f172a !important;
  background: #0f172a !important;
}

body.dark-mode .mode-card-choice.selected .mode-radio-circle {
  border-color: #3b82f6 !important;
  background: #3b82f6 !important;
}

.mode-radio-inner {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  opacity: 0;
  transform: scale(0.4);
  transition: all 0.15s ease;
}

.mode-card-choice.selected .mode-radio-inner {
  opacity: 1;
  transform: scale(1);
}

.mode-card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Modal Action Buttons (Clean & Non-Green) */
.modal-action-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  width: 100%;
}

.modal-action-bar .btn-outline {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  color: #334155;
  font-weight: 600;
  border-radius: 12px;
  padding: 11px 22px;
  font-size: 0.94rem;
}

.modal-action-bar .btn-outline:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

body.dark-mode .modal-action-bar .btn-outline {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

/* Proceed Button: Crisp Dark Navy / Royal Blue Solid with White Text */
.modal-action-bar .btn-primary {
  background: #0f172a !important;
  border: none !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  padding: 11px 24px !important;
  font-size: 0.94rem !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25) !important;
  transition: all 0.15s ease !important;
}

.modal-action-bar .btn-primary:hover {
  background: #1e293b !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35) !important;
}

body.dark-mode .modal-action-bar .btn-primary {
  background: #2563eb !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3) !important;
}

body.dark-mode .modal-action-bar .btn-primary:hover {
  background: #1d4ed8 !important;
}

@media (max-width: 480px) {
  .modal-action-bar {
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
  }
  .modal-action-bar .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ================================================================
   SCREEN: TEST INSTRUCTIONS VIEW (SCREENSHOT 5 EXACT REPLICATION)
   ================================================================ */
.instructions-container {
  max-width: 680px;
  margin: 12px auto 48px;
  padding: 0 12px;
}

.instructions-back-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  cursor: pointer;
  margin-bottom: 20px;
  user-select: none;
  transition: color var(--transition-fast);
}

.instructions-back-nav:hover {
  color: #2563eb;
}

.instructions-title-group {
  margin-bottom: 24px;
}

.instructions-display-title {
  font-family: 'Outfit', 'Poppins', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

@media (max-width: 640px) {
  .instructions-display-title {
    font-size: 1.75rem;
  }
}

.instructions-display-sub {
  font-size: 0.96rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* Hero Test Spec Card (Screenshot 5 Style) */
.instruction-hero-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 6px 24px -2px rgba(0, 0, 0, 0.05);
  margin-bottom: 26px;
}

.instruction-hero-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.instruction-hero-icon-tile {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body.dark-mode .instruction-hero-icon-tile {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.3);
}

.instruction-hero-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.instruction-paper-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: #6366f1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.instruction-paper-title {
  font-family: 'Outfit', 'Poppins', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.015em;
}

@media (max-width: 640px) {
  .instruction-paper-title {
    font-size: 1.20rem;
  }
}

/* 4-Column Metric Grid */
.instruction-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.instruction-stat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-icon-circle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.icon-circle-purple {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

.icon-circle-blue {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.icon-circle-indigo {
  background: #e0e7ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.icon-circle-violet {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.stat-val-bold {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

@media (max-width: 640px) {
  .stat-val-bold {
    font-size: 1.15rem;
  }
}

.mark-pos {
  color: #10b981;
  font-weight: 800;
}

.mark-sep {
  color: var(--text-tertiary);
  margin: 0 2px;
  font-weight: 600;
}

.mark-neg {
  color: #ef4444;
  font-weight: 800;
}

.stat-label-sub {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Important Instructions Checklist Section */
.instruction-checklist-section {
  margin-bottom: 24px;
}

.instruction-section-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.instruction-list-heading {
  font-family: 'Outfit', 'Poppins', sans-serif;
  font-size: 1.20rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.instruction-checklist-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: 22px;
  padding: 8px 20px;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.04);
}

.checklist-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.checklist-row:last-child {
  border-bottom: none;
}

.check-badge-circle {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body.dark-mode .check-badge-circle {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.35);
  color: #60a5fa;
}

.checklist-text {
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.45;
}

.checklist-text strong {
  font-weight: 800;
}

/* Agreement Checkbox Row */
.instruction-agreement-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-subtle);
  margin-bottom: 22px;
  cursor: pointer;
  font-size: 0.90rem;
  font-weight: 600;
  color: var(--text-primary);
  user-select: none;
  transition: all var(--transition-fast);
}

.instruction-agreement-row:hover {
  border-color: var(--border-medium);
}

.instruction-agreement-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #2563eb;
  cursor: pointer;
  flex-shrink: 0;
}

/* CTA Start Test Button Row */
.instructions-cta-row {
  display: flex;
  justify-content: stretch;
}

.btn-start-test-hero {
  width: 100%;
  height: 52px;
  border-radius: 16px;
  font-size: 1.08rem;
  font-weight: 800;
  background-color: #2563eb;
  border-color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  color: #ffffff;
  transition: all var(--transition-fast);
}

.btn-start-test-hero:hover {
  background-color: #1d4ed8;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}

/* ================================================================
   SCREEN: CBT TEST RUNNER ENGINE
   ================================================================ */
.runner-layout {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 16px;
  min-height: calc(100vh - 100px);
}

@media (max-width: 990px) {
  .runner-layout {
    grid-template-columns: 1fr;
  }
}

/* Sleek Modern Runner Top Bar (Screenshot 1 & 2 Style) */
.runner-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 4px 16px;
  background: transparent;
  color: #ffffff;
}

body.dark-mode .runner-top-bar {
  background: transparent;
  border: none;
}

.runner-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.runner-exit-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.runner-exit-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.runner-title-compact {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.runner-test-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.runner-subj-info {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
}

/* ================================================================
   RECTANGULAR BLUE IPHONE NOTCH (CONTINUATION OF BLUE HEADER)
   ================================================================ */
.runner-iphone-notch-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  position: relative;
  z-index: 35;
  margin-top: -12px;
  margin-bottom: 10px;
}

.runner-iphone-notch {
  background: #091126; /* Exact deep cosmic blue continuation of the header */
  padding: 8px 34px 11px;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: none;
  position: relative;
}

/* Authentic iPhone camera ear smooth curve cutouts */
.runner-iphone-notch::before,
.runner-iphone-notch::after {
  content: "";
  position: absolute;
  top: 0;
  width: 12px;
  height: 12px;
  pointer-events: none;
}

.runner-iphone-notch::before {
  left: -12px;
  background: radial-gradient(circle at 0 100%, transparent 12px, #091126 12px);
}

.runner-iphone-notch::after {
  right: -12px;
  background: radial-gradient(circle at 100% 100%, transparent 12px, #091126 12px);
}

.notch-camera-lens {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #040817;
  border: 1.5px solid #1e293b;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5), inset 0 0 2px #000;
  flex-shrink: 0;
}

.notch-q-title {
  font-family: 'Outfit', 'Poppins', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  font-style: italic;
  color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.runner-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.runner-top-bar .timer-pill {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 5px 12px;
  font-size: 0.84rem;
  border-radius: var(--radius-full);
  font-family: 'Inter', monospace;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.runner-mode-pill {
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.runner-mode-pill.mode-practice {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.runner-mode-pill.mode-test {
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border: 1px solid rgba(165, 180, 252, 0.35);
}

/* Multi-subject Switcher Pills Row */
.runner-subject-pills-row {
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.runner-subject-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.runner-subject-pill-btn {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.80rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.runner-subject-pill-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.runner-subject-pill-btn.active {
  background: #ffffff;
  color: #091124;
  border-color: #ffffff;
  font-weight: 800;
}

body.dark-mode .runner-subject-pill-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* Question Stage Card (Screenshot 1 Floating Card) */
.question-stage-card {
  background: #ffffff;
  border: none;
  border-radius: 28px;
  padding: 34px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 520px;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.35);
}

body.dark-mode .question-stage-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.7);
}

@media (max-width: 640px) {
  .question-stage-card {
    padding: 24px 18px;
    border-radius: 22px;
    min-height: 440px;
  }
}

/* Question Statement - Clear Thin Italic & Beautiful Clean Font Style */
.question-text-area {
  font-family: 'Outfit', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.15rem;
  font-weight: 400; /* clear thin / regular */
  font-style: italic; /* beautiful clean italic */
  color: #0f172a;
  line-height: 1.72;
  letter-spacing: 0.015em;
  text-align: left !important;
  margin: 6px 0 26px 0;
  width: 100%;
  max-width: 100%;
  user-select: text;
  word-break: break-word;
}

body.dark-mode .question-text-area {
  color: #f8fafc;
}

@media (max-width: 640px) {
  .question-text-area {
    font-size: 1.05rem;
    line-height: 1.62;
    margin: 4px 0 20px 0;
    text-align: left !important;
  }
}

/* Options Stack (Screenshot 1 & 2 Exact Match) */
.options-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
  width: 100%;
}

.option-choice-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 22px;
  border-radius: 16px;
  background: #ffffff;
  border: 1.5px solid #edf2f7;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  position: relative;
  box-sizing: border-box;
  font-family: 'Outfit', 'Poppins', sans-serif;
}

body.dark-mode .option-choice-item {
  background: #141c2e;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.option-choice-item:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

body.dark-mode .option-choice-item:hover {
  background: #1c273e;
  border-color: rgba(255, 255, 255, 0.28);
}

/* Selected Option: Crisp Dark Outline, Solid Dark Letter Badge & Left Notch (Screenshot 1) */
.option-choice-item.selected {
  border: 2px solid #0f172a !important;
  background: #ffffff !important;
}

body.dark-mode .option-choice-item.selected {
  border-color: #60a5fa !important;
  background: rgba(59, 130, 246, 0.18) !important;
}

/* Triangular Left Notch Indicator (Pointing into card from Screenshot 1) */
.option-choice-item.selected::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 9px solid #0f172a;
  z-index: 2;
}

body.dark-mode .option-choice-item.selected::before {
  border-left-color: #60a5fa;
}

/* Letter Badge */
.option-letter-badge {
  width: 28px;
  height: 28px;
  border-radius: 0;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.10rem;
  color: #0f172a;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

body.dark-mode .option-letter-badge {
  color: #cbd5e1;
  font-weight: 700;
}

.option-choice-item.selected .option-letter-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1e293b !important;
  color: #ffffff !important;
  font-weight: 800;
  font-size: 0.95rem;
}

body.dark-mode .option-choice-item.selected .option-letter-badge {
  background: #2563eb !important;
  color: #ffffff !important;
}

.option-text {
  font-family: 'Outfit', 'Poppins', sans-serif;
  font-size: 1.02rem;
  font-weight: 500;
  color: #0f172a;
  line-height: 1.5;
  flex: 1;
}

body.dark-mode .option-text {
  color: #f8fafc;
  font-weight: 500;
}

.option-choice-item.selected .option-text {
  font-weight: 600;
  color: #0f172a;
}

body.dark-mode .option-choice-item.selected .option-text {
  color: #ffffff !important;
  font-weight: 700;
}

/* Practice Mode Revealed Answers - High Contrast Light & Dark Mode */
.option-choice-item.practice-correct {
  border: 2px solid #16a34a !important;
  background: #dcfce7 !important;
  box-shadow: 0 0 0 1px #16a34a, 0 4px 12px rgba(22, 163, 74, 0.15) !important;
}

.option-choice-item.practice-correct .option-letter-badge {
  background: #16a34a !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border-radius: 8px;
}

.option-choice-item.practice-correct .option-text {
  color: #14532d !important; /* Deep dark green in light mode for 100% contrast */
  font-weight: 700 !important;
}

body.dark-mode .option-choice-item.practice-correct {
  border: 2px solid #22c55e !important;
  background: rgba(34, 197, 94, 0.24) !important;
  box-shadow: 0 0 0 1px #22c55e, 0 4px 16px rgba(34, 197, 94, 0.3) !important;
}

body.dark-mode .option-choice-item.practice-correct .option-letter-badge {
  background: #22c55e !important;
  color: #022c22 !important; /* Dark green on bright green badge */
  font-weight: 800 !important;
  border-radius: 8px;
}

body.dark-mode .option-choice-item.practice-correct .option-text {
  color: #86efac !important; /* Vivid mint green on dark emerald background - 100% readable */
  font-weight: 700 !important;
}

.option-choice-item.practice-incorrect {
  border: 2px solid #dc2626 !important;
  background: #fee2e2 !important;
  box-shadow: 0 0 0 1px #dc2626, 0 4px 12px rgba(220, 38, 38, 0.15) !important;
}

.option-choice-item.practice-incorrect .option-letter-badge {
  background: #dc2626 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border-radius: 8px;
}

.option-choice-item.practice-incorrect .option-text {
  color: #7f1d1d !important; /* Deep dark red in light mode for 100% contrast */
  font-weight: 700 !important;
}

body.dark-mode .option-choice-item.practice-incorrect {
  border: 2px solid #ef4444 !important;
  background: rgba(239, 68, 68, 0.24) !important;
  box-shadow: 0 0 0 1px #ef4444, 0 4px 16px rgba(239, 68, 68, 0.3) !important;
}

body.dark-mode .option-choice-item.practice-incorrect .option-letter-badge {
  background: #ef4444 !important;
  color: #450a0a !important; /* Deep red text on bright red badge */
  font-weight: 800 !important;
  border-radius: 8px;
}

body.dark-mode .option-choice-item.practice-incorrect .option-text {
  color: #fca5a5 !important; /* Vivid bright rose/pink on dark crimson background - 100% readable */
  font-weight: 700 !important;
}

.option-choice-item.practice-locked {
  cursor: default !important;
  pointer-events: none;
}

.practice-explanation-wrapper {
  margin-top: 14px;
  padding: 16px 20px;
  border-radius: 18px;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  color: #14532d;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  overflow-x: auto;
}

.practice-exp-body {
  max-width: 100%;
  line-height: 1.65;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

body.dark-mode .practice-explanation-wrapper {
  background: #0d1e2e;
  border-color: rgba(34, 197, 94, 0.35);
  color: #e2e8f0;
}

body.dark-mode .practice-explanation-wrapper strong {
  color: #4ade80;
}

.practice-exp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  color: #166534;
}

body.dark-mode .practice-exp-header {
  color: #4ade80;
}

.practice-exp-body {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #14532d;
}

body.dark-mode .practice-exp-body {
  color: #bbf7d0;
}

.ncert-ref-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary-border);
}

/* Runner Action Bar: Row 1 (3 buttons), Row 2 (2 buttons) */
.runner-action-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 16px;
}

.runner-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

/* Row 1: 3 buttons (Previous Arrow, Clear Response, Next Arrow) */
.runner-action-row.row-1 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.runner-action-row.row-1 #btn-clear-response {
  flex: 1;
  text-align: center;
}

/* Compact Arrow Icon Buttons */
.btn-icon-arrow {
  width: 44px;
  height: 40px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon-arrow svg {
  display: block;
  stroke-width: 2.5;
}

.btn-icon-arrow:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Row 2: 3 buttons (Mark for Review, Navigation Go To, Submit) */
.runner-action-row.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.runner-action-row.row-2 .btn {
  width: 100%;
  text-align: center;
  padding: 8px 12px;
  font-size: 0.84rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-text-short {
  display: none;
}

.btn-text-full {
  display: inline;
}

@media (max-width: 520px) {
  .btn-text-full {
    display: none;
  }
  .btn-text-short {
    display: inline;
  }
}

@media (max-width: 480px) {
  .runner-action-bar {
    gap: 8px;
    padding-top: 12px;
  }
  .runner-action-row {
    gap: 6px;
  }
  .btn-icon-arrow {
    width: 40px;
    height: 38px;
  }
  .runner-action-row.row-1 #btn-clear-response {
    padding: 8px 10px;
    font-size: 0.80rem;
  }
  .runner-action-row.row-2 {
    gap: 6px;
  }
  .runner-action-row.row-2 .btn {
    padding: 8px 6px;
    font-size: 0.78rem;
  }
}

.palette-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: fit-content;
}

@media (max-width: 990px) {
  .palette-sidebar {
    position: fixed;
    top: 0;
    right: -340px;
    width: 300px;
    height: 100vh;
    z-index: 500;
    border-radius: 0;
    box-shadow: var(--shadow-xl);
    transition: right var(--transition-normal);
    overflow-y: auto;
  }
  .palette-sidebar.open {
    right: 0;
  }
}

.palette-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.palette-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
}

.palette-counter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
}

.counter-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
}

.counter-tag.ans {
  background: var(--nta-answered-bg);
  color: var(--nta-answered);
  border-color: #86efac;
}

.counter-tag.unans {
  background: var(--nta-not-answered-bg);
  color: var(--nta-not-answered);
  border-color: #fca5a5;
}

.counter-tag.rev {
  background: var(--nta-review-bg);
  color: var(--nta-review);
  border-color: #d8b4fe;
}

.counter-tag.notvis {
  background: var(--nta-not-visited-bg);
  color: var(--nta-not-visited);
  border-color: var(--border-medium);
}

.palette-numbers-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
  padding: 4px;
}

/* Subject header label inside the palette (for multi-subject tests) */
.palette-subj-header {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 6px 4px 3px;
  border-top: 1.5px solid var(--border-subtle);
  color: var(--text-secondary);
  margin-top: 4px;
}

.palette-subj-header:first-child {
  border-top: none;
  margin-top: 0;
}

.palette-subj-bio  { color: #059669; border-top-color: #a7f3d0; }
.palette-subj-phy  { color: #d97706; border-top-color: #fde68a; }
.palette-subj-chem { color: #2563eb; border-top-color: #bfdbfe; }

body.dark-mode .palette-subj-bio  { color: #34d399; border-top-color: rgba(52,211,153,0.3); }
body.dark-mode .palette-subj-phy  { color: #fbbf24; border-top-color: rgba(251,191,36,0.3); }
body.dark-mode .palette-subj-chem { color: #60a5fa; border-top-color: rgba(96,165,250,0.3); }

/* Button group inside each subject section */
.palette-subject-btn-group {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 4px;
}

.palette-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast);
  user-select: none;
}

.palette-btn:hover {
  transform: scale(1.08);
}

.palette-btn.current {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ================================================================
   SCREEN: TEST SUBMISSION & SCORECARD RESULTS
   ================================================================ */
.results-container {
  max-width: 920px;
  margin: 10px auto 40px;
}

.scorecard-banner {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--primary-subtle) 100%);
  border: 1.5px solid var(--primary-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  text-align: center;
}

@media (max-width: 640px) {
  .scorecard-banner {
    padding: 18px 14px;
  }
}

.score-main-value {
  font-family: 'Outfit', 'Poppins', sans-serif;
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.score-max-sub {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.results-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0;
}

@media (max-width: 768px) {
  .results-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.stat-box-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-box-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-top: 3px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.score-table th {
  background: var(--bg-surface-subtle);
  padding: 10px 14px;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.score-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.score-table tr:last-child td {
  border-bottom: none;
}

.review-filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.review-qcard {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
}

.review-qcard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.review-result-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-full);
}

.badge-correct {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.badge-incorrect {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.badge-unattempted {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* ================================================================
   SVG ICON HELPERS
   ================================================================ */
.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

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

/* ================================================================
   DOCKED FLOATING BOTTOM NAVIGATION BAR (SCREENSHOT 4 STYLE)
   ================================================================ */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  z-index: 900;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
}

body.dark-mode .bottom-nav-bar {
  background: rgba(11, 15, 23, 0.94);
  border-top-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
}

/* Full Immersive CBT Canvas (Screenshot 1 & 2 Exact Match) */
body.in-runner {
  background: #091124 !important;
}

body.in-runner .site-header,
body.in-runner .bottom-nav-bar,
#runner-view:not(.hidden) ~ .bottom-nav-bar {
  display: none !important;
}

body.in-runner .app-container {
  padding-top: 18px;
  padding-bottom: 34px;
  max-width: 860px;
}

/* Pad the bottom of the container so content is not obscured on normal pages */
body:not(.in-runner) .app-container {
  padding-bottom: 90px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  user-select: none;
}

.bottom-nav-item:hover {
  color: var(--text-primary);
}

.bottom-nav-item.active {
  color: #2563eb;
}

body.dark-mode .bottom-nav-item.active {
  color: #60a5fa;
}

.bnav-icon {
  display: block;
}

.bnav-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Elevated Circular Mock Test Button in Center (Screenshot 4) */
.bottom-nav-item.bnav-elevated {
  position: relative;
  top: -12px;
}

.bnav-circle-btn {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  background: #1d4ed8;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.4);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.bottom-nav-item.bnav-elevated:hover .bnav-circle-btn {
  transform: scale(1.06);
  background: #1e40af;
}

.bottom-nav-item.bnav-elevated .bnav-label {
  margin-top: 4px;
  color: var(--text-primary);
  font-weight: 800;
}

/* ================================================================
   BIGGER DECORATED CUSTOM PRACTICE HERO CARD
   ================================================================ */
.custom-practice-hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 60%, #eff6ff 100%);
  border: 1.5px solid #bfdbfe;
  border-radius: 20px;
  padding: 22px 26px;
  margin-top: 14px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

body.dark-mode .custom-practice-hero-card {
  background: linear-gradient(135deg, #0b0f17 0%, #111827 60%, #172554 100%);
  border-color: rgba(96, 165, 250, 0.3);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.custom-practice-hero-card:hover {
  transform: translateY(-2px);
  border-color: #2563eb;
  box-shadow: 0 14px 30px -4px rgba(37, 99, 235, 0.16), 0 6px 14px -2px rgba(0, 0, 0, 0.05);
}

body.dark-mode .custom-practice-hero-card:hover {
  border-color: #60a5fa;
  box-shadow: 0 14px 30px -4px rgba(37, 99, 235, 0.3);
}

.cp-card-left {
  flex: 1;
  min-width: 0;
}

.cp-tag-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.cp-pill-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.dark-mode .cp-pill-badge {
  background: rgba(37, 99, 235, 0.2);
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.3);
}

.cp-badge-highlight {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.cp-hero-title {
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  line-height: 1.3;
}

.cp-hero-sub {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 14px;
  max-width: 680px;
}

.cp-features-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.cp-feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cp-feature-pill svg {
  stroke: #2563eb;
  flex-shrink: 0;
}

body.dark-mode .cp-feature-pill svg {
  stroke: #60a5fa;
}

.cp-card-right {
  flex-shrink: 0;
}

.cp-action-btn {
  background: #2563eb;
  color: #ffffff;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.custom-practice-hero-card:hover .cp-action-btn {
  background: #1d4ed8;
  transform: translateX(3px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

/* ================================================================
   VIEW 2.5: CUSTOM TEST GENERATOR PAGE STYLING
   ================================================================ */
.builder-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 880px) {
  .builder-layout {
    grid-template-columns: 1fr;
  }
}

.builder-step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

body.dark-mode .builder-step-card {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.step-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

/* Custom Builder Subject Row */
.custom-builder-subj-row {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all var(--transition-fast);
}

.custom-builder-subj-row.selected {
  border-color: #2563eb;
  background: #f8fafc;
  box-shadow: 0 0 0 1px #2563eb;
}

body.dark-mode .custom-builder-subj-row.selected {
  background: rgba(37, 99, 235, 0.1);
  border-color: #60a5fa;
  box-shadow: 0 0 0 1px #60a5fa;
}

.subj-row-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.subj-checkbox {
  width: 20px;
  height: 20px;
  accent-color: #2563eb;
  cursor: pointer;
  flex-shrink: 0;
}

.subj-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  flex-wrap: wrap;
}

.subj-name {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-primary);
}

.subj-chaps-badge {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface-subtle);
  padding: 2px 8px;
  border-radius: 6px;
}

/* Stepper Group: NO WRAP to prevent Chemistry bug */
.subj-stepper-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.subj-stepper-group.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.stepper-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.stepper-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-medium);
  background: var(--bg-surface-subtle);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.stepper-btn:hover:not(:disabled) {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.stepper-input {
  width: 54px;
  height: 32px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: 8px;
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  color: var(--text-primary);
  -moz-appearance: textfield;
}

.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

@media (max-width: 640px) {
  .builder-layout {
    grid-template-columns: 100%;
    width: 100%;
    max-width: 100%;
  }
  .builder-step-card {
    padding: 14px 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .step-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
  }
  .step-title {
    font-size: 0.94rem;
    line-height: 1.35;
    word-break: break-word;
  }
  .custom-builder-subj-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 10px;
    width: 100%;
    box-sizing: border-box;
  }
  .subj-row-left {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
  }
  .subj-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .subj-name {
    font-size: 0.95rem;
  }
  .subj-chaps-badge {
    font-size: 0.72rem;
    padding: 2px 6px;
  }
  .subj-stepper-group {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px dashed var(--border-subtle);
    gap: 6px;
  }
  .stepper-label {
    font-size: 0.8rem;
  }
  .stepper-btn {
    width: 32px;
    height: 32px;
  }
  .stepper-input {
    width: 48px;
    height: 32px;
    font-size: 0.9rem;
  }
  .builder-summary-card {
    padding: 16px 14px;
    width: 100%;
    box-sizing: border-box;
  }
}

/* Step 2: Chapters Checklist */
.builder-subject-divider {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #2563eb;
  padding: 10px 8px 4px;
  margin-top: 8px;
  border-top: 1px dashed var(--border-subtle);
}

.builder-subject-divider:first-child {
  border-top: none;
  margin-top: 0;
}

body.dark-mode .builder-subject-divider {
  color: #60a5fa;
}

.chapter-checklist-box {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 8px;
  background: var(--bg-surface-subtle);
}

.chapter-check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
  background: var(--bg-surface);
  border: 1px solid transparent;
}

.chapter-check-item:hover {
  border-color: var(--border-subtle);
}

.chapter-check-item.checked {
  background: #eff6ff;
  border-color: #bfdbfe;
}

body.dark-mode .chapter-check-item.checked {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(96, 165, 250, 0.3);
}

.chapter-checkbox {
  width: 17px;
  height: 17px;
  accent-color: #2563eb;
  cursor: pointer;
  flex-shrink: 0;
}

.chapter-check-name {
  flex: 1;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-left: 8px;
}

.chapter-check-class {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-surface-subtle);
  padding: 2px 7px;
  border-radius: 4px;
}

/* Builder Summary Sidebar */
.builder-summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: sticky;
  top: 80px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

body.dark-mode .builder-summary-card {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.summary-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.86rem;
}

.summary-metric-row:last-of-type {
  border-bottom: none;
  margin-bottom: 10px;
}

.summary-metric-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.summary-metric-val {
  color: var(--text-primary);
  font-weight: 800;
  text-align: right;
}

/* ================================================================
   VIEW 2: DEDICATED SUBJECT PAGE STYLING
   ================================================================ */
.subject-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.subject-class-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.class-filter-btn {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.class-filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.class-filter-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.subject-search-box-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}

.subject-search-box-wrap input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.86rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.subject-search-box-wrap input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.subject-search-box-wrap .search-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

/* Chapter Cards Grid & Item */
.chapter-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chapter-list-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.chapter-list-item:hover {
  transform: translateY(-1px);
  border-color: var(--border-medium);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

body.dark-mode .chapter-list-item:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.chapter-list-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.chapter-list-num {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.86rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

body.dark-mode .chapter-list-num {
  background: rgba(37, 99, 235, 0.2);
  color: #93c5fd;
}

.chapter-list-details {
  min-width: 0;
}

.chapter-list-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 0 0 3px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chapter-list-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.chapter-list-action {
  flex-shrink: 0;
}

.btn-chapter-solve {
  background: #0d9488;
  color: #ffffff;
  border: none;
  padding: 8px 22px;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.25);
}

.btn-chapter-solve:hover {
  background: #0f766e;
  transform: scale(1.03);
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.35);
}

@media (max-width: 640px) {
  .custom-practice-hero-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 20px;
  }
  .cp-action-btn {
    width: 100%;
    justify-content: center;
    margin-top: 14px;
  }
  .chapter-list-item {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
  }
  .chapter-list-main {
    width: 100%;
    align-items: flex-start;
    gap: 12px;
  }
  .chapter-list-num {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
    margin-top: 2px;
    flex-shrink: 0;
  }
  .chapter-list-details {
    flex: 1;
    min-width: 0;
  }
  .chapter-list-name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 0.98rem;
    line-height: 1.4;
    word-break: break-word;
    margin-bottom: 4px;
  }
  .chapter-list-sub {
    font-size: 0.76rem;
    line-height: 1.4;
    white-space: normal;
  }
  .chapter-list-action {
    width: 100%;
  }
  .btn-chapter-solve {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    font-size: 0.88rem;
    border-radius: 10px;
  }
}

/* ================================================================
   VIEW 1.8: DEDICATED SUBJECTS INDEX PAGE & BEAUTIFUL CARDS
   ================================================================ */
.subjects-summary-ribbon {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 10px 22px;
  margin-top: 14px;
  margin-bottom: 24px;
  width: fit-content;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.subj-ribbon-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
}

.ribbon-metric-bold {
  font-weight: 800;
  color: var(--text-primary);
}

.ribbon-metric-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.subj-ribbon-sep {
  color: var(--border-strong);
  font-size: 0.8rem;
}

.subjects-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.subject-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: 22px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.subject-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.08);
}

body.dark-mode .subject-card {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

body.dark-mode .subject-card:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

/* Card Themes */
.card-biology {
  border-color: #a7f3d0;
}
.card-biology:hover {
  border-color: #059669;
}
body.dark-mode .card-biology {
  border-color: rgba(5, 150, 105, 0.3);
}

.card-physics {
  border-color: #bfdbfe;
}
.card-physics:hover {
  border-color: #2563eb;
}
body.dark-mode .card-physics {
  border-color: rgba(37, 99, 235, 0.3);
}

.card-chemistry {
  border-color: #fde68a;
}
.card-chemistry:hover {
  border-color: #d97706;
}
body.dark-mode .card-chemistry {
  border-color: rgba(217, 119, 6, 0.3);
}

.subj-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.subj-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-bio {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
body.dark-mode .icon-bio {
  background: rgba(4, 120, 87, 0.2);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
}

.icon-phy {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
body.dark-mode .icon-phy {
  background: rgba(29, 78, 216, 0.2);
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
}

.icon-chem {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
body.dark-mode .icon-chem {
  background: rgba(180, 83, 9, 0.2);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

.subj-badge-track {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.badge-bio { color: #047857; }
body.dark-mode .badge-bio { color: #34d399; }

.badge-phy { color: #1d4ed8; }
body.dark-mode .badge-phy { color: #60a5fa; }

.badge-chem { color: #b45309; }
body.dark-mode .badge-chem { color: #fbbf24; }

.subj-card-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.02em;
}

.subj-card-desc {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.subj-card-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--bg-surface-subtle);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 16px;
  text-align: center;
}

.subj-metric-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.subj-metric-box .metric-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.subj-metric-box .metric-lbl {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.subj-units-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.subj-tag-pill {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  padding: 3px 9px;
  border-radius: var(--radius-full);
}

.subj-card-footer {
  margin-top: auto;
}

.btn-subj-explore {
  width: 100%;
  padding: 11px 18px;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 700;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: #ffffff;
}

.btn-bio {
  background: #059669;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}
.subject-card:hover .btn-bio {
  background: #047857;
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
}

.btn-phy {
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.subject-card:hover .btn-phy {
  background: #1d4ed8;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-chem {
  background: #d97706;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}
.subject-card:hover .btn-chem {
  background: #b45309;
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.35);
}

/* ================================================================
   SLIDE-IN NAVIGATION DRAWER (SCREENSHOT 2 & 4 REPLICATION)
   ================================================================ */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 19, 41, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.app-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 85vw;
  height: 100%;
  background: var(--bg-surface);
  z-index: 1250;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.25);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-drawer.active {
  transform: translateX(0);
}

/* Drawer Header Profile Card (TALL COSMIC BLUE BACKGROUND) */
.drawer-profile-card {
  background: linear-gradient(180deg, #091126 0%, #0e1c4a 55%, #162a6e 100%);
  padding: 38px 22px 26px;
  min-height: 160px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.drawer-profile-card::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.drawer-avatar-wrap {
  position: relative;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
}

.drawer-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  border: 2.5px solid #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25), 0 0 16px rgba(34, 197, 94, 0.4);
}

.drawer-avatar-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  background: #22c55e;
  border: 2px solid #091126;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-user-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.drawer-user-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-user-email {
  font-size: 0.78rem;
  color: #93c5fd;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  width: fit-content;
  transition: all 0.2s ease;
}

.drawer-profile-link:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateX(2px);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  padding-left: 8px;
  margin-bottom: 2px;
}

.drawer-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.90rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.drawer-nav-item:hover {
  background: var(--bg-surface-subtle);
  transform: translateX(3px);
}

.drawer-nav-item.active {
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 700;
}

.drawer-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drawer-icon-box.blue { background: #eff6ff; color: #2563eb; }
.drawer-icon-box.purple { background: #f5f3ff; color: #7c3aed; }
.drawer-icon-box.teal { background: #f0fdfa; color: #0d9488; }
.drawer-icon-box.amber { background: #fffbeb; color: #d97706; }
.drawer-icon-box.cyan { background: #ecfeff; color: #0891b2; }
.drawer-icon-box.orange { background: #fff7ed; color: #ea580c; }
.drawer-icon-box.green { background: #f0fdf4; color: #16a34a; }

body.dark-mode .drawer-icon-box.blue { background: rgba(37, 99, 235, 0.2); color: #93c5fd; }
body.dark-mode .drawer-icon-box.purple { background: rgba(124, 58, 237, 0.2); color: #c4b5fd; }
body.dark-mode .drawer-icon-box.teal { background: rgba(13, 148, 136, 0.2); color: #5eead4; }
body.dark-mode .drawer-icon-box.amber { background: rgba(217, 119, 6, 0.2); color: #fde68a; }
body.dark-mode .drawer-icon-box.cyan { background: rgba(8, 145, 178, 0.2); color: #67e8f9; }
body.dark-mode .drawer-icon-box.orange { background: rgba(234, 88, 12, 0.2); color: #fdba74; }
body.dark-mode .drawer-icon-box.green { background: rgba(22, 163, 74, 0.2); color: #86efac; }

.drawer-footer-btn-wrap {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.drawer-signout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid #fee2e2;
  background: #fef2f2;
  color: #dc2626;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

body.dark-mode .drawer-signout-btn {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.3);
  color: #fca5a5;
}

.drawer-signout-btn:hover {
  background: #dc2626;
  color: #ffffff;
}

/* ================================================================
   VIEW 6: DEDICATED PROFILE VIEW (MATCHING USER SCREENSHOT)
   ================================================================ */
/* Break out of .app-container padding so the cosmic blue banner touches screen edges with 0 white gaps */
body.in-profile-view .app-container,
.app-container:has(#profile-view:not(.hidden)) {
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

#profile-view {
  width: 100%;
  margin: 0;
  padding: 0;
}

/* TALL BLUE BACKGROUND WHERE USER PROFILE APPEARS (FULL BLEED, ZERO WHITE BORDER/PADDING) */
.profile-hero-banner {
  background: linear-gradient(180deg, #070d1e 0%, #0e1c4d 40%, #152b75 80%, #1b3794 100%);
  min-height: 380px;
  padding: 56px 20px 84px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  margin: 0;
  border-radius: 0;
  border: none;
}

.profile-ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  pointer-events: none;
  opacity: 0.45;
}

.profile-ambient-glow.glow-1 {
  top: 10%;
  left: 15%;
  width: 180px;
  height: 180px;
  background: rgba(79, 70, 229, 0.4);
}

.profile-ambient-glow.glow-2 {
  bottom: 15%;
  right: 15%;
  width: 200px;
  height: 200px;
  background: rgba(37, 99, 235, 0.4);
}

.profile-ambient-glow.glow-3 {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 260px;
  height: 260px;
  background: rgba(124, 58, 237, 0.25);
}

.profile-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Center Avatar with Glowing Lime-Green Outer Ring and Verified Badge */
.profile-avatar-outer-ring {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 3px solid #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.22), 0 0 32px rgba(34, 197, 94, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0 auto 18px;
  transition: transform 0.3s ease;
}

.profile-avatar-outer-ring:hover {
  transform: scale(1.04);
}

.profile-avatar-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #ffffff;
  font-size: 2.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', 'Poppins', sans-serif;
  letter-spacing: -0.02em;
}

.profile-verified-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #22c55e;
  border: 3px solid #0e1c4d;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.profile-user-name {
  color: #ffffff;
  font-size: 1.65rem;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  font-family: 'Outfit', sans-serif;
}

.profile-user-sub {
  color: #bfdbfe;
  font-size: 0.94rem;
  font-weight: 500;
  margin: 0 0 20px;
}

.profile-edit-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 9px 24px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.profile-edit-pill-btn:hover {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

/* Profile Body Content (Screenshot 1 Replica) */
.profile-body-container {
  max-width: 580px;
  margin: -36px auto 0;
  padding: 0 16px 120px;
  position: relative;
  z-index: 5;
}

.profile-section-heading {
  font-size: 0.80rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-left: 4px;
}

body.dark-mode .profile-section-heading {
  color: #94a3b8;
}

.profile-card-group {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  padding: 8px 18px;
}

.profile-row-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 4px;
}

.profile-row-divider {
  border-bottom: 1px solid var(--border-subtle);
  margin: 0 4px;
}

.profile-icon-tile {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-icon-tile.icon-tile-blue { background: #eff6ff; color: #2563eb; }
.profile-icon-tile.icon-tile-orange { background: #fff7ed; color: #ea580c; }
.profile-icon-tile.icon-tile-green { background: #f0fdf4; color: #16a34a; }
.profile-icon-tile.icon-tile-indigo { background: #f5f3ff; color: #6366f1; }

body.dark-mode .profile-icon-tile.icon-tile-blue { background: rgba(37, 99, 235, 0.2); color: #93c5fd; }
body.dark-mode .profile-icon-tile.icon-tile-orange { background: rgba(234, 88, 12, 0.2); color: #fdba74; }
body.dark-mode .profile-icon-tile.icon-tile-green { background: rgba(22, 163, 74, 0.2); color: #86efac; }
body.dark-mode .profile-icon-tile.icon-tile-indigo { background: rgba(99, 102, 241, 0.2); color: #c7d2fe; }

.profile-row-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.profile-row-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.profile-row-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.profile-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.prof-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.prof-stat-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.prof-stat-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prof-stat-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  margin-bottom: 4px;
}

.prof-stat-sub {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--primary);
}

/* ================================================================
   VIEW 7: MY ATTEMPTS & CHAPTER PROGRESS VIEW
   ================================================================ */
#attempts-view {
  width: 100%;
}

.attempts-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 120px;
}

.attempts-header-banner {
  margin-bottom: 24px;
}

.attempts-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  font-family: 'Outfit', sans-serif;
}

.attempts-subtitle {
  font-size: 0.90rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

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

.attempt-metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attempt-metric-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary);
  font-family: 'Outfit', sans-serif;
}

.attempt-metric-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.attempts-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.attempts-filter-btn {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.attempts-filter-btn:hover {
  background: var(--bg-surface-subtle);
  color: var(--text-primary);
}

.attempts-filter-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.attempts-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.attempt-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: 18px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.attempt-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.attempt-card-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.attempt-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.attempt-subj-tag {
  font-size: 0.70rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.tag-bio { background: #f0fdf4; color: #16a34a; }
.tag-phy { background: #eff6ff; color: #2563eb; }
.tag-chem { background: #fffbeb; color: #d97706; }

body.dark-mode .tag-bio { background: rgba(22, 163, 74, 0.2); color: #86efac; }
body.dark-mode .tag-phy { background: rgba(37, 99, 235, 0.2); color: #93c5fd; }
body.dark-mode .tag-chem { background: rgba(217, 119, 6, 0.2); color: #fde68a; }

.attempt-date {
  font-size: 0.74rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.attempt-ch-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.attempt-progress-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.attempt-progress-bar-wrap {
  width: 100%;
  max-width: 280px;
  height: 6px;
  background: var(--bg-surface-subtle);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 2px;
}

.attempt-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.attempt-progress-fill.fill-bio { background: #16a34a; }
.attempt-progress-fill.fill-phy { background: #2563eb; }
.attempt-progress-fill.fill-chem { background: #d97706; }

.attempt-card-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.attempt-score-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-surface-subtle);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.btn-resume-test {
  background: #0f172a;
  color: #ffffff;
  padding: 9px 20px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
  white-space: nowrap;
}

body.dark-mode .btn-resume-test {
  background: #2563eb;
  color: #ffffff;
}

.btn-resume-test:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.35);
}

@media (max-width: 640px) {
  .attempt-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }
  .attempt-card-action {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
  }
  .attempt-progress-bar-wrap {
    max-width: 100%;
  }
}

/* Scientific Math Formula & Equation Styling */
.math-fraction {
  display: inline-flex;
  flex-direction: column;
  vertical-align: -0.65em;
  text-align: center;
  padding: 0 0.25em;
  font-size: 0.95em;
  line-height: 1.15;
  font-family: 'Cambria Math', 'KaTeX_Main', 'Times New Roman', serif;
}
.math-num {
  border-bottom: 1.5px solid currentColor;
  padding-bottom: 2px;
  display: block;
}
.math-den {
  padding-top: 2px;
  display: block;
}
.math-inline {
  display: inline-block;
  vertical-align: baseline;
  padding: 0 2px;
}
.math-block {
  display: block;
  text-align: center;
  margin: 12px 0;
  overflow-x: auto;
}
.katex {
  font-size: 1.08em !important;
  font-family: KaTeX_Main, 'Times New Roman', serif;
}
.option-text .math-fraction {
  vertical-align: -0.6em;
}
sup {
  font-size: 0.74em;
  vertical-align: super;
  line-height: 0;
}
sub {
  font-size: 0.74em;
  vertical-align: sub;
  line-height: 0;
}

/* ================================================================
   PWA INSTALL APP PROMPT - MODERN FLOATING TOAST / CARD
   ================================================================ */
.pwa-prompt-container {
  position: fixed;
  bottom: 84px; /* Sits nicely above the bottom navigation bar on mobile */
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 480px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-prompt-container.show {
  pointer-events: auto;
  opacity: 1;
  animation: pwaSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pwaSlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 30px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.pwa-prompt-card {
  position: relative;
  background: rgba(11, 19, 41, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1.5px solid rgba(59, 130, 246, 0.4);
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  border-radius: 20px;
  padding: 16px 18px;
  color: #ffffff;
}

body:not(.dark-mode) .pwa-prompt-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1.5px solid rgba(37, 99, 235, 0.25);
  box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  color: #0f172a;
}

.pwa-prompt-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pwa-prompt-close-btn:hover {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-primary);
}

.pwa-prompt-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.pwa-prompt-icon-wrap {
  position: relative;
  flex-shrink: 0;
}

.pwa-prompt-app-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  display: block;
}

.pwa-icon-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: #10b981;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.2;
}

.pwa-prompt-details {
  flex: 1;
  min-width: 0;
}

.pwa-prompt-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.pwa-prompt-title {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.01em;
}

body:not(.dark-mode) .pwa-prompt-title {
  color: #0f172a;
}

.pwa-pill-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.12);
  padding: 2px 7px;
  border-radius: 9999px;
  white-space: nowrap;
}

.pwa-prompt-desc {
  font-size: 0.78rem;
  line-height: 1.35;
  color: #94a3b8;
  margin: 0 0 8px 0;
}

body:not(.dark-mode) .pwa-prompt-desc {
  color: #475569;
}

.pwa-prompt-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 12px;
}

.pwa-feat-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #10b981;
}

.pwa-prompt-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.pwa-btn-dismiss {
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pwa-btn-dismiss:hover {
  background: var(--bg-surface-subtle);
  color: var(--text-primary);
}

.pwa-btn-install {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: none;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all var(--transition-fast);
}

.pwa-btn-install:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}
