/** Floating back-to-top control. */
.back-to-top {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(20px, calc(env(safe-area-inset-bottom) + 14px));
    z-index: 950;
    display: inline-flex;
    width: 48px;
    height: 48px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 12px 30px rgba(11, 29, 58, .24);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .18s ease, visibility .18s ease, transform .18s ease, background-color .18s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

@media (hover: hover) and (pointer: fine) {
    .back-to-top:hover {
        background: var(--color-secondary-strong);
    }
}

.back-to-top.is-pressed,
.back-to-top:active {
    background: var(--color-secondary-strong);
}

.back-to-top svg {
    width: 22px;
    height: 22px;
}

.back-to-top:focus:not(:focus-visible) {
    outline: 0;
}

.back-to-top:not(.is-pressed) {
    background: var(--color-primary);
}

.back-to-top:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

@media (max-width: 767px) {
    .back-to-top {
        right: max(14px, env(safe-area-inset-right));
        bottom: max(16px, calc(env(safe-area-inset-bottom) + 10px));
        width: 46px;
        height: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top {
        transition: none;
    }
}
