/* Canvas tools own finger drags; scrolling remains enabled in panels/forms. */
.viewport, .doc-win-body, .liquify-canvas { touch-action: none; }
.touch-actions { display: none; }
@media (pointer: coarse) {
  .editor { -webkit-touch-callout: none; }
  .editor .tool, .editor .qm-toggle { width: 44px; height: 44px; }
  .editor .tool-flyout button, .editor .dropdown button,
  .editor .ai-tasks button, .editor .primary-btn, .editor .ghost-btn,
  .editor .props-buttons button { min-height: 44px; }
  .editor .dd-sub:hover:not(.touch-open) > .dropdown { display: none; }
  .editor .dd-sub.touch-open > .dropdown { display: block; }
  .editor .panel-collapse-row { min-height: 44px; flex-shrink: 0; }
  .editor .panel-collapse-btn, .editor .panel-flyout-btn { min-width: 44px; min-height: 44px; }
  .editor .layer-row { min-height: 44px; }
  .editor .optionsbar input, .editor .optionsbar select { min-height: 40px; }
  .editor input[type=range] { min-height: 36px; }
  .editor input:not([type=checkbox]):not([type=radio]):not([type=range]),
  .editor select, .editor textarea { font-size: 16px; }
  .tool-flyout { max-height: calc(100dvh - 100px); overflow-y: auto; }
  .touch-actions {
    display: flex; position: absolute; top: 128px; right: 52px; z-index: 20;
    gap: 4px; padding: 4px; border-radius: 8px;
    background: var(--panel); border: 1px solid var(--line);
  }
  .touch-actions button {
    min-width: 44px; height: 44px; border: 0; border-radius: 4px;
    background: var(--panel2); color: var(--text); font-size: 20px;
    touch-action: manipulation;
  }
}
@media (pointer: coarse) and (min-width: 901px) {
  body .editor { grid-template-columns: 56px var(--left-dock, 0px) 1fr var(--panel-col, 272px); }
  body.tools-2col .editor { grid-template-columns: 108px var(--left-dock, 0px) 1fr var(--panel-col, 272px); }
  body.tools-float .editor, body.tools-hidden .editor { grid-template-columns: 0 var(--left-dock, 0px) 1fr var(--panel-col, 272px); }
  body .toolbar.floating { width: 56px; }
  body.tools-2col .toolbar.floating { width: 108px; }
}
