#ao-back-to-top {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 1030;
  box-sizing: border-box;
  width: 48px;
  height: 48px;
  padding: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 1px solid #64748b;
  border-radius: 4px;
  background: #172536;
  color: #fff;
  box-shadow: 0 2px 8px #0004;
  font: 600 12px/16px system-ui, sans-serif;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 500ms ease-in-out, visibility 0s linear 500ms !important;
}
#ao-back-to-top.ao-top-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s !important;
}
#ao-back-to-top > span:first-child { font-size: 23px; line-height: 23px; }
#ao-back-to-top:hover { background: #29445f; }
#ao-back-to-top:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px #172536; }
#ao-back-to-top[hidden] { display: none !important; }
@media print { #ao-back-to-top { display: none !important; } }
/* Opacity-only fade also applies with reduced motion; scrolling remains instant. */
