:root:has(:where([data-app-masthead], #top-bar)) {
  height: auto;
  overflow: clip visible;
  scroll-padding-block: calc(var(--app-header-height, 4rem) + 0.5rem)
    calc(var(--app-dock-height, 0px) + 0.5rem);
}

:is(.app-edition, .state-edition, html:has(#top-bar)):has(.state-dock, .bottom-nav) {
  --app-dock-height: calc(3rem + env(safe-area-inset-bottom));
}

:is(.app-edition, .state-edition, html:has(#top-bar)) body {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 100dvh;
  padding: 0 0 var(--app-dock-height, 0px) !important;
  overflow: clip visible;
}

:is(.app-edition, .state-edition, html:has(#top-bar)) #edition-main {
  flex: 1 0 auto;
  min-height: 0;
  overflow: visible;
}

.app-edition #edition-main { z-index: auto; }

.app-edition #edition-main :is(.modal-overlay, .avatar-modal) {
  height: 100dvh;
  padding-block: max(0.8rem, env(safe-area-inset-top)) max(0.8rem, env(safe-area-inset-bottom));
}

.app-edition :is(.modal-overlay, .avatar-modal) > :is(.modal-content, .avatar-modal-card, .avatar-view-wrap) {
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

html:has(#top-bar) #top-bar {
  position: sticky !important;
  height: calc(var(--rg-topbar-h) + env(safe-area-inset-top)) !important;
  padding-top: max(0.35rem, env(safe-area-inset-top)) !important;
}

html:has(#top-bar) .bottom-nav {
  height: calc(var(--rg-bottomnav-h) + env(safe-area-inset-bottom)) !important;
}

html:has(#top-bar) .mission-banner {
  position: relative;
  inset: auto;
  z-index: auto;
}

html:has(#top-bar) #edition-main {
  padding-block: 1rem 2rem !important;
}

:root:has([data-app-masthead], #top-bar) .flash-overlay {
  position: relative;
  inset: auto;
  transform: none;
  margin-inline: auto;
  z-index: auto;
}

.verification-notice { margin: 0.45rem auto; }

:is(.app-edition, .state-edition) #ios-prompt {
  position: static !important;
}

.conversation-edition #ios-prompt { display: none !important; }
