.map-page { overflow: hidden; }
.event-map-fullscreen {
    --map-footer-height: 60px;
    --map-profile-height: 225px;
    position: fixed; inset: 0 0 var(--map-footer-height); isolation: isolate;
    background: #e6edf1; color: #172b44;
}
.event-map-fullscreen [hidden] { display: none !important; }
.event-map-canvas { position: absolute; inset: 0; touch-action: none; overscroll-behavior: none; }
.event-map-canvas .ol-viewport { touch-action: none; }
.map-profile-dock .race-profile-caption { font-size:11px; padding:3px 12px 6px; }
.map-surface { background: #fff; border: 1px solid #dce3e9; border-radius: 16px; box-shadow: 0 3px 18px #142e4926; }
.map-toolbar { position: absolute; z-index: 3; top: max(12px, env(safe-area-inset-top)); left: 12px; display: flex; align-items: center; gap: 8px; padding: 8px; max-width: calc(100% - 80px); }
.map-toolbar .btn { flex-shrink: 0; width: 40px; height: 40px; }
.map-event-name { font-weight: 650; color: #172b44; text-decoration: none; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-toolbar .form-select { width: 200px; min-width: 0; }
.map-sidebar { position: absolute; z-index: 4; top: 82px; left: 12px; width: 350px; bottom: calc(var(--map-profile-height) + 32px); padding: 16px; overflow-y: auto; overscroll-behavior: contain; }
.map-sidebar .list-group-item { background: transparent; }
.map-detail { position: absolute; z-index: 5; right: 60px; top: 82px; width: min(320px, calc(100% - 24px)); max-height: calc(100% - var(--map-profile-height) - 120px); overflow-y: auto; padding: 16px; }
.map-profile-dock { position: absolute; z-index: 3; left: 12px; right: 12px; bottom: 10px; overflow: hidden; }
.map-profile-toolbar { display: flex; align-items: center; gap: 12px; padding: 5px 10px; border-bottom: 1px solid #e7edf3; }
.map-profile-toolbar .btn { min-height: 32px; min-width: 32px; }
.map-update-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-profile-scroll { width: 100%; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: thin; touch-action: pan-x; }
.map-profile-scroll [data-profile] { width: 100%; min-width: 0; }
.map-profile-scroll [data-profile] > .small { position: sticky; left: 0; padding: 0 12px 5px; width: max-content; max-width: 100%; font-size: 11px; }
.map-replay { display: flex; align-items: center; gap: 12px; padding: 4px 12px; border-top: 1px solid #e7edf3; }
.event-map-fullscreen .ol-zoom { top: 12px; right: 12px; left: auto; }
.event-map-fullscreen .ol-rotate { top: 78px; right: 12px; }
.event-map-fullscreen .ol-attribution { bottom: calc(var(--map-profile-height) + 14px); right: 14px; font-size: 10px; }
.event-map-fullscreen :focus-visible { outline: 3px solid #1769e0; outline-offset: 2px; }
@media (max-width: 767px) {
    .map-toolbar { left: 8px; top: max(8px, env(safe-area-inset-top)); right: 8px; max-width: none; gap: 4px; padding: 6px; border-radius: 12px; }
    .map-event-name { display: none; }
    .map-toolbar .form-select { flex: 1; width: 0; }
    .map-sidebar { top: 70px; left: 8px; width: calc(100% - 16px); bottom: calc(var(--map-profile-height) + 25px); }
    .map-detail { top: 70px; right: 8px; max-height: calc(100% - var(--map-profile-height) - 105px); }
    .map-profile-dock { left: 6px; right: 6px; bottom: 6px; border-radius: 12px; }
    .map-profile-toolbar { gap: 4px; padding: 4px; }
    .map-update-label { display: none; }
    .event-map-fullscreen .ol-zoom { top: 78px; right: 10px; }
    .event-map-fullscreen .ol-rotate { top: 146px; }
}
@media (max-height: 550px) {
    .map-sidebar { bottom: 60px; }
    .map-detail { max-height: calc(100% - 120px); }
}

.map-toolbar > .form-control { width:260px; min-width:90px; }
.map-distance-picker { position:relative; }
.map-distance-picker .form-select { display:none; position:absolute; top:48px; right:0; width:220px; }
.map-distance-picker.is-open .form-select { display:block; }
@media(min-width:992px) {
    .map-distance-picker { flex-shrink:0; }
    .map-distance-picker [data-distance-toggle] { display:none; }
    .map-distance-picker .form-select { display:block; position:static; width:clamp(150px,18vw,230px); }
    .map-toolbar > .form-control { width:clamp(140px,20vw,260px); }
}
@media(max-width:767px) { .map-toolbar > .form-control { flex:1; width:0; } .map-toolbar [data-map-refresh] { display:none; } }

.event-map-list .result-card { min-width: 0; padding: .75rem .5rem !important; cursor: pointer; }
.event-map-list .result-card:focus-visible { outline: 2px solid #1769e0; outline-offset: -2px; }

.map-group-card { display:block; width:100%; border:0; padding:0; background:transparent; color:inherit; text-align:left; }
.map-group-card:hover { background:#f3f7fa; }
.map-group-card:focus-visible { outline:2px solid #1769e0; outline-offset:-2px; }
.map-group-list .result-card { border-radius:0; }
