/* The closet measures its item grid and avatar from a flex viewport.
   Restore the original parent layout after footer-layout-r1's block override.
   Short windows retain the original >=540px scrolling page fallback. */
@media (min-height: 621px) {
  html body[data-view="collection"] #main.content.fit-shell18.cogo-footer-flow-r1 {
    display: flex !important;
    flex-direction: column !important;
  }
  /* Preserve the pre-footer workspace height. The footer scrolls below it
     instead of taking space from the avatar and paginated wardrobe. */
  html body[data-view="collection"] #main.content.fit-shell18.cogo-footer-flow-r1 > .page {
    flex: 0 0 auto !important;
    height: 100% !important;
  }
}
/* Existing item-management text also occupies the paginated viewport.
   Keep the last card reachable on narrow screens when it exceeds the estimate. */
html body[data-view="collection"] #main #closetViewport {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
}
