.r60-back-to-top {
  --r60-back-to-top-background: #0d8e85;
  --r60-back-to-top-scale: .9;
  --r60-back-to-top-left: max(24px, env(safe-area-inset-left));
  --r60-back-to-top-glide-duration: 300ms;
  position: fixed;
  right: auto;
  left: var(--r60-back-to-top-left);
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 900;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: calc(56px * var(--r60-back-to-top-scale));
  height: calc(56px * var(--r60-back-to-top-scale));
  padding: calc(12px * var(--r60-back-to-top-scale));
  border: 0;
  border-radius: calc(12px * var(--r60-back-to-top-scale));
  background: var(--r60-back-to-top-background);
  box-shadow: 0 4px 12px rgb(0 0 0 / 18%);
  cursor: pointer;
  appearance: none;
  translate: calc(-100% - var(--r60-back-to-top-left) - 24px) 0;
  visibility: hidden;
  pointer-events: none;
  transition: translate var(--r60-back-to-top-glide-duration) cubic-bezier(.22,1,.36,1), visibility 0s linear var(--r60-back-to-top-glide-duration), transform 220ms ease, box-shadow 220ms ease;
}
.r60-back-to-top[hidden] { display: none; }
.r60-back-to-top.is-visible {
  translate: 0 0;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
/* Preserve a minimum tap target while scaling the visible button and icon. */
.r60-back-to-top::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100%, 44px);
  height: max(100%, 44px);
  transform: translate(-50%, -50%);
}
.r60-back-to-top img {
  display: block;
  width: 100%;
  height: auto;
  transform: rotate(180deg);
  pointer-events: none;
}
.r60-back-to-top:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--r60-back-to-top-background), 0 4px 12px rgb(0 0 0 / 18%);
}
@media (min-width: 601px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .r60-back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgb(0 0 0 / 22%);
  }
}
@media (max-width: 600px) {
  .r60-back-to-top {
    --r60-back-to-top-left: max(16px, env(safe-area-inset-left));
    bottom: max(16px, env(safe-area-inset-bottom));
    width: calc(44px * var(--r60-back-to-top-scale));
    height: calc(44px * var(--r60-back-to-top-scale));
    padding: calc(10px * var(--r60-back-to-top-scale));
    border-radius: calc(10px * var(--r60-back-to-top-scale));
  }
}
@media (prefers-reduced-motion: reduce) {
  .r60-back-to-top { transition: none; }
}
