.number-slider {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  user-select: none;
  -webkit-user-select: none;
}

.number-slider.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.number-slider__label {
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.7;
}

.number-slider__value-row {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: center;
}

/* Positioned out of flow so its own width changing (eg the digit count of a
   "+N%" delta) never shifts the centered value or anything else. */
.number-slider__accessory {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  font-weight: 700;
}

.number-slider__value {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-size: 1.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--color-base-content);
}

.number-slider__unit {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.55;
}

/* Track: the whole hit area is the drag surface -- a *sliding window* onto
   the ruler, not a spot you tap to jump to. Sized for a comfortable touch
   target and locked to horizontal panning so a vertical swipe inside a
   scrollable panel still scrolls the page instead of fighting the drag. */
.number-slider__track {
  position: relative;
  display: flex;
  align-items: center;
  height: 72px;
  border-radius: 0.85rem;
  background: var(--color-base-200);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.number-slider__track:active {
  cursor: grabbing;
}

.number-slider__track:focus-visible {
  outline: none;
}

.number-slider__track:focus-visible .number-slider__pointer {
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--color-primary) 35%, transparent);
}

/* The clipped viewport onto the (much wider) ruler. */
.number-slider__window {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* Anchored at the window's horizontal center (left: 50%) so that shifting it
   by `-offsetPx(value)` (see the `x` motion value) always brings the tick
   for the current value to rest exactly under the fixed pointer bar. */
.number-slider__ruler {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
}

.number-slider__ticks {
  position: absolute;
  left: 0;
  right: 0;
  background-repeat: repeat-x;
  background-position: left center;
}

.number-slider__ticks--minor {
  top: 50%;
  height: 10px;
  transform: translateY(-50%);
  /* background-image/background-size are set inline (see MINOR_TICKS_BG) --
     a single repeating tile per major-tick interval that skips the tick at
     each tile's start, since a major tick already marks that spot. */
}

/* Labeled landmark: a number sitting above its tick mark. Anchored to the
   same bottom baseline as the minor ticks (just taller), so numbers line up
   with the mark that actually corresponds to them. */
.number-slider__major-tick {
  position: absolute;
  bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform: translateX(-50%);
}

.number-slider__major-tick-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-base-content);
  opacity: 0.55;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.number-slider__major-tick-mark {
  width: 2px;
  height: 18px;
  border-radius: 9999px;
  background: var(--color-base-content);
  opacity: 0.35;
}

/* The moving indicator is gone -- a fixed vertical bar marks "now" and the
   ruler slides underneath it instead. */
.number-slider__pointer {
  position: absolute;
  left: 50%;
  top: 4px;
  bottom: 4px;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 9999px;
  background: var(--color-primary);
  pointer-events: none;
  transition:
    width 0.15s ease,
    margin-left 0.15s ease;
}

.number-slider__pointer.is-dragging {
  width: 4px;
  margin-left: -2px;
}

