.site-back-to-top {
  position: fixed;
  z-index: 60;
  left: max(16px, env(safe-area-inset-left));
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid #656565;
  border-color: color-mix(in srgb, var(--ink, #f7f4f1) 32%, var(--paper, #222));
  border-radius: 50%;
  background: #282828;
  background: color-mix(in srgb, var(--paper, #222) 90%, var(--ink, #f7f4f1));
  color: var(--ink, #f7f4f1);
  box-shadow: 0 4px 16px #0003;
  cursor: pointer;
  transition: background-color .18s ease;
}

.site-back-to-top[hidden] { display: none; }

.site-back-to-top:hover {
  background: color-mix(in srgb, var(--paper, #222) 78%, var(--ink, #f7f4f1));
}

.site-back-to-top:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

@media (max-width: 800px) {
  .site-back-to-top { bottom: calc(78px + env(safe-area-inset-bottom)); }
}

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