#map-controls-drawer-bar{display:flex;flex:0 0 auto;align-items:center;justify-content:center;gap:6px;width:100%;box-sizing:border-box;order:-100;padding:3px max(8px,env(safe-area-inset-right)) 3px max(8px,env(safe-area-inset-left));color:var(--footer-glass-ink)}
#map-controls-drawer-bar[hidden]{display:none!important}
#map-controls-drawer-bar>button{flex:0 1 180px;min-width:0;min-height:32px;height:32px;padding:0 10px;border:1px solid var(--footer-glass-line);border-radius:4px;font:inherit;font-size:12px;background:var(--footer-button-glass);color:var(--footer-glass-ink);touch-action:none;user-select:none;cursor:ns-resize}
html.phone-layout #map-controls-drawer-bar>button{flex:1 1 0;min-height:44px;height:44px}
@media(any-pointer:coarse){#map-controls-drawer-bar>button{height:44px;min-height:44px}}
html.phone-layout #phone-map-nav .lab-five-tools{grid-template-columns:repeat(5,minmax(0,1fr)) minmax(58px,1fr)!important}
#map-related{font-size:22px!important;line-height:1!important;min-width:32px;min-height:32px;padding:3px!important;color:var(--footer-glass-ink);background:var(--footer-button-glass);border:1px solid var(--footer-glass-line)}
html.phone-layout #phone-map-nav #map-related{font-size:11px!important;min-height:44px!important;height:44px!important;width:100%;box-sizing:border-box}
/* Keep the reopen controls below the site header in short phone landscapes. */
html.phone-layout body>footer:has(#map-controls-drawer-bar:not([hidden])){max-height:calc(100dvh - var(--common-height,122px) - 64px)!important;overflow-y:auto!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
html.phone-layout #map-controls-drawer-bar{position:sticky;bottom:44px;top:auto;z-index:5;background:var(--footer-glass);order:4!important}
#map-controls-drawer-bar{display:grid!important;grid-template-columns:repeat(2,minmax(0,180px));order:99!important;background:var(--footer-glass)}
#map-controls-drawer-bar[hidden]{display:none!important}
#map-controls-drawer-bar>.cvb-controls-pull{grid-column:1/-1}
#map-controls-drawer-bar>button{cursor:pointer;touch-action:manipulation}
html.phone-layout #map-controls-drawer-bar{grid-template-columns:repeat(2,minmax(0,1fr))}
html.phone-layout body>footer:has(#map-controls-drawer-bar:not([hidden])){max-height:calc(100dvh - var(--common-height,122px) - 96px)!important}
html.phone-layout body>footer>.collection-status{order:100!important}
/* Candidate: one vertical footer stack; the reopen bar never occupies a side column. */
html.phone-layout body>footer:has(#map-controls-drawer-bar:not([hidden])){display:flex!important;flex-direction:column!important;flex-wrap:nowrap!important;align-items:stretch!important;overflow-x:hidden!important}
html.phone-layout #map-controls-drawer-bar{flex:none!important;position:static!important;bottom:auto!important;min-width:0!important;z-index:auto}
html.phone-layout #phone-map-nav .lab-five-tools{grid-template-columns:repeat(5,minmax(0,1fr)) minmax(58px,1fr) minmax(62px,1fr)!important}
html.phone-layout #phone-map-nav :is(#map-related,#map-download){font-size:11px!important;min-height:44px!important;width:100%;box-sizing:border-box}
.map-pull-docked{order:-99!important;flex:none!important;align-self:stretch;position:relative;z-index:5}
html.phone-layout #phone-browse-sheet{z-index:80!important;pointer-events:auto;touch-action:pan-y pinch-zoom;-webkit-overflow-scrolling:touch;max-height:calc(100dvh - var(--common-height,106px) - 20px);min-height:96px;bottom:auto!important}
.phone-browse-actions{display:flex;flex:none;position:sticky;top:-10px;z-index:2;background:var(--footer-glass);padding:4px 0}
.phone-browse-actions button{min-height:44px;padding:0 12px;color:var(--footer-glass-ink);background:var(--footer-button-glass);border:1px solid var(--footer-glass-line)}
html.phone-layout #full-related.map-related-docked:not([hidden]){display:block!important;flex:none!important;order:-110!important;min-height:96px;max-height:35dvh}
html.phone-layout #full-related.map-related-docked .related-heading button{min-height:44px!important;height:44px!important}
html.phone-layout #full-related.map-related-docked #full-related-items{height:calc(var(--related-height,148px) - 52px)}
html.phone-layout #phone-browse-sheet #lab-controls :is(#general-filters,#aspect-buttons,#media-buttons,#cluster-buttons){display:flex!important;flex-wrap:wrap!important;min-width:0!important;width:100%!important;box-sizing:border-box}
html.phone-layout #phone-browse-sheet #lab-controls :is(#aspect-buttons,#media-buttons)>button{min-width:44px!important;max-width:100%!important;flex:0 1 auto!important;white-space:normal!important}
#lab-controls>#full-related.map-related-docked{order:-110!important}
html.phone-layout #phone-browse-sheet #full-related.map-related-docked{width:100%;max-height:35dvh}
#lab-controls>#map-controls-pull-grip{order:-100!important;flex:none;position:sticky;top:0;z-index:6}
html.phone-layout body>footer>#map-controls-pull-grip{order:-105!important;flex:none;position:sticky;top:0;z-index:6}
#map-controls-pull-grip{background:transparent!important}
#map-controls-pull-grip::after{content:'';position:absolute;inset:6px 0;background:var(--footer-glass);z-index:-1;pointer-events:none}

/* A decorative tail must not create a phantom scroll range over fitted rows. */
html.phone-layout body>footer::before{bottom:0!important}

/* Applied-query disclosure remains with the collection count in Map and IV. */
#active-search-status{grid-column:1 / -1!important;justify-self:stretch!important;flex:1 0 100%;width:100%;min-width:0;display:flex;align-items:center;gap:8px;box-sizing:border-box;padding:2px 0;color:inherit}
#active-search-status .active-search-query{display:block;min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:600;line-height:1.4}
#active-search-status button{flex:0 0 auto;min-width:88px;min-height:44px!important;box-sizing:border-box;font-size:12px;line-height:1.2;padding:6px 10px;white-space:nowrap}
#active-search-status[hidden]{display:none!important}

/* R131q review draft: shared control language, no handler/persistence changes. */
html.desktop-viewer-command-rows #full-view#full-view#full-view#full-view .desktop-viewer-command-row[data-row="1"]{display:grid!important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;gap:8px!important}
html.desktop-viewer-command-rows #full-view#full-view#full-view#full-view .desktop-viewer-command-row[data-row="1"]>.desktop-viewer-action-group[aria-label="Random pool"]{justify-self:start!important;flex-wrap:wrap}
html.desktop-viewer-command-rows #full-view#full-view#full-view#full-view .desktop-viewer-command-row[data-row="1"]>.desktop-viewer-action-group[aria-label="Playback"]{justify-self:end!important}
html.desktop-viewer-command-rows #full-view#full-view#full-view#full-view #desktop-viewer-navigation{justify-self:center!important;width:auto!important}
html.desktop-viewer-command-rows #full-view#full-view#full-view#full-view .desktop-viewer-command-row #desktop-full-help{font:500 20px/24px var(--aiml-sans)!important}
html[data-theme] #help-toggle{font-size:20px!important;line-height:1.2!important}
html[data-theme] #mode-sizing-controls>label:has(#mode-transparency){order:-1!important}
html[data-theme] #full-view #viewer-transparency{order:-1!important}
html[data-theme] #full-download::after,html[data-theme] #map-download::after{content:""!important;display:inline-block!important;width:20px!important;height:20px!important;background:currentColor!important;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v12m-5-5 5 5 5-5M4 16v4h16v-4' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat!important}
html.desktop-locked-groups #desktop-locked-toprow>.desktop-command-group{flex-wrap:wrap!important}
html.desktop-locked-groups #desktop-locked-toprow #map-full-view{width:auto!important;min-width:44px!important;grid-area:auto!important}
html.desktop-locked-groups #desktop-locked-toprow #views{flex-wrap:wrap!important}
html.desktop-cvb-refinement:not(.phone-layout) body>footer #navigation-controls#navigation-controls#navigation-controls#navigation-controls #map-favorites{grid-column:1/6!important}
html.desktop-cvb-refinement:not(.phone-layout) body>footer #navigation-controls#navigation-controls#navigation-controls#navigation-controls #theme-toggle{grid-column:6/8!important}
html.phone-layout #phone-map-options #navigation-controls#navigation-controls#navigation-controls #theme-toggle{order:2!important}
html.phone-layout #phone-map-options #navigation-controls#navigation-controls#navigation-controls #map-favorites{order:1!important}
html.phone-layout #full-view #phone-viewer-bar#phone-viewer-bar{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:4px!important;position:relative!important}
html.phone-layout #full-view #phone-viewer-bar#phone-viewer-bar>:is(button,.full-random-pool){min-width:0!important;max-width:none!important;width:100%!important;box-sizing:border-box!important;order:0!important}
html.phone-layout #full-view #phone-viewer-bar#phone-viewer-bar #full-close{grid-column:1/3!important;grid-row:1!important}
html.phone-layout #full-view #phone-viewer-bar#phone-viewer-bar #full-related-toggle{grid-column:3/5!important;grid-row:1!important}
html.phone-layout #full-view #phone-viewer-bar#phone-viewer-bar #full-random{grid-column:5/7!important;grid-row:1!important}
html.phone-layout #full-view #phone-viewer-bar#phone-viewer-bar #full-prev{grid-column:2/3!important;grid-row:2!important}
html.phone-layout #full-view #phone-viewer-bar#phone-viewer-bar #full-still-play{grid-column:3/5!important;grid-row:2!important}
html.phone-layout #full-view #phone-viewer-bar#phone-viewer-bar #full-next{grid-column:5/6!important;grid-row:2!important}
html.phone-layout #full-view #phone-viewer-bar#phone-viewer-bar .full-random-pool{grid-column:1/5!important;grid-row:3!important;display:flex!important;gap:8px!important}
html.phone-layout #full-view #phone-viewer-bar#phone-viewer-bar #full-slideshow{grid-column:5/7!important;grid-row:3!important}
html.phone-layout #full-view #phone-viewer-bar#phone-viewer-bar #phone-viewer-more{display:none!important}
html.phone-layout #full-view #phone-viewer-core#phone-viewer-core{display:flex!important;flex-wrap:wrap!important;gap:4px!important}
html.phone-layout #full-view #phone-viewer-core#phone-viewer-core #viewer-transparency{flex-basis:100%!important}
html.phone-layout #full-view #phone-viewer-core#phone-viewer-core #full-theme-toggle{order:0!important}
html.phone-layout #full-view #phone-viewer-bar :is(#full-prev,#full-next){font-size:18px!important}
html.phone-layout #full-view #phone-viewer-bar #full-still-play{font-size:14px!important}
html.phone-layout #phone-map-bar#phone-map-bar{display:flex!important;flex-wrap:wrap!important;gap:4px!important}
html.phone-layout #phone-map-bar#phone-map-bar>:is(button,.random-pool){flex:1 1 auto!important;min-width:44px!important;order:0!important}
html.phone-layout #phone-map-bar#phone-map-bar #map-full-view{order:-3!important}
html.phone-layout #phone-map-bar#phone-map-bar #map-related{order:-2!important}
html.phone-layout #phone-map-bar#phone-map-bar #random{order:-1!important}
html.desktop-locked-groups body>footer #navigation-controls#navigation-controls#navigation-controls#navigation-controls #desktop-locked-toprow .desktop-command-group{height:auto!important;max-height:none!important;align-items:center!important;flex-wrap:nowrap!important}
html.desktop-locked-groups body>footer #navigation-controls#navigation-controls#navigation-controls#navigation-controls #desktop-locked-toprow #map-full-view{width:auto!important;min-width:44px!important;max-width:none!important;flex:0 0 auto!important;grid-column:auto!important;grid-row:auto!important}
html.phone-layout #full-view#full-view#full-view #phone-viewer-bar#phone-viewer-bar :is(#full-close,#full-prev,#full-next){font-size:0!important;line-height:0!important}
html.phone-layout #full-view#full-view#full-view #phone-viewer-bar#phone-viewer-bar #full-close::after{content:'Map'!important;font:500 13px/1.2 var(--aiml-sans)!important}
html.phone-layout #full-view#full-view#full-view #phone-viewer-bar#phone-viewer-bar #full-prev::after{content:'⏮'!important;font:500 20px/1 var(--aiml-sans)!important}
html.phone-layout #full-view#full-view#full-view #phone-viewer-bar#phone-viewer-bar #full-next::after{content:'⏭'!important;font:500 20px/1 var(--aiml-sans)!important}
html.phone-layout #full-view#full-view#full-view #phone-viewer-bar#phone-viewer-bar #full-related-toggle{font-size:13px!important}
html.phone-layout #full-view#full-view#full-view #phone-viewer-bar#phone-viewer-bar #full-related-toggle::after{display:none!important}
html.phone-layout #full-view#full-view#full-view #phone-viewer-bar#phone-viewer-bar #full-slideshow{font-size:0!important}
html.phone-layout #full-view#full-view#full-view #phone-viewer-bar#phone-viewer-bar #full-slideshow::after{content:'Slideshow'!important;font:500 12px/1.2 var(--aiml-sans)!important}
html.phone-layout #full-view#full-view#full-view #viewer-extra-tools #full-download{font-size:0!important;flex:0 0 44px!important}
html.phone-layout #full-view#full-view#full-view #viewer-extra-tools #full-download::after{display:inline-block!important}
html.phone-layout #full-view#full-view#full-view #viewer-extra-tools #viewer-transparency{flex:1 1 120px!important;max-width:none!important}
html.phone-layout #full-view#full-view#full-view #phone-viewer-bar#phone-viewer-bar :is(#full-still-play,#video-play){grid-column:3/5!important;grid-row:2!important;font-size:0!important;line-height:0!important}
html.phone-layout #full-view#full-view#full-view #phone-viewer-bar#phone-viewer-bar :is(#full-still-play,#video-play)::after{content:'▶'!important;font:500 20px/1 var(--aiml-sans)!important}
html.phone-layout #full-view#full-view#full-view #phone-viewer-bar#phone-viewer-bar :is(#full-still-play[aria-pressed=true],#video-play[aria-label="Pause video"])::after{content:'Ⅱ'!important}
html.phone-layout body>footer #phone-map-bar#phone-map-bar#phone-map-bar{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;order:-2!important;width:100%!important}
html.phone-layout body>footer #phone-map-bar#phone-map-bar#phone-map-bar>:is(button,.random-pool){width:100%!important;min-width:0!important;max-width:none!important;order:0!important}
html.phone-layout body>footer #phone-map-bar#phone-map-bar#phone-map-bar #map-full-view{grid-area:1/1/2/3!important}
html.phone-layout body>footer #phone-map-bar#phone-map-bar#phone-map-bar #map-related{grid-area:1/3/2/5!important}
html.phone-layout body>footer #phone-map-bar#phone-map-bar#phone-map-bar #random{grid-area:1/5/2/7!important}
html.phone-layout body>footer #phone-map-bar#phone-map-bar#phone-map-bar #phone-categories-toggle{grid-area:2/1/3/3!important}
html.phone-layout body>footer #phone-map-bar#phone-map-bar#phone-map-bar #zoom-to-image{grid-area:2/3/3/5!important}
html.phone-layout body>footer #phone-map-bar#phone-map-bar#phone-map-bar .random-pool{grid-area:2/5/3/7!important;display:flex!important;flex-direction:column!important;align-items:start!important;justify-content:center!important}
html.phone-layout #phone-map-options #navigation-controls#navigation-controls#navigation-controls #theme-toggle{order:3!important}
html.phone-layout #map-download{font-size:0!important;min-width:44px!important;width:44px!important}
html.phone-layout body>footer #mode-sizing-controls#mode-sizing-controls{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:4px!important}
html.phone-layout body>footer #mode-sizing-controls#mode-sizing-controls>label{width:auto!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
