/* Viewport only: document.scrollingElement is HTML in DREZZ (standards mode).
 * Never set overflow, gutter, page dimensions or a fixed thumb length.
 * Keep forced-colors entirely under browser/OS control.
 */
@media (forced-colors: none) {
    html:root {
        scrollbar-width: thin;
        scrollbar-color: rgba(100, 100, 100, .46) transparent;
    }
    /* scrollbar-color inherits. Stop at BODY so inner rails, menus and dialogs
     * retain their own existing scrollbar rules (the inspected BODY is auto).
     */
    html:root > body { scrollbar-color: auto; }

    /* Fine-pointer WebKit/Blink enhancement: standards colors otherwise take
     * precedence over thumb pseudo-elements. Firefox keeps the standard rules.
     * Touch-only devices keep the native platform indicator and target sizing.
     */
    @supports selector(::-webkit-scrollbar) {
        @media (any-hover: hover) and (any-pointer: fine) {
            html:root { scrollbar-width: auto; scrollbar-color: auto; }
            html:root::-webkit-scrollbar {
                /* Preserve native gutter/target width; inset just the paint. */
                width: auto;
            }
            html:root::-webkit-scrollbar-track:vertical,
            html:root::-webkit-scrollbar-track-piece:vertical {
                background: transparent;
                border: 0;
                box-shadow: none;
            }
            html:root::-webkit-scrollbar-thumb:vertical {
                background-color: rgba(100, 100, 100, .46);
                border: 4px solid transparent;
                background-clip: padding-box;
                border-radius: 999px;
                box-shadow: none;
                transition: background-color 180ms ease;
            }
            html:root::-webkit-scrollbar-thumb:vertical:hover {
                background-color: rgba(100, 100, 100, .66);
            }
            html:root::-webkit-scrollbar-thumb:vertical:active {
                background-color: rgba(85, 85, 85, .8);
            }
            html:root::-webkit-scrollbar-button:vertical {
                display: none;
                height: 0;
            }
        }
    }
}
@media (forced-colors: none) and (prefers-reduced-motion: reduce) {
    html:root::-webkit-scrollbar-thumb:vertical { transition: none; }
}

