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

/* ============================================
   RankersHub - Premium Design System v2.5
   Glassmorphism + 3D + Neumorphism + Animations
   ============================================ */

:root {
  --primary: #6c63ff;
  --primary-dark: #5a52d5;
  --primary-light: #e8e5ff;
  --accent: #7C3AED;
  --accent-dark: #5B21B6;
  --accent-light: #EDE9FE;
  --secondary: #ff6584;
  --gold: #ffd700;
  --gold-dark: #cca800;
  --gold-light: #fff8e7;
  --success: #4caf50;
  --success-light: #e8f5e9;
  --warning: #ff9800;
  --warning-light: #fff3e0;
  --danger: #f44336;
  --danger-light: #ffebee;
  --bg-dark: #0d0d1a;
  --bg-card: rgba(255,255,255,0.05);
  --dark: #0F172A;
  --dark-2: #1E293B;
  --dark-3: #334155;
  --gray: #64748B;
  --gray-light: #94A3B8;
  --gray-lighter: #CBD5E1;
  --gray-bg: #F8FAFC;
  --gray-bg2: #F1F5F9;
  --white: #FFFFFF;

  /* Typography */
  --font-primary: 'Aptos', 'Segoe UI', Tahoma, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-hero: 3.5rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-4: 1rem;
  --space-8: 2rem;
  --space-16: 4rem;

  /* Radius */
  --radius-md: 16px;
  --radius: var(--radius-md);
  --radius-xs: 0.25rem;
  --radius-sm: 0.375rem;
  --radius-lg: 1.25rem;
  --radius-xl: 2rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1);
  --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.15);
  --shadow-glow: 0 0 40px rgba(108,99,255,0.15);
  --shadow-gold: 0 4px 20px rgba(255,215,0,0.25);

  /* Glass */
  --glass-bg: rgba(255,255,255,0.75);
  --glass-border: rgba(255,255,255,0.5);
  --glass-shadow: 0 8px 32px rgba(0,0,0,0.06);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  /* Transitions */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  background: var(--gray-bg);
  color: var(--dark);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.rh-scroll-locked {
  overflow: hidden !important;
}

a { text-decoration: none; color: inherit; }
img, svg, canvas, video, iframe { max-width: 100%; }
img, video { height: auto; }
input, select, textarea, button { font: inherit; max-width: 100%; }
table { max-width: 100%; }
.dashboard, .main-content, .main-content-full,
.card, .stat-card, .result-box, .result-section, .mock-card,
.analysis-card, .modal-content, .modal-box, .question-container {
  min-width: 0;
}
.card, .stat-card, .result-box, .result-section, .mock-card,
.analysis-card, .modal-content, .modal-box, .question-container,
.page-header, .section-header {
  overflow-wrap: anywhere;
}

/* ========== ANIMATIONS ========== */
@keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-10px); } }
@keyframes float-slow { 0%, 100% { transform: translateY(0px) rotate(0deg); } 50% { transform: translateY(-15px) rotate(2deg); } }
@keyframes pulse-glow { 0%, 100% { box-shadow: 0 0 20px rgba(79,70,229,0.2); } 50% { box-shadow: 0 0 40px rgba(79,70,229,0.4); } }
@keyframes pulse-gold { 0%, 100% { box-shadow: 0 0 20px rgba(212,175,55,0.3); } 50% { box-shadow: 0 0 40px rgba(212,175,55,0.5); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes gradient-shift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes countdown-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes borderGlow { 0%, 100% { border-color: rgba(79,70,229,0.3); box-shadow: 0 0 8px rgba(79,70,229,0.15); } 50% { border-color: rgba(79,70,229,0.7); box-shadow: 0 0 20px rgba(79,70,229,0.3); } }
@keyframes neonPulse { 0%, 100% { box-shadow: 0 0 8px rgba(79,70,229,0.3), 0 0 20px rgba(79,70,229,0.2); } 50% { box-shadow: 0 0 16px rgba(79,70,229,0.5), 0 0 40px rgba(79,70,229,0.3); } }
@keyframes goldShimmer { to { background-position: 200% center; } }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.7; } }

.animate-float { animation: float 3s ease-in-out infinite; }
.animate-fadeInUp { animation: fadeInUp 0.6s ease-out forwards; }
.animate-fadeIn { animation: fadeIn 0.4s ease-out forwards; }
.animate-scaleIn { animation: scaleIn 0.4s ease-out forwards; }
.animate-slideInRight { animation: slideInRight 0.5s ease-out forwards; }
.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-lighter); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-light); }

/* ========== GRADIENT TEXT ========== */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent), #F43F5E);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s ease-in-out infinite;
}

.gold-text {
  background: linear-gradient(135deg, #f0d060 0%, #d4af37 25%, #fff3c7 50%, #e6c27a 75%, #c5a030 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: goldShimmer 3s linear infinite;
}

/* ========== BUTTONS ========== */
.btn {
  padding: 10px 24px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-primary);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  letter-spacing: -0.2px;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 4px 15px rgba(79,70,229,0.3);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(79,70,229,0.45); transform: translateY(-1px); }

.btn-outline { background: transparent; border: 1.5px solid var(--gray-lighter); color: var(--dark-2); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.btn-accent { background: linear-gradient(135deg, var(--accent), #9333EA); color: white; box-shadow: 0 4px 15px rgba(124,58,237,0.3); }
.btn-accent:hover { box-shadow: 0 6px 20px rgba(124,58,237,0.45); transform: translateY(-1px); }

.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: white; box-shadow: var(--shadow-gold); }
.btn-gold:hover { box-shadow: 0 6px 24px rgba(212,175,55,0.5); transform: translateY(-2px); }

.btn-cta { background: var(--success); color: white; font-weight: 700; }
.btn-cta:hover { background: #047857; }

.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }

.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: 100px; }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 100px; }
.btn-xl { padding: 18px 40px; font-size: 18px; border-radius: 100px; }

.btn-3d {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 24px rgba(34,197,94,.4);
  transition: all var(--transition-bounce);
}
.btn-3d:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(34,197,94,.5), 0 0 0 4px rgba(34,197,94,.15); }

/* ========== NAVBAR ========== */
.navbar {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.nav-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav-logo {
  display: flex; align-items: center; gap: 12px;
  font-weight: 800; font-size: 22px; color: var(--dark); letter-spacing: -0.5px;
}
.nav-logo .logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; flex-wrap: wrap; }
.nav-links a {
  padding: 8px 16px; border-radius: var(--radius-xs);
  font-weight: 500; font-size: 14px; color: var(--gray);
  transition: var(--transition-fast);
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); background: var(--primary-light); }

/* ========== HERO ========== */
.hero {
  position: relative;
  padding: 100px 24px 80px;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 30%, #0f3460 60%, #0a0a15 100%);
}
.hero::before {
  content: '';
  position: absolute;
  top: -300px; right: -200px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(79,70,229,0.12) 0%, transparent 70%);
  border-radius: 50%;
  animation: float-slow 12s ease-in-out infinite;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -200px; left: -150px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(212,175,55,0.08) 0%, transparent 70%);
  border-radius: 50%;
  animation: float-slow 10s ease-in-out infinite reverse;
}
.hero-content { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(79,70,229,0.15);
  color: #a5b4fc;
  padding: 8px 20px; border-radius: 100px;
  font-weight: 600; font-size: 13px;
  margin-bottom: 28px;
  border: 1px solid rgba(79,70,229,0.2);
  animation: fadeInUp 0.6s ease-out;
}
.hero-badge .dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; animation: pulse-glow 2s ease-in-out infinite; }

.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  color: white;
  margin-bottom: 24px;
  letter-spacing: -1.5px;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}
.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent), var(--gold));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s ease-in-out infinite;
}
.hero p {
  font-size: 18px; color: rgba(255,255,255,0.6);
  max-width: 600px; margin: 0 auto 36px; line-height: 1.7;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}
.hero-buttons {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}
.hero-stars { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.star { position: absolute; background: white; border-radius: 50%; animation: twinkle 2s infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } }

.hero-stats {
  display: flex; justify-content: center; gap: 60px;
  margin-top: 60px;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}
.hero-stat { text-align: center; position: relative; }
.hero-stat::after { content: ''; position: absolute; right: -30px; top: 10px; bottom: 10px; width: 1px; background: rgba(255,255,255,0.1); }
.hero-stat:last-child::after { display: none; }
.hero-stat .num { font-size: 36px; font-weight: 800; color: white; letter-spacing: -1px; }
.hero-stat .num span {
  background: linear-gradient(135deg, var(--primary), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-stat .label { font-size: 13px; color: rgba(255,255,255,0.5); margin-top: 4px; font-weight: 500; }

/* ========== SECTIONS ========== */
.section { max-width: 1300px; margin: 0 auto; padding: 80px 24px; }
.section-dark { background: var(--dark-2); max-width: 100%; padding: 80px 24px; }
.section-header { text-align: center; margin-bottom: 56px; }
.section-header .section-tag {
  display: inline-block;
  background: var(--primary-light); color: var(--primary);
  padding: 6px 16px; border-radius: 100px;
  font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 16px;
}
.section-header h2 { font-size: 36px; font-weight: 800; color: var(--dark); margin-bottom: 12px; letter-spacing: -1px; }
.section-header p { font-size: 16px; color: var(--gray); max-width: 500px; margin: 0 auto; }

/* ========== FEATURES ========== */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 24px; }
.feature-card {
  background: var(--white); border-radius: var(--radius); padding: 36px 28px;
  border: 1px solid rgba(0,0,0,0.04); box-shadow: var(--shadow-sm);
  transition: all var(--transition); position: relative; overflow: hidden;
}
.feature-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--primary), var(--accent)); opacity: 0; transition: opacity var(--transition); }
.feature-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.feature-card:hover::before { opacity: 1; }
.feature-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; font-size: 22px;
}
.feature-icon.blue { background: linear-gradient(135deg, #DBEAFE, #BFDBFE); color: #2563EB; }
.feature-icon.purple { background: linear-gradient(135deg, #EDE9FE, #DDD6FE); color: #7C3AED; }
.feature-icon.green { background: linear-gradient(135deg, #D1FAE5, #A7F3D0); color: #059669; }
.feature-icon.orange { background: linear-gradient(135deg, #FEF3C7, #FDE68A); color: #D97706; }
.feature-icon.red { background: linear-gradient(135deg, #FEE2E2, #FECACA); color: #DC2626; }
.feature-icon.cyan { background: linear-gradient(135deg, #CFFAFE, #A5F3FC); color: #0891B2; }
.feature-icon.gold { background: linear-gradient(135deg, #FEF3C7, #FDE68A); color: #D97706; }
.feature-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; color: var(--dark); letter-spacing: -0.3px; }
.feature-card p { font-size: 14px; color: var(--gray); line-height: 1.6; }

/* ========== MOCK CARDS ========== */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 24px; }
.card {
  background: var(--white); border-radius: var(--radius); padding: 24px;
  border: 1px solid rgba(0,0,0,0.04); box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }

.card-badge {
  padding: 4px 12px; border-radius: 100px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
}
.badge-easy { background: var(--success-light); color: var(--success); }
.badge-medium { background: var(--warning-light); color: var(--warning); }
.badge-hard { background: var(--danger-light); color: var(--danger); }
.badge-free { background: var(--primary-light); color: var(--primary); }
.badge-live { background: var(--danger-light); color: var(--danger); animation: pulse 1s infinite alternate; }
.card-title { font-size: 17px; font-weight: 700; color: var(--dark); margin-bottom: 10px; letter-spacing: -0.3px; }
.card-meta { display: flex; gap: 16px; font-size: 13px; color: var(--gray); margin-bottom: 16px; flex-wrap: wrap; }
.card-meta span { display: flex; align-items: center; gap: 5px; }
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; border-top: 1px solid #F1F5F9;
}
.token-cost {
  display: flex; align-items: center; gap: 6px;
  font-weight: 700; color: var(--accent); font-size: 14px;
}
.token-cost .coin {
  width: 22px; height: 22px;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; color: white;
  box-shadow: 0 2px 6px rgba(245,158,11,0.3);
}

/* ========== EXAM CARDS (Home) ========== */
.exam-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.exam-card {
  background: var(--white); border-radius: var(--radius); padding: 28px 24px;
  border: 1px solid rgba(0,0,0,0.04); box-shadow: var(--shadow-sm);
  transition: all var(--transition-bounce); text-align: center; cursor: pointer;
  position: relative; overflow: hidden;
}
.exam-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.exam-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.exam-card.ssc::before { background: linear-gradient(90deg, #EF4444, #F97316); }
.exam-card.upsc::before { background: linear-gradient(90deg, #3B82F6, #8B5CF6); }
.exam-card.banking::before { background: linear-gradient(90deg, #10B981, #059669); }
.exam-card.railway::before { background: linear-gradient(90deg, #F59E0B, #D97706); }

.exam-card .exam-icon { font-size: 40px; margin-bottom: 14px; }
.exam-card h3 { font-size: 18px; font-weight: 800; color: var(--dark); margin-bottom: 6px; }
.exam-card p { font-size: 13px; color: var(--gray); }

/* ========== STEPS ========== */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 32px; }
.step { text-align: center; position: relative; }
.step-num {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(79,70,229,0.25);
}
.step h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; color: var(--dark); }
.step p { font-size: 14px; color: var(--gray); line-height: 1.6; }

/* ========== CTA ========== */
.cta-section {
  background: linear-gradient(135deg, var(--dark), #1E1B4B, var(--dark-2));
  color: white; text-align: center; padding: 100px 24px;
  position: relative; overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(79,70,229,0.2) 0%, transparent 50%),
              radial-gradient(circle at 80% 50%, rgba(212,175,55,0.1) 0%, transparent 50%);
}
.cta-section h2 { font-size: 38px; font-weight: 800; margin-bottom: 16px; letter-spacing: -1px; position: relative; }
.cta-section p { font-size: 17px; color: rgba(255,255,255,0.7); max-width: 500px; margin: 0 auto 32px; position: relative; }

/* ========== FOOTER ========== */
.footer {
  background: var(--dark); color: rgba(255,255,255,0.6);
  padding: 56px 24px 24px;
}
.footer-inner {
  max-width: 1300px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 40px;
}
.footer-col h4 { color: white; font-weight: 700; margin-bottom: 18px; font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; }
.footer-col a, .footer-col p { font-size: 14px; color: rgba(255,255,255,0.5); display: block; margin-bottom: 10px; transition: var(--transition-fast); }
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  max-width: 1300px; margin: 40px auto 0; padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center; font-size: 13px; color: rgba(255,255,255,0.3);
}

/* ========== AUTH ========== */
.auth-container {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #EEF2FF 0%, #F5F3FF 50%, #FEF2F2 100%);
  background-size: 400% 400%;
  animation: gradient-shift 15s ease infinite;
  position: relative;
}
.auth-container::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%234F46E5' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.auth-card {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 44px;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255,255,255,0.5);
  position: relative;
  animation: scaleIn 0.5s ease-out;
}
.auth-card h1 { font-size: 30px; font-weight: 800; color: var(--dark); margin-bottom: 8px; text-align: center; letter-spacing: -1px; }
.auth-card .subtitle { text-align: center; color: var(--gray); margin-bottom: 32px; font-size: 14px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; font-size: 13px; color: var(--dark-2); margin-bottom: 8px; }
.form-input {
  width: 100%; padding: 12px 16px;
  border: 2px solid #E2E8F0; border-radius: var(--radius-sm);
  font-size: 15px; font-family: var(--font-primary);
  transition: all var(--transition-fast); background: var(--gray-bg);
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,70,229,0.1); background: var(--white); }
.auth-error { background: var(--danger-light); color: var(--danger); padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; margin-bottom: 20px; text-align: center; }
.auth-success { background: var(--success-light); color: #166534; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; margin-bottom: 20px; text-align: center; }
.auth-warning { background: var(--warning-light); color: #92400E; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; margin-bottom: 18px; text-align: center; }
.auth-dev-link { background: #fff7ed; color: #9a3412; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 12px; line-height: 1.5; margin-bottom: 18px; overflow-wrap: anywhere; }
.auth-dev-link a { color: #7c2d12; font-weight: 700; }
.auth-dev-title { color: #7c2d12; font-size: 12px; font-weight: 800; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.auth-link-button { width: 100%; justify-content: center; margin-top: 12px; color: #fff !important; }
.auth-links-row { display: flex; justify-content: flex-end; margin-top: 12px; font-size: 13px; }
.auth-links-row a { color: var(--primary); font-weight: 700; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--gray); font-size: 12px; font-weight: 700; margin: 22px 0; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #E2E8F0; }
.btn-google { border: 1px solid #CBD5E1; background: #fff; color: var(--dark); box-shadow: var(--shadow-sm); }
.btn-google:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.google-mark { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #2563eb; background: #eff6ff; }
.auth-footer { text-align: center; margin-top: 24px; font-size: 14px; color: var(--gray); }
.auth-footer a { color: var(--primary); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ========== DASHBOARD LAYOUT ========== */
.dashboard { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  width: 280px; background: var(--white);
  border-right: 1px solid rgba(0,0,0,0.06);
  padding: 24px 16px;
  position: fixed; top: 0; left: 0; bottom: 0;
  overflow-y: auto; z-index: 100;
  display: flex; flex-direction: column;
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; padding: 0 8px 24px; letter-spacing: -0.5px; }
.sidebar-logo .logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: white; font-size: 14px; font-weight: 800;
  box-shadow: 0 4px 10px rgba(79,70,229,0.3);
}
.sidebar-nav { list-style: none; flex: 1; }
.sidebar-nav li { margin-bottom: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-weight: 500; font-size: 14px; color: var(--gray);
  transition: all var(--transition-fast);
}
.sidebar-nav a:hover, .sidebar-nav a.active { background: var(--primary-light); color: var(--primary); }
.sidebar-nav a .nav-icon { font-size: 18px; width: 22px; text-align: center; }
.sidebar-nav .nav-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--gray-light, #94a3b8); padding: 16px 12px 6px; display: block; cursor: default;
  border-top: 1px solid rgba(0,0,0,0.05); margin-top: 6px;
}
.sidebar-nav .nav-section-label:first-child { border-top: none; margin-top: 0; }
.sidebar-user { padding-top: 20px; border-top: 1px solid rgba(0,0,0,0.05); }
.sidebar-user .user-info { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sidebar-user .avatar {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 14px;
}
.sidebar-user .user-name { font-weight: 600; font-size: 14px; color: var(--dark); }
.sidebar-user .user-email { font-size: 12px; color: var(--gray); }
.token-display {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 14px; color: #92400E; margin-bottom: 10px;
}
.main-content { flex: 1; width: calc(100% - 280px); max-width: 100%; margin-left: 280px; padding: 36px 40px; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; overflow-x: clip; }
.main-content-full { flex: 1; width: 100%; max-width: 100%; padding: 36px 40px; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; overflow-x: clip; }
.page-header { margin-bottom: 36px; }
.page-header h1 { font-size: 28px; font-weight: 800; color: var(--dark); margin-bottom: 8px; letter-spacing: -0.8px; }
.page-header p { color: var(--gray); font-size: 15px; }

/* ========== STATS ROW ========== */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 20px; margin-bottom: 36px; }
.stat-card {
  background: var(--white); border-radius: var(--radius); padding: 22px 24px;
  border: 1px solid rgba(0,0,0,0.04); box-shadow: var(--shadow-sm);
  transition: all var(--transition); position: relative; overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card::after { content: ''; position: absolute; top: -20px; right: -20px; width: 80px; height: 80px; border-radius: 50%; background: var(--primary-light); opacity: 0.3; }
.stat-card .stat-label { font-size: 12px; color: var(--gray); margin-bottom: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .stat-value { font-size: 30px; font-weight: 800; color: var(--dark); letter-spacing: -1px; }

/* ========== MOCK TEST INTERFACE ========== */
.mock-screen { display: flex; flex-direction: column; height: 100vh; height: 100dvh; background: var(--gray-bg); }
.mock-topbar {
  height: 60px; background: #1a1a2e; color: white;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; border-bottom: 2px solid rgba(212,175,55,.3);
  flex-shrink: 0; box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.mock-topbar .mock-title {
  font-weight: 800; font-size: .9rem; color: var(--gold);
  text-transform: uppercase; letter-spacing: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 250px;
}
.mock-topbar .topbar-right { display: flex; align-items: center; gap: 10px; }
.lang-pill-group { display: flex; align-items: center; gap: 0; background: rgba(255,255,255,.08); border-radius: 10px; padding: 3px; border: 1px solid rgba(255,255,255,.1); }
.lang-pill {
  border: none; padding: 4px 10px; border-radius: 8px; font-size: .7rem;
  font-weight: 600; cursor: pointer; color: rgba(255,255,255,.55);
  background: transparent; transition: all .25s var(--transition-bounce);
  letter-spacing: .3px;
}
.lang-pill:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.08); }
.lang-pill.active { background: linear-gradient(135deg,rgba(255,255,255,.22),rgba(255,255,255,.1)); color: #fff; font-weight: 700; box-shadow: 0 0 12px rgba(255,255,255,.15); }
.timer-display {
  font-family: var(--font-mono); font-weight: 700; font-size: 1.1rem;
  background: rgba(0,0,0,.4); padding: 6px 14px; border-radius: 8px;
  color: #e6c27a; border: 1px solid rgba(212,175,55,.25);
  min-width: 72px; text-align: center; letter-spacing: 1px; transition: all .3s;
}
.timer-display.warning { background: var(--warning); color: white; animation: countdown-pulse 0.5s infinite; }
.timer-display.danger { background: var(--danger); color: white; animation: countdown-pulse 0.3s infinite; }

.mock-content { display: flex; flex: 1; overflow: hidden; }
.question-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.question-container {
  flex: 1; overflow-y: auto; padding: 20px;
  background: var(--white); margin: 12px;
  border-radius: var(--radius); border: 1px solid rgba(0,0,0,0.04);
  box-shadow: var(--shadow-sm);
}
.question-text { font-size: 1.1rem; font-weight: 700; line-height: 1.65; margin-bottom: 20px; color: var(--dark); }

.option-btn {
  display: block; width: 100%; text-align: left;
  padding: 14px 18px; margin: 8px 0;
  border: 2px solid #E2E8F0; border-radius: var(--radius-sm);
  background: var(--white); cursor: pointer;
  font-size: .95rem; font-weight: 500; font-family: var(--font-primary);
  transition: all .18s var(--transition-bounce);
  box-shadow: 0 2px 8px rgba(0,0,0,.03);
}
.option-btn:hover { border-color: var(--primary); background: rgba(79,70,229,.04); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(79,70,229,0.15); }
.option-btn.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 600; box-shadow: 0 4px 16px rgba(79,70,229,0.2); }

.bottom-bar {
  height: 65px; background: var(--white);
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 0 12px; flex-shrink: 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,.06);
}
.btn-review { background: #EDE9FE; color: #6D28D9; }
.btn-review:hover { background: #DDD6FE; }
.btn-clear { background: #F1F5F9; color: var(--gray); }
.btn-clear:hover { background: #E2E8F0; }

/* Palette Panel */
.palette-panel {
  width: 280px; background: var(--white);
  border-left: 1px solid rgba(0,0,0,0.06);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  box-shadow: -4px 0 24px rgba(0,0,0,.06);
}
.palette-stats {
  padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  font-size: .7rem; font-weight: 600;
  background: linear-gradient(180deg, var(--white), rgba(0,0,0,.02));
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.palette-stats div { display: flex; align-items: center; gap: 4px; }
.palette-stats .stat-dot {
  width: 20px; height: 20px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 800;
}
.stat-dot.answered { background: #22c55e; color: white; }
.stat-dot.not-answered { background: #ef4444; color: white; }
.stat-dot.marked { background: #8b5cf6; color: white; border-radius: 50%; }
.stat-dot.not-visited { background: var(--gray-bg2); color: var(--gray); border: 2px solid #E2E8F0; }

.palette-section {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: white; padding: 10px 14px;
  font-weight: 700; font-size: .78rem;
  text-transform: uppercase; letter-spacing: 1.5px;
}
.palette-grid {
  flex: 1; overflow-y: auto; padding: 14px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-content: start;
}
.palette-btn {
  aspect-ratio: 1; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .78rem;
  cursor: pointer; border: none;
  transition: all .18s var(--transition-bounce);
  position: relative; font-family: var(--font-primary);
}
.palette-btn:hover { transform: scale(1.1); box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.palette-btn.current { border: 3px solid var(--primary) !important; box-shadow: 0 0 0 4px rgba(79,70,229,0.2) !important; transform: scale(1.05); }
.palette-btn.btn-answered { background: #22c55e; color: white; }
.palette-btn.btn-not-answered { background: #ef4444; color: white; }
.palette-btn.btn-marked { background: #8b5cf6; color: white; border-radius: 50% !important; }
.palette-btn.btn-not-visited { background: var(--gray-bg2); color: var(--gray); border: 2px solid #E2E8F0; }

/* ========== RESULT DETAIL ========== */
.result-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 20px; margin-bottom: 36px;
}
.result-box {
  background: var(--white); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm); text-align: center;
  border: 1px solid rgba(0,0,0,0.04);
}
.result-box .label { font-size: 11px; color: var(--gray); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.result-box .value { font-size: 30px; font-weight: 800; color: var(--dark); margin-top: 6px; letter-spacing: -1px; }
.result-box.highlight { background: linear-gradient(135deg, #EEF2FF, #F5F3FF); border-color: var(--primary); }
.result-box.gold { background: linear-gradient(135deg, #FFF8E7, #FEF3C7); border-color: var(--gold); }

.result-section {
  background: var(--white); border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(0,0,0,0.04);
  margin-bottom: 24px;
}
.result-section h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; color: var(--dark); display: flex; align-items: center; gap: 8px; }

.review-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin-bottom: 20px; }
.review-dot {
  aspect-ratio: 1; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .72rem;
  cursor: pointer; border: none;
  transition: all .2s; box-shadow: 0 2px 8px rgba(0,0,0,.08);
  font-family: var(--font-primary);
}
.review-dot:hover { transform: scale(1.12); box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.review-dot.correct { background: #22c55e; color: white; }
.review-dot.wrong { background: #ef4444; color: white; }
.review-dot.skipped { background: #F1F5F9; color: var(--gray); border: 2px solid #E2E8F0; }

.explanation-box {
  margin: 16px 0; padding: 14px 18px;
  background: linear-gradient(135deg, rgba(79,70,229,.04), rgba(79,70,229,.01));
  border-left: 4px solid var(--primary); border-radius: var(--radius-xs);
  font-size: .88rem; line-height: 1.65; color: #334155;
  overflow-x: auto;
}
.explanation-box img, .question-text img { max-width: 100%; height: auto; border-radius: 8px; }
.explanation-box table, .question-text table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: .85rem; }
.explanation-box td, .explanation-box th, .question-text td, .question-text th { padding: 6px 10px; border: 1px solid #E2E8F0; text-align: left; }

/* ========== AI ANALYSIS ========== */
.analysis-hero {
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
  color: white; text-align: center;
  padding: 60px 24px; border-radius: var(--radius-lg);
  margin-bottom: 30px; position: relative; overflow: hidden;
}
.analysis-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(79,70,229,0.2), transparent 60%),
              radial-gradient(circle at 70% 50%, rgba(212,175,55,0.1), transparent 60%);
}
.analysis-hero h1 { font-size: 32px; font-weight: 800; margin-bottom: 12px; position: relative; }
.analysis-hero p { color: rgba(255,255,255,0.7); font-size: 15px; position: relative; }

.analysis-card {
  background: var(--white); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04); margin-bottom: 20px;
}
.analysis-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: var(--dark); }
.analysis-card .section-bar { margin-bottom: 14px; }
.analysis-card .section-bar .bar-label { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.analysis-card .section-bar .bar-track { height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden; }
.analysis-card .section-bar .bar-fill { height: 100%; border-radius: 5px; transition: width 1s var(--transition-bounce); }
.bar-fill.strong { background: var(--success); }
.bar-fill.moderate { background: var(--warning); }
.bar-fill.weak { background: var(--danger); }

.weak-topic-tag {
  display: inline-block;
  padding: 6px 16px; border-radius: 100px;
  background: var(--danger-light); color: var(--danger);
  font-size: 13px; font-weight: 600;
  margin: 0 8px 8px 0;
}
.suggestion-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #F1F5F9;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 14px;
}
.suggestion-icon.info { background: var(--primary-light); color: var(--primary); }
.suggestion-icon.warn { background: var(--warning-light); color: var(--warning); }
.suggestion-icon.success { background: var(--success-light); color: var(--success); }

/* ========== RANK PREDICTOR ========== */
.rank-predictor-form {
  background: var(--white); border-radius: var(--radius); padding: 32px;
  box-shadow: var(--shadow-md); border: 1px solid rgba(0,0,0,0.04);
  max-width: 600px; margin: 0 auto;
}
.rank-result {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: white; border-radius: var(--radius-lg);
  padding: 40px 24px; text-align: center; margin-top: 24px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.5s ease-out;
}
.rank-result .predicted-rank {
  font-size: 56px; font-weight: 900;
  background: linear-gradient(135deg, var(--gold), #fbbf24);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.rank-result .qualified { color: #22c55e; font-weight: 700; }
.rank-result .not-qualified { color: #ef4444; font-weight: 700; }

/* ========== TEST SERIES ========== */
.series-card {
  background: var(--white); border-radius: var(--radius); padding: 28px;
  border: 1px solid rgba(0,0,0,0.04); box-shadow: var(--shadow-sm);
  transition: all var(--transition); margin-bottom: 20px;
}
.series-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.series-card .series-badge {
  display: inline-block;
  padding: 6px 16px; border-radius: 100px;
  font-weight: 700; font-size: 12px;
  background: var(--gold-light); color: var(--gold-dark);
  margin-bottom: 12px;
}
.series-card h3 { font-size: 22px; font-weight: 800; margin-bottom: 8px; color: var(--dark); }
.series-card p { color: var(--gray); margin-bottom: 16px; }
.series-features { display: flex; flex-wrap: wrap; gap: 10px; }
.series-feature {
  padding: 6px 14px; border-radius: 100px;
  background: var(--primary-light); color: var(--primary);
  font-size: 12px; font-weight: 600;
}

/* ========== SHARE SECTION ========== */
.share-section {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-radius: var(--radius); padding: 28px; text-align: center;
  margin: 20px 0;
  border: 1px solid rgba(233,69,96,.3);
  box-shadow: 0 4px 24px rgba(233,69,96,.15);
}
.share-section .share-title { color: white; font-weight: 700; font-size: 1rem; margin-bottom: 8px; }
.share-section .share-sub { color: rgba(255,255,255,.6); font-size: .78rem; margin-bottom: 16px; }
.share-btn {
  background: linear-gradient(135deg, #e94560, #c0392b);
  color: white; padding: 12px 28px; border-radius: 25px;
  font-weight: 700; font-size: .9rem;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all .25s; margin: 0 6px 8px;
  box-shadow: 0 4px 16px rgba(233,69,96,.35);
}
.share-btn:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 8px 28px rgba(233,69,96,.5); }
.share-btn.whatsapp { background: linear-gradient(135deg, #25d366, #128c7e); box-shadow: 0 4px 16px rgba(37,211,102,.35); }

/* ========== ADMIN PANEL ========== */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 20px; margin-bottom: 36px; }
.admin-stat {
  background: var(--white); border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow-sm); text-align: center;
  border: 1px solid rgba(0,0,0,0.04); transition: all var(--transition);
}
.admin-stat:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.admin-stat .value { font-size: 40px; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.admin-stat .label { font-size: 13px; color: var(--gray); margin-top: 6px; font-weight: 500; }

.admin-tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-tab {
  padding: 10px 20px; border-radius: 100px;
  font-weight: 600; font-size: 13px; cursor: pointer;
  border: 2px solid #E2E8F0; background: var(--white);
  transition: all var(--transition-fast); font-family: var(--font-primary);
}
.admin-tab:hover { border-color: var(--primary); color: var(--primary); }
.admin-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

.upload-section, .admin-section {
  background: var(--white); border-radius: var(--radius); padding: 32px;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(0,0,0,0.04);
  margin-bottom: 28px;
}
.upload-section h3, .admin-section h3 { font-size: 20px; font-weight: 700; margin-bottom: 24px; color: var(--dark); letter-spacing: -0.5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-textarea {
  width: 100%; padding: 14px 18px;
  border: 2px solid #E2E8F0; border-radius: var(--radius-sm);
  font-size: 13px; font-family: var(--font-mono);
  resize: vertical; min-height: 200px;
  background: var(--gray-bg); transition: all var(--transition-fast);
}
.form-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,70,229,0.1); }

/* ========== TOAST ========== */
.toast {
  position: fixed; bottom: 30px; right: 30px;
  background: var(--dark); color: white;
  padding: 16px 28px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px;
  z-index: 9999;
  opacity: 0; transform: translateY(10px);
  transition: all var(--transition);
  box-shadow: var(--shadow-xl);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ========== MODAL ========== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.85);
  z-index: 9999;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.show { display: flex; }
.modal-content {
  background: var(--white); border-radius: 20px; padding: 32px;
  max-width: 420px; width: 90%; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  animation: scaleIn 0.3s ease-out;
}
.modal-content h3 { font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; }
.modal-content p { color: var(--gray); font-size: .9rem; margin-bottom: 20px; }

.ad-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center; justify-content: center;
}
.ad-modal.show { display: flex; }
.ad-modal-content {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 40px; max-width: 460px; width: 90%;
  text-align: center; box-shadow: var(--shadow-xl);
}
.ad-timer { font-size: 56px; font-weight: 900; color: var(--primary); margin: 20px 0; }
.ad-progress { width: 100%; height: 8px; background: #E2E8F0; border-radius: 4px; margin: 20px 0; overflow: hidden; }
.ad-progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 4px; transition: width 1s linear; width: 0%; }

/* ========== COPY LINK INPUT ========== */
.copy-link-input {
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-xs);
  padding: 8px 12px; font-size: 12px;
  width: 220px; font-family: var(--font-mono);
  cursor: copy; background: #F8FAFC;
  transition: all var(--transition-fast);
}
.copy-link-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79,70,229,0.1); }

/* ========== EMPTY STATE ========== */
.empty-state { text-align: center; padding: 80px 24px; color: var(--gray); }
.empty-state .icon { font-size: 56px; margin-bottom: 20px; }
.empty-state h3 { font-size: 20px; font-weight: 700; color: var(--dark); margin-bottom: 8px; }
.empty-state p { font-size: 15px; }

/* ========== LOADING ========== */
.loading-spinner {
  width: 22px; height: 22px;
  border: 3px solid #E2E8F0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin-slow 0.6s linear infinite;
  display: inline-block;
}

/* ========== RESULTS TABLE ========== */
.results-table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid rgba(0,0,0,0.04); }
.results-table { width: 100%; border-collapse: collapse; }
.results-table th { background: #F8FAFC; padding: 14px 18px; text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--gray); border-bottom: 1px solid #E2E8F0; }
.results-table td { padding: 14px 18px; font-size: 14px; border-bottom: 1px solid #F1F5F9; }
.results-table tr:hover td { background: #F8FAFC; }
.score-badge { padding: 4px 12px; border-radius: 100px; font-weight: 700; font-size: 13px; }
.score-high { background: var(--success-light); color: var(--success); }
.score-mid { background: var(--warning-light); color: var(--warning); }
.score-low { background: var(--danger-light); color: var(--danger); }

/* ========== GRADIENT ORB ========== */
.gradient-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.15; pointer-events: none;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .palette-panel { width: 250px; }
  .palette-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { width: 100%; height: auto; position: relative; padding: 16px; flex-direction: row; flex-wrap: wrap; }
  .sidebar-nav { display: flex; gap: 4px; flex-wrap: wrap; }
  .sidebar-nav li { margin: 0; }
  .sidebar-user { width: 100%; }
  .main-content { margin-left: 0; padding: 16px; }
  .main-content, .main-content-full { width: 100%; max-width: 100%; }
  .dashboard { flex-direction: column; }
  .hero-stats { gap: 24px; flex-wrap: wrap; }
  .hero-stat::after { display: none; }
  .hero-stat .num { font-size: 24px; }
  .hero h1 { font-size: 28px; }
  .nav-links { flex-wrap: wrap; }
  .form-row { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .section-header h2 { font-size: 24px; }
  .mock-content { flex-direction: column; }
  .palette-panel { position: fixed; right: 0; top: 60px; bottom: 0; width: 85vw; max-width: 300px; z-index: 400; transform: translateX(100%); transition: transform .3s var(--transition-bounce); }
  .palette-panel.open { transform: translateX(0); }
  .review-grid { grid-template-columns: repeat(5, 1fr); }
  .cards-grid { grid-template-columns: 1fr; }
  .admin-tabs { flex-direction: column; }
}

@media (max-width: 380px) {
  .mock-topbar { padding: 8px; gap: 4px; }
  .mock-topbar .mock-title { font-size: .65rem; max-width: 100px; }
  .timer-display { font-size: .8rem; min-width: 50px; padding: 4px 8px; }
  .bottom-bar { gap: 4px; padding: 8px 4px; }
  .bottom-bar button { padding: 10px 8px; font-size: .7rem; }
}

/* ========== FOCUS GLOW ========== */
.focus-glow:focus { box-shadow: 0 0 0 4px rgba(79,70,229,0.12), 0 0 20px rgba(79,70,229,0.08); border-color: var(--primary); }

/* ========== CONFETTI ANIMATION ========== */
.confetti-container { position: fixed; inset: 0; pointer-events: none; z-index: 99999; overflow: hidden; }
.confetti-piece {
  position: absolute; top: -10%;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ========== COUNTDOWN OVERLAY ========== */
.countdown-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.96);
  z-index: 9990; display: none; flex-direction: column;
  align-items: center; justify-content: center; color: #fff;
}
.countdown-overlay.show { display: flex; }
.countdown-number {
  font-size: 10rem; font-weight: 900; font-family: var(--font-mono);
  animation: countdown-pop 0.7s ease-out;
}
@keyframes countdown-pop {
  0% { transform: scale(2); opacity: 0; }
  60% { transform: scale(0.95); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ========== SKELETON LOADING ========== */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}
.skeleton-text { height: 16px; margin-bottom: 8px; }
.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }
.skeleton-card { height: 200px; border-radius: var(--radius); }
.skeleton-circle { width: 80px; height: 80px; border-radius: 50%; }

/* ========== PROGRESS RING ========== */
.progress-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring .ring-bg { fill: none; stroke: #E2E8F0; stroke-width: 8; }
.progress-ring .ring-fill { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s var(--transition-bounce); }
.progress-ring .ring-text {
  position: absolute; font-weight: 800; font-size: 1.5rem;
  color: var(--dark); letter-spacing: -1px;
}

/* ========== SECTION NAV IN MOCK TEST ========== */
.section-nav { display: flex; gap: 6px; padding: 8px 12px; background: var(--gray-bg); border-bottom: 1px solid rgba(0,0,0,.04); flex-wrap: wrap; }
.section-nav-btn {
  padding: 4px 12px; border-radius: 100px; font-size: .7rem; font-weight: 600;
  border: 1px solid #E2E8F0; background: var(--white); cursor: pointer;
  transition: all var(--transition-fast); font-family: var(--font-primary);
}
.section-nav-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.section-nav-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ========== KEYBOARD SHORTCUTS PANEL ========== */
.shortcuts-panel {
  display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: var(--white); border-radius: var(--radius-lg); padding: 28px 32px;
  box-shadow: var(--shadow-xl); z-index: 5000; max-width: 420px; width: 90%;
  border: 1px solid rgba(0,0,0,.04);
}
.shortcuts-panel.show { display: block; animation: scaleIn 0.3s ease-out; }
.shortcuts-panel h3 { margin-bottom: 16px; font-weight: 800; font-size: 1.1rem; }
.shortcuts-panel .kbd-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #F1F5F9; font-size: .85rem; }
.shortcuts-panel .kbd-key { background: var(--gray-bg2); padding: 2px 10px; border-radius: 4px; font-family: var(--font-mono); font-size: .75rem; font-weight: 700; border: 1px solid #E2E8F0; }
.shortcuts-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 4999; }
.shortcuts-overlay.show { display: block; }

/* ========== HEATMAP ========== */
.heatmap-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.heatmap-cell {
  aspect-ratio: 1; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .65rem; cursor: pointer; position: relative;
  transition: transform .15s;
}
.heatmap-cell:hover { transform: scale(1.15); z-index: 2; }
.heatmap-cell.green { background: #22c55e; color: #fff; }
.heatmap-cell.red { background: #ef4444; color: #fff; }
.heatmap-cell.yellow { background: #eab308; color: #fff; }
.heatmap-cell.gray { background: #e2e8f0; color: #94a3b8; }
.heatmap-cell.green-light { background: #dcfce7; color: #16a34a; }
.heatmap-cell.red-light { background: #fef2f2; color: #dc2626; }

/* ========== RADAR CHART (CSS) ========== */
.radar-chart { position: relative; width: 100%; max-width: 400px; margin: 0 auto; aspect-ratio: 1; }
.radar-chart svg { width: 100%; height: 100%; }
.radar-bg-polygon { fill: rgba(79,70,229,.04); stroke: #E2E8F0; stroke-width: 1; }
.radar-data-polygon { fill: rgba(79,70,229,.15); stroke: var(--primary); stroke-width: 2; }
.radar-axis { stroke: #E2E8F0; stroke-width: 1; stroke-dasharray: 4,4; }
.radar-label { font-size: .65rem; font-weight: 600; fill: var(--gray); text-anchor: middle; }

/* ========== STREAK BADGE ========== */
.streak-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  padding: 8px 16px; border-radius: 100px;
  font-weight: 700; font-size: .85rem; color: #92400e;
  box-shadow: 0 2px 10px rgba(245,158,11,.3);
  animation: pulse-gold 2s ease-in-out infinite;
}

/* ========== ACTIVITY GRAPH ========== */
.activity-graph { display: flex; gap: 4px; flex-wrap: wrap; }
.activity-day {
  width: 14px; height: 14px; border-radius: 3px;
  background: #e2e8f0;
  transition: transform .15s;
}
.activity-day:hover { transform: scale(1.3); }
.activity-day.level-1 { background: #c7d2fe; }
.activity-day.level-2 { background: #818cf8; }
.activity-day.level-3 { background: #4f46e5; }
.activity-day.level-4 { background: #3730a3; }

/* ========== MARQUEE ========== */
.marquee-section { overflow: hidden; padding: 30px 0; background: var(--gray-bg); }
.marquee-track { display: flex; gap: 30px; animation: marquee 30s linear infinite; width: max-content; }
.marquee-track:hover { animation-play-state: paused; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.marquee-item {
  background: var(--white); border-radius: var(--radius); padding: 16px 20px;
  box-shadow: var(--shadow-sm); min-width: 220px; flex-shrink: 0;
}
.marquee-item .score { font-size: 1.3rem; font-weight: 800; color: var(--primary); }

/* ========== FLOATING ACTION BUTTON ========== */
.fab {
  position: fixed; bottom: 30px; right: 30px; width: 56px; height: 56px;
  border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; box-shadow: 0 8px 24px rgba(79,70,229,.4);
  cursor: pointer; border: none; z-index: 500; transition: all var(--transition-bounce);
  animation: pulse-glow 2s ease-in-out infinite;
}
.fab:hover { transform: scale(1.1); box-shadow: 0 12px 32px rgba(79,70,229,.5); }

/* ========== TIMELINE ========== */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: #E2E8F0; }
.timeline-item { position: relative; padding-bottom: 24px; }
.timeline-item::before { content: ''; position: absolute; left: -22px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--primary); }

/* ========== DIFFICULTY TAGS ========== */
.diff-tag { padding: 3px 10px; border-radius: 100px; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.diff-tag.easy { background: #dcfce7; color: #16a34a; }
.diff-tag.medium { background: #fef3c7; color: #b45309; }
.diff-tag.hard { background: #fee2e2; color: #dc2626; }

/* ========== TOOLTIP ========== */
.tooltip-wrapper { position: relative; display: inline-block; }
.tooltip-text {
  visibility: hidden; opacity: 0; position: absolute;
  bottom: 120%; left: 50%; transform: translateX(-50%);
  background: var(--dark); color: #fff; padding: 6px 12px;
  border-radius: 6px; font-size: .75rem; font-weight: 500;
  white-space: nowrap; transition: all .2s; pointer-events: none;
  z-index: 999;
}
.tooltip-wrapper:hover .tooltip-text { visibility: visible; opacity: 1; }

/* ========== PULSE DOT ========== */
.pulse-dot {
  width: 10px; height: 10px; border-radius: 50%; background: #22c55e;
  display: inline-block; position: relative;
}
.pulse-dot::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  background: rgba(34,197,94,.3); animation: pulse-ring 1.5s ease-out infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ========== GLASS MODAL BACKDROP ========== */
.glass-backdrop {
  background: rgba(15,23,42,.7); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ============================================
   ENHANCEMENTS: Mock Page, Results, Test Series
   ============================================ */

/* ========== MOCK HERO BANNER ========== */
.mock-hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #1E1B4B 70%, #0f3460 100%);
  border-radius: var(--radius-lg);
  padding: 56px 40px;
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.mock-hero::before {
  content: '';
  position: absolute;
  top: -150px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(79,70,229,0.2) 0%, transparent 70%);
  border-radius: 50%;
}
.mock-hero::after {
  content: '';
  position: absolute;
  bottom: -100px; left: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(212,175,55,0.12) 0%, transparent 70%);
  border-radius: 50%;
}
.mock-hero-badge {
  display: inline-block;
  background: rgba(79,70,229,0.2);
  color: #a5b4fc;
  padding: 8px 24px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 18px;
  border: 1px solid rgba(79,70,229,0.3);
  position: relative;
  z-index: 1;
}
.mock-hero h1 {
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 800;
  color: white;
  margin-bottom: 12px;
  letter-spacing: -1px;
  position: relative;
  z-index: 1;
  line-height: 1.25;
}
.mock-hero p {
  font-size: 15px;
  color: rgba(255,255,255,0.55);
  position: relative;
  z-index: 1;
}

/* ========== SAMPLE QUESTION CAROUSEL ========== */
.sample-carousel-wrap {
  display: none;
  margin-bottom: 28px;
  animation: fadeInUp 0.4s ease-out;
}
.sample-carousel-wrap.show { display: block; }
.sample-carousel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 20px;
}
.sample-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  position: relative;
}
.sample-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.sample-card .q-num {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 14px;
}
.sample-card .q-text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.65;
  margin-bottom: 16px;
  color: var(--dark);
}
.sample-card .q-text img { max-width: 100%; border-radius: 8px; }
.sample-option {
  padding: 10px 14px;
  margin-bottom: 6px;
  border: 1.5px solid #E2E8F0;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--dark-3);
  background: var(--gray-bg);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.5;
}
.sample-option .opt-letter {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #F1F5F9;
  color: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

/* ========== PREVIEW TOGGLE ========== */
.preview-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: 2px dashed var(--gray-lighter);
  border-radius: 100px;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--gray);
  font-family: var(--font-primary);
  transition: all var(--transition);
  margin-bottom: 20px;
}
.preview-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.preview-toggle .preview-icon {
  font-size: 18px;
  transition: transform var(--transition-bounce);
}
.preview-toggle.active .preview-icon { transform: rotate(180deg); }

/* ========== WHAT'S INCLUDED ========== */
.whats-included-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}
.whats-included-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--gray-bg);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0,0,0,0.04);
  transition: all var(--transition-fast);
}
.whats-included-item:hover { background: var(--primary-light); border-color: rgba(79,70,229,0.15); }
.whats-included-item .section-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--dark-2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.whats-included-item .section-count {
  font-weight: 800;
  font-size: 13px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 12px;
  border-radius: 100px;
}

/* ========== TOPPER SCORES ========== */
.topper-score-list {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.topper-score-card {
  background: linear-gradient(135deg, #FEF3C7, #FFF8E7);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: var(--radius);
  padding: 18px 24px;
  text-align: center;
  flex: 1;
  min-width: 120px;
  box-shadow: 0 2px 10px rgba(212,175,55,0.1);
}
.topper-score-card .topper-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--dark);
  margin-bottom: 4px;
}
.topper-score-card .topper-score {
  font-weight: 900;
  font-size: 26px;
  color: var(--gold-dark);
}
.topper-score-card .topper-date {
  font-size: 11px;
  color: var(--gray-light);
  margin-top: 4px;
}
.topper-empty {
  color: var(--gray);
  font-size: 14px;
  text-align: center;
  padding: 24px;
}

/* ========== GLOW BUTTON ========== */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(212,175,55,0.3), 0 0 24px rgba(212,175,55,0.15); }
  50% { box-shadow: 0 0 24px rgba(212,175,55,0.6), 0 0 48px rgba(212,175,55,0.3), 0 0 72px rgba(212,175,55,0.1); }
}
.btn-glow {
  animation: glowPulse 2s ease-in-out infinite;
}

/* ========== SERIES HERO ========== */
.series-hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 50%, #16213e 100%);
  border-radius: var(--radius-lg);
  padding: 52px 40px;
  margin-bottom: 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.series-hero::before {
  content: '';
  position: absolute;
  top: -120px; left: -80px;
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(79,70,229,0.18) 0%, transparent 70%);
  border-radius: 50%;
}
.series-hero::after {
  content: '';
  position: absolute;
  bottom: -100px; right: -60px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(34,197,94,0.1) 0%, transparent 70%);
  border-radius: 50%;
}
.series-hero h1 {
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 800;
  color: white;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  letter-spacing: -1px;
}
.series-hero p {
  font-size: 15px;
  color: rgba(255,255,255,0.55);
  position: relative;
  z-index: 1;
}

/* ========== SERIES PROGRESS ========== */
.series-progress { margin: 16px 0; }
.series-progress .progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray);
}
.series-progress .progress-label .completed { color: var(--success); }
.series-progress-bar {
  height: 8px;
  background: #F1F5F9;
  border-radius: 4px;
  overflow: hidden;
}
.series-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), #10B981);
  border-radius: 4px;
  transition: width 0.8s var(--transition-bounce);
}

/* ========== FEATURE TAGS WITH ICONS ========== */
.feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  margin: 4px;
}
.feature-tag .tag-icon { font-size: 14px; }
.feature-tag.free { background: var(--success-light); color: var(--success); }
.feature-tag.premium { background: var(--accent-light); color: var(--accent); }
.feature-tag.bilingual { background: var(--primary-light); color: var(--primary); }
.feature-tag.pdf { background: var(--danger-light); color: var(--danger); }
.feature-tag.analysis { background: var(--warning-light); color: var(--warning); }

/* ========== FILTER TABS ========== */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.filter-tab {
  padding: 8px 20px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 2px solid #E2E8F0;
  background: var(--white);
  transition: all var(--transition-fast);
  font-family: var(--font-primary);
  color: var(--gray);
}
.filter-tab:hover { border-color: var(--primary); color: var(--primary); }
.filter-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ========== PERCENTAGE BAR ========== */
.percent-bar-wrap {
  height: 6px;
  background: #F1F5F9;
  border-radius: 3px;
  margin-top: 6px;
  min-width: 80px;
  overflow: hidden;
}
.percent-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s var(--transition-bounce);
}
.percent-bar-fill.high { background: var(--success); }
.percent-bar-fill.mid { background: var(--warning); }
.percent-bar-fill.low { background: var(--danger); }

/* ========== ACCURACY BADGE ========== */
.accuracy-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 12px;
}
.accuracy-badge.good { background: var(--success-light); color: var(--success); }
.accuracy-badge.avg { background: var(--warning-light); color: var(--warning); }
.accuracy-badge.poor { background: var(--danger-light); color: var(--danger); }

/* ========== TIME ICON ========== */
.time-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--gray);
  font-weight: 500;
}

/* ========== SPARKLINE ========== */
.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 40px;
  margin-top: 10px;
}
.sparkline-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  transition: height 0.6s var(--transition-bounce);
  min-width: 8px;
  cursor: pointer;
  position: relative;
}
.sparkline-bar:hover { opacity: 0.85; filter: brightness(1.15); }

/* ========== CSV BUTTON ========== */
.btn-csv {
  background: var(--success);
  color: white;
  padding: 8px 18px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 13px;
  border: none;
  cursor: pointer;
  font-family: var(--font-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}
.btn-csv:hover { background: #047857; transform: translateY(-1px); }

/* ========== COMPARE ========== */
.compare-actions {
  display: none;
  background: var(--primary-light);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 12px 20px;
  margin-bottom: 16px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.compare-actions.show { display: flex; }
.compare-actions .selected-count {
  font-weight: 600;
  font-size: 14px;
  color: var(--primary);
}
.compare-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}
.compare-modal-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  text-align: left;
  max-width: 640px;
}
.compare-side {
  background: var(--gray-bg);
  border-radius: var(--radius-sm);
  padding: 20px;
}
.compare-side h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 14px;
  line-height: 1.3;
}
.compare-side .compare-stat {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 14px;
}
.compare-side .compare-stat .stat-label {
  color: var(--gray);
  font-weight: 500;
}
.compare-side .compare-stat .stat-value {
  font-weight: 700;
  color: var(--dark);
}
.compare-winner {
  color: var(--success);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 10px;
}

/* ========== MOBILE RESPONSIVE — Android Optimized ========== */

/* Prevent tap highlight on mobile */
* { -webkit-tap-highlight-color: transparent; }

/* Touch-friendly minimum tap targets */
button, .btn, a, .option-btn, .palette-btn, .word-chip, .nav-links a {
  min-height: 44px;
}
.btn-xs { min-height: 32px; padding: 6px 12px; }

/* Disable user selection on UI chrome (not content) */
.sidebar, .mock-topbar, .bottom-bar, .palette-panel, .navbar {
  -webkit-user-select: none;
  user-select: none;
}

@media (max-width: 768px) {
  /* ── General ── */
  .mock-hero { padding: 36px 20px; border-radius: var(--radius); }
  .mock-hero h1 { font-size: 22px; }
  .series-hero { padding: 32px 20px; border-radius: var(--radius); }
  .series-hero h1 { font-size: 20px; }
  .sample-carousel { grid-template-columns: 1fr; }
  .whats-included-list { grid-template-columns: 1fr; }
  .topper-score-list { flex-direction: column; }
  .compare-modal-content { grid-template-columns: 1fr; }
  .compare-actions { flex-direction: column; text-align: center; }
  .filter-tabs { gap: 4px; }
  .filter-tab { padding: 6px 12px; font-size: 11px; }
  .sparkline { height: 30px; }

  /* ── Dashboard Layout: Sidebar becomes a slide-in drawer ── */
  .dashboard { display: block; }

  .sidebar {
    position: fixed;
    left: -290px;
    top: 0; bottom: 0;
    width: 280px;
    z-index: 1000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }
  .sidebar.mobile-open { left: 0; }

  /* Sidebar backdrop */
  .sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
  }
  .sidebar-backdrop.show { display: block; }

  .main-content {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    padding: 16px;
    padding-top: calc(72px + var(--safe-top)); /* space for mobile top bar */
    padding-left: max(16px, var(--safe-left));
    padding-right: max(16px, var(--safe-right));
  }
  .main-content-full {
    width: 100%;
    max-width: 100%;
    padding: 16px;
    padding-left: max(16px, var(--safe-left));
    padding-right: max(16px, var(--safe-right));
  }

  /* ── Mobile Top Bar (hamburger) ── */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: calc(60px + var(--safe-top));
    background: white;
    border-bottom: 1px solid rgba(0,0,0,0.07);
    padding: var(--safe-top) max(16px, var(--safe-right)) 0 max(16px, var(--safe-left));
    z-index: 998;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  }
  .mobile-topbar .mob-logo {
    display: flex; align-items: center; gap: 8px;
    font-weight: 800; font-size: 18px; color: var(--dark);
  }
  .mobile-topbar .mob-logo .logo-icon {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    color: white; font-size: 13px; font-weight: 800;
  }
  .hamburger-btn {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: none; cursor: pointer;
    border-radius: 10px; transition: background 0.2s;
  }
  .hamburger-btn:hover { background: var(--gray-bg2); }
  .hamburger-btn span {
    display: block; width: 22px; height: 2px;
    background: var(--dark); border-radius: 2px;
    position: relative; transition: all 0.3s;
  }
  .hamburger-btn span::before,
  .hamburger-btn span::after {
    content: ''; position: absolute; left: 0;
    width: 22px; height: 2px;
    background: var(--dark); border-radius: 2px; transition: all 0.3s;
  }
  .hamburger-btn span::before { top: -7px; }
  .hamburger-btn span::after  { top: 7px; }

  /* ── Page Header ── */
  .page-header h1 { font-size: 22px; }
  .page-header { margin-bottom: 20px; }

  /* ── Stats Row ── */
  .stats-row { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
  .stat-card { padding: 16px; }
  .stat-card .stat-value { font-size: 22px; }

  /* ── Cards Grid ── */
  .cards-grid { grid-template-columns: 1fr; gap: 16px; }
  .exam-cards-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .features-grid { grid-template-columns: 1fr; gap: 16px; }

  /* ── Hero ── */
  .hero { padding: 60px 20px 50px; }
  .hero h1 { font-size: clamp(26px, 8vw, 40px); letter-spacing: -0.5px; }
  .hero p { font-size: 15px; }
  .hero-stats { gap: 24px; flex-wrap: wrap; margin-top: 36px; }
  .hero-stat .num { font-size: 24px; }
  .hero-buttons { gap: 10px; }
  .hero-stat::after { display: none; }

  /* ── Auth Card ── */
  .auth-card { padding: 28px 20px; }

  /* ── Mock Test Interface — Critical for mobile ── */
  .mock-screen { height: 100dvh; overflow: hidden; }

  .mock-topbar {
    padding: 0 10px;
    height: 52px;
    flex-wrap: nowrap;
    overflow: hidden;
  }
  .mock-topbar .mock-title { font-size: .72rem; max-width: 140px; }
  .timer-display { font-size: .9rem; padding: 4px 10px; min-width: 60px; }
  .lang-pill { padding: 3px 7px; font-size: .65rem; }

  .mock-content { flex-direction: column; overflow: hidden; }

  .question-area { flex: 1; min-height: 0; }
  .question-container { margin: 8px; padding: 14px; border-radius: var(--radius-sm); }
  .question-text { font-size: .95rem; margin-bottom: 14px; }
  .option-btn { padding: 12px 14px; font-size: .88rem; margin: 6px 0; }

  /* Palette panel becomes a slide-up drawer on mobile */
  .palette-panel {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    width: 100%;
    height: auto;
    max-height: 45vh;
    border-left: none;
    border-top: 2px solid rgba(0,0,0,0.08);
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 500;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
  }
  .palette-panel.mobile-visible { transform: translateY(0); }
  .palette-panel .palette-handle {
    width: 40px; height: 4px;
    background: var(--gray-lighter);
    border-radius: 2px;
    margin: 10px auto 0;
  }
  .palette-grid { grid-template-columns: repeat(8, 1fr); gap: 6px; padding: 10px 14px 80px; }
  .palette-btn { font-size: .7rem; border-radius: 8px; }

  .bottom-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    min-height: calc(60px + var(--safe-bottom)); z-index: 400;
    gap: 6px; padding: 0 max(8px, var(--safe-right)) var(--safe-bottom) max(8px, var(--safe-left));
    background: white;
    border-top: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  }
  .bottom-bar .btn { font-size: .78rem; padding: 8px 12px; }

  /* ── Tables ── */
  .results-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .vb-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* ── Forms (Admin) ── */
  .form-row { flex-direction: column; gap: 0; }
  .upload-section { padding: 16px; }

  /* ── Vocab Book Modal ── */
  .modal-box { max-width: 100%; margin: 10px; border-radius: 16px; }
  .modal-body { padding: 16px; }
  .quiz-opts { grid-template-columns: 1fr; }
  .card-scene { height: 260px; }
  .card-word-big { font-size: 1.7rem; }

  /* ── Result Detail ── */
  .result-summary { grid-template-columns: 1fr 1fr; gap: 12px; }
  .result-box { padding: 16px; }
  .result-box .value { font-size: 22px; }
  .review-grid { grid-template-columns: repeat(8, 1fr); gap: 4px; }

  /* ── Editorial ── */
  .editorial-header { padding: 20px; }
  .editorial-tabs { gap: 4px; }
  .editorial-tab { padding: 8px 12px; font-size: 12px; }
}

/* Extra small (phones ≤ 400px) */
@media (max-width: 400px) {
  .stats-row { grid-template-columns: 1fr; }
  .exam-cards-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 16px; }
  .palette-grid { grid-template-columns: repeat(6, 1fr); }
  .review-grid { grid-template-columns: repeat(6, 1fr); }
  .vocab-details { grid-template-columns: 1fr; }
  .btn { white-space: normal; justify-content: center; text-align: center; }
  .page-header h1 { font-size: 20px; }
  .main-content, .main-content-full { padding-left: 12px; padding-right: 12px; }
}

/* ── Prevent landscape overflow on phones ── */
@media (max-height: 500px) and (orientation: landscape) {
  .mock-topbar { height: 44px; }
  .question-container { padding: 10px; }
  .bottom-bar { height: 50px; }
}

/* ── Tablet (769px – 1024px) ── */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar { width: 220px; }
  .main-content { width: calc(100% - 220px); margin-left: 220px; padding: 24px; }
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .palette-grid { grid-template-columns: repeat(4, 1fr); }
  .mobile-topbar { display: none; }
}

/* ── Desktop only ── */
@media (min-width: 769px) {
  .mobile-topbar { display: none; }
  .sidebar-backdrop { display: none !important; }
}

/* ========== FINAL MOBILE HARDENING PASS ========== */
@media (max-width: 768px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    background: var(--gray-bg);
  }

  .navbar {
    position: sticky;
    top: 0;
  }

  .nav-inner {
    height: auto;
    min-height: 60px;
    padding: 10px max(14px, var(--safe-right)) 10px max(14px, var(--safe-left));
    gap: 10px;
    flex-wrap: wrap;
  }

  .nav-logo {
    font-size: 18px;
    min-width: 0;
  }

  .nav-links {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .nav-links li,
  .nav-links a {
    width: 100%;
  }

  .nav-links a {
    justify-content: center;
    text-align: center;
    padding: 10px 8px;
  }

  .section,
  .section-dark,
  #how-it-works.section {
    padding: 42px max(16px, var(--safe-right)) 42px max(16px, var(--safe-left)) !important;
  }

  .section-header {
    margin-bottom: 24px;
  }

  .section-header h2,
  .page-header h1 {
    font-size: clamp(20px, 6vw, 26px);
    line-height: 1.18;
    letter-spacing: 0;
  }

  .section-header p,
  .page-header p {
    font-size: 14px;
  }

  .hero {
    padding: 54px 16px 44px;
  }

  .hero-badge {
    max-width: 100%;
    white-space: normal;
    justify-content: center;
    text-align: center;
  }

  .hero-buttons,
  .hero-buttons .btn,
  .action-bar,
  .share-row,
  .ss-buttons,
  .result-actions,
  .profile-header-actions,
  .quick-actions,
  .export-bar,
  .bulk-actions-row,
  .ai-live-actions,
  .api-key-actions {
    align-items: stretch;
  }

  .hero-buttons .btn,
  .action-bar .btn,
  .action-bar .btn-download,
  .share-row .btn,
  .ss-buttons .ss-btn,
  .result-actions .btn,
  .profile-header-actions .btn,
  .quick-actions .btn,
  .export-bar .btn,
  .bulk-actions-row .btn,
  .ai-live-actions .btn,
  .api-key-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .main-content,
  .main-content-full {
    overflow-x: clip;
  }

  button,
  .btn {
    white-space: normal;
    justify-content: center;
    text-align: center;
  }

  .dashboard .main-content {
    padding-bottom: calc(28px + var(--safe-bottom));
  }

  .page-header,
  .section-header,
  .dashboard-header,
  .profile-header,
  .ai-header-row,
  .api-console-hero,
  .ed-card-header,
  .classic-header,
  .ai-panel-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-header,
  .profile-header,
  .card,
  .mock-card,
  .series-card,
  .result-section,
  .result-box,
  .analysis-card,
  .rank-predictor-form,
  .vocab-card,
  .ed-card,
  .progress-chart-section,
  .activity-graph-section,
  .goal-section,
  .performance-movement-section,
  .upload-section,
  .filter-panel,
  .editor-sidebar,
  .editor-panel,
  .modal-content,
  .modal-box {
    border-radius: 14px;
  }

  .card,
  .mock-card,
  .series-card,
  .result-section,
  .analysis-card,
  .rank-predictor-form,
  .vocab-card,
  .ed-card,
  .progress-chart-section,
  .activity-graph-section,
  .goal-section,
  .performance-movement-section,
  .upload-section,
  .editor-sidebar,
  .editor-panel {
    padding: 16px !important;
  }

  .stats-row,
  .dashboard-stats,
  .admin-grid,
  .movement-grid,
  .comparison-row,
  .two-col,
  .tips-grid,
  .profile-two-col,
  .mode-cards,
  .chart-grid,
  .ai-charts-grid,
  .ai-coach-grid,
  .mock-compare-charts,
  .mock-compare-panels,
  .lb-insight-cards,
  .lb-insight-panels,
  .api-console-grid,
  .api-env-vars,
  .api-key-list,
  .system-health,
  .stat-grid,
  .drill-summary-grid {
    grid-template-columns: 1fr !important;
  }

  .result-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .form-row,
  .filter-panel,
  .api-meta-grid {
    grid-template-columns: 1fr !important;
  }

  .toolbar,
  .table-search,
  .search-bar,
  .score-range-wrap,
  .filter-panel,
  .card-footer,
  .share-link-row,
  .fc-controls,
  .action-btns,
  .classic-stats,
  .history-card,
  .subject-move-row,
  .cutoff-row,
  .dist-row,
  .topic-risk-row {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .toolbar > *,
  .table-search > *,
  .search-bar > *,
  .score-range-wrap > *,
  .card-footer > *,
  .share-link-row > *,
  .fc-controls > *,
  .action-btns > *,
  .history-card > * {
    width: 100% !important;
    max-width: none !important;
  }

  .card-footer .btn,
  .search-bar button,
  .btn-vocab-book,
  .fc-btn,
  .btn-add,
  .btn-reject,
  .btn-retry,
  .quiz-next-btn,
  .quiz-restart-btn {
    justify-content: center;
    text-align: center;
  }

  .tab-pills,
  .filter-tabs,
  .leaderboard-tabs,
  .result-tabbar,
  .typing-tabs,
  .modal-tabs,
  .practice-tabs,
  .editorial-tabs,
  .lang-pills {
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tab-pills::-webkit-scrollbar,
  .filter-tabs::-webkit-scrollbar,
  .leaderboard-tabs::-webkit-scrollbar,
  .result-tabbar::-webkit-scrollbar,
  .typing-tabs::-webkit-scrollbar,
  .modal-tabs::-webkit-scrollbar,
  .practice-tabs::-webkit-scrollbar,
  .editorial-tabs::-webkit-scrollbar,
  .lang-pills::-webkit-scrollbar {
    display: none;
  }

  .tab-pill,
  .filter-tab,
  .lb-tab,
  .result-tab-btn,
  .typing-tab,
  .modal-tab,
  .p-tab,
  .editorial-tab,
  .lang-pill {
    flex: 0 0 auto;
  }

  .results-table-wrap,
  .cutoff-table-wrap,
  .vb-table-wrap,
  .result-section,
  .analysis-card,
  .modal-body,
  .question-review-detail,
  .explanation-box,
  #leaderboardSection,
  #mockComparisonSection,
  #topicMatrixSection {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .results-table,
  .leaderboard-tbl,
  .leaderboard-table,
  .topic-matrix,
  .section-compare-table,
  .cutoff-table,
  .vb-table,
  .word-detail-table,
  .answer-sheet-table {
    min-width: 640px;
  }

  .modal-overlay,
  .ad-modal {
    align-items: flex-start;
    padding: max(12px, var(--safe-top)) max(12px, var(--safe-right)) max(12px, var(--safe-bottom)) max(12px, var(--safe-left));
    overflow-y: auto;
  }

  .modal-content,
  .modal-box,
  .ad-modal-content,
  .compare-modal-content,
  .shortcuts-modal-body {
    width: 100%;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  .toast,
  .toast-container {
    max-width: calc(100vw - 24px);
  }

  .toast-container {
    left: 12px;
    right: 12px;
    top: calc(72px + var(--safe-top));
  }

  .toast {
    white-space: normal !important;
  }

  .vocab-word,
  .ed-reader-title,
  .profile-name,
  .rph h1,
  .lobby-hero h1,
  .analysis-hero h1,
  .card-title,
  .series-card h3 {
    overflow-wrap: anywhere;
  }

  .game-wrap {
    min-height: min(70dvh, 520px);
    border-radius: 14px;
  }

  .game-hud {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
    padding: 10px;
  }

  .game-hud > button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .game-arena {
    min-height: 280px;
  }

  .player-rocket {
    left: 24px;
    font-size: 38px;
  }

  .enemy-word {
    max-width: 44vw;
    white-space: normal;
    text-align: center;
  }

  .input-hint {
    display: none;
  }

  .classic-header {
    gap: 12px;
  }

  .classic-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .word-display {
    font-size: 1rem;
    line-height: 1.9;
    max-height: 220px;
  }
}

@media (max-width: 430px) {
  .nav-links,
  .stats-row,
  .dashboard-stats,
  .result-summary,
  .classic-stats,
  .game-hud {
    grid-template-columns: 1fr !important;
  }

  .mobile-topbar .mob-logo {
    font-size: 15px;
  }

  .mobile-topbar .mob-logo .logo-icon {
    width: 28px;
    height: 28px;
  }

  .card,
  .mock-card,
  .series-card,
  .result-section,
  .analysis-card,
  .rank-predictor-form,
  .vocab-card,
  .ed-card {
    padding: 14px !important;
  }

  .btn,
  .form-input,
  .form-textarea {
    font-size: 14px;
  }

  .hero h1 {
    font-size: clamp(26px, 10vw, 34px);
  }
}

/* ========== FINAL UI POLISH PASS ========== */
:root {
  --font-primary: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --surface: rgba(255,255,255,0.94);
  --surface-solid: #ffffff;
  --surface-muted: #F8FAFC;
  --border-soft: rgba(15,23,42,0.08);
  --border-strong: rgba(15,23,42,0.13);
  --focus-ring: rgba(79,70,229,0.22);
  --shadow-card: 0 10px 28px rgba(15,23,42,0.07);
  --shadow-card-hover: 0 18px 40px rgba(15,23,42,0.11);
  --radius-card: 12px;
  accent-color: var(--primary);
}

body {
  background:
    linear-gradient(180deg, #F8FAFC 0%, #EEF2F7 48%, #F8FAFC 100%);
}

h1, h2, h3, h4, h5, h6,
.nav-logo,
.sidebar-logo,
.card-title,
.series-card h3,
.stat-card .stat-value,
.page-header h1,
.section-header h2 {
  letter-spacing: 0;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.navbar,
.mobile-topbar {
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 6px 22px rgba(15,23,42,0.04);
}

.sidebar {
  background: rgba(255,255,255,0.94);
  border-right: 1px solid var(--border-soft);
  box-shadow: 8px 0 28px rgba(15,23,42,0.04);
}

.nav-logo .logo-icon,
.sidebar-logo .logo-icon,
.mobile-topbar .mob-logo .logo-icon {
  border-radius: 12px;
  background: linear-gradient(135deg, #4F46E5, #0891B2);
  box-shadow: 0 8px 20px rgba(79,70,229,0.24);
}

.nav-links a,
.sidebar-nav a {
  border-radius: 10px;
  font-weight: 700;
}

.nav-links a:hover,
.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: #EEF2FF;
  color: #4338CA;
}

.main-content,
.main-content-full {
  background: transparent;
}

.page-header {
  padding-bottom: 4px;
}

.page-header h1,
.section-header h2,
.hero h1 {
  line-height: 1.1;
}

.page-header p,
.section-header p,
.card-meta,
.series-card p,
.stat-card .stat-label {
  color: #64748B;
}

.card,
.stat-card,
.mock-card,
.series-card,
.result-section,
.result-box,
.analysis-card,
.rank-predictor-form,
.vocab-card,
.ed-card,
.your-rank-card,
.lb-insight-card,
.lb-insight-panel,
.mock-compare-card,
.mock-compare-panel,
.mock-compare-chart,
.ai-coach-card,
.ai-chart-card,
.ai-analysis-panel,
.progress-chart-section,
.activity-graph-section,
.goal-section,
.performance-movement-section,
.upload-section,
.filter-panel,
.editor-sidebar,
.editor-panel,
.auth-card,
.modal-content,
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.card:hover,
.mock-card:hover,
.series-card:hover,
.stat-card:hover,
.ed-card:hover,
.vocab-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover);
}

.stat-card::after {
  opacity: 0.16;
}

.stat-card .stat-value,
.result-box .value,
.rank-card-value,
.lb-insight-value,
.mock-compare-card .val {
  font-variant-numeric: tabular-nums;
}

.btn,
button.btn,
.btn-download,
.share-btn,
.btn-copy,
.ai-btn,
.typing-tab,
.lb-tab,
.filter-tab,
.tab-pill,
.result-tab-btn,
.modal-tab,
.p-tab,
.editorial-tab,
.lang-pill {
  min-height: 42px;
  border-radius: 11px;
  letter-spacing: 0;
  box-shadow: none;
}

.btn-primary,
.btn-accent,
.btn-glow,
.ai-btn,
.btn-download {
  background: linear-gradient(135deg, #4F46E5, #0891B2);
  color: #fff;
  box-shadow: 0 10px 22px rgba(79,70,229,0.22);
}

.btn-primary:hover,
.btn-accent:hover,
.btn-glow:hover,
.ai-btn:hover,
.btn-download:hover {
  box-shadow: 0 14px 28px rgba(79,70,229,0.28);
}

.btn-outline,
.btn-clear,
.filter-tab,
.tab-pill,
.typing-tab,
.lb-tab,
.result-tab-btn,
.modal-tab,
.p-tab,
.editorial-tab,
.lang-pill {
  background: #fff;
  border: 1px solid var(--border-soft);
  color: #334155;
}

.filter-tab.active,
.tab-pill.active,
.typing-tab.active,
.lb-tab.active,
.result-tab-btn.active,
.modal-tab.active,
.p-tab.active,
.editorial-tab.active,
.lang-pill.active {
  background: #EEF2FF;
  border-color: #C7D2FE;
  color: #4338CA;
}

.form-input,
.form-textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
select,
textarea {
  border-radius: 10px;
  border: 1px solid #CBD5E1;
  background: #fff;
  color: #0F172A;
  min-height: 44px;
}

.form-input:focus,
.form-textarea:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: #6366F1;
  box-shadow: 0 0 0 4px var(--focus-ring);
  outline: none;
}

.results-table-wrap,
.cutoff-table-wrap,
.vb-table-wrap {
  border-radius: var(--radius-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
}

.results-table th,
.leaderboard-table th,
.topic-matrix th,
.section-compare-table th,
.cutoff-table th,
.vb-table th,
.word-detail-table th,
.answer-sheet-table th {
  background: #F1F5F9;
  color: #475569;
  letter-spacing: 0.04em;
}

.results-table td,
.leaderboard-table td,
.topic-matrix td,
.section-compare-table td,
.cutoff-table td,
.vb-table td,
.word-detail-table td,
.answer-sheet-table td {
  vertical-align: middle;
}

.results-table tbody tr:nth-child(even) td,
.leaderboard-table tbody tr:nth-child(even) td,
.vb-table tbody tr:nth-child(even) td {
  background: rgba(248,250,252,0.72);
}

.empty-state,
.empty-editorial,
.lb-empty-mini,
.wp-error {
  border-radius: var(--radius-card);
  border: 1px dashed #CBD5E1;
  background: #F8FAFC;
}

.toast {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 18px 40px rgba(15,23,42,0.18);
}

.loading-shimmer {
  border-radius: 10px;
}

.score-bar-wrap,
.bar-track,
.mini-track,
.lb-mini-track,
.ai-progress-wrap,
.section-bar-wrap {
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
}

.hero-badge,
.card-badge,
.percentile-pill,
.score-badge,
.accuracy-badge,
.ed-tag,
.ai-chip,
.ai-mini-tag,
.live-badge {
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,0.08);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover,
  .btn-download:hover,
  .share-btn:hover,
  .btn-copy:hover,
  .ai-btn:hover {
    transform: translateY(-1px);
  }
}

@media (hover: none) {
  .card:hover,
  .mock-card:hover,
  .series-card:hover,
  .stat-card:hover,
  .ed-card:hover,
  .vocab-card:hover,
  .btn:hover,
  .btn-primary:hover,
  .btn-accent:hover,
  .btn-glow:hover,
  .ai-btn:hover,
  .btn-download:hover {
    transform: none;
  }
}

@media (max-width: 768px) {
  body {
    background: #F8FAFC;
  }

  .navbar,
  .mobile-topbar {
    box-shadow: 0 4px 16px rgba(15,23,42,0.06);
  }

  .page-header {
    margin-bottom: 18px;
  }

  .page-header h1,
  .section-header h2 {
    font-size: clamp(22px, 6.4vw, 28px);
  }

  .card,
  .stat-card,
  .mock-card,
  .series-card,
  .result-section,
  .result-box,
  .analysis-card,
  .rank-predictor-form,
  .vocab-card,
  .ed-card,
  .your-rank-card,
  .lb-insight-card,
  .lb-insight-panel,
  .mock-compare-card,
  .mock-compare-panel,
  .mock-compare-chart,
  .ai-coach-card,
  .ai-chart-card,
  .progress-chart-section,
  .activity-graph-section,
  .goal-section,
  .performance-movement-section,
  .upload-section,
  .filter-panel,
  .editor-sidebar,
  .editor-panel {
    box-shadow: 0 8px 22px rgba(15,23,42,0.06);
  }

  .btn,
  button,
  .btn-download,
  .share-btn,
  .btn-copy,
  .ai-btn {
    min-height: 44px;
  }

  .nav-links a,
  .sidebar-nav a {
    min-height: 42px;
  }

  .results-table th,
  .results-table td,
  .leaderboard-table th,
  .leaderboard-table td,
  .vb-table th,
  .vb-table td {
    padding: 12px 14px;
  }
}

@media (max-width: 430px) {
  .main-content,
  .main-content-full {
    padding-left: max(12px, var(--safe-left));
    padding-right: max(12px, var(--safe-right));
  }

  .page-header h1,
  .section-header h2 {
    font-size: clamp(21px, 7vw, 25px);
  }

  .stat-card .stat-value,
  .result-box .value {
    font-size: 24px;
  }
}

/* ========== STATIC AUDIT FIXES FOR GENERATED CONTENT ========== */
.para-section,
.ed-reader,
.practice-section,
.typing-panel,
.history-card,
.profile-card,
.activity-graph-section,
.question-review-detail,
.ai-admin-log,
.ai-question-list,
.ai-map-list,
.ai-plan-list {
  min-width: 0;
}

.para-section,
.practice-section,
.typing-panel,
.history-card,
.activity-graph-section,
.question-review-detail,
.ai-admin-log {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tw-table,
.word-detail-table {
  width: 100%;
  min-width: 640px;
}

.word-popup,
.wp-popup {
  max-width: calc(100vw - 24px);
}

.unlocked-title,
.user-name-bold,
.mock-title-col,
.ed-card-title,
.wp-word,
.tw-word,
.tw-sentence,
.idiom-phrase,
.vt-question,
.cloze-sentence,
.pj-sent,
.ai-map-item,
.ai-question-item,
.ai-plan-item {
  overflow-wrap: anywhere;
}

@media (max-width: 768px) {
  .modal-content [style*="display:flex"],
  .modal-box [style*="display:flex"],
  .profile-card [style*="display:flex"],
  .history-card [style*="display:flex"],
  .result-section [style*="display:flex"],
  .analysis-card [style*="display:flex"],
  .ed-card [style*="display:flex"],
  .para-section [style*="display:flex"] {
    flex-wrap: wrap !important;
    min-width: 0;
  }

  .modal-content [style*="display:flex"] > .btn,
  .modal-box [style*="display:flex"] > .btn,
  .profile-card [style*="display:flex"] > .btn,
  .history-card [style*="display:flex"] > .btn,
  .result-section [style*="display:flex"] > .btn,
  .analysis-card [style*="display:flex"] > .btn {
    flex: 1 1 160px;
  }

  .ed-card-header,
  .ed-reader-header,
  .rank-card-left,
  .user-cell,
  .lb-user-cell,
  .ai-predicted-box,
  .accuracy-bar,
  .topic-risk-row,
  .cutoff-row,
  .dist-row {
    min-width: 0;
  }

  .tw-table,
  .word-detail-table {
    min-width: 600px;
  }

  .unlocked-title {
    max-width: 100%;
    white-space: normal;
  }

  .toast-container {
    bottom: calc(12px + var(--safe-bottom));
    right: 12px;
  }
}

@media (max-width: 430px) {
  .tw-table,
  .word-detail-table {
    min-width: 560px;
  }

  .word-popup,
  .wp-popup {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }
}

/* ========== SITE-WIDE NATIVE TOUCH SCROLL ========== */
html,
body {
  touch-action: pan-x pan-y pinch-zoom;
  overscroll-behavior-y: auto;
}

/* Explicitly allow a drag that begins on text, cards, buttons, links, or media. */
body * {
  touch-action: pan-x pan-y pinch-zoom;
}

/* Preserve horizontal range dragging while vertical page scrolling stays native. */
input[type="range"] {
  touch-action: pan-y pinch-zoom;
}

/* ========== DYNAMIC UX BEST-PRACTICE GUARDRAILS ========== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* Baseline responsive safeguards; repeated at the end to win the cascade. */
.dashboard .btn,
.dashboard button,
.dashboard .sidebar-nav a,
.dashboard input:not([type="checkbox"]):not([type="radio"]),
.dashboard select,
.dashboard textarea {
  min-height: 44px;
}

.dashboard :focus-visible {
  outline: 3px solid #0891b2;
  outline-offset: 3px;
}

@media (max-width: 768px) {
  .dashboard .main-content {
    padding-top: calc(72px + var(--safe-top));
    padding-bottom: calc(36px + var(--safe-bottom));
  }

  .dashboard .page-header h1 {
    font-size: clamp(25px, 8vw, 34px);
    line-height: 1.08;
    text-wrap: balance;
  }

  .dashboard .filter-tabs,
  .dashboard .result-tabs,
  .dashboard .admin-tabs,
  .dashboard .typing-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .dashboard .filter-tab,
  .dashboard .result-tab-btn,
  .dashboard .admin-tab,
  .dashboard .typing-tab {
    flex: 0 0 auto !important;
    min-height: 44px !important;
    scroll-snap-align: start;
  }
}

@media (max-width: 430px) {
  .dashboard .main-content {
    padding-left: max(14px, var(--safe-left));
    padding-right: max(14px, var(--safe-right));
  }

  .dashboard .stats-row,
  .dashboard .dashboard-stats,
  .dashboard .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
}

/* Auth pages must remain fully reachable on phones and short browser windows. */
body.auth-page {
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  background: #07111F;
}

.auth-page .auth-container {
  min-height: 100svh;
  height: auto;
  padding:
    max(24px, var(--safe-top))
    max(18px, var(--safe-right))
    max(24px, var(--safe-bottom))
    max(18px, var(--safe-left));
  overflow: visible;
}

.auth-page .auth-card {
  color: #0F172A;
}

.auth-page .form-input {
  color: #0F172A;
  background: #F8FAFC;
  border-color: #CBD5E1;
}

.auth-page .form-input::placeholder {
  color: #64748B;
  opacity: 1;
}

.auth-page .form-input:focus {
  color: #0F172A;
  background: #FFFFFF;
  border-color: #4F46E5;
}

@media (max-height: 720px), (max-width: 430px) {
  .auth-page .auth-container {
    align-items: flex-start;
    justify-content: center;
  }

  .auth-page .auth-card {
    margin-block: 0;
    padding: 28px 22px;
  }

  .auth-page .auth-card .subtitle {
    margin-bottom: 24px;
  }
}

/* ========== APP-WIDE UI COMPLETION PASS — 2026-07 ========== */
.dashboard .main-content {
  background:
    radial-gradient(circle at 0 0, rgba(8,145,178,.055), transparent 28rem),
    radial-gradient(circle at 100% 0, rgba(245,158,11,.05), transparent 24rem),
    var(--gray-bg);
}

.dashboard .page-header {
  max-width: 760px;
}

.dashboard .page-header p {
  max-width: 62ch;
  text-wrap: pretty;
}

.dashboard .card,
.dashboard .stat-card,
.dashboard .result-section,
.dashboard .analysis-card,
.dashboard .series-card,
.dashboard .rank-predictor-form {
  border-color: rgba(148,163,184,.34);
}

.dashboard .btn,
.dashboard button,
.dashboard .sidebar-nav a,
.dashboard input:not([type="checkbox"]):not([type="radio"]),
.dashboard select,
.dashboard textarea {
  min-height: 44px;
}

.dashboard :focus-visible {
  outline: 3px solid #0891b2;
  outline-offset: 3px;
}

.table-container,
.results-table-wrap,
.leaderboard-table-wrap,
.vb-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .dashboard .main-content {
    padding-top: calc(72px + var(--safe-top));
    padding-bottom: calc(36px + var(--safe-bottom));
  }

  .mobile-topbar {
    border-bottom: 1px solid #dbe3ec;
    box-shadow: 0 6px 20px rgba(15,23,42,.08);
  }

  .mobile-topbar .mob-logo {
    max-width: calc(100% - 118px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-nav a {
    min-height: 46px !important;
  }

  .page-header {
    margin-bottom: 16px;
  }

  .page-header h1 {
    font-size: clamp(25px, 8vw, 34px);
    line-height: 1.08;
    text-wrap: balance;
  }

  .page-header p {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.55;
  }

  .filter-tabs,
  .result-tabs,
  .admin-tabs,
  .typing-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .filter-tabs::-webkit-scrollbar,
  .result-tabs::-webkit-scrollbar,
  .admin-tabs::-webkit-scrollbar,
  .typing-tabs::-webkit-scrollbar { display: none; }

  .filter-tab,
  .result-tab-btn,
  .admin-tab,
  .typing-tab {
    flex: 0 0 auto !important;
    min-height: 44px !important;
    scroll-snap-align: start;
  }

  .card,
  .stat-card,
  .result-section,
  .analysis-card,
  .series-card,
  .rank-predictor-form {
    border-radius: 14px;
  }

  .card-footer,
  .result-actions,
  .action-bar,
  .share-row {
    gap: 8px;
  }

  .modal-overlay,
  .ad-modal,
  .shortcuts-modal {
    padding: max(12px, var(--safe-top)) max(12px, var(--safe-right)) max(12px, var(--safe-bottom)) max(12px, var(--safe-left));
  }

  .modal-content,
  .modal-box,
  .ad-modal-content,
  .shortcuts-modal-body {
    width: 100%;
    max-width: 560px;
    max-height: calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom));
    overflow-y: auto;
  }

  .empty-state,
  .empty-art,
  [class*="empty-state"] {
    min-height: 220px;
  }
}

@media (max-width: 430px) {
  .dashboard .main-content {
    padding-left: max(14px, var(--safe-left));
    padding-right: max(14px, var(--safe-right));
  }

  .stats-row,
  .dashboard-stats,
  .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-card .stat-value {
    font-size: 22px;
  }
}

.admin-tabs,
.leaderboard-tabs,
.result-tabbar,
.typing-tabs,
.modal-tabs,
.practice-tabs,
.filter-tabs,
.tab-pills,
.lang-pills {
  max-width: 100%;
}

.admin-tabs {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar {
  display: none;
}

.admin-tab,
.lb-tab,
.result-tab-btn,
.typing-tab,
.modal-tab,
.p-tab,
.filter-tab,
.tab-pill,
.lang-pill {
  min-width: max-content;
}

.api-key-card,
.api-env-card,
.api-add-panel,
.api-kpi,
.api-env-var,
.api-meta,
.api-provider-mini,
.ai-live-card,
.ai-live-metric,
.ai-live-empty,
.health-card,
.admin-stat,
.stat-mini,
.drill-meta-card,
.editor-kpi,
.question-edit-row,
.question-bank-item,
.editor-list-item,
.series-pick-item,
.series-selected-row,
.preview-item,
.activity-item,
.popularity-row,
.performer-row,
.missed-row,
.topic-bar,
.accuracy-bar,
.history-card,
.mode-card,
.chart-card,
.progress-chart-wrap,
.result-stat-box,
.ed-card,
.ed-para-block,
.idiom-card,
.cloze-item,
.vt-item,
.pj-item,
.vocab-card,
.quiz-card-box,
.card-face {
  min-width: 0;
}

.api-key-card,
.api-env-card,
.api-add-panel,
.api-kpi,
.api-env-var,
.api-meta,
.ai-live-card,
.ai-live-metric,
.ai-live-log-box,
.ai-admin-log,
.activity-desc,
.activity-time,
.question-edit-row,
.question-bank-item,
.editor-list-item,
.series-pick-item,
.series-selected-row,
.preview-item,
.popularity-row,
.performer-row,
.missed-row,
.topic-label,
.accuracy-bar,
.history-info,
.history-meta,
.history-stats,
.mode-name,
.mode-desc,
.summary-text,
.ed-card-title,
.ed-reader-title,
.ed-para-text,
.ed-para-hindi,
.idiom-meaning,
.idiom-hindi,
.idiom-example,
.cloze-sentence,
.vt-question,
.vt-opt,
.pj-sent,
.vocab-meaning,
.mnemonic-box,
.quiz-q-text,
.quiz-opt,
.card-back {
  overflow-wrap: anywhere;
}

.api-key-head,
.api-env-head,
.ai-live-card-head,
.ai-live-progress-label,
.editor-panel-head,
.qe-header,
.question-edit-row .qe-header,
.series-selected-row,
.history-card,
.popularity-row,
.performer-row,
.accuracy-bar,
.topic-label,
.ed-card-header,
.ed-reader-meta,
.vocab-header,
.wp-header,
.wp-footer {
  min-width: 0;
}

.api-key-secret,
.api-env-path,
.api-env-var .value,
.api-meta .val,
.ai-live-log-box,
.ai-admin-log,
.word-detail-table,
.vb-table,
.tw-table,
.answer-sheet-table {
  word-break: break-word;
}

.mini-chart,
.histogram,
.score-trend-bars,
.activity-graph,
.heatmap-grid {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mini-chart,
.histogram,
.score-trend-bars {
  min-height: 96px;
}

.api-key-actions,
.ai-live-actions,
.editor-actions,
.quick-actions,
.export-bar,
.bulk-actions-row,
.diff-counts,
.fc-controls,
.result-actions,
.action-btns,
.cloze-opts,
.vt-opts,
.wp-chips,
.word-list,
.insight-chips,
.ai-chips {
  min-width: 0;
}

.api-key-actions .btn,
.ai-live-actions .btn,
.editor-actions .btn,
.quick-actions .btn,
.export-bar .btn,
.bulk-actions-row .btn,
.result-actions .btn,
.action-btns button,
.fc-btn,
.quiz-opt,
.cloze-opt,
.vt-opt,
.pj-check-btn,
.wp-btn,
.word-chip {
  min-height: 42px;
}

.loading-spinner,
.spinner,
.type-spinner,
.wp-spinner {
  flex: 0 0 auto;
}

.empty-state,
.empty-editorial,
.topper-empty,
.ai-live-empty,
.lb-empty-mini {
  display: grid;
  place-items: center;
  gap: 6px;
}

.results-table-wrap,
.leaderboard-table-wrap,
.cutoff-table-wrap,
.vb-table-wrap,
.question-bank-list,
.series-pick-list,
.modal-body,
.palette-scroll,
.ai-live-log-box,
.ai-admin-log,
.bulk-preview,
.editor-sidebar {
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .admin-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding-bottom: 4px;
    margin-bottom: 18px;
  }

  .admin-tab {
    flex: 0 0 auto;
    min-height: 42px;
  }

  .api-key-head,
  .api-env-head,
  .ai-live-card-head,
  .ai-live-progress-label,
  .editor-panel-head,
  .question-edit-row .qe-header,
  .ed-card-header,
  .classic-header,
  .history-card,
  .popularity-row,
  .performer-row,
  .accuracy-bar,
  .topic-label,
  .wp-footer {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .series-selected-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .series-selected-row > *:last-child {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .api-key-actions,
  .ai-live-actions,
  .editor-actions,
  .quick-actions,
  .export-bar,
  .bulk-actions-row,
  .result-actions,
  .action-btns,
  .fc-controls,
  .wp-footer {
    align-items: stretch !important;
  }

  .api-key-actions > *,
  .ai-live-actions > *,
  .editor-actions > *,
  .quick-actions > *,
  .export-bar > *,
  .bulk-actions-row > *,
  .result-actions > *,
  .action-btns > *,
  .fc-controls > *,
  .wp-footer > * {
    width: 100% !important;
    max-width: none !important;
  }

  .api-status-pill,
  .api-source-pill,
  .ai-live-pill,
  .role-badge,
  .card-badge,
  .ed-tag,
  .score-badge,
  .accuracy-badge,
  .percentile-pill {
    white-space: normal;
    justify-content: center;
    text-align: center;
  }

  .modal-overlay,
  .ad-modal,
  .shortcuts-modal {
    align-items: flex-start !important;
  }

  .modal-box,
  .modal-content,
  .ad-modal-content,
  .shortcuts-modal-body {
    margin-top: 0;
    margin-bottom: 0;
  }

  .editor-panel-body,
  .modal-body,
  .analysis-body,
  .typing-panel {
    padding: 16px !important;
  }

  .result-hero,
  .lobby-hero,
  .api-console-hero,
  .ai-panel-hero {
    border-radius: 14px !important;
  }

  .result-stats-row {
    border-radius: 0 0 14px 14px;
    overflow: hidden;
  }

  .history-stats,
  .ed-reader-meta,
  .vocab-details,
  .api-meta-grid,
  .ai-live-metrics,
  .editor-kpis,
  .stat-grid,
  .drill-summary-grid,
  .system-health {
    gap: 10px !important;
  }

  .question-bank-list,
  .series-pick-list,
  .bulk-preview,
  .ai-live-log-box,
  .ai-admin-log {
    max-height: min(52dvh, 420px);
  }

  .word-display {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .enemy-word {
    max-width: 50vw;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 430px) {
  .admin-tab,
  .lb-tab,
  .result-tab-btn,
  .typing-tab,
  .modal-tab,
  .p-tab,
  .filter-tab,
  .tab-pill,
  .lang-pill {
    min-height: 40px;
    padding-inline: 12px;
    font-size: 12px;
  }

  .api-kpi .val,
  .health-card .health-value,
  .admin-stat .value,
  .stat-mini .val,
  .editor-kpi .val,
  .drill-meta-card .val,
  .rs-val {
    font-size: clamp(18px, 7vw, 24px);
  }

  .empty-state,
  .empty-editorial,
  .topper-empty,
  .ai-live-empty {
    padding: 28px 14px;
  }

  .card-scene {
    height: min(270px, 48dvh) !important;
  }
}

/* ========== FINAL CROSS-PAGE MOBILE OVERRIDE ========== */
@media (max-width: 768px) {
  html,
  body,
  .dashboard,
  .main-content,
  .main-content-full {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .main-content,
  .main-content-full {
    min-width: 0 !important;
  }

  .dashboard-header,
  .profile-header,
  .auth-card,
  .rph,
  .analysis-hero,
  .score-card,
  .review-detail,
  .question-review-detail,
  .question-area,
  .question-card,
  .mock-screen,
  .vocab-layout,
  .saved-words,
  .admin-card,
  .movement-card,
  .ed-card,
  .ed-reader-header,
  .cloze-item,
  .vt-item,
  .pj-item,
  .result-section,
  .analysis-card,
  .rank-predictor-form {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .dashboard-header > *,
  .profile-header > *,
  .auth-card > *,
  .rph > *,
  .analysis-hero > *,
  .score-card > *,
  .review-detail > *,
  .question-review-detail > *,
  .question-area > *,
  .question-card > *,
  .vocab-layout > *,
  .saved-words > *,
  .admin-card > *,
  .movement-card > *,
  .ed-card > *,
  .ed-reader-header > *,
  .cloze-item > *,
  .vt-item > *,
  .pj-item > *,
  .result-section > *,
  .analysis-card > *,
  .rank-predictor-form > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .admin-grid,
  .movement-grid,
  .form-grid,
  .dashboard-stats,
  .profile-stats,
  .profile-two-col,
  .vocab-layout,
  .chart-grid,
  .mode-cards,
  .history-grid,
  .mock-grid,
  .series-grid,
  .results-grid,
  .analysis-grid,
  .comparison-grid,
  .ai-coach-grid,
  .mock-compare-charts,
  .mock-compare-panels {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  h1,
  h2,
  h3,
  h4,
  p,
  label,
  .dashboard-header,
  .profile-header,
  .auth-card,
  .rph,
  .rph-sub,
  .analysis-hero,
  .score-card,
  .review-detail,
  .question-review-text,
  .answer-row,
  .question-text,
  .option-btn,
  .option-item,
  .mock-title,
  .movement-label,
  .movement-value,
  .movement-note,
  .subject-move-row,
  .ed-card-title,
  .ed-reader-title,
  .ed-para-text,
  .cloze-sentence,
  .cloze-opt,
  .vt-question,
  .vt-opt,
  .pj-sent,
  .vocab-word,
  .vocab-meaning,
  .saved-words,
  .word-chip,
  .enemy-word,
  .enemy-word *,
  .typing-input,
  .bar-label,
  .admin-card,
  .stat-card,
  .btn,
  button {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    letter-spacing: 0 !important;
  }

  .enemy-word,
  .enemy-word * {
    white-space: normal !important;
    max-width: min(64vw, 240px) !important;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .input,
  .typing-input {
    min-height: 44px !important;
    max-width: 100% !important;
  }

  .sidebar a,
  .nav-links a,
  .btn,
  button,
  [role="button"] {
    min-height: 42px !important;
  }

  .result-tabbar,
  .leaderboard-tabs,
  .typing-tabs,
  .practice-tabs,
  .filter-tabs,
  .section-nav,
  .question-nav,
  .cloze-opts,
  .vt-opts,
  .wp-chips,
  .action-btns,
  .test-actions,
  .mock-actions {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .results-table-wrap,
  .leaderboard-table-wrap,
  .cutoff-table-wrap,
  .vb-table-wrap,
  .admin-table-wrap,
  .tw-table-wrap {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ========== PREMIUM EXPERIENCE PASS 2026 ========== */
:root {
  --primary: #4F46E5;
  --primary-dark: #3730A3;
  --primary-light: #EEF2FF;
  --accent: #0891B2;
  --accent-dark: #0E7490;
  --accent-light: #ECFEFF;
  --secondary: #E11D48;
  --gold: #F59E0B;
  --gold-dark: #B45309;
  --gold-light: #FFFBEB;
  --success: #059669;
  --success-light: #ECFDF5;
  --warning: #D97706;
  --warning-light: #FFFBEB;
  --danger: #DC2626;
  --danger-light: #FEF2F2;
  --dark: #0B1220;
  --dark-2: #111827;
  --dark-3: #263244;
  --gray: #5B677A;
  --gray-light: #8A97AA;
  --gray-lighter: #D7DEE8;
  --gray-bg: #F7F9FC;
  --gray-bg2: #EEF3F8;
  --font-primary: 'Plus Jakarta Sans', 'Noto Sans Devanagari', Aptos, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Mono', monospace;
  --surface: rgba(255,255,255,0.9);
  --surface-solid: #FFFFFF;
  --surface-muted: #F7F9FC;
  --border-soft: rgba(15,23,42,0.09);
  --border-strong: rgba(15,23,42,0.16);
  --focus-ring: rgba(8,145,178,0.22);
  --shadow-card: 0 12px 34px rgba(15,23,42,0.07);
  --shadow-card-hover: 0 22px 55px rgba(15,23,42,0.13);
  --shadow-premium: 0 28px 80px rgba(15,23,42,0.16);
  --radius-card: 12px;
  --transition: 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-fast: 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-bounce: 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  background: #F7F9FC;
}

body {
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(circle at top left, rgba(8,145,178,0.10), transparent 34rem),
    radial-gradient(circle at 84% 12%, rgba(245,158,11,0.10), transparent 28rem),
    linear-gradient(180deg, #F7F9FC 0%, #EEF3F8 48%, #F8FAFC 100%);
}

a:visited {
  color: inherit;
}

.nav-logo,
.sidebar-logo,
.page-header h1,
.section-header h2,
.hero h1,
.card-title,
.series-card h3,
.stat-card .stat-value {
  text-wrap: balance;
}

.hero {
  min-height: min(860px, calc(100svh - 42px));
  display: grid;
  align-items: center;
  padding: clamp(72px, 9vw, 112px) 24px clamp(54px, 7vw, 84px);
  background:
    radial-gradient(circle at 18% 16%, rgba(20,184,166,0.22), transparent 28rem),
    radial-gradient(circle at 78% 18%, rgba(245,158,11,0.16), transparent 24rem),
    linear-gradient(145deg, #07111F 0%, #101827 45%, #07111F 100%);
}

.hero::before,
.hero::after {
  filter: blur(2px);
}

.hero-content {
  max-width: 1040px;
}

.hero-badge {
  background: rgba(236,254,255,0.10);
  border-color: rgba(165,243,252,0.22);
  color: #BAE6FD;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.hero h1 {
  font-size: clamp(40px, 7vw, 78px);
  letter-spacing: 0;
}

.hero p {
  color: rgba(255,255,255,0.72);
  font-size: clamp(16px, 2vw, 20px);
}

.practice-console,
.auth-card,
.dashboard-header,
.progress-chart-section,
.activity-graph-section,
.goal-section,
.performance-movement-section,
.modal-content,
.modal-box {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.practice-console {
  transform: translateZ(0);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.practice-console:hover {
  border-color: rgba(255,255,255,0.24);
  box-shadow: 0 34px 90px rgba(2,6,23,0.46);
  transform: translateY(-4px);
}

.meter span,
.goal-progress-fill,
.score-bar-fill,
.bar-fill {
  position: relative;
  overflow: hidden;
}

.meter span::after,
.goal-progress-fill::after,
.score-bar-fill::after,
.bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.36), transparent);
  transform: translateX(-100%);
  animation: sheen 2.8s ease-in-out infinite;
}

@keyframes sheen {
  0%, 45% { transform: translateX(-110%); }
  100% { transform: translateX(110%); }
}

[data-animate] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.72s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.72s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

.features-grid > *:nth-child(2),
.exam-cards-grid > *:nth-child(2),
.cards-grid > *:nth-child(2),
.steps > *:nth-child(2) { --reveal-delay: 80ms; }

.features-grid > *:nth-child(3),
.exam-cards-grid > *:nth-child(3),
.cards-grid > *:nth-child(3),
.steps > *:nth-child(3) { --reveal-delay: 150ms; }

.features-grid > *:nth-child(4),
.exam-cards-grid > *:nth-child(4),
.cards-grid > *:nth-child(4),
.steps > *:nth-child(4) { --reveal-delay: 220ms; }

.card,
.mock-card,
.series-card,
.feature-card,
.exam-card,
.stat-card,
.movement-card,
.subject-move-row,
.ed-card,
.vocab-card {
  isolation: isolate;
  transform: translateZ(0);
}

.card::after,
.mock-card::after,
.series-card::after,
.feature-card::after,
.exam-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(8,145,178,0.10), rgba(245,158,11,0.10));
  transition: opacity var(--transition);
}

.card:hover::after,
.mock-card:hover::after,
.series-card:hover::after,
.feature-card:hover::after,
.exam-card:hover::after {
  opacity: 1;
}

.btn,
.btn-download,
.share-btn,
.btn-copy,
.ai-btn {
  transform: translateZ(0);
}

.btn-primary,
.btn-accent,
.btn-glow,
.ai-btn,
.btn-download {
  background: linear-gradient(135deg, #4F46E5 0%, #0891B2 100%);
  box-shadow: 0 12px 26px rgba(8,145,178,0.24);
}

.btn-primary:hover,
.btn-accent:hover,
.btn-glow:hover,
.ai-btn:hover,
.btn-download:hover {
  box-shadow: 0 16px 34px rgba(8,145,178,0.30);
}

.btn-outline:hover,
.filter-tab:hover,
.tab-pill:hover,
.typing-tab:hover,
.lb-tab:hover,
.result-tab-btn:hover,
.modal-tab:hover,
.p-tab:hover,
.editorial-tab:hover,
.lang-pill:hover {
  border-color: rgba(8,145,178,0.32);
  background: #ECFEFF;
  color: #0E7490;
}

.sidebar-nav a {
  position: relative;
}

.sidebar-nav a.active {
  box-shadow: inset 0 0 0 1px rgba(79,70,229,0.08);
}

.sidebar-nav a.active::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #0891B2;
  transform: translateY(-50%);
}

.mobile-topbar {
  padding-top: max(10px, var(--safe-top));
}

.fab {
  box-shadow: 0 20px 46px rgba(8,145,178,0.32);
}

.fab:hover {
  transform: translateY(-2px) scale(1.03);
}

.marquee-track {
  will-change: transform;
}

.marquee-item {
  border: 1px solid var(--border-soft);
}

.auth-container {
  background:
    radial-gradient(circle at 18% 18%, rgba(8,145,178,0.16), transparent 24rem),
    radial-gradient(circle at 86% 14%, rgba(245,158,11,0.14), transparent 22rem),
    linear-gradient(145deg, #07111F 0%, #111827 100%);
}

.auth-card {
  border-color: rgba(255,255,255,0.18);
  box-shadow: var(--shadow-premium);
}

.dashboard-header,
.page-header {
  animation: fadeInDown 0.48s ease-out both;
}

@media (max-width: 768px) {
  .hero {
    min-height: auto;
    padding-top: 64px;
  }

  .hero h1 {
    font-size: clamp(34px, 11vw, 48px);
  }

  .hero-stats {
    margin-top: 36px;
  }

  .sidebar {
    box-shadow: 12px 0 36px rgba(15,23,42,0.18);
  }

  .card:hover,
  .mock-card:hover,
  .series-card:hover,
  .feature-card:hover,
  .exam-card:hover,
  .stat-card:hover {
    box-shadow: var(--shadow-card);
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-animate] {
    opacity: 1 !important;
    transform: none !important;
  }

  .meter span::after,
  .goal-progress-fill::after,
  .score-bar-fill::after,
  .bar-fill::after,
  .marquee-track,
  .hero::before,
  .hero::after,
  .star {
    animation: none !important;
  }
}

/* Final responsive safeguards: this block stays last in the cascade. */
.dashboard .btn,
.dashboard button,
.dashboard .sidebar-nav a,
.dashboard input:not([type="checkbox"]):not([type="radio"]),
.dashboard select,
.dashboard textarea {
  min-height: 44px;
}

.dashboard :focus-visible {
  outline: 3px solid #0891b2;
  outline-offset: 3px;
}

@media (max-width: 768px) {
  .dashboard .main-content {
    padding-top: calc(72px + var(--safe-top));
    padding-bottom: calc(36px + var(--safe-bottom));
  }

  .dashboard .page-header h1 {
    font-size: clamp(25px, 8vw, 34px);
    line-height: 1.08;
    text-wrap: balance;
  }

  .dashboard .filter-tabs,
  .dashboard .result-tabs,
  .dashboard .admin-tabs,
  .dashboard .typing-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .dashboard .filter-tab,
  .dashboard .result-tab-btn,
  .dashboard .admin-tab,
  .dashboard .typing-tab {
    flex: 0 0 auto !important;
    min-height: 44px !important;
    scroll-snap-align: start;
  }
}

@media (max-width: 430px) {
  .dashboard .main-content {
    padding-left: max(14px, var(--safe-left));
    padding-right: max(14px, var(--safe-right));
  }

  .dashboard .stats-row,
  .dashboard .dashboard-stats,
  .dashboard .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
}
