/* ==========================================================================
   Apple Liquid Glass — Premium Design System & Stylesheet (Adaptable Theme)
   ========================================================================== */

/* 1. CSS VARIABLES & THEME SETUP */
:root {
    /* Typography */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: 'Space Mono', SFMono-Regular, Consolas, monospace;

    /* Theme colors: DEFAULT LIGHT */
    --color-bg-dark: #f6f5f9;
    /* Warm clean alabaster background */
    --color-bg-deep: #ffffff;
    /* Solid pristine white */

    /* Slightly softened color scheme for light mode readability */
    --color-cyan: #008eb3;
    /* Deepened cyan for high contrast readability */
    --color-cyan-glow: rgba(0, 142, 179, 0.15);

    --color-purple: #6a00d4;
    /* Rich violet */
    --color-purple-glow: rgba(106, 0, 212, 0.15);

    --color-pink: #d100eb;

    --color-gold: #e27c5d;
    --color-amber: #c86b00;
    /* Deep amber */
    --color-amber-glow: rgba(200, 107, 0, 0.15);

    --color-red: #d60032;
    /* Deep red for legible risk indications */
    --color-red-glow: rgba(214, 0, 50, 0.15);

    --color-green: #008f47;
    /* Rich green */
    --color-green-glow: rgba(0, 143, 71, 0.12);

    /* Text Colors */
    --color-text-main: #14111d;
    /* Deep slate-charcoal text */
    --color-text-muted: #5e5975;
    /* Soft charcoal */
    --color-text-dark: #8c889f;
    /* Mid gray */

    /* Glass System Spec - Frosted clean white glass */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-bg-hover: rgba(0, 0, 0, 0.02);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-border-glow: rgba(0, 142, 179, 0.25);
    --glass-blur: blur(28px) saturate(190%);
    --glass-shadow: 0 20px 50px rgba(12, 8, 30, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(255, 255, 255, 0.3);
    --glass-shadow-glow: 0 20px 50px rgba(0, 142, 179, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);

    /* Adaptive Components */
    --card-bg: rgba(255, 255, 255, 0.45);
    --card-bg-hover: rgba(255, 255, 255, 0.75);
    --card-border-hover: rgba(0, 0, 0, 0.14);
    --card-shadow: 0 10px 30px rgba(12, 8, 30, 0.03);
    --card-shadow-hover: 0 15px 40px rgba(12, 8, 30, 0.06);

    --subcard-bg: rgba(255, 255, 255, 0.55);
    --subcard-border: rgba(0, 0, 0, 0.05);
    --subcard-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    --subcard-bg-hover: rgba(255, 255, 255, 0.8);
    --subcard-border-hover: rgba(0, 0, 0, 0.08);

    --ticker-bg: rgba(0, 0, 0, 0.02);
    --ticker-border: rgba(0, 0, 0, 0.04);

    --navbar-bg: rgba(255, 255, 255, 0.75);
    --navbar-border: rgba(0, 0, 0, 0.07);

    --active-btn-text: var(--color-text-main);
    --active-btn-bg: linear-gradient(135deg, rgba(0, 142, 179, 0.15), rgba(106, 0, 212, 0.08));
    --active-btn-border: rgba(0, 142, 179, 0.25);
    --active-btn-shadow: 0 4px 15px rgba(0, 142, 179, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.5);

    --input-bg: rgba(255, 255, 255, 0.85);
    --input-border: rgba(0, 0, 0, 0.1);
    --input-text: var(--color-text-main);

    --chip-bg: rgba(0, 0, 0, 0.04);
    --chip-border: rgba(0, 0, 0, 0.07);

    --modal-bg: rgba(255, 255, 255, 0.95);
    --modal-border: rgba(0, 0, 0, 0.1);
    --modal-shadow: 0 30px 70px rgba(12, 8, 30, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);

    --chart-container-bg: rgba(0, 0, 0, 0.02);
    --chart-container-border: rgba(0, 0, 0, 0.05);

    --chart-grid: rgba(0, 0, 0, 0.07);

    --logo-grad-1: linear-gradient(135deg, #14111d 30%, #008eb3 70%, #6a00d4 100%);

    --scrollbar-track: #f6f5f9;
    --scrollbar-thumb: rgba(0, 0, 0, 0.1);

    /* Methodology Handbook Specs */
    --meth-container-bg: rgba(0, 0, 0, 0.025);
    --meth-container-border: rgba(0, 0, 0, 0.05);
    --meth-box-bg: rgba(255, 255, 255, 0.9);
    --meth-box-border: rgba(0, 0, 0, 0.08);
    --meth-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.05);
    --meth-math-color: var(--color-cyan);
    --meth-math-shadow: 0 1px 2px rgba(0, 142, 179, 0.1);
    --meth-card-h4-border: rgba(0, 0, 0, 0.06);

    --meth-tier-critical-bg: rgba(214, 0, 50, 0.03);
    --meth-tier-critical-border: rgba(214, 0, 50, 0.12);
    --meth-tier-critical-hover-bg: rgba(214, 0, 50, 0.06);
    --meth-tier-critical-hover-border: rgba(214, 0, 50, 0.28);

    --meth-tier-severe-bg: rgba(200, 107, 0, 0.03);
    --meth-tier-severe-border: rgba(200, 107, 0, 0.12);
    --meth-tier-severe-hover-bg: rgba(200, 107, 0, 0.06);
    --meth-tier-severe-hover-border: rgba(200, 107, 0, 0.28);

    --meth-tier-elevated-bg: rgba(226, 124, 93, 0.03);
    --meth-tier-elevated-border: rgba(226, 124, 93, 0.12);
    --meth-tier-elevated-hover-bg: rgba(226, 124, 93, 0.06);
    --meth-tier-elevated-hover-border: rgba(226, 124, 93, 0.28);

    --meth-tier-stable-bg: rgba(0, 143, 71, 0.03);
    --meth-tier-stable-border: rgba(0, 143, 71, 0.12);
    --meth-tier-stable-hover-bg: rgba(0, 143, 71, 0.06);
    --meth-tier-stable-hover-border: rgba(0, 143, 71, 0.28);
}

:root[data-theme="dark"] {
    --color-bg-dark: #06040d;
    --color-bg-deep: #0c081e;

    /* Neon Glo-colors */
    --color-cyan: #00f2fe;
    --color-cyan-glow: rgba(0, 242, 254, 0.25);

    --color-purple: #7f00ff;
    --color-purple-glow: rgba(127, 0, 255, 0.3);

    --color-pink: #e100ff;

    --color-gold: #ffb199;
    --color-amber: #f3a63b;
    --color-amber-glow: rgba(243, 166, 59, 0.25);

    --color-red: #ff0844;
    --color-red-glow: rgba(255, 8, 68, 0.3);

    --color-green: #00e676;
    --color-green-glow: rgba(0, 230, 118, 0.2);

    /* Text Colors */
    --color-text-main: #f5f4fa;
    --color-text-muted: #9590a8;
    --color-text-dark: #5c5770;

    /* Glass System Spec */
    --glass-bg: rgba(12, 8, 30, 0.45);
    --glass-bg-hover: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.065);
    --glass-border-glow: rgba(0, 242, 254, 0.2);
    --glass-blur: blur(28px) saturate(190%);
    --glass-shadow: 0 20px 50px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(255, 255, 255, 0.05);
    --glass-shadow-glow: 0 20px 50px rgba(0, 242, 254, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);

    /* Adaptive Components */
    --card-bg: rgba(255, 255, 255, 0.018);
    --card-bg-hover: rgba(255, 255, 255, 0.035);
    --card-border-hover: rgba(255, 255, 255, 0.12);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    --card-shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.25);

    --subcard-bg: rgba(255, 255, 255, 0.015);
    --subcard-border: rgba(255, 255, 255, 0.03);
    --subcard-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --subcard-bg-hover: rgba(255, 255, 255, 0.04);
    --subcard-border-hover: rgba(255, 255, 255, 0.08);

    --ticker-bg: rgba(255, 255, 255, 0.02);
    --ticker-border: rgba(255, 255, 255, 0.04);

    --navbar-bg: rgba(12, 8, 30, 0.65);
    --navbar-border: rgba(255, 255, 255, 0.05);

    --active-btn-text: #fff;
    --active-btn-bg: linear-gradient(135deg, rgba(79, 172, 254, 0.2), rgba(0, 242, 254, 0.1));
    --active-btn-border: rgba(0, 242, 254, 0.3);
    --active-btn-shadow: 0 4px 15px rgba(0, 242, 254, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);

    --input-bg: rgba(12, 8, 30, 0.7);
    --input-border: rgba(255, 255, 255, 0.08);
    --input-text: #fff;

    --chip-bg: rgba(255, 255, 255, 0.04);
    --chip-border: rgba(255, 255, 255, 0.08);

    --modal-bg: rgba(12, 8, 30, 0.85);
    --modal-border: rgba(255, 255, 255, 0.1);
    --modal-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.15);

    --chart-container-bg: rgba(6, 4, 13, 0.4);
    --chart-container-border: rgba(255, 255, 255, 0.04);

    --chart-grid: rgba(255, 255, 255, 0.05);

    --logo-grad-1: linear-gradient(135deg, #fff 30%, #4facfe 70%, #00f2fe 100%);

    --scrollbar-track: #06040d;
    --scrollbar-thumb: rgba(255, 255, 255, 0.08);

    /* Methodology Handbook Specs */
    --meth-container-bg: rgba(6, 4, 13, 0.35);
    --meth-container-border: rgba(255, 255, 255, 0.04);
    --meth-box-bg: rgba(12, 8, 30, 0.65);
    --meth-box-border: rgba(255, 255, 255, 0.06);
    --meth-box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
    --meth-math-color: var(--color-cyan);
    --meth-math-shadow: 0 0 8px rgba(0, 242, 254, 0.35);
    --meth-card-h4-border: rgba(255, 255, 255, 0.05);

    --meth-tier-critical-bg: rgba(255, 8, 68, 0.03);
    --meth-tier-critical-border: rgba(255, 8, 68, 0.15);
    --meth-tier-critical-hover-bg: rgba(255, 8, 68, 0.06);
    --meth-tier-critical-hover-border: rgba(255, 8, 68, 0.35);

    --meth-tier-severe-bg: rgba(243, 166, 59, 0.03);
    --meth-tier-severe-border: rgba(243, 166, 59, 0.15);
    --meth-tier-severe-hover-bg: rgba(243, 166, 59, 0.06);
    --meth-tier-severe-hover-border: rgba(243, 166, 59, 0.35);

    --meth-tier-elevated-bg: rgba(255, 177, 153, 0.03);
    --meth-tier-elevated-border: rgba(255, 177, 153, 0.15);
    --meth-tier-elevated-hover-bg: rgba(255, 177, 153, 0.06);
    --meth-tier-elevated-hover-border: rgba(255, 177, 153, 0.35);

    --meth-tier-stable-bg: rgba(0, 230, 118, 0.03);
    --meth-tier-stable-border: rgba(0, 230, 118, 0.15);
    --meth-tier-stable-hover-bg: rgba(0, 230, 118, 0.06);
    --meth-tier-stable-hover-border: rgba(0, 230, 118, 0.35);
}

/* 2. BASE RESET & LAYOUT */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--color-bg-dark);
    color: var(--color-text-main);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* 3. MAIN APP WRAPPER SYSTEM */
.app-glass-wrapper {
    position: relative;
    z-index: 10;
    width: 95%;
    max-width: 1440px;
    margin: 40px auto;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow);
    padding: 30px;
    overflow: hidden;
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* 4. HEADER COMPONENT */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 25px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

/* Logo Design */
.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.logo-glow {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, var(--color-cyan) 0%, rgba(0, 242, 254, 0) 70%);
    filter: blur(10px);
    opacity: 0.35;
    pointer-events: none;
}

.logo-icon {
    width: 44px;
    height: 44px;
    filter: drop-shadow(0 0 8px var(--color-cyan-glow));
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 26px;
    letter-spacing: -0.5px;
    background: var(--logo-grad-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: background 0.4s ease;
}

.logo-text span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--color-text-muted);
    font-weight: 600;
    display: block;
    margin-top: -2px;
}

/* Live Ticker System */
.live-ticker {
    display: flex;
    gap: 25px;
    background: var(--ticker-bg);
    border: 1px solid var(--ticker-border);
    padding: 10px 20px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
}

.ticker-item {
    display: flex;
    flex-direction: column;
}

.ticker-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    font-weight: 600;
}

.ticker-value {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-main);
}

/* Navigation flex layout containing theme switcher */
.nav-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Theme Switcher Button styling */
.theme-toggle-btn {
    background: var(--navbar-bg);
    border: 1px solid var(--navbar-border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-text-main);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.theme-toggle-btn:hover {
    background: var(--glass-bg-hover);
    transform: scale(1.05);
    border-color: var(--color-cyan);
    box-shadow: 0 0 12px var(--color-cyan-glow);
}

.sun-icon {
    display: none;
    width: 20px;
    height: 20px;
}

.moon-icon {
    display: block;
    width: 20px;
    height: 20px;
}

:root[data-theme="light"] .sun-icon {
    display: block;
}

:root[data-theme="light"] .moon-icon {
    display: none;
}

/* Glass Navbar */
.glass-navbar {
    display: flex;
    background: var(--navbar-bg);
    border: 1px solid var(--navbar-border);
    border-radius: 50px;
    padding: 6px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.4s ease;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn:hover {
    color: var(--color-text-main);
    background: var(--glass-bg-hover);
}

.nav-btn.active {
    color: var(--active-btn-text);
    background: var(--active-btn-bg);
    border: 1px solid var(--active-btn-border);
    box-shadow: var(--active-btn-shadow);
    text-shadow: 0 0 10px var(--color-cyan-glow);
}

.nav-icon {
    width: 16px;
    height: 16px;
}

/* 5. WORKSPACE BODY & PANELS */
.app-body {
    position: relative;
    z-index: 10;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Entrance fade-slide-up for general tabs content */
.tab-panel.active>* {
    animation: fade-slide-up 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes fade-slide-up {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 6. GLASS CARDS & CORE GRID */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 25px;
}

.col-span-8 {
    grid-column: span 8;
}

.col-span-4 {
    grid-column: span 4;
}

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.glass-card:hover {
    border-color: var(--card-border-hover);
    background: var(--card-bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

/* Shine overlay on individual cards */
.glass-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 60%);
    pointer-events: none;
}

.card-header {
    margin-bottom: 25px;
}

.card-header h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-top: 5px;
}

.card-subtitle {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* Badges styling */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-cyan {
    background: rgba(0, 242, 254, 0.1);
    color: var(--color-cyan);
    border: 1px solid rgba(0, 242, 254, 0.2);
}

.badge-purple {
    background: var(--color-purple-glow);
    color: var(--color-purple);
    border: 1px solid rgba(127, 0, 255, 0.2);
}

.badge-orange {
    background: rgba(243, 166, 59, 0.12);
    color: var(--color-amber);
    border: 1px solid rgba(243, 166, 59, 0.2);
}

.badge-red {
    background: rgba(255, 8, 68, 0.1);
    color: var(--color-red);
    border: 1px solid rgba(255, 8, 68, 0.2);
}

.badge-gold {
    background: var(--color-amber-glow);
    color: var(--color-gold);
    border: 1px solid rgba(243, 166, 59, 0.22);
}

.badge-green {
    background: var(--color-green-glow);
    color: var(--color-green);
    border: 1px solid rgba(0, 230, 118, 0.22);
}

/* 7. TAB 1 SPECIFIC VISUALS */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.hero-stat-box {
    background: var(--subcard-bg);
    border: 1px solid var(--subcard-border);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--subcard-shadow);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.hero-stat-box .label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--color-text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.hero-stat-box .value-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 8px 0;
}

.hero-stat-box h3 {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
}

.hero-stat-box .desc {
    font-size: 11px;
    color: var(--color-text-dark);
    line-height: 1.4;
}

/* Tiers & Grades labels */
.rating-grade {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 5px;
}

.grade-moderate {
    background: rgba(243, 166, 59, 0.15);
    color: var(--color-amber);
    border: 1px solid rgba(243, 166, 59, 0.25);
}

.rating-share {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-cyan);
}

.rating-percentage {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
}

/* Chart System layout */
.chart-container-large {
    background: var(--chart-container-bg);
    border: 1px solid var(--chart-container-border);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.4s ease;
}

.chart-container-small {
    background: var(--chart-container-bg);
    border: 1px solid var(--chart-container-border);
    border-radius: 12px;
    padding: 16px;
    min-height: 160px;
}

.chart-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-title-bar h4 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-main);
}

.legend {
    display: flex;
    gap: 15px;
    font-size: 11px;
    color: var(--color-text-muted);
}

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.dot-cyan {
    background: var(--color-cyan);
}

.dot-gold {
    background: var(--color-amber);
}

.dot-orange {
    background: #ff7600;
}

.dot-red {
    background: var(--color-red);
}

.dot-purple {
    background: var(--color-purple);
}

.dot-green {
    background: var(--color-green);
}

.svg-chart-wrapper {
    width: 100%;
    height: 250px;
}

/* Vulnerable Industry List Sidebar */
.vulnerable-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.vulnerable-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--subcard-bg);
    border: 1px solid var(--subcard-border);
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vulnerable-item:hover {
    background: var(--subcard-bg-hover);
    border-color: var(--subcard-border-hover);
    transform: translateX(4px);
}

.vulnerable-item.is-clickable:hover {
    border-color: var(--color-cyan);
    box-shadow: 0 0 10px var(--color-cyan-glow);
}

.vulnerable-item.is-disabled {
    cursor: default;
    opacity: 0.72;
}

.vulnerable-item.is-disabled:hover {
    background: var(--subcard-bg);
    border-color: var(--subcard-border);
    transform: none;
}

.vuln-rank {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-dark);
}

.vuln-info {
    flex-grow: 1;
    overflow: hidden;
}

.vuln-info h4 {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vuln-info span {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--color-text-muted);
}

.vuln-score {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.vuln-score-val {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-red);
}

.vuln-score-lbl {
    font-size: 8px;
    text-transform: uppercase;
    color: var(--color-text-dark);
}

/* 8. TAB 2 SPECIFIC VISUALS (Explorer Grid & Filtering) */
.filter-card {
    padding: 20px;
    margin-bottom: 25px;
}

.filter-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--color-text-dark);
}

.search-input-wrapper input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 12px 15px 12px 45px;
    color: var(--input-text);
    font-family: var(--font-body);
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--color-cyan);
    box-shadow: 0 0 15px var(--color-cyan-glow);
}

.dropdown-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.select-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.select-container label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    font-weight: 600;
}

.select-container select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    padding: 10px 15px;
    color: var(--input-text);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    min-width: 160px;
    transition: all 0.3s ease;
}

.select-container select:focus {
    outline: none;
    border-color: var(--color-cyan);
}

.explorer-header-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-count {
    font-size: 13px;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
}

.active-chips {
    display: flex;
    gap: 10px;
}

.filter-chip {
    background: var(--chip-bg);
    border: 1px solid var(--chip-border);
    border-radius: 50px;
    padding: 4px 12px;
    font-size: 11px;
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-chip:hover {
    background: rgba(255, 8, 68, 0.1);
    border-color: rgba(255, 8, 68, 0.25);
    color: var(--color-red);
}

.explorer-grid-container {
    min-height: 420px;
}

/* Grid of Cards */
.sector-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
    margin-bottom: 30px;
}

.sector-card {
    background: var(--subcard-bg);
    border: 1px solid var(--subcard-border);
    border-radius: 10px;
    padding: 8px 11px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 58px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.sector-card:hover {
    transform: translateY(-3px);
    background: var(--subcard-bg-hover);
    border-color: var(--subcard-border-hover);
    box-shadow: var(--card-shadow-hover);
}

.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.card-code {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--color-text-muted);
    font-weight: 700;
    background: var(--chip-bg);
    padding: 1px 5px;
    border-radius: 4px;
}

.text-green {
    color: var(--color-green);
}

.text-amber {
    color: var(--color-amber);
}

.text-orange {
    color: #ff7600;
}

.text-red {
    color: var(--color-red);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: auto;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--subcard-border);
    padding-top: 6px;
    margin-top: 6px;
    font-size: 10.5px;
}

.card-supplier {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
}

.card-supplier .flag {
    font-size: 14px;
}

.card-imports {
    font-family: var(--font-mono);
    color: var(--color-text-muted);
}

/* Pagination */
.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
}

.page-btn {
    background: var(--subcard-bg);
    border: 1px solid var(--subcard-border);
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background: var(--subcard-bg-hover);
    color: var(--color-text-main);
    border-color: var(--subcard-border-hover);
}

.page-btn.active {
    background: var(--active-btn-bg);
    border-color: var(--active-btn-border);
    color: var(--color-cyan);
    font-weight: 700;
}

.pagination-ellipsis {
    color: var(--color-text-muted);
    font-family: var(--font-body);
    font-size: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}

/* 9. TAB 3 SPECIFIC VISUALS (Simulation Dashboard) */
.simulator-controls-card {
    padding: 30px 25px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.slider-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-value {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-cyan);
}

/* Range Slider Glass Custom Design */

/* Checkbox glass style */
.glass-checkbox {
    display: block;
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 12px;
    color: var(--color-text-muted);
    user-select: none;
}

.glass-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 1px;
    left: 0;
    height: 18px;
    width: 18px;
    background: var(--subcard-bg);
    border: 1px solid var(--subcard-border);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.glass-checkbox:hover input~.checkmark {
    background: var(--subcard-bg-hover);
    border-color: var(--subcard-border-hover);
}

.glass-checkbox input:checked~.checkmark {
    background: rgba(0, 242, 254, 0.15);
    border-color: var(--color-cyan);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.glass-checkbox input:checked~.checkmark:after {
    display: block;
}

.glass-checkbox .checkmark:after {
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid var(--color-cyan);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Glass Buttons */
.glass-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: 100%;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-purple) 0%, #4facfe 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(127, 0, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-icon {
    width: 16px;
    height: 16px;
}

/* Shock Info Banner Ticker */


.ticker-box {
    background: var(--subcard-bg);
    border: 1px solid var(--subcard-border);
    border-radius: 15px;
    padding: 18px;
    box-shadow: var(--subcard-shadow);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.ticker-box .label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--color-text-muted);
    font-weight: 600;
}

.ticker-box h3 {
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 700;
    margin: 4px 0;
}

.ticker-box .desc {
    font-size: 10px;
    color: var(--color-text-dark);
    line-height: 1.3;
}

/* Interactivity lift for clickable summary stats cards */
.clickable-stat-card {
    cursor: pointer;
}

.clickable-stat-card:hover {
    background: var(--subcard-bg-hover) !important;
    border-color: var(--subcard-border-hover) !important;
    transform: translateY(-3px) scale(1.015);
    box-shadow: var(--card-shadow-hover), 0 0 15px var(--color-cyan-glow) !important;
}

/* Injected Glass Table styling */
.table-container {
    background: var(--chart-container-bg);
    border: 1px solid var(--chart-container-border);
    border-radius: 15px;
    padding: 20px;
    overflow-x: auto;
    transition: all 0.4s ease;
}

.table-container h4 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
}

.glass-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}

.glass-table th {
    padding: 10px 15px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--chart-grid);
}

.glass-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--subcard-border);
    color: var(--color-text-main);
    font-family: var(--font-body);
}

.glass-table tr:hover td {
    background: var(--glass-bg-hover);
}

.glass-table .nace-mono {
    font-family: var(--font-mono);
    background: var(--chip-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.action-btn-small {
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid rgba(0, 242, 254, 0.2);
    color: var(--color-cyan);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    transition: all 0.2s ease;
}

.action-btn-small:hover {
    background: rgba(0, 242, 254, 0.25);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

/* 10. TAB 4 SPECIFIC VISUALS (Variable Dictionary Handbook) */
.text-document-card {
    padding: 40px;
}

.document-header {
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 30px;
    margin-bottom: 30px;
}

.document-header h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    margin-top: 8px;
}

.dictionary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.dict-section h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-main);
    margin-bottom: 15px;
    border-left: 3px solid var(--color-cyan);
    padding-left: 10px;
}

.section-intro {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 25px;
}

.dict-term {
    background: var(--subcard-bg);
    border: 1px solid var(--subcard-border);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.dict-term:hover {
    background: var(--subcard-bg-hover);
    border-color: var(--subcard-border-hover);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

.term-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.term-name {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 13px;
    color: var(--color-cyan);
}

.term-badge {
    font-size: 9px;
    text-transform: uppercase;
    color: var(--color-text-muted);
    font-weight: 600;
}

.term-desc {
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* 11. SECTOR INSPECTION MODAL SYSTEM */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 4, 13, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.glass-modal {
    background: var(--modal-bg);
    border: 1px solid var(--modal-border);
    width: 90%;
    max-width: 950px;
    /* Slightly wider to beautifully accommodate the products grid */
    height: auto;
    /* Allow dynamic height fit */
    min-height: 550px;
    max-height: 92vh;
    border-radius: 25px;
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--modal-shadow);
    padding: 24px 30px;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
        height 0.35s cubic-bezier(0.25, 0.8, 0.25, 1),
        /* Smooth height resizing! */
        background-color 0.4s ease,
        border-color 0.4s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .glass-modal {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    background: var(--chip-bg);
    border: 1px solid var(--chip-border);
    color: var(--color-text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 8, 68, 0.15);
    color: var(--color-red);
    border-color: rgba(255, 8, 68, 0.25);
    transform: rotate(90deg);
}

/* Modal Header Content */
.modal-header-section {
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 12px;
    margin-bottom: 14px;
}

.modal-header-section .title-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.modal-nace-code {
    font-family: var(--font-mono);
    background: var(--chip-bg);
    border: 1px solid var(--chip-border);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.modal-header-section h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    margin-top: 10px;
    line-height: 1.3;
}

.modal-header-section h4 {
    font-size: 13px;
    color: var(--color-text-muted);
    font-weight: 400;
    margin-top: 4px;
}

/* Modal Internal Layout */
.modal-body-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 5px;
}

.modal-panel-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-subcard {
    background: var(--subcard-bg);
    border: 1px solid var(--subcard-border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--subcard-shadow);
    transition: all 0.4s ease;
}

.modal-subcard h3 {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--color-text-main);
}

/* Small clarifying caption under a subcard heading */
.subcard-note {
    font-size: 10.5px;
    line-height: 1.45;
    color: var(--color-text-muted);
    margin: -8px 0 12px;
}
.subcard-note strong { color: var(--color-text-main); font-weight: 700; }

/* Coverage caveat under a group heading: which NACE divisions an FDI figure
   actually spans, or what a dpd_total_* basket sum does and does not count.
   Used in both the Overview and All Indicators pages, whose headings already
   carry their own bottom margin. */
.ov-fdi-note,
.ov-basket-note {
    margin: -2px 0 10px;
    font-style: italic;
}

/* Circular SVI Gauge styling */

/* Linear progress breakdown inside modal */
.gauge-factors {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.factor-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.factor-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--color-text-muted);
}

.factor-label-row .name {
    font-weight: 500;
}

.factor-label-row .val {
    font-family: var(--font-mono);
    font-weight: 600;
}

.bar-bg {
    width: 100%;
    height: 4px;
    background: var(--subcard-border);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.bg-cyan {
    background: var(--color-cyan);
    box-shadow: 0 0 8px var(--color-cyan-glow);
}

.bg-purple {
    background: var(--color-purple);
    box-shadow: 0 0 8px var(--color-purple-glow);
}

.bg-orange {
    background: var(--color-amber);
    box-shadow: 0 0 8px var(--color-amber-glow);
}

.bg-red {
    background: var(--color-red);
    box-shadow: 0 0 8px var(--color-red-glow);
}

.bg-green {
    background: var(--color-green);
    box-shadow: 0 0 8px var(--color-green-glow);
}

/* Supplier Showcase Layout */
.supplier-showcase {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.supplier-main-country {
    display: flex;
    align-items: center;
    gap: 12px;
}

.country-flag {
    font-size: 28px;
}

.supplier-main-country h4 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
}

.supplier-desc {
    font-size: 9px;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.supplier-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.sup-met-box {
    background: var(--subcard-bg);
    border: 1px solid var(--subcard-border);
    padding: 10px;
    border-radius: 10px;
    transition: all 0.4s ease;
}

.sup-met-box .val {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-main);
    display: block;
}

.sup-met-box .lbl {
    font-size: 8px;
    text-transform: uppercase;
    color: var(--color-text-dark);
}

/* Modal right side trends */
.tab-header-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.time-range-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--color-text-muted);
}

.chart-container-modal {
    background: var(--chart-container-bg);
    border: 1px solid var(--chart-container-border);
    border-radius: 10px;
    padding: 12px;
    height: 180px;
    width: 100%;
    transition: all 0.4s ease;
}

.chart-legend-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 10px;
    color: var(--color-text-muted);
    margin-top: 10px;
}

.two-col-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.metrics-minigrid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.minigrid-box {
    background: var(--subcard-bg);
    border: 1px solid var(--subcard-border);
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.4s ease;
}

.minigrid-box .val {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-main);
}

.minigrid-box .lbl {
    font-size: 8px;
    text-transform: uppercase;
    color: var(--color-text-dark);
    display: block;
    margin-top: 2px;
}

.progress-bar-minimal {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--color-text-muted);
}

/* 12. HELPER UTILITIES */
.margin-top-10 {
    margin-top: 10px;
}

.margin-top-15 {
    margin-top: 15px;
}

.margin-top-20 {
    margin-top: 20px;
}

.margin-top-25 {
    margin-top: 25px;
}

.margin-top-30 {
    margin-top: 30px;
}

.margin-top-40 {
    margin-top: 40px;
}

.width-100 {
    width: 100%;
}

.text-glow-cyan {
    text-shadow: 0 0 10px var(--color-cyan-glow);
}

.text-glow-red {
    text-shadow: 0 0 10px var(--color-red-glow);
}

/* Custom loading spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--subcard-border);
    border-radius: 50%;
    border-top-color: var(--color-cyan);
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

.empty-state,
.error-box {
    width: 100%;
    border: 1px solid var(--subcard-border);
    border-radius: 10px;
    background: var(--subcard-bg);
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: 13px;
    line-height: 1.5;
    padding: 18px 20px;
    text-align: center;
}

.error-box {
    border-color: rgba(255, 8, 68, 0.24);
    color: var(--color-red);
    background: rgba(255, 8, 68, 0.06);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    transition: background-color 0.4s ease;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
    transition: background-color 0.4s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-cyan-glow);
}

/* 13. STAGGERED ELEVATED ENTRANCE MOTION SYSTEM */
/* CSS cascades that animate layout grids sequentially */
.sector-cards-grid>* {
    opacity: 0;
    animation: fade-slide-up 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.sector-cards-grid>*:nth-child(1) {
    animation-delay: 0.04s;
}

.sector-cards-grid>*:nth-child(2) {
    animation-delay: 0.08s;
}

.sector-cards-grid>*:nth-child(3) {
    animation-delay: 0.12s;
}

.sector-cards-grid>*:nth-child(4) {
    animation-delay: 0.16s;
}

.sector-cards-grid>*:nth-child(5) {
    animation-delay: 0.20s;
}

.sector-cards-grid>*:nth-child(6) {
    animation-delay: 0.24s;
}

.sector-cards-grid>*:nth-child(7) {
    animation-delay: 0.28s;
}

.sector-cards-grid>*:nth-child(8) {
    animation-delay: 0.32s;
}

.sector-cards-grid>*:nth-child(9) {
    animation-delay: 0.36s;
}

.sector-cards-grid>*:nth-child(10) {
    animation-delay: 0.40s;
}

.sector-cards-grid>*:nth-child(11) {
    animation-delay: 0.44s;
}

.sector-cards-grid>*:nth-child(12) {
    animation-delay: 0.48s;
}

.dashboard-grid>* {
    opacity: 0;
    animation: fade-slide-up 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.dashboard-grid>*:nth-child(1) {
    animation-delay: 0.05s;
}

.dashboard-grid>*:nth-child(2) {
    animation-delay: 0.15s;
}

.dashboard-grid>*:nth-child(3) {
    animation-delay: 0.25s;
}

/* 14. RESPONSIVE BREAKDOWNS */
@media (max-width: 1024px) {

    .col-span-8,
    .col-span-4 {
        grid-column: span 12;
    }

    .dictionary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-stats {
        grid-template-columns: 1fr;
    }

    .app-glass-wrapper {
        padding: 15px;
        margin: 15px auto;
        border-radius: 15px;
    }

    .nav-container {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .theme-toggle-btn {
        width: 100%;
        border-radius: 15px;
    }

    .glass-navbar {
        width: 100%;
        justify-content: space-around;
        border-radius: 15px;
    }

    .nav-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .modal-body-layout {
        grid-template-columns: 1fr;
    }

    
}

/* ==========================================================================
   Phase 2 Interactive Styling upgrades: Logo Animations, Tooltips, & Modals
   ========================================================================== */

/* 1. SVG Logo Micro-Animations */
.logo-icon {
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.logo-area:hover .logo-icon {
    transform: rotate(3deg) scale(1.05);
}

.logo-shield {
    transition: stroke-width 0.3s ease, filter 0.3s ease;
}

.logo-area:hover .logo-shield {
    stroke-width: 4.5px;
    filter: drop-shadow(0 0 4px var(--color-cyan-glow));
}

.logo-node {
    transform-origin: center;
    transition: r 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), fill 0.3s ease;
}

.logo-area:hover .logo-node {
    r: 6.5px;
}

.node-pulse-1 {
    animation: logo-node-pulse 2s infinite ease-in-out;
}

.node-pulse-2 {
    animation: logo-node-pulse 2s infinite ease-in-out 0.6s;
}

.node-pulse-3 {
    animation: logo-node-pulse 2s infinite ease-in-out 1.2s;
}

@keyframes logo-node-pulse {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
        filter: drop-shadow(0 0 6px var(--color-cyan));
    }

    100% {
        transform: scale(1);
        opacity: 0.9;
    }
}

/* 2. Premium Frosted Glassmorphic Custom Tooltip */
.chart-tooltip {
    position: fixed;
    z-index: 2500;
    pointer-events: none;
    background: var(--modal-bg);
    border: 1px solid var(--modal-border);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--color-text-main);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35), 0 0 15px var(--color-cyan-glow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.15s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.1s ease-out;
    max-width: 280px;
    min-width: 180px;
    line-height: 1.4;
}

.chart-tooltip.active {
    opacity: 1;
    transform: translateY(0);
}

.chart-tooltip .tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 5px;
    margin-bottom: 6px;
    gap: 10px;
}

.chart-tooltip .tooltip-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 13px;
    color: var(--color-text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-tooltip .tooltip-code {
    font-family: var(--font-mono);
    font-size: 9px;
    background: var(--chip-bg);
    padding: 1px 5px;
    border-radius: 4px;
    color: var(--color-text-muted);
    font-weight: 700;
}

.chart-tooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.chart-tooltip .tooltip-label {
    color: var(--color-text-muted);
    font-size: 11px;
}

.chart-tooltip .tooltip-value {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 12px;
}

/* 3. Reusable Stats Modal Styles */
.stats-modal-large {
    max-width: 820px !important;
}

.stats-modal-desc {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.5;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.stats-modal-content-area {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
    margin-top: 10px;
    min-height: 0;
}

.modal-body-layout.flex-col {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-grow: 1;
    min-height: 0;
    gap: 12px;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.modal-search-wrapper {
    width: 100%;
}

/* Hover scales on chart elements to indicate tooltip interactivity */
.chart-bar-group {
    cursor: pointer;
}

.chart-bar-group rect {
    transition: fill-opacity 0.2s ease, filter 0.2s ease;
}

.chart-bar-group:hover rect {
    fill-opacity: 0.8;
    filter: brightness(1.2) drop-shadow(0 0 5px var(--color-cyan));
}

svg circle {
    transition: r 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.2s ease;
}

svg circle:hover {
    r: 8px !important;
    opacity: 1 !important;
}

.progress-bar-minimal {
    transition: transform 0.2s ease;
}

.progress-bar-minimal:hover {
    transform: translateX(4px);
}

.spin-icon {
    animation: spin 1.2s linear infinite;
}

/* Simulation overlay rules */
.simulation-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.simulation-loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Circular compute orbital */
.cascade-spinner {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--color-cyan);
    border-bottom-color: var(--color-purple);
    animation: spin 1.5s cubic-bezier(0.5, 0.2, 0.3, 0.8) infinite;
    margin: 0 auto 20px auto;
    position: relative;
}

.cascade-spinner::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-left-color: var(--color-orange);
    animation: spin-reverse 1s linear infinite;
}

@keyframes spin-reverse {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(-360deg);
    }
}

/* Scatter plot plot nodes staggered entrance animation */
@keyframes bubble-pop-in {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 0.75;
    }
}

.scatter-node-active {
    animation: bubble-pop-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Stagger list items in simulation impact list */
@keyframes row-fade-in {
    0% {
        transform: translateY(8px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.product-row-active {
    animation: row-fade-in 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

/* 15. GEOPOLITICAL SHOCK SIMULATOR METHODOLOGY HANDBOOK */

.methodology-section-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--color-text-main);
    margin-bottom: 12px;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.methodology-section-title::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 22px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--color-cyan), var(--color-purple));
    box-shadow: 0 0 12px var(--color-cyan-glow);
}

.card-desc {
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: 15px;
}

/* Multiplier styling */

/* Systemic Threat Grid inside Tab 4 */

/* Adaptive Responsiveness for Methodology elements */

/* ==========================================================================
   11. SECTOR DETAIL MODAL PRODUCT EXPLORER & TABS SYSTEM
   ========================================================================== */

/* Modal Tabs Navigation */
/* Four tabs no longer fit one line inside a 950px modal on every screen. The
   measured pill run is ~618px against a content width of min(0.9*vw, 950) - 60,
   so the bar stops fitting below a ~756px viewport. Without flex-wrap the
   buttons shrink to min-content and wrap their labels mid-pill, which also
   breaks the .active::after underline. And because .modal-tabs is an item of
   the .glass-modal COLUMN flex container, a wrapped second row would be
   flex-shrunk in HEIGHT and clipped by the modal's overflow:hidden — hence
   flex-shrink: 0. */
.modal-tabs {
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 0;
    max-width: 100%;
    gap: 10px;
    padding: 2px 5px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin: 0 0 14px 0;
    width: fit-content;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.03);
}

.modal-tab-btn {
    background: transparent;
    border: none;
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 9px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.modal-tab-btn:hover {
    color: var(--color-text-main);
    background: rgba(255, 255, 255, 0.03);
}

.modal-tab-btn.active {
    color: var(--color-cyan);
    background: rgba(0, 242, 254, 0.06);
    box-shadow: inset 0 1px 0 rgba(0, 242, 254, 0.1),
        0 4px 10px rgba(0, 242, 254, 0.05);
    text-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

.modal-tab-btn.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--color-cyan);
    border-radius: 4px;
    box-shadow: 0 0 8px var(--color-cyan);
}

/* Modal Tab Content Visibility */
.modal-tab-content {
    display: none;
    width: 100%;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
    /* The grouped Overview can exceed the modal height — scroll inside the tab
       instead of being clipped by the modal's overflow:hidden. */
    overflow-y: auto;
    padding-right: 4px;
}

.modal-tab-content.active {
    display: flex;
    animation: fadeInTab 0.35s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dynamic Filter Row */
.product-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 10px;
    box-shadow: var(--subcard-shadow);
}

.product-search-wrapper {
    position: relative;
    flex-grow: 1;
    min-width: 250px;
}

.product-search-wrapper .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--color-text-muted);
    pointer-events: none;
}

.product-search-input {
    width: 100%;
    padding: 9px 12px 9px 38px;
    font-family: var(--font-body);
    font-size: 12px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--input-text);
    outline: none;
    transition: all 0.3s ease;
}

.product-search-input::placeholder {
    color: var(--color-text-muted);
    opacity: 0.65;
}

.product-search-input:focus {
    border-color: rgba(0, 242, 254, 0.5);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.15),
        inset 0 1px 1px rgba(0, 0, 0, 0.1);
    background: var(--input-bg);
}

.product-select-filter {
    padding: 9px 12px;
    font-family: var(--font-body);
    font-size: 12px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--input-text);
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 170px;
}

.product-select-filter:focus {
    border-color: rgba(0, 242, 254, 0.5);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.15);
}

.product-select-filter option {
    background: var(--color-bg-deep);
    color: var(--color-text-main);
}

/* Scrollable Product Table Wrapper */
.product-table-wrapper {
    overflow-y: auto;
    overflow-x: hidden;
    flex-grow: 1;
    min-height: 0;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.05);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Elegant Custom Scrollbar styling */
.product-table-wrapper::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.product-table-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
}

.product-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0, 242, 254, 0.15);
    border-radius: 3px;
}

.product-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 242, 254, 0.3);
}

/* Table styling fixes */
.product-table-wrapper .glass-table {
    border: none;
    table-layout: fixed;
    width: 100%;
}

/* Tighter cells so 8 columns fit the modal width without horizontal scroll */
.product-table-wrapper .glass-table th,
.product-table-wrapper .glass-table td {
    padding: 9px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.product-table-wrapper .glass-table th { letter-spacing: 0.2px; }

/* Coherent column alignment: identifiers left, currency right (numbers align
   across rows), category/score badges centred. */
.product-table-wrapper .glass-table th:nth-child(3),
.product-table-wrapper .glass-table td:nth-child(3),   /* BEC */
.product-table-wrapper .glass-table th:nth-child(6),
.product-table-wrapper .glass-table td:nth-child(6),   /* HHI */
.product-table-wrapper .glass-table th:nth-child(7),
.product-table-wrapper .glass-table td:nth-child(7) {  /* Sectors */
    text-align: center;
}
.product-table-wrapper .glass-table th:nth-child(4),
.product-table-wrapper .glass-table td:nth-child(4),   /* Imports */
.product-table-wrapper .glass-table th:nth-child(5),
.product-table-wrapper .glass-table td:nth-child(5) {  /* Exports */
    text-align: right;
}

.product-table-wrapper .glass-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(25, 30, 42, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Translucent Glassmorphic Badge System */
.product-badge-bec {
    display: inline-block;
    padding: 3px 7px;
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    border-radius: 5px;
    text-align: center;
    border: 1px solid transparent;
}

/* BEC: Intermediate Input */
.product-badge-bec.bec-i {
    background: rgba(0, 242, 254, 0.06);
    border-color: rgba(0, 242, 254, 0.2);
    color: var(--color-cyan);
    text-shadow: 0 0 6px rgba(0, 242, 254, 0.25);
    box-shadow: 0 0 5px rgba(0, 242, 254, 0.03);
}

/* BEC: Capital Equipment */
.product-badge-bec.bec-k {
    background: rgba(127, 0, 255, 0.06);
    border-color: rgba(127, 0, 255, 0.2);
    color: var(--color-purple);
    text-shadow: 0 0 6px rgba(127, 0, 255, 0.25);
    box-shadow: 0 0 5px rgba(127, 0, 255, 0.03);
}

/* BEC: Consumer Goods */
.product-badge-bec.bec-c {
    background: rgba(243, 166, 59, 0.06);
    border-color: rgba(243, 166, 59, 0.2);
    color: var(--color-gold);
    text-shadow: 0 0 6px rgba(243, 166, 59, 0.25);
    box-shadow: 0 0 5px rgba(243, 166, 59, 0.03);
}

/* BEC: Other */
.product-badge-bec.bec-o {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--color-text-muted);
}

/* HHI Concentration Badges */

/* Light Theme Specific Contrast Enhancements for Modal Product Filters */
:root[data-theme="light"] .product-filters {
    background: rgba(0, 0, 0, 0.02) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

:root[data-theme="light"] .product-select-filter,
:root[data-theme="light"] .product-search-input {
    background: #ffffff !important;
    color: var(--color-text-main) !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

:root[data-theme="light"] .product-select-filter option {
    background: #ffffff !important;
    color: var(--color-text-main) !important;
}

:root[data-theme="light"] .product-select-filter:focus,
:root[data-theme="light"] .product-search-input:focus {
    border-color: var(--color-cyan) !important;
    box-shadow: 0 0 0 3px rgba(0, 142, 179, 0.12) !important;
}

/* Floating Compare Bar styling */
.floating-compare-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(12, 8, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    padding: 10px 22px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(0, 242, 254, 0.15);
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    pointer-events: none;
}

:root[data-theme="light"] .floating-compare-bar {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 15px 40px rgba(12, 8, 30, 0.12),
        0 0 0 1px rgba(0, 142, 179, 0.15);
}

.floating-compare-bar.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.compare-bar-content {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

:root[data-theme="light"] .compare-bar-content {
    color: var(--color-text-main);
}

.compare-bar-chips {
    display: flex;
    align-items: center;
    gap: 6px;
}

.compare-bar-chip {
    font-family: var(--font-mono);
    font-size: 10.5px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--color-cyan);
    font-weight: 700;
}

:root[data-theme="light"] .compare-bar-chip {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--color-cyan);
}

.btn-compare-action {
    background: var(--active-btn-bg);
    color: var(--color-cyan);
    border: 1px solid var(--active-btn-border);
    border-radius: 50px;
    padding: 8px 18px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 11.5px;
    cursor: pointer;
    box-shadow: var(--active-btn-shadow);
    text-shadow: 0 0 10px var(--color-cyan-glow);
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-compare-action:hover {
    transform: scale(1.03) translateY(-1px);
    box-shadow: 0 0 15px var(--color-cyan-glow), var(--active-btn-shadow);
    border-color: var(--color-cyan);
}

.btn-compare-clear {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 11px;
    cursor: pointer;
    font-weight: 600;
    transition: color 0.2s ease;
    padding: 4px 8px;
}

.btn-compare-clear:hover {
    color: var(--color-red);
}

/* Compare checkbox design inside cards */
.compare-checkbox-input {
    appearance: none;
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border: 1.5px solid var(--color-text-dark);
    border-radius: 4px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    vertical-align: middle;
}

.compare-checkbox-input:hover {
    border-color: var(--color-cyan);
    background: rgba(0, 242, 254, 0.05);
}

.compare-checkbox-input:checked {
    border-color: var(--color-cyan);
    background: rgba(0, 242, 254, 0.15);
}

.compare-checkbox-input:checked::after {
    content: "";
    width: 3.5px;
    height: 7px;
    border: solid var(--color-cyan);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    position: absolute;
    top: 1.5px;
}

/* Side-by-Side Comparison grid, column, and circular button */
.comparison-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.comparison-col {
    min-height: 500px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.circular-action-btn {
    background: var(--navbar-bg);
    border: 1px solid var(--navbar-border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-text-main);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.circular-action-btn:hover {
    background: var(--glass-bg-hover);
    transform: scale(1.05);
    border-color: var(--color-cyan);
    box-shadow: 0 0 12px var(--color-cyan-glow);
}

.circular-action-btn svg {
    color: var(--color-text-main);
    transition: transform 0.3s ease;
}

.circular-action-btn:hover svg {
    transform: rotate(180deg);
}

/* ==========================================================================
   TERTILE COLOR CODING (red / yellow / green vs. the all-sector distribution)
   Applied by app.js getTertileClass(): an indicator value in the riskiest
   third gets .tier-red, the middle third .tier-yellow, the safest third
   .tier-green. Unconfigured / neutral values get no class (default color).
   These live at the end of the sheet so they win source-order ties against
   element colors like .vuln-score-val / .all-ind-value.
   ========================================================================== */
.tier-red { color: var(--color-red); }
.tier-yellow { color: var(--color-amber); }
.tier-green { color: var(--color-green); }

/* Progress-bar fills colored by tertile (Import Dependency rows, resilience
   bars). The plain .tier-fill is the neutral fallback when no tertile applies. */
.bar-fill.tier-fill { background: var(--color-text-muted); box-shadow: none; }
.bar-fill.tier-fill.tier-green { background: var(--color-green); box-shadow: 0 0 8px var(--color-green-glow); }
.bar-fill.tier-fill.tier-yellow { background: var(--color-amber); box-shadow: 0 0 8px var(--color-amber-glow); }
.bar-fill.tier-fill.tier-red { background: var(--color-red); box-shadow: 0 0 8px var(--color-red-glow); }

/* Sector-card / comparison header indicator chips */
.card-chips {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 5px;
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 10px;
}

.indicator-chip {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    padding: 2px 6px;
    border-radius: 5px;
    white-space: nowrap;
    background: var(--chip-bg);
    border: 1px solid var(--subcard-border);
    color: var(--color-text-muted);
}

.indicator-chip.tier-green { color: var(--color-green); border-color: var(--color-green); background: var(--color-green-glow); }
.indicator-chip.tier-yellow { color: var(--color-amber); border-color: var(--color-amber); background: var(--color-amber-glow); }
.indicator-chip.tier-red { color: var(--color-red); border-color: var(--color-red); background: var(--color-red-glow); }
.indicator-chip.tier-cyan { color: var(--color-cyan); border-color: var(--color-cyan); background: var(--color-cyan-glow); }
.indicator-chip.tier-purple { color: var(--color-purple); border-color: var(--color-purple); background: var(--color-purple-glow); }
.indicator-chip.tier-amber { color: var(--color-amber); border-color: var(--color-amber); background: var(--color-amber-glow); }

/* Neutral chip for sectors with no reported import/trade indicators */
.indicator-chip.chip-nodata {
    color: var(--color-text-muted);
    font-weight: 600;
    font-style: italic;
    opacity: 0.85;
}

/* Intro line under a modal subcard heading */
.subcard-intro {
    font-size: 11px;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: -6px 0 14px;
}

/* ==========================================================================
   ALL INDICATORS modal page (every raw database field for a sector)
   ========================================================================== */
/* The tab is a flex child of the height-capped modal; let it scroll its own
   overflow so long catalogs aren't clipped. */
#modal-tab-all-indicators {
    overflow-y: auto;
    padding: 2px 8px 8px 2px;
}

#modal-tab-all-indicators::-webkit-scrollbar {
    width: 8px;
}

#modal-tab-all-indicators::-webkit-scrollbar-track {
    background: transparent;
}

#modal-tab-all-indicators::-webkit-scrollbar-thumb {
    background: var(--subcard-border);
    border-radius: 8px;
}

#modal-tab-all-indicators::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

.all-ind-header {
    margin-bottom: 4px;
}

.all-ind-note {
    font-size: 11.5px;
    color: var(--color-text-muted);
    line-height: 1.55;
    margin: 0;
}

.all-ind-group {
    margin-top: 20px;
}

.all-ind-group-title {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-main);
    border-bottom: 1px solid var(--subcard-border);
    padding-bottom: 6px;
    margin: 0 0 12px;
}

.all-ind-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 8px 18px;
}

.all-ind-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 6px 10px;
    background: var(--subcard-bg);
    border: 1px solid var(--subcard-border);
    border-radius: 8px;
}

.all-ind-label {
    font-size: 11.5px;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.all-ind-value {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-main);
    white-space: nowrap;
    flex-shrink: 0;
}

.all-ind-value.tier-green { color: var(--color-green); }
.all-ind-value.tier-yellow { color: var(--color-amber); }
.all-ind-value.tier-red { color: var(--color-red); }

/* --- Grouped Sector Overview (modal default tab) --- */
.overview-groups {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    align-items: start;
}
.ov-group { margin: 0; }
.ov-group h3 { margin-bottom: 10px; }
.ov-rows { display: flex; flex-direction: column; gap: 6px; }
.ov-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 7px 10px;
    background: var(--subcard-bg);
    border: 1px solid var(--subcard-border);
    border-radius: 8px;
}
.ov-label { font-size: 11.5px; color: var(--color-text-muted); line-height: 1.3; }
.ov-val {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-main);
    white-space: nowrap;
    flex-shrink: 0;
}
.ov-val.tier-green { color: var(--color-green); }
.ov-val.tier-yellow { color: var(--color-amber); }
.ov-val.tier-red { color: var(--color-red); }
.ov-caveat { color: var(--color-text-muted); cursor: help; font-size: 10px; }
.ov-pending { background: transparent; box-shadow: none; border-style: dashed; }

/* ==========================================================================
   SUPPLY NETWORK + SANKEY + TRADE-OFF (input-output flow pages, 2022)
   ========================================================================== */
/* --- Network graph --- */
.network-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin: 4px 0 10px;
    font-size: 10.5px;
    color: var(--color-text-muted);
    font-weight: 500;
}

.net-legend-item { display: inline-flex; align-items: center; gap: 5px; }

.net-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.net-legend-line {
    width: 16px;
    height: 3px;
    border-radius: 2px;
    display: inline-block;
    margin: 0 4px 0 6px;
}

.net-legend-size-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    display: inline-block;
    background: transparent;
    border: 1.5px solid var(--color-text-muted);
    box-shadow: inset 0 0 0 3px var(--color-text-muted);
}

.net-legend-line--dom { background: var(--color-cyan); }
.net-legend-line--out { background: var(--color-green); }

/* Upstreamness axis under the network */
.net-axis-lbl {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    fill: var(--color-text-muted);
}
.net-axis-lbl--mid { font-size: 10px; font-weight: 500; font-style: italic; opacity: 0.8; }

/* "+N more" hint under the side-panel lists */
.net-panel-more {
    font-size: 9.5px;
    color: var(--color-text-muted);
    font-style: italic;
    margin-top: 5px;
}

/* Marker for 2-digit division-aggregate values (indicator not collected at 4-digit) */
.agg-mark {
    font-size: 7.5px;
    font-weight: 700;
    color: var(--color-purple);
    background: var(--color-purple-glow);
    border-radius: 4px;
    padding: 1px 4px;
    margin-left: 4px;
    vertical-align: super;
    letter-spacing: 0.2px;
}

/* ---- Landing page (Overview tab) ---- */
.landing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin: 18px 0 22px;
}

.landing-block {
    background: var(--subcard-bg);
    border: 1px solid var(--subcard-border);
    border-radius: 14px;
    padding: 16px 18px;
}

.landing-block h4 {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--color-cyan);
    margin: 0 0 8px;
}

.landing-block p,
.landing-vintages { font-size: 12px; line-height: 1.65; color: var(--color-text-main); margin: 0; }

.landing-vintages { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.landing-vintages .nace-mono { margin-right: 6px; }

.landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.landing-feature {
    text-align: left;
    background: var(--navbar-bg);
    border: 1px solid var(--subcard-border);
    border-radius: 14px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    color: inherit;
}

.landing-feature:hover {
    border-color: var(--color-cyan);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.10), 0 0 12px var(--color-cyan-glow);
}

.landing-feature h5 {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 800;
    color: var(--color-text-main);
    margin: 0 0 6px;
}

.landing-feature h5::after { content: ' ↗'; color: var(--color-cyan); font-weight: 700; }

.landing-feature p { font-size: 11px; line-height: 1.55; color: var(--color-text-muted); margin: 0; }

/* Graph + side info panel side by side */
.network-stage {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 18px;
    align-items: start;
}

.network-graph-wrap {
    position: relative;
    width: 100%;
    max-width: 660px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The whole SVG is pointer-transparent: hover is resolved by nearest-node math
   on the wrap, so there is NO per-element hit-testing to race or flicker. */
.network-graph-wrap svg { overflow: visible; pointer-events: none; }

/* Ambient supply lines — gently flowing dashes, dimmed when a node is focused */
.net-faint {
    stroke-opacity: 0.5;
    stroke-dasharray: 3 7;
    animation: netFlow 2.8s linear infinite;
    transition: stroke-opacity 0.35s ease;
}
@keyframes netFlow { to { stroke-dashoffset: -20; } }
/* While exploring, the faint links are dimmed to 0.08 — pause their marching-ants
   flow too, so 60 continuous stroke repaints don't compete with interaction. */
.net-focusing .net-faint { stroke-opacity: 0.08; animation-play-state: paused; }

.net-hi-edge {
    stroke-opacity: 0.9;
    filter: drop-shadow(0 0 3px currentColor);
    animation: netHiIn 0.3s ease;
}
@keyframes netHiIn { from { stroke-opacity: 0; } to { stroke-opacity: 0.9; } }

/* faint category cluster labels behind the nodes */
.net-cat-label {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 1.5px;
    opacity: 0.13;
    transition: opacity 0.35s ease;
}
.net-focusing .net-cat-label { opacity: 0.06; }

/* Nodes */
.net-node:focus { outline: none; }

.net-ring {
    opacity: 0;
    stroke-width: 2;
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(1);
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.net-dot {
    fill-opacity: 0.9;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), fill-opacity 0.3s ease, filter 0.3s ease;
}

.net-code {
    font-family: 'Space Mono', monospace;
    font-size: 8.5px;
    font-weight: 700;
    fill: #fff;
    transition: opacity 0.3s ease;
}

/* spotlight states applied during focus mode */
.net-node.net-focus .net-dot {
    transform: scale(1.5);
    fill-opacity: 1;
    filter: drop-shadow(0 0 10px var(--cat, var(--color-cyan)));
}
.net-node.net-focus .net-ring { opacity: 0.55; transform: scale(1.95); }
.net-node.net-on .net-dot { transform: scale(1.18); fill-opacity: 1; }
.net-node.net-off .net-dot { fill-opacity: 0.14; }
.net-node.net-off .net-code { opacity: 0.1; }

/* sector-name labels shown on the focused node + its partners.
   Rendered above the nodes with a thick page-coloured halo so the text stays
   legible even where it crosses other nodes. */
.net-name-label {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    fill: var(--color-text-main);
    paint-order: stroke;
    stroke: var(--color-bg-deep);
    stroke-width: 4.5px;
    stroke-linejoin: round;
    animation: netHiIn 0.25s ease;
}
.net-name-label--focus { font-size: 13.5px; font-weight: 800; }

/* ---- side info panel ---- */
.network-panel {
    background: var(--subcard-bg);
    border: 1px solid var(--subcard-border);
    border-radius: 16px;
    padding: 16px 16px 18px;
    box-shadow: var(--subcard-shadow);
    /* Grow to fit the full hover read-out — no internal scroll cap, so the
       suppliers/customers lists are never clipped at the bottom. Sticky still
       keeps it in view while scrolling when it is shorter than the viewport. */
    position: sticky;
    top: 48px;
}

.net-panel-eyebrow {
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 700;
    color: var(--color-cyan);
}

.net-panel-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    color: var(--color-text-main);
    margin: 4px 0 0;
    line-height: 1.2;
}

.net-panel-intro { font-size: 11.5px; color: var(--color-text-muted); line-height: 1.55; margin: 8px 0 14px; }
.net-panel-code { font-family: var(--font-mono); font-size: 10.5px; color: var(--color-text-muted); margin-top: 3px; }

.net-cat-badge {
    display: inline-block;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--c);
    background: color-mix(in srgb, var(--c) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--c) 50%, transparent);
    padding: 2px 8px;
    border-radius: 20px;
}

.net-panel-head { border-bottom: 1px solid var(--subcard-border); padding-bottom: 12px; margin-bottom: 12px; }

.net-panel-kpis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
.net-kpi { background: var(--navbar-bg); border: 1px solid var(--subcard-border); border-radius: 10px; padding: 7px 9px; }
.net-kpi-val { display: block; font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--color-text-main); }
.net-kpi-lbl { display: block; font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--color-text-muted); font-weight: 600; margin-top: 2px; }

.net-panel-section { margin-top: 10px; }
.net-panel-sub {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}
.net-panel-sub span { font-weight: 500; text-transform: none; opacity: 0.8; }
.net-panel-sub--sup { color: var(--color-cyan); }
.net-panel-sub--cust { color: var(--color-green); }

.net-panel-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.net-panel-list li { display: flex; align-items: center; gap: 7px; font-size: 11px; }
.net-li-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.net-li-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-text-main); }
.net-li-val { font-family: var(--font-mono); font-weight: 700; color: var(--color-text-muted); flex-shrink: 0; }
.net-li-imp { font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; flex-shrink: 0; }
.net-li-empty { color: var(--color-text-muted); }

@media (max-width: 960px) {
    .network-stage { grid-template-columns: 1fr; }
    .network-panel { max-height: none; position: static; }
}

/* --- Sankey detail panel --- */
.network-detail-head {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.network-detail-head h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    color: var(--color-text-main);
    margin: 0;
    flex: 1 1 auto;
}

.sankey-mode-toggle {
    display: inline-flex;
    background: var(--chip-bg);
    border: 1px solid var(--subcard-border);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

.sankey-mode-toggle button {
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sankey-mode-toggle button.active {
    background: var(--color-cyan);
    color: #fff;
    box-shadow: 0 0 10px var(--color-cyan-glow);
}

/* Network-Insights sector/product view switch — same pill style as the toggle. */
.tradeoff-view-toggle {
    display: inline-flex;
    background: var(--chip-bg);
    border: 1px solid var(--subcard-border);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
.tradeoff-view-toggle button {
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tradeoff-view-toggle button.active {
    background: var(--color-cyan);
    color: #fff;
    box-shadow: 0 0 10px var(--color-cyan-glow);
}

.sankey-kpis,
.tradeoff-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.sankey-kpi,
.tradeoff-kpi {
    flex: 1 1 120px;
    background: var(--subcard-bg);
    border: 1px solid var(--subcard-border);
    border-radius: 12px;
    padding: 10px 12px;
    text-align: center;
}

.sankey-kpi-val,
.tradeoff-kpi-val {
    display: block;
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-main);
}

.sankey-kpi-lbl,
.tradeoff-kpi-lbl {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-text-muted);
    font-weight: 600;
    margin-top: 3px;
}

.sankey-wrap {
    width: 100%;
    overflow-x: auto;
}

.sankey-wrap svg { min-width: 720px; }
.network-detail { animation: fadeInTab 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* Sankey elements are animated by a JS tween (positions/sizes); only the ribbon
   colour cross-fades via CSS when the domestic/import mode changes. */
.sankey-rib { transition: fill 0.4s ease; }
.sankey-lbl { font-family: var(--font-heading); font-size: 10.5px; fill: var(--color-text-main); }
.sankey-lbl-val { font-family: 'Space Mono', monospace; font-size: 9px; fill: var(--color-text-muted); }
.sankey-center-lbl { font-family: var(--font-heading); font-size: 13px; font-weight: 800; fill: var(--color-text-main); }
.sankey-hdr { font-family: var(--font-heading); font-size: 11px; font-weight: 700; fill: var(--color-text-muted); }

/* The centre node is a button: click it to open the sector's Trade-off page */
.sankey-center-hit { cursor: pointer; }
.sankey-center { transition: filter 0.2s ease; }
.sankey-center:hover { filter: drop-shadow(0 0 7px var(--color-cyan-glow)); }
.sankey-center-cta {
    font-family: var(--font-heading);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3px;
    fill: var(--color-cyan);
}
.sankey-center-cta:hover { text-decoration: underline; }

/* Supplier / customer list items are buttons: click to open that sector's Sankey (#1) */
.sankey-jump { cursor: pointer; transition: fill 0.15s ease, filter 0.15s ease; }
text.sankey-jump:hover { fill: var(--color-cyan); text-decoration: underline; }
rect.sankey-jump:hover { filter: drop-shadow(0 0 5px var(--color-cyan-glow)); }

/* Sankey colour-scheme legend */
.sankey-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 22px;
    margin-bottom: 12px;
    font-size: 10.5px;
    color: var(--color-text-muted);
}
.sankey-legend-grp { display: inline-flex; align-items: center; gap: 12px; }
.sankey-legend-lbl {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 9.5px;
    color: var(--color-text-main);
}
.sankey-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.sankey-legend-sw { width: 14px; height: 8px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.sankey-legend-note { flex: 1 1 100%; font-size: 9.5px; font-style: italic; opacity: 0.85; line-height: 1.45; margin: 0; }

/* --- Trade-off page --- */
/* Upstream and downstream sit side by side. To fit two-up without truncation
   or a horizontal scrollbar, the long column HEADERS and the sector-NAME cell
   are allowed to wrap onto a second line, while every numeric cell stays on a
   single line. The name column takes the slack (table-layout:auto), so nothing
   is ever clipped with an ellipsis. */
.tradeoff-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* Product view shows a single (downstream-only) table — let it span full width. */
.tradeoff-grid.tradeoff-grid--single { grid-template-columns: 1fr; }

.tradeoff-header-card { margin-bottom: 0; }

.tradeoff-tbl { width: 100%; table-layout: auto; }

/* Numeric / code cells never wrap; headers may. */
.tradeoff-tbl td { white-space: nowrap; }
.tradeoff-tbl th {
    white-space: normal;
    line-height: 1.25;
    vertical-align: bottom;
    word-break: normal;
    overflow-wrap: anywhere;
}

/* Sector name: wrap to at most two lines (clamped, with a tooltip for the
   full label) and absorb the table's spare width. */
.tradeoff-tbl td:nth-child(2) {
    white-space: normal;
    line-height: 1.3;
    min-width: 130px;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* On narrow screens the two tables stack so each gets the full width. */
@media (max-width: 1024px) {
    .tradeoff-grid { grid-template-columns: 1fr; }
}
/* year-sourced (most recent available year) value marker */
.agg-mark--yr { color: var(--color-cyan); background: var(--color-cyan-glow); }

/* Caveat note above the per-sector product bottleneck table */
.product-mapping-note {
    font-size: 11px;
    line-height: 1.45;
    color: var(--color-text-muted);
    background: var(--subcard-bg);
    border: 1px solid var(--subcard-border);
    border-radius: 8px;
    padding: 7px 12px;
    margin: 0 0 10px;
}

/* #2 — sector-card indicator picker pills */
.card-indicator-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--subcard-border);
}
.card-indicator-picker .picker-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-right: 2px;
}
.picker-pill {
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--navbar-bg);
    border: 1px solid var(--subcard-border);
    border-radius: 999px;
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.18s ease;
}
.picker-pill:hover { border-color: var(--color-cyan); color: var(--color-text-main); }
.picker-pill.is-on {
    color: var(--color-bg-deep);
    background: var(--color-cyan);
    border-color: var(--color-cyan);
    box-shadow: 0 0 10px var(--color-cyan-glow);
}

/* ==========================================================================
   PRODUCT TABS — EXPORT TABLE, RCA BANDS, DATA-QUALITY MARKS
   ========================================================================== */

/* The Export-products table reuses .product-table-wrapper but carries a
   different column order, so it overrides the alignment rules above. Two
   classes on the wrapper beat one, so these win outright rather than relying
   on source order.
   1 HS6 | 2 Description | 3 End use | 4 Exports total | 5 RCA | 6 Share EU |
   7 Extra-EU HHI | 8 Top destination
   (The INPUT table needs no override: its column 7 changed from Sectors to
   World market HHI, and both are centred.) */
.product-table-wrapper.export-table-wrapper .glass-table th:nth-child(3),
.product-table-wrapper.export-table-wrapper .glass-table td:nth-child(3),   /* End use      */
.product-table-wrapper.export-table-wrapper .glass-table th:nth-child(5),
.product-table-wrapper.export-table-wrapper .glass-table td:nth-child(5),   /* RCA          */
.product-table-wrapper.export-table-wrapper .glass-table th:nth-child(7),
.product-table-wrapper.export-table-wrapper .glass-table td:nth-child(7) {  /* Extra-EU HHI */
    text-align: center;
}
.product-table-wrapper.export-table-wrapper .glass-table th:nth-child(4),
.product-table-wrapper.export-table-wrapper .glass-table td:nth-child(4),   /* Exports total */
.product-table-wrapper.export-table-wrapper .glass-table th:nth-child(6),
.product-table-wrapper.export-table-wrapper .glass-table td:nth-child(6) {  /* Share EU      */
    text-align: right;
}
.product-table-wrapper.export-table-wrapper .glass-table th:nth-child(8),
.product-table-wrapper.export-table-wrapper .glass-table td:nth-child(8) {  /* Destination   */
    text-align: left;
}

/* RCA is a ratio centred on 1, not a risk score, so it gets its own four-step
   ramp on the neutral cyan/purple accents — never the red/yellow/green tiers,
   where red always means "the risky end" in this dashboard. Cut points are the
   standard Hinloopen & van Marrewijk (2001) RCA classes (<=1 / <=2 / <=4 / >4);
   over the 4,874 rows this tab can show they split 56.2 / 24.4 / 16.1 / 3.3 %
   of rows and 19.0 / 35.3 / 38.0 / 7.6 % of export value. */
.indicator-chip.rca-chip { font-size: 10px; cursor: help; }
.indicator-chip.rca-0 {
    color: var(--color-text-muted);
    border-color: var(--subcard-border);
    background: var(--chip-bg);
}
.indicator-chip.rca-1 {
    color: var(--color-cyan);
    border-color: color-mix(in srgb, var(--color-cyan) 45%, transparent);
    background: var(--color-cyan-glow);
}
.indicator-chip.rca-2 {
    color: var(--color-purple);
    border-color: color-mix(in srgb, var(--color-purple) 55%, transparent);
    background: var(--color-purple-glow);
}
.indicator-chip.rca-3 {
    color: var(--color-purple);
    border-color: var(--color-purple);
    background: color-mix(in srgb, var(--color-purple) 18%, transparent);
    box-shadow: 0 0 8px var(--color-purple-glow);
}

/* "EU only": a STRUCTURAL zero, not a missing value. Dashed border so it reads
   as "this quantity does not exist for this row" and never as a measurement —
   .chip-nodata (solid) stays reserved for genuinely absent measurements. */
.export-eu-only {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    padding: 2px 6px;
    border-radius: 5px;
    white-space: nowrap;
    color: var(--color-cyan);
    border: 1px dashed color-mix(in srgb, var(--color-cyan) 45%, transparent);
    background: transparent;
    cursor: help;
}

/* --------------------------------------------------------------------------
   PER-ROW DATA-QUALITY MARK
   One 14px amber glyph in the code cell of both product tabs, drawn on the
   ~1.1% of rendered input rows and ~1.5% of export rows whose source values
   carry a known, named defect (see DQ_DEFECTS in app.js). Amber not red: the
   row is suspect, not wrong. A "!" not a "⚠": the latter renders as a
   full-colour emoji on Windows and would out-shout every indicator chip in the
   table. Uses only existing tokens, so it follows the theme with no extra rules.
   -------------------------------------------------------------------------- */
.dq-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin-left: 5px;
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1;
    color: var(--color-amber);
    background: var(--color-amber-glow);
    border: 1px solid var(--color-amber);
    border-radius: 4px;
    cursor: help;
    user-select: none;
    opacity: 0.75;
    transition: opacity 0.16s ease, box-shadow 0.16s ease;
}
.dq-flag:hover,
.dq-flag:focus-visible {
    opacity: 1;
    box-shadow: 0 0 8px var(--color-amber-glow);
    outline: none;
}
.glass-table tr:hover .dq-flag { opacity: 1; }

/* The code cell is nowrap + text-overflow: ellipsis. Without this wrapper the
   MARK is what gets clipped when the column is a pixel short — the worst
   possible failure. The wrapper makes the code truncate and the mark survive.
   (Column 1 also went 10% -> 11% on the input tab for the same reason.) */
.dq-cell {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
}
.dq-cell > .nace-mono {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Per-sector data-quality summary, under the tab note. Amber-keyed so it does
   not read as one paragraph with the neutral .product-mapping-note above it. */
.product-dq-note {
    font-size: 10.5px;
    line-height: 1.5;
    color: var(--color-text-muted);
    background: color-mix(in srgb, var(--color-amber) 7%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-amber) 26%, transparent);
    border-radius: 8px;
    padding: 7px 12px;
    margin: 0 0 10px;
}
.product-dq-note strong { color: var(--color-amber); font-weight: 700; }
.product-dq-note ul { margin: 4px 0 0; padding-left: 18px; }
.product-dq-note li { margin: 1px 0; }
.product-dq-note .dq-flag { cursor: default; vertical-align: -2px; }

/* Sector-level mapping caveat: shown when the correspondence is measurably
   wrong for this sector. Neutral body, amber rule — it is a statement about
   the correspondence, not about any one row. */
.product-map-caveat {
    font-size: 10.5px;
    line-height: 1.5;
    color: var(--color-text-muted);
    border-left: 2px solid var(--color-amber);
    padding: 2px 0 2px 10px;
    margin: 0 0 10px;
}
.product-map-caveat strong { color: var(--color-text-main); font-weight: 700; }

/* Per-sector coverage line: what the basket reconciles to, what the filters
   currently hide, and what the correspondence never reached. */
.product-coverage-note {
    font-size: 10.5px;
    line-height: 1.5;
    color: var(--color-text-muted);
    margin: 0 0 10px;
}
.product-coverage-note strong { color: var(--color-text-main); font-weight: 700; }
