/* Custom scrollbar — load after tokens.css.
   Chrome 121+ uses standard scrollbar-* properties. */

* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb, #c9a99a) var(--scrollbar-track, #fff1ed);
}

/* Legacy browsers without scrollbar-color */
@supports not (scrollbar-color: auto) {
    *::-webkit-scrollbar {
        width: var(--scrollbar-size, 8px);
        height: var(--scrollbar-size, 8px);
    }

    *::-webkit-scrollbar-button {
        display: none;
        width: 0;
        height: 0;
    }

    *::-webkit-scrollbar-track {
        background: var(--scrollbar-track, #fff1ed);
    }

    *::-webkit-scrollbar-thumb {
        background-color: var(--scrollbar-thumb, #c9a99a);
        border-radius: var(--scrollbar-radius, 9999px);
    }

    *::-webkit-scrollbar-thumb:hover {
        background-color: var(--scrollbar-thumb-hover, #f4846e);
    }

    *::-webkit-scrollbar-thumb:active {
        background-color: var(--scrollbar-thumb-active, #d95f4c);
    }

    *::-webkit-scrollbar-corner {
        background: transparent;
    }

    .scroll-inset::-webkit-scrollbar-thumb {
        border: var(--scrollbar-inset, 0.5rem) solid transparent;
        background-clip: padding-box;
    }
}

.scroll-inset {
    scrollbar-gutter: stable;
    padding-inline-end: var(--space-1, 0.25rem);
}

/*
 * Use with rounded containers:
 *   .scroll-clip { border-radius; overflow: hidden; }
 *   .scroll-clip > .scroll-inset { overflow: auto; }
 * Scrollbars cannot be radius-aware via scrollbar-color alone;
 * the outer clip is what keeps them inside rounded corners (esp. mobile).
 */
.scroll-clip {
    overflow: hidden;
}
