.page-scroll-progress {
    display: none;
}

.page-back-to-top {
    position: fixed;
    z-index: 44;
    right: 22px;
    bottom: calc(98px + env(safe-area-inset-bottom, 0px));
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    color: #fff;
    background: rgba(50,117,148,.94);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 50%;
    box-shadow: 0 10px 26px rgba(31,72,91,.24);
    font: 900 22px/1 Arial, sans-serif;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(.94);
    transition: opacity .22s ease, transform .22s ease, background .2s ease, box-shadow .2s ease;
}

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

.page-back-to-top:hover,
.page-back-to-top:focus-visible {
    background: #285f79;
    box-shadow: 0 14px 30px rgba(31,72,91,.32);
    transform: translateY(-2px) scale(1.03);
}

.page-back-to-top:focus-visible {
    outline: 3px solid rgba(77,142,174,.3);
    outline-offset: 3px;
}

@media (max-width:600px) {
    .page-scroll-progress {
        position: fixed;
        z-index: 80;
        top: 0;
        right: 0;
        left: 0;
        display: block;
        height: 3px;
        pointer-events: none;
        background: rgba(217,229,234,.72);
    }

    .page-scroll-progress__bar {
        display: block;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, #4d8eae, #7ec3df);
        box-shadow: 0 0 8px rgba(77,142,174,.42);
        transform: scaleX(0);
        transform-origin: left center;
        will-change: transform;
    }

    .page-scroll-progress__value {
        position: absolute;
        top: 7px;
        right: 8px;
        min-width: 32px;
        padding: 2px 6px;
        color: #2f6f8d;
        background: rgba(255,255,255,.9);
        border: 1px solid rgba(77,142,174,.2);
        border-radius: 99px;
        box-shadow: 0 4px 12px rgba(38,66,79,.08);
        font: 800 9px/1.35 Arial, sans-serif;
        text-align: center;
        opacity: 0;
        transform: translateY(-3px);
        transition: opacity .18s ease, transform .18s ease;
    }

    .page-scroll-progress.is-active .page-scroll-progress__value {
        opacity: 1;
        transform: translateY(0);
    }

    .page-back-to-top {
        right: 14px;
        bottom: calc(98px + env(safe-area-inset-bottom, 0px));
        width: 42px;
        height: 42px;
        font-size: 21px;
    }
}

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