/* ==========================================================================
   PRYWATNY ŁOWCA OKAZJI — UI v2.0 (Bento Radar & Command Center)
   Multi-Palette Theme Engine (Linear / Vercel / Amber / Crimson / Nordic)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@500;600;700&display=swap');

/* --------------------------------------------------------------------------
   1. PALETTE: LINEAR OBSIDIAN & VIOLET (Domyślny nowoczesny styl — `linear`)
   Głęboki grafitowo-fioletowy obsydian bez granatowego zafarbu + Electric Indigo
   -------------------------------------------------------------------------- */
:root,
html[data-palette="linear"] {
  color-scheme: dark;
  --bg-canvas: #09090e;
  --bg-surface: #11121a;
  --bg-elevated: rgba(18, 19, 28, 0.84);
  --bg-elevated-hover: rgba(26, 28, 40, 0.95);
  --bg-glass: rgba(13, 14, 21, 0.80);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(129, 140, 248, 0.28);
  --text-main: #f4f4f8;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --accent-primary: #6366f1;
  --accent-primary-glow: rgba(99, 102, 241, 0.25);
  --shadow-card: 0 12px 32px -10px rgba(0, 0, 0, 0.65);
  --scrollbar-thumb: #2e3044;
  --scrollbar-track: #09090e;
  --ambient-1: rgba(99, 102, 241, 0.12);
  --ambient-2: rgba(168, 85, 247, 0.09);
  --ambient-3: rgba(56, 189, 248, 0.05);

  /* Tailwind Surface Override (replaces slate-* navy with Obsidian Graphite) */
  --tw-surface-50: 248 249 252;
  --tw-surface-100: 241 242 248;
  --tw-surface-200: 224 226 236;
  --tw-surface-300: 196 200 216;
  --tw-surface-400: 150 155 176;
  --tw-surface-500: 106 111 133;
  --tw-surface-600: 74 78 98;
  --tw-surface-700: 46 49 66;
  --tw-surface-800: 31 33 46;
  --tw-surface-900: 18 19 28;
  --tw-surface-950: 9 9 14;

  /* Tailwind Brand Override (replaces emerald-* green with Electric Indigo) */
  --tw-brand-50: 238 242 255;
  --tw-brand-100: 224 231 255;
  --tw-brand-200: 199 210 254;
  --tw-brand-300: 165 180 252;
  --tw-brand-400: 129 140 248;
  --tw-brand-500: 99 102 241;
  --tw-brand-600: 79 70 229;
  --tw-brand-700: 67 56 202;
  --tw-brand-800: 55 48 163;
  --tw-brand-900: 49 46 129;
  --tw-brand-950: 30 27 75;
}

/* --------------------------------------------------------------------------
   2. PALETTE: VERCEL CARBON & CYBER CYAN (`vercel`)
   Czysta neutralna czerń OLED (Pure Zinc) + Lodowy Cyjan / Błękit
   -------------------------------------------------------------------------- */
html[data-palette="vercel"] {
  color-scheme: dark;
  --bg-canvas: #09090b;
  --bg-surface: #121215;
  --bg-elevated: rgba(19, 19, 23, 0.86);
  --bg-elevated-hover: rgba(28, 28, 34, 0.96);
  --bg-glass: rgba(12, 12, 15, 0.82);
  --border-subtle: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(34, 211, 238, 0.30);
  --text-main: #fafafa;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --accent-primary: #06b6d4;
  --accent-primary-glow: rgba(6, 182, 212, 0.24);
  --shadow-card: 0 12px 32px -10px rgba(0, 0, 0, 0.75);
  --scrollbar-thumb: #27272a;
  --scrollbar-track: #09090b;
  --ambient-1: rgba(6, 182, 212, 0.10);
  --ambient-2: rgba(59, 130, 246, 0.08);
  --ambient-3: rgba(16, 185, 129, 0.04);

  /* Pure Zinc Surfaces */
  --tw-surface-50: 250 250 250;
  --tw-surface-100: 244 244 245;
  --tw-surface-200: 228 228 231;
  --tw-surface-300: 212 212 216;
  --tw-surface-400: 161 161 170;
  --tw-surface-500: 113 113 122;
  --tw-surface-600: 82 82 91;
  --tw-surface-700: 63 63 70;
  --tw-surface-800: 36 36 41;
  --tw-surface-900: 19 19 23;
  --tw-surface-950: 9 9 11;

  /* Cyber Cyan Brand */
  --tw-brand-50: 236 254 255;
  --tw-brand-100: 207 250 254;
  --tw-brand-200: 165 243 252;
  --tw-brand-300: 103 232 249;
  --tw-brand-400: 34 211 238;
  --tw-brand-500: 6 182 212;
  --tw-brand-600: 8 145 178;
  --tw-brand-700: 14 116 144;
  --tw-brand-800: 21 94 117;
  --tw-brand-900: 22 78 99;
  --tw-brand-950: 8 51 68;
}

/* --------------------------------------------------------------------------
   3. PALETTE: BLOOMBERG AMBER & WARM GRAPHITE (`amber`)
   Ciepły bazaltowy grafit + Złoto / Bursztyn (styl terminali finansowych)
   -------------------------------------------------------------------------- */
html[data-palette="amber"] {
  color-scheme: dark;
  --bg-canvas: #0c0b09;
  --bg-surface: #161412;
  --bg-elevated: rgba(23, 21, 18, 0.86);
  --bg-elevated-hover: rgba(34, 30, 26, 0.96);
  --bg-glass: rgba(16, 14, 12, 0.82);
  --border-subtle: rgba(255, 248, 235, 0.085);
  --border-strong: rgba(245, 158, 11, 0.32);
  --text-main: #fafaf9;
  --text-muted: #a8a29e;
  --text-dim: #78716c;
  --accent-primary: #f59e0b;
  --accent-primary-glow: rgba(245, 158, 11, 0.22);
  --shadow-card: 0 12px 32px -10px rgba(0, 0, 0, 0.72);
  --scrollbar-thumb: #38332e;
  --scrollbar-track: #0c0b09;
  --ambient-1: rgba(245, 158, 11, 0.11);
  --ambient-2: rgba(234, 88, 12, 0.08);
  --ambient-3: rgba(16, 185, 129, 0.04);

  /* Warm Stone Surfaces */
  --tw-surface-50: 250 250 249;
  --tw-surface-100: 245 245 244;
  --tw-surface-200: 231 229 228;
  --tw-surface-300: 214 211 209;
  --tw-surface-400: 168 162 158;
  --tw-surface-500: 120 113 108;
  --tw-surface-600: 87 83 78;
  --tw-surface-700: 61 57 52;
  --tw-surface-800: 38 35 31;
  --tw-surface-900: 22 20 18;
  --tw-surface-950: 12 11 9;

  /* Amber Gold Brand */
  --tw-brand-50: 255 251 235;
  --tw-brand-100: 254 243 199;
  --tw-brand-200: 253 230 138;
  --tw-brand-300: 252 211 77;
  --tw-brand-400: 251 191 36;
  --tw-brand-500: 245 158 11;
  --tw-brand-600: 217 119 6;
  --tw-brand-700: 180 83 9;
  --tw-brand-800: 146 64 14;
  --tw-brand-900: 120 53 15;
  --tw-brand-950: 69 26 3;
}

/* --------------------------------------------------------------------------
   4. PALETTE: TITANIUM & CRIMSON ROSE (`crimson`)
   Chłodny tytan + Koralowa Czerwień / Róż (styl Revolut Ultra / Gaming Pro)
   -------------------------------------------------------------------------- */
html[data-palette="crimson"] {
  color-scheme: dark;
  --bg-canvas: #0b0a0e;
  --bg-surface: #14121a;
  --bg-elevated: rgba(21, 19, 28, 0.86);
  --bg-elevated-hover: rgba(31, 27, 41, 0.96);
  --bg-glass: rgba(15, 13, 20, 0.82);
  --border-subtle: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(244, 63, 94, 0.32);
  --text-main: #f8fafc;
  --text-muted: #a1a1b5;
  --text-dim: #6e6e85;
  --accent-primary: #f43f5e;
  --accent-primary-glow: rgba(244, 63, 94, 0.24);
  --shadow-card: 0 12px 32px -10px rgba(0, 0, 0, 0.72);
  --scrollbar-thumb: #352f44;
  --scrollbar-track: #0b0a0e;
  --ambient-1: rgba(244, 63, 94, 0.11);
  --ambient-2: rgba(168, 85, 247, 0.08);
  --ambient-3: rgba(59, 130, 246, 0.05);

  /* Titanium Dark Surfaces */
  --tw-surface-50: 249 249 251;
  --tw-surface-100: 241 241 246;
  --tw-surface-200: 226 226 235;
  --tw-surface-300: 201 201 216;
  --tw-surface-400: 156 156 178;
  --tw-surface-500: 110 110 133;
  --tw-surface-600: 78 78 98;
  --tw-surface-700: 52 50 68;
  --tw-surface-800: 34 31 46;
  --tw-surface-900: 20 18 26;
  --tw-surface-950: 11 10 14;

  /* Crimson Rose Brand */
  --tw-brand-50: 255 241 242;
  --tw-brand-100: 255 228 230;
  --tw-brand-200: 254 205 211;
  --tw-brand-300: 253 164 175;
  --tw-brand-400: 251 113 133;
  --tw-brand-500: 244 63 94;
  --tw-brand-600: 225 29 72;
  --tw-brand-700: 190 18 60;
  --tw-brand-800: 159 18 57;
  --tw-brand-900: 136 19 55;
  --tw-brand-950: 76 5 25;
}

/* --------------------------------------------------------------------------
   5. PALETTE: NORDIC DAYLIGHT / ALABASTER (`nordic` lub `body.light-theme`)
   Ciepły alabaster i kość słoniowa + Królewski Kobalt (styl Stripe / Notion)
   -------------------------------------------------------------------------- */
html[data-palette="nordic"],
body.light-theme {
  color-scheme: light;
  --bg-canvas: #f3f2ee;
  --bg-surface: #ffffff;
  --bg-elevated: rgba(255, 255, 255, 0.94);
  --bg-elevated-hover: #ffffff;
  --bg-glass: rgba(248, 247, 244, 0.88);
  --border-subtle: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(37, 99, 235, 0.25);
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --accent-primary: #2563eb;
  --accent-primary-glow: rgba(37, 99, 235, 0.16);
  --shadow-card: 0 8px 24px -8px rgba(15, 23, 42, 0.08);
  --scrollbar-thumb: #cbd5e1;
  --scrollbar-track: #f3f2ee;
  --ambient-1: rgba(37, 99, 235, 0.07);
  --ambient-2: rgba(99, 102, 241, 0.06);
  --ambient-3: rgba(14, 165, 233, 0.05);

  /* Royal Cobalt Brand */
  --tw-brand-50: 239 246 255;
  --tw-brand-100: 219 234 254;
  --tw-brand-200: 191 219 254;
  --tw-brand-300: 147 197 253;
  --tw-brand-400: 59 130 246;
  --tw-brand-500: 37 99 235;
  --tw-brand-600: 29 78 216;
  --tw-brand-700: 30 64 175;
  --tw-brand-800: 30 58 138;
  --tw-brand-900: 23 37 84;
  --tw-brand-950: 15 23 42;
}

/* --------------------------------------------------------------------------
   6. PALETTE: EMERALD CARBON (`emerald` — Zneutralizowany ciemny zieleń)
   -------------------------------------------------------------------------- */
html[data-palette="emerald"] {
  color-scheme: dark;
  --bg-canvas: #090b0e;
  --bg-surface: #11151c;
  --bg-elevated: rgba(17, 22, 30, 0.85);
  --bg-elevated-hover: rgba(24, 32, 44, 0.95);
  --bg-glass: rgba(12, 16, 22, 0.82);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(16, 185, 129, 0.28);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-primary: #10b981;
  --accent-primary-glow: rgba(16, 185, 129, 0.22);
  --shadow-card: 0 12px 32px -10px rgba(0, 0, 0, 0.65);
  --scrollbar-thumb: #273244;
  --scrollbar-track: #090b0e;
  --ambient-1: rgba(16, 185, 129, 0.10);
  --ambient-2: rgba(99, 102, 241, 0.08);
  --ambient-3: rgba(14, 165, 233, 0.05);

  --tw-surface-50: 248 250 252;
  --tw-surface-100: 241 245 249;
  --tw-surface-200: 226 232 240;
  --tw-surface-300: 203 213 225;
  --tw-surface-400: 148 163 184;
  --tw-surface-500: 100 116 139;
  --tw-surface-600: 71 85 105;
  --tw-surface-700: 51 65 85;
  --tw-surface-800: 30 38 50;
  --tw-surface-900: 17 21 28;
  --tw-surface-950: 9 11 14;

  --tw-brand-50: 236 253 245;
  --tw-brand-100: 209 250 229;
  --tw-brand-200: 167 243 208;
  --tw-brand-300: 110 231 183;
  --tw-brand-400: 52 211 153;
  --tw-brand-500: 16 185 129;
  --tw-brand-600: 5 150 105;
  --tw-brand-700: 4 120 87;
  --tw-brand-800: 6 95 70;
  --tw-brand-900: 6 78 59;
  --tw-brand-950: 2 44 34;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Modern typography rules (Modern Web Guidance) */
h1, h2, h3, h4, .balance-text {
  text-wrap: balance;
}

p, .pretty-text {
  text-wrap: pretty;
}

.tabular-nums, .font-mono-num {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* Ambient Mesh Background */
.v2-ambient-bg {
  background-image:
    radial-gradient(at 12% 8%, var(--ambient-1) 0px, transparent 44%),
    radial-gradient(at 88% 12%, var(--ambient-2) 0px, transparent 46%),
    radial-gradient(at 50% 90%, var(--ambient-3) 0px, transparent 50%);
}

/* Glass & Bento Surfaces */
.glass-panel {
  background: var(--bg-elevated);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

.glass-header {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.glass-sidebar {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-subtle);
}

/* Palette Swatch Pill Bar */
.palette-swatch-btn {
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
}

@media (max-width: 639px) {
  .palette-swatch-btn {
    width: 18px;
    height: 18px;
  }
}

.palette-swatch-btn:hover {
  transform: scale(1.15);
}

.palette-swatch-btn.active-palette {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px var(--accent-primary), 0 0 12px var(--accent-primary-glow);
  transform: scale(1.12);
}

body.light-theme .palette-swatch-btn.active-palette {
  border-color: #0f172a;
}

/* Container query wrapper for Deal Cards */
.deal-card-wrapper {
  container-type: inline-size;
  content-visibility: auto;
  contain-intrinsic-size: 0 380px;
}

.deal-card {
  position: relative;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.22s ease;
}

.deal-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 16px 34px -10px rgba(0, 0, 0, 0.55), 0 0 20px 0 var(--accent-primary-glow);
}

.deal-card.deal-inactive {
  opacity: 0.62;
  filter: grayscale(35%);
  border-style: dashed;
}

/* Compact list mode for deals grid */
#deals-grid.v2-list-view {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.75rem !important;
}

#deals-grid.v2-list-view .deal-card {
  flex-direction: row !important;
  align-items: stretch !important;
}

#deals-grid.v2-list-view .deal-card-media {
  width: 190px !important;
  min-width: 190px !important;
  max-width: 190px !important;
}

#deals-grid.v2-list-view .deal-card-media img,
#deals-grid.v2-list-view .deal-card-media > div:first-child {
  height: 100% !important;
  min-height: 150px !important;
  border-radius: 15px 0 0 15px !important;
}

@media (max-width: 640px) {
  #deals-grid.v2-list-view .deal-card {
    flex-direction: column !important;
  }
  #deals-grid.v2-list-view .deal-card-media {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Platform Badges */
.badge-olx {
  background-color: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.badge-allegro, .badge-allegro_zwykle {
  background-color: rgba(249, 115, 22, 0.16);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.35);
}
.badge-vinted {
  background-color: rgba(6, 182, 212, 0.16);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.35);
}
.badge-sprzedajemy {
  background-color: rgba(139, 92, 246, 0.16);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.35);
}
.badge-otomoto {
  background-color: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.badge-otodom {
  background-color: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.badge-wakacje {
  background-color: rgba(234, 179, 8, 0.16);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.35);
}
.badge-fly4free {
  background-color: rgba(59, 130, 246, 0.16);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}
.badge-pepper {
  background-color: rgba(244, 63, 94, 0.16);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
}
.badge-aliexpress {
  background-color: rgba(249, 115, 22, 0.16);
  color: #fdba74;
  border: 1px solid rgba(249, 115, 22, 0.35);
}
.badge-xkom {
  background-color: rgba(14, 165, 233, 0.16);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.35);
}
.badge-morele {
  background-color: rgba(236, 72, 153, 0.16);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.35);
}
.badge-ceneo_okazje {
  background-color: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Status Badges */
.badge-delivery-lost {
  background-color: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
}
.badge-sold {
  background-color: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
}
.badge-delivery {
  background-color: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.38);
}
.badge-price-drop {
  background-color: rgba(16, 185, 129, 0.22);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.42);
}

/* Modal Overlay with overscroll containment */
.modal-overlay {
  background: rgba(5, 5, 10, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overscroll-behavior: contain;
}

/* Form validation only after interaction */
input:user-invalid, select:user-invalid, textarea:user-invalid {
  border-color: #f43f5e !important;
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.3);
}

/* Radar pulse */
@keyframes radar-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 var(--accent-primary-glow); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 0, 0, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

.radar-dot {
  animation: radar-pulse 2s infinite;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .deal-card:hover {
    transform: none;
  }
}

/* Light / Nordic theme surface & text overrides */
body.light-theme,
body.light-theme.bg-slate-950,
body.light-theme .bg-slate-950,
body.light-theme .bg-slate-950\/80,
body.light-theme .bg-slate-950\/60,
body.light-theme .bg-slate-950\/90 { background-color: #f3f2ee !important; }

body.light-theme.bg-slate-900,
body.light-theme .bg-slate-900,
body.light-theme .bg-slate-900\/90,
body.light-theme .bg-slate-900\/80,
body.light-theme .bg-slate-900\/60,
body.light-theme .bg-slate-900\/50,
body.light-theme .bg-slate-900\/30 { background-color: #ffffff !important; }

body.light-theme.bg-slate-800,
body.light-theme .bg-slate-800,
body.light-theme .bg-slate-800\/80,
body.light-theme .bg-slate-800\/50 { background-color: #e6e4dd !important; }

body.light-theme .border-slate-800,
body.light-theme .border-slate-800\/80,
body.light-theme .border-slate-800\/60,
body.light-theme .border-slate-800\/50,
body.light-theme .border-slate-700,
body.light-theme .border-slate-700\/60 { border-color: #d6d3c9 !important; }

body.light-theme,
body.light-theme.text-slate-100,
body.light-theme .text-slate-100,
body.light-theme .text-white { color: #0f172a !important; }

body.light-theme .bg-emerald-600,
body.light-theme .bg-emerald-600.text-white,
body.light-theme button.bg-emerald-600 { color: #ffffff !important; }

body.light-theme.text-slate-200,
body.light-theme .text-slate-200 { color: #1e293b !important; }

body.light-theme.text-slate-300,
body.light-theme .text-slate-300 { color: #334155 !important; }

body.light-theme.text-slate-400,
body.light-theme .text-slate-400 { color: #475569 !important; }

body.light-theme.text-slate-500,
body.light-theme .text-slate-500,
body.light-theme .text-slate-600 { color: #64748b !important; }

body.light-theme input,
body.light-theme select,
body.light-theme textarea {
  background-color: #faf9f6 !important;
  color: #0f172a !important;
  border-color: #d6d3c9 !important;
}

body.light-theme .bg-emerald-500\/10,
body.light-theme .bg-emerald-500\/15,
body.light-theme .bg-emerald-500\/20 { background-color: rgba(37, 99, 235, 0.12) !important; }
body.light-theme .text-emerald-400,
body.light-theme .text-emerald-300 { color: #1d4ed8 !important; }
body.light-theme .text-amber-400,
body.light-theme .text-amber-300 { color: #b45309 !important; }
body.light-theme .text-rose-400,
body.light-theme .text-rose-300 { color: #be123c !important; }
body.light-theme .text-indigo-400,
body.light-theme .text-indigo-300 { color: #4338ca !important; }
body.light-theme .bg-indigo-950\/30,
body.light-theme .bg-indigo-950\/40 { background-color: rgba(99, 102, 241, 0.08) !important; }
body.light-theme .text-indigo-200\/80 { color: #312e81 !important; }

/* ==========================================================================
   DIRECT PALETTE OVERRIDES (Guaranteed instant re-theming across all elements)
   ========================================================================== */
html[data-palette]:not([data-palette="nordic"]) body,
html[data-palette]:not([data-palette="nordic"]) .bg-slate-950 {
  background-color: rgb(var(--tw-surface-950)) !important;
}
html[data-palette]:not([data-palette="nordic"]) .bg-slate-950\/90 {
  background-color: rgb(var(--tw-surface-950) / 0.90) !important;
}
html[data-palette]:not([data-palette="nordic"]) .bg-slate-950\/80,
html[data-palette]:not([data-palette="nordic"]) .bg-slate-950\/70,
html[data-palette]:not([data-palette="nordic"]) .bg-slate-950\/60 {
  background-color: rgb(var(--tw-surface-950) / 0.78) !important;
}
html[data-palette]:not([data-palette="nordic"]) .bg-slate-900 {
  background-color: rgb(var(--tw-surface-900)) !important;
}
html[data-palette]:not([data-palette="nordic"]) .bg-slate-900\/95,
html[data-palette]:not([data-palette="nordic"]) .bg-slate-900\/90,
html[data-palette]:not([data-palette="nordic"]) .bg-slate-900\/80,
html[data-palette]:not([data-palette="nordic"]) .bg-slate-900\/75,
html[data-palette]:not([data-palette="nordic"]) .bg-slate-900\/70,
html[data-palette]:not([data-palette="nordic"]) .bg-slate-900\/60,
html[data-palette]:not([data-palette="nordic"]) .bg-slate-900\/50 {
  background-color: rgb(var(--tw-surface-900) / 0.84) !important;
}
html[data-palette]:not([data-palette="nordic"]) .bg-slate-800,
html[data-palette]:not([data-palette="nordic"]) .bg-slate-800\/80,
html[data-palette]:not([data-palette="nordic"]) .bg-slate-800\/60,
html[data-palette]:not([data-palette="nordic"]) .bg-slate-800\/50 {
  background-color: rgb(var(--tw-surface-800)) !important;
}
html[data-palette]:not([data-palette="nordic"]) .border-slate-800,
html[data-palette]:not([data-palette="nordic"]) .border-slate-800\/80,
html[data-palette]:not([data-palette="nordic"]) .border-slate-800\/60,
html[data-palette]:not([data-palette="nordic"]) .border-slate-700,
html[data-palette]:not([data-palette="nordic"]) .border-slate-700\/60 {
  border-color: rgb(var(--tw-surface-700) / 0.55) !important;
}

/* Primary Brand Accent Overrides (applies to all 6 palettes) */
html[data-palette] .bg-emerald-600 {
  background-color: rgb(var(--tw-brand-600)) !important;
}
html[data-palette] .bg-emerald-500,
html[data-palette] .hover\:bg-emerald-500:hover {
  background-color: rgb(var(--tw-brand-500)) !important;
}
html[data-palette] .bg-emerald-500\/20,
html[data-palette] .bg-emerald-500\/15,
html[data-palette] .bg-emerald-500\/10,
html[data-palette] .bg-emerald-950\/40,
html[data-palette] .bg-emerald-950\/30 {
  background-color: rgb(var(--tw-brand-500) / 0.16) !important;
}
html[data-palette] .text-emerald-400,
html[data-palette] .text-emerald-300 {
  color: rgb(var(--tw-brand-400)) !important;
}
html[data-palette] .border-emerald-500,
html[data-palette] .border-emerald-500\/40,
html[data-palette] .border-emerald-500\/30 {
  border-color: rgb(var(--tw-brand-500) / 0.42) !important;
}
html[data-palette] .border-l-emerald-500 {
  border-left-color: rgb(var(--tw-brand-500)) !important;
}
html[data-palette] .shadow-emerald-600\/20,
html[data-palette] .shadow-emerald-500\/10 {
  --tw-shadow-color: rgb(var(--tw-brand-500) / 0.25) !important;
}
