/* Businessbook — palette-driven scrollbars (all themes)
   Loaded from lib/render/public.php. Uses #site-brand-palette --color-* tokens.
   Themes may refine a panel (e.g. mega-menu list) but must not hardcode gray OS rails.
   Intentional hides (scrollbar-width: none) in theme CSS still win by specificity/order.
*/

html:has(body[class*="site-theme-theme"]),
body[class*="site-theme-theme"],
body[class*="site-theme-theme"] * {
  scrollbar-width: thin;
  scrollbar-color:
    color-mix(in srgb, var(--color-accent, var(--color-primary, #3a5f8a)) 72%, var(--color-primary, #2a4a6e))
    color-mix(in srgb, var(--color-primary-soft, #eef3f7) 75%, var(--color-border, #d5dee6));
}

html:has(body[class*="site-theme-theme"])::-webkit-scrollbar,
body[class*="site-theme-theme"]::-webkit-scrollbar,
body[class*="site-theme-theme"] *::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

html:has(body[class*="site-theme-theme"])::-webkit-scrollbar-track,
body[class*="site-theme-theme"]::-webkit-scrollbar-track,
body[class*="site-theme-theme"] *::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--color-primary-soft, #eef3f7) 88%, var(--color-surface, #fff));
  border-radius: 999px;
}

html:has(body[class*="site-theme-theme"])::-webkit-scrollbar-thumb,
body[class*="site-theme-theme"]::-webkit-scrollbar-thumb,
body[class*="site-theme-theme"] *::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--color-accent, var(--color-primary, #3a5f8a)) 88%, #fff),
    var(--color-primary, #2a4a6e) 55%,
    var(--color-secondary, #1a334f)
  );
}

html:has(body[class*="site-theme-theme"])::-webkit-scrollbar-thumb:hover,
body[class*="site-theme-theme"]::-webkit-scrollbar-thumb:hover,
body[class*="site-theme-theme"] *::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    var(--color-accent, var(--color-primary, #3a5f8a)),
    color-mix(in srgb, var(--color-primary, #2a4a6e) 55%, var(--color-accent, #5a8ab8)) 45%,
    var(--color-secondary, #1a334f)
  );
}

html:has(body[class*="site-theme-theme"])::-webkit-scrollbar-corner,
body[class*="site-theme-theme"]::-webkit-scrollbar-corner,
body[class*="site-theme-theme"] *::-webkit-scrollbar-corner {
  background: transparent;
}
