/* Shared by every scrollable web surface, including nested lists and text fields. */
:root {
  --scrollbar-thumb: color-mix(in srgb, var(--fg, CanvasText) 28%, transparent);
  --scrollbar-thumb-hover: color-mix(in srgb, var(--fg, CanvasText) 48%, transparent);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

/* Older WebKit uses rounded thumbs on both axes. Modern browsers keep native overlay scrolling. */
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track,
  ::-webkit-scrollbar-corner { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 999px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
}

@media (forced-colors: active) {
  * { scrollbar-color: auto; }
  ::-webkit-scrollbar-thumb { background: CanvasText; }
}
