/* ─────────────────────────────────────────────────────────────
   modal-lock.css — the background scroll lock while a modal is open (C3).

   Applied and released by js/ui/modalScrollLock.js, which watches <body> for
   the app's body-level scrims (.app-overlay, .po-acct-overlay, .ma-overlay,
   .consent-overlay, .do-ov) and toggles .dang-modal-open on <html>.

   MEASURED, NOT ASSUMED (deployed app at be728e4, real Chromium, anonymous):
   with a modal open the background scrolled behind it in 16 of 21 cases. This
   rule is what stops that. `overflow: hidden` was chosen over the
   `position: fixed; top: -y` body lock because it was measured to preserve the
   scroll offset natively — reference-element shift 0.00px on lock and 0.00px on
   release, with the sticky .web-topbar unmoved — whereas the fixed-body lock
   discards the offset and has to restore it by hand, which is the vertical
   jump this whole change exists to remove.

   THE HORIZONTAL AXIS. Hiding overflow removes the scrollbar, and where the
   scrollbar takes real layout width that would pull the page sideways. Measured
   on this platform the scrollbar width is 0px in every state (overlay
   scrollbars), so there is nothing to compensate and nothing moves — but that
   is a property of the platform, not of the fix, so both compensations below
   are kept for classic-scrollbar platforms.

   `scrollbar-gutter: stable` is preferred: the gutter is part of the scrollport,
   so it keeps the initial containing block the same width and therefore holds
   BOTH in-flow content AND position:fixed chrome (the consent banner) exactly
   where they were. The padding-right fallback only covers in-flow content, so
   it is used solely where the gutter property is unsupported.
   ───────────────────────────────────────────────────────────── */

html.dang-modal-open {
  overflow: hidden;
  /* Don't let a scroll that reaches the end of the modal's own scroller chain
     out to the document behind it. */
  overscroll-behavior: none;
}

@supports (scrollbar-gutter: stable) {
  html.dang-modal-open { scrollbar-gutter: stable; }
}

@supports not (scrollbar-gutter: stable) {
  /* --dang-modal-scrollbar-w is measured by modalScrollLock.js in the instant
     BEFORE the scrollbar is hidden; it is 0px wherever scrollbars overlay. */
  html.dang-modal-open { padding-right: var(--dang-modal-scrollbar-w, 0px); }
}
