.back-to-top {
    position: fixed;
    z-index: 1200;
    right: max(48px, calc(env(safe-area-inset-right) + 32px));
    bottom: max(82px, calc(env(safe-area-inset-bottom) + 72px));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 999px;
    background: linear-gradient(135deg, #ff743b, #ed4e17);
    color: #fff;
    font: inherit;
    font-size: 0;
    box-shadow: 0 10px 28px rgba(215, 77, 25, .3), 0 3px 8px rgba(48, 29, 19, .12);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(.96);
    transition: opacity .2s ease, visibility .2s ease, transform .2s ease, box-shadow .2s ease;
}

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

.back-to-top:hover {
    box-shadow: 0 14px 32px rgba(215, 77, 25, .38), 0 4px 10px rgba(48, 29, 19, .14);
    transform: translateY(-3px);
}

.back-to-top:focus-visible {
    outline: 3px solid rgba(241, 90, 36, .35);
    outline-offset: 4px;
}

.back-to-top svg {
    width: 19px;
    height: 19px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 600px) {
    .back-to-top {
        right: max(40px, calc(env(safe-area-inset-right) + 24px));
        bottom: max(76px, calc(env(safe-area-inset-bottom) + 68px));
        width: 48px;
        height: 48px;
    }
}

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