:root {
  --bg: #0f1419;
  --panel: #1a222d;
  --border: #2d3a4a;
  --text: #e8eef4;
  --muted: #8b9cb3;
  --accent: #3db88a;
  --accent-dim: #2a8f6a;
  --danger: #e07a7a;
  --map-h: 100vh;
}
* { box-sizing: border-box; }
html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
html, body { height: 100%; margin: 0; font-family: "DM Sans", system-ui, sans-serif; background: var(--bg); color: var(--text); }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 3000;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
a { color: var(--accent); }
a:hover { text-decoration: underline; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 1.1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.site-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  min-width: 0;
  flex-shrink: 1;
}
.site-header .brand:hover { text-decoration: none; opacity: 0.92; }
.site-header .brand img {
  display: block;
  /* SVG viewBox 248×36 — max-width must allow full width at this height or the browser scales both axes down */
  height: 34px;
  width: auto;
  max-width: min(236px, calc(100vw - 11rem));
  object-fit: contain;
  flex-shrink: 0;
}
.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  font-size: 0.88rem;
  min-width: 0;
  flex-shrink: 0;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
}
.site-nav a:hover { color: var(--accent); background: rgba(61, 184, 138, 0.08); }
.site-nav a[aria-current="page"] {
  color: var(--accent);
  background: rgba(61, 184, 138, 0.12);
}
.site-nav a.nav-github {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.site-nav .nav-github-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  vertical-align: middle;
}

.site-footer {
  flex-shrink: 0;
  padding: 0.25rem 0.75rem;
  padding-bottom: calc(0.25rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--panel);
  text-align: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.site-footer p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--muted);
  word-break: break-word;
}
.site-footer-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.site-footer-sep {
  margin: 0 0.15rem;
  color: var(--border);
  user-select: none;
}
.site-footer a {
  color: var(--text);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.site-footer-legal a {
  color: var(--muted);
}
.site-footer-legal a:hover {
  color: var(--accent);
}

/* Prose pages (About, API, Privacy, Terms): header/footer stay visible; main scrolls */
body:has(> main.prose) {
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
body:has(> main.prose) > .site-header {
  flex-shrink: 0;
  background: var(--panel);
}
body:has(> main.prose) > main.prose {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body:has(> main.prose) > .site-footer {
  flex-shrink: 0;
}

/* Home map page: landmark wrapper (Lighthouse / a11y) */
.app-main {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.app-main > .app {
  flex: 1 1 0;
  min-height: 0;
}
.app {
  display: grid;
  grid-template-columns: minmax(min(100%, 300px), 400px) minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.app > .sidebar,
.app > #map {
  min-width: 0;
  max-width: 100%;
}
@media (max-width: 900px) {
  .site-header {
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
    padding: 0.45rem max(0.5rem, env(safe-area-inset-left)) 0.45rem max(0.5rem, env(safe-area-inset-right));
    min-width: 0;
  }
  .site-header .brand {
    min-width: 0;
  }
  .site-header .brand img {
    height: 28px;
    max-width: min(200px, calc(100vw - 11rem));
  }
  .site-nav {
    font-size: 0.72rem;
    flex: 1 1 auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0.08rem;
    min-width: 0;
    max-width: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar {
    display: none;
  }
  .site-nav a {
    padding: 0.26rem 0.34rem;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .site-nav a.nav-github {
    position: relative;
    gap: 0;
    padding: 0.28rem 0.45rem;
  }
  .site-nav a.nav-github span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .site-footer {
    padding: 0.2rem 0.55rem;
    padding-bottom: calc(0.2rem + env(safe-area-inset-bottom, 0px));
  }
  .site-footer p {
    font-size: 0.7rem;
    line-height: 1.25;
  }
  .app {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
  }
  /* Collapsed: compact chrome + full-height map. Expanded (body.mobile-list-open): full-height list, map hidden. */
  body:not(.mobile-list-open) .sidebar {
    flex: 0 1 auto;
    max-height: min(46dvh, 520px);
  }
  body.mobile-list-open .sidebar {
    flex: 1 1 0;
    max-height: none;
    min-height: 0;
  }
  .sidebar {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    position: relative;
    z-index: 1002;
  }
  #map {
    flex: 1 1 0;
    min-height: min(180px, 28dvh);
    z-index: 1;
  }
  body.mobile-list-open #map {
    flex: 0 0 0 !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    visibility: hidden;
    pointer-events: none;
    border: none;
  }
  .filters-wrap[open] .filters {
    max-height: none;
    overflow: visible;
  }
  .mobile-list-drawer {
    flex-shrink: 0;
  }
  .mobile-list-drawer[open] {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .mobile-list-drawer[open] > summary {
    flex-shrink: 0;
  }
  .mobile-list-drawer[open] .list-wrap {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-list-drawer:not([open]) .list-wrap {
    /* content hidden by <details> */
    min-height: 0;
  }
  body:not(.mobile-list-open) .list-wrap {
    flex: 0 0 auto;
    min-height: 0;
  }
  /* Tighter intro on small screens so the provider list appears sooner while scrolling */
  .sidebar .intro {
    padding: 0.65rem 1rem 0.45rem;
  }
  .sidebar .intro h1 {
    font-size: 1.08rem;
    margin-bottom: 0.28rem;
  }
  .sidebar .intro .sub {
    font-size: 0.76rem;
    line-height: 1.4;
  }
  .sidebar .intro .sub + .sub {
    margin-top: 0.45rem;
  }
}
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-x: hidden;
}

@media (min-width: 901px) {
  .site-header .brand {
    flex-shrink: 0;
  }
  .sidebar {
    overflow-y: hidden;
    z-index: 500;
  }
  .mobile-list-drawer {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-bottom: none;
  }
  .mobile-list-drawer > summary {
    display: none !important;
  }
  .mobile-list-drawer .list-wrap {
    flex: 1 1 0;
    min-height: 0;
  }
  .filters-wrap[open] .filters {
    max-height: min(46vh, 380px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.sidebar .intro {
  padding: 0.85rem 1.1rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.sidebar .intro h1 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}
.sidebar .intro .sub {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}
.sidebar .intro .sub + .sub {
  margin-top: 0.55rem;
}
.sidebar .intro time {
  font-weight: 500;
  color: var(--text);
}

/* Welcome: one paragraph; narrow screens hide tail + inline More; Less sits after full text */
.intro-welcome-p {
  margin: 0;
}
.intro-welcome-tail {
  display: inline;
}
.intro-welcome-toggle {
  display: none;
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  cursor: pointer;
  vertical-align: baseline;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
}
/* JS sets html.intro-narrow from innerWidth so collapse matches Brave iOS / dynamic viewports. */
html.intro-narrow .intro-welcome-p:not(.intro-welcome--expanded) .intro-welcome-tail {
  display: none !important;
}
html.intro-narrow .intro-welcome-toggle {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  min-height: 44px;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  box-sizing: border-box;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
.intro-welcome-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
@media (min-width: 901px) {
  .intro-welcome-tail {
    display: inline !important;
  }
  html:not(.intro-narrow) .intro-welcome-toggle {
    display: none !important;
  }
}

.filters-wrap {
  border-bottom: 1px solid var(--border);
}
.filters-wrap > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.65rem 1.1rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  user-select: none;
}
.filters-wrap > summary::-webkit-details-marker { display: none; }
.filters-wrap > summary::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.filters-wrap[open] > summary::after {
  transform: rotate(-135deg);
  margin-top: 0.2rem;
}
.filters-wrap > summary:hover { color: var(--text); }
.favorites-accordion-body {
  padding: 0 1.1rem 0.85rem;
}
/* Desktop sidebar does not scroll; cap favorites height so list is scrollable */
@media (min-width: 901px) {
  .favorites-accordion[open] .favorites-accordion-body {
    max-height: min(42vh, 22rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}
.favorites-empty {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
}
.favorites-accordion-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.favorites-accordion-item {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg);
}
.favorites-accordion-row {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}
.favorites-accordion-row:hover {
  background: rgba(255, 255, 255, 0.04);
}
.favorites-accordion-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.favorites-accordion-meta {
  flex-shrink: 0;
  font-size: 0.72rem;
}
.favorites-accordion-remove {
  flex-shrink: 0;
  width: 2rem;
  border: none;
  border-left: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.favorites-accordion-remove:hover {
  color: var(--accent);
  background: var(--bg);
}
.favorites-summary-text {
  min-width: 0;
}
.favorites-accordion-count {
  font-weight: 500;
  color: var(--muted);
}
.filters {
  padding: 0 1.1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.82rem;
}
.filters label:not(.inline) {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 0.25rem;
}
.filters input[type="search"] {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.filters fieldset.filter-fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 0;
  padding: 0.5rem 0.6rem 0.55rem;
}
.filters fieldset.filter-fieldset legend {
  padding: 0 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.radio-col { display: flex; flex-direction: column; gap: 0.35rem; }
.radio-col label.inline { font-size: 0.8rem; }
.radio-col input { accent-color: var(--accent); }
.checks { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.checks label.inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
}
.checks input { accent-color: var(--accent); }
.addr-row { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: stretch; }
.addr-row input[type="text"] {
  flex: 1;
  min-width: 140px;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }
.btn-row button, .addr-row button {
  font: inherit;
  font-size: 0.78rem;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.btn-row button.primary, .addr-row button.primary {
  background: rgba(61, 184, 138, 0.2);
  border-color: var(--accent-dim);
  color: var(--accent);
}
.btn-row button.danger {
  color: var(--danger);
  border-color: rgba(224, 122, 122, 0.45);
}
.btn-row button:disabled { opacity: 0.45; cursor: not-allowed; }
.geo-hint { font-size: 0.72rem; color: var(--muted); margin-top: 0.35rem; line-height: 1.35; }
.geo-error { font-size: 0.75rem; color: var(--danger); margin-top: 0.35rem; }
.max-dist-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.45rem; }
.max-dist-row input[type="number"] {
  width: 4.5rem;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
label.sort-dist.sort-off { opacity: 0.45; }
.meta-bar {
  padding: 0.45rem 1.1rem;
  font-size: 0.78rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.meta-bar button {
  font: inherit;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}
.meta-bar button:hover { border-color: var(--accent); }
.list-wrap {
  flex: 1 1 0;
  overflow: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.list { padding: 0; }
.list.vlist { padding: 0; min-width: 0; }
.list-inner {
  position: relative;
  min-width: 0;
  box-sizing: border-box;
}
.list-slice {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 0.35rem 0.5rem 1rem;
  will-change: transform;
}
.card {
  padding: 0.65rem 0.6rem;
  margin-bottom: 0.35rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.card:hover { background: rgba(61, 184, 138, 0.08); }
.card.selected {
  background: rgba(61, 184, 138, 0.15);
  border-color: var(--accent-dim);
}
.card-top {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  margin-bottom: 0.25rem;
}
.card-fav {
  flex-shrink: 0;
  margin: 0;
  padding: 0.05rem 0.15rem;
  border: none;
  background: transparent;
  color: #e8b84a;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}
.card-fav:hover { background: rgba(232, 184, 74, 0.12); }
.card-fav[aria-pressed="true"] { color: #ffd166; }
.card-top .name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.25;
  margin: 0;
}
.card .line { font-size: 0.75rem; color: var(--muted); }
.card .badge {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
}
#map {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: #1c252e;
  position: relative;
  overflow: hidden;
}
@media (min-width: 901px) {
  #map {
    height: 100%;
    min-height: 200px;
  }
}
.leaflet-container {
  max-width: 100% !important;
  width: 100% !important;
}
.leaflet-popup-content-wrapper {
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
}
.leaflet-popup-content { margin: 0; min-width: 0; max-width: min(320px, calc(100vw - 3rem)); }
.popup-inner { padding: 0.85rem 1rem 1rem; font-size: 0.85rem; line-height: 1.45; }
.popup-inner h3 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1rem;
  margin: 0 0 0.5rem;
  line-height: 1.25;
}
.popup-inner dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.65rem; font-size: 0.78rem; }
.popup-inner dt { color: var(--muted); margin: 0; }
.popup-inner dd { margin: 0; }
.popup-inner a { color: #5fd4b0; }
.popup-actions {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}
.popup-fav-btn {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  width: 100%;
}
.popup-fav-btn[aria-pressed="true"] {
  border-color: rgba(232, 184, 74, 0.5);
  color: #ffd166;
}
.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2500;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--accent-dim);
  color: var(--text);
  font-size: 0.85rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  max-width: min(90vw, 22rem);
  text-align: center;
}
.share-hint {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0 0 0.5rem;
}
.share-actions { margin-bottom: 0.35rem; }
.save-search-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: stretch;
  margin-bottom: 0.5rem;
}
.save-search-row input[type="text"] {
  flex: 1;
  min-width: 120px;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
}
.saved-searches-box { margin-top: 0.25rem; }
.saved-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: block;
  margin-bottom: 0.35rem;
}
.saved-searches-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.saved-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.saved-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.saved-actions { flex-shrink: 0; white-space: nowrap; }
button.linkish {
  font: inherit;
  font-size: inherit;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
button.linkish:hover { color: #5fd4b0; }
button.linkish.danger-text { color: var(--danger); }
button.linkish.danger-text:hover { color: #f0a0a0; }
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  flex-direction: column;
  gap: 1rem;
}
.loading-overlay.hidden { display: none; }
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.leaflet-control-layers {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border) !important;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.leaflet-control-layers-expanded {
  padding: 0.35rem 0.5rem 0.45rem;
  min-width: 11rem;
}
.leaflet-control-layers-base label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.25rem 0;
  font-size: 0.75rem;
  line-height: 1.25;
  cursor: pointer;
}
.leaflet-control-layers-base input { accent-color: var(--accent); }
.leaflet-control-layers-toggle {
  background: var(--panel);
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* About / API prose pages */
.prose {
  flex: 1 0 auto;
  max-width: min(42rem, 100%);
  margin: 0 auto;
  width: 100%;
  padding: 2rem min(1.25rem, 4vw) 3rem;
  line-height: 1.65;
  font-size: 0.95rem;
  overflow-wrap: break-word;
  word-break: break-word;
}
.prose h1 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.75rem;
  margin: 0 0 1rem;
}
.prose h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.2rem;
  margin: 1.75rem 0 0.65rem;
}
.prose p { margin: 0 0 1rem; color: var(--text); }
.prose ul { margin: 0 0 1rem; padding-left: 1.25rem; color: var(--muted); }
.prose li { margin-bottom: 0.35rem; }
.prose .muted { color: var(--muted); font-size: 0.88rem; }
