/* Tape-measure scrollbar — desktop only */
@media (min-width: 768px) {
  html { scrollbar-width: none; }
  html::-webkit-scrollbar { width: 0; height: 0; display: none; }
  /* Reserve the right 38px for the tape, mirror the same on the left so content stays centered. */
  body { padding-right: 38px; padding-left: 38px; }
}

#tape-scrollbar {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: 38px;
  z-index: 2147483600;
  user-select: none;
  display: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  pointer-events: none;
}
@media (min-width: 768px) {
  #tape-scrollbar { display: block; }
}

#tape-scrollbar .ts-rail {
  position: absolute;
  right: 8px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(0, 0, 0, 0.12);
}

#tape-scrollbar .ts-tape {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0%;
  overflow: hidden;
  background: linear-gradient(180deg, #fde047 0%, #facc15 60%, #eab308 100%);
  box-shadow:
    inset 1px 0 0 rgba(0, 0, 0, 0.06),
    inset -1px 0 0 rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(0, 0, 0, 0.04);
}

#tape-scrollbar .ts-ticks {
  position: relative;
  width: 100%;
  height: 100dvh;
}

#tape-scrollbar .ts-tick {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  transform: translateY(-0.5px);
}
#tape-scrollbar .ts-tick > .ts-bar {
  display: block;
  height: 1px;
  background: rgba(0, 0, 0, 0.85);
}
#tape-scrollbar .ts-tick > .ts-num {
  font-size: 9px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.8);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

#tape-scrollbar .ts-hook {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  transform: translateY(-50%);
  pointer-events: none;
}
#tape-scrollbar .ts-hook > .ts-hook-bar {
  height: 5px;
  margin: 0 1px;
  background: #0b0f17;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

#tape-scrollbar .ts-badge {
  position: absolute;
  right: 100%;
  margin-right: 8px;
  top: 0;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 10px;
  font-weight: 600;
  color: #0b0f17;
  background: #fde047;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  padding: 2px 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#tape-scrollbar .ts-hit {
  position: absolute;
  inset: 0;
  cursor: grab;
  pointer-events: auto;
}
#tape-scrollbar .ts-hit:active { cursor: grabbing; }
