.r60-back-to-top {
  --r60-back-to-top-background: #0d8e85;
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 900;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 56px;
  height: 56px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--r60-back-to-top-background);
  box-shadow: 0 4px 12px rgb(0 0 0 / 18%);
  cursor: pointer;
  appearance: none;
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.r60-back-to-top[hidden] { display: none; }
.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 {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    width: 44px;
    height: 44px;
    padding: 10px;
    border-radius: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .r60-back-to-top { transition: none; }
}
