/* Map page — dataset tabs, Leaflet theming, legend. */

#map {
    width: 100%;
    min-height: 400px;
    background: var(--surface-2);
}

.ds-tabs { display: flex; gap: 5px; }
.ds-tab {
    padding: 5px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-2);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.ds-tab:hover { border-color: var(--border-strong); color: var(--text); }
.ds-tab.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-text);
}
.no2-unit { font-size: 10px; color: var(--text-3); font-weight: 400; }

/* ── Leaflet theming via tokens ─────────────────────────────────────────── */

.leaflet-popup-content-wrapper,
.leaflet-tooltip {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-pop);
}
.leaflet-popup-tip { background: var(--surface); }
.leaflet-tooltip-top:before { border-top-color: var(--border-strong); }
.leaflet-container a.leaflet-popup-close-button { color: var(--text-3); }
.leaflet-bar a {
    background: var(--surface);
    color: var(--text);
    border-bottom: 1px solid var(--border);
}
.leaflet-bar a:hover { background: var(--surface-2); }
.leaflet-control-attribution {
    background: var(--surface) !important;
    color: var(--text-3) !important;
}
.leaflet-control-attribution a { color: var(--text-2) !important; }

/* Popup content */
.map-popup { font-family: var(--font-sans); font-size: 12px; min-width: 230px; }
.map-popup-city { font-size: 14px; font-weight: 650; margin-bottom: 1px; }
.map-popup-meta { color: var(--text-3); margin-bottom: 8px; }
.map-popup-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px 12px;
    margin-bottom: 8px;
}
.map-popup-grid .k { color: var(--text-3); }
.map-popup-divider { border-top: 1px solid var(--border); padding-top: 8px; }
.map-popup-year { font-weight: 600; margin-bottom: 5px; }
.map-popup-boundary {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-3);
}

/* Legend */
.map-legend {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-pop);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 12px;
    line-height: 1.6;
    max-width: 230px;
}
.map-legend-title { font-weight: 650; font-size: 12.5px; margin-bottom: 7px; }
.map-legend-section {
    font-weight: 600;
    color: var(--text-3);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 8px 0 4px;
}
.map-legend-row { display: flex; align-items: center; gap: 7px; }
.map-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.map-legend-note { color: var(--text-3); font-size: 11px; line-height: 1.5; }
.map-legend hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
