:root {
  color-scheme: light dark;
  --bg: #f5f5f4;
  --panel: #ffffff;
  --ink: #0a0a0a;
  --ink-soft: #1f1f1f;
  --muted: #6b6b6b;
  --line: #d4d4d4;
  --line-strong: #0a0a0a;
  --accent: #0a0a0a;
  --accent-soft: #2a2a2a;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --map-bg: #e7e5e1;
  --tile-filter: grayscale(0.35) contrast(1.02);
  --on-accent: #ffffff;
  --tag-bg: #f0f0ef;
  --tag-ink: #1f1f1f;
  --tag-strong-bg: #0a0a0a;
  --tag-strong-ink: #ffffff;
  --tag-outline-bg: transparent;
  --tag-outline-ink: #1f1f1f;
  --tag-outline-border: #0a0a0a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --panel: #141414;
    --ink: #f5f5f4;
    --ink-soft: #e5e5e4;
    --muted: #9a9a98;
    --line: #2a2a2a;
    --line-strong: #f5f5f4;
    --accent: #f5f5f4;
    --accent-soft: #d4d4d4;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
    --surface: #141414;
    --surface-strong: #141414;
    --map-bg: #141414;
    --tile-filter: invert(1) hue-rotate(180deg) saturate(0.3) brightness(0.85) contrast(0.95);
    --on-accent: #0a0a0a;
    --tag-bg: #1f1f1f;
    --tag-ink: #e5e5e4;
    --tag-strong-bg: #f5f5f4;
    --tag-strong-ink: #0a0a0a;
    --tag-outline-bg: transparent;
    --tag-outline-ink: #e5e5e4;
    --tag-outline-border: #f5f5f4;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
  touch-action: manipulation;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100svh;
}

.side-panel {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(430px, calc(100vw - 48px));
  min-width: 0;
  min-height: 0;
  background: var(--surface-strong);
  border-radius: 0;
  box-shadow: var(--shadow);
  opacity: 0;
  overflow: auto;
  pointer-events: none;
  transform: translateX(-100%);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  z-index: 700;
}

.filters-open .side-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

/* Scrim over the canvas while the filters panel is open. Tapping it closes
   the panel. */
.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 690;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.filters-open .panel-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 18px 16px 14px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow a {
  color: var(--ink);
  text-decoration: none;
}

h1 {
  margin: 0;
  font-size: 1.9rem;
  line-height: 0.95;
  letter-spacing: -0.01em;
}

.spot-count {
  flex: 0 0 auto;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.panel-actions {
  display: flex;
  align-items: center;
  align-self: flex-start;
  flex: 0 0 auto;
  gap: 8px;
  /* Pull the close button up into the panel's top-right corner. */
  margin: -12px -8px 0 0;
}

#filterClose {
  width: 48px;
  height: 48px;
  font-size: 2rem;
}

.filters {
  width: 100%;
  padding: 0 16px 14px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field span {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

input {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: var(--tag-bg);
  color: var(--ink);
  min-height: 44px;
  padding: 0 12px;
  outline: none;
  font-size: 1rem;
}

input:focus {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.option-chip:focus-visible,
.icon-button:focus-visible,
.filter-toggle:focus-visible,
.location-control:focus-visible,
.install-app-button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.list-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto 12px;
}

.list-search {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
}

.sort-select {
  flex: 0 0 auto;
  width: 112px;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: var(--tag-bg);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0 28px 0 10px;
}

.sort-select:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.location-control {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 0;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
}

.location-control:hover {
  background: var(--surface);
  color: var(--ink);
}

.location-control:disabled {
  opacity: 0.6;
  cursor: progress;
}

.user-location-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(10, 10, 10, 0.25), 0 4px 10px rgba(0, 0, 0, 0.25);
}

.filters-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 6px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.text-button:hover {
  color: var(--muted);
}

.text-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ink);
  border-radius: 0;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 12px;
}

.filter-group {
  align-content: start;
}

.filter-more {
  display: grid;
  gap: 14px;
}

.filter-more summary {
  list-style: none;
}

.filter-more summary::-webkit-details-marker {
  display: none;
}

.filter-more-content {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.option-chip {
  display: inline-flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 0;
  background: var(--tag-bg);
  color: var(--ink-soft);
  min-height: 36px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition:
    background-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.option-chip:hover {
  box-shadow: inset 0 0 0 2px var(--ink);
  background: var(--surface);
  color: var(--ink);
}

.option-chip.is-active:hover {
  background: var(--accent-soft);
  color: var(--on-accent);
  box-shadow: inset 0 0 0 2px var(--surface);
}

.option-chip.is-active {
  background: var(--ink);
  color: var(--on-accent);
}

.option-chip--with-icon {
  padding-left: 10px;
}

.option-chip--bike-type {
  flex-direction: column;
  gap: 3px;
  min-height: 52px;
  padding: 6px 10px;
  line-height: 1;
}

.option-chip-icon {
  display: block;
  flex: 0 0 auto;
  pointer-events: none;
}

.option-chip-icon--bike {
  width: 24px;
  height: 24px;
}

.option-chip-icon--uplift {
  width: 20px;
  height: 20px;
}

.option-chip.is-active .option-chip-icon--bike {
  filter: invert(1);
}

.option-chip--grade {
  background: var(--tag-bg);
  color: var(--chip-color);
}

.option-chip--grade:hover {
  background: var(--tag-bg);
  color: var(--chip-color);
  box-shadow: inset 0 0 0 2px var(--chip-color);
}

.option-chip--grade.is-active,
.option-chip--grade.is-active:hover {
  background: var(--chip-color);
  color: #fff;
  box-shadow: none;
}

@media (prefers-color-scheme: dark) {
  .option-chip-icon--bike {
    filter: invert(1);
  }

  .option-chip.is-active .option-chip-icon--bike {
    filter: none;
  }

  .option-chip--grade,
  .option-chip--grade:hover {
    background: #f5f5f4;
  }
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1;
}

.icon-button:hover {
  background: var(--tag-bg);
}

.disclosure-icon-button {
  grid-auto-flow: column;
  justify-content: start;
  gap: 2px;
  width: auto;
  height: 24px;
  padding: 0;
  color: var(--ink);
}

.disclosure-icon-button:hover,
.disclosure-icon-button:active {
  background: transparent;
}

.disclosure-arrow {
  display: block;
}

.disclosure-label {
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.filter-more .disclosure-label {
  color: var(--muted);
  font-size: 0.73rem;
}

.popup-more .disclosure-label {
  color: var(--ink);
  font-size: 0.7rem;
}

.disclosure-arrow--open,
.disclosure-label--open,
.filter-more[open] .disclosure-arrow--closed,
.filter-more[open] .disclosure-label--closed,
.popup-more[open] .disclosure-arrow--closed {
  display: none;
}

.filter-more[open] .disclosure-arrow--open,
.filter-more[open] .disclosure-label--open,
.popup-more[open] .disclosure-arrow--open {
  display: block;
}

.popup-more[open] .disclosure-label--closed {
  display: none;
}

.popup-more[open] .disclosure-label--open {
  display: block;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 0;
  border-radius: 0;
  background: var(--tag-bg);
  color: var(--tag-ink);
  font-size: 0.76rem;
  font-weight: 500;
  padding: 0 8px;
}

.content-stack {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  width: 100%;
}

.map-wrap {
  position: relative;
  flex: 1 1 auto;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  min-width: 0;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--map-bg);
}

.leaflet-tile-pane {
  filter: var(--tile-filter);
}

.leaflet-control-zoom.leaflet-bar {
  display: grid;
  gap: 2px;
  margin-top: 64px;
  margin-right: 12px;
  border: 0;
  border-radius: 0;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.leaflet-control-zoom.leaflet-bar a {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 0;
  background: var(--surface-strong);
  color: var(--ink);
  line-height: 44px;
}

.leaflet-control-zoom.leaflet-bar a + a {
  border-top: 1px solid var(--line);
}

.leaflet-control-zoom.leaflet-bar a:hover {
  background: var(--surface);
  color: var(--ink);
}

@media (prefers-color-scheme: dark) {
  .marker-bike-icon,
  .spot-card-bike-icon {
    filter: invert(1);
  }
}

.list-view {
  display: none;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
  background: var(--panel);
  padding: 70px 12px 96px;
}

body.view-list .list-view {
  display: flex;
}

body.view-list .map-wrap {
  display: none;
}

/* In list view the list scrolls beneath the fixed menu button and view
   toggle, so back them with a bar to keep the controls legible. */
body.view-list::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  z-index: 550;
  pointer-events: none;
}

/* On mobile, keep the search/sort toolbar pinned just below the header bar
   so it stays in view while the list scrolls, with even spacing around it. */
@media (max-width: 899px) {
  .list-view {
    padding-top: 68px;
  }

  .list-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    width: auto;
    max-width: none;
    margin: 0 -12px;
    padding: 12px;
    background: var(--panel);
    box-shadow: 0 8px 8px -6px rgba(0, 0, 0, 0.12);
  }
}

.spot-list {
  display: grid;
  gap: 0;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.spot-list::after {
  content: "";
  display: block;
  height: var(--spot-list-end-spacer, 0px);
}

.spot-list.is-empty {
  flex: 1 1 auto;
  place-content: center;
  place-items: center;
}

.spot-list-empty {
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.spot-card {
  border: 0;
  border-radius: 0;
  background: var(--tag-bg);
  overflow: hidden;
}

.spot-card[open] {
  box-shadow: inset 3px 0 0 var(--ink);
}

.spot-list-item.is-selected .spot-card {
  box-shadow: inset 3px 0 0 var(--accent, var(--ink));
}

/* In the list view, drop the card fill and separate parks with a top border. */
.list-view .spot-card {
  background: transparent;
  border-top: 1px solid var(--line);
}

.spot-card-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: flex-start;
  column-gap: 12px;
  row-gap: 4px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.spot-card-main {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.spot-card-summary::-webkit-details-marker {
  display: none;
}

.spot-card-summary:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--ink);
}

.spot-card-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.spot-card-title {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.2;
  letter-spacing: -0.005em;
}

.spot-card-region {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
}

.spot-card-region--lines {
  display: grid;
  gap: 1px;
  line-height: 1.3;
}

.spot-card-location,
.spot-card-address {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.spot-card-location {
  flex-wrap: wrap;
}

.spot-card-address-inline {
  display: inline;
}

.address-copy-button {
  display: inline-grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 1em;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  margin-left: 4px;
  padding: 0;
  vertical-align: -0.12em;
}

.address-copy-button::before {
  content: "";
  position: absolute;
  inset: -6px;
}

.address-copy-button svg {
  width: 16px;
  height: 16px;
}

.address-copy-button:hover {
  color: var(--ink);
}

.address-copy-button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.spot-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.spot-card-summary > .spot-card-links {
  grid-column: 1 / -1;
  margin-top: 0;
}

.spot-link-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
}

.spot-link-icon svg {
  width: 23px;
  height: 23px;
}

.spot-link-icon:hover {
  background: transparent;
  color: var(--accent, var(--ink));
}

.spot-link-icon:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.popup-card > .spot-card-links {
  margin-top: 0;
}

.popup-card .spot-link-icon {
  background: transparent;
}

.popup-card .spot-link-icon:hover {
  background: transparent;
  color: var(--accent, var(--ink));
}

.spot-card-bike {
  display: grid;
  justify-self: end;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--grade-ring, var(--ink));
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
  padding: 5px;
  flex: 0 0 auto;
}

.spot-card-bike-inner {
  display: grid;
  place-items: center;
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--panel);
  overflow: hidden;
}

.spot-card-bike-icon,
.spot-card-construction-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: block;
  pointer-events: none;
}

.spot-card-bike-icon {
  width: 110%;
  height: 110%;
}

.spot-card-construction-icon {
  width: 62%;
  height: 62%;
}

.spot-card-body {
  display: grid;
  gap: 10px;
  padding: 8px 16px 18px;
}

.spot-card-body .popup-facts dt,
.spot-card-body .popup-section h4 {
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.spot-card-body .popup-card > .spot-card-head,
.spot-card-body .popup-card > .spot-card-links {
  display: none;
}

.top-bar {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  pointer-events: none;
  z-index: 650;
}

.view-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  border: 0;
  border-radius: 0;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 2px;
  pointer-events: auto;
}

.map-location-btn {
  position: fixed;
  top: 12px;
  right: 12px;
  box-shadow: var(--shadow);
  z-index: 900;
}

.install-app-button {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  color: var(--ink);
  cursor: pointer;
  padding: 0 14px;
  font-size: 0.85rem;
  font-weight: 600;
}

.install-app-button:hover {
  background: var(--surface);
}

.install-app-button[hidden],
.filters-open .install-app-button,
body.view-list .install-app-button {
  display: none;
}

.view-toggle-btn {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-soft);
  min-height: 40px;
  padding: 0 18px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.view-toggle-btn:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--ink);
}

.view-toggle-btn.is-active {
  background: var(--ink);
  color: var(--on-accent);
  font-weight: 600;
}

.filter-toggle {
  position: fixed;
  left: 12px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 0;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  z-index: 600;
}

.filter-icon {
  display: block;
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.filter-count {
  position: fixed;
  left: 56px;
  top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 10px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  z-index: 600;
}

.filters-open .filter-toggle {
  opacity: 0;
  pointer-events: none;
}

.filters-open .filter-count {
  opacity: 0;
}

.active-filters {
  position: fixed;
  top: 64px;
  left: 12px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  /* Stack down the left edge below the menu button; scroll if the column runs
     past the viewport. */
  max-height: calc(100% - 76px);
  overflow-y: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.active-filters::-webkit-scrollbar {
  display: none;
}

.active-filters[hidden] {
  display: none;
}

.filters-open .active-filters {
  opacity: 0;
  pointer-events: none;
}

/* The chips are a map overlay; in list view they'd sit on top of the list. */
body.view-list .active-filters {
  display: none;
}

.active-filter-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 4px 0 12px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.active-filter-chip--grade {
  background: var(--chip-color);
  color: #fff;
}

.active-filter-chip .chip-remove {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: 400 18px/1 "Helvetica Neue", Arial, sans-serif;
}

.active-filter-chip .chip-remove:hover {
  background: var(--ink);
  color: var(--on-accent);
}

.active-filter-chip--grade .chip-remove:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.active-filter-chip .chip-remove:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--ink);
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 680;
  background: var(--panel, var(--surface-strong));
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
  max-height: 80vh;
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

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

.bottom-sheet.is-expanded {
  overflow: auto;
}

.bottom-sheet-handle {
  display: block;
  width: 100%;
  padding: 10px 0 6px;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bottom-sheet-handle::before {
  content: "";
  display: block;
  width: 42px;
  height: 4px;
  margin: 0 auto;
  border-radius: 2px;
  background: var(--line);
}

.bottom-sheet-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 700 24px/1 "Helvetica Neue", Arial, sans-serif;
  cursor: pointer;
  z-index: 2;
}

.bottom-sheet-content .spot-card {
  background: transparent;
}

.bottom-sheet-content .spot-card-summary {
  padding-right: 48px;
}

.bottom-sheet-content {
  zoom: 1.15;
}

.bottom-sheet:not(.is-expanded) .spot-card-body {
  display: none;
}

@media (min-width: 900px) {
  .bottom-sheet {
    display: none !important;
  }
}

.panel-tabs {
  display: flex;
  gap: 18px;
  margin: 6px 16px 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.panel-tab {
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  min-height: 40px;
  margin-bottom: -1px;
  padding: 0 2px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}

.panel-tab:hover {
  color: var(--ink);
}

.panel-tab.is-active {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--ink);
}

.panel-tab:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.panel-tab-content {
  padding-top: 14px;
}

.panel-tab-content[hidden] {
  display: none;
}

.about-content {
  padding: 0 18px 22px;
  display: grid;
  gap: 18px;
  color: var(--ink);
}

.about-content h2 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.about-content p,
.about-content li {
  margin: 0 0 8px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.about-content ul {
  margin: 0 0 8px;
  padding-left: 18px;
}

.contact-link {
  display: inline-block;
  margin-top: 4px;
  font-weight: 500;
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.jump-marker {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--grade-ring, var(--ink));
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
  color: var(--ink);
  padding: 5px;
}

.jump-marker.is-selected {
  border-color: var(--ink);
}

.marker-feature-label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--panel);
  letter-spacing: 0;
  overflow: hidden;
}

.marker-feature-code {
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
}

.marker-bike-icon {
  width: 110%;
  height: 110%;
  display: block;
  pointer-events: none;
}

.marker-construction-icon {
  position: absolute;
  top: 48%;
  left: 50%;
  width: 60%;
  height: 60%;
  transform: translate(-50%, -50%);
  display: block;
  pointer-events: none;
}

.marker-uplift-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 58%;
  height: 58%;
  transform: translate(-50%, -50%);
  display: block;
  pointer-events: none;
}

.leaflet-popup-pane {
  z-index: 760;
}

.leaflet-popup-content-wrapper {
  border-radius: 0;
  background: var(--panel);
  color: var(--ink);
  border: 0;
  box-shadow: var(--shadow);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

.leaflet-popup-content {
  font-size: 1rem;
}

.leaflet-popup-tip {
  background: var(--panel);
  border: 0;
}

.leaflet-container a.leaflet-popup-close-button {
  color: var(--muted);
  width: 36px;
  height: 36px;
  padding: 6px 8px;
  font: 700 24px/24px "Helvetica Neue", Arial, sans-serif;
  display: grid;
  place-items: center;
}

.leaflet-popup-content {
  box-sizing: border-box;
  width: min(332px, calc(100vw - 32px)) !important;
  max-height: min(54vh, 440px);
  margin: 14px 0 14px 14px;
  padding-right: 40px;
  overflow: auto;
}

.popup-card {
  display: grid;
  gap: 7px;
}

.popup-facts {
  display: grid;
  gap: 5px;
  margin: 0;
}

.popup-facts div {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 20px;
  align-items: baseline;
}

.popup-facts dt,
.popup-section h4 {
  margin: 0;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.popup-facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.35;
}

.popup-card .meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  line-height: 1;
}

.popup-section {
  display: grid;
  gap: 3px;
}

.popup-section p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.popup-card a {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.popup-card .spot-card-title a {
  color: inherit;
  font: inherit;
  text-decoration: none;
}

.popup-links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.popup-links li:not(:last-child)::after {
  content: "|";
  margin-left: 8px;
  color: var(--muted);
}

.popup-section--inline {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 20px;
  align-items: baseline;
}

.popup-more {
  display: grid;
  gap: 7px;
}

.popup-more summary {
  list-style: none;
}

.popup-more summary::-webkit-details-marker {
  display: none;
}

.popup-notes-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.popup-notes {
  margin-top: 8px;
}

@media (max-width: 900px) {
  .leaflet-popup {
    max-width: calc(100vw - 28px);
  }
}

@media (min-width: 900px) {
  .content-stack {
    flex-direction: row;
  }

  .list-view,
  body.view-list .list-view {
    display: flex;
    flex: 0 0 380px;
    order: 1;
    min-height: 0;
    height: 100%;
    border-left: 1px solid var(--line);
    padding: 20px 14px 24px;
  }

  body.view-list .map-wrap {
    display: block;
  }

  .top-bar {
    display: none;
  }

  .map-location-btn {
    right: 392px;
  }

  .install-app-button {
    left: 12px;
  }

  body.view-list::before {
    display: none;
  }
}

@media (max-width: 360px) {
  .top-bar {
    gap: 4px;
  }

  .view-toggle-btn {
    padding-right: 10px;
    padding-left: 10px;
  }

  .sort-select {
    width: 98px;
  }
}

@media (max-width: 899px) {
  .leaflet-control-zoom.leaflet-bar {
    position: fixed;
    top: 64px;
    right: 12px;
    margin: 0;
  }
}

@media (min-width: 1300px) {
  .app-shell {
    flex-direction: row;
  }

  .side-panel {
    position: relative;
    left: auto;
    top: auto;
    bottom: auto;
    flex: 0 0 360px;
    width: 360px;
    height: 100%;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
    border-right: 1px solid var(--line);
    z-index: auto;
  }

  .filter-toggle,
  .filter-count,
  .active-filters,
  #filterClose,
  .panel-backdrop {
    display: none;
  }

  .content-stack {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    flex-direction: row;
  }

  .install-app-button {
    left: 372px;
  }
}

@media (max-width: 640px) {
  .brand {
    gap: 12px;
  }

  .eyebrow {
    font-size: 0.78rem;
  }

  h1 {
    font-size: 1.72rem;
  }

  .option-chip {
    min-height: 40px;
  }
}

@media (max-width: 390px) {
  .brand {
    align-items: flex-start;
  }
}
