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 {
  box-sizing: border-box;
  width: min(100%, 400px);
}

.ch__field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  border: 1px solid rgba(255, 247, 230, 0.18);
  border-radius: 999px;
  background: rgba(255, 247, 230, 0.08);
  box-shadow: 0 0 0 0 rgba(185, 160, 255, 0);
  transition: box-shadow 300ms ease-out, border-color 300ms ease-out;
}

.ch__field:focus-within {
  border-color: rgba(185, 160, 255, 0.62);
  box-shadow: 0 0 0 4px rgba(185, 160, 255, 0.34);
}

.ch__lead {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: rgba(255, 247, 230, 0.62);
}

.ch__lead svg {
  width: 100%;
  height: 100%;
}

.ch__box {
  position: relative;
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.ch__input {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  padding: 0;
  font-family: inherit;
  font-weight: 600;
  font-size: clamp(10px, 2.9vw, 12px);
  line-height: 1.6;
  color: #fff7e6;
}

.ch__input:focus {
  outline: none;
}

.ch__input::placeholder {
  color: rgba(255, 247, 230, 0.62);
  opacity: 1;
}

.ch__ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  opacity: 0;
  font-weight: 600;
  font-size: clamp(10px, 2.9vw, 12px);
  line-height: 1.6;
  color: #fff7e6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.ch.is-demo .ch__input::placeholder {
  color: transparent;
}

.ch__send {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: #fff7e6;
  color: #17141a;
  transition: transform 140ms ease-out;
}

.ch__ico {
  display: inline-flex;
  width: 15px;
  height: 15px;
}

.ch__ico svg {
  width: 100%;
  height: 100%;
}

.ch__dot {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0.6;
  background: radial-gradient(circle at 50% 50%, #6ec8ff 0%, #2f6df6 70%);
  transform-origin: 50% 50%;
  transition: transform 140ms ease-out, opacity 140ms ease-out;
}

.ch__send:active {
  transform: translateY(1px);
}

.ch__send:active .ch__dot {
  transform: scale(1.55);
  opacity: 1;
}

.ch__send:focus-visible {
  outline: 2px solid rgba(185, 160, 255, 0.8);
  outline-offset: 2px;
}

.ch__row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.ch__btn {
  flex: 1 1 0;
  padding: 12px 8px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(10px, 2.9vw, 12px);
  line-height: 1;
  transition: transform 220ms ease-out, box-shadow 220ms ease-out;
}

.ch__btn--solid {
  background: #fff7e6;
  color: #17141a;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
}

.ch__btn--quiet {
  background: rgba(255, 247, 230, 0.12);
  color: #fff7e6;
}

.ch__btn:hover,
.ch__btn:focus-visible {
  transform: translateY(-1px);
}

.ch__btn--solid:hover,
.ch__btn--solid:focus-visible {
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.ch__btn:active {
  transform: translateY(0);
}

.ch__hint {
  margin: 12px 0 0;
  text-align: center;
  font-weight: 600;
  font-size: clamp(8px, 2.4vw, 9px);
  line-height: 1;
  color: rgba(255, 247, 230, 0.62);
}

.ch.is-demo .ch__field {
  animation-name: chRing;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

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

.ch.is-demo .ch__send {
  animation-name: chPress;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

.ch.is-demo .ch__dot {
  animation-name: chDot;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes chRing {
  0%, 6% {
    border-color: rgba(255, 247, 230, 0.18);
    box-shadow: 0 0 0 0 rgba(185, 160, 255, 0);
  }
  30%, 66% {
    border-color: rgba(185, 160, 255, 0.62);
    box-shadow: 0 0 0 4px rgba(185, 160, 255, 0.34);
  }
  86%, 100% {
    border-color: rgba(255, 247, 230, 0.18);
    box-shadow: 0 0 0 0 rgba(185, 160, 255, 0);
  }
}
@keyframes chGhost {
  0% {
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  86% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes chPress {
  0%, 62% {
    transform: translateY(0);
  }
  66%, 74% {
    transform: translateY(1px);
  }
  78%, 100% {
    transform: translateY(0);
  }
}
@keyframes chDot {
  0%, 62% {
    transform: scale(1);
    opacity: 0.6;
  }
  66%, 74% {
    transform: scale(1.55);
    opacity: 1;
  }
  78%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
}
@media (max-width: 340px), (max-height: 220px) {
  .ch__field {
    padding: 4px 4px 4px 12px;
  }
  .ch__lead {
    width: 14px;
    height: 14px;
  }
  .ch__input, .ch__ghost {
    font-size: 10px;
  }
  .ch__send {
    width: 26px;
    height: 26px;
  }
  .ch__ico {
    width: 13px;
    height: 13px;
  }
  .ch__row {
    margin-top: 8px;
  }
  .ch__btn {
    padding: 8px;
    font-size: 10px;
  }
  .ch__hint {
    margin-top: 8px;
    font-size: 7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ch.is-demo .ch__field,
  .ch.is-demo .ch__ghost,
  .ch.is-demo .ch__send,
  .ch.is-demo .ch__dot {
    animation: none !important;
  }
  .ch.is-demo .ch__field {
    border-color: rgba(185, 160, 255, 0.62) !important;
    box-shadow: 0 0 0 4px rgba(185, 160, 255, 0.34) !important;
  }
  .ch.is-demo .ch__ghost {
    opacity: 1 !important;
  }
  .ch__field, .ch__send, .ch__dot, .ch__btn {
    transition: none !important;
  }
}
