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

.sh {
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  width: min(100%, 400px);
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.sh__bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sh__ico {
  display: grid;
  place-items: center;
  color: #2b9d74;
  font-size: 15px;
}

.sh__name {
  flex: 1 1 auto;
  color: #fff7e6;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.4;
}

.sh__count {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(43, 157, 116, 0.22);
  color: #fff7e6;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.4;
}

.sh__wrap {
  position: relative;
  display: grid;
  height: 156px;
}

.sh__wrap > * {
  grid-area: 1/1;
}

.sh__ta, .sh__hl {
  box-sizing: border-box;
  margin: 0;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 500;
  font-size: clamp(11px, 3vw, 13px);
  line-height: 20px;
  letter-spacing: 0;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
  overscroll-behavior: contain;
}

.sh__hl {
  background: rgba(0, 0, 0, 0.28);
  color: #fff7e6;
  pointer-events: none;
}

.sh__ln {
  display: block;
}

.t--c {
  color: #beb7ad;
}

.t--s {
  color: #ffd23f;
}

.t--n {
  color: #6ec8ff;
}

.t--k {
  color: #2b9d74;
}

.sh__ta {
  background: transparent;
  color: transparent;
  caret-color: #ffd23f;
  resize: none;
  -webkit-text-fill-color: transparent;
}

.sh__ta::selection {
  background: rgba(255, 210, 63, 0.32);
}

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

.sh__note {
  margin: 0;
  color: #beb7ad;
  font-weight: 500;
  font-size: 11px;
  line-height: 1.4;
}

.sh__sweep {
  align-self: center;
  justify-self: start;
  width: 120px;
  height: 72px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(43, 157, 116, 0), rgba(43, 157, 116, 0.4), rgba(43, 157, 116, 0));
  opacity: 0;
  pointer-events: none;
}

.sh.is-demo .sh__ln {
  animation-name: shLine;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.sh.is-demo .sh__ln:nth-child(1) {
  animation-delay: 0s;
}

.sh.is-demo .sh__ln:nth-child(2) {
  animation-delay: 0.2s;
}

.sh.is-demo .sh__ln:nth-child(3) {
  animation-delay: 0.4s;
}

.sh.is-demo .sh__ln:nth-child(4) {
  animation-delay: 0.6s;
}

.sh.is-demo .sh__ln:nth-child(5) {
  animation-delay: 0.8s;
}

.sh.is-demo .sh__ln:nth-child(6) {
  animation-delay: 1s;
}

.sh.is-demo .sh__ln:nth-child(7) {
  animation-name: shType;
  animation-timing-function: steps(12, end);
  animation-delay: 1.04s;
}

.sh.is-demo .sh__count {
  animation-name: shPulse;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
  transform-origin: 50% 50%;
}

.sh.is-demo .sh__sweep {
  animation-name: shSweep;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes shSweep {
  0%, 54% {
    opacity: 0;
    transform: translateX(-120px);
  }
  56% {
    opacity: 1;
    transform: translateX(-120px);
  }
  88% {
    opacity: 1;
    transform: translateX(400px);
  }
  90%, 100% {
    opacity: 0;
    transform: translateX(400px);
  }
}
@keyframes shLine {
  0% {
    opacity: 0;
  }
  3%, 100% {
    opacity: 1;
  }
}
@keyframes shType {
  0% {
    clip-path: inset(0 100% 0 0);
  }
  48% {
    clip-path: inset(0 0 0 0);
  }
  100% {
    clip-path: inset(0 0 0 0);
  }
}
@keyframes shPulse {
  0%, 56% {
    transform: scale(1);
  }
  64% {
    transform: scale(1.22);
  }
  76%, 100% {
    transform: scale(1);
  }
}
@media (max-width: 340px) {
  .sh {
    gap: 4px;
    padding: 8px;
  }
  .sh__wrap {
    height: 104px;
  }
  .sh__hl, .sh__ta {
    font-size: 11px;
    line-height: 16px;
    padding: 4px;
  }
  .sh__note {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sh.is-demo .sh__ln,
  .sh.is-demo .sh__sweep,
  .sh.is-demo .sh__count {
    animation: none !important;
    opacity: 1 !important;
    clip-path: none !important;
    transform: none !important;
  }
}
