/* Pull-through EV fast chargers — public map */
:root {
  --bg: #f3efe6;
  --paper: #fffdf8;
  --ink: #1b1915;
  --muted: #5c564c;
  --faint: #8a8376;
  --line: #ddd6c8;
  --line-strong: #c9c0ae;
  --navy: #1b3545;
  --navy-2: #16303e;
  --cream: #f3efe6;
  --tesla: #b4232c;
  --documented: #c05609;
  --pilot: #0a7a84;
  --rivian: #2a6b3f;
  --mdhd: #6c6559;
  --focus: #1b3545;
  --danger: #8b1e1e;
  --shadow: 0 1px 2px rgba(27,25,21,.05), 0 10px 28px rgba(27,25,21,.08);
  --font: "Segoe UI", ui-sans-serif, system-ui, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --max: 1120px;
  --radius: 12px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-size: 16px;
}
a { color: #164e6e; }
a:hover { color: var(--ink); }
img, svg { max-width: 100%; }
h1, h2, h3 { font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: clamp(1.6rem, 3vw, 2.15rem); margin: 0 0 .4rem; }
h2 { font-size: 1.25rem; margin: 0 0 .75rem; }
p { margin: 0 0 1rem; }
.wrap { width: min(var(--max), calc(100% - 32px)); margin-inline: auto; }

header {
  background: var(--navy);
  color: var(--cream);
  padding: 28px 0 26px;
}
header p { color: #d5cfc3; margin: 0; max-width: 62ch; }
header .asof { display: inline-block; margin-top: 12px; font-size: .82rem; color: #b9c5cc; }

main { padding: 28px 0 64px; }
section { margin: 0 0 2.4rem; }

.lede { color: var(--muted); max-width: 70ch; }

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 1.6rem;
}
.metric {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px 14px;
}
.metric b { display: block; font-size: 1.55rem; letter-spacing: -0.03em; line-height: 1.1; }
.metric span { display: block; color: var(--muted); font-size: .82rem; margin-top: 4px; }

.callout {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 1.4rem;
  color: var(--ink);
}
.callout strong { display: block; margin-bottom: 2px; }
.callout p { margin: 0; color: var(--muted); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  margin: 0 0 12px;
}
.layers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.layer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px 6px 10px;
  font-size: .9rem;
  cursor: pointer;
  user-select: none;
}
.layer input { accent-color: var(--navy); margin: 0; }
.layer .swatch {
  width: 10px; height: 10px; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,.12);
  flex: none;
}
.layer .swatch.hollow { background: var(--paper) !important; border: 2px solid var(--tesla); box-shadow: none; width: 8px; height: 8px; }
.layer.off { opacity: .55; }

label.field { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: var(--muted); }
label.field input, label.field select, button, .btn {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 10px;
}
label.field input, label.field select { min-width: 160px; }
label.field input[type="search"] { min-width: min(280px, 100%); }
button, .btn {
  cursor: pointer;
  background: var(--navy);
  color: var(--cream);
  border-color: var(--navy);
  padding: 8px 14px;
}
button.secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line-strong);
}
button:hover, .btn:hover { filter: brightness(1.08); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, .layer:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.map-frame {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
#map { height: min(62vh, 640px); min-height: 340px; width: 100%; background: #d9e3d6; }
.map-caption { font-size: .82rem; color: var(--muted); margin: 8px 0 0; }

.leaflet-popup-content-wrapper { border-radius: 10px; }
.leaflet-popup-content { margin: 12px 14px; font-size: 14px; line-height: 1.45; min-width: 200px; }
.popup h3 { font-size: 1rem; margin: 0 0 4px; }
.popup .addr { color: #5c564c; margin: 0 0 8px; }
.popup dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
.popup dt { color: #5c564c; }
.popup dd { margin: 0; }
.popup .note { margin: 8px 0 0; color: #3f3b35; }
.popup .src { margin: 6px 0 0; font-size: .8rem; color: #6e675c; }

.pin-wrap { background: none; border: none; }
.pin {
  display: block; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25);
}
.pin.hollow { background: #fff !important; border-width: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }

.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; font-size: .78rem; text-transform: none; letter-spacing: .01em; color: var(--muted); background: #f7f3eb; position: sticky; top: 0; white-space: nowrap; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--ink); }
th[aria-sort="ascending"]::after { content: " \2191"; }
th[aria-sort="descending"]::after { content: " \2193"; }
tbody tr[data-id] { cursor: pointer; }
tbody tr:hover { background: #f4efe4; }
tbody tr.active { background: #e7eef2; }
.tag {
  display: inline-block;
  font-size: .72rem;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.muted { color: var(--muted); }
.empty { padding: 18px; color: var(--muted); }

.pager {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 10px; font-size: .9rem; color: var(--muted);
}
.pager button { padding: 6px 12px; }

.sources, .caveats { max-width: 75ch; }
.sources ul, .caveats ul { margin: 0; padding-left: 1.2rem; }
.sources li, .caveats li { margin: 0 0 .45rem; }
.links { list-style: none; padding: 0; margin: 1rem 0 0; }
.links li { margin: 0 0 .6rem; padding: 10px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.links .site { color: var(--faint); font-size: .82rem; }

footer {
  border-top: 1px solid var(--line);
  padding: 18px 0 28px;
  color: var(--muted);
  font-size: .85rem;
}
footer p { margin: 0; }
footer .hits { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
footer .hits img { display: block; height: 20px; width: auto; border: 0; }

.error {
  background: #f8ecec;
  border: 1px solid #e3c1c1;
  color: var(--danger);
  padding: 12px 14px;
  border-radius: 8px;
}

@media (max-width: 640px) {
  :root { --max: 100%; }
  .wrap { width: calc(100% - 24px); }
  header { padding: 22px 0 20px; }
  #map { height: 55vh; min-height: 280px; }
  th, td { padding: 8px 8px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  label.field input, label.field select { min-width: 0; width: 100%; }
  .toolbar { flex-direction: column; align-items: stretch; }
}
