/* Shared public scroll-to-top control. Keep fixed actions below it unobstructed. */
:is(.site-scroll-top, #ai-scroll-top, .floating-scroll-top) {
    position: fixed;
    right: var(--rv-scroll-right, 20px);
    bottom: var(--rv-scroll-bottom, calc(20px + env(safe-area-inset-bottom, 0px)));
    z-index: 1500;
    width: 55px;
    height: 55px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
    background: var(--card-bg);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px) scale(.9);
    transition: opacity .25s ease, visibility .25s ease, transform .25s ease, background-color .2s ease, color .2s ease;
}
:is(.site-scroll-top.visible, #ai-scroll-top:not([hidden]), .floating-scroll-top.show) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
}
:is(.site-scroll-top, #ai-scroll-top, .floating-scroll-top):hover {
    color: var(--rv-scroll-icon-on-gold, #fff);
    background: var(--primary-color);
    transform: translateY(-2px);
}
:is(.site-scroll-top, #ai-scroll-top, .floating-scroll-top):focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}
:is(.site-scroll-top, #ai-scroll-top, .floating-scroll-top) .material-symbols-outlined {
    font-size: 27px;
    font-weight: 500;
    line-height: 1;
    flex-shrink: 0;
}
#ai-scroll-top { --rv-scroll-bottom: calc(87px + env(safe-area-inset-bottom, 0px)); }
.floating-scroll-top { --rv-scroll-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 640px) {
    #ai-scroll-top { --rv-scroll-bottom: calc(20px + 55px + 12px); }
    .floating-scroll-top { --rv-scroll-right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    :is(.site-scroll-top, #ai-scroll-top, .floating-scroll-top) { transition: none; }
}
