/* ============================================
   EARTH REPORT — PAGE-SPECIFIC CSS
   Cinematic earth monitoring dashboard.
   Extends earth-monitor.css shared styles.
   ============================================ */

/* ── Hide old hero banner ── */
.em-hero-banner { display: none; }

/* ── Fracture Epicenter Markers ── */
.er-fx-icon {
    background: none !important;
    border: none !important;
}

.er-fx-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Seismic wave propagation rings */
.er-fx-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    border: 1px solid;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.er-fx-wave-1 {
    animation: er-fx-propagate 2.5s cubic-bezier(0.1, 0, 0.3, 1) infinite;
}

.er-fx-wave-2 {
    animation: er-fx-propagate 3.5s cubic-bezier(0.1, 0, 0.3, 1) infinite 0.8s;
}

.er-fx-wave-3 {
    animation: er-fx-propagate 5s cubic-bezier(0.1, 0, 0.3, 1) infinite 0.3s;
    border-width: 2px;
}

@keyframes er-fx-propagate {
    0% {
        transform: translate(-50%, -50%) scale(0.15);
        opacity: 0.5;
    }
    60% {
        opacity: 0.15;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* Magnitude readout */
.er-fx-mag {
    position: absolute;
    bottom: -2px;
    left: calc(50% + 8px);
    font-size: 0.55rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.7);
    z-index: 5;
    letter-spacing: 0.03em;
    line-height: 1;
}

/* Popup */
.er-fx-popup {
    font-family: var(--font-mono, monospace);
}

.er-fx-popup-mag {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.er-fx-popup-loc {
    font-size: 0.7rem;
    color: var(--th-text-primary, #e4e6ed);
    margin: 4px 0 2px;
}

.er-fx-popup-meta {
    font-size: 0.6rem;
    color: var(--th-text-muted, #50546a);
}

/* Cross-highlight from table/card hover */
.er-fx-highlighted .er-fx-wrap svg {
    filter: brightness(1.6) drop-shadow(0 0 6px currentColor);
    transition: filter 0.2s ease;
}

.er-fx-highlighted .er-fx-mag {
    color: #fff !important;
    text-shadow: 0 0 8px currentColor, 0 0 16px rgba(0,0,0,0.9);
}

/* Hide mobile-only "updated" label by default — shown at 480px breakpoint */
.em-last-updated-mobile {
    display: none;
}

/* ── Status Bar (replaces hero) ── */
.er-status-bar {
    height: auto;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 14px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    position: relative;
    gap: 8px;
    max-width: 100vw;
    box-sizing: border-box;
    overflow: visible;
}

.er-status-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--th-color-seismic, #ef4444) 30%, var(--th-color-frequency, #d946ef) 70%, transparent);
    opacity: 0.4;
}

.er-status-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    flex-shrink: 1;
    min-width: 0;
}

.er-status-left > .er-status-title,
.er-status-left > #status-badge {
    display: inline;
}

.er-status-top-row {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

/* Laser beam removed */

.er-status-title {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--th-text-heading, #f0f1f5);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-family: 'Cinzel', serif;
    white-space: nowrap;
    transition: color 0.6s ease-out, text-shadow 0.6s ease-out;
}


.er-status-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 0;
}

.er-chips {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    flex: 1;
    min-width: 0;
}

.er-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2px 6px;
    white-space: nowrap;
}

.er-chip-value {
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    color: var(--th-text-heading, #f0f1f5);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.er-chip-label {
    font-size: 0.38rem;
    color: var(--th-text-muted, #50546a);
    font-family: var(--font-mono, monospace);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1;
    margin-top: 1px;
}

/* ── Map scroll fade + hint ── */
.er-map-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(to bottom, transparent, var(--th-bg-void, #08090c));
    pointer-events: none;
    z-index: 400;
    transition: opacity 0.4s ease;
}

.er-map-fade.hidden { opacity: 0; }

.er-scroll-hint {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 401;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.er-scroll-hint.hidden { opacity: 0; }

.er-scroll-hint-text {
    font-size: 0.55rem;
    color: var(--th-text-muted, #50546a);
    font-family: var(--font-mono, monospace);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.er-scroll-hint-chevron {
    font-size: 0.7rem;
    color: var(--th-text-muted, #50546a);
    animation: er-bounce 1.5s ease-in-out infinite;
}

@keyframes er-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

/* ── Tab System ── */
.er-detail-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-top: 12px;
    margin-bottom: 8px;
    padding: 0 4px;
}

.er-detail-tab {
    padding: 6px 14px;
    font-size: 0.55rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--th-text-muted, #50546a);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.er-detail-tab:hover {
    color: var(--th-text-primary, #e4e6ed);
    background: rgba(255,255,255,0.03);
}

.er-detail-tab.active {
    color: var(--th-color-globe, #38bdf8);
    border-bottom-color: var(--th-color-globe, #38bdf8);
    background: rgba(56, 189, 248, 0.05);
}

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

.er-space-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.er-space-grid > :last-child {
    grid-column: 1 / -1;
}

/* ── Proximity columns ── */
.er-site-name {
    color: #d4af37;
    font-weight: 600;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.er-site-distance {
    color: var(--th-text-muted, #50546a);
    white-space: nowrap;
}

/* ── Weekly Earth Briefing ── */
.er-briefing {
    background: var(--em-glass);
    backdrop-filter: var(--em-glass-blur);
    -webkit-backdrop-filter: var(--em-glass-blur);
    border-bottom: 1px solid var(--th-border, rgba(255,255,255,0.06));
    padding: 4px 14px;
    position: relative;
}

.er-briefing::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--th-color-seismic, #ef4444) 30%, var(--th-color-frequency, #d946ef) 70%, transparent);
    opacity: 0.25;
}

.er-briefing-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
    transition: margin-bottom 0.3s ease;
}

.er-briefing.er-expanded .er-briefing-header {
    margin-bottom: 10px;
}

.er-briefing-title {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--th-text-heading, #f0f1f5);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: 'Cinzel', serif;
    white-space: nowrap;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.15);
}

.er-briefing-period {
    font-size: 0.4rem;
    color: var(--th-text-muted, #50546a);
    font-family: var(--font-mono, monospace);
    white-space: nowrap;
    opacity: 0.7;
}

/* Stats chips — map overlay */
.er-briefing-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    min-width: 0;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid rgba(0, 229, 255, 0.08);
    transition: border-color 0.2s, background 0.2s;
}

.er-briefing-stat:hover {
    border-color: rgba(0, 229, 255, 0.25);
    background: rgba(0, 229, 255, 0.04);
}

.er-briefing-stat-value {
    font-size: 0.6rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    color: var(--th-text-heading, #f0f1f5);
    line-height: 1;
    white-space: nowrap;
}

.er-briefing-stat-label {
    font-size: 0.35rem;
    color: rgba(0, 229, 255, 0.35);
    font-family: var(--font-mono, monospace);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.er-trend-arrow {
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 4px;
}
.er-trend-arrow.up { color: #ef4444; }
.er-trend-arrow.down { color: #34d399; }
.er-trend-arrow.flat { color: var(--th-text-muted, #50546a); }

.er-briefing-narrative {
    font-size: 0.65rem;
    color: var(--th-text-secondary, #8b8fa3);
    line-height: 1.6;
    max-width: 900px;
    font-style: italic;
    padding: 0 12px;
    background: rgba(0,0,0,0.15);
    border-left: 2px solid var(--th-color-seismic, #ef4444);
    border-radius: 0 8px 8px 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.3s ease;
}

.er-briefing.er-expanded .er-briefing-narrative {
    max-height: 200px;
    opacity: 1;
    padding: 6px 12px;
}

/* ── Expand chevron button ── */
.er-expand-chevron {
    background: none;
    border: 1px solid rgba(0, 229, 255, 0.1);
    color: rgba(0, 229, 255, 0.4);
    font-size: 0.55rem;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.3s ease;
    font-family: var(--font-mono, monospace);
    flex-shrink: 0;
    margin-left: auto;
}

.er-expand-chevron:hover {
    color: rgba(0, 229, 255, 0.8);
    border-color: rgba(0, 229, 255, 0.3);
    background: rgba(0, 229, 255, 0.05);
}

.er-briefing.er-expanded .er-expand-chevron {
    transform: rotate(180deg);
}

/* HUD toggle is subordinate to briefing toggle */
.hud-header .er-expand-chevron {
    width: 16px;
    height: 16px;
    font-size: 0.45rem;
    color: rgba(0, 229, 255, 0.25);
    border-color: rgba(0, 229, 255, 0.06);
}

/* ═══════════════════════════════════════════════════
   HUD INSTRUMENTS — Unified Space Weather Command Panel
   ═══════════════════════════════════════════════════ */
.hud-instruments {
    position: relative;
    margin-top: 4px;
    background: rgba(0, 8, 20, 0.85);
    border: 1px solid rgba(0, 229, 255, 0.12);
    border-radius: 4px;
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

/* ── Canvas Particle Overlay ── */
.hud-particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    clip-path: inset(0);
}

/* ── HUD Header Bar ── */
.hud-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 16px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.08);
    position: relative;
    z-index: 2;
}

.hud-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hud-header-label {
    font-size: 0.48rem;
    font-weight: 600;
    color: rgba(0, 229, 255, 0.55);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-family: var(--font-mono, monospace);
}

.hud-header-src {
    font-size: 0.4rem;
    color: rgba(56, 189, 248, 0.45);
    letter-spacing: 0.08em;
    font-family: var(--font-mono, monospace);
}

.hud-header-right {
    display: flex;
    align-items: center;
}

.hud-live-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.45rem;
    font-weight: 700;
    color: rgba(0, 229, 255, 0.6);
    letter-spacing: 0.12em;
    font-family: var(--font-mono, monospace);
}

.hud-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00e5ff;
    box-shadow: 0 0 6px #00e5ff, 0 0 12px rgba(0, 229, 255, 0.3);
    animation: hud-pulse 2s ease-in-out infinite;
}

@keyframes hud-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px #00e5ff, 0 0 12px rgba(0, 229, 255, 0.3); }
    50% { opacity: 0.4; box-shadow: 0 0 3px #00e5ff, 0 0 6px rgba(0, 229, 255, 0.15); }
}

/* ── Gauge Grid ── */
.hud-gauges {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1.5fr;
    align-items: stretch;
    position: relative;
    z-index: 2;
    max-width: 100%;
    overflow: hidden;
}

.hud-instrument {
    padding: 2px 8px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.4s ease-out;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.hud-instrument::after {
    content: '';
    position: absolute;
    right: 0;
    top: 8%;
    height: 84%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(0, 229, 255, 0.15) 20%, rgba(0, 229, 255, 0.08) 80%, transparent);
    transition: opacity 0.4s ease-out;
}

.hud-instrument:last-child::after {
    display: none;
}

.hud-instrument:hover {
    background-color: rgba(0, 229, 255, 0.03);
}

.hud-instrument:hover .hud-click-hint {
    opacity: 1;
}

.hud-instrument.hud-active {
    background-color: rgba(0, 229, 255, 0.06);
    box-shadow: inset 0 0 30px rgba(0, 229, 255, 0.04);
}

/* ── Instrument Labels ── */
.hud-inst-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.hud-inst-label {
    font-size: 0.5rem;
    font-weight: 600;
    color: rgba(0, 229, 255, 0.65);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: var(--font-mono, monospace);
}

.hud-inst-label::before {
    content: '▸ ';
    color: rgba(0, 229, 255, 0.2);
    font-size: 0.45rem;
}

.hud-inst-value {
    font-size: 0.55rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    letter-spacing: 0.06em;
}

.hud-inst-body {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    flex: 1;
    min-width: 0;
    max-height: 120px;
}

/* Force all gauge SVGs + canvases to scale within their container height */
.hud-inst-body svg {
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block;
}
.hud-inst-body canvas {
    max-height: 100% !important;
}
/* Bz gauge container: constrain the entire flex column (scoped to bz only) */
[data-gauge="bz"] .hud-inst-body > div {
    max-height: 100%;
    overflow: hidden;
}
/* Aurora + Solar: allow overflow for SVG content */
[data-gauge="aurora"] .hud-inst-body > div,
[data-gauge="solar"] .hud-inst-body > div {
    max-height: none;
    overflow: visible;
}
[data-gauge="solar"] .hud-inst-body {
    overflow: visible;
    min-height: 120px;
}
[data-gauge="solar"] {
    overflow: visible;
}

/* ── Aurora Hero Gauge — wider column, distinct treatment ── */
[data-gauge="aurora"] {
    overflow: visible;
    border-left: 1px solid rgba(52, 211, 153, 0.12);
    background: rgba(52, 211, 153, 0.015);
}
[data-gauge="aurora"] .hud-inst-body {
    overflow: visible;
}
[data-gauge="aurora"] .hud-inst-body svg {
    max-height: none !important;
    width: 100% !important;
    max-width: 120px !important;
    height: auto !important;
}

/* ── Cinematic Boot Sequence ── */
.hud-instruments.hud-booting .hud-instrument {
    opacity: 0;
}

.hud-instruments.hud-booting .hud-header {
    opacity: 0;
}

.hud-instruments.hud-booting .hud-trends {
    opacity: 0;
}

/* Boot scanline effect */
.hud-instruments::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 229, 255, 0) 10%,
        rgba(0, 229, 255, 0.8) 50%,
        rgba(0, 229, 255, 0) 90%,
        transparent 100%);
    z-index: 100;
    opacity: 0;
    transform: translateY(0);
    pointer-events: none;
}

.hud-instruments.hud-scan-active::before {
    animation: hud-boot-scan 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes hud-boot-scan {
    0%   { opacity: 0; transform: translateY(0); }
    10%  { opacity: 1; }
    90%  { opacity: 0.6; }
    100% { opacity: 0; transform: translateY(calc(100% + 200px)); }
}

/* Power-on reveal for header */
.hud-header.hud-powered-on {
    animation: hud-power-on 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Power-on reveal for each gauge */
.hud-instrument.hud-gauge-boot {
    animation: hud-gauge-boot 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes hud-gauge-boot {
    0% {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
        filter: brightness(0.3);
    }
    40% {
        opacity: 1;
        filter: brightness(1.6);
    }
    70% {
        filter: brightness(1.15);
        transform: translateY(-1px) scale(1.01);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: brightness(1);
    }
}

@keyframes hud-power-on {
    0% {
        opacity: 0;
        filter: brightness(0.2);
    }
    50% {
        opacity: 1;
        filter: brightness(1.8);
    }
    100% {
        opacity: 1;
        filter: brightness(1);
    }
}

/* Trends power-on */
.hud-trends.hud-powered-on {
    animation: hud-trends-boot 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes hud-trends-boot {
    0% {
        opacity: 0;
        transform: translateY(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Border glow flash on boot complete */
.hud-instruments.hud-boot-complete {
    animation: hud-border-flash 1.5s ease-out forwards;
}

@keyframes hud-border-flash {
    0%   { border-color: rgba(0, 229, 255, 0.6); box-shadow: 0 0 20px rgba(0, 229, 255, 0.15), inset 0 0 20px rgba(0, 229, 255, 0.05); }
    100% { border-color: rgba(0, 229, 255, 0.12); box-shadow: none; }
}

/* ── Sparkline Draw-On Animation ── */
/* Stroke draws left-to-right; fill fades in after stroke completes */
.sparkline-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.sparkline-fill {
    opacity: 0;
}

/* When trends section powers on, trigger staggered sparkline draw */
.hud-trends.hud-powered-on .hud-trends-grid > div:nth-child(1) .sparkline-path {
    animation: sparkline-draw 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}
.hud-trends.hud-powered-on .hud-trends-grid > div:nth-child(2) .sparkline-path {
    animation: sparkline-draw 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.25s forwards;
}
.hud-trends.hud-powered-on .hud-trends-grid > div:nth-child(3) .sparkline-path {
    animation: sparkline-draw 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards;
}
.hud-trends.hud-powered-on .hud-trends-grid > div:nth-child(4) .sparkline-path {
    animation: sparkline-draw 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.55s forwards;
}

@keyframes sparkline-draw {
    0%   { stroke-dashoffset: 1000; opacity: 0.85; }
    100% { stroke-dashoffset: 0; opacity: 0.85; }
}

/* Fill fades in after stroke draw completes */
.hud-trends.hud-powered-on .hud-trends-grid > div:nth-child(1) .sparkline-fill {
    animation: sparkline-fill-in 0.8s ease-out 1.0s forwards;
}
.hud-trends.hud-powered-on .hud-trends-grid > div:nth-child(2) .sparkline-fill {
    animation: sparkline-fill-in 0.8s ease-out 1.15s forwards;
}
.hud-trends.hud-powered-on .hud-trends-grid > div:nth-child(3) .sparkline-fill {
    animation: sparkline-fill-in 0.8s ease-out 1.3s forwards;
}
.hud-trends.hud-powered-on .hud-trends-grid > div:nth-child(4) .sparkline-fill {
    animation: sparkline-fill-in 0.8s ease-out 1.45s forwards;
}

@keyframes sparkline-fill-in {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

/* Pulsing endpoint dot hidden until draw completes, then pops in */
.hud-trends-grid svg circle {
    opacity: 0;
}
.hud-trends.hud-powered-on .hud-trends-grid > div:nth-child(1) svg circle {
    animation: sparkline-dot-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 1.1s both;
}
.hud-trends.hud-powered-on .hud-trends-grid > div:nth-child(2) svg circle {
    animation: sparkline-dot-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 1.25s both;
}
.hud-trends.hud-powered-on .hud-trends-grid > div:nth-child(3) svg circle {
    animation: sparkline-dot-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 1.4s both;
}
.hud-trends.hud-powered-on .hud-trends-grid > div:nth-child(4) svg circle {
    animation: sparkline-dot-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 1.55s both;
}

@keyframes sparkline-dot-in {
    0%   { opacity: 0; transform: scale(0); }
    60%  { opacity: 1; transform: scale(1.6); }
    100% { opacity: 0.9; transform: scale(1); }
}

/* ── Gauge Divider Glow on Boot ── */
/* Flash the divider line bright cyan when each gauge boots in */
.hud-instrument.hud-gauge-boot::after {
    animation: hud-divider-boot-flash 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards, hud-divider-shimmer 3s ease-in-out 0.8s infinite !important;
}

@keyframes hud-divider-boot-flash {
    0%   { opacity: 0; box-shadow: none; }
    30%  { opacity: 1; box-shadow: 0 0 8px rgba(0, 229, 255, 0.6), 0 0 16px rgba(0, 229, 255, 0.3); }
    60%  { opacity: 1; box-shadow: 0 0 4px rgba(0, 229, 255, 0.3); }
    100% { opacity: 0.6; box-shadow: none; }
}

.hud-click-hint {
    position: absolute;
    bottom: 4px;
    right: 8px;
    font-size: 0.4rem;
    color: rgba(0, 229, 255, 0.15);
    font-family: var(--font-mono, monospace);
    letter-spacing: 0.06em;
    opacity: 0;
    transition: opacity 0.4s ease-out;
    pointer-events: none;
}

/* ── Click overlay (sits on top of SVG to capture clicks) ── */
.hud-inst-click-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    cursor: pointer;
}

/* ── Trends Row ── */
.hud-trends {
    border-top: none;
    padding: 2px 16px 4px;
    position: relative;
    z-index: 2;
}

.hud-trends::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.15) 20%, rgba(0, 229, 255, 0.15) 80%, transparent);
}

.hud-trends-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.45rem;
    font-weight: 700;
    color: rgba(0, 229, 255, 0.35);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-family: var(--font-mono, monospace);
    margin-bottom: 2px;
}

.hud-trends-header-label::before {
    content: '▸ ';
    color: rgba(0, 229, 255, 0.15);
}

.hud-trends-header .er-expand-chevron {
    width: 14px;
    height: 14px;
    font-size: 0.4rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

.hud-trends-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 8px;
}

.hud-trends-grid > div {
    min-width: 0;
    overflow: visible;
    position: relative;
}

.hud-trends-grid > div[data-trend] {
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    padding: 4px;
    margin: -4px;
}
.hud-trends-grid > div[data-trend]:hover {
    background: rgba(0, 229, 255, 0.04);
}

.hud-trends-grid svg {
    display: block;
    width: 100%;
    height: 28px;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,1) 8%, rgba(0,0,0,1) 92%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,1) 8%, rgba(0,0,0,1) 92%, transparent 100%);
}

.hud-trend-label {
    font-size: 0.4rem;
    color: rgba(0, 229, 255, 0.25);
    letter-spacing: 0.06em;
    font-family: var(--font-mono, monospace);
    text-transform: uppercase;
    margin-bottom: 4px;
}

/* ── Trends Collapse ── */
.hud-trends {
    max-height: 200px;
    transition: max-height 0.4s ease, opacity 0.35s ease, padding 0.4s ease;
}

.hud-trends.hud-trends-collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}

.hud-trends.hud-trends-collapsed .hud-trends-grid {
    display: none;
}

.hud-trends.hud-trends-collapsed .hud-trends-header .er-expand-chevron {
    transform: rotate(180deg);
}

/* ── Briefing Entrance + Collapse ── */
.er-briefing {
    max-height: 400px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease,
                padding 0.4s ease,
                border-width 0.4s ease;
}

.er-briefing.er-briefing-hidden {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom-width: 0;
    overflow: hidden;
}

.er-briefing.er-briefing-visible {
    animation: erBriefingEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.er-briefing.er-briefing-collapsed {
    max-height: 28px;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease;
}

.er-briefing.er-briefing-collapsed .er-briefing-narrative {
    display: none;
}

.er-briefing.er-briefing-collapsed .er-expand-chevron {
    transform: rotate(0deg);
}

@keyframes erBriefingEntrance {
    0% {
        max-height: 0;
        opacity: 0;
        transform: translateY(-4px);
    }
    40% {
        opacity: 0.7;
    }
    100% {
        max-height: 400px;
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════
   HUD MODAL — Expanded Gauge Detail
   ═══════════════════════════════════════════════════ */
.hud-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 4, 12, 0.25);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 9000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.hud-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 480px;
    max-width: 90vw;
    max-height: 70vh;
    background: rgba(0, 8, 20, 0.95);
    border: 1px solid rgba(0, 229, 255, 0.15);
    border-radius: 12px;
    z-index: 9001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    /* HUD corner brackets — gradient fade */
    background-image:
        linear-gradient(to right, rgba(0,229,255,0.3), transparent),
        linear-gradient(to bottom, rgba(0,229,255,0.3), transparent),
        linear-gradient(to left, rgba(0,229,255,0.15), transparent),
        linear-gradient(to bottom, rgba(0,229,255,0.15), transparent),
        linear-gradient(to right, rgba(0,229,255,0.15), transparent),
        linear-gradient(to top, rgba(0,229,255,0.15), transparent),
        linear-gradient(to left, rgba(0,229,255,0.3), transparent),
        linear-gradient(to top, rgba(0,229,255,0.3), transparent);
    background-size:
        14px 1px, 1px 14px,
        14px 1px, 1px 14px,
        14px 1px, 1px 14px,
        14px 1px, 1px 14px;
    background-position:
        0 0, 0 0,
        100% 0, 100% 0,
        0 100%, 0 100%,
        100% 100%, 100% 100%;
    background-repeat: no-repeat;
}

.hud-modal.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.hud-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.08);
}

.hud-modal-title {
    font-size: 0.55rem;
    font-weight: 700;
    color: rgba(0, 229, 255, 0.6);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-family: var(--font-mono, monospace);
}

.hud-modal-title::before {
    content: '▸ ';
    color: rgba(0, 229, 255, 0.3);
}

.hud-modal-close {
    background: none;
    border: 1px solid rgba(0, 229, 255, 0.1);
    color: rgba(0, 229, 255, 0.4);
    font-size: 1rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.3s ease-out;
    font-family: var(--font-mono, monospace);
}

.hud-modal-close:hover {
    color: rgba(0, 229, 255, 0.8);
    border-color: rgba(0, 229, 255, 0.3);
    background: rgba(0, 229, 255, 0.05);
}

.hud-modal-content {
    padding: 16px;
}

.hud-modal-body {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    align-items: start;
}

.hud-modal-hero {
    text-align: center;
    min-width: 120px;
}

.hud-modal-big-value {
    font-size: 2.2rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    line-height: 1;
    text-shadow: 0 0 20px currentColor;
    animation: hud-value-breathe 3s ease-in-out infinite;
}

@keyframes hud-value-breathe {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.hud-modal-unit {
    font-size: 0.6rem;
    opacity: 0.4;
    margin-left: 4px;
    font-weight: 400;
}

.hud-modal-status {
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    font-family: var(--font-mono, monospace);
    margin-top: 6px;
}

.hud-modal-details {
    font-family: var(--font-mono, monospace);
}

.hud-modal-info-title {
    font-size: 0.5rem;
    font-weight: 700;
    color: rgba(0, 229, 255, 0.5);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.hud-modal-info-text {
    font-size: 0.5rem;
    color: rgba(0, 229, 255, 0.35);
    line-height: 1.6;
    letter-spacing: 0.02em;
}

/* Range bar */
.hud-modal-range {
    margin-top: 10px;
}

.hud-modal-range-bar {
    height: 4px;
    background: rgba(0, 229, 255, 0.06);
    border-radius: 2px;
    position: relative;
    overflow: visible;
}

.hud-modal-range-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease-out;
    box-shadow: 0 0 8px currentColor;
}

.hud-modal-range-marker {
    position: absolute;
    top: -3px;
    width: 2px;
    height: 10px;
    background: #fff;
    border-radius: 1px;
    transform: translateX(-1px);
    box-shadow: 0 0 6px rgba(255,255,255,0.5);
}

.hud-modal-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.4rem;
    color: rgba(0, 229, 255, 0.2);
    margin-top: 4px;
    font-family: var(--font-mono, monospace);
}

/* Metrics row */
.hud-modal-metrics {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 229, 255, 0.06);
}

.hud-modal-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hud-modal-metric-val {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(0, 229, 255, 0.7);
    font-family: var(--font-mono, monospace);
}

.hud-modal-metric-label {
    font-size: 0.4rem;
    color: rgba(0, 229, 255, 0.25);
    letter-spacing: 0.06em;
    font-family: var(--font-mono, monospace);
}

/* Bz diagram */
.hud-modal-bz-diagram {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-top: 10px;
    height: 80px;
}

.hud-modal-bz-bar {
    width: 16px;
    background: rgba(0, 229, 255, 0.04);
    border: 1px solid rgba(0, 229, 255, 0.08);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.hud-modal-bz-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transition: height 0.6s ease-out;
    border-radius: 2px;
    box-shadow: 0 0 8px currentColor;
}

.hud-modal-bz-zero {
    position: absolute;
    top: 50%;
    left: -2px;
    right: -2px;
    height: 1px;
    background: rgba(0, 229, 255, 0.3);
}

.hud-modal-bz-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.4rem;
    font-family: var(--font-mono, monospace);
}

/* City list */
.hud-modal-city-list {
    font-size: 0.5rem;
    font-family: var(--font-mono, monospace);
    line-height: 1.8;
    letter-spacing: 0.02em;
}

/* ── Modal Staggered Entry Animations ── */
.hud-stagger-1 { animation: hud-slide-up 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.05s both; }
.hud-stagger-2 { animation: hud-slide-up 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.15s both; }
.hud-stagger-3 { animation: hud-slide-up 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.25s both; }
.hud-stagger-4 { animation: hud-slide-up 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.35s both; }

.hud-fade-in { animation: hud-fade 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both; }

@keyframes hud-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes hud-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Animated property transitions for bars/fills */
.hud-animate-width {
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}

.hud-animate-left {
    transition: left 1s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}

.hud-animate-height {
    transition: height 1s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}

/* ═══════════════════════════════════════════════════
   AMBIENT MOTION — CSS Breathing Animations
   ═══════════════════════════════════════════════════ */

/* Instrument entrance — handled by JS boot sequence now */

/* HUD header label breathing */
.hud-header-label {
    animation: hud-label-breathe 4s ease-in-out infinite;
}
@keyframes hud-label-breathe {
    0%, 100% { letter-spacing: 0.12em; opacity: 0.55; }
    50%      { letter-spacing: 0.13em; opacity: 0.7; }
}

/* Source label pulse */
.hud-header-src {
    animation: hud-src-pulse 6s ease-in-out infinite;
}
@keyframes hud-src-pulse {
    0%, 100% { opacity: 0.35; }
    50%      { opacity: 0.5; }
}

/* Divider line shimmer (staggered per divider) */
.hud-instrument::after {
    animation: hud-divider-shimmer 3s ease-in-out infinite;
}
.hud-instrument:nth-child(2)::after { animation-delay: 1s; }
.hud-instrument:nth-child(3)::after { animation-delay: 2s; }

@keyframes hud-divider-shimmer {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1; }
}

/* Trends arrow pulse */
.hud-trends-header-label::before {
    display: inline-block;
    animation: hud-arrow-pulse 2s ease-in-out infinite;
}
@keyframes hud-arrow-pulse {
    0%, 100% { opacity: 0.15; }
    50%      { opacity: 0.4; }
}

/* Sparkline grid staggered entrance */
.hud-trends-grid > div {
    animation: hud-slide-up 0.5s cubic-bezier(0.4,0,0.2,1) both;
}
.hud-trends-grid > div:nth-child(1) { animation-delay: 0.5s; }
.hud-trends-grid > div:nth-child(2) { animation-delay: 0.6s; }
.hud-trends-grid > div:nth-child(3) { animation-delay: 0.7s; }
.hud-trends-grid > div:nth-child(4) { animation-delay: 0.8s; }

/* Briefing stat pills border glow cycle */
.er-briefing-stat {
    border: 1px solid var(--hud-border, rgba(0,229,255,0.12));
    animation: hud-stat-breathe 5s ease-in-out infinite;
}
.er-briefing-stat:nth-child(2) { animation-delay: 1s; }
.er-briefing-stat:nth-child(3) { animation-delay: 2s; }
.er-briefing-stat:nth-child(4) { animation-delay: 3s; }
.er-briefing-stat:nth-child(5) { animation-delay: 4s; }

@keyframes hud-stat-breathe {
    0%, 100% { border-color: var(--hud-border, rgba(0,229,255,0.12)); }
    50%      { border-color: var(--hud-border-bright, rgba(0,229,255,0.35)); }
}

/* ── HUD Responsive ── */
/* ALWAYS keep gauges in a single 4-column row — never wrap to 2x2 */
@media (max-width: 1024px) {
    .hud-gauges {
        grid-template-columns: 1fr 1fr 1fr 1.4fr;
    }
    .hud-instrument {
        padding: 2px 4px;
    }
    .hud-inst-body {
        min-height: 55px;
    }
    /* Bz gauge: scale down readout for tablets */
    .hud-inst-body .er-bz-readout {
        font-size: 0.9rem !important;
        min-width: 0 !important;
    }
    .hud-inst-body canvas {
        height: 45px !important;
    }
    .hud-trends-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .hud-trends {
        padding: 2px 10px;
    }
    .hud-trends-header {
        margin-bottom: 1px;
        font-size: 0.35rem;
    }
    .hud-trend-label {
        font-size: 0.3rem;
        margin-bottom: 1px;
    }
    .hud-modal {
        width: 420px;
        max-width: 90vw;
    }
}

@media (max-width: 600px) {
    .hud-gauges {
        grid-template-columns: 1fr 1fr 1fr 1.3fr;
    }
    .hud-instrument {
        padding: 1px 2px;
    }
    .hud-inst-header {
        margin-bottom: 0;
        gap: 3px;
        align-items: flex-start;
    }
    .hud-inst-label {
        font-size: 0.35rem;
        letter-spacing: 0.04em;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .hud-inst-label::before {
        display: none;
    }
    .hud-inst-value {
        font-size: 0.3rem;
        white-space: normal;
        overflow-wrap: anywhere;
        text-align: right;
        line-height: 1.2;
    }
    .hud-inst-body {
        min-height: 40px;
    }
    /* Bz gauge: shrink readout + hide range labels on mobile */
    .hud-inst-body .er-bz-readout {
        font-size: 0.65rem !important;
        min-width: 0 !important;
    }
    .hud-inst-body .er-bz-readout span {
        font-size: 0.35rem !important;
    }
    .hud-inst-body canvas {
        height: 22px !important;
    }
    [data-gauge="solar"] .hud-inst-body svg,
    [data-gauge="aurora"] .hud-inst-body svg {
        width: 100% !important;
        max-width: 100% !important;
    }
    /* Tighten Bz flex layout on mobile */
    .hud-inst-body > div > div:first-child {
        gap: 4px !important;
        margin-bottom: 2px !important;
    }
    /* Hide Bz range labels (+20 nT / 0 / -20 nT) and status on small screens */
    #bz-status {
        display: none;
    }
    .hud-inst-body > div > div:last-child {
        display: none;
    }
    .hud-trends {
        padding: 1px 8px;
    }
    .hud-trends-header {
        font-size: 0.3rem;
        margin-bottom: 0;
    }
    .hud-trends-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2px;
    }
    .hud-trend-label {
        font-size: 0.25rem;
        margin-bottom: 0;
    }
    .hud-click-hint {
        display: none;
    }
    .hud-modal {
        width: 95vw;
        max-width: 95vw;
        max-height: 80vh;
    }
    .hud-modal-body {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .hud-modal-big-value {
        font-size: 1.6rem;
    }
}

/* ── Map Section (full-width) ── */
.er-map-section {
    position: relative;
    width: 100%;
}

/* Hide Leaflet attribution badge */
.leaflet-control-attribution {
    display: none !important;
}

.er-map-container {
    position: relative;
    width: 100%;
    height: 40vh;
    max-height: 400px;
    overflow: hidden;
    background: var(--th-bg-void, #08090c);
}

/* Stat chips — floating overlay at top of map */
.er-map-stats {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    display: flex;
    gap: 6px;
    pointer-events: none;
}
.er-map-stats .er-briefing-stat {
    pointer-events: auto;
    background: rgba(0, 6, 14, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 229, 255, 0.1);
    border-radius: 3px;
    padding: 3px 8px;
    gap: 4px;
}

/* Controls — bottom of map */
.er-map-controls {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    display: flex;
    gap: 4px;
}

.er-map-btn {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.45rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: 1px solid rgba(0, 229, 255, 0.12);
    background: rgba(0, 6, 14, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(0, 229, 255, 0.5);
    cursor: pointer;
    transition: all var(--em-transition);
    font-family: var(--font-mono, monospace);
    display: flex;
    align-items: center;
    gap: 4px;
}

.er-map-btn:hover {
    background: var(--th-bg-surface-hover, #20232f);
    color: var(--th-text-primary, #e4e6ed);
    border-color: var(--th-border-accent, rgba(160,174,192,0.25));
    transform: translateY(-1px);
}

.er-map-btn.active {
    background: rgba(56, 189, 248, 0.12);
    color: var(--th-color-globe, #38bdf8);
    border-color: rgba(56, 189, 248, 0.3);
}

/* ── Fullscreen Map ── */
.er-map-fullscreen {
    position: fixed !important;
    inset: 0;
    z-index: 10000;
    height: 100vh !important;
    max-height: none !important;
    transition: none;
}

.er-map-fullscreen .er-map-controls {
    bottom: 16px;
}
.er-map-fullscreen .er-map-stats {
    top: 16px;
}

.er-fullscreen-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    background: var(--em-glass-strong);
    backdrop-filter: var(--em-glass-blur);
    -webkit-backdrop-filter: var(--em-glass-blur);
    border-top: 1px solid var(--th-border-strong, rgba(255,255,255,0.1));
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.er-fullscreen-bar.visible {
    transform: translateY(0);
}

body.er-fullscreen-active {
    overflow: hidden;
}

body.er-fullscreen-active .er-status-bar,
body.er-fullscreen-active .hud-instruments,
body.er-fullscreen-active .er-briefing,
body.er-fullscreen-active .em-content,
body.er-fullscreen-active .er-family-rollup,
body.er-fullscreen-active .er-domain-cards,
body.er-fullscreen-active .unified-nav,
body.er-fullscreen-active #unified-nav,
body.er-fullscreen-active #magna-site-footer {
    display: none !important;
}

/* ── Content Layout ── */
.earth-monitor .em-content {
    padding: 8px 14px;
}

.er-grid-main {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
}

/* ── Main Split: Events left, Detail right ── */
.er-main-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: start;
}

.er-split-left,
.er-split-right {
    min-width: 0;
}

@media (max-width: 1024px) {
    .er-main-split {
        grid-template-columns: 1fr;
    }
}

/* ── Active Event Cards ── */
.er-events-grid {
    display: grid;
    gap: 5px;
}

.er-event-card {
    background: var(--em-glass);
    backdrop-filter: var(--em-glass-blur);
    -webkit-backdrop-filter: var(--em-glass-blur);
    border: 1px solid var(--th-border, rgba(255,255,255,0.06));
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
}

.er-event-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--event-color, var(--th-text-muted));
    transition: width 0.3s ease;
}

.er-event-card:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.er-event-card:hover::before {
    width: 4px;
}

.er-event-card.highlighted {
    border-color: var(--event-color, rgba(255,255,255,0.2));
    box-shadow: 0 0 20px color-mix(in srgb, var(--event-color, #888) 20%, transparent);
}

.er-event-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.er-event-icon {
    font-size: 0.75rem;
}

.er-event-type {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--event-color, var(--th-text-heading));
    font-family: var(--font-mono, monospace);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.er-event-severity {
    height: 2px;
    border-radius: 1px;
    background: rgba(255,255,255,0.06);
    margin-bottom: 4px;
    overflow: hidden;
}

.er-event-severity-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--event-color);
    transition: width 0.6s ease;
}

.er-event-location {
    font-size: 0.65rem;
    color: var(--th-text-secondary, #8b8fa3);
    margin-bottom: 2px;
    line-height: 1.3;
}

.er-event-meta {
    font-size: 0.55rem;
    color: var(--th-text-muted, #50546a);
    font-family: var(--font-mono, monospace);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.er-event-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 0.5rem;
    color: var(--th-color-globe, #38bdf8);
    font-family: var(--font-mono, monospace);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.er-event-card:hover .er-event-link {
    opacity: 1;
}

/* ── Space Weather Gauges ── */
.er-space-weather {
    display: grid;
    gap: 12px;
}

.er-gauge-card {
    background: var(--em-glass);
    backdrop-filter: var(--em-glass-blur);
    -webkit-backdrop-filter: var(--em-glass-blur);
    border: 1px solid var(--th-border, rgba(255,255,255,0.06));
    border-radius: 8px;
    padding: 10px 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.er-gauge-card:hover {
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.er-gauge-title {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--th-text-heading, #f0f1f5);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: var(--font-mono, monospace);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.er-gauge-label {
    font-size: 0.6rem;
    color: var(--th-text-muted, #50546a);
    font-family: var(--font-mono, monospace);
}

/* Kp SVG bar gauge */
.er-kp-gauge {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 48px;
    padding: 4px 0;
}

.er-kp-segment {
    flex: 1;
    border-radius: 3px 3px 0 0;
    transition: all 0.4s ease;
    position: relative;
    min-height: 6px;
}

.er-kp-segment.active {
    box-shadow: 0 0 12px var(--seg-color);
}

.er-kp-segment-label {
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.5rem;
    font-family: var(--font-mono, monospace);
    color: var(--th-text-muted, #50546a);
}

/* Bz vertical gauge */
.er-bz-gauge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.er-bz-bar {
    flex: 1;
    height: 40px;
    border-radius: 4px;
    background: rgba(255,255,255,0.04);
    position: relative;
    overflow: hidden;
}

.er-bz-fill {
    position: absolute;
    left: 0;
    right: 0;
    border-radius: 4px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.er-bz-value {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    line-height: 1;
    min-width: 0;
    text-align: right;
}

.er-bz-unit {
    font-size: 0.6rem;
    color: var(--th-text-muted, #50546a);
    font-family: var(--font-mono, monospace);
}

/* Aurora probability */
.er-aurora-display {
    text-align: center;
    padding: 8px 0;
}

.er-aurora-pct {
    font-size: 2.4rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    color: #34d399;
    line-height: 1;
}

.er-aurora-cities {
    font-size: 0.65rem;
    color: var(--th-text-secondary, #8b8fa3);
    margin-top: 8px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
}

/* ── Seismic Feed Table ── */
.er-seismic-section {
    margin-top: 24px;
}

.er-seismic-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
}

.er-seismic-table th {
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--th-text-muted, #50546a);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: var(--font-mono, monospace);
    padding: 6px 8px;
    text-align: left;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
    border-bottom: 1px solid var(--th-border, rgba(255,255,255,0.06));
}

.er-seismic-table th:hover {
    color: var(--th-text-secondary, #8b8fa3);
}

.er-seismic-table th.sorted {
    color: var(--th-color-globe, #38bdf8);
}

.er-seismic-table th .sort-arrow {
    margin-left: 4px;
    font-size: 0.5rem;
}

.er-seismic-table td {
    padding: 6px 8px;
    font-size: 0.65rem;
    color: var(--th-text-secondary, #8b8fa3);
    font-family: var(--font-mono, monospace);
    background: var(--em-glass);
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.er-seismic-table td:first-child {
    border-radius: 8px 0 0 8px;
    border-left: 1px solid transparent;
}

.er-seismic-table td:last-child {
    border-radius: 0 8px 8px 0;
    border-right: 1px solid transparent;
}

.er-seismic-table tr.quake-row {
    cursor: pointer;
    transition: all 0.2s;
}

.er-seismic-table tr.quake-row:hover td {
    background: var(--th-bg-surface-hover, #20232f);
    border-color: var(--th-border, rgba(255,255,255,0.06));
}

.er-seismic-table tr.quake-row.highlighted td {
    border-color: var(--event-color, var(--th-color-globe, #38bdf8));
    box-shadow: 0 0 8px color-mix(in srgb, var(--event-color, #38bdf8) 15%, transparent);
}

.er-mag-cell {
    font-weight: 700;
    font-size: 0.8rem;
}

/* ── Notification Bell ── */
.er-bell-btn {
    position: relative;
    padding: 2px;
    border-radius: 3px;
    border: 1px solid var(--th-border-strong, rgba(255,255,255,0.08));
    background: var(--em-glass);
    backdrop-filter: blur(8px);
    color: var(--th-text-secondary, #8b8fa3);
    cursor: pointer;
    transition: all var(--em-transition);
    font-size: 0.7rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.er-bell-btn .er-bell-icon {
    width: 12px;
    height: 12px;
}
.er-share-btn {
    padding: 2px 5px;
    border: 1px solid rgba(0, 229, 255, 0.12);
    background: rgba(0, 12, 24, 0.5);
    color: rgba(0, 229, 255, 0.4);
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 3px;
    font-family: var(--font-mono, monospace);
    font-size: 0.4rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.er-share-btn svg {
    width: 9px;
    height: 9px;
}

.er-share-btn:hover {
    color: rgba(0, 229, 255, 0.8);
    border-color: rgba(0, 229, 255, 0.35);
    background: rgba(0, 229, 255, 0.06);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.1);
}

.er-bell-icon {
    display: block;
    transition: transform 0.2s ease, filter 0.3s ease;
}
.er-bell-btn:hover .er-bell-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.4));
}
.er-bell-btn.has-unread .er-bell-icon {
    color: #38bdf8;
    animation: er-pulse-icon 2s ease-in-out infinite;
}
@keyframes er-pulse-icon {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(56, 189, 248, 0.2)); }
    50% { filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6)); }
}

.er-bell-btn:hover {
    background: var(--th-bg-surface-hover, #20232f);
    color: var(--th-text-primary, #e4e6ed);
}

.er-bell-badge {
    position: absolute;
    top: -3px;
    right: -5px;
    min-width: 11px;
    height: 11px;
    border-radius: 2px;
    background: rgba(0, 12, 24, 0.85);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: rgba(0, 229, 255, 0.8);
    font-size: 0.35rem;
    font-weight: 600;
    font-family: var(--font-mono, monospace);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
    letter-spacing: -0.02em;
    text-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
    box-shadow: 0 0 4px rgba(0, 229, 255, 0.1);
}

.er-bell-badge.hidden {
    display: none;
}

/* ── Notification Modal ── */
.er-notif-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 440px;
    max-width: 92vw;
    max-height: 80vh;
    z-index: 10002;
    background: var(--em-glass-strong);
    backdrop-filter: var(--em-glass-blur);
    -webkit-backdrop-filter: var(--em-glass-blur);
    border: 1px solid var(--th-border-strong, rgba(255,255,255,0.1));
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.er-notif-modal.open {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}

.er-notif-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--th-border, rgba(255,255,255,0.06));
}

.er-notif-modal-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--th-text-heading, #f0f1f5);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: var(--font-mono, monospace);
}

.er-notif-modal-actions {
    display: flex;
    gap: 6px;
}

.er-notif-panel-btn {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--th-border, rgba(255,255,255,0.06));
    background: none;
    color: var(--th-text-muted, #50546a);
    font-size: 0.55rem;
    font-family: var(--font-mono, monospace);
    cursor: pointer;
    transition: all 0.2s;
}

.er-notif-panel-btn:hover {
    color: var(--th-text-primary, #e4e6ed);
    border-color: var(--th-border-strong, rgba(255,255,255,0.12));
}

/* Subscription status bar in notification panel */
.er-sub-status {
    padding: 10px 20px;
    border-bottom: 1px solid var(--th-border, rgba(255,255,255,0.06));
    background: rgba(56, 189, 248, 0.03);
}

.er-sub-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.er-sub-status-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--th-text-heading, #f0f1f5);
    font-family: var(--font-mono, monospace);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.er-sub-status-active {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.55rem;
    color: #34d399;
    font-family: var(--font-mono, monospace);
}

.er-sub-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    animation: er-sub-pulse 2s ease-in-out infinite;
}

@keyframes er-sub-pulse {
    0%, 100% { opacity: 0.5; box-shadow: 0 0 2px #34d399; }
    50% { opacity: 1; box-shadow: 0 0 6px #34d399; }
}

.er-sub-status-detail {
    font-size: 0.5rem;
    color: var(--th-text-muted, #50546a);
    font-family: var(--font-mono, monospace);
    margin-top: 4px;
}

.er-sub-configure-btn {
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    background: rgba(56, 189, 248, 0.08);
    color: #38bdf8;
    font-size: 0.55rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.er-sub-configure-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.5);
    transform: translateY(-1px);
}

.er-notif-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    max-height: 300px;
}

.er-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.er-notif-item:hover {
    background: rgba(255,255,255,0.03);
}

.er-notif-item.unread {
    background: rgba(56, 189, 248, 0.03);
}

.er-notif-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--th-color-globe, #38bdf8);
    flex-shrink: 0;
    margin-top: 6px;
}

.er-notif-item:not(.unread) .er-notif-dot {
    opacity: 0;
}

.er-notif-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.er-notif-content {
    flex: 1;
    min-width: 0;
}

.er-notif-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--th-text-primary, #e4e6ed);
    margin-bottom: 2px;
}

.er-notif-time {
    font-size: 0.55rem;
    color: var(--th-text-muted, #50546a);
    font-family: var(--font-mono, monospace);
}

/* ── Toast Notifications ── */
.er-toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10003;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.er-toast {
    pointer-events: all;
    background: var(--em-glass-strong);
    backdrop-filter: var(--em-glass-blur);
    -webkit-backdrop-filter: var(--em-glass-blur);
    border: 1px solid var(--th-border-strong, rgba(255,255,255,0.1));
    border-radius: 12px;
    padding: 12px 16px;
    min-width: 280px;
    max-width: 380px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    animation: er-toast-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.er-toast.removing {
    animation: er-toast-out 0.3s ease-in forwards;
}

.er-toast-stripe {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--toast-color, var(--th-text-muted));
}

.er-toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-left: 6px;
}

.er-toast-body {
    flex: 1;
    min-width: 0;
}

.er-toast-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--th-text-primary, #e4e6ed);
    margin-bottom: 2px;
}

.er-toast-desc {
    font-size: 0.6rem;
    color: var(--th-text-secondary, #8b8fa3);
    font-family: var(--font-mono, monospace);
}

.er-toast-close {
    background: none;
    border: none;
    color: var(--th-text-muted, #50546a);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px;
    transition: color 0.2s;
    flex-shrink: 0;
}

.er-toast-close:hover {
    color: var(--th-text-primary, #e4e6ed);
}

.er-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--toast-color, var(--th-text-muted));
    border-radius: 0 0 0 12px;
    transition: width linear;
}

@keyframes er-toast-in {
    from { opacity: 0; transform: translateX(40px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes er-toast-out {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(40px) scale(0.95); }
}

/* ── Earth Intelligence Settings Modal ── */
.er-settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 10004;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.er-settings-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.er-settings-modal {
    background: var(--em-glass-strong, rgba(12, 13, 20, 0.95));
    backdrop-filter: var(--em-glass-blur);
    -webkit-backdrop-filter: var(--em-glass-blur);
    border: 1px solid var(--th-border-strong, rgba(255,255,255,0.1));
    border-radius: 16px;
    width: 480px;
    max-width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.7), 0 0 1px rgba(56,189,248,0.15);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.er-settings-overlay.open .er-settings-modal {
    transform: scale(1);
}

/* scrollbar */
.er-settings-modal::-webkit-scrollbar { width: 4px; }
.er-settings-modal::-webkit-scrollbar-track { background: transparent; }
.er-settings-modal::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

/* Intel header */
.er-intel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--th-border, rgba(255,255,255,0.06));
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 2;
}

.er-intel-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.er-intel-icon {
    color: #38bdf8;
    opacity: 0.8;
}

.er-intel-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--th-text-heading, #f0f1f5);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: var(--font-mono, monospace);
}

.er-intel-close {
    background: none;
    border: none;
    color: var(--th-text-muted, #50546a);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s;
}

.er-intel-close:hover {
    color: var(--th-text-primary, #e4e6ed);
}

/* Auth gate */
.er-intel-auth-gate {
    padding: 40px 24px;
    text-align: center;
}

.er-intel-auth-msg {
    font-size: 0.65rem;
    color: var(--th-text-secondary, #8b8fa3);
    font-family: var(--font-mono, monospace);
    margin-bottom: 16px;
}

.er-intel-signin-btn {
    padding: 8px 24px;
    border-radius: 8px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.2s;
}

.er-intel-signin-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
}

/* Intel config sections */
.er-intel-config {
    padding: 0 24px 24px;
}

.er-intel-section {
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.er-intel-section:last-of-type {
    border-bottom: none;
}

.er-intel-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--th-text-heading, #f0f1f5);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: var(--font-mono, monospace);
    margin-bottom: 12px;
}

.er-intel-section-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Location row */
.er-intel-loc-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.er-intel-input-wrap {
    position: relative;
    flex: 0 0 100px;
}

.er-intel-input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--th-border-strong, rgba(255,255,255,0.1));
    background: rgba(0,0,0,0.35);
    color: var(--th-text-primary, #e4e6ed);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-mono, monospace);
    letter-spacing: 0.15em;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: center;
}

.er-intel-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.er-intel-input::placeholder {
    color: var(--th-text-muted, #50546a);
    letter-spacing: 0.08em;
    font-weight: 400;
}

.er-intel-radius-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.er-intel-range {
    flex: 1;
    accent-color: #38bdf8;
    height: 4px;
}

.er-intel-range-val {
    font-size: 0.6rem;
    font-weight: 700;
    color: #38bdf8;
    font-family: var(--font-mono, monospace);
    min-width: 42px;
    text-align: right;
    white-space: nowrap;
}

.er-intel-loc-resolved {
    font-size: 0.55rem;
    color: var(--th-text-muted, #50546a);
    font-family: var(--font-mono, monospace);
    margin-top: 6px;
    min-height: 14px;
}

/* Category toggles */
.er-intel-categories {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.er-intel-cat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.04);
    background: rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.2s;
}

.er-intel-cat:hover {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
}

.er-intel-cat input[type="checkbox"] {
    display: none;
}

.er-intel-cat-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid var(--cat-color, #8b8fa3);
    background: transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}

.er-intel-cat input:checked ~ .er-intel-cat-indicator {
    background: var(--cat-color, #8b8fa3);
    box-shadow: 0 0 6px color-mix(in srgb, var(--cat-color, #8b8fa3) 50%, transparent);
}

.er-intel-cat-name {
    font-size: 0.6rem;
    color: var(--th-text-secondary, #8b8fa3);
    font-family: var(--font-mono, monospace);
    transition: color 0.2s;
}

.er-intel-cat input:checked ~ .er-intel-cat-name {
    color: var(--th-text-primary, #e4e6ed);
}

/* Threshold rows */
.er-intel-threshold-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.6rem;
    color: var(--th-text-secondary, #8b8fa3);
    font-family: var(--font-mono, monospace);
}

.er-intel-threshold-label {
    font-size: 0.6rem;
    color: var(--th-text-secondary, #8b8fa3);
    font-family: var(--font-mono, monospace);
}

.er-intel-threshold-ctrl {
    display: flex;
    align-items: center;
    gap: 8px;
}

.er-intel-threshold-ctrl .er-intel-range {
    width: 100px;
}

.er-intel-threshold-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.6rem;
    color: var(--th-text-secondary, #8b8fa3);
    font-family: var(--font-mono, monospace);
}

.er-intel-threshold-check input[type="checkbox"] {
    accent-color: #38bdf8;
    width: 13px;
    height: 13px;
}

/* Time inputs */
.er-intel-time {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--th-border-strong, rgba(255,255,255,0.1));
    border-radius: 6px;
    color: var(--th-text-primary, #e4e6ed);
    padding: 4px 8px;
    font-size: 0.6rem;
    font-family: var(--font-mono, monospace);
}

/* Delivery grid */
.er-intel-delivery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}

.er-intel-delivery-opt {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.04);
    background: rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.2s;
}

.er-intel-delivery-opt:hover {
    border-color: rgba(255,255,255,0.08);
}

.er-intel-delivery-opt input[type="checkbox"] {
    accent-color: #34d399;
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.er-intel-del-label {
    font-size: 0.55rem;
    color: var(--th-text-secondary, #8b8fa3);
    font-family: var(--font-mono, monospace);
    white-space: nowrap;
}

/* Frequency toggle */
.er-intel-freq-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
}

.er-intel-freq-btns {
    display: flex;
    gap: 0;
    border: 1px solid var(--th-border-strong, rgba(255,255,255,0.1));
    border-radius: 6px;
    overflow: hidden;
}

.er-intel-freq-btn {
    padding: 5px 14px;
    border: none;
    background: transparent;
    color: var(--th-text-muted, #50546a);
    font-size: 0.55rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.2s;
}

.er-intel-freq-btn:not(:last-child) {
    border-right: 1px solid var(--th-border, rgba(255,255,255,0.06));
}

.er-intel-freq-btn.active {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
}

.er-intel-freq-btn:hover:not(.active) {
    color: var(--th-text-primary, #e4e6ed);
}

/* Action buttons */
.er-intel-actions {
    display: flex;
    gap: 10px;
    padding-top: 16px;
    margin-top: 8px;
}

.er-intel-save {
    flex: 1;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.er-intel-save::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.15) 50%, transparent 60%);
    background-size: 200% 100%;
    animation: er-intel-shimmer 3s ease-in-out infinite;
}

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

.er-intel-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.3);
}

.er-intel-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.er-intel-deactivate {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    font-size: 0.6rem;
    font-weight: 600;
    font-family: var(--font-mono, monospace);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.2s;
}

.er-intel-deactivate:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

.er-intel-status-msg {
    font-size: 0.55rem;
    font-family: var(--font-mono, monospace);
    text-align: center;
    margin-top: 10px;
    min-height: 16px;
    transition: color 0.3s;
}

.er-intel-status-msg.success { color: #34d399; }
.er-intel-status-msg.error { color: #ef4444; }
.er-intel-status-msg.loading { color: #38bdf8; }

/* ── Animated Counter ── */
.er-counter {
    font-variant-numeric: tabular-nums;
}

/* ── Card Entrance Animations ── */
.er-animate-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.er-animate-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.er-animate-in:nth-child(2) { transition-delay: 0.08s; }
.er-animate-in:nth-child(3) { transition-delay: 0.16s; }
.er-animate-in:nth-child(4) { transition-delay: 0.24s; }
.er-animate-in:nth-child(5) { transition-delay: 0.32s; }
.er-animate-in:nth-child(6) { transition-delay: 0.40s; }

/* ── Notification Panel Overlay ── */
.er-notif-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.er-notif-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
    .er-grid-main {
        grid-template-columns: 1fr 340px;
    }
}

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

    .er-map-container {
        height: 35vh;
    }

    .er-space-grid {
        grid-template-columns: 1fr;
    }

    .er-status-bar {
        height: auto;
        min-height: 32px;
        flex-wrap: nowrap;
        padding: 3px 10px;
        gap: 4px;
    }

    /* Move "updated Xs ago" from status bar to HUD header on tablets/mobile */
    .er-status-right .em-last-updated {
        display: none;
    }
    .em-last-updated-mobile {
        display: inline !important;
        font-size: 0.35rem;
    }

    .er-chips {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .er-briefing {
        padding: 2px 14px;
    }

    .er-map-stats {
        gap: 3px;
        top: 22px;
        left: 8px;
        right: 8px;
        transform: none;
        justify-content: center;
    }
    .er-map-stats .er-briefing-stat {
        padding: 2px 5px;
        gap: 2px;
    }
    .er-briefing-stat-value {
        font-size: 0.5rem;
    }
    .er-briefing-stat-label {
        font-size: 0.3rem;
    }

    /* HUD scaled for 20% viewport */
    .hud-instruments {
        margin-top: 2px;
    }

    .hud-header {
        padding: 2px 10px;
    }

    .hud-header-label {
        font-size: 0.45rem;
    }

    .hud-header-src {
        font-size: 0.35rem;
    }

    .hud-instrument {
        padding: 2px 4px;
    }


    .hud-inst-header {
        margin-bottom: 0;
    }

    .hud-inst-label {
        font-size: 0.4rem;
    }

    .hud-inst-value {
        font-size: 0.35rem;
    }

    .hud-trends {
        padding: 2px 10px;
    }

    .hud-trends-header {
        font-size: 0.35rem;
        margin-bottom: 1px;
    }

    .hud-trends-grid {
        gap: 6px;
    }

    .hud-trend-label {
        font-size: 0.3rem;
        margin-bottom: 1px;
    }

    .er-map-controls {
        bottom: 6px;
    }

    .er-map-btn {
        padding: 3px 6px;
        font-size: 0.4rem;
    }

    .er-notif-panel {
        width: 100vw;
    }

    .er-toast-container {
        right: 12px;
        left: 12px;
    }

    .er-toast {
        min-width: auto;
        max-width: 100%;
    }

    .er-intel-categories {
        grid-template-columns: 1fr;
    }

    .er-intel-delivery-grid {
        grid-template-columns: 1fr 1fr;
    }

    .er-intel-loc-row {
        flex-direction: column;
        align-items: stretch;
    }

    .er-intel-input-wrap {
        flex: auto;
    }
}

@media (max-width: 480px) {
    .er-map-container {
        height: 30vh;
    }

    .er-status-bar {
        min-height: 28px;
        padding: 2px 8px;
        gap: 3px;
    }

    .er-status-title {
        font-size: 0.48rem;
        letter-spacing: 0.08em;
    }

    .er-status-top-row .header-pyramid-logo {
        width: 20px !important;
        height: 20px !important;
    }

    .er-map-stats {
        gap: 2px;
    }
    .er-map-stats .er-briefing-stat {
        padding: 1px 4px;
    }
    .er-briefing-stat-value {
        font-size: 0.45rem;
    }
    .er-briefing-stat-label {
        font-size: 0.25rem;
    }

    .er-briefing {
        padding: 1px 10px;
    }

    .er-briefing-narrative {
        font-size: 0.6rem;
    }

    .er-seismic-table {
        font-size: 0.6rem;
    }

    .er-chip-value {
        font-size: 0.7rem;
    }

    .er-share-btn span {
        display: none;
    }

    /* Hide bell + share at narrow widths — tabs + avatar need the space */
    .er-bell-btn,
    .er-share-btn {
        display: none !important;
    }

    /* Hide status badge text at narrow widths — status is visible on page */
    #status-badge {
        display: none !important;
    }

    .hud-trends {
        padding: 1px 8px;
    }
}

/* ============================================
   PERFORMANCE: GPU LAYERS + EXPLICIT TRANSITIONS
   Prevent transitioning backdrop-filter on iPad.
   ============================================ */
.er-event-card,
.er-gauge-card {
    will-change: transform;
    contain: layout style paint;
    transition-property: transform, background-color, border-color, box-shadow;
}

.er-map-btn,
.er-bell-btn,
.er-detail-tab,
.er-notif-panel-btn,
.er-sub-configure-btn,
.er-intel-save {
    will-change: transform;
    transition-property: transform, color, background-color, border-color, box-shadow;
}

.er-event-card::before {
    transition-property: width;
}

.er-event-link {
    transition-property: opacity, transform;
}

.er-seismic-table td {
    transition-property: background-color, border-color;
}

.er-notif-modal {
    transition-property: opacity, transform;
}

.er-settings-modal {
    transition-property: transform;
}

/* Scope event grid + table layout */
.er-events-grid,
.er-seismic-section,
#seismic-body {
    contain: layout style;
}

/* ============================================
   HUD / LED DISPLAY SYSTEM
   Tactical heads-up display transformation.
   ============================================ */

/* ── HUD Custom Properties ── */
.earth-monitor {
    --hud-cyan: #00e5ff;
    --hud-cyan-dim: rgba(0, 229, 255, 0.12);
    --hud-cyan-glow: rgba(0, 229, 255, 0.4);
    --hud-green: #00ff88;
    --hud-amber: #ffaa00;
    --hud-red: #ff3344;
    --hud-bg: rgba(0, 8, 16, 0.92);
    --hud-panel: rgba(0, 12, 24, 0.7);
    --hud-border: rgba(0, 229, 255, 0.12);
    --hud-border-bright: rgba(0, 229, 255, 0.35);
    --hud-corner-size: 28px;
    --hud-text-glow: 0 0 8px rgba(0, 229, 255, 0.5), 0 0 20px rgba(0, 229, 255, 0.15);
    --hud-value-glow: 0 0 6px rgba(0, 229, 255, 0.6), 0 0 16px rgba(0, 229, 255, 0.2);
}

/* ── Scanline Overlay ── */
.hud-scanlines {
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.04) 2px,
        rgba(0, 0, 0, 0.04) 4px
    );
    pointer-events: none;
    z-index: 99998;
}

/* ── Animated Sweep Line ── */
.hud-sweep {
    position: fixed;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 229, 255, 0.08) 15%,
        rgba(0, 229, 255, 0.25) 40%,
        rgba(0, 229, 255, 0.5) 50%,
        rgba(0, 229, 255, 0.25) 60%,
        rgba(0, 229, 255, 0.08) 85%,
        transparent 100%
    );
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.15), 0 0 30px rgba(0, 229, 255, 0.06);
    pointer-events: none;
    z-index: 99999;
    animation: hud-sweep 6s linear infinite;
}

@keyframes hud-sweep {
    0% { top: -2px; opacity: 0; }
    5% { opacity: 1; }
    95% { opacity: 1; }
    100% { top: 100vh; opacity: 0; }
}

/* ── Page Background Grid ── */
.earth-monitor {
    background-image:
        linear-gradient(rgba(0, 229, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center center;
}

/* ── Vignette Edge Darkening ── */
#seismic-content {
    position: relative;
}

/* ── HUD Corner Brackets (reusable mixin via background-image) ── */
.er-briefing,
.er-gauge-card,
.er-event-card {
    background-image:
        /* top-left L — fade out */
        linear-gradient(to right, var(--hud-border-bright), transparent),
        linear-gradient(to bottom, var(--hud-border-bright), transparent),
        /* top-right L — fade out */
        linear-gradient(to left, var(--hud-cyan-dim), transparent),
        linear-gradient(to bottom, var(--hud-cyan-dim), transparent),
        /* bottom-left L — fade out */
        linear-gradient(to right, var(--hud-cyan-dim), transparent),
        linear-gradient(to top, var(--hud-cyan-dim), transparent),
        /* bottom-right L — fade out */
        linear-gradient(to left, var(--hud-border-bright), transparent),
        linear-gradient(to top, var(--hud-border-bright), transparent);
    background-size:
        var(--hud-corner-size) 1px, 1px var(--hud-corner-size),
        var(--hud-corner-size) 1px, 1px var(--hud-corner-size),
        var(--hud-corner-size) 1px, 1px var(--hud-corner-size),
        var(--hud-corner-size) 1px, 1px var(--hud-corner-size);
    background-position:
        0 0, 0 0,
        100% 0, 100% 0,
        0 100%, 0 100%,
        100% 100%, 100% 100%;
    background-repeat: no-repeat;
}

/* ── Weekly Briefing HUD ── */
.er-briefing {
    background-color: var(--hud-panel);
    border-bottom: 1px solid var(--hud-border);
    border-radius: 0;
}

.er-briefing::after {
    background: linear-gradient(90deg, transparent, var(--hud-cyan) 30%, var(--hud-cyan) 70%, transparent);
    opacity: 0.2;
}

.er-briefing-title {
    color: rgba(0, 229, 255, 0.6);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
    letter-spacing: 0.12em;
    font-family: var(--font-mono, monospace);
}

.er-briefing-period {
    color: rgba(0, 229, 255, 0.3);
}

.er-briefing-stat {
    border-radius: 2px;
    border: 1px solid var(--hud-border);
    background: rgba(0, 12, 24, 0.6);
    position: relative;
    padding: 6px 14px;
}

.er-briefing-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--hud-border-bright), transparent);
}

.er-briefing-stat-value {
    color: var(--hud-cyan);
    text-shadow: var(--hud-value-glow);
    font-size: 0.95rem;
}

.er-briefing-stat-label {
    color: rgba(0, 229, 255, 0.3);
    font-size: 0.55rem;
}

.er-briefing-narrative {
    border-left: 2px solid rgba(0, 229, 255, 0.4);
    background: rgba(0, 12, 24, 0.5);
    border-radius: 0 2px 2px 0;
    color: rgba(0, 229, 255, 0.6);
    font-style: normal;
    font-family: var(--font-mono, monospace);
    letter-spacing: 0.02em;
    line-height: 1.7;
    position: relative;
}

.er-briefing-narrative::after {
    content: '█';
    color: var(--hud-cyan);
    animation: hud-cursor-blink 1s step-end infinite;
    font-size: 0.6em;
    margin-left: 2px;
}

@keyframes hud-cursor-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ── Map Container HUD ── */
.er-map-container {
    border: 1px solid var(--hud-border);
    position: relative;
}

.er-map-container::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 1px solid rgba(0, 229, 255, 0.06);
    pointer-events: none;
    z-index: 450;
}

.er-map-container::after {
    content: 'LIVE FEED';
    position: absolute;
    top: 10px;
    left: 14px;
    font-size: 0.5rem;
    font-family: var(--font-mono, monospace);
    color: rgba(0, 229, 255, 0.35);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 451;
    text-shadow: 0 0 6px rgba(0, 229, 255, 0.2);
}

.er-map-btn {
    border-radius: 2px;
    border: 1px solid var(--hud-border);
    background: rgba(0, 8, 16, 0.85);
    color: rgba(0, 229, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.er-map-btn:hover {
    background: rgba(0, 229, 255, 0.08);
    color: var(--hud-cyan);
    border-color: var(--hud-border-bright);
    text-shadow: 0 0 6px var(--hud-cyan-glow);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.1);
    transform: none;
}

.er-map-btn.active {
    background: rgba(0, 229, 255, 0.1);
    color: var(--hud-cyan);
    border-color: var(--hud-border-bright);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.12);
}

/* ── Active Event Cards HUD ── */
.er-event-card {
    background-color: var(--hud-panel);
    border: 1px solid var(--hud-border);
    border-radius: 2px;
}

.er-event-card:hover {
    border-color: var(--hud-border-bright);
    background-color: rgba(0, 229, 255, 0.04);
    transform: none;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.06), inset 0 0 20px rgba(0, 229, 255, 0.02);
}

.er-event-type {
    letter-spacing: 0.08em;
}

.er-event-meta {
    color: rgba(0, 229, 255, 0.3);
}

.er-event-link {
    color: var(--hud-cyan);
}

/* ── Detail Tabs HUD ── */
.er-detail-tabs {
    border-bottom: 1px solid var(--hud-border);
}

.er-detail-tab {
    border-radius: 0;
    color: rgba(0, 229, 255, 0.3);
}

.er-detail-tab:hover {
    color: rgba(0, 229, 255, 0.6);
    background: rgba(0, 229, 255, 0.03);
}

.er-detail-tab.active {
    color: var(--hud-cyan);
    border-bottom-color: var(--hud-cyan);
    background: rgba(0, 229, 255, 0.06);
    text-shadow: 0 0 8px var(--hud-cyan-glow);
}

/* ── Seismic Table HUD ── */
.er-seismic-table th {
    color: rgba(0, 229, 255, 0.35);
    border-bottom: 1px solid var(--hud-border);
    font-size: 0.5rem;
    letter-spacing: 0.1em;
}

.er-seismic-table th:hover {
    color: rgba(0, 229, 255, 0.6);
}

.er-seismic-table th.sorted {
    color: var(--hud-cyan);
    text-shadow: 0 0 6px var(--hud-cyan-glow);
}

.er-seismic-table td {
    background: rgba(0, 12, 24, 0.4);
    color: rgba(0, 229, 255, 0.55);
    border-top: 1px solid rgba(0, 229, 255, 0.04);
    border-bottom: 1px solid rgba(0, 229, 255, 0.04);
    font-size: 0.6rem;
}

.er-seismic-table td:first-child {
    border-radius: 2px 0 0 2px;
    border-left: 1px solid rgba(0, 229, 255, 0.04);
}

.er-seismic-table td:last-child {
    border-radius: 0 2px 2px 0;
    border-right: 1px solid rgba(0, 229, 255, 0.04);
}

.er-seismic-table tr.quake-row:hover td {
    background: rgba(0, 229, 255, 0.05);
    border-color: var(--hud-border);
    color: rgba(0, 229, 255, 0.8);
}

.er-seismic-table tr.quake-row.highlighted td {
    border-color: var(--hud-border-bright);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.08);
    background: rgba(0, 229, 255, 0.06);
}

.er-mag-cell {
    color: var(--hud-cyan) !important;
    text-shadow: var(--hud-value-glow);
}

/* ── Section Headers HUD ── */
.earth-monitor .em-section-title {
    color: rgba(0, 229, 255, 0.6);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
    letter-spacing: 0.12em;
    font-family: var(--font-mono, monospace);
}

.earth-monitor .em-section-header {
    border-bottom: 1px solid var(--hud-border);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

/* ── Gauge Cards HUD ── */
.er-gauge-card {
    background-color: var(--hud-panel);
    border: 1px solid var(--hud-border);
    border-radius: 2px;
    position: relative;
    overflow: visible;
}

.er-gauge-card:hover {
    border-color: var(--hud-border-bright);
    transform: none;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.06);
}

.er-gauge-title {
    color: rgba(0, 229, 255, 0.5);
    letter-spacing: 0.12em;
    font-size: 0.55rem;
}

.er-gauge-title span:first-child::before {
    content: '▸ ';
    color: rgba(0, 229, 255, 0.3);
    font-size: 0.5rem;
}

.er-gauge-label {
    color: rgba(0, 229, 255, 0.3);
}

/* SVG Gauge glow effects */
.er-gauge-card svg text {
    filter: drop-shadow(0 0 4px var(--hud-cyan-glow));
}

/* Kp bar segments */
.er-kp-segment.active {
    box-shadow: 0 0 8px var(--seg-color), 0 0 16px color-mix(in srgb, var(--seg-color) 30%, transparent);
}

.er-kp-segment-label {
    color: rgba(0, 229, 255, 0.25);
}

/* Bz gauge */
.er-bz-bar {
    border-radius: 2px;
    background: rgba(0, 229, 255, 0.03);
    border: 1px solid rgba(0, 229, 255, 0.06);
}

.er-bz-fill {
    border-radius: 2px;
}

.er-bz-value {
    text-shadow: var(--hud-value-glow);
}

.er-bz-unit {
    color: rgba(0, 229, 255, 0.3);
}

/* Aurora display */
.er-aurora-pct {
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5), 0 0 30px rgba(0, 255, 136, 0.15);
}

.er-aurora-cities {
    color: rgba(0, 229, 255, 0.4);
}

/* Sparkline labels */
.er-gauge-card .em-stat-label {
    color: rgba(0, 229, 255, 0.35);
    letter-spacing: 0.08em;
}

/* ── Search Input HUD ── */
.earth-monitor .em-search-input {
    border-radius: 2px;
    border: 1px solid var(--hud-border);
    background: rgba(0, 8, 16, 0.8);
    color: var(--hud-cyan);
}

.earth-monitor .em-search-input:focus {
    border-color: var(--hud-border-bright);
    box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.08), 0 0 12px rgba(0, 229, 255, 0.1);
}

.earth-monitor .em-search-input::placeholder {
    color: rgba(0, 229, 255, 0.2);
}

/* ── Tab Bar (time range) HUD ── */
.earth-monitor .em-tab-bar {
    border-radius: 3px;
    overflow: hidden;
    background: rgba(0, 6, 14, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 229, 255, 0.1);
}

.earth-monitor .em-tab {
    border-radius: 0;
    color: rgba(0, 229, 255, 0.35);
    padding: 3px 10px;
    font-size: 0.45rem;
}

.earth-monitor .em-tab.active {
    color: var(--hud-cyan);
    background: rgba(0, 229, 255, 0.1);
    text-shadow: 0 0 6px var(--hud-cyan-glow);
}

.earth-monitor .em-tab:hover:not(.active) {
    color: rgba(0, 229, 255, 0.6);
}

/* ── Pagination HUD ── */
.earth-monitor .em-pagination {
    gap: 4px;
}

.earth-monitor .em-pagination button {
    border-radius: 2px;
    border: 1px solid var(--hud-border);
    background: rgba(0, 12, 24, 0.5);
    color: rgba(0, 229, 255, 0.4);
}

.earth-monitor .em-pagination button:hover {
    border-color: var(--hud-border-bright);
    color: var(--hud-cyan);
}

.earth-monitor .em-pagination button.active {
    background: rgba(0, 229, 255, 0.1);
    border-color: var(--hud-border-bright);
    color: var(--hud-cyan);
    text-shadow: 0 0 6px var(--hud-cyan-glow);
}

/* ── Map Fade HUD ── */
.er-map-fade {
    background: linear-gradient(to bottom, transparent, rgba(0, 4, 10, 0.95));
}

.er-scroll-hint-text {
    color: rgba(0, 229, 255, 0.3);
    letter-spacing: 0.1em;
}

.er-scroll-hint-chevron {
    color: rgba(0, 229, 255, 0.3);
}

/* ── Proximity Columns HUD ── */
.er-site-name {
    color: var(--hud-amber);
    text-shadow: 0 0 6px rgba(255, 170, 0, 0.3);
}

.er-site-distance {
    color: rgba(0, 229, 255, 0.3);
}

/* ── Trend Arrows HUD ── */
.er-trend-arrow.up {
    color: var(--hud-red);
    text-shadow: 0 0 6px rgba(255, 51, 68, 0.4);
}

.er-trend-arrow.down {
    color: var(--hud-green);
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.4);
}

.er-trend-arrow.flat {
    color: rgba(0, 229, 255, 0.3);
}

/* ── Toast Notifications HUD ── */
.er-toast {
    border-radius: 2px;
    border: 1px solid var(--hud-border);
    background: rgba(0, 8, 16, 0.95);
}

.er-toast-title {
    color: var(--hud-cyan);
    text-shadow: 0 0 6px var(--hud-cyan-glow);
    letter-spacing: 0.04em;
}

.er-toast-desc {
    color: rgba(0, 229, 255, 0.45);
}

/* ── Fullscreen Bar HUD ── */
.er-fullscreen-bar {
    background: rgba(0, 8, 16, 0.95);
    border-top: 1px solid var(--hud-border-bright);
    box-shadow: 0 -4px 20px rgba(0, 229, 255, 0.05);
}

/* ── Notification Modal HUD ── */
.er-notif-modal {
    border-radius: 4px;
    border: 1px solid var(--hud-border-bright);
    background: rgba(0, 8, 16, 0.96);
    box-shadow: 0 0 40px rgba(0, 229, 255, 0.06), 0 24px 64px rgba(0, 0, 0, 0.7);
}

.er-notif-modal-header {
    border-bottom: 1px solid var(--hud-border);
}

.er-notif-modal-title {
    color: var(--hud-cyan);
    text-shadow: 0 0 6px var(--hud-cyan-glow);
}

.er-notif-panel-btn {
    border-radius: 2px;
    border: 1px solid var(--hud-border);
    color: rgba(0, 229, 255, 0.35);
}

.er-notif-panel-btn:hover {
    color: var(--hud-cyan);
    border-color: var(--hud-border-bright);
}

/* ── Empty State HUD ── */
.earth-monitor .em-empty {
    color: rgba(0, 229, 255, 0.25);
}

/* ── Settings Modal HUD ── */
.er-settings-modal {
    border-radius: 4px;
    border: 1px solid var(--hud-border-bright);
    background: rgba(0, 8, 16, 0.97);
    box-shadow: 0 0 40px rgba(0, 229, 255, 0.06), 0 24px 64px rgba(0, 0, 0, 0.7);
}

.er-intel-header {
    border-bottom: 1px solid var(--hud-border);
}

.er-intel-icon {
    color: var(--hud-cyan);
}

.er-intel-title {
    color: var(--hud-cyan);
    text-shadow: 0 0 6px var(--hud-cyan-glow);
}

.er-intel-section {
    border-bottom: 1px solid rgba(0, 229, 255, 0.04);
}

.er-intel-section-title {
    color: rgba(0, 229, 255, 0.5);
    letter-spacing: 0.1em;
}

.er-intel-input {
    border-radius: 2px;
    border: 1px solid var(--hud-border);
    background: rgba(0, 8, 16, 0.8);
    color: var(--hud-cyan);
}

.er-intel-input:focus {
    border-color: var(--hud-border-bright);
    box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.08);
}

.er-intel-range {
    accent-color: var(--hud-cyan);
}

.er-intel-range-val {
    color: var(--hud-cyan);
    text-shadow: 0 0 4px var(--hud-cyan-glow);
}

.er-intel-cat {
    border-radius: 2px;
    border: 1px solid rgba(0, 229, 255, 0.04);
    background: rgba(0, 8, 16, 0.5);
}

.er-intel-cat:hover {
    border-color: var(--hud-border);
    background: rgba(0, 229, 255, 0.03);
}

.er-intel-cat-name {
    color: rgba(0, 229, 255, 0.4);
}

.er-intel-cat input:checked ~ .er-intel-cat-name {
    color: rgba(0, 229, 255, 0.8);
}

.er-intel-threshold-label,
.er-intel-threshold-check {
    color: rgba(0, 229, 255, 0.4);
}

.er-intel-time {
    border-radius: 2px;
    border: 1px solid var(--hud-border);
    background: rgba(0, 8, 16, 0.8);
    color: var(--hud-cyan);
}

.er-intel-delivery-opt {
    border-radius: 2px;
    border: 1px solid rgba(0, 229, 255, 0.04);
    background: rgba(0, 8, 16, 0.5);
}

.er-intel-del-label {
    color: rgba(0, 229, 255, 0.4);
}

.er-intel-freq-btns {
    border-radius: 2px;
    border: 1px solid var(--hud-border);
}

.er-intel-freq-btn {
    color: rgba(0, 229, 255, 0.3);
}

.er-intel-freq-btn.active {
    background: rgba(0, 229, 255, 0.1);
    color: var(--hud-cyan);
}

.er-intel-save {
    border-radius: 2px;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.2) 0%, rgba(0, 229, 255, 0.35) 100%);
    color: var(--hud-cyan);
    border: 1px solid var(--hud-border-bright);
    text-shadow: 0 0 8px var(--hud-cyan-glow);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.1);
}

.er-intel-save:hover {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.3) 0%, rgba(0, 229, 255, 0.45) 100%);
    box-shadow: 0 0 24px rgba(0, 229, 255, 0.15), 0 4px 16px rgba(0, 229, 255, 0.1);
}

.er-intel-deactivate {
    border-radius: 2px;
    border: 1px solid rgba(255, 51, 68, 0.2);
    background: rgba(255, 51, 68, 0.06);
    color: var(--hud-red);
}

.er-intel-deactivate:hover {
    background: rgba(255, 51, 68, 0.12);
    border-color: var(--hud-red);
}

/* ── Sub Status HUD ── */
.er-sub-status {
    border-bottom: 1px solid var(--hud-border);
    background: rgba(0, 229, 255, 0.02);
}

.er-sub-status-label {
    color: rgba(0, 229, 255, 0.5);
}

.er-sub-configure-btn {
    border-radius: 2px;
    border: 1px solid var(--hud-border-bright);
    background: rgba(0, 229, 255, 0.06);
    color: var(--hud-cyan);
}

.er-sub-configure-btn:hover {
    background: rgba(0, 229, 255, 0.12);
    border-color: var(--hud-cyan);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.1);
    transform: none;
}

.er-sub-status-dot {
    background: var(--hud-green);
    box-shadow: 0 0 4px var(--hud-green);
}

.er-sub-status-active {
    color: var(--hud-green);
}

/* ── Earth family overview ── */
.er-family-rollup {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr);
    gap: 8px;
    padding: 8px 14px 4px;
    align-items: stretch;
}

.er-family-rollup-copy,
.er-family-rollup-metrics {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 229, 255, 0.12);
    border-radius: 6px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.er-family-rollup-copy {
    padding: 10px 12px;
}

.er-family-rollup-kicker {
    font-family: var(--font-mono, monospace);
    font-size: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: rgba(0, 229, 255, 0.55);
    margin-bottom: 3px;
}

.er-family-rollup-title {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--th-text-heading, #f0f1f5);
    margin-bottom: 4px;
}

.er-family-rollup-text {
    font-family: var(--font-mono, monospace);
    font-size: 0.55rem;
    line-height: 1.5;
    color: var(--th-text-secondary, #8b8fa3);
    max-width: 68ch;
}

.er-family-rollup-metrics {
    display: grid;
    grid-template-columns: 1.1fr repeat(4, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
}

.er-family-rollup-state,
.er-family-rollup-stat {
    padding: 8px 8px;
    border-left: 1px solid rgba(255,255,255,0.05);
}

.er-family-rollup-state {
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: none;
    background: rgba(255,255,255,0.02);
}

.er-family-rollup-value {
    display: block;
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    font-weight: 700;
    color: #f0f7ff;
    line-height: 1;
    margin-bottom: 3px;
}

.er-family-rollup-label {
    display: block;
    font-family: var(--font-mono, monospace);
    font-size: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(148, 163, 184, 0.72);
}

/* ── Domain Sections ── */
.er-domain-section {
    padding: 0 14px;
}

.er-domain-section + .er-domain-section {
    margin-top: 2px;
}

.er-domain-section-label {
    font-family: var(--font-mono, monospace);
    font-size: 0.45rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(148, 163, 184, 0.45);
    padding: 8px 0 4px;
}

/* ── Domain Status Cards ── */
.er-domain-cards {
    display: grid;
    gap: 6px;
}

.er-domain-cards-earth {
    grid-template-columns: repeat(3, 1fr);
}

.er-domain-cards-space {
    grid-template-columns: repeat(4, 1fr);
}

/* Space cards — amber/gold accent instead of cyan */
.er-domain-card-space {
    border-color: rgba(245, 197, 66, 0.12);
}
.er-domain-card-space:hover {
    border-color: rgba(245, 197, 66, 0.35);
    background: rgba(245, 197, 66, 0.05);
    box-shadow: 0 0 16px rgba(245, 197, 66, 0.08);
}
.er-domain-icon-space {
    color: #f5c542;
    filter: drop-shadow(0 0 4px rgba(245, 197, 66, 0.3));
}
.er-domain-card-space .er-domain-title {
    color: #f5c542;
}
.er-domain-card-space .er-domain-link {
    color: #f5c542;
}

.er-domain-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 229, 255, 0.12);
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    cursor: pointer;
}

.er-domain-card:hover {
    border-color: rgba(0, 229, 255, 0.35);
    background: rgba(0, 229, 255, 0.05);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.08);
}

.er-domain-icon {
    color: #00e5ff;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.3));
    line-height: 1;
}

.er-domain-title {
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--hud-cyan, #00e5ff);
    opacity: 0.8;
}

.er-domain-stat {
    font-family: var(--font-mono, monospace);
    font-size: 0.58rem;
    color: var(--th-text-primary, #e0e0e0);
    line-height: 1.3;
    min-height: 1.6em;
}

.er-domain-link {
    font-family: var(--font-mono, monospace);
    font-size: 0.55rem;
    color: var(--hud-cyan, #00e5ff);
    opacity: 0.5;
    transition: opacity 0.2s;
}

.er-domain-card:hover .er-domain-link {
    opacity: 1;
}

@media (max-width: 768px) {
    .er-family-rollup {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px 12px 4px;
    }

    .er-family-rollup-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .er-family-rollup-state {
        grid-column: 1 / -1;
    }

    .er-family-rollup-state,
    .er-family-rollup-stat {
        padding: 12px 10px;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.05);
    }

    .er-family-rollup-state {
        border-top: none;
    }

    .er-domain-section {
        padding: 0 8px;
    }
    .er-domain-cards-earth {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
    .er-domain-cards-space {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .er-family-rollup {
        grid-template-columns: 1fr;
        padding: 12px 14px 4px;
    }

    .er-family-rollup-metrics {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .er-domain-cards-earth {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .er-domain-cards-space {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
}

/* ============================================
   EARTHQUAKE TREND CHART
   10-year M5+ frequency line chart overlay.
   ============================================ */

/* ── Container ── */
.er-trend-container {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    z-index: 460;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 4, 10, 0.95);
}

.er-trend-svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Hide map container pseudo-elements when trend is active */
.er-trend-active::before,
.er-trend-active::after {
    display: none !important;
}

/* ── Loading state ── */
.er-trend-loading {
    font-family: var(--font-mono, monospace);
    font-size: 0.5rem;
    color: rgba(0, 229, 255, 0.5);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    padding: 40px 20px;
}

/* ── Axis styling ── */
.er-trend-axis path,
.er-trend-axis line {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 0.5;
}

.er-trend-axis text {
    fill: rgba(255, 255, 255, 0.35);
    font-family: var(--font-mono, monospace);
    font-size: 0.4rem;
    letter-spacing: 0.04em;
}

/* ── Line ── */
.er-trend-line {
    filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.3));
}

/* ── Labels ── */
.er-trend-title {
    fill: rgba(255, 255, 255, 0.55);
    font-family: var(--font-mono, monospace);
    font-size: 0.45rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.er-trend-source {
    fill: rgba(0, 229, 255, 0.35);
    font-family: var(--font-mono, monospace);
    font-size: 0.35rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.er-trend-label-avg {
    fill: rgba(0, 229, 255, 0.6);
    font-family: var(--font-mono, monospace);
    font-size: 0.38rem;
    letter-spacing: 0.04em;
}

.er-trend-label-sigma {
    fill: rgba(0, 229, 255, 0.3);
    font-family: var(--font-mono, monospace);
    font-size: 0.35rem;
    letter-spacing: 0.03em;
}

.er-trend-label-current {
    font-family: var(--font-mono, monospace);
    font-size: 0.42rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.er-trend-label-anomalous {
    fill: #ef4444;
    font-family: var(--font-mono, monospace);
    font-size: 0.38rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ── Current month dot pulse ── */
.er-trend-current-glow {
    animation: er-trend-pulse 2s ease-in-out infinite;
}

@keyframes er-trend-pulse {
    0%, 100% { opacity: 0.3; r: 8; }
    50%      { opacity: 0.1; r: 12; }
}

/* ── Tooltip ── */
.er-trend-tooltip {
    position: absolute;
    pointer-events: none;
    z-index: 470;
    background: rgba(0, 8, 16, 0.92);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 3px;
    padding: 6px 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.er-trend-tt-month {
    font-family: var(--font-mono, monospace);
    font-size: 0.42rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.er-trend-tt-count {
    font-family: var(--font-mono, monospace);
    font-size: 0.5rem;
    font-weight: 700;
    color: #d4af37;
    letter-spacing: 0.04em;
}

.er-trend-tt-dev {
    font-family: var(--font-mono, monospace);
    font-size: 0.38rem;
    color: rgba(0, 229, 255, 0.5);
    letter-spacing: 0.03em;
    margin-top: 1px;
}

/* ── Trend button active state (matches er-map-btn.active) ── */
#btn-trend.active {
    background: rgba(212, 175, 55, 0.12);
    color: #d4af37;
    border-color: rgba(212, 175, 55, 0.35);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.12);
    text-shadow: 0 0 6px rgba(212, 175, 55, 0.4);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .er-trend-container {
        padding: 4px;
    }

    .er-trend-title,
    .er-trend-source {
        font-size: 0.38rem;
    }

    .er-trend-axis text {
        font-size: 0.35rem;
    }
}

@media (max-width: 480px) {
    .er-trend-axis text {
        font-size: 0.32rem;
    }

    .er-trend-label-avg,
    .er-trend-label-sigma {
        font-size: 0.32rem;
    }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    .hud-sweep,
    .hud-scanlines {
        display: none;
    }
    .er-briefing-narrative::after {
        animation: none;
    }
    .er-status-bar::after {
        animation: none;
    }
    .er-trend-current-glow {
        animation: none;
    }
}
