.back-to-top {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 1000;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #0f766e;
  border-radius: 50%;
  background: #0f766e;
  color: #fff;
  box-shadow: 0 3px 14px rgb(15 23 42 / 18%);
  cursor: pointer;
  transition: background-color .18s, box-shadow .18s;
}
.back-to-top[hidden] { display: none; }
.back-to-top:hover { background: #115e59; box-shadow: 0 4px 18px rgb(15 23 42 / 25%); }
.back-to-top:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px #0f766e; }
@media (max-width: 600px) {
  .back-to-top { right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .back-to-top { transition: none; } }
