/* Bootstrap handles layout and controls. Theme values inherit from the shop. */
.chat-launcher { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1040; }
.chat-popup {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: min(var(--chat-width, 25.5rem), calc(100vw - 2.5rem));
  height: min(var(--chat-height, 37rem), calc(100dvh - 2.5rem));
  z-index: 1050;
  border-radius: var(--chat-radius, var(--bs-border-radius-xl, 1rem));
  background: var(--chat-background, var(--bs-tertiary-bg, #f8f9fa));
  color: var(--chat-text, var(--bs-body-color, #212529));
  box-shadow: var(--chat-shadow, var(--bs-box-shadow-lg));
  font-family: var(--chat-font-family, inherit);
  font-size: .9rem;
}
.chat-popup[hidden], .chat-attachment-selection[hidden], .chat-popup [data-chat-popup-target=error]:empty { display: none !important; }
.chat-surface { background: var(--chat-surface, var(--bs-body-bg, #fff)); }
.chat-muted { color: var(--chat-muted, var(--bs-secondary-color, #6c757d)); }
.chat-popup-content, .chat-header-label { min-width: 0; min-height: 0; }
.chat-header-avatar { width: 42px; height: 42px; background: var(--chat-accent, var(--bs-primary)); color: var(--chat-on-accent, #fff); }
.chat-themed-button {
  --bs-btn-bg: var(--chat-accent, var(--bs-primary));
  --bs-btn-border-color: var(--chat-accent, var(--bs-primary));
  --bs-btn-color: var(--chat-on-accent, #fff);
  --bs-btn-hover-bg: var(--chat-accent-hover, var(--chat-accent, var(--bs-primary)));
  --bs-btn-hover-border-color: var(--chat-accent-hover, var(--chat-accent, var(--bs-primary)));
  --bs-btn-hover-color: var(--chat-on-accent, #fff);
  --bs-btn-active-bg: var(--chat-accent-hover, var(--chat-accent, var(--bs-primary)));
  --bs-btn-active-border-color: var(--chat-accent-hover, var(--chat-accent, var(--bs-primary)));
  --bs-btn-active-color: var(--chat-on-accent, #fff);
  --bs-btn-disabled-bg: var(--chat-accent, var(--bs-primary));
  --bs-btn-disabled-border-color: var(--chat-accent, var(--bs-primary));
  --bs-btn-disabled-color: var(--chat-on-accent, #fff);
}
.chat-conversation-details summary { cursor: pointer; }
.chat-messages { min-height: 5rem; }
.chat-message { align-self: flex-start; max-width: 88%; overflow-wrap: anywhere; border-radius: var(--chat-bubble-radius, 1rem); border-bottom-left-radius: .25rem; background: var(--chat-incoming-background, var(--chat-surface, var(--bs-body-bg, #fff))); }
.chat-message-own { align-self: flex-end; border-bottom-left-radius: var(--chat-bubble-radius, 1rem); border-bottom-right-radius: .25rem; background: var(--chat-outgoing-background, var(--bs-primary-bg-subtle, #cfe2ff)); }
.chat-message-text { white-space: pre-wrap; }
.chat-message-meta { font-size: .7rem; }
.chat-receipt-seen { color: var(--chat-seen, var(--bs-success)); }
.chat-empty p { max-width: 15rem; }
.chat-empty-icon { width: 52px; height: 52px; background: var(--chat-outgoing-background, var(--bs-primary-bg-subtle)); color: var(--chat-accent, var(--bs-primary)); }
.chat-composer-input:focus-within { outline: 2px solid var(--chat-accent, var(--bs-primary)); outline-offset: 1px; }
.chat-composer-text { min-width: 0; min-height: 36px; max-height: 120px; resize: none; color: inherit; font-size: inherit; }
.chat-icon-button { width: 36px; height: 36px; padding: 0; }
@media (max-width: 575px) { .chat-popup { inset: 0; width: 100%; height: 100dvh; border-radius: 0; } }
