/* One quiet treatment for every visible scroll surface in Atlas. */
:root {
  --scroll-thumb: #527b8d;
  --scroll-thumb-hover: #79b6cd;
  --scroll-thumb-active: #a0d9ed;
}

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

*:hover {
  scrollbar-color: var(--scroll-thumb-hover) transparent;
}

/* Chromium/Safari can draw a narrow rail inside a comfortable drag target. */
@supports selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: auto;
    scrollbar-color: auto;
  }

  *:hover { scrollbar-color: auto; }

  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    background: transparent;
  }

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

  ::-webkit-scrollbar-thumb {
    min-height: 32px;
    min-width: 32px;
    border: 2px solid transparent;
    border-radius: 8px;
    background-color: var(--scroll-thumb);
    background-clip: padding-box;
  }

  ::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-thumb-hover); }
  ::-webkit-scrollbar-thumb:active { background-color: var(--scroll-thumb-active); }
  ::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
}

/* Keep native high-contrast visibility and operating-system preferences. */
@media (forced-colors: active) {
  *, *:hover { scrollbar-color: auto; }
  ::-webkit-scrollbar-thumb { background-color: ButtonText; }
}
