/* =============================================================================
   styles/nexus-v3-universal.css
   NEXUSLAB UNIVERSAL ORBITAL GLASS × BRILLIANT.ORG GUI ENGINE
   Unifies all Subject Portals, Linked Feature Hubs, and 160+ Interactive Labs.
   ============================================================================= */

:root,
html.dark,
html[data-theme="dark"] {
  --nx-bg: #050814;
  --nx-elev: rgba(11, 18, 36, 0.9);
  --nx-card: rgba(14, 22, 44, 0.78);
  --nx-card-hover: rgba(20, 32, 62, 0.94);
  --nx-soft: rgba(255, 255, 255, 0.048);
  --nx-border: rgba(148, 163, 184, 0.16);
  --nx-border-strong: rgba(56, 189, 248, 0.48);
  --nx-ink: #f8fafc;
  --nx-ink-soft: #cbd5e1;
  --nx-muted: #94a3b8;
  --nx-accent: #38bdf8;
  --nx-accent-2: #6366f1;
  --nx-accent-3: #22c55e;
  --nx-nav-bg: rgba(7, 11, 24, 0.86);
  --nx-dot: rgba(148, 163, 184, 0.13);
  --nx-shadow: 0 20px 50px rgba(0, 0, 0, 0.44);
}

html.light,
html[data-theme="light"] {
  --nx-bg: #f8fafc;
  --nx-elev: rgba(255, 255, 255, 0.96);
  --nx-card: rgba(255, 255, 255, 0.94);
  --nx-card-hover: #ffffff;
  --nx-soft: #f1f5f9;
  --nx-border: rgba(15, 23, 42, 0.11);
  --nx-border-strong: rgba(2, 132, 199, 0.46);
  --nx-ink: #0f172a;
  --nx-ink-soft: #334155;
  --nx-muted: #64748b;
  --nx-accent: #0284c7;
  --nx-accent-2: #4f46e5;
  --nx-accent-3: #16a34a;
  --nx-nav-bg: rgba(255, 255, 255, 0.9);
  --nx-dot: rgba(15, 23, 42, 0.075);
  --nx-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

/* Subject-specific accent refinement */
body.nx-subj-physics { --nx-accent: #38bdf8; --nx-accent-2: #6366f1; }
body.nx-subj-chem    { --nx-accent: #34d399; --nx-accent-2: #0ea5e9; }
body.nx-subj-bio     { --nx-accent: #f472b6; --nx-accent-2: #22c55e; }
body.nx-subj-code    { --nx-accent: #fbbf24; --nx-accent-2: #6366f1; }

/* =========================================================================
   1. BASE TYPOGRAPHY & ORBITAL SPACE BACKDROP
   ========================================================================= */
html[data-theme="dark"] body.nx-v3-enhanced,
html.dark body.nx-v3-enhanced {
  background-color: var(--nx-bg) !important;
  color: var(--nx-ink) !important;
  font-family: "Plus Jakarta Sans", "Be Vietnam Pro", system-ui, -apple-system, sans-serif !important;
  background-image: radial-gradient(var(--nx-dot) 1px, transparent 1px) !important;
  background-size: 28px 28px !important;
  background-attachment: fixed !important;
}

html[data-theme="light"] body.nx-v3-enhanced,
html.light body.nx-v3-enhanced {
  background-color: var(--nx-bg) !important;
  color: var(--nx-ink) !important;
  font-family: "Plus Jakarta Sans", "Be Vietnam Pro", system-ui, -apple-system, sans-serif !important;
  background-image: radial-gradient(var(--nx-dot) 1px, transparent 1px) !important;
  background-size: 28px 28px !important;
  background-attachment: fixed !important;
}

.nx-v3-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.nx-v3-ambient .nx-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(115px);
  opacity: 0.24;
  will-change: transform;
}
html[data-theme="light"] .nx-v3-ambient .nx-orb { opacity: 0.13; }
.nx-v3-ambient .nx-orb-1 { width: 480px; height: 480px; top: -150px; left: -120px; background: var(--nx-accent); }
.nx-v3-ambient .nx-orb-2 { width: 500px; height: 500px; top: 18%; right: -160px; background: var(--nx-accent-2); }
.nx-v3-ambient .nx-orb-3 { width: 420px; height: 420px; bottom: -140px; left: 28%; background: var(--nx-accent-3); }

/* Keep lab pages extra calm so eyes focus on the simulation canvas */
body.nx-page-lab .nx-v3-ambient .nx-orb { opacity: 0.14; }
html[data-theme="light"] body.nx-page-lab .nx-v3-ambient .nx-orb { opacity: 0.08; }

body.nx-v3-enhanced .quantum-grid,
body.nx-v3-enhanced .cyber-grid {
  background-color: transparent !important;
  background-image: none !important;
}

/* Crisp custom scrollbars */
body.nx-v3-enhanced ::-webkit-scrollbar { width: 7px; height: 7px; }
body.nx-v3-enhanced ::-webkit-scrollbar-track { background: transparent; }
body.nx-v3-enhanced ::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.32); border-radius: 999px; }
body.nx-v3-enhanced ::-webkit-scrollbar-thumb:hover { background: var(--nx-accent); }

/* =========================================================================
   2. FLOATING FROSTED GLASS HEADER (HUBS & LABS)
   ========================================================================= */
html[data-theme="dark"] body.nx-v3-enhanced > header,
html[data-theme="dark"] body.nx-v3-enhanced header.sticky {
  background: rgba(7, 11, 24, 0.88) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28) !important;
  transition: background-color 0.24s ease, border-color 0.24s ease !important;
}

html[data-theme="light"] body.nx-v3-enhanced > header,
html[data-theme="light"] body.nx-v3-enhanced header.sticky {
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.11) !important;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.08) !important;
  transition: background-color 0.24s ease, border-color 0.24s ease !important;
}

/* Keep header pills single-line & remove redundant auth sound button in compact V3 bar */
body.nx-v3-enhanced header span.rounded-full,
body.nx-v3-enhanced header a,
body.nx-v3-enhanced header button {
  white-space: nowrap;
}
body.nx-v3-enhanced #authHeaderSlot .nexus-sound-btn {
  display: none !important;
}
body.nx-v3-enhanced header a:has(> i.fa-grid-2) {
  display: none !important;
}

/* Floating pill-container header feel on wide desktop hub pages */
@media (min-width: 1024px) {
  body.nx-page-hub > header {
    width: min(1260px, calc(100% - 28px));
    margin: 12px auto 0 !important;
    top: 12px !important;
    border: 1px solid var(--nx-border) !important;
    border-radius: 20px !important;
  }
}

/* Header V3 injected action pills (Home / Theme Toggle / Quick Hub Links) */
.nx-v3-hdr-dock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Keep hub navigation and injected account/theme tools inside the viewport. */
body.nx-page-hub .nx-v3-header-layout{flex-wrap:wrap;gap:12px;min-width:0}
body.nx-page-hub .nx-v3-header-layout>div{min-width:0;max-width:100%}
body.nx-page-hub .nx-v3-header-actions{flex-wrap:wrap;justify-content:flex-end;gap:8px;flex:1 1 580px}
body.nx-page-hub .nx-v3-header-actions nav{flex-wrap:wrap;min-width:0;max-width:100%;justify-content:flex-end}
body.nx-page-hub .nx-v3-header-actions nav a{white-space:nowrap}
@media(max-width:767px){body.nx-page-hub .nx-v3-header-actions{flex-basis:auto;justify-content:flex-start}}

.nx-v3-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  padding: 0 11px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none !important;
  cursor: pointer;
  border: 1px solid var(--nx-border) !important;
  background: var(--nx-card) !important;
  color: var(--nx-ink) !important;
  transition: transform 0.14s ease, border-color 0.16s ease, background-color 0.16s ease !important;
  white-space: nowrap;
}
.nx-v3-pill-btn:hover {
  border-color: var(--nx-border-strong) !important;
  transform: translateY(-1px);
  color: var(--nx-accent) !important;
}
.nx-v3-pill-btn.nx-icon-only {
  width: 34px;
  padding: 0;
  font-size: 14px;
}

/* Hide legacy theme-toggle floating pill so UI stays crisp & uncluttered */
body.nx-v3-enhanced #nexusThemeFloatContainer,
body.nx-v3-enhanced #nexusThemeFloatingHud,
body.nx-v3-enhanced .nexus-theme-floating-pill {
  display: none !important;
}

/* Polished Lab Stepper, Filter Pills & Sandbox Draggable Tool Chips */
body.nx-v3-enhanced .filter-tab,
body.nx-v3-enhanced .speed-btn,
body.nx-v3-enhanced .tool-item,
body.nx-v3-enhanced .element-btn {
  border-radius: 12px !important;
  transition: transform 0.14s ease, border-color 0.16s ease, background-color 0.16s ease !important;
}
body.nx-v3-enhanced .tool-item:hover,
body.nx-v3-enhanced .element-btn:hover {
  transform: translateY(-2px);
  border-color: var(--nx-border-strong) !important;
}

/* Crisp Headings & Gradient Display Accent on Hubs */
body.nx-page-hub main h1 {
  letter-spacing: -0.025em;
  line-height: 1.15;
}
body.nx-page-lab main h2,
body.nx-page-lab main h3 {
  letter-spacing: -0.01em;
}

/* Unified Frosted Footer across Hubs & Labs */
body.nx-v3-enhanced footer {
  border-top: 1px solid var(--nx-border) !important;
  background: rgba(5, 8, 20, 0.72) !important;
  backdrop-filter: blur(14px);
}
html[data-theme="light"] body.nx-v3-enhanced footer {
  background: rgba(248, 250, 252, 0.85) !important;
}

/* =========================================================================
   3. ORBITAL GLASS BENTO CARDS & PANELS (DARK + LIGHT)
   ========================================================================= */
html[data-theme="dark"] body.nx-v3-enhanced .glass-card,
html[data-theme="dark"] body.nx-v3-enhanced .glass-panel,
html[data-theme="dark"] body.nx-v3-enhanced .glass-box,
html[data-theme="dark"] body.nx-v3-enhanced .nr-card,
html[data-theme="dark"] body.nx-v3-enhanced .sim-card,
html[data-theme="dark"] body.nx-v3-enhanced .flagship-card,
html[data-theme="dark"] body.nx-v3-enhanced .exp-card,
html[data-theme="dark"] body.nx-v3-enhanced .lab-card,
html[data-theme="dark"] body.nx-v3-enhanced main > section:not(.no-v3-card)[class*="bg-slate-"],
html[data-theme="dark"] body.nx-v3-enhanced main .rounded-2xl[class*="bg-slate-9"],
html[data-theme="dark"] body.nx-v3-enhanced main .rounded-3xl[class*="bg-slate-9"],
html[data-theme="dark"] body.nx-v3-enhanced aside .rounded-2xl[class*="bg-slate-9"] {
  background: linear-gradient(155deg, rgba(14, 22, 44, 0.86), rgba(9, 14, 30, 0.9)) !important;
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  border-radius: 22px !important;
}

html[data-theme="light"] body.nx-v3-enhanced .glass-card,
html[data-theme="light"] body.nx-v3-enhanced .glass-panel,
html[data-theme="light"] body.nx-v3-enhanced .glass-box,
html[data-theme="light"] body.nx-v3-enhanced .nr-card,
html[data-theme="light"] body.nx-v3-enhanced .sim-card,
html[data-theme="light"] body.nx-v3-enhanced .flagship-card,
html[data-theme="light"] body.nx-v3-enhanced .exp-card,
html[data-theme="light"] body.nx-v3-enhanced .lab-card,
html[data-theme="light"] body.nx-v3-enhanced main > section:not(.no-v3-card)[class*="bg-slate-"],
html[data-theme="light"] body.nx-v3-enhanced main .rounded-2xl[class*="bg-slate-9"],
html[data-theme="light"] body.nx-v3-enhanced main .rounded-3xl[class*="bg-slate-9"],
html[data-theme="light"] body.nx-v3-enhanced aside .rounded-2xl[class*="bg-slate-9"] {
  background: rgba(255, 255, 255, 0.94) !important;
  border: 1px solid rgba(15, 23, 42, 0.11) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  border-radius: 22px !important;
  color: #0f172a !important;
}

/* Smooth hover glow ONLY on clickable navigation/catalog cards (never on interactive lab containers) */
body.nx-page-hub .glass-card:hover,
body.nx-page-hub .sim-card:hover,
body.nx-page-hub .flagship-card:hover,
body.nx-page-hub .exp-card:hover,
body.nx-page-hub .lab-card:hover,
body.nx-page-hub a.rounded-2xl:hover,
body.nx-page-hub a.rounded-3xl:hover {
  border-color: var(--nx-border-strong) !important;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45), 0 0 28px rgba(56, 189, 248, 0.16) !important;
  transform: translateY(-4px) !important;
}
html[data-theme="light"] body.nx-page-hub .glass-card:hover,
html[data-theme="light"] body.nx-page-hub .sim-card:hover,
html[data-theme="light"] body.nx-page-hub .flagship-card:hover,
html[data-theme="light"] body.nx-page-hub .exp-card:hover,
html[data-theme="light"] body.nx-page-hub .lab-card:hover {
  box-shadow: 0 20px 44px rgba(2, 132, 199, 0.14) !important;
}

/* =========================================================================
   4. BRILLIANT.ORG TACTILE 3D BUTTONS & INTERACTIVE LAB CONTROLS
   ========================================================================= */
body.nx-v3-enhanced #btnStart,
body.nx-v3-enhanced #btnPlay,
body.nx-v3-enhanced #btnDrop,
body.nx-v3-enhanced #btnRun,
body.nx-v3-enhanced #btnLaunch,
body.nx-v3-enhanced button[class*="from-emerald-"],
body.nx-v3-enhanced a[class*="from-emerald-"],
body.nx-v3-enhanced button[class*="from-cyan-"],
body.nx-v3-enhanced a[class*="from-cyan-"],
body.nx-v3-enhanced button[class*="from-blue-"],
body.nx-v3-enhanced a[class*="from-blue-"],
body.nx-v3-enhanced button[class*="from-amber-"],
body.nx-v3-enhanced a[class*="from-amber-"] {
  border-radius: 14px !important;
  font-weight: 800 !important;
  box-shadow: 0 3px 0 rgba(2, 6, 23, 0.45), 0 10px 24px rgba(14, 165, 233, 0.24) !important;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.16s ease !important;
}

body.nx-v3-enhanced #btnStart:hover,
body.nx-v3-enhanced #btnPlay:hover,
body.nx-v3-enhanced #btnDrop:hover,
body.nx-v3-enhanced #btnRun:hover,
body.nx-v3-enhanced #btnLaunch:hover,
body.nx-v3-enhanced button[class*="from-emerald-"]:hover,
body.nx-v3-enhanced a[class*="from-emerald-"]:hover,
body.nx-v3-enhanced button[class*="from-cyan-"]:hover,
body.nx-v3-enhanced a[class*="from-cyan-"]:hover,
body.nx-v3-enhanced button[class*="from-blue-"]:hover,
body.nx-v3-enhanced a[class*="from-blue-"]:hover,
body.nx-v3-enhanced button[class*="from-amber-"]:hover,
body.nx-v3-enhanced a[class*="from-amber-"]:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

body.nx-v3-enhanced #btnStart:active,
body.nx-v3-enhanced #btnPlay:active,
body.nx-v3-enhanced #btnDrop:active,
body.nx-v3-enhanced #btnRun:active,
body.nx-v3-enhanced #btnLaunch:active,
body.nx-v3-enhanced button[class*="from-emerald-"]:active,
body.nx-v3-enhanced a[class*="from-emerald-"]:active,
body.nx-v3-enhanced button[class*="from-cyan-"]:active,
body.nx-v3-enhanced a[class*="from-cyan-"]:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(2, 6, 23, 0.45) !important;
}

/* Precision Glowing Lab Range Sliders */
body.nx-v3-enhanced input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.3), rgba(99, 102, 241, 0.28));
  border: 1px solid rgba(56, 189, 248, 0.25);
  outline: none;
  cursor: pointer;
}
body.nx-v3-enhanced input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(145deg, #67e8f9, #0284c7);
  border: 2px solid #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.7), 0 2px 6px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
body.nx-v3-enhanced input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.14);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.95), 0 3px 8px rgba(0, 0, 0, 0.5);
}
body.nx-v3-enhanced input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(145deg, #67e8f9, #0284c7);
  border: 2px solid #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.7);
  cursor: pointer;
}

/* =========================================================================
   5. LABORATORY SIMULATION VIEWPORTS, TELEMETRY & TABLES
   ========================================================================= */
body.nx-v3-enhanced .canvas-container,
body.nx-v3-enhanced .canvas-box,
body.nx-v3-enhanced #canvasContainer,
body.nx-v3-enhanced #simCanvasWrap {
  background: radial-gradient(circle at 50% 24%, rgba(20, 42, 84, 0.75) 0%, #050a18 82%) !important;
  border-top: 1px solid rgba(56, 189, 248, 0.18);
  border-bottom: 1px solid rgba(56, 189, 248, 0.14);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.55) !important;
}

/* Keep in-canvas HUD readouts sleek dark frosted glass even in Light Mode so canvas vectors pop */
body.nx-v3-enhanced .canvas-container > div[class*="absolute"],
body.nx-v3-enhanced .canvas-box > div[class*="absolute"] {
  background: rgba(7, 12, 28, 0.86) !important;
  border: 1px solid rgba(56, 189, 248, 0.32) !important;
  backdrop-filter: blur(12px) !important;
  color: #f8fafc !important;
  border-radius: 14px !important;
}
body.nx-v3-enhanced .canvas-container > div[class*="absolute"] *,
body.nx-v3-enhanced .canvas-box > div[class*="absolute"] * {
  font-variant-numeric: tabular-nums;
}

/* Lab & Hub Data Tables */
body.nx-v3-enhanced table {
  border-collapse: separate;
  border-spacing: 0;
}
html[data-theme="dark"] body.nx-v3-enhanced thead th {
  background: rgba(15, 23, 42, 0.85) !important;
  color: #67e8f9 !important;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
}
html[data-theme="dark"] body.nx-v3-enhanced tbody tr:hover {
  background: rgba(56, 189, 248, 0.06) !important;
}

/* Inputs, Selects & Search boxes */
html[data-theme="dark"] body.nx-v3-enhanced input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] body.nx-v3-enhanced select,
html[data-theme="dark"] body.nx-v3-enhanced textarea {
  background-color: rgba(8, 14, 30, 0.88) !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
  color: #f8fafc !important;
  border-radius: 12px;
}
html[data-theme="dark"] body.nx-v3-enhanced input:not([type="range"]):focus,
html[data-theme="dark"] body.nx-v3-enhanced select:focus,
html[data-theme="dark"] body.nx-v3-enhanced textarea:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16) !important;
}

/* =========================================================================
   6. CLEAN LIGHT-MODE ADAPTATION FOR ALL HUBS & LABS (EXCLUDING MODALS & CANVASES)
   ========================================================================= */
html[data-theme="light"] body.nx-v3-enhanced main h1,
html[data-theme="light"] body.nx-v3-enhanced main h2,
html[data-theme="light"] body.nx-v3-enhanced main h3,
html[data-theme="light"] body.nx-v3-enhanced main h4,
html[data-theme="light"] body.nx-v3-enhanced header h1,
html[data-theme="light"] body.nx-v3-enhanced header h2 {
  color: #0f172a !important;
}

html[data-theme="light"] body.nx-v3-enhanced header .text-white,
html[data-theme="light"] body.nx-v3-enhanced main .text-white:not(button):not(a):not([class*="bg-gradient"]):not(.canvas-container *):not(.canvas-box *),
html[data-theme="light"] body.nx-v3-enhanced main .text-slate-100:not(.canvas-container *):not(.canvas-box *),
html[data-theme="light"] body.nx-v3-enhanced main .text-slate-200:not(.canvas-container *):not(.canvas-box *) {
  color: #0f172a !important;
}

html[data-theme="light"] body.nx-v3-enhanced header .text-slate-300,
html[data-theme="light"] body.nx-v3-enhanced header .text-slate-400,
html[data-theme="light"] body.nx-v3-enhanced main .text-slate-300:not(.canvas-container *):not(.canvas-box *),
html[data-theme="light"] body.nx-v3-enhanced main .text-slate-400:not(.canvas-container *):not(.canvas-box *) {
  color: #475569 !important;
}

html[data-theme="light"] body.nx-v3-enhanced main [class*="bg-slate-950"]:not(.canvas-container):not(.canvas-box):not(.canvas-container *):not(.canvas-box *),
html[data-theme="light"] body.nx-v3-enhanced main [class*="bg-slate-900"]:not(.canvas-container):not(.canvas-box):not(.canvas-container *):not(.canvas-box *) {
  background-color: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.11) !important;
}

html[data-theme="light"] body.nx-v3-enhanced main [class*="bg-slate-800"]:not(button[class*="active"]):not(.canvas-container *):not(.canvas-box *),
html[data-theme="light"] body.nx-v3-enhanced header [class*="bg-slate-800"],
html[data-theme="light"] body.nx-v3-enhanced header [class*="bg-slate-900"] {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.14) !important;
}

html[data-theme="light"] body.nx-v3-enhanced input:not([type="range"]),
html[data-theme="light"] body.nx-v3-enhanced select,
html[data-theme="light"] body.nx-v3-enhanced textarea {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
}

/* =========================================================================
   7. PROTECT SPECIAL DARK OVERLAYS (POL AI, TOUR HUB, QUIZ MODAL, AUTH & MAINTENANCE)
   ========================================================================= */
#nexusAiModal,
#nexusAiModal *,
#nexusPeakGuideHub,
#nexusPeakMissionHud,
#nexus-maintenance-shield-root {
  font-family: "Plus Jakarta Sans", "Be Vietnam Pro", system-ui, sans-serif;
}
#nexusAiModal h1, #nexusAiModal h2, #nexusAiModal h3, #nexusAiModal h4, #nexusAiModal strong {
  color: #f8fafc !important;
}

/* Pre-Experiment Quiz Modal: razor-sharp contrast in BOTH Dark & Light modes */
#nexusQuizModalOverlay {
  z-index: 100050 !important;
}
#nexusQuizModalOverlay .nexus-quiz-card {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid rgba(56, 189, 248, 0.45) !important;
}
#nexusQuizModalOverlay .nexus-quiz-card h2,
#nexusQuizModalOverlay .nexus-quiz-card h3,
#nexusQuizModalOverlay .nexus-quiz-card #nexusQuizQuestionText {
  color: #0f172a !important;
}
html[data-theme="dark"] #nexusQuizModalOverlay .nexus-quiz-card {
  background: linear-gradient(155deg, rgba(13, 21, 44, 0.98), rgba(6, 11, 26, 0.99)) !important;
  color: #f8fafc !important;
  border: 1.5px solid rgba(56, 189, 248, 0.5) !important;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.8), 0 0 40px rgba(14, 165, 233, 0.25) !important;
}
html[data-theme="dark"] #nexusQuizModalOverlay .nexus-quiz-card > div:first-child {
  background: rgba(15, 23, 42, 0.95) !important;
  border-bottom-color: rgba(148, 163, 184, 0.2) !important;
}
html[data-theme="dark"] #nexusQuizModalOverlay .nexus-quiz-card h2,
html[data-theme="dark"] #nexusQuizModalOverlay .nexus-quiz-card h3,
html[data-theme="dark"] #nexusQuizModalOverlay .nexus-quiz-card #nexusQuizQuestionText {
  color: #f8fafc !important;
}
html[data-theme="dark"] #nexusQuizModalOverlay #nexusQuizStepQuestion > div:first-child {
  background: rgba(15, 23, 42, 0.85) !important;
  border-left-color: #38bdf8 !important;
}
html[data-theme="dark"] #nexusQuizModalOverlay .nexus-option-btn {
  background: rgba(15, 23, 42, 0.78) !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] #nexusQuizModalOverlay .nexus-option-btn:hover,
html[data-theme="dark"] #nexusQuizModalOverlay .nexus-option-btn.selected {
  background: rgba(14, 165, 233, 0.2) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
}
html[data-theme="dark"] #nexusQuizModalOverlay #nexusBtnSkipQuiz {
  background: rgba(30, 41, 59, 0.85) !important;
  color: #cbd5e1 !important;
  border-color: rgba(148, 163, 184, 0.3) !important;
}
