/* Leave the approved spacious desktop and the separate mobile row drawer intact. */
.desktop-tools-overflow-hint{display:none}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) body>footer #navigation-controls{display:flex!important;flex-direction:column!important;width:calc(100% - 16px)!important;max-width:1040px!important;min-width:0!important;flex:0 1 auto!important;gap:6px!important;grid-template:none!important}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) #navigation-controls .lab-browse-row{display:flex!important;flex-wrap:wrap!important;align-items:center;justify-content:center;gap:6px!important;width:100%;min-width:0;order:0}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) #navigation-controls .lab-mode-group{display:flex!important;flex-wrap:wrap!important;gap:6px;align-items:center;justify-content:center;min-width:0;max-width:100%}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) body>footer #navigation-controls #views{display:flex!important;flex-wrap:wrap!important;width:auto!important;max-width:100%!important;gap:4px!important;justify-content:center}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) body>footer #navigation-controls :is(#views,.lab-five-tools) button{flex:0 0 auto!important;min-width:max-content!important;width:auto!important;height:auto!important;min-height:32px!important;white-space:nowrap!important;padding:5px 8px!important;line-height:1.3!important}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) body>footer #navigation-controls #map-full-view{width:auto!important;min-width:max-content!important;height:auto!important;padding:5px 8px!important}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) #navigation-controls .header-right{display:flex!important;flex-wrap:wrap!important;justify-content:center;align-items:center;gap:5px!important;width:auto!important;max-width:100%;min-width:0}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) #navigation-controls #map-favorites{width:auto!important;max-width:100%;justify-self:auto}
#desktop-secondary-tools{order:2;width:100%;min-width:0;text-align:center}
#desktop-secondary-tools>summary{cursor:pointer;list-style:revert;display:list-item;list-style-position:inside;padding:7px 10px;min-height:32px;box-sizing:border-box;border:1px solid var(--footer-glass-line,#888);border-radius:4px;background:var(--footer-button-glass,rgba(255,255,255,.64));color:var(--footer-glass-ink,#333);font:inherit}
#desktop-secondary-tools>summary:focus-visible{outline:2px solid currentColor;outline-offset:-3px}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) #desktop-secondary-tools .lab-utility-row{display:flex!important;flex-direction:column;gap:6px!important;align-items:center;width:100%;max-height:35dvh;overflow:auto;overscroll-behavior:contain;scrollbar-width:auto;box-sizing:border-box;padding:6px}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) #navigation-controls .lab-linear-actions{display:flex!important;flex-wrap:wrap!important;gap:6px!important;align-items:center;justify-content:center;width:100%;min-width:0}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) #navigation-controls .lab-five-tools{display:flex!important;flex-wrap:wrap!important;flex:0 1 auto;width:auto!important;gap:4px!important;max-width:100%!important;justify-content:center}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) body>footer #navigation-controls :is(#zoom-to-image,#random,#theme-toggle,#map-fullscreen){width:auto!important;max-width:none!important;min-width:max-content!important;flex:none!important;height:auto!important;min-height:32px!important;padding:5px 8px!important;line-height:1.3!important}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) #navigation-controls .random-pool{flex:none!important;min-width:max-content}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) body>footer #navigation-controls #mode-sizing-controls{position:static!important;display:flex!important;flex-wrap:wrap!important;flex:1 1 300px!important;max-width:100%!important;width:auto!important;min-width:0!important;gap:10px!important;padding:0!important}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) #mode-sizing-controls>label{flex:1 1 100px!important;min-width:90px!important}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) body>footer{max-height:calc(100dvh - 80px);overflow-y:auto;overflow-x:clip;overscroll-behavior:contain}
/* Viewer overflow has an explicit hint and native scrollbar, never clipped buttons. */
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) #full-view:not(.viewer-controls-drawer-enabled) .full-toolbar{display:flex!important;flex-direction:column;gap:4px;min-width:0;max-width:100%;box-sizing:border-box}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) #full-view:not(.viewer-controls-drawer-enabled) .full-actions{display:flex!important;flex-wrap:wrap!important;gap:6px!important;align-items:center;justify-content:center!important;width:100%!important;max-width:100%!important;max-height:30dvh;overflow:auto!important;overscroll-behavior:contain;scrollbar-width:auto;box-sizing:border-box;padding:4px}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) #full-view:not(.viewer-controls-drawer-enabled) .full-actions :is(button,a){flex:0 0 auto!important;min-width:max-content!important;height:auto!important;min-height:32px;white-space:nowrap!important;line-height:1.3;padding-block:5px}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls) #full-view:not(.viewer-controls-drawer-enabled) .desktop-tools-overflow-hint{display:block;flex:1 0 100%;font-size:inherit;line-height:1.4;text-align:center}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls).immersive #full-view:not(.viewer-controls-drawer-enabled) .immersive-controls{box-sizing:border-box;width:calc(100vw - 24px)!important;max-width:calc(100vw - 24px)!important;max-height:40dvh;flex-wrap:wrap!important;justify-content:center!important;overflow:auto!important;overscroll-behavior:contain;scrollbar-width:auto;gap:6px!important}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls).immersive #full-view:not(.viewer-controls-drawer-enabled) .immersive-controls button{flex:none;min-width:max-content;height:auto!important;min-height:32px;white-space:nowrap;line-height:1.3}
html.desktop-footer-compact:not(.phone-layout):not(.tablet-compact-controls).immersive #full-view:not(.viewer-controls-drawer-enabled) .immersive-controls .fullscreen-group{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px;max-width:100%;min-width:0}
