/* OnlyShows 0.11.20: shared title geometry and session-persistent add search. */

@media (max-width: 719px) {
  :root {
    --mobile-content-cut: 62px;
  }

  /*
   * Home and database use the same two text rows. Absolute row coordinates
   * avoid font metrics moving the apparent divider between the two pages.
   */
  body:not(.mobile-database-tab):not(.mobile-profile-tab) .topbar {
    top: 4px !important;
    height: 18px !important;
    min-height: 18px !important;
  }

  body:not(.mobile-database-tab):not(.mobile-profile-tab) .topbar .brand {
    font-size: 14px !important;
    line-height: 18px !important;
  }

  body:not(.mobile-database-tab):not(.mobile-profile-tab) .hero {
    top: 24px !important;
    height: 34px !important;
    padding: 0 !important;
  }

  body.mobile-database-tab .mobile-workspace-heading {
    position: absolute !important;
    height: var(--mobile-content-cut) !important;
    padding: 0 !important;
  }

  body.mobile-database-tab .mobile-workspace-heading > p {
    position: absolute;
    top: 2px;
    left: 2px;
    height: 18px;
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 18px !important;
  }

  body.mobile-database-tab .mobile-workspace-heading > div {
    position: absolute;
    top: 26px;
    right: 2px;
    left: 2px;
    height: 34px;
    align-items: flex-start !important;
  }

  body.mobile-database-tab .mobile-workspace-heading h2 {
    font-size: var(--mobile-masthead-title-size) !important;
    line-height: 1.04 !important;
  }

  /*
   * Large viewport dimensions are sufficient to stop wallpaper recropping.
   * Do not translate the fixed layer with VisualViewport: that translation
   * was the remaining jump when the keyboard opened and closed.
   */
  html[data-background="prism-mono"] body > .theme-backdrop,
  html[data-background="prism-violet"] body > .theme-backdrop {
    transform: none !important;
  }

  /*
   * Once the add page enters text input, its search control belongs to the
   * bottom for the rest of that page session. Keyboard dismissal and input
   * blur only remove the measured lift; they never return the form to top.
   */
  html body #searchDialog.search-dialog.mobile-search-docked .remote-search,
  html body #searchDialog.search-dialog.mobile-search-docked:not(.mobile-ime-visible) .remote-search,
  html body #searchDialog.search-dialog.mobile-search-docked:has(#remoteSearchInput:focus) .remote-search,
  html body #searchDialog.search-dialog.mobile-search-docked.mobile-ime-visible .remote-search {
    position: fixed !important;
    z-index: 4 !important;
    right: 18px !important;
    bottom: 8px !important;
    left: 18px !important;
    width: auto !important;
    margin: 0 !important;
    transform: translateY(calc(-1 * var(--remote-search-lift, 0px))) !important;
    will-change: transform;
  }
}
