a.floating-back-to-top {
  position: fixed; right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom)); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; box-sizing: border-box;
  border: 0; border-radius: 8px;
  background: #fff; color: #111; box-shadow: 0 2px 10px #0006;
  text-decoration: none;
}
body a.floating-back-to-top:link, body a.floating-back-to-top:visited { color: #111; --floating-arrow-color: #fff; }
a.floating-back-to-top:hover, a.floating-back-to-top:focus-visible,
body a.floating-back-to-top:hover, body a.floating-back-to-top:focus-visible {
  background: var(--icon-accent, #6f93d1); color: var(--icon-hover-text, #111);
  --floating-arrow-color: var(--icon-accent, #6f93d1);
}
a.floating-back-to-top:focus-visible { outline: 3px solid var(--icon-accent, #6f93d1); outline-offset: 3px; }
a.floating-back-to-top[hidden] { display: none; }
a.floating-back-to-top:hover, a.floating-back-to-top:focus-visible {
  --floating-arrow-color: var(--icon-accent, #6f93d1);
}

@media (max-width: 767px) {
  a.floating-back-to-top { width: 44px; height: 44px; }
}

body.light-mode a.floating-back-to-top {
  box-shadow: 0 0 10px color-mix(in srgb, var(--icon-accent, #6f93d1) 55%, transparent);
}
body.light-mode a.floating-back-to-top:hover,
body.light-mode a.floating-back-to-top:focus-visible {
  box-shadow: 0 0 14px color-mix(in srgb, var(--icon-accent, #6f93d1) 80%, transparent);
}
