/* Scroll-to-top button */

#scroll-top {
    position: fixed;
    z-index: 9990;
    bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.15s, background 0.15s;

    /* Desktop: centered */
    left: 50%;
    margin-left: -20px;
}

#scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#scroll-top:hover {
    background: #f9fafb;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}

#scroll-top svg {
    width: 18px;
    height: 18px;
}

.dark #scroll-top {
    background: #1f2937;
    color: #d1d5db;
    border-color: #374151;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.dark #scroll-top:hover {
    background: #374151;
}

/* Mobile: bottom right, no longer centered */
@media (max-width: 640px) {
    #scroll-top {
        left: auto;
        right: 20px;
        margin-left: 0;
    }
}
