/* Mobile controls are local to the scene, including browser fullscreen. */
#mobile-toolbar,#gesture-help,#rotate-hint{display:none}
body.scene-immersive{overflow:hidden;overscroll-behavior:none}
body.scene-immersive #viewport{position:fixed;inset:0;z-index:100;width:100%;height:100dvh;min-height:0;margin:0;border-radius:0}
@media(max-width:700px),(pointer:coarse) and (max-width:1100px),(max-height:520px) and (max-width:1100px){
 #viewport,body[data-atlas=true] #viewport{height:calc(100svh - 72px);min-height:630px;isolation:isolate}
 #mobile-toolbar:not([hidden]){display:flex;position:absolute;z-index:20;top:max(8px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));gap:6px;pointer-events:none}
 #mobile-toolbar button{pointer-events:auto;min-height:44px;padding:8px 10px;font-size:13px;border:1px solid #46636b;background:#102830ed;color:#e3f1ee;border-radius:9px;white-space:nowrap}
 #mobile-toolbar button[hidden]{display:none}
 #mobile-dashboard{margin-left:auto}
 #gesture-help:not([hidden]){display:grid;gap:9px;position:absolute;left:max(12px,env(safe-area-inset-left));top:62px;z-index:22;width:min(340px,calc(100% - 24px));padding:16px;border:1px solid #547b80;border-radius:12px;background:#102830fa;color:#e3f1ee;box-shadow:0 12px 40px #0008;font-size:14px;line-height:1.5}
 #gesture-help strong{font-size:16px}#gesture-help span:last-child{color:#b3cdce}
 #rotate-hint:not([hidden]){display:block;position:absolute;z-index:19;top:58px;left:12px;right:12px;margin:0;padding:8px 12px;background:#123c46ed;border-radius:8px;color:#d2ece6;font-size:13px;line-height:1.5;pointer-events:none}
 #scene{touch-action:none}
 #atlas-story,#story-caption{top:70px;left:5%;right:5%;width:auto;max-width:none}
 #atlas-story h1{font-size:30px;line-height:1.15}#atlas-story p:not(.eyebrow){font-size:14px;line-height:1.55}#atlas-story .eyebrow{font-size:12px}
 .atlas-actions{gap:8px}.atlas-actions button{min-height:44px;padding:10px 12px;font-size:14px}
 #destinations{left:4%;right:4%;bottom:max(12px,env(safe-area-inset-bottom));width:auto}
 #destinations button{min-height:54px;font-size:14px;padding:7px 10px}
 #atlas-controls{bottom:147px;left:4%;right:4%;gap:6px;flex-wrap:wrap}#atlas-controls button{min-height:44px;font-size:13px;padding:8px 10px}#atlas-motion{font-size:12px}
 #story-caption h2{font-size:24px}#story-caption>p:not(.eyebrow){font-size:14px;line-height:1.5}#story-next{min-height:44px;font-size:14px}
 #story-panel{left:4%;right:4%;bottom:205px;width:auto;max-width:none;max-height:34%;overflow:auto}#story-panel img{max-height:145px;object-fit:cover}#story-panel h2{font-size:19px}#story-panel p{font-size:13px}
 #bridge-toolbar{top:62px;left:max(12px,env(safe-area-inset-left));right:auto;gap:6px;max-width:calc(100% - 24px)}
 #bridge-toolbar button{min-height:44px;font-size:14px;padding:8px 10px}#bridge-overview{display:block}.deck-picker{display:none}
 #bridge-tools{top:113px;left:12px;width:min(280px,calc(100% - 24px));max-height:calc(100% - 240px);z-index:18;overscroll-behavior:contain;padding:12px}
 #bridge-tools button,#bridge-tools select{min-height:44px;font-size:14px}.layer-note{display:none}
 #scene-readout{top:113px;right:12px;width:222px;padding:10px;max-height:calc(100% - 266px);overscroll-behavior:contain}
 #scene-readout.expanded{width:calc(100% - 24px);max-width:380px;max-height:calc(100% - 235px);z-index:17}
 #scene-readout .panel-head button{font-size:13px;min-height:44px;padding:5px}#scene-readout .panel-head span{font-size:13px}
 #scene-readout .mini-readings{gap:8px}#scene-readout .mini-readings small{font-size:12px}#scene-readout .mini-readings b{font-size:16px}
 #scene-readout .scene-alerts{margin-top:5px;padding-top:5px}#scene-readout .scene-alerts p{font-size:12px;margin:4px 0}
 #scene-readout:not([data-open=true]) .scene-alerts>small:first-child,#scene-readout:not([data-open=true]) #band-legend p,#scene-readout:not([data-open=true]) #band-legend em{display:none}
 #scene-readout .scene-alerts #band-legend{margin:5px 0}#scene-readout .scene-alerts #band-legend small{font-size:11px!important;line-height:1.3}#scene-readout .scene-alerts #band-legend ol,.quasi-legend{gap:4px 8px;margin:5px 0}#scene-readout .scene-alerts>small{font-size:11px}.line-key{margin-top:5px}
 #scene-replay{bottom:max(10px,env(safe-area-inset-bottom));width:calc(100% - 24px);padding:8px 10px;z-index:15}
 .replay-head{flex-wrap:nowrap;gap:6px}.replay-head>div{min-width:0}.replay-head small{font-size:10px}.replay-head strong{font-size:13px}.replay-head button,.replay-head select{min-height:44px;font-size:13px}.replay-head label{font-size:12px}
 #scene-time{height:26px;margin:0}#replay-details{min-height:32px;font-size:12px;padding:4px}#scene-replay .replay-foot{font-size:12px}
 body[data-near=true] .view-tools,.view-tools{right:auto;left:12px;bottom:155px;gap:6px}.view-tools button{width:44px;height:44px;font-size:23px}
 body.scene-immersive:has(#rotate-hint:not([hidden])) #atlas-story,body.scene-immersive:has(#rotate-hint:not([hidden])) #story-caption{top:115px}
 body.scene-immersive:has(#rotate-hint:not([hidden])) #bridge-toolbar{top:110px}
 body.scene-immersive:has(#rotate-hint:not([hidden])) #scene-readout,body.scene-immersive:has(#rotate-hint:not([hidden])) #bridge-tools{top:162px}
 #evidence,#dashboard,#method,#applications{overflow-wrap:anywhere}
}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 header{height:52px;min-height:52px;padding:6px 16px}.brand{font-size:22px}.brand small{display:none}header button,.dashboard-link{font-size:13px}
 #viewport,body[data-atlas=true] #viewport{height:calc(100svh - 52px);min-height:320px}
 #atlas-story,#story-caption{top:62px;left:max(16px,env(safe-area-inset-left));width:42%;right:auto;max-height:calc(100% - 144px);overflow-y:auto;padding:0 12px 8px 0;background:linear-gradient(90deg,#071218db,transparent)}
 #atlas-story h1{font-size:26px;margin:7px 0}#atlas-story .eyebrow,#story-caption .eyebrow{font-size:11px;margin:0 0 7px}#atlas-story p:not(.eyebrow){font-size:13px;margin:8px 0;line-height:1.45}.atlas-actions{flex-wrap:wrap}.atlas-actions button{font-size:13px}
 #story-caption h2{font-size:23px;margin:6px 0}#story-caption>p:not(.eyebrow){font-size:13px;margin:7px 0}
 #story-panel{top:62px;bottom:85px;left:auto;right:max(16px,env(safe-area-inset-right));width:43%;max-height:none;display:flex;flex-direction:column}#story-panel[hidden]{display:none}#story-panel img{min-height:80px;height:50%;max-height:150px;flex-shrink:1}#story-panel>div{padding:8px 12px}#story-panel h2{font-size:16px;margin:0 0 5px}#story-panel p{font-size:12px;margin:3px 0}#story-panel small,#story-panel a{font-size:11px}
 #destinations{grid-template-columns:repeat(4,minmax(0,1fr));left:max(16px,env(safe-area-inset-left));right:max(16px,env(safe-area-inset-right));bottom:max(8px,env(safe-area-inset-bottom));gap:6px}#destinations button{min-height:54px;padding:6px 10px;font-size:13px}#destinations span{font-size:10px}#destinations small{display:none}
 #atlas-controls{left:auto;right:max(16px,env(safe-area-inset-right));top:8px;bottom:auto;z-index:21}#atlas-controls #atlas-motion{display:none}body[data-atlas=true] #mobile-dashboard{display:none}
 #mobile-toolbar{right:auto!important}#mobile-toolbar button{font-size:12px;padding:7px 9px}
 #bridge-toolbar{top:62px;max-width:calc(100% - 250px)}#bridge-toolbar button{font-size:13px}
 #scene-readout{top:62px;right:max(12px,env(safe-area-inset-right));width:228px;max-height:calc(100% - 143px);padding:8px;z-index:12}
 #scene-readout.expanded{width:340px;max-height:calc(100% - 143px)}
 #bridge-tools{top:113px;max-height:calc(100% - 195px);width:260px}
 #scene-replay{bottom:max(6px,env(safe-area-inset-bottom));width:calc(100% - 32px);display:grid;grid-template-columns:265px 1fr;gap:0 12px;padding:5px 10px;align-items:center}#scene-replay[hidden]{display:none}
 #scene-time{grid-column:2;grid-row:1}#replay-details{grid-column:2;grid-row:2;text-align:right;min-height:24px;padding:0;font-size:11px}.replay-head{grid-row:1/3}.replay-head strong{font-size:12px}.replay-head small{font-size:10px}.replay-head select{min-width:48px}
 #scene-replay.details-open .replay-foot,#scene-replay.details-open .scene-position{grid-column:1/-1}.replay-foot{margin-top:0}
 body[data-near=true] .view-tools,.view-tools{bottom:85px;left:max(12px,env(safe-area-inset-left));right:auto;flex-direction:row}
 .provenance,#pin{display:none!important}
}
body.scene-immersive #viewport,body.scene-immersive[data-atlas=true] #viewport{height:100dvh;min-height:0}
@media(max-width:700px),(pointer:coarse) and (max-width:1100px),(max-height:520px) and (max-width:1100px){
 canvas#scene,body[data-atlas=true] canvas#scene{position:absolute;inset:0;width:100%;height:100%}
 #bridge-tools,#scene-readout{position:absolute;margin:0;left:auto}
 #bridge-tools{left:max(12px,env(safe-area-inset-left));right:auto}
 #scene-replay{position:absolute;left:50%;right:auto;top:auto;transform:translateX(-50%);margin:0}
 body[data-near=true] .view-tools,.view-tools{top:auto}
 #story-caption{margin-left:0}
}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 #scene-replay{grid-template-columns:340px 1fr}.replay-head>div{min-width:135px}.replay-head strong,.replay-head small{white-space:nowrap}.replay-head button{white-space:nowrap}.replay-head label{gap:4px}
 body[data-near=true] .view-tools,.view-tools{height:44px}
}
@media(max-width:700px),(pointer:coarse) and (max-width:1100px),(max-height:520px) and (max-width:1100px){
 #scene-readout:not([data-open=true]) #selected-alert,#scene-readout:not([data-open=true]) #band-legend>small{display:none}
 #scene-readout:not([data-open=true]) .scene-alerts p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;line-height:1.3}
 #scene-readout:not([data-open=true]) .scene-alerts #band-legend li{font-size:11px}
 #scene-readout:not([data-open=true]) .mini-readings{margin:2px 0}
 #scene-readout:not([data-open=true]) .quasi-legend{font-size:11px;gap:6px}
 #scene-readout:not([data-open=true]) .scene-alerts .line-key{font-size:10px;gap:4px}
}
@media(max-width:700px),(pointer:coarse) and (max-width:1100px),(max-height:520px) and (max-width:1100px){
 #scene-readout .mini-readings{padding:2px 0}#scene-readout .mini-readings small,#scene-readout .mini-readings b{margin:0;line-height:1.35}
}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 #scene-replay{grid-template-columns:370px 1fr}.replay-head>div{min-width:170px}.replay-head strong{font-size:11px}
}
@media(max-width:700px) and (orientation:portrait){
 header{height:72px;min-height:72px;padding:10px 4%}
 .replay-head{display:grid;grid-template-columns:1fr auto}.replay-head>div{grid-column:1/-1;display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}.replay-head strong{font-size:12px}.replay-head small{font-size:10px}.replay-head button{min-height:38px}.replay-head label{justify-self:end}.replay-head select{min-height:38px}
}
@media(max-width:700px),(pointer:coarse) and (max-width:1100px),(max-height:520px) and (max-width:1100px){
 body[data-ready=true] #load-status{display:none}
}
/* Keep an exit reachable if a tablet/window grows past the mobile breakpoint. */
body.scene-immersive #mobile-toolbar{display:flex;position:absolute;z-index:20;top:max(8px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));gap:6px}
body.scene-immersive #mobile-toolbar button{min-height:44px;padding:8px 10px;font-size:13px;border:1px solid #46636b;background:#102830ed;color:#e3f1ee;border-radius:9px}
body.scene-immersive #mobile-toolbar button[hidden]{display:none}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 .atlas-actions{flex-wrap:nowrap;align-items:stretch}.atlas-actions>button,.atlas-actions .primary{flex:1;min-width:0;min-height:44px;font-size:12px;padding:8px;white-space:normal}
}
