/* 158: no JS pixel height; popup limits derive from the current dynamic viewport. */
:root{--erp-viewport-height:100vh;--erp-content-space:calc(var(--erp-viewport-height) - var(--erp-header-height,64px) - var(--erp-dock-height,66px))}
@supports(height:100dvh){:root{--erp-viewport-height:100dvh}}
/* 135-3: shared viewport chrome; work content stays at phone size, 430px. */
html.erp-common-chrome #appPage.v9.erp-shell>:is(.tab-body.on,#tabWorker.on,#tabAction.on,#tabWorks.on,#tabCs.on,#tabAdmin.on,#tabExtra.on){min-height:0!important;box-sizing:border-box;height:auto!important;flex:1 1 0%!important;scroll-padding-block:8px}
html.erp-common-chrome #appPage.v9.erp-shell>:is(#tabWorker.on,#tabAction.on){padding-bottom:0!important}
html.erp-common-chrome #appPage.v9.erp-shell>#tabWorker.on{overflow:auto!important;padding-top:6px!important}
html.erp-common-chrome.erp-work-embedded #appPage.v9.erp-shell>#tabWorker.on{padding:0!important;overflow:hidden!important}
html.erp-common-chrome.erp-work-embedded #appPage.v9.erp-shell #incomingNew{height:100%!important;min-height:0!important;margin:0;overflow:hidden}
html.erp-common-chrome #appPage.v9.erp-shell>#tabAction.on{display:flex!important;flex-direction:column;overflow:hidden!important}
html.erp-common-chrome #appPage.v9.erp-shell #tabAction>.v9-scroll{flex:1;min-height:0;overflow:auto!important;scroll-padding-bottom:16px;padding-bottom:16px!important}
html.erp-common-chrome #appPage.v9.erp-shell #sortingNew{padding-bottom:16px!important}
html.erp-common-chrome #appPage.v9.erp-shell #erpUnifiedHeader{position:relative!important;top:auto!important;flex-shrink:0!important}
@media(min-width:900px){
 html.layout-unified.erp-common-chrome body #appPage.v9.erp-shell:has(#tabWorker #workerMenu.lg){position:fixed!important;inset:0!important;width:100%!important;max-width:none!important;height:100dvh!important;min-height:0!important;max-height:none!important;padding:0!important;margin:0!important;transform:none!important;overflow:hidden!important}
 html.layout-unified.erp-common-chrome body #appPage.v9.erp-shell #erpUnifiedHeader{width:100%!important;max-width:none!important;height:64px!important;min-height:64px!important;max-height:64px!important;margin:0!important;padding:10px 24px 8px!important;background:#f5f7faed;box-sizing:border-box;z-index:452}
 html.layout-unified.erp-common-chrome body #appPage.v9.erp-shell>.dock{position:fixed!important;left:0!important;right:0!important;bottom:0!important;width:100%!important;min-width:0!important;max-width:none!important;margin:0!important;padding:0 0 env(safe-area-inset-bottom,0px)!important;transform:none!important;background:#fff!important;border-radius:0!important;box-shadow:none!important;box-sizing:border-box}
 html.layout-unified.erp-common-chrome body #appPage.v9.erp-shell>.dock>:is(.tabbar,#lgWorkNavigation){position:relative!important;left:0!important;right:0!important;width:100%!important;min-width:0!important;max-width:none!important;height:66px!important;min-height:66px!important;max-height:66px!important;margin:0!important;padding:6px 24px!important;transform:none!important;border:0!important;border-top:1px solid #E4E7EF!important;border-radius:0!important;background:#fff!important;box-shadow:none!important;animation:none!important;transition:none!important;box-sizing:border-box;overflow:visible}
 html.layout-unified.erp-common-chrome body #appPage.v9.erp-shell>.dock>#lgWorkNavigation>button{height:52px;max-height:52px}
 html.layout-unified.erp-common-chrome body #appPage.v9.erp-shell>.dock #v9Acts{margin:0!important;padding:8px 24px!important}
 html.layout-unified.erp-common-chrome.erp-work-scaled body #appPage.v9.erp-shell>:is(.tab-body.on,#tabWorker.on:has(#workerMenu.lg),#tabAction.on,#tabWorks.on){position:relative!important;left:auto!important;right:auto!important;width:var(--erp-work-canvas-width)!important;max-width:none!important;height:auto!important;min-height:0!important;max-height:none!important;margin:0 auto!important;transform:none!important;transform-origin:center top;flex:1 1 0%!important}
 html.layout-unified.erp-common-chrome.erp-work-scaled body #appPage.v9.erp-shell #workerMenu.lg{width:100%!important;max-width:none!important;margin:0!important;padding:12px!important}
 html.layout-unified.erp-common-chrome.erp-work-scaled body #appPage.v9.erp-shell #workerMenu .flow{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
 html.layout-unified.erp-common-chrome.erp-work-scaled body #appPage.v9.erp-shell #tabWorks.on{overflow:hidden!important;display:flex!important;flex-direction:column;padding:0!important}
 html.layout-unified.erp-common-chrome.erp-work-scaled body #appPage.v9.erp-shell :is(.lg-sheet,.lg-confirm,.sheet,.erp-hold-reason-sheet){max-height:var(--erp-content-space)!important;bottom:var(--erp-dock-height,66px)!important}
 /* Sorting panels are external to appPage and keep the same phone content width. */
 html.erp-common-chrome.erp-work-scaled body>.sp-sheet{width:var(--erp-work-canvas-width)!important;max-width:var(--erp-work-canvas-width)!important;height:calc(var(--erp-content-space) / var(--erp-work-scale))!important;max-height:calc(var(--erp-content-space) / var(--erp-work-scale))!important;bottom:var(--erp-dock-height,66px)!important;transform:translateX(-50%)!important;transform-origin:center bottom}
}
/* Embedded screens own their scroll area; no second header/dock reservation. */
html.erp-work-phone-frame body.embedded-work #incomingA{width:100%;max-width:none;margin-inline:0}
body.embedded-work #incomingA,body.embedded-work>.main-container{padding-top:6px!important;padding-bottom:16px!important;scroll-padding-block:8px}
html.erp-work-phone-frame body.fv-packing .fv-recent{padding-inline:0}
/* 135-5: one persistent, edge-to-edge packing-style work bar at every width. */
html.layout-unified.erp-common-chrome.work-navigation-active body #appPage.v9.erp-shell>.dock{left:0!important;right:0!important;bottom:0!important;width:100%!important;max-width:none!important;margin:0!important;padding:0 0 env(safe-area-inset-bottom,0px)!important;transform:none!important;background:#fff!important;border-radius:0!important;box-shadow:none!important}
html.layout-unified.erp-common-chrome body #appPage.v9.erp-shell>.dock>#lgWorkNavigation{position:relative!important;left:0!important;right:0!important;width:100%!important;min-width:0!important;max-width:none!important;height:66px!important;min-height:66px!important;max-height:66px!important;margin:0!important;padding:6px clamp(5px,1.25vw,24px)!important;transform:none!important;box-sizing:border-box!important;border:0!important;border-top:1px solid #E4E7EF!important;border-radius:0!important;background:#fff!important;box-shadow:none!important;animation:none!important;transition:none!important;overflow:visible}
html.layout-unified.erp-common-chrome body #appPage.v9.erp-shell>.dock>#lgWorkNavigation>button{height:52px;max-height:52px}
html.layout-unified.erp-common-chrome body #lgWorkNavigation>button.on{background:#2563EB;color:#fff}html.layout-unified.erp-common-chrome body #lgWorkNavigation>button.on{background:#FFC21A;color:#2B1D00}
/* 135-7: the original sorting entry remains available by its URL, not in the work UI. */
#sortingNew #lgLegacy{display:none!important}

/* 158: keep chrome in the flex shell, reserving its real height exactly once. */
/* 160: dynamically appended tabs may follow the dock in DOM order. */
#appPage>.dock{order:100!important}
html.layout-unified.erp-common-chrome.erp-dynamic-layout body #appPage.v9.erp-shell{display:flex!important;flex-direction:column!important;position:fixed!important;inset:0!important;height:100vh!important;height:100dvh!important;min-height:0!important;max-height:none!important;padding-block:0!important;overflow:hidden!important}
html.layout-unified.erp-common-chrome.erp-dynamic-layout body #appPage.v9.erp-shell>.dock{position:relative!important;flex:0 0 auto!important;inset:auto!important;left:0!important;right:0!important;bottom:0!important;margin-block:0!important;padding-block:0 env(safe-area-inset-bottom,0px)!important}
html.layout-unified.erp-common-chrome.erp-dynamic-layout body #appPage.v9.erp-shell>:is(.tab-body.on,#tabWorker.on,#tabAction.on,#tabWorks.on,#tabCs.on,#tabAdmin.on,#tabExtra.on){flex:1 1 0%!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:auto}
html.layout-unified.erp-common-chrome.erp-dynamic-layout.erp-work-embedded body #appPage.v9.erp-shell>#tabWorker.on{display:flex!important;flex-direction:column!important;overflow:hidden!important}
html.layout-unified.erp-common-chrome.erp-dynamic-layout.erp-work-embedded body #appPage.v9.erp-shell #incomingNew{flex:1 1 0%!important;height:auto!important;min-height:0!important;display:flex;flex-direction:column;overflow:hidden!important}
html.layout-unified.erp-common-chrome.erp-dynamic-layout.erp-work-embedded body #appPage.v9.erp-shell #incomingNew>iframe:not([hidden]){flex:1 1 0%;min-height:0;height:100%;display:block}
