/* Keep map content in its own stack, below surrounding panels and dialogs. */
.route-map, #public-route-map { isolation: isolate; }
/* Marker transforms/opacity create stacking contexts; DOM insertion order must
   never let a newly added wind, circuit or place marker cover an open popup. */
.route-map .mapboxgl-marker, #public-route-map .mapboxgl-marker { z-index: 1; }
.route-map .mapboxgl-popup, #public-route-map .mapboxgl-popup { z-index: 2; }
.route-map .mapboxgl-control-container > div,
#public-route-map .mapboxgl-control-container > div { z-index: 3; }

/* Place cards share the same styling in the builder and public viewer. */
.retki-place-popup .mapboxgl-popup-content { padding: 0; border: 1px solid #e1e5df; border-radius: 12px; box-shadow: 0 6px 24px #172b2426; }
.retki-place-popup .mapboxgl-popup-close-button { display: grid; place-items: center; top: 8px; right: 8px; width: 32px; height: 32px; min-height: 32px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #65716a; font: 22px/1 sans-serif; }
.retki-place-popup .mapboxgl-popup-close-button:hover { background: #f0f3ef; }
.retki-place-popup :is(button, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.retki-stop-popup { overflow-y: auto; overscroll-behavior: contain; box-sizing: border-box; width: 284px; max-width: calc(100vw - 40px); padding: 18px; color: #202725; font: 13px/1.5 system-ui, sans-serif; }
.retki-stop-popup__category { display: block; padding-right: 28px; color: #65716a; font-size: 11px; font-weight: 500; }
.retki-stop-popup .retki-stop-popup__title { margin: 3px 24px 0 0; font-size: 17px; line-height: 1.3; font-weight: 650; letter-spacing: -.02em; overflow-wrap: anywhere; }
.retki-stop-popup .retki-stop-popup__address { margin: 7px 0 0; color: #65716a; font-size: 12px; }
.retki-stop-popup__metrics { display: grid; grid-template-columns: 1fr 1fr; margin: 16px 0 12px; padding: 12px 0; border-block: 1px solid #e8ece6; }
.retki-stop-popup__metric { display: flex; flex-direction: column; gap: 2px; }
.retki-stop-popup__metric + .retki-stop-popup__metric { padding-left: 16px; border-left: 1px solid #e8ece6; }
.retki-stop-popup__metric dt { color: #65716a; font-size: 11px; }
.retki-stop-popup__metric dd { order: -1; margin: 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.retki-stop-popup__hours { margin: 0 0 14px; font-size: 12px; }
.retki-stop-popup__hours summary { width: fit-content; cursor: pointer; color: var(--accent); }
.retki-stop-popup__hours ul { max-height: 150px; overflow-y: auto; margin: 8px 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.retki-stop-popup__hours li + li { margin-top: 3px; }
.retki-stop-popup .retki-stop-popup__hours-note { margin: 8px 0 0; color: #65716a; font-size: 11px; }
.retki-stop-popup .retki-stop-popup__unavailable { margin: 0 0 14px; color: #65716a; font-size: 12px; }
.retki-stop-popup button.retki-stop-popup__add { display: block; box-sizing: border-box; width: 100%; min-height: 38px; margin: 0; border: 0; border-radius: 7px; background: var(--accent); color: white; padding: 8px 12px; font: 500 13px/1.5 system-ui, sans-serif; cursor: pointer; }
.retki-stop-popup button.retki-stop-popup__add:hover:not(:disabled) { background: var(--accent-hover); }
.retki-stop-popup button.retki-stop-popup__add:disabled { opacity: .5; cursor: default; }
.retki-stop-popup__distance { margin: 10px 0; font-variant-numeric: tabular-nums; }
