.scroll-to-top {
    position: fixed;
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    z-index: 900;
    width: 48px;
    height: 48px;
    /*
     * The client portal's button framework (Milligram) gives every bare <button> 3rem of
     * horizontal padding and nothing else here overrode it, so that padding alone — 60px —
     * was wider than this button's own 48px. A border-box element cannot push its padding
     * into negative content space, so the browser grew the box past the width actually set
     * here (an oval instead of a circle) and left zero content width for the icon, which
     * shrank it to nothing. Resetting the button's own box model to margin: 0 as well as
     * padding: 0 is what makes "width: 48px" the width, regardless of what any button
     * elsewhere on the page is styled to look like.
     */
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #021a4d;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.scroll-to-top-arrow {
    width: 22px;
    height: 22px;
    /* Without this, the same squeezed-content-area problem can shrink the icon on its own,
       even once the button's own box is sized correctly. */
    flex-shrink: 0;
    color: #fff;
}

.scroll-to-top:hover,
.scroll-to-top:focus-visible {
    background: #0a4385;
}

@media (max-width: 480px) {
    .scroll-to-top {
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        width: 44px;
        height: 44px;
    }
}
