/* v1.5.1: all primary controls above the platform's bottom-right "Powered by Netlify" overlay.
   The external overlay is not part of the app DOM and must not be removed by fragile selectors. */
body.viewer-immersive {
  --studio-brand-reserve: 92px;
  --studio-primary-height: 48px;
  --studio-dock-gap: 10px;
  --studio-view-height: 48px;
  --studio-quick-height: 46px;
  --studio-primary-bottom: calc(var(--studio-brand-reserve) + var(--studio-safe-bottom));
  --studio-view-bottom: calc(var(--studio-primary-bottom) + var(--studio-primary-height) + var(--studio-dock-gap));
  --studio-quick-bottom: calc(var(--studio-view-bottom) + var(--studio-view-height) + var(--studio-dock-gap));
  --studio-menu-bottom: calc(var(--studio-quick-bottom) + var(--studio-quick-height) + 14px);
}
.immersive-quickbar {display:none}
.floating-section-label {grid-column:1/-1;border-top:1px solid #34556d;padding:10px 3px 2px;color:#8ebed5;font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
body.viewer-immersive .immersive-actions {
  bottom:var(--studio-primary-bottom)!important;
  min-height:var(--studio-primary-height);
  grid-template-columns:repeat(4,minmax(0,1fr));
  left:max(10px,env(safe-area-inset-left,0px));
  right:max(10px,env(safe-area-inset-right,0px));
  max-width:560px;
  gap:8px;
}
body.viewer-immersive .immersive-actions .immersive-action{min-height:var(--studio-primary-height);padding:7px 2px}
body.viewer-immersive .view-controls{
  bottom:var(--studio-view-bottom)!important;
  height:var(--studio-view-height);
  width:max-content;
  max-width:calc(100% - 20px)!important;
  overflow-x:auto;
  overscroll-behavior-x:contain;
  scrollbar-width:none;
  white-space:nowrap;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-x;
}
body.viewer-immersive .view-controls::-webkit-scrollbar,
body.viewer-immersive .immersive-quickbar::-webkit-scrollbar{display:none}
body.viewer-immersive .view-controls .view-btn{flex:0 0 auto;min-height:44px;padding:7px 10px}
body.viewer-immersive .immersive-quickbar{
  display:flex;position:absolute;left:10px;right:10px;
  bottom:var(--studio-quick-bottom);min-height:var(--studio-quick-height);
  max-width:560px;margin:0 auto;padding:1px 2px;
  align-items:center;gap:7px;overflow-x:auto;overflow-y:hidden;
  overscroll-behavior-x:contain;scrollbar-width:none;-webkit-overflow-scrolling:touch;
  touch-action:pan-x;z-index:15;
  border-radius:13px;
  background:linear-gradient(90deg,#10263ad9,#10263ab8);
  border:1px solid #344e66;
}
body.viewer-immersive .immersive-quickbar button{
  flex:0 0 auto;min-width:66px;min-height:44px;padding:7px 11px;border-radius:10px;
  border:1px solid #42647d;background:#1c344aee;color:#e0f5ff;
  font-weight:750;font-size:12px;white-space:nowrap;touch-action:manipulation;
}
body.viewer-immersive .immersive-quickbar button.active,
body.viewer-immersive .immersive-quickbar button[aria-pressed="true"]{
  background:#245a70;border-color:#76e0f3;color:#fff;
}
body.viewer-immersive .viewer-toolbox{
  bottom:var(--studio-menu-bottom)!important;
  top:auto!important;left:50%;right:auto;
  max-height:min(44dvh, calc(100dvh - var(--studio-menu-bottom) - 115px));
  min-height:0;
  width:min(450px,calc(100vw - 24px));
  z-index:120;overscroll-behavior:contain;touch-action:pan-y;
}
body.viewer-immersive .viewer-toolbox .floating-grid button{min-height:44px}
body.viewer-immersive .viewer-floating-tools{z-index:130}
body.viewer-immersive .view-controls,body.viewer-immersive .immersive-actions,
body.viewer-immersive .immersive-quickbar{pointer-events:auto}
body.viewer-immersive .viewport-body{overscroll-behavior:contain}
body.viewer-immersive.toolbox-open .immersive-quickbar,
body.viewer-immersive.toolbox-open .view-controls{opacity:.45;pointer-events:none}
@media(max-width:390px){
  body.viewer-immersive .immersive-actions{gap:5px;left:8px;right:8px}
  body.viewer-immersive .view-controls .view-btn{padding:7px 9px;font-size:11px}
  body.viewer-immersive .immersive-quickbar button{font-size:11px;padding:7px 9px}
  body.viewer-immersive .immersive-action{font-size:11px}
}
@media(max-height:610px) and (orientation:landscape){
  body.viewer-immersive {--studio-brand-reserve:64px;--studio-primary-height:44px;--studio-dock-gap:5px;--studio-view-height:44px;--studio-quick-height:42px}
  body.viewer-immersive .viewer-toolbox{max-height:min(32dvh,calc(100dvh - var(--studio-menu-bottom) - 55px))}
  body.viewer-immersive .immersive-quickbar button{min-height:40px}
}
@media(prefers-reduced-motion:reduce){body.viewer-immersive .immersive-quickbar{scroll-behavior:auto}}
