/* OnlyShows 0.11.10: persistent content fades, reversible dock motion and tighter mobile headings. */

@media (max-width: 719px) {
  :root {
    --mobile-title-gutter: 14px;
  }

  body:not(.mobile-profile-tab) .library:not([hidden]) {
    bottom: calc(68px + env(safe-area-inset-bottom)) !important;
  }

  body:not(.mobile-database-tab):not(.mobile-profile-tab) .library:not([hidden]) {
    top: 68px !important;
  }

  body:not(.mobile-database-tab):not(.mobile-profile-tab) .topbar {
    height: 30px !important;
    min-height: 30px !important;
    padding-right: var(--mobile-title-gutter) !important;
    padding-left: var(--mobile-title-gutter) !important;
  }

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

  body:not(.mobile-database-tab):not(.mobile-profile-tab) .hero {
    top: 30px !important;
    right: var(--mobile-title-gutter) !important;
    left: var(--mobile-title-gutter) !important;
    padding: 0 0 5px !important;
  }

  body:not(.mobile-database-tab):not(.mobile-profile-tab) .hero h1 {
    font-size: clamp(25px, 7.4vw, 31px) !important;
    line-height: 1.04 !important;
  }

  body:not(.mobile-database-tab):not(.mobile-profile-tab) main {
    padding-top: 68px !important;
  }

  body.mobile-database-tab .mobile-workspace-heading {
    padding: 4px 2px 8px !important;
  }

  body.mobile-database-tab .mobile-workspace-heading p {
    margin-bottom: 2px;
  }

  body.mobile-database-tab .mobile-workspace-heading h2 {
    font-size: 28px;
  }

  /*
   * Keep the scrollport running to the main tab, then reserve the control
   * height as transparent padding. Cards retain their old stopping point
   * while the fade itself continues behind the controls.
   */
  html body:not(.mobile-database-tab):not(.mobile-profile-tab) #showGrid {
    padding-bottom: 56px !important;
    -webkit-mask-image: linear-gradient(
      to bottom,
      transparent 0,
      rgb(0 0 0 / 8%) 10px,
      rgb(0 0 0 / 28%) 24px,
      rgb(0 0 0 / 58%) 42px,
      rgb(0 0 0 / 84%) 58px,
      #000 70px,
      #000 calc(100% - 56px),
      rgb(0 0 0 / 76%) calc(100% - 44px),
      rgb(0 0 0 / 42%) calc(100% - 29px),
      rgb(0 0 0 / 12%) calc(100% - 15px),
      transparent calc(100% - 4px),
      transparent 100%
    ) !important;
    mask-image: linear-gradient(
      to bottom,
      transparent 0,
      rgb(0 0 0 / 8%) 10px,
      rgb(0 0 0 / 28%) 24px,
      rgb(0 0 0 / 58%) 42px,
      rgb(0 0 0 / 84%) 58px,
      #000 70px,
      #000 calc(100% - 56px),
      rgb(0 0 0 / 76%) calc(100% - 44px),
      rgb(0 0 0 / 42%) calc(100% - 29px),
      rgb(0 0 0 / 12%) calc(100% - 15px),
      transparent calc(100% - 4px),
      transparent 100%
    ) !important;
  }

  html body.mobile-database-tab:not(.mobile-profile-tab) #showGrid {
    padding-bottom: 106px !important;
    -webkit-mask-image: linear-gradient(
      to bottom,
      transparent 0,
      rgb(0 0 0 / 4%) 10px,
      rgb(0 0 0 / 12%) 24px,
      rgb(0 0 0 / 28%) 40px,
      rgb(0 0 0 / 50%) 58px,
      rgb(0 0 0 / 72%) 74px,
      rgb(0 0 0 / 90%) 88px,
      #000 96px,
      #000 calc(100% - 106px),
      rgb(0 0 0 / 84%) calc(100% - 92px),
      rgb(0 0 0 / 58%) calc(100% - 74px),
      rgb(0 0 0 / 28%) calc(100% - 57px),
      rgb(0 0 0 / 8%) calc(100% - 42px),
      transparent calc(100% - 32px),
      transparent 100%
    ) !important;
    mask-image: linear-gradient(
      to bottom,
      transparent 0,
      rgb(0 0 0 / 4%) 10px,
      rgb(0 0 0 / 12%) 24px,
      rgb(0 0 0 / 28%) 40px,
      rgb(0 0 0 / 50%) 58px,
      rgb(0 0 0 / 72%) 74px,
      rgb(0 0 0 / 90%) 88px,
      #000 96px,
      #000 calc(100% - 106px),
      rgb(0 0 0 / 84%) calc(100% - 92px),
      rgb(0 0 0 / 58%) calc(100% - 74px),
      rgb(0 0 0 / 28%) calc(100% - 57px),
      rgb(0 0 0 / 8%) calc(100% - 42px),
      transparent calc(100% - 32px),
      transparent 100%
    ) !important;
  }

  html body.mobile-database-tab:not(.mobile-profile-tab) main::after {
    content: none !important;
    display: none !important;
    background: none !important;
  }

  #mobileWorkspaceDock {
    transition: bottom 300ms cubic-bezier(.2, .8, .2, 1) !important;
  }

  html body > .mobile-bottom-shell {
    grid-template-rows: 0 60px;
    overflow: hidden !important;
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
    transition:
      grid-template-rows 300ms cubic-bezier(.2, .8, .2, 1),
      border-color 220ms ease,
      background-color 220ms ease,
      box-shadow 260ms ease,
      border-radius 300ms cubic-bezier(.2, .8, .2, 1) !important;
    will-change: grid-template-rows;
  }

  html body .mobile-bottom-shell > .mobile-database-actions[hidden] {
    display: grid !important;
  }

  html body .mobile-bottom-shell .mobile-database-actions {
    min-height: 0 !important;
    padding: 0 5px !important;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    pointer-events: none;
    animation: none !important;
    transition:
      opacity 180ms ease,
      transform 280ms cubic-bezier(.2, .8, .2, 1),
      padding 300ms cubic-bezier(.2, .8, .2, 1),
      visibility 0s linear 300ms !important;
  }

  html body.mobile-database-tab > .mobile-bottom-shell {
    grid-template-rows: 52px 60px;
    animation: none !important;
  }

  html body.mobile-database-tab .mobile-bottom-shell .mobile-database-actions {
    padding: 5px 5px 3px !important;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    animation: none !important;
    transition-delay: 35ms, 0ms, 0ms, 0ms !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body > .mobile-bottom-shell,
  html body .mobile-bottom-shell .mobile-database-actions {
    transition: none !important;
  }
}
