/* Leave animation-created containing blocks behind once a menu has opened.
   Nested form dialogs must be positioned relative to the viewport. */
.vertex-v3 #app#app#app#app :is(#findSheet,#layerPanel,#routePlanner,#routeDetail,#recordSheet,#youSheet,#exploreSheet,#activitiesSheet,#activityDetail,#compareSheet,#avalancheSheet,#todayBriefSheet,#weatherView,#communityView,#placeCard) {
  animation-fill-mode:backwards!important;
}

/* At 16px Safari can focus fields without automatically zooming the page. */
@media (pointer:coarse), (max-width:899px) {
  .vertex-v3 .auth-gate :is(input,textarea,select),
  .vertex-v3 #app#app#app#app#app :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),textarea,select) {
    font-size:16px!important;
  }
}

html[data-keyboard-open] .vertex-v3 #app#app#app#app#app [data-keyboard-panel] {
  position:fixed!important;
  top:auto!important;
  bottom:var(--keyboard-bottom)!important;
  height:min(440px,calc(var(--keyboard-view-height) - 16px))!important;
  min-height:0!important;
  max-height:calc(var(--keyboard-view-height) - 16px)!important;
  margin-top:0!important;
  margin-bottom:0!important;
  padding-bottom:12px!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  scroll-padding:80px 12px 16px;
  -webkit-overflow-scrolling:touch;
  transform:none!important;
  translate:none!important;
  clip-path:none!important;
  animation:none!important;
}
/* A blurred or animated parent otherwise traps fixed nested dialogs in its
   own bounds, even when the child knows the keyboard's position. */
html[data-keyboard-open] .vertex-v3 #app#app#app#app#app :is(#communityView,#routeDetail,#weatherView):has([data-keyboard-panel]) {
  transform:none!important;
  translate:none!important;
  filter:none!important;
  backdrop-filter:none!important;
  clip-path:none!important;
  animation:none!important;
}
/* Search remains a page anchored at the top of the visual viewport. The keyboard
   reduces the list's space instead of lifting a bottom card across the map. */
html[data-keyboard-open] .vertex-v3 #app#app#app#app#app#app#app #findSheet[data-keyboard-panel] {
  top:var(--keyboard-view-top)!important;
  bottom:auto!important;
  height:var(--keyboard-view-height)!important;
  max-height:var(--keyboard-view-height)!important;
  padding-top:max(8px,env(safe-area-inset-top))!important;
  padding-bottom:12px!important;
  overflow:hidden!important;
  animation:none!important;
}
/* "On your map" stays put while the keyboard opens and closes, so switching Nearby/Saved never makes it
   appear or vanish (Bjorn 2026-11-06). */
html[data-keyboard-open] .vertex-v3 #app#app#app#app#app :is(.profile-editor-sheet,.publish-route-sheet,.community-safety-sheet)[data-keyboard-panel] {
  left:12px!important;
  right:12px!important;
  width:auto!important;
  max-width:520px!important;
  margin-left:auto!important;
  margin-right:auto!important;
  z-index:110!important;
}
html[data-keyboard-open] .vertex-v3 .auth-gate[data-keyboard-panel] {
  top:var(--keyboard-view-top)!important;
  bottom:auto!important;
  height:var(--keyboard-view-height)!important;
  min-height:0!important;
  overflow-y:auto!important;
  align-items:flex-start;
  padding:12px!important;
  scroll-padding:12px;
}
html[data-keyboard-open] .vertex-v3 [data-keyboard-panel] :is(input,textarea,select,[contenteditable="true"]) {
  scroll-margin:80px 12px 16px;
}
/* The full-screen place card (Wall posts and replies) shrinks to the space above the keyboard,
   so what you type stays in view (Bjorn 2026-10-28). */
html[data-keyboard-open] .vertex-v3 #app#app#app#app#app#app#app #mapSheet #placeCard[data-keyboard-panel]:not(.collapsed) {
  left:0!important;
  right:0!important;
  top:calc(var(--keyboard-view-top) + env(safe-area-inset-top,0px) + 8px)!important;
  bottom:auto!important;
  height:calc(var(--keyboard-view-height) - env(safe-area-inset-top,0px) - 8px)!important;
  max-height:calc(var(--keyboard-view-height) - env(safe-area-inset-top,0px) - 8px)!important;
  padding-bottom:0!important;
}
/* Friends & people (and the other full pages under You): the page ends at the top of the keyboard and
   gets room below its content, so a search field near the bottom can scroll up under the header with
   its results visible beneath it (Bjorn 2026-11-09, iPhone keyboard covered "Find people"). */
html[data-keyboard-open] body.vertex-v3 #app#app#app#app#app#app#app#app#app#app#app#app#app#app#app#app#app#app #communityView[data-keyboard-panel] {
  top:var(--keyboard-view-top)!important;
  bottom:auto!important;
  height:var(--keyboard-view-height)!important;
  min-height:0!important;
  max-height:var(--keyboard-view-height)!important;
  overflow-y:auto!important;
  padding-bottom:max(12px,calc(var(--keyboard-view-height) - 220px))!important;
}
/* Plan a route: naming the tour lifts the planner (and the Name card above it) to sit on the keyboard. */
html[data-keyboard-open] body.vertex-v3 #app#app#app#app#app#app#app#app#app#app#app#app#app#app#app#app#app#app #routePlanner[data-keyboard-panel] {
  top:auto!important;
  bottom:calc(var(--keyboard-bottom) + 8px)!important;
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
}
/* Set up your profile: the mountain search moves to the top with its results between it and the keyboard. */
html[data-keyboard-open] body.vertex-v3 .profile-setup[data-keyboard-panel] {
  top:var(--keyboard-view-top)!important;
  bottom:auto!important;
  height:var(--keyboard-view-height)!important;
}
html[data-keyboard-open] body.vertex-v3 .profile-setup[data-keyboard-panel] .ps-scroll {
  padding-bottom:max(12px,calc(var(--keyboard-view-height) - 200px))!important;
}
