/* Tool sheets leave the dock available for direct switching. */
body.brb-desktop:has(dialog[open]:not(:modal)) .chrome,
body.brb-desktop.workspace-persistent:has(dialog[open]:not(:modal)) .chrome {
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}
body.scene-ui-hidden .chrome {
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
}
body.scene-ui-hidden #dock-tooltip { display:none!important; }
.feature-dock:not(:has(button:not([hidden]))) { display:none; }

@media(max-width:700px) {
  html[data-scene] .panel[open]:not(:modal) {
    position:fixed;
    top:max(88px,env(safe-area-inset-top,0px));
    right:auto;
    bottom:auto;
    left:50%;
    transform:translateX(-50%);
    margin:0;
    max-width:calc(100vw - 24px);
    max-height:calc(100dvh - 240px - env(safe-area-inset-bottom,0px));
    z-index:20;
    overflow:auto;
  }
  body.brb-desktop:has(dialog:modal) .chrome { opacity:.35; pointer-events:none; }
}
@media(max-width:700px) and (max-height:500px) {
  html[data-scene] .panel[open]:not(:modal) {
    top:max(12px,env(safe-area-inset-top,0px));
    max-height:calc(100dvh - 154px - env(safe-area-inset-bottom,0px));
  }
}
