/* ============================================
   PHYLAS RESEARCH DASHBOARD - Tactical Dark Theme v4.1
   Premium glassmorphism + refined depth
   RESPONSIVE - rem-based with clamp()
   ============================================ */

/* --- CSS Variables --- */
:root {
    --bg-primary: #050609;
    --bg-secondary: #0a0e15;
    --bg-surface: #111820;
    --bg-elevated: #1a222f;
    --bg-glass: rgba(10, 14, 21, 0.88);
    --border-color: rgba(30, 39, 54, 0.7);
    --border-subtle: rgba(20, 25, 35, 0.8);
    --border-accent: rgba(6, 214, 160, 0.12);
    --text-primary: #e8edf5;
    --text-secondary: #99a4b8;
    --text-dim: #7a8598;
    --text-muted: #566378;
    --accent: #06d6a0;
    --accent-bright: #2dffce;
    --accent-dim: #04a87d;
    --accent-glow: rgba(6, 214, 160, 0.3);
    --accent-subtle: rgba(6, 214, 160, 0.08);
    --accent-gradient: linear-gradient(135deg, #06d6a0 0%, #00f5d4 100%);
    --danger: #ff5555;
    --danger-dim: #dc2626;
    --warning: #ffb84d;
    --success: #27d39f;
    --info: #3b82f6;
    --purple: #8b5cf6;
    --pink: #ec4899;
    --flight-color: #38bdf8;
    --ship-color: #06d6a0;
    --space-color: #a78bfa;
    --radio-color: #e879f9;
    --cable-color: #fbbf24;
    --mesh-color: #f472b6;
    --quake-color: #ef4444;
    --weather-color: #f59e0b;
    --ship-cargo-color: #fb923c;
    --ship-tanker-color: #c084fc;
    --ship-passenger-color: #fde047;
    --ship-fishing-color: #2dd4bf;
    --ship-military-color: #94a3b8;
    --sidebar-width: clamp(14rem, 18vw, 20rem);
    --sidebar-collapsed: 3rem;
    --topbar-height: clamp(2.5rem, 3.5vh, 3.5rem);
    --ticker-height: clamp(1.75rem, 2.5vh, 2.5rem);
    --ticker-total-height: calc(var(--ticker-height) * 2);
    --radius-sm: 0.545rem;
    --radius-md: 0.909rem;
    --radius-lg: 1.273rem;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.5);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.55);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.65);
    --shadow-glow: 0 0 20px var(--accent-glow);
    --transition-fast: 120ms cubic-bezier(0.23, 1, 0.32, 1);
    --transition-normal: 220ms cubic-bezier(0.23, 1, 0.32, 1);
    --transition-slow: 380ms cubic-bezier(0.23, 1, 0.32, 1);
    --font-mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-data: 'JetBrains Mono', 'Fira Code', monospace;

    /* ============================================
       v4.1 — Design System Tokens
       ============================================ */

    /* Typography scale — 7 levels */
    --fs-xs:  0.7rem;     /* captions, units, timestamps */
    --fs-sm:  0.8rem;     /* small meta, symbols secondary */
    --fs-md:  0.875rem;   /* body secondary */
    --fs-body: 1rem;      /* body default */
    --fs-lg:  1.1rem;     /* emphasized body, prices */
    --fs-xl:  1.3rem;     /* section subtitles */
    --fs-2xl: 1.6rem;     /* modal titles */
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semi: 600;
    --fw-bold: 700;
    --ls-label: 0.11rem;
    --ls-uber:  0.18rem;

    /* Tier accents — 3 pillars (Intel / Signals / Sensors) */
    --tier-intel-color:  #fbbf24;                    /* gold */
    --tier-intel-glow:   rgba(251, 191, 36, 0.18);
    --tier-signal-color: #a78bfa;                    /* purple */
    --tier-signal-glow:  rgba(167, 139, 250, 0.18);
    --tier-sensor-color: #22d3ee;                    /* cyan */
    --tier-sensor-glow:  rgba(34, 211, 238, 0.18);

    /* Markets / trading */
    --markets-ticker-height: 2.85rem;
    --color-bull: #22d3a0;
    --color-bear: #ff6b6b;
    --color-flat: #99a4b8;
    --bull-tint: rgba(34, 211, 160, 0.05);
    --bear-tint: rgba(255, 107, 107, 0.05);
    --markets-glow: rgba(34, 211, 160, 0.18);
    --markets-label: var(--tier-intel-color);

    /* Chokepoints risk palette */
    --risk-low: #22d3a0;
    --risk-medium: #fbbf24;
    --risk-high: #fb923c;
    --risk-extreme: #ef4444;
    --chokepoint-fill-opacity: 0.20;
    --chokepoint-border-opacity: 0.75;

    /* Correlation overlay */
    --overlay-bg: rgba(10, 14, 21, 0.96);
    --overlay-border: rgba(251, 191, 36, 0.4);
    --overlay-glow: 0 0 32px rgba(251, 191, 36, 0.20), 0 12px 32px rgba(0, 0, 0, 0.6);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: clamp(9px, 0.35vw + 4px, 12px);
}

body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.55;
    letter-spacing: 0.014rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

::-webkit-scrollbar { width: 0.455rem; height: 0.455rem; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(90, 101, 120, 0.3); border-radius: 0.273rem; }
::-webkit-scrollbar-thumb:hover { background: rgba(90, 101, 120, 0.5); }

a { color: var(--accent); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-bright); }

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-0.545rem); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-0.727rem); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--success), inset 0 0 4px var(--success); }
    50% { opacity: 0.35; box-shadow: 0 0 14px var(--success), inset 0 0 2px var(--success); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes quakePulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.4; }
}

/* --- Skeleton Loader --- */
.skeleton {
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-elevated) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

/* --- Map Container --- */
#map {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    background: #000;
}

/* --- Top Bar (premium glass) --- */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-height);
    background: linear-gradient(180deg, rgba(5, 6, 9, 0.96) 0%, rgba(8, 12, 20, 0.92) 100%);
    backdrop-filter: blur(1.5rem);
    border-bottom: 1px solid var(--border-accent);
    display: flex;
    align-items: center;
    padding: 0 1.455rem;
    z-index: 1000;
    gap: 1.091rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 0.909rem;
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--accent);
    letter-spacing: 0.136rem;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all var(--transition-normal);
}

.topbar-logo:hover {
    text-shadow: 0 0 16px rgba(6, 214, 160, 0.4);
}

.topbar-logo svg {
    width: 3.273rem;
    height: 3.273rem;
    fill: var(--accent);
    filter: drop-shadow(0 0 8px rgba(6, 214, 160, 0.35));
}

.topbar-divider {
    width: 1px;
    height: 2rem;
    background: linear-gradient(180deg, transparent, var(--border-color), transparent);
    flex-shrink: 0;
}

/* --- Regional Presets --- */
.regional-presets {
    display: flex;
    align-items: center;
    gap: 0.273rem;
    flex-shrink: 0;
}

.preset-btn {
    padding: 0.909rem 1.818rem;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.091rem;
    text-transform: uppercase;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.preset-btn:hover {
    color: var(--accent);
    background: var(--accent-subtle);
    border-color: rgba(6, 214, 160, 0.2);
}

.preset-btn.active {
    color: var(--bg-primary);
    background: var(--accent-gradient);
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(6, 214, 160, 0.35);
    font-weight: 700;
}

/* --- Search Bar --- */
.search-container {
    flex: 1;
    max-width: 36.364rem;
    position: relative;
}

#search-bar {
    width: 100%;
    height: 2.5rem;
    background: rgba(17, 24, 32, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 1.091rem 0 3.091rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: all var(--transition-normal);
    outline: none;
    backdrop-filter: blur(0.364rem);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
}

#search-bar::placeholder { color: var(--text-dim); font-size: 1rem; }
#search-bar:focus {
    border-color: rgba(6, 214, 160, 0.45);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25), 0 0 0 3px rgba(6, 214, 160, 0.12);
    background: rgba(17, 24, 32, 0.85);
}

.search-icon {
    position: absolute;
    left: 0.909rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    opacity: 0.5;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

#search-bar:focus ~ .search-icon { opacity: 1; }

.search-shortcut {
    position: absolute;
    right: 0.727rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 0.818rem;
    color: var(--text-muted);
    background: rgba(26, 34, 47, 0.7);
    padding: 0.182rem 0.545rem;
    border-radius: 0.364rem;
    border: 1px solid var(--border-color);
    pointer-events: none;
}

#search-dropdown {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: rgba(10, 14, 22, 0.96);
    border: 1px solid var(--border-accent);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 29.091rem;
    overflow-y: auto;
    display: none;
    z-index: 1001;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(1rem);
}

.search-item {
    padding: 0.727rem 1.091rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.727rem;
    font-size: 1rem;
    border-bottom: 1px solid rgba(30, 39, 54, 0.4);
    transition: all var(--transition-fast);
}

.search-item:hover {
    background: var(--accent-subtle);
    padding-left: 1.455rem;
}
.search-item:last-child { border-bottom: none; }

.search-item-type {
    font-size: 0.727rem;
    font-family: var(--font-mono);
    padding: 0.182rem 0.545rem;
    border-radius: 0.364rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.045rem;
}

/* --- Top Bar Controls --- */
.topbar-controls {
    display: flex;
    align-items: center;
    gap: 0.364rem;
    margin-left: auto;
    flex-shrink: 0;
}

.topbar-btn {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 2.182rem;
    flex-shrink: 0;
    position: relative;
}

.topbar-btn:hover {
    background: var(--accent-subtle);
    border-color: rgba(6, 214, 160, 0.15);
    color: var(--accent);
}

.topbar-btn.active {
    background: rgba(6, 214, 160, 0.15);
    color: var(--accent);
    border-color: rgba(6, 214, 160, 0.3);
    box-shadow: 0 0 12px rgba(6, 214, 160, 0.15);
}

/* --- Status Indicator (LIVE) --- */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.909rem;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: 0.091rem;
    text-transform: uppercase;
    flex-shrink: 0;
    padding: 0.364rem 0.909rem;
    border-radius: var(--radius-sm);
    background: rgba(39, 211, 159, 0.06);
    border: 1px solid rgba(39, 211, 159, 0.18);
}

.status-dot {
    width: 0.545rem;
    height: 0.545rem;
    border-radius: 50%;
    background: var(--success);
    animation: pulseGlow 2s ease-in-out infinite;
}

/* --- Sidebar Section Count --- */
.entity-count {
    font-family: var(--font-data);
    font-size: 0.818rem;
    color: var(--text-dim);
    margin-left: 0.182rem;
}

/* --- Sidebar (glass panel) --- */
.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: var(--ticker-total-height);
    width: var(--sidebar-width);
    background: linear-gradient(180deg, rgba(8, 12, 20, 0.97) 0%, rgba(5, 8, 15, 0.95) 100%);
    backdrop-filter: blur(1.5rem);
    border-right: 1px solid var(--border-accent);
    z-index: 500;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal), transform var(--transition-normal);
    overflow: hidden;
    box-shadow: 4px 0 28px rgba(0, 0, 0, 0.3);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .sidebar-content,
.sidebar.collapsed .sidebar-section-title span,
.sidebar.collapsed .toggle-label,
.sidebar.collapsed .folder-content,
.sidebar.collapsed .sidebar-footer { display: none; }

.sidebar-toggle-btn {
    position: absolute;
    right: -1.182rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.364rem;
    height: 2.364rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-accent);
    border-radius: 50%;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 501;
    transition: all var(--transition-normal);
    font-size: 0.909rem;
    box-shadow: var(--shadow-sm);
}

.sidebar-toggle-btn:hover {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(6, 214, 160, 0.4);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.545rem 0.727rem;
}

/* --- Sidebar Sections (elevated cards) --- */
.sidebar-section {
    margin-bottom: 0.364rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    border-left: 3px solid transparent;
    background: transparent;
    transition: all var(--transition-normal);
}

.sidebar-section:hover {
    background: rgba(255, 255, 255, 0.015);
}

.sidebar-section.open {
    border-left-color: var(--accent);
    background: rgba(6, 214, 160, 0.04);
    border-color: rgba(6, 214, 160, 0.1);
    border-left-width: 3px;
    box-shadow: inset 0 0 20px rgba(6, 214, 160, 0.04);
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.727rem 0.909rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    user-select: none;
}

.sidebar-section-header:hover { background: rgba(6, 214, 160, 0.06); }

.sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 0.636rem;
    font-family: var(--font-mono);
    font-size: 0.909rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.109rem;
    color: var(--text-secondary);
    transition: color var(--transition-normal);
}

.sidebar-section.open .sidebar-section-title { color: var(--accent); }

.sidebar-section-title .icon {
    font-size: 1.273rem;
    width: 1.636rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-section-title .icon svg {
    stroke: currentColor;
    flex-shrink: 0;
}

.sidebar-section-chevron {
    font-size: 0.818rem;
    color: var(--text-dim);
    transition: transform var(--transition-normal);
}

.sidebar-section.open .sidebar-section-chevron {
    transform: rotate(90deg);
}

.folder-content {
    display: none;
    padding: 0.182rem 0 0.545rem 1.091rem;
    animation: fadeIn var(--transition-normal);
}

.sidebar-section.open .folder-content { display: block; }

/* --- Toggle Switches (refined) --- */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.455rem 0.909rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.toggle-row:hover { background: rgba(6, 214, 160, 0.05); }

.toggle-label {
    font-size: 1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.455rem;
}

.toggle-count {
    font-family: var(--font-data);
    font-size: 0.818rem;
    color: rgba(6, 214, 160, 0.6);
    background: var(--accent-subtle);
    padding: 0.091rem 0.545rem;
    border-radius: 0.727rem;
    font-weight: 600;
}

/* Enhanced toggle switch */
.switch {
    position: relative;
    width: 2.909rem;
    height: 1.636rem;
    flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(26, 34, 47, 0.9), rgba(17, 24, 32, 0.9));
    border-radius: 0.909rem;
    transition: all var(--transition-normal);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.slider::before {
    content: '';
    position: absolute;
    width: 1.273rem;
    height: 1.273rem;
    left: 2px;
    bottom: 2px;
    background: var(--text-dim);
    border-radius: 50%;
    transition: all var(--transition-normal);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.switch input:checked + .slider {
    background: var(--accent-gradient);
    box-shadow: 0 0 14px rgba(6, 214, 160, 0.35), inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

.switch input:checked + .slider::before {
    transform: translateX(1.273rem);
    background: #fff;
    box-shadow: 0 2px 8px rgba(6, 214, 160, 0.5);
}

/* --- Freshness Indicators --- */
.freshness-dot {
    width: 0.455rem;
    height: 0.455rem;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 0 4px currentColor;
}
.freshness-fresh { background: var(--success); color: var(--success); }
.freshness-stale { background: var(--warning); color: var(--warning); }
.freshness-old { background: var(--danger); color: var(--danger); }

/* --- Inline Badge Count --- */
.inline-badge {
    font-family: var(--font-data);
    font-size: 0.818rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-subtle);
    padding: 0.182rem 0.636rem;
    border-radius: 0.909rem;
    letter-spacing: 0.027rem;
    border: 1px solid rgba(6, 214, 160, 0.12);
}

/* --- Filters --- */
.filter-group {
    padding: 0.364rem 0.727rem;
}

.filter-title {
    font-family: var(--font-mono);
    font-size: 0.818rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.091rem;
    color: var(--text-dim);
    margin-bottom: 0.364rem;
}

.filter-checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.636rem;
    padding: 0.273rem 0;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
}

.filter-checkbox-row:hover {
    background: rgba(6, 214, 160, 0.04);
    padding-left: 0.364rem;
}

.filter-checkbox-row input[type="checkbox"] {
    appearance: none;
    width: 1.273rem;
    height: 1.273rem;
    border: 1.5px solid rgba(6, 214, 160, 0.25);
    border-radius: 0.273rem;
    background: rgba(17, 24, 32, 0.8);
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.filter-checkbox-row input[type="checkbox"]:hover {
    border-color: rgba(6, 214, 160, 0.5);
}

.filter-checkbox-row input[type="checkbox"]:checked {
    background: var(--accent-gradient);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(6, 214, 160, 0.35);
}

.filter-checkbox-row input[type="checkbox"]:checked::after {
    content: '\2713';
    display: block;
    text-align: center;
    font-size: 0.909rem;
    color: var(--bg-primary);
    line-height: 1.182rem;
    font-weight: 700;
}

.filter-checkbox-label {
    font-size: 0.909rem;
    color: var(--text-secondary);
}

/* --- Slider Controls --- */
.slider-control {
    padding: 0.545rem 0.727rem;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.364rem;
}

.slider-title {
    font-family: var(--font-mono);
    font-size: 0.818rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.091rem;
    color: var(--text-dim);
}

.slider-value {
    font-family: var(--font-data);
    font-size: 0.909rem;
    color: var(--accent);
    text-shadow: 0 0 8px rgba(6, 214, 160, 0.3);
}

input[type="range"] {
    width: 100%;
    height: 0.364rem;
    appearance: none;
    background: var(--bg-elevated);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 1.273rem;
    height: 1.273rem;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 0 6px rgba(6, 214, 160, 0.3);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 12px rgba(6, 214, 160, 0.5);
}

/* --- Status Box --- */
#status-box {
    position: fixed;
    top: calc(var(--topbar-height) + 0.909rem);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 14, 22, 0.9);
    backdrop-filter: blur(1rem);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    padding: 0.727rem 1.636rem;
    z-index: 900;
    display: none;
    font-family: var(--font-mono);
    font-size: 1rem;
    box-shadow: var(--shadow-md), 0 0 24px rgba(6, 214, 160, 0.1);
    animation: fadeIn var(--transition-normal);
}

#loading-text { color: var(--text-secondary); }
.text-dim { color: var(--text-dim); }
.text-red { color: var(--danger); }
.text-green { color: var(--success); }

/* --- Console / Log --- */
.console-wrapper {
    position: fixed;
    bottom: calc(var(--ticker-total-height) + 0.727rem);
    right: 0.909rem;
    width: 34.545rem;
    max-height: 20rem;
    background: rgba(5, 6, 9, 0.97);
    backdrop-filter: blur(0.75rem);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    z-index: 800;
    display: none;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    resize: both;
    overflow: hidden;
    min-width: 22.727rem;
    min-height: 10.909rem;
}

.console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.364rem 1.091rem;
    background: rgba(17, 24, 32, 0.6);
    border-bottom: 1px solid var(--border-subtle);
    min-height: 2.364rem;
}

.console-title {
    font-family: var(--font-mono);
    font-size: 0.818rem;
    font-weight: 600;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 0.545rem;
    text-transform: uppercase;
    letter-spacing: 0.091rem;
}

.console-output {
    flex: 1;
    overflow-y: auto;
    padding: 0.545rem 1.091rem;
    font-family: var(--font-data);
    font-size: 0.909rem;
    line-height: 1.65;
    color: var(--text-dim);
}

.console-output .log-dim { color: var(--text-dim); }
.console-output .log-warn { color: var(--warning); }
.console-output .log-err { color: var(--danger); }
.console-output .log-ok { color: var(--success); }

/* --- News Ticker --- */
.ticker-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--ticker-height);
    background: linear-gradient(180deg, rgba(5, 6, 9, 0.97) 0%, rgba(5, 6, 9, 0.99) 100%);
    backdrop-filter: blur(0.75rem);
    border-top: 1px solid var(--border-accent);
    z-index: 900;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.ticker-label {
    flex-shrink: 0;
    padding: 0 1.818rem;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.136rem;
    color: var(--accent);
    border-right: 1px solid var(--border-accent);
    height: 100%;
    display: flex;
    align-items: center;
    background: rgba(6, 214, 160, 0.04);
}

.ticker-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.ticker-content {
    display: inline-flex;
    gap: 0;
    white-space: nowrap;
    will-change: transform;
}

.news-box {
    display: inline-flex;
    align-items: center;
    padding: 0 1.636rem;
    gap: 0.545rem;
}

.news-country {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent);
    font-weight: 600;
}

.news-link {
    font-size: 1rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.news-link:hover { color: var(--text-primary); }

.news-item { color: var(--text-secondary); font-size: 1rem; }
.item-error { color: var(--danger); }

/* --- Polymarket Ticker --- */
.polymarket-ticker {
    position: fixed;
    bottom: var(--ticker-height);
    left: 0;
    right: 0;
    height: var(--ticker-height);
    background: rgba(5, 6, 9, 0.95);
    border-top: 1px solid rgba(139, 92, 246, 0.12);
    display: none;
    align-items: center;
    overflow: hidden;
    z-index: 899;
}

.poly-label {
    flex-shrink: 0;
    padding: 0 1.818rem;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.136rem;
    color: var(--purple);
    border-right: 1px solid rgba(139, 92, 246, 0.12);
    height: 100%;
    display: flex;
    align-items: center;
    background: rgba(139, 92, 246, 0.04);
}

/* --- Modals (glassmorphism) --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(0.625rem);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.visible { display: flex; }

.modal {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(12, 16, 24, 0.95) 100%);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl), 0 0 48px rgba(6, 214, 160, 0.08);
    max-width: 90vw;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(1.25rem);
    animation: fadeIn var(--transition-normal);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.273rem 1.636rem;
    border-bottom: 1px solid var(--border-accent);
    background: rgba(6, 214, 160, 0.03);
}

.modal-title {
    font-family: var(--font-mono);
    font-size: 1.091rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.727rem;
    text-transform: uppercase;
    letter-spacing: 0.073rem;
}

.modal-close {
    width: 2.364rem;
    height: 2.364rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 85, 85, 0.1);
    border-color: rgba(255, 85, 85, 0.2);
    color: var(--danger);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.636rem;
}

/* --- GDELT News Modal --- */
.news-modal { width: 81.818rem; }

.gdelt-controls {
    display: flex;
    gap: 0.364rem;
    flex-wrap: wrap;
    margin-bottom: 1.091rem;
}

.gdelt-time-btn {
    padding: 0.364rem 1.091rem;
    font-family: var(--font-mono);
    font-size: 0.909rem;
    font-weight: 600;
    background: rgba(17, 24, 32, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    letter-spacing: 0.045rem;
}

.gdelt-time-btn:hover {
    border-color: rgba(6, 214, 160, 0.4);
    color: var(--accent);
    background: var(--accent-subtle);
}

.gdelt-time-btn.active {
    background: var(--accent-gradient);
    color: var(--bg-primary);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(6, 214, 160, 0.3);
    font-weight: 700;
}

/* Tag filters */
.tag-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.364rem;
    padding: 0.727rem 0.909rem;
    background: rgba(17, 24, 32, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-height: 3.091rem;
    margin-bottom: 0.727rem;
    transition: border-color var(--transition-fast);
}

.tag-container:focus-within {
    border-color: rgba(6, 214, 160, 0.3);
}

.poly-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.364rem;
    padding: 0.182rem 0.727rem;
    background: var(--accent-subtle);
    border: 1px solid rgba(6, 214, 160, 0.15);
    border-radius: 1.091rem;
    font-size: 0.909rem;
    color: var(--accent);
    font-weight: 500;
}

.poly-tag-remove {
    cursor: pointer;
    color: var(--text-dim);
    font-size: 1.091rem;
    line-height: 1;
    transition: color var(--transition-fast);
}

.poly-tag-remove:hover { color: var(--danger); }

.tag-input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    min-width: 5.455rem;
    flex: 1;
}

.tag-input::placeholder { color: var(--text-dim); }

/* --- GDELT Console --- */
#gdelt-console-wrapper {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 0.727rem;
    display: none;
    max-height: 16.364rem;
    overflow: hidden;
}

#gdelt-console-output {
    padding: 0.727rem 1.091rem;
    font-family: var(--font-data);
    font-size: 0.909rem;
    color: var(--accent);
    overflow-y: auto;
    max-height: 16.364rem;
    white-space: pre-wrap;
}

/* --- Tables --- */
.poly-market-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

.poly-market-table thead th {
    padding: 0.909rem 1.091rem;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.818rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.091rem;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border-accent);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    cursor: pointer;
    user-select: none;
    transition: color var(--transition-fast);
}

.poly-market-table thead th:hover { color: var(--accent); }

.poly-market-table tbody tr {
    border-bottom: 1px solid rgba(20, 25, 35, 0.6);
    transition: background var(--transition-fast);
}

.poly-market-table tbody tr:hover { background: var(--accent-subtle); }

.poly-market-table tbody td {
    padding: 0.727rem 1.091rem;
    color: var(--text-secondary);
}

.poly-table-title {
    color: var(--text-primary);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.poly-table-title:hover { color: var(--accent); }

.poly-sort-arrow {
    margin-left: 0.273rem;
    color: var(--accent);
    font-size: 0.636rem;
}

/* --- Loader --- */
.poly-loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.727rem;
    gap: 1.091rem;
}

.poly-loader {
    width: 2.727rem;
    height: 2.727rem;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.poly-loader-text {
    font-family: var(--font-mono);
    font-size: 0.909rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.136rem;
}

/* --- Buttons (polished) --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.455rem;
    padding: 0.545rem 1.273rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 1px solid transparent;
    font-family: var(--font-sans);
    letter-spacing: 0.027rem;
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--bg-primary);
    border-color: var(--accent);
    box-shadow: 0 0 14px rgba(6, 214, 160, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 0 22px rgba(6, 214, 160, 0.45);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-ghost:hover {
    background: var(--accent-subtle);
    color: var(--accent);
    border-color: rgba(6, 214, 160, 0.3);
}

.btn-sm { padding: 0.364rem 0.909rem; font-size: 0.909rem; }

.intel-btn {
    font-family: var(--font-mono);
    font-size: 0.909rem;
    color: var(--accent);
    padding: 0.364rem 0.909rem;
    border: 1px solid rgba(6, 214, 160, 0.25);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
    transition: all var(--transition-normal);
    text-decoration: none;
    display: inline-block;
    letter-spacing: 0.027rem;
}

.intel-btn:hover {
    background: var(--accent);
    color: var(--bg-primary);
    box-shadow: 0 0 12px rgba(6, 214, 160, 0.3);
}

/* --- Popups (MapLibre - premium glass) --- */
.maplibregl-popup-content {
    background: linear-gradient(135deg, rgba(17, 24, 32, 0.95) 0%, rgba(10, 14, 22, 0.97) 100%) !important;
    border: 1px solid rgba(6, 214, 160, 0.18) !important;
    border-radius: var(--radius-lg) !important;
    padding: 0 !important;
    box-shadow: var(--shadow-lg), 0 0 28px rgba(6, 214, 160, 0.12) !important;
    max-width: 30.909rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    backdrop-filter: blur(1rem);
}

.maplibregl-popup-tip {
    border-top-color: rgba(17, 24, 32, 0.95) !important;
}

.maplibregl-popup-close-button {
    color: var(--text-dim) !important;
    font-size: 1.455rem !important;
    right: 0.727rem !important;
    top: 0.727rem !important;
    transition: color var(--transition-fast);
}

.maplibregl-popup-close-button:hover { color: var(--accent) !important; }

.popup-header {
    padding: 0.909rem 1.273rem;
    border-bottom: 1px solid var(--border-accent);
    display: flex;
    align-items: center;
    gap: 0.727rem;
    background: rgba(6, 214, 160, 0.06);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.popup-header-title {
    font-family: var(--font-mono);
    font-size: 1.091rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.045rem;
}

.popup-body { padding: 0.909rem 1.273rem; }

.popup-row {
    display: flex;
    justify-content: space-between;
    padding: 0.273rem 0;
    font-size: 1rem;
}

.popup-label {
    font-family: var(--font-mono);
    font-size: 0.818rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.045rem;
    color: var(--text-dim);
}

.popup-value {
    color: var(--accent);
    font-family: var(--font-data);
    font-size: 1rem;
    font-weight: 500;
}

.popup-actions {
    padding: 0.727rem 1.273rem;
    border-top: 1px solid var(--border-accent);
    display: flex;
    gap: 0.545rem;
    flex-wrap: wrap;
    background: rgba(6, 214, 160, 0.02);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* --- Legend --- */
.legend-container {
    padding: 0.545rem 0.727rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.636rem;
    padding: 0.182rem 0;
    font-size: 0.909rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.legend-item:hover { color: var(--accent); }

.legend-dot {
    width: 0.636rem;
    height: 0.636rem;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}

/* --- Live TV Panel --- */
.live-tv-panel {
    position: fixed;
    top: calc(var(--topbar-height) + 0.727rem);
    right: 0.909rem;
    width: min(22vw, 36rem);
    height: min(calc(22vw / 16 * 9), 20rem);
    background: rgba(5, 6, 9, 0.97);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    overflow: hidden;
    z-index: 1500;
    box-shadow: var(--shadow-xl), 0 0 30px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    backdrop-filter: blur(1.25rem);
    transition: width 0.3s ease, height 0.3s ease;
}

.live-tv-panel.expanded {
    width: min(22vw, 36rem);
    height: min(calc(22vw / 16 * 9), 20rem);
}

.live-tv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.545rem 0.909rem;
    background: rgba(17, 24, 32, 0.6);
    border-bottom: 1px solid var(--border-accent);
    cursor: move;
    user-select: none;
    min-height: 2.727rem;
}

.live-tv-channels {
    display: flex;
    gap: 0;
    overflow-x: auto;
    background: rgba(10, 14, 22, 0.8);
    border-bottom: 1px solid var(--border-accent);
    scrollbar-width: none;
}

.live-tv-channels::-webkit-scrollbar { display: none; }

.tv-channel-btn {
    padding: 0.909rem 1.636rem;
    font-family: var(--font-mono);
    font-size: 1.273rem;
    font-weight: 700;
    letter-spacing: 0.073rem;
    text-transform: uppercase;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
}

.tv-channel-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}

.tv-channel-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: var(--accent-subtle);
}

.live-tv-body {
    flex: 1;
    background: #000;
    position: relative;
}

.live-tv-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.live-tv-panel {
    min-width: 15rem;
    min-height: 10rem;
}

.tv-resize-edge {
    position: absolute;
    z-index: 10;
}

.tv-resize-edge.top { top: -0.364rem; left: 0.727rem; right: 0.727rem; height: 0.727rem; cursor: ns-resize; }
.tv-resize-edge.bottom { bottom: -0.364rem; left: 0.727rem; right: 0.727rem; height: 0.727rem; cursor: ns-resize; }
.tv-resize-edge.left { left: -0.364rem; top: 0.727rem; bottom: 0.727rem; width: 0.727rem; cursor: ew-resize; }
.tv-resize-edge.right { right: -0.364rem; top: 0.727rem; bottom: 0.727rem; width: 0.727rem; cursor: ew-resize; }

.tv-resize-corner {
    position: absolute;
    width: 1.273rem;
    height: 1.273rem;
    z-index: 11;
}

.tv-resize-corner.top-left { top: -0.364rem; left: -0.364rem; cursor: nwse-resize; }
.tv-resize-corner.top-right { top: -0.364rem; right: -0.364rem; cursor: nesw-resize; }
.tv-resize-corner.bottom-left { bottom: -0.364rem; left: -0.364rem; cursor: nesw-resize; }
.tv-resize-corner.bottom-right { bottom: -0.364rem; right: -0.364rem; cursor: nwse-resize; }

/* --- Radio Player (glass) --- */
.radio-player {
    position: fixed;
    bottom: calc(var(--ticker-total-height) + 0.727rem);
    right: 1.273rem;
    background: rgba(10, 14, 22, 0.92);
    backdrop-filter: blur(1rem);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    padding: 0.909rem 1.273rem;
    display: none;
    align-items: center;
    gap: 0.909rem;
    z-index: 850;
    box-shadow: var(--shadow-md), 0 0 20px rgba(6, 214, 160, 0.1);
    min-width: 20.909rem;
}

.radio-now-playing {
    flex: 1;
    overflow: hidden;
}

.radio-station-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.radio-status {
    font-size: 0.818rem;
    color: var(--success);
    font-family: var(--font-mono);
}

.radio-controls {
    display: flex;
    gap: 0.364rem;
}

.radio-btn {
    width: 2.364rem;
    height: 2.364rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 32, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 0.909rem;
}

.radio-btn:hover {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(6, 214, 160, 0.4);
}

/* --- Settings Modal --- */
.settings-modal { width: 43.636rem; }

.settings-group {
    margin-bottom: 1.455rem;
}

.settings-group-title {
    font-family: var(--font-mono);
    font-size: 0.909rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.091rem;
    color: var(--text-dim);
    margin-bottom: 0.727rem;
    padding-bottom: 0.545rem;
    border-bottom: 1px solid var(--border-accent);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.545rem 0;
}

.settings-label {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* --- Live TV Player --- */
.live-tv-player {
    position: fixed;
    width: 34.545rem;
    height: 21.818rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    overflow: hidden;
    z-index: 1500;
    box-shadow: var(--shadow-xl);
    display: none;
    flex-direction: column;
    resize: both;
}

.live-tv-title {
    font-size: 0.909rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* --- Globe Toggle --- */
.globe-toggle {
    position: fixed;
    bottom: calc(var(--ticker-total-height) + 0.727rem);
    left: calc(var(--sidebar-width) + 1.273rem);
    z-index: 500;
    transition: left var(--transition-normal);
}

.sidebar.collapsed ~ .globe-toggle {
    left: calc(var(--sidebar-collapsed) + 1.273rem);
}

/* --- Globe 3D/2D Toggle --- */
#globe-toggle-container {
    position: fixed;
    top: calc(var(--topbar-height) + 1rem);
    left: calc(var(--sidebar-width) + 1rem);
    z-index: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: left 0.2s ease, top 0.2s ease;
}

/* Push globe toggle below markets ticker when it's visible */
body.markets-ticker-visible #globe-toggle-container {
    top: calc(var(--topbar-height) + var(--markets-ticker-height) + 1rem);
}

#globe-toggle-btn {
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 50%;
    border: 2px solid var(--text-dim);
    background: rgba(5, 6, 9, 0.85);
    backdrop-filter: blur(0.75rem);
    color: var(--text-dim);
    font-size: 1.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    transition: all 0.3s ease;
}

#globe-toggle-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 1.25rem rgba(6, 214, 160, 0.25);
}

#globe-tooltip {
    background: rgba(5, 6, 9, 0.9);
    backdrop-filter: blur(0.75rem);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.875rem;
    font-family: var(--font-mono);
    font-size: 0.818rem;
    color: var(--text-secondary);
    white-space: nowrap;
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.sidebar.collapsed ~ #globe-toggle-container {
    left: calc(var(--sidebar-collapsed) + 1rem);
}

/* --- Squawk Tags --- */
.squawk-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.273rem;
    padding: 0.182rem 0.727rem;
    background: rgba(17, 24, 32, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 1.091rem;
    font-size: 0.818rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.squawk-tag:hover {
    background: var(--accent-subtle);
    border-color: rgba(6, 214, 160, 0.3);
    color: var(--accent);
}

.squawk-tag.active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(6, 214, 160, 0.3);
}

.squawk-tag-remove {
    font-size: 1rem;
    color: var(--text-dim);
    cursor: pointer;
}

/* --- FPS/Performance Monitor --- */
.perf-monitor {
    position: fixed;
    top: calc(var(--topbar-height) + 0.727rem);
    right: 0.727rem;
    background: rgba(10, 14, 22, 0.88);
    backdrop-filter: blur(0.625rem);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-sm);
    padding: 0.364rem 0.727rem;
    font-family: var(--font-data);
    font-size: 0.818rem;
    color: var(--text-dim);
    z-index: 400;
    display: none;
}

.perf-good { color: var(--success); }
.perf-warn { color: var(--warning); }
.perf-critical { color: var(--danger); }

/* --- Cursor Coordinates (bottom right) --- */
.cursor-coords {
    position: fixed;
    bottom: calc(var(--ticker-total-height) + 0.455rem);
    right: 0.909rem;
    background: rgba(5, 6, 9, 0.88);
    backdrop-filter: blur(0.5rem);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-sm);
    padding: 0.273rem 0.727rem;
    font-family: var(--font-data);
    font-size: 0.818rem;
    color: var(--text-dim);
    z-index: 450;
    letter-spacing: 0.027rem;
    pointer-events: none;
}

/* --- Day/Night Terminator --- */
.terminator-overlay {
    pointer-events: none;
}

/* --- Earthquake indicators --- */
.quake-pulse {
    animation: quakePulse 2s ease-in-out infinite;
}

/* --- Section note (small info text) --- */
.section-note {
    font-size: 0.818rem;
    color: var(--text-dim);
    padding: 0.273rem 0.909rem;
    font-style: italic;
}

/* --- Accent divider --- */
.divider-accent {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(6, 214, 160, 0.2), transparent);
    margin: 0.727rem 0;
}

/* --- Mobile Menu Button (hidden by default) --- */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: all var(--transition-normal);
}

.mobile-menu-btn:hover {
    background: var(--accent-subtle);
    color: var(--accent);
    border-color: rgba(6, 214, 160, 0.3);
}

/* --- Sidebar Backdrop (for mobile) --- */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 499;
}

/* --- MapLibre zoom controls fix --- */
.maplibregl-ctrl-bottom-right {
    z-index: 600;
    bottom: calc(var(--ticker-total-height) + 0.727rem) !important;
    right: 1.091rem !important;
}

/* =============================================
   RESPONSIVE MEDIA QUERIES
   ============================================= */

/* --- Phone (<600px / 37.5rem) --- */
@media (max-width: 37.5rem) {
    :root {
        --topbar-height: 3rem;
        --ticker-total-height: 2.25rem;
    }

    /* Hide elements on phone */
    .status-indicator,
    .search-shortcut,
    .topbar-divider,
    .regional-presets,
    .topbar-logo span,
    .cursor-coords,
    #globe-tooltip,
    #console-toggle-btn,
    #fullscreen-btn,
    #terminator-btn {
        display: none !important;
    }

    .topbar {
        padding: 0 0.5rem;
        gap: 0.5rem;
    }

    /* Sidebar off-screen */
    .sidebar {
        transform: translateX(-100%);
        width: 85vw;
        bottom: 0;
        z-index: 1100;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Show hamburger */
    .mobile-menu-btn {
        display: flex;
    }

    /* Hide polymarket ticker, single GDELT ticker */
    .polymarket-ticker {
        display: none !important;
    }

    .ticker-container {
        height: var(--ticker-total-height);
    }

    /* Touch targets */
    .switch {
        width: 2.75rem;
    }

    .toggle-row {
        min-height: 2.75rem;
    }

    .filter-checkbox-row input[type="checkbox"] {
        width: 1.25rem;
        height: 1.25rem;
    }

    /* TV panel */
    .live-tv-panel {
        width: calc(100vw - 1rem) !important;
        height: 14rem;
        right: 0.5rem;
        left: 0.5rem;
    }

    .live-tv-panel.expanded {
        width: calc(100vw - 1rem) !important;
        height: calc(100vh - var(--topbar-height) - var(--ticker-total-height) - 1rem);
    }

    /* Console */
    .console-wrapper {
        left: 0.5rem;
        right: 0.5rem;
        width: auto;
    }

    /* Globe toggle */
    .globe-toggle {
        left: 0.75rem;
    }

    .globe-toggle .topbar-btn {
        width: 2.75rem;
        height: 2.75rem;
    }

    /* Disable backdrop-filter for performance */
    .sidebar,
    .topbar,
    .console-wrapper,
    .radio-player,
    #status-box {
        backdrop-filter: none;
    }

    /* Search container full width */
    .search-container {
        max-width: none;
    }

    /* Sidebar backdrop */
    .sidebar-backdrop.active {
        display: block;
    }

    /* Hide sidebar toggle button (use hamburger) */
    .sidebar-toggle-btn {
        display: none;
    }

    /* Modal adjustments */
    .modal {
        max-width: 95vw;
        max-height: 90vh;
    }

    .news-modal,
    .settings-modal {
        width: 95vw;
    }
}

/* --- Tablet (<900px / 56.25rem) --- */
@media (max-width: 56.25rem) and (min-width: 37.501rem) {
    /* Sidebar off-screen */
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Show hamburger */
    .mobile-menu-btn {
        display: flex;
    }

    /* Globe toggle */
    .globe-toggle {
        left: 0.75rem;
    }

    /* TV panel */
    .live-tv-panel {
        width: calc(100vw - 1.25rem) !important;
        right: 0.625rem;
    }

    /* Console */
    .console-wrapper {
        left: 0.625rem;
        right: 0.625rem;
        width: auto;
    }

    /* Hide sidebar toggle button (use hamburger) */
    .sidebar-toggle-btn {
        display: none;
    }

    /* Sidebar backdrop */
    .sidebar-backdrop.active {
        display: block;
    }

    /* Hide some topbar items */
    .topbar-logo span {
        display: none;
    }

    .regional-presets {
        display: none;
    }

    .cursor-coords {
        display: none;
    }

    .search-container {
        max-width: none;
    }

    /* Modal adjustments */
    .news-modal {
        width: 90vw;
    }
}

/* --- Ultrawide (>1920px / 120rem) --- */
@media (min-width: 120rem) {
    :root {
        --sidebar-width: clamp(20rem, 20vw, 26rem);
    }

    .search-container {
        max-width: 50rem;
    }

    .console-wrapper {
        width: 45rem;
    }

    .live-tv-panel,
    .live-tv-panel.expanded {
        width: min(22vw, 36rem);
        height: min(calc(22vw / 16 * 9), 20rem);
    }

    .news-modal {
        width: 100rem;
    }

    .settings-modal {
        width: 55rem;
    }
}
/* ============================================
   v4.1 — SIDEBAR FOOTER REDESIGN
   ============================================ */
.sidebar-footer {
    padding: 0.636rem 0.909rem 0.636rem;
    border-top: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.3));
}

.sidebar-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.636rem;
}

.sidebar-footer-brand {
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    letter-spacing: var(--ls-label);
    color: var(--text-secondary);
    text-transform: uppercase;
}

.sidebar-footer-version {
    color: var(--accent);
    font-weight: var(--fw-semi);
    margin-left: 0.272rem;
}

.sidebar-footer-links {
    display: inline-flex;
    gap: 0.727rem;
    align-items: center;
}

.sidebar-footer-link {
    color: var(--text-dim);
    font-size: var(--fs-body);
    text-decoration: none;
    transition: color var(--transition-fast), transform var(--transition-fast);
    line-height: 1;
    display: inline-block;
}

.sidebar-footer-link:hover {
    color: var(--accent-bright);
    transform: translateY(-1px);
}

.sidebar-footer-ca {
    display: flex;
    align-items: center;
    gap: 0.454rem;
    margin-top: 0.454rem;
    padding: 0.272rem 0.454rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--transition-fast);
    overflow: hidden;
}

.sidebar-footer-ca:hover {
    border-color: var(--accent-dim);
}

.sidebar-footer-ca-label {
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    color: var(--markets-label);
    letter-spacing: var(--ls-label);
    flex-shrink: 0;
}

.sidebar-footer-ca-value {
    font-size: var(--fs-xs);
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    font-family: var(--font-mono);
}

/* ============================================
   v4.1 — LOADING SKELETONS (replace "Loading...")
   ============================================ */
.phyl-skeleton {
    background: linear-gradient(
        90deg,
        rgba(100, 116, 139, 0.05) 0%,
        rgba(100, 116, 139, 0.12) 50%,
        rgba(100, 116, 139, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.phyl-skeleton-row {
    height: 1.636rem;
    margin-bottom: 0.363rem;
}

/* ============================================
   v4.1 — SIDEBAR TIER HEADERS
   ============================================ */
.sidebar-tier {
    display: flex;
    align-items: center;
    gap: 0.636rem;
    padding: 0.909rem 0.909rem 0.545rem;
    margin-top: 0.272rem;
    position: relative;
    border-bottom: 1px solid transparent;
}

.sidebar-tier:first-of-type {
    margin-top: 0;
}

.sidebar-tier::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.909rem;
    right: 0.909rem;
    height: 1px;
    background: linear-gradient(90deg, currentColor 0%, transparent 100%);
    opacity: 0.25;
}

.sidebar-tier .tier-dot {
    width: 0.454rem;
    height: 0.454rem;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    box-shadow: 0 0 8px currentColor;
}

.sidebar-tier .tier-label {
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: var(--ls-uber);
    color: currentColor;
}

.sidebar-tier .tier-meta {
    font-family: var(--font-sans);
    font-size: var(--fs-xs);
    font-style: italic;
    color: var(--text-muted);
    margin-left: auto;
}

/* Tier colors */
.sidebar-tier.tier-intel  { color: var(--tier-intel-color); }
.sidebar-tier.tier-signal { color: var(--tier-signal-color); }
.sidebar-tier.tier-sensor { color: var(--tier-sensor-color); }

/* When sidebar is collapsed, hide tier labels + meta, keep dot */
.sidebar.collapsed .sidebar-tier .tier-label,
.sidebar.collapsed .sidebar-tier .tier-meta { display: none; }

.sidebar.collapsed .sidebar-tier {
    justify-content: center;
    padding: 0.636rem 0;
}

/* ============================================
   v4.0 — MARKETS TICKER (between topbar and map)
   ============================================ */
.markets-ticker {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    right: 0;
    height: var(--markets-ticker-height);
    background: linear-gradient(180deg, rgba(10, 14, 21, 0.98), rgba(5, 6, 9, 0.96));
    backdrop-filter: blur(0.75rem);
    -webkit-backdrop-filter: blur(0.75rem);
    border-bottom: 1px solid var(--border-accent);
    z-index: 901;
    display: flex;
    align-items: center;
    overflow: hidden;
    font-family: var(--font-mono);
}

.markets-ticker.hidden { display: none; }

.markets-ticker .markets-label {
    flex-shrink: 0;
    padding: 0 1.818rem;
    font-family: var(--font-mono);
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: var(--ls-uber);
    color: var(--markets-label);
    border-right: 1px solid rgba(251, 191, 36, 0.25);
    height: 100%;
    display: flex;
    align-items: center;
    background: rgba(251, 191, 36, 0.06);
    box-shadow: inset -2px 0 8px rgba(251, 191, 36, 0.08);
}

.markets-ticker .ticker-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.markets-ticker .ticker-content {
    display: inline-flex;
    gap: 0;
    white-space: nowrap;
    will-change: transform;
}

.mkt-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.909rem;
    padding: 0 2.2rem;
    font-size: var(--fs-body);
    border-right: 1px solid rgba(100, 116, 139, 0.22);
    cursor: pointer;
    transition: background var(--transition-fast);
    position: relative;
    height: 100%;
}

.mkt-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.mkt-pill.bull::before { background: var(--bull-tint); }
.mkt-pill.bear::before { background: var(--bear-tint); }
.mkt-pill.bull::before,
.mkt-pill.bear::before { opacity: 1; }

.mkt-pill:hover { background: var(--accent-subtle); }
.mkt-pill:hover::before { opacity: 0; }

.mkt-pill .mkt-sym {
    color: var(--text-primary);
    font-weight: var(--fw-bold);
    font-size: var(--fs-lg);
    letter-spacing: var(--ls-label);
}

.mkt-pill .mkt-price {
    color: var(--text-primary);
    font-weight: var(--fw-semi);
    font-variant-numeric: tabular-nums;
}

.mkt-pill .mkt-chg {
    font-weight: var(--fw-bold);
    font-size: var(--fs-md);
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: center;
    gap: 0.272rem;
    padding: 0.145rem 0.545rem;
    border-radius: 0.272rem;
}

.mkt-pill.bull .mkt-chg {
    color: var(--color-bull);
    background: rgba(34, 211, 160, 0.08);
}
.mkt-pill.bear .mkt-chg {
    color: var(--color-bear);
    background: rgba(255, 107, 107, 0.08);
}
.mkt-pill.flat .mkt-chg {
    color: var(--color-flat);
    background: rgba(153, 164, 184, 0.06);
}

.mkt-pill .mkt-arrow { font-size: 0.636rem; opacity: 0.95; line-height: 1; }

body.markets-ticker-visible #map {
    top: calc(var(--topbar-height) + var(--markets-ticker-height));
}

body.markets-ticker-visible .sidebar {
    top: calc(var(--topbar-height) + var(--markets-ticker-height));
}

body.markets-ticker-visible .live-tv-panel {
    top: calc(var(--topbar-height) + var(--markets-ticker-height) + 0.5rem);
}

/* ============================================
   v4.0 — MARKETS SIDEBAR PANEL
   ============================================ */
.markets-category {
    margin-top: 0.909rem;
    border-top: 1px solid rgba(100, 116, 139, 0.08);
    padding-top: 0.636rem;
}

.markets-category:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 0.454rem;
}

.markets-category-title {
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    text-transform: uppercase;
    letter-spacing: var(--ls-label);
    color: var(--markets-label);
    margin-bottom: 0.454rem;
    padding: 0 0.363rem;
    display: flex;
    align-items: center;
    gap: 0.363rem;
}

.markets-category-title::before {
    content: '';
    width: 0.272rem;
    height: 0.272rem;
    background: var(--markets-label);
    border-radius: 50%;
    opacity: 0.75;
}

/* 2-line layout: line1 = SYM + PRICE, line2 = NAME + CHG */
.mkt-row {
    display: flex;
    flex-direction: column;
    padding: 0.454rem 0.545rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast), border-left-color var(--transition-fast);
    font-family: var(--font-mono);
    gap: 0.145rem;
    position: relative;
    border-left: 2px solid transparent;
}

.mkt-row:hover {
    background: var(--accent-subtle);
    border-left-color: var(--accent-dim);
}

.mkt-row.bull:hover { border-left-color: var(--color-bull); }
.mkt-row.bear:hover { border-left-color: var(--color-bear); }

.mkt-row-line1,
.mkt-row-line2 {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.545rem;
}

.mkt-row-line2 { align-items: center; }

.mkt-row-sym {
    color: var(--text-primary);
    font-weight: var(--fw-bold);
    font-size: var(--fs-body);
    letter-spacing: 0.054rem;
}

.mkt-row-name {
    color: var(--text-dim);
    font-size: var(--fs-xs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    font-family: var(--font-sans);
}

.mkt-row-price {
    color: var(--text-primary);
    font-size: var(--fs-body);
    font-weight: var(--fw-semi);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.mkt-row-chg {
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    font-variant-numeric: tabular-nums;
    padding: 0.09rem 0.454rem;
    border-radius: 0.272rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.145rem;
}

.mkt-row.bull .mkt-row-chg {
    color: var(--color-bull);
    background: rgba(34, 211, 160, 0.10);
}
.mkt-row.bear .mkt-row-chg {
    color: var(--color-bear);
    background: rgba(255, 107, 107, 0.10);
}
.mkt-row.flat .mkt-row-chg {
    color: var(--color-flat);
    background: rgba(153, 164, 184, 0.07);
}

.mkt-sparkline { width: 2.727rem; height: 0.818rem; opacity: 0.7; }

/* ============================================
   v4.0 — CHOKEPOINTS SIDEBAR PANEL
   ============================================ */
.chokepoint-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.363rem 0.454rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
    gap: 0.545rem;
    border-left: 2px solid transparent;
}

.chokepoint-row:hover {
    background: var(--accent-subtle);
    border-left-color: var(--accent);
}

.chokepoint-row.flagship {
    background: rgba(239, 68, 68, 0.04);
    border-left: 2px solid var(--risk-extreme);
}

.chokepoint-row.flagship:hover { background: rgba(239, 68, 68, 0.08); }

.chokepoint-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.chokepoint-name {
    font-family: var(--font-sans);
    font-size: 0.909rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chokepoint-meta {
    font-family: var(--font-mono);
    font-size: 0.727rem;
    color: var(--text-dim);
    margin-top: 0.09rem;
}

.chokepoint-status {
    font-family: var(--font-mono);
    font-size: 0.727rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.072rem;
    padding: 0.145rem 0.545rem;
    border-radius: 0.272rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.chokepoint-status.normal {
    background: rgba(34, 211, 160, 0.12);
    color: var(--risk-low);
    border: 1px solid rgba(34, 211, 160, 0.3);
}

.chokepoint-status.elevated {
    background: rgba(251, 191, 36, 0.12);
    color: var(--risk-medium);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.chokepoint-status.high {
    background: rgba(251, 146, 60, 0.12);
    color: var(--risk-high);
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.chokepoint-status.extreme {
    background: rgba(239, 68, 68, 0.16);
    color: var(--risk-extreme);
    border: 1px solid rgba(239, 68, 68, 0.4);
    animation: pulseExtreme 2s ease-in-out infinite;
}

@keyframes pulseExtreme {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.0); }
    50% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }
}

.chokepoint-deepdive-btn {
    width: 100%;
    margin-top: 0.545rem;
    padding: 0.454rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(251, 146, 60, 0.10));
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: var(--radius-sm);
    color: var(--risk-extreme);
    font-family: var(--font-mono);
    font-size: 0.818rem;
    font-weight: 700;
    letter-spacing: 0.109rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chokepoint-deepdive-btn:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.28), rgba(251, 146, 60, 0.20));
    border-color: var(--risk-extreme);
    transform: translateY(-1px);
}

/* ============================================
   v4.0 — HORMUZ DEEP-DIVE MODAL
   ============================================ */
.hormuz-modal {
    width: min(90vw, 100rem);
    height: min(88vh, 60rem);
    display: flex;
    flex-direction: column;
}

.hormuz-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 1rem;
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.hormuz-tab {
    padding: 0.818rem 1.363rem;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.909rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.109rem;
    cursor: pointer;
    position: relative;
    transition: color var(--transition-fast);
}

.hormuz-tab:hover { color: var(--text-secondary); }

.hormuz-tab.active { color: var(--risk-extreme); }

.hormuz-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--risk-extreme);
}

.hormuz-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.363rem;
}

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

.hormuz-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.909rem;
    margin-bottom: 1.363rem;
}

.hormuz-stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.909rem;
}

.hormuz-stat-card.accent {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), transparent);
}

.hormuz-stat-label {
    font-family: var(--font-mono);
    font-size: 0.727rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.109rem;
    margin-bottom: 0.363rem;
}

.hormuz-stat-value {
    font-family: var(--font-mono);
    font-size: 1.636rem;
    font-weight: 700;
    color: var(--text-primary);
}

.hormuz-stat-sub {
    font-family: var(--font-mono);
    font-size: 0.727rem;
    color: var(--text-secondary);
    margin-top: 0.272rem;
}

.hormuz-news-item {
    padding: 0.545rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.hormuz-news-item:last-child { border-bottom: none; }

.hormuz-news-title {
    font-size: 0.909rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.hormuz-news-title:hover { color: var(--accent); }

.hormuz-news-meta {
    font-family: var(--font-mono);
    font-size: 0.727rem;
    color: var(--text-dim);
    margin-top: 0.272rem;
}

.hormuz-poly-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.636rem 0.818rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-bottom: 0.454rem;
    gap: 0.818rem;
}

.hormuz-poly-question {
    flex: 1;
    font-size: 0.909rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.hormuz-poly-prob {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.272rem;
    flex-shrink: 0;
}

.hormuz-tv-wrap {
    height: 28rem;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.hormuz-tv-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* ============================================
   v4.0 — CORRELATION OVERLAY
   ============================================ */
.correlation-overlay {
    position: fixed;
    top: calc(var(--topbar-height) + var(--markets-ticker-height) + 0.909rem);
    right: 1rem;
    width: min(24rem, calc(100vw - 2rem));
    background: var(--overlay-bg);
    border: 1px solid var(--overlay-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    backdrop-filter: blur(1rem);
    -webkit-backdrop-filter: blur(1rem);
    box-shadow: var(--overlay-glow);
    z-index: 950;
    display: none;
    animation: correlationSlideIn 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

.correlation-overlay.visible { display: block; }

@keyframes correlationSlideIn {
    from { opacity: 0; transform: translateX(1rem); }
    to { opacity: 1; transform: translateX(0); }
}

.correlation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.636rem;
    margin-bottom: 0.727rem;
    padding-bottom: 0.636rem;
    border-bottom: 1px solid var(--border-subtle);
}

.correlation-title {
    font-family: var(--font-mono);
    font-size: 0.909rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.109rem;
    color: var(--risk-extreme);
    display: flex;
    align-items: center;
    gap: 0.454rem;
}

.correlation-title::before {
    content: '';
    width: 0.454rem;
    height: 0.454rem;
    border-radius: 50%;
    background: var(--risk-extreme);
    animation: pulseGlow 1.5s ease-in-out infinite;
}

.correlation-trigger {
    font-size: 0.818rem;
    color: var(--text-secondary);
    margin-bottom: 0.727rem;
    line-height: 1.45;
}

.correlation-list {
    display: flex;
    flex-direction: column;
    gap: 0.272rem;
}

.correlation-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.818rem;
    padding: 0.272rem 0;
}

.correlation-row-sym {
    color: var(--text-primary);
    font-weight: 700;
}

.correlation-row-chg { font-weight: 700; }

.correlation-row.bull .correlation-row-chg { color: var(--color-bull); }
.correlation-row.bear .correlation-row-chg { color: var(--color-bear); }
.correlation-row.flat .correlation-row-chg { color: var(--color-flat); }

.correlation-close {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.correlation-close:hover { color: var(--text-primary); }

/* Chokepoint map label — rendered as symbol layer text */
.chokepoint-badge {
    font-family: var(--font-mono);
    font-size: 0.818rem;
    font-weight: 700;
}
