.directional-scrollbar-frame {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.directional-scrollbar-viewport {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  scrollbar-width: none !important;
  -ms-overflow-style: none;
}

.directional-scrollbar-viewport::-webkit-scrollbar,
.directional-scrollbar-viewport::-webkit-scrollbar-corner {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.directional-scrollbar-overlay {
  position: absolute;
  inset: 0 0 0 auto;
  width: var(--ds-width, 40px);
  pointer-events: none;
  user-select: none;
  z-index: 20;
  opacity: 1;
  transition: opacity 120ms ease;
}

.directional-scrollbar-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.directional-scrollbar-track {
  position: absolute;
  inset: 0 0 0 auto;
  width: 100%;
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
}

.directional-scrollbar-thumb {
  position: absolute;
  top: 0;
  right: 2px;
  width: min(12px, calc(var(--ds-width, 40px) * 0.34));
  min-height: 33px;
  border-radius: 999px;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  background: linear-gradient(
    180deg,
    rgba(145, 255, 205, 0.98) 0%,
    rgba(84, 245, 165, 0.96) 46%,
    rgba(46, 196, 126, 0.96) 100%
  );
  border: 1px solid rgba(188, 255, 220, 0.34);
  box-shadow:
    0 0 0 1px rgba(124, 255, 163, 0.08),
    0 0 10px rgba(70, 255, 155, 0.28),
    0 0 22px rgba(70, 255, 155, 0.16);
  will-change: transform, height;
}

.directional-scrollbar-thumb:hover,
.directional-scrollbar-thumb.is-dragging {
  cursor: grabbing;
  box-shadow:
    0 0 0 1px rgba(160, 255, 205, 0.18),
    0 0 14px rgba(70, 255, 155, 0.42),
    0 0 28px rgba(70, 255, 155, 0.22);
}

/* Directional glow is attached to the actual thumb so it can never become
   a second, independently-positioned scrollbar. */
.directional-scrollbar-thumb::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 7px;
  height: 18px;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0.52;
}

.directional-scrollbar-overlay[data-tail='up'] .directional-scrollbar-thumb::after {
  top: 100%;
  background: linear-gradient(180deg, rgba(70,255,155,.45), rgba(70,255,155,0));
}

.directional-scrollbar-overlay[data-tail='down'] .directional-scrollbar-thumb::after {
  bottom: 100%;
  background: linear-gradient(0deg, rgba(70,255,155,.45), rgba(70,255,155,0));
}

/* The outer lyrics viewport is the one scroll owner. The editing textarea
   grows with its content and must not expose a second vertical scrollbar. */
.directional-scrollbar-viewport .lyrics-textarea {
  overflow-x: auto;
  overflow-y: hidden;
}
