body.app-home {
    overflow: hidden;
    overscroll-behavior: none;
}

.app-home .parking-map {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
}

.app-home .parking-map .leaflet-right {
    margin-right: env(safe-area-inset-right);
}

.app-home__topbar {
    position: fixed;
    top: max(0.75rem, env(safe-area-inset-top));
    left: max(0.75rem, env(safe-area-inset-left));
    right: max(0.75rem, env(safe-area-inset-right));
    z-index: 1010;
    --app-home-control-size: 2.75rem;
}

.app-home__topbar .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--app-home-control-size);
    padding-top: 0;
    padding-bottom: 0;
}

.app-home__topbar .btn-rounded-circle {
    width: var(--app-home-control-size);
    padding-left: 0;
    padding-right: 0;
}

/* LandKit's .btn-rounded-circle > * forces width: 1em on every child, which stretched a padding-sized dot into an oval. */
.app-home__dot {
    width: 0.875rem;
    height: 0.875rem;
}

.app-home__topbar > .btn:not(.btn-rounded-circle) {
    padding-left: 1rem;
    padding-right: 1rem;
}

.app-home__search {
    flex-wrap: nowrap;
    height: var(--app-home-control-size);
}

.app-home__search > .input-group-text {
    padding: 0 0 0 1rem;
}

.app-home__search > .form-control {
    height: 100%;
    padding: 0 .875rem 0 .625rem;
}

.app-home__search > .input-group-text.d-none + .form-control {
    padding-left: 1rem;
}

.app-home__search > .btn {
    padding-left: 0;
    padding-right: .875rem;
}

.app-home__topbar .form-control {
    /* 16px keeps iOS Safari from zooming the page when the field takes focus. */
    font-size: 1rem;
}

/* Safari ignores autocomplete="off" here and paints its autofill background over the pill. */
.app-home__topbar .form-control:-webkit-autofill,
.app-home__topbar .form-control:-webkit-autofill:hover,
.app-home__topbar .form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 100px var(--bs-white) inset;
    -webkit-text-fill-color: var(--bs-body-color);
    caret-color: var(--bs-body-color);
}

.app-home__topbar input[type="search"]::-webkit-search-cancel-button {
    display: none;
}

.app-home__results {
    position: absolute;
    left: 0;
    right: 0;
    max-height: 60vh;
    max-height: 60dvh;
    overflow-y: auto;
}

.bottom-sheet {
    position: fixed;
    left: max(0.5rem, env(safe-area-inset-left));
    right: max(0.5rem, env(safe-area-inset-right));
    bottom: calc(0.5rem + env(safe-area-inset-bottom));
    /* LandKit's .card is width: 100%, which would push the sheet past the right offset. */
    width: auto;
    z-index: 1000;
    height: 85vh;
    height: 85dvh;
    /* The half snap of bottom_sheet_controller, so the sheet does not open full height until the lazy controller loads. */
    transform: translateY(45%);
    transition: transform 0.25s ease-out;
    touch-action: none;
}

.bottom-sheet.is-dragging {
    transition: none;
}

.bottom-sheet__grip {
    cursor: grab;
}

.bottom-sheet__handle {
    width: 2.5rem;
    height: 0.3rem;
    border-radius: 1rem;
    background: var(--bs-gray-300);
}

/* The whole row opens the zone; the info icon is its keyboard and screen-reader entry. */
.app-home__zone {
    cursor: pointer;
    transition: background-color .15s ease-out;
}

.app-home__zone-info {
    color: var(--bs-gray-600);
}

.app-home__zone:hover .app-home__zone-info,
.app-home__zone-info:focus-visible {
    color: var(--bs-primary);
}

/* The zone's category colour, the same as its pin and cluster on the map. */
.app-home__zone-badge {
    background: var(--zone-color, #335eea);
    color: #fff;
}

.bottom-sheet__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

/* The drawer floats over the map like the sheet and the top bar; no utility can inset it by the safe area. */
.offcanvas.app-home__drawer {
    --app-home-drawer-inset: 0.5rem;
    top: calc(var(--app-home-drawer-inset) + env(safe-area-inset-top));
    right: max(var(--app-home-drawer-inset), env(safe-area-inset-right));
    bottom: calc(var(--app-home-drawer-inset) + env(safe-area-inset-bottom));
    width: min(24rem, calc(100vw - 2 * var(--app-home-drawer-inset)));
    /* Past its inset too, so no sliver of the hidden drawer or its shadow stays on screen. */
    transform: translateX(calc(100% + 2rem));
}

.offcanvas.app-home__drawer.show {
    transform: none;
}

.app-home .offcanvas-backdrop.show {
    opacity: .35;
}

@media (min-width: 768px) {
    .app-home__topbar {
        right: auto;
        width: 26rem;
        left: max(1rem, env(safe-area-inset-left));
    }

    .offcanvas.app-home__drawer {
        --app-home-drawer-inset: 1rem;
    }

    .bottom-sheet {
        left: max(1rem, env(safe-area-inset-left));
        right: auto;
        bottom: calc(1rem + env(safe-area-inset-bottom));
        width: 24rem;
    }

    .app-home .parking-map .leaflet-bottom.leaflet-left {
        left: calc(25.5rem + env(safe-area-inset-left));
    }

    /* Beside the sheet, not above it, so nothing else lifts them off the home indicator. */
    .app-home .parking-map .leaflet-bottom {
        margin-bottom: env(safe-area-inset-bottom);
    }
}

