/* Width changes retain a working icon rail and never detach the navigation. */
html body #sidebarToggle,html body #sidebarResize,html body .sidebar-company-chip,html body .sidebar-only-icon{display:none}
@media(min-width:851px){
 html body.sidebar-ui-ready{--sidebar-current:var(--sidebar,246px);--sidebar-motion:cubic-bezier(.22,.8,.25,1)}
 html body.sidebar-ui-ready.sidebar-collapsed{--sidebar-current:88px}
 html body.sidebar-ui-ready #appHeader{width:calc(var(--sidebar-current) - 24px);overflow-x:hidden;transform:none;opacity:1;pointer-events:auto;transition:width 420ms var(--sidebar-motion);padding-top:16px;gap:12px}
 html body.sidebar-ui-ready>main{margin-left:var(--sidebar-current)!important;transition:margin-left 420ms var(--sidebar-motion);padding-top:32px!important}
 html body #appHeader #sidebarToggle{position:absolute;z-index:4;display:grid;place-items:center;top:10px;right:8px;width:32px;height:30px;min-height:30px;padding:6px;border:0;border-radius:7px;background:transparent;box-shadow:none;color:var(--cabinet-ink,#233e32);cursor:pointer}
 html body #appHeader #sidebarToggle svg{display:block;width:19px;height:19px}
 html body #appHeader #sidebarToggle:hover{background:color-mix(in srgb,var(--cabinet-ink,#233e32) 7%,transparent)}
 html body #appHeader #sidebarToggle:focus-visible{outline:2px solid var(--cabinet-focus,#619e7d);outline-offset:1px}
 html body.sidebar-ui-ready #appHeader .brand{margin-top:0;min-width:0;transition:margin-top 420ms var(--sidebar-motion)}
 html body.sidebar-ui-ready #appHeader .brand>div{transition:opacity 160ms ease}
 html body.sidebar-ui-ready #appHeader .company-switcher{max-height:100px;overflow:hidden;transition:max-height 420ms var(--sidebar-motion),padding 420ms var(--sidebar-motion),opacity 180ms}
 html body.sidebar-collapsed #appHeader{padding-inline:8px;padding-top:16px;gap:8px}
 html body.sidebar-collapsed #appHeader #sidebarToggle{right:16px}
 html body.sidebar-collapsed #appHeader .brand{margin-top:36px;padding-inline:0;gap:0;justify-content:center}
 html body.sidebar-collapsed #appHeader .brand-logo{width:30px;height:36px;flex:0 0 30px}
 html body.sidebar-collapsed #appHeader .brand>div{width:0;opacity:0;overflow:hidden}
 html body.sidebar-collapsed #appHeader .company-switcher{max-height:0;min-height:0;padding-block:0;opacity:0;pointer-events:none}
 html body.sidebar-collapsed #appHeader .sidebar-company-chip{display:grid;place-items:center;flex:0 0 30px;align-self:center;width:30px;height:30px;min-height:30px;padding:0;border:0;border-radius:50%;background:var(--cabinet-wash,#dcece2);color:var(--cabinet-ink,#233e32);font-size:11px}
 html body .sidebar-company-chip::before{content:'П'}
 html body[data-company="kozlov"] .sidebar-company-chip::before{content:'К'}
 html body.sidebar-collapsed #mainNav{width:46px;min-width:46px;gap:4px}
 html body.sidebar-collapsed #mainNav button{display:flex;align-items:center;justify-content:center;width:46px;min-width:46px;min-height:40px;padding:10px 12px;gap:0;font-size:0!important;border-radius:13px;overflow:hidden;white-space:nowrap}
 html body.sidebar-collapsed #mainNav button>span{font-size:0}
 html body.sidebar-collapsed #mainNav button svg{display:block;flex:0 0 20px;width:20px;height:20px;margin:0}
 html body.sidebar-collapsed #mainNav>.nav-caption{display:none}
 html body.sidebar-collapsed #modelsNav{margin:0;padding:0;border:0}
 html body.sidebar-collapsed #modelsNav>summary{display:none}
 html body.sidebar-collapsed #modelsNav>div{margin:0;padding:0;border:0;gap:4px}
 html body.sidebar-collapsed #appHeader .top-actions{display:flex;flex-direction:column;align-items:center;gap:4px;padding-top:8px}
 html body.sidebar-collapsed #appHeader #accountButton{font-size:0;padding:4px;min-height:34px;justify-content:center}
 html body.sidebar-collapsed #appHeader #accountButton>*{display:none}
 html body.sidebar-collapsed #appHeader #accountButton::before{display:grid;place-items:center;margin:0;font-size:10px;flex:0 0 28px;width:28px;height:28px}
 html body.sidebar-collapsed #appHeader #logoutButton{font-size:0;display:grid;place-items:center;padding:8px;width:36px;height:36px}
 html body.sidebar-collapsed #appHeader .sidebar-only-icon{display:block;width:20px;height:20px}
 html body.sidebar-ui-ready:has(:where(#appHeader:not(.hidden)))>#sidebarResize{display:grid;place-items:start center;position:fixed;z-index:45;top:12px;bottom:12px;left:calc(var(--sidebar-current) - 13px);width:12px;cursor:ns-resize;touch-action:none;outline:none;transition:left 420ms var(--sidebar-motion)}
 html body #sidebarResize>span{display:block;width:3px;height:35px;border-radius:3px;background:repeating-linear-gradient(to bottom,var(--cabinet-muted,#617568) 0 3px,transparent 3px 7px);opacity:.38;transition:opacity 160ms}
 html body #sidebarResize:hover>span,html body #sidebarResize:focus-visible>span{opacity:1}
 html body #sidebarResize:focus-visible{background:color-mix(in srgb,var(--cabinet-focus,#619e7d) 14%,transparent);border-radius:8px}
 html body.sidebar-resizing{cursor:ns-resize;user-select:none}
 html body.sidebar-resizing #appHeader,html body.sidebar-resizing>main,html body.sidebar-resizing #sidebarResize{transition:none}
}
@media(prefers-reduced-motion:reduce){html body.sidebar-ui-ready #appHeader,html body.sidebar-ui-ready>main,html body.sidebar-ui-ready #sidebarResize,html body.sidebar-ui-ready #appHeader .brand,html body.sidebar-ui-ready #appHeader .company-switcher{transition:none}}
@media(forced-colors:active){html body #appHeader #sidebarToggle{color:ButtonText}html body #sidebarResize>span{background:ButtonText}}
@media(min-width:851px){
 html body.sidebar-collapsed #mainNav::before{display:none}
 html body.sidebar-collapsed #appHeader #metalHeaderActions{display:flex;flex-direction:column;align-items:center;gap:4px}
}
@media(min-width:851px){
 html body.sidebar-collapsed #appHeader .top-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));justify-items:center;gap:4px;width:48px}
 html body.sidebar-collapsed #appHeader #metalHeaderActions{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,24px);gap:4px}
 html body.sidebar-collapsed #appHeader #metalHeaderActions>button{width:24px;height:28px;min-width:24px;min-height:28px;padding:2px}
 html body.sidebar-collapsed #appHeader #metalHeaderActions>button svg{width:20px;height:20px}
 html body.sidebar-collapsed #appHeader #accountButton{width:24px;min-height:28px;padding:0}
 html body.sidebar-collapsed #appHeader #accountButton::before{width:24px;height:24px;flex-basis:24px;font-size:9px}
 html body.sidebar-collapsed #appHeader #logoutButton{width:24px;height:28px;min-height:28px;padding:2px}
}
@media(min-width:851px){html body.sidebar-ui-ready:not(.sidebar-collapsed) #appHeader .brand{padding-right:28px}}

@media(min-width:851px){
 html body.sidebar-collapsed #appHeader .top-actions{display:flex;width:100%;align-items:center;gap:8px}
 html body.sidebar-collapsed #appHeader #metalHeaderActions{display:flex;justify-content:center;width:100%}
 html body.sidebar-collapsed #appHeader #metalHeaderActions>button:not(#metalSettingsButton),html body.sidebar-collapsed #appHeader #logoutButton{display:none!important}
 html body.sidebar-collapsed #appHeader #metalSettingsButton{width:32px;height:32px;padding:6px}
 html body.sidebar-collapsed #appHeader #accountButton{width:32px;height:32px}
 html body.sidebar-collapsed #appHeader #accountButton::before{width:28px;height:28px;flex-basis:28px;font-size:10px}
 html body #sidebarResize>span{will-change:transform;transition:opacity 160ms;pointer-events:none}
 html body #sidebarResize.scroll-unneeded{visibility:hidden}
 html body.sidebar-scrolling{cursor:ns-resize;user-select:none}
}

/* One continuous width transition; the catalogue keeps stable rows and full opacity. */
@media(min-width:851px){
 html body.sidebar-ui-ready{--sidebar-motion:cubic-bezier(.2,.65,.3,1)}
 html body.sidebar-ui-ready #appHeader{contain:layout style;overflow-anchor:none;transition:width 200ms var(--sidebar-motion),padding 200ms var(--sidebar-motion),gap 200ms var(--sidebar-motion)!important}
 html body.sidebar-ui-ready>main{opacity:1;transition:margin-left 200ms var(--sidebar-motion)!important}
 html body.sidebar-ui-ready #sidebarResize{transition:left 200ms var(--sidebar-motion)!important}
 html body.sidebar-ui-ready #appHeader .brand{transition:margin-top 200ms var(--sidebar-motion),padding 200ms var(--sidebar-motion)!important}
 html body.sidebar-ui-ready #appHeader .brand>div{width:auto;max-width:180px;overflow:hidden;white-space:nowrap;opacity:1;transition:max-width 200ms var(--sidebar-motion)!important}
 html body.sidebar-collapsed #appHeader .brand>div{max-width:0}
 html body.sidebar-ui-ready #appHeader .brand-logo{transition:width 200ms var(--sidebar-motion),height 200ms var(--sidebar-motion),flex-basis 200ms var(--sidebar-motion)}
 html body.sidebar-ui-ready #appHeader .company-switcher{opacity:1;transition:max-height 200ms var(--sidebar-motion),padding 200ms var(--sidebar-motion)!important}
 html body.sidebar-ui-ready #appHeader #sidebarToggle{transition:right 200ms var(--sidebar-motion)}
 html body.sidebar-ui-ready #mainNav{width:100%;min-width:0}
 html body.sidebar-ui-ready #mainNav button{width:100%;justify-content:flex-start;white-space:nowrap;overflow:hidden;min-height:40px;gap:9px;transition:padding 200ms var(--sidebar-motion),border-radius 200ms var(--sidebar-motion)}
 html body.sidebar-collapsed #mainNav button{font-size:12px!important}
 html body.sidebar-collapsed #mainNav button>span{font-size:12px;white-space:nowrap}
 html body.sidebar-ui-ready #mainNav button svg{flex:0 0 20px;width:20px;height:20px}
 html body.sidebar-ui-ready #modelsNav>div{margin-left:0;padding-left:0;border-left:0}
 html body.sidebar-ui-ready #mainNav>.nav-caption,html body.sidebar-ui-ready #modelsNav>summary{display:block;overflow:hidden;white-space:nowrap;max-height:50px;transition:max-height 200ms var(--sidebar-motion),padding 200ms var(--sidebar-motion),margin 200ms var(--sidebar-motion)}
 html body.sidebar-collapsed #mainNav>.nav-caption,html body.sidebar-collapsed #modelsNav>summary{max-height:0;padding-block:0;margin-block:0}
 html body :is(#catalogBody.product-grid:not(.table-mode),#systemPage .product-grid:has(>[data-candidate]),#partsList>.product-grid,#legacyGrid.legacy-grid,#unassignedGrid.unassigned-grid){grid-template-columns:repeat(var(--sidebar-grid-columns,4),minmax(0,1fr))!important}
}
html body #sidebarSurface{display:none!important}
@media(prefers-reduced-motion:reduce){html body.sidebar-ui-ready #appHeader,html body.sidebar-ui-ready>main,html body.sidebar-ui-ready #sidebarResize,html body.sidebar-ui-ready #appHeader *{transition:none!important}}

@media(min-width:851px){html body.sidebar-ui-ready #mainNav button>span{display:block;flex:1 1 auto;min-width:0;max-width:220px;overflow:hidden;white-space:nowrap;transition:max-width 200ms var(--sidebar-motion)}html body.sidebar-collapsed #mainNav button>span{flex:0 1 0;max-width:0}}

@media(min-width:851px){html body.sidebar-ui-ready #appHeader .sidebar-company-chip{display:grid!important;place-items:center;align-self:center;width:30px;height:0;min-height:0;max-height:0;flex:0 0 0;padding:0;border:0;margin-block:-6px;overflow:hidden;transition:height 200ms var(--sidebar-motion),max-height 200ms var(--sidebar-motion),flex-basis 200ms var(--sidebar-motion),margin 200ms var(--sidebar-motion)}html body.sidebar-collapsed #appHeader .sidebar-company-chip{height:30px;max-height:30px;flex-basis:30px;margin-block:0}html body.sidebar-ui-ready #mainNav{transition:gap 200ms var(--sidebar-motion)}html body.sidebar-ui-ready #modelsNav{transition:margin 200ms var(--sidebar-motion)}}
