/* Layout shared only by the full RO/EN/HU map; other embedded maps keep theirs. */
.pc-map-shell {
    position: relative;
    isolation: isolate;
    --pc-map-gap: 12px;
    --pc-map-left: max(var(--pc-map-gap), env(safe-area-inset-left, 0px));
    --pc-map-right: max(var(--pc-map-gap), env(safe-area-inset-right, 0px));
    --pc-map-bottom: max(var(--pc-map-gap), env(safe-area-inset-bottom, 0px));
}
.pc-map-shell #map-full { min-height: 180px; }
.pc-map-shell .map-controls {
    display: block;
    top: var(--pc-map-gap);
    left: var(--pc-map-left);
    right: auto;
    width: 280px;
    max-width: calc(100% - var(--pc-map-left) - var(--pc-map-right) - 60px);
    max-height: calc(100% - var(--pc-map-gap) - var(--pc-map-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    scrollbar-width: thin;
}
.pc-map-shell .map-controls-header { display: none; }
.pc-map-shell .ctrl-toggle {
    display: none;
    top: var(--pc-map-gap);
    left: var(--pc-map-left);
    min-height: 44px;
    padding: 10px 14px;
    touch-action: manipulation;
}
.pc-map-shell .filter-row .btn--pill {
    min-height: 44px;
    padding: 10px 12px;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}
.pc-map-shell .map-note { font-size: 12px; line-height: 1.5; margin: 10px 0; }
/* The right rail is reserved for zoom and location in both panel states. */
#map-full .leaflet-top { top: 0 !important; }
#map-full .leaflet-bottom { bottom: var(--pc-map-bottom); }
#map-full .leaflet-right .leaflet-control { margin-right: var(--pc-map-right); }
#map-full .leaflet-top .leaflet-control { margin-top: var(--pc-map-gap); }
#map-full .leaflet-control-zoom a,
#map-full .pc-locate-button {
    width: 44px !important;
    height: 44px !important;
    line-height: 44px;
    min-height: 44px;
    touch-action: manipulation;
}
#map-full .leaflet-control-attribution { margin-right: 0; max-width: 100%; }
/* Foreign popups already reserve 136px above the card when auto-panning.
   Leave room for that toolbar clearance plus the popup margins/tip. The
   content scrolls instead of extending beyond a short landscape map. */
#map-full .leaflet-popup-content {
    max-height: max(60px, calc(var(--pc-map-height, 100vh) - 200px));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
    .pc-map-shell .ctrl-toggle { display: block; }
    .pc-map-shell .map-controls { display: none; }
    .pc-map-shell.is-filter-open .ctrl-toggle { display: none; }
    .pc-map-shell.is-filter-open .map-controls { display: block; }
    .pc-map-shell .map-controls-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        position: sticky;
        top: -12px;
        z-index: 1;
        background: var(--c-surface);
        margin: -12px -12px 12px;
        padding: 8px 8px 8px 12px;
        border-bottom: 1px solid var(--c-border);
    }
    .pc-map-shell .map-controls-header h2 { margin: 0; font-size: 14px; color: var(--c-text); }
    .pc-map-shell .ctrl-close {
        position: static;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        border-radius: var(--radius-sm);
        color: var(--c-text);
        touch-action: manipulation;
    }
}
