@media (max-width: 1024px) {
  /* Clip horizontal artwork without creating a second vertical scroll surface
     that can strand sticky navigation after WebKit restores a page. */
  html:has(.gg-nav-shell, .gg-site-nav-shell, [data-mobile-navigation]),
  html:has(.gg-nav-shell, .gg-site-nav-shell, [data-mobile-navigation]) > body {
    height: auto !important;
    min-height: 100svh;
    overflow-x: clip !important;
    overflow-y: visible !important;
  }

  .gg-nav-shell,
  .gg-site-nav-shell,
  [data-mobile-navigation] {
    padding-top: env(safe-area-inset-top, 0px);
  }

  [data-mobile-navigation] {
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .gg-mpanel,
  .gg-site-mobile-panel,
  .gg-mobile-menu > div {
    /* Leave room for the navigation row and offer strip even before scrolling. */
    max-height: calc(100dvh - 120px - env(safe-area-inset-top, 0px));
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding-bottom: max(18px, env(safe-area-inset-bottom, 0px)) !important;
  }
}
