html { scroll-behavior: smooth; scroll-padding-bottom: 5.5rem; }

.to-top {
  position: fixed;
  z-index: 30;
  right: max(1.15rem, env(safe-area-inset-right));
  bottom: max(1.15rem, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  background: #101114;
  color: #f7f4ee;
  text-decoration: none;
  font-family: Geist, Nunito, system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(16, 17, 20, 0.28);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.to-top.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.to-top-icon { display: block; line-height: 1; }

.to-top .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.to-top:hover { background: #2c241c; }

.to-top:focus-visible {
  outline: 3px solid #dac5a7;
  outline-offset: 3px;
}

body { padding-bottom: 5.5rem; }

body.menu-open .to-top,
body.cookie-banner-open .to-top {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (prefers-reduced-motion: no-preference) {
  .to-top { transition: opacity 0.18s ease; }
}
