/*
 * CARLAB — canonical scrollbar system (V1.1.18)
 * One complete replacement for legacy/native scrollbar styling.
 * Scroll behavior remains native; only the visual scrollbar controls are reset.
 */
:root {
  --scrollbar-size: 7px;
  --scrollbar-thumb: rgba(151, 155, 164, 0.42);
  --scrollbar-thumb-hover: rgba(190, 194, 202, 0.68);
  --scrollbar-thumb-active: rgba(214, 217, 224, 0.78);
  --scrollbar-track: transparent;
}

/* Firefox and standards-based engines */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Chromium / Edge / Safari: consistent track and thumb */
*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
  background: transparent;
}
*::-webkit-scrollbar-track,
*::-webkit-scrollbar-track-piece {
  background: var(--scrollbar-track);
  border: 0;
  box-shadow: none;
}
*::-webkit-scrollbar-thumb {
  min-width: 28px;
  min-height: 28px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--scrollbar-thumb);
  background-clip: padding-box;
  box-shadow: none;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:active {
  background: var(--scrollbar-thumb-active);
  background-clip: padding-box;
}

/* Hard-reset every native arrow/button variant on both axes.
   Explicit directional selectors cover classic Windows Chromium scrollbars. */
*::-webkit-scrollbar-button,
*::-webkit-scrollbar-button:single-button,
*::-webkit-scrollbar-button:double-button,
*::-webkit-scrollbar-button:no-button,
*::-webkit-scrollbar-button:vertical,
*::-webkit-scrollbar-button:horizontal,
*::-webkit-scrollbar-button:vertical:decrement,
*::-webkit-scrollbar-button:vertical:increment,
*::-webkit-scrollbar-button:horizontal:decrement,
*::-webkit-scrollbar-button:horizontal:increment,
*::-webkit-scrollbar-button:vertical:start:decrement,
*::-webkit-scrollbar-button:vertical:end:increment,
*::-webkit-scrollbar-button:horizontal:start:decrement,
*::-webkit-scrollbar-button:horizontal:end:increment,
*::-webkit-scrollbar-button:single-button:vertical:decrement,
*::-webkit-scrollbar-button:single-button:vertical:increment,
*::-webkit-scrollbar-button:single-button:horizontal:decrement,
*::-webkit-scrollbar-button:single-button:horizontal:increment {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

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

/* Rounded search dropdown: inset the track away from the container corners. */
#partResults {
  border-radius: 16px;
  background-clip: padding-box;
}
#partResults::-webkit-scrollbar {
  width: var(--scrollbar-size);
}
#partResults::-webkit-scrollbar-track,
#partResults::-webkit-scrollbar-track-piece {
  margin-block: 9px;
  border-radius: 999px;
  background: transparent;
}

/* Preserve native touch scrolling and momentum in scrollable work areas. */
.rail,
.catalogWheelGrid,
#partResults,
.browse,
.studioLayout .inspector,
.studioLayout .inspector #options {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

@media (prefers-reduced-motion: reduce) {
  *::-webkit-scrollbar-thumb {
    transition: none;
  }
}
