.aca-ai-chat {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  font-family: inherit;
}

/* Top-right floating toolbar; panel opens below and remains inside the viewport. */
.aca-ai-chat.is-floating{display:flex;flex-direction:column;align-items:flex-end;gap:8px;right:auto!important;bottom:auto!important;width:max-content;max-width:calc(100vw - 16px);z-index:100}
.aca-ai-chat-toolbar{order:0;display:flex;align-items:stretch;background:#08234b;border:1px solid #ffffff35;border-radius:8px;box-shadow:0 6px 24px #061c382b;overflow:hidden}
.aca-ai-chat.is-floating .aca-ai-chat-panel{order:1;width:min(420px,calc(100vw - 16px));height:480px;max-height:var(--chat-available-height,calc(100dvh - 78px))!important}
.aca-ai-chat-drag{display:grid;place-items:center;width:32px;padding:0;border:0;border-right:1px solid #ffffff25;color:#afc8df;background:transparent;cursor:grab;font-size:27px;touch-action:none;user-select:none}
.aca-ai-chat.is-floating .aca-ai-chat-head{cursor:grab;touch-action:none;user-select:none}
.aca-ai-chat.is-dragging .aca-ai-chat-drag,.aca-ai-chat.is-dragging .aca-ai-chat-head{cursor:grabbing}
html body .aca-ai-chat.is-floating .aca-ai-chat-toggle{border:0!important;box-shadow:none!important;border-radius:0!important;padding:10px 13px;font-size:12px!important}
.aca-ai-chat.is-floating .aca-ai-chat-head{gap:8px;padding:12px}
.aca-ai-chat.is-floating .aca-ai-chat-head strong{font-size:14px}.aca-ai-chat.is-floating .aca-ai-chat-head span{font-size:10px}
html body .aca-ai-chat.is-floating .aca-ai-chat-head strong,html body .aca-ai-chat.is-floating .aca-ai-chat-head span{color:#fff!important}.aca-ai-chat.is-floating .aca-ai-chat-status{color:#24734d}
/* Leave account/cart and the campaign pause control accessible. */
body:has(.aca-ai-chat.is-floating) .v-motion-toggle{top:80px}

.aca-ai-chat-panel {
  display: none;
  width: min(420px, calc(100vw - 28px));
  max-height: min(620px, calc(100vh - 110px));
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px;
  background: rgba(18,18,18,.96);
  color: #fff;
  box-shadow: 0 24px 70px rgba(0,0,0,.32);
}

.aca-ai-chat.is-open .aca-ai-chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.expert-chat.is-open .chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(620px, calc(100vh - 110px));
  max-height: min(620px, calc(100dvh - 110px));
}

.aca-ai-chat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #d7192a, #980b18);
}

.aca-ai-chat-head strong,
.aca-ai-chat-head span {
  display: block;
}

.aca-ai-chat-head span {
  margin-top: 3px;
  opacity: .86;
  font-size: 12px;
}

.aca-ai-chat-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.aca-ai-chat-close,
.aca-ai-chat-reset,
.chat-reset,
.aca-ai-chat-toggle,
.aca-ai-chat-form button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.aca-ai-chat-reset,
.chat-reset {
  white-space: nowrap;
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.16);
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 900;
}

.aca-ai-chat-close {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.14);
  font-size: 20px;
}

.aca-ai-chat-body,
.chat-body {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
}

.aca-ai-chat-status,
.chat-status {
  color: #49d68f;
  font-size: 12px;
  font-weight: 800;
}

[data-chat-state="awaiting_contact"] .aca-ai-chat-status,
[data-chat-state="awaiting_contact"] .chat-status,
[data-chat-state="waiting_human"] .aca-ai-chat-status,
[data-chat-state="waiting_human"] .chat-status {
  color: #ffbf47;
}

[data-chat-state="connected"] .aca-ai-chat-status,
[data-chat-state="connected"] .chat-status {
  color: #55d88c;
}

[data-chat-state="closed"] .aca-ai-chat-status,
[data-chat-state="closed"] .chat-status {
  color: #aeb6c2;
}

.aca-ai-chat-message {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  line-height: 1.45;
  font-size: 13px;
}

.aca-ai-chat-message.expert {
  border-left: 3px solid #d7192a;
}

.aca-ai-chat-message.user {
  justify-self: end;
  color: #fff;
  background: linear-gradient(135deg, #0f8de8, #0b64b1);
  border-right: 3px solid rgba(255,255,255,.65);
}

.chat-message.user {
  justify-self: end;
  color: #fff;
  background: linear-gradient(135deg, #0f8de8, #0b64b1);
  border-right: 3px solid rgba(255,255,255,.65);
}

.aca-ai-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.aca-ai-chat-form input {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  color: inherit;
  padding: 11px 13px;
}

.aca-ai-chat-form button,
.aca-ai-chat-toggle {
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #e52739, #a70d1c);
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(215,25,42,.25);
}

.aca-ai-chat-form button {
  padding: 0 16px;
}

.aca-ai-chat-form input:disabled,
.chat-form input:disabled,
.aca-ai-chat-form button:disabled,
.chat-form button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.aca-ai-chat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 17px;
}

.aca-ai-chat-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
}

html[data-theme="light"] .aca-ai-chat-panel {
  color: #2b241e;
  border-color: rgba(92,70,42,.16);
  background: rgba(255,250,242,.98);
}

html[data-theme="light"] .aca-ai-chat-message {
  background: rgba(112,84,52,.08);
}

html[data-theme="light"] .aca-ai-chat-form input {
  color: #2b241e;
  border-color: rgba(92,70,42,.18);
  background: rgba(255,255,255,.78);
}

html[data-theme="light"] .chat-reset {
  color: #fff;
}

@media (max-width: 640px) {
  .aca-ai-chat {
    right: 12px;
    bottom: 12px;
  }

  .aca-ai-chat.is-open {
    left: 12px;
  }

  .aca-ai-chat-toggle span:last-child {
    display: none;
  }

  .aca-ai-chat-reset,
  .chat-reset {
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
