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

.stage {
  grid-template-columns: minmax(0, 1fr);
}

.tr {
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  max-width: 420px;
  padding: 12px;
  border: 1px solid rgba(23, 20, 26, 0.12);
  border-radius: 16px;
  background: #ffffff;
}

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

.tr__label {
  flex: 0 0 auto;
  color: #17141a;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.4;
}

.tr__range {
  flex: 1 1 auto;
  min-width: 0;
  accent-color: #0a4fe8;
}

.tr__val {
  flex: 0 0 auto;
  min-width: 40px;
  color: #17141a;
  text-align: right;
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.4;
}

.tr__toggle {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  background: #0a4fe8;
  color: #fff7e6;
  cursor: pointer;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.4;
}

.tr__toggle[aria-pressed=false] {
  background: rgba(23, 20, 26, 0.12);
  color: #17141a;
}

.tr__toggle:focus-visible {
  outline: 2px solid #17141a;
  outline-offset: 2px;
}

.tr__sheet {
  --measure: 44;
  box-sizing: border-box;
  width: calc(var(--measure) * 1ch);
  max-width: 100%;
  padding: 8px;
  border-radius: 8px;
}

.tr__sheet.is-grid {
  background-image: repeating-linear-gradient(to bottom, rgba(47, 109, 246, 0.26) 0, rgba(47, 109, 246, 0.26) 1px, transparent 1px, transparent 18px);
  background-position: 0 8px;
}

.tr__p {
  margin: 0;
  color: #17141a;
  font-family: ui-serif, Georgia, "Times New Roman", "Noto Serif KR", serif;
  font-weight: 400;
  font-size: 13px;
  line-height: 18px;
  text-wrap: pretty;
}

.tr__note {
  margin: 0;
  color: rgba(23, 20, 26, 0.72);
  font-weight: 500;
  font-size: 11px;
  line-height: 1.4;
}

.tr.is-demo .tr__sheet {
  animation-name: trMeasure;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

.tr.is-demo .tr__val {
  animation-name: trVal;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

@keyframes trMeasure {
  0%, 8% {
    width: 44ch;
  }
  46%, 54% {
    width: 28ch;
  }
  92%, 100% {
    width: 44ch;
  }
}
@keyframes trVal {
  0%, 30% {
    opacity: 1;
  }
  32%, 68% {
    opacity: 0.35;
  }
  70%, 100% {
    opacity: 1;
  }
}
@media (max-width: 340px) {
  .tr {
    gap: 4px;
    padding: 8px;
  }
  .tr__sheet {
    padding: 4px;
  }
  .tr__p {
    font-size: 12px;
    line-height: 16px;
  }
  .tr__sheet.is-grid {
    background-image: repeating-linear-gradient(to bottom, rgba(47, 109, 246, 0.26) 0, rgba(47, 109, 246, 0.26) 1px, transparent 1px, transparent 16px);
    background-position: 0 4px;
  }
  .tr__label, .tr__val, .tr__toggle, .tr__note {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tr.is-demo .tr__sheet,
  .tr.is-demo .tr__val {
    animation: none !important;
    width: 44ch !important;
    opacity: 1 !important;
  }
}
