.animated-conversation {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line, #dce6ee);
  border-radius: 8px;
  background: var(--panel, #fff);
  box-shadow: var(--shadow, 0 22px 60px rgba(12, 31, 54, 0.11));
}

.animated-conversation .phone-top,
.animated-conversation .conversation-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  color: #fff;
  background: var(--brand-strong, #0b6a59);
}

.animated-conversation .conversation-top > div {
  min-width: 0;
  flex: 1;
}

.animated-conversation .conversation-top strong,
.animated-conversation .conversation-top small {
  overflow-wrap: anywhere;
}

.animated-conversation .conversation-top small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.78);
}

.animated-conversation .avatar-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-strong, #0b6a59);
  background: #fff;
  font-weight: 900;
}

.animated-conversation .live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #9ee6ce;
  box-shadow: 0 0 0 4px rgba(158, 230, 206, 0.16);
}

.animated-conversation .chat-stream,
.animated-conversation .conversation-body {
  display: grid;
  min-height: 260px;
  max-height: 430px;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  padding: 16px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.91), rgba(255, 255, 255, 0.91)),
    radial-gradient(circle at 18px 18px, rgba(17, 134, 111, 0.12) 0 2px, transparent 2px 24px);
}

.animated-conversation.conversation-phone .conversation-body {
  min-height: 470px;
  max-height: 528px;
}

.animated-conversation .bubble {
  width: min(88%, 420px);
  padding: 12px 14px;
  border: 1px solid var(--line, #dce6ee);
  border-radius: 8px;
  color: var(--ink-soft, #18324d);
  background: #fff;
  line-height: 1.52;
  box-shadow: 0 8px 18px rgba(12, 31, 54, 0.07);
  overflow-wrap: anywhere;
}

.animated-conversation .bubble span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--muted, #637083);
  font-size: 12px;
  font-weight: 850;
}

.animated-conversation .bubble span strong {
  color: inherit;
  font-size: inherit;
}

.animated-conversation .bubble time {
  color: #8190a4;
  font-size: 11px;
  font-weight: 750;
}

.animated-conversation .bubble.ai {
  justify-self: end;
  background: #eaf8f2;
  border-color: #c4e7d9;
}

.animated-conversation .bubble.agent {
  justify-self: end;
  background: #eef5ff;
  border-color: #c9dcf5;
}

.animated-conversation.is-ready .bubble {
  opacity: 0;
  transform: translate3d(0, 12px, 0) scale(0.985);
  transition:
    opacity 320ms ease,
    transform 320ms ease;
}

.animated-conversation.is-ready .bubble.customer {
  transform-origin: left bottom;
}

.animated-conversation.is-ready .bubble.ai,
.animated-conversation.is-ready .bubble.agent {
  transform-origin: right bottom;
}

.animated-conversation.is-ready .bubble.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.animated-conversation .typing-indicator {
  width: fit-content;
  max-width: 88%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 10px 13px;
  border: 1px solid var(--line, #dce6ee);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(12, 31, 54, 0.07);
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  animation: whatsos-typing-enter 220ms ease forwards;
}

.animated-conversation .typing-indicator.ai,
.animated-conversation .typing-indicator.agent {
  justify-self: end;
  background: #eaf8f2;
  border-color: #c4e7d9;
}

.animated-conversation .typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted, #637083);
  opacity: 0.52;
  animation: whatsos-typing-dot 960ms ease-in-out infinite;
}

.animated-conversation .typing-indicator span:nth-child(2) {
  animation-delay: 140ms;
}

.animated-conversation .typing-indicator span:nth-child(3) {
  animation-delay: 280ms;
}

.animated-conversation .conversation-footer {
  display: flex;
  min-height: 55px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line, #dce6ee);
  background: #fff;
}

.animated-conversation .conversation-outcome,
.animated-conversation .action-chip {
  display: inline-flex;
  width: fit-content;
  min-height: 30px;
  align-items: center;
  border: 1px solid #c7e7dc;
  border-radius: 999px;
  padding: 0 11px;
  color: var(--brand-strong, #0b6a59);
  background: var(--success-soft, #e7f7f2);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.animated-conversation .conversation-outcome {
  min-height: 34px;
  font-size: 13px;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition:
    opacity 260ms ease,
    transform 260ms ease;
}

.animated-conversation .action-chip {
  margin-top: 10px;
  background: #fff;
}

.animated-conversation .conversation-outcome::before,
.animated-conversation .action-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--brand, #11866f);
}

.animated-conversation .conversation-outcome.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.animated-conversation .chat-replay-control {
  flex: 0 0 auto;
  min-height: 34px;
  margin-top: 2px;
  padding: 0 12px;
  border: 1px solid #b9ddd2;
  border-radius: 8px;
  color: var(--brand, #11866f);
  background: #fff;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition:
    opacity 240ms ease,
    transform 240ms ease,
    color 180ms ease,
    background 180ms ease;
}

.animated-conversation .chat-replay-control.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.animated-conversation .chat-replay-control:hover,
.animated-conversation .chat-replay-control:focus-visible {
  color: #fff;
  background: var(--brand, #11866f);
}

.animated-conversation.is-loop-reset .conversation-body,
.animated-conversation.is-loop-reset .conversation-footer {
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.animated-conversation.conversation-inbox .phone-top,
.animated-conversation.conversation-flow .phone-top {
  background: var(--ink, #10233f);
}

.animated-conversation.conversation-flow .conversation-body {
  background:
    linear-gradient(rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.94)),
    linear-gradient(90deg, transparent 0 49%, rgba(17, 134, 111, 0.18) 49% 51%, transparent 51% 100%);
}

[data-animated-capture].is-ready {
  opacity: 0;
  transform: translate3d(0, 14px, 0) scale(0.99);
  transition:
    opacity 420ms ease,
    transform 420ms ease;
}

[data-animated-capture].is-ready.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

[data-animated-capture].is-ready [data-capture-field] {
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition:
    opacity 260ms ease,
    transform 260ms ease,
    background 260ms ease,
    border-color 260ms ease;
}

[data-animated-capture].is-ready [data-capture-field].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

[data-animated-capture].is-ready [data-capture-highlight].is-visible dd {
  color: var(--brand-strong, #0b6a59);
}

[data-animated-capture].is-ready [data-capture-highlight].is-visible::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand, #11866f);
  box-shadow: 0 0 0 4px var(--success-soft, #e7f7f2);
  transform: translateY(-50%);
}

@keyframes whatsos-typing-enter {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes whatsos-typing-dot {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.44;
  }

  40% {
    transform: translateY(-3px);
    opacity: 0.9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .animated-conversation.is-ready .bubble,
  .animated-conversation .conversation-outcome,
  .animated-conversation .chat-replay-control,
  [data-animated-capture].is-ready,
  [data-animated-capture].is-ready [data-capture-field] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .animated-conversation .typing-indicator {
    display: none;
  }
}

@media (max-width: 680px) {
  .animated-conversation .phone-top,
  .animated-conversation .conversation-top,
  .animated-conversation .chat-stream,
  .animated-conversation .conversation-body {
    padding: 14px;
  }

  .animated-conversation .conversation-body,
  .animated-conversation.conversation-phone .conversation-body {
    min-height: 250px;
    max-height: 390px;
  }

  .animated-conversation .bubble {
    width: 94%;
    padding: 11px 12px;
  }

  .animated-conversation .bubble span {
    align-items: flex-start;
    flex-direction: column;
    gap: 1px;
  }

  .animated-conversation .conversation-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .animated-conversation .conversation-outcome,
  .animated-conversation .chat-replay-control {
    width: 100%;
    justify-content: center;
  }
}
