/* #/visit — full-width map only */
main.parking-map-active {
  display: flex;
  flex-direction: column;
  max-width: none;
  width: 100%;
  padding: 0.5rem;
  min-height: 0;
  overflow: hidden;
}

#parkingView {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

/* Options chrome stays natural height; map is the only flex-grow column. */
#parkingMapChrome {
  flex: 0 0 auto;
}

/* Grows to fill space between chrome and route panel (`#parkingView` is `flex flex-col` in HTML). */
#parkingAppMap {
  box-sizing: border-box;
  min-height: 0;
  width: 100%;
  height: 100%;
  border-radius: 0.5rem;
  border: 1px solid rgb(226 232 240);
  overflow: hidden;
}

/**
 * Match Leaflet `.leaflet-bar a` (zoom +/-): white tile, border, shadow — top-right on `#parkingAppMap`.
 * @see leaflet.css `.leaflet-bar`, `.leaflet-bar a`
 */
.parking-map-control-help {
  position: absolute;
  z-index: 1000; /* tiles ~200; controls use high z-index */
  top: 10px;
  right: 10px;
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(204 204 204);
  border-radius: 4px;
  background-color: rgb(255 255 255);
  color: rgb(51 51 51);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.parking-map-control-help:hover {
  background-color: rgb(244 244 244);
}

.parking-map-control-help:focus-visible {
  outline: 2px solid rgb(59 130 246);
  outline-offset: 2px;
}

.parking-map-control-help-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Parking legend modal — Leaflet fills the Tailwind-sized tile */
.parking-legend-mini-map.leaflet-container {
  height: 100%;
  min-height: 8rem;
}

/* Sits under the map; height follows content (map column keeps flex growth). */
#parkingRouteInstructions {
  flex: 0 0 auto;
  flex-shrink: 0;
}

.parking-route-instructions-placeholder {
  margin: 0;
  line-height: 1.45;
  color: rgb(100 116 139);
  font-size: 0.8125rem;
}

.parking-route-instructions-error {
  color: rgb(159 18 57);
}

.parking-route-instructions-prompt {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.parking-route-prompt-icon {
  flex-shrink: 0;
  line-height: 0;
  margin-top: 0.05rem;
}

.parking-route-prompt-icon svg {
  display: block;
}

.parking-route-prompt-msg {
  flex: 1;
  min-width: 0;
}

.parking-route-steps {
  margin: 0;
  padding-left: 0;
  line-height: 1.45;
  list-style: none;
  counter-reset: parking-route-step;
}

.parking-route-steps .parking-route-step-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.35rem;
  counter-increment: parking-route-step;
}

.parking-route-steps .parking-route-step-item::before {
  flex: 0 0 1.35rem;
  text-align: right;
  content: counter(parking-route-step) ". ";
}

.parking-route-steps .parking-route-step-item--no-list-marker {
  counter-increment: none;
}

.parking-route-steps .parking-route-step-item--no-list-marker::before {
  content: "";
}

.parking-route-steps .parking-route-step-item + .parking-route-step-item {
  margin-top: 0.35rem;
}

.parking-route-step-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  flex: 1 1 auto;
  min-width: 0;
}

.parking-route-step-main {
  flex: 1 1 auto;
  min-width: 0;
}

.parking-route-step-metrics {
  flex: 0 1 auto;
  max-width: min(12rem, 46%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  line-height: 1.2;
}

/* Time chips — shared pill base; variants below set colors (base must come first). */
.parking-route-step-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid transparent;
}

/* Drive (park here) — green fill + faint neutral edge (slate-300) */
.parking-route-step-badge--drive {
  color: rgb(22 101 52);
  background-color: rgb(220 252 231);
  border-color: rgb(203 213 225);
}

.parking-route-step-badge--walk {
  color: rgb(29 78 216);
  background-color: rgb(219 234 254);
  border-color: rgb(147 197 253);
}

.parking-route-step-badge--wait {
  color: rgb(51 65 85);
  background-color: rgb(241 245 249);
  border-color: rgb(203 213 225);
}

/* DASH trip / shuttle — same family as `PARKING_DASH_TRIP_STOP_FILL` */
.parking-route-step-badge--dash {
  color: rgb(147 49 69);
  background-color: rgb(252 231 236);
  border-color: rgb(251 182 198);
}

/* Legacy: older inline route hints (keep if any remain) */
.parking-route-step-detail {
  color: rgb(100 116 139);
  font-weight: 400;
}

a.parking-route-step-maps-link,
a.parking-route-transit-app-link {
  text-decoration: none;
}

a.parking-route-step-maps-link .parking-route-step-link-content,
a.parking-route-transit-app-link .parking-route-step-link-content {
  display: inline-flex;
  align-items: center;
  gap: 0.28em;
  /* Border spans full flex row (text + gap + icon); text-decoration skips gaps under inline-flex in some engines. */
  border-bottom: 1px solid rgb(148 163 184);
  padding-bottom: 1px;
}

a.parking-route-step-maps-link:hover,
a.parking-route-transit-app-link:hover {
  color: rgb(71 85 105);
}

a.parking-route-step-maps-link:hover .parking-route-step-link-content,
a.parking-route-transit-app-link:hover .parking-route-step-link-content {
  border-bottom-color: rgb(100 116 139);
}

.parking-route-step-link-icon {
  display: inline-flex;
  flex-shrink: 0;
  line-height: 0;
}

.parking-route-step-link-icon-svg {
  width: 0.92em;
  height: 0.92em;
  display: block;
}

a.parking-route-step-maps-link:focus-visible,
a.parking-route-transit-app-link:focus-visible {
  outline: 2px solid rgb(59 130 246);
  outline-offset: 2px;
  border-radius: 2px;
}

.leaflet-tooltip.parking-estimated-walk-tooltip {
  max-width: 14rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.75rem;
  line-height: 1.25;
  font-weight: 500;
  color: rgb(51 65 85);
  border-color: rgb(148 163 184);
  box-shadow: 0 2px 8px rgb(15 23 42 / 0.12);
}

/* Animated “dots” along estimated walk (SVG stroke-dashoffset); pattern length = 14px → loop */
@keyframes parking-estimated-walk-dots {
  to {
    stroke-dashoffset: -14;
  }
}

path.parking-estimated-walk-line-path {
  stroke-dasharray: 2 12 !important;
  stroke-linecap: round !important;
  animation: parking-estimated-walk-dots 1.1s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  path.parking-estimated-walk-line-path {
    animation: none;
  }
}

/* Trip-only DASH segment (`#/visit` multimodal) — flowing dashes; period = sum of dasharray pair (sync `visit.mjs`). */
@keyframes parking-dash-trip-flow {
  to {
    stroke-dashoffset: -32;
  }
}

path.parking-dash-trip-segment-path {
  stroke-dasharray: 20 12 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  animation: parking-dash-trip-flow 1.1s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  path.parking-dash-trip-segment-path {
    animation: none;
  }
}

/*
 * Phones: no document scroll on `#/visit` — chrome, route band, and footer stay put; map column shrinks.
 * Class is toggled in `visit.mjs` (`html` beats `body` utility specificity via descendant selector).
 */
@media (max-width: 767.98px) {
  html.parking-visit-viewport-lock {
    height: 100dvh;
    overflow: hidden;
  }

  html.parking-visit-viewport-lock body {
    height: 100%;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: none;
  }

  main.parking-map-active {
    flex: 1 1 0;
  }
}
