/* Navigation stability only. Existing header design and URL rules are retained. */
html { scrollbar-gutter: stable; }
@media (min-width:1181px) {
 /* Viewport, not physical-device width, decides the desktop dropdown layout. */
 .wsl-header .wsl-nav__item > .wsl-nav__menu {
  position:absolute; top:100%; left:0; width:max-content; min-width:136px;
  max-width:min(260px,calc(100vw - 24px)); box-shadow:0 14px 28px rgba(15,23,42,.12);
 }
}
@media (max-width:1180px) {
 /* Out of normal flow: opening a menu cannot push the whole page downward. */
 body.wsl-mobile-header .wsl-header .wsl-header__inner > [data-nav].open {
  position:absolute; top:100%; left:0; right:0; grid-area:auto;
  max-height:min(68vh,calc(100vh - 120px));
  max-height:min(68dvh,calc(100dvh - 120px));
  overscroll-behavior:contain;
 }
 html.wsl-navigation-open { overflow-y:hidden; }
 /* Touch/hover alone must not reveal a second submenu state. */
 body.wsl-mobile-header .wsl-header .wsl-nav__item:not(.is-submenu-open) > .wsl-nav__menu { display:none !important; }
 body.wsl-mobile-header .wsl-header .wsl-nav__item.is-submenu-open > .wsl-nav__menu { display:block !important; }
}

@media (max-width:1180px) {
 /* Hidden overflow creates a non-scrolling ancestor that breaks mobile sticky. */
 body.wsl-body { overflow-x:clip; overflow-y:visible; }
 html { scroll-padding-top:110px; }
}

/* Let the browser perform a native document navigation without a root cross-fade. */
@view-transition { navigation:none; }

/* Preserve the advisor toggle; open its panel below the actual compact-screen trigger. */
@media(max-width:1180px) {
 body.wsl-body .wsl-ai-service [data-ai-panel] {
  position:fixed!important;
  inset:var(--wsl-ai-panel-top,74px) 12px auto auto!important;
  width:min(360px,calc(100vw - 24px));
  max-height:calc(100dvh - var(--wsl-ai-panel-top,74px) - 16px)!important;
  overflow:auto;
 }
}
