/* PageScouter's scrollbars, shared by the app (base.html) and the landing
   page: an orange pill on a clear track, in the accent of whichever theme is
   on. It fills in and fattens a little under the pointer, and goes a shade
   brighter while it is being dragged. Boxes inside a page (a wide table, a
   diff, a picker list) get a slimmer pill than the page's own bar.

   Two mechanisms, and they must not meet. Chrome, Edge and Safari draw the
   pill from the ::-webkit-scrollbar parts below. Chrome ignores those parts
   entirely on any element whose scrollbar-color or scrollbar-width is set,
   so those two properties appear only inside the Firefox block, which the
   WebKit engines skip. Firefox can colour a bar but not shape it. */

:root {
  --sb-thumb: color-mix(in srgb, var(--accent) 45%, transparent);
  --sb-thumb-hover: var(--accent);
  --sb-thumb-active: var(--accent-bright, var(--accent));
}

::-webkit-scrollbar { width: 12px; height: 12px; background: transparent; }
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; }
::-webkit-scrollbar-thumb {
  background-color: var(--sb-thumb);
  /* The transparent border is the gap between the pill and the window edge. */
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
  min-height: 2.5rem;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--sb-thumb-hover); border-width: 2px; }
::-webkit-scrollbar-thumb:active { background-color: var(--sb-thumb-active); border-width: 2px; }

body *::-webkit-scrollbar { width: 9px; height: 9px; }
body *::-webkit-scrollbar-thumb { border-width: 2px; min-height: 1.5rem; }
body *::-webkit-scrollbar-thumb:hover,
body *::-webkit-scrollbar-thumb:active { border-width: 1px; }

@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-color: var(--sb-thumb) transparent; }
  body * { scrollbar-width: thin; }
}
