/* Tablet navigation: overlay sidebars never resize or rebuild the drawing. */
@media screen {
    .floor-viewport { overflow-anchor: none; overscroll-behavior: contain; scroll-behavior: auto; touch-action: none; }
    .floor-scale-surface { position: relative; flex: none; }
    .floor-scale-surface > .floor-canvas { position: absolute; top: 0; left: 0; margin: 0; }
    .floor-viewport.panning { cursor: grabbing; user-select: none; }
    .floor-touch-controls,.editor-panel-close { display: none; }
}
@media screen and (max-width: 900px), screen and (hover: none), screen and (pointer: coarse) {
    .editor-panel-tabs.floor-panel-tabs { grid-template-columns: minmax(0,1fr) minmax(0,.7fr) minmax(0,1fr) minmax(52px,.65fr); }
    .editor-panel-tabs [data-editor-panel-auto][aria-pressed=true] { border-color: var(--green); color: var(--green); background: color-mix(in srgb,var(--green) 12%,var(--surface)); }
    html[data-theme=light] .editor-panel-tabs [data-editor-panel-auto][aria-pressed=true] { border-color: #18733c; color: #176637; background: #eaf7ee; }
    .editor-body > .tool-panel { right: auto; width: min(370px,100%); }
    .editor-body > .inspector { left: auto; width: min(420px,100%); }
    .editor-body > .tool-panel,.editor-body > .inspector { overscroll-behavior: contain; box-shadow: var(--shadow); }
    .editor-body .editor-panel-close { position: sticky; top: 0; z-index: 60; display: flex; width: 100%; min-height: 44px; border-radius: 0; background: var(--surface-3); }
    .floor-touch-controls { display: flex; flex: 1 1 auto; gap: 6px; }
    .floor-touch-controls button { min-height: 44px; border: 1px solid var(--border); white-space: nowrap; }
    .floor-touch-controls button[aria-pressed=true] { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
    .floor-viewport { padding-top: 160px; padding-bottom: 110px; }
    .floor-scale-surface > .floor-canvas { touch-action: none; }
    .workspace-toolbar { user-select: none; }
    .editor-body .workspace-toolbar .layout-lock-state { flex: 0 1 auto; }
    .editor-body .tool-grid,.editor-body .palette-list { grid-template-columns: minmax(0,1fr); }
    .editor-body .tool-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .editor-body > .workspace { visibility: visible; }
}
@media screen and (max-width: 620px) {
    .editor-body > .tool-panel,.editor-body > .inspector { width: 100%; }
    .floor-touch-controls { flex-basis: 100%; }
    .floor-touch-controls button { flex: 1; }
    .editor-body .workspace-toolbar .layout-lock-state { font-size: .875rem; flex-basis: 100%; }
    .floor-viewport { padding-top: 185px; }
}
