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

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

.cb {
  display: flex;
  justify-content: center;
  width: 100%;
  padding-bottom: 8px;
}

.cb__card {
  width: min(100%, 420px);
  background: #fff7e6;
  border-radius: 16px;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  padding: 12px 16px 8px;
}

.cb__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.cb__title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(12px, 3vw, 14px);
  color: #17141a;
}

.cb__chip {
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 10px);
  color: rgba(23, 20, 26, 0.66);
  border: 1px solid rgba(23, 20, 26, 0.28);
  border-radius: 999px;
  padding: 4px 8px;
}

.cb__plot {
  position: relative;
}

.cb__svg {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  cursor: crosshair;
}

.cb__grid line {
  stroke: rgba(23, 20, 26, 0.12);
  stroke-width: 1;
}

.cb__ticks text {
  fill: rgba(23, 20, 26, 0.72);
  font-weight: 700;
  font-size: 9px;
  text-anchor: end;
  dominant-baseline: middle;
}

.cb__day {
  fill: rgba(23, 20, 26, 0.72);
  font-weight: 700;
  font-size: 10px;
  text-anchor: middle;
}

.cb__axis {
  stroke: rgba(23, 20, 26, 0.32);
  stroke-width: 1.5;
}

.cb__bar {
  fill: #17141a;
}

.cb__bar--peak {
  fill: #2f6df6;
}

.cb__bar {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.cb__val {
  fill: rgba(23, 20, 26, 0.72);
  font-weight: 700;
  font-size: 10px;
  text-anchor: middle;
  dominant-baseline: auto;
}

.cb__vPeak {
  fill: #0a4fe8;
  font-weight: 800;
  font-size: 11px;
}

.cb__tip {
  position: absolute;
  transform: translate(-50%, 4px);
  display: flex;
  align-items: baseline;
  gap: 4px;
  pointer-events: none;
  background: #17141a;
  color: #ffd23f;
  border-radius: 4px;
  padding: 4px 8px;
  font-weight: 700;
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
}

.cb__tip.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
  transition: opacity 220ms ease-out, transform 220ms ease-out;
}

.cb__tipDay {
  opacity: 0.72;
}

.cb__tipVal {
  font-size: 12px;
}

.cb__sr {
  position: fixed;
  top: 0;
  left: -640px;
  width: 320px;
  margin: 0;
}

.cb:not(.is-demo) .cb__vHalf {
  display: none;
}

.cb.is-demo .cb__bar {
  animation-name: cbGrow;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-delay: var(--d, 0s);
  animation-fill-mode: backwards;
  animation-iteration-count: infinite;
}

@keyframes cbGrow {
  0% {
    transform: scaleY(0);
  }
  30%, 86% {
    transform: scaleY(1);
  }
  96%, 100% {
    transform: scaleY(0);
  }
}
.cb.is-demo .cb__vHalf {
  animation-name: cbHalf;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-delay: var(--d, 0s);
  animation-fill-mode: backwards;
  animation-iteration-count: infinite;
}

@keyframes cbHalf {
  0%, 26% {
    opacity: 1;
  }
  28%, 100% {
    opacity: 0;
  }
}
.cb.is-demo .cb__vFull {
  animation-name: cbFull;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-delay: var(--d, 0s);
  animation-fill-mode: backwards;
  animation-iteration-count: infinite;
}

@keyframes cbFull {
  0%, 26% {
    opacity: 0;
  }
  28%, 94% {
    opacity: 1;
  }
  96%, 100% {
    opacity: 0;
  }
}
.cb.is-demo .cb__tip {
  animation-name: cbTip;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes cbTip {
  0%, 62% {
    opacity: 0;
  }
  64%, 90% {
    opacity: 1;
  }
  92%, 100% {
    opacity: 0;
  }
}
@media (max-width: 340px) {
  .cb__card {
    padding: 8px 12px 4px;
  }
  .cb__val {
    font-size: 9px;
  }
  .cb__vPeak {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cb.is-demo .cb__bar,
  .cb.is-demo .cb__vHalf,
  .cb.is-demo .cb__vFull,
  .cb.is-demo .cb__tip {
    animation: none !important;
  }
  .cb.is-demo .cb__bar {
    transform: scaleY(1) !important;
  }
  .cb.is-demo .cb__vHalf {
    opacity: 0 !important;
  }
  .cb.is-demo .cb__vFull, .cb.is-demo .cb__tip {
    opacity: 1 !important;
  }
}
