/* ==========================================================================
   Apple Design System for DGCA Pilot Exam Practice Platform
   Inspired by apple.com aesthetics, SF Pro typography, and Human Interface Guidelines
   ========================================================================== */

:root {
  /* Brand Primary Scale */
  --color-primary: #0071e3;
  --color-primary-dark: #005bb5;
  --color-primary-light: #e8f2fe;
  --color-primary-hover: #0077ed;
  --color-primary-active: #005bb5;
  --color-primary-subtle: rgba(0, 113, 227, 0.08);

  /* Semantic Feedback Scale */
  --color-success: #10b981;
  --color-success-dark: #059669;
  --color-success-light: #ecfdf5;
  --color-success-bg: rgba(16, 185, 129, 0.12);
  --color-success-border: rgba(16, 185, 129, 0.32);

  --color-danger: #ef4444;
  --color-danger-dark: #dc2626;
  --color-danger-light: #fef2f2;
  --color-danger-bg: rgba(239, 68, 68, 0.12);
  --color-danger-border: rgba(239, 68, 68, 0.32);

  --color-warning: #f59e0b;
  --color-warning-dark: #d97706;
  --color-warning-light: #fffbeb;
  --color-warning-bg: rgba(245, 158, 11, 0.12);
  --color-warning-border: rgba(245, 158, 11, 0.32);

  /* Neutral Scale (High-contrast, clean modern scale) */
  --color-neutral-50: #fafafa;
  --color-neutral-100: #f4f4f5;
  --color-neutral-200: #e4e4e7;
  --color-neutral-300: #d4d4d8;
  --color-neutral-400: #a1a1aa;
  --color-neutral-500: #71717a;
  --color-neutral-600: #52525b;
  --color-neutral-700: #3f3f46;
  --color-neutral-800: #27272a;
  --color-neutral-900: #18181b;
  --color-neutral-950: #09090b;

  /* Surface & Base Mappings (Light Mode) */
  --color-bg: #f5f5f7;
  --color-surface: #ffffff;
  --color-surface-subtle: #fafafa;
  --color-surface-hover: #f4f4f5;
  --color-surface-elevated: #ffffff;

  --color-text-primary: #18181b;
  --color-text-secondary: #52525b;
  --color-text-tertiary: #a1a1aa;
  --color-border: #e4e4e7;
  --color-border-subtle: #f4f4f5;
  --color-divider: #e4e4e7;

  /* Accent aliases for compatibility */
  --color-accent: var(--color-primary);
  --color-accent-hover: var(--color-primary-hover);
  --color-accent-active: var(--color-primary-active);
  --color-accent-subtle: var(--color-primary-subtle);
  --color-accent-text: #ffffff;

  /* Subject Accent Palette (Light Mode) */
  --subject-meteorology: #0284c7;        /* Sky Blue */
  --subject-meteorology-dark: #0369a1;
  --subject-meteorology-gradient: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  --subject-meteorology-bg: rgba(2, 132, 199, 0.08);

  --subject-regulations: #4f46e5;        /* Indigo */
  --subject-regulations-dark: #3730a3;
  --subject-regulations-gradient: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
  --subject-regulations-bg: rgba(79, 70, 229, 0.08);

  --subject-navigation: #0d9488;         /* Teal */
  --subject-navigation-dark: #0f766e;
  --subject-navigation-gradient: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
  --subject-navigation-bg: rgba(13, 148, 136, 0.08);

  --subject-technical: #ea580c;          /* Orange */
  --subject-technical-dark: #c2410c;
  --subject-technical-gradient: linear-gradient(135deg, #c2410c 0%, #f97316 100%);
  --subject-technical-bg: rgba(234, 88, 12, 0.08);

  --subject-rtr: #9333ea;                /* Violet / Purple */
  --subject-rtr-dark: #7e22ce;
  --subject-rtr-gradient: linear-gradient(135deg, #7e22ce 0%, #a855f7 100%);
  --subject-rtr-bg: rgba(147, 51, 234, 0.08);

  /* Typography */
  --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-heading: 'Plus Jakarta Sans', var(--font-family-sans);
  --font-family-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* Standardized Radii (14-16px cards/buttons, 10px chips/badges) */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-chip: 10px;
  --radius-badge: 10px;
  --radius-md: 14px;
  --radius-button: 16px;
  --radius-card: 16px;
  --radius-pill: 980px;
  --radius-full: 980px;

  /* Two-Layer Shadow System (Subtle Resting + Stronger Hover Shadow) */
  --shadow-resting: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 12px 24px -4px rgba(0, 0, 0, 0.09), 0 4px 8px -2px rgba(0, 0, 0, 0.04);
  --shadow-sm: var(--shadow-resting);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.06);
  --shadow-lg: var(--shadow-hover);
  --shadow-dropdown: 0 12px 36px rgba(0, 0, 0, 0.12);

  --header-height: 46px;
  --ribbon-height: 34px;
}

[data-theme="dark"] {
  /* Brand Primary Dark Scale */
  --color-primary: #2997ff;
  --color-primary-dark: #0077ed;
  --color-primary-light: rgba(41, 151, 255, 0.18);
  --color-primary-hover: #47a3ff;
  --color-primary-active: #0077ed;
  --color-primary-subtle: rgba(41, 151, 255, 0.16);

  /* Semantic Feedback Dark */
  --color-success: #34d399;
  --color-success-dark: #10b981;
  --color-success-light: rgba(52, 211, 153, 0.15);
  --color-success-bg: rgba(52, 211, 153, 0.15);
  --color-success-border: rgba(52, 211, 153, 0.35);

  --color-danger: #f87171;
  --color-danger-dark: #ef4444;
  --color-danger-light: rgba(248, 113, 113, 0.15);
  --color-danger-bg: rgba(248, 113, 113, 0.15);
  --color-danger-border: rgba(248, 113, 113, 0.35);

  --color-warning: #fbbf24;
  --color-warning-dark: #f59e0b;
  --color-warning-light: rgba(251, 191, 36, 0.15);
  --color-warning-bg: rgba(251, 191, 36, 0.15);
  --color-warning-border: rgba(251, 191, 36, 0.35);

  /* Dark Neutral Scale */
  --color-neutral-50: #09090b;
  --color-neutral-100: #18181b;
  --color-neutral-200: #27272a;
  --color-neutral-300: #3f3f46;
  --color-neutral-400: #52525b;
  --color-neutral-500: #71717a;
  --color-neutral-600: #a1a1aa;
  --color-neutral-700: #d4d4d8;
  --color-neutral-800: #e4e4e7;
  --color-neutral-900: #f4f4f5;
  --color-neutral-950: #fafafa;

  /* Surface & Base Mappings (Dark Mode) */
  --color-bg: #09090b;
  --color-surface: #18181b;
  --color-surface-subtle: #27272a;
  --color-surface-hover: #313136;
  --color-surface-elevated: #27272a;

  --color-text-primary: #fafafa;
  --color-text-secondary: #a1a1aa;
  --color-text-tertiary: #71717a;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-border-subtle: rgba(255, 255, 255, 0.06);
  --color-divider: rgba(255, 255, 255, 0.12);

  /* Subject Accent Dark Mode Gradients */
  --subject-meteorology: #38bdf8;
  --subject-meteorology-dark: #0284c7;
  --subject-meteorology-gradient: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
  --subject-meteorology-bg: rgba(56, 189, 248, 0.14);

  --subject-regulations: #818cf8;
  --subject-regulations-dark: #4f46e5;
  --subject-regulations-gradient: linear-gradient(135deg, #3730a3 0%, #4f46e5 100%);
  --subject-regulations-bg: rgba(129, 140, 248, 0.14);

  --subject-navigation: #2dd4bf;
  --subject-navigation-dark: #0d9488;
  --subject-navigation-gradient: linear-gradient(135deg, #115e59 0%, #0d9488 100%);
  --subject-navigation-bg: rgba(45, 212, 191, 0.14);

  --subject-technical: #fb923c;
  --subject-technical-dark: #ea580c;
  --subject-technical-gradient: linear-gradient(135deg, #9a3412 0%, #ea580c 100%);
  --subject-technical-bg: rgba(251, 146, 60, 0.14);

  --subject-rtr: #c084fc;
  --subject-rtr-dark: #9333ea;
  --subject-rtr-gradient: linear-gradient(135deg, #6b21a8 0%, #9333ea 100%);
  --subject-rtr-bg: rgba(192, 132, 252, 0.14);

  /* Two-Layer Shadow System (Dark Mode) */
  --shadow-resting: 0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 12px 28px -4px rgba(0, 0, 0, 0.75), 0 4px 10px rgba(0, 0, 0, 0.5);
  --shadow-sm: var(--shadow-resting);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: var(--shadow-hover);
  --shadow-dropdown: 0 12px 36px rgba(0, 0, 0, 0.85);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  font-family: var(--font-family-sans);
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.47059;
  font-size: 16px;
  letter-spacing: -0.015em;
  transition: background-color 0.25s ease, color 0.25s ease;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  width: 100%;
  position: relative;
}

h1, h2, h3, h4, h5, h6,
.stage__title,
.subject-hero__title,
.exam-list-header__title,
.q-text,
#result-status-title {
  font-family: var(--font-family-heading);
  font-weight: 700;
  letter-spacing: -0.028em;
  color: var(--color-text-primary);
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Container */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 max(1.25rem, env(safe-area-inset-right)) 0 max(1.25rem, env(safe-area-inset-left));
  box-sizing: border-box;
}

/* Responsive text visibility utilities */
.btn-text-short {
  display: none;
}
.btn-text-full {
  display: inline;
}
.crumb-text-short {
  display: none;
}
.crumb-text-full {
  display: inline;
}
.ticker__detail {
  display: inline;
}

/* ==========================================================================
   Apple Ribbon Announcement Bar
   ========================================================================== */

.ticker, .apple-ribbon {
  background-color: var(--color-surface-subtle);
  border-bottom: 1px solid var(--color-border);
  min-height: var(--ribbon-height);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--color-text-secondary);
  overflow: hidden;
  user-select: none;
  z-index: 60;
  width: 100%;
}

.ticker__inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left));
  max-width: 1080px;
  width: 100%;
  justify-content: center;
  overflow: hidden;
  min-width: 0;
}

.ticker__label-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ticker__dot {
  width: 6px;
  height: 6px;
  background-color: var(--color-accent);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--color-accent);
  flex-shrink: 0;
}

.u-font-superscript {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-secondary) !important;
}

.ticker__track {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  overflow: hidden;
  min-width: 0;
}

.ticker__text {
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  min-width: 0;
}

.ticker__text strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

/* ==========================================================================
   Apple Frosted Glass Header & Navigation
   ========================================================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

[data-theme="dark"] .header {
  background: rgba(22, 22, 23, 0.82);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header__logo-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--color-text-primary);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.header__logo-link:hover {
  opacity: 0.9;
  transform: translateY(-0.5px);
}

.header__logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0, 113, 227, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  display: block;
}

.header__brand-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.header__logo-text {
  font-family: var(--font-family-sans);
  font-weight: 800;
  font-size: 15.5px;
  letter-spacing: -0.025em;
  color: var(--color-text-primary);
}

.header__logo-tagline {
  font-family: var(--font-family-sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--color-text-secondary);
  text-transform: uppercase;
}

[data-theme="dark"] .header__logo-tagline {
  color: var(--color-neutral-400);
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.header__nav-link {
  font-family: var(--font-family-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.header__nav-link:hover {
  color: var(--color-text-primary);
}

.header__nav-link.active {
  color: var(--color-text-primary);
  background: var(--color-surface-hover);
  font-weight: 500;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ==========================================================================
   Apple Premium Buttons (Pill, Specular Sheen & Tactile Depth)
   ========================================================================== */

.button {
  font-family: var(--font-family-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.015em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  border: 1px solid transparent;
  white-space: nowrap;
  user-select: none;
  outline: none;
}

/* Apple Primary Solid Pill Button (Luminous Blue Gradient) */
.button--accent, .button--solid, .button--primary {
  background: linear-gradient(180deg, #0077ed 0%, #0071e3 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 
    0 2px 6px rgba(0, 113, 227, 0.35), 
    0 6px 18px -2px rgba(0, 113, 227, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.button--accent::after, .button--solid::after, .button--primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-20deg);
  transition: none;
  pointer-events: none;
}

.button--accent:hover::after, .button--solid:hover::after, .button--primary:hover::after {
  left: 140%;
  transition: left 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.button--accent:hover, .button--solid:hover, .button--primary:hover {
  background: linear-gradient(180deg, #1b86ff 0%, #0077ed 100%);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 4px 12px rgba(0, 113, 227, 0.4), 
    0 10px 28px -4px rgba(0, 113, 227, 0.45), 
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.button--accent:active, .button--solid:active, .button--primary:active {
  background: linear-gradient(180deg, #0066cc 0%, #005bb5 100%);
  transform: translateY(0.5px) scale(0.975);
  box-shadow: 0 2px 4px rgba(0, 113, 227, 0.25), inset 0 2px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .button--accent, 
[data-theme="dark"] .button--solid,
[data-theme="dark"] .button--primary {
  background: linear-gradient(180deg, #389dff 0%, #0071e3 100%);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 
    0 2px 8px rgba(41, 151, 255, 0.45), 
    0 8px 24px -2px rgba(41, 151, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .button--accent:hover, 
[data-theme="dark"] .button--solid:hover,
[data-theme="dark"] .button--primary:hover {
  background: linear-gradient(180deg, #5bb2ff 0%, #1a88ff 100%);
  box-shadow: 
    0 4px 14px rgba(41, 151, 255, 0.55), 
    0 12px 32px -4px rgba(41, 151, 255, 0.5), 
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

/* Apple Secondary Frosted Glass Pill Button */
.button--outline, .button--outline-primary {
  background: rgba(0, 113, 227, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--color-primary);
  border: 1px solid rgba(0, 113, 227, 0.28);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.button--outline:hover, .button--outline-primary:hover {
  background: rgba(0, 113, 227, 0.12);
  border-color: rgba(0, 113, 227, 0.45);
  transform: translateY(-1.5px) scale(1.015);
  box-shadow: 0 6px 18px rgba(0, 113, 227, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  color: var(--color-primary-hover);
}

.button--outline:active, .button--outline-primary:active {
  transform: translateY(0.5px) scale(0.98);
  background: rgba(0, 113, 227, 0.18);
}

[data-theme="dark"] .button--outline,
[data-theme="dark"] .button--outline-primary {
  background: rgba(41, 151, 255, 0.1);
  color: var(--color-primary);
  border-color: rgba(41, 151, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .button--outline:hover,
[data-theme="dark"] .button--outline-primary:hover {
  background: rgba(41, 151, 255, 0.2);
  border-color: rgba(41, 151, 255, 0.5);
  box-shadow: 0 6px 20px rgba(41, 151, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.button--sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: var(--radius-pill);
}

.button__icon {
  width: 13px;
  height: 13px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.button:hover .button__icon {
  transform: translateX(3px);
}

/* Icon Button (Round Apple Control with Glass Elevation) */
.btn-icon-technical {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.btn-icon-technical:hover {
  color: var(--color-text-primary);
  background: var(--color-surface-hover);
  border-color: var(--color-accent);
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.15);
}

/* ==========================================================================
   Apple Hero Presentation Section (Atmospheric Mesh & Gradient Typography)
   ========================================================================== */

.stage {
  padding: 5rem 0 3.5rem;
  position: relative;
  text-align: center;
  overflow: hidden;
  border-radius: 28px;
}

/* Atmospheric Ambient Aurora Glow */
.stage::before {
  content: "";
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: min(600px, 90vw);
  height: 320px;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.12) 0%, rgba(94, 92, 230, 0.08) 40%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  animation: heroAurora 10s ease-in-out infinite alternate;
}

[data-theme="dark"] .stage::before {
  background: radial-gradient(circle, rgba(41, 151, 255, 0.18) 0%, rgba(175, 82, 222, 0.12) 40%, transparent 70%);
  filter: blur(80px);
}

@keyframes heroAurora {
  0% { transform: translateX(-50%) scale(0.95); opacity: 0.8; }
  100% { transform: translateX(-48%) scale(1.1); opacity: 1; }
}

.stage__top {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.stage__micro-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--color-text-secondary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .stage__micro-tag {
  background: rgba(30, 30, 34, 0.7);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.stage__title {
  font-family: var(--font-family-sans);
  font-size: clamp(2.75rem, 5.5vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.038em;
  line-height: 1.05;
  color: var(--color-text-primary);
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}

/* Apple Iridescent Gradient Accent Word */
.stage__title span.accent-word {
  background: linear-gradient(135deg, #0071e3 0%, #2997ff 45%, #af52de 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

[data-theme="dark"] .stage__title span.accent-word {
  background: linear-gradient(135deg, #2997ff 0%, #64d2ff 45%, #d18dff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stage__description {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  line-height: 1.48;
  color: var(--color-text-secondary);
  max-width: 680px;
  margin: 0 auto 2.5rem;
  font-weight: 400;
  letter-spacing: -0.015em;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Step 1: Apple Subject Showcase Container (Gradients, Movement & Spotlight Hover)
   ========================================================================== */

.subject-showcase-container {
  position: relative;
  border-radius: 36px;
  padding: 2rem 1.5rem 2.5rem;
  margin: 1rem 0 5rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(245, 245, 247, 0.25) 100%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 
    0 24px 64px -20px rgba(0, 0, 0, 0.05), 
    inset 0 1px 2px rgba(255, 255, 255, 0.95);
  overflow: hidden;
  isolation: isolate;
  max-width: 100%;
  box-sizing: border-box;
}

[data-theme="dark"] .subject-showcase-container {
  background: linear-gradient(180deg, rgba(26, 26, 30, 0.65) 0%, rgba(14, 14, 16, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 32px 84px -24px rgba(0, 0, 0, 0.75), 
    inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

/* Atmospheric Multi-Hue Animated Halo Behind Subject Cards */
.subject-ambient-halo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle 520px at 15% 25%, rgba(0, 113, 227, 0.14), transparent 70%),
    radial-gradient(circle 480px at 85% 75%, rgba(175, 82, 222, 0.12), transparent 70%),
    radial-gradient(circle 440px at 50% 45%, rgba(50, 173, 230, 0.09), transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  animation: ambientHaloMotion 18s ease-in-out infinite alternate;
}

[data-theme="dark"] .subject-ambient-halo {
  background: 
    radial-gradient(circle 550px at 15% 25%, rgba(41, 151, 255, 0.22), transparent 70%),
    radial-gradient(circle 500px at 85% 75%, rgba(191, 90, 242, 0.18), transparent 70%),
    radial-gradient(circle 460px at 50% 45%, rgba(100, 210, 255, 0.14), transparent 70%);
  filter: blur(75px);
}

@keyframes ambientHaloMotion {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(25px, -18px) scale(1.04); }
  66% { transform: translate(-18px, 20px) scale(0.97); }
  100% { transform: translate(12px, -10px) scale(1.02); }
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.5rem;
  margin: 0;
  position: relative;
  z-index: 1;
}

.subject-card {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 248, 252, 0.85) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-card);
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: var(--color-text-primary);
  position: relative;
  box-shadow: 
    0 4px 16px -2px rgba(0, 0, 0, 0.04), 
    0 12px 32px -4px rgba(0, 0, 0, 0.05), 
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.95);
  cursor: pointer;
  transition: 
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
    box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
    border-color 0.3s ease;
  overflow: hidden;
  isolation: isolate;
  animation: appleCardReveal 0.65s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  animation-delay: calc(var(--card-index, 0) * 0.08s);
}

@keyframes appleCardReveal {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.965);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

[data-theme="dark"] .subject-card {
  background: linear-gradient(165deg, rgba(28, 28, 32, 0.88) 0%, rgba(16, 16, 18, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.45), 
    0 16px 40px -8px rgba(0, 0, 0, 0.65), 
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.16);
}

/* Ambient Gradient Aurora under each card */
.subject-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--subject-ambient-gradient, radial-gradient(circle at top right, rgba(0, 113, 227, 0.12), transparent 70%));
  opacity: 0.75;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: -2;
}

/* Mouse-Driven Dynamic Cursor Spotlight */
.subject-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    360px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    var(--subject-spotlight-color, rgba(0, 113, 227, 0.15)),
    transparent 80%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: -1;
}

.subject-card:hover {
  transform: translateY(-8px) scale(1.018);
  border-color: var(--subject-border-color, rgba(0, 113, 227, 0.4));
  box-shadow: 
    0 24px 54px -12px var(--subject-glow-color, rgba(0, 113, 227, 0.25)), 
    0 2px 6px rgba(0, 0, 0, 0.04), 
    inset 0 1px 2px rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .subject-card:hover {
  border-color: var(--subject-border-color, rgba(56, 157, 255, 0.5));
  box-shadow: 
    0 24px 60px -12px var(--subject-glow-color, rgba(0, 113, 227, 0.45)), 
    0 2px 6px rgba(0, 0, 0, 0.3), 
    inset 0 1px 2px rgba(255, 255, 255, 0.25);
}

.subject-card:hover::before {
  opacity: 1;
}

.subject-card:hover::after {
  opacity: 1;
}

/* Subject Specific Color Themes (Light Mode) */
.subject-card[data-subject="Navigation"] {
  --subject-ambient-gradient: radial-gradient(circle at top right, rgba(0, 113, 227, 0.18), rgba(94, 92, 230, 0.08) 60%, transparent 80%);
  --subject-spotlight-color: rgba(0, 113, 227, 0.22);
  --subject-border-color: rgba(0, 113, 227, 0.45);
  --subject-glow-color: rgba(0, 113, 227, 0.28);
  --subject-accent: #0071e3;
}

.subject-card[data-subject="Meteorology"] {
  --subject-ambient-gradient: radial-gradient(circle at top right, rgba(50, 173, 230, 0.2), rgba(100, 210, 255, 0.1) 60%, transparent 80%);
  --subject-spotlight-color: rgba(50, 173, 230, 0.25);
  --subject-border-color: rgba(50, 173, 230, 0.45);
  --subject-glow-color: rgba(50, 173, 230, 0.28);
  --subject-accent: #32ade6;
}

.subject-card[data-subject="Air Regulations"] {
  --subject-ambient-gradient: radial-gradient(circle at top right, rgba(52, 199, 89, 0.18), rgba(48, 209, 88, 0.08) 60%, transparent 80%);
  --subject-spotlight-color: rgba(52, 199, 89, 0.22);
  --subject-border-color: rgba(52, 199, 89, 0.45);
  --subject-glow-color: rgba(52, 199, 89, 0.28);
  --subject-accent: #34c759;
}

.subject-card[data-subject="Technical General"] {
  --subject-ambient-gradient: radial-gradient(circle at top right, rgba(255, 149, 0, 0.18), rgba(255, 69, 58, 0.08) 60%, transparent 80%);
  --subject-spotlight-color: rgba(255, 149, 0, 0.22);
  --subject-border-color: rgba(255, 149, 0, 0.45);
  --subject-glow-color: rgba(255, 149, 0, 0.28);
  --subject-accent: #ff9500;
}

.subject-card[data-subject="RTR Part 1"] {
  --subject-ambient-gradient: radial-gradient(circle at top right, rgba(175, 82, 222, 0.18), rgba(218, 143, 255, 0.08) 60%, transparent 80%);
  --subject-spotlight-color: rgba(175, 82, 222, 0.22);
  --subject-border-color: rgba(175, 82, 222, 0.45);
  --subject-glow-color: rgba(175, 82, 222, 0.28);
  --subject-accent: #af52de;
}

/* Subject Specific Color Themes (Dark Mode - Apple Luminous Accents) */
[data-theme="dark"] .subject-card[data-subject="Navigation"] {
  --subject-ambient-gradient: radial-gradient(circle at top right, rgba(41, 151, 255, 0.24), rgba(94, 92, 230, 0.15) 60%, transparent 80%);
  --subject-spotlight-color: rgba(41, 151, 255, 0.3);
  --subject-border-color: rgba(41, 151, 255, 0.55);
  --subject-glow-color: rgba(41, 151, 255, 0.42);
  --subject-accent: #2997ff;
}

[data-theme="dark"] .subject-card[data-subject="Meteorology"] {
  --subject-ambient-gradient: radial-gradient(circle at top right, rgba(100, 210, 255, 0.24), rgba(50, 173, 230, 0.15) 60%, transparent 80%);
  --subject-spotlight-color: rgba(100, 210, 255, 0.3);
  --subject-border-color: rgba(100, 210, 255, 0.55);
  --subject-glow-color: rgba(100, 210, 255, 0.42);
  --subject-accent: #64d2ff;
}

[data-theme="dark"] .subject-card[data-subject="Air Regulations"] {
  --subject-ambient-gradient: radial-gradient(circle at top right, rgba(48, 209, 88, 0.24), rgba(52, 199, 89, 0.15) 60%, transparent 80%);
  --subject-spotlight-color: rgba(48, 209, 88, 0.3);
  --subject-border-color: rgba(48, 209, 88, 0.55);
  --subject-glow-color: rgba(48, 209, 88, 0.42);
  --subject-accent: #30d158;
}

[data-theme="dark"] .subject-card[data-subject="Technical General"] {
  --subject-ambient-gradient: radial-gradient(circle at top right, rgba(255, 159, 10, 0.24), rgba(255, 69, 58, 0.15) 60%, transparent 80%);
  --subject-spotlight-color: rgba(255, 159, 10, 0.3);
  --subject-border-color: rgba(255, 159, 10, 0.55);
  --subject-glow-color: rgba(255, 159, 10, 0.42);
  --subject-accent: #ff9f0a;
}

[data-theme="dark"] .subject-card[data-subject="RTR Part 1"] {
  --subject-ambient-gradient: radial-gradient(circle at top right, rgba(191, 90, 242, 0.24), rgba(218, 143, 255, 0.15) 60%, transparent 80%);
  --subject-spotlight-color: rgba(191, 90, 242, 0.3);
  --subject-border-color: rgba(191, 90, 242, 0.55);
  --subject-glow-color: rgba(191, 90, 242, 0.42);
  --subject-accent: #bf5af2;
}

.subject-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

/* Aviation Icon Badge */
.subject-card__icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04), inset 0 1px 1px rgba(255, 255, 255, 0.8);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  color: var(--subject-accent, var(--color-accent));
}

.subject-card:hover .subject-card__icon-badge {
  transform: scale(1.1) rotate(-3deg);
  box-shadow: 0 8px 20px var(--subject-glow-color, rgba(0, 113, 227, 0.25));
}

.subject-card__badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.subject-card__title {
  font-family: var(--font-family-sans);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.15;
  margin-bottom: 0.5rem;
  color: var(--color-text-primary);
  transition: color 0.2s ease;
}

.subject-card:hover .subject-card__title {
  color: var(--subject-accent, var(--color-accent));
}

.subject-card__meta {
  font-size: 14px;
  color: var(--color-text-secondary);
  letter-spacing: -0.015em;
  margin-bottom: 1.75rem;
  line-height: 1.45;
}

/* Apple Progress Capsule */
.subject-card__progress-bar {
  width: 100%;
  height: 5px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 1.75rem;
}

[data-theme="dark"] .subject-card__progress-bar {
  background: rgba(255, 255, 255, 0.08);
}

.subject-card__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--subject-accent, var(--color-accent)) 0%, #5ac8fa 100%);
  border-radius: var(--radius-pill);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.subject-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border-subtle);
  margin-top: auto;
}

.subject-card__cta {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--color-text-secondary);
}

/* Explore Pill Button */
.subject-card__action-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: 13px;
  font-weight: 600;
  color: var(--subject-accent, var(--color-accent));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.subject-card:hover .subject-card__action-pill {
  background: var(--subject-accent, var(--color-accent));
  color: #ffffff;
  border-color: transparent;
  transform: translateX(3px);
  box-shadow: 0 4px 14px var(--subject-glow-color, rgba(0, 113, 227, 0.35));
}

.subject-card__arrow {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.subject-card:hover .subject-card__arrow {
  transform: translateX(3px);
}

/* ==========================================================================
   Step 2: Apple Grouped Exam List
   ========================================================================== */

/* Breadcrumb Back Button */
.breadcrumb-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-family-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--color-accent);
  text-decoration: none;
  margin-bottom: 2rem;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.breadcrumb-back:hover {
  background: rgba(0, 113, 227, 0.08);
  border-color: var(--color-accent);
  transform: translateX(-3px);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.15);
}

.breadcrumb-back svg {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.breadcrumb-back:hover svg {
  transform: translateX(-2px);
}

/* ==========================================================================
   Subject Hero Banner (Subject Accent Themes)
   ========================================================================== */

.subject-hero-banner {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 2.25rem 2.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-resting);
  transition: all 0.3s ease;
}

.subject-hero-banner::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -15%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

/* Subject Accent Palettes for Hero Banner */
.subject-hero-banner[data-subject*="Meteorology"] {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.08) 0%, rgba(56, 189, 248, 0.03) 100%), var(--color-surface);
  border-color: rgba(2, 132, 199, 0.25);
}
.subject-hero-banner[data-subject*="Meteorology"]::before {
  background: var(--subject-meteorology);
}
.subject-hero-banner[data-subject*="Meteorology"] .subject-hero__icon {
  background: var(--subject-meteorology-gradient);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.35);
}
.subject-hero-banner[data-subject*="Meteorology"] .subject-hero__eyebrow {
  color: var(--subject-meteorology);
}

.subject-hero-banner[data-subject*="Regulations"] {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(99, 102, 241, 0.03) 100%), var(--color-surface);
  border-color: rgba(79, 70, 229, 0.25);
}
.subject-hero-banner[data-subject*="Regulations"]::before {
  background: var(--subject-regulations);
}
.subject-hero-banner[data-subject*="Regulations"] .subject-hero__icon {
  background: var(--subject-regulations-gradient);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
}
.subject-hero-banner[data-subject*="Regulations"] .subject-hero__eyebrow {
  color: var(--subject-regulations);
}

.subject-hero-banner[data-subject*="Navigation"] {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.08) 0%, rgba(20, 184, 166, 0.03) 100%), var(--color-surface);
  border-color: rgba(13, 148, 136, 0.25);
}
.subject-hero-banner[data-subject*="Navigation"]::before {
  background: var(--subject-navigation);
}
.subject-hero-banner[data-subject*="Navigation"] .subject-hero__icon {
  background: var(--subject-navigation-gradient);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.35);
}
.subject-hero-banner[data-subject*="Navigation"] .subject-hero__eyebrow {
  color: var(--subject-navigation);
}

.subject-hero-banner[data-subject*="Technical"] {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.08) 0%, rgba(249, 115, 22, 0.03) 100%), var(--color-surface);
  border-color: rgba(234, 88, 12, 0.25);
}
.subject-hero-banner[data-subject*="Technical"]::before {
  background: var(--subject-technical);
}
.subject-hero-banner[data-subject*="Technical"] .subject-hero__icon {
  background: var(--subject-technical-gradient);
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.35);
}
.subject-hero-banner[data-subject*="Technical"] .subject-hero__eyebrow {
  color: var(--subject-technical);
}

.subject-hero-banner[data-subject*="Radio"],
.subject-hero-banner[data-subject*="RTR"] {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.08) 0%, rgba(168, 85, 247, 0.03) 100%), var(--color-surface);
  border-color: rgba(147, 51, 234, 0.25);
}
.subject-hero-banner[data-subject*="Radio"]::before,
.subject-hero-banner[data-subject*="RTR"]::before {
  background: var(--subject-rtr);
}
.subject-hero-banner[data-subject*="Radio"] .subject-hero__icon,
.subject-hero-banner[data-subject*="RTR"] .subject-hero__icon {
  background: var(--subject-rtr-gradient);
  box-shadow: 0 8px 24px rgba(147, 51, 234, 0.35);
}
.subject-hero-banner[data-subject*="Radio"] .subject-hero__eyebrow,
.subject-hero-banner[data-subject*="RTR"] .subject-hero__eyebrow {
  color: var(--subject-rtr);
}

[data-theme="dark"] .subject-hero-banner {
  background: var(--color-surface);
}

.subject-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.subject-hero__icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.subject-hero__icon svg {
  width: 36px;
  height: 36px;
}

.subject-hero-banner:hover .subject-hero__icon {
  transform: scale(1.05);
}

.subject-hero__text {
  flex: 1;
}

.subject-hero__eyebrow {
  font-family: var(--font-family-sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
  display: block;
}

.subject-hero__title {
  font-family: var(--font-family-heading);
  font-size: clamp(1.85rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--color-text-primary);
  margin-bottom: 0.875rem;
}

.subject-hero__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-family-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 6px 14px;
  border-radius: var(--radius-chip);
  box-shadow: var(--shadow-resting);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.stat-chip__icon {
  color: var(--color-text-secondary);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.stat-chip--progress {
  color: var(--color-primary);
  border-color: rgba(0, 113, 227, 0.3);
  background: var(--color-primary-light);
}

[data-theme="dark"] .stat-chip--progress {
  background: rgba(41, 151, 255, 0.15);
  border-color: rgba(41, 151, 255, 0.4);
}

.stat-chip--progress .stat-chip__icon {
  color: var(--color-primary);
}

/* Exam List Toolbar */
.exam-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.75rem 0 1.25rem;
  flex-wrap: wrap;
}

/* Year Grouping & Sticky Sub-Headers */
.year-group {
  margin-bottom: 2rem;
}

.year-group-header {
  position: sticky;
  top: var(--header-height);
  z-index: 15;
  background: rgba(245, 245, 247, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 0.75rem 0;
  margin-bottom: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
}

[data-theme="dark"] .year-group-header {
  background: rgba(0, 0, 0, 0.82);
}

.year-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-family-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

.year-group-title svg {
  color: var(--color-primary);
}

.year-group-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
}

.year-group-rows {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

/* Exam Row Specifics (Left-border, Card Styling, Icons) */
.exam-list-row {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 1.125rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.2s ease;
  box-shadow: var(--shadow-resting);
  position: relative;
}

.exam-list-row:hover {
  border-color: rgba(0, 113, 227, 0.35);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.exam-list-row--regular {
  border-left: 4px solid var(--color-primary) !important;
}

.exam-list-row--ondemand {
  border-left: 4px solid var(--subject-navigation) !important;
}

.exam-list-row__info {
  display: flex;
  align-items: center;
  gap: 1.125rem;
  flex: 1;
  min-width: 280px;
}

.exam-list-row__icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.exam-list-row:hover .exam-list-row__icon-wrap {
  transform: scale(1.05);
  background: var(--color-primary-light);
}

.exam-list-row__title {
  font-family: var(--font-family-heading);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--color-text-primary);
  margin-bottom: 0.25rem;
}

.exam-list-row__meta {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--color-text-secondary);
}

.exam-list-row__status {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 140px;
}

.exam-list-row__actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

/* Status Chips */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-family-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 4px 10px;
  border-radius: var(--radius-chip);
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-chip--neutral {
  background: var(--color-neutral-100);
  border: 1px solid var(--color-neutral-200);
  color: var(--color-text-secondary);
}

[data-theme="dark"] .status-chip--neutral {
  background: var(--color-neutral-800);
  border-color: var(--color-neutral-700);
  color: var(--color-text-tertiary);
}

.status-chip--warning {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  color: var(--color-warning-dark);
}

[data-theme="dark"] .status-chip--warning {
  color: var(--color-warning);
}

.status-chip--warning .chip-dot {
  background: var(--color-warning);
  box-shadow: 0 0 6px var(--color-warning);
}

.status-chip--success {
  background: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  color: var(--color-success-dark);
}

[data-theme="dark"] .status-chip--success {
  color: var(--color-success);
}

.status-chip--success .chip-dot {
  background: var(--color-success);
  box-shadow: 0 0 6px var(--color-success);
}

.status-chip--danger {
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  color: var(--color-danger-dark);
}

[data-theme="dark"] .status-chip--danger {
  color: var(--color-danger);
}

.status-chip--danger .chip-dot {
  background: var(--color-danger);
  box-shadow: 0 0 6px var(--color-danger);
}

/* Apple Search Input */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  min-width: 280px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-family-sans);
  font-size: 13px;
  color: var(--color-text-primary);
  width: 100%;
}

.search-box input::placeholder {
  color: var(--color-text-secondary);
}

/* ==========================================================================
   Exam Simulator & Question Layout (exam.html)
   ========================================================================== */

.header--slim {
  height: 48px;
}

.header__inner--slim {
  height: 100%;
}

/* Apple Breadcrumb */
.exam-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-family-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.exam-breadcrumb__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
  font-weight: 500;
}

.exam-breadcrumb__link:hover {
  color: var(--color-primary);
}

.exam-breadcrumb__chevron--subject {
  display: none;
}

.exam-breadcrumb__sep {
  color: var(--color-neutral-400);
  font-size: 12px;
}

.exam-breadcrumb__current {
  color: var(--color-text-primary);
  font-weight: 600;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .exam-breadcrumb__current {
    max-width: 130px;
  }
}

.exam-layout {
  display: flex;
  min-height: calc(100vh - 48px - var(--ribbon-height));
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.exam-main {
  flex: 1;
  width: 100%;
  max-width: 820px;
  min-width: 0;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 7.5rem;
  box-sizing: border-box;
}

.q-progress-bar-container {
  width: 100%;
  height: 3px;
  background: var(--color-border);
  position: sticky;
  top: 48px;
  z-index: 45;
}

.q-progress-bar {
  height: 100%;
  background: var(--color-primary);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Question Overview Card & Status Matrix */
.matrix-overview-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-resting);
  transition: box-shadow 0.25s ease;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.matrix-overview-card:hover {
  box-shadow: var(--shadow-hover);
}

.matrix-overview-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--color-border-subtle);
  min-width: 0;
  max-width: 100%;
}

.matrix-status-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
}

.matrix-status-pill {
  font-family: var(--font-family-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--color-text-secondary);
}

.matrix-status-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-text-primary);
}

/* Slim Horizontal Progress Bar */
.matrix-progress-wrap {
  margin: 0.875rem 0 1.25rem;
}

.matrix-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-family-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

#matrix-progress-pct {
  font-family: var(--font-family-mono);
  font-weight: 700;
  color: var(--color-primary);
}

.matrix-progress-track {
  width: 100%;
  height: 6px;
  background: var(--color-neutral-200);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

[data-theme="dark"] .matrix-progress-track {
  background: var(--color-neutral-800);
}

.matrix-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-success) 100%);
  border-radius: var(--radius-pill);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Interactive Question Tiles (30-32px squircles) */
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px 0;
}

.matrix-tile {
  width: 32px;
  height: 32px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family-mono);
  font-weight: 600;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.matrix-tile:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: scale(1.15);
  box-shadow: 0 4px 10px rgba(0, 113, 227, 0.25);
  z-index: 3;
}

.matrix-tile:active {
  transform: scale(0.95);
}

.matrix-tile.is-correct {
  background: var(--color-success) !important;
  border-color: var(--color-success) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35) !important;
}

.matrix-tile.is-incorrect {
  background: var(--color-danger) !important;
  border-color: var(--color-danger) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35) !important;
}

.matrix-tile.is-mock-answered {
  background: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.35) !important;
}

.matrix-tile.is-marked {
  box-shadow: 0 0 0 2px var(--color-warning) !important;
}

.matrix-tile.is-marked::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 5px;
  height: 5px;
  background: var(--color-warning);
  border-radius: 50%;
  box-shadow: 0 0 3px var(--color-warning);
}

.matrix-tile.is-current {
  outline: 2.5px solid var(--color-primary);
  outline-offset: 2px;
  z-index: 2;
  box-shadow: 0 0 10px rgba(0, 113, 227, 0.4);
}

/* Filter Pills Bar */
.filter-pills-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.75rem;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.filter-pills-bar::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-family: var(--font-family-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  box-shadow: var(--shadow-resting);
}

.filter-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-text-primary);
  transform: translateY(-1px);
}

.filter-pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.35);
}

.filter-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.filter-pill__dot--all { background: var(--color-primary); }
.filter-pill__dot--answered { background: var(--color-success); }
.filter-pill__dot--pending { background: var(--color-neutral-400); }
.filter-pill__dot--incorrect { background: var(--color-danger); }
.filter-pill__dot--flagged { background: var(--color-warning); }

.filter-pill.active .filter-pill__dot {
  background: #ffffff !important;
}

.filter-pill__count {
  font-family: var(--font-family-mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-subtle);
  color: var(--color-text-secondary);
  margin-left: 2px;
}

.filter-pill.active .filter-pill__count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Question Card */
.question-card, .modular-q-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 2.25rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-resting);
  position: relative;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.question-card:hover, .modular-q-card:hover {
  box-shadow: var(--shadow-hover);
}

.q-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border-subtle);
}

.q-number {
  font-family: var(--font-family-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-tertiary);
}

.q-text {
  font-family: var(--font-family-sans);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: -0.018em;
  color: var(--color-text-primary);
  margin-bottom: 2rem;
}

/* Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.125rem;
  min-height: 52px;
  padding: 12px 18px;
  border: 1.5px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-family: var(--font-family-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
  cursor: pointer;
  text-align: left;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  box-shadow: var(--shadow-resting);
  position: relative;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--color-primary);
  background: var(--color-primary-subtle);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.option-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.995);
}

.option-key {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  font-family: var(--font-family-sans);
  font-weight: 700;
  font-size: 12px;
  color: var(--color-text-secondary);
  transition: all 0.22s ease;
}

.option-text {
  flex: 1;
}

/* Option States */
.option-btn.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-subtle);
}

.option-btn.selected .option-key {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

.option-btn.correct {
  border-color: var(--color-success) !important;
  background: var(--color-success-bg) !important;
  color: var(--color-text-primary) !important;
}

.option-btn.correct .option-key {
  background: var(--color-success) !important;
  color: #ffffff !important;
  border-color: var(--color-success) !important;
}

.option-btn.incorrect {
  border-color: var(--color-danger) !important;
  background: var(--color-danger-bg) !important;
  color: var(--color-text-primary) !important;
}

.option-btn.incorrect .option-key {
  background: var(--color-danger) !important;
  color: #ffffff !important;
  border-color: var(--color-danger) !important;
}

.option-badge-indicator {
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.option-badge-indicator--correct {
  background: var(--color-success);
  color: #ffffff;
}

.option-badge-indicator--incorrect {
  background: var(--color-danger);
  color: #ffffff;
}

.option-badge-indicator--selected {
  background: var(--color-primary);
  color: #ffffff;
}

/* Explanation Box (Apple Disclosure Callout) */
.explanation-box {
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  margin-top: 1.5rem;
  animation: fadeIn 0.25s ease-in-out;
  position: relative;
}

.explanation-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-family-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-primary);
  margin-bottom: 0.625rem;
}

.explanation-text {
  font-family: var(--font-family-sans);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.015em;
  color: var(--color-text-secondary);
}

/* Bookmark Active & Warning Buttons */
.button--marked {
  background: var(--color-warning-bg);
  border-color: var(--color-warning);
  color: var(--color-warning-dark);
  box-shadow: 0 0 0 1px var(--color-warning);
}

[data-theme="dark"] .button--marked {
  color: var(--color-warning);
}

.button--warning-tint {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  color: var(--color-warning-dark);
}

.button--warning-tint.active,
.button--warning-tint:hover {
  background: var(--color-warning);
  border-color: var(--color-warning);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .button--warning-tint {
  color: var(--color-warning);
}

/* Bottom Glass Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--color-border);
  padding: 0.75rem max(1.25rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
  z-index: 40;
  box-shadow: var(--shadow-dropdown);
  width: 100%;
  box-sizing: border-box;
}

[data-theme="dark"] .bottom-nav {
  background: rgba(22, 22, 23, 0.85);
}

.bottom-nav-inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.bottom-nav__left,
.bottom-nav__right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.bottom-nav__center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  min-width: 0;
}

.footer-q-indicator {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  font-family: var(--font-family-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Drawer / Navigator */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.drawer-backdrop:not(.open) {
  display: none !important;
}

.drawer-backdrop.open {
  display: flex !important;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.drawer-panel {
  width: 100%;
  max-width: min(420px, 88vw);
  height: 100%;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-lg);
  box-sizing: border-box;
}

.drawer-backdrop.open .drawer-panel {
  transform: translateX(0);
}

.q-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
  margin-top: 1.25rem;
}

.q-grid-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.q-grid-btn:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-accent);
}

.q-grid-btn.current {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.q-grid-btn.answered-correct {
  background: var(--color-success);
  color: #ffffff;
  border-color: var(--color-success);
}

.q-grid-btn.answered-incorrect {
  background: var(--color-danger);
  color: #ffffff;
  border-color: var(--color-danger);
}

.q-grid-btn.marked {
  background: var(--color-warning);
  color: #ffffff;
  border-color: var(--color-warning);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop:not(.open) {
  display: none !important;
}

.modal-backdrop.open {
  display: flex !important;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  max-width: 480px;
  width: 100%;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.open .modal-card {
  transform: scale(1);
}

/* Apple Segmented View Switcher */
.view-switcher {
  display: inline-flex;
  background: rgba(120, 120, 128, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}

[data-theme="dark"] .view-switcher {
  background: rgba(120, 120, 128, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.view-switcher-btn {
  font-family: var(--font-family-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.view-switcher-btn:hover {
  color: var(--color-text-primary);
}

.view-switcher-btn.active {
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 0 1px rgba(0, 0, 0, 0.12);
  font-weight: 600;
}

[data-theme="dark"] .view-switcher-btn.active {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Timer Display */
.timer-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-family-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  background: var(--color-surface-subtle);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
}

/* Subject Badges */
.subject-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 3px 8px;
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text-secondary);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Responsive Architecture: All Mobile Models, Tablets & iPads
   ========================================================================== */

/* Tier 1: iPad / Tablet Landscape & Portrait (<= 1024px) */
@media (max-width: 1024px) {
  .header__inner {
    padding: 0 max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left));
  }
  .header__actions {
    gap: 0.375rem;
  }
  .exam-breadcrumb {
    gap: 6px;
  }
  .exam-breadcrumb__link--root,
  .exam-breadcrumb__sep--root {
    display: none;
  }
  .exam-breadcrumb__current {
    max-width: 150px;
  }
  .view-switcher-btn {
    padding: 4px 10px;
    font-size: 12px;
  }
  .timer-box {
    padding: 3px 8px;
    font-size: 12px;
  }
  .stage {
    padding: 4rem 0 2.5rem;
  }
  .stage__title {
    font-size: clamp(2.4rem, 5vw, 3.5rem);
  }
  .subject-showcase-container {
    border-radius: 28px;
    padding: 1.75rem 1.25rem 2.25rem;
    margin: 1rem 0 3.5rem;
  }
  .subject-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  .subject-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
  }
  .subject-hero-banner {
    padding: 1.75rem;
    border-radius: 20px;
  }
  .search-box {
    min-width: 260px;
    flex: 1;
    max-width: 440px;
  }
}

/* Tier 2: Small Tablets & Landscape Mobile (<= 768px) */
@media (max-width: 768px) {
  :root {
    --header-height: 48px;
  }
  .header {
    height: 48px;
  }
  .header__inner {
    padding: 0 max(0.875rem, env(safe-area-inset-right)) 0 max(0.875rem, env(safe-area-inset-left));
  }
  .header__nav {
    display: none;
  }
  .header__actions {
    gap: 0.375rem;
  }
  .exam-breadcrumb {
    gap: 5px;
  }
  .exam-breadcrumb__current {
    max-width: 120px;
  }
  .stage {
    padding: 3rem 0 2rem;
  }
  .stage__title {
    font-size: clamp(2rem, 5.5vw, 2.75rem);
    line-height: 1.15;
  }
  .stage__title br {
    display: none;
  }
  .stage__description {
    font-size: 15px;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
  }
  .exam-list-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .search-box {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .exam-list-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1.125rem 1.125rem;
    border-radius: 16px;
  }
  .exam-list-row__info {
    width: 100%;
    min-width: 0;
  }
  .exam-list-row__title {
    font-size: 1.05rem;
    line-height: 1.35;
  }
  .exam-list-row__status {
    width: 100%;
    min-width: 0;
  }
  .exam-list-row__actions {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }
  .exam-list-row__actions .button {
    flex: 1;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    text-align: center;
    padding: 8px 12px;
  }
  .exam-main {
    padding: 1.5rem 1rem calc(5.5rem + env(safe-area-inset-bottom));
  }
  .matrix-overview-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.625rem;
  }
  .matrix-status-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .q-text {
    font-size: 1.125rem;
    line-height: 1.48;
    margin-bottom: 1.5rem;
  }
  .question-card,
  .modular-q-card {
    padding: 1.5rem 1.25rem;
    border-radius: 18px;
  }
}

/* Tier 3: Standard Mobile Phones (<= 640px) */
@media (max-width: 640px) {
  .ticker,
  .apple-ribbon {
    font-size: 11.5px;
  }
  .ticker__detail {
    display: none;
  }
  .subject-grid {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }
  .subject-card:last-child:nth-child(odd) {
    grid-column: auto;
    max-width: 100%;
  }
  .subject-card {
    padding: 1.35rem 1.15rem;
    border-radius: 16px;
  }
  .subject-card__icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .subject-card__icon-box svg {
    width: 22px;
    height: 22px;
  }
  .subject-hero-banner {
    padding: 1.25rem 1rem;
    border-radius: 18px;
    margin-bottom: 1.25rem;
  }
  .subject-hero__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.875rem;
  }
  .subject-hero__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }
  .subject-hero__icon svg {
    width: 24px;
    height: 24px;
  }
  .subject-hero__title {
    font-size: 1.5rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
  }
  .subject-hero__desc {
    font-size: 13px;
    margin-bottom: 0.875rem;
  }
  .subject-hero__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.375rem;
    width: 100%;
  }
  .stat-chip {
    padding: 6px 6px;
    font-size: 11px;
    justify-content: center;
    text-align: center;
    gap: 4px;
  }
  .stat-chip svg {
    width: 12px;
    height: 12px;
  }
  .matrix-overview-card {
    padding: 1.125rem 0.875rem;
    border-radius: 16px;
    margin-bottom: 1.25rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .matrix-overview-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.625rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .matrix-status-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .matrix-status-pill {
    padding: 3px 8px;
    font-size: 11px;
    gap: 4px;
  }
  .matrix-grid {
    grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
    gap: 4px;
    max-height: 160px;
  }
  .matrix-tile {
    width: 100%;
    max-width: 32px;
    height: 28px;
    font-size: 11px;
    border-radius: 6px;
  }
  .filter-pills-bar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.375rem;
    padding-bottom: 2px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .matrix-status-pills::-webkit-scrollbar,
  .filter-pills-bar::-webkit-scrollbar {
    display: none;
  }
  .filter-pill {
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: 12px;
  }
  .option-btn {
    padding: 0.875rem 0.875rem;
    border-radius: 12px;
    min-height: 48px;
    gap: 0.625rem;
  }
  .option-key {
    width: 26px;
    height: 26px;
    min-width: 26px;
    font-size: 12px;
  }
  .option-text {
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .view-switcher--layout {
    display: none;
  }
  .exam-breadcrumb__chevron--subject {
    display: inline-block;
  }
  .exam-breadcrumb__sep--current,
  .exam-breadcrumb__current {
    display: none;
  }
  .view-switcher--mode .button,
  .view-switcher--mode button,
  .view-switcher--mode .view-switcher-btn {
    padding: 3px 8px !important;
    font-size: 11px !important;
    min-height: 28px !important;
    gap: 3px !important;
  }
  .btn-text-full {
    display: none;
  }
  .btn-text-short {
    display: inline;
  }
  .crumb-text-full {
    display: none;
  }
  .crumb-text-short {
    display: inline;
  }
}

/* Tier 4: Compact Phones (iPhone SE, 375px, Android 360px) (<= 480px) */
@media (max-width: 480px) {
  .container {
    padding: 0 0.875rem;
  }
  .header__inner {
    padding: 0 max(0.625rem, env(safe-area-inset-right)) 0 max(0.625rem, env(safe-area-inset-left));
  }
  .header__actions {
    gap: 0.25rem;
  }
  .header__logo-img {
    width: 26px;
    height: 26px;
    border-radius: 6px;
  }
  .header__logo-text {
    font-size: 14px;
  }
  .header__logo-tagline {
    font-size: 8px;
  }
  .stage {
    padding: 2.25rem 0 1.5rem;
  }
  .stage__title {
    font-size: clamp(1.75rem, 7.5vw, 2.25rem);
    letter-spacing: -0.025em;
  }
  .stage__description {
    font-size: 14px;
    line-height: 1.45;
  }
  .stage__micro-tag {
    font-size: 11px;
    padding: 4px 10px;
  }
  .subject-showcase-container {
    border-radius: 20px;
    padding: 0.875rem 0.625rem 1.125rem;
    margin: 0.5rem 0 2rem;
  }
  .subject-card {
    padding: 1.125rem 1rem;
    border-radius: 14px;
  }
  .subject-card__title {
    font-size: 1.35rem;
  }
  .view-switcher--mode .button,
  .view-switcher--mode button,
  .view-switcher--mode .view-switcher-btn {
    padding: 2.5px 6px !important;
    font-size: 10.5px !important;
    min-height: 26px !important;
    gap: 2px !important;
  }
  .timer-box {
    padding: 3px 6px;
    font-size: 11px;
    gap: 3px;
  }
  .timer-box svg {
    width: 11px;
    height: 11px;
  }
  .btn-icon-technical {
    width: 30px;
    height: 30px;
  }
  .btn-icon-technical svg {
    width: 13px;
    height: 13px;
  }
  #footer-flag-text {
    display: none;
  }
  .footer-q-indicator {
    font-size: 11.5px;
  }
  .bottom-nav {
    padding: 0.5rem max(0.625rem, env(safe-area-inset-right)) max(0.625rem, env(safe-area-inset-bottom)) max(0.625rem, env(safe-area-inset-left));
  }
  .bottom-nav-inner {
    gap: 0.25rem;
  }
  .bottom-nav__left,
  .bottom-nav__right {
    gap: 0.25rem;
  }
  .bottom-nav .button--sm {
    min-height: 40px;
    padding: 6px 10px;
    font-size: 12px;
  }
  .exam-main {
    padding: 1.125rem 0.75rem calc(5.5rem + env(safe-area-inset-bottom));
  }
  .question-card,
  .modular-q-card {
    padding: 1.125rem 0.875rem;
    border-radius: 14px;
  }
  .q-text {
    font-size: 1rem;
    line-height: 1.42;
    margin-bottom: 1rem;
  }
  .option-btn {
    padding: 0.75rem 0.75rem;
    border-radius: 10px;
    gap: 0.5rem;
  }
  .option-feedback-badge {
    font-size: 10px;
    padding: 2px 6px;
  }
}
