/* ========================================
   UNIFIED SCROLLBAR SYSTEM
   Brand gradient thumb (raspberry -> periwinkle), chunky 16px grip.
   Self-contained: the brand colours fall back to literals, so this works
   on pages that load global.css (app, admin) AND on the standalone
   content pages that don't.
   Works: Chrome, Safari, Edge, Firefox · dark + light modes.
   ======================================== */

/* Firefox: no gradient support, so the thumb is the raspberry brand colour.
   Gated to Firefox specifically via -moz-appearance, a Gecko-only vendor
   prefix nothing else recognises. Chrome/Edge now understand scrollbar-color
   too, and once it is set on an element they drop its ::-webkit-scrollbar
   rules entirely, flattening the pill back into a plain square bar - so this
   block must stay invisible to them, not just to whichever engines happen to
   support -webkit-scrollbar (an @supports selector() check for that pseudo-
   element isn't reliably recognised as "supported" even in Chrome itself). */
@supports (-moz-appearance: none) {
  * {
    scrollbar-width: auto;
    scrollbar-color: var(--brand-gradient-start, #90233a) var(--scrollbar-track, rgba(128, 128, 128, 0.14));
  }
}

/* WebKit/Blink Support (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: var(--scrollbar-width, 16px);
  height: var(--scrollbar-width, 16px);
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track, rgba(128, 128, 128, 0.14));
  border-radius: var(--scrollbar-radius, 100px);
}

/* The 4px transparent border, clipped to the padding box, insets the coloured
   handle so it reads as a rounded pill floating inside the groove. */
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brand-gradient-start, #90233a) 0%, var(--brand-gradient-end, #7569ff) 100%);
  border-radius: var(--scrollbar-radius, 100px);
  border: 4px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #a82a46 0%, #8a7dff 100%);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, #b02f4c 0%, #9b8fff 100%);
  background-clip: padding-box;
}

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