/* OnlyShows 0.11.4: bounded mobile scrollers that never pass beneath controls. */

@media (max-width: 719px) {
  body:not(.mobile-profile-tab) .library:not([hidden]) {
    position: fixed !important;
    z-index: 1;
    top: 92px;
    right: 12px;
    bottom: calc(128px + env(safe-area-inset-bottom));
    left: 12px;
    display: flex !important;
    width: auto !important;
    min-height: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    flex-direction: column;
    justify-content: stretch !important;
  }

  body.mobile-database-tab .library:not([hidden]) {
    top: 0;
    bottom: calc(181px + env(safe-area-inset-bottom));
    padding-top: 6px !important;
  }

  body:not(.mobile-database-tab):not(.mobile-profile-tab) main::before,
  body:not(.mobile-profile-tab) .library::after,
  .profile-dialog.mobile-tab-page[open]::after {
    display: none !important;
    content: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body:not(.mobile-database-tab):not(.mobile-profile-tab) .topbar,
  body:not(.mobile-database-tab):not(.mobile-profile-tab) .hero {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .mobile-workspace-heading {
    flex: 0 0 auto;
    margin-bottom: 10px !important;
  }

  .show-grid {
    min-height: 0;
    flex: 1 1 auto;
    grid-template-rows: minmax(0, 1fr);
    grid-auto-rows: max-content;
    align-content: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .show-grid::before {
    content: "";
    grid-column: 1 / -1;
    min-height: 0;
  }

  .show-grid::-webkit-scrollbar {
    display: none;
  }

  .profile-dialog.mobile-tab-page[open] {
    overflow: hidden !important;
  }

  .profile-dialog.mobile-tab-page .insights-scroll {
    height: calc(100dvh - 143px) !important;
    max-height: calc(100dvh - 143px) !important;
    margin-bottom: calc(76px + env(safe-area-inset-bottom));
    padding-bottom: 16px !important;
    overscroll-behavior: contain;
  }

  .mobile-bottom-tab.active,
  .mobile-bottom-tab.is-active,
  .mobile-bottom-tab[aria-current="page"] {
    background: var(--primary) !important;
    color: var(--on-primary) !important;
  }
}
