:root {
  color-scheme: light dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #f8f9fb;
  --text: #17191c;
  --muted: #626973;
  --border: #dde1e7;
  --control-border: #818891;
  --accent: #c62828;
  --accent-strong: #a51f1f;
  --coming: #7c4dff;
  --good: #0d7a4a;
  --warn: #9a5c00;
  --price-very-low: #0d7a4a;
  --price-low: #0b7771;
  --price-moderate: #856d00;
  --price-high: #a95400;
  --price-very-high: #b42318;
  --price-unknown: #626973;
  --shadow: 0 10px 26px rgba(0, 0, 0, 0.07);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101214;
    --panel: #181b1f;
    --panel-2: #20242a;
    --text: #f3f4f6;
    --muted: #a9b0ba;
    --border: #343a43;
    --control-border: #7e8998;
    --accent: #ef5350;
    --accent-strong: #ff6b68;
    --coming: #b39ddb;
    --good: #51c990;
    --warn: #e5b15f;
    --price-very-low: #51c990;
    --price-low: #55c9c0;
    --price-moderate: #e0c85c;
    --price-high: #f0a15c;
    --price-very-high: #ff7470;
    --price-unknown: #a9b0ba;
    --shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
.result-feedback, .detail-load-feedback { padding: 12px; margin: 8px; background: var(--panel-2); border: 1px solid var(--control-border); border-radius: 8px; font-size: .85rem; line-height: 1.45; }
.result-feedback p, .detail-load-feedback p { margin: 0 0 8px; }
.feedback-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.map-feedback { position: absolute; top: 12px; right: 12px; z-index: 5; max-width: 280px; background: var(--panel); border: 1px solid var(--control-border); border-radius: 12px; padding: 12px; font-size: .85rem; box-shadow: var(--shadow); }
.map-feedback[hidden] { display: none; }
.map-feedback p { margin: 0 0 8px; }
@media (max-width: 820px) {
  .map-feedback { top: auto; bottom: calc(90px + env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
  body.detail-open .map-feedback, body.filters-open .map-feedback, body.app-menu-open .map-feedback { display: none; }
}

.topbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 14px;
  max-width: 1800px;
  margin: 0 auto;
}

h1 { margin: 0; font-size: clamp(1.35rem, 2vw, 2rem); }
.subtitle { margin: 5px 0 0; color: var(--muted); }
.header-status { display: grid; justify-items: end; gap: 6px; }
.header-pills { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.dataset-time { color: var(--muted); text-align: right; font-size: 0.9rem; }
.validation-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--panel);
}
.validation-status.passed { color: var(--good); border-color: color-mix(in srgb, var(--good) 50%, var(--border)); }
.validation-status.warning { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, var(--border)); }
.validation-status.failed,
.validation-status.error { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.validation-status.not-run { color: var(--muted); border-color: var(--border); }
.history-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--panel);
}
.history-status.ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 50%, var(--border)); }
.history-status.changed { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, var(--border)); }
.history-status.neutral { color: var(--muted); }

main { max-width: 1800px; margin: 0 auto; padding: 0 24px 24px; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.metric {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.metric span { display: block; color: var(--muted); font-size: 0.8rem; }
.metric strong { display: block; margin-top: 3px; font-size: 1.35rem; }

.history-dashboard {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.history-dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.history-dashboard-head h2 {
  margin: 0;
  font-size: 1rem;
}
.history-dashboard-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}
.history-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.history-dashboard-grid article {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
}
.history-dashboard-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
}
.history-dashboard-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filters {
  display: grid;
  /*
   * Keep the desktop filter area intentionally two rows instead of forcing
   * every control into one crowded line. There are 11 filter fields plus
   * Reset; six columns gives us two balanced rows with enough width for
   * labels such as "Operational + coming soon" and "Minimum schedule rate".
   */
  grid-template-columns: minmax(300px, 1.7fr) repeat(5, minmax(155px, 1fr));
  gap: 10px;
  align-items: end;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.field { display: grid; gap: 5px; min-width: 0; }
.field span { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.field input, .field select {
  width: 100%;
  min-height: 38px;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
}

.max-price-custom {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
}
.max-price-custom[hidden] { display: none; }
.max-price-custom input {
  min-width: 0;
  text-align: right;
}
.currency-prefix,
.unit-suffix {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.button {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 11px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}
.button:hover { border-color: var(--accent); }
.button:disabled { opacity: 0.4; cursor: default; }
.button.compact { min-height: 31px; padding: 5px 8px; }

.map-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}
.viewport-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
}
.viewport-toggle input { width: 16px; height: 16px; }
.map-control-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.location-status {
  color: var(--muted);
  font-size: 0.76rem;
}

.filter-summary {
  display: grid;
  grid-template-columns: auto repeat(7, minmax(105px, 1fr));
  gap: 8px;
  align-items: stretch;
  margin-bottom: 12px;
}
.filter-summary-title {
  display: flex;
  align-items: center;
  padding: 0 10px 0 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.filter-summary article {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
}
.filter-summary article span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
}
.filter-summary article strong {
  display: block;
  margin-top: 2px;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.price-tier-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin-bottom: 12px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.74rem;
}
.price-tier-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.price-tier-legend-title {
  color: var(--text);
  font-weight: 800;
}
.price-tier-swatch {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 40%, transparent);
}
.price-tier-legend-note {
  margin-left: auto;
  white-space: normal !important;
  text-align: right;
}

.workspace {
  display: grid;
  /* Tesla Find Us-style desktop emphasis: a dominant map plus a narrow result rail. */
  grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
  gap: 12px;
  height: clamp(720px, calc(100vh - 88px), 980px);
  min-height: 720px;
}
.map-panel, .results-panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.map-panel {
  min-width: 0;
  height: 100%;
}
#map {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #aad3df;
}
.map-legend {
  position: absolute;
  z-index: 600;
  left: 12px;
  bottom: 12px;
  display: flex;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--border);
  font-size: 0.8rem;
}
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
.operational-dot { background: var(--accent); }
.coming-dot { background: var(--coming); }
.nearby-context-dot {
  background: #98a3af;
  border: 1px solid #5f6b78;
}
.tooltip-context-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.results-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  height: 100%;
}
.results-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.page-controls { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 0.8rem; }
.results {
  min-height: 0;
  overflow: auto;
  max-height: none;
  overscroll-behavior: contain;
}
.result-card {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.result-card:hover { background: var(--panel-2); }
.result-card.selected {
  background: color-mix(in srgb, var(--accent) 9%, var(--panel));
  box-shadow: inset 3px 0 0 var(--accent);
}
.result-card.selected .result-name { color: var(--accent-strong); }
.result-top { display: flex; justify-content: space-between; gap: 10px; }
.result-name { font-weight: 700; line-height: 1.25; }
.result-location { margin-top: 3px; color: var(--muted); font-size: 0.82rem; }
.price { font-weight: 800; white-space: nowrap; }
.price-value { font-weight: inherit; }
.price-tier-very-low { color: var(--price-very-low) !important; }
.price-tier-low { color: var(--price-low) !important; }
.price-tier-moderate { color: var(--price-moderate) !important; }
.price-tier-high { color: var(--price-high) !important; }
.price-tier-very-high { color: var(--price-very-high) !important; }
.price-tier-unknown { color: var(--price-unknown) !important; }
.price-tier-uniform { color: var(--muted) !important; }
.pricing-now > strong.price-tier-unknown { font-size: 1.1rem; line-height: 1.35; }
.pricing-rule-cards { display: grid; gap: 10px; }
.pricing-rule-card { padding: 12px; border: 1px solid var(--border); background: var(--panel-2); border-radius: 9px; min-width: 0; }
.pricing-rule-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pricing-rule-heading h4 { margin: 0; font-size: .86rem; }
.pricing-rule-amount { font-weight: 800; font-size: 1rem; margin: 8px 0 5px; }
.pricing-rule-facts { margin: 10px 0; display: grid; gap: 7px; font-size: .78rem; }
.pricing-rule-facts > div { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 10px; }
.pricing-rule-facts dt { color: var(--muted); }
.pricing-rule-facts dd { margin: 0; }
.pricing-rule-card > p:last-child { margin-bottom: 0; }
.rule-tier-details > summary, .additional-rules-table > summary { cursor: pointer; font-size: .78rem; padding: 9px 0; }
.rule-tier-details .tier-values > div { grid-template-columns: minmax(0, 1fr) auto; }
.rule-tier-details .tier-values dt { overflow-wrap: anywhere; }
.additional-rules-table { margin-top: 10px; }
.legend-band-hidden { display: none !important; }
.meta-row { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.history-change-chip {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 50%, var(--border));
  background: color-mix(in srgb, var(--warn) 8%, var(--panel-2));
}
.chip, .badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.badge.operational {
  color: var(--good);
  border-color: var(--good);
  background: color-mix(in srgb, var(--good) 10%, var(--panel));
}
.badge.coming { border-color: var(--coming); }

#detailDialog {
  width: min(900px, calc(100vw - 32px));
  max-height: min(86vh, 900px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.35);
}
#detailDialog::backdrop { background: rgba(0,0,0,0.5); }
.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}
.dialog-head h2 { margin: 8px 0 0; font-size: 1.25rem; }
.icon-button { border: 0; background: transparent; color: var(--text); font-size: 1.8rem; cursor: pointer; }
.detail-body { padding: 18px; overflow: auto; }
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.action-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.accent-action {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--border));
  color: var(--accent-strong);
}
.pricing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.pricing-now, .pricing-next {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 13px 14px;
  background: var(--panel-2);
}
.pricing-now {
  border-color: color-mix(in srgb, var(--good) 55%, var(--border));
  background: color-mix(in srgb, var(--good) 8%, var(--panel-2));
}
.pricing-now span, .pricing-next span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pricing-now strong {
  display: block;
  margin-top: 4px;
  font-size: 1.55rem;
}
.pricing-next strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
}
.pricing-now small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}
.detail-notice {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--warn) 55%, var(--border));
  border-radius: 9px;
  background: color-mix(in srgb, var(--warn) 8%, var(--panel));
}
.detail-notice strong { color: var(--warn); }
.detail-notice span { color: var(--muted); font-size: 0.82rem; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.detail-span-2 { grid-column: span 2; }
.detail-item { background: var(--panel-2); border-radius: 9px; padding: 10px; border: 1px solid var(--border); }
.detail-item span { display: block; color: var(--muted); font-size: 0.72rem; }
.detail-item strong { display: block; margin-top: 4px; }
.detail-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 0.72rem; }
.detail-item.current-rate {
  border-color: color-mix(in srgb, var(--good) 55%, var(--border));
  background: color-mix(in srgb, var(--good) 9%, var(--panel-2));
}
.detail-item.current-rate strong { color: var(--good); font-size: 1.08rem; }
.detail-section { margin-top: 18px; }
.detail-section h3 { margin: 0 0 8px; font-size: 0.95rem; }
.section-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.small-note { font-size: 0.75rem; }
.schedule-wrap { overflow-x: auto; }
.schedule-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.schedule-table th, .schedule-table td { border-bottom: 1px solid var(--border); padding: 8px 6px; text-align: left; }
.schedule-table tr.active-period td {
  background: color-mix(in srgb, var(--good) 10%, transparent);
}
.schedule-table tr.active-period td:first-child {
  box-shadow: inset 3px 0 0 var(--good);
}
.current-period-tag {
  display: inline-flex;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--good) 16%, var(--panel));
  color: var(--good);
  font-size: 0.66rem;
  font-weight: 800;
  vertical-align: middle;
}
.address-section p { margin-bottom: 0; }

.history-section {
  padding-top: 2px;
}
.history-badge {
  display: inline-flex;
  flex-shrink: 0;
  white-space: nowrap;
  align-items: center;
  min-height: 23px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
}
.history-badge.stable {
  color: var(--good);
  border-color: color-mix(in srgb, var(--good) 48%, var(--border));
}
.history-badge.changed {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 55%, var(--border));
}
.history-badge.neutral { color: var(--muted); }

.history-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}
.history-summary-grid > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
}
.history-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
}
.history-summary-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 0.9rem;
}

.history-timeline {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}
.history-event {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-left: 3px solid var(--warn);
  border-radius: 7px;
  background: var(--panel-2);
}
.history-event-date {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.history-event-change {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.history-event-change strong { color: var(--warn); }
.history-arrow { color: var(--muted); }
.history-rule-note {
  display: inline-flex;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.68rem;
}
.history-more, .history-empty { margin: 10px 0 0; }
.history-section code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 0.8em;
}

.data-note {
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.link-button { display: inline-block; color: var(--accent-strong); font-weight: 700; text-decoration: none; }
.muted { color: var(--muted); }

.fatal-error {
  position: fixed;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  max-width: 720px;
  padding: 20px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid #d33;
  box-shadow: var(--shadow);
  white-space: pre-wrap;
  z-index: 10000;
}

@media (max-width: 1600px) {
  .filters { grid-template-columns: repeat(6, minmax(150px, 1fr)); }
  .field-wide { grid-column: span 2; }
}

@media (max-width: 1300px) {
  .filters { grid-template-columns: repeat(5, minmax(140px, 1fr)); }
  .field-wide { grid-column: span 2; }
}

@media (max-width: 1050px) {
  .filter-summary { grid-template-columns: repeat(3, 1fr); }
  .filter-summary-title { grid-column: 1 / -1; padding: 0 2px 2px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .map-panel {
    height: clamp(520px, 68vh, 760px);
  }
  #map {
    min-height: 0;
  }
  .results {
    max-height: 560px;
  }
  .results-panel {
    height: auto;
    min-height: 420px;
    max-height: 620px;
  }
}

@media (max-width: 680px) {
  .map-controls-bar { align-items: flex-start; flex-direction: column; }
  .map-control-actions { justify-content: flex-start; }
  .filter-summary { grid-template-columns: repeat(2, 1fr); }
  .topbar { align-items: flex-start; padding: 14px; }
  .header-status { max-width: 52%; }
  .dataset-time { max-width: 100%; }
  .validation-status { text-align: right; justify-content: flex-end; }
  main { padding: 0 10px 14px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .field-wide { grid-column: span 2; }
  .summary-grid { gap: 8px; }
  .metric { padding: 11px; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
}


@media (max-width: 720px) {
  .pricing-hero { grid-template-columns: 1fr; }
  #detailDialog { width: calc(100vw - 16px); max-height: 92vh; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-span-2 { grid-column: span 2; }
  .detail-actions .button { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 460px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-span-2 { grid-column: span 1; }
}


@media (max-width: 820px) {
  .history-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .header-pills { justify-content: flex-end; }
  .history-event { grid-template-columns: 1fr; gap: 4px; }
}


@media (max-width: 1180px) {
  .history-dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .history-dashboard-head { align-items: flex-start; flex-direction: column; }
  .history-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


@media (max-width: 760px) {
  .price-tier-legend-note {
    width: 100%;
    margin-left: 0;
    text-align: left;
  }
}

/* v0.13.0 — Tesla raw congestion profile */
.congestion-section {
  padding-top: 2px;
}
.congestion-section code {
  padding: 1px 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel-2);
  font-size: 0.8em;
}
.congestion-loading {
  margin: 8px 0 0;
}
.congestion-subtitle {
  margin: 3px 0 0;
}
.congestion-profile-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.congestion-profile-meta > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
}
.congestion-profile-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
}
.congestion-profile-meta strong {
  display: block;
  margin-top: 3px;
  font-size: 0.85rem;
}
.congestion-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-top: 10px;
}
.congestion-day {
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--muted);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}
.congestion-day:hover {
  border-color: var(--muted);
  color: var(--text);
}
.congestion-day.active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-2));
  color: var(--text);
}
.congestion-chart {
  margin-top: 10px;
  padding: 10px 10px 7px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
}
.congestion-bars {
  display: grid;
  grid-template-columns: repeat(24, minmax(3px, 1fr));
  align-items: end;
  gap: 3px;
  height: 150px;
  padding: 0;
  border-bottom: 1px solid var(--border);
  background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), var(--border) calc(25% - 1px), var(--border) 25%);
}
.congestion-plot { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 6px; }
.congestion-percent-axis { display: flex; flex-direction: column; justify-content: space-between; color: var(--muted); font-size: .65rem; }
.congestion-chart .congestion-axis { margin-left: 40px; }
.congestion-bar-slot.missing-value { position: relative; background: transparent; }
.congestion-bar-slot.missing-value::after { content: ""; position: absolute; bottom: 0; width: 100%; height: 3px; border: 1px dashed var(--muted); }
.congestion-bar-slot {
  display: flex;
  height: 100%;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
}
.congestion-bar {
  width: 100%;
  max-width: 18px;
  min-height: 0;
  border-radius: 4px 4px 1px 1px;
  background: var(--occupancy-color, var(--muted));
  opacity: 1;
}
.congestion-bar.current-hour {
  outline: 2px solid var(--text);
  outline-offset: 1px;
  opacity: 1;
}
.congestion-axis {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 5px;
  color: var(--muted);
  font-size: 0.66rem;
}
.congestion-note {
  margin: 9px 0 0;
  font-size: 0.76rem;
  line-height: 1.45;
}
.congestion-values {
  margin-top: 8px;
}
.congestion-values summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.congestion-raw-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.congestion-raw-cell {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-2);
}
.congestion-raw-cell span,
.congestion-raw-cell strong {
  display: block;
}
.congestion-raw-cell span {
  color: var(--muted);
  font-size: 0.66rem;
}
.congestion-raw-cell strong {
  margin-top: 2px;
  font-size: 0.78rem;
}

@media (max-width: 720px) {
  .congestion-profile-meta {
    grid-template-columns: 1fr;
  }
  .congestion-days {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .congestion-bars {
    gap: 2px;
    height: 128px;
  }
  .congestion-raw-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .congestion-raw-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* v0.14.0 — weekly raw congestion profile overview */
.congestion-week-overview {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
}
.congestion-week-heading,
.congestion-day-detail-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.congestion-week-heading span,
.congestion-day-detail-heading span {
  font-size: 0.7rem;
}
.congestion-day-detail-heading {
  margin-top: 14px;
}
.congestion-heat-header {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 6px;
  margin-top: 8px;
}
.congestion-heat-hours,
.congestion-heat-cells {
  display: grid;
  grid-template-columns: repeat(24, minmax(4px, 1fr));
  gap: 2px;
}
.congestion-heat-hour {
  min-width: 0;
  color: var(--muted);
  font-size: 0.58rem;
  text-align: center;
  white-space: nowrap;
  overflow: visible;
}
.congestion-heatmap {
  display: grid;
  gap: 3px;
  margin-top: 3px;
}
.congestion-heat-row {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 6px;
}
.congestion-heat-day {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.congestion-heat-day:hover,
.congestion-heat-day.active {
  color: var(--text);
}
.congestion-heat-cell {
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 7px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 2px;
  background: var(--occupancy-color, var(--muted));
  opacity: 1;
  cursor: pointer;
}
.congestion-heat-cell:hover {
  border-color: var(--text);
  opacity: 1;
}
.congestion-heat-cell.selected-day {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 28%, transparent);
}
.congestion-heat-cell.current-time {
  outline: 2px solid var(--text);
  outline-offset: 1px;
  opacity: 1;
  z-index: 1;
}
.congestion-heat-legend {
  display: grid;
  grid-template-columns: auto minmax(72px, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.66rem;
}
.congestion-heat-gradient {
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent) 16%, transparent),
    color-mix(in srgb, var(--accent) 90%, transparent)
  );
}
.congestion-heat-range {
  margin-top: 4px;
  font-size: 0.66rem;
  text-align: center;
}

@media (max-width: 600px) {
  .congestion-week-overview {
    overflow-x: auto;
  }
  .congestion-heat-header,
  .congestion-heat-row {
    min-width: 560px;
  }
  .congestion-heat-legend,
  .congestion-heat-range {
    min-width: 520px;
  }
}


@media (min-width: 1500px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 390px;
  }
}

@media (min-width: 1900px) {
  main {
    max-width: 1880px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 400px;
  }
}

/* v0.21.0 — collection provenance, station comparison, charging-cost calculator */
.collection-info,
.compare-workspace {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.collection-info-head,
.compare-head,
.calculator-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.collection-info-head h2,
.compare-head h2,
.calculator-head h3 {
  margin: 0;
  font-size: 1rem;
}

.collection-info-head p,
.compare-head p,
.calculator-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.collection-badge,
.compare-count {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.collection-badge.ok {
  color: var(--good);
  border-color: color-mix(in srgb, var(--good) 50%, var(--border));
}
.collection-badge.warning {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 55%, var(--border));
}
.collection-badge.error {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.collection-info-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.collection-info-grid article {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
}
.collection-info-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.69rem;
}
.collection-info-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.collection-info-note {
  margin: 9px 1px 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.compare-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.compare-selection {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 32px;
  align-items: center;
  margin-top: 10px;
}

.compare-selection-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 4px 5px 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  max-width: min(100%, 360px);
}
.compare-selection-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.76rem;
  font-weight: 700;
}
.compare-selection-chip button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.compare-selection-chip button:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--panel-2));
}

.compare-table-wrap {
  margin-top: 10px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.compare-table-wrap[hidden] { display: none; }

.compare-table,
.calculator-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.compare-table th,
.compare-table td,
.calculator-table th,
.calculator-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.compare-table thead th,
.calculator-table thead th {
  background: var(--panel-2);
  font-size: 0.73rem;
}
.compare-table tbody th {
  width: 155px;
  color: var(--muted);
  background: var(--panel-2);
  font-weight: 700;
}
.compare-table tr:last-child td,
.compare-table tr:last-child th,
.calculator-table tr:last-child td {
  border-bottom: 0;
}

.compare-station-heading {
  display: grid;
  gap: 2px;
}
.compare-station-heading strong {
  line-height: 1.2;
}
.compare-station-heading span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
}

.result-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
.result-footer .meta-row {
  flex: 1 1 auto;
}
.compare-card-button {
  flex: 0 0 auto;
  min-height: 28px;
  margin-top: 8px;
  padding: 4px 8px;
  font-size: 0.72rem;
}
.compare-card-button.active {
  border-color: color-mix(in srgb, var(--good) 55%, var(--border));
  color: var(--good);
  background: color-mix(in srgb, var(--good) 8%, var(--panel-2));
}

.calculator-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.calculator-head > strong {
  flex: 0 0 auto;
  font-size: 1.15rem;
}
.calculator-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.calculator-controls [hidden] {
  display: none;
}
.calculator-results {
  margin-top: 10px;
}
.calculator-results > p {
  margin: 0;
}
.calculator-warning {
  margin: 8px 0 0;
  color: var(--warn);
  font-size: 0.74rem;
}

.compare-limit-message {
  margin: 8px 0 0;
  color: var(--warn);
  font-size: 0.75rem;
}

@media (max-width: 1400px) {
  .collection-info-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1050px) {
  .calculator-controls {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

@media (max-width: 680px) {
  .collection-info-head,
  .compare-head,
  .calculator-head {
    flex-direction: column;
  }

  .collection-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compare-head-actions {
    justify-content: flex-start;
  }

  .calculator-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .compare-card-button {
    margin-top: 0;
  }
}

@media (max-width: 460px) {
  .calculator-controls {
    grid-template-columns: 1fr;
  }
}



/* ==========================================================================\n   v0.22.0 — map-first full-screen explorer\n   ========================================================================== */
html,
body.map-first-app {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
}

body.map-first-app {
  --map-edge: 16px;
  --results-width: 410px;
  --results-gap: 16px;
  --result-overlay-width: calc(var(--results-width) + var(--results-gap) + var(--map-edge));
  background: var(--bg);
}

.map-shell {
  position: fixed;
  inset: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.map-shell > #map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  z-index: 0;
  background: #aad3df;
}

.map-search-cluster {
  position: absolute;
  z-index: 1200;
  top: var(--map-edge);
  left: var(--map-edge);
  display: flex;
  align-items: stretch;
  gap: 8px;
  max-width: calc(100vw - var(--result-overlay-width) - 32px);
}

.map-search-box {
  width: min(520px, 48vw);
  min-height: 56px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  border-radius: 28px;
  background: color-mix(in srgb, var(--panel) 97%, transparent);
  box-shadow: 0 7px 26px rgba(0,0,0,.18);
  backdrop-filter: blur(14px);
}

.map-search-leading-button,
.map-search-submit {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}

.map-search-leading-button:hover,
.map-search-leading-button:focus-visible,
.map-search-submit:hover,
.map-search-submit:focus-visible {
  background: var(--panel-2);
  color: var(--text);
  outline: none;
}

.map-search-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.map-search-icon,
.map-tool-button svg,
.round-map-button svg,
.map-search-leading-button svg,
.map-search-submit svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.map-tool-button.icon-only svg circle { fill: currentColor; stroke: none; }
.map-search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
}

.map-search-box input::placeholder {
  color: color-mix(in srgb, var(--muted) 88%, var(--text));
}
.map-search-box input::-webkit-search-cancel-button { display: none; }
.map-search-clear {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.25rem;
}
.map-search-clear:hover { background: var(--panel-2); color: var(--text); }

.map-tool-button,
.map-pill-button,
.round-map-button,
.results-collapsed-tab,
.compare-launcher {
  border: 1px solid color-mix(in srgb, var(--border) 92%, transparent);
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  color: var(--text);
  box-shadow: 0 6px 22px rgba(0,0,0,.16);
  backdrop-filter: blur(14px);
  cursor: pointer;
}
.map-tool-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border-radius: 12px;
  font-weight: 700;
}
.map-tool-button.icon-only { width: 48px; justify-content: center; padding: 0; }
.map-tool-button.active,
.map-tool-button[aria-expanded="true"] { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.tool-count {
  min-width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: .68rem;
  line-height: 1;
}

.active-filter-chips {
  position: absolute;
  z-index: 1190;
  top: 72px;
  left: var(--map-edge);
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: min(780px, calc(100vw - var(--result-overlay-width) - 32px));
  overflow-x: auto;
  scrollbar-width: none;
  pointer-events: auto;
}
.active-filter-chips:empty { display: none; }
.active-filter-chips::-webkit-scrollbar { display: none; }
.active-filter-chip {
  flex: 0 0 auto;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  color: var(--text);
  box-shadow: 0 4px 15px rgba(0,0,0,.12);
  backdrop-filter: blur(12px);
  font-size: .73rem;
  font-weight: 700;
  cursor: pointer;
}
.active-filter-chip::after { content: "×"; color: var(--muted); font-size: .95rem; }

.map-popover,
.map-sheet,
.map-results-panel,
.station-detail-sheet {
  border: 1px solid color-mix(in srgb, var(--border) 94%, transparent);
  background: color-mix(in srgb, var(--panel) 97%, transparent);
  color: var(--text);
  box-shadow: 0 16px 48px rgba(0,0,0,.25);
  backdrop-filter: blur(16px);
}
.map-popover[hidden],
.map-sheet[hidden] { display: none !important; }

.map-popover {
  position: absolute;
  z-index: 1300;
  border-radius: 14px;
}
.filter-popover {
  top: 72px;
  left: var(--map-edge);
  width: min(720px, calc(100vw - var(--result-overlay-width) - 32px));
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 14px;
}
.popover-head,
.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.popover-head > div { display: grid; gap: 2px; }
.popover-head > div span { color: var(--muted); font-size: .75rem; }
.small-icon-button {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
}
.small-icon-button:hover { background: var(--panel-2); }
.map-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}
.map-filter-grid .field select,
.map-filter-grid .field input { min-height: 38px; }
.map-viewport-toggle { margin-top: 12px; }
.map-filter-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.map-filter-summary article { min-height: 58px; }
.popover-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.button.primary { border-color: var(--accent); background: var(--accent); color: white; }

.more-menu {
  top: 72px;
  left: min(calc(var(--map-edge) + 528px + 120px), calc(100vw - var(--result-overlay-width) - 300px));
  width: 280px;
  padding: 6px;
}
.more-menu button {
  width: 100%;
  display: grid;
  gap: 2px;
  padding: 10px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.more-menu button:hover { background: var(--panel-2); }
.more-menu button span { font-weight: 750; }
.more-menu button small { color: var(--muted); }

.map-results-panel {
  position: absolute;
  z-index: 1150;
  top: var(--map-edge);
  right: var(--map-edge);
  bottom: var(--map-edge);
  width: var(--results-width);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
  border-radius: 16px;
  transition: transform .22s ease, opacity .22s ease;
}
body.results-collapsed .map-results-panel {
  transform: translateX(calc(100% + 32px));
  opacity: 0;
  pointer-events: none;
}
.map-results-toolbar {
  min-height: 62px;
  padding: 10px 10px 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.results-title { display: grid; gap: 2px; min-width: 0; }
.results-title strong { font-size: .95rem; }
.results-title span { color: var(--muted); font-size: .72rem; }
.collapse-results { font-size: 1.7rem; }
.map-results-panel .results {
  min-height: 0;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
}
.results-pagination {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 98%, transparent);
}
.results-pagination span { color: var(--muted); font-size: .76rem; }
.results-collapsed-tab {
  position: absolute;
  z-index: 1160;
  top: 50%;
  right: var(--map-edge);
  transform: translateY(-50%);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 12px;
  font-weight: 700;
}
.results-collapsed-tab[hidden] { display: none; }
.results-collapsed-tab strong { color: var(--accent-strong); }

.map-bottom-left {
  position: absolute;
  z-index: 1100;
  left: var(--map-edge);
  bottom: var(--map-edge);
  display: flex;
  gap: 8px;
}
.map-pill-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border-radius: 10px;
  font-weight: 700;
}
.status-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  background: var(--muted);
}
.status-dot.ok { background: var(--good); }
.status-dot.warning { background: var(--warn); }
.status-dot.error { background: var(--accent); }
.status-dot.neutral { background: var(--muted); }
.legend-popover {
  left: var(--map-edge);
  bottom: 62px;
  width: 260px;
  padding: 12px;
}
.legend-section { display: grid; gap: 7px; }
.legend-section + .legend-section { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.legend-section > strong { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.legend-section > span { display: flex; align-items: center; gap: 7px; font-size: .78rem; }

.map-control-stack {
  position: absolute;
  z-index: 1120;
  right: var(--result-overlay-width);
  bottom: var(--map-edge);
  display: grid;
  justify-items: end;
  gap: 8px;
  transition: right .22s ease, bottom .22s ease;
}
body.results-collapsed:not(.detail-open) .map-control-stack { right: var(--map-edge); }
.round-map-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
}
.round-map-button:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.location-button svg { width: 22px; height: 22px; }
.location-toast {
  max-width: 280px;
  padding: 7px 10px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  color: var(--text);
  box-shadow: 0 5px 18px rgba(0,0,0,.16);
  font-size: .73rem;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.location-toast.visible { opacity: 1; transform: translateY(0); }

.compare-launcher {
  position: absolute;
  z-index: 1140;
  left: 50%;
  bottom: var(--map-edge);
  transform: translateX(-50%);
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 800;
}
.compare-launcher[hidden] { display: none; }
.compare-launcher span {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: .72rem;
}

.map-sheet {
  position: absolute;
  z-index: 1450;
  top: 50%;
  left: 50%;
  width: min(980px, calc(100vw - 48px));
  max-height: min(86vh, 880px);
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 16px;
}
.sheet-head {
  padding: 15px 16px 13px;
  border-bottom: 1px solid var(--border);
}
.sheet-head h2 { margin: 2px 0 0; font-size: 1.15rem; }
.eyebrow { color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.sheet-scroll { min-height: 0; overflow: auto; padding: 16px; }
.sheet-intro { margin: 0 0 12px; color: var(--muted); }
.info-sheet { width: min(900px, calc(100vw - 48px)); }
.compare-sheet { width: min(1180px, calc(100vw - 48px)); }
.embedded-info,
.embedded-compare { margin: 12px 0 0; box-shadow: none; }
.compact-summary { margin: 12px 0 0; }
.dataset-sheet-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.dataset-sheet-header .dataset-time { text-align: left; }
.map-history-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 12px; }

#detailDialog.station-detail-sheet {
  position: fixed;
  z-index: 1500;
  top: var(--map-edge);
  right: var(--map-edge);
  bottom: var(--map-edge);
  left: auto;
  width: var(--results-width);
  max-width: none;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  transform: none;
  box-shadow: 0 16px 48px rgba(0,0,0,.28);
}
#detailDialog.station-detail-sheet::backdrop { display: none; }
#detailDialog.station-detail-sheet .dialog-head { padding: 14px; }
#detailDialog.station-detail-sheet .detail-body { min-height: 0; overflow: auto; padding: 14px; }
#detailDialog.station-detail-sheet .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#detailDialog.station-detail-sheet .pricing-hero { grid-template-columns: 1fr; }
#detailDialog.station-detail-sheet .history-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.map-fatal {
  position: fixed;
  z-index: 3000;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(640px, calc(100vw - 32px));
}

/* Leaflet controls stay clear of the floating search UI and result rail. */
.map-first-app .leaflet-top.leaflet-left { top: 104px; }
.map-first-app .leaflet-bottom.leaflet-right { right: var(--result-overlay-width); transition: right .22s ease, bottom .22s ease; }
.map-first-app.results-collapsed:not(.detail-open) .leaflet-bottom.leaflet-right { right: 0; }
.map-first-app .leaflet-control-zoom { box-shadow: 0 4px 16px rgba(0,0,0,.15); border: 0; }

@media (max-width: 1050px) {
  body.map-first-app { --results-width: 370px; }
  .map-search-box { width: min(360px, 38vw); }
  .map-tool-button { width: 48px; justify-content: center; padding: 0; }
  .map-tool-button > span:not(.tool-count) { display: none; }
  .filter-popover { width: min(650px, calc(100vw - var(--result-overlay-width) - 28px)); }
}

@media (max-width: 820px) {
  body.map-first-app {
    --map-edge: 10px;
    --results-width: auto;
    --result-overlay-width: 0px;
  }
  .map-search-cluster {
    top: var(--map-edge);
    left: var(--map-edge);
    right: var(--map-edge);
    max-width: none;
  }
  .map-search-box { width: auto; flex: 1 1 auto; min-width: 0; }
  .map-tool-button { padding: 0 11px; }
  .map-tool-button > span:not(.tool-count) { display: none; }
  .active-filter-chips { top: 68px; right: var(--map-edge); max-width: none; }
  .filter-popover {
    top: 68px;
    left: var(--map-edge);
    right: var(--map-edge);
    width: auto;
    max-height: calc(100vh - 80px);
  }
  .map-filter-grid { grid-template-columns: 1fr 1fr; }
  .more-menu { top: 68px; left: auto; right: var(--map-edge); width: 280px; }
  .map-results-panel {
    top: auto;
    left: var(--map-edge);
    right: var(--map-edge);
    bottom: var(--map-edge);
    width: auto;
    height: min(48vh, 560px);
    border-radius: 16px;
    transition: transform .22s ease, opacity .22s ease;
  }
  body.results-collapsed .map-results-panel {
    transform: translateY(calc(100% + 24px));
  }
  .results-collapsed-tab {
    top: auto;
    left: 50%;
    right: auto;
    bottom: var(--map-edge);
    transform: translateX(-50%);
    border-radius: 999px;
  }
  .map-bottom-left { bottom: calc(48vh + 20px); }
  body.results-collapsed:not(.detail-open) .map-bottom-left { bottom: var(--map-edge); }
  .map-control-stack { right: var(--map-edge); bottom: calc(48vh + 20px); }
  body.results-collapsed:not(.detail-open) .map-control-stack { right: var(--map-edge); bottom: var(--map-edge); }
  .compare-launcher { bottom: calc(48vh + 20px); }
  body.results-collapsed:not(.detail-open) .compare-launcher { bottom: var(--map-edge); }
  .legend-popover { bottom: calc(48vh + 66px); }
  body.results-collapsed:not(.detail-open) .legend-popover { bottom: 58px; }
  #detailDialog.station-detail-sheet {
    top: auto;
    left: var(--map-edge);
    right: var(--map-edge);
    bottom: var(--map-edge);
    width: auto;
    height: min(76vh, 760px);
    border-radius: 18px;
  }
  body.detail-open .map-control-stack,
  body.detail-open .map-bottom-left,
  body.detail-open .compare-launcher { bottom: calc(76vh + 20px); }
  .map-sheet {
    top: auto;
    left: var(--map-edge);
    right: var(--map-edge);
    bottom: var(--map-edge);
    width: auto;
    max-height: 82vh;
    transform: none;
    border-radius: 18px;
  }
  .map-history-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collection-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calculator-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-first-app .leaflet-top.leaflet-left { top: 102px; }
  .map-first-app .leaflet-bottom.leaflet-right { right: 0; bottom: calc(48vh + 10px); }
  .map-first-app.results-collapsed:not(.detail-open) .leaflet-bottom.leaflet-right { bottom: 0; }
  .map-first-app.detail-open .leaflet-bottom.leaflet-right { bottom: calc(76vh + 10px); }
}

@media (max-width: 520px) {
  .map-search-cluster { gap: 6px; }
  .map-tool-button { width: 44px; min-height: 46px; justify-content: center; padding: 0; }
  .map-search-box { height: 46px; padding-left: 11px; }
  .map-filter-grid { grid-template-columns: 1fr; }
  .map-filter-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-bottom-left { gap: 6px; }
  .map-pill-button { min-height: 36px; padding: 0 9px; font-size: .74rem; }
  .round-map-button { width: 42px; height: 42px; }
  .sheet-scroll { padding: 12px; }
  #detailDialog.station-detail-sheet .detail-grid { grid-template-columns: 1fr; }
  #detailDialog.station-detail-sheet .detail-span-2 { grid-column: auto; }
  .collection-info-grid,
  .map-history-grid,
  .calculator-controls { grid-template-columns: 1fr; }
}

/* v0.22.2 — Google-Maps-style left search/results rail */
body.map-first-app {
  --results-width: 430px;
  --result-overlay-width: calc(var(--results-width) + 18px);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* The left panel is the search/results application surface. */
.map-results-panel {
  top: 0;
  left: 0;
  right: auto;
  bottom: 0;
  width: var(--results-width);
  border-width: 0 1px 0 0;
  border-radius: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: visible;
  box-shadow: 8px 0 28px rgba(0,0,0,.20);
  transition: transform .23s ease, opacity .18s ease;
}

body.results-collapsed .map-results-panel {
  transform: translateX(calc(-100% - 22px));
  opacity: 0;
  pointer-events: none;
}

.left-panel-search {
  padding: 14px 14px 8px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 98%, transparent);
}

.panel-search-box {
  width: 100%;
  height: 48px;
  border-radius: 24px;
  box-shadow: 0 3px 14px rgba(0,0,0,.18);
}

.left-panel-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
}

.compact-panel-tool {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 18px;
  box-shadow: none;
  font-size: .78rem;
}

.compact-panel-tool svg {
  width: 17px;
  height: 17px;
}

.panel-filter-chips {
  position: static;
  z-index: auto;
  top: auto;
  left: auto;
  width: 100%;
  max-width: none;
  margin-top: 8px;
  padding-bottom: 1px;
}

.panel-filter-chips:empty {
  display: none;
}

.map-results-toolbar {
  min-height: 58px;
  padding: 10px 14px;
}

.map-results-panel .results {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: color-mix(in srgb, var(--panel) 99%, transparent);
}

.left-panel-footer {
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 99%, transparent);
}

.update-map-results-toggle {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px 6px;
  color: var(--text);
  font-size: .78rem;
  cursor: pointer;
}

.update-map-results-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.left-panel-footer .results-pagination {
  min-height: 48px;
  border-top: 0;
  padding: 6px 10px 10px;
}

.panel-edge-collapse {
  position: absolute;
  z-index: 20;
  top: 50%;
  right: -22px;
  width: 24px;
  height: 48px;
  transform: translateY(-50%);
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--panel) 98%, transparent);
  color: var(--text);
  box-shadow: 5px 2px 14px rgba(0,0,0,.16);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.panel-edge-collapse:hover {
  background: var(--panel-2);
}

/* Collapsed state leaves a small Google-Maps-style reopen handle on the left edge. */
.results-collapsed-tab {
  top: 50%;
  left: 0;
  right: auto;
  width: 30px;
  min-width: 30px;
  height: 50px;
  min-height: 50px;
  padding: 0;
  transform: translateY(-50%);
  justify-content: center;
  border-left: 0;
  border-radius: 0 10px 10px 0;
  font-size: 1.4rem;
}

.results-collapsed-tab strong {
  display: none;
}

/* Search/filter menus originate beside the left rail. */
.filter-popover {
  top: 14px;
  left: calc(var(--results-width) + 14px);
  width: min(690px, calc(100vw - var(--results-width) - 42px));
  max-height: calc(100vh - 28px);
}

.more-menu {
  top: 104px;
  left: calc(var(--results-width) + 14px);
  width: 285px;
}

/* Map controls and informational pills stay on the map, not under the rail. */
.map-bottom-left {
  left: calc(var(--results-width) + 16px);
  transition: left .23s ease, bottom .22s ease;
}

body.results-collapsed:not(.detail-open) .map-bottom-left {
  left: var(--map-edge);
}

.legend-popover {
  left: calc(var(--results-width) + 16px);
  transition: left .23s ease, bottom .22s ease;
}

body.results-collapsed:not(.detail-open) .legend-popover {
  left: var(--map-edge);
}

.map-control-stack {
  right: var(--map-edge);
  bottom: var(--map-edge);
}

body.results-collapsed:not(.detail-open) .map-control-stack {
  right: var(--map-edge);
}

.compare-launcher {
  left: calc(50% + (var(--results-width) / 2));
  transition: left .23s ease, bottom .22s ease;
}

body.results-collapsed:not(.detail-open) .compare-launcher {
  left: 50%;
}

/* Station details occupy the same left rail position as search results. */
#detailDialog.station-detail-sheet {
  top: 0;
  left: 0;
  right: auto;
  bottom: 0;
  width: var(--results-width);
  height: 100vh;
  border-width: 0 1px 0 0;
  border-radius: 0;
  box-shadow: 8px 0 28px rgba(0,0,0,.23);
}

#detailDialog.station-detail-sheet .dialog-head {
  min-height: 74px;
  padding: 14px 16px;
}

#detailDialog.station-detail-sheet .detail-body {
  padding: 14px 16px 24px;
}

/* Leaflet's own controls remain in the map area when the left rail is open. */
.map-first-app .leaflet-top.leaflet-left {
  top: 14px;
  left: calc(var(--results-width) + 12px);
  transition: left .23s ease;
}

.map-first-app.results-collapsed:not(.detail-open) .leaflet-top.leaflet-left {
  left: 10px;
}

.map-first-app .leaflet-bottom.leaflet-right {
  right: 0;
}

.map-first-app.results-collapsed:not(.detail-open) .leaflet-bottom.leaflet-right {
  right: 0;
}

/* Result cards read more like a search-results feed. */
.map-results-panel .result-card {
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  margin: 0;
  box-shadow: none;
}

.map-results-panel .result-card + .result-card {
  border-top: 1px solid var(--border);
}

.map-results-panel .result-card.selected {
  box-shadow: inset 4px 0 0 var(--accent);
}

/* When detail is open, the result rail underneath should not intercept input. */
body.detail-open .map-results-panel {
  pointer-events: none;
}

body.detail-open .panel-edge-collapse {
  visibility: hidden;
}

/* Tablet/mobile keeps the existing bottom-sheet interaction, with search inside it. */
@media (max-width: 820px) {
  body.map-first-app {
    --results-width: auto;
    --result-overlay-width: 0px;
  }

  .map-results-panel {
    top: auto;
    left: var(--map-edge);
    right: var(--map-edge);
    bottom: var(--map-edge);
    width: auto;
    height: min(62vh, 670px);
    border: 1px solid var(--border);
    border-radius: 18px;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    box-shadow: 0 16px 48px rgba(0,0,0,.26);
  }

  body.results-collapsed .map-results-panel {
    transform: translateY(calc(100% + 26px));
  }

  .panel-edge-collapse {
    top: -22px;
    right: 50%;
    width: 52px;
    height: 24px;
    transform: translateX(50%) rotate(90deg);
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
  }

  .results-collapsed-tab {
    top: auto;
    left: 50%;
    right: auto;
    bottom: var(--map-edge);
    width: 58px;
    height: 32px;
    min-height: 32px;
    transform: translateX(-50%);
    border: 1px solid var(--border);
    border-radius: 999px;
  }

  .left-panel-search {
    padding: 10px 10px 6px;
  }

  .panel-search-box {
    height: 44px;
  }

  .left-panel-tools {
    margin-top: 7px;
  }

  .filter-popover {
    top: var(--map-edge);
    left: var(--map-edge);
    right: var(--map-edge);
    width: auto;
    max-height: calc(100vh - (2 * var(--map-edge)));
  }

  .more-menu {
    top: 68px;
    left: auto;
    right: var(--map-edge);
  }

  .map-bottom-left {
    left: var(--map-edge);
    bottom: calc(62vh + 20px);
  }

  body.results-collapsed:not(.detail-open) .map-bottom-left {
    bottom: var(--map-edge);
  }

  .legend-popover,
  body.results-collapsed:not(.detail-open) .legend-popover {
    left: var(--map-edge);
  }

  .map-control-stack {
    right: var(--map-edge);
    bottom: calc(62vh + 20px);
  }

  body.results-collapsed:not(.detail-open) .map-control-stack {
    bottom: var(--map-edge);
  }

  .compare-launcher,
  body.results-collapsed:not(.detail-open) .compare-launcher {
    left: 50%;
  }

  .compare-launcher {
    bottom: calc(62vh + 20px);
  }

  body.results-collapsed:not(.detail-open) .compare-launcher {
    bottom: var(--map-edge);
  }

  #detailDialog.station-detail-sheet {
    top: auto;
    left: var(--map-edge);
    right: var(--map-edge);
    bottom: var(--map-edge);
    width: auto;
    height: min(80vh, 820px);
    border: 1px solid var(--border);
    border-radius: 18px;
  }

  body.detail-open .map-control-stack,
  body.detail-open .map-bottom-left,
  body.detail-open .compare-launcher {
    bottom: calc(80vh + 20px);
  }

  .map-first-app .leaflet-top.leaflet-left,
  .map-first-app.results-collapsed:not(.detail-open) .leaflet-top.leaflet-left {
    top: 10px;
    left: 10px;
  }

  .map-first-app .leaflet-bottom.leaflet-right,
  .map-first-app.results-collapsed:not(.detail-open) .leaflet-bottom.leaflet-right {
    right: 0;
    bottom: calc(62vh + 10px);
  }

  .map-first-app.results-collapsed:not(.detail-open) .leaflet-bottom.leaflet-right {
    bottom: 0;
  }

  .map-first-app.detail-open .leaflet-bottom.leaflet-right {
    bottom: calc(80vh + 10px);
  }
}

@media (max-width: 520px) {
  .left-panel-tools {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .left-panel-tools::-webkit-scrollbar {
    display: none;
  }

  .compact-panel-tool {
    flex: 0 0 auto;
  }

  .update-map-results-toggle {
    font-size: .74rem;
  }
}

/* v0.22.3 — persistent map search + "This area" results + scrollable detail rail */
body.map-first-app {
  --search-dock-top: 14px;
  --search-dock-left: 14px;
  --search-dock-height: 48px;
  --search-dock-gap: 8px;
  --search-dock-reserved: 76px;
}

/* Search stays visible even when the results rail is collapsed or a station is open. */
.map-search-dock {
  position: fixed;
  z-index: 1700;
  top: var(--search-dock-top);
  left: var(--search-dock-left);
  display: flex;
  align-items: center;
  gap: 0;
  max-width: calc(100vw - 28px);
  pointer-events: auto;
}

.persistent-map-search {
  width: min(510px, calc(100vw - 120px));
  min-height: var(--search-dock-height);
  border-radius: 28px;
  box-shadow: 0 4px 18px rgba(0,0,0,.24);
}

.search-dock-filter-chips {
  position: absolute;
  top: calc(var(--search-dock-height) + 8px);
  left: 0;
  width: min(690px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
}

.search-dock-filter-chips:empty {
  display: none;
}

/* Results rail starts below the always-visible search dock. */
.map-results-panel {
  padding-top: var(--search-dock-reserved);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.map-results-toolbar {
  min-height: 58px;
}

/* Google-Maps-like small information card when no results rail is open. */
.area-results-card {
  position: fixed;
  z-index: 1350;
  top: calc(var(--search-dock-top) + var(--search-dock-height) + 10px);
  left: var(--search-dock-left);
  width: min(390px, calc(100vw - 28px));
  min-height: 66px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: color-mix(in srgb, var(--panel) 97%, transparent);
  color: var(--text);
  box-shadow: 0 4px 18px rgba(0,0,0,.18);
  text-align: left;
  cursor: pointer;
}

.area-results-card[hidden] {
  display: none;
}

.area-results-card:hover {
  background: var(--panel-2);
}

.area-results-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.area-results-copy strong {
  font-size: .92rem;
}

.area-results-copy small {
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.area-results-count {
  display: grid;
  justify-items: end;
  flex: 0 0 auto;
}

.area-results-count strong {
  color: var(--accent-strong);
  font-size: 1.15rem;
  line-height: 1;
}

.area-results-count small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .67rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Filter / more menus now originate under the permanent search dock. */
.filter-popover {
  top: calc(var(--search-dock-top) + var(--search-dock-height) + 10px);
  left: var(--search-dock-left);
  width: min(690px, calc(100vw - 28px));
  max-height: calc(100vh - 86px);
}

.more-menu {
  top: calc(var(--search-dock-top) + var(--search-dock-height) + 10px);
  left: min(520px, calc(100vw - 300px));
  width: 285px;
}

/* The result rail can disappear, but the search dock never does. */
body.results-collapsed .map-search-dock,
body.detail-open .map-search-dock {
  opacity: 1;
  pointer-events: auto;
}

/* Detail rail: explicitly create a two-row layout so the body can actually scroll. */
#detailDialog.station-detail-sheet {
  box-sizing: border-box;
  top: 0;
  bottom: 0;
  height: auto;
  max-height: none;
  padding: var(--search-dock-reserved) 0 0;
  overflow: hidden;
}

#detailDialog.station-detail-sheet[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

#detailDialog.station-detail-sheet .dialog-head {
  min-height: 0;
  flex: 0 0 auto;
}

#detailDialog.station-detail-sheet .detail-body {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

/* When details are open the map search remains usable above the detail rail. */
body.detail-open .map-results-panel {
  pointer-events: none;
}

/* Leaflet zoom is moved down so it does not collide with the permanent search dock. */
.map-first-app .leaflet-top.leaflet-left,
.map-first-app.results-collapsed:not(.detail-open) .leaflet-top.leaflet-left {
  top: calc(var(--search-dock-top) + var(--search-dock-height) + 14px);
}

/* Keep "This area" hidden while another major left-side surface is open. */
body:not(.results-collapsed) .area-results-card,
body.detail-open .area-results-card {
  display: none !important;
}

@media (max-width: 820px) {
  body.map-first-app {
    --search-dock-top: 10px;
    --search-dock-left: 10px;
    --search-dock-height: 44px;
    --search-dock-reserved: 64px;
  }

  .map-search-dock {
    right: 10px;
    max-width: none;
  }

  .persistent-map-search {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
  }

  .map-search-box {
    min-height: 52px;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    padding: 0 8px 0 10px;
  }

  .area-results-card {
    top: 64px;
    left: 10px;
    width: min(360px, calc(100vw - 20px));
  }

  .filter-popover {
    top: 64px;
    left: 10px;
    right: 10px;
    width: auto;
    max-height: calc(100vh - 74px);
  }

  .more-menu {
    top: 64px;
    left: auto;
    right: 10px;
  }

  .map-results-panel {
    padding-top: 0;
  }

  /* Mobile detail remains a bottom sheet; search stays on the map above it. */
  #detailDialog.station-detail-sheet {
    top: auto;
    padding: 0;
    height: min(80vh, 820px);
  }

  #detailDialog.station-detail-sheet[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .map-first-app .leaflet-top.leaflet-left,
  .map-first-app.results-collapsed:not(.detail-open) .leaflet-top.leaflet-left {
    top: 68px;
    left: 10px;
  }
}

@media (max-width: 520px) {
  .persistent-map-search {
    min-width: 180px;
  }

  .area-results-card {
    width: calc(100vw - 20px);
  }
}

/* v0.22.4 — permanent Google-Maps-like left navigation rail */
body.map-first-app {
  /* Re-measured against the supplied Google Maps screenshot at the same
     screenshot scale: Google’s desktop rail is ~72 CSS px, with ~15 px
     between the rail and the floating search card. */
  --sidebar-width: 72px;
  --left-ui-offset: calc(var(--sidebar-width) + 15px);
  --results-width: 417px;
  --search-dock-left: var(--left-ui-offset);
  --result-overlay-width: calc(var(--sidebar-width) + var(--results-width) + 18px);
}

/* Permanent far-left toolbar */
.map-sidebar {
  position: fixed;
  z-index: 2200;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 10px 7px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 98%, transparent);
  box-shadow: 2px 0 12px rgba(0,0,0,.12);
}

.sidebar-button {
  position: relative;
  min-height: 54px;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 6px 3px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: .63rem;
  line-height: 1;
}

.sidebar-button svg {
  /* Google Maps uses the standard 24 px Material-style icon footprint. */
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-button:hover,
.sidebar-button.active {
  background: var(--panel-2);
  color: var(--text);
}

.sidebar-button.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-divider {
  height: 1px;
  margin: 7px 5px;
  background: var(--border);
}

.sidebar-spacer {
  flex: 1 1 auto;
}

.sidebar-count {
  position: absolute;
  top: 4px;
  right: 5px;
  min-width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: .58rem;
  font-weight: 800;
}

/* Search always starts to the right of the permanent toolbar. */
.map-search-dock {
  left: var(--search-dock-left);
}

.persistent-map-search {
  width: min(520px, calc(100vw - var(--sidebar-width) - 28px));
}

/* Results/detail occupy the same slot immediately right of permanent toolbar. */
.map-results-panel {
  left: var(--sidebar-width);
  width: var(--results-width);
  border-left: 0;
}

body.results-collapsed .map-results-panel {
  transform: translateX(calc(-100% - 28px));
}

.results-collapsed-tab {
  left: var(--sidebar-width);
}

#detailDialog.station-detail-sheet {
  left: var(--sidebar-width);
  width: var(--results-width);
}

/* Filters use the exact same slot as Results rather than overlaying them. */
.map-side-sheet {
  position: fixed;
  z-index: 1800;
  top: 0;
  bottom: 0;
  left: var(--sidebar-width);
  width: var(--results-width);
  padding: var(--search-dock-reserved) 12px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 99%, transparent);
  box-shadow: 8px 0 28px rgba(0,0,0,.20);
}

.map-side-sheet[hidden] {
  display: none;
}

.filter-side-sheet .popover-head {
  margin-bottom: 10px;
}

.filter-side-sheet .map-filter-grid {
  grid-template-columns: 1fr;
}

.filter-side-sheet .map-filter-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filter-side-sheet .popover-actions {
  position: sticky;
  bottom: -14px;
  margin: 12px -12px -14px;
  padding: 10px 12px 14px;
  background: color-mix(in srgb, var(--panel) 99%, transparent);
  border-top: 1px solid var(--border);
}

/* Results are temporarily hidden while Filters owns the side-sheet slot. */
body.filters-open .map-results-panel,
body.filters-open .results-collapsed-tab,
body.filters-open .area-results-card {
  visibility: hidden;
  pointer-events: none;
}

/* Other floating UI accounts for the permanent toolbar. */
.area-results-card {
  left: var(--search-dock-left);
}

.map-bottom-left,
body.results-collapsed:not(.detail-open) .map-bottom-left {
  left: calc(var(--sidebar-width) + 16px);
}

.legend-popover,
body.results-collapsed:not(.detail-open) .legend-popover {
  left: calc(var(--sidebar-width) + 16px);
}

body:not(.results-collapsed) .map-bottom-left,
body.detail-open .map-bottom-left,
body.filters-open .map-bottom-left,
body:not(.results-collapsed) .legend-popover,
body.detail-open .legend-popover,
body.filters-open .legend-popover {
  left: calc(var(--sidebar-width) + var(--results-width) + 16px);
}

/* Zoom fix:
   collapsed mode -> next to permanent toolbar
   open results/detail/filter -> next to active side sheet */
.map-first-app .leaflet-top.leaflet-left,
.map-first-app.results-collapsed:not(.detail-open) .leaflet-top.leaflet-left {
  left: calc(var(--sidebar-width) + 12px);
  top: calc(var(--search-dock-top) + var(--search-dock-height) + 16px);
}

body:not(.results-collapsed) .leaflet-top.leaflet-left,
body.detail-open .leaflet-top.leaflet-left,
body.filters-open .leaflet-top.leaflet-left {
  left: calc(var(--sidebar-width) + var(--results-width) + 12px);
}

/* More menu still belongs to persistent search dock. */
.more-menu {
  left: calc(var(--search-dock-left) + 300px);
}

/* Comparison launcher centers in the actually visible map portion. */
.compare-launcher,
body.results-collapsed:not(.detail-open) .compare-launcher {
  left: calc(50% + (var(--sidebar-width) / 2));
}

body:not(.results-collapsed) .compare-launcher,
body.detail-open .compare-launcher,
body.filters-open .compare-launcher {
  left: calc(50% + ((var(--sidebar-width) + var(--results-width)) / 2));
}

@media (max-width: 820px) {
  body.map-first-app {
    --sidebar-width: 50px;
    --left-ui-offset: calc(var(--sidebar-width) + 8px);
    --search-dock-left: var(--left-ui-offset);
  }

  .map-sidebar {
    width: var(--sidebar-width);
    padding: 8px 5px;
  }

  .sidebar-button {
    min-height: 46px;
  }

  .sidebar-button > span:not(.sidebar-count) {
    display: none;
  }

  .map-search-dock {
    left: var(--search-dock-left);
    right: 8px;
  }

  .persistent-map-search {
    width: auto;
  }

  .map-results-panel {
    left: calc(var(--sidebar-width) + 8px);
    right: 8px;
    width: auto;
  }

  .results-collapsed-tab {
    left: calc(var(--sidebar-width) + 8px);
  }

  .map-side-sheet {
    top: auto;
    left: calc(var(--sidebar-width) + 8px);
    right: 8px;
    bottom: 8px;
    width: auto;
    height: min(72vh, 720px);
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
  }

  #detailDialog.station-detail-sheet {
    left: calc(var(--sidebar-width) + 8px);
    right: 8px;
    width: auto;
  }

  .area-results-card {
    left: var(--search-dock-left);
    width: min(360px, calc(100vw - var(--sidebar-width) - 20px));
  }

  .map-first-app .leaflet-top.leaflet-left,
  .map-first-app.results-collapsed:not(.detail-open) .leaflet-top.leaflet-left,
  body:not(.results-collapsed) .leaflet-top.leaflet-left,
  body.detail-open .leaflet-top.leaflet-left,
  body.filters-open .leaflet-top.leaflet-left {
    left: calc(var(--sidebar-width) + 8px);
    top: 70px;
  }

  .map-bottom-left,
  body.results-collapsed:not(.detail-open) .map-bottom-left,
  body:not(.results-collapsed) .map-bottom-left,
  body.detail-open .map-bottom-left,
  body.filters-open .map-bottom-left,
  .legend-popover,
  body.results-collapsed:not(.detail-open) .legend-popover,
  body:not(.results-collapsed) .legend-popover,
  body.detail-open .legend-popover,
  body.filters-open .legend-popover {
    left: calc(var(--sidebar-width) + 8px);
  }
}

/* v0.22.5 — active-filter chip spacing
   Sorting is now represented only by the results subtitle, not as a filter chip.
   Real filter chips still get their own reserved row below Search. */
body.map-first-app.has-active-filter-chips {
  --search-dock-reserved: 116px;
}

body.map-first-app.has-active-filter-chips .area-results-card {
  top: calc(var(--search-dock-top) + var(--search-dock-height) + 48px);
}

/* Keep the search/filter-chip layer above side-sheet contents without covering them. */
.search-dock-filter-chips {
  z-index: 2;
  min-height: 30px;
}

/* Results header should never paint behind the floating chip row. */
.map-results-toolbar {
  position: relative;
  z-index: 1;
}

/* On narrow screens one chip row also receives explicit breathing room. */
@media (max-width: 820px) {
  body.map-first-app.has-active-filter-chips {
    --search-dock-reserved: 106px;
  }

  body.map-first-app.has-active-filter-chips .area-results-card {
    top: 104px;
  }
}

/* v0.22.6 — map navigation controls live in the permanent left sidebar */
.sidebar-map-action {
  min-height: 48px;
}

.sidebar-map-action svg {
  width: 24px;
  height: 24px;
}

/* No map-action buttons remain in the bottom-right corner. */
.map-control-stack {
  display: none !important;
}

/* Location permission/status messages remain available as a transient toast only. */
.map-toast-layer {
  position: fixed;
  z-index: 1900;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  pointer-events: none;
}

.map-toast-layer .location-toast {
  display: block;
  max-width: min(420px, calc(100vw - 32px));
}

/* Leaflet's default zoom widget is disabled in JavaScript.
   These rules make sure a stale control cannot reappear after hot reload. */
.map-first-app .leaflet-control-zoom {
  display: none !important;
}

@media (max-height: 760px) and (min-width: 821px) {
  .map-sidebar {
    overflow-y: auto;
    scrollbar-width: none;
  }

  .map-sidebar::-webkit-scrollbar {
    display: none;
  }

  .sidebar-button {
    min-height: 46px;
  }

  .sidebar-map-action {
    min-height: 42px;
  }
}

@media (max-width: 820px) {
  .sidebar-map-action {
    min-height: 42px;
  }

  .map-toast-layer {
    left: calc(50% + (var(--sidebar-width) / 2));
    bottom: 14px;
  }
}

/* v0.22.7 — Tesla Find Us-like Supercharger marker palette */
.operational-dot {
  background: #ff3a3a;
}

.coming-dot {
  box-sizing: border-box;
  background: #ff3a3a;
  border: 1.5px solid rgba(255,255,255,.78);
  opacity: .68;
}

/* v0.22.8 — Tesla Find Us-style Supercharger pins */
.tesla-findus-marker {
  background: transparent !important;
  border: 0 !important;
  line-height: 0;
  pointer-events: auto;
}

.tesla-findus-marker .tesla-findus-pin-svg {
  display: block;
  overflow: visible;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .28));
}

.tesla-findus-marker.selected .tesla-findus-pin-svg {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .38));
}

/* Status legend mirrors the actual map-marker treatment. */
.operational-dot {
  background: #ff3a3a;
  border: 1px solid #ffffff;
}

.coming-dot {
  background: #a0a0a0;
  border: 1px solid #ffffff;
}

.nearby-context-dot {
  background: #ff3a3a;
  border: 1px solid rgba(255,255,255,.78);
  opacity: .68;
}


/* v0.22.9 — progressive disclosure for complete station data */
.station-host {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
}
.station-host span,
.section-mini-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.station-host strong { font-size: 0.92rem; }

.pricing-summary-grid { margin-top: 10px; }
.pricing-subsection { margin-top: 12px; }
.pricing-subsection > .section-heading-row { margin-bottom: 7px; }

.detail-info-note {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
}
.detail-info-note strong { font-size: 0.82rem; }
.detail-info-note span { color: var(--muted); font-size: 0.78rem; line-height: 1.4; }

.access-hours-card,
.amenities-block,
.metadata-chip-block,
.detail-subsection {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
}
.hours-primary {
  display: grid;
  gap: 3px;
  margin-top: 6px;
}
.hours-primary strong { font-size: 0.9rem; }
.hours-primary span { color: var(--muted); font-size: 0.76rem; }
.hours-list { display: grid; gap: 6px; margin-top: 7px; }
.hours-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.hours-row:last-child { border-bottom: 0; }
.hours-row span { color: var(--muted); font-size: 0.78rem; }
.hours-row strong { font-size: 0.82rem; text-align: right; }

.detail-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}
.detail-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  font-size: 0.74rem;
  font-weight: 700;
}

.detail-value-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.detail-value-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.copy-inline {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 0.66rem;
  font-weight: 700;
  cursor: pointer;
}
.copy-inline:hover { color: var(--text); }

.detail-disclosure {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
  overflow: clip;
}
.detail-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.detail-disclosure > summary::-webkit-details-marker { display: none; }
.detail-disclosure > summary::after {
  content: "›";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 120ms ease;
}
.detail-disclosure[open] > summary::after { transform: rotate(-90deg); }
.detail-disclosure > summary span { font-size: 0.86rem; font-weight: 800; }
.detail-disclosure > summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  text-align: right;
}
.detail-disclosure[open] > summary { border-bottom: 1px solid var(--border); }
.detail-disclosure-body { padding: 12px; }
.detail-disclosure-body > .detail-section:first-child { margin-top: 0; }
.detail-group-heading { margin: 22px 0 0; font-size: 0.9rem; }
.detail-disclosure > summary:focus-visible { outline: 2px solid var(--text); outline-offset: -3px; }

.derived-technical-slot { margin-top: 10px; }
.derived-technical-slot > .detail-subsection { margin-top: 0; }

.raw-json-disclosure {
  margin-top: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  overflow: hidden;
}
.raw-json-disclosure > summary {
  padding: 8px 10px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}
.raw-json {
  max-height: 360px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border-top: 1px solid var(--border);
  background: var(--panel);
  font-size: 0.7rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.schedule-table { width: max-content; min-width: 100%; overflow-wrap: normal; }
.schedule-table th, .schedule-table td { white-space: nowrap; vertical-align: top; }
.schedule-wrap { max-width: 100%; overscroll-behavior-x: contain; }
.section-heading-row > :first-child { min-width: 0; }
.congestion-band-legend { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin-top: 9px; font-size: .62rem; color: var(--muted); text-align: center; overflow-wrap: normal; }
.congestion-band-legend span { white-space: nowrap; }
.congestion-band-legend i { display: block; height: 7px; border-radius: 2px; margin-bottom: 4px; }
.congestion-heat-cell.missing-value { background: transparent; border: 1px dashed var(--muted); }
.detail-load-feedback.detail-load-complete { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); border: 0; }
.advanced-price-table { min-width: 100%; }
.advanced-price-table td { vertical-align: top; }
.tier-field-cell { font-size: 0.72rem; }
.tier-values { margin: 0; }
.tier-values > div { display: grid; grid-template-columns: auto auto; gap: 12px; }
.tier-values dt { color: var(--muted); }
.tier-values dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
  .detail-disclosure > summary {
    align-items: flex-start;
  }
  .detail-disclosure > summary small {
    display: none;
  }
  .hours-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
  .hours-row strong { text-align: left; }
  .raw-json { max-height: 280px; }
}

/* v0.23.1 — latest collection / new-stations display */
.changes-sheet { width: min(900px, calc(100vw - 48px)); }
.changes-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 16px 0 8px; }
.changes-filters label { display: grid; gap: 5px; flex: 1 1 140px; min-width: 0; color: var(--muted); font-size: .8rem; }
.changes-filters label:nth-child(2) { flex: 1.7 1 200px; }
.changes-filters input, .changes-filters select { width: 100%; min-width: 0; min-height: 38px; padding: 7px 9px; border: 1px solid var(--control-border); border-radius: 8px; background: var(--panel-2); color: var(--text); }
@media (max-width: 700px) { .changes-filters input, .changes-filters select, .changes-filters button { min-height: 44px; } }
.changes-summary .metric strong { font-size: 1.5rem; }
.new-operational-metric { border-color: color-mix(in srgb, var(--accent) 38%, var(--border)); }
.new-coming-metric { border-color: color-mix(in srgb, var(--muted) 42%, var(--border)); }
.coverage-backfill-metric { border-color: color-mix(in srgb, var(--muted) 55%, var(--border)); }

.changes-group {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.changes-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 9px;
}
.changes-group-head h3 { margin: 0; font-size: .96rem; }
.changes-group-head p { margin: 3px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.changes-list {
  display: grid;
  gap: 7px;
}
.change-station-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 13px minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.change-station-row:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  background: var(--panel-2);
}
.change-row-marker {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid transparent;
  box-sizing: border-box;
}
.change-row-marker.operational { background: #ff3a3a; border-color: #ffffff; }
.change-row-marker.coming { background: #a0a0a0; border-color: #ffffff; }
.change-row-copy { min-width: 0; display: grid; gap: 2px; }
.change-row-copy strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.change-row-copy small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .72rem; }
.change-row-meta { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.change-row-arrow { color: var(--muted); font-size: 1.15rem; line-height: 1; }
.empty-change-message {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--panel-2);
}

.new-station-chip {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  background: color-mix(in srgb, var(--accent) 11%, var(--panel));
  color: var(--accent-strong);
  font-weight: 800;
}
.new-station-banner {
  display: grid;
  gap: 3px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}
.new-station-banner strong { font-size: .82rem; }
.new-station-banner span { color: var(--muted); font-size: .74rem; line-height: 1.4; }

@media (max-width: 620px) {
  .change-station-row {
    grid-template-columns: 13px minmax(0, 1fr) 14px;
  }
  .change-row-meta { display: none; }
  .changes-group-head { align-items: center; }
}
.tooltip-new-label {
  color: var(--accent-strong);
  font-size: .72rem;
  font-weight: 800;
}

/* v0.23.2 — rolling 30-day New status */
.changes-sheet .change-row-meta {
  max-width: 42%;
  white-space: normal;
  text-align: right;
  line-height: 1.35;
}

/* ==========================================================================\n   v0.24.0 — MapLibre GL JS map engine\n   ========================================================================== */

.more-menu-section {
  display: grid;
  gap: 7px;
  padding: 7px 8px 8px;
}
.more-menu-section-title {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.map-style-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}
.more-menu .map-style-option {
  display: block;
  padding: 7px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
  font-size: .73rem;
  font-weight: 750;
}
.more-menu .map-style-option:hover {
  background: var(--panel-2);
  color: var(--text);
}
.more-menu .map-style-option.active,
.more-menu .map-style-option[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  color: var(--accent-strong);
}
.more-menu-separator {
  height: 1px;
  margin: 3px 6px;
  background: var(--border);
}

/* MapLibre popup replaces Leaflet's tooltip while retaining the explorer look. */
.maplibregl-popup.station-hover-popup {
  max-width: min(300px, calc(100vw - 32px)) !important;
  pointer-events: none;
}
.maplibregl-popup.station-hover-popup .maplibregl-popup-content {
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  color: var(--text);
  box-shadow: var(--shadow);
  font: inherit;
  font-size: .78rem;
  line-height: 1.45;
}
.maplibregl-popup.station-hover-popup .maplibregl-popup-tip {
  border-top-color: var(--panel);
}
.maplibregl-canvas {
  outline: none;
}

/* The application owns zoom controls; MapLibre only supplies attribution. */
.map-first-app .maplibregl-ctrl-top-left,
.map-first-app .maplibregl-ctrl-top-right {
  pointer-events: none;
}
.map-first-app .maplibregl-ctrl-attrib {
  border-radius: 7px 0 0 0;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  color: var(--muted);
}
.map-first-app .maplibregl-ctrl-attrib a {
  color: inherit;
}

@media (max-width: 820px) {
  body:not(.results-collapsed) .maplibregl-ctrl-bottom-right {
    bottom: calc(62vh + 10px);
  }
  body.detail-open .maplibregl-ctrl-bottom-right {
    bottom: calc(80vh + 10px);
  }
  body.results-collapsed:not(.detail-open) .maplibregl-ctrl-bottom-right {
    bottom: 0;
  }
}


/* The map fills the window beneath the floating application surfaces. Camera
   actions account for panel coverage without retaining asymmetric padding. */
body.map-first-app .map-shell > #map { inset: 0; width: 100%; height: 100%; }


/* ==========================================================================\n   v0.24.5 — compact, interaction-aware map attribution\n   ========================================================================== */
.map-first-app .map-attribution-control {
  display: flex;
  align-items: center;
  max-width: min(520px, calc(100vw - 24px));
  min-height: 28px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  color: var(--muted);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  backdrop-filter: blur(8px);
  transition: max-width 160ms ease, background 160ms ease;
}

.map-first-app .map-attribution-credits {
  min-width: 0;
  padding: 5px 5px 5px 9px;
  white-space: nowrap;
  font-size: .68rem;
  line-height: 1.2;
  opacity: 1;
  transition: opacity 120ms ease, max-width 160ms ease, padding 160ms ease;
}

.map-first-app .map-attribution-credits a {
  color: inherit;
  text-decoration: none;
}

.map-first-app .map-attribution-credits a:hover,
.map-first-app .map-attribution-credits a:focus-visible {
  color: var(--text);
  text-decoration: underline;
}

.map-first-app .map-attribution-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-left: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
}

.map-first-app .map-attribution-toggle:hover,
.map-first-app .map-attribution-toggle:focus-visible {
  background: color-mix(in srgb, var(--panel-2) 90%, transparent);
  outline: none;
}

.map-first-app .map-attribution-control.collapsed {
  max-width: 30px;
}

.map-first-app .map-attribution-control.collapsed .map-attribution-credits {
  max-width: 0;
  padding-left: 0;
  padding-right: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.map-first-app .map-attribution-control.collapsed .map-attribution-toggle {
  border-left-color: transparent;
}

@media (max-width: 520px) {
  .map-first-app .map-attribution-control.expanded {
    max-width: min(420px, calc(100vw - 18px));
  }
  .map-first-app .map-attribution-credits {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}


/* ==========================================================================
   v0.24.6 — side-by-side Results + station detail rails

   Wide desktop keeps Results visible when a station opens. The detail rail is
   placed to its right. Narrow desktop/tablet keeps a single panel slot so
   the uncovered map stays usable.
   ========================================================================== */
@media (min-width: 1181px) {
  /* Results remain a live navigation surface while the selected station is open. */
  body.detail-open:not(.results-collapsed) .map-results-panel {
    pointer-events: auto;
  }

  /* The detail rail becomes a second column instead of replacing Results. */
  body.detail-open:not(.results-collapsed) #detailDialog.station-detail-sheet {
    left: calc(var(--sidebar-width) + var(--results-width));
    padding-top: 0;
    border-left: 0;
    border-right: 1px solid var(--border);
    box-shadow: 8px 0 28px rgba(0,0,0,.23);
  }

  /* Search belongs to Results. Keep Search + More inside that first rail so
     the controls do not spill over the station-detail column. */
  body.detail-open:not(.results-collapsed) .map-search-dock {
    max-width: calc(var(--results-width) - 24px);
  }

  body.detail-open:not(.results-collapsed) .persistent-map-search {
    width: calc(var(--results-width) - 68px);
  }

  body.detail-open:not(.results-collapsed) .search-dock-filter-chips {
    width: calc(var(--results-width) - 24px);
    max-width: calc(var(--results-width) - 24px);
  }

  /* Map-attached UI follows the new left edge of the visible map. */
  body.detail-open:not(.results-collapsed) .map-bottom-left,
  body.detail-open:not(.results-collapsed) .legend-popover {
    left: calc(var(--sidebar-width) + var(--results-width) + var(--results-width) + 16px);
  }

  body.detail-open:not(.results-collapsed) .compare-launcher {
    left: calc(50% + ((var(--sidebar-width) + var(--results-width) + var(--results-width)) / 2));
  }
}


/* ==========================================================================
   v0.24.8 — nearby search results + focused Distance/Price sorting
   ========================================================================== */
.map-results-toolbar {
  align-items: flex-start;
  gap: 12px;
}

.map-results-toolbar .results-title {
  flex: 1 1 auto;
  min-width: 0;
  gap: 3px;
}

.map-results-toolbar .results-title > strong {
  font-size: 1.08rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.map-results-toolbar #resultCount {
  font-size: 1.18em;
}

.map-results-toolbar #resultsSubtitle {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.25;
}

.map-results-toolbar #resultsSubtitle[hidden] {
  display: none;
}

.results-sort-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .75rem;
  white-space: nowrap;
}

.results-sort-control select {
  min-width: 92px;
  height: 32px;
  padding: 0 24px 0 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.results-sort-control select:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, white);
  outline-offset: 2px;
}

.results-section-divider {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-2) 88%, var(--panel));
  color: var(--text);
}

.results-section-divider strong {
  font-size: .8rem;
  letter-spacing: .01em;
}

.results-section-divider span {
  min-width: 24px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
}

.result-location-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.result-location-line .result-location {
  min-width: 0;
}

.result-distance {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .map-results-toolbar {
    gap: 8px;
  }

  .results-sort-control > span {
    display: none;
  }

  .results-sort-control select {
    min-width: 88px;
  }
}

/* ==========================================================================
   v0.24.9 — search camera + results-header/menu polish
   ========================================================================== */
.map-results-toolbar {
  min-height: 76px;
  padding: 13px 12px 12px 14px;
  align-items: center;
}

.map-results-toolbar .results-title {
  gap: 5px;
}

.map-results-toolbar .results-title > strong {
  font-size: 1.2rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.map-results-toolbar #resultCount {
  font-size: 1em;
}

.map-results-toolbar #resultsSubtitle {
  margin-top: 0;
  font-size: .88rem;
  line-height: 1.3;
  font-weight: 600;
}

/* Keep the native two-item select semantics, but make the closed control read
   like the rest of the rounded map UI instead of an OS-default form box. */
.results-sort-control {
  position: relative;
  gap: 7px;
  color: var(--muted);
  font-size: .83rem;
  font-weight: 650;
}

.results-sort-control select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 98px;
  height: 36px;
  padding: 0 30px 0 12px;
  border: 1px solid color-mix(in srgb, var(--border) 94%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-2) 94%, transparent);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 2px 8px rgba(0,0,0,.12);
  font-size: .82rem;
  font-weight: 750;
}

.results-sort-control::after {
  content: "";
  position: absolute;
  right: 13px;
  width: 7px;
  height: 7px;
  border-right: 1.7px solid var(--muted);
  border-bottom: 1.7px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}

.results-sort-control select:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--panel-2) 86%, var(--panel));
}

/* Make the search clear action a themed icon control instead of a bare glyph. */
.map-search-clear {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 0;
}

.map-search-clear::before,
.map-search-clear::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 1.6px;
  border-radius: 2px;
  background: currentColor;
}

.map-search-clear::before { transform: rotate(45deg); }
.map-search-clear::after { transform: rotate(-45deg); }

.map-search-clear:hover {
  border-color: var(--border);
  background: var(--panel-2);
  color: var(--text);
}

/* Nearby is a real section break: stronger label, separated count badge, and
   enough vertical rhythm that it cannot read as "Nearby stations38". */
.results-section-divider {
  min-height: 46px;
  padding: 10px 14px;
  gap: 14px;
  background: color-mix(in srgb, var(--panel-2) 92%, var(--panel));
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 78%, transparent);
}

.results-section-divider strong {
  min-width: 0;
  font-size: .94rem;
  font-weight: 800;
  letter-spacing: 0;
}

.results-section-divider span {
  margin-left: auto;
  min-width: 32px;
  height: 26px;
  padding: 0 9px;
  border-color: color-mix(in srgb, var(--border) 88%, transparent);
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  color: var(--text);
  font-size: .76rem;
  font-weight: 800;
}

/* More/tools now opens entirely inside the Results rail. It no longer extends
   beneath the adjacent station-detail rail on wide desktop. */
.more-menu {
  position: fixed;
  z-index: 2300;
  top: calc(var(--search-dock-top) + var(--search-dock-height) + 10px);
  left: var(--search-dock-left);
  right: auto;
  width: calc(var(--results-width) - 24px);
  max-width: calc(100vw - var(--search-dock-left) - 12px);
  padding: 8px;
  border-radius: 14px;
  box-shadow: 0 16px 42px rgba(0,0,0,.34);
}

.more-menu button {
  padding: 11px 12px;
}

.more-menu button span {
  font-size: .86rem;
}

.more-menu button small {
  margin-top: 1px;
  font-size: .72rem;
  line-height: 1.25;
}

@media (max-width: 820px) {
  .map-results-toolbar {
    min-height: 70px;
    padding: 11px 10px 10px 12px;
  }

  .map-results-toolbar .results-title > strong {
    font-size: 1.08rem;
  }

  .map-results-toolbar #resultsSubtitle {
    font-size: .8rem;
  }

  .more-menu {
    left: var(--search-dock-left);
    width: min(360px, calc(100vw - var(--search-dock-left) - 10px));
  }
}

@media (max-width: 520px) {
  .results-sort-control > span {
    display: none;
  }

  .results-sort-control select {
    min-width: 90px;
    height: 34px;
  }
}

/* v0.24.9 final control-state adjustments */
.results-sort-control::after {
  top: 50%;
}

.map-search-clear[hidden] {
  display: none !important;
}

.more-menu {
  max-height: calc(100vh - var(--search-dock-top) - var(--search-dock-height) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ==========================================================================
   v0.24.11 — Google-Maps-style application drawer + sidebar visibility
   ========================================================================== */

/* The former ellipsis action is now an explicit menu launcher. */
.app-menu-launcher svg {
  width: 22px;
  height: 22px;
}

/* Full-height navigation drawer. It overlays the app instead of competing with
   the Results/detail rails for layout space. */
.app-menu-scrim {
  position: fixed;
  z-index: 3050;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(0, 0, 0, .28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility 0s linear .2s;
}

.app-menu-drawer {
  position: fixed;
  z-index: 3100;
  inset: 0 auto 0 0;
  width: min(420px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px 18px 22px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 99%, transparent);
  color: var(--text);
  box-shadow: 16px 0 44px rgba(0, 0, 0, .34);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(calc(-100% - 18px));
  visibility: hidden;
  pointer-events: none;
  transition: transform .22s ease, visibility 0s linear .22s;
}

body.app-menu-open .app-menu-scrim {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

body.app-menu-open .app-menu-drawer {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.app-menu-head {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 2px 4px 16px;
}

.app-menu-head h2 {
  margin: 1px 0 0;
  font-size: 1.45rem;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.app-menu-eyebrow,
.app-menu-section-kicker {
  display: block;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.app-menu-close {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 1.7rem;
  line-height: 1;
}

.app-menu-close:hover,
.app-menu-close:focus-visible {
  border-color: var(--border);
  background: var(--panel-2);
  color: var(--text);
  outline: none;
}

.sidebar-visibility-row {
  min-height: 78px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin: 2px 0 4px;
  padding: 12px 10px;
  border-radius: 14px;
  cursor: pointer;
}

.sidebar-visibility-row:hover {
  background: var(--panel-2);
}

.sidebar-visibility-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.sidebar-visibility-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-visibility-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.sidebar-visibility-copy strong {
  font-size: .98rem;
  font-weight: 750;
}

.sidebar-visibility-copy small {
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.35;
}

.drawer-switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex: 0 0 44px;
}

.drawer-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.drawer-switch-track {
  position: absolute;
  inset: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  transition: background .18s ease, border-color .18s ease;
  pointer-events: none;
}

.drawer-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 1px 4px rgba(0,0,0,.28);
  transition: transform .18s ease, background .18s ease;
}

.drawer-switch input:checked + .drawer-switch-track {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 28%, var(--panel-2));
}

.drawer-switch input:checked + .drawer-switch-track .drawer-switch-knob {
  transform: translateX(18px);
  background: var(--accent-strong);
}

.drawer-switch input:focus-visible + .drawer-switch-track {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, white);
  outline-offset: 2px;
}

.app-menu-divider {
  height: 1px;
  margin: 12px 2px 18px;
  background: var(--border);
}

.app-menu-section {
  display: grid;
  gap: 14px;
  padding: 0 4px;
}

.app-menu-section-head {
  display: grid;
  gap: 3px;
}

.app-menu-section-head h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

/* Larger square preview targets make the six styles easy to compare quickly. */
.drawer-map-style-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.app-menu-drawer .map-style-option {
  aspect-ratio: 1 / 1;
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel-2);
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
  cursor: pointer;
  font: inherit;
  font-size: .9rem;
  font-weight: 800;
  text-align: center;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.app-menu-drawer .map-style-option:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  background: color-mix(in srgb, var(--panel-2) 82%, var(--panel));
  color: var(--text);
  transform: translateY(-1px);
}

.app-menu-drawer .map-style-option.active,
.app-menu-drawer .map-style-option[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
  background: color-mix(in srgb, var(--accent) 14%, var(--panel-2));
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}

.app-menu-drawer .map-style-option:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, white);
  outline-offset: 2px;
}


body.map-first-app:not(.sidebar-hidden) .app-menu-drawer {
  left: var(--sidebar-width);
  width: min(420px, calc(100vw - var(--sidebar-width) - 24px));
}

/* "Show side bar" genuinely releases the left rail's width for the map and
   application sheets. The search-dock hamburger remains available to reopen
   this drawer when the permanent rail is hidden. */
body.map-first-app.sidebar-hidden {
  --sidebar-width: 0px;
  --left-ui-offset: 12px;
  --search-dock-left: 12px;
  --result-overlay-width: calc(var(--results-width) + 18px);
}

body.sidebar-hidden .map-sidebar {
  display: none;
}

@media (max-width: 820px) {
  body.map-first-app.sidebar-hidden {
    --sidebar-width: 0px;
    --left-ui-offset: 8px;
    --search-dock-left: 8px;
  }

  .app-menu-drawer {
    width: min(380px, calc(100vw - 12px));
    padding: 16px 14px 18px;
  }

  .drawer-map-style-options {
    gap: 9px;
  }
}

@media (max-width: 520px) {
  .app-menu-drawer {
    width: min(340px, calc(100vw - 8px));
  }

  .drawer-map-style-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar-visibility-copy small {
    display: none;
  }
}


/* ==========================================================================
   v0.24.32 — default camera + What's New status colors + Dataset/Search layout
   ========================================================================== */

.history-badge.error {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 62%, var(--border));
  background: color-mix(in srgb, var(--accent) 7%, var(--panel-2));
}

.new-operational-metric strong {
  color: var(--good);
}

.coverage-backfill-metric {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.coverage-backfill-metric strong {
  color: var(--accent);
}

/* Keep Dataset provenance cards legible instead of squeezing eight cards into
   one row. Values may wrap rather than overlap or disappear behind ellipsis. */
#collectionPanel .collection-info-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

#collectionPanel .collection-info-grid article {
  min-height: 78px;
}

#collectionPanel .collection-info-grid span,
#collectionPanel .collection-info-grid strong {
  overflow-wrap: anywhere;
}

#collectionPanel .collection-info-grid strong {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.25;
}

/* The persistent search field belongs to the Results rail and must not extend
   into the map when the desktop rail is open. */
body.map-first-app .persistent-map-search {
  width: min(
    calc(var(--results-width) - 37px),
    calc(100vw - var(--search-dock-left) - 12px)
  );
  max-width: 100%;
  box-sizing: border-box;
}

body.map-first-app .map-search-dock {
  max-width: calc(var(--results-width) - 37px);
}

@media (max-width: 820px) {
  #collectionPanel .collection-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.map-first-app .map-search-dock {
    max-width: none;
  }

  body.map-first-app .persistent-map-search {
    width: auto;
    max-width: none;
  }
}

@media (max-width: 520px) {
  #collectionPanel .collection-info-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   v0.24.34 — corrected Google Maps desktop rail measurements
   ========================================================================== */

/* Re-measured from the two supplied 2048 × 1152 screenshots:
   - Google rail: ~77 raster px
   - Explorer rail: ~84 raster px with the previous 80 CSS-px setting
   The shared screenshot scale implies a Google-equivalent rail of ~72 CSS px.
   The hamburger visual bounds already match closely, so the 24 px SVG icon
   footprint is retained rather than made smaller. */
@media (min-width: 821px) {
  body.map-first-app {
    --sidebar-width: 72px;
    --left-ui-offset: calc(var(--sidebar-width) + 15px);
  }

  .map-sidebar {
    /* Keep the 72px Google Maps rail while giving labels the full usable width. */
    padding-inline: 4px;
  }

  .sidebar-button svg,
  .sidebar-map-action svg {
    width: 24px;
    height: 24px;
  }
}


/* ==========================================================================
   v0.24.36 — final Google Maps Results pane alignment
   ========================================================================== */

/* The latest paired screenshots show the Google results panel ending about
   seven raster pixels farther right than v0.24.35 at the same 2048 × 1152
   capture size. 417 CSS px closes that remaining gap. The search bar already
   matches closely, so its effective desktop width stays at ~380 CSS px. */
@media (min-width: 821px) {
  body.map-first-app {
    --results-width: 417px;
  }

  body.map-first-app .persistent-map-search {
    width: min(
      calc(var(--results-width) - 37px),
      calc(100vw - var(--search-dock-left) - 12px)
    );
  }

  body.map-first-app .map-search-dock {
    max-width: calc(var(--results-width) - 37px);
  }
}


/* ==========================================================================
   v0.24.37 — Google Maps sidebar rhythm + matched search action bubbles
   ========================================================================== */

@media (min-width: 821px) {
  /* Google Maps does not place a visible divider directly below the hamburger.
     Removing it also moves the first tool upward to match the supplied rail. */
  #sidebarMenu + .sidebar-divider {
    display: none;
  }

  /* Keep the hamburger in the same top position, but give the labeled app
     tools the more open vertical rhythm seen in Google Maps. */
  #sidebarMenu {
    min-height: 54px;
    gap: 0;
  }

  .map-sidebar > .sidebar-button:not(.sidebar-map-action) {
    min-height: 76px;
    gap: 8px;
    padding: 8px 3px;
    font-size: 0.72rem;
    line-height: 1.1;
  }

  .sidebar-map-action {
    min-height: 64px;
    gap: 7px;
    padding: 7px 3px;
    font-size: 0.72rem;
    line-height: 1.1;
  }

  .sidebar-button svg,
  .sidebar-map-action svg {
    width: 24px;
    height: 24px;
  }
}

/* Search and Clear are peers. Give the X the same 38px circular hit target
   and the same hover/focus bubble as the magnifying-glass button. */
.map-search-clear {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}

.map-search-clear::before,
.map-search-clear::after {
  width: 14px;
  height: 1.8px;
}

.map-search-clear:hover,
.map-search-clear:focus-visible {
  border: 0;
  background: var(--panel-2);
  color: var(--text);
  outline: none;
}


/* ==========================================================================
   v0.24.38 — measured Google Maps sidebar icon/label rhythm
   ========================================================================== */

@media (min-width: 821px) {
  /* The sidebar width and hamburger already match the Google reference closely.
     The remaining mismatch was the icon↔label separation and label scale.
     Prevent grid tracks from stretching so the declared gap is the real gap. */
  .map-sidebar > .sidebar-button:not(.sidebar-map-action) {
    min-height: 76px;
    align-content: center;
    justify-items: center;
    gap: 8px;
    padding: 8px 3px;
    font-size: 0.75rem; /* Google Maps rail labels use a 12px footprint. */
    line-height: 1.1;
  }

  /* Google’s Saved → Recents pitch is about 80px in CSS-equivalent terms.
     Keep the 76px button itself, then add 4px between app tools so the first
     item stays aligned while subsequent tools use Google-like spacing. */
  .map-sidebar > .sidebar-button:not(.sidebar-map-action) {
    margin-bottom: 4px;
  }

  /* Badges should move with the icon after removing the stretched grid rows. */
  .sidebar-count {
    top: 8px;
  }

  /* Bottom controls use the same label size but a slightly tighter
     icon↔label gap, matching the Get app control in the supplied reference. */
  .sidebar-map-action {
    min-height: 64px;
    align-content: center;
    justify-items: center;
    gap: 5px;
    padding: 7px 3px;
    font-size: 0.75rem;
    line-height: 1.1;
  }

  .sidebar-button svg,
  .sidebar-map-action svg {
    width: 24px;
    height: 24px;
  }
}


/* ==========================================================================
   v0.24.39 — Google search/card alignment + single visible hamburger
   ========================================================================== */

@media (min-width: 821px) {
  body.map-first-app {
    /* Directly measured from the supplied app/Google crops at the same scale:
       Google search begins ~16 CSS px right of the rail and ~12 CSS px down. */
    --left-ui-offset: calc(var(--sidebar-width) + 16px);
    --search-dock-left: var(--left-ui-offset);
    --search-dock-top: 12px;
    --desktop-map-card-width: 377px;
  }

  /* When the permanent sidebar is visible, Google Maps does not repeat the
     hamburger inside the search field. The sidebar hamburger already opens
     the same application drawer. */
  body.map-first-app:not(.sidebar-hidden) .app-menu-launcher {
    display: none;
  }

  body.map-first-app:not(.sidebar-hidden) .persistent-map-search {
    width: min(
      var(--desktop-map-card-width),
      calc(100vw - var(--search-dock-left) - 12px)
    );
    grid-template-columns: minmax(0, 1fr) auto;
    padding-left: 24px;
  }

  body.map-first-app:not(.sidebar-hidden) .map-search-dock {
    width: var(--desktop-map-card-width);
    max-width: var(--desktop-map-card-width);
  }

  .persistent-map-search input {
    font-size: 0.875rem;
    line-height: 24px;
  }

  .persistent-map-search .map-search-submit svg {
    width: 24px;
    height: 24px;
  }

  .area-results-card {
    min-height: 80px;
    padding: 12px 20px;
    border-radius: 16px;
  }

  .area-results-copy {
    gap: 12px;
  }

  .area-results-copy strong {
    font-size: 1rem;
    font-weight: 500;
    line-height: 24px;
  }

  .area-results-copy small {
    font-size: 0.75rem;
    line-height: 18px;
  }

  /* Google aligns "This area" to the exact same left/right edges as Search. */
  body.map-first-app:not(.sidebar-hidden) .area-results-card {
    left: var(--search-dock-left);
    top: calc(var(--search-dock-top) + var(--search-dock-height) + 12px);
    width: var(--desktop-map-card-width);
    max-width: var(--desktop-map-card-width);
    box-sizing: border-box;
  }

  /* Explicitly center every sidebar icon box. The Results glyph itself was
     also rebalanced in the SVG so its visual bounds are centered. */
  .sidebar-button {
    justify-items: center;
  }

  .sidebar-button svg {
    display: block;
    margin-inline: auto;
  }
}

/* If the permanent sidebar is hidden, retain the search-field hamburger so
   the drawer still has an entry point. */
body.map-first-app.sidebar-hidden .app-menu-launcher {
  display: grid;
}


/* ==========================================================================
   v0.24.40 — Google Maps-style menu drawer geometry and row rhythm
   ========================================================================== */

/* The supplied 2048×1152 Google Maps screenshot has a drawer right edge at
   ~x=341. The drawer covers the permanent rail instead of starting beside it. */
.app-menu-drawer,
body.map-first-app:not(.sidebar-hidden) .app-menu-drawer {
  left: 0;
  width: min(341px, 100vw);
  padding: 0;
  border-right: 1px solid var(--border);
  box-shadow: 8px 0 24px rgba(0, 0, 0, .24);
}

/* Compact one-line header, matching Google's top menu row height and padding. */
.app-menu-head {
  min-height: 58px;
  padding: 0 14px 0 20px;
  gap: 12px;
  border-bottom: 0;
}

.app-menu-brand {
  min-width: 0;
  display: flex;
  align-items: center;
}

.app-menu-head h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -.01em;
}

.app-menu-eyebrow {
  display: none;
}

.app-menu-close {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 0;
  border-radius: 50%;
  font-size: 1.45rem;
}

.app-menu-close:hover,
.app-menu-close:focus-visible {
  border: 0;
  background: var(--panel-2);
}

/* Google-style Show side bar row: icon, label, switch. The explanatory copy
   remains in the DOM for accessibility/content history but is hidden visually
   on desktop so the row keeps Google's compact menu rhythm. */
.sidebar-visibility-row {
  min-height: 62px;
  grid-template-columns: 24px minmax(0, 1fr) 36px;
  gap: 16px;
  margin: 0;
  padding: 0 20px;
  border-radius: 0;
}

.sidebar-visibility-row:hover {
  background: var(--panel-2);
}

.sidebar-visibility-icon {
  width: 24px;
  height: 24px;
}

.sidebar-visibility-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.7;
}

.sidebar-visibility-copy {
  display: block;
}

.sidebar-visibility-copy strong {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.2;
}

.sidebar-visibility-copy small {
  display: none;
}

.drawer-switch {
  width: 36px;
  height: 20px;
  flex: 0 0 36px;
}

.drawer-switch-knob {
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
}

.drawer-switch input:checked + .drawer-switch-track .drawer-switch-knob {
  transform: translateX(16px);
}

/* Full-width dividers like Google Maps. */
.app-menu-divider {
  height: 1px;
  margin: 0;
  background: var(--border);
}

/* The app only needs map-style choices in this drawer. Present them as compact
   menu rows instead of large square cards so the panel itself matches Google's
   menu proportions while preserving all six style choices. */
.app-menu-section {
  display: block;
  padding: 0;
}

.app-menu-section-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}

.app-menu-section-kicker {
  display: none;
}

.app-menu-section-head h3 {
  margin: 0;
  font-size: .875rem;
  line-height: 1.2;
  font-weight: 500;
}

.drawer-map-style-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.app-menu-drawer .map-style-option {
  aspect-ratio: auto;
  min-height: 46px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 20px 0 60px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  font-size: .875rem;
  font-weight: 500;
  text-align: left;
  transform: none;
  position: relative;
}

.app-menu-drawer .map-style-option::before {
  content: "";
  position: absolute;
  left: 23px;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel-2);
}

.app-menu-drawer .map-style-option:hover {
  border: 0;
  background: var(--panel-2);
  color: var(--text);
  transform: none;
}

.app-menu-drawer .map-style-option.active,
.app-menu-drawer .map-style-option[aria-pressed="true"] {
  border: 0;
  background: color-mix(in srgb, var(--accent) 9%, var(--panel));
  color: var(--text);
  box-shadow: none;
}

.app-menu-drawer .map-style-option.active::before,
.app-menu-drawer .map-style-option[aria-pressed="true"]::before {
  border-color: var(--accent);
  background:
    radial-gradient(circle at center, var(--accent) 0 4px, transparent 4.5px),
    var(--panel-2);
}

.app-menu-drawer .map-style-option:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, white);
  outline-offset: -2px;
}

/* On narrow screens the drawer still uses the available viewport width. */
@media (max-width: 520px) {
  .app-menu-drawer,
  body.map-first-app:not(.sidebar-hidden) .app-menu-drawer {
    width: min(341px, 100vw);
  }

  .drawer-map-style-options {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   v0.24.49 — Google widths + endless Results scrolling
   ========================================================================== */

/* The modal menu remains above the compact map rail. */
body.app-menu-open .app-menu-drawer,
body.map-first-app.app-menu-open:not(.sidebar-hidden) .app-menu-drawer {
  z-index: 4000;
}

/* Ensure the drawer fully covers the permanent rail rather than allowing the
   sidebar icons/labels to visually overlap its contents. */
body.app-menu-open .app-menu-scrim {
  z-index: 3950;
}

body.app-menu-open .map-sidebar {
  z-index: 2200;
}

/* Results now behave like Google Maps: one continuous scrolling list with the
   persistent viewport checkbox at the bottom, and no numbered pages. */
.results-pagination {
  display: none !important;
}

.left-panel-footer {
  min-height: 48px;
}

.update-map-results-toggle {
  min-height: 48px;
  padding: 10px 14px;
}

/* Google Map details is about 536 captured pixels wide in the supplied 2x
   reference, which corresponds to roughly 268 CSS pixels. */
.map-details-dialog,
body:not(.results-collapsed) .map-details-dialog,
body.detail-open .map-details-dialog,
body.filters-open .map-details-dialog {
  width: 268px;
  box-sizing: border-box;
}

.map-details-current-legend .legend-three-columns {
  gap: 9px 6px;
}

.map-details-current-legend .legend-values-row > span {
  font-size: .59rem;
}

@media (max-width: 760px) {
  .map-details-dialog,
  body:not(.results-collapsed) .map-details-dialog,
  body.detail-open .map-details-dialog,
  body.filters-open .map-details-dialog {
    width: min(268px, calc(100vw - 32px));
  }
}

/* Result scope and station decision summary. */
body.filters-open .map-search-dock { z-index: 1850; }
.filter-side-sheet .map-filter-grid { gap: 12px; }
.filter-help { margin: -5px 0 0; color: var(--muted); font-size: .73rem; line-height: 1.45; }
.filter-region-status { grid-column: 1 / -1; }
.filter-region-status:empty { display: none; }
.advanced-filters { margin-top: 16px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); }
.advanced-filters > summary { display: flex; align-items: center; gap: 8px; justify-content: space-between; min-height: 32px; cursor: pointer; font-size: .85rem; font-weight: 650; }
.advanced-filters > summary::after { content: "⌄"; margin-left: auto; }
.advanced-filters[open] > summary::after { content: "⌃"; }
.advanced-filters > summary::-webkit-details-marker { display: none; }
.advanced-filters > summary:focus-visible, .filter-source-notes > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.advanced-filter-count { padding: 3px 7px; border-radius: 999px; background: var(--panel); color: var(--accent-strong); font-size: .7rem; white-space: nowrap; }
.advanced-filter-count[hidden] { display: none; }
.advanced-filter-summary { margin: 8px 0 12px; }
.filter-source-notes { margin-top: 10px; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.filter-source-notes summary { cursor: pointer; }
.filter-source-notes p { margin-bottom: 0; overflow-wrap: anywhere; }
#teslaPricebookField > .filter-help { margin-top: 6px; }
.filter-side-sheet .map-filter-summary { margin-top: 16px; }

#resultsPanel .map-results-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}
.results-scope-control {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .8rem;
  color: var(--muted);
}
.results-scope-control select {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
}
#resultsPanel #resultsSubtitle { white-space: normal; line-height: 1.35; }
.update-map-results-toggle:has(input:disabled) { color: var(--muted); opacity: .65; }
.station-access-summary { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-bottom: 10px; color: var(--muted); font-size: .75rem; }
.station-access-summary span + span::before { content: "·"; margin-right: 12px; }
#detailDialog.station-detail-sheet .charging-essentials { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
#detailDialog .charging-essentials .detail-item { padding: 8px; }
#detailDialog .charging-essentials strong { font-size: .9rem; }
.pricing-now .pricing-freshness { color: var(--text); font-size: .75rem; line-height: 1.4; }
.pricing-now .pricing-method, .pricing-now .station-clock { font-size: .7rem; line-height: 1.4; }
#detailDialog .detail-primary-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; position: relative; gap: 7px; }
#detailDialog .detail-primary-actions > .button { justify-content: center; min-height: 40px; padding: 7px 9px; font-size: .8rem; text-align: center; }
.detail-actions-more summary { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); cursor: pointer; font-size: .8rem; }
.detail-actions-more summary::-webkit-details-marker { display: none; }
.detail-actions-more summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.detail-secondary-actions { position: absolute; z-index: 5; right: 0; top: calc(100% + 6px); display: grid; gap: 6px; width: min(240px, 100%); padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.detail-secondary-actions .button { justify-content: flex-start; min-height: 40px; }
.detail-actions-more:not([open]) .detail-secondary-actions { display: none; }
@media (max-width: 820px) {
  /* In-flow actions remain inside the phone's scrolling sheet. WebKit can
     otherwise paint a floating menu behind following cards or clip its top. */
  #detailDialog .detail-actions-more { grid-column: 1 / -1; }
  #detailDialog .detail-secondary-actions { position: static; width: 100%; box-sizing: border-box; margin-top: 7px; box-shadow: none; }
}
@media (min-width: 821px) {
  #resultsPanel { height: 100%; max-height: none; }
}

/* Startup uses the explorer's existing surface, accent and control tokens. */
/* Compact map legend: one explanatory popover instead of thumbnail tiles. */
.map-bottom-left #legendPanel[hidden]{display:none}.explorer-legend-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.explorer-legend-head button{width:30px;height:30px;padding:0;font-size:20px}.explorer-legend-status,.explorer-legend-prices{display:grid;grid-template-columns:1fr 1fr;gap:12px 8px;font-size:.75rem}.explorer-legend-status>span,.explorer-legend-prices>span{display:flex;align-items:center;gap:7px}.explorer-legend-status{padding-bottom:16px;border-bottom:1px solid var(--border);margin-bottom:14px}.legend-new-badge{font-size:.6rem;padding:2px 5px;background:var(--accent);color:var(--bg);border-radius:4px}#legendPanel .legend-price-heading{margin:0;font-size:.8rem}#legendPriceNote{font-size:.73rem;line-height:1.5;margin:8px 0 12px}#legendPriceRows[hidden]{display:none}#legendCurrency{font-size:.75rem;min-height:32px}
.congestion-section .congestion-days .congestion-day{padding:4px 2px;min-height:30px;font-size:.72rem}.congestion-section .congestion-week-overview{overflow-x:auto}.congestion-section .congestion-heat-cell.missing-value{background:var(--muted);border-style:dashed}
#legendPanel .legend-price-heading{padding:0;border:0}#legendPanel .nearby-context-dot{background:transparent;border:2px solid var(--accent)}
.startup-overlay{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(7px);padding:24px}.startup-overlay[hidden]{display:none}.startup-card{width:min(440px,100%);padding:32px;background:var(--panel);border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow);text-align:center}.startup-card h2{font-size:20px;margin:18px 0 10px}.startup-card p{font-size:13px;color:var(--muted);min-height:38px}.startup-spinner{display:inline-block;width:36px;height:36px;border:3px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:startup-spin .8s linear infinite}.startup-progress-line{display:flex;align-items:center;gap:14px;margin:20px 0 0}.startup-progress-line progress{flex:1;min-width:0;height:8px;accent-color:var(--accent)}.startup-progress-line strong{font-size:13px;min-width:35px}.startup-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:8px}.startup-actions:has(button:not([hidden])){margin-top:18px}.loading-error .startup-spinner{animation:none;border-color:var(--accent)}@keyframes startup-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.startup-spinner{animation-duration:2s}}

/* Mobile map navigation and sheets (backlog items 8–10). Desktop rails retain
   their layout; all mobile surfaces reserve the same safe-area-aware bar. */
.mobile-nav, .mobile-overflow-tools, .mobile-sheet-controls { display: none; }
@media (max-width: 820px) {
  body.map-first-app, body.map-first-app.sidebar-hidden {
    --sidebar-width: 0px;
    --left-ui-offset: 10px;
    --search-dock-left: max(10px, env(safe-area-inset-left));
    --search-dock-top: max(10px, env(safe-area-inset-top));
    --search-dock-reserved: calc(64px + env(safe-area-inset-top));
    --mobile-nav-height: calc(64px + env(safe-area-inset-bottom));
    --mobile-sheet-bottom: calc(var(--mobile-nav-height) + 8px);
    --mobile-sheet-max: calc(100dvh - var(--search-dock-reserved) - var(--mobile-sheet-bottom) - 8px);
  }
  body.map-first-app.has-active-filter-chips { --search-dock-reserved: calc(116px + env(safe-area-inset-top)); }
  #mapSidebar, #moreToggle, .sidebar-visibility-row { display: none !important; }
  .map-search-dock { right: max(10px, env(safe-area-inset-right)); }
  .map-search-box.persistent-map-search { grid-template-columns: minmax(0, 1fr) auto; padding-left: 16px; min-width: 0; }
  .mobile-nav {
    position: fixed; z-index: 2500; bottom: 0; left: 0; right: 0;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    height: var(--mobile-nav-height); padding: 4px max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
    background: var(--panel); border-top: 1px solid var(--border);
  }
  .mobile-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 48px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; }
  .mobile-nav button.active { color: var(--text); background: var(--panel-2); box-shadow: inset 0 3px 0 var(--accent); }
  .mobile-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
  .mobile-overflow-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 0 16px; border-bottom: 1px solid var(--border); }
  .mobile-overflow-tools button { min-height: 48px; padding: 10px; font: inherit; font-size: 14px; text-align: left; color: var(--text); background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; }
  .mobile-nav button:focus-visible, .mobile-overflow-tools button:focus-visible, .mobile-sheet-controls button:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
  body .app-menu-drawer { max-height: 100dvh; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .mobile-sheet-controls { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-bottom: 1px solid var(--border); }
  .mobile-sheet-controls button { min-height: 44px; min-width: 44px; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; }
  .mobile-sheet-controls button[aria-pressed="true"] { color: var(--text); background: var(--panel-2); }
  .mobile-sheet-controls .sheet-drag-handle { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; flex: 1; touch-action: none; user-select: none; color: var(--text); }
  .sheet-drag-handle > span { width: 32px; height: 4px; border-radius: 3px; background: var(--muted); }
  body #resultsPanel.map-results-panel, body #detailDialog.station-detail-sheet {
    position: fixed; top: auto; left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right));
    bottom: var(--mobile-sheet-bottom); width: auto; margin: 0; padding: 0;
    height: min(max(52dvh, 280px), var(--mobile-sheet-max)); max-height: var(--mobile-sheet-max);
    border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
    transform: none; opacity: 1; transition: none;
  }
  body #resultsPanel.map-results-panel { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
  body #detailDialog.station-detail-sheet[open] { display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
  body #resultsPanel[data-sheet-size="full"], body #detailDialog.station-detail-sheet[data-sheet-size="full"] { height: var(--mobile-sheet-max); }
  body #detailDialog.station-detail-sheet[data-sheet-size="collapsed"] { height: auto; max-height: min(180px, var(--mobile-sheet-max)); }
  body #detailDialog[data-sheet-size="collapsed"] #detailBody { display: none; }
  body #detailDialog.station-detail-sheet .dialog-head { padding: 8px 12px; align-items: center; }
  #detailDialog #closeDialog { width: 44px; height: 44px; flex: 0 0 44px; }
  body.results-collapsed #resultsPanel { display: none; }
  body.detail-open #resultsPanel, body.filters-open #resultsPanel, body.mobile-secondary-open #resultsPanel { display: none; }
  #toggleResultsPanel { display: none; }
  /* The map summary and Results navigation already open this list on phones. */
  body #resultsCollapsedTab { display: none !important; }
  body #filtersPanel { top: calc(var(--search-dock-reserved) + 8px); bottom: var(--mobile-sheet-bottom); left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); width: auto; height: auto; max-height: none; padding: 12px; }
  #filtersPanel .popover-head { position: sticky; z-index: 2; top: -12px; margin: -12px -12px 12px; padding: 10px 12px; background: var(--panel); }
  #filtersPanel .popover-head button { min-width: 44px; min-height: 44px; }
  body .map-sheet { top: calc(var(--search-dock-reserved) + 8px); bottom: var(--mobile-sheet-bottom); left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); width: auto; max-height: none; transform: none; z-index: 1900; }
  .sheet-scroll, #results, #detailBody { overscroll-behavior: contain; }
  #results { touch-action: pan-y; }
  .sheet-scroll, #detailBody { touch-action: auto; }
  .sheet-head .small-icon-button { min-width: 44px; min-height: 44px; }
  /* Legend lives in More on phones. Its panel is bounded independently of
     sheet height, with a sticky close row and unobstructed navigation. */
  #legendToggle, .compare-launcher { display: none !important; }
  body .map-bottom-left:has(#legendPanel:not([hidden])) { z-index: 2700; }
  body .map-bottom-left #legendPanel {
    position: fixed; z-index: 2700; left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right));
    bottom: var(--mobile-sheet-bottom); width: auto; max-width: none; height: auto;
    max-height: var(--mobile-sheet-max); padding: 14px; overscroll-behavior: contain;
  }
  #legendPanel .explorer-legend-head { position: sticky; z-index: 1; top: -14px; margin: -14px -14px 10px; padding: 8px 14px; background: var(--panel); }
  #legendPanel .explorer-legend-head button { width: 44px; height: 44px; }
  .map-first-app .maplibregl-ctrl-bottom-right { bottom: var(--mobile-nav-height); }
}
@media (min-width: 620px) and (max-width: 820px) and (max-height: 600px) {
  #resultsPanel .map-results-toolbar { grid-template-columns: minmax(180px, 1fr) minmax(0, 1fr) auto; gap: 8px; padding: 8px 10px; min-height: 56px; }
  #resultsPanel .results-scope-control { grid-column: auto; }
  #resultsPanel .results-scope-control > span { display: none; }
  #resultsPanel .results-title > strong { font-size: 14px; }
  #resultsPanel #resultsSubtitle { font-size: 11px; }
}

/* Price explanations live with the scrolling list, preserving usable sheet
   height on short phones. Neutral foreign prices retain their rate and unit. */
.results-price-context { padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--panel); }
.price-display-help > summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; font-size: .75rem; }
.price-display-help > summary > span { color: var(--muted); font-size: .7rem; }
.price-display-help > summary > span::after { content: ' ⌄'; }
.price-display-help[open] > summary > span::after { content: ' ⌃'; }
.price-display-help > summary::-webkit-details-marker { display: none; }
.price-display-help > summary:focus-visible, .price-currency-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.price-display-help p, .results-sort-note { margin: 5px 0 8px; color: var(--muted); font-size: .7rem; line-height: 1.4; }
.results-sort-note { margin: 0 0 3px; }
.price-display-help [data-price-currency] { min-height: 44px; font-size: .75rem; }
.price-group-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; background: var(--panel-2); border-bottom: 1px solid var(--border); font-size: .72rem; }
.price-group-heading > span { color: var(--muted); font-size: .65rem; overflow-wrap: anywhere; }
.price-tier-outside-currency { color: var(--muted) !important; }
#fitResults > span { font-size: 11px; }
.outside-color-label { display: block; margin-top: 4px; font-size: .65rem; line-height: 1.3; font-weight: 400; }
.pricing-now .price-color-note, .price-color-note { display: block; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.price-currency-link { padding: 3px 0; border: 0; color: var(--text); background: transparent; text-decoration: underline; font: inherit; cursor: pointer; }
.sidebar-count[hidden], .tool-count[hidden] { display: none !important; }
#catalogChangesPanel .history-badge[hidden] { display: none; }
#newStationCount { max-width: 44px; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); font-size: 10px; font-weight: 600; }
.new-meaning-note { padding: 10px 12px; margin: 0 0 14px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: .8rem; line-height: 1.45; background: var(--panel-2); }
@media (max-width: 820px) {
  .price-display-help > summary { min-height: 44px; }
  .price-currency-link { min-height: 44px; }
  .mobile-overflow-tools small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.3; }
  .results-sort-control select { min-width: 130px; font-size: 12px; }
}

/* Accessibility review: independent native result actions, visible focus and
   readable action labels without changing the near-black map palette. */
.result-card[data-key] { position: relative; }
.result-open { position: absolute; inset: 0; z-index: 1; width: 100%; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.result-card .compare-card-button { position: relative; z-index: 2; }
.result-card .result-top, .result-card .result-location-line, .result-card .meta-row { pointer-events: none; }
.result-name { min-width: 0; overflow-wrap: anywhere; }
.result-card .price-tier-unknown, .outside-color-label { white-space: normal; overflow-wrap: anywhere; }
.price-group-heading > strong, .price-group-heading > span { min-width: 0; overflow-wrap: anywhere; }
.map-first-app :is(button, a, input, select, summary, [tabindex]):focus-visible { outline: 2px solid var(--text); outline-offset: -3px; }
.map-first-app .button.primary { background: #b82d2a; border-color: #b82d2a; color: #fff; }
.map-first-app .button.primary:hover { background: #9f2522; border-color: #9f2522; }
.map-first-app .button.primary:focus-visible { outline-color: #fff; outline-offset: -4px; }
.skip-link { position: fixed; z-index: 10001; top: 8px; left: 8px; transform: translateY(-160%); padding: 12px 16px; color: var(--text); background: var(--panel); border: 2px solid var(--control-border); border-radius: 8px; font-size: 1rem; }
.skip-link:focus { transform: none; }
.map-first-app :is(select, input[type="number"], .button:not(.primary), .persistent-map-search, .detail-actions-more > summary, .map-style-option) { border-color: var(--control-border); }
.map-first-app button, .map-first-app summary { min-height: 24px; }
.schedule-wrap:focus-visible, .raw-json:focus-visible, .compare-table-wrap:focus-visible { outline-offset: -2px; }
.congestion-heat-day { min-height: 24px; }
.congestion-heat-cell { display: block; }
.congestion-heat-cell:hover { cursor: default; }
.profile-position-axis{display:grid;gap:0;text-align:center}.profile-position-axis span:first-child{text-align:left}.profile-position-axis span:last-child{text-align:right}
.congestion-axis-label{text-align:center;color:var(--muted);font-size:.7rem;margin:6px 0 0}
.congestion-metadata{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:8px;font-size:.75rem}.congestion-metadata dt{color:var(--muted)}.congestion-metadata dd{margin:0;overflow-wrap:anywhere}.congestion-raw-cell small{display:block;color:var(--muted);overflow-wrap:anywhere}
.detail-distance small{display:block;margin-top:5px;color:var(--muted);font-size:.74rem;line-height:1.4;overflow-wrap:anywhere}
.result-distance span{display:block;font-size:.62rem;color:var(--muted);white-space:nowrap}
.results-distance-context{padding:10px 12px;border-bottom:1px solid var(--border);font-size:.72rem;color:var(--muted);line-height:1.5}.results-distance-context p{margin:0 0 5px}
.distance-unit-link{padding:2px 0;border:0;background:transparent;color:var(--text);font:inherit;text-decoration:underline;cursor:pointer;min-height:30px}
.distance-preferences label{display:block;color:var(--muted);font-size:.78rem;margin-bottom:8px}.distance-preferences select{width:100%;min-height:40px}.distance-preferences p{line-height:1.5}
.search-suggestions{position:absolute;top:calc(100% - 2px);left:0;right:0;max-height:min(430px,60dvh);overflow:auto;background:var(--panel);color:var(--text);border:1px solid var(--border);border-radius:12px;box-shadow:0 8px 24px #0005;z-index:30;padding:5px}
.search-suggestion{display:flex;align-items:center;gap:10px;padding:10px 8px;border-radius:7px;cursor:pointer;min-height:52px}.search-suggestion:hover,.search-suggestion[aria-selected="true"]{background:var(--panel-2,#24303a)}.suggestion-type{font-size:.68rem;border:1px solid var(--border);border-radius:5px;padding:3px 5px;flex:0 0 66px;text-align:center}.suggestion-copy{min-width:0;display:grid;gap:3px}.suggestion-copy strong{font-size:.8rem;overflow-wrap:anywhere}.suggestion-copy small{font-size:.7rem;color:var(--muted);overflow-wrap:anywhere}
.catalog-background-status{position:absolute;top:12px;right:12px;z-index:4;width:min(310px,calc(100% - 24px));padding:10px 12px;background:var(--panel);color:var(--text);border:1px solid var(--border);border-radius:8px;box-shadow:0 3px 12px #0004;font-size:.76rem;line-height:1.5}.catalog-background-status p{margin:0}.catalog-background-status button{margin-top:6px}
@media(max-width:820px){.catalog-background-status{top:auto;bottom:calc(78px + env(safe-area-inset-bottom));right:12px;max-width:250px}.search-suggestion{min-height:56px}}
.detail-body, .sheet-scroll { overflow-wrap: anywhere; }
.catalog-background-status:not([hidden]) + .publication-status:not([hidden]){top:120px}
@media(max-width:820px){.catalog-background-status:not([hidden]) + .publication-status:not([hidden]){top:auto;bottom:calc(190px + env(safe-area-inset-bottom))}}
body #resultsPanel.compact-results-scroll { display: block; overflow-y: auto; overscroll-behavior: contain; scroll-padding-block: 60px; }
body #resultsPanel.compact-results-scroll #results { height: auto; max-height: none; overflow: visible; }
#resultsPanel.compact-results-scroll .mobile-sheet-controls { position: sticky; top: 0; z-index: 4; background: var(--panel); }
#resultsPanel.compact-results-scroll .left-panel-footer { position: sticky; bottom: 0; z-index: 4; background: var(--panel); }
.compact-detail-close { display: none; }
body #detailDialog.compact-detail-scroll[open] { display: block; overflow-y: auto; overscroll-behavior: contain; scroll-padding-top: 60px; }
body #detailDialog.compact-detail-scroll #detailBody { height: auto; max-height: none; overflow: visible; }
#detailDialog.compact-detail-scroll .mobile-sheet-controls { position: sticky; top: 0; z-index: 4; background: var(--panel); }
#detailDialog.compact-detail-scroll .compact-detail-close { display: block; flex: 0 0 44px; min-width: 44px; font-size: 1.5rem; }
@media (prefers-reduced-motion: reduce) {
  .map-first-app *, .map-first-app *::before, .map-first-app *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 820px) {
  .result-top { flex-wrap: wrap; }
  .result-name { flex: 1 1 120px; }
  body:is(.results-collapsed, .detail-open, .filters-open, .mobile-secondary-open) #resultsPanel.compact-results-scroll { display: none; }
  .map-first-app .map-attribution-toggle { width: 44px; height: 44px; flex-basis: 44px; }
  .map-first-app .map-attribution-control.collapsed { max-width: 46px; }
  /* The bottom attribution control otherwise peeks out from beneath a sheet
     with only part of its target exposed. Map view restores the full control. */
  body:not(.results-collapsed) .maplibregl-ctrl-bottom-right,
  body:is(.detail-open, .filters-open, .mobile-secondary-open) .maplibregl-ctrl-bottom-right { visibility: hidden; }
  .map-first-app :is(button, select, summary, .action-link) { min-height: 44px; }
  .map-first-app input:not([type="checkbox"]):not([type="radio"]) { min-height: 44px; }
  .map-first-app .small-icon-button, .map-first-app .copy-inline { min-width: 44px; }
  .congestion-section .congestion-days { grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); }
  .congestion-section .congestion-days .congestion-day { min-height: 44px; }
  .congestion-heat-row { min-height: 44px; }
}
[data-read-only-preview="true"] a[href^="/admin"] { display: none !important; }
.result-card .save-card-button { position: relative; z-index: 2; }
.result-card-actions { display: flex; flex: 0 0 auto; align-items: baseline; gap: 6px; flex-wrap: wrap; justify-content: end; }
.saved-stations-list { display: grid; gap: 10px; }
.saved-station-row { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); }
.saved-station-row strong { display: block; overflow-wrap: anywhere; }
.saved-station-row p { margin: 6px 0 10px; }
.saved-station-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.share-dialog { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-sizing: border-box; padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); color: var(--text); overflow-y: auto; }
.share-dialog::backdrop { background: rgba(0,0,0,.5); }
.share-dialog-body { padding: 16px; display: grid; gap: 12px; }
.share-dialog-body p { margin: 0; }
.share-search-option { display: flex; align-items: center; gap: 8px; }
#shareLink { width: 100%; min-width: 0; box-sizing: border-box; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.share-view-notice { position: absolute; z-index: 1500; top: 110px; right: 12px; max-width: min(360px, calc(100vw - 24px)); background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.share-view-notice[hidden] { display: none; }
.share-view-notice p { margin: 0 0 8px; }

/* Approved black price-sign treatment; map price bands remain independent. */
body.map-first-app {
  color-scheme: dark;
  --bg: #000000;
  --panel: #000000;
  --panel-2: #0b0b0b;
  --text: #f5f5f5;
  --muted: #b3b3b3;
  --border: #303030;
  --control-border: #858585;
  --accent: #ff3a3a;
  --accent-strong: #ff6b6b;
  --good: #51c990;
  --warn: #e5b15f;
  --coming: #b39ddb;
  --sign-tesla: #ff3a3a;
  --sign-non-tesla: #39e87d;
  --sign-unavailable: #858585;
  --price-very-low: #51c990;
  --price-low: #55c9c0;
  --price-moderate: #e0c85c;
  --price-high: #f0a15c;
  --price-very-high: #ff7470;
  --price-unknown: #b3b3b3;
}
body.map-first-app .result-card.selected { background: var(--panel-2); }
.vehicle-price { display: grid; gap: 5px; min-width: 0; }
.vehicle-price-label { color: var(--muted); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.vehicle-price-unit, .vehicle-price-note { color: var(--muted); font-size: .72rem; font-weight: 400; line-height: 1.4; }
.seven-readout { display: inline-flex; align-items: flex-end; gap: .07em; font-size: 1.5rem; line-height: 1; vertical-align: middle; white-space: nowrap; }
.seven-readout, .seven-readout span { font-weight: 400; letter-spacing: normal; text-transform: none; }
.seven-readout span { font-size: inherit; color: inherit !important; }
.seven-digit { position: relative; display: inline-block; width: .61em; height: 1.08em; flex: 0 0 .61em; }
.seven-segment { position: absolute; display: block; background: currentColor; opacity: .08; }
.seven-segment.segment-on { opacity: 1; }
.segment-horizontal { width: 76%; height: 9%; left: 12%; clip-path: polygon(10% 0,90% 0,100% 50%,90% 100%,10% 100%,0 50%); }
.segment-vertical { width: 14%; height: 40%; clip-path: polygon(50% 0,100% 10%,100% 90%,50% 100%,0 90%,0 10%); }
.segment-a { top: 0; }
.segment-g { top: 45.5%; }
.segment-d { bottom: 0; }
.segment-b { right: 0; top: 7%; }
.segment-c { right: 0; bottom: 7%; }
.segment-f { left: 0; top: 7%; }
.segment-e { left: 0; bottom: 7%; }
.seven-decimal { display: inline-block; width: .1em; height: .1em; flex: 0 0 .1em; margin: 0 .015em; background: currentColor; border-radius: 1px; }
.tesla-sign .seven-readout { color: var(--sign-tesla) !important; filter: drop-shadow(0 0 1.5px var(--sign-tesla)); }
.non-tesla-sign .seven-readout { color: var(--sign-non-tesla) !important; filter: drop-shadow(0 0 1.5px var(--sign-non-tesla)); }
.sign-no-access .seven-readout { color: var(--sign-unavailable) !important; filter: none !important; }
.sign-no-access .seven-segment, .sign-no-access .seven-decimal { opacity: .22; }
.sign-unavailable .non-tesla-sign-amount { color: var(--muted); font-size: .76rem; line-height: 1.4; font-weight: 500; }
.sign-no-access .non-tesla-sign-amount { color: var(--sign-unavailable); filter: none; }
.price-sign-text { color: inherit; overflow-wrap: anywhere; }
.tesla-sign .price-sign-text { color: var(--sign-tesla); }
.non-tesla-sign .price-sign-text { color: var(--sign-non-tesla); }
.result-card .result-top { display: grid; grid-template-columns: minmax(0,1fr) minmax(96px,116px); align-items: center; gap: 12px; }
.result-identity { min-width: 0; }
.result-identity .result-location-line { flex-wrap: wrap; }
.result-price-signs { display: grid; gap: 12px; text-align: right; min-width: 0; }
.result-price-signs .vehicle-price { justify-items: end; }
.result-price-signs .price { min-width: 0; font-size: .76rem; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
.result-price-signs .seven-readout { font-size: 1.55rem; }
.result-price-signs .seven-readout-long { font-size: 1rem; }
.result-price-signs .outside-color-label { font-size: .65rem; color: var(--muted); }
.result-price-signs .vehicle-price-unit { font-size: .68rem; }
.result-price-signs .non-tesla-sign-amount { display: block; }
.result-card .result-footer { align-items: flex-end; margin-top: 12px; gap: 8px; flex-wrap: wrap; }
.price-group-heading { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 7px 12px; }
.price-group-heading > .price-board-station-heading, .price-group-heading > strong { font-size: .65rem; font-weight: 600; color: var(--muted); }
.price-group-heading > strong { text-align: right; }
.price-group-heading > .price-board-source { grid-column: 1 / -1; font-size: .65rem; }
#detailDialog .pricing-hero > .non-tesla-sign { padding: 12px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; }
#detailDialog .pricing-now { background: var(--panel-2); border-color: var(--border); }
#detailDialog .pricing-now .vehicle-price-label, #detailDialog .pricing-hero > .non-tesla-sign > .vehicle-price-label { font-size: .75rem; color: var(--muted); }
#detailDialog .pricing-now .seven-readout, #detailDialog .pricing-hero > .non-tesla-sign .seven-readout { display: inline-flex; font-size: 2.4rem; }
#detailDialog .pricing-now .seven-readout span, #detailDialog .pricing-hero > .non-tesla-sign .seven-readout span { font-size: inherit; }
#detailDialog .pricing-now .seven-readout-long, #detailDialog .pricing-hero > .non-tesla-sign .seven-readout-long { font-size: 1.25rem; }
#detailDialog .pricing-now .vehicle-price-unit { display: block; margin-top: 7px; font-size: .8rem; text-transform: none; letter-spacing: normal; }
#detailDialog .pricing-now .vehicle-price-unit[hidden] { display: none; }
#detailDialog .pricing-next .price-value { color: var(--sign-tesla) !important; }
@media (max-width: 360px) {
  .result-card .result-top { grid-template-columns: minmax(0,1fr) 102px; gap: 10px; }
}
@media (forced-colors: active) {
  .seven-readout { display: none !important; }
  .price .visually-hidden, .pricing-now strong > .visually-hidden, .non-tesla-sign-amount > .visually-hidden { position: static; width: auto; height: auto; clip-path: none; overflow: visible; white-space: normal; }
}

/* UX/UI 40–42: scoped rhythm and controls for the everyday explorer views. */
body.map-first-app {
  --explorer-space-1: 4px;
  --explorer-space-2: 8px;
  --explorer-space-3: 12px;
  --explorer-space-4: 16px;
  --explorer-radius: 9px;
  --explorer-copy: .875rem;
  --explorer-support: .75rem;
}
.result-card { padding: var(--explorer-space-4) var(--explorer-space-3); container-type: inline-size; container-name: station-result; }
.result-card .result-top { align-items: start; }
.result-card .result-name { font-size: .9375rem; line-height: 1.35; }
.result-card .result-location { font-size: .8125rem; line-height: 1.4; margin-top: var(--explorer-space-2); }
.result-card .result-location-line { display: block; }
.result-card .result-distance { margin-top: var(--explorer-space-2); font-size: .8125rem; }
.result-card .result-distance span { display: inline; font-size: var(--explorer-support); white-space: normal; }
.result-primary-meta { margin-top: var(--explorer-space-3); gap: 6px; }
.result-primary-meta .chip { color: var(--text); background: var(--panel-2); font-size: var(--explorer-support); line-height: 1.4; padding: 4px 7px; }
.result-secondary-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: var(--explorer-space-2); pointer-events: none; }
.result-secondary-meta .chip { font-size: var(--explorer-support); line-height: 1.4; padding: 0; border: 0; background: transparent; color: var(--muted); }
.result-card .result-footer { margin-top: var(--explorer-space-3); }
.result-card-actions { display: grid; width: 100%; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--explorer-space-2); }
.result-card-actions > .button { min-height: 40px; justify-content: center; text-align: center; font-size: .8125rem; padding: 8px; border-radius: var(--explorer-radius); }
.result-card-actions > .button:only-child { grid-column: 1 / -1; }
.vehicle-price-label, .result-price-signs .vehicle-price-unit, .result-price-signs .outside-color-label { font-size: var(--explorer-support); }
.result-price-signs .seven-readout { font-size: 1.65rem; }
.result-price-signs .seven-readout-long { font-size: 1.25rem; }
.result-card:has(.seven-readout-long) .result-top { grid-template-columns: 1fr; }
.result-card:has(.seven-readout-long) .result-price-signs { grid-template-columns: 1fr; }
.price-group-heading > .price-board-station-heading, .price-group-heading > strong, .price-group-heading > .price-board-source { font-size: var(--explorer-support); }
#detailDialog.station-detail-sheet .pricing-hero { grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--explorer-space-2); margin-bottom: 0; }
#detailDialog .pricing-hero > .pricing-now, #detailDialog .pricing-hero > .non-tesla-sign { min-width: 0; padding: var(--explorer-space-3); border-radius: var(--explorer-radius); }
#detailDialog .pricing-hero .pricing-next { grid-column: 1 / -1; padding: var(--explorer-space-2) var(--explorer-space-3); border-radius: var(--explorer-radius); }
#detailDialog .pricing-next > span { font-size: var(--explorer-support); }
#detailDialog .pricing-next > strong { margin-top: var(--explorer-space-1); font-size: var(--explorer-copy); line-height: 1.4; }
#detailDialog .pricing-next .price-value { display: inline; text-transform: none; letter-spacing: normal; }
#detailDialog .pricing-now .seven-readout, #detailDialog .pricing-hero > .non-tesla-sign .seven-readout { font-size: 2rem; }
#detailDialog .pricing-now .seven-readout-long, #detailDialog .pricing-hero > .non-tesla-sign .seven-readout-long { font-size: 1.5rem; }
#detailDialog .pricing-hero:has(.seven-readout-long), #detailDialog .pricing-hero:has(.pricing-now > .price-tier-unknown) { grid-template-columns: 1fr; }
.pricing-capture-caption { margin: var(--explorer-space-2) 0 var(--explorer-space-3); color: var(--muted); font-size: var(--explorer-support); line-height: 1.4; }
.pricing-capture-details :is(.pricing-method,.pricing-freshness,.station-clock,.price-color-note) { display: block; margin: 0 0 var(--explorer-space-2); color: var(--muted); font-size: .8125rem; line-height: 1.5; overflow-wrap: anywhere; }
.pricing-capture-details .pricing-freshness { color: var(--text); }
.pricing-capture-details .price-currency-link { min-height: 36px; padding: 4px 0; font-size: inherit; }
#detailDialog .detail-primary-actions { grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--explorer-space-2); }
#detailDialog .detail-primary-actions > .button, #detailDialog .detail-actions-more > summary { min-height: 44px; font-size: var(--explorer-copy); padding: 8px 10px; border-radius: var(--explorer-radius); }
#detailDialog .detail-actions-more { grid-column: auto; min-width: 0; }
#detailDialog .detail-primary-actions:not(:has([data-detail-action="compare"])) .detail-actions-more { grid-column: 1 / -1; }
#detailDialog .detail-actions-more[open] { grid-column: 1 / -1; }
#detailDialog .detail-primary-actions:has(.detail-actions-more[open]) > [data-detail-action="compare"] { grid-column: 1 / -1; }
#detailDialog .detail-secondary-actions { position: static; width: 100%; margin-top: var(--explorer-space-2); box-shadow: none; border-radius: var(--explorer-radius); }
#detailDialog .detail-secondary-actions > .button { min-height: 44px; font-size: var(--explorer-copy); }
#detailDialog .detail-disclosure > summary small, .filter-side-sheet .filter-help, .filter-side-sheet .field > span { font-size: .8125rem; line-height: 1.5; }
#detailDialog .detail-notice { padding: var(--explorer-space-3); border-radius: var(--explorer-radius); }
#detailDialog .detail-notice :is(span,p) { font-size: .8125rem; line-height: 1.5; }
.filter-side-sheet .popover-actions > .button { min-height: 44px; font-size: var(--explorer-copy); border-radius: var(--explorer-radius); }
@container station-result (max-width: 300px) {
  .result-card .result-top { grid-template-columns: 1fr; }
  .result-price-signs { grid-template-columns: repeat(2,minmax(0,1fr)); text-align: left; }
  .result-price-signs .vehicle-price { justify-items: start; }
}
@media (max-width: 360px) {
  #detailDialog.station-detail-sheet .pricing-hero { grid-template-columns: 1fr; }
}
@media (pointer: coarse) {
  .result-card-actions > .button, .pricing-capture-details .price-currency-link { min-height: 44px; }
}
#detailDialog .charging-essentials .distance-origin-disclosure { margin: 4px 0 0; border: 0; background: transparent; }
#detailDialog .charging-essentials .distance-origin-disclosure > summary { min-height: 36px; padding: 4px 0; gap: 6px; border: 0; border-radius: 0; }
#detailDialog .charging-essentials .distance-origin-disclosure > summary > span { font-size: var(--explorer-support); font-weight: 500; }
#detailDialog .charging-essentials .distance-origin-disclosure > .detail-disclosure-body { padding: 0; }
#detailDialog .charging-essentials .distance-origin-disclosure small { margin: 4px 0 0; font-size: var(--explorer-support); }
.app-menu-drawer :is(.button,select), .mobile-overflow-tools > button { min-height: 44px; font-size: var(--explorer-copy); border-radius: var(--explorer-radius); }
.app-menu-drawer .filter-help, .mobile-overflow-tools small { font-size: .8125rem; line-height: 1.5; }

/* UX/UI 46–48: compact comparison, result navigation and saved browsing. */
.detail-navigation { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
body #detailDialog.station-detail-sheet[open] { grid-template-rows: auto auto minmax(0,1fr); }
.detail-navigation .button { min-height: 44px; font-size: .8125rem; padding: 8px; }
#detailPosition { color: var(--muted); text-align: center; font-size: .8125rem; overflow-wrap: anywhere; min-width: 0; }
.saved-search-controls { display: flex; align-items: end; gap: 8px; margin: 12px 0; }
.saved-search-controls .field { flex: 1; min-width: 0; }
.saved-search-controls input { width: 100%; min-height: 44px; font-size: 1rem; }
.saved-search-controls .button { min-height: 44px; }
.saved-station-row h3 { margin: 0; font-size: 1rem; line-height: 1.4; overflow-wrap: anywhere; }
.saved-station-row .seven-readout { font-size: 1.75rem; }
.saved-station-row .seven-readout-long { font-size: 1.25rem; }
.saved-station-row:has(.seven-readout-long) .saved-prices { grid-template-columns: 1fr; }
.saved-station-row .vehicle-price strong { font-size: .875rem; overflow-wrap: anywhere; }
.saved-station-row .saved-station-actions { margin-top: 16px; }
.saved-station-actions .button { min-height: 44px; flex: 1; }
@media (max-width: 820px) {
  body #detailDialog.station-detail-sheet[open] { grid-template-rows: auto auto auto minmax(0,1fr); }
  body #detailDialog[data-sheet-size="collapsed"] #detailNavigation { display: none; }
  #comparePanel:has(#compareOverview:not([hidden])) .compare-selection-chip { display: none; }
  #comparePanel:has(#compareOverview:not([hidden])) .compare-selection { min-height: 0; margin-top: 0; }
  #comparePanel:has(#compareOverview:not([hidden])) .compare-head > div:first-child > p { display: none; }
  #comparePanel .compare-head-actions { justify-content: space-between; }
  #comparePanel .compare-head-actions .button { min-height: 44px; }
  .detail-navigation { padding: 6px 10px; }
  .saved-search-controls { flex-wrap: wrap; }
}

/* UX/UI 43–45: direct map location, responsive comparison and quick filters. */
.mobile-location-control { display: none; }
.quick-filter-controls { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 16px; }
.quick-filter-controls > .button { min-height: 44px; padding: 8px 12px; font-size: .8125rem; border-radius: var(--explorer-radius); }
.quick-filter-controls > .button[aria-pressed="true"] { background: var(--panel-2); border-color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }
.compare-overview { display: none; }
.compare-overview[hidden], .compare-full-details[hidden] { display: none; }
.compare-full-details > summary { display: none; }
.comparison-card { padding: 14px; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--explorer-radius); min-width: 0; }
.comparison-card-heading { display: flex; align-items: start; gap: 12px; justify-content: space-between; }
.comparison-card-heading h3 { margin: 0; font-size: .9375rem; line-height: 1.4; overflow-wrap: anywhere; }
.comparison-card-heading .button { min-height: 44px; flex-shrink: 0; font-size: .8125rem; }
.comparison-card .vehicle-price { margin-top: 16px; }
.comparison-prices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.comparison-card .comparison-prices .vehicle-price { margin-top: 0; }
.comparison-card:has(.seven-readout-long) .comparison-prices { grid-template-columns: 1fr; }
.comparison-card .seven-readout { font-size: 1.75rem; }
.comparison-card .seven-readout-long { font-size: 1.25rem; }
.comparison-card .vehicle-price strong { overflow-wrap: anywhere; font-size: .875rem; }
.comparison-card-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 16px 0 0; }
.comparison-card-facts dt { color: var(--muted); font-size: .75rem; }
.comparison-card-facts dd { margin: 4px 0 0; font-size: .875rem; overflow-wrap: anywhere; }
.compare-overview-note { margin: 0; color: var(--muted); font-size: .8125rem; line-height: 1.5; }
@media (max-width: 820px) {
  body.results-collapsed:not(.detail-open):not(.filters-open):not(.app-menu-open):not(.mobile-secondary-open) .mobile-location-control {
    position: fixed; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    right: max(12px,env(safe-area-inset-right)); bottom: var(--mobile-sheet-bottom);
    z-index: 1100; min-width: 64px; min-height: 64px; padding: 8px;
    color: var(--text); background: var(--panel); border: 1px solid var(--control-border); border-radius: 12px;
    font-size: .75rem; box-shadow: var(--shadow);
  }
  .mobile-location-control svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .mobile-location-control:disabled { color: var(--muted); }
  body:has(#legendPanel:not([hidden]),#layersTray:not([hidden]),#mapDetailsPanel:not([hidden])) .mobile-location-control { display: none !important; }
  .compare-overview { display: grid; gap: 12px; margin-bottom: 16px; }
  .compare-full-details > summary { display: block; min-height: 44px; padding: 12px; background: var(--panel-2); border: 1px solid var(--control-border); border-radius: var(--explorer-radius); color: var(--text); font-size: .875rem; }
  .compare-full-details > summary::before { content: '▸'; display: inline-block; margin-right: 8px; }
  .compare-full-details[open] > summary::before { content: '▾'; }
  .compare-full-details > summary::-webkit-details-marker { display: none; }
  .comparison-card-heading { flex-wrap: wrap; }
  .comparison-card-heading .button { margin-left: auto; }
}

/* Five-station comparison board. Keep the same visible controls at every size. */
body #comparePanel.compare-sheet { width: min(1480px,calc(100vw - 48px)); z-index: 2400; }
body:has(#comparePanel:not([hidden])) .compare-launcher { display: none; }
#comparePanel .embedded-compare { margin: 0; padding: 0; border: 0; box-shadow: none; }
#comparePanel .compare-head { align-items: center; margin-bottom: 16px; }
#comparePanel .compare-head h3 { margin: 0; font-size: 1rem; }
#comparePanel .compare-count { border: 0; background: none; padding: 0; font-size: .875rem; color: var(--text); }
.compare-capacity-wrap { display: grid; gap: 6px; }
.compare-capacity { display: flex; gap: 4px; }
.compare-capacity span { height: 4px; width: 22px; border-radius: 2px; background: var(--border); }
.compare-capacity .filled { background: var(--accent); }
#comparePanel .compare-selection-chip { display: none; }
#comparePanel:has(#compareOverview:not([hidden])) .compare-selection { min-height: 0; margin: 0; }
#comparePanel:has(#compareOverview:not([hidden])) .compare-head > div:first-child > p { display: none; }
#comparePanel .comparison-energy { margin: 0 0 20px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); }
#comparePanel .calculator-head h3 { font-size: .9375rem; }
#comparePanel .calculator-head p { font-size: .8125rem; line-height: 1.5; }
#comparePanel .calculator-head > strong { font-size: 1rem; white-space: nowrap; }
#comparePanel .calculator-controls { grid-template-columns: repeat(5,minmax(0,1fr)); }
#comparePanel .calculator-controls input, #comparePanel .calculator-controls select { min-height: 44px; width: 100%; font-size: 1rem; }
#comparePanel .compare-overview { display: grid; grid-template-columns: repeat(var(--comparison-count,1),minmax(0,1fr)); gap: 12px; margin: 0 0 20px; }
#comparePanel .compare-overview[hidden] { display: none; }
#comparePanel .compare-overview-note { grid-column: 1 / -1; }
#comparePanel .comparison-card { display: grid; grid-template-rows: auto auto 1fr auto; padding: 14px; border-top: 2px solid var(--accent); }
#comparePanel .comparison-card-heading { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 8px; align-content: start; min-height: 140px; }
#comparePanel .comparison-card-heading h3, #comparePanel .comparison-locality { grid-column: 1 / -1; }
.comparison-number { align-self: center; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; letter-spacing: .12em; }
#comparePanel .comparison-remove { width: 44px; height: 44px; padding: 0; font-size: 1.375rem; background: none; }
.comparison-locality { margin: 0; color: var(--muted); font-size: .8125rem; line-height: 1.4; overflow-wrap: anywhere; }
#comparePanel .comparison-prices { margin-top: 16px; }
#comparePanel .comparison-prices .vehicle-price-label { min-height: 38px; font-size: .6875rem; }
#comparePanel .comparison-prices .seven-readout { font-size: 1.625rem; }
#comparePanel .comparison-prices .seven-readout-long { font-size: 1.125rem; }
#comparePanel .comparison-card-facts { padding: 16px 0; border-top: 1px solid var(--border); align-content: start; }
.comparison-cost { border-top: 1px solid var(--border); padding-top: 14px; }
.comparison-cost > span, .comparison-cost > small { display: block; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.comparison-cost > strong { display: block; margin: 6px 0; color: var(--text); font-size: 1.25rem; overflow-wrap: anywhere; }
#comparePanel .compare-full-details > summary { display: block; min-height: 44px; padding: 12px; background: var(--panel-2); border: 1px solid var(--control-border); border-radius: var(--explorer-radius); font-size: .875rem; cursor: pointer; }
#comparePanel .compare-full-details > summary::before { content: '▸'; margin-right: 8px; }
#comparePanel .compare-full-details[open] > summary::before { content: '▾'; }
#comparePanel .compare-full-details > summary::-webkit-details-marker { display: none; }
#comparePanel .compare-table-wrap { background: var(--panel); }
#comparePanel .calculator-results { margin-top: 20px; }
#comparePanel .compare-limit-message { display: block; margin: 0 0 16px; font-size: .875rem; }
@media (min-width: 821px) {
  body #comparePanel.compare-sheet { width: min(1480px,calc(100vw - var(--sidebar-width) - 32px)); left: calc(50% + var(--sidebar-width) / 2); }
  #comparePanel .comparison-energy { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: center; gap: 20px; }
  #comparePanel .calculator-head { flex-wrap: wrap; }
  #comparePanel .calculator-controls { margin-top: 0; grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (min-width: 821px) and (max-width: 1199px) {
  #comparePanel .compare-overview { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  body #comparePanel.compare-sheet { width: auto; }
  #comparePanel .compare-head { gap: 8px; }
  #comparePanel .compare-head-actions { flex: 1; justify-content: space-between; }
  #comparePanel .compare-head > div:first-child > h3 { display: none; }
  #comparePanel .calculator-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #comparePanel .calculator-head { flex-wrap: wrap; gap: 8px; }
  #comparePanel .calculator-head p { display: none; }
  #comparePanel .compare-overview { grid-template-columns: 1fr; }
  #comparePanel .comparison-card-heading { min-height: 0; }
  #comparePanel .comparison-prices .seven-readout { font-size: 2rem; }
  #comparePanel .comparison-prices .seven-readout-long { font-size: 1.25rem; }
}

/* Reference-sized map navigation and black explorer scrollbars. */
.map-station-labels { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.map-station-label { position: absolute; width: 180px; height: 42px; padding: 4px 7px; background: #000e; border: 1px solid #454545; border-radius: 5px; font-size: 11px; line-height: 16px; color: #fff; }
.map-station-label > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-station-label small { color: #ff3a3a; font-size: 11px; white-space: nowrap; }
.map-label-setting { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: .8125rem; }
.map-label-help { color: var(--muted); font-size: .75rem; line-height: 1.5; margin: 0 0 12px; }
body .maplibregl-popup.station-hover-popup { max-width: min(320px,calc(100vw - 32px)) !important; z-index: 3; }
body .station-hover-popup .maplibregl-popup-content { pointer-events: none; }
.station-hover-popup .map-station-preview { width: 280px; max-width: calc(100vw - 54px); }
.map-preview-name { display: block; font-size: .875rem; line-height: 1.4; overflow-wrap: anywhere; }
.map-preview-location { margin-top: 4px; color: var(--muted); font-size: .75rem; }
.map-preview-prices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 12px 0; }
.map-preview-prices .vehicle-price-label { font-size: .6875rem; }
.map-preview-prices .seven-readout { font-size: 1.5rem; }
.map-preview-prices .seven-readout-long { font-size: 1rem; }
.map-preview-prices:has(.seven-readout-long) { grid-template-columns: 1fr; }
.map-preview-prices .vehicle-price strong { overflow-wrap: anywhere; font-size: .75rem; }
.map-preview-prices .vehicle-price-unit { font-size: .6875rem; }
.map-preview-facts { display: flex; gap: 5px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 8px; }
.map-preview-facts > span { padding: 2px 5px; border: 1px solid var(--border); border-radius: 5px; font-size: .6875rem; }
.map-preview-caption,.map-preview-distance { display: block; margin-top: 8px; color: var(--muted); font-size: .6875rem; }
.map-station-picker { position: absolute; z-index: 1850; top: max(100px,calc(var(--search-dock-reserved) + 16px)); right: 64px; width: 360px; max-width: calc(100vw - 80px); max-height: calc(100dvh - 160px); display: flex; flex-direction: column; padding: 14px; border: 1px solid var(--control-border); border-radius: 12px; background: #000; box-shadow: var(--shadow); }
.map-station-picker[hidden] { display: none; }
.map-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.map-picker-head h2 { margin: 0; font-size: 1rem; }
.map-picker-head .button { min-width: 44px; min-height: 44px; }
.map-station-picker > p { font-size: .8125rem; line-height: 1.5; }
.map-picker-choices { overflow: auto; min-height: 0; scrollbar-color: #4a4a4a #000; scrollbar-width: thin; }
.map-station-choice { display: block; width: 100%; min-height: 44px; text-align: left; padding: 12px; margin: 0 0 8px; border: 1px solid var(--control-border); border-radius: 8px; background: #0b0b0b; color: var(--text); font: inherit; }
.map-station-choice:hover { border-color: var(--accent); }
.map-station-choice:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.map-choice-name { display: block; font-weight: 600; font-size: .875rem; overflow-wrap: anywhere; }
.map-station-choice > .muted,.map-choice-access { display: block; font-size: .75rem; margin-top: 5px; overflow-wrap: anywhere; }
.map-first-app .maplibregl-ctrl-bottom-left { left: 20px; bottom: 110px; }
.map-first-app .maplibregl-ctrl-scale { background: transparent; color: #ddd; border-color: #aaa; font-size: .75rem; padding: 2px 5px; margin: 0; text-shadow: 0 1px 2px #000; }
body.map-first-app:is([data-basemap-style='light'],[data-basemap-style='threeD'],[data-basemap-style='liberty']) .maplibregl-ctrl-scale { color: #222; border-color: #444; text-shadow: 0 1px 2px #fff; }
@media(max-width:820px) {
  .map-station-picker { position: fixed; left: 8px; right: 8px; top: auto; bottom: var(--mobile-sheet-bottom); width: auto; max-width: none; max-height: var(--mobile-sheet-max); z-index: 2300; }
  .map-first-app .maplibregl-ctrl-bottom-left { left: 12px; bottom: calc(var(--mobile-sheet-bottom) + 8px); }
  body:not(.results-collapsed) .maplibregl-ctrl-bottom-left,body:is(.detail-open,.filters-open,.mobile-secondary-open) .maplibregl-ctrl-bottom-left { visibility: hidden; }
  .map-first-app .maplibregl-ctrl-scale { position: fixed; left: 12px; bottom: calc(var(--mobile-sheet-bottom) + 8px); }
}
.compare-add-controls { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.compare-add-controls .button { min-height: 44px; }
.compare-add-controls > span { color: var(--muted); font-size: .8125rem; }
.compare-add-panel { margin-bottom: 16px; padding: 12px; border: 1px solid var(--control-border); border-radius: 10px; background: #000; }
.compare-add-heading { display: flex; gap: 8px; align-items: end; }
.compare-add-heading .field { flex: 1; min-width: 0; }
.compare-add-heading input { min-height: 44px; width: 100%; font-size: 1rem; }
.compare-add-heading .button { min-width: 44px; min-height: 44px; }
#compareSuggestions { position: static; max-height: min(330px,45dvh); box-shadow: none; }
#compareSearchHint,#compareSearchStatus,#compareAddFeedback { font-size: .8125rem; line-height: 1.5; }
.suggestion-facts { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.suggestion-price { display: grid; gap: 3px; }
.suggestion-price .seven-readout { font-size: 1rem; }
.suggestion-price .seven-readout-long { font-size: .8125rem; }
.suggestion-price .sign-readable-label { font-size: .75rem; }
.suggestion-charging { color: var(--muted); font-size: .75rem; }
.estimate-unavailable { display: block; margin-top: 4px; color: var(--muted); }
#comparePanel .calculator-controls { grid-template-columns: repeat(3,minmax(0,1fr)); }
.mobile-action-label { display: none; }
#compareAddToggle { min-height: 44px; white-space: nowrap; }
@media (max-width: 820px) {
  #comparePanel .calculator-controls { grid-template-columns: minmax(125px,1.25fr) minmax(0,1fr) minmax(0,.85fr); align-items: end; }
  .desktop-action-label { display: none; }
  .mobile-action-label { display: inline; }
  #comparePanel .compare-head-actions { gap: 6px; }
  #comparePanel .compare-head-actions .button { padding: 7px 9px; font-size: .8125rem; }
  #comparePanel .compare-capacity span { width: 15px; }
}
@media (max-width: 360px) { #comparePanel .calculator-controls { grid-template-columns: repeat(2,minmax(0,1fr)); } }
.map-navigation { position: absolute; right: 16px; bottom: 48px; z-index: 1800; display: grid; gap: 2px; width: 32px; }
.map-navigation .sidebar-button { display: grid; place-items: center; width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 0; border: 1px solid var(--control-border); border-radius: 4px; background: #000; color: var(--text); box-shadow: 0 2px 5px #0006; }
.map-navigation .sidebar-button > span { display: none; }
.map-navigation .sidebar-button svg { width: 20px; height: 20px; margin: 0; }
.map-navigation .sidebar-button:hover { background: #171717; }
.map-navigation .sidebar-button:disabled { opacity: .5; }
.map-first-app #locateMe[aria-pressed='true'], .map-first-app #mobileLocate[aria-pressed='true'] {
  color: #8dc8ff; border-color: #8dc8ff; box-shadow: inset 0 0 0 1px #8dc8ff55;
}
.map-navigation .sidebar-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.map-zoom-controls { overflow: visible; border-radius: 4px; }
.map-zoom-controls #sidebarZoomIn { border-radius: 4px 4px 0 0; }
.map-zoom-controls #sidebarZoomOut { border-radius: 0 0 4px 4px; border-top: 0; }
body .compare-launcher { min-height: 44px; padding: 8px 16px; gap: 10px; font-size: .875rem; font-weight: 600; border: 1px solid var(--control-border); border-radius: 10px; background: #000; color: var(--text); box-shadow: 0 3px 12px #0006; bottom: 20px; }
body .compare-launcher span { min-width: 24px; height: 24px; font-size: .8125rem; }
.map-first-app :is(#results,#resultsPanel,#detailBody,.sheet-scroll,.app-menu-drawer,#mapDetailsPanel,.compare-table-wrap,.raw-json,.schedule-wrap) { scrollbar-width: thin; scrollbar-color: #4a4a4a #000; }
.map-first-app ::-webkit-scrollbar { width: 8px; height: 8px; background: #000; }
.map-first-app ::-webkit-scrollbar-track { background: #000; }
.map-first-app ::-webkit-scrollbar-thumb { background: #4a4a4a; border: 2px solid #000; border-radius: 8px; }
.map-first-app ::-webkit-scrollbar-thumb:hover { background: #686868; }
.map-first-app ::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.map-first-app ::-webkit-scrollbar-corner { background: #000; }
@media (min-width: 821px) {
  body .maplibregl-ctrl-bottom-right { right: 16px; bottom: 14px; }
  .map-first-app .map-attribution-control { margin: 0; min-height: 32px; height: 32px; border-radius: 4px; background: #000; border-color: var(--control-border); }
  .map-first-app .map-attribution-control.collapsed { width: 32px; max-width: 32px; }
  .map-first-app .map-attribution-toggle { flex: 0 0 30px; width: 30px; height: 30px; font-size: .875rem; }
}
@media (max-width: 820px) {
  .map-navigation { display: none; }
}
@media (forced-colors: active) {
  .map-first-app :is(#results,#resultsPanel,#detailBody,.sheet-scroll,.app-menu-drawer,#mapDetailsPanel,.compare-table-wrap,.raw-json,.schedule-wrap) { scrollbar-color: auto; }
}

/* Phone map: one count summary and a reachable action dock. Shared dynamic
   viewport and safe-area reserves follow Safari's expanding/collapsing toolbar. */
@media (max-width: 820px) {
  body.map-first-app, body.map-first-app.sidebar-hidden {
    --search-dock-left: max(12px, env(safe-area-inset-left));
    --search-dock-height: 52px;
    --search-dock-reserved: calc(72px + env(safe-area-inset-top));
    --mobile-nav-height: calc(60px + env(safe-area-inset-bottom));
  }
  body.map-first-app.has-active-filter-chips { --search-dock-reserved: calc(124px + env(safe-area-inset-top)); }
  body.map-first-app .map-search-dock { right: max(12px, env(safe-area-inset-right)); }
  body.map-first-app .persistent-map-search { border-radius: 16px; background: #000; }
  body.map-first-app .area-results-card {
    top: calc(var(--search-dock-top) + var(--search-dock-height) + 8px);
    left: var(--search-dock-left); right: max(12px, env(safe-area-inset-right));
    width: auto; max-width: none; min-height: 56px; padding: 9px 12px;
    gap: 10px; border-radius: 12px; background: #000;
  }
  body.map-first-app.has-active-filter-chips .area-results-card { top: calc(var(--search-dock-top) + var(--search-dock-height) + 52px); }
  .area-results-copy { gap: 3px; }
  .area-results-copy strong { font-size: .875rem; line-height: 1.35; }
  .area-results-copy small { font-size: .75rem; line-height: 1.4; }
  .area-results-count strong { font-size: 1.125rem; font-variant-numeric: tabular-nums; }
  .area-results-count small { font-size: .625rem; }
  .mobile-nav { gap: 4px; padding-top: 2px; background: #000; border-color: #303030; }
  .mobile-nav button { position: relative; min-height: 48px; gap: 3px; border-radius: 0; font-size: .75rem; }
  .mobile-nav button.active { background: transparent; box-shadow: none; }
  .mobile-nav button.active::after {
    content: ''; position: absolute; bottom: 0; left: calc(50% - 12px);
    width: 24px; height: 2px; border-radius: 2px; background: #FF3A3A;
  }
  .mobile-nav button.active svg { color: #FF3A3A; }
  body.results-collapsed:not(.detail-open):not(.filters-open):not(.app-menu-open):not(.mobile-secondary-open) .mobile-location-control {
    width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 10px;
    bottom: var(--mobile-sheet-bottom); border-radius: 50%; background: #000;
  }
  .mobile-location-control span {
    position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
  .mobile-location-control svg { width: 22px; height: 22px; flex-shrink: 0; }
  .mobile-location-control[aria-busy="true"] { border-color: #FF3A3A; }
  .mobile-location-control[aria-busy="true"] svg { animation: mobile-locate-pulse 1s ease-in-out infinite alternate; }
  .map-first-app .maplibregl-ctrl-scale { border-color: #888; font-size: .6875rem; border-width: 0 1px 1px; padding: 2px 4px; }
}
@keyframes mobile-locate-pulse { to { opacity: .4; } }

/* Map notices share one scrollable region, clear of controls and open sheets. */
.map-status-stack { position: absolute; top: 12px; right: 12px; z-index: 5; display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: min(310px,calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto; overscroll-behavior: contain; border-radius: 8px; }
.map-status-stack[hidden] { display: none; }
#mapStatusStack > [hidden] { display: none !important; }
#mapStatusStack > .map-feedback, #mapStatusStack > .catalog-background-status, #mapStatusStack > .share-view-notice { position: static; top: auto; right: auto; bottom: auto; left: auto; width: auto; max-width: none; margin: 0; flex-shrink: 0; pointer-events: auto; transform: none; }
#mapStatusStack .catalog-background-status[data-state='loading'] { display: flex; align-items: center; gap: 8px; align-self: flex-end; padding: 6px 10px; font-size: .6875rem; box-shadow: none; }
#mapStatusStack .catalog-background-status[data-state='loading']::before { content: ''; width: 10px; height: 10px; flex: 0 0 10px; border: 1.5px solid #555; border-top-color: #ddd; border-radius: 50%; animation: map-status-spin 1s linear infinite; }
#mapStatusStack .catalog-background-status[data-state='loading'] button[hidden] { display: none; }
@keyframes map-status-spin { to { transform: rotate(360deg); } }
@media(max-width:820px) {
  .map-status-stack { top: auto; right: 12px; left: 12px; width: auto; bottom: calc(var(--mobile-sheet-bottom) + 116px); }
  #mapStatusStack button { min-height: 44px; }
}
@media(prefers-reduced-motion:reduce) { #mapStatusStack .catalog-background-status[data-state='loading']::before { animation: none; } }
@media (prefers-reduced-motion: reduce) { .mobile-location-control[aria-busy="true"] svg { animation: none; } }

/* A lightweight, non-modal map selection; the full sheet opens on request. */
.phone-station-preview { display: none; }
.captured-free { font-size: 1.15rem; font-weight: 750; line-height: 1.3; }
.tesla-sign .captured-free { color: #FF3A3A; }
.non-tesla-sign .captured-free { color: #39E87D; }
#detailDialog .pricing-now .captured-free, #detailDialog .non-tesla-sign .captured-free { font-size: 1.5rem; line-height: 1.3; }
.updates-view-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.updates-view-switch .button { min-height: 44px; }
.updates-view-switch [aria-pressed="true"] { border-color: #FF3A3A; background: #200707; }
.import-change-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.import-change-controls label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.import-change-controls select { width: 100%; min-width: 0; min-height: 44px; }
.import-changes-list { display: grid; gap: 12px; margin: 14px 0; }
.import-change-row { min-width: 0; border: 1px solid #444; border-radius: 10px; padding: 14px; overflow-wrap: anywhere; background: #000; }
.import-change-row h3 { margin: 0 0 8px; font-size: 1rem; }
.import-field-change { border-top: 1px solid #333; margin: 10px 0; padding-top: 10px; }
.import-field-change summary { min-height: 32px; cursor: pointer; }
.import-before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.import-before-after > div { min-width: 0; padding: 10px; border: 1px solid #333; border-radius: 6px; }
.import-before-after p { white-space: pre-line; line-height: 1.55; font-size: .8125rem; }
.source-name-list { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 8px 12px; font-size: .875rem; }
.source-name-list dd { margin: 0; overflow-wrap: anywhere; }
@media(max-width:540px){.import-change-controls,.import-before-after { grid-template-columns: 1fr; } .import-field-change summary { min-height: 44px; } .source-name-list { grid-template-columns: 1fr; } }
.return-map-view { position: fixed; z-index: 1350; top: calc(var(--search-dock-reserved) + 88px); left: var(--search-dock-left); min-height: 44px; padding: 8px 12px; gap: 8px; background: #000; border: 1px solid #555; border-radius: 10px; font-size: .8125rem; box-shadow: var(--shadow); }
.return-map-view[hidden], body.detail-open .return-map-view, body.filters-open .return-map-view, body.mobile-secondary-open .return-map-view, body.app-menu-open .return-map-view { display: none; }
@media(min-width:821px) { body:not(.results-collapsed) .return-map-view { left: calc(var(--sidebar-width) + var(--results-width) + 16px); top: 12px; } }
@media(max-width:820px), (pointer:coarse) {
  .phone-station-preview:not([hidden]) { display: flex; flex-direction: column; position: fixed; left: max(12px,env(safe-area-inset-left)); right: max(12px,env(safe-area-inset-right)); bottom: var(--mobile-sheet-bottom); z-index: 2200; max-height: min(356px,calc(100dvh - var(--search-dock-reserved) - var(--mobile-sheet-bottom) - 16px)); background: #000; border: 1px solid #555; border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
  .phone-preview-header { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 14px; flex-shrink: 0; min-height: 44px; color: var(--muted); font-size: .75rem; }
  .phone-preview-header button { min-width: 44px; min-height: 44px; font-size: 1.25rem; border: none; }
  .phone-preview-content { padding: 0 14px 12px; overflow: auto; overscroll-behavior: contain; min-height: 0; }
  .phone-preview-content .map-preview-name { font-size: 1rem; line-height: 1.35; }
  .phone-preview-content .map-preview-prices { margin: 10px 0; }
  .phone-preview-content .map-preview-caption { margin-top: 6px; }
  .phone-preview-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); flex-shrink: 0; }
  .phone-preview-actions .button { min-height: 44px; font-size: .875rem; text-align: center; display: flex; align-items: center; justify-content: center; }
  body.phone-preview-open #resultsCollapsedTab, body.phone-preview-open .mobile-location-control, body.phone-preview-open .area-results-card, body.phone-preview-open .return-map-view { display: none !important; }
}

/* Wide touch windows retain the map rail, with deliberate finger-sized controls.
   Fine-pointer desktop geometry stays compact. No device or browser sniffing. */
body[data-basemap-style='dark'] .map-shell > #map { background:#000; }
.result-hardware, .preview-hardware { display:flex; flex-wrap:wrap; gap:5px; margin-top:8px; }
.hardware-badge { display:inline-flex; flex-wrap:wrap; align-items:center; gap:5px; border:1px solid #555; border-radius:5px; padding:4px 6px; font-size:.6875rem; color:#eee; background:#000; line-height:1.4; }
.hardware-status { color:#bcbcbc; font-weight:400; }
.hardware-unknown { color:#bcbcbc; border-color:#333; }
.hardware-details { margin:16px 0; padding:14px; border:1px solid #444; border-radius:10px; background:#000; overflow-wrap:anywhere; }
.hardware-details h3 { font-size:1rem; margin:0 0 8px; }
.hardware-explanation { color:#bcbcbc; font-size:.8125rem; line-height:1.5; }
.hardware-components { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.hardware-components article { min-width:0; border-top:1px solid #333; padding-top:10px; }
.hardware-components h4 { margin:0 0 6px; font-size:.875rem; }
.hardware-components strong { font-size:.875rem; }
.hardware-components p { font-size:.8125rem; line-height:1.5; margin:8px 0; }
.hardware-components small { display:block; font-size:.75rem; color:#bcbcbc; margin-top:6px; line-height:1.5; }
.hardware-details a { color:#eee; text-decoration:underline; display:inline-flex; align-items:center; min-height:44px; }
.hardware-warning { color:#ffd18a; }
@media(max-width:540px) { .hardware-components { grid-template-columns:1fr; } }
@media (min-width:821px) and (pointer:coarse) {
  .map-navigation { width:48px; bottom:72px; gap:8px; }
  .map-navigation .sidebar-button { width:48px; min-width:48px; height:48px; min-height:48px; border-radius:8px; }
  .map-navigation .sidebar-button svg { width:24px; height:24px; }
  .map-zoom-controls { display:grid; gap:8px; }
  .map-zoom-controls #sidebarZoomIn, .map-zoom-controls #sidebarZoomOut { border:1px solid var(--control-border); border-radius:8px; }
  .map-first-app .map-attribution-control { min-height:48px; height:48px; border-radius:8px; }
  .map-first-app .map-attribution-control.collapsed { width:48px; max-width:48px; }
  .map-first-app .map-attribution-toggle { flex-basis:46px; width:46px; height:46px; }
  .map-sidebar { gap:4px; overflow-y:auto; }
  .map-sidebar > .sidebar-button { flex-shrink:0; min-width:48px; }
  .map-sidebar > .sidebar-button:not(.sidebar-map-action) { min-height:60px; margin-bottom:0; gap:5px; }
  .map-search-box .map-search-submit, .map-search-clear { width:48px; height:48px; flex-basis:48px; }
  .phone-station-preview:not([hidden]) {
    left:calc(var(--sidebar-width) + 112px); right:auto; bottom:20px;
    width:420px; max-width:calc(100vw - var(--sidebar-width) - 200px);
    max-height:min(420px,calc(100dvh - 120px));
  }
  .phone-preview-header { min-height:48px; }
  .phone-preview-header button, .phone-preview-actions .button { min-height:48px; min-width:48px; }
  .map-status-stack { top:auto; }
  #mapStatusStack button { min-height:48px; }
}

/* Short landscape windows put search and map counts beside each other. */
@media (min-width:600px) and (max-width:820px) and (max-height:640px) and (orientation:landscape) {
  body.map-first-app, body.map-first-app.sidebar-hidden {
    --search-dock-height:48px;
    --search-dock-reserved:calc(68px + env(safe-area-inset-top));
  }
  body.map-first-app.has-active-filter-chips { --search-dock-reserved:calc(112px + env(safe-area-inset-top)); }
  body.map-first-app .map-search-dock { right:calc(42% + 16px); }
  body.map-first-app .area-results-card, body.map-first-app.has-active-filter-chips .area-results-card {
    top:var(--search-dock-top); left:58%; right:max(12px,env(safe-area-inset-right));
    min-height:48px; padding:6px 10px; gap:8px;
  }
  .area-results-copy strong { font-size:.8125rem; }
  .area-results-copy small { font-size:.6875rem; }
  .area-results-count small { display:none; }
  body.results-collapsed:not(.detail-open):not(.filters-open):not(.app-menu-open):not(.mobile-secondary-open) .mobile-location-control { bottom:var(--mobile-sheet-bottom); width:48px; height:48px; }
  .phone-station-preview:not([hidden]) { right:auto; width:420px; max-width:calc(100vw - 24px); }
  .return-map-view { top:calc(var(--search-dock-reserved) + 8px); }
}
