html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ffffff;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.rg {
  --a: .39583;
  --b: .75;
  --len: .35417;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(340px, 90vw);
  color: #17141a;
}

.rg__head {
  position: relative;
  height: 22px;
}

.rg__cut {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  opacity: 0;
}

.rg__cut[data-k="1"] {
  opacity: 1;
}

.rg__val {
  font-size: clamp(13px, 4vw, 15px);
  line-height: 22px;
  font-weight: 700;
  white-space: nowrap;
}

.rg__len {
  font-size: clamp(11px, 3.2vw, 12px);
  line-height: 22px;
  font-weight: 700;
  color: #2f6df6;
  white-space: nowrap;
}

.rg__body {
  padding-left: 12px;
  padding-right: 12px;
  overflow: hidden;
}

.rg__axis {
  position: relative;
  height: 40px;
}

.rg__rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 16px;
  translate: 0 -50%;
  border-radius: 999px;
  overflow: hidden;
  background-color: rgba(23, 20, 26, 0.1);
  background-image: repeating-linear-gradient(90deg, rgba(23, 20, 26, 0.3) 0 2px, rgba(23, 20, 26, 0) 2px 25%);
}

.rg__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  transform-origin: left center;
  transform: translateX(calc(var(--a) * 100%)) scaleX(var(--len));
  background-color: #2f6df6;
}

.rg__band {
  position: absolute;
  top: 50%;
  left: calc(var(--a) * 100%);
  width: calc(var(--len) * 100%);
  height: 26px;
  translate: 0 -50%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background-color: transparent;
  cursor: grab;
  touch-action: none;
}

.rg__band:focus-visible {
  outline: 3px solid #17141a;
  outline-offset: 0;
}

.rg__h {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  pointer-events: none;
}

.rg__h--a {
  transform: translateX(calc(var(--a) * 100%));
}

.rg__h--b {
  transform: translateX(calc(var(--b) * 100%));
}

.rg__knob {
  position: absolute;
  left: 0;
  top: 50%;
  width: 22px;
  height: 22px;
  translate: -50% -50%;
  border-radius: 50%;
  background-color: #17141a;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  cursor: ew-resize;
  pointer-events: auto;
  touch-action: none;
}

.rg__knob::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  translate: -50% -50%;
  border-radius: 50%;
  background-color: #ffffff;
}

.rg__knob:focus-visible {
  outline: 3px solid #2f6df6;
  outline-offset: 2px;
}

.rg__ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

.rg__ticks span {
  font-size: clamp(9px, 2.8vw, 11px);
  line-height: 14px;
  font-weight: 500;
  color: rgba(23, 20, 26, 0.6);
}

.rg.is-demo .rg__fill,
.rg.is-demo .rg__h--a,
.rg.is-demo .rg__h--b {
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.rg.is-demo .rg__fill {
  animation-name: rg-fill;
}

.rg.is-demo .rg__h--a {
  animation-name: rg-a;
}

.rg.is-demo .rg__h--b {
  animation-name: rg-b;
}

@keyframes rg-fill {
  0%, 14% {
    transform: translateX(39.583%) scaleX(0.35417);
  }
  18% {
    transform: translateX(53.125%) scaleX(0.21875);
  }
  22% {
    transform: translateX(66.667%) scaleX(0.08333);
  }
  25%, 36% {
    transform: translateX(72.917%) scaleX(0.04167);
  }
  48%, 56% {
    transform: translateX(81.25%) scaleX(0.04167);
  }
  68% {
    transform: translateX(72.917%) scaleX(0.04167);
  }
  73% {
    transform: translateX(61.458%) scaleX(0.14583);
  }
  78% {
    transform: translateX(50%) scaleX(0.25);
  }
  84%, 100% {
    transform: translateX(39.583%) scaleX(0.35417);
  }
}
@keyframes rg-a {
  0%, 14% {
    transform: translateX(39.583%);
  }
  18% {
    transform: translateX(53.125%);
  }
  22% {
    transform: translateX(66.667%);
  }
  25%, 36% {
    transform: translateX(72.917%);
  }
  48%, 56% {
    transform: translateX(81.25%);
  }
  68% {
    transform: translateX(72.917%);
  }
  73% {
    transform: translateX(61.458%);
  }
  78% {
    transform: translateX(50%);
  }
  84%, 100% {
    transform: translateX(39.583%);
  }
}
@keyframes rg-b {
  0%, 22% {
    transform: translateX(75%) scale(1);
  }
  25% {
    transform: translateX(77.083%) scale(1.25);
  }
  32%, 36% {
    transform: translateX(77.083%) scale(1);
  }
  48%, 56% {
    transform: translateX(85.417%) scale(1);
  }
  68% {
    transform: translateX(77.083%) scale(1);
  }
  73% {
    transform: translateX(76.042%) scale(1);
  }
  78%, 100% {
    transform: translateX(75%) scale(1);
  }
}
.rg.is-demo .rg__cut {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.rg.is-demo .rg__cut[data-k="1"] {
  animation-name: rg-k1;
}

.rg.is-demo .rg__cut[data-k="2"] {
  animation-name: rg-k2;
}

.rg.is-demo .rg__cut[data-k="3"] {
  animation-name: rg-k3;
}

@keyframes rg-k1 {
  0% {
    opacity: 1;
  }
  25% {
    opacity: 0;
  }
  84% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes rg-k2 {
  0% {
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  68% {
    opacity: 1;
  }
  84% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes rg-k3 {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  68% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@media (max-width: 340px) {
  .rg {
    gap: 8px;
  }
  .rg__head {
    height: 20px;
  }
  .rg__val {
    line-height: 20px;
  }
  .rg__len {
    line-height: 20px;
  }
  .rg__axis {
    height: 32px;
  }
  .rg__rail {
    height: 14px;
  }
  .rg__knob {
    width: 20px;
    height: 20px;
  }
  .rg__band {
    height: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rg.is-demo .rg__fill,
  .rg.is-demo .rg__h--a,
  .rg.is-demo .rg__h--b,
  .rg.is-demo .rg__cut {
    animation: none !important;
  }
  .rg.is-demo .rg__cut[data-k="1"] {
    opacity: 1;
  }
}
