:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #1e293b;
    --text-tertiary: #334155;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    --text-faint: #cbd5e1;
    --border-primary: #e2e8f0;
    --border-secondary: #cbd5e1;
}
[data-theme="dark"] {
    --bg-primary: #020617;
    --bg-secondary: #0f172a;
    --bg-tertiary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #e2e8f0;
    --text-tertiary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --text-faint: #475569;
    --border-primary: #1e293b;
    --border-secondary: #334155;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.3s ease-out; }
@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 400px; }
}
.animate-slide-down { animation: slideDown 0.4s ease-out; }

/* ── Console: Section card glow on hover ── */
.console-section {
    transition: border-color 0.3s ease;
}
.console-section:hover {
    border-color: var(--border-secondary);
}

/* ── Console: Environment toggle active state ── */
.env-toggle {
    transition: all 0.2s ease;
}
.env-toggle:not(.bg-violet-600):hover {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* ── Console: Card button light-theme overrides ── */
/* In light mode, replace dark zinc/cyan tones with accessible slate/sky tones
   that meet WCAG AA 4.5:1 contrast against light backgrounds. */

/* Light-theme inactive card state */
[data-theme="light"] .bg-zinc-900\/30.compliance-chip,
[data-theme="light"] .bg-zinc-900\/30.guardrail-filter {
    background-color: rgba(241, 245, 249, 0.9);
}
[data-theme="light"] .border-zinc-800.compliance-chip,
[data-theme="light"] .border-zinc-800.guardrail-filter {
    border-color: #cbd5e1;
}
[data-theme="light"] .text-zinc-400.compliance-chip,
[data-theme="light"] .text-zinc-400.guardrail-filter {
    color: #475569;
}
[data-theme="light"] .compliance-chip:hover,
[data-theme="light"] .guardrail-filter:hover {
    border-color: #94a3b8;
    color: #1e293b;
}

/* Light-theme active card state */
[data-theme="light"] .bg-cyan-950\/40.compliance-chip,
[data-theme="light"] .bg-cyan-950\/40.guardrail-filter {
    background-color: rgba(240, 249, 255, 0.95);
}
[data-theme="light"] .border-cyan-500\/50.compliance-chip,
[data-theme="light"] .border-cyan-500\/50.guardrail-filter {
    border-color: rgba(14, 165, 233, 0.5);
}
[data-theme="light"] .text-cyan-400.compliance-chip,
[data-theme="light"] .text-cyan-400.guardrail-filter {
    color: #0369a1;
}

/* Light-theme description subtext */
[data-theme="light"] .card-desc.text-cyan-300\/80 {
    color: rgba(3, 105, 161, 0.85);
}

/* ── Global light-theme color overrides ── */
/* In light mode, all 400/500-level Tailwind text colors are too bright
   against light backgrounds. Bump them to 600-800 equivalents for WCAG AA 4.5:1. */

/* Violet: #a78bfa (2.7:1) → #7c3aed (5.2:1 on white) */
[data-theme="light"] .text-violet-400 {
    color: #7c3aed;
}
[data-theme="light"] .hover\:text-violet-400:hover {
    color: #6d28d9;
}
[data-theme="light"] .hover\:text-violet-300:hover {
    color: #7c3aed;
}

/* Amber: #fbbf24 (1.5:1) → #b45309 (5.8:1 on white) */
[data-theme="light"] .text-amber-400 {
    color: #b45309;
}
[data-theme="light"] .text-amber-400\/70 {
    color: rgba(180, 83, 9, 0.7);
}
[data-theme="light"] .text-amber-500 {
    color: #92400e;
}

/* Emerald: #34d399 (2.0:1) → #047857 (5.9:1 on white) */
[data-theme="light"] .text-emerald-400 {
    color: #047857;
}

/* Sky: #38bdf8 (1.8:1) → #0369a1 (5.6:1 on white) */
[data-theme="light"] .text-sky-400 {
    color: #0369a1;
}

/* Cyan: #22d3ee (1.6:1) → #0e7490 (5.4:1 on white) */
[data-theme="light"] .text-cyan-400 {
    color: #0e7490;
}
[data-theme="light"] .text-cyan-300\/80 {
    color: rgba(14, 116, 144, 0.85);
}

/* Standalone zinc-500 (e.g., production-simulator-label) → #475569 (6.1:1) */
[data-theme="light"] .text-zinc-500 {
    color: #475569;
}

/* Accent backgrounds — slightly more opaque in light mode for visibility */
[data-theme="light"] .bg-cyan-500\/10 {
    background-color: rgba(14, 116, 144, 0.1);
}
[data-theme="light"] .border-cyan-500\/20 {
    border-color: rgba(14, 116, 144, 0.25);
}
[data-theme="light"] .border-emerald-500\/30 {
    border-color: rgba(4, 120, 87, 0.3);
}
