.foodev-overlay-scrollbar-thumb {
  position: fixed;
  /* Navigation may sit below this indicator, but every backdrop, sheet and
     dialog must be able to cover it. */
  z-index: var(--foodev-scrollbar-layer, 50);
  top: 0;
  left: 0;
  display: none;
  width: 4px;
  border-radius: 999px;
  background: currentColor;
  color: var(--text, CanvasText);
  opacity: 0;
  pointer-events: none;
  contain: strict;
  overflow: hidden;
  will-change: height, transform;
}

.foodev-overlay-scrollbar-thumb.is-visible {
  opacity: .25;
}

/* Inicio remains natively scrollable, but deliberately has no visible track. */
html:not(.nav-page-mode):not(.home-access-entering):not(.home-access-leaving) #app-scroll {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

html:not(.nav-page-mode):not(.home-access-entering):not(.home-access-leaving) #app-scroll::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

html.foodev-scroll-locked,
html.foodev-scroll-locked body {
  overscroll-behavior: none !important;
}

/* The legacy page-specific indicator is replaced by the single global
   progress component above. Keeping it hidden prevents duplicate bars. */
#scroll-progress {
  display: none !important;
}

/* Touch devices retain the native transient scrollbar. */
@media (hover: none), (pointer: coarse) {
  .foodev-overlay-scrollbar-thumb {
    display: none !important;
  }
}

/* Computers use one overlay indicator; no native scrollbar may reserve space
   or flash during navigation and DOM replacement. */
@media (hover: hover) and (pointer: fine) {
  html,
  body,
  * {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar,
  *::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  .foodev-overlay-scrollbar-thumb {
    display: block;
  }
}

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