/* Keep Leaflet's own controls, including keyboard operation and zoom limits. */
:is(.leaflet-container,.boat-map-rail) .leaflet-control-zoom.leaflet-bar {
    display: grid;
    gap: 6px;
    background: transparent;
    border: 0;
    box-shadow: none;
}
html :is(.leaflet-container,.boat-map-rail) .leaflet-control-zoom.leaflet-bar a {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 64px;
    height: 64px;
    min-height: 64px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255,255,255,.85);
    border-radius: 16px;
    background-color: var(--fv-zoom-bg);
    color: #fff;
    font: 700 34px/1 system-ui,sans-serif;
    text-decoration: none;
    text-shadow: 0 1px 2px #0006;
    box-shadow: 0 2px 7px #112b352b;
    touch-action: manipulation;
}
.leaflet-control-zoom-in { --fv-zoom-bg: rgba(5,104,63,.84); }
.leaflet-control-zoom-out { --fv-zoom-bg: rgba(157,38,44,.84); }
:is(.leaflet-container,.boat-map-rail) .leaflet-control-zoom.leaflet-bar a:focus-visible {
    outline: 3px solid #ffdb66;
    outline-offset: 2px;
}
:is(.leaflet-container,.boat-map-rail) .leaflet-control-zoom.leaflet-bar a.leaflet-disabled {
    opacity: .55;
    cursor: default;
}
@media (max-width: 1000px), (pointer: coarse) and (max-width: 1180px) {
    /* Stretch just the corner that owns zoom. Other Leaflet controls keep their corner. */
    .leaflet-container .leaflet-control-container > :is(.leaflet-top,.leaflet-bottom):has(> .leaflet-control-zoom) {
        inset: 0;
        pointer-events: none;
    }
    .leaflet-container .leaflet-control-container .leaflet-control-zoom,
    .boat-map-rail .boat-rail-top {
        position: absolute;
        top: 50%;
        right: max(8px,env(safe-area-inset-right,0px));
        margin: 0;
        transform: translateY(-50%);
        pointer-events: auto;
    }
    .map-wrap .boat-map-rail {
        inset: 0 max(8px,env(safe-area-inset-right,0px)) 0 auto;
        width: 58px;
    }
    .boat-map-rail .boat-rail-top { right: 0; display: block; }
    html :is(.leaflet-container,.boat-map-rail) .leaflet-control-zoom.leaflet-bar a {
        width: 60px;
        height: 60px;
        min-height: 60px;
    }
    body .boat-map-rail .boat-rail-middle {
        position: absolute;
        inset: 10px 0 auto auto;
        display: flex;
    }
    .boat-map-rail .boat-rail-bottom {
        position: absolute;
        inset: auto 0 calc(20px + env(safe-area-inset-bottom,0px)) auto;
        justify-items: end;
    }
    .map-wrap > .boat-view-actions {
        position: absolute;
        inset: 10px calc(max(8px,env(safe-area-inset-right,0px)) + var(--boat-action-size,56px) + 8px) auto auto;
        display: flex;
        width: auto;
    }
}
@media (max-height: 500px) and (max-width: 1000px) {
    html :is(.leaflet-container,.boat-map-rail) .leaflet-control-zoom.leaflet-bar a {
        width: 54px;
        height: 54px;
        min-height: 54px;
    }
    .boat-map-rail .boat-rail-bottom { display: flex; }
}
