/* Mobile workbench: full-width canvas, docked panels and touch controls. */
#mobileNav,#mobilePicker,#mobileLayoutMode{display:none}
@media(max-width:780px), (max-height:500px) and (pointer:coarse){
 body{overflow-x:hidden}header{padding:8px 12px;gap:6px}.brand{width:100%;justify-content:space-between}.brand .logo{width:28px;height:28px;font-size:24px}.brand strong{font-size:15px}#homeName{display:block;width:80px;min-width:0;font-size:16px}.brand .divider{display:none}.view-switch{flex-shrink:0}.actions{width:100%;justify-content:flex-start;flex-wrap:nowrap;overflow-x:auto;margin:0;padding-bottom:2px}.actions button{white-space:nowrap;flex-shrink:0;min-height:42px;padding:8px 12px}.actions #saveStatus{display:none}
 body:not(.spaces-home) main{display:block;height:calc(100dvh - var(--mobile-header,160px) - 66px - env(safe-area-inset-bottom));min-height:260px;overflow:hidden}main>.library,main>.properties{display:none;height:100%;overflow-y:auto;padding:18px 16px 32px;overscroll-behavior:contain}main>.workspace{display:flex;height:100%;min-height:0}body[data-mobile-panel="library"] main>.workspace,body[data-mobile-panel="properties"] main>.workspace{display:none}body[data-mobile-panel="library"] main>.library{display:flex}body[data-mobile-panel="properties"] main>.properties{display:block}
 #mobileNav{position:fixed;bottom:0;left:0;right:0;z-index:8;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;padding:8px 8px calc(8px + env(safe-area-inset-bottom));background:#fff;border-top:1px solid #dce2e9}#mobileNav button{min-height:46px;padding:8px 2px;font-size:12px}#mobileNav [aria-pressed="true"],#mobileLayoutMode[aria-pressed="true"]{background:#e7f0fe;color:#245ebd;border-color:#9ebbe6}.spaces-home #mobileNav{display:none}#mobilePicker{display:block;margin-bottom:24px}#mobileLayoutMode{display:block}.workspace-heading{padding:10px 12px;display:flex;align-items:center}.workspace-heading h1{display:none}.workspace-heading .eyebrow{font-size:12px}.workspace-actions{margin:0;gap:4px}.workspace-actions button{min-height:40px;padding:6px 8px}footer{padding:8px;gap:8px;flex-wrap:wrap}footer>span:last-child{display:none}.canvas-hint{bottom:8px;padding:6px 8px;font-size:11px;max-width:95%}.zoom{bottom:70px;right:10px}.zoom button{min-height:44px;min-width:44px}
 #spatialToolbar{top:4px;left:6px;right:6px;gap:5px;max-height:132px;overflow-y:auto}#spatialToolbar button{min-height:40px;padding:7px;font-size:11px}.spatial-tool-group{padding-right:4px;flex-wrap:wrap}.storage-preview-hint{font-size:10px}.tiles button{min-height:100px}.catalog-grid button{min-height:48px}.library-bottom{margin-top:22px}#propertyContent{margin-top:16px}
 button{touch-action:manipulation;min-height:44px}input,select,textarea{font-size:16px;min-width:0}select{max-width:100%}input:not([type="checkbox"]):not([type="file"]){min-height:44px}.swatch{min-height:30px}dialog{padding:16px;width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow-y:auto;overscroll-behavior:contain;border-radius:12px}#recordDialog,#globalInventoryDialog,#inventoryDialog,#containerDialog,#batchDialog,#recycleDialog,#helpDialog,#spaceNameDialog{width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:16px}.dialog-heading{gap:8px}.dialog-heading button{flex-shrink:0}.dialog-heading h2{font-size:16px}.record-form-body,.help-sections{grid-template-columns:1fr}.record-section{padding:12px}.record-save-bar{position:static;margin:16px -16px -16px;padding:16px;flex-wrap:wrap}#recordDialog>.dialog-heading{top:-16px;padding:10px 0}#recordForm .record-save-bar button{width:100%}#recordUsage{grid-template-columns:1fr}.record-save-bar span{width:100%}.inventory-filters{flex-wrap:wrap}.global-query{flex-direction:column;gap:8px}.global-query select,#globalCategory{width:100%}#globalResults,#inventoryResults,#recycleResults{max-height:none}.global-record{gap:8px;flex-wrap:wrap}.global-record-body{flex:1;min-width:0}.global-record-end{flex-basis:100%;max-width:none;display:flex;align-items:center;justify-content:space-between;gap:8px}.global-record-end button{min-height:40px}.global-record-body p{font-size:12px}.global-results-toolbar{flex-wrap:wrap;gap:8px}#batchBar input,#globalResults .batch-record-check,#recycleResults input[type="checkbox"]{width:24px;height:24px;flex-basis:24px}#containerScopeBanner:not([hidden]){flex-direction:column;align-items:start}.photo-actions{flex-wrap:wrap}.field-grid{gap:8px}#toast{bottom:80px;max-width:94vw;width:max-content;font-size:12px;padding:10px 14px;z-index:9}
 #spaceHome{padding:20px 14px}.home-heading{gap:12px;flex-wrap:wrap}.home-tools{display:block;margin:20px 0}.home-tools input{max-width:none}.home-tools>div{flex-wrap:wrap;margin-top:12px;gap:8px}#spaceCards{grid-template-columns:1fr}.space-card-actions button{min-height:44px}.spaces-home header{min-height:52px}.home-heading h1{font-size:28px}#globalSearchBar{flex-wrap:wrap;padding:14px}#globalSearchBar>div{flex-basis:100%}#globalSearchBar button{height:auto;min-height:44px}#spaceSummary{flex-wrap:wrap;gap:10px}.home-storage-note{overflow-wrap:anywhere}
}

@media(max-height:500px) and (pointer:coarse){body:not(.spaces-home) main{min-height:0}.brand{width:auto;flex:1}.brand strong,.brand .logo,#homeName{display:none}.view-switch{margin-left:auto}.workspace-heading{padding:4px 10px}.workspace-heading .eyebrow,footer{display:none}#spatialToolbar{max-height:86px}.canvas-hint{font-size:10px;bottom:3px}}

.view-transition-layer{position:absolute;inset:0;width:100%;height:100%;z-index:6;pointer-events:none;background:#edf0f3;visibility:visible!important}
#floatingPlan{position:absolute;right:12px;bottom:55px;z-index:7;min-width:60px;min-height:52px;border-radius:20px;background:#ffffffed;box-shadow:0 4px 18px #25334526;color:#285fc7;touch-action:none}
#floatingPlan[hidden]{display:none}
@media(max-width:780px), (max-height:500px) and (pointer:coarse){
 body[data-mobile-panel="properties"] main,body[data-mobile-panel="library"] main{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:42% 58%}body[data-mobile-panel="properties"] main>.workspace,body[data-mobile-panel="library"] main>.workspace{display:flex;min-height:0;height:100%}body[data-mobile-panel="properties"] main>.properties,body[data-mobile-panel="library"] main>.library{grid-row:2;border-top:2px solid #cbd7e5;min-height:0;padding-top:10px}body[data-mobile-panel="properties"] .workspace-heading,body[data-mobile-panel="library"] .workspace-heading{display:none}
 body.mobile-sheet main{height:calc(var(--sheet-top,44dvh) - var(--mobile-header,160px));min-height:90px}body.mobile-sheet .workspace-heading,body.mobile-sheet footer{display:none}body.mobile-sheet #mobileNav{visibility:hidden}
 body.mobile-sheet #recordDialog[open],body.mobile-sheet #containerDialog[open],body.mobile-sheet #spaceNameDialog[open],body.mobile-sheet #batchDialog[open]{position:fixed;inset:var(--sheet-top,44dvh) 0 auto;margin:0;width:100%;max-width:100%;height:var(--sheet-height,56dvh);max-height:var(--sheet-height,56dvh);border-radius:16px 16px 0 0;border-top:2px solid #cbd7e5;box-shadow:0 -4px 18px #25334514;padding:14px 16px 24px}
 body.mobile-sheet #recordDialog::backdrop,body.mobile-sheet #containerDialog::backdrop,body.mobile-sheet #spaceNameDialog::backdrop,body.mobile-sheet #batchDialog::backdrop{background:transparent}
 body.mobile-sheet #spatialToolbar{display:none}body.mobile-sheet .canvas-hint{display:none}body.mobile-sheet .zoom{bottom:8px}body.mobile-sheet #floatingPlan{display:none}
}
@media(max-height:500px) and (pointer:coarse){body[data-mobile-panel="properties"] main,body[data-mobile-panel="library"] main{grid-template-columns:48% 52%;grid-template-rows:100%}body[data-mobile-panel="properties"] main>.properties,body[data-mobile-panel="library"] main>.library{grid-column:2;grid-row:1;border-left:2px solid #cbd7e5}body.mobile-sheet main{height:calc(100dvh - var(--mobile-header,118px));width:48%;min-height:0}body.mobile-sheet #recordDialog[open],body.mobile-sheet #containerDialog[open],body.mobile-sheet #spaceNameDialog[open],body.mobile-sheet #batchDialog[open]{inset:0 0 0 auto;width:52%;height:100dvh;max-height:100dvh;border-radius:12px 0 0 12px}}
@media(max-width:780px), (max-height:500px) and (pointer:coarse){body.mobile-sheet header{min-height:52px}body.mobile-sheet header .actions,body.mobile-sheet header .view-switch{display:none}body.mobile-sheet main{min-height:0}}

@media(max-width:780px), (max-height:500px) and (pointer:coarse){body[data-mobile-panel="library"] main>.library,body[data-mobile-panel="properties"] main>.properties{width:100%;min-width:0}.library .tiles{grid-template-columns:repeat(2,minmax(0,1fr))}.library .catalog-grid{grid-template-columns:repeat(auto-fit,minmax(130px,1fr))}}

