.chat-image-preview {
  display: block;
  max-width: min(220px, 100%);
  margin-top: 8px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: zoom-in;
}

.chat-image-preview img,
.chat-image-preview-thumb {
  display: block;
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 8px;
}

.chat-image-preview-thumb {
  width: 96px;
  height: 72px;
  margin-bottom: 4px;
}

.chat-image-modal {
  z-index: 2000;
}

.chat-image-modal .modal-backdrop {
  z-index: 1990;
}

.chat-image-modal-content {
  max-width: 100%;
  max-height: min(72vh, 900px);
  object-fit: contain;
}

.client-chat-bubble .chat-image-preview {
  max-width: min(190px, 100%);
}

.chat-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.chat-typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .35;
  animation: chat-typing-pulse 1s ease-in-out infinite;
}

.chat-typing-dots i:nth-child(2) {
  animation-delay: .15s;
}

.chat-typing-dots i:nth-child(3) {
  animation-delay: .3s;
}

.client-chat-typing .client-chat-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
}

.client-chat-typing .client-chat-bubble small {
  margin: 0;
}

[data-chat-typing-indicator][hidden],
[data-client-typing-indicator][hidden],
[data-admin-chat-typing-indicator][hidden] {
  display: none !important;
}

@keyframes chat-typing-pulse {
  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-typing-dots i {
    animation: none;
    opacity: .75;
  }
}
