/* OnlyShows 0.11.15: keyboard-overlay fallback and fixed-edge mobile pages. */

@media (max-width: 719px) {
  /*
   * Chromium browsers exposing the VirtualKeyboard API keep the document
   * stable and report the IME occlusion through keyboard-inset-height.
   */
  html.virtual-keyboard-overlay body > .mobile-bottom-shell {
    bottom: calc(env(keyboard-inset-height, 0px) + 8px + env(safe-area-inset-bottom)) !important;
  }

  /*
   * Focus state is deterministic and independent of viewport heuristics.
   * Retain the database search row and remove the Tab row while typing.
   */
  html body.mobile-database-input-active > .mobile-bottom-shell {
    grid-template-rows: 52px 0 !important;
    border-radius: 24px !important;
  }

  html body.mobile-database-input-active > .mobile-bottom-shell > .mobile-bottom-nav,
  html body.mobile-database-input-active > .mobile-bottom-shell > .mobile-bottom-nav.is-scroll-hidden {
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  html body.mobile-database-input-active > #mobileWorkspaceDock {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /*
   * Fixed edges are more reliable than a viewport unit during Android's
   * keyboard/back-gesture transition. They also override every older 92dvh
   * bottom-sheet rule.
   */
  html body #searchDialog.search-dialog[open] {
    position: fixed !important;
    inset: 0 !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
}
