#mobileDesignerBar,#mobileDesignerViews,#mobileCatalogClose,#mobileAddModule,.mobileExtraTool{display:none}
@media(max-width:720px){
#authorWorkspace{height:100dvh!important;max-height:100dvh;overflow:hidden;background:#edf1f4}
#authorWorkspace #accessPreviewBar{font-size:10px!important;padding:6px 12px!important;line-height:1.4;gap:4px!important;flex:none;min-height:26px}
#mobileDesignerBar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;background:#263b46;color:#fff;flex:none;min-height:56px}
#mobileDesignerBar strong{font:600 15px Arial;letter-spacing:-.3px}
#mobileDesignerBar button,#mobileDesignerViews button,#mobileCatalogClose{font:13px Arial;min-height:40px;border:1px solid #d3dfe4;border-radius:7px;padding:8px 12px;background:white;color:#254752;cursor:pointer}
#mobileDesignerBar button{background:#36515e;border-color:#6f8793;color:white}
#mobileDesignerViews{display:flex;gap:8px;align-items:center;padding:9px 12px;background:white;border-bottom:1px solid #d5dfe4;flex:none}
#mobileDesignerViews button{flex:1;padding:8px 6px;white-space:nowrap}
#mobileDesignerViews button[aria-pressed=true]{background:#174f6a;color:white;border-color:#174f6a}
#authorWorkspace #topbar{display:none!important}
#authorWorkspace.mobileToolsOpen #topbar{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;position:absolute;top:143px;left:8px;right:8px;bottom:42px;max-height:calc(100dvh - 185px);z-index:250;overflow:auto;align-content:start;padding:14px;background:#263b46;border:1px solid #7b909a;border-radius:12px;box-shadow:0 10px 35px #17323e55}
#authorWorkspace #topbar #projectActionsWrap,#authorWorkspace #topbar>h1,#authorWorkspace #topbar #btnPlan,#authorWorkspace #topbar #btn3d,#authorWorkspace #topbar #btnPaymentLicense{display:none!important}
#authorWorkspace #topbar .mobileExtraTool{display:block}
#authorWorkspace #topbar button,#authorWorkspace #topbar select{position:static!important;width:100%;min-width:0;min-height:44px;margin:0!important;white-space:normal;line-height:1.3;font:13px Arial;padding:9px!important}
#authorWorkspace #topbar #btnShareView{position:static!important;grid-column:auto}
#authorWorkspace #toolbarPreferences,#authorWorkspace #reviewImageActions{display:contents!important}
#authorWorkspace #main{position:relative;min-height:0;flex:1;overflow:hidden;width:100%}
#authorWorkspace #canvasWrap{width:100%;height:100%;min-width:0;flex:1}
#authorWorkspace #sidebar{display:none!important}
#authorWorkspace.mobileCatalogOpen #sidebar{display:flex!important;position:absolute;left:8px;right:8px;bottom:8px;width:auto;height:min(48dvh,410px);max-height:calc(100% - 14px);z-index:120;border:1px solid #bdccd4;border-radius:12px;padding:12px;background:#f5f7f8;box-shadow:0 -8px 28px #18374726;overflow:hidden}
#authorWorkspace #sidebar h2{padding:0 70px 10px 0;margin:0;font:600 12px/1.4 Arial;color:#254752;min-height:35px}
#mobileCatalogClose{display:block;position:absolute;right:10px;top:7px;min-height:32px;padding:6px 9px;font-size:12px}
#authorWorkspace #catalog{display:grid!important;grid-template-columns:1fr 1fr;gap:8px;align-content:start;overflow:auto;flex:1;min-height:0}
#authorWorkspace .cat-item{margin:0;padding:10px;min-width:0;min-height:76px;border-radius:8px;touch-action:manipulation}
#authorWorkspace .cat-item b{font:600 12px/1.35 Arial}#authorWorkspace .cat-item span{font:10px/1.5 Arial}
#authorWorkspace #catalogModelPreview,#authorWorkspace #sidebar .help{display:none!important}
#authorWorkspace #status{font:11px/1.4 Arial;padding:7px 12px;min-height:30px;max-height:48px;overflow:auto;flex:none}
#authorWorkspace .modal{max-width:calc(100vw - 24px)!important;max-height:calc(100dvh - 32px)!important;left:12px!important;right:12px!important;top:16px!important;width:auto!important;overflow:auto;box-sizing:border-box;z-index:350}
#authorWorkspace .modal input,#authorWorkspace .modal select{max-width:100%;min-height:36px;font-size:14px}
#authorWorkspace .modal button{min-height:38px}
}

@media(max-width:720px){#mobileAddModule{display:block;flex:none;min-height:42px;margin-top:10px;border:0;border-radius:7px;background:#174f6a;color:white;font:600 13px Arial;padding:10px;cursor:pointer}}

/* Mobile catalog: one horizontal row below the drawing. */
.mobileModuleThumb,.mobileModuleAdd{display:none}
@media(max-width:720px){
#authorWorkspace #main{display:flex;flex-direction:column}
#authorWorkspace #canvasWrap{height:auto;min-height:0;order:0}
#authorWorkspace.mobileCatalogOpen #sidebar{display:flex!important;position:relative;left:auto;right:auto;bottom:auto;width:100%;height:132px;max-height:none;min-height:132px;flex:0 0 132px;order:1;border:0;border-top:1px solid #c4d0d6;border-radius:0;padding:6px 8px;background:#f4f7f8;box-shadow:none;overflow:hidden}
#authorWorkspace #sidebar h2,#mobileCatalogClose,#mobileAddModule{display:none!important}
#authorWorkspace #catalog{display:flex!important;flex-direction:row;flex-wrap:nowrap;gap:7px;overflow-x:auto;overflow-y:hidden;min-height:0;padding:0 0 4px;scroll-snap-type:x proximity;touch-action:pan-x;overscroll-behavior-x:contain}
#authorWorkspace .cat-item{position:relative;flex:0 0 112px;width:112px;min-height:0;height:112px;box-sizing:border-box;padding:4px 5px;scroll-snap-align:start;touch-action:pan-x}
#authorWorkspace .cat-item b{font:600 10px/1.15 Arial;height:24px;overflow:hidden;margin-top:2px}
#authorWorkspace .cat-item span{font:9px/1.3 Arial;white-space:nowrap}
#authorWorkspace .mobileModuleThumb{display:block;width:100%;height:60px;object-fit:contain;pointer-events:none}
#authorWorkspace .mobileModuleAdd{display:block;position:absolute;top:0;right:0;width:36px;height:40px;border:0;border-radius:6px;background:#174f6a;color:#fff;font:23px Arial;cursor:pointer}
}
@media(max-width:720px){
#authorWorkspace.mobileCatalogOpen #sidebar{flex-direction:row;gap:7px}
#authorWorkspace #catalog{flex:1;min-width:0}
#authorWorkspace #catalogModelPreview{display:flex!important;width:90px;flex:0 0 90px;min-width:0;height:116px;padding:4px;margin:0;border:1px solid #c5d3cc;border-radius:7px;justify-content:center}
#authorWorkspace #catalogModelImage,#authorWorkspace #catalogModelPreview[data-selected-type] #catalogModelImage{height:88px;width:80px;margin:0;object-fit:contain}
#authorWorkspace #catalogModelSize{font:8px/1.3 Arial;white-space:nowrap}
}
.mobileDialogCloseBar{display:none}
@media(max-width:720px){
body.mobileDesignerActive .modal{position:fixed!important;inset:12px!important;left:12px!important;right:12px!important;top:12px!important;bottom:auto!important;transform:none!important;width:calc(100vw - 24px)!important;max-width:calc(100vw - 24px)!important;max-height:calc(100dvh - 24px)!important;overflow-x:hidden!important;overflow-y:auto!important;box-sizing:border-box;overscroll-behavior-y:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;z-index:350}
body.mobileDesignerActive .modal .mobileDialogCloseBar{display:flex;justify-content:flex-end;position:sticky;top:-14px;z-index:20;background:#fff;padding:5px 0 7px;margin-top:-8px;border-bottom:1px solid #d6e0e4;touch-action:pan-y}
body.mobileDesignerActive .mobileDialogCloseBar button{min-width:90px;min-height:42px;padding:8px 14px;border:1px solid #9fb3bd;border-radius:6px;background:#edf3f6;color:#254752;font:600 14px Arial}
body.mobileDesignerActive .modal h3{touch-action:pan-y!important;cursor:default!important}
body.mobileDesignerActive #catalogList,body.mobileDesignerActive #floorList{max-height:none!important;overflow:visible!important;touch-action:pan-y}
body.mobileDesignerActive #shareDestinationMenu{left:12px!important;right:12px!important;top:12px!important;width:calc(100vw - 24px)!important;max-width:none;max-height:calc(100dvh - 24px);overflow-y:auto;touch-action:pan-y}
body.mobileDesignerActive #shareDestinationMenu header{position:sticky;top:-12px;z-index:2;background:white;padding:8px 0}
body.mobileDesignerActive #shareDestinationClose{min-width:42px;min-height:42px}
}
@media(max-width:720px){#authorWorkspace #catalogModelPreview{display:none!important}}
@media(max-width:720px){
body.mobileDesignerActive #catalogDlg[style*="display: block"],body.mobileDesignerActive #catalogDlg[style*="display:block"]{display:block!important;height:auto!important;bottom:auto!important;top:12px!important;max-height:calc(100dvh - 24px)!important}
body.mobileDesignerActive #catalogDlg #catalogList{overflow:visible!important;min-height:0!important;max-height:none!important;flex:none!important}
}
@media(max-width:720px){#authorWorkspace #canvasWrap canvas{touch-action:none!important;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}}
@media(max-width:720px){
#authorWorkspace.mobileToolsOpen #topbar{top:auto!important;bottom:48px!important;left:8px;right:8px;max-height:min(31dvh,250px);grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:8px;border-radius:10px;background:#263b46;align-content:start}
#authorWorkspace #topbar button,#authorWorkspace #topbar select{min-height:40px;font-size:11px;padding:6px!important}
#authorWorkspace #topbar .mobileToolsClose{grid-column:1/-1;position:sticky!important;top:-8px!important;z-index:5;background:#e9f0f3!important;color:#254752!important;min-height:36px}
}
@media(max-width:720px){
#mobileCatalogToggle{display:none!important}
#mobileDesignerBar{order:1}#mobileDesignerViews{order:2}#authorWorkspace #main{order:3}#authorWorkspace #status{order:5}
#authorWorkspace.mobileToolsOpen #topbar{position:relative!important;top:auto!important;bottom:auto!important;left:auto!important;right:auto!important;order:4;flex:none;width:100%;height:190px;max-height:26dvh;border-radius:0;box-shadow:none;margin:0;overflow:auto}
}
@media(max-width:720px){
#mobileToolsToggle,#authorWorkspace #topbar .mobileToolsClose{display:none!important}
#mobileDesignerBar{order:1;min-height:42px;padding:10px 12px}
#authorWorkspace #topbar,#authorWorkspace.mobileToolsOpen #topbar{display:flex!important;position:relative!important;order:2;flex:0 0 58px;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:flex-start;width:100%;height:58px;min-height:58px;max-height:58px;padding:6px 8px!important;gap:7px;border:0;border-radius:0;overflow-x:auto;overflow-y:hidden;touch-action:pan-x;overscroll-behavior-x:contain;scroll-snap-type:x proximity;box-shadow:none}
#authorWorkspace #topbar button,#authorWorkspace #topbar select{flex:0 0 auto;width:auto;min-width:90px;max-width:125px;min-height:40px;font:11px/1.2 Arial;scroll-snap-align:start;touch-action:pan-x;white-space:normal}
#mobileDesignerViews{order:3;padding:6px 12px}
#authorWorkspace #main{order:4}#authorWorkspace #status{order:5}
}

@media(max-width:720px){
#mobileDesignerBar{gap:8px;padding:7px 8px;min-height:54px}
#mobileDesignerBar strong{font-size:13px;flex:0 0 103px}
#mobileDesignerBar #mobileDesignerViews{display:flex;flex:1;min-width:0;gap:5px;padding:0;background:transparent;border:0}
#mobileDesignerBar #mobileDesignerViews button{font-size:11px;padding:6px 5px;min-height:38px}
}

@media(max-width:720px){
#mobileDesignerBar strong{display:flex;align-items:center;gap:5px;flex:0 0 134px;font-size:12px;white-space:nowrap}
#mobileDesignerBar .mobileBrandLogo{display:block;width:25px;height:25px;object-fit:contain;flex:0 0 25px}
}

@media(max-width:720px){#authorWorkspace #topbar #btnZoomIn,#authorWorkspace #topbar #btnZoomOut{display:none!important}}

@media(max-width:720px){
body.mobileDesignerActive #floorList{align-items:stretch;padding-right:0!important}
body.mobileDesignerActive #floorList>div{display:flex;flex-direction:column;min-width:0;box-sizing:border-box}
body.mobileDesignerActive #floorList>div>div:nth-of-type(2){margin-top:auto!important;padding-top:4px}
body.mobileDesignerActive #floorList button[data-floor-id]{box-sizing:border-box;display:block;width:100%;min-width:0;margin:0;padding:8px 2px;font-size:11px;line-height:1.2;white-space:nowrap}
body.mobileDesignerActive #floorList>div>a{margin-top:5px}
}

.mobileRoomUnits{display:none}
@media(max-width:720px){#roomDlg .mobileRoomUnits{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0}#roomDlg .mobileRoomUnits select{min-width:150px} }

@media(max-width:720px){html:not(.designerAdmin) #authorWorkspace #designerSettingsOpen{display:none!important}}

/* Toolbar order requested 2026-11-27: Idioma, Habitación, Diseño automático, Catálogos, Manijas, LED, Deshacer, Centrar, Descargar imagen, Render, Despiece, Optimizador, Abrir, Compartir, Nuevo proyecto, Cerrar sesión; unlisted controls next; Ajustes last (admin only). Phone and desktop. Order only, no other style. */
#authorWorkspace #reviewImageActions,#authorWorkspace #shareLanguage,#authorWorkspace #toolbarPreferences{display:contents!important}
#authorWorkspace #topbar #uiLanguageWrap{order:1}
#authorWorkspace #topbar #btnRoom{order:2}
#authorWorkspace #topbar #btnAgent{order:3}
#authorWorkspace #topbar #btnCatalogs{order:4}
#authorWorkspace #topbar #btnHandles{order:5}
#authorWorkspace #topbar #btnAllWarmLED{order:6}
#authorWorkspace #topbar #btnUndo{order:7}
#authorWorkspace #topbar #btnCenter{order:8}
#authorWorkspace #topbar #btnSnapshot{order:9}
#authorWorkspace #topbar #btnRenderHQ{order:10}
#authorWorkspace #topbar #btnCutReview{order:11}
#authorWorkspace #topbar #btnOptCut{order:12}
#authorWorkspace #topbar #btnOpen{order:13}
#authorWorkspace #topbar #btnShareView{order:14}
#authorWorkspace #topbar .mobileExtraTool[data-tool=btnNewProject]{order:15}
#authorWorkspace #topbar .mobileExtraTool[data-tool=pilotEditorLogout]{order:16}
#authorWorkspace #topbar #btnPlan{order:50}
#authorWorkspace #topbar #btn3d{order:51}
#authorWorkspace #topbar #unitSel{order:52}
#authorWorkspace #topbar #btnSave{order:53}
#authorWorkspace #topbar #btnZoomIn{order:54}
#authorWorkspace #topbar #btnZoomOut{order:55}
#authorWorkspace #topbar #designerSettingsOpen{order:99}

/* Diseño automático on phone: whole window scrolls, action bar stays visible above the phone's navigation bar. */
@media(max-width:720px){body.mobileDesignerActive #designStudio{top:8px!important;left:8px!important;right:8px!important;width:auto!important;max-height:calc(100vh - 16px)!important;max-height:calc(100dvh - 16px - env(safe-area-inset-bottom,0px))!important;padding:12px 12px 0!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y}}
@media(max-width:720px){body.mobileDesignerActive #designStudio footer{position:sticky!important;bottom:0!important;margin:12px -12px 0!important;padding:10px 12px calc(12px + env(safe-area-inset-bottom,0px))!important;background:#f8faf9;border-top:1px solid #d4dfd8;z-index:5;box-shadow:0 -6px 12px #f8faf9}}
@media(max-width:720px){body.mobileDesignerActive #designStudio footer button{min-height:42px;flex:1 1 auto}}

/* Language menu on phone: opens right under the Idioma button (position set by designer-mobile.js because the toolbar scrolls sideways and clips absolute children). */
@media(max-width:720px),(pointer:coarse) and (orientation:landscape) and (max-height:540px){body.mobileDesignerActive #uiLanguageMenu{position:fixed!important;right:auto!important;bottom:auto!important;transform:none;width:min(230px,calc(100vw - 16px))!important;max-width:none;margin:0;max-height:calc(100dvh - 24px);overflow-y:auto;z-index:900!important;display:flex;flex-direction:column;gap:2px;padding:6px!important;box-sizing:border-box}
body.mobileDesignerActive #uiLanguageMenu[hidden]{display:none!important}
body.mobileDesignerActive #uiLanguageMenu button{width:100%!important;max-width:none!important;min-width:0!important;min-height:44px!important;flex:0 0 auto!important;text-align:left;font-size:14px!important;scroll-snap-align:none}}

/* ===== Phone windows (portrait and landscape): full height, compact header, no sideways scroll ===== */
@media (max-width:720px),(pointer:coarse) and (orientation:landscape) and (max-height:540px){
 body.mobileDesignerActive #cutReview,body.mobileDesignerActive #optCut{position:fixed!important;inset:0!important;width:100%!important;max-width:100vw!important;height:100vh!important;height:100dvh!important;max-height:none!important;border-radius:0!important;border:0!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;z-index:1000!important}
 #cutReview>header,#optCut>header{padding:6px 10px!important;min-height:0}
 #cutReview>header h2,#optCut>header h2{font-size:15px!important;line-height:1.2}
 #cutReview>header>button,#optCut>header>button{min-height:38px!important;min-width:64px!important;padding:4px 10px!important}
 #cutReview section,#optCut section{margin:8px!important;padding:10px!important}
 #cutReview h3,#optCut h3{font-size:15px;margin:0 0 8px}
 /* project buttons: 2 columns */
 #optCut .projectControls{display:grid!important;grid-template-columns:1fr 1fr;gap:8px;align-items:stretch}
 #optCut .projectControls>label{grid-column:1/-1}
 #optCut .projectControls button{width:100%;min-height:42px}
 #optCut .projectControls input{width:100%;box-sizing:border-box}
 /* tables become stacked cards */
 #cutReview .wide,#optCut .wide{overflow-x:hidden!important}
 #cutReview table.materialTable,#optCut table.pieceTable,#cutReview table.materialTable tbody,#optCut table.pieceTable tbody{display:block;width:100%}
 #cutReview table.materialTable thead,#optCut table.pieceTable thead{display:none}
 #cutReview table.materialTable tr:has(>th),#optCut table.pieceTable tr:has(>th){display:none!important}
 #cutReview table.materialTable,#optCut table.pieceTable{min-width:0!important;max-width:100%!important;table-layout:auto}
 #cutReview .wide{min-width:0!important;max-width:100%}
 #cutReview table.materialTable tr{max-width:100%;box-sizing:border-box}
 #cutReview table.materialTable tr,#optCut table.pieceTable tr.pieceRow{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:10px;margin:0 0 10px;background:#f8fafb;border:1px solid #ccd6da;border-radius:8px}
 #cutReview table.materialTable td,#optCut table.pieceTable tr.pieceRow>td{display:block;min-width:0!important;width:auto!important;padding:0!important;border:0!important;background:transparent!important}
 #cutReview table.materialTable td::before,#optCut table.pieceTable tr.pieceRow>td::before{content:attr(data-label);display:block;font-size:11px;font-weight:700;color:#52656f;margin:0 0 3px}
 #cutReview table.materialTable td:first-child,#optCut table.pieceTable tr.pieceRow>td:nth-child(1),#optCut table.pieceTable tr.pieceRow>td:nth-child(5),#optCut table.pieceTable tr.pieceRow>td:nth-child(6),#optCut table.pieceTable tr.pieceRow>td:nth-child(11){grid-column:1/-1}
 #cutReview table.materialTable td:nth-child(2){grid-column:1/-1}
 #cutReview table.materialTable select,#cutReview table.materialTable input,#optCut table.pieceTable tr.pieceRow select,#optCut table.pieceTable tr.pieceRow input[type=text],#optCut table.pieceTable tr.pieceRow input[type=number],#optCut table.pieceTable .colorCombo,#optCut table.pieceTable .edgeColorCell>div{width:100%!important;max-width:100%!important;min-height:40px;height:auto!important;box-sizing:border-box;font-size:16px}
 #optCut table.pieceTable .colorCombo input{min-height:38px;height:38px!important}
 #optCut table.pieceTable .miniEdges{max-width:180px!important}
 #optCut table.pieceTable tr.pieceRow>td input[type=checkbox]{width:22px;height:22px}
 /* long help text folds away */
 .phHelpBtn{display:inline-block;margin:2px 0 6px;padding:6px 10px;font-size:12px;border:1px solid #afbdc3;border-radius:6px;background:#eef3f5;color:#263a43}
 .phHelpP{display:none!important}.phHelpP.open{display:block!important}
 .phShort{margin:6px 0;font-size:13px;color:#405c4e}
}
@media (min-width:721px) and not ((pointer:coarse) and (orientation:landscape) and (max-height:540px)){.phHelpBtn,.phShort{display:none!important}}
/* other large windows on a landscape phone: use the whole height */
@media (pointer:coarse) and (orientation:landscape) and (max-height:540px){
 body.mobileDesignerActive .modal{margin:0!important;position:fixed!important;inset:0!important;left:0!important;right:0!important;top:0!important;bottom:0!important;transform:none!important;width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;border-radius:0!important;overflow-y:auto!important;overflow-x:hidden!important;box-sizing:border-box;z-index:1000}
 body.mobileDesignerActive #designStudio{inset:0!important;top:0!important;left:0!important;right:0!important;width:100vw!important;max-height:100dvh!important;height:100dvh!important;border-radius:0!important;overflow-y:auto!important;padding:8px 12px 0!important}
 body.mobileDesignerActive #designStudio footer{bottom:0!important}
 body.mobileDesignerActive #catalogDlg[style*="display: block"],body.mobileDesignerActive #catalogDlg[style*="display:block"]{top:0!important;max-height:100dvh!important;height:100dvh!important}
}

/* landscape phone: cards use 4 columns */
@media (pointer:coarse) and (orientation:landscape) and (max-height:540px){
 #optCut table.pieceTable tr.pieceRow{grid-template-columns:repeat(4,1fr)}
 #optCut table.pieceTable tr.pieceRow>td:nth-child(1),#optCut table.pieceTable tr.pieceRow>td:nth-child(11){grid-column:1/-1}
 #optCut table.pieceTable tr.pieceRow>td:nth-child(5),#optCut table.pieceTable tr.pieceRow>td:nth-child(6){grid-column:span 2}
 #cutReview table.materialTable tr{grid-template-columns:repeat(4,1fr)}
 #cutReview table.materialTable td:first-child{grid-column:span 2}
 #cutReview table.materialTable td:nth-child(2){grid-column:span 2}
 #optCut .projectControls{grid-template-columns:repeat(4,1fr)}
 #optCut .projectControls>label{grid-column:span 1}
}
/* result/summary tables in the optimizer: scroll inside their own box instead of widening the window */
@media (max-width:720px),(pointer:coarse) and (orientation:landscape) and (max-height:540px){
 #optCut table:not(.pieceTable){display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
 #optCut section,#optCut section>div{min-width:0;max-width:100%}
 #cutReview table:not(.materialTable){display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
}
/* Main designer on a landscape phone: one scrollable toolbar row, so the 3D view gets the height */
@media (pointer:coarse) and (orientation:landscape) and (max-height:540px){
 #authorWorkspace #topbar{flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;height:48px!important;min-height:48px!important;max-height:48px!important;padding:5px 8px!important;gap:6px!important;align-items:center;-webkit-overflow-scrolling:touch}
 #authorWorkspace #topbar>*{flex:0 0 auto!important;white-space:nowrap}
 #authorWorkspace #topbar button,#authorWorkspace #topbar select{min-height:36px}
 #authorWorkspace #catalogModelPreview{display:none!important}
 #authorWorkspace #status{padding:4px 10px;font-size:11px}
}

/* optimizer piece card on portrait phones: compact rows (Cant/Largo/Ancho/Formato, Color/Canto/Color canto, Veta/Girar + figure) */
@media (max-width:720px) and (orientation:portrait){
 #optCut table.pieceTable tr.pieceRow{grid-template-columns:repeat(12,minmax(0,1fr));grid-auto-flow:row dense;gap:6px;padding:8px}
 #optCut table.pieceTable tr.pieceRow>td::before{font-size:9.5px;margin:0 0 2px;white-space:nowrap;overflow:visible;letter-spacing:-.2px}
 #optCut table.pieceTable tr.pieceRow>td:nth-child(1){grid-column:1/-1}
 #optCut table.pieceTable tr.pieceRow>td:nth-child(2){grid-column:span 2}
 #optCut table.pieceTable tr.pieceRow>td:nth-child(3),#optCut table.pieceTable tr.pieceRow>td:nth-child(4){grid-column:span 2}
 #optCut table.pieceTable tr.pieceRow>td:nth-child(5){grid-column:span 6}
 #optCut table.pieceTable tr.pieceRow>td:nth-child(6),#optCut table.pieceTable tr.pieceRow>td:nth-child(7),#optCut table.pieceTable tr.pieceRow>td:nth-child(8){grid-column:span 4}
 #optCut table.pieceTable tr.pieceRow>td:nth-child(9){grid-column:1/7;grid-row:auto}
 #optCut table.pieceTable tr.pieceRow>td:nth-child(10){grid-column:1/7}
 #optCut table.pieceTable tr.pieceRow>td:nth-child(11){grid-column:7/13;grid-row:span 2}
 #optCut table.pieceTable tr.pieceRow>td:nth-child(n+2):nth-child(-n+10) select,#optCut table.pieceTable tr.pieceRow>td:nth-child(n+2):nth-child(-n+8) input[type=text],#optCut table.pieceTable tr.pieceRow>td:nth-child(n+2):nth-child(-n+8) input[type=number]{font-size:13px;min-height:34px;padding-left:4px;padding-right:2px}
 #optCut table.pieceTable tr.pieceRow>td:nth-child(n+2):nth-child(-n+8) .colorCombo,#optCut table.pieceTable tr.pieceRow>td:nth-child(n+2):nth-child(-n+8) .edgeColorCell>div{min-height:34px}
 #optCut table.pieceTable tr.pieceRow>td:nth-child(n+2):nth-child(-n+8) .colorCombo input{font-size:13px;min-height:32px;height:32px!important}
 #optCut table.pieceTable tr.pieceRow>td:nth-child(11) .miniEdges{max-width:100%!important}
}
@media (max-width:720px) and (orientation:portrait){
 #optCut table.pieceTable tr.pieceRow>td:nth-child(n+2):nth-child(-n+8) input:not([type=checkbox]){font-size:13px!important;min-height:32px!important;height:32px!important;padding-left:4px!important;padding-right:2px!important}
 #optCut table.pieceTable tr.pieceRow>td:nth-child(n+6):nth-child(-n+8) .colorCombo,#optCut table.pieceTable tr.pieceRow>td:nth-child(n+6):nth-child(-n+8) .edgeColorCell>div{min-height:34px!important;height:34px!important}
}
@media (max-width:720px) and (orientation:portrait){
 #optCut table.pieceTable tr.pieceRow>td:nth-child(n+2):nth-child(-n+10) select{font-size:13px!important;min-height:34px!important;padding-left:4px!important;padding-right:14px!important}
}
