/*
  Scroll-to-top control (scripts/main.js injects .js-scroll-to-top on every page).
  Fixed in the bottom-right corner; fades in after the user scrolls down.
  Separate file so pages still get correct styling when an old global.css stays in CDN cache.
*/
.scroll-to-top{
  position: fixed;
  right: max(18px, env(safe-area-inset-right, 0px));
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity .22s ease,
    visibility .22s ease,
    transform .22s ease,
    border-color .18s ease,
    box-shadow .18s ease;
}
.scroll-to-top:hover{
  border-color: var(--btn-hover-border);
  box-shadow:
    0 0 0 1px var(--btn-hover-inner) inset,
    0 18px 60px var(--btn-hover-glow);
  transform: translateY(-2px);
}
.scroll-to-top:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}
.scroll-to-top.is-visible{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.scroll-to-top.is-visible:hover{
  transform: translateY(-2px);
}
.scroll-to-top__icon{
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
html[data-theme="light"] .scroll-to-top{
  background: rgba(255, 255, 255, .92);
  border-color: rgba(79, 70, 229, .28);
  box-shadow: 0 12px 32px rgba(18, 24, 38, .12);
}

@media (prefers-reduced-motion: reduce){
  .scroll-to-top{ transition:none; transform:none; }
  .scroll-to-top.is-visible:hover{ transform:none; }
}
