/**
 * ============================================================================
 * ONBOX — contrato de tema (dark / light)
 * ============================================================================
 * Dark (default): superfície #020617/#0f172a · texto claro · acentos pastéis
 * Light (data-onbox-theme="light"): superfície #fff/#f1f5f9 · texto escuro · acentos 700–800
 * Ilhas escuras (.onbox-keep-dark, .onbox-prod-spoiler, .onbox-iw, #onbox-hud):
 *   mantêm contraste escuro (foto, ficha de pin, HUD no mapa).
 * Carregar DEPOIS do Tailwind e de qualquer <style> de página (ex.: explorar.php).
 * ============================================================================
 */

:root {
  --onbox-surface: #020617;
  --onbox-surface-2: #0f172a;
  --onbox-surface-3: #1e293b;
  --onbox-ink: #f8fafc;
  --onbox-ink-2: #e2e8f0;
  --onbox-muted: #94a3b8;
  --onbox-border: rgba(148, 163, 184, 0.22);
  --onbox-accent: #22d3ee;
  --onbox-accent-ink: #67e8f9;
  --onbox-energy-rgb: 251 191 36;
  --onbox-energy-cyan-rgb: 34 211 238;
}

html[data-onbox-theme="light"] {
  color-scheme: light;
  --onbox-surface: #ffffff;
  --onbox-surface-2: #f1f5f9;
  --onbox-surface-3: #e2e8f0;
  --onbox-ink: #0f172a;
  --onbox-ink-2: #1e293b;
  --onbox-muted: #475569;
  --onbox-border: rgba(15, 23, 42, 0.12);
  --onbox-accent: #0e7490;
  --onbox-accent-ink: #155e75;
  --onbox-energy-rgb: 180 83 9;
  --onbox-energy-cyan-rgb: 14 116 144;
}

html[data-onbox-theme="light"] body,
html[data-onbox-theme="light"] body.onbox-user-area,
html[data-onbox-theme="light"] body.onbox-nav-safe,
html[data-onbox-theme="light"] body.onbox-explorar-page {
  background-color: #e8eef5 !important;
  color: #0f172a !important;
}

/* Fundos slate escuros → superfícies claras */
html[data-onbox-theme="light"] [class*="bg-slate-950"],
html[data-onbox-theme="light"] [class*="bg-slate-900"],
html[data-onbox-theme="light"] [class*="bg-slate-800"] {
  background-color: #ffffff !important;
}

html[data-onbox-theme="light"] aside[class*="bg-slate"],
html[data-onbox-theme="light"] header[class*="bg-slate"],
html[data-onbox-theme="light"] #onbox-public-nav,
html[data-onbox-theme="light"] #onbox-public-nav [class*="bg-slate"] {
  background-color: rgba(255, 255, 255, 0.96) !important;
}

html[data-onbox-theme="light"] .bg-gradient-to-br,
html[data-onbox-theme="light"] .bg-gradient-to-t,
html[data-onbox-theme="light"] .bg-gradient-to-b {
  background-image: linear-gradient(145deg, #ffffff 0%, #f1f5f9 55%, #e2e8f0 100%) !important;
}

/* ——— Texto base ——— */
html[data-onbox-theme="light"] .text-white,
html[data-onbox-theme="light"] .text-slate-50,
html[data-onbox-theme="light"] .text-slate-100,
html[data-onbox-theme="light"] .text-slate-200 {
  color: #0f172a !important;
}

html[data-onbox-theme="light"] .text-slate-300 {
  color: #1e293b !important;
}

html[data-onbox-theme="light"] .text-slate-400 {
  color: #334155 !important;
}

html[data-onbox-theme="light"] .text-slate-500,
html[data-onbox-theme="light"] .text-slate-600 {
  color: #475569 !important;
}

/*
 * Acentos pastel → escuros.
 * Usa [class*="…"] para apanhar variantes com opacidade (ex.: text-cyan-200/90).
 */
html[data-onbox-theme="light"] [class*="text-cyan-50"],
html[data-onbox-theme="light"] [class*="text-cyan-100"],
html[data-onbox-theme="light"] [class*="text-cyan-200"],
html[data-onbox-theme="light"] [class*="text-cyan-300"],
html[data-onbox-theme="light"] [class*="text-cyan-400"] {
  color: #155e75 !important; /* cyan-800 — valores/saldos legíveis */
}

html[data-onbox-theme="light"] [class*="text-sky-50"],
html[data-onbox-theme="light"] [class*="text-sky-100"],
html[data-onbox-theme="light"] [class*="text-sky-200"],
html[data-onbox-theme="light"] [class*="text-sky-300"],
html[data-onbox-theme="light"] [class*="text-sky-400"] {
  color: #075985 !important;
}

html[data-onbox-theme="light"] [class*="text-indigo-50"],
html[data-onbox-theme="light"] [class*="text-indigo-100"],
html[data-onbox-theme="light"] [class*="text-indigo-200"],
html[data-onbox-theme="light"] [class*="text-indigo-300"],
html[data-onbox-theme="light"] [class*="text-indigo-400"] {
  color: #312e81 !important;
}

html[data-onbox-theme="light"] [class*="text-violet-50"],
html[data-onbox-theme="light"] [class*="text-violet-100"],
html[data-onbox-theme="light"] [class*="text-violet-200"],
html[data-onbox-theme="light"] [class*="text-violet-300"],
html[data-onbox-theme="light"] [class*="text-violet-400"] {
  color: #5b21b6 !important;
}

html[data-onbox-theme="light"] [class*="text-fuchsia-50"],
html[data-onbox-theme="light"] [class*="text-fuchsia-100"],
html[data-onbox-theme="light"] [class*="text-fuchsia-200"],
html[data-onbox-theme="light"] [class*="text-fuchsia-300"],
html[data-onbox-theme="light"] [class*="text-fuchsia-400"] {
  color: #86198f !important;
}

html[data-onbox-theme="light"] [class*="text-pink-50"],
html[data-onbox-theme="light"] [class*="text-pink-100"],
html[data-onbox-theme="light"] [class*="text-pink-200"],
html[data-onbox-theme="light"] [class*="text-pink-300"],
html[data-onbox-theme="light"] [class*="text-pink-400"] {
  color: #9d174d !important;
}

html[data-onbox-theme="light"] [class*="text-emerald-50"],
html[data-onbox-theme="light"] [class*="text-emerald-100"],
html[data-onbox-theme="light"] [class*="text-emerald-200"],
html[data-onbox-theme="light"] [class*="text-emerald-300"],
html[data-onbox-theme="light"] [class*="text-emerald-400"] {
  color: #065f46 !important;
}

html[data-onbox-theme="light"] [class*="text-green-50"],
html[data-onbox-theme="light"] [class*="text-green-100"],
html[data-onbox-theme="light"] [class*="text-green-200"],
html[data-onbox-theme="light"] [class*="text-green-300"],
html[data-onbox-theme="light"] [class*="text-green-400"] {
  color: #166534 !important;
}

html[data-onbox-theme="light"] [class*="text-amber-50"],
html[data-onbox-theme="light"] [class*="text-amber-100"],
html[data-onbox-theme="light"] [class*="text-amber-200"],
html[data-onbox-theme="light"] [class*="text-amber-300"],
html[data-onbox-theme="light"] [class*="text-amber-400"] {
  color: #92400e !important;
}

html[data-onbox-theme="light"] [class*="text-yellow-50"],
html[data-onbox-theme="light"] [class*="text-yellow-100"],
html[data-onbox-theme="light"] [class*="text-yellow-200"],
html[data-onbox-theme="light"] [class*="text-yellow-300"],
html[data-onbox-theme="light"] [class*="text-yellow-400"] {
  color: #854d0e !important;
}

html[data-onbox-theme="light"] [class*="text-orange-50"],
html[data-onbox-theme="light"] [class*="text-orange-100"],
html[data-onbox-theme="light"] [class*="text-orange-200"],
html[data-onbox-theme="light"] [class*="text-orange-300"],
html[data-onbox-theme="light"] [class*="text-orange-400"] {
  color: #c2410c !important;
}

html[data-onbox-theme="light"] [class*="text-rose-50"],
html[data-onbox-theme="light"] [class*="text-rose-100"],
html[data-onbox-theme="light"] [class*="text-rose-200"],
html[data-onbox-theme="light"] [class*="text-rose-300"],
html[data-onbox-theme="light"] [class*="text-rose-400"] {
  color: #9f1239 !important;
}

html[data-onbox-theme="light"] [class*="text-red-50"],
html[data-onbox-theme="light"] [class*="text-red-100"],
html[data-onbox-theme="light"] [class*="text-red-200"],
html[data-onbox-theme="light"] [class*="text-red-300"],
html[data-onbox-theme="light"] [class*="text-red-400"] {
  color: #b91c1c !important;
}

html[data-onbox-theme="light"] [class*="text-blue-50"],
html[data-onbox-theme="light"] [class*="text-blue-100"],
html[data-onbox-theme="light"] [class*="text-blue-200"],
html[data-onbox-theme="light"] [class*="text-blue-300"],
html[data-onbox-theme="light"] [class*="text-blue-400"] {
  color: #1e40af !important;
}

html[data-onbox-theme="light"] [class*="text-teal-50"],
html[data-onbox-theme="light"] [class*="text-teal-100"],
html[data-onbox-theme="light"] [class*="text-teal-200"],
html[data-onbox-theme="light"] [class*="text-teal-300"],
html[data-onbox-theme="light"] [class*="text-teal-400"] {
  color: #115e59 !important;
}

/* Slate claros com /opacidade (grid, labels) */
html[data-onbox-theme="light"] [class*="text-slate-50"],
html[data-onbox-theme="light"] [class*="text-slate-100"],
html[data-onbox-theme="light"] [class*="text-slate-200"] {
  color: #0f172a !important;
}

html[data-onbox-theme="light"] [class*="text-slate-300"] {
  color: #1e293b !important;
}

html[data-onbox-theme="light"] [class*="text-slate-400"] {
  color: #334155 !important;
}

html[data-onbox-theme="light"] [class*="text-slate-500"],
html[data-onbox-theme="light"] [class*="text-slate-600"] {
  color: #475569 !important;
}

/* Valores mono da carteira / saldos — reforço extra */
html[data-onbox-theme="light"] #carteira .font-mono,
html[data-onbox-theme="light"] #carteira [class*="font-mono"] {
  font-weight: 600;
  opacity: 1 !important;
}

html[data-onbox-theme="light"] #carteira [class*="text-cyan-"] {
  color: #155e75 !important;
}

html[data-onbox-theme="light"] #carteira [class*="text-amber-"] {
  color: #92400e !important;
}

html[data-onbox-theme="light"] #carteira [class*="text-emerald-"],
html[data-onbox-theme="light"] #carteira [class*="text-cyan-200"] {
  opacity: 1 !important;
}

/* Pulso económico (ticker) — texto legível em fundo claro */
html[data-onbox-theme="light"] #onbox-ticker-bar,
html[data-onbox-theme="light"] .onbox-ticker-link {
  color: #1e293b !important;
  background-color: #ffffff !important;
  border-color: rgba(21, 94, 117, 0.35) !important;
}

html[data-onbox-theme="light"] #onbox-ticker-bar strong,
html[data-onbox-theme="light"] #onbox-ticker-bar .tabular-nums,
html[data-onbox-theme="light"] #onbox-ticker-bar [class*="text-cyan-"] {
  color: #155e75 !important;
  font-weight: 700 !important;
}

html[data-onbox-theme="light"] #onbox-ticker-bar [class*="text-slate-"] {
  color: #334155 !important;
}

html[data-onbox-theme="light"] .onbox-pulso-item [class*="text-cyan-"] {
  color: #0e7490 !important;
}

/* Hover de links/acentos claros */
html[data-onbox-theme="light"] .hover\:text-cyan-200:hover,
html[data-onbox-theme="light"] .hover\:text-cyan-100:hover,
html[data-onbox-theme="light"] .hover\:text-indigo-300:hover,
html[data-onbox-theme="light"] .hover\:text-indigo-200:hover {
  color: #155e75 !important;
}

/* ——— Borders: baixa opacidade → traço mais marcado ——— */
html[data-onbox-theme="light"] [class*="border-white"] {
  border-color: rgba(15, 23, 42, 0.16) !important;
}

html[data-onbox-theme="light"] [class*="border-cyan-"] {
  border-color: rgba(14, 116, 144, 0.55) !important;
}

html[data-onbox-theme="light"] [class*="border-indigo-"] {
  border-color: rgba(55, 48, 163, 0.5) !important;
}

html[data-onbox-theme="light"] [class*="border-emerald-"] {
  border-color: rgba(4, 120, 87, 0.5) !important;
}

html[data-onbox-theme="light"] [class*="border-amber-"] {
  border-color: rgba(146, 64, 14, 0.5) !important;
}

html[data-onbox-theme="light"] [class*="border-fuchsia-"] {
  border-color: rgba(134, 25, 143, 0.5) !important;
}

html[data-onbox-theme="light"] [class*="border-rose-"],
html[data-onbox-theme="light"] [class*="border-red-"] {
  border-color: rgba(159, 18, 57, 0.5) !important;
}

html[data-onbox-theme="light"] [class*="border-violet-"] {
  border-color: rgba(91, 33, 182, 0.5) !important;
}

html[data-onbox-theme="light"] [class*="border-slate-"] {
  border-color: rgba(51, 65, 85, 0.28) !important;
}

/* ——— Painéis tintados: fundo com cor visível (não “branco lavado”) ——— */
html[data-onbox-theme="light"] [class*="bg-cyan-950"],
html[data-onbox-theme="light"] [class*="bg-cyan-900"],
html[data-onbox-theme="light"] [class*="bg-cyan-800"] {
  background-color: #cffafe !important; /* cyan-100 */
}

html[data-onbox-theme="light"] [class*="bg-indigo-950"],
html[data-onbox-theme="light"] [class*="bg-indigo-900"],
html[data-onbox-theme="light"] [class*="bg-indigo-800"],
html[data-onbox-theme="light"] [class*="bg-indigo-500"] {
  background-color: #e0e7ff !important; /* indigo-100 */
}

html[data-onbox-theme="light"] [class*="bg-emerald-950"],
html[data-onbox-theme="light"] [class*="bg-emerald-900"],
html[data-onbox-theme="light"] [class*="bg-emerald-800"] {
  background-color: #d1fae5 !important;
}

html[data-onbox-theme="light"] [class*="bg-amber-950"],
html[data-onbox-theme="light"] [class*="bg-amber-900"],
html[data-onbox-theme="light"] [class*="bg-amber-800"] {
  background-color: #fef3c7 !important;
}

html[data-onbox-theme="light"] [class*="bg-fuchsia-950"],
html[data-onbox-theme="light"] [class*="bg-fuchsia-900"],
html[data-onbox-theme="light"] [class*="bg-fuchsia-800"] {
  background-color: #fae8ff !important;
}

html[data-onbox-theme="light"] [class*="bg-rose-950"],
html[data-onbox-theme="light"] [class*="bg-rose-900"],
html[data-onbox-theme="light"] [class*="bg-red-950"],
html[data-onbox-theme="light"] [class*="bg-red-900"] {
  background-color: #ffe4e6 !important;
}

html[data-onbox-theme="light"] [class*="bg-violet-950"],
html[data-onbox-theme="light"] [class*="bg-violet-900"] {
  background-color: #ede9fe !important;
}

html[data-onbox-theme="light"] [class*="bg-sky-950"],
html[data-onbox-theme="light"] [class*="bg-sky-900"] {
  background-color: #e0f2fe !important;
}

/* Rings / focus */
html[data-onbox-theme="light"] [class*="ring-cyan-"],
html[data-onbox-theme="light"] [class*="ring-fuchsia-"],
html[data-onbox-theme="light"] [class*="ring-indigo-"],
html[data-onbox-theme="light"] [class*="ring-amber-"] {
  --tw-ring-color: rgba(15, 23, 42, 0.2) !important;
}

/* Inputs */
html[data-onbox-theme="light"] input:not([type="checkbox"]):not([type="radio"]),
html[data-onbox-theme="light"] select,
html[data-onbox-theme="light"] textarea {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
}

html[data-onbox-theme="light"] input::placeholder,
html[data-onbox-theme="light"] textarea::placeholder {
  color: #64748b !important;
}

/* Nav lateral área privada */
html[data-onbox-theme="light"] .onbox-nav-item {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
}

html[data-onbox-theme="light"] .onbox-nav-item i {
  opacity: 1 !important;
}

html[data-onbox-theme="light"] .onbox-nav-item:hover {
  background: #e2e8f0 !important;
}

html[data-onbox-theme="light"] .onbox-nav-group__hint {
  color: #475569 !important;
}

html[data-onbox-theme="light"] .onbox-nav-group__t--admin { color: #a21caf !important; }
html[data-onbox-theme="light"] .onbox-nav-group__t--live { color: #0e7490 !important; }
html[data-onbox-theme="light"] .onbox-nav-group__t--boxes { color: #92400e !important; }
html[data-onbox-theme="light"] .onbox-nav-group__t--self { color: #3730a3 !important; }
html[data-onbox-theme="light"] .onbox-nav-group__t--flow { color: #047857 !important; }
html[data-onbox-theme="light"] .onbox-nav-group__t--house { color: #334155 !important; }

html[data-onbox-theme="light"] .onbox-nav-item--admin { color: #701a75 !important; }
html[data-onbox-theme="light"] .onbox-nav-item--admin i { color: #a21caf !important; }
html[data-onbox-theme="light"] .onbox-nav-item--live { color: #155e75 !important; }
html[data-onbox-theme="light"] .onbox-nav-item--live i { color: #0e7490 !important; }
html[data-onbox-theme="light"] .onbox-nav-item--boxes { color: #78350f !important; }
html[data-onbox-theme="light"] .onbox-nav-item--boxes i { color: #b45309 !important; }
html[data-onbox-theme="light"] .onbox-nav-item--self { color: #312e81 !important; }
html[data-onbox-theme="light"] .onbox-nav-item--self i { color: #4338ca !important; }
html[data-onbox-theme="light"] .onbox-nav-item--flow { color: #065f46 !important; }
html[data-onbox-theme="light"] .onbox-nav-item--flow i { color: #047857 !important; }
html[data-onbox-theme="light"] .onbox-nav-item--house { color: #1e293b !important; }
html[data-onbox-theme="light"] .onbox-nav-item--house i { color: #475569 !important; }

html[data-onbox-theme="light"] .onbox-nav-item--admin.onbox-nav-active {
  border-color: rgba(162, 28, 175, 0.55) !important;
  background: #fae8ff !important;
  color: #701a75 !important;
}
html[data-onbox-theme="light"] .onbox-nav-item--live.onbox-nav-active {
  border-color: rgba(14, 116, 144, 0.55) !important;
  background: #cffafe !important;
  color: #155e75 !important;
}
html[data-onbox-theme="light"] .onbox-nav-item--boxes.onbox-nav-active {
  border-color: rgba(180, 83, 9, 0.55) !important;
  background: #fef3c7 !important;
  color: #78350f !important;
}
html[data-onbox-theme="light"] .onbox-nav-item--self.onbox-nav-active {
  border-color: rgba(67, 56, 202, 0.55) !important;
  background: #e0e7ff !important;
  color: #312e81 !important;
}
html[data-onbox-theme="light"] .onbox-nav-item--flow.onbox-nav-active {
  border-color: rgba(4, 120, 87, 0.55) !important;
  background: #d1fae5 !important;
  color: #065f46 !important;
}
html[data-onbox-theme="light"] .onbox-nav-item--house.onbox-nav-active {
  border-color: rgba(71, 85, 105, 0.45) !important;
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* Navbar pública / glass */
html[data-onbox-theme="light"] .onbox-glass,
html[data-onbox-theme="light"] #onbox-public-nav .onbox-glass {
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.92), rgba(241, 245, 249, 0.95) 48%, rgba(226, 232, 240, 0.96)),
    radial-gradient(circle at 12% 20%, rgba(14, 116, 144, 0.08), transparent 38%) !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

html[data-onbox-theme="light"] .onbox-nav-separator {
  background: linear-gradient(90deg, transparent, rgba(14, 116, 144, 0.55) 20%, rgba(55, 48, 163, 0.45) 50%, rgba(14, 116, 144, 0.4) 80%, transparent) !important;
  box-shadow: none !important;
}

html[data-onbox-theme="light"] .onbox-ai-entity {
  background-image: linear-gradient(105deg, #b45309 0%, #0e7490 45%, #92400e 100%) !important;
  filter: none !important;
}

/* Sombras */
html[data-onbox-theme="light"] .shadow-lg,
html[data-onbox-theme="light"] .shadow-xl {
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1) !important;
}

/*
 * Ilhas escuras intencionais (landing, cards com foto, painéis com gradiente).
 * O tema claro força texto escuro globalmente — aqui restauramos contraste claro.
 */
html[data-onbox-theme="light"] .onbox-keep-dark,
html[data-onbox-theme="light"] .onbox-prod-spoiler {
  color: #e2e8f0 !important;
}

html[data-onbox-theme="light"] .onbox-keep-dark .text-white,
html[data-onbox-theme="light"] .onbox-keep-dark [class*="text-white"],
html[data-onbox-theme="light"] .onbox-prod-spoiler .text-white,
html[data-onbox-theme="light"] .onbox-prod-spoiler [class*="text-white"],
html[data-onbox-theme="light"] .onbox-keep-dark [class*="text-slate-50"],
html[data-onbox-theme="light"] .onbox-keep-dark [class*="text-slate-100"],
html[data-onbox-theme="light"] .onbox-keep-dark [class*="text-slate-200"],
html[data-onbox-theme="light"] .onbox-prod-spoiler [class*="text-slate-50"],
html[data-onbox-theme="light"] .onbox-prod-spoiler [class*="text-slate-100"],
html[data-onbox-theme="light"] .onbox-prod-spoiler [class*="text-slate-200"] {
  color: #f8fafc !important;
}

html[data-onbox-theme="light"] .onbox-keep-dark [class*="text-slate-300"],
html[data-onbox-theme="light"] .onbox-prod-spoiler [class*="text-slate-300"] {
  color: #cbd5e1 !important;
}

html[data-onbox-theme="light"] .onbox-keep-dark [class*="text-slate-400"],
html[data-onbox-theme="light"] .onbox-prod-spoiler [class*="text-slate-400"] {
  color: #94a3b8 !important;
}

html[data-onbox-theme="light"] .onbox-keep-dark [class*="text-slate-500"],
html[data-onbox-theme="light"] .onbox-prod-spoiler [class*="text-slate-500"] {
  color: #64748b !important;
}

html[data-onbox-theme="light"] .onbox-keep-dark [class*="text-cyan-"],
html[data-onbox-theme="light"] .onbox-prod-spoiler [class*="text-cyan-"] {
  color: #67e8f9 !important;
}

html[data-onbox-theme="light"] .onbox-keep-dark [class*="text-emerald-"],
html[data-onbox-theme="light"] .onbox-prod-spoiler [class*="text-emerald-"] {
  color: #6ee7b7 !important;
}

html[data-onbox-theme="light"] .onbox-keep-dark [class*="text-amber-"],
html[data-onbox-theme="light"] .onbox-prod-spoiler [class*="text-amber-"] {
  color: #fcd34d !important;
}

html[data-onbox-theme="light"] .onbox-keep-dark [class*="text-fuchsia-"],
html[data-onbox-theme="light"] .onbox-prod-spoiler [class*="text-fuchsia-"] {
  color: #e879f9 !important;
}

html[data-onbox-theme="light"] .onbox-keep-dark [class*="text-indigo-"],
html[data-onbox-theme="light"] .onbox-prod-spoiler [class*="text-indigo-"] {
  color: #a5b4fc !important;
}

html[data-onbox-theme="light"] .onbox-keep-dark [class*="text-rose-"],
html[data-onbox-theme="light"] .onbox-keep-dark [class*="text-red-"],
html[data-onbox-theme="light"] .onbox-prod-spoiler [class*="text-rose-"],
html[data-onbox-theme="light"] .onbox-prod-spoiler [class*="text-red-"] {
  color: #fda4af !important;
}

html[data-onbox-theme="light"] .onbox-keep-dark .onbox-section-title,
html[data-onbox-theme="light"] .onbox-prod-spoiler .onbox-section-title {
  color: #f8fafc !important;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

/* Cards de produto: véu um pouco mais forte no claro para o título saltar */
html[data-onbox-theme="light"] .onbox-prod-spoiler-veil {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.25) 0%, rgba(2, 6, 23, 0.62) 45%, rgba(2, 6, 23, 0.94) 100%) !important;
}

html[data-onbox-theme="light"] .onbox-prod-spoiler [class*="text-cyan-"] {
  color: #a5f3fc !important;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

/* Cookie bar */
html[data-onbox-theme="light"] #onbox-cookie-ack {
  background-color: rgba(255, 255, 255, 0.98) !important;
  color: #0f172a !important;
  border-color: rgba(14, 116, 144, 0.35) !important;
}

/* Toggle no perfil */
.onbox-theme-pick {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.onbox-theme-pick label {
  flex: 1 1 9rem;
  cursor: pointer;
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 0.85rem 1rem;
  background: rgba(15, 23, 42, 0.35);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.onbox-theme-pick label:has(input:checked) {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.25);
  background: rgba(8, 47, 73, 0.45);
}
html[data-onbox-theme="light"] .onbox-theme-pick label {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.16);
}
html[data-onbox-theme="light"] .onbox-theme-pick label:has(input:checked) {
  background: #cffafe;
  border-color: rgba(14, 116, 144, 0.55);
  box-shadow: 0 0 0 1px rgba(14, 116, 144, 0.25);
}
.onbox-theme-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ============================================================================
 * Explorar — painéis, canais, ranking, ações, legenda (modo claro)
 * ============================================================================ */
html[data-onbox-theme="light"] .onbox-rail {
  border-color: rgba(15, 23, 42, 0.1) !important;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(14, 116, 144, 0.06), transparent 50%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  box-shadow: 0 12px 28px -18px rgba(15, 23, 42, 0.18) !important;
}

html[data-onbox-theme="light"] .onbox-rail__head {
  border-bottom-color: rgba(15, 23, 42, 0.08) !important;
  background: linear-gradient(90deg, rgba(207, 250, 254, 0.65), transparent 70%) !important;
}

html[data-onbox-theme="light"] .onbox-explore-context {
  border-color: rgba(14, 116, 144, 0.22) !important;
  background: linear-gradient(180deg, #ffffff, #f1f5f9) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

html[data-onbox-theme="light"] .onbox-intent-panel {
  border-color: rgba(14, 116, 144, 0.25) !important;
  background: linear-gradient(145deg, #ecfeff, #f8fafc) !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06) !important;
}

html[data-onbox-theme="light"] .onbox-seg {
  border-color: rgba(15, 23, 42, 0.1) !important;
  background: #e2e8f0 !important;
}

html[data-onbox-theme="light"] .onbox-intent-btn {
  border-color: rgba(15, 23, 42, 0.1) !important;
  background: #ffffff !important;
  color: #1e293b !important;
}

html[data-onbox-theme="light"] .onbox-intent-btn--active {
  border-color: rgba(14, 116, 144, 0.55) !important;
  background: linear-gradient(120deg, #cffafe, #e0f2fe) !important;
  color: #155e75 !important;
  box-shadow: 0 0 0 1px rgba(14, 116, 144, 0.2) !important;
}

html[data-onbox-theme="light"] .onbox-nat-chip {
  border-color: rgba(15, 23, 42, 0.1) !important;
  background: #ffffff !important;
  color: #0f172a !important;
}

html[data-onbox-theme="light"] .onbox-nat-chip:hover {
  border-color: rgba(14, 116, 144, 0.35) !important;
  background: #f8fafc !important;
}

html[data-onbox-theme="light"] .onbox-nat-chip__ico {
  border-color: rgba(15, 23, 42, 0.12) !important;
  background: #f1f5f9 !important;
}

html[data-onbox-theme="light"] .onbox-nat-chip__t {
  color: #0f172a !important;
}

html[data-onbox-theme="light"] .onbox-nat-chip__s {
  color: #64748b !important;
}

html[data-onbox-theme="light"] .onbox-filter-active {
  background: color-mix(in srgb, var(--chip-accent, #0e7490) 16%, #ffffff) !important;
  color: #0f172a !important;
  border-color: color-mix(in srgb, var(--chip-accent, #0e7490) 45%, transparent) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--chip-accent, #0e7490) 20%, transparent) !important;
}

html[data-onbox-theme="light"] .onbox-action-tile {
  border-color: rgba(15, 23, 42, 0.1) !important;
  background: #ffffff !important;
  color: #0f172a !important;
}

html[data-onbox-theme="light"] .onbox-action-tile:hover {
  border-color: rgba(14, 116, 144, 0.4) !important;
  background: #ecfeff !important;
}

html[data-onbox-theme="light"] .onbox-action-tile__ico {
  border-color: rgba(15, 23, 42, 0.12) !important;
}

html[data-onbox-theme="light"] .onbox-action-tile__t {
  color: #0f172a !important;
}

html[data-onbox-theme="light"] .onbox-action-tile__s {
  color: #64748b !important;
}

html[data-onbox-theme="light"] .onbox-detail-stage {
  border-color: rgba(14, 116, 144, 0.25) !important;
  background:
    radial-gradient(90% 80% at 100% 0%, rgba(14, 116, 144, 0.08), transparent 55%),
    #ffffff !important;
}

html[data-onbox-theme="light"] .onbox-detail-stage--empty {
  color: #64748b !important;
}

html[data-onbox-theme="light"] .onbox-map-stage {
  border-color: rgba(15, 23, 42, 0.1) !important;
  background:
    radial-gradient(80% 50% at 50% 0%, rgba(14, 116, 144, 0.06), transparent 55%),
    #ffffff !important;
}

html[data-onbox-theme="light"] .onbox-rank-panel {
  border-color: rgba(180, 83, 9, 0.35) !important;
  background:
    radial-gradient(90% 80% at 100% 0%, rgba(251, 191, 36, 0.14), transparent 55%),
    #fffbeb !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06) !important;
}

html[data-onbox-theme="light"] .onbox-rank-summary {
  color: #92400e !important;
}

html[data-onbox-theme="light"] .onbox-rank-summary::after {
  color: #b45309 !important;
}

html[data-onbox-theme="light"] .onbox-rank-sub {
  color: #78716c !important;
}

html[data-onbox-theme="light"] .onbox-rank-row {
  border-color: rgba(15, 23, 42, 0.08) !important;
  background: #ffffff !important;
}

html[data-onbox-theme="light"] .onbox-rank-row--1 {
  background: linear-gradient(105deg, rgba(251, 191, 36, 0.18), #ffffff) !important;
}

html[data-onbox-theme="light"] .onbox-rank-row--2 {
  background: linear-gradient(105deg, rgba(148, 163, 184, 0.16), #ffffff) !important;
}

html[data-onbox-theme="light"] .onbox-rank-row--3 {
  background: linear-gradient(105deg, rgba(251, 146, 60, 0.14), #ffffff) !important;
}

html[data-onbox-theme="light"] .onbox-rank-pos {
  background: #f1f5f9 !important;
  color: #334155 !important;
}

html[data-onbox-theme="light"] .onbox-rank-row--1 .onbox-rank-pos {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #b45309 !important;
}

html[data-onbox-theme="light"] .onbox-rank-row--2 .onbox-rank-pos {
  background: rgba(100, 116, 139, 0.15) !important;
  color: #334155 !important;
}

html[data-onbox-theme="light"] .onbox-rank-row--3 .onbox-rank-pos {
  background: rgba(234, 88, 12, 0.15) !important;
  color: #c2410c !important;
}

html[data-onbox-theme="light"] .onbox-rank-name {
  color: #0f172a !important;
}

html[data-onbox-theme="light"] .onbox-rank-meta {
  color: #0e7490 !important;
}

html[data-onbox-theme="light"] .onbox-pin-legend {
  border-color: rgba(15, 23, 42, 0.12) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12) !important;
  color: #0f172a !important;
}

html[data-onbox-theme="light"] .onbox-pin-legend.is-filtering {
  border-color: rgba(14, 116, 144, 0.4) !important;
}

html[data-onbox-theme="light"] .onbox-pin-legend__hint {
  color: #64748b !important;
}

html[data-onbox-theme="light"] .onbox-pin-legend__clear {
  border-color: rgba(15, 23, 42, 0.14) !important;
  background: #f1f5f9 !important;
  color: #334155 !important;
}

html[data-onbox-theme="light"] .onbox-pin-legend__clear:hover,
html[data-onbox-theme="light"] .onbox-pin-legend__clear:focus-visible {
  color: #155e75 !important;
  border-color: rgba(14, 116, 144, 0.45) !important;
  background: #ecfeff !important;
}

html[data-onbox-theme="light"] .onbox-pin-legend__dismiss {
  border-color: rgba(15, 23, 42, 0.14) !important;
  background: #f8fafc !important;
  color: #334155 !important;
}

/* Labels do filtro: no claro o #e2e8f0 fica invisível no branco */
html[data-onbox-theme="light"] .onbox-pin-legend__t {
  color: #475569 !important;
}

html[data-onbox-theme="light"] .onbox-pin-legend__row {
  color: #0f172a !important;
}

html[data-onbox-theme="light"] .onbox-pin-legend__row:hover,
html[data-onbox-theme="light"] .onbox-pin-legend__row:focus-visible {
  background: rgba(14, 116, 144, 0.08) !important;
}

html[data-onbox-theme="light"] .onbox-pin-legend__row.is-active {
  border-color: rgba(14, 116, 144, 0.45) !important;
  background: #cffafe !important;
  color: #155e75 !important;
}

html[data-onbox-theme="light"] .onbox-pin-legend.is-filtering .onbox-pin-legend__row:not(.is-active) {
  opacity: 1 !important;
  color: #64748b !important;
}

html[data-onbox-theme="light"] .onbox-pin-legend.is-filtering .onbox-pin-legend__row:not(.is-active):hover {
  color: #0f172a !important;
  background: #f1f5f9 !important;
}

html[data-onbox-theme="light"] .onbox-pin-legend__sw {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 0 0 3px rgba(15, 23, 42, 0.18) !important;
}

html[data-onbox-theme="light"] .onbox-pin-legend__edge {
  background: #0f172a !important;
  color: #67e8f9 !important;
  border-color: rgba(15, 23, 42, 0.2) !important;
}

html[data-onbox-theme="light"] .onbox-pin-legend__edge-label {
  color: #a5f3fc !important;
}

html[data-onbox-theme="light"] .onbox-nav-glass {
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.94), rgba(241, 245, 249, 0.96) 48%, rgba(226, 232, 240, 0.98)),
    radial-gradient(circle at 12% 20%, rgba(14, 116, 144, 0.07), transparent 38%) !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

/* Perfil no rail do mapa */
html[data-onbox-theme="light"] .onbox-profile-glow {
  background: linear-gradient(145deg, #ecfeff, #ffffff 55%, #f8fafc) !important;
  border-bottom-color: rgba(14, 116, 144, 0.15) !important;
}

/* Ilhas que permanecem escuras no mapa (contraste sobre tiles claros) */
html[data-onbox-theme="light"] .onbox-iw,
html[data-onbox-theme="light"] #onbox-hud {
  color: #e2e8f0 !important;
}

html[data-onbox-theme="light"] .onbox-iw [class*="text-white"],
html[data-onbox-theme="light"] .onbox-iw [class*="text-slate-1"],
html[data-onbox-theme="light"] .onbox-iw [class*="text-slate-2"],
html[data-onbox-theme="light"] #onbox-hud [class*="text-white"],
html[data-onbox-theme="light"] #onbox-hud [class*="text-slate-1"],
html[data-onbox-theme="light"] #onbox-hud [class*="text-slate-2"] {
  color: #f8fafc !important;
}

html[data-onbox-theme="light"] .onbox-iw [class*="text-cyan-"],
html[data-onbox-theme="light"] #onbox-hud [class*="text-cyan-"] {
  color: #67e8f9 !important;
}

html[data-onbox-theme="light"] .onbox-iw [class*="text-amber-"],
html[data-onbox-theme="light"] #onbox-hud [class*="text-amber-"] {
  color: #fcd34d !important;
}

html[data-onbox-theme="light"] .onbox-iw [class*="text-emerald-"],
html[data-onbox-theme="light"] #onbox-hud [class*="text-emerald-"] {
  color: #6ee7b7 !important;
}
