html { scroll-behavior: smooth; }

.floating-back-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right, 0px));
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
  z-index: 1020;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50%;
  background: #12366f;
  box-shadow: 0 8px 24px rgba(8,27,57,.24);
  color: #fff;
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.floating-back-to-top:hover {
  transform: translateY(-2px);
  background: #0b2856;
  box-shadow: 0 11px 28px rgba(8,27,57,.3);
  color: #fff;
}

.floating-back-to-top:focus-visible {
  outline: 3px solid #e5a642;
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .floating-back-to-top {
    right: max(14px, env(safe-area-inset-right, 0px));
    bottom: max(14px, env(safe-area-inset-bottom, 0px));
    width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .floating-back-to-top { transition: none; }
}
