/* ============================================================
   DashAdvisr — Theme System (Light / Dark Mode)

   Two theme variants controlled by data-theme attribute on <html>.
   Default is dark (current brand look). Light mode is the new variant.

   Brand colors (--accent, --teal, status colors) stay the same
   in both modes. Only surface/background/text colors change.

   Include this file BEFORE other stylesheets so variables cascade.
   ============================================================ */

/* ── LIGHT THEME (default for pages that were already light) ── */
[data-theme="light"],
:root {
  --theme-bg:             #F0F4F8;
  --theme-bg-warm:        #fafaf8;
  --theme-surface:        #ffffff;
  --theme-surface-alpha:  rgba(255,255,255,0.72);
  --theme-surface-border: rgba(255,255,255,0.90);
  --theme-ink:            #0d1117;
  --theme-ink-soft:       #444c56;
  --theme-ink-muted:      #8b95a1;
  --theme-nav-bg:         rgba(248,250,252,0.90);
  --theme-nav-border:     rgba(37,99,235,0.10);
  --theme-border:         rgba(37,99,235,0.08);
  --theme-border-subtle:  rgba(0,0,0,0.06);
  --theme-card-shadow:    0 2px 12px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.03);
  --theme-card-hover:     0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  --theme-overlay:        rgba(0,0,0,0.35);
  --theme-sidebar-bg:     #ffffff;
  --theme-sidebar-shadow: 4px 0 24px rgba(0,0,0,0.08);
  --theme-popover-bg:     #ffffff;
  --theme-popover-border: rgba(0,0,0,0.1);
  --theme-popover-shadow: 0 8px 32px rgba(0,0,0,0.12);
  --theme-input-bg:       #ffffff;
  --theme-input-border:   rgba(0,0,0,0.12);
  --theme-hover-bg:       rgba(0,0,0,0.05);
  --theme-bar-track:      rgba(0,0,0,0.07);
  --theme-modal-bg:       #ffffff;
  --theme-modal-shadow:   0 16px 48px rgba(0,0,0,0.15);
  --theme-toast-bg:       #0d1117;
  --theme-code-bg:        #f3f3f4;
  --theme-gradient-blob1: rgba(37,99,235,0.08);
  --theme-gradient-blob2: rgba(59,130,246,0.06);
  --theme-gradient-blob3: rgba(29,78,216,0.05);
  --theme-noise-opacity:  0.025;
  --theme-mini-kpi-bg:    rgba(255,255,255,0.55);
  --theme-mini-kpi-border:rgba(255,255,255,0.75);
  --theme-chip-bg:        rgba(255,255,255,0.6);
  --theme-form-input-bg:  rgba(255,255,255,0.7);
  --theme-hero-glow:      rgba(37,99,235,0.12);
  --theme-proof-divider:  rgba(37,99,235,0.08);
  --theme-browser-bg:     #f3f3f4;
  --theme-browser-card:   #ffffff;
  --theme-browser-url:    #888888;
  --theme-404-bg:         #F0F4F8;
  --theme-404-surface:    rgba(37,99,235,0.06);
  --theme-404-text:       #0d1117;
  --theme-404-muted:      #8b95a1;
  --theme-scroll-track:   rgba(0,0,0,0.05);
  --theme-scroll-thumb:   rgba(0,0,0,0.15);
  --theme-accent-soft:    #DBEAFE;
}

/* ── DARK THEME — Obsidian Arctic / Glassmorphism ─────────── */
[data-theme="dark"] {
  --theme-bg:             #0A192F;
  --theme-bg-warm:        #0C1B33;
  --theme-surface:        rgba(15,23,42,0.75);
  --theme-surface-alpha:  rgba(15,23,42,0.65);
  --theme-surface-border: rgba(255,255,255,0.10);
  --theme-glass-blur:     blur(16px) saturate(1.2);
  --theme-accent-glow:    rgba(0,210,255,0.08);
  --theme-ink:            #e2e8f0;
  --theme-ink-soft:       #a8b8c8;
  --theme-ink-muted:      #7a8a9a;
  --theme-nav-bg:         rgba(10,25,47,0.88);
  --theme-nav-border:     rgba(255,255,255,0.06);
  --theme-border:         rgba(255,255,255,0.06);
  --theme-border-subtle:  rgba(255,255,255,0.04);
  --theme-card-shadow:    0 2px 16px rgba(0,10,30,0.3), 0 1px 3px rgba(0,0,0,0.2);
  --theme-card-hover:     0 8px 40px rgba(0,10,30,0.45), 0 2px 8px rgba(0,210,255,0.06);
  --theme-overlay:        rgba(0,0,0,0.55);
  --theme-sidebar-bg:     #0A192F;
  --theme-sidebar-shadow: 4px 0 24px rgba(0,0,0,0.3);
  --theme-popover-bg:     rgba(15,23,42,0.9);
  --theme-popover-border: rgba(255,255,255,0.08);
  --theme-popover-shadow: 0 8px 32px rgba(0,0,0,0.4);
  --theme-input-bg:       rgba(15,23,42,0.6);
  --theme-input-border:   rgba(255,255,255,0.1);
  --theme-hover-bg:       rgba(255,255,255,0.06);
  --theme-bar-track:      rgba(255,255,255,0.08);
  --theme-modal-bg:       #1a1f2e;
  --theme-modal-shadow:   0 16px 48px rgba(0,0,0,0.5);
  --theme-toast-bg:       #e2e8f0;
  --theme-code-bg:        rgba(10,25,47,0.8);
  --theme-gradient-blob1: rgba(0,210,255,0.10);
  --theme-gradient-blob2: rgba(37,99,235,0.08);
  --theme-gradient-blob3: rgba(0,166,153,0.06);
  --theme-noise-opacity:  0.04;
  --theme-mini-kpi-bg:    rgba(255,255,255,0.04);
  --theme-mini-kpi-border:rgba(255,255,255,0.06);
  --theme-chip-bg:        rgba(255,255,255,0.06);
  --theme-form-input-bg:  rgba(255,255,255,0.06);
  --theme-hero-glow:      rgba(37,99,235,0.18);
  --theme-proof-divider:  rgba(255,255,255,0.08);
  --theme-browser-bg:     #141824;
  --theme-browser-card:   #1a1f2e;
  --theme-browser-url:    #64748b;
  --theme-404-bg:         #0A192F;
  --theme-404-surface:    rgba(255,255,255,0.06);
  --theme-404-text:       #e2e8f0;
  --theme-404-muted:      #64748b;
  --theme-scroll-track:   rgba(255,255,255,0.03);
  --theme-scroll-thumb:   rgba(255,255,255,0.12);
  --theme-accent-soft:    rgba(37,99,235,0.15);
}

/* ── THEME APPLICATION LAYER ──────────────────────────────── */
/* Override the existing CSS variables used across the site.   */
/* Uses html[data-theme] for higher specificity than inline    */
/* :root blocks in pages with embedded <style> tags.           */

html[data-theme="light"],
html[data-theme="dark"] {
  --bg:           var(--theme-bg);
  --surface:      var(--theme-surface);
  --ink:          var(--theme-ink);
  --ink-soft:     var(--theme-ink-soft);
  --ink-muted:    var(--theme-ink-muted);
  --border:       var(--theme-border);
  --tile-bg:      var(--theme-surface-alpha);
  --tile-border:  var(--theme-surface-border);
  --accent-soft:  var(--theme-accent-soft, #DBEAFE);
}

/* ── GLOBAL OVERRIDES ─────────────────────────────────────── */
/* These handle elements that use hardcoded colors rather than variables */

[data-theme="dark"] body {
  background: var(--theme-bg);
  color: var(--theme-ink);
}

/* Nav */
[data-theme="dark"] nav {
  background: var(--theme-nav-bg);
  border-bottom-color: var(--theme-nav-border);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
}

/* Background gradient blobs */
[data-theme="dark"] .bg-gradient {
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, var(--theme-gradient-blob1) 0%, transparent 100%),
    radial-gradient(ellipse 50% 40% at 80% 75%, var(--theme-gradient-blob2) 0%, transparent 100%),
    radial-gradient(ellipse 40% 40% at 60% 10%, var(--theme-gradient-blob3) 0%, transparent 100%);
}

/* Auth gate */
[data-theme="dark"] #auth-gate {
  background: var(--theme-bg);
}

/* Sidebar */
[data-theme="dark"] .sidebar {
  background: var(--theme-sidebar-bg);
  box-shadow: var(--theme-sidebar-shadow);
}
[data-theme="dark"] .sidebar-header {
  border-bottom-color: var(--theme-border-subtle);
}
[data-theme="dark"] .sidebar-overlay.open {
  background: var(--theme-overlay);
}
[data-theme="dark"] .sidebar-link:hover {
  background: rgba(37,99,235,0.1);
}

/* Tiles */
[data-theme="dark"] .tile {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 4px 24px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.06);
}
[data-theme="dark"] .tile:hover {
  box-shadow:
    0 8px 32px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.08);
  border-color: rgba(37,99,235,0.2);
}

/* Health tile gradient */
[data-theme="dark"] .tile-health,
[data-theme="dark"] .tile-scorecard {
  background: linear-gradient(135deg, rgba(37,99,235,0.12) 0%, var(--theme-surface-alpha) 100%);
}

/* Insight tile gradient */
[data-theme="dark"] .tile-insight {
  background: linear-gradient(135deg, rgba(124,58,237,0.1) 0%, var(--theme-surface-alpha) 100%);
}

/* Bar tracks */
[data-theme="dark"] .h-bar-track,
[data-theme="dark"] .dm-bar-track,
[data-theme="dark"] .weight-bar-track,
[data-theme="dark"] .bm-bar {
  background: var(--theme-bar-track);
}

/* Mini KPIs */
[data-theme="dark"] .mini-kpi {
  background: var(--theme-mini-kpi-bg);
  border-color: var(--theme-mini-kpi-border);
}

/* Domain mini */
[data-theme="dark"] .domain-mini {
  background: var(--theme-mini-kpi-bg);
  border-color: var(--theme-mini-kpi-border);
}
[data-theme="dark"] .domain-mini:hover {
  background: rgba(37,99,235,0.1);
  border-color: rgba(37,99,235,0.25);
}

/* Domain buckets */
[data-theme="dark"] .domain-bucket {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.07);
  box-shadow:
    0 2px 16px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255,255,255,0.05);
}
[data-theme="dark"] .domain-bucket:hover {
  box-shadow:
    0 8px 32px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.07);
  border-color: rgba(37,99,235,0.18);
}

/* Activity items */
[data-theme="dark"] .activity-item {
  border-bottom-color: var(--theme-border-subtle);
}

/* Todo items */
[data-theme="dark"] .todo-item {
  border-bottom-color: var(--theme-border-subtle);
}

/* Tip popover */
[data-theme="dark"] .tip-popover {
  background: var(--theme-popover-bg);
  border-color: var(--theme-popover-border);
  box-shadow: var(--theme-popover-shadow);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
}

/* Tip button */
[data-theme="dark"] .tip-btn {
  background: rgba(255,255,255,0.08);
}

/* Modal */
[data-theme="dark"] .modal-overlay {
  background: var(--theme-overlay);
}
[data-theme="dark"] .modal-card {
  background: var(--theme-modal-bg);
  box-shadow: var(--theme-modal-shadow);
}

/* Weight rows */
[data-theme="dark"] .weight-row {
  border-bottom-color: var(--theme-border-subtle);
}

/* Benchmark rows */
[data-theme="dark"] .bm-row {
  border-bottom-color: var(--theme-border-subtle);
}

/* Module tiles */
[data-theme="dark"] .module-tile {
  background: var(--theme-mini-kpi-bg);
  border-color: var(--theme-border);
}
[data-theme="dark"] .module-tile.module-unlocked {
  background: var(--theme-surface-alpha);
  border-color: rgba(37,99,235,0.2);
}

/* Forms */
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
  background: var(--theme-form-input-bg);
  border-color: var(--theme-input-border);
  color: var(--theme-ink);
}

/* Chips */
[data-theme="dark"] .chip {
  background: var(--theme-chip-bg);
  border-color: var(--theme-border);
  color: var(--theme-ink-muted);
}

/* Toast */
[data-theme="dark"] .toast {
  background: var(--theme-toast-bg);
  color: var(--theme-bg);
}

/* Placeholder tile */
[data-theme="dark"] .tile-placeholder {
  border-color: rgba(37,99,235,0.25);
  background: rgba(37,99,235,0.04);
}
[data-theme="dark"] .tile-placeholder:hover {
  border-color: var(--accent);
  background: rgba(37,99,235,0.08);
}

/* Sage prompt (non-dark-card variant) */
[data-theme="dark"] .sage-prompt {
  background: rgba(255,255,255,0.05);
  border-color: var(--theme-border);
}
[data-theme="dark"] .sage-input {
  color: var(--theme-ink);
}
[data-theme="dark"] .sage-input::placeholder {
  color: var(--theme-ink-muted);
}

/* iaction ghost */
[data-theme="dark"] .iaction.ghost {
  background: rgba(255,255,255,0.06);
  color: var(--theme-ink-soft);
}
[data-theme="dark"] .iaction.ghost:hover {
  background: rgba(255,255,255,0.1);
}

/* Sandbox ribbon */
[data-theme="dark"] .sandbox-ribbon {
  background: rgba(212,130,10,0.15);
  border-color: rgba(212,130,10,0.25);
}

/* Demo bar */
[data-theme="dark"] .demo-bar {
  background: rgba(124,95,245,0.12);
  border-color: rgba(124,95,245,0.25);
  color: #c4b5fd;
}
[data-theme="dark"] .demo-bar a { color: #c4b5fd; }

/* Compensation table */
[data-theme="dark"] .comp-table th {
  background: var(--theme-code-bg, #1e293b);
  color: var(--ink);
}
[data-theme="dark"] .comp-table td {
  border-bottom-color: var(--theme-border-subtle, rgba(255,255,255,0.06));
}

/* Inventory table */
[data-theme="dark"] .inv-table th {
  background: var(--theme-code-bg, #1e293b);
  color: var(--ink);
}
[data-theme="dark"] .inv-table td {
  border-bottom-color: var(--theme-border-subtle, rgba(255,255,255,0.06));
}

/* Add Performer page */
[data-theme="dark"] .edition-card {
  background: var(--surface, #0f172a);
}
[data-theme="dark"] .edition-card:hover {
  background: var(--theme-surface-hover, #1e293b);
}

/* Connect pages */
[data-theme="dark"] .permissions-list {
  background: var(--theme-input-bg, #0f172a);
}

/* Onboarding */
[data-theme="dark"] .onb-progress {
  background: rgba(10,25,47,0.92);
}
[data-theme="dark"] .onb-input,
[data-theme="dark"] .onb-select {
  background: var(--theme-input-bg, #0f172a);
  color: var(--ink);
}
[data-theme="dark"] .int-card {
  background: var(--surface, #0f172a);
}
[data-theme="dark"] .int-badge.soon {
  background: rgba(255,255,255,0.08);
}

/* Settings card */
[data-theme="dark"] .settings-card {
  background: var(--theme-surface-alpha);
  border-color: var(--theme-surface-border);
  box-shadow: var(--theme-card-shadow);
}

/* User chip */
[data-theme="dark"] .user-chip {
  background: var(--theme-surface-alpha);
  border-color: var(--theme-surface-border);
}

/* Sign out button */
[data-theme="dark"] .btn-signout {
  border-color: var(--theme-border);
  color: var(--theme-ink-muted);
}

/* Nav link hover */
[data-theme="dark"] .nav-link:hover {
  background: var(--theme-hover-bg);
  color: var(--theme-ink);
}

/* Comparison table (signup) */
[data-theme="dark"] .compare-table {
  background: var(--theme-surface);
  border-color: var(--theme-border);
}
[data-theme="dark"] .compare-table th {
  background: var(--theme-code-bg);
  color: var(--theme-ink);
}
[data-theme="dark"] .compare-table td {
  border-bottom-color: var(--theme-border-subtle);
}

/* FAQ items */
[data-theme="dark"] .faq-item {
  background: var(--theme-surface);
  border-color: var(--theme-border);
}

/* Price cards */
[data-theme="dark"] .price-card {
  background: var(--theme-surface);
  border-color: var(--theme-border);
}
[data-theme="dark"] .price-card.featured {
  border-color: var(--accent);
}

/* Edition cards */
[data-theme="dark"] .edition-card {
  background: var(--theme-surface);
  border-color: var(--theme-border);
}
[data-theme="dark"] .edition-card:hover {
  border-color: rgba(37,99,235,0.3);
  background: var(--theme-surface-alpha);
}
[data-theme="dark"] .edition-card.selected {
  background: rgba(37,99,235,0.08);
}

/* Period bar (manual-entry) */
[data-theme="dark"] .period-bar {
  background: var(--theme-surface-alpha);
  border-color: var(--theme-surface-border);
}

/* Scrollbar (Webkit) */
[data-theme="dark"] ::-webkit-scrollbar {
  width: 8px;
}
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--theme-scroll-track);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--theme-scroll-thumb);
  border-radius: 4px;
}

/* ── THEME TOGGLE BUTTON ──────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--theme-border);
  border-radius: 50%;
  cursor: pointer;
  color: var(--theme-ink-muted);
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
  position: relative;
}
.theme-toggle:hover {
  background: var(--theme-hover-bg);
  color: var(--theme-ink);
  border-color: var(--theme-ink-muted);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease, opacity 0.2s ease;
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
}
/* Show sun in dark mode (click to go light), moon in light mode (click to go dark) */
[data-theme="light"] .theme-toggle .icon-sun { opacity: 0; transform: rotate(90deg) scale(0.5); }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }

/* ── LANDING / STANDALONE PAGE OVERRIDES ──────────────────── */
/* Pages with inline styles that define their own backgrounds   */

/* Login page */
[data-theme="dark"] .bg-orbs::before {
  background: radial-gradient(ellipse, rgba(37,99,235,0.12) 0%, transparent 65%);
}
[data-theme="dark"] .bg-orbs::after {
  background: radial-gradient(ellipse, rgba(26,158,110,0.1) 0%, transparent 65%);
}
[data-theme="dark"] .login-card {
  background: var(--theme-surface);
  border-color: var(--theme-border);
  box-shadow: 0 4px 40px rgba(0,0,0,0.3), 0 1px 4px rgba(0,0,0,0.2);
}
[data-theme="dark"] .login-card input {
  background: var(--theme-input-bg);
  border-color: var(--theme-input-border);
  color: var(--theme-ink);
}
[data-theme="dark"] .login-card input::placeholder {
  color: var(--theme-ink-muted);
}
[data-theme="dark"] .divider::before,
[data-theme="dark"] .divider::after {
  background: var(--theme-border);
}
[data-theme="dark"] .btn-magic {
  border-color: var(--theme-border);
  color: var(--theme-ink-soft);
}
[data-theme="dark"] .btn-magic:hover {
  border-color: var(--theme-ink-muted);
  color: var(--theme-ink);
}

/* Steps (landing page) */
[data-theme="dark"] .step {
  background: var(--theme-surface);
  border-color: var(--theme-border);
}
[data-theme="dark"] .step:hover {
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* Feature cards */
[data-theme="dark"] .feature-card {
  background: var(--theme-surface);
  border-color: var(--theme-border);
}
[data-theme="dark"] .feature-card:hover {
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
[data-theme="dark"] .feature-icon {
  background: rgba(37,99,235,0.15);
}

/* Integration pills */
[data-theme="dark"] .integration-pill {
  background: var(--theme-surface);
  border-color: var(--theme-border);
  color: var(--theme-ink-soft);
}

/* Data trust callout */
[data-theme="dark"] .data-trust-callout {
  background: var(--theme-surface);
  border-color: var(--theme-border);
  color: var(--theme-ink-muted);
}

/* Onboarding wizard */
[data-theme="dark"] .wizard-container {
  background: var(--theme-surface);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
[data-theme="dark"] .wizard-container input[type="text"] {
  background: var(--theme-input-bg);
  border-color: var(--theme-input-border);
  color: var(--theme-ink);
}
[data-theme="dark"] .progress-dot {
  background: var(--theme-bar-track);
}

/* Help page content cards */
[data-theme="dark"] .help-card,
[data-theme="dark"] .help-section {
  background: var(--theme-surface);
  border-color: var(--theme-border);
}

/* Legal pages */
[data-theme="dark"] .legal-card,
[data-theme="dark"] .policy-card,
[data-theme="dark"] .terms-card {
  background: var(--theme-surface);
  border-color: var(--theme-border);
}

/* 404 page */
[data-theme="dark"] .code {
  color: var(--accent);
}

/* Footer */
[data-theme="dark"] footer {
  border-top-color: var(--theme-border);
}

/* CTA email form in dark mode */
[data-theme="dark"] .email-form input:focus {
  border-color: var(--accent);
}

/* Pricing page btn-login */
[data-theme="dark"] .btn-login {
  color: var(--theme-ink-soft);
  border-color: var(--theme-border);
}
[data-theme="dark"] .btn-login:hover {
  color: var(--theme-ink);
  border-color: var(--theme-ink-muted);
}

/* Price features list */
[data-theme="dark"] .price-features li {
  border-bottom-color: var(--theme-border-subtle);
  color: var(--theme-ink-soft);
}

/* Hero section sign in link */
[data-theme="dark"] .hero-sub {
  color: var(--theme-ink-soft);
}

/* Section text */
[data-theme="dark"] .section-body {
  color: var(--theme-ink-soft);
}
[data-theme="dark"] .step p,
[data-theme="dark"] .feature-card p {
  color: var(--theme-ink-soft);
}

/* btn-ghost in dark mode */
[data-theme="dark"] .btn-ghost {
  color: var(--theme-ink-soft);
  border-color: var(--theme-border);
}
[data-theme="dark"] .btn-ghost:hover {
  color: var(--theme-ink);
  border-color: var(--theme-ink);
}

/* Proof divider */
[data-theme="dark"] .proof-divider {
  background: var(--theme-proof-divider);
}

/* Alert boxes */
[data-theme="dark"] .alert.error {
  background: rgba(212,58,58,0.12);
  border-color: rgba(212,58,58,0.2);
}
[data-theme="dark"] .alert.success {
  background: rgba(26,158,110,0.12);
  border-color: rgba(26,158,110,0.2);
}

/* Choose button (signup) */
[data-theme="dark"] .btn-choose {
  background: var(--theme-surface);
}
[data-theme="dark"] .btn-choose:hover {
  background: rgba(37,99,235,0.1);
}

/* ── GLASSMORPHISM LAYER (Dark Mode) ───────────────────────── */
[data-theme="dark"] .tile,
[data-theme="dark"] .domain-bucket {
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
}
[data-theme="dark"] .settings-card,
[data-theme="dark"] .modal-card,
[data-theme="dark"] .login-card,
[data-theme="dark"] .wizard-container,
[data-theme="dark"] .price-card,
[data-theme="dark"] .faq-item,
[data-theme="dark"] .feature-card,
[data-theme="dark"] .step,
[data-theme="dark"] .help-card,
[data-theme="dark"] .help-section,
[data-theme="dark"] .legal-card,
[data-theme="dark"] .policy-card,
[data-theme="dark"] .terms-card,
[data-theme="dark"] .edition-card {
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
}

/* Noise texture — slightly stronger in dark mode */
[data-theme="dark"] .tile::after {
  opacity: 0.6;
}

/* Subtle accent glow on card hover */
[data-theme="dark"] .tile:hover,
[data-theme="dark"] .module-tile.module-unlocked:hover,
[data-theme="dark"] .feature-card:hover,
[data-theme="dark"] .step:hover {
  border-color: rgba(0,210,255,0.15);
}

/* Module tiles glass */
[data-theme="dark"] .module-tile {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
[data-theme="dark"] .module-tile.module-unlocked {
  border-color: rgba(0,210,255,0.12);
  box-shadow: 0 0 20px rgba(0,210,255,0.04);
}

/* Waypoint score animation */
@keyframes scoreReveal {
  from { transform: rotate(-90deg); }
  to { transform: rotate(var(--score-angle, 0deg)); }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
[data-theme="dark"] .tile-health,
[data-theme="dark"] .tile-scorecard {
  animation: fadeSlideUp 0.5s ease-out;
}

/* ── SKELETON LOADING ───────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg,
    var(--theme-bar-track, rgba(0,0,0,0.07)) 25%,
    var(--theme-hover-bg, rgba(0,0,0,0.04)) 50%,
    var(--theme-bar-track, rgba(0,0,0,0.07)) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}
.skeleton-text       { height: 14px; margin-bottom: 8px; width: 80%; }
.skeleton-text.short { width: 40%; }
.skeleton-title      { height: 22px; margin-bottom: 12px; width: 60%; }
.skeleton-card {
  height: 120px;
  border-radius: 12px;
  margin-bottom: 16px;
}
.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.skeleton-chart {
  height: 200px;
  border-radius: 12px;
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}
