:root {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --accent-blue: #38bdf8;
    --accent-green: #34d399;
    --accent-purple: #c084fc;
    --accent-orange: #fb923c;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-code: 'Fira Code', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    padding: 24px;
    min-height: 100vh;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    font-size: 32px;
}

.brand-text h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-neo4j {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-gpt {
    background: rgba(52, 211, 153, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.badge-quota {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
    font-family: 'Fira Code', monospace;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-blue);
}

.stat-icon {
    font-size: 28px;
}

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-blue);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Search Panel */
.search-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.info-tag {
    font-size: 13px;
    color: var(--text-secondary);
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.input-group {
    display: flex;
    gap: 12px;
}

.input-group input {
    flex: 1;
    padding: 14px 20px;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: var(--accent-blue);
}

.btn-primary {
    padding: 14px 28px;
    background: var(--accent-blue);
    color: #0f172a;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover:not(:disabled) {
    background: #7dd3fc;
}

.btn-primary:disabled {
    background: #334155;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.7;
}

.pill-btn:disabled {
    background: #0f172a;
    color: #475569;
    border-color: #334155;
    cursor: not-allowed;
    opacity: 0.6;
}

.options-row {
    display: flex;
    gap: 16px;
}

.api-key-group {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.api-key-group input {
    padding: 8px 14px;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    width: 380px;
}

/* Sample Prompts */
.sample-prompts {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
}

.sample-title {
    color: var(--text-secondary);
    font-weight: 500;
}

.prompt-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill-btn {
    padding: 6px 12px;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.pill-btn:hover {
    background: var(--bg-card-hover);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Results Panel */
.results-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hidden {
    display: none !important;
}

.tabs-header {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    flex-wrap: wrap;
}

.search-timing-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    color: #38bdf8;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    align-self: center;
}

.search-timing-badge .timing-icon {
    font-size: 13px;
}

.summary-meta-badges {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.badge-time {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    font-weight: 600;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
}


.tab-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--bg-card-hover);
    color: var(--accent-blue);
}

.tab-pane {
    display: none;
}

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

/* Map Box & Leaflet Map Styling */
.map-box {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: #0f172a;
}

#events-map {
    width: 100%;
    height: 480px;
    background: #0b1120;
}

.leaflet-popup-content-wrapper {
    background: #0f172a !important;
    color: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    padding: 6px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.6) !important;
}

.leaflet-popup-content {
    color: #ffffff !important;
    margin: 12px 14px !important;
    line-height: 1.5 !important;
}

.leaflet-popup-content * {
    color: inherit;
}

.leaflet-popup-content .popup-description,
.leaflet-popup-content .event-desc,
.popup-description {
    color: #ffffff !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
    margin: 6px 0 !important;
}

.leaflet-popup-tip {
    background: #0f172a !important;
}

.leaflet-popup-close-button {
    color: #cbd5e1 !important;
    padding: 6px !important;
}

.leaflet-popup-close-button:hover {
    color: #ffffff !important;
}

/* Summary Content */
.summary-box {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-badge {
    color: var(--accent-green);
    font-weight: 600;
    font-size: 14px;
}

.summary-content {
    font-size: 15px;
    line-height: 1.7;
    color: #e2e8f0;
    white-space: pre-wrap;
}

/* Interactive Knowledge Graph Tab Styling */
.graph-box {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: #0f172a;
    display: flex;
    flex-direction: column;
}

.graph-toolbar {
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.graph-toolbar-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.graph-btn {
    padding: 7px 14px;
    border-radius: 8px;
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.graph-btn:hover {
    background: #334155;
    border-color: #475569;
    color: #ffffff;
}

.graph-btn.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
    color: #38bdf8;
}

.graph-filter-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.graph-select {
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.graph-select:focus {
    border-color: var(--accent-blue);
}

.graph-search-control {
    flex: 1;
    min-width: 220px;
}

.graph-search-input {
    width: 100%;
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.graph-search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.graph-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(51, 65, 85, 0.4);
    font-size: 12px;
    color: #94a3b8;
}

.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.color-event { background: #38bdf8; }
.color-country { background: #10b981; }
.color-region { background: #06b6d4; }
.color-period { background: #f59e0b; }
.color-impact { background: #ef4444; }
.color-gfm { background: #8b5cf6; }
.color-sdb { background: #0284c7; }
.color-secondary { background: #ec4899; }

/* Temporal Stepper / Scrubber Bar Styling */
.graph-temporal-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(51, 65, 85, 0.6);
    border-radius: 10px;
    margin-top: 4px;
}

.temporal-playback-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.temporal-btn {
    padding: 6px 12px;
    border-radius: 6px;
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    user-select: none;
}

.temporal-btn:hover {
    background: #334155;
    border-color: #475569;
    color: #ffffff;
}

.temporal-btn.active {
    background: rgba(56, 189, 248, 0.18);
    border-color: #38bdf8;
    color: #38bdf8;
}

.temporal-btn-play {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #34d399;
    font-weight: 600;
}

.temporal-btn-play:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: #34d399;
    color: #ffffff;
}

.temporal-btn-play.playing {
    background: rgba(245, 158, 11, 0.18);
    border-color: #f59e0b;
    color: #fbbf24;
}

.temporal-slider-container {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.temporal-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #334155;
    outline: none;
    cursor: pointer;
    transition: background 0.2s;
}

.temporal-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #38bdf8;
    border: 2px solid #0f172a;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
    cursor: pointer;
    transition: transform 0.15s;
}

.temporal-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    background: #7dd3fc;
}

.temporal-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #64748b;
    padding: 0 2px;
}

.temporal-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #94a3b8;
    margin-left: auto;
}

#timeline-current-label {
    font-weight: 500;
    color: #e2e8f0;
}

.graph-canvas-wrapper {
    position: relative;
    width: 100%;
    height: 560px;
    background: #0b1120;
}

#events-graph {
    width: 100%;
    height: 100%;
    outline: none;
}

/* Vis network tooltip styling overrides */
div.vis-tooltip {
    position: absolute;
    visibility: hidden;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 12px;
    color: #f8fafc;
    background-color: rgba(15, 23, 42, 0.95);
    border: 1px solid #334155;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    z-index: 100;
    max-width: 320px;
    line-height: 1.4;
}

/* Node Inspector Details Drawer */
.graph-details-overlay {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 340px;
    max-height: calc(100% - 32px);
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(12px);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.7), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    z-index: 25;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.graph-details-overlay.hidden {
    display: none;
    opacity: 0;
    transform: translateY(-8px);
}

.details-card-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #334155;
}

.details-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.details-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}

.details-close-btn:hover {
    color: #ffffff;
    background: #334155;
}

.details-node-label {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.4;
    word-break: break-word;
}

.details-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-key {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.detail-val {
    color: #f1f5f9;
    word-break: break-word;
}

.graph-footer-bar {
    padding: 8px 16px;
    background: #0f172a;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
}

.graph-footer-stats {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #94a3b8;
}

.stat-separator {
    color: #475569;
}

.graph-hint {
    color: #64748b;
    font-size: 11.5px;
}

/* Events Grid */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.event-card {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s;
}

.event-card:hover {
    border-color: var(--accent-blue);
}

.event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.event-source {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(192, 132, 252, 0.15);
    color: var(--accent-purple);
    border: 1px solid rgba(192, 132, 252, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.event-source.event-source-forecasted {
    background: rgba(168, 85, 247, 0.2);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.15);
}

.event-source.event-source-observed {
    background: rgba(14, 165, 233, 0.2);
    color: #7dd3fc;
    border: 1px solid rgba(14, 165, 233, 0.5);
    box-shadow: 0 0 8px rgba(14, 165, 233, 0.15);
}

.event-period {
    font-size: 12px;
    color: var(--accent-orange);
    font-family: var(--font-code);
}

.event-headline {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.event-details {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.event-link {
    display: inline-block;
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.event-link:hover {
    text-decoration: underline;
}

/* Cypher Code Container */
.cypher-container {
    background: #090d16;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.code-header {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

pre code {
    font-family: var(--font-code);
    font-size: 13px;
    color: var(--accent-green);
    white-space: pre-wrap;
    word-break: break-all;
}

/* Login Modal Overlay */
.login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 17, 32, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-modal-overlay.hidden {
    display: none !important;
}

.login-modal-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.login-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-modal-header .login-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.login-modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 6px;
}

.login-modal-header p {
    font-size: 13px;
    color: #94a3b8;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.login-form input {
    width: 100%;
    padding: 10px 14px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #f8fafc;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

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

.btn-block {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    margin-top: 8px;
}

.login-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    text-align: center;
}

/* User Profile Header Badge & Logout Button */
.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1e293b;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-badge {
    font-size: 12px;
    font-weight: 600;
    color: #38bdf8;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 10px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.4);
    color: #ffffff;
}

/* ==========================================================================
   Copernicus GFM Satellite Data Styles
   ========================================================================== */

.stat-card-gfm:hover {
    border-color: #06b6d4;
}

.stat-card-gfm .stat-value {
    color: #06b6d4;
}

.pill-gfm {
    border-color: rgba(6, 182, 212, 0.4) !important;
    background: rgba(6, 182, 212, 0.1) !important;
    color: #22d3ee !important;
}

.pill-gfm:hover {
    background: rgba(6, 182, 212, 0.25) !important;
    border-color: #06b6d4 !important;
    color: #ffffff !important;
}

/* Event Card GFM Elements */
.gfm-event-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: #22d3ee;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    margin-top: 8px;
}

.gfm-badge-icon {
    font-size: 15px;
}

.gfm-badge-text strong {
    color: #ffffff;
}

.gfm-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.btn-gfm-details, .btn-gfm-footprint {
    background: #0f172a;
    border: 1px solid rgba(6, 182, 212, 0.4);
    color: #38bdf8;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
}

.btn-gfm-details:hover {
    background: #0891b2;
    color: #ffffff;
    border-color: #06b6d4;
}

.btn-gfm-footprint:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
}

/* GFM Modal */
.gfm-modal-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.gfm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: #0f172a;
    border-bottom: 1px solid #334155;
}

.gfm-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon {
    font-size: 28px;
}

.gfm-modal-title h3 {
    font-size: 17px;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.3;
}

.gfm-subtitle {
    font-size: 12px;
    color: #94a3b8;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.gfm-modal-body {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gfm-modal-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 12px 18px;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 8px;
    font-size: 13px;
    color: #cbd5e1;
}

.gfm-summary-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.gfm-summary-stats strong {
    color: #22d3ee;
}

.gfm-summary-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gfm-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #e2e8f0;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.6);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    user-select: none;
}

.gfm-filter-toggle input[type="checkbox"] {
    accent-color: #0284c7;
    cursor: pointer;
}

.btn-gfm-unlink {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-gfm-unlink:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    border-color: #ef4444;
}

.gfm-swath-status {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    margin-top: 2px;
}

.swath-hit-badge {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.swath-miss-badge {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.gfm-obs-item.gfm-swath-miss {
    opacity: 0.75;
    border-color: rgba(239, 68, 68, 0.35);
}

.gfm-obs-item.gfm-swath-hit {
    border-color: rgba(16, 185, 129, 0.35);
}

.gfm-obs-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gfm-obs-item {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s;
}

.gfm-obs-item:hover {
    border-color: #06b6d4;
}

.gfm-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.gfm-item-num {
    background: #334155;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.gfm-item-time {
    font-size: 12px;
    color: #94a3b8;
}

.gfm-item-area {
    font-size: 13px;
    color: #f8fafc;
}

.gfm-item-area strong {
    color: #38bdf8;
}

.gfm-item-product {
    font-size: 11px;
    color: #64748b;
    word-break: break-all;
    background: #090d16;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #1e293b;
}

.gfm-item-product code {
    font-family: var(--font-code);
    color: #a5f3fc;
}

.gfm-obs-map {
    height: 180px;
    width: 100%;
    border-radius: 8px;
    border: 1px solid #334155;
    position: relative;
    overflow: hidden;
    background: #0b1120;
    margin: 8px 0;
}

.gfm-map-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    pointer-events: none;
}

.gfm-thumb-container {
    max-height: 180px;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid #334155;
    display: flex;
    justify-content: center;
    background: #000;
}

.gfm-thumb-img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
}

.gfm-item-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.gfm-link-btn, .gfm-footprint-btn {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
}

.gfm-link-btn {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.gfm-link-btn:hover {
    background: #0284c7;
    color: #ffffff;
}

.gfm-footprint-btn {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.gfm-footprint-btn:hover {
    background: #0891b2;
    color: #ffffff;
}

.gfm-loading, .gfm-no-obs, .gfm-error {
    text-align: center;
    padding: 30px;
    font-size: 14px;
    color: #94a3b8;
}

.gfm-error {
    color: #fca5a5;
}

/* ==========================================================================
   JRC SDB Hydrological River Segment & Station Styles
   ========================================================================== */

.stat-card-sdb:hover {
    border-color: #0284c7;
}

.stat-card-sdb .stat-value {
    color: #38bdf8;
}

.pill-sdb {
    border-color: rgba(14, 165, 233, 0.4) !important;
    background: rgba(14, 165, 233, 0.1) !important;
    color: #38bdf8 !important;
}

.pill-sdb:hover {
    background: rgba(14, 165, 233, 0.25) !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
}

/* Event Card SDB Elements */
.sdb-event-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(14, 165, 233, 0.3);
    color: #38bdf8;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    margin-top: 8px;
}

.sdb-badge-icon {
    font-size: 15px;
}

.sdb-badge-text strong {
    color: #ffffff;
}

.sdb-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.btn-sdb-details, .btn-sdb-map {
    background: #0f172a;
    border: 1px solid rgba(14, 165, 233, 0.4);
    color: #38bdf8;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
}

.btn-sdb-details:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
}

.btn-sdb-map:hover {
    background: #0369a1;
    color: #ffffff;
    border-color: #0284c7;
}

/* SDB Modal */
.sdb-modal-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    max-width: 820px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-top: 4px solid #0284c7;
    animation: modalSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sdb-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #334155;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 16px 16px 0 0;
}

.sdb-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sdb-modal-title .modal-icon {
    font-size: 28px;
}

.sdb-modal-title h3 {
    font-size: 18px;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
}

.sdb-subtitle {
    font-size: 12px;
    color: #94a3b8;
}

.sdb-modal-body {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sdb-modal-summary {
    display: flex;
    gap: 20px;
    padding: 10px 16px;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.25);
    border-radius: 8px;
    font-size: 13px;
    color: #cbd5e1;
}

.sdb-modal-summary strong {
    color: #38bdf8;
}

.sdb-seg-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sdb-seg-item {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s;
}

.sdb-seg-item:hover {
    border-color: #0284c7;
}

.sdb-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.sdb-item-num {
    background: #334155;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.sdb-item-name {
    font-size: 14px;
    color: #f8fafc;
}

.sdb-item-name strong {
    color: #38bdf8;
}

.sdb-item-name em {
    color: #7dd3fc;
    font-style: normal;
}

.sdb-item-badge {
    font-size: 12px;
    color: #94a3b8;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.3);
    padding: 3px 8px;
    border-radius: 6px;
}

.sdb-item-badge strong {
    color: #34d399;
}

.sdb-item-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
    font-size: 12px;
    color: #cbd5e1;
    background: #090d16;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #1e293b;
}

.sdb-item-details-grid code {
    font-family: var(--font-code);
    color: #7dd3fc;
}

.sdb-item-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.sdb-map-btn, .sdb-api-link-btn {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
}

.sdb-map-btn {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.sdb-map-btn:hover {
    background: #0284c7;
    color: #ffffff;
}

.sdb-api-link-btn {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sdb-api-link-btn:hover {
    background: #059669;
    color: #ffffff;
}

.sdb-loading, .sdb-no-obs, .sdb-error {
    text-align: center;
    padding: 30px;
    font-size: 14px;
    color: #94a3b8;
}

.sdb-error {
    color: #fca5a5;
}

/* Secondary & Cascading Impacts Styles */
.stat-card-secondary {
    border-left: 3px solid #f59e0b;
}

.pill-secondary {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
    color: #fbbf24 !important;
}

.pill-secondary:hover {
    background: rgba(245, 158, 11, 0.3) !important;
}

.secondary-event-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(217, 119, 6, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 6px;
    font-size: 12px;
    color: #fef3c7;
}

.secondary-badge-icon {
    font-size: 14px;
}

.secondary-badge-text strong {
    color: #fbbf24;
}

.secondary-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.btn-secondary-details {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: #fde68a;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary-details:hover {
    background: #d97706;
    color: #ffffff;
}

.secondary-modal-card {
    background: #0f172a;
    border: 1px solid #d97706;
    border-radius: 12px;
    max-width: 780px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7), 0 0 20px rgba(245, 158, 11, 0.15);
    overflow: hidden;
}

.secondary-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(245, 158, 11, 0.25);
    background: #1e293b;
}

.secondary-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.secondary-modal-title h3 {
    margin: 0;
    font-size: 17px;
    color: #fbbf24;
}

.secondary-subtitle {
    font-size: 12px;
    color: #cbd5e1;
}

.secondary-modal-body {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.secondary-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.secondary-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #fde68a;
    margin: 0;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.secondary-direct-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.secondary-direct-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.secondary-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.secondary-name {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-transform: capitalize;
}

.secondary-metric {
    font-size: 14px;
    font-weight: 700;
    color: #fbbf24;
}

.secondary-metric.qualitative {
    font-weight: normal;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qualitative-tag {
    align-self: flex-start;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
}

.qualitative-tag-sm {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    margin-right: 4px;
}

.qualitative-desc {
    font-size: 12px;
    font-style: italic;
    color: #e2e8f0;
    line-height: 1.4;
    word-break: break-word;
}

.secondary-qual-note {
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
    line-height: 1.35;
    margin-top: 2px;
}

.secondary-casc-qualitative-text {
    font-size: 12px;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.5);
    border-left: 3px solid #38bdf8;
    border-radius: 4px;
    padding: 6px 10px;
    margin-top: 4px;
    line-height: 1.4;
}

.sec-impact-quant {
    color: #fbbf24;
    font-weight: 600;
}

.sec-impact-qual {
    color: #38bdf8;
    font-weight: 500;
    font-size: 11px;
}

.secondary-casc-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.secondary-casc-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-left: 3px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.secondary-casc-card.upstream {
    border-left-color: #0284c7;
}

.secondary-casc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.secondary-lag-badge,
.secondary-dekad-badge {
    background: #0369a1;
    color: #e0f2fe;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.secondary-dist-badge {
    background: #065f46;
    color: #d1fae5;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
}

.secondary-confidence {
    color: #10b981;
    font-weight: 600;
}

.secondary-casc-headline {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.4;
}

.secondary-casc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: #94a3b8;
}

.secondary-casc-meta strong {
    color: #cbd5e1;
}

.pathway-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-lifeline_cascade { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.tag-inundation_stagnation { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.4); }
.tag-humanitarian_cascade { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.tag-hydraulic_cascade { background: rgba(14, 165, 233, 0.2); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.4); }
.tag-economic_interruption { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.tag-environmental_cascade { background: rgba(20, 184, 166, 0.2); color: #2dd4bf; border: 1px solid rgba(20, 184, 166, 0.4); }
.tag-health_strain { background: rgba(244, 63, 94, 0.2); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.4); }
.tag-lagged_damage { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.4); }
.tag-unknown, .tag-indirect { background: rgba(100, 116, 139, 0.2); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.4); }

/* GHSL Settlement Unit Elements */
.stat-card-settlement {
    border-top: 3px solid #d97706;
}

.pill-settlement {
    border-color: rgba(217, 119, 6, 0.4) !important;
    background: rgba(217, 119, 6, 0.12) !important;
    color: #f59e0b !important;
}

.pill-settlement:hover {
    background: rgba(217, 119, 6, 0.25) !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
}

.color-settlement {
    background: #d97706 !important;
}

.settlement-event-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(217, 119, 6, 0.12);
    border: 1px solid rgba(217, 119, 6, 0.35);
    color: #fbbf24;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    margin-top: 8px;
}

.settlement-badge-icon {
    font-size: 15px;
}

.settlement-badge-text strong {
    color: #ffffff;
}

.settlement-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.btn-settlement-details {
    background: #0f172a;
    border: 1px solid rgba(217, 119, 6, 0.4);
    color: #fbbf24;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
}

.btn-settlement-details:hover {
    background: #d97706;
    color: #ffffff;
    border-color: #fbbf24;
}

/* Settlement Modal */
.settlement-modal-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    max-width: 860px;
    width: 92%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-top: 4px solid #d97706;
    animation: modalSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.settlement-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #334155;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 16px 16px 0 0;
}

.settlement-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settlement-modal-title .modal-icon {
    font-size: 28px;
}

.settlement-modal-title h3 {
    font-size: 18px;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
}

.settlement-subtitle {
    font-size: 12px;
    color: #94a3b8;
}

.settlement-modal-body {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settlement-modal-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 18px;
    background: rgba(217, 119, 6, 0.1);
    border: 1px solid rgba(217, 119, 6, 0.25);
    border-radius: 10px;
    font-size: 13px;
    color: #cbd5e1;
}

.settlement-modal-summary strong {
    color: #fbbf24;
}

.settlement-item-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settlement-item-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s;
}

.settlement-item-card:hover {
    border-color: #d97706;
}

.settlement-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.settlement-item-num {
    background: #334155;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.settlement-item-name {
    font-size: 15px;
    color: #f8fafc;
}

.settlement-item-name strong {
    color: #fbbf24;
}

.settlement-item-name em {
    color: #fde68a;
    font-style: normal;
}

.settlement-item-badge {
    font-size: 12px;
    color: #94a3b8;
    background: rgba(217, 119, 6, 0.1);
    border: 1px solid rgba(217, 119, 6, 0.3);
    padding: 2px 8px;
    border-radius: 6px;
}

.settlement-exposure-highlight-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(217, 119, 6, 0.25);
    border-radius: 8px;
    padding: 12px;
}

.exp-metric-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.exp-label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.exp-value {
    font-size: 14px;
    font-weight: 700;
    color: #f8fafc;
}

.exp-source-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(14, 165, 233, 0.15);
    border: 1px solid rgba(14, 165, 233, 0.35);
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
}

.settlement-item-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 18px;
    font-size: 13px;
    color: #94a3b8;
    border-top: 1px solid #1e293b;
    padding-top: 10px;
}

.settlement-item-details-grid div strong {
    color: #cbd5e1;
}

.badge-urban-class {
    background: rgba(217, 119, 6, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(217, 119, 6, 0.4);
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 4px;
}

.badge-settlementunit {
    background: rgba(217, 119, 6, 0.2) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(217, 119, 6, 0.4) !important;
}

.settlement-loading, .settlement-no-obs, .settlement-error {
    text-align: center;
    padding: 30px;
    color: #94a3b8;
    font-size: 14px;
}

.settlement-error {
    color: #f87171;
}

/* OpenStreetMap Critical Infrastructure Elements */
.stat-card-infrastructure {
    border-top: 3px solid #10b981;
}

.pill-infrastructure {
    border-color: rgba(16, 185, 129, 0.4) !important;
    background: rgba(16, 185, 129, 0.12) !important;
    color: #34d399 !important;
}

.pill-infrastructure:hover {
    background: rgba(16, 185, 129, 0.25) !important;
    border-color: #34d399 !important;
    color: #ffffff !important;
}

.color-infrastructure {
    background: #10b981 !important;
}

.infrastructure-event-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    margin-top: 8px;
}

.infrastructure-badge-icon {
    font-size: 15px;
}

.infrastructure-badge-text strong {
    color: #ffffff;
}

.infrastructure-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.btn-infrastructure-details, .btn-infrastructure-map {
    background: #0f172a;
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-infrastructure-details:hover {
    background: #10b981;
    color: #ffffff;
    border-color: #34d399;
}

.btn-infrastructure-map:hover {
    background: #059669;
    color: #ffffff;
    border-color: #10b981;
}

/* Critical Infrastructure Modal */
.infrastructure-modal-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    max-width: 900px;
    width: 94%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-top: 4px solid #10b981;
    animation: modalSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.infrastructure-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #334155;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 16px 16px 0 0;
}

.infrastructure-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.infrastructure-modal-title .modal-icon {
    font-size: 28px;
}

.infrastructure-modal-title h3 {
    font-size: 18px;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
}

.infrastructure-subtitle {
    font-size: 12px;
    color: #94a3b8;
}

.infrastructure-modal-body {
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.infrastructure-modal-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    gap: 16px;
    flex-wrap: wrap;
}

.infrastructure-summary-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    align-items: center;
    font-size: 12px;
    color: #cbd5e1;
}

.infra-summary-item {
    background: #1e293b;
    border: 1px solid #334155;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.infra-summary-item strong {
    color: #f8fafc;
    font-weight: 700;
}

.infra-summary-item.item-healthcare {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(6, 78, 59, 0.35);
}
.infra-summary-item.item-healthcare strong { color: #34d399; }

.infra-summary-item.item-emergency {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(127, 29, 29, 0.35);
}
.infra-summary-item.item-emergency strong { color: #f87171; }

.infra-summary-item.item-water {
    border-color: rgba(2, 132, 199, 0.4);
    background: rgba(12, 74, 110, 0.35);
}
.infra-summary-item.item-water strong { color: #38bdf8; }

.infra-summary-item.item-transport {
    border-color: rgba(217, 119, 6, 0.4);
    background: rgba(120, 53, 15, 0.35);
}
.infra-summary-item.item-transport strong { color: #fbbf24; }

.infra-summary-item.item-utility {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(76, 29, 149, 0.35);
}
.infra-summary-item.item-utility strong { color: #c084fc; }

.infra-summary-item.item-other {
    border-color: rgba(148, 163, 184, 0.4);
    background: rgba(30, 41, 59, 0.5);
}
.infra-summary-item.item-other strong { color: #cbd5e1; }

.btn-infrastructure-modal-map {
    background: #064e3b;
    border: 1px solid #10b981;
    color: #34d399;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans);
}

.btn-infrastructure-modal-map:hover {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Leaflet Custom Infrastructure Pin Markers */
.infra-marker-div-icon {
    background: transparent !important;
    border: none !important;
}

.infra-map-pin {
    width: 32px;
    height: 32px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    border: 2px solid #ffffff;
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.18s;
}

.infra-map-pin:hover {
    transform: rotate(-45deg) scale(1.28);
    z-index: 1000 !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.7);
}

.infra-map-pin .infra-pin-icon {
    transform: rotate(45deg);
    font-size: 15px;
    line-height: 1;
    display: inline-block;
    user-select: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Category pin colors */
.infra-map-pin.pin-healthcare {
    background: #059669;
    border-color: #34d399;
}
.infra-map-pin.pin-emergency {
    background: #dc2626;
    border-color: #f87171;
}
.infra-map-pin.pin-water {
    background: #0284c7;
    border-color: #38bdf8;
}
.infra-map-pin.pin-transport {
    background: #d97706;
    border-color: #fbbf24;
}
.infra-map-pin.pin-utility {
    background: #7c3aed;
    border-color: #c084fc;
}
.infra-map-pin.pin-other {
    background: #334155;
    border-color: #94a3b8;
}

/* Leaflet MarkerCluster Group Badges */
.infra-marker-cluster-container {
    background: transparent !important;
    border: none !important;
}

.infra-cluster-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #ffffff;
    font-weight: 700;
    font-family: var(--font-sans);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s;
}

.infra-cluster-badge:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 22px rgba(16, 185, 129, 0.6);
}

.infra-cluster-small {
    width: 36px;
    height: 36px;
    background: radial-gradient(circle, #059669 0%, #064e3b 100%);
    font-size: 12px;
}

.infra-cluster-medium {
    width: 42px;
    height: 42px;
    background: radial-gradient(circle, #0284c7 0%, #0c4a6e 100%);
    font-size: 13px;
    border-color: #38bdf8;
}

.infra-cluster-large {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, #7c3aed 0%, #4c1d95 100%);
    font-size: 14px;
    border-color: #c084fc;
}

/* Floating Map Banner for Infrastructure Overlay */
.infra-map-banner {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid #10b981;
    border-radius: 10px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    font-family: var(--font-sans);
    animation: fadeIn 0.2s ease-in-out;
}

.infra-banner-title {
    font-weight: 700;
    color: #34d399;
    font-size: 13px;
    display: block;
}

.infra-banner-counts {
    font-size: 11px;
    color: #cbd5e1;
    display: block;
    margin-top: 3px;
    line-height: 1.4;
}

.btn-clear-infra-map {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.6);
    color: #fca5a5;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-sans);
    white-space: nowrap;
}

.btn-clear-infra-map:hover {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.infrastructure-category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.infra-cat-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    background: #1e293b;
    border: 1px solid #334155;
    color: #94a3b8;
}

.infra-cat-pill.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #34d399;
}

.infrastructure-item-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.infrastructure-item-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s;
}

.infrastructure-item-card:hover {
    border-color: #10b981;
}

.infrastructure-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.infrastructure-item-num {
    background: #334155;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.infrastructure-item-name {
    font-size: 15px;
    color: #f8fafc;
}

.infrastructure-item-name strong {
    color: #34d399;
}

.infrastructure-item-name em {
    color: #6ee7b7;
    font-style: normal;
}

.infrastructure-item-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 6px;
    text-transform: capitalize;
}

.badge-infra-healthcare {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-infra-emergency {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-infra-water {
    background: rgba(2, 132, 199, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(2, 132, 199, 0.4);
}

.badge-infra-transport {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-infra-utility {
    background: rgba(139, 92, 246, 0.2);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.badge-infra-other {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.4);
}

.infrastructure-item-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px 16px;
    font-size: 13px;
    color: #94a3b8;
    border-top: 1px solid #1e293b;
    padding-top: 10px;
}

.infrastructure-item-details-grid div strong {
    color: #cbd5e1;
}

.infrastructure-item-details-grid a {
    color: #38bdf8;
    text-decoration: none;
}

.infrastructure-item-details-grid a:hover {
    text-decoration: underline;
}

.badge-infrastructureasset {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
}

.infrastructure-loading, .infrastructure-no-obs, .infrastructure-error {
    text-align: center;
    padding: 30px;
    color: #94a3b8;
    font-size: 14px;
}

.infrastructure-error {
    color: #f87171;
}

/* ==========================================================================
   Rolling Wheel Spinner & Loading State for Response Div
   ========================================================================== */
.response-spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 16px;
    color: #94a3b8;
    text-align: center;
}

.rolling-wheel {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(56, 189, 248, 0.15);
    border-top-color: #38bdf8;
    border-right-color: #0284c7;
    border-radius: 50%;
    animation: rolling-wheel-spin 0.9s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.35);
}

@keyframes rolling-wheel-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.response-spinner-title {
    font-size: 15px;
    font-weight: 600;
    color: #f8fafc;
}

.response-spinner-sub {
    font-size: 13px;
    color: #64748b;
}

/* Tab Loading Overlay for all response tabs */
.tab-loading-overlay {
    position: absolute;
    inset: 0;
    min-height: 280px;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    gap: 16px;
    border-radius: 12px;
    color: #94a3b8;
    text-align: center;
    padding: 32px 24px;
}

.tab-pane {
    position: relative;
    min-height: 320px;
}

.summary-box {
    position: relative;
}

.map-box {
    position: relative;
}

.graph-canvas-wrapper {
    position: relative;
}

.events-grid {
    position: relative;
    min-height: 280px;
}

.cypher-container {
    position: relative;
    min-height: 280px;
}

/* ==========================================================================
   Tab Blinking Animation on Search Completion or Timeout
   ========================================================================== */
.tab-btn.tab-blink {
    animation: tab-pulse-yellow 0.7s ease-in-out infinite alternate;
}

@keyframes tab-pulse-yellow {
    0% {
        background: rgba(234, 179, 8, 0.2);
        color: #fde047;
        box-shadow: 0 0 0 rgba(234, 179, 8, 0);
        border-color: rgba(234, 179, 8, 0.4);
    }
    100% {
        background: rgba(234, 179, 8, 0.65);
        color: #0f172a;
        font-weight: 700;
        box-shadow: 0 0 16px rgba(250, 204, 21, 0.85);
        border-color: #facc15;
    }
}

.tab-btn.tab-blink-error {
    animation: tab-pulse-error 0.5s ease-in-out infinite alternate;
}

@keyframes tab-pulse-error {
    0% {
        background: rgba(239, 68, 68, 0.15);
        color: #f87171;
        box-shadow: 0 0 0 rgba(239, 68, 68, 0);
    }
    100% {
        background: rgba(239, 68, 68, 0.55);
        color: #ffffff;
        box-shadow: 0 0 14px rgba(239, 68, 68, 0.75);
    }
}

/* ==========================================================================
   Markdown Rendered Typography in Summary Content
   ========================================================================== */
.summary-content.markdown-body {
    font-size: 14.5px;
    line-height: 1.7;
    color: #e2e8f0;
    white-space: normal;
}

.summary-content.markdown-body h1,
.summary-content.markdown-body h2,
.summary-content.markdown-body h3,
.summary-content.markdown-body h4 {
    color: #f8fafc;
    font-weight: 700;
    margin-top: 18px;
    margin-bottom: 8px;
    line-height: 1.35;
}

.summary-content.markdown-body h1 {
    font-size: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
    color: #38bdf8;
}

.summary-content.markdown-body h2 {
    font-size: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 4px;
    color: #7dd3fc;
}

.summary-content.markdown-body h3 {
    font-size: 16px;
    color: #bae6fd;
}

.summary-content.markdown-body h4 {
    font-size: 14.5px;
    color: #e2e8f0;
}

.summary-content.markdown-body p {
    margin-bottom: 12px;
}

.summary-content.markdown-body ul,
.summary-content.markdown-body ol {
    margin: 8px 0 14px 22px;
    padding: 0;
}

.summary-content.markdown-body li {
    margin-bottom: 5px;
}

.summary-content.markdown-body li::marker {
    color: #38bdf8;
}

.summary-content.markdown-body code {
    font-family: var(--font-code);
    font-size: 13px;
    background: #090d16;
    color: #38bdf8;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #1e293b;
}

.summary-content.markdown-body pre {
    background: #090d16;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    margin: 12px 0;
}

.summary-content.markdown-body pre code {
    background: transparent;
    padding: 0;
    border: none;
    color: #f1f5f9;
}

.summary-content.markdown-body blockquote {
    border-left: 3px solid #38bdf8;
    margin: 12px 0;
    padding: 6px 14px;
    background: rgba(56, 189, 248, 0.08);
    color: #cbd5e1;
    border-radius: 0 6px 6px 0;
}

.summary-content.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 13.5px;
}

.summary-content.markdown-body th,
.summary-content.markdown-body td {
    padding: 8px 12px;
    border: 1px solid #334155;
    text-align: left;
}

.summary-content.markdown-body th {
    background: #1e293b;
    color: #38bdf8;
    font-weight: 600;
}

.summary-content.markdown-body tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.5);
}

.summary-content.markdown-body hr {
    border: none;
    border-top: 1px solid #334155;
    margin: 16px 0;
}

.summary-content.markdown-body a {
    color: #38bdf8;
    text-decoration: underline;
}

.summary-content.markdown-body strong {
    color: #ffffff;
    font-weight: 700;
}
