/* ============================================================
   demo.css: 체험 화면(/demo)

   왼쪽은 카카오톡 방 모양의 가상 화면, 오른쪽은 설정과 차감 미리보기.
   방의 말풍선은 stage.css의 .room 부품을 그대로 쓴다.
   ============================================================ */

/* 체험이 실제로 보내지 않는다는 약속은 화면을 내려도 따라온다. */
.demo-safe {
  position: sticky; top: calc(var(--bar-h) + 8px); z-index: 5;
  display: flex; align-items: center; gap: 8px;
  width: fit-content; max-width: 100%;
  margin-bottom: 20px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--ink-2) 94%, transparent);
  font-size: 14px; color: var(--mute-2);
}
.demo-safe .lapt-ico svg { width: 16px; height: 16px; }

.demo-tabs { margin-bottom: 20px; max-width: 100%; overflow-x: auto; }
.demo-tabs > button { white-space: nowrap; }

.demo {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
  padding-bottom: var(--stack);
}

.room-pane {
  min-height: 460px;
  padding: clamp(16px, 2vw, 24px);
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
}
.room-pane .room__head { margin-right: 0; }
.room-pane .room__chat { max-height: 520px; overflow-y: auto; padding-right: 2px; }
.room__sys {
  align-self: center;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--ink-3);
  font-size: 12.5px; color: var(--mute);
  text-align: center;
}
.room__msg--bot p { border-color: var(--line); white-space: pre-line; }
.room__msg--bot b::after { content: " · 봇"; color: var(--mute); }
.room__time { display: block; margin-top: 4px; font-size: 11.5px; color: var(--mute); font-variant-numeric: tabular-nums; }
.room__reply { display: block; margin-bottom: 6px; padding-left: 8px; border-left: 1px solid var(--line-hard); font-size: 12.5px; color: var(--mute); }

/* 새 말풍선은 아래에서 짧게 올라온다. 움직임 줄이기에서는 그냥 나타난다. */
@media (prefers-reduced-motion: no-preference) {
  .room__chat > li.is-new { animation: demo-in 320ms var(--ease-out) both; }
}
@keyframes demo-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.demo__side { min-width: 0; }
.demo__title { font-size: clamp(19px, 2vw, 23px); font-weight: 700; letter-spacing: -.025em; line-height: 1.35; margin-bottom: 18px; }
.demo__form .btn { margin-top: 4px; }
.demo__pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.demo__btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.demo__meter {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 12px 14px; margin-bottom: 12px;
  border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  font-size: 14px; color: var(--mute-2);
}
.demo__meter b { font-size: 18px; color: var(--text); }
.demo__line { margin-top: 18px; }
.demo__log { margin-top: 14px; border-top: 1px solid var(--line-soft); }
.demo__log li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; color: var(--mute-2); }
.demo__log li b { color: var(--text); font-weight: 600; }
.demo__log .is-skip b { color: var(--mute); }
.demo__rate { margin-top: 4px; font-size: 14.5px; }
.demo__rate td { padding: 10px 0; }

/* 차감 미리보기: 크레딧이라 숫자만 라임이다. */
.demo__cost {
  margin-top: 18px; padding: 14px 16px;
  border: 1px solid var(--credit-line); border-radius: var(--r-sm);
  background: var(--credit-wash);
  font-size: 14.5px; line-height: 1.6; color: var(--mute-2);
}
.demo__cost:empty { display: none; }
.demo__cost b { color: var(--credit); font-weight: 650; font-variant-numeric: tabular-nums; }
.demo__end { margin-top: 18px; }
.demo__end-note { margin-top: 8px; font-size: 13px; color: var(--mute); text-align: center; }

.vroom { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.vroom__state { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 15px; font-weight: 600; }
.vroom__song { margin-top: 8px; font-size: 13.5px; color: var(--mute-2); }

@media (max-width: 900px) {
  .demo { grid-template-columns: minmax(0, 1fr); }
  .room-pane { min-height: 320px; }
}
@media (max-width: 420px) {
  .demo__pair { grid-template-columns: minmax(0, 1fr); }
}
