/* One neutral scrollbar treatment for the marketing site, including nested scroll regions. */
:root {
  --scroll-thumb: #dfe1e5;
  --scroll-thumb-hover: #bfc4cc;
  --scroll-thumb-active: #a2a9b3;
}

[data-theme="dark"],
.sidebar {
  --scroll-thumb: #ffffff24;
  --scroll-thumb-hover: #ffffff40;
  --scroll-thumb-active: #ffffff59;
}

/* Chromium supports the standard properties too; non-auto values bypass the
   rounded WebKit thumb and can reintroduce native arrow controls. */
@supports selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: auto;
    scrollbar-color: auto;
  }

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

  *::-webkit-scrollbar-track,
  *::-webkit-scrollbar-track-piece,
  *::-webkit-scrollbar-corner {
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  *::-webkit-scrollbar-thumb {
    min-width: 32px;
    min-height: 32px;
    border: 3px solid transparent;
    border-radius: 999px;
    background: var(--scroll-thumb);
    background-clip: padding-box;
    box-shadow: none;
  }

  *::-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;
    background: transparent;
    border: 0;
  }

  *::-webkit-resizer {
    background: transparent;
  }
}

/* Firefox's standard API controls colour and width; thumb rounding is native. */
@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
  }
}

@media (forced-colors: active) {
  :root, [data-theme="dark"], .sidebar {
    --scroll-thumb: ButtonText;
    --scroll-thumb-hover: Highlight;
    --scroll-thumb-active: Highlight;
  }
}
