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);
}

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

.cd__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;
}

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

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

.cd__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;
}

.cd__plot {
  position: relative;
}

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

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

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

.cd__labels text {
  text-anchor: middle;
  font-size: 9.5px;
}

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

.cd__area {
  fill: rgba(47, 109, 246, 0.08);
}

.cd__line {
  fill: none;
  stroke: #2f6df6;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cd__peak {
  fill: #ffffff;
  stroke: #2f6df6;
  stroke-width: 2.5;
  opacity: 1;
}

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

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

.cd__tipMon {
  opacity: 0.72;
}

.cd__tipVal {
  font-size: 12px;
}

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

.cd.is-demo .cd__line {
  stroke-dasharray: 100;
}

.cd.is-demo .cd__line {
  animation-name: cdDraw;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes cdDraw {
  0%, 4% {
    stroke-dashoffset: 100;
  }
  58%, 86% {
    stroke-dashoffset: 0;
  }
  96%, 100% {
    stroke-dashoffset: 100;
  }
}
.cd.is-demo .cd__area {
  animation-name: cdArea;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes cdArea {
  0%, 4% {
    clip-path: inset(0 100% 0 0);
  }
  58%, 86% {
    clip-path: inset(0 0 0 0);
  }
  96%, 100% {
    clip-path: inset(0 100% 0 0);
  }
}
.cd.is-demo .cd__peak {
  animation-name: cdPeak;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes cdPeak {
  0%, 62% {
    opacity: 0;
  }
  64%, 90% {
    opacity: 1;
  }
  92%, 100% {
    opacity: 0;
  }
}
.cd.is-demo .cd__tip {
  left: 87.3%;
}

.cd.is-demo .cd__tip {
  animation-name: cdTip;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes cdTip {
  0%, 62% {
    opacity: 0;
  }
  64%, 90% {
    opacity: 1;
  }
  92%, 100% {
    opacity: 0;
  }
}
@media (max-width: 340px) {
  .cd__labels text:nth-child(even) {
    display: none;
  }
  .cd__labels text {
    font-size: 9px;
  }
  .cd__card {
    padding: 8px 12px 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cd.is-demo .cd__line,
  .cd.is-demo .cd__peak,
  .cd.is-demo .cd__tip {
    animation: none !important;
  }
  .cd.is-demo .cd__line {
    stroke-dashoffset: 0 !important;
  }
  .cd.is-demo .cd__peak {
    opacity: 1 !important;
  }
}
