/* ==========================================================================
   Global Supply Chain Index — Global Supply Chain Health Index
   Master stylesheet. Dash auto-loads this from the assets/ directory.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */

:root {
    --bg: #0a0a0b;
    --surface: #111113;
    --surface-raised: #18181b;
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #ececef;
    --text-muted: #8b8b93;
    --text-faint: #5c5c66;
    --radius: 6px;
    --radius-panel: var(--radius);
    --radius-control: var(--radius);
    --radius-pill: var(--radius);
    --bs-border-radius: var(--radius);
    --bs-border-radius-sm: var(--radius);
    --bs-border-radius-lg: var(--radius);
    --bs-border-radius-xl: var(--radius);
    --bs-border-radius-2xl: var(--radius);
    --bs-border-radius-pill: var(--radius);
    /* Satoshi: UI text + every meter/score figure. IBM Plex Sans: fallback.
       IBM Plex Mono: chrome only (badges, timestamps, code) — never scores. */
    --font-sans: "Satoshi", "IBM Plex Sans", system-ui, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, monospace;
    --font-numbers: "Satoshi", "IBM Plex Sans", system-ui, sans-serif;
    --tier-healthy: #4ade80;
    --tier-stable: #c4a35a;
    --tier-stressed: #c47a3a;
    --tier-critical: #c44d5f;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Dashboard Shell
   -------------------------------------------------------------------------- */

.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.dash-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px 32px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.header-brand {
    display: flex;
    align-items: center;
    justify-self: start;
    min-width: 0;
}

.brand-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Center column: industry profile dropdown, front-and-center */
.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    width: min(340px, 100%);
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.app-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text);
}

.app-subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: -0.01em;
}

.app-subtitle-link:hover {
    color: var(--text);
}

.header-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    justify-self: end;
    gap: 8px;
    margin-top: 0;
}

.header-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px 2px;
}

.header-nav-link {
    color: var(--text-muted) !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    text-decoration: none !important;
    padding: 4px 10px !important;
    border-radius: var(--radius-control);
}

.header-nav-link:hover {
    color: var(--text) !important;
    background: var(--surface-raised);
}

.header-nav-link-accent {
    color: var(--tier-healthy) !important;
}

.live-dot {
    font-size: 0.8rem;
    color: #4ade80;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

.live-dot.pulsing {
    animation: livePulse 2.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%,
    100% {
        opacity: 1;
        text-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
    }

    50% {
        opacity: 0.7;
        text-shadow: 0 0 4px rgba(74, 222, 128, 0.25);
    }
}

@media (prefers-reduced-motion: reduce) {
    .live-dot.pulsing {
        animation: none;
    }
}

/* --------------------------------------------------------------------------
   Hero Row (Gauge + 90-Day Trend)
   -------------------------------------------------------------------------- */

.hero-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    align-items: stretch;
    overflow: visible;
}

/* --------------------------------------------------------------------------
   Chart Panels (shared card style for gauge, trend, map, health bars)
   -------------------------------------------------------------------------- */
.chart-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-panel);
    padding: 16px;
    overflow: hidden;
    position: relative;
}

.chart-panel .js-plotly-plot,
.chart-panel .plotly,
.chart-panel .plot-container {
    width: 100% !important;
}

/* --------------------------------------------------------------------------
   Category Cards Row
   -------------------------------------------------------------------------- */

.cards-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    position: relative;
    z-index: 1;
}

/* --------------------------------------------------------------------------
   Sharp Financial Variant (Top Panels - Stock Market Look)
   -------------------------------------------------------------------------- */

.hero-row .chart-panel,
.charts-row .chart-panel {
    border-radius: var(--radius-panel);
    position: relative;
    background: var(--surface);
    box-shadow: none;
    /* Flat, clean look */
}

/* Middle Row Charts (Health, Map) */
.charts-row .chart-panel {
    border: 1px solid var(--border);
}

/* Top Row (Gauge & Trend) */
.hero-row .chart-panel {
    border: 1px solid var(--border);
}

/* Gauge score hover explanation */
.gauge-panel {
    overflow: visible;
    z-index: 4;
    border: none;
    background: transparent;
}

.gauge-panel:has(.gauge-score-hover-zone:hover),
.gauge-panel:has(.gauge-score-hover-zone:focus-within) {
    z-index: 500;
}

.gauge-panel .js-plotly-plot,
.gauge-panel .plotly,
.gauge-panel .plot-container {
    pointer-events: none;
}

/* Plotly SVG ignores CSS variables; force the same stack/weight as .tech-score. */
.gauge-panel .js-plotly-plot .numbers text,
.gauge-panel .js-plotly-plot .delta text,
.gauge-panel .js-plotly-plot .gauge text {
    font-family: var(--font-numbers) !important;
    font-weight: 600 !important;
    font-variant-numeric: tabular-nums lining-nums;
    letter-spacing: -0.03em;
}

.gauge-score-hover-zone {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    width: 160px;
    height: 88px;
    z-index: 6;
    cursor: help;
}

.gauge-score-hint {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    background: var(--surface-raised);
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.gauge-panel:hover .gauge-score-hint,
.gauge-score-hover-zone:focus-within .gauge-score-hint {
    opacity: 1;
}

.score-explanation-tooltip {
    position: absolute;
    left: 50%;
    top: calc(100% + 12px);
    transform: translateX(-50%);
    width: min(340px, 88vw);
    max-height: min(420px, 70vh);
    overflow-y: auto;
    padding: 14px 16px;
    border-radius: var(--radius-control);
    border: 1px solid var(--border-strong);
    background-color: var(--surface-raised);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
    z-index: 501;
    isolation: isolate;
}

.score-explanation-tooltip::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-color: var(--surface-raised);
    z-index: -1;
}

.score-explanation-headline,
.score-explanation-summary,
.score-explanation-bullet {
    position: relative;
    z-index: 1;
}

.gauge-score-hover-zone:hover .score-explanation-tooltip,
.gauge-score-hover-zone:focus-within .score-explanation-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(2px);
}

.score-explanation-headline {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.score-explanation-summary {
    margin: 0 0 10px;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.score-explanation-bullet {
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-muted);
    margin-top: 6px;
}

/* --------------------------------------------------------------------------
   Middle Row (Health Bars + World Map)
   -------------------------------------------------------------------------- */

.charts-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    align-items: stretch;
}

.chart-narrow {
    /* inherits from .chart-panel */
}

.chart-wide {
    /* inherits from .chart-panel */
}

/* --------------------------------------------------------------------------
   Bottom Row (Alerts + Disruptions)
   -------------------------------------------------------------------------- */

.bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.bottom-panel {
    min-width: 0;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Panel (shared wrapper used by alerts + disruptions)
   -------------------------------------------------------------------------- */

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-panel);
    padding: 20px;
    height: 100%;
    position: relative;
}

.panel-title {
    margin: 0 0 14px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}

/* --------------------------------------------------------------------------
   AI Daily Briefing
   -------------------------------------------------------------------------- */

.daily-briefing-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.daily-briefing-card--empty {
    text-align: center;
}

.briefing-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 420px;
    overflow-y: auto;
}

.briefing-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
}

.briefing-marker {
    flex-shrink: 0;
    margin-top: 2px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    line-height: 1.5;
    color: var(--text-faint);
}

.briefing-text {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 400;
    line-height: 1.55;
    color: var(--text);
}

.briefing-report-link {
    display: block;
    margin-top: 16px;
    padding: 9px 12px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    background: var(--surface-raised);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: var(--radius-control);
}

.briefing-report-link:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

.briefing-empty {
    padding: 8px 0 4px;
}

.briefing-empty-copy {
    margin: 0 0 14px;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.briefing-generate-btn {
    background: var(--text);
    color: var(--bg);
    border: none;
    border-radius: var(--radius-control);
    padding: 10px 20px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
}

.briefing-generate-btn:hover {
    opacity: 0.92;
}

.briefing-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 0;
}

.briefing-spinner-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   Alerts Feed
   -------------------------------------------------------------------------- */

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 420px;
    overflow-y: auto;
}

.alert-item {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: background 0.15s ease;
}

.alert-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 6px;
}

.severity-badge {
    /* color/background/border are severity-specific — set inline per pill */
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.alert-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.alert-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.3;
}

.alert-body {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Disruptions Table
   -------------------------------------------------------------------------- */

.disruptions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.disruptions-table thead {
    border-bottom: 2px solid var(--border);
}

.disruptions-table th {
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.disruptions-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: top;
}

.disruptions-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.td-event {
    font-weight: 500;
    max-width: 200px;
}

.td-affected {
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 160px;
}

.td-status {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Category Health Bars (inside chart panel)
   -------------------------------------------------------------------------- */

.health-bar-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 8px;
}

.health-bar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* The Label sits on TOP of the bar */
.health-bar-label {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    width: 100%;

    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
}

.health-bar-label span:last-child {
    font-family: var(--font-numbers);
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    font-variant-numeric: tabular-nums lining-nums;
}

.health-bar-track {
    width: 100%;
    height: 8px;
    /* Thicker */
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    /* Sharper */
    overflow: hidden;
}

.health-bar-fill {
    height: 100%;
    border-radius: 2px;
    /* Sharper */
    transition: width 0.6s ease;
    position: relative;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.dash-footer {
    text-align: center;
    padding: 20px 0 0;
    border-top: 1px solid var(--border);
}

.footer-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

/* --------------------------------------------------------------------------
   Active Ingestion Feed (Startup Sequence Overlay)
   -------------------------------------------------------------------------- */

.ingestion-terminal {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: var(--surface-raised);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    padding: 12px;
    z-index: 1040;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    pointer-events: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);

    /* Fade out the entire container at the very end */
    animation: terminalContainerHide 0.5s 6.0s forwards;
}

@keyframes terminalContainerHide {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

.terminal-line {
    display: block;
    color: var(--text-muted);
    margin-bottom: 6px;
    opacity: 1;
}

.terminal-line.final {
    color: var(--tier-healthy);
    margin-bottom: 0;
}

/* Staggered disappearances */
.terminal-line:nth-child(1) {
    animation: seqOut 0.3s 4.0s forwards;
}

.terminal-line:nth-child(2) {
    animation: seqOut 0.3s 4.2s forwards;
}

.terminal-line:nth-child(3) {
    animation: seqOut 0.3s 4.4s forwards;
}

.terminal-line:nth-child(4) {
    animation: seqOut 0.3s 4.6s forwards;
}

.terminal-line:nth-child(5) {
    animation: seqOut 0.3s 4.8s forwards;
}

.terminal-line.final::after {
    content: '█';
    margin-left: 6px;
    animation: seqBlink 1s step-end infinite;
}

@keyframes seqOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-4px);
    }
}

@keyframes seqBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* --------------------------------------------------------------------------
   Scrollbar (dark theme)
   -------------------------------------------------------------------------- */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-faint);
}

/* --------------------------------------------------------------------------
   Plotly global overrides (prevent toolbar bloat, enforce dark bg)
   -------------------------------------------------------------------------- */

.js-plotly-plot .plotly .modebar {
    display: none !important;
}

/* ==========================================================================
   RESPONSIVE — Mobile-first breakpoints
   ========================================================================== */

/* Tablets & small laptops (≤1024px) */
@media (max-width: 1024px) {
    .dashboard {
        padding: 16px 16px 32px;
        gap: 16px;
    }

    .hero-row {
        grid-template-columns: 1fr 1.5fr;
        gap: 16px;
    }

    .cards-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .charts-row {
        grid-template-columns: 1fr 1.5fr;
        gap: 16px;
    }

    .bottom-row {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

/* Phones — landscape & large phones (≤768px) */
@media (max-width: 768px) {
    .dashboard {
        padding: 12px 12px 24px;
        gap: 14px;
    }

    .dash-header {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .header-brand,
    .header-center,
    .header-meta {
        justify-self: stretch;
    }

    .header-center {
        width: 100%;
    }

    .app-title {
        font-size: 1.5rem;
    }

    .header-meta {
        align-items: flex-start;
        gap: 10px;
    }

    .header-nav {
        justify-content: flex-start;
    }

    .hero-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .cards-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .charts-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .bottom-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .chart-panel {
        padding: 12px;
    }

    .panel {
        padding: 14px;
    }

    .disruptions-table th,
    .disruptions-table td {
        padding: 6px 8px;
        font-size: 0.72rem;
    }

    .disruptions-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Phones — portrait (≤480px) */
@media (max-width: 480px) {
    .dashboard {
        padding: 8px 8px 20px;
        gap: 12px;
    }

    .app-title {
        font-size: 1.25rem;
    }

    .app-subtitle {
        font-size: 0.8rem;
    }

    .cards-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .panel {
        padding: 12px;
    }

    .panel-title {
        font-size: 0.9rem;
    }

    .alert-item {
        padding: 10px 12px;
    }

    .alert-title {
        font-size: 0.82rem;
    }

    .alert-body {
        font-size: 0.75rem;
    }

    .alerts-list {
        max-height: 350px;
    }

    .briefing-item {
        padding: 10px 12px;
    }

    .briefing-text {
        font-size: 0.82rem;
    }

    .briefing-list {
        max-height: 350px;
    }
}

/* ==========================================================================
   Dash debug toolbar — push below our content
   ========================================================================== */

._dash-debug-menu {
    z-index: 9999;
}

/* ==========================================================================
   Live Market Data Redesign (Scrolling Ticker)
   ========================================================================== */

.market-section-ticker {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-panel);
    padding: 12px 16px;
    margin-bottom: 24px;
    overflow: hidden;
    /* Hide the scrolling content */
    position: relative;
    white-space: nowrap;
    mask-image: linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent);
}

/* The Scrolling Track */
.market-ticker-track {
    display: flex;
    align-items: center;
    gap: 48px;
    /* Gap between items */
    width: max-content;
    /* Allow track to be as wide as needed */
    animation: ticker-scroll 60s linear infinite;
    /* Very slow rotation */
}

.market-ticker-track:hover {
    animation-play-state: paused;
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }

    /* Move half the width (the duplicate set) */
}

/* Individual Ticker Items */
.market-ticker-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.market-ticker-item + .market-ticker-item {
    border-left: 1px solid var(--border);
    padding-left: 12px;
}

.market-symbol {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.market-value-price {
    font-family: var(--font-numbers);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums lining-nums;
}

.market-change-group {
    font-family: var(--font-numbers);
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    font-variant-numeric: tabular-nums lining-nums;
}

.market-arrow {
    font-size: 0.7rem;
}

/* ==========================================================================
   Skeleton Loading Animation
   ========================================================================== */
.skeleton-pulse {
    background: var(--surface-raised);
    position: relative;
    overflow: hidden;
}

/* ==========================================================================
   Category Card Redesign (Technical HUD)
   ========================================================================== */

.tech-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;

    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    /* overflow:hidden on the same box as the border squares off the radius
       (Bootswatch Darkly + WebKit clip the border to a padding-box). */
    overflow: visible;
    isolation: isolate;
    background-clip: padding-box;
    transition: border-color 0.2s;
    min-height: 160px;
}

.tech-card:hover {
    border-color: var(--border-strong);
    /* no transform, box-shadow, or filter */
}

/* Header */
.tech-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* Align top so height difference grows down */
    margin-bottom: 12px;
    /* Increased spacing */
    min-height: 2.4em;
    /* Force height for 2 lines */
}

.tech-label {
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    max-width: 75%;
    /* Ensure space for weight badge */
    line-height: 1.2;
}

.tech-weight {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-faint);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: var(--radius-pill);
}

/* Main Score Row */
.tech-main-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.tech-score {
    font-family: var(--font-numbers);
    font-size: 2.2rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums lining-nums;
    font-feature-settings: "tnum" 1, "lnum" 1, "zero" 0;
}

/* Daily Delta Box */
.tech-delta-box {
    text-align: right;
}

.tech-meta-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-faint);
    text-transform: uppercase;
    margin-bottom: 1px;
    font-family: var(--font-mono);
}

.tech-delta-value {
    font-family: var(--font-numbers);
    font-size: 0.85rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums lining-nums;
}

/* Secondary Stats Grid (Min/Max) */
.tech-stats-grid {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    padding: 4px 8px;
    border-radius: var(--radius);
    margin-top: 4px;
}

.tech-grid-sep {
    width: 1px;
    height: 12px;
    background: var(--border);
}

.tech-meta-value {
    font-family: var(--font-numbers);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    font-variant-numeric: tabular-nums lining-nums;
}

/* Sparkline "Screen" */
.tech-sparkline-container {
    flex: 0 0 44px;
    height: 44px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    margin-top: auto;
    overflow: hidden;
    /* Clip any potential fill bleed */
    /* Push to bottom */
}

/* Inline SVG sparkline (server-rendered, fixed 0-100 y domain) */
.spark-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 40px;
}

.spark-svg {
    display: block;
    width: 100%;
    height: 40px;
    border: 0;
    pointer-events: none;
    user-select: none;
}

.spark-caption {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-faint);
    letter-spacing: 0.5px;
    pointer-events: none;
    white-space: nowrap;
}

#newsletter-toast-inner:hover {
    border-color: var(--border-strong) !important;
}

/* --------------------------------------------------------------------------
   Dark Theme Dropdown (Industry Profile Selector)
   -------------------------------------------------------------------------- */
#profile-selector {
    /* Keep form-select chevron: set color + image, not background shorthand */
    -webkit-appearance: none !important;
    appearance: none !important;
    background-color: var(--surface-raised) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%239aa3b5' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 16px 16px !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-control) !important;
    color: var(--text) !important;
    font-family: var(--font-sans) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
    padding: 7px 40px 7px 14px !important;
    cursor: pointer !important;
    height: auto !important;
    min-height: 36px !important;
    width: 260px !important;
    flex: 1;
    min-width: 0;
}

#profile-selector:focus {
    border-color: var(--border-strong) !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06) !important;
}

#profile-selector option {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    padding: 8px !important;
}

/* --------------------------------------------------------------------------
   Gauge Panel — prevent reflow when profile switches
   -------------------------------------------------------------------------- */
.gauge-panel {
    height: 340px;
    overflow: hidden;
}

.gauge-panel .dash-graph {
    height: 100% !important;
    width: 100% !important;
}

/* --------------------------------------------------------------------------
   Modal + Bootstrap Overrides
   -------------------------------------------------------------------------- */
.modal-content,
.gsc-modal-content {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    --bs-modal-border-radius: var(--radius);
    border-radius: var(--radius) !important;
    overflow: hidden !important;
}

.modal-header,
.modal-footer {
    border-color: var(--border) !important;
    background: var(--surface) !important;
}

.modal-header {
    border-top-left-radius: var(--radius) !important;
    border-top-right-radius: var(--radius) !important;
}

.modal-footer {
    border-bottom-left-radius: var(--radius) !important;
    border-bottom-right-radius: var(--radius) !important;
}

.form-control,
.form-select,
.btn,
.badge,
.rounded,
.rounded-1,
.rounded-2,
.rounded-3,
.rounded-pill {
    border-radius: var(--radius) !important;
}

.modal-title {
    color: var(--text) !important;
}

/* --------------------------------------------------------------------------
   Vendored effects — thinking-orbs, metal-fx
   See assets/vendor/ + frontend/ for provenance and build steps.
   Used sparingly and tastefully per design brief: loading states + a single
   restrained brand accent, not decoration.
   -------------------------------------------------------------------------- */

/* thinking-orbs: brand mark — <ThinkingOrb state="working" size={64} /> */
canvas.thinking-orb-mount.brand-orb {
    display: block;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}
/* Compact monitoring dashboard. */
:root {
    --bg: #090d14; --surface: #111823; --surface-raised: #192333;
    --border: #293648; --border-strong: #526783;
    --text: #edf2f9; --text-muted: #a6b4c7; --text-faint: #8294ad;
    --brand: #78b4ff; --radius: 4px;
}
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body { background: var(--bg); }
a { color: var(--brand); }
button, input, select { font: inherit; }
:focus-visible { outline: 2px solid var(--brand) !important; outline-offset: 3px; }
.workspace { max-width: 1600px; padding: 0 24px 16px; gap: 0; }
.workspace main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.workspace section { min-width: 0; }
.workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 65px; border-bottom: 1px solid var(--border); }
.brand-lockup { color: var(--text); text-decoration: none; }
.workspace h1 { font-size: 20px; line-height: 1.2; font-weight: 700; letter-spacing: -.4px; margin: 0; }
.workspace-nav { display: flex; gap: 22px; }
.workspace-nav a { color: var(--text-muted); text-decoration: none; padding: 23px 0 20px; font-size: 12px; border-bottom: 2px solid transparent; }
.workspace-nav a:hover, .workspace-nav .nav-active { color: var(--text); border-bottom-color: var(--brand); }
.header-actions, .toolbar-actions { display: flex; gap: 7px; align-items: center; }
.button-primary, .button-secondary, .button-quiet { border: 1px solid transparent; border-radius: 4px; padding: 7px 11px; font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap; min-height: 33px; }
.button-primary { color: #dceafd; background: #1f4167; border-color: #375f8d; }
.button-primary:hover { background: #2b5484; }
.button-secondary { color: var(--text); border-color: var(--border); background: var(--surface); }
.button-secondary:hover { border-color: var(--brand); }
.button-quiet { background: none; color: var(--text-muted); }
.button-quiet:hover { color: var(--text); }
.dashboard-toolbar { display: flex; align-items: center; gap: 14px; padding-top: 12px; }
.dashboard-toolbar > .filter-control { flex: 0 0 215px; }
.dashboard-toolbar > .filter-control > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.dashboard-toolbar #snapshot-status { flex: 1; }
.filter-control { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.filter-control label { color: var(--text-muted); font-size: 10px; margin: 0; }
.filter-control select, .filter-control input, .workspace #profile-selector { height: 34px !important; min-height: 34px !important; width: 100% !important; background-color: #121c29 !important; color: var(--text); border: 1px solid var(--border) !important; border-radius: 4px !important; padding: 6px 28px 6px 10px !important; font-size: 12px; }
.filter-control input { padding-right: 10px !important; }
.filter-control input::placeholder { color: var(--text-faint); }
.freshness-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 10px; color: var(--text-muted); }
.snapshot-label { display: inline-flex; align-items: center; gap: 6px; color: #39dfa0; }
.status-dot { width: 5px; height: 5px; background: currentColor; border-radius: 50%; display: inline-block; }
.freshness-warning .snapshot-label, .fallback-summary { color: #ffb454; }
.fallback-summary { cursor: help; border-bottom: 1px dotted currentColor; }
.overview-grid { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 12px; }
.overview-card, .network-card, .trend-card, .ports-card, .news-column { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; min-width: 0; }
.overview-card { padding: 18px; display: flex; flex-direction: column; justify-content: space-between; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.workspace h2 { font-size: 14px; font-weight: 600; letter-spacing: 0; margin: 0; }
.eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: .6px; color: var(--text-muted); }
.status-pill { display: inline-flex; align-items: center; color: var(--text-muted); border: 1px solid currentColor; border-radius: 3px; font-size: 10px; padding: 2px 5px; line-height: 1.4; white-space: nowrap; }
.tier-healthy { color: #20df9c; }.tier-stable { color: #f8d84a; }.tier-stressed { color: #ff963f; }.tier-critical { color: #ff4969; }
.score-line { display: flex; align-items: baseline; gap: 9px; margin-top: 4px; }
.hero-score { font-size: 68px; font-weight: 600; letter-spacing: -3px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.score-denominator { color: var(--text-faint); font-size: 14px; }
.score-change { font: 11px var(--font-mono); color: var(--text-muted); margin: 4px 0 8px; }
.positive { color: #20df9c; }.negative { color: #ff4969; }
.scale-caption { color: var(--text-faint); font-size: 9px; }
#pressure-drivers { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 14px; }
.workspace .driver-heading { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.driver-item { margin-top: 12px; }.driver-row { display: flex; align-items: center; gap: 8px; }
.driver-rank { display: none; }.driver-row strong { font-size: 11px; font-weight: 500; display: block; }.driver-row small { font-size: 9px; color: var(--text-faint); }
.driver-value { font: 16px var(--font-mono); color: #ffb454; margin-left: auto; }
.driver-track { height: 2px; background: #253447; margin-top: 5px; }.driver-track > div { height: 100%; background: #d88737; }
.network-card { overflow: hidden; background: #0b121c; }
.map-heading { padding: 12px 16px 0; }.map-hint { font-size: 10px; color: var(--text-muted); }
.map-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 16px 12px; font-size: 10px; color: var(--text-muted); min-height: 35px; }
.map-legend { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }.map-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.risk-gradient { height: 5px; width: 80px; background: linear-gradient(90deg,#ff4969,#ff963f,#f8d84a,#73e589,#20df9c); }
.range-switch { display: flex; flex-shrink: 0; border: 1px solid var(--border); border-radius: 3px; padding: 2px; }
.range-switch .form-check { margin: 0; padding: 0; min-height: 0; position: relative; }
.range-switch .form-check-input { position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 1; }
.range-switch label { font-size: 10px; cursor: pointer; padding: 4px 9px; color: var(--text-muted); border-radius: 2px; }
.range-switch input:checked + label { color: #e0edff; background: #28476c; }
.range-switch input:focus-visible + label { outline: 2px solid var(--brand); }
.workspace .cards-row { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 8px; margin: 0; }
.workspace .tech-card { display: grid; grid-template-rows: 26px 36px 22px 28px; gap: 4px; min-height: 0; min-width: 0; padding: 11px 12px 8px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-top: 2px solid #465b74; border-radius: 4px; text-align: left; height: auto; box-shadow: none; font-family: inherit; }
.workspace .tech-card:hover { background: #192637; border-color: var(--brand); transform: none; }
.workspace .tech-card-header { margin-bottom: 0; gap: 5px; align-items: flex-start; min-height: 24px; }.workspace .tech-label { max-width: none; font-size: 10px; letter-spacing: .2px; color: var(--text); line-height: 1.4; }
.workspace .tech-sublabel { display: none; }.workspace .tech-weight { font-size: 9px; padding: 0; color: var(--text-muted); border: 0; background: none; }
.workspace .tech-main-row { margin: 0; gap: 6px; }.workspace .tech-score { font-size: 34px; line-height: 1.1; letter-spacing: -1px; }
.workspace .tech-delta-value { font-size: 11px; }.workspace .tech-meta-label { font-size: 8px; color: var(--text-faint); }
.workspace .tech-stats-grid { margin: 0; padding: 0; background: none; gap: 8px; justify-content: space-between; }.workspace .tech-meta-value { font-size: 10px; color: var(--text-muted); }
.workspace .tech-sparkline-container { flex: none; margin-top: 0; height: 28px; padding: 0; background: none; border: 0; }.workspace .spark-caption { color: var(--text-muted); }.workspace .spark-wrap { min-height: 0; height: 28px; }.workspace .spark-svg { height: 28px; }
.analysis-grid { display: block; }.trend-card { padding: 12px 16px 6px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 10px; }
.filter-bar { display: grid; grid-template-columns: minmax(140px,1.5fr) minmax(110px,1fr) minmax(110px,1fr) auto; align-items: end; gap: 12px; padding: 12px 16px; }
.form-check-input:checked { background-color: #397cc5; border-color: #397cc5; }
.results-count { font: 9px var(--font-mono); color: var(--text-muted); padding: 0 16px 10px; }
.empty-state { padding: 28px 16px; color: var(--text-muted); text-align: center; }.empty-state strong { font-size: 14px; color: var(--text); }.empty-state p { margin: 8px 0 0; font-size: 12px; }
.intelligence-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }.workspace .panel { border-radius: 4px; padding: 14px 16px; }
.workspace .briefing-disclosure { height: auto; }.briefing-disclosure > summary { font-size: 12px; cursor: pointer; }.briefing-disclosure[open] > summary { margin-bottom: 12px; }
.workspace .briefing-list { gap: 4px; max-height: none; }.workspace .briefing-item { padding: 6px 0; border: 0; background: none; }.workspace .briefing-text { font-size: 12px; color: var(--text-muted); }
.workspace .briefing-report-link { display: inline-block; width: auto; padding: 6px 10px; font-size: 11px; border-color: var(--border); color: var(--brand); }
.news-filters { grid-template-columns: 2fr 1fr 1fr; }.news-column .panel { border: 0; padding-top: 0; background: none; }.news-column .panel-title { display: none; }
.workspace .alerts-list { max-height: 440px; overflow-y: auto; }.workspace .alert-item { border: 0; border-bottom: 1px solid var(--border); padding: 10px 0; border-radius: 0; background: none; }
.workspace .alert-title { font-size: 13px; line-height: 1.5; margin-top: 5px; }.workspace .alert-title:hover { color: var(--brand) !important; }
.news-detail > summary { font-size: 10px; color: var(--text-faint); cursor: pointer; }.workspace .alert-body { font-size: 12px; line-height: 1.7; color: var(--text-muted); margin: 6px 0 0; }
.market-strip { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.workspace .market-section-ticker { margin: 0; padding: 0; border: 0; background: none; overflow: hidden; }
.workspace .market-ticker-track { display: flex; width: max-content; animation: ticker-scroll 45s linear infinite; }
.market-ticker-set { display: flex; flex-shrink: 0; }
.workspace .market-section-ticker:hover .market-ticker-track, .workspace .market-section-ticker:focus-within .market-ticker-track { animation-play-state: paused; }
.workspace .market-ticker-item { display: flex; padding: 5px 16px; gap: 10px; border: 0; border-right: 1px solid var(--border); flex-shrink: 0; }.workspace .market-ticker-item:first-child { padding-left: 0; }.workspace .market-ticker-item:last-child { border: 0; padding-right: 0; }
.workspace .market-symbol { font-size: 9px; }.workspace .market-value-price { font-size: 12px; }.workspace .market-change-group { font-size: 10px; }.workspace .market-value-abs { display: none; }
.workspace-footer { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 0; font-size: 10px; color: var(--text-muted); }.workspace-footer a { color: var(--text-muted); text-decoration: none; }
.skip-link { position: absolute; top: -100px; left: 16px; padding: 10px; background: var(--brand); color: var(--bg); z-index: 10000; }.skip-link:focus { top: 10px; }
.newsletter-email-label { display: block; font-size: 12px; margin-bottom: 8px; color: var(--text-muted); }
@media (max-width: 1100px) {
    .workspace { padding: 0 16px 16px; }.workspace-header { gap: 16px; }.workspace h1 { font-size: 17px; }.workspace-nav { gap: 16px; }
    .workspace .cards-row { grid-template-columns: repeat(3,minmax(0,1fr)); }.overview-grid { grid-template-columns: 230px minmax(0,1fr); }
    .map-footer { flex-wrap: wrap; gap: 7px 12px; }
}
@media (max-width: 750px) {
    .workspace-header { flex-wrap: wrap; gap: 0; padding-top: 14px; }.workspace-nav { order: 3; width: 100%; justify-content: space-between; }.workspace-nav a { padding: 14px 0 10px; }
    .dashboard-toolbar { flex-wrap: wrap; gap: 8px; }.dashboard-toolbar > .filter-control { flex: 1; }.dashboard-toolbar #snapshot-status { order: 3; flex-basis: 100%; padding: 3px 0; }.dashboard-toolbar .toolbar-actions { margin-left: auto; }
    .overview-grid { grid-template-columns: 1fr; }.overview-card { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 14px; }
    #pressure-drivers { margin: 0; border-top: 0; border-left: 1px solid var(--border); padding: 0 0 0 18px; }.driver-item { margin-top: 9px; }.driver-row small { display: none; }.driver-value { font-size: 12px; }.driver-row strong { font-size: 10px; }.driver-track { margin-top: 4px; }
    .hero-score { font-size: 57px; }.scale-caption { font-size: 8px; }.score-change { font-size: 10px; }
    .workspace .cards-row { grid-template-columns: repeat(3,minmax(0,1fr)); }.workspace .tech-card { padding: 10px 8px 6px; }.workspace .tech-label { font-size: 9px; }.workspace .tech-card-header { min-height: 0; }.workspace .tech-score { font-size: 28px; }.workspace .tech-delta-value { font-size: 10px; }
    .filter-bar { grid-template-columns: 1fr 1fr; gap: 10px; }.news-filters { grid-template-columns: 1fr 1fr; }.news-filters > :first-child { grid-column: 1/-1; }
}
@media (max-width: 460px) {
    .workspace { padding: 0 10px 12px; }.workspace h1 { font-size: 15px; }.header-actions .button-primary { font-size: 10px; padding: 5px 8px; }.button-quiet { padding: 5px 8px; }
    .workspace main { gap: 9px; }.workspace-header .header-actions { gap: 0; }.dashboard-toolbar > .filter-control { flex-basis: 175px; }.dashboard-toolbar .button-secondary { padding: 6px 8px; font-size: 10px; }
    .overview-card { gap: 12px; }#pressure-drivers { padding-left: 12px; }.hero-score { font-size: 52px; }.score-denominator { font-size: 10px; }.eyebrow { font-size: 8px; }.status-pill { font-size: 8px; padding: 2px 4px; }
    .workspace .cards-row { gap: 6px; }.workspace .tech-card { grid-template-rows: 28px 47px 22px; }.workspace .tech-card-header { min-height: 0; }.workspace .tech-main-row { flex-wrap: wrap; align-items: flex-start; margin-bottom: 0; }.workspace .tech-delta-box { align-items: flex-start; }.workspace .tech-delta-box .tech-meta-label { display: none; }.workspace .tech-stats-grid { display: none; }.workspace .tech-label { font-size: 9px; }.workspace .tech-weight { font-size: 8px; }
    .workspace #world-map { height: 230px !important; }
    .map-heading { padding: 10px 12px 0; }.range-switch label { padding: 5px 7px; font-size: 9px; }.map-footer { padding: 5px 12px 10px; font-size: 9px; }.map-legend { gap: 6px; }.risk-gradient { width: 55px; }
    .filter-bar { padding: 12px; }.results-count { padding-left: 12px; }.port-context p { font-size: 10px; min-width: 85px; }.alert-header { flex-wrap: wrap; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Readable figures and explicit data states without crowding the cards. */
.workspace .tech-card { grid-template-rows: 32px 40px minmax(22px, auto) 28px 40px; gap: 6px; padding: 12px; }
.workspace .tech-card-header { gap: 8px; }
.workspace .tech-label { font-size: 12px; line-height: 1.35; }
.workspace .tech-weight { font-size: 11px; }
.workspace .tech-main-row { flex-wrap: nowrap; align-items: center; }
.workspace .tech-score { font-size: 34px; }
.workspace .tech-meta-label { display: block; font-size: 10px; color: #aebed0; }
.workspace .tech-meta-value, .workspace .tech-delta-value { font-size: 12px; }
.card-condition { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #bacbdd; flex-wrap: wrap; line-height: 1.3; }
.card-condition > span:first-child:not(:last-child) { font-size: 9px !important; margin: 0 !important; }
.workspace .tech-sparkline-container, .workspace .spark-wrap, .workspace .spark-svg { height: 40px; }
.workspace .spark-caption { font-size: 10px; background: #121c2a; padding: 2px 4px; }
.history-unavailable { font-size: 11px; color: #aebed0; }
.workspace .market-symbol { font-size: 12px; }
.workspace .market-value-price { font-size: 14px; }
.workspace .market-change-group { font-size: 12px; }
.workspace .market-ticker-item { padding: 9px 24px !important; gap: 12px; }
.map-hint, .scale-caption, .score-change { font-size: 11px; color: #bacbdd; }
.driver-row strong { font-size: 12px; }
.driver-value { font-size: 13px; }
@media (max-width: 1300px) { .workspace .cards-row { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 600px) {
    .workspace .cards-row { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
    .workspace .tech-card { padding: 10px; }
    .workspace .tech-delta-box { align-items: flex-end; }
    .workspace .tech-delta-box .tech-meta-label { display: block; }
    .workspace .tech-stats-grid { display: flex; }
    .workspace .tech-score { font-size: 30px; }
    .workspace .tech-delta-value { font-size: 10px; }
    .workspace .tech-label { font-size: 11px; }
    .card-condition { font-size: 10px; }
    .map-hint { font-size: 10px; }
    .driver-row strong { font-size: 11px; }
    .driver-value { font-size: 11px; }
    .scale-caption, .score-change { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .workspace .market-section-ticker { overflow-x: auto; }
    .market-ticker-set[aria-hidden="true"] { display: none; }
}

.workspace #world-map .modebar { display: flex !important; background: #121c2a !important; }
.workspace #world-map .modebar-btn path { fill: #b9cce1 !important; }
.workspace .tech-delta-value { color: #b9cce1; }

/* Let the map occupy the entire panel, including while zoomed or panned. */
.workspace .network-card { position: relative; min-height: clamp(400px, 32vw, 520px); }
.map-loading-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #bacbdd; font-size: 13px; pointer-events: none; }
.workspace #world-map { position: absolute; inset: 0; width: 100%; height: 100% !important; }
.workspace .map-heading { position: absolute; top: 0; left: 0; right: 0; z-index: 2; padding: 12px 16px 24px; pointer-events: none; background: linear-gradient(#0b121cee, #0b121c00); }
.workspace .map-footer { position: absolute; bottom: 0; left: 0; right: 0; z-index: 2; padding: 24px 16px 12px; pointer-events: none; background: linear-gradient(#0b121c00, #0b121cee); }
.workspace #world-map .modebar { top: 38px; right: 12px; }
/* Keep port labels above the decorative header/footer gradients. */
.workspace #world-map .main-svg:has(> .hoverlayer) { z-index: 4; }
.workspace #world-map .maplibregl-ctrl-bottom-right { bottom: 34px; }
@media (max-width: 750px) { .workspace .network-card { min-height: 360px; } }
@media (max-width: 460px) { .workspace .network-card { min-height: 320px; } }

.workspace #world-map .maplibregl-ctrl-attrib { background: #121c2ae6; color: #bacbdd; }
.workspace #world-map .maplibregl-ctrl-attrib a { color: #bacbdd; }

/* Dense headline rows retain readable type and optional article summaries. */
.workspace .alerts-list { gap: 0; max-height: 360px; }
.workspace .alert-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 4px; padding: 8px 0; }
.workspace .alert-title { grid-column: 1; grid-row: 1; margin: 0 !important; font-size: 13px; line-height: 1.35; }
.workspace .alert-header { grid-column: 1; grid-row: 2; justify-content: flex-start; gap: 8px; margin: 0; }
.workspace .alert-meta { flex-wrap: wrap; }
.workspace .severity-badge { padding: 1px 5px; font-size: 9px; }
.workspace .category-tag { padding: 0 !important; border: 0 !important; background: none !important; }
.workspace .alert-time { font-size: 10px; }
.workspace .news-detail { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.workspace .news-detail > summary { color: var(--text-muted); font-size: 11px; padding: 5px 0; }
.workspace .news-detail[open] { grid-column: 1 / -1; grid-row: 3; }
.workspace .news-detail[open] > summary { padding-top: 0; }
.workspace .news-detail .alert-body { margin: 2px 0 4px; line-height: 1.5; }
.workspace .news-filters { padding-top: 10px; padding-bottom: 8px; gap: 10px; }
.workspace .news-column .results-count { padding-bottom: 6px; }
