/* Keep the map frame fixed when thematic keys change. */
.bd-map-page .bd-basemap-heading{display:none!important}
@media(min-width:1051px){
 .bd-map-page .bd-record-sidebar{display:flex;flex-direction:column;gap:6px;overflow:hidden}
 .bd-map-page .bd-record-sidebar .bd-basemap-panel{flex:0 0 auto;margin:0;padding:7px 9px}
 .bd-map-page .bd-record-sidebar .bd-basemap-options{flex-direction:row;flex-wrap:wrap;gap:4px 10px}
 .bd-map-page .bd-record-sidebar .bd-basemap-options .bd-basemap-primary::after{content:none}
 .bd-map-page .bd-record-sidebar .bd-layer-list{flex:0 1 auto;min-height:0;overflow-y:auto}
 .bd-map-page .bd-record-sidebar>.bd-map-legend{position:relative;inset:auto;display:block;flex:0 0 auto;min-width:0;max-width:none;max-height:32%;overflow:auto;margin:0;padding:8px 9px}
 .bd-map-page .bd-record-sidebar>.bd-map-legend>div{display:flex;flex-wrap:wrap;gap:5px 8px}
 .bd-map-page .bd-record-sidebar>.bd-map-legend>div+div{border:0;padding:0;margin:0}
 .bd-map-page .bd-record-sidebar>.bd-map-legend b,.bd-map-page .bd-record-sidebar>.bd-map-legend small{width:100%}
 .bd-map-page .bd-record-sidebar>.bd-map-legend [data-cmab-change-categories]{gap:4px 9px}
 .bd-map-page .bd-record-sidebar>.bd-map-legend [data-cmab-change-status]{display:none}
}
@media(max-width:1050px){
 .bd-map-page .bd-map-app .bd-map-legend{height:96px;min-height:96px;max-height:96px;overflow:auto}
 .bd-map-page .bd-map-app .bd-map-legend:not(:has(>[data-layer-legend]:not([hidden]))){display:block}
}
@media(max-width:360px){
 .bd-map-page .bd-map-app .bd-map-legend{height:110px;min-height:110px;max-height:110px}
}
@media(max-width:1050px) and (orientation:landscape) and (max-height:540px){
 .bd-map-page .bd-map-app .bd-map-legend{height:68px;min-height:68px;max-height:68px}
}

/* All checked layers keep their own key; scroll the key, never the map frame. */
.bd-map-page .bd-map-legend > [data-layer-legend][hidden]{display:none!important}
.bd-map-page .bd-map-legend > [data-layer-legend]:not([hidden]){display:flex!important}
.bd-map-page .bd-map-legend{overscroll-behavior:contain;scrollbar-width:thin;touch-action:pan-y}
.bd-map-page .bd-map-legend:focus-visible{outline:2px solid #ff8a54;outline-offset:-2px}
.bd-map-page .bd-map-legend > [data-layer-legend]+[data-layer-legend]{border:0;border-top:1px solid #333;margin-top:6px;padding:6px 0 0}
@media(min-width:1051px){
 .bd-map-page .bd-record-sidebar > .bd-map-legend{flex:1 1 120px;min-height:72px;max-height:none}
}
@media(max-width:1050px){
 .bd-map-page .bd-map-legend > [data-layer-legend]{gap:3px 7px;line-height:1.2}
 .bd-map-page .bd-map-legend > [data-layer-legend]+[data-layer-legend]{margin-top:4px;padding-top:4px}
}

.bd-map-page .bd-map-legend > .bd-legend-focus-label{position:sticky;top:-8px;z-index:2;background:#080808;padding:3px 0;margin-bottom:3px}
@media(max-width:1050px){.bd-map-page .bd-map-legend > .bd-legend-focus-label{top:-4px}}
@media(max-width:1050px) and (orientation:portrait) and (min-height:700px){
 .bd-map-page .bd-map-app .bd-map-legend{height:150px;min-height:150px;max-height:150px}
}
