/* Explorer-only viewport budget. The affiliation remains visible in normal flow. */
body:has([data-explorer-page="unified"]){height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:clip}
body:has([data-explorer-page="unified"]) #root{flex:1 1 0%;min-height:0;width:100%}
body:has([data-explorer-page="unified"]) #root>div.h-screen{height:100%;min-height:0}
body:has([data-explorer-page="unified"]) #tm-brand-affiliation{flex:0 0 auto;padding:4px 16px;font-size:12px;line-height:20px}
/* Keep source attribution inside its globe instead of fixed over the information panel. */
@media(max-width:1023px){
[data-explorer-page="unified"] .explorer-map-attribution{position:absolute;bottom:4px}
[data-explorer-page="unified"] .explorer-maps-toggle{position:absolute;bottom:44px}
[data-explorer-page="unified"] .eclopidia-active-layers{bottom:44px!important}
[data-explorer-page="unified"] [aria-label="Earth recovery controls"]{bottom:96px!important}
}
/* In short landscape, the same Fit/Zoom controls remain available through Maps. */
@media(max-width:1023px) and (max-height:480px){
[data-explorer-page="unified"] [aria-label="Earth recovery controls"]{display:none}
}

/* Map controls must remain operable outside a short globe viewport. */
[data-explorer-page="unified"] .explorer-map-drawer-close{display:none}
@media(max-width:1023px){
[data-explorer-page="unified"] #explorer-maps-controls:not([hidden]){position:fixed;inset:88px 12px 40px;z-index:80;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-content:start;align-items:start;gap:12px;width:min(680px,calc(100vw - 24px));max-width:none;margin:0;overflow-y:auto;overscroll-behavior:contain;padding:12px;border:1px solid #647b70;border-radius:16px;background:#071912;box-shadow:0 16px 50px #0008}
[data-explorer-page="unified"] #explorer-maps-controls>.explorer-map-drawer-close{display:block;grid-column:1/-1;position:sticky;top:0;z-index:90;justify-self:end;min-height:44px;padding:0 16px;border:1px solid #8cafa0;border-radius:24px;background:#173f34;color:#fffdf7}
[data-explorer-page="unified"] #explorer-maps-controls .explorer-map-context-controls{position:static!important;grid-column:1;grid-row:2;max-width:100%;align-items:stretch}
[data-explorer-page="unified"] #explorer-maps-controls .explorer-map-action-buttons{position:static!important;grid-column:1;grid-row:3;flex-wrap:wrap;max-width:100%}
[data-explorer-page="unified"] #explorer-maps-controls .explorer-map-action-buttons button{min-height:44px;min-width:44px}
[data-explorer-page="unified"] #explorer-maps-controls>[data-testid="deep-zoom-preview"]{position:static;grid-column:1;grid-row:4}
[data-explorer-page="unified"] #explorer-maps-controls [data-testid="earth-layer-drawer"]{position:static;grid-column:2;grid-row:2/span 3;max-width:100%!important;max-height:none!important;align-items:stretch}
[data-explorer-page="unified"] #explorer-maps-controls #earth-base-options{position:static;max-height:180px;overflow-y:auto}
[data-explorer-page="unified"] #explorer-maps-controls [data-testid="earth-layer-category-panel"]{max-width:100%!important;max-height:min(45dvh,240px)!important}
}
@media(max-width:479px){
[data-explorer-page="unified"] #explorer-maps-controls:not([hidden]){grid-template-columns:minmax(0,1fr)}
[data-explorer-page="unified"] #explorer-maps-controls [data-testid="earth-layer-drawer"]{grid-column:1;grid-row:5}
}
/* Use the existing collapsible information sheet in short tablet landscape. */
@media(min-width:640px) and (max-width:1023px) and (max-height:480px){
[data-explorer-tablet-panel]{display:none}
[data-explorer-source-sheet]{display:block}
}

[data-explorer-page="unified"] .explorer-map-drawer-close:focus-visible{outline:3px solid #276b50;outline-offset:3px;box-shadow:0 0 0 3px #f6f5ed}

@media(max-width:1023px){
[data-explorer-page="unified"] #explorer-maps-controls button{min-height:44px}
[data-explorer-page="unified"] #explorer-maps-controls [data-testid="earth-layer-category-panel"] header button{min-width:44px}
[data-explorer-page="unified"] #explorer-maps-controls input:is([type="checkbox"],[type="radio"]){width:24px;height:24px}
/* Reserve the closed information bar in flow; its expanded content remains an overlay. */
[data-explorer-source-sheet]{position:relative;inset:auto;flex:0 0 auto}
[data-explorer-source-sheet]>[role="region"]{position:absolute;left:0;right:0;bottom:100%;height:50dvh;max-height:calc(100dvh - 90px);box-shadow:0 -8px 24px #0004}
}

@media(max-width:1023px) and (max-height:480px){[data-explorer-source-sheet]>[role="region"]{max-height:calc(100dvh - 225px)}}

@media(max-width:1023px){
[data-explorer-page="unified"] #explorer-maps-controls [data-testid="nautical-layer-drawer"]{position:static;grid-column:2;grid-row:2/span 3;width:100%;max-width:100%;max-height:none}
[data-explorer-page="unified"] #explorer-maps-controls [data-testid="nautical-layer-trigger"]{position:static;grid-column:2;grid-row:2}
}
@media(max-width:479px){
[data-explorer-page="unified"] #explorer-maps-controls :is([data-testid="nautical-layer-drawer"],[data-testid="nautical-layer-trigger"]){grid-column:1;grid-row:5}
}
@media(min-width:640px) and (max-width:1023px) and (max-height:480px){
[data-explorer-compact-menu]{display:grid}
[data-explorer-page="unified"] :is([data-testid="explorer-tabs"],[data-testid="explorer-sections"]){display:none}
[data-testid$="coverage-notice"]>details{display:block}
[data-testid$="coverage-notice"]>div{display:none}
[data-testid$="coverage-notice"]>details>summary{min-height:32px;display:flex;align-items:center}
[data-testid$="coverage-notice"]>details[open]>div{max-height:25dvh;overflow-y:auto}
}

@media(min-width:640px) and (max-width:1023px) and (max-height:480px){
[data-explorer-compact-menu]>div{display:block}
[data-explorer-compact-menu] button,[data-explorer-compact-menu] nav a{min-height:44px}
}

@media(max-width:1023px){[data-explorer-page="unified"] #explorer-maps-controls select{min-height:44px}[data-explorer-page="unified"] #explorer-maps-controls [aria-label="Collapse Nautical chart controls"]{min-width:44px}}

@media(max-width:1023px){[data-explorer-page="unified"] #explorer-maps-controls [aria-label="Earth layer categories"]{max-height:160px;overflow-y:auto}}
