:root {
  --amx-chat-brand: #5fb927;
  --amx-chat-brand-strong: #4c9d1b;
  --amx-chat-bg: #ffffff;
  --amx-chat-surface: #f4f7f2;
  --amx-chat-border: #dce4d8;
  --amx-chat-text: #1c2818;
  --amx-chat-muted: #697564;
  --amx-chat-mine: #e5f5da;
  --amx-chat-theirs: #ffffff;
  --amx-chat-shadow: 0 14px 42px rgba(22, 39, 16, 0.12);
}

.amx-chat-app,
.amx-chat-app *,
.amx-chat-product-contact,
.amx-chat-product-contact *,
.amx-chat-login-card,
.amx-chat-login-card * {
  box-sizing: border-box;
}

.amx-chat-icon {
  width: 1em;
  height: 1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 1;
}

.amx-chat-icon svg {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  overflow: visible !important;
}

#amx-chat-app button {
  appearance: none !important;
  min-width: 0;
  max-width: none;
  margin: 0 !important;
  font: inherit !important;
  line-height: 1 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  box-shadow: none !important;
}

/* Le sélecteur natif reste uniquement piloté par le bouton caméra. */
#amx-chat-image-input.amx-chat-native-file-input,
.amx-chat-native-file-input,
.amx-chat-composer input[type="file"].amx-chat-native-file-input {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.amx-chat-product-contact {
  margin-top: 12px;
}

.amx-chat-contact-btn,
.woocommerce a.button.amx-chat-contact-btn,
.woocommerce button.button.amx-chat-contact-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--amx-chat-brand) !important;
  border-color: var(--amx-chat-brand) !important;
  color: #fff !important;
  border-radius: 12px !important;
  min-height: 44px;
  padding: 10px 18px !important;
  text-decoration: none !important;
  font-weight: 700;
}

.amx-chat-contact-btn:hover {
  filter: brightness(.95);
}

.amx-chat-contact-icon {
  width: 20px;
  height: 20px;
}

#amx-chat-app.amx-chat-app {
  --amx-chat-css-revision: 121;
  --amx-chat-height: calc(100dvh - 130px);
  position: relative;
  display: grid !important;
  grid-template-columns: minmax(270px, 330px) minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  width: calc(100vw - 24px) !important;
  width: calc(100dvw - 24px) !important;
  max-width: none !important;
  height: var(--amx-chat-height) !important;
  max-height: none;
  min-height: 0;
  margin-top: 8px;
  margin-right: calc(50% - 50vw + 12px);
  margin-bottom: 12px;
  margin-left: calc(50% - 50vw + 12px);
  overflow: hidden;
  contain: layout paint;
  color: var(--amx-chat-text);
  background: var(--amx-chat-bg);
  border: 1px solid var(--amx-chat-border);
  border-radius: 18px;
  box-shadow: var(--amx-chat-shadow);
}

#amx-chat-app > .amx-chat-sidebar {
  grid-column: 1 !important;
  grid-row: 1 !important;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--amx-chat-border);
  background: var(--amx-chat-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.amx-chat-sidebar-head {
  min-height: 72px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--amx-chat-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.amx-chat-sidebar-head h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
  color: var(--amx-chat-text);
}

.amx-chat-sidebar-head p {
  margin: 3px 0 0;
  color: var(--amx-chat-brand);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .055em;
}

#amx-chat-app .amx-chat-mobile-close {
  display: none;
  width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 9px !important;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--amx-chat-text);
  cursor: pointer;
}

.amx-chat-mobile-close .amx-chat-icon {
  width: 20px;
  height: 20px;
}

.amx-chat-conversations {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  flex: 1;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(95, 185, 39, .55) transparent;
}

#amx-chat-app .amx-chat-conversation {
  width: 100% !important;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--amx-chat-border) !important;
  background: transparent !important;
  color: var(--amx-chat-text) !important;
  text-align: left;
  cursor: pointer;
}

#amx-chat-app .amx-chat-conversation:hover,
#amx-chat-app .amx-chat-conversation.is-active {
  background: var(--amx-chat-surface) !important;
}

#amx-chat-app .amx-chat-conversation.is-active {
  box-shadow: inset 3px 0 0 var(--amx-chat-brand) !important;
}

.amx-chat-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  overflow: hidden;
  background: #edf2ea;
  display: grid;
  place-items: center;
  color: var(--amx-chat-brand);
  font-weight: 800;
}

.amx-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.amx-chat-conversation-copy {
  min-width: 0;
  flex: 1;
}

.amx-chat-conversation-top,
.amx-chat-conversation-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.amx-chat-conversation-top strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.amx-chat-conversation-top time {
  color: var(--amx-chat-muted);
  font-size: 11px;
  white-space: nowrap;
}

.amx-chat-conversation-bottom {
  margin-top: 4px;
}

.amx-chat-preview {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--amx-chat-muted);
  font-size: 12px;
}

.amx-chat-unread {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--amx-chat-brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

#amx-chat-app > .amx-chat-panel {
  grid-column: 2 !important;
  grid-row: 1 !important;
  position: relative;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: hidden !important;
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  background: var(--amx-chat-surface);
  isolation: isolate;
}

/* Les zones d'en-tête et de saisie gardent leur taille ; seule la liste défile. */
.amx-chat-header,
.amx-chat-product-context,
.amx-chat-status,
.amx-chat-composer {
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto !important;
}

.amx-chat-header {
  grid-row: 1;
  min-height: 72px;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--amx-chat-border);
  background: var(--amx-chat-bg);
}

.amx-chat-header-avatar-node {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}

.amx-chat-header-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.amx-chat-header-copy strong {
  color: var(--amx-chat-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amx-chat-header-copy span {
  margin-top: 2px;
  color: var(--amx-chat-muted);
  font-size: 12px;
}

.amx-chat-context-badge {
  flex: 0 0 auto;
  max-width: 145px;
  padding: 6px 9px;
  overflow: hidden;
  border: 1px solid rgba(95, 185, 39, .28);
  border-radius: 999px;
  background: var(--amx-chat-mine);
  color: var(--amx-chat-brand-strong);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#amx-chat-app .amx-chat-sidebar-backdrop {
  position: absolute !important;
  inset: 0 !important;
  z-index: 25;
  display: none !important;
  visibility: hidden;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: rgba(5, 10, 4, .48);
  opacity: 0;
  pointer-events: none;
}

#amx-chat-app .amx-chat-list-toggle {
  display: none;
  width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 9px !important;
  border-radius: 10px;
  border: 1px solid var(--amx-chat-border);
  background: var(--amx-chat-bg);
  color: var(--amx-chat-text);
  cursor: pointer;
}

.amx-chat-list-toggle .amx-chat-icon {
  width: 19px;
  height: 19px;
}

.amx-chat-product-context {
  grid-row: 2;
  padding: 9px 14px;
  border-bottom: 1px solid var(--amx-chat-border);
  background: var(--amx-chat-bg);
}

.amx-chat-product-context[hidden],
.amx-chat-status[hidden] {
  display: none !important;
}

.amx-chat-product-label {
  display: block;
  margin-bottom: 6px;
  color: var(--amx-chat-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.amx-chat-product-card {
  max-width: 430px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--amx-chat-border);
  border-radius: 12px;
  background: var(--amx-chat-bg);
  color: var(--amx-chat-text) !important;
  text-decoration: none !important;
}

.amx-chat-product-card img {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  object-fit: cover;
  border-radius: 9px;
}

.amx-chat-product-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.amx-chat-product-card strong {
  font-size: 13px;
  line-height: 1.3;
}

.amx-chat-product-card small {
  margin-top: 4px;
  color: var(--amx-chat-brand);
  font-weight: 800;
}

.amx-chat-product-card[href] {
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.amx-chat-product-card[href]:hover {
  border-color: rgba(98, 176, 42, .7);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(20, 35, 15, .08);
}

.amx-chat-product-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  color: var(--amx-chat-brand);
  font-size: 11px;
  font-weight: 800;
}

.amx-chat-product-link .amx-chat-icon {
  width: 13px;
  height: 13px;
}

.amx-chat-messages {
  grid-row: 3;
  position: relative;
  min-width: 0 !important;
  min-height: 0 !important;
  width: 100%;
  height: 100% !important;
  max-height: none !important;
  flex: none !important;
  box-sizing: border-box;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  padding: 18px 18px 22px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overflow-anchor: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(95, 185, 39, .55) transparent;
}

.amx-chat-messages::-webkit-scrollbar,
.amx-chat-conversations::-webkit-scrollbar {
  width: 8px;
}

.amx-chat-messages::-webkit-scrollbar-thumb,
.amx-chat-conversations::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(95, 185, 39, .55);
  background-clip: padding-box;
}

.amx-chat-message-row {
  display: flex;
  margin: 6px 0;
}

.amx-chat-message-row.is-mine {
  justify-content: flex-end;
}

.amx-chat-message-row.is-theirs {
  justify-content: flex-start;
}

.amx-chat-bubble {
  max-width: min(76%, 620px);
  padding: 9px 11px 6px;
  border: 1px solid var(--amx-chat-border);
  border-radius: 16px 16px 16px 5px;
  background: var(--amx-chat-theirs);
  color: var(--amx-chat-text);
  box-shadow: 0 2px 7px rgba(20, 35, 15, 0.035);
}

.amx-chat-message-row.is-mine .amx-chat-bubble {
  border-color: rgba(98, 176, 42, .22);
  border-radius: 16px 16px 5px 16px;
  background: var(--amx-chat-mine);
}

.amx-chat-bubble .amx-chat-product-card {
  margin-bottom: 7px;
  background: rgba(255, 255, 255, .65);
}

.amx-chat-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.42;
  font-size: 14px;
}

.amx-chat-message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 4px;
  color: var(--amx-chat-muted);
  text-align: right;
  font-size: 10px;
}

.amx-chat-receipt {
  display: inline-block;
  min-width: 10px;
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2.5px;
  white-space: nowrap;
}

.amx-chat-receipt.is-sent {
  color: var(--amx-chat-muted);
}

.amx-chat-receipt.is-read {
  color: var(--amx-chat-brand);
}

.amx-chat-image-wrap img {
  display: block;
  max-width: min(360px, 100%);
  max-height: 420px;
  margin: 2px 0 5px;
  border-radius: 11px;
  object-fit: contain;
  cursor: zoom-in;
}

.amx-chat-audio-wrap {
  min-width: min(300px, 65vw);
}

.amx-chat-audio-wrap audio {
  width: 100%;
  max-width: 360px;
  height: 38px;
}

.amx-chat-duration {
  display: block;
  margin-top: 2px;
  color: var(--amx-chat-muted);
  text-align: right;
  font-size: 10px;
}

.amx-chat-media-loading,
.amx-chat-loading,
.amx-chat-list-empty {
  color: var(--amx-chat-muted);
  font-size: 13px;
}

.amx-chat-loading,
.amx-chat-list-empty {
  padding: 22px;
  text-align: center;
}

.amx-chat-empty-state {
  height: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--amx-chat-muted);
  text-align: center;
  padding: 24px;
}

.amx-chat-empty-state strong {
  color: var(--amx-chat-text);
}

.amx-chat-empty-icon {
  width: 62px;
  height: 62px;
  margin-bottom: 4px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--amx-chat-mine);
  color: var(--amx-chat-text);
}

.amx-chat-empty-icon .amx-chat-icon {
  width: 28px;
  height: 28px;
}

.amx-chat-status {
  grid-row: 4;
  padding: 6px 14px;
  border-top: 1px solid var(--amx-chat-border);
  background: var(--amx-chat-bg);
  color: var(--amx-chat-muted);
  font-size: 12px;
}

.amx-chat-status.is-error {
  color: #b42318;
}

#amx-chat-form.amx-chat-composer {
  grid-row: 5;
  position: relative !important;
  inset: auto !important;
  z-index: 5;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 66px;
  margin: 0 !important;
  box-sizing: border-box;
  display: flex !important;
  flex: 0 0 auto !important;
  align-items: center;
  gap: 8px;
  padding: 11px 14px !important;
  border: 0 !important;
  border-top: 1px solid var(--amx-chat-border) !important;
  background: var(--amx-chat-bg) !important;
  box-shadow: 0 -8px 22px rgba(20, 35, 15, .045);
  transform: none !important;
}

#amx-chat-form.amx-chat-composer[hidden] {
  display: none !important;
}

/* Neutralise les marges des thèmes WooCommerce/Dokan qui peuvent déplacer
 * la barre de saisie en dehors du conteneur. */
#amx-chat-form.amx-chat-composer textarea,
#amx-chat-form.amx-chat-composer button,
#amx-chat-form.amx-chat-composer input {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  box-sizing: border-box;
}

#amx-chat-form.amx-chat-composer textarea {
  flex: 1;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  max-height: 140px;
  resize: none;
  border: 1px solid var(--amx-chat-border);
  border-radius: 14px;
  outline: 0;
  padding: 11px 13px;
  background: var(--amx-chat-surface);
  color: var(--amx-chat-text);
  line-height: 1.35;
}

#amx-chat-form.amx-chat-composer textarea:focus {
  border-color: var(--amx-chat-brand);
  box-shadow: 0 0 0 2px rgba(98, 176, 42, .12);
}

#amx-chat-app .amx-chat-tool,
#amx-chat-app .amx-chat-send {
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  overflow: hidden;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
}

#amx-chat-app .amx-chat-tool {
  width: auto;
  min-width: 44px !important;
  flex: 0 0 auto;
  padding: 0 12px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--amx-chat-surface);
  color: var(--amx-chat-text) !important;
  border: 1px solid var(--amx-chat-border);
}

#amx-chat-app .amx-chat-tool .amx-chat-icon {
  width: 19px !important;
  height: 19px !important;
}

#amx-chat-app .amx-chat-tool::after {
  content: attr(data-label);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

#amx-chat-app .amx-chat-tool:hover:not(:disabled) {
  border-color: rgba(98, 176, 42, .65);
  color: var(--amx-chat-brand) !important;
  background: var(--amx-chat-bg);
}

#amx-chat-app .amx-chat-tool.is-recording {
  background: #fee4e2;
  border-color: #fda29b;
  animation: amx-recording-pulse 1s infinite alternate;
}

#amx-chat-app .amx-chat-send {
  min-width: 112px !important;
  padding: 0 17px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--amx-chat-brand) !important;
  color: #fff !important;
  font-weight: 800;
}

#amx-chat-app .amx-chat-send .amx-chat-icon {
  width: 18px !important;
  height: 18px !important;
}

#amx-chat-app .amx-chat-send:hover:not(:disabled) {
  background: var(--amx-chat-brand-strong) !important;
}

#amx-chat-app .amx-chat-send:disabled,
#amx-chat-app .amx-chat-tool:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.amx-chat-image-viewer {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 30px;
  background: rgba(0, 0, 0, .88);
}

.amx-chat-image-viewer img {
  max-width: 96vw;
  max-height: 90vh;
  object-fit: contain;
}

.amx-chat-image-viewer button {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 44px;
  height: 44px;
  padding: 12px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  cursor: pointer;
}

.amx-chat-image-viewer button .amx-chat-icon {
  width: 20px;
  height: 20px;
}

.amx-chat-login-card {
  max-width: 520px;
  margin: 30px auto;
  padding: 28px;
  border: 1px solid var(--amx-chat-border);
  border-radius: 18px;
  background: var(--amx-chat-bg);
  box-shadow: var(--amx-chat-shadow);
  text-align: left;
}

.amx-chat-login-card > h2,
.amx-chat-login-intro {
  text-align: center;
}

.amx-chat-login-card > h2 {
  margin: 0 0 8px;
  color: var(--amx-chat-text);
}

.amx-chat-login-intro {
  margin: 0 0 22px;
  color: var(--amx-chat-muted);
}

.amx-chat-login-form .form-row {
  margin: 0 0 15px;
  padding: 0;
}

.amx-chat-login-form .form-row label {
  display: block;
  margin-bottom: 6px;
  color: var(--amx-chat-text);
  font-weight: 700;
}

.amx-chat-login-form input[type="text"],
.amx-chat-login-form input[type="password"] {
  width: 100% !important;
  min-height: 48px;
  margin: 0 !important;
  padding: 10px 12px !important;
  color: var(--amx-chat-text) !important;
  background: var(--amx-chat-surface) !important;
  border: 1px solid var(--amx-chat-border) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}

.amx-chat-login-form input[type="text"]:focus,
.amx-chat-login-form input[type="password"]:focus {
  border-color: var(--amx-chat-brand) !important;
  outline: 2px solid color-mix(in srgb, var(--amx-chat-brand) 22%, transparent);
  outline-offset: 1px;
}

.amx-chat-login-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 6px;
}

.amx-chat-login-actions .woocommerce-form-login__rememberme {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--amx-chat-text);
}

.amx-chat-login-actions input[type="checkbox"] {
  margin: 0 !important;
}

.amx-chat-login-submit,
.woocommerce .amx-chat-login-submit.button {
  min-height: 44px;
  margin: 0 !important;
  padding: 10px 18px !important;
  color: #fff !important;
  background: var(--amx-chat-brand) !important;
  border: 1px solid var(--amx-chat-brand) !important;
  border-radius: 10px !important;
  font-weight: 800 !important;
}

.amx-chat-login-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  text-align: center;
}

.amx-chat-login-links a {
  color: var(--amx-chat-brand-strong);
  font-weight: 700;
  text-decoration: none;
}

.amx-chat-login-links a:hover {
  text-decoration: underline;
}

@keyframes amx-recording-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

@media (prefers-color-scheme: dark) {
  :root {
    --amx-chat-brand-strong: #86d852;
    --amx-chat-bg: #151914;
    --amx-chat-surface: #0f130e;
    --amx-chat-border: #2b3328;
    --amx-chat-text: #edf2e9;
    --amx-chat-muted: #a9b3a3;
    --amx-chat-mine: #20351a;
    --amx-chat-theirs: #1a2018;
    --amx-chat-shadow: 0 12px 36px rgba(0, 0, 0, .28);
  }

  .amx-chat-bubble .amx-chat-product-card {
    background: rgba(0, 0, 0, .12);
  }
}

body.dark-mode .amx-chat-app,
body.dark .amx-chat-app,
html.dark .amx-chat-app {
  --amx-chat-brand-strong: #86d852;
  --amx-chat-bg: #151914;
  --amx-chat-surface: #0f130e;
  --amx-chat-border: #2b3328;
  --amx-chat-text: #edf2e9;
  --amx-chat-muted: #a9b3a3;
  --amx-chat-mine: #20351a;
  --amx-chat-theirs: #1a2018;
}

@media (max-width: 1050px) {
  #amx-chat-app .amx-chat-tool {
    width: 44px;
    flex-basis: 44px;
    padding: 0 !important;
  }

  #amx-chat-app .amx-chat-tool::after {
    content: none;
    display: none;
  }
}

@media (max-width: 760px) {
  #amx-chat-app.amx-chat-app {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100vw !important;
    width: 100dvw !important;
    height: var(--amx-chat-height) !important;
    min-height: 0;
    margin: 0 calc(50% - 50vw);
    border-width: 1px 0 0;
    border-radius: 0;
    box-shadow: none;
  }

  #amx-chat-app > .amx-chat-panel {
    grid-column: 1 !important;
    grid-row: 1 !important;
    height: 100%;
    min-height: 0;
    max-height: 100%;
  }

  #amx-chat-app > .amx-chat-sidebar {
    grid-column: 1 !important;
    grid-row: 1 !important;
    position: absolute;
    z-index: 30;
    width: min(88vw, 340px);
    height: 100%;
    min-height: 0;
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 12px 0 30px rgba(0, 0, 0, .18);
  }

  .amx-chat-sidebar.is-open {
    transform: translateX(0);
  }

  #amx-chat-app .amx-chat-sidebar-backdrop {
    display: block !important;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
  }

  #amx-chat-app.is-sidebar-open .amx-chat-sidebar-backdrop {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  #amx-chat-app .amx-chat-mobile-close,
  #amx-chat-app .amx-chat-list-toggle {
    display: inline-grid;
    place-items: center;
  }

  .amx-chat-header {
    min-height: 64px;
    padding-inline: 10px;
  }

  .amx-chat-messages {
    padding: 12px 9px 18px;
  }

  .amx-chat-bubble {
    max-width: 88%;
  }

  #amx-chat-form.amx-chat-composer {
    min-height: 62px;
    padding: 8px !important;
    gap: 5px;
  }

  #amx-chat-app .amx-chat-send {
    min-width: 46px !important;
    padding: 0 12px !important;
  }

  #amx-chat-app .amx-chat-tool {
    width: 40px;
    flex-basis: 40px;
  }
}

@media (max-width: 520px) {
  .amx-chat-login-card {
    margin: 12px;
    padding: 20px 16px;
    border-radius: 14px;
  }

  .amx-chat-login-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .amx-chat-login-submit,
  .woocommerce .amx-chat-login-submit.button {
    width: 100%;
  }

  .amx-chat-context-badge {
    max-width: 98px;
    padding-inline: 7px;
  }

  .amx-chat-send-label {
    display: none;
  }

  #amx-chat-app .amx-chat-send {
    width: 44px;
    padding: 0 !important;
  }

  .amx-chat-product-context {
    padding: 7px 9px;
  }

  .amx-chat-product-card {
    max-width: 100%;
  }
}
