/* ════════════════════════════════════════════════════
   JECA Test Prep — styles.css
   Design: Clean academic, navy + azure accent,
   Lexend display font, Nunito body
   ════════════════════════════════════════════════════ */

:root {
  --primary:       #1d4ed8;
  --primary-hover: #1e40af;
  --accent:        #0ea5e9;
  --bg:            #f0f5ff;
  --surface:       #ffffff;
  --surface-2:     #f8fafc;
  --border:        #e2e8f0;
  --border-focus:  #93c5fd;
  --text-h:        #0f172a;
  --text-b:        #1e293b;
  --text-m:        #64748b;
  --text-faint:    #94a3b8;
  --success:       #16a34a;
  --success-bg:    #f0fdf4;
  --danger:        #dc2626;
  --danger-bg:     #fef2f2;
  --warn:          #d97706;
  --warn-bg:       #fffbeb;
  --palette-bg:    #0f172a;
  --palette-w:     260px;
  --header-h:      56px;
  --radius-sm:     8px;
  --radius-md:     14px;
  --radius-lg:     20px;
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.07);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.09);
  --shadow-lg:     0 8px 40px rgba(0,0,0,0.12);
}

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

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text-b);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

h1, h2, h3, h4 { font-family: 'Lexend', sans-serif; color: var(--text-h); }

button { cursor: pointer; font-family: inherit; }
input  { font-family: inherit; }
.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════════
   CINEMATIC LOADER — VIDEOGRAPHY STYLE
   ══════════════════════════════════════════════════════════════ */

/* ── Base overlay ──────────────────────────────────────────── */
.loader-overlay {
  position: fixed; inset: 0;
  background: #000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999; overflow: hidden;
  gap: 0;
  padding: 20px 16px;
}

/* ── Film grain CSS noise ──────────────────────────────────── */
.ldr-grain {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  animation: grain-move 0.4s steps(1) infinite;
}
@keyframes grain-move {
  0%  { transform: translate(0,0); }
  25% { transform: translate(-4px, 2px); }
  50% { transform: translate(3px, -3px); }
  75% { transform: translate(-2px, 4px); }
}

/* ── Cinematic letterbox bars ──────────────────────────────── */
.ldr-bar {
  position: absolute; left: 0; right: 0; z-index: 8;
  background: #000;
  transition: height 0.9s cubic-bezier(0.77,0,0.18,1);
}
.ldr-bar-top { top: 0;    height: 72px; }
.ldr-bar-bot { bottom: 0; height: 72px; }
@media (max-width: 480px) {
  .ldr-bar-top, .ldr-bar-bot { height: 44px; }
}

/* ── Stars ─────────────────────────────────────────────────── */
.loader-stars { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.loader-stars span {
  position: absolute; border-radius: 50%; background: #fff;
  animation: starTwinkle var(--dur,2s) ease-in-out infinite; opacity: 0;
}
.loader-stars span:nth-child(1)  { width:2px;height:2px;top:8%;left:15%;--dur:2.1s;animation-delay:0s }
.loader-stars span:nth-child(2)  { width:3px;height:3px;top:14%;left:70%;--dur:1.7s;animation-delay:0.3s }
.loader-stars span:nth-child(3)  { width:2px;height:2px;top:25%;left:40%;--dur:2.4s;animation-delay:0.6s }
.loader-stars span:nth-child(4)  { width:2px;height:2px;top:60%;left:80%;--dur:1.9s;animation-delay:0.2s }
.loader-stars span:nth-child(5)  { width:3px;height:3px;top:75%;left:25%;--dur:2.2s;animation-delay:0.8s }
.loader-stars span:nth-child(6)  { width:2px;height:2px;top:35%;left:90%;--dur:1.8s;animation-delay:1.0s }
.loader-stars span:nth-child(7)  { width:4px;height:4px;top:88%;left:55%;--dur:2.5s;animation-delay:0.4s }
.loader-stars span:nth-child(8)  { width:2px;height:2px;top:5%;left:82%;--dur:2.0s;animation-delay:1.2s }
.loader-stars span:nth-child(9)  { width:3px;height:3px;top:48%;left:12%;--dur:1.6s;animation-delay:0.7s }
.loader-stars span:nth-child(10) { width:2px;height:2px;top:92%;left:38%;--dur:2.3s;animation-delay:0.1s }
.loader-stars span:nth-child(11) { width:2px;height:2px;top:18%;left:55%;--dur:1.5s;animation-delay:1.4s }
.loader-stars span:nth-child(12) { width:3px;height:3px;top:70%;left:7%;--dur:2.6s;animation-delay:0.9s }
.loader-stars span:nth-child(13) { width:2px;height:2px;top:40%;left:60%;--dur:1.9s;animation-delay:0.5s }
.loader-stars span:nth-child(14) { width:2px;height:2px;top:55%;left:95%;--dur:2.1s;animation-delay:1.1s }
.loader-stars span:nth-child(15) { width:3px;height:3px;top:82%;left:72%;--dur:1.7s;animation-delay:0.3s }
.loader-stars span:nth-child(16) { width:2px;height:2px;top:10%;left:30%;--dur:2.4s;animation-delay:1.5s }
.loader-stars span:nth-child(17) { width:2px;height:2px;top:65%;left:48%;--dur:2.0s;animation-delay:0.2s }
.loader-stars span:nth-child(18) { width:3px;height:3px;top:30%;left:20%;--dur:1.6s;animation-delay:0.8s }
.loader-stars span:nth-child(19) { width:2px;height:2px;top:95%;left:65%;--dur:2.2s;animation-delay:1.3s }
.loader-stars span:nth-child(20) { width:4px;height:4px;top:44%;left:85%;--dur:1.8s;animation-delay:0.6s }
@keyframes starTwinkle {
  0%,100% { opacity:0; transform:scale(1); }
  40%,60% { opacity:.9; transform:scale(1.3); }
}

/* ── Production card ───────────────────────────────────────── */
.ldr-production {
  position: relative; z-index: 6;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 28px;
  animation: ldr-prod-fade 0.7s ease 0.15s both;
}
.ldr-prod-line {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(96,165,250,0.5), transparent);
  min-width: 40px;
}
.ldr-prod-text {
  font-family: 'Lexend', sans-serif;
  font-size: 9.5px; font-weight: 500;
  letter-spacing: 0.32em; color: rgba(148,163,184,0.65);
  text-transform: uppercase; white-space: nowrap;
}
@keyframes ldr-prod-fade {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ── Centre stage ──────────────────────────────────────────── */
.ldr-center {
  position: relative; z-index: 6;
  display: flex; flex-direction: column;
  align-items: center; gap: 28px;
  margin-bottom: 32px;
}

/* ── Orbital icon rings ────────────────────────────────────── */
.ldr-icon-wrap {
  position: relative; width: 160px; height: 160px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ldr-orbit-ring {
  position: absolute; border-radius: 50%;
  border: 1.5px solid transparent;
}
.ldr-ring-1 {
  width: 160px; height: 160px;
  border-top-color: #3b82f6; border-right-color: rgba(59,130,246,0.3);
  box-shadow: 0 0 18px rgba(59,130,246,0.2);
  animation: ldrCW 1.8s linear infinite;
}
.ldr-ring-2 {
  width: 122px; height: 122px;
  border-bottom-color: #a78bfa; border-left-color: rgba(167,139,250,0.3);
  animation: ldrCCW 2.4s linear infinite;
}
.ldr-ring-3 {
  width: 88px; height: 88px;
  border-top-color: #38bdf8; border-left-color: rgba(56,189,248,0.25);
  animation: ldrCW 1.1s linear infinite;
}
@keyframes ldrCW  { to { transform: rotate(360deg); } }
@keyframes ldrCCW { to { transform: rotate(-360deg); } }

.ldr-core-glow-wrap {
  position: absolute; width: 62px; height: 62px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.ldr-core-glow {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.5) 0%, transparent 72%);
  animation: ldrCorePulse 2s ease-in-out infinite;
}
@keyframes ldrCorePulse {
  0%,100% { transform:scale(1);   opacity:0.7; }
  50%     { transform:scale(1.4); opacity:1; }
}
.ldr-brain {
  font-size: 28px; color: #fff; position: relative; z-index: 3;
  filter: drop-shadow(0 0 12px #60a5fa);
  animation: ldrBrainGlow 2s ease-in-out infinite;
}
@keyframes ldrBrainGlow {
  0%,100% { filter: drop-shadow(0 0 8px #60a5fa); }
  50%     { filter: drop-shadow(0 0 24px #93c5fd) drop-shadow(0 0 6px #fff); }
}

/* ── Title wrap ────────────────────────────────────────────── */
.ldr-title-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.ldr-title-row {
  display: flex; align-items: center; gap: 0;
  font-family: 'Lexend', sans-serif;
  font-size: clamp(44px, 10vw, 72px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

/* Each letter slams in from above with blur */
.ldr-letter {
  display: inline-block;
  color: #fff;
  text-shadow: 0 0 30px rgba(255,255,255,0.15);
  animation: ldrLetterIn 0.55s cubic-bezier(0.22,1,0.36,1) calc(var(--d)*0.08s + 0.3s) both;
}
.ldr-accent-letter {
  color: #60a5fa;
  text-shadow: 0 0 30px rgba(96,165,250,0.55), 0 0 60px rgba(96,165,250,0.25);
}
@keyframes ldrLetterIn {
  0%   { opacity:0; transform: translateY(-40px) scaleY(1.3); filter:blur(8px); }
  60%  { filter:blur(0); }
  100% { opacity:1; transform: translateY(0) scaleY(1); }
}

/* Thin divider between JECA and prep */
.ldr-title-divider {
  display: inline-block; width: 2px; height: 0.72em;
  background: linear-gradient(180deg, transparent 0%, #3b82f6 50%, transparent 100%);
  margin: 0 12px; flex-shrink: 0;
  animation: ldrLetterIn 0.55s cubic-bezier(0.22,1,0.36,1) 0.62s both;
}

/* Holographic shimmer on the whole title */
.ldr-title-row::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg,
    transparent 30%, rgba(255,255,255,0.06) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: ldrShimmer 2.5s linear 1.2s infinite;
  pointer-events: none;
}
@keyframes ldrShimmer {
  from { background-position: 150% center; }
  to   { background-position: -50% center; }
}
.ldr-title-wrap { position: relative; }

/* Sub-brand line */
.ldr-subbrand {
  display: flex; align-items: center; gap: 12px;
  animation: ldrSubFade 0.6s ease 1s both;
}
.ldr-subbrand-line {
  height: 1px; width: 50px;
  background: linear-gradient(90deg, transparent, rgba(96,165,250,0.45));
}
.ldr-subbrand-line:last-child {
  background: linear-gradient(270deg, transparent, rgba(96,165,250,0.45));
}
.ldr-subbrand-text {
  font-family: 'Lexend', sans-serif;
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.3em; color: rgba(148,163,184,0.6);
  text-transform: uppercase; white-space: nowrap;
}
@keyframes ldrSubFade {
  from { opacity:0; transform:scaleX(0.7); }
  to   { opacity:1; transform:scaleX(1); }
}

/* ── Status strip ──────────────────────────────────────────── */
.ldr-status-strip {
  position: relative; z-index: 6;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  animation: ldrStatusFade 0.5s ease 1.1s both;
}
@keyframes ldrStatusFade {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:translateY(0); }
}
.ldr-tagline {
  color: rgba(148,163,184,0.6);
  font-family: 'Lexend', sans-serif;
  font-size: 11px; letter-spacing: 0.08em;
  min-height: 16px; text-transform: uppercase;
}
/* Progress track — film style */
.ldr-progress-track {
  width: 260px; height: 3px;
  background: rgba(255,255,255,0.07);
  border-radius: 100px; overflow: visible;
  position: relative;
}
.ldr-progress-segments {
  position: absolute; inset: 0; display: flex;
  gap: 2px; pointer-events: none;
}
.ldr-progress-segments span {
  flex: 1; height: 100%;
  background: rgba(255,255,255,0.04); border-radius: 1px;
}
.ldr-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #1d4ed8 0%, #3b82f6 40%, #38bdf8 70%, #a78bfa 100%);
  border-radius: 100px;
  transition: width 0.38s cubic-bezier(0.4,0,0.2,1);
  position: relative; z-index: 2;
  box-shadow: 0 0 10px rgba(96,165,250,0.7), 0 0 20px rgba(56,189,248,0.35);
}
.ldr-progress-fill::after {
  content: '';
  position: absolute; right: -1px; top: -4px;
  width: 11px; height: 11px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 8px #60a5fa, 0 0 18px rgba(96,165,250,0.8);
  opacity: 0; transition: opacity 0.3s;
}
.ldr-progress-fill:not([style*="width: 0"])::after { opacity: 1; }

/* Status dots */
.ldr-dot-row {
  display: flex; gap: 8px; align-items: center;
}
.lsd-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: all 0.3s ease;
}
.lsd-dot.active {
  background: #60a5fa;
  box-shadow: 0 0 8px #60a5fa;
  transform: scale(1.4);
}
.lsd-dot.done {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34,197,94,0.6);
}

.ldr-by-line {
  font-size: 10px; color: rgba(255,255,255,0.2);
  text-transform: uppercase; letter-spacing: 0.12em;
}
.ldr-by-line strong { color: rgba(255,255,255,0.38); font-weight: 600; }

/* ── Decorative shapes ─────────────────────────────────────── */
.loader-shape {
  position: absolute; border-radius: 6px;
  opacity: 0.05; pointer-events: none; z-index: 3;
}
.shape-1 {
  width: 80px; height: 80px; top: 12%; left: 8%;
  background: #3b82f6; border-radius: 20px;
  animation: floatShape 6s ease-in-out infinite; transform: rotate(20deg);
}
.shape-2 {
  width: 50px; height: 50px; bottom: 20%; right: 10%;
  background: #a78bfa; border-radius: 50%;
  animation: floatShape 4.5s ease-in-out infinite reverse;
}
@keyframes floatShape {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%     { transform: translateY(-18px) rotate(8deg); }
}


/* ── SECURITY OVERLAY ──────────────────────────────── */
.security-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000; backdrop-filter: blur(4px);
}
.security-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  max-width: 380px; width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.security-icon {
  font-size: 36px; color: var(--warn);
  margin-bottom: 12px;
}
.security-box h3 {
  font-size: 20px; margin-bottom: 8px;
}
.security-box p {
  color: var(--text-m); font-size: 14px; margin-bottom: 20px;
}
.security-box button {
  background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 10px 28px; font-size: 14px; font-weight: 600;
  transition: background 0.2s;
}
.security-box button:hover { background: var(--primary-hover); }

/* ── HEADER ────────────────────────────────────────── */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  height: var(--header-h);
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  height: 100%; padding: 0 20px;
  display: flex; align-items: center;
  justify-content: space-between;
}
.logo-group {
  display: flex; align-items: center; gap: 12px;
}
.logo-icon-wrap {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 17px;
}
.logo-title {
  font-family: 'Lexend', sans-serif;
  font-size: 20px; font-weight: 700;
  color: var(--text-h); letter-spacing: -0.3px;
  display: block; line-height: 1.1;
}
.logo-accent { color: var(--accent); }
.logo-sub { font-size: 11px; color: var(--text-faint); display: block; }

/* Timer chip */
.timer-chip {
  display: flex; align-items: center; gap: 7px;
  background: #1e293b;
  color: #f8fafc;
  font-family: 'Lexend', sans-serif;
  font-size: 17px; font-weight: 600;
  padding: 5px 15px;
  border-radius: 100px;
  letter-spacing: 1px;
  border: 2px solid #334155;
  transition: background 0.4s, border-color 0.3s;
}
body.dark-mode .timer-chip {
  background: #0f172a;
  border-color: #475569;
}
.timer-chip.timer-warning {
  background: #dc2626 !important;
  border-color: #b91c1c !important;
  animation: pulse 1s ease-in-out infinite;
}
.timer-chip.timer-critical {
  background: #7f1d1d !important;
  border-color: #dc2626 !important;
  animation: pulse 0.6s ease-in-out infinite;
}
.timer-icon { font-size: 13px; opacity: 0.75; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.72; } }

/* ── SCROLL-WHEEL THEME TOGGLE ─────────────────────── */
.theme-wheel-btn {
  flex-shrink: 0;
  margin-left: 12px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
}
.wheel-track {
  width: 52px; height: 28px;
  border-radius: 100px;
  background: #334155;
  border: 2px solid #475569;
  position: relative;
  transition: background 0.35s, border-color 0.35s;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.3);
}
body:not(.dark-mode) .wheel-track {
  background: #dbeafe;
  border-color: #93c5fd;
}
.wheel-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1),
              background 0.35s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  overflow: hidden;
}
body:not(.dark-mode) .wheel-thumb {
  transform: translateX(24px);
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}
/* Icon layering inside thumb */
.wheel-thumb .fa-moon,
.wheel-thumb .fa-sun {
  position: absolute;
  font-size: 10px;
  color: #fff;
  transition: opacity 0.25s, transform 0.35s;
}
.wheel-thumb .fa-moon  { opacity: 1; transform: rotate(0deg); }
.wheel-thumb .fa-sun   { opacity: 0; transform: rotate(-90deg); }
body:not(.dark-mode) .wheel-thumb .fa-moon { opacity: 0; transform: rotate(90deg); }
body:not(.dark-mode) .wheel-thumb .fa-sun  { opacity: 1; transform: rotate(0deg); }
.theme-wheel-btn:hover .wheel-thumb { box-shadow: 0 2px 10px rgba(59,130,246,0.5); }

/* ── SCREENS ────────────────────────────────────────── */
.screen { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

/* ── DASHBOARD ──────────────────────────────────────── */
.dashboard-screen {
  max-width: 960px; margin: 0 auto;
  padding: 28px 20px 60px;
}

.dash-hero {
  display: flex; align-items: center;
  justify-content: space-between;
  background: linear-gradient(125deg, #1d4ed8 0%, #0ea5e9 100%);
  border-radius: var(--radius-lg);
  padding: 28px 36px;
  margin-bottom: 24px;
  color: #fff;
  overflow: hidden;
  position: relative;
}
.dash-hero::before {
  content: '';
  position: absolute; right: -40px; top: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
}
.dash-hero-text h2 {
  font-size: 26px; font-weight: 700; color: #fff;
  margin-bottom: 6px;
}
.highlight { color: #bae6fd; }
.dash-hero-text p { color: rgba(255,255,255,0.8); font-size: 14px; max-width: 400px; }
.dash-hero-img { font-size: 64px; opacity: 0.25; }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 640px) { .dash-grid { grid-template-columns: 1fr; } }

/* Card base */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.card-title {
  font-size: 15px; font-weight: 600;
  color: var(--text-h);
  margin-bottom: 18px;
  display: flex; align-items: center;
}

/* Start card */
.field-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-m); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 7px;
}
.text-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 14px;
  outline: none;
  background: var(--surface-2);
  color: var(--text-h);
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 18px;
}
.text-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(147,197,253,0.3);
}

.year-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 20px;
}
.year-btn {
  padding: 6px 16px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-m);
  font-size: 13px; font-weight: 600;
  transition: all 0.2s;
}
.year-btn:hover { border-color: var(--primary); color: var(--primary); }
.year-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-start {
  width: 100%;
  background: linear-gradient(95deg, var(--primary), #0369a1);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-size: 15px; font-weight: 700;
  letter-spacing: 0.2px;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(29,78,216,0.3);
}
.btn-start:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(29,78,216,0.4);
}
.btn-start:active { transform: translateY(0); }

/* Stats */
.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.stat-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
}
.stat-icon { font-size: 20px; margin-bottom: 4px; }
.icon-gold   { color: #d97706; }
.icon-blue   { color: var(--primary); }
.icon-green  { color: var(--success); }
.icon-orange { color: #f97316; }
.stat-val  { font-family: 'Lexend', sans-serif; font-size: 22px; font-weight: 700; color: var(--text-h); }
.stat-lbl  { font-size: 11px; font-weight: 600; color: var(--text-m); text-transform: uppercase; letter-spacing: 0.4px; }

/* History */
.history-card { margin-bottom: 16px; }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.hi-left  { display: flex; flex-direction: column; }
.hi-year  { font-size: 14px; font-weight: 700; color: var(--text-h); }
.hi-date  { font-size: 12px; color: var(--text-m); }
.hi-right { display: flex; align-items: baseline; gap: 2px; }
.hi-score { font-family: 'Lexend', sans-serif; font-size: 20px; font-weight: 700; color: var(--primary); }
.hi-total { font-size: 13px; color: var(--text-m); }
.no-history { font-size: 13px; color: var(--text-m); padding: 8px 0; }

/* Info pills */
.dash-info {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.info-pill {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
}

/* ── TEST SCREEN ────────────────────────────────────── */
.test-screen {
  display: flex;
  height: calc(100vh - var(--header-h));
  overflow: hidden;
  position: relative;
}

/* Palette panel */
.palette-panel {
  width: var(--palette-w);
  background: var(--palette-bg);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: transform 0.3s ease;
}
.palette-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.palette-title {
  color: #e2e8f0;
  font-family: 'Lexend', sans-serif;
  font-size: 14px; font-weight: 600;
}
.palette-close {
  background: transparent; border: none;
  color: rgba(255,255,255,0.4);
  font-size: 16px; padding: 4px;
  display: none;  /* shown on mobile only */
  transition: color 0.2s;
}
.palette-close:hover { color: rgba(255,255,255,0.8); }

.palette-legend {
  display: flex; gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.pal-legend { display: flex; align-items: center; gap: 5px; color: rgba(255,255,255,0.4); font-size: 11px; }
.pal-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
}
.dot-answered   { background: #22c55e; }
.dot-current    { background: #f59e0b; }
.dot-unanswered { background: rgba(255,255,255,0.2); }

.palette-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 14px;
  overflow-y: auto;
  align-content: start;
}
.palette-grid::-webkit-scrollbar { width: 4px; }
.palette-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.palette-btn {
  aspect-ratio: 1;
  border: none;
  border-radius: 6px;
  font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.07);
  transition: all 0.15s;
}
.palette-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.palette-btn.palette-current {
  background: #f59e0b;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(245,158,11,0.4);
}
.palette-btn.palette-answered {
  background: #16a34a;
  color: #fff;
}

.palette-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.progress-bar-track {
  height: 5px; background: rgba(255,255,255,0.1);
  border-radius: 100px; overflow: hidden;
  margin-bottom: 7px;
}
.progress-bar-fill {
  height: 100%; background: #22c55e;
  border-radius: 100px;
  transition: width 0.3s ease;
}
.progress-label { font-size: 11px; color: rgba(255,255,255,0.4); text-align: center; }

/* Question area */
.question-area {
  flex: 1;
  display: flex; flex-direction: column;
  overflow-y: auto;
  background: var(--bg);
}
.q-topbar {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 24px 0;
  flex-wrap: wrap;
}
.q-counter {
  font-family: 'Lexend', sans-serif;
  font-size: 14px; font-weight: 600;
  color: var(--text-m);
}
.q-category-badge {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 3px 10px; border-radius: 100px;
}
.badge-cat1 { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-cat2 { background: #fdf4ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.q-subject-tag {
  font-size: 12px; color: var(--text-m);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 100px; padding: 3px 10px;
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 14px 24px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  flex: 1;
}
.question-text {
  font-size: 16px; font-weight: 500;
  color: var(--text-h); line-height: 1.65;
  margin-bottom: 22px;
}

.cat2-hint {
  font-size: 12px; font-weight: 600;
  color: #7e22ce;
  background: #fdf4ff; border: 1px solid #e9d5ff;
  border-radius: 6px; padding: 6px 12px;
  margin-bottom: 14px;
}

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

.option-label {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.option-label:hover {
  border-color: var(--border-focus);
  background: #eff6ff;
}
.option-label.selected {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(29,78,216,0.12);
}
.option-input {
  margin-top: 2px; flex-shrink: 0;
  accent-color: var(--primary);
  width: 16px; height: 16px;
}
.option-letter {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--text-m);
}
.option-label.selected .option-letter {
  background: var(--primary);
  color: #fff;
}
.option-text { font-size: 14px; line-height: 1.5; color: var(--text-b); }

/* Nav bar */
.q-nav-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 24px 20px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.btn-nav {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-h);
  font-size: 14px; font-weight: 600;
  transition: all 0.15s;
}
.btn-nav:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-nav:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-palette-toggle {
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-m);
  font-size: 15px;
  display: none;  /* shown only on mobile */
  transition: all 0.15s;
}
.btn-palette-toggle:hover { border-color: var(--primary); color: var(--primary); }

.btn-submit {
  margin-left: auto;
  padding: 9px 24px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(95deg, #16a34a, #15803d);
  color: #fff;
  font-size: 14px; font-weight: 700;
  box-shadow: 0 3px 10px rgba(22,163,74,0.3);
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(22,163,74,0.4);
}

/* ── RESULT SCREEN ──────────────────────────────────── */
.result-screen {
  padding: 32px 20px 60px;
}
.result-wrap {
  max-width: 760px; margin: 0 auto;
}

.result-hero-section {
  text-align: center; margin-bottom: 28px;
}
.result-emoji-big { font-size: 52px; margin-bottom: 8px; animation: pop 0.4s ease; }
@keyframes pop { from { transform: scale(0.5); opacity:0; } to { transform: scale(1); opacity:1; } }
.result-title { font-size: 28px; font-weight: 700; margin-bottom: 16px; }
.score-display {
  display: inline-flex; align-items: baseline; gap: 4px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-md);
  padding: 16px 40px;
  color: #fff;
}
.score-number {
  font-family: 'Lexend', sans-serif;
  font-size: 52px; font-weight: 800; line-height: 1;
}
.score-denom { font-size: 22px; font-weight: 500; opacity: 0.8; }
.score-subtitle { color: var(--text-m); font-size: 13px; margin-top: 10px; }

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 520px) { .breakdown-grid { grid-template-columns: repeat(2, 1fr); } }

.bd-item {
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  text-align: center;
  border: 1px solid transparent;
}
.bd-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; }
.bd-value { font-family: 'Lexend', sans-serif; font-size: 22px; font-weight: 700; }

.bd-blue   { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.bd-purple { background: #fdf4ff; border-color: #e9d5ff; color: #7e22ce; }
.bd-green  { background: var(--success-bg); border-color: #bbf7d0; color: var(--success); }
.bd-red    { background: var(--danger-bg);  border-color: #fecaca; color: var(--danger); }
.bd-gray   { background: var(--surface-2);  border-color: var(--border); color: var(--text-m); }
.bd-teal   { background: #f0fdfa; border-color: #99f6e4; color: #0d9488; }

.result-action-row {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 28px;
}
.btn-retake {
  padding: 11px 28px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text-h);
  font-size: 14px; font-weight: 700;
  transition: all 0.15s;
}
.btn-retake:hover { border-color: var(--primary); color: var(--primary); }

.btn-solutions {
  padding: 11px 28px; border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(95deg, var(--primary), #0369a1);
  color: #fff;
  font-size: 14px; font-weight: 700;
  box-shadow: 0 3px 12px rgba(29,78,216,0.3);
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn-solutions:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(29,78,216,0.4);
}

/* Solutions */
.solutions-section {
  display: flex; flex-direction: column; gap: 16px;
  border-top: 2px solid var(--border);
  padding-top: 24px;
  animation: fadeIn 0.2s ease;
}
.sol-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.sol-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.sol-qnum {
  font-family: 'Lexend', sans-serif;
  font-size: 14px; font-weight: 700; color: var(--text-m);
}
.sol-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; padding: 2px 9px; border-radius: 100px; }
.sol-question {
  font-size: 14px; font-weight: 500; color: var(--text-h);
  line-height: 1.55; margin-bottom: 14px;
}
.sol-options { display: flex; flex-direction: column; gap: 7px; }
.sol-option {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 12px; border-radius: 6px;
  font-size: 13px; line-height: 1.45;
  border: 1.5px solid transparent;
  background: var(--surface-2);
  color: var(--text-b);
}
.sol-correct            { background: var(--success-bg); border-color: #86efac; color: var(--success); }
.sol-wrong              { background: var(--danger-bg);  border-color: #fca5a5; color: var(--danger); }
.sol-selected-correct   { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.sol-letter { font-weight: 700; min-width: 18px; }
.sol-tick   { margin-left: auto; font-weight: 700; color: var(--success); }
.sol-cross  { margin-left: auto; font-weight: 700; color: var(--danger); }

.sol-badge {
  font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 100px;
  margin-left: auto;
}
.badge-correct { background: var(--success-bg); color: var(--success); }
.badge-wrong   { background: var(--danger-bg);  color: var(--danger); }
.badge-skip    { background: var(--surface-2);  color: var(--text-m); }
.badge-partial { background: #fffbeb; color: var(--warn); }
.badge-nokey   { background: var(--surface-2);  color: var(--text-faint); }

/* ── MOBILE RESPONSIVE ──────────────────────────────── */
@media (max-width: 767px) {
  .palette-panel {
    position: fixed; left: 0; top: var(--header-h); bottom: 0;
    z-index: 500;
    transform: translateX(-100%);
  }
  .palette-panel.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }
  .palette-close  { display: block; }
  .btn-palette-toggle { display: flex; }
  .question-area { width: 100%; }
  .dash-hero      { flex-direction: column; gap: 12px; padding: 22px 22px; }
  .dash-hero-img  { display: none; }
  .question-text  { font-size: 15px; }
  /* Prevent horizontal scroll on mobile */
  .test-interface, .result-screen, .dashboard { overflow-x: hidden; }
  /* Options easier to tap */
  .option-label { padding: 12px 14px; min-height: 48px; }
  /* Result screen on mobile */
  .result-action-row { gap: 8px; }
  .btn-retake, .btn-solutions { padding: 10px 18px; font-size: 13.5px; }
}

@media (max-width: 480px) {
  .breakdown-grid { grid-template-columns: 1fr 1fr; }
  .score-number   { font-size: 40px; }
  .q-nav-bar      { padding: 12px 16px; }
  .question-card  { margin: 10px 12px; padding: 18px; }
}

/* ════════════════════════════════════════════════════
   v2 ADDITIONS: Dashboard tabs, Subject grid, Water drop toast
   ════════════════════════════════════════════════════ */

/* ── DASHBOARD LAYOUT ───────────────────────────────── */
.dash-main-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  margin-bottom: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .dash-main-grid { grid-template-columns: 1fr; }
}

.start-panel { display: flex; flex-direction: column; gap: 0; }

.name-row {
  border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
  border-bottom: none !important;
  padding-bottom: 14px !important;
}
.name-row .field-label { margin-top: 0; }

/* ── TABS ────────────────────────────────────────────── */
.dash-tabs {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-bottom: none;
}
.dash-tab {
  flex: 1;
  padding: 11px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-m);
  font-size: 13px; font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: all 0.18s;
}
.dash-tab:hover { color: var(--primary); background: #eff6ff; }
.dash-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: #eff6ff;
}

/* ── TAB CONTENT ─────────────────────────────────────── */
.tab-content.card {
  border-radius: 0 0 var(--radius-md) var(--radius-md) !important;
  border-top: none !important;
}
.tab-desc {
  font-size: 13px; color: var(--text-m);
  margin-bottom: 16px; line-height: 1.5;
}
/* Subject tab desc inherits card styling */
#tab-subject .tab-desc {
  border-radius: 0 !important;
  border: 1px solid var(--border);
  border-top: none;
  border-bottom: none;
  padding: 14px 20px;
  margin-bottom: 0;
  background: var(--surface);
}

/* ── SUBJECT GRID ────────────────────────────────────── */
.subject-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}

.subject-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  background: var(--surface);
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, transform 0.1s;
  width: 100%;
}
.subject-card:last-child { border-bottom: none; }
.subject-card:hover:not(:disabled) { background: #eff6ff; }
.subject-card:active:not(:disabled) { transform: scale(0.99); }
.subject-card:disabled, .sc-empty { opacity: 0.4; cursor: not-allowed; }

.sc-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 15px;
}
.sc-body { flex: 1; min-width: 0; }
.sc-title {
  font-size: 14px; font-weight: 700;
  color: var(--text-h);
  font-family: 'Lexend', sans-serif;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sc-count { font-size: 11px; color: var(--text-m); margin-top: 1px; }
.sc-arrow { color: var(--text-faint); font-size: 12px; flex-shrink: 0; }

/* Stats card history divider */
.history-divider {
  border: none; border-top: 1px solid var(--border);
  margin: 16px 0 14px;
}

/* ── WATER DROP TOAST ────────────────────────────────── */
.waterdrop-toast {
  position: fixed;
  top: 72px;   /* below header */
  right: 20px;
  z-index: 8000;
  width: 340px;
  max-width: calc(100vw - 32px);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.4s cubic-bezier(0.34, 1.3, 0.64, 1),
              opacity  0.35s ease;
}

.toast-hidden {
  transform: translateX(calc(100% + 28px));
  opacity: 0;
  pointer-events: none;
}
.toast-visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 14px 14px 16px;
  background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%);
  color: #fff;
}
.toast-icon-wrap {
  flex-shrink: 0;
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.toast-drop {
  font-size: 22px;
  animation: drip 1.6s ease-in-out infinite;
}
@keyframes drip {
  0%,100% { transform: translateY(0);   }
  45%      { transform: translateY(5px); }
  55%      { transform: translateY(5px); }
}

.toast-body { flex: 1; min-width: 0; }
.toast-title {
  font-family: 'Lexend', sans-serif;
  font-size: 14px; font-weight: 700;
  color: #fff; line-height: 1.2;
  margin-bottom: 4px;
}
.toast-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.78);
  line-height: 1.4;
}
.toast-sub strong { color: #bae6fd; font-weight: 700; }

.toast-close {
  flex-shrink: 0;
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 8px;
  color: rgba(255,255,255,0.7);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  cursor: pointer;
  margin-top: -2px;
  transition: background 0.2s, color 0.2s;
}
.toast-close:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* Animated progress bar that drains over 9 seconds */
.toast-progress-bar {
  height: 3px;
  background: rgba(186,230,253,0.6);
  transform-origin: left;
  animation: toast-drain 9s linear forwards;
}
@keyframes toast-drain {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* Play the progress animation only when toast is visible */
.toast-hidden .toast-progress-bar { animation-play-state: paused; }
.toast-visible .toast-progress-bar { animation-play-state: running; }


/* ════════════════════════════════════════════════════
   DARK MODE VARIABLES
   ════════════════════════════════════════════════════ */
body.dark-mode {
  --primary:       #3b82f6;
  --primary-hover: #60a5fa;
  --accent:        #38bdf8;
  --bg:            #0f172a;
  --surface:       #1e293b;
  --surface-2:     #263348;
  --border:        #334155;
  --border-focus:  #3b82f6;
  --text-h:        #f1f5f9;
  --text-b:        #cbd5e1;
  --text-m:        #94a3b8;
  --text-faint:    #64748b;
  --success:       #22c55e;
  --success-bg:    #052e16;
  --danger:        #f87171;
  --danger-bg:     #2d0b0b;
  --warn:          #fbbf24;
  --warn-bg:       #1c1107;
  --palette-bg:    #0b1120;
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.35);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.45);
  --shadow-lg:     0 8px 40px rgba(0,0,0,0.55);
}

body.dark-mode .info-pill {
  background: #1e2d45;
  border-color: #334155;
  color: #93c5fd;
}
body.dark-mode .badge-cat1 { background: #1e2d45; color: #93c5fd; border-color: #334155; }
body.dark-mode .badge-cat2 { background: #2d1f45; color: #c4b5fd; border-color: #4c3070; }
body.dark-mode .option-label:hover  { background: #1e2d45; border-color: var(--border-focus); }
body.dark-mode .option-label.selected { background: #1e2d45; }
body.dark-mode .dash-tab:hover { background: #1e2d45; }
body.dark-mode .dash-tab.active { background: #1e2d45; }
body.dark-mode .subject-card:hover:not(:disabled) { background: #1e2d45; }
body.dark-mode .sc-icon { background: linear-gradient(135deg, #1e2d45, #263348); }
body.dark-mode .btn-nav { background: var(--surface); border-color: var(--border); }
body.dark-mode .cat2-hint { background: #2d1f45; border-color: #4c3070; color: #c4b5fd; }

/* ════════════════════════════════════════════════════
   PRE-TEST CONFIRMATION MODAL
   ════════════════════════════════════════════════════ */
.pretest-overlay {
  position: fixed; inset: 0;
  background: rgba(5, 13, 30, 0.82);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 8500;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.pretest-box {
  background: var(--surface);
  border-radius: 20px;
  max-width: 520px; width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4), 0 0 0 1px var(--border);
  overflow: hidden;
  animation: modal-pop 0.35s cubic-bezier(0.34,1.4,0.64,1) both;
}
@keyframes modal-pop {
  from { transform: scale(0.88) translateY(20px); opacity:0; }
  to   { transform: scale(1) translateY(0); opacity:1; }
}

.pretest-header {
  background: linear-gradient(125deg, #1d4ed8 0%, #0369a1 100%);
  padding: 28px 28px 24px;
  text-align: center;
  position: relative;
}
.pretest-icon-ring {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: 2px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff;
  margin: 0 auto 14px;
  animation: icon-bounce 2.5s ease-in-out infinite;
}
@keyframes icon-bounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
.pretest-header h3 {
  font-size: 22px; font-weight: 800;
  color: #fff; margin-bottom: 6px;
}
.pretest-sub {
  font-size: 13px; color: rgba(255,255,255,0.75);
  font-weight: 500;
}

.pretest-rules {
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 12px;
  max-height: 340px; overflow-y: auto;
}
.pretest-rules::-webkit-scrollbar { width: 4px; }
.pretest-rules::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.rule-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border-left: 3px solid transparent;
}
.rule-icon-wrap {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.rule-body { flex: 1; }
.rule-body strong {
  display: block;
  font-size: 13.5px; font-weight: 700;
  color: var(--text-h); margin-bottom: 3px;
}
.rule-body span { font-size: 12.5px; color: var(--text-m); line-height: 1.45; }
.rule-body span b { color: var(--text-b); font-weight: 700; }

.rule-warn   { background: #fffbeb; border-left-color: #f59e0b; }
.rule-warn   .rule-icon-wrap { background: #fef3c7; color: #d97706; }
.rule-orange { background: #fff7ed; border-left-color: #f97316; }
.rule-orange .rule-icon-wrap { background: #ffedd5; color: #ea580c; }
.rule-blue   { background: #eff6ff; border-left-color: #3b82f6; }
.rule-blue   .rule-icon-wrap { background: #dbeafe; color: #1d4ed8; }
.rule-purple { background: #fdf4ff; border-left-color: #a855f7; }
.rule-purple .rule-icon-wrap { background: #f3e8ff; color: #7c3aed; }
.rule-green  { background: #f0fdf4; border-left-color: #22c55e; }
.rule-green  .rule-icon-wrap { background: #dcfce7; color: #16a34a; }

/* Dark mode rule items */
body.dark-mode .rule-warn   { background: #1c1a0a; border-left-color: #fbbf24; }
body.dark-mode .rule-warn   .rule-icon-wrap { background: #292208; color: #fbbf24; }
body.dark-mode .rule-orange { background: #1c110a; border-left-color: #fb923c; }
body.dark-mode .rule-orange .rule-icon-wrap { background: #291508; color: #fb923c; }
body.dark-mode .rule-blue   { background: #0f1e38; border-left-color: #60a5fa; }
body.dark-mode .rule-blue   .rule-icon-wrap { background: #1e2d45; color: #60a5fa; }
body.dark-mode .rule-purple { background: #1a0f2e; border-left-color: #c084fc; }
body.dark-mode .rule-purple .rule-icon-wrap { background: #2d1f45; color: #c084fc; }
body.dark-mode .rule-green  { background: #082318; border-left-color: #4ade80; }
body.dark-mode .rule-green  .rule-icon-wrap { background: #052e16; color: #4ade80; }

.pretest-actions {
  display: flex; gap: 12px;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border);
}
.pretest-btn-cancel {
  flex: 1; padding: 11px 20px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-m);
  font-size: 14px; font-weight: 700;
  transition: all 0.2s;
}
.pretest-btn-cancel:hover { border-color: var(--primary); color: var(--primary); }
.pretest-btn-start {
  flex: 2; padding: 11px 20px;
  border-radius: 10px; border: none;
  background: linear-gradient(95deg, #1d4ed8, #0369a1);
  color: #fff;
  font-size: 14px; font-weight: 700;
  box-shadow: 0 4px 16px rgba(29,78,216,0.35);
  transition: transform 0.15s, box-shadow 0.2s;
  letter-spacing: 0.2px;
}
.pretest-btn-start:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(29,78,216,0.45);
}

/* ════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════ */
.app-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  margin-top: 40px;
}
.footer-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
  text-align: center;
}
.footer-quote {
  font-family: 'Lexend', sans-serif;
  font-size: 13px; font-weight: 500;
  color: var(--text-m);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 16px;
  letter-spacing: 0.01em;
}
.footer-links {
  display: flex; align-items: center;
  gap: 10px; flex-wrap: wrap; justify-content: center;
}
.footer-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13.5px; font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  padding: 5px 12px;
  transition: background 0.18s, color 0.18s;
}
.footer-link-linkedin { color: #0a66c2; background: #e8f0fe; }
.footer-link-linkedin:hover { background: #0a66c2; color: #fff; }
body.dark-mode .footer-link-linkedin { color: #60a5fa; background: #1e2d45; }
body.dark-mode .footer-link-linkedin:hover { background: #3b82f6; color: #fff; }
.footer-link-youtube { color: #dc2626; background: #fef2f2; }
.footer-link-youtube:hover { background: #dc2626; color: #fff; }
body.dark-mode .footer-link-youtube { color: #f87171; background: #2d0b0b; }
body.dark-mode .footer-link-youtube:hover { background: #ef4444; color: #fff; }
.footer-divider { color: var(--text-faint); font-weight: 300; }
.footer-copy { font-size: 12px; color: var(--text-faint); }

/* ── COMING SOON pill ── */
.footer-coming-soon {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700;
  color: #7c3aed;
  background: linear-gradient(90deg, #fdf4ff, #ede9fe);
  border: 1.5px solid #c4b5fd;
  border-radius: 100px;
  padding: 5px 14px;
  position: relative;
  overflow: hidden;
}
body.dark-mode .footer-coming-soon {
  color: #c084fc;
  background: linear-gradient(90deg, #1a0f2e, #2d1f45);
  border-color: #6d28d9;
}
.footer-coming-soon::before {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: shimmer-slide 2.5s linear infinite;
}
@keyframes shimmer-slide {
  from { left: -100%; }
  to   { left: 200%; }
}
.coming-soon-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #7c3aed;
  animation: dot-blink 1.2s ease-in-out infinite;
  flex-shrink: 0;
}
body.dark-mode .coming-soon-dot { background: #c084fc; }
@keyframes dot-blink {
  0%,100% { opacity:1; transform: scale(1); }
  50%      { opacity:0.3; transform: scale(0.7); }
}
.coming-soon-badge {
  background: #7c3aed;
  color: #fff;
  font-size: 10px; font-weight: 800;
  padding: 2px 7px; border-radius: 100px;
  text-transform: uppercase; letter-spacing: 0.4px;
  animation: badge-glow 1.8s ease-in-out infinite;
}
body.dark-mode .coming-soon-badge { background: #6d28d9; }
@keyframes badge-glow {
  0%,100% { box-shadow: 0 0 0 0 rgba(124,58,237,0.5); }
  50%      { box-shadow: 0 0 0 5px rgba(124,58,237,0); }
}

/* ════════════════════════════════════════════════════
   HEADER ACTIONS (Notes + Admin + Theme)
   ════════════════════════════════════════════════════ */
.header-actions {
  display: flex; align-items: center; gap: 8px;
}
.header-icon-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 100px;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12);
  color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  font-family: 'Nunito', sans-serif;
}
.header-icon-btn:hover {
  background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.5);
}
.header-btn-label { font-size: 12px; }
@media(max-width:500px) { .header-btn-label { display:none; } }
.header-admin-btn {
  padding: 6px 10px; opacity: 0.5;
}
.header-admin-btn:hover { opacity: 1; }

/* Timer chip */
.timer-chip {
  display: flex; align-items: center; gap: 7px;
  background: #1e293b; color: #f8fafc;
  font-family: 'Lexend', sans-serif;
  font-size: 17px; font-weight: 600;
  padding: 5px 15px; border-radius: 100px;
  letter-spacing: 1px; border: 2px solid #334155;
  transition: background 0.4s, border-color 0.3s;
}
body.dark-mode .timer-chip { background: #0f172a; border-color: #475569; }
.timer-chip.timer-warning  { background:#dc2626!important; border-color:#b91c1c!important; animation:pulse 1s ease-in-out infinite; }
.timer-chip.timer-critical { background:#7f1d1d!important; border-color:#dc2626!important; animation:pulse 0.6s ease-in-out infinite; }
.timer-icon { font-size: 13px; opacity: 0.75; }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:.72} }

/* Scroll-wheel toggle */
.theme-wheel-btn { background:none;border:none;padding:0;cursor:pointer;outline:none;margin-left:4px; }
.wheel-track { width:52px;height:28px;border-radius:100px;background:#334155;border:2px solid #475569;position:relative;transition:background .35s,border-color .35s;box-shadow:inset 0 1px 4px rgba(0,0,0,.3); }
body:not(.dark-mode) .wheel-track { background:#dbeafe;border-color:#93c5fd; }
.wheel-thumb { position:absolute;top:2px;left:2px;width:20px;height:20px;border-radius:50%;background:linear-gradient(135deg,#1e3a8a,#3b82f6);display:flex;align-items:center;justify-content:center;transition:transform .35s cubic-bezier(.34,1.56,.64,1),background .35s;box-shadow:0 2px 6px rgba(0,0,0,.35);overflow:hidden; }
body:not(.dark-mode) .wheel-thumb { transform:translateX(24px);background:linear-gradient(135deg,#f59e0b,#fbbf24); }
.wheel-thumb .fa-moon,.wheel-thumb .fa-sun { position:absolute;font-size:10px;color:#fff;transition:opacity .25s,transform .35s; }
.wheel-thumb .fa-moon { opacity:1;transform:rotate(0); }
.wheel-thumb .fa-sun  { opacity:0;transform:rotate(-90deg); }
body:not(.dark-mode) .wheel-thumb .fa-moon { opacity:0;transform:rotate(90deg); }
body:not(.dark-mode) .wheel-thumb .fa-sun  { opacity:1;transform:rotate(0); }

/* ════════════════════════════════════════════════════
   EXTRA PRACTICE TAB
   ════════════════════════════════════════════════════ */
.tab-practice { position: relative; }
.tab-practice::after {
  content: "NEW";
  position: absolute; top: -6px; right: -4px;
  font-size: 8px; font-weight: 800;
  background: linear-gradient(90deg,#7c3aed,#a855f7);
  color: #fff; border-radius: 100px; padding: 1px 5px;
  letter-spacing: 0.4px;
}

.practice-hero {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(125deg,#7c3aed,#a855f7);
  border-radius: 12px; padding: 16px 20px; margin-bottom: 18px;
  color: #fff;
}
.practice-hero-badge {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,255,255,0.18); display: flex;
  align-items: center; justify-content: center; font-size: 20px; flex-shrink:0;
}
.practice-hero-title { font-family:'Lexend',sans-serif;font-size:16px;font-weight:700;margin-bottom:3px; }
.practice-hero-sub   { font-size:12px;opacity:.8; }

.practice-option-card {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 14px 18px; border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--surface-2);
  cursor: pointer; transition: all 0.2s;
  text-align: left;
}
.practice-option-card:hover {
  border-color: #7c3aed;
  background: #fdf4ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124,58,237,0.15);
}
body.dark-mode .practice-option-card:hover { background:#1a0f2e; }
.poc-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: linear-gradient(135deg,#7c3aed,#a855f7);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; flex-shrink:0;
}
.poc-body { flex:1; }
.poc-title { font-family:'Lexend',sans-serif;font-size:15px;font-weight:700;color:var(--text-h); }
.poc-desc  { font-size:12px;color:var(--text-m);margin-top:2px; }
.poc-badge {
  padding: 4px 12px; border-radius: 100px;
  background: linear-gradient(90deg,#7c3aed,#a855f7);
  color: #fff; font-size: 12px; font-weight: 700;
  white-space: nowrap;
}

.practice-divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-faint); font-size: 12px;
  margin: 16px 0 12px;
}
.practice-divider::before,.practice-divider::after {
  content: ''; flex:1; height: 1px; background: var(--border);
}

.practice-subject-grid {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 300px; overflow-y: auto;
}
.practice-subject-grid::-webkit-scrollbar { width:4px; }
.practice-subject-grid::-webkit-scrollbar-thumb { background:var(--border);border-radius:4px; }

.practice-subject-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface-2); cursor: pointer;
  transition: all 0.18s; text-align:left; width:100%;
}
.practice-subject-card:hover {
  border-color: #a855f7; background: #fdf4ff;
}
body.dark-mode .practice-subject-card:hover { background:#1a0f2e;border-color:#a855f7; }
.practice-subject-card:disabled { opacity:0.4; cursor:not-allowed; }
.psc-icon { width:30px;height:30px;border-radius:8px;background:linear-gradient(135deg,#fdf4ff,#ede9fe);display:flex;align-items:center;justify-content:center;color:#7c3aed;font-size:13px;flex-shrink:0; }
body.dark-mode .psc-icon { background:linear-gradient(135deg,#1a0f2e,#2d1f45); }
.psc-body { flex:1; }
.psc-title { font-size:13px;font-weight:700;color:var(--text-h); }
.psc-count { font-size:11px;color:var(--text-m); }
.psc-go    { color:var(--text-faint);font-size:12px; }
.psc-empty { opacity:0.4; }

/* ════════════════════════════════════════════════════
   NOTES MODAL
   ════════════════════════════════════════════════════ */
.notes-overlay {
  position:fixed;inset:0;background:rgba(5,13,30,.82);
  backdrop-filter:blur(6px);display:flex;align-items:center;
  justify-content:center;z-index:8500;padding:16px;
  animation:fadeInModal .2s ease;
}
@keyframes fadeInModal{from{opacity:0}to{opacity:1}}
.notes-box {
  background:var(--surface);border-radius:20px;
  max-width:600px;width:100%;max-height:90vh;
  display:flex;flex-direction:column;
  box-shadow:0 24px 64px rgba(0,0,0,.4),0 0 0 1px var(--border);
  animation:modalPop .35s cubic-bezier(.34,1.4,.64,1) both;
}
@keyframes modalPop{from{transform:scale(.88) translateY(20px);opacity:0}to{transform:scale(1) translateY(0);opacity:1}}
.notes-header {
  display:flex;align-items:center;justify-content:space-between;
  padding:20px 24px;border-bottom:1px solid var(--border);
  background:linear-gradient(125deg,#0369a1,#1d4ed8);
  border-radius:20px 20px 0 0;
}
.notes-header-left { display:flex;align-items:center;gap:14px; }
.notes-icon-ring {
  width:48px;height:48px;border-radius:12px;
  background:rgba(255,255,255,.18);border:2px solid rgba(255,255,255,.3);
  display:flex;align-items:center;justify-content:center;font-size:20px;color:#fff;
}
.notes-header h3 { font-size:20px;font-weight:700;color:#fff;margin-bottom:3px; }
.notes-sub { font-size:13px;color:rgba(255,255,255,.7); }
.notes-close-btn {
  width:34px;height:34px;border-radius:50%;border:1.5px solid rgba(255,255,255,.3);
  background:rgba(255,255,255,.12);color:#fff;font-size:14px;
  display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s;
}
.notes-close-btn:hover { background:rgba(255,255,255,.25); }

.notes-body { flex:1;overflow-y:auto;padding:20px 24px; }
.notes-add-area {
  background:var(--surface-2);border:1px solid var(--border);
  border-radius:14px;padding:16px;margin-bottom:16px;
}
.note-title-input,.note-content-input,.note-subject-select {
  width:100%;border:1.5px solid var(--border);border-radius:8px;
  padding:9px 13px;font-size:14px;outline:none;
  background:var(--surface);color:var(--text-h);
  font-family:'Nunito',sans-serif;transition:border-color .2s;margin-bottom:10px;
}
.note-title-input:focus,.note-content-input:focus { border-color:#93c5fd;box-shadow:0 0 0 3px rgba(147,197,253,.25); }
.note-content-input { resize:vertical;min-height:80px; }
.notes-add-actions { display:flex;gap:10px;align-items:center; }
.note-subject-select { margin-bottom:0;flex:1; }
.add-note-btn {
  padding:9px 20px;border-radius:8px;border:none;
  background:linear-gradient(95deg,#1d4ed8,#0369a1);
  color:#fff;font-size:13px;font-weight:700;
  white-space:nowrap;cursor:pointer;transition:transform .15s,box-shadow .2s;
}
.add-note-btn:hover { transform:translateY(-1px);box-shadow:0 4px 14px rgba(29,78,216,.35); }

.notes-filter-bar {
  display:flex;gap:6px;flex-wrap:wrap;margin-bottom:14px;
}
.note-filter-btn {
  padding:4px 12px;border-radius:100px;border:1.5px solid var(--border);
  background:var(--surface-2);color:var(--text-m);font-size:12px;font-weight:700;cursor:pointer;transition:all .18s;
}
.note-filter-btn.active,.note-filter-btn:hover {
  background:var(--primary);border-color:var(--primary);color:#fff;
}

.notes-list { display:flex;flex-direction:column;gap:10px; }
.notes-empty { text-align:center;padding:32px 16px;color:var(--text-faint); }
.notes-empty i { font-size:36px;margin-bottom:12px;display:block;opacity:.4; }
.note-card {
  background:var(--surface);border:1px solid var(--border);
  border-radius:12px;padding:14px 16px;
  transition:box-shadow .15s;
}
.note-card:hover { box-shadow:var(--shadow-sm); }
.note-card-header {
  display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:8px;
}
.note-card-meta { display:flex;align-items:center;gap:8px;flex-wrap:wrap; }
.note-card-title { font-weight:700;font-size:14px;color:var(--text-h); }
.note-subject-pill {
  font-size:11px;font-weight:600;
  background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe;
  border-radius:100px;padding:2px 8px;
}
body.dark-mode .note-subject-pill { background:#1e2d45;color:#60a5fa;border-color:#334155; }
.note-card-actions { display:flex;align-items:center;gap:8px; }
.note-date { font-size:11px;color:var(--text-faint); }
.note-delete-btn {
  width:26px;height:26px;border-radius:6px;border:none;
  background:var(--danger-bg);color:var(--danger);font-size:11px;
  display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .15s;
}
.note-delete-btn:hover { background:var(--danger);color:#fff; }
.note-card-content { font-size:13.5px;color:var(--text-b);line-height:1.6; }

/* ════════════════════════════════════════════════════
   ADMIN PANEL
   ════════════════════════════════════════════════════ */
.admin-overlay {
  position:fixed;inset:0;background:rgba(5,13,30,.88);
  backdrop-filter:blur(8px);display:flex;align-items:center;
  justify-content:center;z-index:8600;padding:16px;
  animation:fadeInModal .2s ease;
}
.admin-box {
  background:var(--surface);border-radius:20px;
  max-width:640px;width:100%;max-height:90vh;
  overflow-y:auto;
  box-shadow:0 24px 64px rgba(0,0,0,.5),0 0 0 1px var(--border);
  animation:modalPop .35s cubic-bezier(.34,1.4,.64,1) both;
}
.admin-header {
  display:flex;align-items:center;gap:14px;
  padding:20px 24px;border-bottom:1px solid var(--border);
  background:linear-gradient(125deg,#1f2937,#111827);
  border-radius:20px 20px 0 0; position:sticky;top:0;
}
.admin-icon-ring { width:46px;height:46px;border-radius:12px;background:rgba(255,255,255,.1);border:2px solid rgba(255,255,255,.2);display:flex;align-items:center;justify-content:center;font-size:20px;color:#60a5fa; }
.admin-header h3 { font-size:18px;font-weight:700;color:#f1f5f9;flex:1; }
.admin-sub { font-size:12px;color:#64748b; }
.admin-close-btn { width:32px;height:32px;border-radius:50%;border:1.5px solid #334155;background:rgba(255,255,255,.07);color:#94a3b8;font-size:13px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s; }
.admin-close-btn:hover { background:rgba(255,255,255,.15);color:#fff; }
.admin-auth { padding:32px 24px;display:flex;flex-direction:column;align-items:center;gap:14px; }
.admin-auth-label { font-size:14px;color:var(--text-m);font-weight:600; }
.admin-auth-row { display:flex;gap:10px;width:100%;max-width:360px; }
.admin-pass-input {
  flex:1;border:1.5px solid var(--border);border-radius:8px;padding:9px 13px;
  font-size:14px;outline:none;background:var(--surface-2);color:var(--text-h);
  font-family:'Nunito',sans-serif;transition:border-color .2s;
}
.admin-pass-input:focus { border-color:#60a5fa; }
.admin-login-btn { padding:9px 20px;border-radius:8px;border:none;background:linear-gradient(95deg,#1d4ed8,#0369a1);color:#fff;font-size:13px;font-weight:700;cursor:pointer; }
.admin-auth-error { font-size:13px;color:var(--danger);font-weight:600; }
.admin-content { padding:20px 24px; }
.admin-stats-grid { display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:24px; }
@media(max-width:500px){.admin-stats-grid{grid-template-columns:repeat(2,1fr)}}
.admin-stat { border-radius:12px;padding:16px;text-align:center;border:1px solid transparent; }
.admin-stat .as-icon { font-size:22px;margin-bottom:8px;display:block; }
.admin-stat .as-val { font-family:'Lexend',sans-serif;font-size:24px;font-weight:800;color:var(--text-h); }
.admin-stat .as-lbl { font-size:11px;color:var(--text-m);font-weight:600;text-transform:uppercase;letter-spacing:.4px;margin-top:4px; }
.as-blue   { background:#eff6ff;border-color:#bfdbfe; color:#1d4ed8; }
.as-green  { background:var(--success-bg);border-color:#bbf7d0;color:var(--success); }
.as-purple { background:#fdf4ff;border-color:#e9d5ff;color:#7c3aed; }
.as-orange { background:#fff7ed;border-color:#fed7aa;color:#ea580c; }
body.dark-mode .as-blue  {background:#0f1e38;border-color:#1e3a5f;}
body.dark-mode .as-green {background:#052e16;border-color:#14532d;}
body.dark-mode .as-purple{background:#1a0f2e;border-color:#4c1d95;}
body.dark-mode .as-orange{background:#1c110a;border-color:#7c2d12;}
.admin-section-title { font-size:14px;font-weight:700;color:var(--text-h);margin-bottom:12px; }
.admin-activity-list { display:flex;flex-direction:column;gap:8px;max-height:300px;overflow-y:auto; }
.admin-activity-row { display:flex;align-items:center;gap:10px;background:var(--surface-2);border:1px solid var(--border);border-radius:8px;padding:10px 14px;flex-wrap:wrap; }
.aar-user  { font-size:13px;font-weight:700;color:var(--text-h);flex:1;min-width:120px; }
.aar-label { font-size:12px;color:var(--text-m);flex:2;min-width:100px; }
.aar-score { font-family:'Lexend',sans-serif;font-size:14px;font-weight:700;color:var(--primary); }
.aar-date  { font-size:11px;color:var(--text-faint); }
.no-activity { text-align:center;color:var(--text-faint);padding:20px; }
.admin-clear-btn { margin-top:20px;padding:9px 20px;border-radius:8px;border:1.5px solid var(--danger);background:var(--danger-bg);color:var(--danger);font-size:13px;font-weight:700;cursor:pointer;transition:all .2s;width:100%; }
.admin-clear-btn:hover { background:var(--danger);color:#fff; }

/* ════════════════════════════════════════════════════
   VIVID ANALYSIS SECTION
   ════════════════════════════════════════════════════ */
.analysis-section {
  background:var(--surface);border:1px solid var(--border);
  border-radius:16px;padding:24px;margin-bottom:24px;
}
.analysis-title {
  font-family:'Lexend',sans-serif;font-size:18px;font-weight:700;
  color:var(--text-h);margin-bottom:20px;display:flex;align-items:center;
}
.analysis-grid {
  display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px;
}
@media(max-width:700px){.analysis-grid{grid-template-columns:1fr;}}

.analysis-card {
  background:var(--surface-2);border:1px solid var(--border);
  border-radius:12px;padding:18px;
}
.ac-title { font-size:13px;font-weight:700;color:var(--text-m);text-transform:uppercase;letter-spacing:.5px;margin-bottom:14px;display:block; }

/* Donut chart */
.chart-card { display:flex;flex-direction:column;align-items:center; }
.donut-wrap { position:relative;display:flex;align-items:center;justify-content:center;margin-bottom:12px; }
.donut-center {
  position:absolute;display:flex;flex-direction:column;align-items:center;justify-content:center;
  pointer-events:none;
}
.donut-pct { font-family:'Lexend',sans-serif;font-size:22px;font-weight:800;color:var(--text-h); }
.donut-lbl { font-size:10px;color:var(--text-m);font-weight:600;text-transform:uppercase;letter-spacing:.4px; }
.chart-legend { display:flex;flex-direction:column;gap:6px;width:100%; }
.legend-item { display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text-b); }
.legend-dot { width:10px;height:10px;border-radius:50%;flex-shrink:0; }
.dot-g{background:#22c55e}.dot-r{background:#ef4444}.dot-s{background:#94a3b8}

/* Metrics */
.metric-list { display:flex;flex-direction:column;gap:8px; }
.metric-item {
  display:flex;align-items:center;gap:10px;
  padding:9px 12px;border-radius:8px;border:1px solid transparent;
}
.met-icon { width:30px;height:30px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:13px;flex-shrink:0; }
.met-body { flex:1; }
.met-label { font-size:11px;color:var(--text-m);font-weight:600;text-transform:uppercase;letter-spacing:.3px; }
.met-val   { font-family:'Lexend',sans-serif;font-size:16px;font-weight:700;color:var(--text-h); }
.met-blue  {background:#eff6ff;border-color:#bfdbfe}.met-blue .met-icon{background:#dbeafe;color:#1d4ed8}
.met-green {background:var(--success-bg);border-color:#bbf7d0}.met-green .met-icon{background:#dcfce7;color:#16a34a}
.met-red   {background:var(--danger-bg);border-color:#fecaca}.met-red .met-icon{background:#fee2e2;color:#dc2626}
.met-gray  {background:var(--surface-2);border-color:var(--border)}.met-gray .met-icon{background:var(--border);color:var(--text-m)}
.met-purple{background:#fdf4ff;border-color:#e9d5ff}.met-purple .met-icon{background:#f3e8ff;color:#7c3aed}
.met-orange{background:#fff7ed;border-color:#fed7aa}.met-orange .met-icon{background:#ffedd5;color:#ea580c}
body.dark-mode .met-blue  {background:#0f1e38;border-color:#1e3a5f}
body.dark-mode .met-blue .met-icon{background:#1e2d45;color:#60a5fa}
body.dark-mode .met-green {background:#052e16;border-color:#14532d}
body.dark-mode .met-green .met-icon{background:#052e16;color:#22c55e}
body.dark-mode .met-red   {background:#2d0b0b;border-color:#7f1d1d}
body.dark-mode .met-red .met-icon{background:#450a0a;color:#f87171}
body.dark-mode .met-purple{background:#1a0f2e;border-color:#4c1d95}
body.dark-mode .met-purple .met-icon{background:#2d1f45;color:#c084fc}
body.dark-mode .met-orange{background:#1c110a;border-color:#7c2d12}
body.dark-mode .met-orange .met-icon{background:#291508;color:#fb923c}

/* Rank */
.rank-card { display:flex;flex-direction:column; }
.rank-display { text-align:center;padding:16px 8px; }
.rank-number { font-family:'Lexend',sans-serif;font-size:28px;font-weight:800;color:var(--text-h);margin-bottom:6px; }
.rank-band   { font-size:15px;font-weight:700;color:var(--text-b);margin-bottom:8px; }
.rank-desc   { font-size:12px;color:var(--text-m);line-height:1.5; }
.rank-scale  { margin-top:12px; }
.rank-bar-track { height:8px;background:var(--border);border-radius:100px;overflow:hidden;margin-bottom:4px; }
.rank-bar-fill  { height:100%;border-radius:100px;background:linear-gradient(90deg,#ef4444,#f59e0b,#22c55e);transition:width 1s ease; }
.rank-bar-labels { display:flex;justify-content:space-between;font-size:10px;color:var(--text-faint); }
.rank-disclaimer { font-size:10px;color:var(--text-faint);margin-top:8px;line-height:1.4;text-align:center; }

/* ════════════════════════════════════════════════════
/* ════════════════════════════════════════════════════
   FOOTER — NEVER LOOK BACK  (LinkedIn-style animation)
   ════════════════════════════════════════════════════ */
.app-footer {
  background:var(--surface);border-top:1px solid var(--border);
  padding:28px 24px;margin-top:40px;
}
.footer-inner { max-width:960px;margin:0 auto;display:flex;flex-direction:column;align-items:center;gap:14px;text-align:center; }

.footer-motto-wrap { display:flex;flex-direction:column;align-items:center;gap:6px;margin:4px 0; }

/* Container for the animated text */
.footer-motto-line1 {
  font-family:'Lexend',sans-serif;
  font-size:clamp(22px,4vw,36px);
  font-weight:800;
  letter-spacing:0.08em;
  text-transform:uppercase;
  display:inline-flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:0;
}
.nlb-space { display:inline-block; width:0.35em; }

/* Each character: starts invisible/shifted down */
.nlb-char {
  display:inline-block;
  opacity:0;
  transform:translateY(20px) scale(0.85);
  background:linear-gradient(135deg,#3b82f6 0%,#a855f7 50%,#ec4899 100%);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  transition:opacity 0.38s cubic-bezier(.22,1,.36,1), transform 0.38s cubic-bezier(.22,1,.36,1);
  transition-delay:calc(var(--i) * 0.055s);
}

/* When .nlb-animate is added, characters fly in */
.footer-motto-line1.nlb-animate .nlb-char {
  opacity:1;
  transform:translateY(0) scale(1);
}

/* Hover: each character gets a wave bounce */
.footer-motto-line1:hover .nlb-char {
  animation:nlbWave 0.5s cubic-bezier(.22,1,.36,1) both;
  animation-delay:calc(var(--i) * 0.04s);
}
@keyframes nlbWave {
  0%   { transform:translateY(0)     scale(1); }
  40%  { transform:translateY(-8px)  scale(1.15); }
  70%  { transform:translateY(3px)   scale(0.97); }
  100% { transform:translateY(0)     scale(1); }
}

/* Subtle pulsing underline bar (LinkedIn-style) */
.footer-motto-line1::after {
  content:'';
  display:block;
  height:3px;
  width:0%;
  background:linear-gradient(90deg,#3b82f6,#a855f7,#ec4899);
  border-radius:4px;
  margin:4px auto 0;
  transition:width 0.7s cubic-bezier(.22,1,.36,1) 0.9s;
}
.footer-motto-line1.nlb-animate::after {
  width:100%;
}

.footer-motto-line2 {
  font-size:clamp(10px,2vw,13px);
  font-weight:700;
  letter-spacing:0.25em;
  text-transform:uppercase;
  color:var(--text-m);
  position:relative;
}
.footer-motto-line2::before,.footer-motto-line2::after {
  content:'✦';
  margin:0 10px;
  color:var(--primary);
  animation:sparkle 2s ease-in-out infinite;
}
.footer-motto-line2::after { animation-delay:.5s; }
@keyframes sparkle {
  0%,100%{opacity:.3;transform:scale(1)}
  50%{opacity:1;transform:scale(1.3)}
}

.footer-quote {
  font-family:'Lexend',sans-serif;font-size:13px;font-weight:500;
  color:var(--text-m);background:var(--surface-2);
  border:1px solid var(--border);border-radius:20px;padding:6px 16px;
}
.footer-links { display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:center; }
.footer-link { display:inline-flex;align-items:center;gap:5px;font-size:13.5px;font-weight:600;text-decoration:none;border-radius:8px;padding:5px 12px;transition:background .18s,color .18s; }
.footer-link-linkedin{color:#0a66c2;background:#e8f0fe}.footer-link-linkedin:hover{background:#0a66c2;color:#fff}
body.dark-mode .footer-link-linkedin{color:#60a5fa;background:#1e2d45}
.footer-link-youtube{color:#dc2626;background:#fef2f2}.footer-link-youtube:hover{background:#dc2626;color:#fff}
body.dark-mode .footer-link-youtube{color:#f87171;background:#2d0b0b}
.footer-divider { color:var(--text-faint); }
.footer-copy { font-size:12px;color:var(--text-faint); }

/* SEO h1 visually hidden but readable by search engines */
.seo-h1 {
  position:absolute;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* ════════════════════════════════════════════════════
   TWO-OPTION CARDS (PYQ Practice / Extra Practice)
   ════════════════════════════════════════════════════ */
.main-options-wrap {
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:14px;
}
.main-opt-card {
  display:flex;
  align-items:center;
  gap:14px;
  width:100%;
  background:var(--surface-2);
  border:2px solid var(--border);
  border-radius:14px;
  padding:14px 16px;
  cursor:pointer;
  text-align:left;
  transition:border-color .2s,background .2s,transform .15s,box-shadow .2s;
  position:relative;
  overflow:hidden;
}
.main-opt-card::before {
  content:'';
  position:absolute;inset:0;
  background:linear-gradient(135deg,#3b82f620,#a855f710);
  opacity:0;
  transition:opacity .2s;
}
.main-opt-card:hover::before, .main-opt-card.active::before { opacity:1; }
.main-opt-card:hover { border-color:var(--primary);transform:translateY(-1px);box-shadow:0 4px 16px #3b82f622; }
.main-opt-card.active {
  border-color:var(--primary);
  background:linear-gradient(135deg,var(--surface-2),#eff6ff);
  box-shadow:0 4px 18px #3b82f628;
}
body.dark-mode .main-opt-card.active { background:linear-gradient(135deg,var(--surface-2),#1e3a5f); }

.moc-icon-ring {
  width:44px;height:44px;
  border-radius:12px;
  background:linear-gradient(135deg,#3b82f6,#6366f1);
  display:flex;align-items:center;justify-content:center;
  color:#fff;font-size:18px;
  flex-shrink:0;
  box-shadow:0 3px 10px #3b82f640;
}
.moc-icon-extra { background:linear-gradient(135deg,#f59e0b,#ef4444); box-shadow:0 3px 10px #f59e0b40; }

.moc-text { flex:1; display:flex;flex-direction:column;gap:2px; }
.moc-title { font-family:'Lexend',sans-serif;font-size:15px;font-weight:700;color:var(--text); }
.moc-sub   { font-size:12px;color:var(--text-m);font-weight:500; }
.moc-arrow { color:var(--text-faint);font-size:12px;transition:transform .2s; }
.main-opt-card:hover .moc-arrow, .main-opt-card.active .moc-arrow { transform:translateX(3px);color:var(--primary); }

/* ════════════════════════════════════════════════════
   PRE-TEST MODAL STYLES
   ════════════════════════════════════════════════════ */
.pretest-overlay {
  position:fixed;inset:0;background:rgba(5,13,30,.82);backdrop-filter:blur(6px);
  display:flex;align-items:center;justify-content:center;z-index:8500;padding:16px;
  animation:fadeInModal .2s ease;
}
.pretest-box { background:var(--surface);border-radius:20px;max-width:520px;width:100%;box-shadow:0 24px 64px rgba(0,0,0,.4),0 0 0 1px var(--border);overflow:hidden;animation:modalPop .35s cubic-bezier(.34,1.4,.64,1) both; }
.pretest-header { background:linear-gradient(125deg,#1d4ed8,#0369a1);padding:28px 28px 24px;text-align:center; }
.pretest-icon-ring { width:60px;height:60px;border-radius:50%;background:rgba(255,255,255,.18);border:2px solid rgba(255,255,255,.3);display:flex;align-items:center;justify-content:center;font-size:24px;color:#fff;margin:0 auto 14px;animation:iconBounce 2.5s ease-in-out infinite; }
@keyframes iconBounce{0%,100%{transform:translateY(0)}50%{transform:translateY(-5px)}}
.pretest-header h3 { font-size:22px;font-weight:800;color:#fff;margin-bottom:6px; }
.pretest-sub { font-size:13px;color:rgba(255,255,255,.75);font-weight:500; }
.pretest-rules { padding:20px 24px;display:flex;flex-direction:column;gap:10px;max-height:300px;overflow-y:auto; }
.rule-item { display:flex;align-items:flex-start;gap:12px;padding:11px 13px;border-radius:10px;border-left:3px solid transparent; }
.rule-icon-wrap { flex-shrink:0;width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px; }
.rule-body strong { display:block;font-size:13.5px;font-weight:700;color:var(--text-h);margin-bottom:2px; }
.rule-body span { font-size:12.5px;color:var(--text-m);line-height:1.4; }
.rule-body span b { color:var(--text-b);font-weight:700; }
.rule-warn{background:#fffbeb;border-left-color:#f59e0b}.rule-warn .rule-icon-wrap{background:#fef3c7;color:#d97706}
.rule-orange{background:#fff7ed;border-left-color:#f97316}.rule-orange .rule-icon-wrap{background:#ffedd5;color:#ea580c}
.rule-blue{background:#eff6ff;border-left-color:#3b82f6}.rule-blue .rule-icon-wrap{background:#dbeafe;color:#1d4ed8}
.rule-purple{background:#fdf4ff;border-left-color:#a855f7}.rule-purple .rule-icon-wrap{background:#f3e8ff;color:#7c3aed}
.rule-green{background:#f0fdf4;border-left-color:#22c55e}.rule-green .rule-icon-wrap{background:#dcfce7;color:#16a34a}
body.dark-mode .rule-warn{background:#1c1a0a;border-left-color:#fbbf24}
body.dark-mode .rule-warn .rule-icon-wrap{background:#292208;color:#fbbf24}
body.dark-mode .rule-orange{background:#1c110a;border-left-color:#fb923c}
body.dark-mode .rule-orange .rule-icon-wrap{background:#291508;color:#fb923c}
body.dark-mode .rule-blue{background:#0f1e38;border-left-color:#60a5fa}
body.dark-mode .rule-blue .rule-icon-wrap{background:#1e2d45;color:#60a5fa}
body.dark-mode .rule-purple{background:#1a0f2e;border-left-color:#c084fc}
body.dark-mode .rule-purple .rule-icon-wrap{background:#2d1f45;color:#c084fc}
body.dark-mode .rule-green{background:#082318;border-left-color:#4ade80}
body.dark-mode .rule-green .rule-icon-wrap{background:#052e16;color:#4ade80}
.pretest-actions { display:flex;gap:12px;padding:14px 22px 22px;border-top:1px solid var(--border); }
.pretest-btn-cancel { flex:1;padding:11px 20px;border-radius:10px;border:1.5px solid var(--border);background:var(--surface-2);color:var(--text-m);font-size:14px;font-weight:700;transition:all .2s;cursor:pointer; }
.pretest-btn-cancel:hover { border-color:var(--primary);color:var(--primary); }
.pretest-btn-start { flex:2;padding:11px 20px;border-radius:10px;border:none;background:linear-gradient(95deg,#1d4ed8,#0369a1);color:#fff;font-size:14px;font-weight:700;cursor:pointer;box-shadow:0 4px 16px rgba(29,78,216,.35);transition:transform .15s,box-shadow .2s; }
.pretest-btn-start:hover { transform:translateY(-1px);box-shadow:0 6px 22px rgba(29,78,216,.45); }

/* ════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ════════════════════════════════════════════════════ */
@media(max-width:768px){
  .dash-main-grid { grid-template-columns:1fr; }
  .analysis-grid  { grid-template-columns:1fr; }
  .bdgrid,.breakdown-grid { grid-template-columns:repeat(2,1fr)!important; }
  .dash-hero { padding:20px; }
  .dash-hero-img { font-size:44px; }
  .question-area { padding-bottom:0; }
  .header-inner  { padding:0 12px; }
  .logo-sub      { display:none; }
  .app-footer    { padding:20px 16px; }
  .admin-stats-grid { grid-template-columns:repeat(2,1fr); }
  .practice-options { padding:0; }
}
@media(max-width:420px){
  .dash-tabs { flex-wrap:wrap; }
  .dash-tab  { flex:1 1 33%; font-size:11px;padding:8px 4px; }
  .footer-motto-line2 { letter-spacing:.1em; }
  .notes-add-actions  { flex-direction:column; }
  .note-subject-select { margin-bottom:0; }
}

/* ════════════════════════════════════════════════════
   LOADER — CINEMATIC (compressed mirror — kept for overrides)
   ════════════════════════════════════════════════════ */
/* Overrides already handled by the dev section above */

/* ════════════════════════════════════════════════════
   NEW FEATURES — v4
   Auth Modal · eBook · Auth Chip · Rank Improvements
   All rules use CSS vars → auto light/dark compatible
   ════════════════════════════════════════════════════ */

/* ── AUTH MODAL ─────────────────────────────────── */
.auth-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 8500; backdrop-filter: blur(6px);
  padding: 16px;
}
.auth-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 420px;
  padding: 32px 28px;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { opacity:0; transform:translateY(24px) scale(0.97); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}
.auth-logo {
  text-align: center; margin-bottom: 24px;
}
.auth-logo-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff; margin-bottom: 8px;
  box-shadow: 0 4px 16px rgba(29,78,216,0.3);
}
.auth-logo-text {
  font-family: 'Lexend', sans-serif; font-size: 22px;
  font-weight: 800; color: var(--text-h); letter-spacing: -0.5px;
}
.auth-logo-text span { color: var(--accent); }
.auth-logo-sub { font-size: 12px; color: var(--text-m); }

.auth-tabs {
  display: flex; gap: 0;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 3px; margin-bottom: 20px;
  border: 1px solid var(--border);
}
.auth-tab {
  flex: 1; padding: 8px 12px;
  border: none; background: transparent;
  border-radius: calc(var(--radius-sm) - 2px);
  font-size: 13px; font-weight: 600;
  color: var(--text-m); transition: all 0.2s;
}
.auth-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.auth-panel.hidden { display: none; }
.auth-field { margin-bottom: 14px; }
.auth-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-m); margin-bottom: 5px;
}
.auth-label i { margin-right: 5px; }
.auth-input {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-b); font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.auth-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,0.12);
}
.auth-error {
  font-size: 12px; color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid rgba(220,38,38,0.2);
  border-radius: 6px; padding: 7px 10px;
  margin-bottom: 10px;
}
.auth-submit-btn {
  width: 100%; padding: 11px;
  background: linear-gradient(135deg, var(--primary), #1e40af);
  color: #fff; font-size: 14px; font-weight: 700;
  border: none; border-radius: var(--radius-sm);
  margin-top: 4px; margin-bottom: 8px;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 3px 12px rgba(29,78,216,0.28);
}
.auth-submit-btn:hover { opacity:0.92; transform: translateY(-1px); }
.auth-submit-btn:disabled { opacity:0.6; cursor:not-allowed; transform:none; }
.auth-guest-btn {
  width: 100%; padding: 9px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-m); font-size: 13px; font-weight: 600;
  margin-bottom: 12px; transition: all 0.2s;
}
.auth-guest-btn:hover { border-color: var(--accent); color: var(--accent); }
.auth-hint { font-size: 12px; color: var(--text-m); text-align: center; }
.auth-hint a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-firebase-notice {
  margin-top: 16px; padding: 10px 12px;
  background: var(--warn-bg); border: 1px solid rgba(217,119,6,0.25);
  border-radius: 8px; font-size: 12px; color: var(--warn);
  text-align: center;
}
.auth-firebase-notice code {
  background: rgba(217,119,6,0.1); padding: 1px 4px;
  border-radius: 4px; font-size: 11px;
}

/* Dark mode overrides */
body.dark-mode .auth-box { background: var(--surface); }
body.dark-mode .auth-input { background: var(--surface-2); }

/* ── AUTH USER CHIP (Header) ────────────────────── */
.auth-user-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 100px; padding: 4px 12px 4px 8px;
  font-size: 13px; color: var(--text-b); font-weight: 600;
}
.auth-user-chip i { color: var(--accent); font-size: 15px; }
.auth-chip-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-chip-logout {
  background: none; border: none; padding: 0 0 0 4px;
  color: var(--text-faint); font-size: 12px;
  transition: color 0.2s;
}
.auth-chip-logout:hover { color: var(--danger); }
.auth-login-btn { color: var(--accent) !important; }

/* ── EBOOK MODAL ─────────────────────────────────── */
.ebook-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: stretch; justify-content: center;
  z-index: 8000; backdrop-filter: blur(4px);
  padding: 20px;
}
.ebook-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 1100px;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  overflow: hidden;
  animation: slideUp 0.3s ease;
  max-height: calc(100vh - 40px);
}
.ebook-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
  flex-shrink: 0;
}
.ebook-header-left { display: flex; align-items: center; gap: 14px; }
.ebook-icon-ring {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
}
.ebook-header h3 { font-size: 16px; color: #fff; margin: 0; }
.ebook-sub { font-size: 12px; color: rgba(255,255,255,0.7); margin: 0; }
.ebook-close-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none; color: #fff; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.ebook-close-btn:hover { background: rgba(255,255,255,0.3); }

.ebook-layout {
  display: flex; flex: 1; overflow: hidden; min-height: 0;
}

/* Sidebar */
.ebook-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.ebook-search-wrap {
  position: relative; padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ebook-search-icon {
  position: absolute; left: 19px; top: 50%; transform: translateY(-50%);
  color: var(--text-m); font-size: 12px;
}
.ebook-search-input {
  width: 100%; padding: 7px 8px 7px 28px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface); color: var(--text-b);
  font-size: 13px; outline: none;
}
.ebook-search-input:focus { border-color: var(--accent); }
.ebook-chapter-list {
  flex: 1; overflow-y: auto; padding: 8px 6px;
}
.ebook-chapter-btn {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 8px;
  background: transparent; border: none;
  color: var(--text-b); font-size: 13px; font-weight: 500;
  text-align: left; margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}
.ebook-chapter-btn:hover { background: var(--bg); }
.ebook-chapter-btn.active {
  background: linear-gradient(90deg, rgba(29,78,216,0.12), rgba(14,165,233,0.06));
  color: var(--primary); font-weight: 700;
  border-left: 3px solid var(--primary);
}
.ec-icon { font-size: 13px; opacity: 0.7; flex-shrink: 0; }
.ebook-chapter-btn.active .ec-icon { opacity: 1; color: var(--primary); }

/* Content area */
.ebook-content-wrap {
  flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
}
.ebook-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ebook-toolbar-title {
  font-size: 13px; font-weight: 700; color: var(--text-h);
}
.ebook-toolbar-actions { display: flex; align-items: center; gap: 6px; }
.ebook-tool-btn {
  width: 30px; height: 30px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-m); font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.ebook-tool-btn:hover { border-color: var(--accent); color: var(--accent); }
.ebook-font-label { font-size: 12px; color: var(--text-m); min-width: 32px; text-align: center; }

.ebook-content {
  flex: 1; overflow-y: auto; padding: 24px 32px;
  font-size: 16px; line-height: 1.75;
  color: var(--text-b);
  scroll-behavior: smooth;
}

/* eBook Welcome screen */
.ebook-welcome {
  text-align: center; padding: 48px 24px;
}
.ebook-welcome-icon {
  font-size: 52px; color: var(--primary);
  margin-bottom: 16px; opacity: 0.7;
}
.ebook-welcome h3 { font-size: 20px; margin-bottom: 8px; }
.ebook-welcome p { color: var(--text-m); margin-bottom: 24px; }
.ebook-subject-pills {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.ebook-pill-btn {
  padding: 7px 14px;
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 100px; font-size: 12px; font-weight: 600;
  color: var(--text-b); transition: all 0.2s;
}
.ebook-pill-btn:hover {
  border-color: var(--primary); color: var(--primary);
  background: rgba(29,78,216,0.06);
  transform: translateY(-1px);
}
.ebook-pill-btn i { margin-right: 5px; }

/* Markdown rendered content */
.ebook-chapter-wrap { max-width: 780px; margin: 0 auto; }
.md-h1 { font-size: 1.8em; font-weight: 800; color: var(--primary); margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.md-h2 { font-size: 1.35em; font-weight: 700; color: var(--text-h); margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.md-h3 { font-size: 1.1em; font-weight: 700; color: var(--primary); margin: 20px 0 8px; }
.md-h4 { font-size: 1em; font-weight: 700; color: var(--accent); margin: 16px 0 6px; }
/* marked.js generates h1-h4 directly */
.ebook-chapter-markdown h1 { font-size:1.8em;font-weight:800;color:var(--primary);margin:0 0 12px;padding-bottom:8px;border-bottom:2px solid var(--border); }
.ebook-chapter-markdown h2 { font-size:1.35em;font-weight:700;color:var(--text-h);margin:28px 0 10px;padding-bottom:6px;border-bottom:1px solid var(--border); }
.ebook-chapter-markdown h3 { font-size:1.1em;font-weight:700;color:var(--primary);margin:20px 0 8px; }
.ebook-chapter-markdown h4 { font-size:1em;font-weight:700;color:var(--accent);margin:16px 0 6px; }
.ebook-chapter-markdown p { margin: 0 0 12px; }
.ebook-chapter-markdown ul, .ebook-chapter-markdown ol, .md-ul { padding-left: 20px; margin: 8px 0 14px; }
.ebook-chapter-markdown li { margin-bottom: 4px; }
.ebook-chapter-markdown strong { font-weight: 700; color: var(--text-h); }
.ebook-chapter-markdown em { font-style: italic; color: var(--text-m); }
.ebook-chapter-markdown hr, .md-hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.ebook-chapter-markdown a { color: var(--accent); text-decoration: underline; }
.md-inline-code, .ebook-chapter-markdown code:not(pre code) {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px;
  font-size: 0.88em; font-family: 'Courier New', monospace;
  color: var(--danger); word-break: break-word;
}
body.dark-mode .md-inline-code,
body.dark-mode .ebook-chapter-markdown code:not(pre code) { color: #f87171; }
.md-pre, .ebook-chapter-markdown pre {
  background: #0f172a; color: #e2e8f0;
  border-radius: 10px; padding: 16px 18px;
  overflow-x: auto; font-size: 0.85em;
  font-family: 'Courier New', monospace;
  line-height: 1.6; margin: 14px 0;
  border: 1px solid rgba(255,255,255,0.07);
}
body:not(.dark-mode) .md-pre,
body:not(.dark-mode) .ebook-chapter-markdown pre {
  background: #1e293b;
}
.ebook-chapter-markdown pre code { background:none; border:none; padding:0; color:inherit; }
.md-table-wrap, .ebook-chapter-markdown table { overflow-x: auto; display: block; margin: 14px 0; }
.md-table, .ebook-chapter-markdown table {
  border-collapse: collapse; width: 100%; font-size: 13px;
}
.md-table th, .md-table td,
.ebook-chapter-markdown th, .ebook-chapter-markdown td {
  border: 1px solid var(--border);
  padding: 8px 12px; text-align: left;
}
.md-table thead tr, .ebook-chapter-markdown thead tr {
  background: var(--primary); color: #fff;
}
.ebook-chapter-markdown tbody tr:nth-child(even),
.md-table tbody tr:nth-child(even) { background: var(--surface-2); }
/* Blockquotes */
.ebook-chapter-markdown blockquote {
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  padding: 10px 16px; border-radius: 0 8px 8px 0;
  color: var(--text-m); margin: 12px 0;
  font-style: italic;
}

/* ── RANK IMPROVEMENTS ──────────────────────────── */
.rank-admission {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600; margin-bottom: 10px;
}
.rank-in  { background: var(--success-bg); color: var(--success); }
.rank-out { background: var(--danger-bg);  color: var(--danger);  }
.rank-stats-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 10px 0 8px;
}
.rank-stat-pill {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 100px; font-size: 11px;
  color: var(--text-m); font-weight: 600;
}
.rank-stat-pill i { font-size: 10px; color: var(--accent); }

/* ── FIRESTORE ADMIN SECTION ────────────────────── */
.admin-firestore-section { margin-top: 16px; }
.admin-firestore-section .admin-section-title { margin-top: 12px; }
.fs-user-grid {
  display: flex; flex-direction: column; gap: 6px;
}
.fs-user-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px;
}
.fsu-icon { font-size: 22px; color: var(--accent); }
.fsu-info { flex: 1; min-width: 0; }
.fsu-name { font-size: 13px; font-weight: 700; color: var(--text-h); }
.fsu-email { font-size: 11px; color: var(--text-m); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fsu-seen { font-size: 11px; color: var(--text-faint); flex-shrink: 0; }
.fs-summary {
  display: flex; gap: 16px; padding: 8px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 8px;
  font-size: 13px; font-weight: 600; color: var(--text-m);
}
.fs-summary i { color: var(--accent); margin-right: 5px; }
.mt-3 { margin-top: 16px; }

/* ── DARK MODE SPECIFICS for new components ──── */
body.dark-mode .ebook-sidebar { background: var(--surface-2); }
body.dark-mode .ebook-search-input { background: var(--surface); }
body.dark-mode .ebook-chapter-btn:hover { background: rgba(255,255,255,0.04); }
body.dark-mode .auth-tabs { background: rgba(255,255,255,0.04); }
body.dark-mode .auth-tab.active { background: var(--surface); }
body.dark-mode .ebook-chapter-markdown tbody tr:nth-child(even) { background: rgba(255,255,255,0.04); }
body.dark-mode .ebook-chapter-markdown thead tr { background: var(--primary); }
body.dark-mode .md-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.04); }
body.dark-mode .fs-user-card { background: rgba(255,255,255,0.04); }
body.dark-mode .fs-summary { background: rgba(255,255,255,0.04); }
body.dark-mode .auth-user-chip { background: rgba(255,255,255,0.06); }

/* ── MOBILE RESPONSIVE ──────────────────────────── */
@media (max-width: 640px) {
  .ebook-overlay { padding: 0; }
  .ebook-box { border-radius: 0; max-height: 100vh; }
  .ebook-sidebar { width: 180px; }
  .ebook-content { padding: 16px; }
  .auth-box { padding: 24px 18px; }
  .ebook-chapter-btn { font-size: 12px; padding: 8px; }
  .auth-user-chip { display: none; }
}
@media (max-width: 480px) {
  .ebook-sidebar { display: none; }
  .ebook-layout { flex-direction: column; }
}

/* ════════════════════════════════════════════════════════════════
   THREE.JS 3D BACKGROUND + GLASSMORPHISM + PROFESSIONAL GRADING
   ════════════════════════════════════════════════════════════════ */

/* ── 3D Canvas (main page background) ──────────────────────── */
#three-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -1;          /* Sits behind all content, above body bg */
  pointer-events: none;
  display: block;
}

/* ── 3D Loader Intro Canvas ─────────────────────────────────── */
.loader-3d-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 1; display: block;
  opacity: 0.72;
}
/* All loader children sit above the 3D canvas */
.loader-stars, .ldr-grain, .ldr-bar,
.ldr-production, .ldr-center, .ldr-status-strip,
.loader-shape, .loader-scan-line, .loader-bracket { position: relative; z-index: 5; }
.ldr-bar { position: absolute; z-index: 8; }
.loader-scan-line, .loader-bracket { position: absolute; }
/* Mobile loader adjustments */
@media (max-width: 480px) {
  .ldr-icon-wrap       { width: 120px; height: 120px; }
  .ldr-ring-1          { width: 120px; height: 120px; }
  .ldr-ring-2          { width:  92px; height:  92px; }
  .ldr-ring-3          { width:  66px; height:  66px; }
  .ldr-core-glow-wrap  { width: 48px;  height: 48px; }
  .ldr-brain           { font-size: 22px; }
  .ldr-title-row       { font-size: clamp(36px,12vw,52px); }
  .ldr-progress-track  { width: 200px; }
  .ldr-production      { margin-bottom: 16px; }
  .ldr-center          { gap: 18px; margin-bottom: 22px; }
  .ldr-bar-top, .ldr-bar-bot { height: 36px; }
}

/* ── Enhanced Body Backgrounds ─────────────────────────────── */
body:not(.dark-mode) {
  background: linear-gradient(155deg, #dde9ff 0%, #eef3ff 35%, #e5f0fe 70%, #dde9ff 100%);
  background-attachment: fixed;
}
body.dark-mode {
  background: linear-gradient(155deg, #060d1e 0%, #0a1328 35%, #0f172a 70%, #080f1e 100%);
  background-attachment: fixed;
}

/* ── Glassmorphism — Light Mode ────────────────────────────── */
body:not(.dark-mode) .app-header {
  background: rgba(248, 252, 255, 0.92) !important;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(190, 215, 255, 0.7) !important;
  box-shadow: 0 1px 16px rgba(30, 64, 200, 0.09) !important;
}
body:not(.dark-mode) .card {
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-color: rgba(200, 220, 255, 0.65) !important;
  box-shadow: 0 2px 16px rgba(29, 78, 216, 0.08) !important;
}
body:not(.dark-mode) .app-footer {
  background: rgba(248, 252, 255, 0.90) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(200, 220, 255, 0.6) !important;
}

/* ── Light Mode — Ensure all text is readable ──────────────── */
body:not(.dark-mode) .logo-title,
body:not(.dark-mode) .logo-sub { color: var(--text-h) !important; }

body:not(.dark-mode) .dash-tab { color: var(--text-m) !important; background: transparent; }
body:not(.dark-mode) .dash-tab:hover { background: rgba(239, 246, 255, 0.90) !important; }
body:not(.dark-mode) .dash-tab.active {
  color: var(--primary) !important;
  background: rgba(239, 246, 255, 0.95) !important;
}

body:not(.dark-mode) .subject-card { background: rgba(255,255,255,0.85) !important; }
body:not(.dark-mode) .subject-card:hover:not(:disabled) { background: rgba(239,246,255,0.95) !important; }

body:not(.dark-mode) .sc-title  { color: var(--text-h)  !important; }
body:not(.dark-mode) .sc-count  { color: var(--text-m)  !important; }

/* Question card */
body:not(.dark-mode) .question-card {
  background: rgba(255, 255, 255, 0.90) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(200, 220, 255, 0.55) !important;
}
body:not(.dark-mode) .question-text { color: var(--text-h) !important; }
body:not(.dark-mode) .option-label  {
  background: rgba(248, 252, 255, 0.88) !important;
  border-color: rgba(200, 220, 255, 0.6) !important;
  color: var(--text-b) !important;
}
body:not(.dark-mode) .option-label:hover {
  background: rgba(239, 246, 255, 0.95) !important;
  border-color: var(--border-focus) !important;
}

/* Palette */
body:not(.dark-mode) .palette-panel {
  background: rgba(245, 248, 255, 0.94) !important;
  backdrop-filter: blur(14px);
  border-right: 1px solid rgba(200, 220, 255, 0.6) !important;
}

/* Solution cards */
body:not(.dark-mode) .sol-card {
  background: rgba(255,255,255,0.88) !important;
  border-color: rgba(200,220,255,0.55) !important;
}
body:not(.dark-mode) .sol-option { background: rgba(248,252,255,0.88) !important; }

/* Breadkdown grid items — ensure light bg is opaque enough */
body:not(.dark-mode) .bd-blue   { background: #eff6ff !important; }
body:not(.dark-mode) .bd-purple { background: #fdf4ff !important; }
body:not(.dark-mode) .bd-green  { background: #f0fdf4 !important; }
body:not(.dark-mode) .bd-red    { background: #fef2f2 !important; }
body:not(.dark-mode) .bd-gray   { background: #f8fafc !important; }
body:not(.dark-mode) .bd-teal   { background: #f0fdfa !important; }

/* Tab-content card panels */
body:not(.dark-mode) .tab-content.card { background: rgba(255,255,255,0.92) !important; }
body:not(.dark-mode) .dash-tabs        { background: rgba(248,252,255,0.90) !important; }

/* Auth box — ensure opaque in light mode */
body:not(.dark-mode) .auth-box {
  background: rgba(255,255,255,0.97) !important;
  box-shadow: 0 24px 64px rgba(29,78,216,0.15), 0 0 0 1px rgba(200,220,255,0.5) !important;
}
body:not(.dark-mode) .auth-input {
  background: #f8fafc !important;
  border-color: #d1d9f0 !important;
  color: var(--text-h) !important;
}
body:not(.dark-mode) .auth-input:focus { border-color: var(--border-focus) !important; }

/* Timer chip — keep dark (high contrast clock) but improve border in light */
body:not(.dark-mode) .timer-chip {
  background: #1e3a8a !important;
  color: #f0f9ff !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 2px 10px rgba(29,78,216,0.28) !important;
}

/* Stats/analysis section */
body:not(.dark-mode) .analysis-section {
  background: rgba(255,255,255,0.88) !important;
  border-color: rgba(200,220,255,0.55) !important;
}
body:not(.dark-mode) .analysis-card {
  background: rgba(248,252,255,0.90) !important;
}

/* Result screen */
body:not(.dark-mode) .result-screen {
  /* inherits body bg — nothing needed */
}

/* Waterdrop toast always dark (intentional) */
/* Security overlay */
body:not(.dark-mode) .security-box {
  background: #ffffff !important;
  box-shadow: 0 24px 64px rgba(29,78,216,0.18) !important;
}

/* Main option card */
body:not(.dark-mode) .main-opt-card {
  background: rgba(255,255,255,0.88) !important;
  border-color: rgba(200,220,255,0.60) !important;
}
body:not(.dark-mode) .main-opt-card.active {
  background: rgba(239,246,255,0.96) !important;
  border-color: var(--primary) !important;
}

/* Pretest modal */
body:not(.dark-mode) .pretest-box { background: #ffffff !important; }

/* Notes / Admin modals */
body:not(.dark-mode) .notes-box  { background: #ffffff !important; }
body:not(.dark-mode) .admin-box  { background: #ffffff !important; }
body:not(.dark-mode) .ebook-box  { background: #ffffff !important; }

/* ── Glassmorphism — Dark Mode ─────────────────────────────── */
body.dark-mode .app-header {
  background: rgba(10, 18, 38, 0.82) !important;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom-color: rgba(51, 65, 85, 0.6) !important;
}
body.dark-mode .card {
  background: rgba(18, 28, 52, 0.76) !important;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-color: rgba(51, 65, 85, 0.55) !important;
}
body.dark-mode .app-footer {
  background: rgba(10, 18, 38, 0.80) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top-color: rgba(51, 65, 85, 0.5) !important;
}

/* ── Enhanced Hero Banner ──────────────────────────────────── */
.dash-hero {
  background: linear-gradient(130deg, #1d4ed8 0%, #0284c7 55%, #0ea5e9 100%) !important;
  box-shadow: 0 8px 40px rgba(29,78,216,0.28), 0 2px 8px rgba(0,0,0,0.1);
}
body.dark-mode .dash-hero {
  background: linear-gradient(130deg, #1e3a8a 0%, #1d4ed8 55%, #0284c7 100%) !important;
  box-shadow: 0 8px 40px rgba(59,130,246,0.22);
}

/* ── Smooth Global Transitions ─────────────────────────────── */
body, body * {
  transition-property: background-color, border-color, color, box-shadow, opacity;
  transition-duration: 0.2s;
  transition-timing-function: ease;
}
/* But don't slow down transforms/animations */
body *, body *::before, body *::after {
  will-change: auto;
}

/* ── Elevated Card Hover ───────────────────────────────────── */
.card {
  transition: box-shadow 0.28s ease, transform 0.22s ease,
              background 0.25s ease, border-color 0.22s ease !important;
}
.dash-main-grid .card:hover {
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(59,130,246,0.12);
  transform: translateY(-2px);
}
body.dark-mode .dash-main-grid .card:hover {
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(59,130,246,0.18);
}

/* ── Subject Card 3D Lift ──────────────────────────────────── */
.subject-card {
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.25s ease, background 0.22s ease !important;
}
.subject-card:hover:not(:disabled) {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 10px 28px rgba(29,78,216,0.18), 0 2px 8px rgba(0,0,0,0.08);
}
body.dark-mode .subject-card:hover:not(:disabled) {
  box-shadow: 0 10px 28px rgba(59,130,246,0.20);
}

/* ── Year/Tab Button Micro-animations ──────────────────────── */
.year-btn, .dash-tab {
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1) !important;
}
.year-btn:hover:not(.active) { transform: translateY(-1px) scale(1.03); }
.year-btn.active             { transform: scale(1.04); }

/* ── Main Option Cards ─────────────────────────────────────── */
.main-opt-card {
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.25s ease, border-color 0.22s ease,
              background 0.22s ease !important;
}
.main-opt-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(29,78,216,0.13);
  border-color: var(--primary) !important;
}
.main-opt-card.active {
  transform: translateY(-1px);
}
body.dark-mode .main-opt-card:hover {
  box-shadow: 0 8px 28px rgba(59,130,246,0.18);
}

/* ── Btn-start glow pulse ──────────────────────────────────── */
.btn-start {
  position: relative; overflow: hidden;
}
.btn-start::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
.btn-start:hover::after { transform: translateX(100%); }

/* ── Palette Button 3D ─────────────────────────────────────── */
.palette-btn {
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1),
              background 0.15s ease !important;
}
.palette-btn:hover { transform: scale(1.12); }

/* ── Result Screen Hero ────────────────────────────────────── */
.result-hero-section {
  background: linear-gradient(135deg,
    rgba(29,78,216,0.07) 0%,
    rgba(14,165,233,0.05) 100%) !important;
  border: 1px solid rgba(59,130,246,0.12);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
}
body.dark-mode .result-hero-section {
  background: linear-gradient(135deg,
    rgba(59,130,246,0.09) 0%,
    rgba(56,189,248,0.06) 100%) !important;
  border-color: rgba(59,130,246,0.18);
}

/* ── Enhanced Scrollbars ───────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.38);
  border-radius: 100px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.65); }
body.dark-mode ::-webkit-scrollbar-thumb { background: rgba(71,85,105,0.55); }
body.dark-mode ::-webkit-scrollbar-thumb:hover { background: rgba(71,85,105,0.8); }

/* ── Screen Entrance Animation ─────────────────────────────── */
.screen {
  animation: screen3dIn 0.35s cubic-bezier(0.22,1,0.36,1) both !important;
}
@keyframes screen3dIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── Header Icons Enhanced ─────────────────────────────────── */
.header-icon-btn {
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1),
              background 0.18s ease, box-shadow 0.2s ease !important;
}
.header-icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(29,78,216,0.16);
}

/* ── Contact Button in Header ──────────────────────────────── */
.contact-hdr-btn {
  background: linear-gradient(135deg,
    rgba(29,78,216,0.09) 0%,
    rgba(14,165,233,0.09) 100%) !important;
  border: 1.5px solid rgba(59,130,246,0.22) !important;
  color: var(--primary) !important;
}
.contact-hdr-btn:hover {
  background: linear-gradient(135deg,
    rgba(29,78,216,0.20) 0%,
    rgba(14,165,233,0.20) 100%) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 4px 16px rgba(29,78,216,0.22) !important;
}
body.dark-mode .contact-hdr-btn {
  background: linear-gradient(135deg,
    rgba(59,130,246,0.12) 0%,
    rgba(56,189,248,0.12) 100%) !important;
  border-color: rgba(59,130,246,0.28) !important;
  color: #60a5fa !important;
}
body.dark-mode .contact-hdr-btn:hover {
  background: linear-gradient(135deg,
    rgba(59,130,246,0.25) 0%,
    rgba(56,189,248,0.22) 100%) !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 4px 16px rgba(59,130,246,0.28) !important;
}

/* ════════════════════════════════════════════════════════════════
   CONTACT US MODAL
   ════════════════════════════════════════════════════════════════ */
.contact-overlay {
  position: fixed; inset: 0;
  background: rgba(5,13,30,0.72);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  display: flex; align-items: center; justify-content: center;
  z-index: 8800; padding: 16px;
  animation: fadeIn 0.22s ease;
}

.contact-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 500px;
  max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-lg),
              0 0 0 1px rgba(59,130,246,0.08),
              0 0 60px rgba(29,78,216,0.10);
  border: 1px solid var(--border);
  animation: contactSlideUp 0.32s cubic-bezier(0.22,1,0.36,1);
}
@keyframes contactSlideUp {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.contact-header {
  display: flex; align-items: center; gap: 14px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--surface);
  z-index: 1;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.contact-icon-ring {
  width: 48px; height: 48px; flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px;
  box-shadow: 0 4px 16px rgba(29,78,216,0.32);
}
.contact-header-text { flex: 1; min-width: 0; }
.contact-header h3   { font-size: 17px; margin-bottom: 2px; }
.contact-sub         { font-size: 12px; color: var(--text-m); }
.contact-close-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text-m); font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s !important;
}
.contact-close-btn:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }

.contact-body { padding: 18px 22px 22px; }

.contact-info-banner {
  background: linear-gradient(135deg,
    rgba(29,78,216,0.07) 0%,
    rgba(14,165,233,0.07) 100%);
  border: 1px solid rgba(59,130,246,0.18);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px; color: var(--text-m);
  margin-bottom: 18px; line-height: 1.55;
}
.contact-info-banner i      { color: var(--accent); margin-right: 6px; }
.contact-info-banner strong { color: var(--text-h); }
body.dark-mode .contact-info-banner {
  background: rgba(59,130,246,0.07);
  border-color: rgba(59,130,246,0.2);
}

.contact-field { margin-bottom: 13px; }
.contact-label {
  display: block;
  font-size: 11.5px; font-weight: 700;
  color: var(--text-m); text-transform: uppercase;
  letter-spacing: 0.55px; margin-bottom: 6px;
}
.contact-label i { margin-right: 5px; opacity: 0.8; }

.contact-input {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-size: 14px; font-family: inherit;
  color: var(--text-h); outline: none;
  transition: border-color 0.18s, box-shadow 0.18s !important;
  appearance: none;
}
.contact-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.14);
}
.contact-select { cursor: pointer; }
.contact-textarea {
  resize: vertical; min-height: 88px; line-height: 1.55;
}

.contact-actions {
  display: flex; gap: 10px; margin-top: 20px;
}
.contact-btn-cancel {
  flex: 1; padding: 11px 10px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-m); font-size: 14px;
  font-weight: 600; font-family: inherit;
  transition: all 0.18s !important;
}
.contact-btn-cancel:hover {
  border-color: var(--text-m); color: var(--text-h);
  background: var(--surface);
}
.contact-btn-send {
  flex: 2; padding: 11px 10px;
  background: linear-gradient(95deg, #1d4ed8, #0369a1);
  border: none; border-radius: var(--radius-sm);
  color: #fff; font-size: 14px; font-weight: 700;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(29,78,216,0.28);
  position: relative; overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s ease !important;
}
.contact-btn-send::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.18) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.45s ease;
}
.contact-btn-send:hover::after { transform: translateX(100%); }
.contact-btn-send:hover  { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(29,78,216,0.38); }
.contact-btn-send:active { transform: translateY(0); }

.contact-alt-links {
  display: flex; gap: 10px; margin-top: 16px;
  justify-content: center; flex-wrap: wrap;
}
.contact-alt-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
  text-decoration: none;
  padding: 6px 14px; border-radius: 100px;
  border: 1.5px solid var(--border);
  color: var(--text-m);
  transition: all 0.18s !important;
}
.contact-alt-link:hover {
  border-color: var(--primary); color: var(--primary);
  background: rgba(29,78,216,0.06);
  transform: translateY(-1px);
}
body.dark-mode .contact-alt-link:hover {
  background: rgba(59,130,246,0.10);
}

/* ── Dark mode contact box adjustments ─────────────────────── */
body.dark-mode .contact-box {
  box-shadow: var(--shadow-lg),
              0 0 0 1px rgba(59,130,246,0.10),
              0 0 60px rgba(15,23,42,0.8);
}
body.dark-mode .contact-header { background: var(--surface); }

/* ── Responsive Contact Modal ──────────────────────────────── */
@media (max-width: 600px) {
  .contact-overlay  { padding: 0; align-items: flex-end; }
  .contact-box      {
    max-width: 100%; max-height: 94vh;
    border-radius: 22px 22px 0 0;
  }
  .contact-header   { border-radius: 22px 22px 0 0; padding: 18px 18px 14px; }
  .contact-body     { padding: 14px 18px 20px; }
  .contact-actions  { flex-direction: column; }
  .contact-btn-send, .contact-btn-cancel { flex: none; width: 100%; }
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE SMOOTHNESS IMPROVEMENTS
   ════════════════════════════════════════════════════════════════ */

/* Fluid type scaling */
.dash-hero-text h2  { font-size: clamp(20px, 4vw, 28px); }
.logo-title         { font-size: clamp(17px, 3vw, 21px); }

/* Touch target improvements on mobile */
@media (max-width: 768px) {
  .year-btn   { min-height: 40px; }
  .dash-tab   { min-height: 40px; }
  .btn-nav    { min-height: 44px; }
  .palette-btn { min-width: 40px; min-height: 40px; }

  /* Reduce glassmorphism blur on mobile for performance */
  body:not(.dark-mode) .app-header,
  body.dark-mode       .app-header {
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
  }
  body:not(.dark-mode) .card,
  body.dark-mode       .card {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  #three-canvas { display: none !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Rank Analysis — College & Target Tables ────────────────── */
.rank-college-table {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 14px;
}
.rank-college-title {
  padding: 10px 14px;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.rank-college-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-wrap: wrap;
}
.rank-college-row:last-child { border-bottom: none; }
.rank-col-name { color: var(--text-b); font-weight: 500; flex: 1; min-width: 150px; }
.rank-col-status { font-weight: 600; font-size: 12.5px; flex-shrink: 0; }
body.dark-mode .rank-college-table { background: rgba(255,255,255,0.03); }
body.dark-mode .rank-college-title { background: rgba(255,255,255,0.05); }

.rank-target-section { margin-bottom: 14px; }
.rank-section-title {
  font-weight: 700; font-size: 13px;
  color: var(--text-h); margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.rank-target-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}
.rank-target-table th {
  background: var(--surface);
  padding: 8px 12px;
  text-align: left;
  font-weight: 700;
  color: var(--text-m);
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}
.rank-target-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-b);
}
.rank-target-table tr:last-child td { border-bottom: none; }
body.dark-mode .rank-target-table { background: rgba(255,255,255,0.03); }
body.dark-mode .rank-target-table th { background: rgba(255,255,255,0.05); }

.rank-scenario-box {
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 12px;
}
.rank-scenario-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px;
  color: var(--text-b);
}

.rank-diff-note {
  background: rgba(14,165,233,0.07);
  border: 1px solid rgba(14,165,233,0.18);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-b);
  margin-bottom: 12px;
  display: flex; align-items: flex-start; gap: 7px;
}
.rank-diff-note i { color: var(--accent); margin-top: 2px; flex-shrink: 0; }

/* Mobile rank analysis */
@media (max-width: 600px) {
  .rank-college-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .rank-target-table th, .rank-target-table td { padding: 7px 8px; font-size: 12px; }
}

/* ── Dark mode overrides for rank analysis elements ─────────── */
body.dark-mode .rank-college-table {
  background: rgba(15,23,42,0.6);
  border-color: rgba(51,65,85,0.6);
}
body.dark-mode .rank-college-title {
  background: rgba(30,41,59,0.7);
  color: #e2e8f0;
  border-bottom-color: rgba(51,65,85,0.5);
}
body.dark-mode .rank-college-row {
  border-bottom-color: rgba(51,65,85,0.4);
  color: #cbd5e1;
}
body.dark-mode .rank-col-name { color: #cbd5e1; }
body.dark-mode .rank-target-table {
  background: rgba(15,23,42,0.6);
  border-color: rgba(51,65,85,0.6);
}
body.dark-mode .rank-target-table th {
  background: rgba(30,41,59,0.7);
  color: #94a3b8;
  border-bottom-color: rgba(51,65,85,0.5);
}
body.dark-mode .rank-target-table td {
  color: #cbd5e1;
  border-bottom-color: rgba(51,65,85,0.4);
}
body.dark-mode .rank-scenario-box {
  background: rgba(239,68,68,0.10);
  border-color: rgba(239,68,68,0.25);
}
body.dark-mode .rank-scenario-list { color: #fca5a5; }
body.dark-mode .rank-diff-note {
  background: rgba(14,165,233,0.10);
  border-color: rgba(14,165,233,0.22);
  color: #7dd3fc;
}


/* ═══════════════════════════════════════════════════════════════
   GALAXYTECH ENHANCEMENT PACK — Futuristic 3D + UX Fixes
   ═══════════════════════════════════════════════════════════════ */

/* ── LIGHT MODE: HEADER BUTTON VISIBILITY FIX ─────────────── */
body:not(.dark-mode) .header-icon-btn {
  color: var(--primary) !important;
  background: rgba(29,78,216,0.08) !important;
  border-color: rgba(29,78,216,0.20) !important;
}
body:not(.dark-mode) .header-icon-btn:hover {
  background: rgba(29,78,216,0.16) !important;
  border-color: rgba(29,78,216,0.40) !important;
  color: var(--primary-hover) !important;
}
body:not(.dark-mode) .header-admin-btn {
  color: var(--text-m) !important;
}
body:not(.dark-mode) .logo-title { color: var(--text-h) !important; }

/* ── INFO PILLS — dark mode fix ───────────────────────────── */
body.dark-mode .info-pill {
  background: rgba(29,78,216,0.12);
  border-color: rgba(59,130,246,0.22);
  color: #60a5fa;
}

/* ── YEAR BUTTONS — dark mode fix ─────────────────────────── */
body.dark-mode .year-btn:not(.active) {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.12);
  color: #94a3b8;
}
body.dark-mode .year-btn:hover:not(.active) {
  border-color: #3b82f6;
  color: #60a5fa;
}

/* ── DASH TABS — dark mode fix ────────────────────────────── */
body.dark-mode .dash-tab:not(.active) {
  color: #64748b;
  border-bottom-color: transparent;
}
body.dark-mode .dash-tab:not(.active):hover { color: #94a3b8; }

/* ── FIELD LABEL — dark mode ──────────────────────────────── */
body.dark-mode .field-label { color: #64748b; }
body.dark-mode .text-input {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  color: #e2e8f0;
}
body.dark-mode .text-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

/* ── STAT ITEM — dark mode ────────────────────────────────── */
body.dark-mode .stat-item {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}
body.dark-mode .stat-val { color: #e2e8f0; }

/* ── FOOTER — dark mode ───────────────────────────────────── */
body.dark-mode .footer-quote {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
  color: #64748b;
}

/* ── NOTES & MODAL INPUTS — dark mode ─────────────────────── */
body.dark-mode .note-title-input,
body.dark-mode .note-content-input,
body.dark-mode .note-subject-select {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.1) !important;
  color: #e2e8f0 !important;
}
body.dark-mode .contact-input {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.1) !important;
  color: #e2e8f0 !important;
}

/* ══════════════════════════════════════════════════════════════
   CINEMATIC LOADER — EXTRA DETAILS
   ══════════════════════════════════════════════════════════════ */

/* Holographic scan line */
.loader-scan-line {
  position: absolute; top: 0; left: 0; right: 0; height: 2px; z-index: 9;
  background: linear-gradient(90deg,
    transparent 0%, rgba(56,189,248,0.35) 25%,
    rgba(96,165,250,0.9) 50%, rgba(56,189,248,0.35) 75%, transparent 100%);
  box-shadow: 0 0 10px rgba(96,165,250,0.5), 0 0 22px rgba(56,189,248,0.25);
  animation: ldrScanDown 3.2s linear infinite;
}
@keyframes ldrScanDown {
  0%   { top: 0%;   opacity: 0; }
  4%   { opacity: 1; }
  96%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* HUD corner brackets */
.loader-bracket {
  position: absolute; width: 28px; height: 28px; z-index: 9; opacity: 0.35;
  animation: ldrBracketPulse 3s ease-in-out infinite;
}
.loader-bracket::before, .loader-bracket::after {
  content: ''; position: absolute; background: #60a5fa;
}
.loader-bracket::before { width: 100%; height: 2px; }
.loader-bracket::after  { height: 100%; width: 2px; }
.lb-tl { top: 16px; left: 16px; }
.lb-tl::before { top: 0; left: 0; }
.lb-tl::after  { top: 0; left: 0; }
.lb-tr { top: 16px; right: 16px; transform: scaleX(-1); }
.lb-tr::before { top: 0; left: 0; }
.lb-tr::after  { top: 0; left: 0; }
.lb-bl { bottom: 16px; left: 16px; transform: scaleY(-1); }
.lb-bl::before { top: 0; left: 0; }
.lb-bl::after  { top: 0; left: 0; }
.lb-br { bottom: 16px; right: 16px; transform: scale(-1); }
.lb-br::before { top: 0; left: 0; }
.lb-br::after  { top: 0; left: 0; }
@keyframes ldrBracketPulse {
  0%,100% { opacity: 0.2; }
  50%     { opacity: 0.55; }
}

/* ══════════════════════════════════════════════════════════════
   FUTURISTIC CARD UPGRADES
   ══════════════════════════════════════════════════════════════ */

/* Neon grid lines on hero */
.dash-hero {
  position: relative; overflow: hidden;
}
.dash-hero::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Dark mode glassmorphism cards */
body.dark-mode .card {
  background: rgba(15,23,42,0.75);
  border-color: rgba(59,130,246,0.12);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
}
body.dark-mode .card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(59,130,246,0.05) 0%, transparent 60%);
  pointer-events: none;
}
body.dark-mode .dash-main-grid .card {
  position: relative;
}

/* Futuristic neon border on hover */
body.dark-mode .dash-main-grid .card:hover {
  border-color: rgba(59,130,246,0.35);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4),
              0 0 0 1px rgba(59,130,246,0.2),
              inset 0 1px 0 rgba(96,165,250,0.1);
}

/* Subject card glow in dark mode */
body.dark-mode .subject-card:hover:not(:disabled) {
  box-shadow: 0 10px 28px rgba(0,0,0,0.4),
              0 0 20px rgba(59,130,246,0.25),
              inset 0 1px 0 rgba(96,165,250,0.1);
  border-color: rgba(59,130,246,0.4);
}

/* Question card — futuristic */
body.dark-mode .question-card {
  background: rgba(15,23,42,0.85);
  border-color: rgba(59,130,246,0.15);
  box-shadow: 0 8px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(96,165,250,0.08);
  position: relative; overflow: hidden;
}
body.dark-mode .question-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%; right: -50%; bottom: -50%;
  background: conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg,
    rgba(59,130,246,0.06) 60deg,
    transparent 120deg
  );
  animation: card-rotate 8s linear infinite;
  pointer-events: none;
}
@keyframes card-rotate { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════════
   TEST FULLSCREEN MODE
   ══════════════════════════════════════════════════════════════ */

/* When test is fullscreen — hide the main header */
body.test-fullscreen .app-header { display: none !important; }
body.test-fullscreen .app-footer { display: none !important; }

/* Fullscreen test HUD */
.test-fs-hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 48px;
  background: linear-gradient(90deg, #080e1f 0%, #0c1a35 50%, #080e1f 100%);
  border-bottom: 1px solid rgba(59,130,246,0.25);
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 200;
  box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
body.test-fullscreen .test-fs-hud { display: flex; }

/* HUD left: logo/brand */
.hud-brand {
  font-family: 'Lexend', sans-serif;
  font-size: 14px; font-weight: 700;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.3px;
  display: flex; align-items: center; gap: 8px;
}
.hud-brand span { color: #60a5fa; }
.hud-brand-icon {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff;
}

/* HUD center: timer */
.hud-timer {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.4);
  border: 1.5px solid rgba(59,130,246,0.35);
  border-radius: 100px;
  padding: 5px 18px;
  font-family: 'Lexend', sans-serif;
  font-size: 18px; font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 2px;
  box-shadow: 0 0 12px rgba(59,130,246,0.15), inset 0 1px 0 rgba(255,255,255,0.05);
  transition: all 0.3s;
}
.hud-timer.timer-warning {
  border-color: #f97316 !important;
  color: #fed7aa !important;
  box-shadow: 0 0 16px rgba(249,115,22,0.3) !important;
  animation: hud-pulse-orange 1s ease-in-out infinite;
}
.hud-timer.timer-critical {
  border-color: #ef4444 !important;
  color: #fecaca !important;
  box-shadow: 0 0 20px rgba(239,68,68,0.4) !important;
  animation: hud-pulse-red 0.6s ease-in-out infinite;
}
@keyframes hud-pulse-orange { 0%,100%{box-shadow:0 0 16px rgba(249,115,22,0.3);}50%{box-shadow:0 0 28px rgba(249,115,22,0.6);} }
@keyframes hud-pulse-red    { 0%,100%{box-shadow:0 0 20px rgba(239,68,68,0.4);}50%{box-shadow:0 0 36px rgba(239,68,68,0.7);} }
.hud-timer-icon { font-size: 13px; opacity: 0.7; }

/* HUD right: actions */
.hud-actions {
  display: flex; align-items: center; gap: 10px;
}
.hud-progress-ring {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: rgba(255,255,255,0.5);
  font-family: 'Lexend', sans-serif;
}
.hud-btn-exit {
  padding: 5px 14px;
  border-radius: 100px;
  border: 1.5px solid rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.1);
  color: #fca5a5;
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  font-family: 'Nunito', sans-serif;
}
.hud-btn-exit:hover {
  background: rgba(239,68,68,0.2);
  border-color: rgba(239,68,68,0.6);
  color: #fff;
}
.hud-btn-submit {
  padding: 5px 18px;
  border-radius: 100px;
  border: none;
  background: linear-gradient(90deg, #1d4ed8, #0ea5e9);
  color: #fff;
  font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  font-family: 'Nunito', sans-serif;
  box-shadow: 0 2px 10px rgba(29,78,216,0.4);
}
.hud-btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(29,78,216,0.6);
}
.hud-btn-palette {
  padding: 5px 12px;
  border-radius: 100px;
  border: 1.5px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  font-family: 'Nunito', sans-serif;
}
.hud-btn-palette:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}

/* Test screen shift when fullscreen + HUD visible */
body.test-fullscreen #test-interface {
  height: 100vh;
  padding-top: 48px;
}

/* Fullscreen lock indicator */
.fs-lock-indicator {
  position: fixed;
  top: 12px; right: 220px;
  display: none;
  align-items: center; gap: 5px;
  font-size: 11px; color: rgba(96,165,250,0.6);
  font-family: 'Lexend', sans-serif;
  letter-spacing: 0.3px;
  z-index: 201;
}
body.test-fullscreen .fs-lock-indicator { display: flex; }
.fs-lock-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: dot-ping 1.5s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════════════════
   SECURITY OVERLAY — Anti-cheat
   ══════════════════════════════════════════════════════════════ */
.anti-cheat-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(12px);
  z-index: 99999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  animation: fadeIn 0.2s ease;
}
.anti-cheat-box {
  background: linear-gradient(135deg, #0f172a, #1e1b4b);
  border: 1px solid rgba(239,68,68,0.4);
  border-radius: 20px;
  padding: 40px 50px;
  max-width: 420px; width: 90%;
  text-align: center;
  box-shadow: 0 0 60px rgba(239,68,68,0.2), inset 0 1px 0 rgba(255,255,255,0.05);
}
.anti-cheat-icon {
  font-size: 40px; margin-bottom: 16px;
  color: #ef4444;
  filter: drop-shadow(0 0 12px rgba(239,68,68,0.5));
  animation: icon-shake 0.5s ease;
}
@keyframes icon-shake {
  0%,100%{transform:rotate(0);}20%{transform:rotate(-8deg);}40%{transform:rotate(8deg);}60%{transform:rotate(-4deg);}80%{transform:rotate(4deg);}
}
.anti-cheat-box h3 {
  font-family: 'Lexend', sans-serif;
  font-size: 20px; font-weight: 700;
  color: #fff; margin-bottom: 10px;
}
.anti-cheat-box p {
  font-size: 14px; color: rgba(255,255,255,0.6);
  line-height: 1.6; margin-bottom: 24px;
}
.anti-cheat-btn {
  background: linear-gradient(90deg, #1d4ed8, #0ea5e9);
  color: #fff; border: none;
  border-radius: 10px; padding: 11px 32px;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(29,78,216,0.4);
  transition: transform 0.15s, box-shadow 0.2s;
  font-family: 'Nunito', sans-serif;
}
.anti-cheat-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(29,78,216,0.55);
}

/* ══════════════════════════════════════════════════════════════
   3D BACKGROUND CANVAS — Futuristic
   ══════════════════════════════════════════════════════════════ */
#three-canvas {
  position: fixed; inset: 0;
  z-index: 0; pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease;
}
#three-canvas.visible { opacity: 1; }

/* ══════════════════════════════════════════════════════════════
   LOADER 3D CANVAS — Enhanced overlap layering
   ══════════════════════════════════════════════════════════════ */
.loader-3d-canvas {
  position: absolute; inset: 0;
  z-index: 1;
}

/* ══════════════════════════════════════════════════════════════
   OPTION BUTTONS — Futuristic hover
   ══════════════════════════════════════════════════════════════ */
body.dark-mode .option-btn {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}
body.dark-mode .option-btn:hover:not(:disabled) {
  background: rgba(59,130,246,0.1);
  border-color: rgba(59,130,246,0.35);
  box-shadow: 0 0 12px rgba(59,130,246,0.15);
}
body.dark-mode .option-btn.selected {
  background: rgba(29,78,216,0.2);
  border-color: rgba(59,130,246,0.55);
  box-shadow: 0 0 16px rgba(59,130,246,0.2), inset 0 1px 0 rgba(96,165,250,0.1);
}

/* ══════════════════════════════════════════════════════════════
   RESULT SCREEN — Futuristic glow
   ══════════════════════════════════════════════════════════════ */
body.dark-mode .bd-item {
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
body.dark-mode .bd-blue   { border-color: rgba(59,130,246,0.25) !important; background: rgba(29,78,216,0.12) !important; }
body.dark-mode .bd-purple { border-color: rgba(167,139,250,0.25) !important; background: rgba(124,58,237,0.12) !important; }
body.dark-mode .bd-green  { border-color: rgba(34,197,94,0.25) !important; background: rgba(22,163,74,0.10) !important; }
body.dark-mode .bd-red    { border-color: rgba(239,68,68,0.25) !important; background: rgba(220,38,38,0.10) !important; }

/* ══════════════════════════════════════════════════════════════
   PERFORMANCE OPTIMIZATIONS
   ══════════════════════════════════════════════════════════════ */

/* Contain paint for modals */
.auth-box, .ebook-box, .notes-box,
.pretest-box, .contact-box, .admin-box {
  contain: layout style;
}

/* GPU-accelerate key animated elements only */
.loader-orbit,
.loader-core-glow,
.loader-brain-icon,
.palette-btn,
.subject-card {
  will-change: transform;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* ── Loader brand: needs relative positioning for pseudo-elements ── */
.loader-brand {
  position: relative;
}

/* ── Loader progress cursor glow ─────────────────────────── */
.loader-progress-track { position: relative; }

/* ── Test screen height fix in fullscreen mode ────────────── */
body.test-fullscreen .test-screen {
  height: calc(100vh - 48px) !important;
}

/* ── HUD hidden when test-interface hidden ────────────────── */
body:not(.test-fullscreen) .test-fs-hud { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════
   3D DEPTH ENHANCEMENTS — ALL SECTIONS
   ═══════════════════════════════════════════════════════════════════ */

/* Global 3D perspective context */
#app, .dashboard-screen, .test-screen, .result-screen {
  perspective: 1200px;
}

/* ── Dashboard Hero — 3D float ── */
.dash-hero {
  transform-style: preserve-3d;
  transform: translateZ(0) rotateX(0deg);
  transition: transform 0.6s cubic-bezier(.2,.8,.3,1);
}
.dash-hero:hover {
  transform: translateZ(8px) rotateX(-1.5deg);
}

/* ── Start Panel / Stats cards ── */
.start-panel > .card,
.stats-card,
.history-card {
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(.2,.8,.3,1), box-shadow 0.4s;
}
.start-panel > .card:hover,
.stats-card:hover,
.history-card:hover {
  transform: translateY(-4px) rotateX(-1deg) rotateY(0.5deg) scale(1.01);
}

/* ── Main option cards — 3D press-in ── */
.main-opt-card {
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(.2,.8,.3,1), box-shadow 0.35s !important;
}
.main-opt-card:hover {
  transform: translateY(-6px) rotateX(-2deg) rotateY(1deg) scale(1.02) !important;
}
.main-opt-card:active {
  transform: translateY(-1px) rotateX(1deg) scale(0.99) !important;
}

/* ── Subject cards — 3D tilt ── */
.subject-card {
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(.2,.8,.3,1) !important;
}
.subject-card:hover {
  transform: translateY(-8px) rotateX(-3deg) rotateY(2deg) scale(1.04) !important;
}
.subject-card:active {
  transform: translateY(-2px) scale(1.01) !important;
}

/* ── Year buttons ── */
.year-btn {
  transform-style: preserve-3d;
  transition: transform 0.25s ease, box-shadow 0.25s;
}
.year-btn:hover {
  transform: translateY(-3px) rotateX(-2deg);
}
.year-btn.active {
  transform: translateY(-2px) rotateX(-1deg) scale(1.05);
}

/* ── Question card — 3D depth ── */
.question-card {
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(0deg) translateZ(0);
  transition: box-shadow 0.4s, transform 0.4s;
}
.question-card:hover {
  transform: perspective(900px) rotateX(-0.8deg) translateZ(4px);
}

/* ── Option labels — 3D press ── */
.option-label {
  transform-style: preserve-3d;
  transition: transform 0.25s cubic-bezier(.2,.8,.3,1) !important;
}
.option-label:hover {
  transform: translateX(6px) translateZ(4px) !important;
}
.option-label.selected {
  transform: translateX(8px) translateZ(6px) scale(1.01) !important;
}

/* ── Result breakdown items ── */
.bd-item {
  transform-style: preserve-3d;
  transition: transform 0.3s cubic-bezier(.2,.8,.3,1), box-shadow 0.3s;
}
.bd-item:hover {
  transform: translateY(-5px) rotateX(-2deg) rotateY(1deg) scale(1.03);
}

/* ── Analysis cards ── */
.analysis-card {
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(.2,.8,.3,1), box-shadow 0.35s;
}
.analysis-card:hover {
  transform: translateY(-6px) rotateX(-1.5deg) scale(1.02);
}

/* ── Metric items ── */
.metric-item {
  transition: transform 0.25s ease, box-shadow 0.25s;
}
.metric-item:hover {
  transform: translateX(4px) translateZ(3px) scale(1.02);
}

/* ── History items ── */
.history-item {
  transition: transform 0.25s ease, box-shadow 0.25s;
}
.history-item:hover {
  transform: translateX(4px) translateZ(4px);
}

/* ── Palette buttons ── */
.palette-btn {
  transition: transform 0.2s ease, box-shadow 0.2s !important;
}
.palette-btn:hover {
  transform: translateY(-2px) scale(1.1) rotateX(-3deg);
}
.palette-btn.palette-current {
  transform: scale(1.18) rotateX(-4deg);
}

/* ── Header ── */
.app-header {
  transform-style: preserve-3d;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18), 0 1px 0 rgba(255,255,255,0.04);
}

/* ── Nav buttons in test ── */
.btn-nav, .btn-palette-toggle {
  transition: transform 0.22s cubic-bezier(.2,.8,.3,1), box-shadow 0.22s;
}
.btn-nav:hover, .btn-palette-toggle:hover {
  transform: translateY(-3px) rotateX(-4deg) scale(1.06);
}
.btn-nav:active {
  transform: translateY(0px) scale(0.98);
}

/* ── Pretest box ── */
.pretest-box {
  transform-style: preserve-3d;
  transform: perspective(1000px) rotateX(0deg) scale(1);
  transition: transform 0.5s cubic-bezier(.2,.8,.3,1);
}
.pretest-box:hover {
  transform: perspective(1000px) rotateX(-0.8deg) scale(1.005);
}

/* ── Rule items ── */
.rule-item {
  transition: transform 0.25s ease;
}
.rule-item:hover {
  transform: translateX(6px) translateZ(4px);
}

/* ── Stats grid items ── */
.stat-item {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}
.stat-item:hover {
  transform: translateY(-4px) rotateX(-2deg) rotateY(1.5deg) scale(1.04);
}

/* ── Footer — slight 3D tilt on link hover ── */
.footer-link {
  transition: transform 0.2s ease;
  display: inline-block;
}
.footer-link:hover {
  transform: translateY(-2px) rotateX(-3deg);
}

/* ── Auth box ── */
.auth-box {
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(0deg) scale(1);
  transition: transform 0.5s cubic-bezier(.2,.8,.3,1);
}
.auth-box:hover {
  transform: perspective(900px) rotateX(-0.5deg) scale(1.003);
}

/* ── Result hero ── */
.result-hero-section {
  transform-style: preserve-3d;
  transform: perspective(800px) rotateX(0deg);
  transition: transform 0.5s ease;
}
.result-hero-section:hover {
  transform: perspective(800px) rotateX(-1.2deg) translateZ(6px);
}

/* ── Score display ── */
.score-display {
  transform-style: preserve-3d;
  transition: transform 0.35s ease;
}
.score-display:hover {
  transform: scale(1.05) translateZ(8px) rotateX(-2deg);
}

/* ── eBook modal ── */
.ebook-box {
  transform-style: preserve-3d;
}
.ebook-chapter-btn {
  transition: transform 0.2s ease;
}
.ebook-chapter-btn:hover {
  transform: translateX(4px) translateZ(3px);
}

/* ── HUD 3D depth ── */
.test-fs-hud {
  transform-style: preserve-3d;
  backdrop-filter: blur(20px) saturate(1.4);
}
.hud-btn-palette, .hud-btn-submit, .hud-btn-exit {
  transition: transform 0.2s ease !important;
}
.hud-btn-palette:hover { transform: translateY(-2px) rotateX(-3deg) scale(1.05); }
.hud-btn-submit:hover  { transform: translateY(-2px) rotateX(-3deg) scale(1.06); }
.hud-btn-exit:hover    { transform: translateY(-2px) rotateX(-3deg) scale(1.05); }

/* ── Note cards ── */
.note-card {
  transition: transform 0.25s ease, box-shadow 0.25s;
}
.note-card:hover {
  transform: translateY(-3px) rotateX(-1deg) scale(1.01);
}

/* ── Sol cards ── */
.sol-card {
  transition: transform 0.25s ease;
}
.sol-card:hover {
  transform: translateX(4px) translateZ(3px);
}

/* ── Contact / admin / modal inner boxes ── */
.contact-box, .admin-box, .notes-box {
  transform-style: preserve-3d;
}

/* ── 3D glow on active elements ── */
.palette-btn.palette-answered {
  box-shadow: 0 4px 12px rgba(34,197,94,0.35), 0 0 0 2px rgba(34,197,94,0.2);
}
.palette-btn.palette-current {
  box-shadow: 0 6px 20px rgba(59,130,246,0.5), 0 0 0 2px rgba(59,130,246,0.3);
}

/* ═══════════════════════════════════════════════════════════════════
   LOADER ENHANCEMENTS — GALAXY VORTEX INTRO
   ═══════════════════════════════════════════════════════════════════ */

/* Scanlines overlay for cinematic HUD feel */
.loader-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.06) 3px,
    rgba(0,0,0,0.06) 4px
  );
  pointer-events: none;
  z-index: 1;
  animation: scanlineMove 8s linear infinite;
}
@keyframes scanlineMove {
  0%   { background-position: 0 0; }
  100% { background-position: 0 100px; }
}

/* Sub-brand label under JECAprep */
.loader-sub-brand {
  font-family: 'Lexend', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  color: rgba(96,165,250,0.65);
  text-transform: uppercase;
  margin: -8px 0 10px;
  animation: fadeInUp 1s ease 0.4s both;
}

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

/* Upgrade the loader 3D canvas blend */
.loader-3d-canvas {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  z-index: 0 !important;
  opacity: 1;
  mix-blend-mode: screen;
}

/* ══════════════════════════════════════════════════════════════
   BUTTERY SMOOTH UI POLISH — v5
   ══════════════════════════════════════════════════════════════ */

/* Global smooth transitions */
button, a, input, select, textarea,
.option-label, .subject-card, .year-btn,
.dash-tab, .header-icon-btn, .main-opt-card,
.practice-option-card, .practice-subject-card,
.sol-card, .history-item, .note-card,
.auth-tab, .auth-submit-btn, .auth-guest-btn,
.palette-btn, .pretest-btn-start, .pretest-btn-cancel,
.ebook-chapter-btn, .ebook-pill-btn,
.admin-activity-row, .fs-user-card {
  transition: all 0.18s cubic-bezier(0.4,0,0.2,1);
}

/* Prevent layout shift on transitions */
.screen { -webkit-overflow-scrolling: touch; }

/* Smooth scroll everywhere */
html { scroll-behavior: smooth; }

/* Better tap highlight on mobile */
* { -webkit-tap-highlight-color: rgba(59,130,246,0.12); }

/* Smooth transform on interactive cards */
.subject-card:hover:not(:disabled),
.practice-option-card:hover:not(:disabled),
.practice-subject-card:hover:not(:disabled),
.main-opt-card:hover {
  transform: translateY(-2px);
}
.subject-card:active:not(:disabled),
.practice-option-card:active:not(:disabled),
.practice-subject-card:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

/* Touch-friendly tap targets */
@media (max-width: 768px) {
  .palette-btn   { min-width: 38px; min-height: 38px; }
  .btn-nav       { padding: 10px 18px; min-height: 44px; }
  .header-icon-btn { min-width: 40px; min-height: 40px; padding: 8px; }
  .year-btn      { padding: 10px 14px; min-height: 44px; }
  .dash-tab      { min-height: 44px; }
  .option-label  { padding: 14px 16px; }
}

/* Smooth palette slide */
.palette-panel {
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1),
              opacity  0.22s ease,
              box-shadow 0.22s ease;
  will-change: transform;
}

/* Smooth modal appear */
.auth-overlay:not(.hidden) .auth-box,
.pretest-overlay:not(.hidden) .pretest-box,
.ebook-overlay:not(.hidden) .ebook-box,
.notes-overlay:not(.hidden) .notes-box,
.admin-overlay:not(.hidden) .admin-box,
.contact-overlay:not(.hidden) .contact-box {
  animation: modalAppear 0.28s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes modalAppear {
  from { opacity:0; transform: scale(0.94) translateY(12px); }
  to   { opacity:1; transform: scale(1)    translateY(0); }
}

/* Smooth option selection feedback */
.option-label {
  will-change: transform;
}
.option-label.selected {
  animation: optionPop 0.18s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes optionPop {
  0%  { transform: scale(0.98); }
  60% { transform: scale(1.015); }
  100%{ transform: scale(1); }
}

/* Page transitions between screens */
.screen:not(.hidden) {
  animation: screenSlideIn 0.3s cubic-bezier(0.4,0,0.2,1) both;
}
@keyframes screenSlideIn {
  from { opacity:0; transform: translateY(14px); }
  to   { opacity:1; transform: translateY(0); }
}

/* Smooth result reveal */
.result-wrap { animation: screenSlideIn 0.35s ease both; }

/* Keyboard shortcut: smooth palette toggle */
.palette-panel.open { transform: translateX(0) !important; }

/* Admin auto-submitted badge */
.admin-auto-badge {
  display: inline-block;
  background: linear-gradient(135deg, #dc2626, #f97316);
  color: #fff;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 100px;
  margin-left: 6px; vertical-align: middle;
  white-space: nowrap;
  box-shadow: 0 1px 6px rgba(220,38,38,0.4);
}

/* Security overlay for auto-submit — make button say "View Result" */
.security-box button {
  transition: background 0.2s, transform 0.15s;
}
.security-box button:active { transform: scale(0.97); }

/* Scrollbar polish */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.3); border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.5); }
body.dark-mode ::-webkit-scrollbar-thumb { background: rgba(100,116,139,0.4); }

/* Focus ring accessibility */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid #60a5fa; outline-offset: 2px;
}

/* Loader sub-brand legacy alias */
.loader-sub-brand { display: none; }


/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE GRID IMPROVEMENTS — Mobile & Cross-Device Fixes
   Targets: dash-main-grid, breakdown-grid, analysis-grid,
            palette-grid, admin-stats-grid, q-nav-bar, test HUD,
            header-actions, dashboard padding
   Everything else is 100% unchanged.
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. Dashboard screen: tighter padding on small phones ─────── */
@media (max-width: 480px) {
  .dashboard-screen { padding: 16px 10px 60px; }
  .dash-main-grid   { gap: 12px; margin-bottom: 14px; }
  .dash-hero        { padding: 16px 14px; gap: 10px; }
  .card             { padding: 18px; }
}

/* ── 2. dash-main-grid: explicit single-col below 640px ──────── */
/* (Already 1fr at ≤900px; this ensures proper gap + alignment at phone widths) */
@media (max-width: 640px) {
  .dash-main-grid { grid-template-columns: 1fr; gap: 12px; }
}

/* ── 3. breakdown-grid: 2-col at ≤768px, 1-col at ≤360px ─────── */
@media (max-width: 768px) {
  .breakdown-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
}
@media (max-width: 360px) {
  .breakdown-grid { grid-template-columns: 1fr !important; }
}

/* ── 4. analysis-grid: single column earlier ─────────────────── */
@media (max-width: 760px) {
  .analysis-grid { grid-template-columns: 1fr; gap: 12px; }
}

/* ── 5. admin-stats-grid: 2-col on all mobile ─────────────────── */
@media (max-width: 768px) {
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
}

/* ── 6. palette-grid: 4-col on very narrow screens (<300px) ───── */
@media (max-width: 300px) {
  .palette-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── 7. Palette panel position fix when in fullscreen on mobile ── */
@media (max-width: 767px) {
  body.test-fullscreen .palette-panel {
    top: 48px !important; /* HUD height replaces hidden header */
    bottom: 0;
  }
}

/* ── 8. Test fullscreen HUD: shrink gracefully on small phones ── */
@media (max-width: 540px) {
  .test-fs-hud    { padding: 0 10px; height: 44px; }
  .hud-brand span { display: none; }          /* hide "prep" part */
  .hud-brand      { font-size: 13px; gap: 6px; }
  .hud-actions    { gap: 6px; }
  .hud-progress-ring { display: none; }       /* reclaim space */
  .hud-btn-exit   { padding: 4px 8px; font-size: 11px; }
  .hud-btn-submit { padding: 4px 10px; font-size: 11px; }
  .hud-btn-palette { padding: 4px 8px; font-size: 11px; }
  body.test-fullscreen #test-interface { padding-top: 44px; }
  body.test-fullscreen .test-screen    { height: calc(100vh - 44px) !important; }
  body.test-fullscreen .palette-panel  { top: 44px !important; }
}
@media (max-width: 400px) {
  .hud-timer      { font-size: 13px; padding: 3px 8px; letter-spacing: 0.5px; }
  .hud-btn-palette { display: none; } /* palette still accessible via bottom bar */
}

/* ── 9. Header actions: prevent overflow on very small phones ─── */
@media (max-width: 420px) {
  .header-actions { gap: 5px; }
  .header-icon-btn { padding: 5px 9px; font-size: 12px; }
  .theme-wheel-btn { margin-left: 2px; }
}
@media (max-width: 360px) {
  /* Hide admin + contact buttons on tiny screens (low-priority actions) */
  .header-admin-btn   { display: none; }
  .contact-hdr-btn    { display: none; }
  .header-actions     { gap: 4px; }
  .header-icon-btn    { padding: 5px 8px; }
}

/* ── 10. q-nav-bar: better stacking on very small phones ────────── */
@media (max-width: 380px) {
  .q-nav-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto;
    gap: 8px;
    padding: 10px 12px 14px;
    align-items: center;
  }
  #prev-btn           { grid-column: 1; grid-row: 1; }
  .btn-palette-toggle { grid-column: 2; grid-row: 1; }
  #next-btn           { grid-column: 3; grid-row: 1; }
  #submit-btn         { grid-column: 1 / -1; grid-row: 2; margin-left: 0 !important; width: 100%; }
}

/* ── 11. question-card & question-area: tighter on phones ──────── */
@media (max-width: 380px) {
  .question-card  { margin: 8px 10px; padding: 16px 14px; }
  .q-topbar       { padding: 10px 14px 0; }
  .question-text  { font-size: 14px; }
  .option-label   { padding: 11px 12px; }
  .option-text    { font-size: 13px; }
}

/* ── 12. stats-grid stays 2-col — no change needed ─────────────── */
/* Already grid-template-columns: 1fr 1fr — works on all sizes   */

/* ── 13. year-grid wraps naturally — ensure min touch size ──────── */
@media (max-width: 480px) {
  .year-btn { padding: 7px 13px; font-size: 12px; }
}

/* ── 14. result action row: stack on tiny screens ───────────────── */
@media (max-width: 380px) {
  .result-action-row { flex-direction: column; align-items: stretch; }
  .btn-retake, .btn-solutions { text-align: center; }
}

/* ── 15. score-display: scale down on small phones ──────────────── */
@media (max-width: 380px) {
  .score-display  { padding: 12px 24px; }
  .score-number   { font-size: 38px; }
  .score-denom    { font-size: 18px; }
}

/* ── 16. Practice section: options grid on wide screens ─────────── */
@media (min-width: 640px) {
  .practice-options   { padding: 0; }
}

/* ── 17. Ensure ebook sidebar shows on mid tablets ───────────────── */
@media (min-width: 481px) and (max-width: 639px) {
  .ebook-sidebar { width: 160px; }
  .ebook-content { padding: 14px; font-size: 14px; }
}

/* ── 18. Pretest modal rules: prevent overflow on small screens ──── */
@media (max-width: 480px) {
  .pretest-rules { max-height: 240px; padding: 14px 16px; gap: 8px; }
  .pretest-header { padding: 20px 18px 16px; }
  .pretest-actions { padding: 12px 16px 18px; }
}

/* ── 19. notes-add-actions: stack on tiny phones ─────────────────── */
@media (max-width: 380px) {
  .notes-add-actions  { flex-direction: column; }
  .note-subject-select { width: 100%; }
  .add-note-btn       { width: 100%; }
}

/* ── 20. dash-tabs: ensure all 3 tabs fit on tiny screens ─────────── */
@media (max-width: 380px) {
  .dash-tabs  { display: grid; grid-template-columns: repeat(2, 1fr); }
  .dash-tab   { font-size: 11px; padding: 8px 4px; min-height: 40px; }
  .dash-tab[data-tab="practice"] { display: none !important; }
}

/* ══════════════════════════════════════════════════════════════
   NOTIFICATION SYSTEM — Bell · Panel · Popup · Admin Section
   ══════════════════════════════════════════════════════════════ */

/* ── Bell button ───────────────────────────────────────────── */
.notif-bell-btn {
  position: relative;
}
.notif-badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Lexend', sans-serif;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--surface);
  animation: badge-pop 0.3s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes badge-pop {
  0%   { transform: scale(0); opacity: 0; }
  70%  { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Notification Panel Overlay ─────────────────────────────── */
.notif-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 4000;
  display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 70px 16px 16px;
  animation: notif-overlay-in 0.22s ease both;
}
@keyframes notif-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.notif-box {
  width: 100%; max-width: 420px;
  max-height: calc(100vh - 90px);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: notif-box-in 0.28s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes notif-box-in {
  from { transform: translateY(-18px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1.5px solid var(--border);
  background: linear-gradient(135deg, rgba(29,78,216,0.06) 0%, rgba(14,165,233,0.04) 100%);
  flex-shrink: 0;
}
.notif-header-left { display: flex; align-items: center; gap: 12px; }
.notif-icon-ring {
  width: 40px; height: 40px;
  background: linear-gradient(135deg,#1d4ed8,#0ea5e9);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 17px;
  flex-shrink: 0;
}
.notif-header h3 { font-size: 16px; font-family: 'Lexend',sans-serif; color: var(--text-h); }
.notif-sub { font-size: 11px; color: var(--text-m); margin-top: 1px; }
.notif-header-actions { display: flex; align-items: center; gap: 8px; }
.notif-mark-all-btn {
  font-size: 11px; font-family: 'Nunito',sans-serif;
  background: transparent;
  color: var(--primary); border: 1.5px solid var(--primary);
  border-radius: 6px; padding: 5px 10px;
  transition: all 0.18s;
}
.notif-mark-all-btn:hover { background: var(--primary); color: #fff; }
.notif-close-btn {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface-2); border: 1.5px solid var(--border);
  color: var(--text-m); font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}
.notif-close-btn:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ── Panel body ─────────────────────────────────────────────── */
.notif-body {
  flex: 1; overflow-y: auto;
  padding: 12px;
  display: flex; flex-direction: column; gap: 0;
}
.notif-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 40px 20px; text-align: center;
  color: var(--text-m);
}
.notif-empty-icon { font-size: 40px; opacity: 0.35; }
.notif-empty p { font-size: 14px; font-weight: 600; }
.notif-empty-sub { font-size: 12px; opacity: 0.75; }

/* ── Notification Items ──────────────────────────────────────── */
.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  cursor: pointer; transition: all 0.18s; position: relative;
}
.notif-item-unread {
  background: linear-gradient(135deg,rgba(29,78,216,0.05),rgba(14,165,233,0.04));
  border-color: rgba(29,78,216,0.18);
}
.notif-item-read { background: var(--surface-2); opacity: 0.82; }
.notif-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: var(--border-focus); }
.notif-item-left { flex-shrink: 0; }
.notif-item-emoji { font-size: 22px; line-height: 1; }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-top { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.notif-item-title { font-size: 13px; font-weight: 700; font-family: 'Lexend',sans-serif; color: var(--text-h); }
.notif-unread-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0;
}
.notif-item-msg { font-size: 12px; color: var(--text-b); line-height: 1.5; margin-bottom: 4px; }
.notif-item-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--primary); font-weight: 600;
  text-decoration: none; margin-bottom: 4px;
  transition: color 0.15s;
}
.notif-item-link:hover { color: var(--accent); }
.notif-item-time { font-size: 10px; color: var(--text-faint); }
.notif-item-dismiss {
  background: transparent; border: none; color: var(--text-faint);
  font-size: 11px; padding: 4px; border-radius: 4px;
  opacity: 0; transition: all 0.18s; align-self: flex-start; flex-shrink: 0;
}
.notif-item:hover .notif-item-dismiss { opacity: 1; }
.notif-item-dismiss:hover { color: var(--danger); background: var(--danger-bg); }

/* Type accent left borders */
.notif-type-announce { border-left: 3px solid #1d4ed8 !important; }
.notif-type-update   { border-left: 3px solid #0284c7 !important; }
.notif-type-link     { border-left: 3px solid #7c3aed !important; }
.notif-type-warn     { border-left: 3px solid #d97706 !important; }
.notif-type-success  { border-left: 3px solid #16a34a !important; }

/* ── Notification Popup Toast ───────────────────────────────── */
.notif-popup {
  position: fixed;
  bottom: 28px; right: 24px;
  width: 340px;
  background: rgba(15,23,42,0.82);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border: 1.5px solid rgba(96,165,250,0.22);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.04) inset;
  z-index: 5000;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.28s ease;
}
.notif-popup-hidden { transform: translateY(24px) scale(0.94); opacity: 0; pointer-events: none; }
.notif-popup-show   { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.notif-popup-inner {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 14px 10px;
}
.notif-popup-icon-wrap {
  width: 36px; height: 36px; flex-shrink: 0;
  background: linear-gradient(135deg,#1d4ed8,#0ea5e9);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.notif-popup-bell { color: #fff; font-size: 15px; animation: bell-ring 0.6s ease 0.1s both; }
@keyframes bell-ring {
  0%,100% { transform: rotate(0deg); }
  20%      { transform: rotate(-15deg); }
  40%      { transform: rotate(12deg); }
  60%      { transform: rotate(-8deg); }
  80%      { transform: rotate(5deg); }
}
.notif-popup-body { flex: 1; min-width: 0; }
.notif-popup-title { font-size: 13px; font-weight: 700; font-family: 'Lexend',sans-serif; color: #f1f5f9; margin-bottom: 3px; }
.notif-popup-msg   { font-size: 12px; color: #94a3b8; line-height: 1.45; margin-bottom: 5px; }
.notif-popup-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: #60a5fa; font-weight: 600; text-decoration: none;
  transition: color 0.15s;
}
.notif-popup-link:hover { color: #93c5fd; }
.notif-popup-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.notif-popup-view-btn {
  width: 28px; height: 28px; border-radius: 6px;
  background: rgba(96,165,250,0.12); border: 1px solid rgba(96,165,250,0.2);
  color: #93c5fd; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}
.notif-popup-view-btn:hover { background: rgba(96,165,250,0.22); }
.notif-popup-dismiss {
  width: 28px; height: 28px; border-radius: 6px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: #94a3b8; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}
.notif-popup-dismiss:hover { background: rgba(220,38,38,0.2); color: #fca5a5; }
.notif-popup-progress {
  height: 3px;
  background: linear-gradient(90deg,#1d4ed8,#0ea5e9);
  width: 100%; border-radius: 0 0 2px 2px;
}

/* ── Admin Notification Section ─────────────────────────────── */
.admin-notif-section {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 18px;
}
.admin-notif-form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.admin-notif-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.admin-notif-field { display: flex; flex-direction: column; gap: 5px; }
.admin-notif-label {
  font-size: 12px; font-weight: 600; color: var(--text-m); font-family: 'Lexend',sans-serif;
}
.admin-notif-optional { font-weight: 400; opacity: 0.7; }
.admin-notif-input {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px; font-family: 'Nunito',sans-serif;
  color: var(--text-b);
  width: 100%;
  transition: border-color 0.18s;
}
.admin-notif-input:focus { outline: none; border-color: var(--primary); }
.admin-notif-textarea { resize: vertical; min-height: 60px; }
.admin-notif-select { cursor: pointer; }
.admin-notif-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.admin-notif-publish-btn {
  background: linear-gradient(135deg,#1d4ed8,#0ea5e9);
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 10px 20px; font-size: 13px; font-weight: 700; font-family: 'Lexend',sans-serif;
  transition: all 0.2s; box-shadow: 0 3px 12px rgba(29,78,216,0.25);
}
.admin-notif-publish-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(29,78,216,0.3); }
.admin-notif-error { font-size: 12px; color: var(--danger); }

.admin-notif-existing { margin-top: 18px; border-top: 1.5px solid var(--border); padding-top: 14px; }
.admin-notif-existing-title { font-size: 13px; font-weight: 600; font-family: 'Lexend',sans-serif; color: var(--text-h); margin-bottom: 10px; }
.admin-notif-existing-list { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; }
.admin-notif-none { font-size: 12px; color: var(--text-faint); font-style: italic; }
.admin-notif-row-item {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.admin-notif-row-emoji { font-size: 18px; flex-shrink: 0; }
.admin-notif-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.admin-notif-row-title { font-size: 12px; font-weight: 700; color: var(--text-h); font-family: 'Lexend',sans-serif; }
.admin-notif-row-msg   { font-size: 11px; color: var(--text-m); line-height: 1.4; }
.admin-notif-row-link  { font-size: 11px; color: var(--primary); font-weight: 600; text-decoration: none; margin-top: 2px; }
.admin-notif-row-time  { font-size: 10px; color: var(--text-faint); flex-shrink: 0; white-space: nowrap; }
.admin-notif-row-del {
  background: transparent; border: none; color: var(--text-faint); font-size: 12px;
  padding: 4px; border-radius: 4px; flex-shrink: 0; transition: all 0.18s;
}
.admin-notif-row-del:hover { color: var(--danger); background: var(--danger-bg); }

/* ── Dark mode overrides ─────────────────────────────────────── */
body.dark-mode .notif-box {
  background: #1e293b; border-color: rgba(96,165,250,0.15);
}
body.dark-mode .notif-header {
  background: linear-gradient(135deg,rgba(29,78,216,0.12),rgba(14,165,233,0.08));
  border-color: rgba(96,165,250,0.15);
}
body.dark-mode .notif-header h3 { color: #f1f5f9; }
body.dark-mode .notif-item {
  background: rgba(30,41,59,0.8); border-color: rgba(96,165,250,0.12);
}
body.dark-mode .notif-item-unread { background: rgba(29,78,216,0.10); border-color: rgba(96,165,250,0.2); }
body.dark-mode .notif-item-read   { background: rgba(15,23,42,0.5); }
body.dark-mode .notif-item-title  { color: #e2e8f0; }
body.dark-mode .notif-item-msg    { color: #94a3b8; }
body.dark-mode .notif-close-btn   { background: #334155; border-color: #475569; color: #94a3b8; }
body.dark-mode .notif-mark-all-btn { color: #60a5fa; border-color: #60a5fa; }
body.dark-mode .notif-mark-all-btn:hover { background: #60a5fa; color: #0f172a; }
body.dark-mode .admin-notif-section { background: #1e293b; border-color: rgba(96,165,250,0.15); }
body.dark-mode .admin-notif-input   { background: #0f172a; border-color: #334155; color: #e2e8f0; }
body.dark-mode .admin-notif-row-item { background: #0f172a; border-color: #334155; }
body.dark-mode .admin-notif-row-title { color: #e2e8f0; }
body.dark-mode .admin-notif-existing { border-color: #334155; }
body.dark-mode .notif-badge { box-shadow: 0 0 0 2px #1e293b; }

/* ── Mobile adjustments ──────────────────────────────────────── */
@media (max-width: 480px) {
  .notif-overlay { padding: 66px 8px 8px; align-items: flex-start; justify-content: center; }
  .notif-box     { max-width: 100%; max-height: calc(100vh - 80px); }
  .admin-notif-row { grid-template-columns: 1fr; }
  .notif-popup   { width: calc(100vw - 24px); right: 12px; bottom: 16px; }
}
