/* Shared by the public website, workspace and Orchard admin, including nested scrollers.
   Leave high-contrast scrollbars to the browser and operating system. */
@media screen and (forced-colors: none) {
    :root,
    :root:has(.gstvt-workspace-theme, .gstvt-scrapbook) {
        --gstvt-scrollbar-thumb: #000000;
        --gstvt-scrollbar-thumb-hover: #262626;
        --gstvt-scrollbar-track: transparent;
        color-scheme: light;
    }

    :root[data-public-theme=dark]:not(:has(.gstvt-workspace-theme, .gstvt-scrapbook)),
    :root:has(.gstvt-workspace-dark, .gstvt-scrapbook-dark) {
        --gstvt-scrollbar-thumb: #52525b;
        --gstvt-scrollbar-thumb-hover: #71717a;
        --gstvt-scrollbar-track: #09090b;
        color-scheme: dark;
    }

    .gstvt-workspace-dark .gstvt-workspace-sidebar-content,
    .gstvt-workspace-dark .gstvt-stream-sidebar {
        --gstvt-scrollbar-thumb: var(--background);
        --gstvt-scrollbar-thumb-hover: color-mix(in srgb, var(--background) 80%, var(--foreground));
    }

    .gstvt-sb-sidebar-content {
        --gstvt-scrollbar-thumb: #000000;
        --gstvt-scrollbar-thumb-hover: #262626;
    }

    .gstvt-scrapbook-dark .gstvt-sb-sidebar-content {
        --gstvt-scrollbar-thumb: var(--sb-theme-background);
        --gstvt-scrollbar-thumb-hover: color-mix(in srgb, var(--sb-theme-background) 80%, var(--sb-theme-foreground));
    }

    :root::-webkit-scrollbar,
    :root *::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    :root::-webkit-scrollbar-track,
    :root *::-webkit-scrollbar-track,
    :root::-webkit-scrollbar-corner,
    :root *::-webkit-scrollbar-corner {
        background-color: transparent;
    }

    /* A transparent viewport track can expose the light document canvas even
       when the visible application owns its own dark theme. */
    :root::-webkit-scrollbar-track,
    :root::-webkit-scrollbar-corner,
    :root body::-webkit-scrollbar-track,
    :root body::-webkit-scrollbar-corner {
        background-color: var(--gstvt-scrollbar-track);
    }

    :root::-webkit-scrollbar-thumb,
    :root *::-webkit-scrollbar-thumb {
        background-color: var(--gstvt-scrollbar-thumb);
        border-radius: 4px;
    }

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

    /* Firefox's standard properties must not override WebKit's exact size and hover. */
    @supports not selector(::-webkit-scrollbar) {
        :root,
        :root * {
            scrollbar-width: thin;
            scrollbar-color: var(--gstvt-scrollbar-thumb) transparent;
        }
        :root,
        :root body {
            scrollbar-color: var(--gstvt-scrollbar-thumb) var(--gstvt-scrollbar-track);
        }
    }
}
