/* EWER Dashboard Regional Intelligence — isolated presentation layer */
#aiHotspotsContainer {
    overflow: hidden;
    border-left: 0 !important;
    background: var(--card-bg) !important;
}

#aiHotspotsContainer .card-header {
    gap: 1rem;
    flex-wrap: wrap;
}

.ewer-methodology-note {
    margin: -0.25rem 1.25rem 0;
    padding: 0 0 0.8rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    border-bottom: 1px solid var(--border-color);
}

.ewer-hotspot-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
    gap: 1rem !important;
}

.ewer-hotspot-card {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 12px;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
}

.ewer-hotspot-card.risk-2 { border-top-color: #d97706; }
.ewer-hotspot-card.risk-3 { border-top-color: #dc2626; }

.ewer-hotspot-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.ewer-hotspot-card-header strong {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.ewer-trend-badge {
    flex: none;
    padding: 0.24rem 0.45rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    background: var(--bg-main);
    color: var(--text-secondary);
}

.ewer-trend-badge.trend-rising { background: rgba(220, 38, 38, 0.1); color: #b91c1c; }
.ewer-trend-badge.trend-declining { background: rgba(5, 150, 105, 0.1); color: #047857; }
.ewer-trend-badge.trend-stable { background: rgba(37, 99, 235, 0.1); color: #1d4ed8; }

.ewer-hotspot-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.ewer-hotspot-metrics > div {
    padding: 0.6rem;
    border-radius: 9px;
    background: var(--bg-main);
}

.ewer-hotspot-metrics span,
.ewer-hotspot-metrics strong {
    display: block;
}

.ewer-hotspot-metrics span {
    margin-bottom: 0.16rem;
    color: var(--text-muted);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ewer-hotspot-metrics strong {
    color: var(--text-primary);
    font-size: 1rem;
}

.ewer-hotspot-prediction {
    margin: 0.85rem 0 0;
    color: var(--text-secondary);
    font-size: 0.76rem;
    line-height: 1.55;
}

.ewer-intelligence-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 110px;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    background: var(--bg-main);
}

.ewer-intelligence-state.is-error { color: #b91c1c; border-color: rgba(220, 38, 38, 0.28); }
.ewer-intelligence-state.is-stable strong { color: var(--text-primary); }

.ewer-regional-card-body {
    align-items: stretch !important;
}

#zambiaMapContainer {
    isolation: isolate;
}

.map-path {
    cursor: pointer;
    fill: #6366f1 !important;
    fill-opacity: var(--province-intensity, 0.16) !important;
    stroke: #6366f1 !important;
    stroke-width: 1.2 !important;
    transition: fill-opacity 180ms ease, stroke-width 180ms ease, filter 180ms ease;
    outline: none;
}

.map-path:hover,
.map-path:focus,
.map-path.is-selected {
    fill-opacity: 0.92 !important;
    stroke-width: 3 !important;
    filter: drop-shadow(0 5px 9px rgba(79, 70, 229, 0.25));
}

.ewer-map-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 0.8rem;
    color: var(--text-muted);
    font-size: 0.67rem;
}

.ewer-map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.ewer-legend-dot {
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 3px;
    background: #6366f1;
}

.ewer-legend-dot.low { opacity: 0.22; }
.ewer-legend-dot.medium { opacity: 0.55; }
.ewer-legend-dot.high { opacity: 0.92; }

.ewer-regional-breakdown {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 1rem;
}

.ewer-region-metric {
    min-width: 0;
    padding: 0.75rem;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-main);
}

.ewer-region-metric span,
.ewer-region-metric strong {
    display: block;
}

.ewer-region-metric span {
    margin-bottom: 0.25rem;
    color: var(--text-muted);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
}

.ewer-region-metric strong {
    color: var(--text-primary);
    font-size: 1.05rem;
}

@media (max-width: 900px) {
    .ewer-regional-card-body {
        flex-direction: column !important;
        padding: 1.25rem !important;
    }

    #zambiaMapContainer {
        width: 100%;
        max-width: 620px !important;
        margin: 0 auto;
    }
}

@media (max-width: 520px) {
    .ewer-hotspot-grid,
    .ewer-regional-breakdown {
        grid-template-columns: 1fr !important;
    }

    .ewer-hotspot-metrics {
        grid-template-columns: 1fr 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .map-path { transition: none; }
}
/* EWER Regional Predictive Intelligence V2 */
.ewer-regional-card-body-v2 {
    display: grid !important;
    grid-template-columns: minmax(340px, .88fr) minmax(520px, 1.22fr) !important;
    align-items: stretch !important;
    gap: 1.25rem !important;
    padding: 1.25rem !important;
}
.ewer-regional-card-body-v2 #zambiaMapContainer { max-width: none !important; width: 100%; align-self: center; }
.ewer-map-info-panel-v2 { min-width: 0 !important; width: 100%; }
.ewer-legacy-map-heading { display: none !important; }

.ewer-predictive-panel {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 1rem;
    border: 1px solid color-mix(in srgb, var(--primary-color) 22%, var(--border-color));
    border-radius: 18px;
    background: var(--card-bg);
    box-shadow: 0 16px 38px rgba(15, 23, 42, .07);
}
.ewer-predictive-panel.hidden { display: none !important; }
.ewer-predictive-panel__heading,
.ewer-predictive-title-wrap,
.ewer-subpanel-heading,
.ewer-predictive-footer { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.ewer-predictive-title-wrap { justify-content: flex-start; min-width: 0; }
.ewer-predictive-icon {
    display: inline-flex; width: 42px; height: 42px; flex: 0 0 42px; align-items: center; justify-content: center;
    border: 1px solid rgba(79, 70, 229, .24); border-radius: 50%; color: #4f46e5; background: rgba(79, 70, 229, .08);
}
.ewer-predictive-eyebrow,
.ewer-subpanel-heading span,
.ewer-ai-metric span,
.ewer-action-priority {
    color: var(--text-muted); font-size: .62rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase;
}
.ewer-predictive-panel__heading h3 { margin: .15rem 0 0; color: var(--text-primary); font-size: 1.35rem; line-height: 1.1; }
.ewer-predictive-panel__heading p { margin: .3rem 0 0; color: var(--text-secondary); font-size: .7rem; }
.ewer-watch-badge,
.ewer-inline-state,
.ewer-analyst-required {
    display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; padding: .35rem .55rem;
    border-radius: 999px; font-size: .6rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
    background: rgba(37, 99, 235, .09); color: #1d4ed8;
}
.ewer-watch-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ewer-watch-badge[data-tone="high"] { background: rgba(220,38,38,.09); color:#b91c1c; }
.ewer-watch-badge[data-tone="moderate"] { background: rgba(217,119,6,.1); color:#b45309; }
.ewer-watch-badge[data-tone="low"] { background: rgba(5,150,105,.1); color:#047857; }

.ewer-predictive-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; margin-top: .9rem; }
.ewer-ai-metric {
    display: flex; align-items: flex-start; justify-content: space-between; gap: .55rem; min-width: 0;
    padding: .72rem; border: 1px solid var(--border-color); border-radius: 13px; background: var(--bg-main);
}
.ewer-ai-metric > div { min-width: 0; }
.ewer-ai-metric strong { display: block; margin-top: .28rem; color: var(--text-primary); font-size: 1.25rem; line-height: 1; }
.ewer-ai-metric small { display: block; margin-top: .3rem; color: var(--text-muted); font-size: .57rem; line-height: 1.3; }
.ewer-ai-metric > i { display: inline-flex; width: 30px; height: 30px; flex: 0 0 30px; align-items:center; justify-content:center; border-radius: 50%; background: rgba(79,70,229,.08); color:#4f46e5; }
.ewer-ai-metric.is-warning strong, .ewer-ai-metric.is-warning > i { color:#d97706; }
.ewer-ai-metric.is-danger strong, .ewer-ai-metric.is-danger > i { color:#dc2626; }
.ewer-ai-metric.is-success strong, .ewer-ai-metric.is-success > i { color:#059669; }
.ewer-ai-metric.is-violet strong, .ewer-ai-metric.is-violet > i { color:#7c3aed; }

.ewer-predictive-analysis-grid { display:grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap:.7rem; margin-top:.7rem; }
.ewer-predictive-subpanel,
.ewer-actions-section { min-width:0; padding:.75rem; border:1px solid var(--border-color); border-radius:14px; background:var(--card-bg); }
.ewer-subpanel-heading { align-items:flex-start; }
.ewer-subpanel-heading h4 { margin:.13rem 0 0; color:var(--text-primary); font-size:.74rem; }
.ewer-subpanel-heading > i { color:var(--text-muted); }
.ewer-inline-state[data-trend="rising"] { background:rgba(220,38,38,.09); color:#b91c1c; }
.ewer-inline-state[data-trend="declining"] { background:rgba(5,150,105,.09); color:#047857; }

.ewer-forecast-chart { margin-top:.45rem; min-height:150px; }
.ewer-forecast-chart svg { display:block; width:100%; height:150px; overflow:visible; }
.ewer-chart-grid line { stroke:var(--border-color); stroke-width:1; }
.ewer-chart-area { fill:rgba(79,70,229,.09); }
.ewer-chart-line { fill:none; stroke:#4f46e5; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }
.ewer-chart-points circle { fill:var(--card-bg); stroke:#4f46e5; stroke-width:2; }
.ewer-chart-labels { display:flex; justify-content:space-between; color:var(--text-muted); font-size:.56rem; }
.ewer-model-note { margin:.4rem 0 0; color:var(--text-muted); font-size:.56rem; line-height:1.45; }

.ewer-narrative-list { display:flex; flex-direction:column; gap:.55rem; margin-top:.55rem; }
.ewer-narrative-item { display:grid; grid-template-columns:30px minmax(0,1fr); gap:.55rem; align-items:start; }
.ewer-narrative-icon { display:inline-flex; width:30px; height:30px; align-items:center; justify-content:center; border-radius:50%; color:#4f46e5; background:rgba(79,70,229,.08); }
.ewer-narrative-item strong { display:block; color:var(--text-primary); font-size:.68rem; }
.ewer-narrative-item p { margin:.14rem 0 0; color:var(--text-secondary); font-size:.61rem; line-height:1.42; }

.ewer-actions-section { margin-top:.7rem; }
.ewer-analyst-required { background:rgba(79,70,229,.08); color:#4f46e5; }
.ewer-actions-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.55rem; margin-top:.55rem; }
.ewer-action-card { display:grid; grid-template-columns:32px minmax(0,1fr); gap:.55rem; min-width:0; padding:.65rem; border:1px solid var(--border-color); border-radius:12px; background:var(--bg-main); }
.ewer-action-icon { display:inline-flex; width:32px; height:32px; align-items:center; justify-content:center; border-radius:50%; color:#4f46e5; background:rgba(79,70,229,.08); }
.ewer-action-card strong { display:block; color:var(--text-primary); font-size:.65rem; }
.ewer-action-card p { margin:.2rem 0 .35rem; color:var(--text-secondary); font-size:.58rem; line-height:1.4; }
.ewer-action-card.priority-high .ewer-action-priority { color:#b91c1c; }
.ewer-action-card.priority-medium .ewer-action-priority { color:#b45309; }
.ewer-action-card.priority-low .ewer-action-priority { color:#047857; }

.ewer-predictive-footer { margin-top:auto; padding-top:.65rem; border-top:1px solid var(--border-color); color:var(--text-muted); font-size:.58rem; }

.ewer-predictive-tooltip {
    position:absolute; z-index:50; width:min(270px,calc(100% - 24px)); padding:.75rem; pointer-events:none;
    opacity:0; visibility:hidden; transform:translateY(6px); transition:opacity .14s ease,transform .14s ease,visibility .14s ease;
    border:1px solid rgba(79,70,229,.22); border-radius:13px; background:color-mix(in srgb,var(--card-bg) 94%,transparent);
    box-shadow:0 16px 40px rgba(15,23,42,.18); backdrop-filter:blur(12px);
}
.ewer-predictive-tooltip.is-visible { opacity:1; visibility:visible; transform:translateY(0); }
.ewer-predictive-tooltip__head { display:flex; justify-content:space-between; gap:.6rem; align-items:flex-start; }
.ewer-predictive-tooltip__head span { display:block; color:var(--text-muted); font-size:.56rem; text-transform:uppercase; }
.ewer-predictive-tooltip__head strong { display:block; margin-top:.13rem; color:var(--text-primary); font-size:.9rem; }
.ewer-predictive-tooltip__head b { padding:.25rem .38rem; border-radius:999px; background:rgba(79,70,229,.09); color:#4f46e5; font-size:.55rem; }
.ewer-predictive-tooltip__grid { display:grid; grid-template-columns:repeat(4,1fr); gap:.35rem; margin-top:.55rem; }
.ewer-predictive-tooltip__grid div { padding:.42rem .25rem; border-radius:8px; background:var(--bg-main); text-align:center; }
.ewer-predictive-tooltip__grid strong,.ewer-predictive-tooltip__grid span { display:block; }
.ewer-predictive-tooltip__grid strong { color:var(--text-primary); font-size:.8rem; }
.ewer-predictive-tooltip__grid span { margin-top:.1rem; color:var(--text-muted); font-size:.5rem; text-transform:uppercase; }
.ewer-predictive-tooltip p { margin:.5rem 0 0; color:var(--text-muted); font-size:.55rem; }

#zambiaSvgMap .map-path { cursor:pointer; transform-box:fill-box; transform-origin:center; transition:fill-opacity .16s ease,stroke-width .16s ease,filter .16s ease,transform .16s ease; }
#zambiaSvgMap .map-path.is-hovered,#zambiaSvgMap .map-path:focus-visible { fill-opacity:.88 !important; stroke:#fff !important; stroke-width:3 !important; filter:drop-shadow(0 7px 12px rgba(79,70,229,.28)); transform:translateY(-1px); }
#zambiaSvgMap .map-path.is-selected { fill-opacity:.96 !important; stroke:#fff !important; stroke-width:3.4 !important; filter:drop-shadow(0 9px 16px rgba(67,56,202,.34)); }

@media (max-width: 1280px) {
    .ewer-regional-card-body-v2 { grid-template-columns:1fr !important; }
    .ewer-regional-card-body-v2 #zambiaMapContainer { max-width:650px !important; margin:0 auto; }
}
@media (max-width: 760px) {
    .ewer-predictive-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .ewer-predictive-analysis-grid { grid-template-columns:1fr; }
    .ewer-actions-grid { grid-template-columns:1fr; }
    .ewer-predictive-panel__heading,.ewer-predictive-footer { align-items:flex-start; flex-direction:column; }
}
@media (max-width: 520px) {
    .ewer-predictive-panel { padding:.75rem; border-radius:14px; }
    .ewer-predictive-metrics { grid-template-columns:1fr 1fr; }
    .ewer-predictive-tooltip { display:none; }
}
@media (prefers-reduced-motion: reduce) {
    #zambiaSvgMap .map-path,.ewer-predictive-tooltip { transition:none; }
}
