/* /ev-charging: map workspace, filters, in-view summary, connector cards. Shared chips come from navig-ui.css (.nv-pick, .nv-seg). */
* { box-sizing: border-box; }
body.nv { overflow: hidden; }
#map { height: calc(100dvh - var(--nv-bar-h)); width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Search */
.top-search-container { position: fixed; top: calc(var(--nv-bar-h) + 12px); left: 50%; transform: translateX(-50%); z-index: 1200; width: min(400px, calc(100vw - 140px)); display: flex; flex-direction: column; gap: 6px; }
.top-search-input-wrapper { position: relative; width: 100%; }
.top-search-input { width: 100%; min-height: 44px; padding: 10px 14px 10px 38px; border: 1px solid var(--nv-line); border-radius: var(--nv-r); background: var(--nv-raised); color: var(--nv-ink); font: 16px var(--nv-font); }
.top-search-icon { position: absolute; top: 50%; left: 14px; transform: translateY(-50%); color: var(--nv-muted); pointer-events: none; }
.top-search-results { display: none; background: var(--nv-raised); border: 1px solid var(--nv-line); border-radius: var(--nv-r); overflow: auto; max-height: min(240px, 45dvh); }
.top-search-results.visible { display: block; }
.top-search-result { width: 100%; display: block; min-height: 44px; padding: 10px 14px; text-align: left; background: transparent; color: var(--nv-ink); border: 0; border-bottom: 1px solid var(--nv-line); cursor: pointer; font: inherit; }
.top-search-result:hover, .top-search-result:focus-visible { background: var(--nv-surface); }
.top-search-result strong { display: block; }
.top-search-result span, .top-search-empty, .top-search-error { font-size: .85rem; color: var(--nv-muted); }
.top-search-empty, .top-search-error { padding: 12px 16px; }

/* Right-hand controls */
#weather-circle, .nv .location-button { position: fixed; right: 12px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--nv-raised); color: var(--nv-ink); border: 1px solid var(--nv-line); border-radius: var(--nv-r); box-shadow: none; z-index: 1200; cursor: pointer; text-decoration: none; }
#weather-circle { top: calc(var(--nv-bar-h) + 64px); }
.nv .location-button { top: calc(var(--nv-bar-h) + 116px); bottom: auto; }

/* Chips, filter sheet and in-view summary sit under the search field */
.ev-controls { position: fixed; z-index: 1150; top: calc(var(--nv-bar-h) + 64px); left: 50%; transform: translateX(-50%); width: min(400px, calc(100vw - 140px)); display: grid; gap: 8px; }
.ev-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.ev-chips::-webkit-scrollbar { display: none; }
.ev-chips .nv-pick { flex: none; background: var(--nv-raised); }
.ev-chips .nv-pick[aria-pressed="true"], .ev-chips .nv-pick.is-active { background: var(--nv-accent); }
.ev-sheet { display: grid; gap: 14px; padding: 14px; background: var(--nv-raised); border: 1px solid var(--nv-line); border-radius: var(--nv-r); max-height: calc(100dvh - var(--nv-bar-h) - 200px); overflow-y: auto; overscroll-behavior: contain; animation: ev-sheet-in .28s var(--nv-ease); }
.ev-sheet[hidden], .ev-error[hidden], #ev-price-note[hidden] { display: none; }
.ev-sheet fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; min-width: 0; }
.ev-sheet legend { padding: 0; margin-bottom: 8px; font: 650 .8125rem var(--nv-font); color: var(--nv-ink); }
.ev-plug-options { display: flex; flex-wrap: wrap; gap: 8px; }
.ev-price-options { max-width: 100%; overflow-x: auto; }
.ev-sheet select { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--nv-line); border-radius: var(--nv-r); background: #fff; color: var(--nv-ink); font: 16px var(--nv-font); }
.ev-sheet-actions { display: flex; justify-content: space-between; gap: 8px; }
.ev-sheet-actions .nv-pick:disabled { color: var(--nv-muted); cursor: not-allowed; }

.ev-summary { min-height: 52px; padding: 10px 12px; background: var(--nv-raised); border: 1px solid var(--nv-line); border-radius: var(--nv-r); font: 500 .875rem/1.35 var(--nv-font); color: var(--nv-ink); }
.ev-summary p { margin: 0; }
.ev-summary strong { font: 700 1.125rem var(--nv-mono); font-variant-numeric: tabular-nums; }
.ev-summary[data-state="loading"] .ev-summary-line, .ev-summary[data-state="error"] .ev-summary-line { display: none; }
.ev-skel { display: none; gap: 8px; }
.ev-summary[data-state="loading"] .ev-skel { display: grid; }
.ev-skel span { display: block; height: 14px; border-radius: 4px; background: var(--nv-line); animation: ev-skel 1.3s ease-in-out infinite; }
.ev-skel span:first-child { width: 88%; }
.ev-skel span:last-child { width: 52%; animation-delay: .15s; }
.ev-error { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--nv-bad); }
.ev-meta { margin: 0; color: var(--nv-muted); font-size: .8125rem; line-height: 1.35; }
#ev-price-note { margin: 0; }

/* Markers: 36px visual in a 44px hit area; the number is the connectors free now */
.ev-marker-hit { display: grid; place-items: center; background: none; border: 0; cursor: pointer; }
.ev-cluster, .ev-station-pin { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--nv-ink); background: #fbe6a0; color: var(--nv-ink); font: 700 12px var(--nv-mono); font-variant-numeric: tabular-nums; transition: transform .2s var(--nv-ease); }
.ev-cluster.is-new, .ev-station-pin.is-new { animation: ev-pop .38s var(--nv-ease) backwards; }
.ev-station-pin { background: var(--nv-accent); }
.ev-cluster.is-none, .ev-station-pin.is-none { background: #fff; color: var(--nv-muted); border-color: var(--nv-muted); }
.ev-marker-hit:hover > div { transform: scale(1.08); }
.ev-marker-hit:active > div { transform: scale(.94); }
.ev-marker-hit:focus-visible { outline: 2px solid var(--nv-ink); outline-offset: -4px; border-radius: 50%; }
.ev-you { width: 18px; height: 18px; border-radius: 50%; background: var(--nv-info); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--nv-ink), 0 1px 4px rgba(0,0,0,.35); }

/* Station card: shared .map-pop card plus connector rows */
.ev-popup .map-pop { max-height: min(62dvh, 420px); overflow-y: auto; overscroll-behavior: contain; max-width: min(300px, calc(100vw - 64px)); }
.ev-status-summary { margin: 0; font-size: .875rem; font-weight: 650; }
.ev-connector-list { display: grid; gap: 10px; }
.ev-point { display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid var(--nv-line); animation: ev-rise .35s var(--nv-ease) both; animation-delay: calc(min(var(--i, 0), 6) * 50ms); }
.ev-point h3 { margin: 0; font-size: .9375rem; }
.ev-plug-group { display: grid; gap: 4px; padding: 8px; background: var(--nv-surface); border: 1px solid var(--nv-line); border-radius: var(--nv-r); }
.ev-plug-head { display: flex; justify-content: space-between; gap: 8px; font-size: .875rem; }
.ev-kw { font: 600 .8125rem var(--nv-mono); }
.ev-price { margin: 0; font: 700 1rem var(--nv-mono); font-variant-numeric: tabular-nums; }
.ev-connector-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; font-size: .8125rem; }
.ev-connector-id { color: var(--nv-muted); font-family: var(--nv-mono); overflow-wrap: anywhere; }
.ev-status-pill { flex: none; padding: 3px 9px; border-radius: 999px; border: 1px solid currentColor; font-weight: 650; font-size: .75rem; }
.ev-status-pill.is-free { color: #145c34; background: #e6f4ec; }
.ev-status-pill.is-busy { color: #7a4a05; background: #fbefd5; }
.ev-status-pill.is-off { color: #464b52; background: #eceef0; }

/* Bottom status bar */
.map-status, #last-updated { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1000; max-width: calc(100vw - 100px); padding: 8px 12px; border: 1px solid var(--nv-line); border-radius: var(--nv-r); background: var(--nv-raised); color: var(--nv-muted); font: 600 12px/1.4 var(--nv-font); text-align: center; }
.map-status[data-state="error"] { color: var(--nv-bad); }
.ev-statusbar { position: fixed; z-index: 1000; left: 12px; right: 52px; bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px; pointer-events: none; }
.ev-statusbar > * { pointer-events: auto; }
.ev-statusbar .map-status, .ev-statusbar #last-updated { position: static; transform: none; max-width: none; min-height: 36px; display: inline-flex; align-items: center; }
.ev-statusbar .page-about { position: relative; left: auto; bottom: auto; transform: none; width: auto; z-index: 1; }
.ev-statusbar .page-about > summary { min-height: 44px; margin: -4px 0; padding: 0 12px; font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.ev-statusbar .page-about-body { position: absolute; bottom: calc(100% + 6px); left: 0; width: min(560px, calc(100vw - 24px)); max-height: 60dvh; overflow-y: auto; background: var(--nv-raised); border: 1px solid var(--nv-line); border-radius: var(--nv-r); padding-top: 12px; }

.leaflet-popup-tip-container { display: none; }
button, .map-link { transition: background 180ms var(--nv-ease), transform 180ms var(--nv-ease); }
button:active, .map-link:active { transform: scale(.97); }
input:focus-visible, button:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--nv-ink); outline-offset: 2px; }

@keyframes ev-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes ev-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ev-sheet-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes ev-skel { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

@media (max-width: 767px) {
    .top-search-container { left: 12px; transform: none; width: calc(100vw - 24px); }
    .ev-controls { left: 12px; transform: none; width: calc(100vw - 80px); }
    .ev-statusbar { right: 68px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
