/* One desktop workspace, irrespective of input method. Only gestures differ. */
html,body{height:100%;overflow:hidden;overscroll-behavior:none}
body{height:100dvh;min-width:0}
.editor-shell{height:calc(100dvh - var(--header-h));grid-template-rows:minmax(0,1fr);min-height:0}
.editor-shell>.left-rail,.editor-shell>.inspector,.editor-shell>.canvas-panel{min-height:0}
.left-rail,.inspector,.preview-chat-log,.preview-sessions,.preview-debug{overscroll-behavior:contain}
/* Keep all three columns on narrower windows too, without a different tablet UI. */
@media(max-width:1000px){
 :root{--left-w:clamp(150px,24vw,248px);--right-w:clamp(220px,34vw,360px)}
 .editor-shell{grid-template-columns:var(--left-w) minmax(0,1fr) var(--right-w)}
 .editor-masthead{grid-template-columns:150px minmax(0,1fr)}
 .editor-masthead h1{font-size:18px}
 .toolbar{flex-wrap:nowrap;overflow-x:auto;justify-content:flex-start}
 .toolbar button{flex-shrink:0}
 .document-state{display:none}
 .canvas-toolbar{gap:4px}.canvas-toolbar>span,.canvas-status{display:none}
 .workbench-preview{min-width:0;max-width:calc(100vw - 16px)}
 .float-grid{grid-template-columns:90px minmax(0,1fr) 180px}
}
.touch-input .blueprint-canvas{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.touch-input .blueprint-node{touch-action:none}
.touch-input .pin-row{cursor:crosshair}
.touch-input [data-wire-hit]{stroke-width:18px;vector-effect:non-scaling-stroke}
.touch-input .palette-button,.touch-input [data-variable-drag]>summary{touch-action:pan-y;position:relative;padding-right:28px}
.touch-drag-handle{display:none}
.touch-input .touch-drag-handle{display:grid;place-items:center;position:absolute;right:0;top:0;bottom:0;width:26px;touch-action:none;color:#5c7869;cursor:grab}
.touch-input .rich-editor{touch-action:auto;-webkit-user-select:text;user-select:text}
.touch-multi{box-shadow:inset 0 0 0 2px #dfc48b}
.touch-operation[hidden],.touch-placement-ghost[hidden]{display:none}
.touch-operation{position:absolute;bottom:48px;left:12px;right:12px;z-index:45;display:flex;align-items:center;gap:8px;padding:8px 12px;background:#233d32;color:#fff;border:1px solid #94af9d;border-radius:6px;box-shadow:0 6px 20px #0004;pointer-events:auto}
.touch-input-setting{display:flex;align-items:center;gap:12px;margin:10px 0}.touch-input-setting select{width:auto;min-width:150px}
.touch-sheet{padding:0;border:1px solid #9b9f91;border-radius:7px;background:#f3eddf;color:#293c32;width:min(460px,calc(100vw - 24px));max-height:calc(var(--touch-menu-height,100dvh) - 30px);box-shadow:0 18px 70px #0006}
.touch-sheet::backdrop{background:#07191166}.touch-sheet header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;position:sticky;top:0;background:#f3eddf}.touch-sheet-body{display:grid;padding:8px 12px 16px;gap:6px;overflow:auto}.touch-sheet button{min-height:44px;border-radius:5px;padding:8px 12px;text-align:left;font-size:14px}.touch-sheet textarea{min-height:150px;font-size:16px}
.touch-placement-ghost{position:absolute;z-index:44;pointer-events:none;max-width:220px;padding:8px 16px;border:1px dashed #dfc48b;border-radius:6px;background:#36503cd9;color:#fff;transform:translateX(-50%)}

.touch-canvas-controls{display:none}
.touch-input .touch-canvas-controls{display:flex;align-items:center;gap:6px;flex-shrink:0}
.touch-mode-switch{display:flex;border:1px solid #687d6e;border-radius:5px;overflow:hidden}
.touch-canvas-controls button{height:32px;padding:0 10px;font-size:12px;border:1px solid #687d6e;border-radius:5px;color:#e0e7df;background:#304239;white-space:nowrap}
.touch-canvas-controls button:hover:not(:disabled),.touch-canvas-controls button[aria-expanded="true"]{background:#496353;color:#fff}
.touch-mode-switch button[aria-pressed="true"]:hover:not(:disabled){background:#ead4a6;color:#25362e}
.touch-mode-switch button{border:0;border-radius:0}.touch-mode-switch button[aria-pressed="true"]{background:#ddc48f;color:#25362e}
.touch-input .canvas-toolbar{gap:7px;overflow-x:auto;scrollbar-width:none}.touch-input #canvasHint,.touch-input .canvas-status{display:none}.touch-input .zoom-controls{margin-left:auto;flex-shrink:0}
.touch-actions-dropdown{position:fixed;z-index:500;width:204px;overflow-y:auto;overscroll-behavior:contain;padding:6px;border:1px solid #93a191;border-radius:7px;background:#f3eddf;box-shadow:0 8px 24px #0005;display:grid;gap:3px}
.touch-actions-dropdown[hidden]{display:none}.touch-actions-dropdown button{min-height:40px;text-align:left;padding:8px 12px;border:0;border-radius:4px;background:transparent;font-size:14px;color:#293c32}.touch-actions-dropdown button:hover:not(:disabled){background:#dbe5db}.touch-actions-dropdown button:disabled{opacity:.4}
.touch-input :is(.editor-shell,.editor-masthead,.bottom-dock,.touch-actions-dropdown),.touch-input :is(.editor-shell,.editor-masthead,.bottom-dock,.touch-actions-dropdown) *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.touch-input :is(input,textarea,[contenteditable]:not([contenteditable="false"])),.touch-input [contenteditable]:not([contenteditable="false"]) *{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
