.back-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 1200;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(238, 226, 209, 0.46);
  border-radius: 999px;
  background: #005326;
  color: #fffaf1;
  box-shadow: 0 16px 34px rgba(0, 45, 20, 0.24);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.96);
  transition: opacity 180ms ease, transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

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

.back-to-top:hover,
.back-to-top:focus-visible {
  background: #006d32;
  box-shadow: 0 18px 38px rgba(0, 45, 20, 0.32);
  outline: none;
}

.back-to-top:focus-visible {
  outline: 3px solid rgba(218, 137, 75, 0.46);
  outline-offset: 3px;
}

.back-to-top svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.2;
}

@media (max-width: 720px) {
  .back-to-top {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    width: 44px;
    height: 44px;
  }
}

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