:root {
    color-scheme: light dark;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #1e293b;
    --text-tertiary: #334155;
    --text-muted: #475569;
    --text-dim: #64748b;
    --text-faint: #6b7280;
    --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: #718497;
    --text-faint: #7e8fa2;
    --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);
}

/* ── Light-theme color overrides for WCAG AA contrast ── */
/* In light mode, 400-level Tailwind colors are too bright against white backgrounds.
   Bump them to 600-700 equivalents for WCAG AA 4.5:1 minimum contrast. */
[data-theme="light"] .text-violet-400 { color: #7c3aed; }
[data-theme="light"] .hover\:text-violet-400:hover { color: #6d28d9; }

/* ── System Exploit Preset buttons — theme-aware ── */
.exploit-chip {
    background-color: #ffffff;
    color: #000000;
    border-color: #d4d4d8;
    font-weight: 700;
}
.exploit-chip:hover {
    background-color: #fafafa;
}
[data-theme="dark"] .exploit-chip {
    background-color: #09090b;
    color: #a1a1aa;
    border-color: #27272a;
}
[data-theme="dark"] .exploit-chip:hover {
    background-color: #09090b;
}

/* ── Quick Test Clean button — theme-aware ── */
.quick-test-chip {
    background-color: #ffffff;
    color: #000000;
    border-color: #d4d4d8;
    font-weight: 700;
}
.quick-test-chip:hover {
    background-color: #fafafa;
    color: #1e293b;
}
[data-theme="dark"] .quick-test-chip {
    background-color: rgba(24, 24, 27, 0.5);
    color: #a1a1aa;
    border-color: #27272a;
}
[data-theme="dark"] .quick-test-chip:hover {
    background-color: #27272a;
    color: #22d3ee;
}
[data-theme="light"] .hover\:text-violet-300:hover { color: #7c3aed; }
[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; }
[data-theme="light"] .text-emerald-400 { color: #047857; }
[data-theme="light"] .text-emerald-400\/70 { color: rgba(4, 120, 87, 0.7); }
[data-theme="light"] .text-sky-400 { color: #0369a1; }
[data-theme="light"] .text-cyan-400 { color: #0e7490; }
[data-theme="light"] .text-cyan-400\/70 { color: rgba(14, 116, 144, 0.85); }
[data-theme="light"] .text-cyan-300\/80 { color: rgba(3, 105, 161, 0.85); }
[data-theme="light"] .text-zinc-500 { color: #475569; }
[data-theme="light"] .hover\:text-zinc-300:hover { color: #1e293b; }
[data-theme="light"] .text-white { color: #ffffff; }

/* ── Toast pulse animation — draws attention to critical warnings ── */
@keyframes toastPulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4); }
    50% { opacity: 1; transform: scale(1.03); box-shadow: 0 0 20px 8px rgba(251, 191, 36, 0.25); }
}
.toast-pulse {
    animation: toastPulse 1.2s ease-in-out 3;
}

/* 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);
}
