.ma-back-to-top {
    --ma-btt-size: 2.5rem;
    position: fixed;
    left: max(1rem, env(safe-area-inset-left, 0px));
    bottom: max(1.15rem, env(safe-area-inset-bottom, 0px));
    z-index: 2147483640;
    width: var(--ma-btt-size);
    height: var(--ma-btt-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(12, 12, 12, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.88);
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.45rem) scale(0.92);
    pointer-events: none;
    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        visibility 0.22s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        background 0.2s ease;
}

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

.ma-back-to-top:hover,
.ma-back-to-top:focus-visible {
    border-color: rgba(200, 169, 110, 0.55);
    background: rgba(20, 18, 14, 0.9);
    color: #c8a96e;
    outline: none;
}

.ma-back-to-top svg {
    display: block;
    width: 1rem;
    height: 1rem;
}

@media (max-width: 768px) {
    .ma-back-to-top {
        --ma-btt-size: 2.65rem;
        left: max(0.85rem, env(safe-area-inset-left, 0px));
        bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    }
}

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