:root {
    /* Shared map UI theme — panels, listings rail, price pills, popovers */
    --panel-bg: rgba(24, 24, 28, 0.9);
    --panel-bg-opaque: rgb(24, 24, 28);
    /* Lighter charcoal for map price pills (same family as panel-bg) */
    --panel-elevated: rgba(52, 52, 58, 0.94);
    --panel-elevated-hover: rgba(64, 64, 72, 0.98);
    --panel-text: #e8e8ea;
    --panel-text-strong: #ffffff;
    --panel-text-muted: rgba(232, 232, 234, 0.72);
    --panel-text-faint: rgba(232, 232, 234, 0.55);
    --panel-border: rgba(255, 255, 255, 0.22);
    --panel-border-subtle: rgba(255, 255, 255, 0.1);
    --panel-border-strong: rgba(255, 255, 255, 0.38);
    --panel-control-bg: rgba(255, 255, 255, 0.1);
    --panel-control-bg-hover: rgba(255, 255, 255, 0.16);
    --panel-surface: rgba(255, 255, 255, 0.06);
    --panel-surface-hover: rgba(255, 255, 255, 0.1);
    --panel-surface-selected: rgba(255, 255, 255, 0.12);
    --panel-inverse-bg: #ffffff;
    --panel-inverse-text: rgb(24, 24, 28);
    --panel-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --booking-score-bg: #003b95;

    --accent-blue: #2b5cff;
    --accent-blue-hover: #244de0;
    --icon-btn-bg: #9aa0a6;
    --side-btn-bg: var(--panel-inverse-bg);
    --side-btn-color: #111827;
}

body {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-x: visible;
    background: none;
}

/* ── Maps ── */
#circles,
#basemap {
    width: 100%;
    height: 100vh;
    height: 100dvh;
}
#basemap canvas {
    /* Full opacity until isochrones are drawn; JS fades to 0.6 when bands exist. */
    opacity: 1;
}

/* Single / multi: lock the page so header chrome cannot create a body scrollbar. */
body[data-map-mode="single"],
body[data-map-mode="multi"] {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
}
body[data-map-mode="single"] #container,
body[data-map-mode="multi"] #container {
    height: 100vh;
    height: 100dvh;
}
body[data-map-mode="single"] #circles,
body[data-map-mode="single"] #basemap,
body[data-map-mode="multi"] #circles,
body[data-map-mode="multi"] #basemap {
    height: 100%;
}

/* Price pills sit above the faded canvas and keep true colours */
#basemap .maplibregl-marker {
    z-index: 2;
    will-change: transform;
    top: 0;
    left: 0;
}

/* Listing detail popup must sit above HTML price-pill markers */
#basemap .maplibregl-popup.listing-map-popup,
#basemap .maplibregl-popup.origin-info-map-popup {
    z-index: 20;
}

.multi-origin-marker {
    width: 36px;
    height: 52px;
    display: block;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.28));
}

.multi-origin-marker svg {
    width: 100%;
    height: 100%;
    display: block;
}

.listings-origin-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 36px;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.35));
    pointer-events: auto;
    cursor: pointer;
}
.listings-origin-marker__label {
    margin-bottom: 3px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--accent-blue);
    color: #fff;
    font: 700 10px/1.2 Inter, system-ui, sans-serif;
    letter-spacing: 0.02em;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.listings-origin-marker__pin {
    width: 36px;
    height: 52px;
    display: block;
}

.listing-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.listing-marker__pin {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #1565C0;
    border: 2px solid #ffffff;
    box-sizing: border-box;
}

.listing-marker__label {
    margin-bottom: 3px;
    max-width: 120px;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.92);
    color: #111111;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Price pills — same tokens as map panels / listings rail */
.listing-price-pill {
    appearance: none;
    border: 1px solid var(--panel-border);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--panel-elevated);
    color: var(--panel-text-strong);
    font: 700 12px/1.1 Inter, system-ui, sans-serif;
    box-shadow: var(--panel-shadow);
    white-space: nowrap;
    pointer-events: auto;
    backface-visibility: hidden;
    /* No backdrop-filter — blur on many markers hitchs mobile pans hard */
    transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.listing-price-pill:hover,
.listing-price-pill.is-active {
    background: var(--panel-elevated);
    border-color: var(--panel-text-strong);
    transform: scale(1.08);
    z-index: 2;
}
.listing-price-pill.is-selected,
.listing-price-pill.is-active.is-selected {
    background: var(--panel-inverse-bg);
    color: var(--panel-inverse-text);
    border-color: var(--panel-inverse-bg);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.listing-price-pill.listing-price-pill--dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid var(--panel-text-strong);
    background: var(--panel-elevated);
    box-sizing: border-box;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.listing-price-pill.listing-price-pill--dot:hover,
.listing-price-pill.listing-price-pill--dot.is-active {
    transform: scale(1.2);
}
.listing-price-pill.listing-price-pill--dot.is-selected,
.listing-price-pill.listing-price-pill--dot.is-active.is-selected {
    background: var(--panel-inverse-bg);
    border-color: var(--panel-inverse-bg);
}

/* Listings: sidebar + map side-by-side; collapse via grid (smoother than flex-basis) */
.map-page-shell--listings {
    --listings-rail-width: min(390px, 40vw);
    --listings-rail-motion: 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    display: grid;
    grid-template-columns: var(--listings-rail-width) minmax(0, 1fr);
    height: 100vh;
    overflow: hidden;
    transition: grid-template-columns var(--listings-rail-motion);
}
.map-page-shell--listings.listings-rail-collapsed {
    grid-template-columns: 0px minmax(0, 1fr);
}
.map-page-shell--listings .map-page-main {
    min-width: 0;
    position: relative;
    height: 100vh;
    overflow: hidden;
}
.map-page-shell--listings #container {
    height: 100%;
    width: 100%;
}
.map-page-shell--listings #circles,
.map-page-shell--listings #basemap {
    height: 100%;
    width: 100%;
}

.listings-rail {
    position: relative;
    z-index: 1;
    min-width: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--panel-bg);
    color: var(--panel-text);
    border-right: 1px solid var(--panel-border-subtle);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
    backdrop-filter: saturate(1.2) blur(6px);
    font-family: Inter, system-ui, sans-serif;
    /* Keep inner layout at full rail width so collapse clips instead of reflowing cards */
    box-sizing: border-box;
}
.map-page-shell--listings.listings-rail-collapsed .listings-rail {
    border-right-color: transparent;
    box-shadow: none;
    pointer-events: none;
}
.listings-rail__inner {
    display: flex;
    flex-direction: column;
    width: var(--listings-rail-width);
    min-width: var(--listings-rail-width);
    height: 100%;
    min-height: 0;
}
.listings-rail__header {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 14px 12px 16px;
    border-bottom: 1px solid var(--panel-border-subtle);
    background: transparent;
}
.listings-rail__toggle.icon-btn {
    flex: 0 0 auto;
    place-items: center;
    width: 2.125rem;
    height: 1.875rem;
    min-width: 2.125rem;
    padding: 0;
    margin-top: 2px;
    border-radius: 8px;
    background: var(--panel-control-bg);
    border: 1px solid var(--panel-border);
    color: var(--panel-text);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}
.listings-rail__toggle.icon-btn:hover {
    background: var(--panel-control-bg-hover);
    border-color: var(--panel-border-strong);
    color: var(--panel-text-strong);
}
.listings-rail-reopen-group {
    position: absolute;
    left: 10px;
    top: 50%;
    z-index: 12;
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    background: var(--panel-bg);
    color: var(--panel-text);
    box-shadow: var(--panel-shadow);
    backdrop-filter: saturate(1.2) blur(6px);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-50%) translateX(-8px);
    transition:
        opacity 0.28s ease 0.12s,
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1) 0.12s,
        background 0.18s ease,
        border-color 0.18s ease;
}
.map-page-shell--listings.listings-rail-collapsed .listings-rail-reopen-group {
    pointer-events: auto;
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}
.listings-rail-reopen {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 6px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: inherit;
    font: 600 0.88rem/1.2 Inter, system-ui, sans-serif;
    cursor: pointer;
}
.listings-rail-reopen-group .listings-rail-reopen {
    border-radius: 9px 9px 0 0;
}
.listings-rail-reopen:hover {
    background: var(--panel-control-bg-hover);
}
.listings-rail-reopen-pager {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-top: 1px solid var(--panel-border-subtle);
    border-radius: 0 0 9px 9px;
}
.listings-rail-reopen-pager__btn.listings-pager__btn {
    width: 30px;
    height: 28px;
    border-radius: 8px;
    background: transparent;
    border-color: transparent;
}
.listings-rail-reopen-pager__btn.listings-pager__btn:hover:not(:disabled) {
    background: var(--panel-control-bg-hover);
    border-color: transparent;
}
.listings-rail-reopen-pager__label {
    min-width: 2.5rem;
    text-align: center;
    font: 600 0.72rem/1 Inter, system-ui, sans-serif;
    color: var(--panel-text-muted);
    white-space: nowrap;
}
.listings-rail__brand {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}
.listings-rail__logo-link {
    flex: 0 0 auto;
    display: block;
    line-height: 0;
}
.listings-rail__logo {
    width: 52px;
    height: auto;
    display: block;
}
.listings-rail__heading {
    flex: 1 1 auto;
    min-width: 0;
}
.listings-rail__title {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--panel-text-strong, var(--panel-text));
}
.listings-rail__subtitle {
    margin: 4px 0 0;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--panel-text-muted);
}
.listings-rail__stats {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--panel-text-muted);
}
.listings-rail__stats:empty {
    display: none;
    margin: 0;
}
.listings-rail__stat {
    white-space: nowrap;
}
.listings-rail__stat strong {
    color: var(--panel-text-strong);
    font-weight: 650;
}
.listings-rail__stat--muted {
    color: var(--panel-text-faint);
}
.listings-rail__list {
    flex: 1 1 auto;
    overflow: auto;
    padding: 10px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-color: var(--panel-border) transparent;
}
.listings-rail__empty {
    margin: 24px 8px;
    color: var(--panel-text-faint);
    font-size: 0.92rem;
    line-height: 1.4;
}
.listings-rail__loading {
    margin: 12px 8px 8px;
    color: var(--panel-text-faint);
    font-size: 0.82rem;
    text-align: center;
}
.listings-rail__pager {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--panel-border-subtle);
    background: rgba(0, 0, 0, 0.18);
}
.listings-pager__btn {
    appearance: none;
    border: 1px solid var(--panel-border);
    background: var(--panel-control-bg);
    color: var(--panel-text);
    border-radius: 999px;
    width: 40px;
    height: 36px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    line-height: 0;
    cursor: pointer;
}
.listings-pager__btn svg {
    display: block;
}
.listings-pager__btn:hover:not(:disabled) {
    border-color: var(--panel-border-strong);
    background: var(--panel-control-bg-hover);
}
.listings-pager__btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.listings-pager__label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--panel-text);
}

.listing-card {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 10px;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid var(--panel-border-subtle);
    background: var(--panel-surface);
    cursor: pointer;
    text-align: left;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.listing-card:hover,
.listing-card.is-hovered {
    border-color: var(--panel-border);
    background: var(--panel-surface-hover);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.listing-card.is-selected {
    border-color: var(--panel-border-strong);
    background: var(--panel-surface-selected);
    box-shadow: 0 0 0 1px var(--panel-border);
}
.listing-card__photo {
    width: 112px;
    height: 112px;
    object-fit: cover;
    border-radius: 12px;
    background: var(--panel-control-bg);
}
.listing-card__photo--empty {
    background: linear-gradient(135deg, var(--panel-control-bg), var(--panel-surface-selected));
}
.listing-card__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.listing-card__title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
}
.listing-card__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 650;
    line-height: 1.25;
    color: var(--panel-text);
}
.listing-card__distance {
    font-size: 0.75rem;
    line-height: 1.2;
    color: var(--panel-text-muted);
}
.listing-card__policy {
    font-size: 0.75rem;
    line-height: 1.2;
    font-weight: 600;
    color: #00d26a;
}
.listing-card__stars {
    color: #b4690e;
    font-size: 0.72rem;
    letter-spacing: -1px;
    flex-shrink: 0;
}
.listing-card__rating {
    display: flex;
    align-items: center;
    gap: 8px;
}
.listing-card__score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 24px;
    padding: 0 6px;
    border-radius: 6px 6px 6px 2px;
    background: var(--booking-score-bg);
    color: var(--panel-text-strong);
    font-size: 0.78rem;
    font-weight: 700;
}
.listing-card__score-meta {
    display: flex;
    flex-direction: column;
    font-size: 0.72rem;
    line-height: 1.2;
    color: var(--panel-text-muted);
}
.listing-card__reviews {
    color: var(--panel-text-faint);
}
.listing-card__price {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}
.listing-card__price strong {
    font-size: 1rem;
    color: var(--panel-text-strong);
}
.listing-card__strike {
    text-decoration: line-through;
    color: var(--panel-text-faint);
    font-size: 0.82rem;
}
.listing-card__stay {
    width: 100%;
    color: var(--panel-text-faint);
    font-size: 0.75rem;
}
.listing-card__actions {
    display: none;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
    width: 100%;
}
.listing-card.is-selected .listing-card__actions {
    display: flex;
}
.listing-card__map-btn {
    display: none;
    width: 100%;
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    font: 650 0.8rem/1.2 Inter, system-ui, sans-serif;
    color: var(--panel-text);
    background: var(--panel-control-bg, rgba(255, 255, 255, 0.08));
    border: 1px solid var(--panel-border, rgba(255, 255, 255, 0.16));
    border-radius: 8px;
    cursor: pointer;
}
.listing-card__map-btn:hover {
    background: var(--panel-control-bg-hover, rgba(255, 255, 255, 0.12));
}
.listing-card__book {
    display: block;
    width: 100%;
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 650;
    border-radius: 8px;
    cursor: pointer;
}
.listing-card__book:disabled {
    opacity: 0.65;
    cursor: wait;
}
.listing-card__price--missing {
    color: var(--panel-text-faint);
    font-size: 0.82rem;
}

@media (max-width: 820px) {
    .listing-card.is-selected .listing-card__map-btn {
        display: block;
    }
}

/* Map popup card */
.listing-map-popup .maplibregl-popup-content {
    padding: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}
.origin-info-map-popup .maplibregl-popup-content {
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--panel-bg-opaque);
    color: var(--panel-text);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--panel-border-subtle);
}
.origin-info-map-popup .maplibregl-popup-close-button {
    color: var(--panel-text-muted);
    font-size: 18px;
    padding: 4px 8px;
    right: 2px;
    top: 2px;
}
.origin-info-map-popup .maplibregl-popup-close-button:hover {
    color: var(--panel-text-strong);
    background: transparent;
}
.origin-info-popup {
    padding: 12px 36px 12px 14px;
    max-width: 260px;
}
.origin-info-popup__title {
    margin: 0 0 6px;
    font: 700 0.92rem/1.25 Inter, system-ui, sans-serif;
    color: var(--panel-text-strong);
}
.origin-info-popup__text {
    margin: 0 0 8px;
    font: 500 0.82rem/1.45 Inter, system-ui, sans-serif;
    color: var(--panel-text-muted);
}
.origin-info-popup__text:last-child {
    margin-bottom: 0;
}
.origin-info-popup__text strong {
    color: var(--panel-text);
    font-weight: 700;
}
.listing-popup {
    display: grid;
    grid-template-columns: 110px 1fr;
    min-width: 260px;
    background: var(--panel-bg-opaque);
    color: var(--panel-text);
}
.listing-popup__photo {
    width: 110px;
    height: 100%;
    min-height: 110px;
    object-fit: cover;
    background: var(--panel-control-bg);
}
.listing-popup__body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.listing-popup__distance {
    font-size: 0.75rem;
    line-height: 1.2;
    color: var(--panel-text-muted);
}
.listing-popup__policy {
    font-size: 0.75rem;
    line-height: 1.2;
    font-weight: 600;
    color: #00d26a;
}
.listing-popup__title {
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.25;
    color: var(--panel-text-strong);
}
.listing-popup__rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
}
.listing-popup__score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 5px;
    border-radius: 5px 5px 5px 2px;
    background: var(--booking-score-bg);
    color: var(--panel-text-strong);
    font-weight: 700;
}
.listing-popup__price {
    margin-top: 4px;
    font-size: 1.05rem;
    font-weight: 750;
    color: var(--panel-text-strong);
}
.listing-popup__stay {
    font-size: 0.75rem;
    color: var(--panel-text-faint);
}
.listing-popup__book {
    margin-top: 8px;
    width: 100%;
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 650;
    border-radius: 8px;
    cursor: pointer;
}
.listing-popup__book:disabled {
    opacity: 0.65;
    cursor: wait;
}


@media (max-width: 820px) {
    .map-page-shell--listings {
        display: flex;
        flex-direction: column;
        transition: none;
        grid-template-columns: none;
    }
    .map-page-shell--listings.listings-rail-collapsed {
        grid-template-columns: none;
    }
    .map-page-shell--listings .map-page-main {
        flex: 1 1 auto;
        height: auto;
        min-height: 100vh;
    }
    .map-page-shell--listings #circles,
    .map-page-shell--listings #basemap {
        height: 100vh;
    }
    /* Exclusive Map | Filters | Places (≤820px)
       Switcher stays pinned to the same bottom spot in all three modes;
       Categories sits above it on Map. */
    .map-page-shell--listings {
        --listings-switcher-clearance: calc(3.55rem + env(safe-area-inset-bottom));
        --listings-view-motion: 0.42s cubic-bezier(0.22, 1, 0.36, 1);
        --listings-view-fade: 0.28s ease;
    }
    /* Map-corner logo on listings: Map view only (hidden on Places/Filters) */
    .map-page-shell--listings[data-listings-view="stays"] a:has(> .logo-fixed),
    .map-page-shell--listings[data-listings-view="filters"] a:has(> .logo-fixed) {
        display: none;
    }
    .listings-view-switcher {
        position: fixed;
        left: 50%;
        bottom: calc(12px + env(safe-area-inset-bottom));
        z-index: 22;
        display: inline-flex !important;
        flex-direction: row;
        align-items: stretch;
        gap: 0;
        padding: 3px;
        border: 1px solid var(--panel-border);
        border-radius: 999px;
        background: var(--panel-bg);
        color: var(--panel-text);
        box-shadow: var(--panel-shadow);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(24, 24, 28, 0.94);
        transform: translateX(-50%);
        transition: opacity var(--listings-view-fade);
    }
    .listings-view-switcher__btn {
        appearance: none;
        margin: 0;
        border: 0;
        border-radius: 999px;
        padding: 9px 14px;
        min-width: 4.25rem;
        background: transparent;
        color: rgba(255, 255, 255, 0.62);
        font: 600 0.82rem/1.2 Inter, system-ui, sans-serif;
        cursor: pointer;
        transition: background 0.14s ease, color 0.14s ease;
    }
    .listings-view-switcher__btn:hover {
        color: rgba(255, 255, 255, 0.92);
    }
    .listings-view-switcher__btn[aria-selected="true"] {
        background: rgba(43, 92, 255, 0.42);
        color: #fff;
    }
    .listings-view-switcher__btn:focus-visible {
        outline: 2px solid rgba(43, 92, 255, 0.7);
        outline-offset: 1px;
    }
    /* Desktop List control stays off-screen on mobile */
    .listings-rail-reopen-group {
        display: none !important;
    }

    .listings-rail {
        position: fixed;
        width: min(100vw, 100%);
        max-height: none;
        height: auto;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 20;
        border-right: 0;
        border-top: 0;
        box-shadow: none;
        transition: transform var(--listings-view-motion);
        transform: translateY(0);
        opacity: 1;
        will-change: transform;
    }
    .listings-rail__inner {
        width: 100%;
        min-width: 0;
        max-height: none;
        height: 100%;
        display: flex;
        flex-direction: column;
        padding-bottom: calc(4rem + env(safe-area-inset-bottom));
        box-sizing: border-box;
    }
    .listings-rail__list {
        flex: 1 1 auto;
        min-height: 0;
    }
    .listings-rail__pager {
        padding-bottom: 10px;
    }
    .listings-rail__header {
        padding: 10px 12px 8px 14px;
    }

    /* Places: same slide as Filters */
    .map-page-shell--listings[data-listings-view="stays"] .listings-rail {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    .map-page-shell--listings[data-listings-view="map"] .listings-rail,
    .map-page-shell--listings[data-listings-view="filters"] .listings-rail {
        transform: translateY(calc(100% + 12px));
        opacity: 1;
        pointer-events: none;
    }

    .map-page-shell--listings .bottom-dock {
        bottom: 0;
        z-index: 21;
    }

    /* Map: Categories above the fixed mode switcher.
       Origin pick still needs Day & Time — and no switcher yet, so dock stays flush bottom. */
    .map-page-shell--listings[data-listings-view="map"] .bottom-dock,
    .map-page-shell--listings[data-listings-view="stays"] .bottom-dock {
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: none;
        bottom: var(--listings-switcher-clearance, 3.55rem);
        padding-bottom: 10px;
    }

    /*
     * After origin: Filters is a full-screen overlay, so Categories is alone in the dock.
     * Beat .legend.is-header-collapsed { width: max-content } (and cover 641–820 where the
     * ≤640 dock full-bleed rules do not apply) — otherwise the collapsed pill sits in the corner
     * until expand/collapse forces a reflow.
     */
    body:not(.listings-origin-pick) .map-page-shell--listings .bottom-dock {
        position: fixed;
        left: 0;
        right: 0;
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        padding-left: 10px;
        padding-right: 10px;
        box-sizing: border-box;
    }
    body:not(.listings-origin-pick) .map-page-shell--listings .bottom-dock.bottom-dock--both-collapsed {
        grid-template-columns: 1fr;
    }
    body:not(.listings-origin-pick) .map-page-shell--listings .bottom-dock > .legend,
    body:not(.listings-origin-pick) .map-page-shell--listings .bottom-dock > .legend.is-header-collapsed {
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        left: auto;
        right: auto;
        box-sizing: border-box;
    }
    body.listings-origin-pick .map-page-shell--listings[data-listings-view="map"] .bottom-dock {
        bottom: 0;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
    .map-page-shell--listings[data-listings-view="stays"] .bottom-dock > .legend {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    /*
     * Filters panel: same enter/exit as Places (slide + fade).
     * Keep position:fixed even when hidden so the transition can run (no display:none).
     * Origin pick keeps the normal in-dock Day & Time panel.
     */
    body:not(.listings-origin-pick) .map-page-shell--listings .bottom-dock > .nav-panel {
        position: fixed !important;
        inset: 0 !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        height: 100% !important;
        max-height: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        z-index: 20;
        display: flex !important;
        flex-direction: column;
        overflow: hidden;
        transition: transform var(--listings-view-motion);
        transform: translateY(calc(100% + 12px));
        opacity: 1;
        pointer-events: none;
        will-change: transform;
    }
    body:not(.listings-origin-pick) .map-page-shell--listings[data-listings-view="filters"] .bottom-dock > .nav-panel {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    body:not(.listings-origin-pick) .map-page-shell--listings[data-listings-view="filters"] .bottom-dock > .legend {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
    .map-page-shell--listings[data-listings-view="filters"] .navigation__header {
        flex: 0 0 auto;
    }
    .map-page-shell--listings[data-listings-view="filters"] #navigation-body {
        flex: 1 1 auto;
        min-height: 0 !important;
        height: auto !important;
        overflow: auto;
        padding-bottom: calc(4.25rem + env(safe-area-inset-bottom));
        display: block !important;
    }
    .map-page-shell--listings[data-listings-view="filters"] #timeForm {
        max-width: none;
        width: 100%;
        box-sizing: border-box;
    }
    /* Mode switcher replaces collapse controls on mobile */
    body[data-map-mode="listings"] .listings-rail__toggle {
        display: none !important;
    }
    body[data-map-mode="listings"]:not(.listings-origin-pick) #navigation-toggle {
        display: none !important;
    }
}

/* ── Loading overlay ── */
#loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(24, 24, 28, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
#loading-overlay[hidden] { display: none; }

#loading-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
#loading-text {
    color: #fff;
    font: 500 1rem/1.4 inherit;
    letter-spacing: 0.01em;
}

/* ── Utility ── */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ── Address search (Photon; panel closed until user opens it) ── */
.address-search-trigger {
    pointer-events: auto;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 14px;
    border: none;
    border-radius: 8px;
    background: var(--panel-bg);
    color: #fff;
    font: 600 clamp(0.75rem, 2.8vw, 0.88rem) system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: saturate(1.2) blur(6px);
    max-width: calc(100vw - 24px);
    transition: background 0.15s ease, transform 0.02s ease;
}
.address-search-trigger[hidden] {
    display: none !important;
}
/* Listings: Search for address only while changing origin */
body[data-map-mode="listings"]:not(.listings-origin-pick) .listings-origin-search-trigger {
    display: none !important;
}
body.listings-origin-pick .listings-origin-search-trigger {
    display: inline-flex !important;
}
.address-search-trigger:hover {
    background: rgba(36, 38, 44, 0.98);
}
.address-search-trigger:active {
    transform: translateY(1px);
}
.address-search-trigger:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}
.address-search-trigger[aria-expanded="true"] {
    box-shadow: 0 0 0 2px var(--accent-blue), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.address-search-shell {
    position: fixed;
    inset: 0;
    z-index: 12;
    pointer-events: none;
}

.address-search-backdrop {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(18, 20, 24, 0.45);
    backdrop-filter: blur(2px);
    pointer-events: none;
}
.address-search-backdrop:not([hidden]) {
    display: block;
    pointer-events: auto;
}

.address-search-panel {
    position: fixed;
    z-index: 2;
    background: var(--panel-bg);
    color: var(--panel-text);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: saturate(1.2) blur(6px);
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.22s ease;
}

@media (min-width: 641px) {
    .address-search-backdrop {
        display: none !important;
    }

    .address-search-panel {
        top: 148px;
        left: 50%;
        width: min(420px, calc(100vw - 24px));
        margin-left: calc(-0.5 * min(420px, calc(100vw - 24px)));
        opacity: 0;
        visibility: hidden;
        transform: translateY(-12px);
    }
    .address-search-panel.address-search-panel--open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }
}

@media (max-width: 640px) {
    .address-search-backdrop:not([hidden]) {
        display: block;
    }

    .address-search-panel {
        left: 0;
        right: 0;
        top: 0;
        width: 100%;
        margin-left: 0;
        padding-top: max(6px, env(safe-area-inset-top));
        border-radius: 0 0 10px 10px;
        opacity: 1;
        visibility: visible;
        transform: translateY(-100%);
    }
    .address-search-panel.address-search-panel--open {
        pointer-events: auto;
        transform: translateY(0);
    }

    /* Search UI above the logo so the bar covers it; when closed, :has() no longer applies */
    body:has(#address-search-panel.address-search-panel--open) .address-search-shell {
        z-index: 1012;
    }
    body:has(#address-search-panel.address-search-panel--open) .logo-fixed {
        z-index: 100;
    }
}

.address-search-inner {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px 6px;
}

#addressSearchInput {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.2);
    color: var(--panel-text);
    /* ≥16px prevents iOS Safari from zooming the page when the field is focused */
    font-family: inherit;
    font-size: 16px;
    line-height: 1.35;
}
#addressSearchInput::placeholder {
    color: rgba(232, 232, 234, 0.55);
}
#addressSearchInput:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 1px;
}

.address-search-results {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: min(40vh, 280px);
    overflow-y: auto;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.15);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.32) rgba(0, 0, 0, 0.2);
}

.address-search-results::-webkit-scrollbar,
.category-edit-dialog__body::-webkit-scrollbar {
    width: 8px;
}

.address-search-results::-webkit-scrollbar-track,
.category-edit-dialog__body::-webkit-scrollbar-track {
    margin: 4px 0;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 8px;
}

.address-search-results::-webkit-scrollbar-thumb,
.category-edit-dialog__body::-webkit-scrollbar-thumb {
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
    background-color: rgba(255, 255, 255, 0.28);
}

.address-search-results::-webkit-scrollbar-thumb:hover,
.category-edit-dialog__body::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4);
    background-clip: padding-box;
}
.address-search-results[hidden] {
    display: none !important;
}
.address-search-results li {
    padding: 8px 10px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.88rem;
    line-height: 1.35;
}
.address-search-results li:last-child {
    border-bottom: 0;
}
.address-search-results li:hover,
.address-search-results li:focus {
    background: rgba(43, 92, 255, 0.25);
    outline: none;
}

.address-search-status {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.35;
    color: rgba(232, 232, 234, 0.85);
}
.address-search-status[hidden] {
    display: none !important;
}
.address-search-status--error {
    color: #f5a3a3;
}

.address-search-attribution {
    margin: 0;
    font-size: 0.68rem;
    line-height: 1.3;
    color: rgba(232, 232, 234, 0.45);
}
.address-search-attribution a {
    color: rgba(232, 232, 234, 0.65);
}

/* ── Map title header ── */
.title-wrapper {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11;
    text-align: center;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.city-selector-link {
    text-decoration: none;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease;
    cursor: pointer;
}
.city-selector-link:hover { transform: scale(1.02); }

.map-title {
    background: var(--panel-bg);
    color: var(--panel-text-strong);
    border-radius: 8px 8px 0 0;
    backdrop-filter: saturate(1.2) blur(6px);
    padding: 8px 14px 8px 18px;
    font: 600 clamp(20px, 2.8vw, 28px)/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    max-width: 90vw;
    box-shadow: var(--panel-shadow);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.map-title svg {
    opacity: 0.7;
    transition: opacity 0.2s;
    padding-top: 5px;
}
.city-selector-link:hover .map-title svg { opacity: 1; }

.listings-origin-pick-bar {
    --map-hint-icon-size: 1.25rem;
    --map-hint-pad-x: 14px;
    margin-top: 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 8px;
    box-sizing: border-box;
    max-width: none;
    padding: 10px var(--map-hint-pad-x);
    border-radius: 20px;
    background: var(--accent-blue);
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.3;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    pointer-events: auto;
    white-space: normal;
    text-align: center;
}
.listings-origin-pick-bar[hidden] {
    display: none !important;
}
.listings-origin-pick-bar .map-hint__body {
    grid-column: 1;
}
.listings-origin-pick-bar__cancel[hidden] {
    display: none !important;
}
.listings-search-area-btn {
    pointer-events: auto;
    margin-top: 10px;
    appearance: none;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    background: var(--panel-bg);
    color: #fff;
    font: 600 clamp(0.75rem, 2.8vw, 0.88rem) system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: saturate(1.2) blur(6px);
    cursor: pointer;
    max-width: calc(100vw - 24px);
    transition: background 0.15s ease, transform 0.02s ease;
}
.listings-search-area-btn[hidden] {
    display: none !important;
}
.listings-search-area-btn:hover {
    background: rgba(36, 38, 44, 0.98);
}
.listings-search-area-btn:active {
    transform: translateY(1px);
}
body.listings-origin-pick .listings-search-area-btn {
    display: none !important;
}
.listings-origin-pick-bar__text {
    margin: 0;
    font: inherit;
    color: inherit;
}
.listings-origin-pick-bar__cancel {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-radius: 8px;
    padding: 6px 12px;
    font: 600 0.82rem/1 Inter, system-ui, sans-serif;
    cursor: pointer;
    justify-self: end;
}
.listings-origin-pick-bar__cancel:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.65);
}

body.listings-origin-pick .listings-change-origin-btn {
    display: none !important;
}
/* Rail collapse is driven by .listings-rail-collapsed (same animated grid as the toggle). */
body.listings-origin-pick .listings-rail-reopen-group {
    visibility: hidden !important;
    pointer-events: none !important;
}
/* Mobile listings view switcher — shown only ≤820px */
.listings-view-switcher {
    display: none;
}
body.listings-origin-pick .listings-view-switcher {
    visibility: hidden !important;
    pointer-events: none !important;
}
body.listings-origin-pick .listing-price-pill {
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Listings panel: stay filters by default; day/time only while changing origin */
body[data-map-mode="listings"] .listings-panel-title--travel,
body[data-map-mode="listings"].listings-origin-pick .listings-panel-title--stay {
    display: none;
}
body[data-map-mode="listings"].listings-origin-pick .listings-panel-title--travel {
    display: inline;
}
body[data-map-mode="listings"]:not(.listings-origin-pick) .listings-map-settings {
    display: none;
}
body.listings-origin-pick .listings-stay-settings {
    display: none;
}

.listings-stay-settings,
.listings-map-settings {
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.listings-search-mode-row {
    width: 100%;
}
.listings-search-mode-field {
    width: 100%;
    max-width: none;
}
.listings-search-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    height: var(--tf-field-h, 2.25rem);
    box-sizing: border-box;
    border-radius: var(--tf-radius, 8px);
    border: 1px solid var(--tf-field-border, rgba(255, 255, 255, 0.14));
    background: var(--tf-field-bg, rgba(255, 255, 255, 0.07));
    overflow: hidden;
}
.listings-search-mode__option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    min-width: 0;
    height: 100%;
    cursor: pointer;
    user-select: none;
    color: rgba(255, 255, 255, 0.55);
    transition: background 0.12s ease, color 0.12s ease;
}
.listings-search-mode__option + .listings-search-mode__option {
    border-left: 1px solid var(--tf-field-border, rgba(255, 255, 255, 0.14));
}
.listings-search-mode__option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.listings-search-mode__text {
    font: 600 0.9rem/1 Inter, system-ui, sans-serif;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.listings-search-mode__option:hover {
    color: rgba(255, 255, 255, 0.88);
    background: var(--tf-field-bg-hover, rgba(255, 255, 255, 0.1));
}
.listings-search-mode__option:has(input:checked) {
    color: #fff;
    background: rgba(43, 92, 255, 0.38);
}
.listings-search-mode__option:has(input:focus-visible) {
    outline: 2px solid rgba(43, 92, 255, 0.7);
    outline-offset: -2px;
    z-index: 1;
}
.listings-search-mode--disabled,
.listings-search-mode--disabled .listings-search-mode__option {
    cursor: not-allowed;
    opacity: 0.48;
    pointer-events: none;
}
.listings-search-mode--disabled .listings-search-mode__option:hover {
    color: rgba(255, 255, 255, 0.55);
    background: transparent;
}

body[data-map-mode="listings"] #timeForm .listings-search-mode-row .listings-search-mode-field {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Listings Stay panel — compact, fonts aligned with Categories */
body[data-map-mode="listings"] .nav-panel .navigation__header,
body[data-map-mode="listings"] .nav-panel > header {
    padding: 6px 10px;
    font-size: 0.95rem;
}
body[data-map-mode="listings"] #timeForm {
    --tf-field-h: 2.25rem;
    --tf-radius: 8px;
    gap: 8px;
    padding: 8px 10px 10px;
    width: 100%;
    max-width: 100%;
}
body[data-map-mode="listings"] #timeForm .time-form-row {
    gap: 6px;
}
body[data-map-mode="listings"] #timeForm .time-form-row > label,
body[data-map-mode="listings"] #timeForm label {
    gap: 3px;
}
body[data-map-mode="listings"] #timeForm .lbl,
body[data-map-mode="listings"] .listings-children-ages .listings-child-age .lbl {
    font-size: 0.6875rem;
    letter-spacing: 0.07em;
}
body[data-map-mode="listings"] #timeForm select,
body[data-map-mode="listings"] #timeForm input[type="time"],
body[data-map-mode="listings"] #timeForm input[type="date"],
body[data-map-mode="listings"] #timeForm input[type="number"],
body[data-map-mode="listings"] #timeForm input[type="text"],
body[data-map-mode="listings"] .listings-child-age__trigger {
    font-size: 0.9rem;
    padding-left: 0.55rem;
}
/* Arrival / Departure: equal columns spanning the full Stay row */
body[data-map-mode="listings"] #timeForm .listings-stay-row > label {
    flex: 1 1 0%;
    width: auto;
    min-width: 0;
    max-width: none;
}
body[data-map-mode="listings"] #timeForm .listings-stay-row .time-input-shell {
    width: 100%;
    max-width: none;
}
body[data-map-mode="listings"] #timeForm .listings-stay-row .stay-date-trigger {
    width: 100%;
    max-width: none;
    padding-right: 2.1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8e8ea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 1.0625rem 1.0625rem;
    background-position: right 0.65rem center;
    letter-spacing: -0.01em;
    cursor: pointer;
}
body[data-map-mode="listings"] #timeForm .listings-guests-row,
body[data-map-mode="listings"] #timeForm .listings-price-row,
body[data-map-mode="listings"] .listings-stay-settings,
body[data-map-mode="listings"] .listings-map-settings,
body[data-map-mode="listings"] .listings-children-ages {
    width: 100%;
}
body[data-map-mode="listings"] .listings-stay-settings,
body[data-map-mode="listings"] .listings-map-settings {
    gap: 8px;
}
body[data-map-mode="listings"] .listings-children-ages {
    gap: 8px 6px;
}
body[data-map-mode="listings"] .listings-children-ages .listings-child-age {
    gap: 3px;
}
body[data-map-mode="listings"] .listings-child-age__trigger {
    height: var(--tf-field-h, 2.25rem);
    border-radius: var(--tf-radius, 8px);
    padding-right: 1.85rem;
    background-position: right 0.5rem center;
    background-size: 12px 12px;
}
body[data-map-mode="listings"] .listings-child-age__option {
    padding: 6px 8px;
    font-size: 0.9rem;
}
body[data-map-mode="listings"] #timeForm .btn-primary {
    margin-top: 2px;
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.listings-children-ages {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 8px;
    min-width: 0;
    max-width: 100%;
}
.listings-children-ages[hidden] {
    display: none !important;
}
.listings-children-ages .listings-child-age {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.listings-children-ages .listings-child-age .lbl {
    font-size: 0.75rem;
}
.listings-child-age__trigger {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    height: var(--tf-field-h, 2.5rem);
    box-sizing: border-box;
    padding: 0 2.35rem 0 0.75rem;
    border-radius: var(--tf-radius, 10px);
    border: 1px solid var(--tf-field-border, rgba(255, 255, 255, 0.14));
    background-color: var(--tf-field-bg, rgba(255, 255, 255, 0.07));
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 14px 14px;
    color: var(--panel-text);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 1px 2px rgba(0, 0, 0, 0.22);
}
.listings-child-age__trigger:hover {
    background-color: var(--tf-field-bg-hover, rgba(255, 255, 255, 0.1));
    border-color: var(--tf-field-border-hover, rgba(255, 255, 255, 0.22));
}
.listings-child-age.is-open .listings-child-age__trigger {
    border-color: rgba(43, 92, 255, 0.55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.22),
        0 0 0 2px rgba(43, 92, 255, 0.45);
}
.listings-child-age__menu {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 4px);
    z-index: 30;
    margin: 0;
    padding: 4px;
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    background: var(--panel-bg-opaque);
    color: var(--panel-text);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.listings-child-age__menu[hidden] {
    display: none !important;
}
.listings-child-age__option {
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--panel-text);
}
.listings-child-age__option:hover {
    background: var(--panel-surface-hover);
}
.listings-child-age__option.is-selected {
    background: var(--accent-blue);
    color: #fff;
}

.subheader {
    display: inline-block;
    background: var(--panel-bg);
    padding: 6px 12px;
    border-radius: 8px;
    color: var(--panel-text);
    font: 500 clamp(12px, 1.6vw, 16px)/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    backdrop-filter: saturate(1.2) blur(6px);
    box-shadow: var(--panel-shadow);
    max-width: 35vw;
}

/* ── Logo ── */
.logo-fixed {
    position: fixed;
    top: max(0px, env(safe-area-inset-top));
    z-index: 1000;
    display: inline-block;
    height: 130px;
    width: 110px;
    margin: 10px;
}
/* Listings desktop: logo already in Places rail — hide map-corner logo */
@media (min-width: 821px) {
    body[data-map-mode="listings"] a:has(> .logo-fixed) {
        display: none;
    }
}

/* ── Side buttons ── */
.side-button {
    position: fixed;
    z-index: 1000;
    width: 35px;
    height: 35px;
    padding: 0;
    display: grid;
    place-items: center;
    background: var(--side-btn-bg);
    color: var(--side-btn-color);
    border: none;
    border-radius: 8px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}
.general-info {
    top: max(170px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
}
.general-info svg { width: 22px; height: 22px; }

/* ── Panels (nav-panel + legend share base styles) ── */
.nav-panel,
.legend {
    background: var(--panel-bg);
    color: var(--panel-text);
    position: absolute;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: saturate(1.2) blur(6px);
    max-width: min(86vw, 360px);
    overflow: hidden;
    bottom: 10px;
    box-sizing: border-box;
}
.nav-panel {
    z-index: 11;
    /* min-width must not exceed max-width or the panel overflows its map column */
    width: min(360px, calc(100% - 20px));
    min-width: 0;
    right: 10px;
}
.nav-panel:has(.listings-child-age.is-open) {
    overflow: visible;
}
.legend    { z-index: 10; min-width: 260px; left: 10px; }

/* Listings Stay / Day & Time panel — same width as other map modes */
body[data-map-mode="listings"] .nav-panel {
    width: min(360px, calc(100% - 20px));
    max-width: min(92vw, calc(100% - 20px));
}
/* Collapsed Filters must beat the listings width above (same as Categories). */
body[data-map-mode="listings"] .nav-panel.is-header-collapsed {
    width: max-content;
    max-width: none;
    min-width: 0;
}

/* ── Panel + popover headers ── */
aside header,
.pop-inner > header {
    background: var(--panel-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    font-weight: 600;
    border-bottom: 1px solid white;
}
.nav-panel .navigation__header,
.nav-panel > header {
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}
.pop-inner > header {
    margin: -10px -12px 0;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

/* ── Time form (Day & departure) ── */
#timeForm {
    --tf-field-bg: rgba(255, 255, 255, 0.07);
    --tf-field-bg-hover: rgba(255, 255, 255, 0.1);
    --tf-field-border: rgba(255, 255, 255, 0.14);
    --tf-field-border-hover: rgba(255, 255, 255, 0.22);
    --tf-field-h: 2.5rem;
    --tf-radius: 10px;
    --tf-focus: 0 0 0 2px rgba(43, 92, 255, 0.45);

    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px 12px 14px;
    min-width: 0;
}

/* Hidden fields must not consume grid rows if UA gives them a box */
#timeForm > input[type="hidden"] {
    display: none !important;
}

/* Flex row: iOS WebKit often ignores width inside CSS grid for type="time" */
#timeForm .time-form-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

#timeForm .time-form-row > label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 0%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
}

#timeForm label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    min-width: 0;
}

/* Pin controls to the bottom of each column so Day + Time line up when label heights differ */
#timeForm select#daySelect,
#timeForm .time-input-shell {
    margin-top: auto;
}

/* Flex host: WebKit time inputs shrink correctly as flex items, not as nested grid blocks */
#timeForm .time-input-shell {
    display: flex;
    flex-direction: row;
    align-items: center;
    box-sizing: border-box;
    height: var(--tf-field-h);
    min-height: var(--tf-field-h);
    max-height: var(--tf-field-h);
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Native date/number controls have large intrinsic min-widths — force shrink in 2-col rows */
#timeForm .listings-stay-row .time-input-shell,
#timeForm .listings-guests-row input[type="number"],
#timeForm .listings-price-row input[type="number"],
#timeForm .listings-children-ages select {
    min-width: 0 !important;
    max-width: 100%;
}

#timeForm .listings-guests-row input[type="number"],
#timeForm .listings-price-row input[type="number"] {
    /* Spinners + long padding were blowing the right column past the panel */
    padding-right: 0.5rem;
}

/* Native time inputs keep a large intrinsic min-width in WebKit */
#timeForm .time-field {
    min-width: 0;
}

#timeForm .lbl {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(232, 232, 234, 0.68);
}
#timeForm .lbl--required::after {
    content: " *";
    color: #f87171;
    font-weight: 700;
}

#timeForm .time-input-shell input[type="time"],
#timeForm .time-input-shell input[type="date"] {
    flex: 1 1 auto;
    min-width: 0 !important;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
}

#timeForm select,
#timeForm input[type="time"],
#timeForm input[type="date"],
#timeForm input[type="number"],
#timeForm input[type="text"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    background-color: var(--tf-field-bg);
    color: var(--panel-text);
    box-sizing: border-box;
    height: var(--tf-field-h);
    min-height: var(--tf-field-h);
    max-height: var(--tf-field-h);
    padding: 0 2.35rem 0 0.75rem;
    border-radius: var(--tf-radius);
    border: 1px solid var(--tf-field-border);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.2;
    color-scheme: dark;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 1px 2px rgba(0, 0, 0, 0.22);
    cursor: pointer;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

#timeForm input[type="number"],
#timeForm input[type="text"] {
    padding-right: 0.75rem;
    cursor: text;
}

#timeForm select:hover,
#timeForm input[type="time"]:hover,
#timeForm input[type="date"]:hover,
#timeForm input[type="number"]:hover,
#timeForm input[type="text"]:hover {
    background-color: var(--tf-field-bg-hover);
    border-color: var(--tf-field-border-hover);
}

#timeForm select:focus,
#timeForm input[type="time"]:focus,
#timeForm input[type="date"]:focus,
#timeForm input[type="number"]:focus,
#timeForm input[type="text"]:focus {
    outline: none;
    border-color: rgba(43, 92, 255, 0.55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.22),
        var(--tf-focus);
}

#timeForm select#daySelect,
#timeForm .listings-child-age__select {
    display: flex;
    align-items: center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 14px 14px;
    color-scheme: dark;
}

#timeForm input[type="time"] {
    position: relative;
    overflow: hidden;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l4 2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 1.0625rem 1.0625rem;
}

#timeForm input[type="date"] {
    position: relative;
    overflow: hidden;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M8 3v4M16 3v4M3 11h18'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 1.0625rem 1.0625rem;
}

#timeForm input[type="time"]::-webkit-calendar-picker-indicator,
#timeForm input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 2.25rem;
    height: auto;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
}

#timeForm input[type="date"]::-webkit-datetime-edit,
#timeForm input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
    max-width: 100%;
    min-width: 0;
}

#timeForm input[type="date"]::-webkit-datetime-edit {
    max-width: 100%;
    overflow: hidden;
}

#timeForm input[type="time"]::-webkit-datetime-edit,
#timeForm input[type="time"]::-webkit-datetime-edit-fields-wrapper,
#timeForm input[type="time"]::-webkit-datetime-edit-hour-field,
#timeForm input[type="time"]::-webkit-datetime-edit-minute-field,
#timeForm input[type="time"]::-webkit-datetime-edit-ampm-field,
#timeForm input[type="time"]::-webkit-datetime-edit-text {
    font-family: inherit !important;
    font-variant-numeric: proportional-nums;
    font-feature-settings: normal;
}

#timeForm input[type="time"]::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
    max-width: 100%;
    min-width: 0;
}

#timeForm input[type="time"]::-webkit-datetime-edit {
    max-width: 100%;
    overflow: hidden;
}
#timeForm input[type="time"]::-webkit-datetime-edit-text {
    padding: 0 0.12em;
}
#timeForm input[type="time"]::-webkit-datetime-edit-hour-field,
#timeForm input[type="time"]::-webkit-datetime-edit-minute-field,
#timeForm input[type="time"]::-webkit-datetime-edit-ampm-field {
    padding: 0;
}

#timeForm select option,
#timeForm select#daySelect option,
#timeForm .listings-child-age__select option {
    background-color: #1e2128;
    color: #e8e8ea;
}

.btn-primary {
    background: var(--accent-blue);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 3px;
    font: inherit;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.02s ease;
}
.btn-primary:hover { background: var(--accent-blue-hover); }
#timeForm .btn-primary,
#multiOriginPanel .btn-primary {
    grid-column: 1 / -1;
    margin-top: 4px;
    border-radius: 10px;
    padding: 0.55rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(180deg, #4a74ff 0%, var(--accent-blue) 55%, #2a4fd4 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 2px 10px rgba(43, 92, 255, 0.35);
    transition:
        background 0.18s ease,
        transform 0.02s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        filter 0.18s ease;
}
#timeForm .btn-primary:not(:disabled):hover,
#multiOriginPanel .btn-primary:not(:disabled):hover {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 4px 18px rgba(43, 92, 255, 0.45);
    filter: brightness(1.04);
    border-color: rgba(255, 255, 255, 0.28);
}
#timeForm .btn-primary:not(:disabled):active,
#multiOriginPanel .btn-primary:not(:disabled):active { transform: translateY(1px); }
#timeForm .btn-primary:disabled,
#multiOriginPanel .btn-primary:disabled {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(200, 204, 214, 0.65);
    cursor: not-allowed;
    opacity: 1;
    box-shadow: none;
    pointer-events: none;
    filter: none;
}

/* ── Collapsible panel bodies ── */
#navigation-body,
#legend-body {
    box-sizing: border-box;
    overflow: hidden;
    min-width: 0;
    height: auto;
    /* Duration matched in bindCollapsibleMapPanel (inline transition during anim) */
    transition: height 0.4s ease;
}
#navigation-body:has(.listings-child-age.is-open) {
    overflow: visible;
}
#navigation-body[hidden],
#legend-body[hidden] { display: none; }

#legend-body {
    padding: 0;
}

.legend__body-inner {
    margin: 0;
    padding: 12px 12px 14px;
}

.nav-panel:has(.legend__toggle[aria-expanded="false"]) #navigation-body { height: 0; }
.legend:has(.legend__toggle[aria-expanded="false"]) #legend-body { height: 0; }

/* Applied after height/width collapse finishes — avoids mid-animation jumps */
.nav-panel.is-header-collapsed,
.legend.is-header-collapsed {
    width: max-content;
    min-width: 0;
}
.nav-panel.is-header-collapsed #navigation-body,
.legend.is-header-collapsed #legend-body {
    padding: 0;
}
.nav-panel.is-header-collapsed .navigation__header,
.legend.is-header-collapsed .legend__header {
    border: 0;
}

/* ── Legend (Categories) — glass rows aligned with #timeForm ── */
.legend__title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.legend table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.legend tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 12px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 1px 2px rgba(0, 0, 0, 0.22);
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.legend tbody tr:last-child {
    margin-bottom: 0;
}

.legend tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.22);
}

.legend__category-cell {
    min-width: 0;
    display: inline-flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
}

.legend__name {
    font-weight: 500;
}

.legend__range-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 0.2rem;
    text-align: right;
    min-width: 0;
}

.legend__range {
    font-variant-numeric: tabular-nums;
    color: rgba(232, 232, 234, 0.9);
    white-space: nowrap;
}

#legend .legend__area-col {
    display: none;
}

#legend.legend--dev-on .legend__area-col {
    display: block;
    font-variant-numeric: tabular-nums;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(186, 192, 206, 0.82);
    white-space: nowrap;
    line-height: 1.25;
}

#legend.legend--dev-on .legend__area-col::before {
    content: "[";
    color: rgba(255, 255, 255, 0.35);
    font-weight: 500;
}

#legend.legend--dev-on .legend__area-col::after {
    content: "]";
    color: rgba(255, 255, 255, 0.35);
    font-weight: 500;
}

.legend td {
    padding: 0;
    border: none;
    vertical-align: middle;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.2;
}

.legend td:last-child {
    /* Time range column */
    min-width: 0;
}

.legend th {
    padding: 0;
    border: none;
}

.swatch {
    width: 13px;
    height: 13px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    display: inline-block;
    margin-right: 8px;
    vertical-align: -2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ── Icon buttons ── */
.icon-btn {
    width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    cursor: pointer;
    border-radius: 50%;
    background: var(--icon-btn-bg);
    color: #111827;
    position: relative;
    transition: background 0.15s ease;
}
.icon-btn:hover { background: white; }
.icon-btn:focus-visible { outline: none; }
.icon-btn::before {
    content: "";
    position: absolute;
    inset: -5px;
}

/* ── Info popover layout ── */
.info-popover {
    position: relative;
    display: flex;
    gap: 10px;
    margin-left: 0;
    flex-shrink: 0;
    line-height: 0;
}
aside header .info-popover,
.legend__header .info-popover {
    margin-left: auto;
}

/* Collapsed headers: no auto-margin stretch — rely on gap between title and icons */
.nav-panel.is-header-collapsed .info-popover,
.legend.is-header-collapsed .info-popover {
    margin-left: 0;
}

/* ── Map dock panels: header icon controls (Day & Time + Categories) ── */
#info-btn.icon-btn,
#navigation-toggle.legend__toggle.icon-btn,
#legend-toggle.legend__toggle.icon-btn,
#legend-edit-categories-btn.legend__edit-btn.map-dev-category-edit--visible {
    place-items: center;
    width: 2.125rem;
    height: 1.875rem;
    min-width: 2.125rem;
    padding: 0;
    border-radius: 8px;
    background: var(--panel-control-bg);
    border: 1px solid var(--panel-border);
    color: var(--panel-text);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.18);
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.12s ease;
}

#info-btn.icon-btn:hover,
#navigation-toggle.legend__toggle.icon-btn:hover,
#legend-toggle.legend__toggle.icon-btn:hover,
#legend-edit-categories-btn.legend__edit-btn.map-dev-category-edit--visible:hover {
    background: var(--panel-control-bg-hover);
    border-color: var(--panel-border-strong);
    color: var(--panel-text-strong);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.22);
    transform: translateY(-1px);
}

#info-btn.icon-btn:active,
#navigation-toggle.legend__toggle.icon-btn:active,
#legend-toggle.legend__toggle.icon-btn:active,
#legend-edit-categories-btn.legend__edit-btn.map-dev-category-edit--visible:active {
    transform: translateY(0);
}

#info-btn.icon-btn:focus-visible,
#navigation-toggle.legend__toggle.icon-btn:focus-visible,
#legend-toggle.legend__toggle.icon-btn:focus-visible,
#legend-edit-categories-btn.legend__edit-btn.map-dev-category-edit--visible:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(43, 92, 255, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.18);
}

/* ── Toggle chevron ── */
.legend__toggle .chev {
    width: 20px;
    height: 20px;
    color: currentColor;
    transition: transform 0.4s ease;
    transform-origin: 50% 50%;
    transform: rotate(180deg);
}
.legend__toggle[aria-expanded="true"] .chev { transform: rotate(0deg); }

/* ── Popover panel ── */
.pop {
    position: fixed;
    z-index: 10020;
    min-inline-size: 220px;
    max-inline-size: min(86vw, 360px);
    color: var(--panel-text);
    background: var(--panel-bg);
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
    backdrop-filter: saturate(1.2) blur(6px);
    padding: 10px 12px;
}
.pop[hidden] { display: none !important; }
.pop-inner { display: grid; gap: 6px; }
.pop-inner p { margin: 0; line-height: 1.5; color: var(--panel-text); }

.pop-close {
    padding: 2px;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--icon-btn-bg);
    font-size: 14px;
    border-radius: 4px;
}
.pop-close:hover { color: var(--panel-text); }
.pop-close:focus-visible { outline: none; }

/* ── Popover arrow ── */
.pop-arrow {
    position: absolute;
    inline-size: 10px;
    block-size: 10px;
    background: #1d1f24;
    transform: rotate(45deg);
}
.pop:not([data-placement="bottom"]) .pop-arrow { bottom: -6px; left: 12px; }
.pop[data-placement="bottom"] .pop-arrow { top: -5px; left: 12px; }
.pop[data-align="end"] .pop-arrow { left: auto; right: 12px; }

/* ── Map hints ── */
#map-hint,
#map-hint-action {
    --map-hint-icon-size: 1.125rem;
    --map-hint-pad-x: 14px;
    position: fixed;
    left: 50%;
    top: 38%;
    transform: translateX(-50%);
    z-index: 12;
    display: block;
    box-sizing: border-box;
    padding: 10px var(--map-hint-pad-x);
    border-radius: 20px;
    font-size: 0.9rem;
    line-height: 1.3;
    pointer-events: none;
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    white-space: normal;
    max-width: calc(100vw - 24px);
    text-align: center;
}
/* Icon on the left; copy centered in the remaining space to the right edge. */
.map-hint__body {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 0.45rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.map-hint__body > svg,
.map-hint-icon {
    width: var(--map-hint-icon-size, 1.125rem);
    height: var(--map-hint-icon-size, 1.125rem);
    flex-shrink: 0;
    pointer-events: none;
    justify-self: start;
}
#map-hint-text,
#map-hint-action-text,
.listings-origin-pick-bar__text {
    display: block;
    margin: 0;
    min-width: 0;
    text-align: center;
    text-wrap: balance;
    overflow-wrap: break-word;
    white-space: normal;
}
/* display:block above beats the UA [hidden] rule — force hide after fade. */
#map-hint[hidden],
#map-hint-action[hidden] { display: none !important; }

#map-hint {
    background: var(--panel-bg);
    color: white;
    transition: opacity 0.3s ease;
}
/* Single / multi / listings: sit under the header controls. */
body[data-map-mode="single"] #map-hint,
body[data-map-mode="single"] #map-hint-action,
body[data-map-mode="multi"] #map-hint,
body[data-map-mode="multi"] #map-hint-action,
body[data-map-mode="listings"] #map-hint {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    z-index: auto;
    margin-top: 8px;
    max-width: none;
    white-space: normal;
}
body[data-map-mode="single"] #map-hint,
body[data-map-mode="single"] #map-hint-action,
body[data-map-mode="multi"] #map-hint,
body[data-map-mode="multi"] #map-hint-action,
body[data-map-mode="listings"] #map-hint {
    --map-hint-icon-size: 1.25rem;
}
body[data-map-mode="single"] #map-hint,
body[data-map-mode="multi"] #map-hint,
body[data-map-mode="listings"] #map-hint {
    background: var(--accent-blue);
    color: #fff;
}
/* Pick bar owns the starting-point prompt while choosing an origin. */
body.listings-origin-pick #map-hint {
    display: none !important;
}
#map-hint.map-hint--hidden { opacity: 0; }
#map-hint-action {
    background: var(--accent-blue);
    color: #fff;
}

@keyframes btn-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(43, 92, 255, 0.7); }
    60%  { box-shadow: 0 0 0 8px rgba(43, 92, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(43, 92, 255, 0); }
}
.btn--pulse { animation: btn-pulse 0.7s ease-out 2; }

/* ── MapLibre controls ── */
.maplibregl-ctrl-group { border-radius: 8px; }
.maplibregl-ctrl-group button { width: 35px; height: 35px; }
.maplibregl-ctrl-group .maplibregl-ctrl-icon { background-size: 80% 80%; }

/* ── Onboarding / tutorial ── */
.skip-btn {
    background: transparent;
    border: none;
    color: #d0d0d0;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}
.skip-btn:hover { color: #ffffff; }

.tutorial-buttons {
    display: none;
    justify-content: space-between;
    align-items: center;
}
.tutorial-buttons button {
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    font: inherit;
    cursor: pointer;
    background: var(--accent-blue);
    color: white;
}
.tutorial-buttons .skip-btn {
    background: transparent;
    color: #d0d0d0;
    padding: 0;
}
.tutorial-progress { margin: 0 8px; }

.floating-clone {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    margin: 0;
    transform: translate3d(0, 0, 0);
}
#info-btn-onboarding { display: none; }

/* ── Responsive ── */
@media (prefers-reduced-motion: reduce) {
    .legend__toggle .chev,
    #legend-body,
    #navigation-body { transition: none; }
    .address-search-panel { transition: none; }
    #info-btn.icon-btn,
    #navigation-toggle.legend__toggle.icon-btn,
    #legend-toggle.legend__toggle.icon-btn,
    #legend-edit-categories-btn.legend__edit-btn.map-dev-category-edit--visible {
        transition: none;
    }
}

@media (max-width: 640px) {
    .map-title { font-size: 1.5rem; line-height: 1.0; }
    .subheader { font-size: 0.8rem; }

    .address-search-trigger__text {
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .bottom-dock {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        z-index: 11;
        pointer-events: none;
        align-items: end;
    }
    .bottom-dock > .legend,
    .bottom-dock > .nav-panel {
        pointer-events: auto;
        position: static !important;
        max-width: none !important;
        /* Desktop uses min-width: 360px — allow panels to shrink to the viewport */
        min-width: 0 !important;
        /* No !important on width — collapse/expand JS animates inline width */
        width: 100%;
        box-sizing: border-box;
    }
    /* Listings desktop rule is more specific — keep mobile dock full-bleed like other maps */
    body[data-map-mode="listings"] .bottom-dock > .nav-panel {
        width: 100%;
        max-width: none;
    }
    /* One panel closed → full row. Both closed → share one row 50/50. */
    .bottom-dock > .nav-panel.is-header-collapsed,
    .bottom-dock > .legend.is-header-collapsed {
        width: 100%;
    }
    .bottom-dock.bottom-dock--both-collapsed {
        /* minmax(0,1fr) keeps equal columns — plain 1fr can grow with header content */
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: stretch;
    }
    /* Match desktop: Categories left, Day & Time / Stay right */
    .bottom-dock.bottom-dock--both-collapsed > .legend {
        order: 1;
    }
    .bottom-dock.bottom-dock--both-collapsed > .nav-panel {
        order: 2;
    }
    .bottom-dock.bottom-dock--both-collapsed > .nav-panel,
    .bottom-dock.bottom-dock--both-collapsed > .legend {
        width: 100%;
        max-width: none !important;
        min-width: 0 !important;
        height: 100%;
        align-self: stretch;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    /* Same header chrome height for both collapsed pills */
    .bottom-dock.bottom-dock--both-collapsed .navigation__header,
    .bottom-dock.bottom-dock--both-collapsed .legend__header {
        flex-wrap: nowrap !important;
        align-items: center;
        row-gap: 0;
        column-gap: 8px;
        padding: 8px 10px !important;
        min-height: 2.75rem;
        box-sizing: border-box;
    }
    .bottom-dock.bottom-dock--both-collapsed .info-popover {
        gap: 6px;
        flex-shrink: 0;
        margin-left: auto;
    }
    .bottom-dock.bottom-dock--both-collapsed .navigation__header > span,
    .bottom-dock.bottom-dock--both-collapsed .legend__title,
    .bottom-dock.bottom-dock--both-collapsed .listings-panel-title {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Categories header: keep title + edit + collapse on narrow widths */
    .legend__header {
        flex-wrap: wrap;
        row-gap: 8px;
        column-gap: 10px;
        align-items: center;
    }

    .legend__header .legend__title {
        flex: 1 1 0;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .legend__header .info-popover {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 8px;
        margin-left: auto;
    }

    /* WebKit time UI — mobile: favor Day width, match control heights, nudge time text start */
    #timeForm {
        gap: 10px;
        padding: 12px 12px 14px;
    }

    #timeForm .time-form-row {
        gap: 6px;
    }

    /* Equal column widths (share row 50/50 minus gap) */
    #timeForm .time-form-row > .day-field,
    #timeForm .time-form-row > .time-field {
        flex: 1 1 0%;
        min-width: 0;
    }

    #timeForm select#daySelect {
        font-size: 0.9375rem;
        padding-right: 2rem;
    }

    #timeForm #departureTimeInput {
        direction: ltr;
        text-align: left !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l4 2'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.5rem center;
        background-size: 1rem 1rem;
        padding: 0 1.9rem 0 0.75rem;
        font-size: 0.9375rem;
        overflow: hidden;
    }

    #timeForm input[type="time"]::-webkit-calendar-picker-indicator,
    #timeForm input[type="date"]::-webkit-calendar-picker-indicator {
        width: 1.9rem;
    }

    #timeForm input[type="time"]::-webkit-datetime-edit-fields-wrapper {
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center;
        width: 100% !important;
        box-sizing: border-box;
        padding-inline-start: 2px;
    }

    #timeForm input[type="time"]::-webkit-datetime-edit {
        overflow: hidden;
        max-width: 100%;
        margin-inline: 0 !important;
        text-align: start !important;
        direction: ltr !important;
        width: auto !important;
        flex: 0 0 auto !important;
    }

    #timeForm input[type="time"]::-webkit-datetime-edit,
    #timeForm input[type="time"]::-webkit-datetime-edit-fields-wrapper,
    #timeForm input[type="time"]::-webkit-datetime-edit-hour-field,
    #timeForm input[type="time"]::-webkit-datetime-edit-minute-field,
    #timeForm input[type="time"]::-webkit-datetime-edit-ampm-field,
    #timeForm input[type="time"]::-webkit-datetime-edit-text {
        font-size: 0.9375rem !important;
    }

    #timeForm input[type="time"]::-webkit-datetime-edit-hour-field,
    #timeForm input[type="time"]::-webkit-datetime-edit-minute-field,
    #timeForm input[type="time"]::-webkit-datetime-edit-ampm-field {
        text-align: start !important;
    }

    .logo-fixed { height: 80px; width: 68px; }

    /* Long map hints: 77vw pill — icon left, centered copy; larger icon with 2-line copy */
    body[data-map-mode="single"] #map-hint:not([hidden]),
    body[data-map-mode="single"] #map-hint-action:not([hidden]),
    body[data-map-mode="multi"] #map-hint:not([hidden]),
    body[data-map-mode="multi"] #map-hint-action:not([hidden]),
    body[data-map-mode="listings"] #map-hint:not([hidden]),
    .listings-origin-pick-bar:not([hidden]) {
        --map-hint-icon-size: 1.35rem;
        --map-hint-pad-x: 12px;
        white-space: normal;
        width: 77vw;
        max-width: 77vw;
        box-sizing: border-box;
        display: block;
        text-align: center;
        padding: 8px var(--map-hint-pad-x);
        font-size: clamp(0.78rem, 3.4vw, 0.9rem);
        line-height: 1.3;
    }
    .map-hint__body {
        column-gap: 0.45rem;
    }
    #map-hint-text,
    #map-hint-action-text,
    .listings-origin-pick-bar__text {
        text-align: center;
        text-wrap: balance;
        overflow-wrap: break-word;
        white-space: normal;
    }
}

@media (min-width: 641px) {
    body[data-map-mode="single"] #map-hint,
    body[data-map-mode="single"] #map-hint-action,
    body[data-map-mode="multi"] #map-hint,
    body[data-map-mode="multi"] #map-hint-action,
    body[data-map-mode="listings"] #map-hint,
    .listings-origin-pick-bar {
        --map-hint-icon-size: 1.35rem;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .bottom-dock { display: flex; }
    .logo-fixed { height: 80px; width: 68px; }
}

/* Keep listings Stay compact even when the mobile #timeForm padding rule applies */
@media (max-width: 640px) {
    body[data-map-mode="listings"] #timeForm {
        gap: 8px;
        padding: 8px 10px 10px;
    }
}

/* Map page — edit travel-time categories (modal) */
html.category-edit-open {
    overflow: hidden;
}

.category-edit-backdrop {
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    z-index: 10010;
    margin: 0;
    padding: 0;
    border: none;
    background: rgba(6, 8, 12, 0.58);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    cursor: pointer;
}

.category-edit-backdrop:not([hidden]) {
    display: block;
}

.category-edit-backdrop[hidden],
.category-edit-dialog[hidden] {
    display: none !important;
}

.category-edit-dialog:not([hidden]) {
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    z-index: 10011;
    display: flex;
    align-items: center;
    justify-content: center;
    padding:
        max(12px, env(safe-area-inset-top))
        max(12px, env(safe-area-inset-right))
        max(12px, env(safe-area-inset-bottom))
        max(12px, env(safe-area-inset-left));
    pointer-events: none;
}

.category-edit-dialog__surface {
    pointer-events: auto;
    width: min(100%, 420px);
    max-height: min(88vh, 640px);
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    background: linear-gradient(165deg, rgba(34, 38, 48, 0.98) 0%, rgba(22, 24, 30, 0.99) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(0, 0, 0, 0.2) inset;
    color: #e8eaef;
    overflow: hidden;
}

.category-edit-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.category-edit-dialog__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    line-height: 1.25;
}

.category-edit-dialog__close {
    flex-shrink: 0;
    color: rgba(232, 234, 239, 0.85);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.category-edit-dialog__close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.category-edit-dialog__body {
    box-sizing: border-box;
    margin: 0;
    padding: 12px 16px 10px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.15);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.32) rgba(0, 0, 0, 0.2);
}

.category-edit-dialog__lede {
    margin: 0 0 16px;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: rgba(200, 204, 214, 0.92);
}

.category-edit-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.category-edit-field__label {
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(210, 214, 224, 0.88);
}

.category-edit-select,
.category-edit-input {
    font: inherit;
    font-size: 0.9rem;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.28);
    color: #f4f5f8;
    width: 100%;
    box-sizing: border-box;
}

.category-edit-select:focus,
.category-edit-input:focus {
    outline: none;
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

.category-edit-count {
    position: relative;
    min-width: 0;
}
.category-edit-count__trigger {
    appearance: none;
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 2.35rem 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background-color: rgba(0, 0, 0, 0.28);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 14px 14px;
    color: #f4f5f8;
    text-align: left;
    cursor: pointer;
}
.category-edit-count__trigger:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background-color: rgba(0, 0, 0, 0.36);
}
.category-edit-count.is-open .category-edit-count__trigger,
.category-edit-count__trigger:focus-visible {
    outline: none;
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}
.category-edit-count__menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 40;
    margin: 0;
    padding: 4px;
    list-style: none;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    background: var(--panel-bg-opaque);
    color: var(--panel-text);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.category-edit-count__menu[hidden] {
    display: none !important;
}
.category-edit-count__option {
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--panel-text);
}
.category-edit-count__option:hover {
    background: var(--panel-surface-hover);
}
.category-edit-count__option.is-selected {
    background: var(--accent-blue);
    color: #fff;
}

.category-edit-boundaries label[hidden] {
    display: none !important;
}

.category-edit-section-label {
    margin: 6px 0 10px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(168, 174, 188, 0.9);
}

.category-edit-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 4px;
}

.category-edit-row {
    display: grid;
    grid-template-columns: 28px 1fr 44px;
    align-items: center;
    gap: 10px;
}

.category-edit-row[hidden] {
    display: none !important;
}

.category-edit-row__idx {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.category-edit-name {
    min-width: 0;
    font: inherit;
    font-size: 0.9rem;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.28);
    color: #f4f5f8;
}

.category-edit-name:focus {
    outline: none;
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

.category-edit-color {
    width: 44px;
    height: 40px;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.category-edit-dialog__footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.15);
}

.category-edit-footer-btn {
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    border: none;
    transition: background 0.15s ease, transform 0.1s ease;
}

.category-edit-footer-btn:active {
    transform: translateY(1px);
}

.category-edit-footer-btn--ghost {
    background: transparent;
    color: rgba(200, 204, 214, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.category-edit-footer-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.category-edit-footer-btn--primary {
    background: linear-gradient(180deg, #4b7cff 0%, #355dde 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(53, 93, 222, 0.35);
}

.category-edit-footer-btn--primary:hover {
    filter: brightness(1.06);
}

/* Legend — edit categories (shown when JS adds .map-dev-category-edit--visible). */
#legend-edit-categories-btn.legend__edit-btn {
    display: none !important;
}

#legend-edit-categories-btn.legend__edit-btn.map-dev-category-edit--visible {
    display: inline-grid !important;
}

.legend__edit-icon {
    display: block;
    width: 15px;
    height: 15px;
}

@media (max-width: 640px) {
    .category-edit-dialog:not([hidden]) {
        align-items: flex-end;
    }

    .category-edit-dialog__surface {
        width: 100%;
        max-height: min(92dvh, 620px);
        border-radius: 14px 14px 0 0;
    }
}

.multi-origin-panel__actions {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    margin-top: 4px;
}

.multi-origin-panel__clear {
    flex: 0 0 auto;
    min-width: 5.5rem;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    color: var(--panel-text);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.02s ease;
}

.multi-origin-panel__clear:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.32);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.multi-origin-panel__clear:not(:disabled):active {
    transform: translateY(1px);
}

.multi-origin-panel__clear:disabled {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(200, 204, 214, 0.38);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
    cursor: not-allowed;
    pointer-events: none;
}

#multiOriginPanel .btn-primary {
    flex: 1 1 0;
    min-width: 0;
    margin-top: 0;
}


/* -- Stay date picker (cross-browser Arrival / Departure) -- */
.stay-date-shell {
    position: relative;
    width: 100%;
}
.stay-date-trigger {
    appearance: none;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    width: 100%;
    height: var(--tf-field-h, 2.25rem);
    min-height: var(--tf-field-h, 2.25rem);
    margin: 0;
    padding: 0 0.55rem;
    border: 1px solid var(--panel-border);
    border-radius: var(--tf-radius, 8px);
    background-color: var(--panel-control-bg);
    color: var(--panel-text);
    font: inherit;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
}
.stay-date-trigger:hover {
    border-color: var(--panel-border-strong);
    background-color: var(--panel-control-bg-hover);
}
.stay-date-trigger:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 1px;
}
.stay-date-trigger.is-picking {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(43, 92, 255, 0.28);
}
.stay-date-trigger__value.is-placeholder {
    color: var(--panel-text-faint);
}

.stay-date-picker {
    position: fixed;
    inset: 0;
    z-index: 80;
    pointer-events: none;
}
.stay-date-picker[hidden] {
    display: none !important;
}
.stay-date-picker__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    pointer-events: auto;
}
.stay-date-picker__panel {
    position: fixed;
    z-index: 1;
    top: 0;
    left: 0;
    width: min(20.5rem, calc(100vw - 20px));
    border-radius: 14px;
    border: 1px solid var(--panel-border);
    background: var(--panel-bg-opaque);
    color: var(--panel-text);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    padding: 12px 12px 14px;
    pointer-events: auto;
    will-change: transform;
    transition: transform 0.18s ease;
}
.stay-date-picker__arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--panel-bg-opaque);
    border-left: 1px solid var(--panel-border);
    border-top: 1px solid var(--panel-border);
    pointer-events: none;
    z-index: 2;
}
.stay-date-picker__panel[data-placement="below"] .stay-date-picker__arrow {
    top: -6px;
    transform: rotate(45deg);
}
.stay-date-picker__panel[data-placement="above"] .stay-date-picker__arrow {
    top: auto;
    bottom: -6px;
    transform: rotate(225deg);
}
.stay-date-picker__purpose {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--panel-text-muted);
    margin: 0 0 8px;
}
.stay-date-picker__header {
    display: grid;
    grid-template-columns: 2.25rem 1fr 2.25rem;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}
.stay-date-picker__title {
    text-align: center;
    font-weight: 650;
    font-size: 0.95rem;
    color: var(--panel-text-strong);
}
.stay-date-picker__nav {
    appearance: none;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    border: 1px solid var(--panel-border);
    background: var(--panel-control-bg);
    color: var(--panel-text);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
}
.stay-date-picker__nav:hover {
    background: var(--panel-control-bg-hover);
    border-color: var(--panel-border-strong);
}
.stay-date-picker__weekdays,
.stay-date-picker__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.stay-date-picker__weekdays {
    margin-bottom: 6px;
}
.stay-date-picker__weekdays span {
    text-align: center;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--panel-text-faint);
    padding: 2px 0;
}
.stay-date-picker__day {
    appearance: none;
    aspect-ratio: 1;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--panel-text);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 550;
    cursor: pointer;
    padding: 0;
}
.stay-date-picker__day:hover:not(:disabled) {
    background: var(--panel-surface-hover);
}
.stay-date-picker__day--today:not(.stay-date-picker__day--selected) {
    box-shadow: inset 0 0 0 1px var(--panel-border-strong);
}
.stay-date-picker__day--selected {
    background: var(--accent-blue);
    color: #fff;
}
.stay-date-picker__day--selected:hover {
    background: var(--accent-blue-hover);
}
.stay-date-picker__day--disabled,
.stay-date-picker__day:disabled {
    color: rgba(232, 232, 234, 0.28);
    cursor: not-allowed;
    background: transparent;
    text-decoration: none;
}
.stay-date-picker__day--empty {
    visibility: hidden;
    pointer-events: none;
}
body.stay-date-picker-open {
    overflow: hidden;
}
