/* Discreet navigation shared by the portal and file library. */
body .site-back-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 45;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid #78654b;
  border-radius: 3px;
  background: #101315ee;
  color: #c5ad84;
  box-shadow: 0 4px 18px #0005;
  cursor: pointer;
  opacity: .84;
  transition: opacity .18s, border-color .18s, background-color .18s;
}
body .site-back-top[hidden] { display: none !important; }
body .site-back-top:hover, body .site-back-top:focus-visible {
  opacity: 1;
  border-color: #ceb17d;
  background: #20211e;
  color: #f1d7aa;
}
body .site-back-top:focus-visible { outline: 2px solid #e4c791; outline-offset: 3px; }
.site-back-top svg { display: block; pointer-events: none; }
.library-feed-tail button[hidden] { display: none !important; }
.portal-list-sentinel { height: 1px; margin: 0; pointer-events: none; }
.portal-list-sentinel[hidden], .catalog-items [hidden], .news-rows [hidden] { display: none !important; }
@media (max-width: 600px) {
  body .site-back-top {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  body .site-back-top { transition: none; }
}
/* Keep the viewport in place when a batch grows above the footer. */
body:has(.wg-scroll-sentinel, .portal-list-sentinel, [data-ranking-feed], .library-feed-tail) {
  overflow-anchor: none;
}
