/* Touch workspace presentation. Construction fields and document renderers stay shared. */
@media screen and (max-width:760px), screen and (max-width:1000px) and (max-height:500px) and (pointer:coarse){
 body.app-hud .project-toolbar-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch;width:100%;max-width:none;gap:6px;margin:0}
 body.app-hud .project-toolbar-actions>:is(#hudMillPart,#projectSave,.hud-project-more){grid-column:auto;grid-row:auto;min-width:0;width:100%!important;margin:0}
 body.app-hud .project-toolbar-actions :is(#hudMillPart,#projectSave,.hud-project-more>summary){width:100%!important;min-width:0;height:44px;min-height:44px;box-sizing:border-box;margin:0;font-size:10px}
 body.app-hud>.export-actions{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));align-items:stretch;gap:6px;padding:7px 8px}
 body.app-hud>.export-actions>:is(.action,.hud-documents){min-width:0;width:100%;margin:0}
 body.app-hud>.export-actions>.action,body.app-hud>.export-actions>.hud-documents>summary{display:flex;justify-content:center;align-items:center;height:42px;min-height:42px;width:100%;padding:7px 4px;box-sizing:border-box;margin:0;font-size:10px;white-space:nowrap}
 body.app-hud :is(.block-step-footer,.product-step-footer,.block-model-actions){display:flex;gap:8px;align-items:stretch}
 body.app-hud :is(.block-step-footer,.product-step-footer,.block-model-actions)>button:not([hidden]){flex:1;min-width:0;min-height:44px;margin:0;padding:9px 6px;font-size:12px;box-sizing:border-box}
 body.app-hud :is(.milling-history,.milling-actions,.transport-heading-actions){align-items:stretch;gap:6px}
 body.app-hud :is(.milling-history,.milling-actions,.transport-heading-actions)>.action{display:flex;align-items:center;justify-content:center;min-height:42px;margin:0;box-sizing:border-box}
 body.app-hud .milling-model-footer{gap:10px}
 body.app-hud .milling-model-footer .milling-history{display:grid;grid-template-columns:1fr 1fr;width:100%}
 body.app-hud .milling-canvas-card{box-sizing:border-box}
 body.app-hud .project-local-note{line-height:1.5}
 body.app-hud :is(input,select,button,summary){scroll-margin-block:60px}
}
/* Separate compact layouts: portrait remains above, landscape uses side panels. */
@media screen and (max-width:1000px) and (max-height:500px) and (orientation:landscape) and (pointer:coarse){


 body.app-hud .workspace-header{height:36px;min-height:36px;padding:3px 12px}
 body.app-hud .project-toolbar{grid-template-columns:minmax(120px,1fr) minmax(310px,45%);padding:4px 10px;gap:6px;margin:0;min-height:48px;box-sizing:border-box}
 body.app-hud .project-identity{grid-column:1;grid-row:1;min-width:0}
 body.app-hud #projectName{min-height:36px;font-size:14px;max-width:100%}
 body.app-hud .project-toolbar-actions{grid-column:2;grid-row:1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}
 body.app-hud .project-local-note{display:none}
 body.app-hud .project-toolbar-actions :is(#hudMillPart,#projectSave,.hud-project-more>summary){height:38px;min-height:38px}
 body.app-hud :is(.block-stage-bar,.product-stage-bar){margin:3px 8px 0;width:calc(100% - 16px);padding:4px;box-sizing:border-box}
 body.app-hud :is(#blockSteps,#productSteps)>button{min-height:32px;line-height:1.2;padding:5px 3px;font-size:10px}
 body.app-hud:not(.home-active):not(.transport-active):not(.milling-active):not(.expert-active) .app{display:grid!important;grid-template-columns:clamp(190px,27vw,260px) minmax(0,1fr);gap:8px;padding:6px 8px;align-items:start}
 body.app-hud:not(.expert-active) .app>.panel{grid-column:1;grid-row:1;order:0;width:100%;padding:10px;max-height:var(--workspace-height,50dvh)!important;overflow:auto!important;overscroll-behavior:contain;scrollbar-width:thin}
 body.app-hud:not(.expert-active) .app>.sheet{grid-column:2;grid-row:1;order:0;width:100%;min-width:0;position:sticky;top:4px;padding:0;align-self:start}
 body.app-hud :is(.block-build-preview,#creatorSection){padding:8px!important;margin:0}
 body.app-hud .block-build-heading{margin-bottom:4px;gap:6px}
 body.app-hud .block-build-heading h3{font-size:13px;margin:0}
 body.app-hud .block-build-heading>div>small{display:none}
 body.app-hud .block-build-heading p{font-size:10px;margin:3px 0}
 body.app-hud .studio-live-summary{padding:5px 0;gap:14px;flex-wrap:nowrap}
 body.app-hud .studio-live-summary div{gap:2px}
 body.app-hud .studio-live-summary strong{font-size:13px}
 body.app-hud .studio-live-summary small{font-size:9px}
 body.app-hud .studio-live-summary>span,body.app-hud .block-build-footer>p{display:none}
 body.app-hud .block-build-footer{margin:4px 0 0;padding:0;display:flex}
 body.app-hud .block-build-footer>button{margin:0;min-height:34px;width:100%;font-size:12px;padding:6px}
 body.app-hud .block-workflow-head{gap:6px;margin-bottom:6px}
 body.app-hud .block-workflow-head h2{font-size:14px}
 body.app-hud #creatorCanvas{height:var(--workspace-height,50dvh)!important;min-height:140px!important}
 body.app-hud .app>.sheet>.grid{grid-template-columns:1fr;gap:8px}
 body.app-hud #millingDialog{margin:6px auto 100px;padding:0 8px}
 body.app-hud .milling-heading{flex-direction:row;align-items:center;margin-bottom:8px;gap:8px}
 body.app-hud .milling-heading h2{font-size:18px;margin:0}
 body.app-hud .milling-heading p,body.app-hud .milling-heading .eyebrow{display:none}
 body.app-hud .milling-layout{display:grid;grid-template-columns:210px minmax(0,1fr);gap:8px;align-items:start}
 body.app-hud .milling-settings{position:sticky;top:4px;max-height:calc(100dvh - 150px);overflow:auto;overscroll-behavior:contain}
 body.app-hud .milling-canvas-card{padding:8px;margin-bottom:8px}
 body.app-hud .milling-canvas-heading{flex-direction:row;flex-wrap:wrap;gap:6px;margin-bottom:6px}
 body.app-hud .milling-canvas-heading h3{font-size:13px;margin:0}
 body.app-hud .milling-canvas-heading .eyebrow{display:none}
 body.app-hud .milling-view-tools{flex-wrap:wrap;gap:4px}
 body.app-hud .milling-view-tools .action{min-height:34px;padding:5px 7px;margin:0}
 body.app-hud .milling-grid-scroll{max-height:calc(100dvh - 230px);min-height:80px}
 body.app-hud .milling-grid-footer{flex-direction:row;flex-wrap:wrap;gap:6px;margin-top:6px}
 body.app-hud .milling-actions{width:auto}
 body.app-hud>.export-actions{padding:3px 8px;gap:6px}
 body.app-hud>.export-actions>.action,body.app-hud>.export-actions>.hud-documents>summary{min-height:34px;height:34px}


 body.app-hud .app>.sheet>.grid>.box>svg{max-height:calc(var(--workspace-height,50dvh) - 40px);min-height:100px;width:100%;object-fit:contain}
 body.app-hud .app>.sheet>.grid>.box{padding:8px}
 body.app-hud .app>.sheet>.grid>.box>h3{font-size:11px;margin:0 0 5px}


 body.app-hud .panel>.studio-live-summary{margin:0 0 8px;border-top:0;border-bottom:1px solid var(--ui-border);padding:0 0 6px;justify-content:space-between}
 body.app-hud .block-build-heading{display:flex;align-items:center;min-height:36px}
 body.app-hud #blockBuildFormat{display:none}
 body.app-hud .block-build-heading>div{flex:1;min-width:0}
 body.app-hud .block-build-heading #blockBuildNext{flex:none;width:auto;min-height:36px;padding:6px 9px;font-size:11px;margin:0}
 body.app-hud .block-build-footer{display:none}
}
@media screen{.studio-live-summary[hidden]{display:none!important}}
@media screen and (max-width:1000px) and (max-height:500px) and (orientation:landscape) and (pointer:coarse){

 body.app-hud #blockBuildPreview:not([hidden]){display:flex;flex-direction:column;box-sizing:border-box;height:var(--workspace-height,45dvh)}
 body.app-hud #blockBuildPreview>.block-build-heading{flex:none}
 body.app-hud #blockBuildPreview>#blockBuildView{flex:1;min-height:0;height:0!important;width:100%;display:block}


 /* Stage names are already visible above the model; leave room for real fields. */
 body.app-hud .block-workflow-head>div,body.app-hud :is(#blockStepHelp,#productStepHelp){display:none}
 body.app-hud .block-workflow-head{justify-content:flex-end;margin:0 0 4px}
 body.app-hud .block-workflow-head>button{min-height:28px;font-size:10px;padding:5px 7px}
 body.app-hud .panel h3{font-size:13px;margin:5px 0}
 body.app-hud .panel label{font-size:11px;margin-top:6px}
 body.app-hud .panel .settings-body{padding:8px}


 /* One app bar, rather than separate brand and project rows on a short display. */
 body.app-hud:not(.home-active):not(.milling-active):not(.transport-active):not(.expert-active) .workspace-header{height:48px;min-height:48px}
 body.app-hud:not(.home-active):not(.milling-active):not(.transport-active):not(.expert-active) .workspace-header .brand-caption{display:none}
 body.app-hud:not(.home-active):not(.milling-active):not(.transport-active):not(.expert-active) .project-toolbar{position:absolute;top:0;left:64px;right:68px;width:auto;z-index:55;background:transparent!important;box-shadow:none;grid-template-columns:minmax(100px,1fr) minmax(300px,50%)}
}

@media screen{.mobile-dimension-row{display:contents}}
@media screen and (max-width:1000px) and (max-height:500px) and (orientation:landscape) and (pointer:coarse){

 body.app-hud .panel :is(.settings-heading,.block-workflow-head){display:none}
 body.app-hud .mobile-dimension-row{display:grid;grid-template-columns:55px minmax(0,1fr);align-items:center;gap:6px;margin:5px 0}
 body.app-hud .mobile-dimension-row>label{font-size:11px;margin:0;line-height:1.4}
 body.app-hud .mobile-dimension-row>.mako-number-control{min-width:0;width:100%;margin:0}
}

@media screen and (max-width:1000px) and (max-height:500px) and (orientation:landscape) and (pointer:coarse){
 body.app-hud .panel .settings-group>summary{padding:6px 8px;min-height:28px;font-size:11px}
 body.app-hud #settingsDimensions>summary>small{display:none}


 body.app-hud .panel>#blockWorkflow{padding:0;margin:0;border:0}
 body.app-hud .panel>.studio-live-summary{padding-bottom:3px!important;margin-bottom:4px!important}
 body.app-hud .panel>.studio-live-summary :is(small,strong){line-height:1.2}
 body.app-hud .panel #settingsDimensions>summary{padding:6px 8px!important;font-size:11px!important;min-height:28px;line-height:16px}
 body.app-hud .mobile-dimension-row>.mako-number-control{min-height:36px;gap:4px}
 body.app-hud .mobile-dimension-row .mako-step{flex:0 0 24px;min-width:24px;height:36px;min-height:36px;font-size:17px}
 body.app-hud .mobile-dimension-row input[type=number]{padding:5px 4px;font-size:14px;min-height:36px;height:36px;box-sizing:border-box}


 body.app-hud .mobile-dimension-row{margin:2px 0}
 body.app-hud #settingsDimensions>.settings-body{padding:6px}
}
/* Landscape step workspace: fixed model frame and independently scrolling specification. */
#phoneStageTitle[hidden],#phoneStageNavigation[hidden]{display:none!important}
#phoneStageTitle,#phoneStageNavigation{display:none}
@media screen and (max-width:1000px) and (max-height:500px) and (orientation:landscape) and (pointer:coarse){
 body.app-hud.phone-stage-workspace{height:100dvh;overflow:hidden}
 body.phone-stage-workspace :is(#blockStageBar,#productStageBar){display:none!important}
 body.app-hud.phone-stage-workspace #phoneStageTitle{display:flex;align-items:center;justify-content:center;position:fixed;top:48px;left:8px;right:8px;height:28px;color:var(--ui-text);font-size:13px;font-weight:500;z-index:35}
 body.app-hud.phone-stage-workspace .app{position:fixed!important;inset:80px 8px calc(var(--phone-stage-bottom,81px) + 52px);width:auto!important;height:auto!important;margin:0;padding:0;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:8px;box-sizing:border-box}
 body.app-hud.phone-stage-workspace .app>.sheet{grid-column:1;grid-row:1;position:relative!important;top:0;height:100%;max-height:100%;min-height:0;overflow:auto;padding:0;box-sizing:border-box;overscroll-behavior:none}
 body.app-hud.phone-stage-workspace .app>.panel{grid-column:2;grid-row:1;height:100%;max-height:100%!important;min-height:0;overflow:auto!important;overscroll-behavior:contain;box-sizing:border-box;padding:10px}
 body.phone-stage-workspace #blockBuildPreview:not([hidden]){position:relative;height:100%!important;min-height:0;margin:0;padding:4px!important}
 body.phone-stage-workspace #blockBuildPreview>.block-build-heading{position:absolute;right:5px;top:5px;padding:0;width:36px;height:36px;min-height:36px;z-index:5}
 body.phone-stage-workspace .block-build-heading>div,body.phone-stage-workspace #blockBuildFormat{display:none}
 body.phone-stage-workspace #blockBuildView{min-width:0;min-height:0}
 body.app-hud.phone-stage-workspace #phoneStageNavigation{position:fixed;left:8px;right:8px;bottom:calc(var(--phone-stage-bottom,81px) + 4px);height:44px;display:grid;grid-template-columns:1fr 1fr;gap:8px;z-index:60}
 body.app-hud.phone-stage-workspace #phoneStageNavigation>button{width:100%;height:44px;min-height:44px;margin:0;padding:8px 12px;font:inherit;font-size:12px;box-sizing:border-box}
 body.phone-stage-workspace #phoneStageNavigation>[data-phone-step-action=next]{background:var(--ui-gradient-button);color:var(--ui-on-accent);border:1px solid var(--ui-accent)}
 body.phone-stage-workspace :is(#blockStepFooter,#productStepFooter){display:none!important}
}
@media print{#phoneStageTitle,#phoneStageNavigation{display:none!important}}
