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

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

.qs {
  box-sizing: border-box;
  width: min(300px, 92vw);
  padding: 12px;
  border-radius: 16px;
  background: #fff7e6;
  color: #17141a;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

.qs * {
  box-sizing: border-box;
}

.qs__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.qs__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.qs__hint {
  margin: 0;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.3;
  color: rgba(23, 20, 26, 0.72);
}

.qs__list {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.qs__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
}

.qs__info {
  display: grid;
  min-width: 0;
}

.qs__name {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qs__unit {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
  color: rgba(23, 20, 26, 0.72);
  font-variant-numeric: tabular-nums;
}

.qs__step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.07);
}

.qs__b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: #fff7e6;
  color: #17141a;
  cursor: pointer;
}
.qs__b:focus-visible {
  outline: 2px solid #2f6df6;
  outline-offset: 2px;
}

.qs__q {
  position: relative;
  min-width: 18px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.qs__sum {
  position: relative;
  justify-self: end;
  min-width: 58px;
  padding: 4px;
  border-radius: 4px;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  background-color: rgba(255, 210, 63, 0);
  transition: background-color 600ms ease-out;
}
.qs__sum.is-hot {
  background-color: rgba(255, 210, 63, 0.62);
  transition: none;
}

.qs__alt {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
}

.qs__sum .qs__alt {
  place-items: center end;
  padding: 4px;
}

.qs__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid rgba(23, 20, 26, 0.14);
}

.qs__tlabel {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.qs__sum--grand {
  min-width: 68px;
  font-size: 13px;
}

@keyframes qs-a {
  0%, 24% {
    opacity: 1;
  }
  25%, 62% {
    opacity: 0;
  }
  63%, 100% {
    opacity: 1;
  }
}
@keyframes qs-b {
  0%, 24% {
    opacity: 0;
  }
  25%, 62% {
    opacity: 1;
  }
  63%, 100% {
    opacity: 0;
  }
}
@keyframes qs-tint {
  0%, 24% {
    background-color: rgba(255, 210, 63, 0);
  }
  25% {
    background-color: rgba(255, 210, 63, 0.62);
  }
  54% {
    background-color: rgba(255, 210, 63, 0);
  }
  62% {
    background-color: rgba(255, 210, 63, 0);
  }
  63% {
    background-color: rgba(255, 210, 63, 0.62);
  }
  88%, 100% {
    background-color: rgba(255, 210, 63, 0);
  }
}
@keyframes qs-pop {
  0%, 24% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-4px);
  }
  40% {
    transform: translateY(0);
  }
  62% {
    transform: translateY(0);
  }
  63% {
    transform: translateY(-4px);
  }
  78%, 100% {
    transform: translateY(0);
  }
}
@keyframes qs-press-up {
  0%, 21% {
    transform: scale(1);
  }
  25% {
    transform: scale(0.78);
  }
  37%, 100% {
    transform: scale(1);
  }
}
@keyframes qs-press-down {
  0%, 59% {
    transform: scale(1);
  }
  63% {
    transform: scale(0.78);
  }
  75%, 100% {
    transform: scale(1);
  }
}
.qs.is-demo .qs__swap .qs__v {
  animation-name: qs-a;
}
.qs.is-demo .qs__swap .qs__alt {
  animation-name: qs-b;
}
.qs.is-demo .qs__swap .qs__v,
.qs.is-demo .qs__swap .qs__alt {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}
.qs.is-demo .qs__sum.qs__swap {
  animation-name: qs-tint, qs-pop;
  animation-duration: 2s, 2s;
  animation-timing-function: ease-out, cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite, infinite;
  animation-fill-mode: backwards, backwards;
}
.qs.is-demo .qs__row:first-child .qs__b--up {
  animation-name: qs-press-up;
}
.qs.is-demo .qs__row:first-child .qs__b--down {
  animation-name: qs-press-down;
}
.qs.is-demo .qs__row:first-child .qs__b {
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@media (max-width: 340px) {
  .qs {
    padding: 8px;
  }
  .qs__sum {
    min-width: 52px;
  }
  .qs__sum--grand {
    min-width: 60px;
  }
  .qs__b {
    width: 18px;
    height: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .qs.is-demo .qs__v,
  .qs.is-demo .qs__b,
  .qs.is-demo .qs__sum {
    animation: none !important;
    transform: none !important;
  }
  .qs.is-demo .qs__v {
    opacity: 1 !important;
  }
  .qs.is-demo .qs__alt {
    animation: none !important;
    opacity: 0 !important;
  }
  .qs.is-demo .qs__sum {
    background-color: rgba(255, 210, 63, 0) !important;
  }
  .qs__sum {
    transition: none !important;
  }
}
