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

.tp {
  box-sizing: border-box;
  width: 288px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  background: #fff7e6;
  color: #17141a;
}

.tp__head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  color: rgba(23, 20, 26, 0.6);
  background: rgba(23, 20, 26, 0.05);
}

.tp__label {
  font-size: 11px;
  font-weight: 700;
  color: #17141a;
}

.tp__body {
  position: relative;
  box-sizing: border-box;
  padding: 12px;
  padding-bottom: 40px;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 12px;
  line-height: 18px;
}

.tp__line {
  margin: 0 0 4px 0;
}

.tp__line:last-of-type {
  margin-bottom: 8px;
}

.tok {
  display: inline;
  padding: 0 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #c93000;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}

.tok.is-on {
  background: rgba(47, 109, 246, 0.14);
  color: #0a4fe8;
  text-decoration: none;
}

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

.tp__code {
  box-sizing: border-box;
  margin: 0;
  padding: 8px;
  border-radius: 8px;
  background: rgba(23, 20, 26, 0.04);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 18px;
  color: #17141a;
}

.tp__code .k {
  color: #c93000;
}

.tp__code .s {
  color: #0a4fe8;
}

.tp__code .n {
  color: #c2361a;
}

.tp__code .c {
  color: rgba(23, 20, 26, 0.72);
}

.ln {
  display: block;
}

.tp__ptr {
  position: absolute;
  top: 26px;
  left: 221px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(23, 20, 26, 0.55);
  box-shadow: 0 0 0 4px rgba(23, 20, 26, 0.12);
  pointer-events: none;
}

.tp__pop {
  box-sizing: border-box;
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 8px;
  border-radius: 8px;
  background: #2f6df6;
  color: #fff7e6;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(0.96);
}

.tp__pop.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.tp.is-demo #tp-ptr {
  animation-name: tp-ptr;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.tp.is-demo #tp-tok1 {
  animation-name: tp-tok1-on;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.tp.is-demo #tp-tok2 {
  animation-name: tp-tok2-on;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.tp.is-demo #tp-pop1 {
  animation-name: tp-pop1;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.tp.is-demo #tp-pop2 {
  animation-name: tp-pop2;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes tp-ptr {
  0% {
    transform: translate(0, 0);
  }
  14% {
    transform: translate(0, 0);
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  34% {
    transform: translate(0, 0);
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  48% {
    transform: translate(-46px, 22px);
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  66% {
    transform: translate(-46px, 22px);
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  84% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(0, 0);
  }
}
@keyframes tp-tok1-on {
  0% {
    background: transparent;
    color: #c93000;
  }
  16% {
    background: transparent;
    color: #c93000;
    animation-timing-function: steps(1, end);
  }
  18% {
    background: rgba(47, 109, 246, 0.14);
    color: #2f6df6;
    animation-timing-function: steps(1, end);
  }
  49% {
    background: rgba(47, 109, 246, 0.14);
    color: #2f6df6;
    animation-timing-function: steps(1, end);
  }
  50% {
    background: transparent;
    color: #c93000;
    animation-timing-function: steps(1, end);
  }
  100% {
    background: transparent;
    color: #c93000;
  }
}
@keyframes tp-tok2-on {
  0% {
    background: transparent;
    color: #c93000;
  }
  49% {
    background: transparent;
    color: #c93000;
    animation-timing-function: steps(1, end);
  }
  50% {
    background: rgba(47, 109, 246, 0.14);
    color: #2f6df6;
    animation-timing-function: steps(1, end);
  }
  83% {
    background: rgba(47, 109, 246, 0.14);
    color: #2f6df6;
    animation-timing-function: steps(1, end);
  }
  84% {
    background: transparent;
    color: #c93000;
  }
  100% {
    background: transparent;
    color: #c93000;
  }
}
@keyframes tp-pop1 {
  0% {
    opacity: 0;
    visibility: hidden;
    transform: translateY(44px);
    animation-timing-function: steps(1, end);
  }
  17% {
    opacity: 0;
    visibility: hidden;
    transform: translateY(44px);
    animation-timing-function: steps(1, end);
  }
  18% {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    animation-timing-function: steps(1, end);
  }
  49% {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    animation-timing-function: steps(1, end);
  }
  50% {
    opacity: 0;
    visibility: hidden;
    transform: translateY(44px);
    animation-timing-function: steps(1, end);
  }
  100% {
    opacity: 0;
    visibility: hidden;
    transform: translateY(44px);
  }
}
@keyframes tp-pop2 {
  0% {
    opacity: 0;
    visibility: hidden;
    transform: translateY(44px);
    animation-timing-function: steps(1, end);
  }
  49% {
    opacity: 0;
    visibility: hidden;
    transform: translateY(44px);
    animation-timing-function: steps(1, end);
  }
  50% {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    animation-timing-function: steps(1, end);
  }
  76% {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  88% {
    opacity: 1;
    visibility: visible;
    transform: translateY(44px);
    animation-timing-function: steps(1, end);
  }
  100% {
    opacity: 0;
    visibility: hidden;
    transform: translateY(44px);
  }
}
@media (max-width: 340px) {
  .tp {
    width: 100%;
  }
  .tp__body {
    font-size: 11px;
    line-height: 16px;
    padding: 8px;
    padding-bottom: 40px;
  }
  .tp__code {
    font-size: 10px;
    line-height: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tp.is-demo #tp-ptr,
  .tp.is-demo #tp-tok1,
  .tp.is-demo #tp-tok2,
  .tp.is-demo #tp-pop1,
  .tp.is-demo #tp-pop2 {
    animation: none !important;
  }
  .tp.is-demo #tp-pop1,
  .tp.is-demo #tp-pop2 {
    opacity: 0;
    visibility: hidden;
  }
}
