:root {

    --bg-0: #111111;
    --bg-1: #171717;
    --bg-2: #232323;
    --card-bg: rgba(28, 28, 30, 0.96);
    --card-border: rgba(163, 163, 163, 0.14);
    --text-main: #f3f4f6;
    --text-muted: #a3a3a3;
    --accent: #8b8b8b;
    --accent-2: #c7c7c7;
    --success: #28c76f;
    --warning: #ff9f43;
    --danger: #ea5455;
}

body {
    background: #0b0b0c;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ── Animated background layer ── */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.04), transparent 26%),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.03), transparent 22%),
        linear-gradient(180deg, #111111 0%, #171717 40%, #0b0b0c 100%);
}

/* Floating gradient orbs */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(600px circle at var(--orb1-x, 15%) var(--orb1-y, 20%),
            rgba(124, 92, 255, 0.045), transparent 60%),
        radial-gradient(500px circle at var(--orb2-x, 80%) var(--orb2-y, 30%),
            rgba(234, 84, 85, 0.035), transparent 60%),
        radial-gradient(450px circle at var(--orb3-x, 50%) var(--orb3-y, 75%),
            rgba(43, 214, 123, 0.03), transparent 60%);
    animation: orbDrift 25s ease-in-out infinite alternate;
}

@keyframes orbDrift {
    0% {
        --orb1-x: 15%; --orb1-y: 20%;
        --orb2-x: 80%; --orb2-y: 30%;
        --orb3-x: 50%; --orb3-y: 75%;
    }
    33% {
        --orb1-x: 30%; --orb1-y: 35%;
        --orb2-x: 65%; --orb2-y: 55%;
        --orb3-x: 20%; --orb3-y: 60%;
    }
    66% {
        --orb1-x: 55%; --orb1-y: 15%;
        --orb2-x: 85%; --orb2-y: 70%;
        --orb3-x: 40%; --orb3-y: 85%;
    }
    100% {
        --orb1-x: 25%; --orb1-y: 45%;
        --orb2-x: 70%; --orb2-y: 20%;
        --orb3-x: 60%; --orb3-y: 65%;
    }
}

/* Animated floating particles layer */
.app-shell {
    max-width: 1600px;
    position: relative;
}

.app-shell::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background-image:
        radial-gradient(1.5px 1.5px at 10% 15%, rgba(255,255,255,0.10) 50%, transparent 50%),
        radial-gradient(1px 1px at 25% 40%, rgba(255,255,255,0.07) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 45% 10%, rgba(255,255,255,0.08) 50%, transparent 50%),
        radial-gradient(1px 1px at 60% 55%, rgba(255,255,255,0.06) 50%, transparent 50%),
        radial-gradient(2px 2px at 75% 25%, rgba(255,255,255,0.09) 50%, transparent 50%),
        radial-gradient(1px 1px at 85% 70%, rgba(255,255,255,0.07) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 35% 80%, rgba(255,255,255,0.06) 50%, transparent 50%),
        radial-gradient(1px 1px at 90% 45%, rgba(255,255,255,0.08) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 20% 65%, rgba(255,255,255,0.05) 50%, transparent 50%),
        radial-gradient(1px 1px at 55% 90%, rgba(255,255,255,0.07) 50%, transparent 50%),
        radial-gradient(2px 2px at 5% 50%, rgba(255,255,255,0.06) 50%, transparent 50%),
        radial-gradient(1px 1px at 70% 85%, rgba(255,255,255,0.05) 50%, transparent 50%);
    animation: particleFloat 40s linear infinite;
}

@keyframes particleFloat {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-60px); }
}

/* Scan line effect — very subtle horizontal sweep */
.app-shell::after {
    content: "";
    position: fixed;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(124, 92, 255, 0.015) 40%,
        rgba(124, 92, 255, 0.025) 50%,
        rgba(124, 92, 255, 0.015) 60%,
        transparent 100%
    );
    animation: scanSweep 12s ease-in-out infinite;
}

@keyframes scanSweep {
    0%   { left: -50%; }
    100% { left: 150%; }
}

/* Site header with logo */
.site-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 8px 12px 4px;
}

.site-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    border-radius: 10px;
    flex-shrink: 0;
}

.site-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.site-title {
    color: #fafafa;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-subtitle {
    color: #a3a3a3;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}

/* Share button */
.share-wrapper {
    position: relative;
    flex-shrink: 0;
}

.share-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #e5e7eb;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease;
    white-space: nowrap;
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fafafa;
}

.share-toast {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(40, 199, 111, 0.92);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 280ms ease, transform 280ms ease;
    pointer-events: none;
    z-index: 100;
}

.hero-panel {
    background: linear-gradient(135deg, rgba(38, 38, 40, 0.98), rgba(20, 20, 22, 0.98));
    border: 1px solid rgba(163, 163, 163, 0.12);
    border-radius: 28px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    position: relative;
    overflow: hidden;
}

/* Hero panel shimmer border */
.hero-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 28px;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(124, 92, 255, 0.0),
        rgba(124, 92, 255, 0.12),
        rgba(43, 214, 123, 0.08),
        rgba(124, 92, 255, 0.0)
    );
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: shimmerBorder 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmerBorder {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.eyebrow-text {
    color: #c5c5c5;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #b9ffd7;
    background: rgba(43, 214, 123, 0.14);
    border: 1px solid rgba(43, 214, 123, 0.28);
    animation: pillPulse 3s ease-in-out infinite;
}

@keyframes pillPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(43, 214, 123, 0); }
    50%      { box-shadow: 0 0 12px 2px rgba(43, 214, 123, 0.12); }
}

.status-pill-alt {
    color: #ebebeb;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    animation: none;
}

.hero-title {
    color: #fafafa;
    font-size: clamp(2rem, 3vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.hero-metric {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(163, 163, 163, 0.10);
    border-radius: 18px;
    padding: 0.95rem 1rem;
}

.hero-metric-label {
    color: #a3a3a3;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12rem;
}

.hero-metric-value {
    color: #f5f5f5;
    font-size: 1rem;
    font-weight: 700;
    margin-top: 0.3rem;
}

.hero-subtitle,
.section-subtitle,
.footer-note,
.text-muted {
    color: var(--text-muted) !important;
}

.glass-card.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    overflow: hidden;
    transition: border-color 300ms ease, box-shadow 300ms ease;
}

.glass-card.card:hover {
    border-color: rgba(163, 163, 163, 0.22);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.glass-card .card-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(163, 163, 163, 0.10);
    padding: 0.95rem 1.1rem;
    position: relative;
    color: #f5f5f5;
}

.glass-card .card-header::after {
    content: "";
    position: absolute;
    inset: auto 1.25rem 0.6rem 1.25rem;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.18), rgba(255,255,255,0.10), rgba(255,255,255,0));
}

.card-header-stack {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    color: #f5f5f5;
}

.glass-card .card-body {
    background: transparent;
}

.stat-card {
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
    animation: cardFadeIn 0.6s ease both;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.36), 0 0 20px rgba(124, 92, 255, 0.06);
    border-color: rgba(124, 92, 255, 0.18);
}

/* Staggered fade-in for KPI cards */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.g-3 > [class*="col-"]:nth-child(1) .stat-card { animation-delay: 0.05s; }
.g-3 > [class*="col-"]:nth-child(2) .stat-card { animation-delay: 0.12s; }
.g-3 > [class*="col-"]:nth-child(3) .stat-card { animation-delay: 0.19s; }
.g-3 > [class*="col-"]:nth-child(4) .stat-card { animation-delay: 0.26s; }

.kpi-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 210px;
}

.kpi-card-body h3,
.kpi-card-body p,
.kpi-card-body small {
    overflow-wrap: anywhere;
}

.chart-header-title {
    letter-spacing: 0.01em;
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.08);
    line-height: 1.2;
    color: #f5f5f5 !important;
}

.kpi-sparkline {
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0.005));
}

.section-title {
    color: #f1f1f1 !important;
    font-weight: 700;
}

.glass-card .card-header h5,
.glass-card .card-header h6,
.glass-card .card-header .section-title,
.glass-card .card-header .chart-header-title {
    color: #f5f5f5 !important;
    opacity: 1 !important;
}

.glass-card .card-header small,
.glass-card .card-header .text-muted {
    color: #cfcfd4 !important;
    opacity: 1 !important;
}

.conflict-feed-alert,
.future-conflict-alert {
    color: #f3f4f6 !important;
}

.conflict-feed-alert {
    background: rgba(22, 24, 30, 0.92) !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
}

.future-conflict-alert {
    background: rgba(70, 44, 10, 0.28) !important;
    border-color: rgba(255, 159, 67, 0.28) !important;
}

.conflict-feed-title,
.future-conflict-title {
    color: #fafafa !important;
    font-weight: 700;
}

.conflict-feed-meta,
.conflict-feed-metrics,
.future-conflict-meta,
.future-conflict-metrics {
    color: #d1d5db !important;
}

.conflict-feed-summary,
.future-conflict-summary {
    color: #f3f4f6 !important;
    line-height: 1.55;
}

.conflict-feed-link,
.future-conflict-link {
    color: #8ab4ff !important;
    font-weight: 600;
}

.conflict-feed-link:hover,
.future-conflict-link:hover {
    color: #bfd4ff !important;
}

.control-label {
    color: #d4d4d8;
    font-size: 0.76rem;
    letter-spacing: 0.12rem;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.55rem;
}

.disease-note {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    color: #e5e7eb;
    padding: 14px 16px;
    font-size: 0.95rem;
}

.top-level-tabs {
    background: transparent;
}

.top-level-tabs .tab {
    background: rgba(24, 24, 27, 0.84) !important;
    color: #d4d4d8 !important;
    border: 1px solid rgba(163, 163, 163, 0.14) !important;
    border-radius: 14px 14px 0 0 !important;
    padding: 14px 22px !important;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

.top-level-tabs .tab:hover {
    background: rgba(255, 255, 255, 0.04) !important;
    color: #f0f0f0 !important;
}

.top-level-tabs .tab--selected,
.top-level-tab--selected {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)) !important;
    color: #f5f5f5 !important;
    border-bottom-color: rgba(124, 92, 255, 0.65) !important;
    box-shadow: inset 0 -2px 0 rgba(124, 92, 255, 0.72), 0 0 16px rgba(124, 92, 255, 0.08);
    animation: tabGlow 4s ease-in-out infinite;
}

@keyframes tabGlow {
    0%, 100% { box-shadow: inset 0 -2px 0 rgba(124, 92, 255, 0.72), 0 0 12px rgba(124, 92, 255, 0.06); }
    50%      { box-shadow: inset 0 -2px 0 rgba(124, 92, 255, 0.85), 0 0 22px rgba(124, 92, 255, 0.12); }
}

.premium-dropdown .Select-control,
.premium-dropdown .Select-menu-outer,
.premium-dropdown .VirtualizedSelectFocusedOption,
.premium-dropdown .Select-menu {
    background-color: rgba(24, 24, 27, 0.98) !important;
    color: #f3f4f6 !important;
}

.premium-dropdown .Select-control {
    border: 1px solid rgba(163, 163, 163, 0.14) !important;
    border-radius: 12px !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
    min-height: 64px !important;
    height: 64px !important;
    font-size: 1.08rem !important;
}

.premium-dropdown .Select-value-label,
.premium-dropdown .Select-placeholder,
.premium-dropdown .Select-input > input {
    color: #f3f4f6 !important;
    line-height: 62px !important;
    font-size: 1.08rem !important;
}

.premium-dropdown .Select-placeholder,
.premium-dropdown .Select--single > .Select-control .Select-value {
    padding-left: 18px !important;
    padding-right: 52px !important;
}

.premium-dropdown .Select-input {
    height: 62px !important;
    padding-left: 18px !important;
}

.premium-dropdown .Select-arrow-zone,
.premium-dropdown .Select-clear-zone {
    width: 52px !important;
}

.premium-dropdown .Select-menu-outer {
    border: 1px solid rgba(163, 163, 163, 0.12) !important;
    border-radius: 14px !important;
    margin-top: 6px !important;
    max-height: 380px !important;
    font-size: 1.05rem !important;
}

.premium-dropdown .VirtualizedSelectOption {
    background-color: rgba(24, 24, 27, 0.98) !important;
    color: #f3f4f6 !important;
    padding: 16px 18px !important;
    min-height: 56px !important;
    display: flex !important;
    align-items: center !important;
}

.premium-dropdown .VirtualizedSelectFocusedOption {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

.js-plotly-plot .plotly .modebar {
    background: rgba(9, 15, 28, 0.72) !important;
    border-radius: 10px;
}

.js-plotly-plot .plotly .legend {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.js-plotly-plot .plotly .legend rect {
    fill: rgba(9, 15, 28, 0.58) !important;
    stroke: rgba(255, 255, 255, 0.12) !important;
}

@media (max-width: 991.98px) {
    .hero-title {
        font-size: clamp(1.8rem, 7vw, 2.6rem);
    }

    .hero-metric-grid {
        grid-template-columns: 1fr;
    }

    .glass-card .card-header {
        padding: 0.85rem 1rem;
    }

    .kpi-card-body {
        min-height: 190px;
    }
}

a {
    text-decoration: none;
}

.alert {
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
}

/* Stock impact cards */
.stock-impact-card {
    background: rgba(22, 24, 30, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    color: #f3f4f6;
}

.stock-impact-card strong {
    color: #fafafa;
}

.stock-impact-card details summary {
    color: #8ab4ff;
}

.stock-conf-high {
    color: #28c76f !important;
}

.stock-conf-med {
    color: #ff9f43 !important;
}

.stock-conf-low {
    color: #a3a3a3 !important;
}

/* Threat Index */
.threat-detail-item {
    background: rgba(22, 24, 30, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #f3f4f6;
}

.scenario-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 10px;
}

.scenario-check-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(22, 24, 30, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: #e5e7eb !important;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 180ms ease, background 180ms ease;
}

.scenario-check-label:hover {
    border-color: rgba(234, 84, 85, 0.35);
    background: rgba(234, 84, 85, 0.06);
}

.scenario-check-input {
    accent-color: #ea5455;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.scenario-check-input:checked + .scenario-check-label {
    border-color: rgba(234, 84, 85, 0.50) !important;
    background: rgba(234, 84, 85, 0.10) !important;
    color: #fafafa !important;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Vulnerability metric grid */
.vuln-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.vuln-metric-item {
    background: rgba(22, 24, 30, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px 14px;
}

