/*!
 * EV Charger Map - page styles
 * Loaded only on /ev-charging-stations/ and its city pages. Built on the design
 * tokens in style.css (--wst-*), so it follows the dark / light switch with
 * the rest of the site. Every class is prefixed ev- to stay clear of the other
 * map pages.
 *
 * Layout: hero with the search, a filter bar, then the results list beside a
 * large map (list under the map below 992px). The station card floats on the
 * map on desktop and becomes a bottom sheet on phones. evmap.js only toggles
 * hidden attributes and a few classes; the geometry lives here.
 */

/* ------------------------------------------------------------------ tokens */
.ev-page {
  /* Speed tiers. Decorative reinforcement only: every tier is also named. */
  --ev-ultra: #8b5cf6;
  --ev-fast: #0ea5e9;
  --ev-standard: #10b981;
  --ev-slow: #94a3b8;
  --ev-unknown: #64748b;
  --ev-ok: #34d399;
  --ev-warn: #fbbf24;
  --ev-glass: var(--wst-surface);
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .ev-page { --ev-glass: color-mix(in srgb, var(--wst-surface) 88%, transparent); }
}
:root[data-theme="light"] .ev-page {
  --ev-ok: #047857;
  --ev-warn: #a16207;
}

/* -------------------------------------------------------------------- hero */
.ev-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(2rem, 5vw, 3.75rem) clamp(1.75rem, 4vw, 2.75rem);
  text-align: center;
  border-bottom: 1px solid var(--wst-line);
  background:
    radial-gradient(60% 80% at 18% 0%, var(--wst-hero-a), transparent 70%),
    radial-gradient(50% 70% at 85% 10%, var(--wst-hero-b), transparent 70%),
    radial-gradient(40% 60% at 50% 100%, var(--wst-hero-c), transparent 75%),
    var(--wst-bg);
}
/* A faint charging-grid wash, all CSS. */
.ev-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--wst-map-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--wst-map-grid) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(70% 90% at 50% 30%, #000 30%, transparent 80%);
  mask-image: radial-gradient(70% 90% at 50% 30%, #000 30%, transparent 80%);
}
.ev-hero .breadcrumb { justify-content: center; font-size: .8rem; margin-bottom: 1.1rem; }
.ev-hero .breadcrumb-item.active { color: var(--wst-muted); }

.ev-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .9rem;
  padding: .32rem .8rem .32rem .55rem;
  border: 1px solid var(--wst-line-strong);
  border-radius: var(--wst-radius-pill);
  background: var(--wst-blue-soft);
  color: var(--wst-ink);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.ev-eyebrow svg { color: var(--ev-standard); }

.ev-hero__title {
  margin: 0 auto .7rem;
  max-width: 20ch;
  font-size: clamp(2rem, 5.2vw, 3.4rem);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -.035em;
}
.ev-accent {
  background: linear-gradient(100deg, var(--wst-accent) 5%, var(--ev-standard) 55%, var(--wst-violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ev-hero__lead {
  margin: 0 auto 1.6rem;
  max-width: 46rem;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  line-height: 1.6;
  color: var(--wst-body);
}

/* The big search */
.ev-search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 46rem;
  margin: 0 auto;
}
.ev-search__icon {
  position: absolute;
  left: 20px;
  color: var(--wst-muted);
  pointer-events: none;
}
.ev-search__input {
  width: 100%;
  height: 62px;
  padding: 0 128px 0 54px;
  border: 1px solid var(--wst-line-strong);
  border-radius: var(--wst-radius-pill);
  background: var(--ev-glass);
  color: var(--wst-ink);
  font-size: 1.05rem;
  box-shadow: var(--wst-shadow-lg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ev-search__input::placeholder { color: var(--wst-muted); opacity: 1; }
.ev-search__input:focus {
  outline: none;
  border-color: var(--wst-accent);
  box-shadow: 0 0 0 4px var(--bs-focus-ring-color), var(--wst-shadow-lg);
}
.ev-search__go {
  position: absolute;
  right: 7px;
  height: 48px;
  padding-inline: 1.4rem;
  border-radius: var(--wst-radius-pill);
  font-weight: 700;
}

.ev-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .5rem 1rem;
  margin-top: 1rem;
}
.ev-locate {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 46px;
  padding-inline: 1.25rem;
  border: 1px solid var(--wst-line-strong);
  border-radius: var(--wst-radius-pill);
  background: var(--wst-surface);
  color: var(--wst-ink);
  font-weight: 700;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.ev-locate:hover:not(:disabled) { border-color: var(--wst-accent); background: var(--wst-surface-2); color: var(--wst-ink); }
.ev-locate svg { color: var(--wst-accent); }
.ev-locate.is-busy svg { animation: ev-spin 1.2s linear infinite; }
.ev-hero__hint { font-size: .8rem; color: var(--wst-muted); }

.ev-examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .4rem;
  max-width: 46rem;
  margin: 1.1rem auto 0;
}
.ev-examples__label { font-size: .8rem; font-weight: 600; color: var(--wst-muted); margin-right: .2rem; }
.ev-example {
  padding: .3rem .8rem;
  border: 1px solid var(--wst-line);
  border-radius: var(--wst-radius-pill);
  background: transparent;
  color: var(--wst-body);
  font-size: .82rem;
  font-weight: 600;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.ev-example:hover { border-color: var(--wst-accent); color: var(--wst-ink); background: var(--wst-blue-soft); }

/* ------------------------------------------------------------------ filters */
.ev-app { padding-block: 1.25rem clamp(2rem, 5vw, 3.5rem); scroll-margin-top: 4.5rem; }

.ev-filters {
  display: grid;
  gap: .7rem;
  margin-bottom: 1rem;
  padding: 14px 16px;
  border: 1px solid var(--wst-line);
  border-radius: var(--wst-radius);
  background: var(--wst-glass);
  box-shadow: var(--wst-shadow-sm);
}
.ev-filter-group {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.ev-filter-group__label {
  flex: none;
  width: 6.2rem;
  margin: 0;
  padding: 0;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--wst-muted);
}
.ev-chips { display: flex; flex-wrap: wrap; gap: .4rem; min-width: 0; }

.ev-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .32rem .75rem;
  border: 1px solid var(--wst-line);
  border-radius: var(--wst-radius-pill);
  background: var(--wst-surface);
  color: var(--wst-body);
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.ev-chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.ev-chip:hover { border-color: var(--wst-line-strong); color: var(--wst-ink); }
.ev-chip:has(input:checked) {
  border-color: var(--wst-accent);
  background: var(--wst-blue-soft);
  color: var(--wst-ink);
}
.ev-chip:has(input:focus-visible) { outline: 3px solid var(--wst-focus-ring); outline-offset: 2px; }
.ev-chip small { font-weight: 600; color: var(--wst-muted); }
.ev-chip.is-unsupported {
  opacity: .45;
  cursor: not-allowed;
  text-decoration: line-through;
  text-decoration-color: var(--wst-muted);
}
.ev-chip.is-unsupported:hover { border-color: var(--wst-line); color: var(--wst-body); }
.ev-chip__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.ev-filters__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding-top: .55rem;
  border-top: 1px solid var(--wst-line);
  font-size: .78rem;
  color: var(--wst-muted);
}
.ev-clear {
  border: 0;
  padding: 0;
  background: none;
  color: var(--wst-accent);
  font-weight: 700;
  font-size: .8rem;
}
.ev-clear:hover { color: var(--wst-accent-hover); text-decoration: underline; }

/* ------------------------------------------------------------------ layout */
.ev-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 16px;
  height: clamp(560px, 76vh, 880px);
}

.ev-results {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--wst-line);
  border-radius: var(--wst-radius);
  background: var(--wst-glass);
  box-shadow: var(--wst-shadow-sm);
  overflow: hidden;
}
.ev-results__bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 12px 14px 10px 16px;
  border-bottom: 1px solid var(--wst-line);
}
.ev-results__count {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--wst-ink);
}
.ev-sort {
  flex: none;
  height: 32px;
  padding: 0 1.9rem 0 .75rem;
  border: 1px solid var(--wst-line-strong);
  border-radius: var(--wst-radius-pill);
  background-color: var(--wst-bg-soft);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238394b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 6 4 4 4-4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  background-size: 12px;
  color: var(--wst-ink);
  font-size: .8rem;
  font-weight: 600;
  appearance: none;
  cursor: pointer;
}
.ev-sort:focus-visible { outline: 3px solid var(--wst-focus-ring); outline-offset: 2px; }

.ev-results__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--wst-line-strong) transparent;
}
.ev-note {
  margin: 4px 4px 8px;
  padding: .55rem .7rem;
  border: 1px solid color-mix(in srgb, var(--ev-warn) 45%, transparent);
  border-radius: var(--wst-radius-sm);
  background: color-mix(in srgb, var(--ev-warn) 10%, transparent);
  font-size: .78rem;
  line-height: 1.45;
  color: var(--wst-ink);
}

/* Intro before the first search */
.ev-intro { padding: 22px 12px 10px; text-align: center; }
.ev-intro__icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: .75rem;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--ev-standard), var(--ev-fast) 55%, var(--ev-ultra));
  box-shadow: 0 10px 26px -10px var(--wst-glow);
}
.ev-intro__title { margin: 0 0 .35rem; font-weight: 800; color: var(--wst-ink); }
.ev-intro__text { margin: 0 0 1rem; font-size: .85rem; line-height: 1.55; }
.ev-legend { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; text-align: left; font-size: .8rem; }
.ev-legend li { display: flex; align-items: center; gap: .5rem; }
.ev-legend .ev-chip__dot { width: 10px; height: 10px; }

.ev-dot--ultra { background: var(--ev-ultra); }
.ev-dot--fast { background: var(--ev-fast); }
.ev-dot--standard { background: var(--ev-standard); }
.ev-dot--slow { background: var(--ev-slow); }
.ev-dot--unknown { background: var(--ev-unknown); }

/* Results */
.ev-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.ev-item__btn {
  display: flex;
  gap: .7rem;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--wst-radius-sm);
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background-color .15s ease, border-color .15s ease;
}
.ev-item__btn:hover { background: var(--wst-blue-soft); }
.ev-item__btn:focus-visible { outline: 3px solid var(--wst-focus-ring); outline-offset: 1px; }
.ev-item.is-selected .ev-item__btn { border-color: var(--wst-accent); background: var(--wst-blue-soft); }
.ev-item__mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #fff;
  background: var(--ev-unknown);
}
.ev-item__mark--ultra { background: linear-gradient(135deg, #a78bfa, var(--ev-ultra)); }
.ev-item__mark--fast { background: linear-gradient(135deg, #38bdf8, var(--ev-fast)); }
.ev-item__mark--standard { background: linear-gradient(135deg, #34d399, var(--ev-standard)); }
.ev-item__mark--slow { background: linear-gradient(135deg, #cbd5e1, var(--ev-slow)); color: #0f172a; }
.ev-item__body { display: grid; gap: .15rem; min-width: 0; }
.ev-item__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: .9rem;
  color: var(--wst-ink);
}
.ev-item__meta { font-size: .78rem; color: var(--wst-muted); }
.ev-item__plugs { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .2rem; }
.ev-plug {
  padding: .05rem .45rem;
  border: 1px solid var(--wst-line);
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 600;
  color: var(--wst-body);
}
.ev-plug--down { border-color: color-mix(in srgb, var(--ev-warn) 50%, transparent); color: var(--ev-warn); }
.ev-item--more { padding: 8px 10px; font-size: .78rem; color: var(--wst-muted); }

.ev-skeleton { display: grid; gap: 8px; padding: 4px; }
.ev-skeleton span {
  height: 58px;
  border-radius: var(--wst-radius-sm);
  background: linear-gradient(90deg, var(--wst-surface) 25%, var(--wst-surface-2) 50%, var(--wst-surface) 75%);
  background-size: 200% 100%;
  animation: ev-shimmer 1.3s ease-in-out infinite;
}

/* --------------------------------------------------------------------- map */
.ev-mapwrap {
  position: relative;
  isolation: isolate;          /* Leaflet's z-indexes stay under the header */
  min-height: 0;
  border: 1px solid var(--wst-line);
  border-radius: var(--wst-radius);
  overflow: hidden;
  background: var(--wst-bg-soft);
  box-shadow: var(--wst-shadow-lg);
  scroll-margin-top: 4.5rem;
}
.ev-map { position: absolute; inset: 0; z-index: 0; background: var(--wst-bg-soft); }

/* The site is dark-first; OpenStreetMap's tiles are not. Inverting the tile
   layer gives a dark street map without a second tile provider. Markers, the
   card and the controls sit outside the tile pane and keep their colours. */
:root:not([data-theme="light"]) .ev-map--leaflet .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(.95) contrast(.88) saturate(.55);
}
.ev-map .leaflet-container,
.ev-map.leaflet-container { background: var(--wst-bg-soft); font-family: inherit; }
.ev-map .leaflet-control-zoom {
  border: 1px solid var(--wst-line) !important;
  border-radius: 14px !important;
  overflow: hidden;
  box-shadow: var(--wst-shadow-sm) !important;
}
.ev-map .leaflet-control-zoom a {
  width: 38px;
  height: 38px;
  line-height: 36px;
  background: var(--wst-surface);
  color: var(--wst-ink);
  border-color: var(--wst-line);
}
.ev-map .leaflet-control-zoom a:hover { background: var(--wst-surface-2); color: var(--wst-accent); }
.ev-map .leaflet-control-attribution {
  background: color-mix(in srgb, var(--wst-surface) 85%, transparent);
  color: var(--wst-muted);
  font-size: .68rem;
}
.ev-map .leaflet-control-attribution a { color: var(--wst-accent); }

/* Pins: a teardrop in the tier colour with a bolt. */
.ev-pin-wrap { background: none; border: 0; }
.ev-pin {
  position: relative;
  display: block;
  width: 34px;
  height: 42px;
  cursor: pointer;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .45));
  transition: transform .15s ease;
}
.ev-pin__head {
  position: absolute;
  top: 2px;
  left: 3px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--ev-unknown);
  color: #fff;
}
.ev-pin__head svg { transform: rotate(45deg); }
.ev-pin--ultra .ev-pin__head { background: var(--ev-ultra); }
.ev-pin--fast .ev-pin__head { background: var(--ev-fast); }
.ev-pin--standard .ev-pin__head { background: var(--ev-standard); }
.ev-pin--slow .ev-pin__head { background: var(--ev-slow); color: #0f172a; }
.ev-pin--down .ev-pin__head { background: #475569; opacity: .8; }
.ev-pin:hover,
.ev-pin.is-selected { transform: scale(1.18) translateY(-2px); }
.ev-pin.is-selected .ev-pin__head { border-color: var(--ev-warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ev-warn) 35%, transparent); }
.leaflet-marker-icon:focus-visible .ev-pin { outline: 3px solid var(--wst-focus-ring); outline-offset: 2px; border-radius: 8px; }

.ev-cluster-wrap { background: none; border: 0; }
.ev-cluster {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 3px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ev-fast), var(--ev-ultra));
  color: #fff;
  font-weight: 800;
  font-size: .82rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4), 0 0 0 5px color-mix(in srgb, var(--ev-fast) 25%, transparent);
}

.ev-you span,
.ev-you > span {
  display: block;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 6px rgba(37, 99, 235, .28);
}
.ev-accuracy { fill: #5cc8ff; fill-opacity: .1; stroke: #5cc8ff; stroke-opacity: .5; stroke-width: 1; }

/* Overlays on the map */
.ev-overlay {
  position: absolute;
  z-index: 900;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
.ev-overlay > * { pointer-events: auto; }
.ev-overlay--top { top: 14px; }
.ev-overlay--centre { top: 50%; transform: translate(-50%, -50%); width: min(360px, calc(100% - 32px)); }

.ev-pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  padding: .55rem 1rem;
  border: 1px solid var(--wst-line-strong);
  border-radius: var(--wst-radius-pill);
  background: var(--ev-glass);
  color: var(--wst-ink);
  font-size: .85rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--wst-shadow-lg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.ev-pill--action { cursor: pointer; transition: border-color .15s ease, transform .15s ease; }
.ev-pill--action:hover { border-color: var(--wst-accent); transform: translateY(-1px); }
.ev-pill--action svg { color: var(--wst-accent); }

.ev-notice {
  padding: 18px;
  border: 1px solid var(--wst-line-strong);
  border-radius: var(--wst-radius-md);
  background: var(--ev-glass);
  text-align: center;
  box-shadow: var(--wst-shadow-lg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.ev-notice__icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: .5rem;
  border-radius: 50%;
  background: var(--wst-blue-soft);
  color: var(--wst-accent);
}
.ev-notice__icon--error { background: color-mix(in srgb, var(--ev-warn) 16%, transparent); color: var(--ev-warn); }
.ev-notice__text { margin: 0 0 .8rem; font-size: .9rem; line-height: 1.5; color: var(--wst-ink); }
.ev-notice__actions { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; }

.ev-maplegend {
  position: absolute;
  z-index: 800;
  left: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .75rem;
  margin: 0;
  padding: .45rem .75rem;
  list-style: none;
  border: 1px solid var(--wst-line);
  border-radius: 12px;
  background: var(--ev-glass);
  font-size: .72rem;
  font-weight: 600;
  color: var(--wst-body);
  box-shadow: var(--wst-shadow-sm);
}
.ev-maplegend li { display: inline-flex; align-items: center; gap: .35rem; }
.ev-app.has-card .ev-maplegend { visibility: hidden; }

/* ------------------------------------------------------------ station card */
.ev-card {
  position: absolute;
  z-index: 1000;
  top: 12px;
  right: 12px;
  width: min(390px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow-y: auto;
  padding: 18px 18px 16px;
  border: 1px solid var(--wst-line-strong);
  border-radius: var(--wst-radius);
  background: var(--wst-surface);
  box-shadow: var(--wst-shadow-lg);
  scrollbar-width: thin;
  animation: ev-in .22s cubic-bezier(.2, .8, .2, 1);
}
.ev-card__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--wst-line);
  border-radius: 50%;
  background: var(--wst-bg-soft);
  color: var(--wst-ink);
}
.ev-card__close:hover { border-color: var(--wst-accent); color: var(--wst-accent); }
.ev-card__head { display: flex; gap: .75rem; align-items: flex-start; padding-right: 40px; }
.ev-card__mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #fff;
  background: var(--ev-unknown);
}
.ev-card__titles { min-width: 0; }
.ev-card__title {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--wst-ink);
  overflow-wrap: anywhere;
}
.ev-card__title:focus { outline: none; }
.ev-card__sub { margin: .2rem 0 0; font-size: .82rem; color: var(--wst-muted); }
.ev-card__badges { display: flex; flex-wrap: wrap; gap: .35rem; margin: .9rem 0 .4rem; }

.ev-tier,
.ev-badge {
  display: inline-flex;
  align-items: center;
  padding: .18rem .55rem;
  border: 1px solid var(--wst-line);
  border-radius: var(--wst-radius-pill);
  font-size: .74rem;
  font-weight: 700;
  color: var(--wst-ink);
  background: var(--wst-bg-soft);
}
.ev-tier { color: #fff; border-color: transparent; }
.ev-tier--ultra { background: var(--ev-ultra); }
.ev-tier--fast { background: #0284c7; }
.ev-tier--standard { background: #047857; }
.ev-tier--slow { background: #475569; }
.ev-tier--unknown { background: transparent; color: var(--wst-muted); border-color: var(--wst-line); }
.ev-badge--ok { color: var(--ev-ok); border-color: color-mix(in srgb, var(--ev-ok) 45%, transparent); }
.ev-badge--warn { color: var(--ev-warn); border-color: color-mix(in srgb, var(--ev-warn) 45%, transparent); }

.ev-dl { margin: .5rem 0 0; }
.ev-dl__row {
  display: grid;
  grid-template-columns: 8.2rem minmax(0, 1fr);
  gap: .6rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--wst-line);
  font-size: .85rem;
}
.ev-dl__row:last-child { border-bottom: 0; }
.ev-dl dt { font-weight: 600; color: var(--wst-muted); }
.ev-dl dd { margin: 0; color: var(--wst-ink); overflow-wrap: anywhere; }
.ev-dl a { color: var(--wst-accent); }
.ev-muted { color: var(--wst-muted); }
.ev-ok { color: var(--ev-ok); }
.ev-warn { color: var(--ev-warn); }

.ev-conn { display: grid; gap: .3rem; margin: 0; padding: 0; list-style: none; }
.ev-conn__row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .5rem; }
.ev-conn__type { font-weight: 700; }
.ev-conn__spec { color: var(--wst-muted); font-size: .8rem; }
.ev-conn__avail { color: var(--ev-ok); font-size: .78rem; font-weight: 700; }

.ev-hours { display: grid; gap: .3rem; justify-items: start; }
.ev-hours__list { margin: 0; padding: 0; list-style: none; font-size: .8rem; color: var(--wst-body); }
.ev-rating { display: inline-flex; align-items: center; gap: .1rem; }
.ev-rating svg { color: #fbbf24; }

.ev-card__actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1rem; }
.ev-card__actions .btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  font-weight: 700;
  border-radius: var(--wst-radius-pill);
}
.ev-card__actions .btn-primary { flex: 1 1 100%; justify-content: center; min-height: 44px; }
.ev-card__actions .btn-outline-secondary { flex: 1 1 0; justify-content: center; }
.ev-card__more { margin-top: .8rem; padding-top: .3rem; border-top: 1px dashed var(--wst-line-strong); }
.ev-card__disclaimer { margin: .7rem 0 0; font-size: .75rem; line-height: 1.5; color: var(--wst-muted); }

.ev-attrib { margin: .75rem 0 0; font-size: .75rem; color: var(--wst-muted); }
.ev-attrib a { color: var(--wst-accent); }

.ev-toast {
  position: fixed;
  z-index: 1100;
  left: 50%;
  bottom: 24px;
  max-width: calc(100% - 32px);
  transform: translateX(-50%);
  padding: .7rem 1.1rem;
  border: 1px solid var(--wst-line-strong);
  border-radius: var(--wst-radius-pill);
  background: var(--wst-surface-2);
  color: var(--wst-ink);
  font-size: .85rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  box-shadow: var(--wst-shadow-lg);
}

/* Popular city links under the map */
.ev-cities { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.ev-cities a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .9rem;
  border: 1px solid var(--wst-line);
  border-radius: var(--wst-radius-pill);
  background: var(--wst-surface);
  color: var(--wst-ink);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
}
.ev-cities a:hover { border-color: var(--wst-accent); color: var(--wst-accent); }
.ev-cities svg { color: var(--ev-standard); }

/* Connector guide table */
.ev-table { font-size: .92rem; }
.ev-table th { color: var(--wst-ink); white-space: nowrap; }

/* ---------------------------------------------------------------- tablet */
@media (max-width: 991.98px) {
  .ev-layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  .ev-mapwrap { order: -1; height: 64vh; height: 64svh; min-height: 420px; }
  /* Capped, or a busy city would push the guide thousands of pixels down. */
  .ev-results__body { max-height: 70vh; max-height: 70svh; }

  /* The card becomes a bottom sheet inside the map. */
  .ev-card {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    max-height: 78%;
    padding: 16px 14px 14px;
    border-radius: 18px;
    animation-name: ev-up;
  }
}

/* ----------------------------------------------------------------- phones */
@media (max-width: 767.98px) {
  .ev-search__input { height: 56px; padding-right: 58px; font-size: 1rem; }
  .ev-search__go { width: 44px; height: 44px; padding: 0; right: 6px; }
  .ev-search__go-text { display: none; }
  .ev-hero__hint { flex-basis: 100%; }

  .ev-filters { padding: 12px 0 10px; border-radius: var(--wst-radius-md); }
  .ev-filter-group { display: grid; gap: .35rem; }
  .ev-filter-group__label { width: auto; padding-inline: 14px; }
  /* One swipeable row per group instead of a wall of chips. */
  .ev-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 2px 14px 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .ev-chips::-webkit-scrollbar { display: none; }
  .ev-filters__foot { padding-inline: 14px; }
  .ev-maplegend { display: none; }
  .ev-dl__row { grid-template-columns: 7rem minmax(0, 1fr); }
}
@media (min-width: 768px) and (max-width: 991.98px) {
  .ev-filter-group__label { width: 5.6rem; }
}

/* ------------------------------------------------------------- animation */
@keyframes ev-spin { to { transform: rotate(360deg); } }
@keyframes ev-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes ev-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes ev-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .ev-card, .ev-skeleton span, .ev-locate.is-busy svg { animation: none; }
  .ev-pin, .ev-pill--action { transition: none; }
}
