/* The embedded menu is the only page scroller while an archive view is visible. */
html:has(#root > .archive-workspace:not([hidden], [data-guide-overlay="true"])),
body:has(#root > .archive-workspace:not([hidden], [data-guide-overlay="true"])) {
  overflow: hidden;
}

#root:has(> .archive-workspace:not([hidden], [data-guide-overlay="true"])) {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

#root:has(> .archive-workspace:not([hidden], [data-guide-overlay="true"])) > .site-header {
  flex: none;
}

#root:has(> .archive-workspace:not([hidden], [data-guide-overlay="true"])) > .compact-footer {
  display: none;
}

#root > .archive-workspace:not([hidden], [data-guide-overlay="true"]) {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#root > .archive-workspace:not([hidden], [data-guide-overlay="true"]) > :is(.workspace-heading, .workspace-tabs) {
  flex: none;
}

#root > .archive-workspace:not([hidden], [data-guide-overlay="true"]) > .workspace-body {
  flex: 1;
  /* Replace older per-view height rules, including the admin override. */
  min-height: 0 !important;
  height: auto !important;
  overflow: hidden;
}

/* Keep the current page in place while a native detail or full menu is open. */
html:has(dialog:modal, .complete-menu[data-state="open"]:not(.guide-practice-menu)),
body:has(dialog:modal, .complete-menu[data-state="open"]:not(.guide-practice-menu)),
html.account-overlay-open {
  overflow: hidden;
}

dialog:modal,
.complete-menu[data-state="open"]:not(.guide-practice-menu),
#account-overlay .account-login-card {
  overscroll-behavior-y: contain;
}

#account-overlay .account-login {
  overflow: hidden;
}
