html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ffffff;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.ct {
  box-sizing: border-box;
  width: min(100%, 400px);
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(23, 20, 26, 0.1);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(23, 20, 26, 0.1);
  color: #17141a;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

.ct__head {
  margin: 0;
  font-size: clamp(13px, 3.4vw, 15px);
  font-weight: 700;
  line-height: 1.2;
}

.ct__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 8px;
}

.ct__row + .ct__row {
  border-top: 1px solid rgba(23, 20, 26, 0.06);
}

.ct__ic {
  grid-column: 1;
  display: inline-flex;
  color: rgba(23, 20, 26, 0.4);
}

.ct__row--stats .ct__ic, .ct__row--ads .ct__ic {
  color: #2f6df6;
}

.ct__name {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  border: 0;
  margin: 0;
  padding: 8px 0;
  background: none;
  color: #17141a;
  font-family: inherit;
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.ct__label {
  white-space: nowrap;
}

.ct__caret {
  display: inline-flex;
  color: rgba(23, 20, 26, 0.36);
  transform: rotate(0deg);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ct__name[aria-expanded=true] .ct__caret {
  transform: rotate(180deg);
}

.ct__sw {
  grid-column: 3;
  position: relative;
  width: 36px;
  height: 20px;
  flex: 0 0 auto;
  border: 0;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.16);
  cursor: pointer;
}

.ct__sw::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #2f6df6;
  opacity: 0;
  transition: opacity 220ms ease-out;
}

.ct__sw.is-on::before {
  opacity: 1;
}

.ct__sw:focus-visible {
  outline: 2px solid rgba(47, 109, 246, 0.56);
  outline-offset: 2px;
}

.ct__sw--fixed {
  cursor: not-allowed;
  opacity: 0.64;
}

.ct__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(23, 20, 26, 0.24);
  transform: translateX(0);
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ct__sw.is-on .ct__knob {
  transform: translateX(16px);
}

.ct__panel {
  grid-column: 1/-1;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ct__inner {
  overflow: hidden;
}

.ct__row.is-open .ct__panel {
  grid-template-rows: 1fr;
}

.ct__desc {
  margin: 4px 0;
  padding: 8px;
  border-radius: 8px;
  background: rgba(47, 109, 246, 0.06);
  color: rgba(23, 20, 26, 0.72);
  font-size: clamp(9px, 2.6vw, 11px);
  line-height: 1.4;
}

.ct.is-demo .ct__row--stats .ct__panel {
  animation: ct-open 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.ct.is-demo .ct__row--stats .ct__caret {
  animation: ct-caret 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.ct.is-demo .ct__row--ads .ct__knob {
  animation: ct-knob 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.ct.is-demo .ct__row--ads .ct__sw::before {
  animation: ct-fill 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

@keyframes ct-open {
  0% {
    grid-template-rows: 0fr;
  }
  20%, 70% {
    grid-template-rows: 1fr;
  }
  100% {
    grid-template-rows: 0fr;
  }
}
@keyframes ct-caret {
  0% {
    transform: rotate(0deg);
  }
  20%, 70% {
    transform: rotate(180deg);
  }
  100% {
    transform: rotate(0deg);
  }
}
@keyframes ct-knob {
  0% {
    transform: translateX(0);
  }
  35%, 80% {
    transform: translateX(16px);
  }
  100% {
    transform: translateX(0);
  }
}
@keyframes ct-fill {
  0% {
    opacity: 0;
  }
  35%, 80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@media (max-width: 340px) {
  .ct {
    padding: 12px;
    gap: 4px;
  }
  .ct__row {
    column-gap: 4px;
  }
  .ct__name {
    padding: 4px 0;
  }
  .ct__desc {
    margin: 4px 0;
    padding: 4px 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ct.is-demo .ct__row--stats .ct__panel,
  .ct.is-demo .ct__row--stats .ct__caret,
  .ct.is-demo .ct__row--ads .ct__knob,
  .ct.is-demo .ct__row--ads .ct__sw::before {
    animation: none !important;
  }
  .ct__panel, .ct__caret, .ct__knob, .ct__sw::before {
    transition: none;
  }
}
