/* v128 mobile hard reset
   Keep the complete profile toolset, isolate the database scroller and pin the
   home check action to the lower-right corner of each timeline card. */
@media (max-width: 719px) {
  /* The database owns exactly two visual regions: a 50px header and the
     independently scrolling poster grid. No legacy mask or spacer survives. */
  html body.view-database main #library:not([hidden]),
  html body.mobile-database-tab main #library:not([hidden]) {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    isolation: isolate !important;
  }

  html body.view-database main::before,
  html body.view-database main::after,
  html body.mobile-database-tab main::before,
  html body.mobile-database-tab main::after,
  html body.view-database main #library::before,
  html body.view-database main #library::after,
  html body.mobile-database-tab main #library::before,
  html body.mobile-database-tab main #library::after,
  html body.view-database main #library > .mobile-workspace-heading::before,
  html body.view-database main #library > .mobile-workspace-heading::after,
  html body.mobile-database-tab main #library > .mobile-workspace-heading::before,
  html body.mobile-database-tab main #library > .mobile-workspace-heading::after {
    display: none !important;
    content: none !important;
  }

  html body.view-database main #library > .mobile-workspace-heading,
  html body.mobile-database-tab main #library > .mobile-workspace-heading {
    position: absolute !important;
    z-index: 2 !important;
    inset: 0 0 auto 0 !important;
    width: 100% !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    margin: 0 !important;
    padding-top: 0 !important;
    overflow: hidden !important;
    contain: layout paint !important;
    transform: none !important;
  }

  html body.view-database main #library > #showGrid,
  html body.mobile-database-tab main #library > #showGrid {
    position: absolute !important;
    z-index: 1 !important;
    inset: 50px 0 0 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 10px calc(62px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    background: var(--share-page, #fff) !important;
    transform: none !important;
    clip-path: inset(0) !important;
  }

  html body.view-database main #library > #showGrid > .database-card,
  html body.mobile-database-tab main #library > #showGrid > .database-card {
    margin-top: 0 !important;
    transform: none !important;
  }

  /* All seven secondary actions must remain in the same group beneath the
     account row, including in the signed-in profile state. */
  html body #profileDialog.mobile-tab-page .mobile-profile-hub,
  html body:not(.profile-signed-out) #profileDialog.mobile-tab-page .mobile-profile-hub,
  html body #profileDialog.mobile-tab-page .mobile-profile-actions,
  html body:not(.profile-signed-out) #profileDialog.mobile-tab-page .mobile-profile-actions {
    display: block !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
    contain: none !important;
    clip: auto !important;
    clip-path: none !important;
  }

  html body #profileDialog.mobile-tab-page .mobile-profile-actions > button,
  html body:not(.profile-signed-out) #profileDialog.mobile-tab-page .mobile-profile-actions > button {
    position: relative !important;
    display: grid !important;
    width: 100% !important;
    min-height: 60px !important;
    max-height: none !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  #profileDialog.mobile-tab-page .profile-overview-grid > div:nth-child(4) strong {
    max-width: none !important;
    overflow: visible !important;
    font-size: clamp(14px, 3.8vw, 17px) !important;
    letter-spacing: -.045em !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }

  /* The date keeps the upper-right lane; the check target occupies the lower
     right corner and no longer sits in the vertical middle of the card. */
  html body.view-home main #library #showGrid > .timeline-card .card-content {
    position: relative !important;
  }

  html body.view-home main #library #showGrid > .timeline-card .card-quick-watch {
    position: absolute !important;
    inset: auto 0 4px auto !important;
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    margin: 0 !important;
    transform: none !important;
  }

  html body.view-home main #library #showGrid > .timeline-card .progress-row,
  html body.view-home main #library #showGrid > .timeline-card .card-remaining {
    padding-right: 42px !important;
  }
}
