/* Shared native scrolling: wheel, touch, keyboard and thumb dragging stay native. */
:root {
  --scrollbar-size: 12px;
  --scrollbar-thumb: #a3a3a3;
  --scrollbar-active: #e1010d;
}

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

/* Chromium/Safari need auto here to allow the complete custom design below. */
@supports selector(::-webkit-scrollbar) {
  *:not(.news-grid) {
    scrollbar-width: auto;
    scrollbar-color: auto;
  }

  ::-webkit-scrollbar {
    width: var(--scrollbar-size);
    height: var(--scrollbar-size);
    background: transparent;
  }

  ::-webkit-scrollbar-track {
    margin: 14px;
    border-radius: 999px;
    background: transparent;
  }

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

  ::-webkit-scrollbar-thumb:hover,
  ::-webkit-scrollbar-thumb:active {
    background-color: var(--scrollbar-active);
  }

  ::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
  }

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

/* The news carousel uses dragging/swiping and keeps its existing hidden rail. */
.news-grid { scrollbar-width: none; }
.news-grid::-webkit-scrollbar { display: none; }

/* A transparent native track still reserves a blank gutter. Overlay only the
   thumb and let the image/background occupy the full width beneath it. */
[data-scrollbar-overlay] { scrollbar-width: none !important; scrollbar-gutter: auto !important; }
[data-scrollbar-overlay]::-webkit-scrollbar { display: none !important; width: 0; height: 0; }
.helpa-scrollbar {
  position: fixed;
  z-index: 1000;
  padding: 0;
  border: 0;
  background: transparent;
  touch-action: none;
  user-select: none;
  cursor: default;
}
.helpa-scrollbar[hidden] { display: none !important; }
.review-card { position: relative; }
.helpa-scrollbar-y { width: 14px; }
.helpa-scrollbar-x { height: 14px; }
.helpa-scrollbar-thumb {
  position: absolute;
  border-radius: 999px;
  background: var(--scrollbar-thumb);
  opacity: 0;
  transition: opacity .35s ease;
}
.helpa-scrollbar.is-visible .helpa-scrollbar-thumb { opacity: 1; }
.helpa-scrollbar-y .helpa-scrollbar-thumb { top: 0; right: 4px; width: 6px; }
.helpa-scrollbar-x .helpa-scrollbar-thumb { bottom: 4px; left: 0; height: 6px; }
.helpa-scrollbar:hover .helpa-scrollbar-thumb,
.helpa-scrollbar.is-dragging .helpa-scrollbar-thumb { background: var(--scrollbar-active); }
.helpa-scrollbar.is-dragging .helpa-scrollbar-thumb { will-change: transform; }

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

/* Let the OS provide its high-contrast controls when explicitly requested. */
@media (forced-colors: active) {
  [data-scrollbar-overlay] { scrollbar-width: auto !important; }
  [data-scrollbar-overlay]::-webkit-scrollbar { display: initial !important; width: 12px; height: 12px; }
  .helpa-scrollbar { display: none !important; }
  *:not(.news-grid) { scrollbar-color: auto; }
  ::-webkit-scrollbar-thumb { background-color: ButtonText; }
  ::-webkit-scrollbar-thumb:hover,
  ::-webkit-scrollbar-thumb:active { background-color: Highlight; }
}
