.rifey-back-to-top {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 900;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ff4b00;
  color: #fff;
  box-shadow: 0 8px 24px rgb(20 30 53 / 15%);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 240ms ease, transform 240ms ease, visibility 240ms ease, background-color 180ms ease, box-shadow 180ms ease;
}
.rifey-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.rifey-back-to-top:hover {
  background: #ec4d09;
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgb(20 30 53 / 19%);
}
.rifey-back-to-top:active { transform: translateY(0) scale(.96); }
.rifey-back-to-top:focus-visible { outline: 3px solid #233b85; outline-offset: 4px; }
.rifey-back-to-top svg { display: block; width: 24px; height: 24px; }
@media (max-width: 600px) {
  .rifey-back-to-top {
    width: 46px;
    height: 46px;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
  }
}
@media (prefers-reduced-motion: reduce) {
  .rifey-back-to-top { transition: none; }
}
