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

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

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

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

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

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

.ch__plot {
  position: relative;
}

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

.ch__cell {
  fill: #2f6df6;
  cursor: pointer;
}

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

.ch__day {
  text-anchor: end;
  font-size: 9.5px;
}

.ch__numBg {
  fill: #ffffff;
  transform-box: fill-box;
  transform-origin: center;
}

.ch__num {
  fill: #17141a;
  font-weight: 800;
  font-size: 10px;
  dominant-baseline: middle;
  transform-box: fill-box;
  transform-origin: center;
}

.ch__tip {
  position: absolute;
  transform: translate(-50%, -118%);
  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;
}

.ch__tip.is-below {
  transform: translate(-50%, 18%);
}

.ch__tip.is-on {
  opacity: 1;
  transition: opacity 220ms ease-out;
}

.ch__tipDay {
  opacity: 0.72;
}

.ch__tipVal {
  font-size: 12px;
}

.ch__legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.ch__lgWord {
  font-weight: 700;
  font-size: 9px;
  color: rgba(23, 20, 26, 0.6);
}

.ch__lgBar {
  width: 72px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(47, 109, 246, 0.12), #2f6df6);
}

.ch__lgExp {
  margin-left: auto;
  font-weight: 700;
  font-size: 9px;
  color: rgba(23, 20, 26, 0.72);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

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

.ch.is-demo .ch__cell {
  animation-name: chCell;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  animation-delay: var(--d);
  animation-fill-mode: backwards;
}

@keyframes chCell {
  0% {
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
.ch.is-demo .ch__num,
.ch.is-demo .ch__numBg {
  animation-name: chNum;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  animation-delay: var(--dn);
  animation-fill-mode: backwards;
}

@keyframes chNum {
  0% {
    transform: scale(0);
  }
  16% {
    transform: scale(1);
  }
  100% {
    transform: scale(1);
  }
}
.ch.is-demo .ch__grid {
  animation-name: chGrid;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes chGrid {
  0%, 86% {
    clip-path: inset(0 0 0 0);
  }
  94%, 100% {
    clip-path: inset(0 0 100% 0);
  }
}
.ch.is-demo .ch__tip {
  animation-name: chTip;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes chTip {
  0%, 70% {
    opacity: 0;
  }
  72%, 84% {
    opacity: 1;
  }
  86%, 100% {
    opacity: 0;
  }
}
@media (max-width: 340px) {
  .ch__card {
    padding: 8px 12px 4px;
  }
  .ch__band {
    font-size: 8px;
  }
  .ch__day {
    font-size: 8.5px;
  }
  .ch__num {
    font-size: 9px;
  }
  .ch__legend {
    margin-top: 4px;
  }
  .ch__lgExp {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ch.is-demo .ch__cell,
  .ch.is-demo .ch__num,
  .ch.is-demo .ch__numBg,
  .ch.is-demo .ch__grid,
  .ch.is-demo .ch__tip {
    animation: none !important;
  }
  .ch.is-demo .ch__num,
  .ch.is-demo .ch__numBg {
    transform: none !important;
  }
  .ch.is-demo .ch__grid {
    clip-path: none !important;
  }
}
