/* Conversation playback: reserved space, clear controls and quiet motion. */
.conversation .chat-messages {
  height: 385px;
  min-height: 240px;
  max-height: 385px;
  overscroll-behavior: contain;
  overflow-anchor: none;
  scrollbar-gutter: stable;
  overflow-y: auto;
}
.conversation .chat-bubble { flex: 0 0 auto; }
.conversation .chat-messages.is-expanded { height: 440px; max-height: 440px; }
.chat-bubble .bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-bubble.is-typing .bubble-text::after {
  content: '';
  display: inline-block;
  height: 1em;
  width: 2px;
  margin-left: 3px;
  background: currentColor;
  vertical-align: -.12em;
  animation: demo-caret .85s steps(1) infinite;
}
.conversation[data-playback="paused"] .is-typing .bubble-text::after,
.conversation[data-playback="waiting"] .is-typing .bubble-text::after { animation-play-state: paused; }
.conversation .demo-typing {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 29px;
  margin-top: 8px;
  color: #bcb7b0;
  font-size: 11px;
  line-height: 1.5;
}
.conversation .demo-typing::before {
  content: '';
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: #ff8838;
  box-shadow: 8px 0 #ff883899, 16px 0 #ff883844;
  margin-right: 15px;
  animation: demo-dots 1.2s ease-in-out infinite;
}
.conversation .demo-typing[hidden] { display: flex !important; visibility: hidden; }
.demo-playback { padding: 0 0 4px; }
.demo-playback .message-progress { min-height: 17px; margin: 2px 0 12px; }
.demo-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr); gap: 8px; }
.demo-controls .demo-control,
.demo-controls .demo-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #45423f;
  border-radius: 9px;
  padding: 9px 7px;
  margin: 0;
  background: #242426;
  color: #f8f6f2;
  font: inherit;
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
}
.demo-controls .demo-next { border-color: #ff883866; color: #ffad72; background: #ff88380a; }
.demo-controls button:hover:not(:disabled) { border-color: #ff8838; background: #ff88381a; }
.demo-controls button:focus-visible { outline: 2px solid #ff8838; outline-offset: 3px; }
.demo-controls button:disabled { opacity: .45; cursor: default; }
.conversation .chat-bubble { animation: demo-bubble-in .18s ease-out; }
@keyframes demo-caret { 50% { opacity: 0; } }
@keyframes demo-dots { 50% { opacity: .4; } }
@keyframes demo-bubble-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .conversation .chat-messages { height: 340px; max-height: 340px; }
  .conversation .chat-messages.is-expanded { height: 400px; max-height: 400px; }
  .demo-controls .demo-control, .demo-controls .demo-next { font-size: 12px; }
}
@media (max-width: 380px) {
  .demo-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .demo-controls .demo-next { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-bubble.is-typing .bubble-text::after, .conversation .demo-typing::before { animation: none; }
  .conversation .chat-bubble { animation: none; }
}
