.back-to-top {
  --back-to-top-offset: 14px;
  position: fixed;
  right: calc(14px + env(safe-area-inset-right));
  bottom: calc(var(--back-to-top-offset) + env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 242, 224, .68);
  border-radius: 50%;
  background: rgba(40, 54, 75, .9);
  box-shadow: 0 5px 16px rgba(0, 0, 0, .16);
  color: #fff2e0;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease, bottom .15s ease, background-color .2s ease;
  place-items: center;
  backdrop-filter: blur(4px);
}

.back-to-top svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover { background: rgba(27, 27, 26, .94); }
.back-to-top:focus-visible { outline: 3px solid #ffc21c; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: none; }
}
