/* Only an active studio canvas fills the surface; other modules retain their layout. */
/* Home keeps one compact, in-flow brand bar. No overlay or negative offset. */
html[data-studio-home] .workbench-bar { height: 48px; grid-template-rows: 48px; }
html[data-studio-home] .brand img { height: 96px; }
html[data-studio-home] .desktop-surface > main { margin-top: 0; }
html[data-studio-canvas-full] body { padding: 0; }
html[data-desktop-frame][data-studio-canvas-full] body { padding: var(--frame-inset); }
html[data-studio-canvas-full] .desktop-surface {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0;
  isolation: isolate;
}
html[data-studio-canvas-full] .workbench-bar {
  height: 52px;
  grid-template-rows: 52px;
  grid-template-columns: 52px minmax(0, 1fr) auto auto;
  z-index: 2;
  margin: 12px 20px 0 calc(20px + var(--studio-canvas-left-inset, 0px));
  pointer-events: none;
}
html[data-studio-canvas-full] .brand { width: 52px; height: 52px; transform: none; }
html[data-studio-canvas-full] .brand img { width: 52px; height: 52px; }
html[data-studio-canvas-full] .module-tabs { display: none; }
html[data-studio-canvas-full] .workbench-bar > * { pointer-events: auto; }
html[data-studio-canvas-full] .desktop-surface > main {
  position: absolute;
  inset: 0;
  margin: 0;
  z-index: 1;
}

/* Let the shared studio resource control occupy the reserved header slot. */
html[data-studio-home] .desktop-surface { position: relative; }
html[data-studio-home] .desktop-surface > main { position: absolute; inset: 0; margin: 0; z-index: 1; }
html[data-studio-home] .workbench-bar { position: relative; z-index: 2; pointer-events: none; }
html[data-studio-home] .workbench-bar > * { pointer-events: auto; }
html[data-studio-home] .workbench-actions { pointer-events: none; }
html[data-studio-home] .workbench-actions > a { pointer-events: auto; }
html[data-studio-canvas-full] .brand{width:128px;height:44px}
html[data-studio-canvas-full] .brand img{width:128px;height:44px;object-fit:contain}
/* A home sidebar already owns the web brand. Keep the canvas home action. */
html[data-runtime=web][data-studio-home] .workbench-bar .brand{visibility:hidden;pointer-events:none}

html[data-runtime=web][data-studio-home] .workbench-bar{position:absolute;top:0;left:0;right:0;height:0;min-height:0;margin-top:0}
html[data-runtime=web][data-studio-home] .workbench-actions>a{display:none}

html[data-runtime="web"] .workbench-actions > .local-label{display:none}
/* Image editing owns the whole canvas; native desktop titlebar stays outside. */
html[data-studio-editor] .workbench-bar,
html[data-studio-editor] .workbench-bar * { visibility:hidden!important; pointer-events:none!important; }

html[data-studio-canvas-full] .workbench-actions { pointer-events:none; }
html[data-studio-canvas-full] .workbench-actions > * { pointer-events:auto; }
