/* A consistent, always-available control across public pages and owner workspaces. */
body > .site-back-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 50px;
  height: 58px;
  min-width: 48px;
  min-height: 48px;
  padding: 7px;
  border: 1px solid #c3a0b3;
  border-radius: 25px;
  background: #3d0a2d;
  color: #fbf8ed;
  box-shadow: 0 3px 14px #20061926;
  font: 10px/1.2 Arial, sans-serif;
  letter-spacing: .08em;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .18s ease, color .18s ease;
}
body > .site-back-to-top:hover { background: #fbf8ed; color: #3d0a2d; }
body > .site-back-to-top:focus-visible { outline: 3px solid #fbf8ed; outline-offset: 3px; box-shadow: 0 0 0 7px #3d0a2d; }
/* Keep footer links clear of the fixed control, including on narrow screens. */
body > footer { padding-right: max(88px, calc(env(safe-area-inset-right) + 72px)); min-height: 96px; }
/* Native dialogs occupy the top layer; also remove this control visually. */
body:has(dialog[open]) > .site-back-to-top { visibility: hidden; }
@media (max-width: 600px) {
  body > .site-back-to-top { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); width: 48px; height: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  body > .site-back-to-top { transition: none; }
}
