.site-back-to-top {
    position: fixed;
    right: clamp(14px, 2vw, 26px);
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    z-index: 58;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 999px;
    background: linear-gradient(145deg, #0ba9a3, #087aa8);
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(4, 32, 45, 0.32);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px) scale(0.94);
    transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease, box-shadow 180ms ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.site-back-to-top.is-stacked {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
}

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

.site-back-to-top:hover {
    transform: translateY(-2px) scale(1);
    box-shadow: 0 16px 34px rgba(4, 32, 45, 0.4);
}

.site-back-to-top:focus-visible {
    outline: 3px solid rgba(245, 214, 109, 0.95);
    outline-offset: 3px;
}

.site-back-to-top svg {
    width: 22px;
    height: 22px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

    .site-back-to-top.is-stacked {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }
}

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

@media print {
    .site-back-to-top {
        display: none !important;
    }
}
