/* Shared floating control; stays below the header and modal overlays. */
.back-to-top {
    position: fixed;
    right: calc(24px + env(safe-area-inset-right, 0px));
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 50%;
    background: #171717;
    color: #fff;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .22);
    cursor: pointer;
    animation: back-to-top-enter .18s ease-out;
    transition: background-color .15s ease;
}
.back-to-top[hidden] { display: none; }
.back-to-top svg { pointer-events: none; }
.back-to-top:focus-visible { outline: 3px solid #fb0082; outline-offset: 3px; }
@media (hover: hover) {
    .back-to-top:hover { background: #a80059; }
}
@keyframes back-to-top-enter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 767px) {
    .back-to-top {
        right: calc(16px + env(safe-area-inset-right, 0px));
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        width: 44px;
        height: 44px;
    }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .back-to-top { animation: none; transition: none; }
}
