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

.ccb {
  position: relative;
}

.pane {
  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;
}

.pane__head {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  background: rgba(23, 20, 26, 0.06);
  border-bottom: 1px solid rgba(23, 20, 26, 0.12);
}

.pane__lang {
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(23, 20, 26, 0.72);
  text-transform: uppercase;
}

.pane__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pane__chip {
  box-sizing: border-box;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  color: rgba(23, 20, 26, 0.45);
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 10px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms cubic-bezier(0.2, 1.4, 0.4, 1), transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.pane__copy {
  position: relative;
  box-sizing: border-box;
  width: 76px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.08);
  color: inherit;
  cursor: pointer;
  transition: transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

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

.pane__copy:hover {
  background: rgba(23, 20, 26, 0.14);
}

.copy__state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 999px;
  pointer-events: none;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transition: opacity 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.copy__state--idle {
  opacity: 1;
  color: #17141a;
}

.copy__state--done {
  opacity: 0;
  background: #2f6df6;
  color: #fff7e6;
}

.pane__copy.is-copied .copy__state--idle {
  opacity: 0;
}

.pane__copy.is-copied .copy__state--done {
  opacity: 1;
}

.pane__body {
  position: relative;
  box-sizing: border-box;
  padding: 12px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 18px;
}

.pane__body pre, .pane__body code {
  margin: 0;
  font: inherit;
  white-space: pre;
}

.k {
  color: #c93000;
}

.s {
  color: #0a4fe8;
}

.n {
  color: #c2361a;
}

.pane__sel {
  position: absolute;
  inset: 4px;
  border-radius: 4px;
  background: rgba(47, 109, 246, 0.18);
  opacity: 0;
  pointer-events: none;
}

.ccb__cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  width: 12px;
  height: 12px;
  border: 2px solid #fff7e6;
  border-radius: 50%;
  background: #17141a;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  pointer-events: none;
  opacity: 0;
  transform: translate(16px, 128px);
}

.ccb.is-demo .ccb__cursor {
  opacity: 1;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.ccb.is-demo .copy__state--idle,
.ccb.is-demo .copy__state--done,
.ccb.is-demo .pane__sel {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.ccb.is-demo .copy__state--idle {
  animation-name: ccb-idle;
}

.ccb.is-demo .copy__state--done {
  animation-name: ccb-done;
}

.ccb.is-demo .pane__sel {
  animation-name: ccb-sel;
}

.ccb.is-demo .pane__copy {
  animation-name: ccb-press;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

.ccb.is-demo .pane__chip {
  animation-name: ccb-chip;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

.ccb.is-demo .ccb__cursor {
  animation-name: ccb-cursor;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

@keyframes ccb-idle {
  0% {
    opacity: 1;
  }
  20% {
    opacity: 0;
  }
  86% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes ccb-done {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  86% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes ccb-sel {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  28% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes ccb-press {
  0%, 14% {
    transform: scale(1);
  }
  18% {
    transform: scale(0.94);
  }
  22%, 100% {
    transform: scale(1);
  }
}
@keyframes ccb-chip {
  0%, 20% {
    opacity: 0;
    transform: translateY(8px);
  }
  22%, 34% {
    opacity: 1;
    transform: translateY(0);
  }
  72% {
    opacity: 1;
    transform: translateY(0);
  }
  84%, 100% {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes ccb-cursor {
  0%, 2% {
    transform: translate(16px, 128px);
  }
  16%, 34% {
    transform: translate(192px, 34px);
  }
  70%, 100% {
    transform: translate(16px, 128px);
  }
}
@media (max-width: 340px) {
  .pane {
    width: 100%;
  }
  .pane__body {
    font-size: 10px;
    line-height: 16px;
    padding: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ccb.is-demo .copy__state--idle,
  .ccb.is-demo .copy__state--done,
  .ccb.is-demo .pane__sel,
  .ccb.is-demo .pane__copy,
  .ccb.is-demo .pane__chip,
  .ccb.is-demo .ccb__cursor {
    animation: none !important;
  }
  .ccb.is-demo .copy__state--idle {
    opacity: 0;
  }
  .ccb.is-demo .copy__state--done {
    opacity: 1;
  }
  .ccb.is-demo .ccb__cursor {
    opacity: 0;
  }
}
