/* Floating navigation stays outside document flow and matches the site palette. */
.w4-back-to-top {
  position: fixed;
  right: clamp(16px, 3vw, 34px);
  bottom: clamp(16px, 3vw, 34px);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-width: 48px;
  min-height: 48px;
  padding: .78rem .95rem;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 999px;
  background: #176652;
  color: #fff;
  box-shadow: 0 8px 24px rgba(18, 60, 49, .22);
  font-weight: 700;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity .18s ease, transform .18s ease;
}
.w4-back-to-top span[aria-hidden="true"] {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  font-size: 1.15rem;
  line-height: 1;
}
.w4-back-to-top.is-visible,
.w4-back-to-top:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.w4-back-to-top:hover { background: #104d3e; color: #fff; }
.w4-back-to-top:focus-visible { outline: 3px solid #9a761d; outline-offset: 4px; }
@media (max-width: 640px) {
  .w4-back-to-top {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    padding: .7rem;
  }
  .w4-back-to-top span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  .w4-back-to-top { transition: none; }
}
@media print {
  .w4-back-to-top { display: none !important; }
}
