/* UI Stability v47 — deterministic first paint + persistent Community shell. */

/* Community navigation is a shell element, never a render-child. */
#communityPersistentNav.community-fusion-v44-footer {
  position: absolute !important;
  z-index: 140 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  min-height: 4.9rem !important;
  display: none !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  border-top: 1px solid rgba(56, 47, 34, 0.08) !important;
  border-radius: 1.15rem 1.15rem 0 0 !important;
  padding: 0.38rem 0.42rem max(0.45rem, env(safe-area-inset-bottom)) !important;
  background: rgba(255, 255, 255, 0.99) !important;
  box-shadow: 0 -0.65rem 1.55rem rgba(42, 31, 17, 0.07) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  backdrop-filter: blur(18px) !important;
  transform: none !important;
}

body[data-screen="community"] #communityPersistentNav,
body[data-screen="communityPostDetail"] #communityPersistentNav {
  display: grid !important;
}

body[data-screen="community"] .phone-frame > .bottom-nav,
body[data-screen="communityPostDetail"] .phone-frame > .bottom-nav,
body[data-screen="community"] .mobile-menu-fab,
body[data-screen="communityPostDetail"] .mobile-menu-fab {
  display: none !important;
}

body[data-screen="community"] .mobile-content,
body[data-screen="communityPostDetail"] .mobile-content {
  padding-bottom: calc(5.35rem + env(safe-area-inset-bottom)) !important;
  scroll-padding-bottom: calc(5.85rem + env(safe-area-inset-bottom)) !important;
}

/* Any legacy/dynamic Community footer is suppressed if the persistent shell exists. */
body #communityPersistentNav ~ .community-fusion-v44-footer,
.phone-frame > .community-fusion-v44-footer:not(#communityPersistentNav) {
  display: none !important;
}

#communityPersistentNav button {
  min-height: 3.85rem !important;
}

/* iOS standalone uses the phone-frame as the visual viewport: keep the nav inside it. */
html.is-ios body.is-standalone #communityPersistentNav,
html.is-ios body #communityPersistentNav {
  bottom: 0 !important;
}
