#back_to_top { display: none; }
@media (max-width: 600px) {
  #back_to_top:not([hidden]) {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    position: fixed;
    right: max(.75rem, env(safe-area-inset-right));
    bottom: max(.75rem, env(safe-area-inset-bottom));
    z-index: 5;
    min-height: 44px;
    padding: .45rem .85rem;
    border: 1px solid #92a3b3;
    border-radius: 2rem;
    background: #102943;
    color: white;
  }
}

@media (max-width: 600px) {
  #back_to_top.is-idle:not(:focus) { opacity: 0; pointer-events: none; }
}
@media (max-width: 600px) and (prefers-reduced-motion: no-preference) {
  #back_to_top:not([hidden]) { transition: opacity 160ms ease-out; }
  #back_to_top:focus { transition: none; }
}
