/* Keep browser gestures off the canvas surface, not the surrounding app/forms. */
body .studio .canvas-workspace { touch-action: none; overscroll-behavior: contain; }
body .studio .canvas-mobile-toolbar-toggle { display: none; }
@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  body .studio .canvas-mobile-toolbar-toggle {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    position: absolute; top: max(72px, calc(env(safe-area-inset-top) + 64px)); z-index: 100;
    min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: 14px;
    border: 1px solid #56635c33; background: #fbfdfbee; color: #284d3c;
    box-shadow: 0 3px 14px #1d35231c; font: 600 12px/1.2 system-ui, sans-serif;
    touch-action: manipulation;
  }
  body .studio.dark .canvas-mobile-toolbar-toggle { background: #242b33ee; color: #edf5f0; border-color: #ffffff25; }
  body .studio .canvas-mobile-toolbar-toggle:focus-visible { outline: 2px solid #298969; outline-offset: 2px; }
  body .studio .canvas-mobile-toolbar-toggle.is-left { left: max(8px, env(safe-area-inset-left)); }
  body .studio .canvas-mobile-toolbar-toggle.is-right { right: max(8px, env(safe-area-inset-right)); }
  body .studio .left-toolbar, body .studio .right-toolbar {
    top: max(124px, calc(env(safe-area-inset-top) + 116px)); bottom: auto; transform: none;
    width: 56px; box-sizing: border-box;
    max-height: calc(100dvh - 196px - env(safe-area-inset-bottom)); overflow-y: auto;
    overscroll-behavior: contain; touch-action: pan-y;
  }
  body .studio.mobile-left-collapsed .left-toolbar,
  body .studio.mobile-left-collapsed .node-type-palette,
  body .studio.mobile-right-collapsed .right-toolbar { display: none !important; }
  body .studio .left-toolbar button, body .studio .right-toolbar button,
  body .studio .zoom-controls button, body .studio .theme-toggle { min-width: 44px; min-height: 44px; }
  body .studio .zoom-controls { height: 52px; bottom: max(10px, env(safe-area-inset-bottom)); left: max(8px, env(safe-area-inset-left)); max-width: calc(100vw - 72px); }
  body .studio .zoom-controls input[type="range"] { min-height: 44px; width: 76px; touch-action: none; }
  body .studio .bottom-actions { bottom: max(10px, env(safe-area-inset-bottom)); }
}
