body.ami-chat-open {
  overflow: hidden;
}

body.ami-enabled main.site-main,
body.ami-enabled .application-shell {
  padding-bottom: 118px;
}

.ami-chat {
  position: fixed;
  right: 32px;
  bottom: 148px;
  z-index: 998;
  pointer-events: none;
}

.ami-chat-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(21, 17, 36, 0.28);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ami-chat-dialog {
  width: min(380px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(155, 35, 155, 0.16);
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(246, 183, 246, 0.45), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 243, 252, 0.98));
  box-shadow: 0 24px 80px rgba(39, 48, 83, 0.24);
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
}

.ami-chat.is-open {
  pointer-events: auto;
}

.ami-chat.is-open .ami-chat-backdrop {
  opacity: 1;
  visibility: visible;
}

.ami-chat.is-open .ami-chat-dialog {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.ami-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #8a2895, #be55be);
  color: var(--white-color, #ffffff);
}

.ami-chat-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ami-chat-avatar {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 12px 22px rgba(56, 9, 61, 0.24);
}

.ami-chat-eyebrow {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: var(--font-weight-medium, 500);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ami-chat-title {
  color: var(--white-color, #ffffff);
  font-size: 22px;
  font-weight: var(--font-weight-bold, 700);
  letter-spacing: -0.02em;
}

.ami-chat-close {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: var(--white-color, #ffffff);
  font-size: 18px;
}

.ami-chat-close:hover,
.ami-chat-close:focus {
  background: rgba(255, 255, 255, 0.22);
  color: var(--white-color, #ffffff);
}

.ami-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(248, 236, 249, 0.8)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239b239b' fill-opacity='0.05'%3E%3Ccircle cx='20' cy='20' r='4'/%3E%3Ccircle cx='80' cy='80' r='4'/%3E%3Ccircle cx='140' cy='40' r='4'/%3E%3Ccircle cx='120' cy='130' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.ami-chat-date {
  width: fit-content;
  margin: 0 auto 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(61, 65, 91, 0.08);
  color: rgba(61, 65, 91, 0.72);
  font-size: 12px;
  font-weight: var(--font-weight-medium, 500);
}

.ami-message {
  display: flex;
  margin-bottom: 14px;
}

.ami-message-user {
  justify-content: flex-end;
}

.ami-message-bubble {
  max-width: 82%;
  padding: 13px 16px;
  border-radius: 18px;
  color: var(--secondary-color, #3d415b);
  font-size: 15px;
  line-height: 1.5;
  box-shadow: 0 10px 24px rgba(39, 48, 83, 0.08);
}

.ami-message-bot .ami-message-bubble {
  border-top-left-radius: 6px;
  background: var(--white-color, #ffffff);
}

.ami-message-user .ami-message-bubble {
  border-top-right-radius: 6px;
  background: linear-gradient(135deg, #9b239b, #6f1a86);
  color: var(--white-color, #ffffff);
}

.ami-chat-form {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 18px;
  border-top: 1px solid rgba(61, 65, 91, 0.08);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
}

.ami-chat-input {
  width: 100%;
  min-width: 0;
  padding: 14px 18px;
  border: 1px solid rgba(155, 35, 155, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--secondary-color, #3d415b);
  font-size: 15px;
}

.ami-chat-input::placeholder {
  color: rgba(113, 114, 117, 0.88);
}

.ami-chat-input:focus {
  outline: 0;
  border-color: rgba(155, 35, 155, 0.45);
  box-shadow: 0 0 0 4px rgba(246, 183, 246, 0.32);
}

.ami-chat-send {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #9b239b, #6f1a86);
  color: var(--white-color, #ffffff);
  box-shadow: 0 12px 24px rgba(111, 26, 134, 0.28);
}

.ami-chat-send:hover,
.ami-chat-send:focus {
  color: var(--white-color, #ffffff);
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(111, 26, 134, 0.34);
}

.float {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 24px;
  background: var(--custom-btn-bg-color, #9b239b);
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--border-radius-large, 100px);
  color: var(--white-color, #ffffff);
  font-size: var(--btn-font-size, 14px);
  font-weight: var(--font-weight-bold, 700);
  line-height: 1;
  text-align: center;
  box-shadow: 0 12px 30px rgba(68, 9, 68, 0.28);
  cursor: pointer;
}

.float:hover,
.float:focus {
  background: var(--custom-btn-bg-hover-color, #7d0c7d);
  color: var(--white-color, #ffffff);
  box-shadow: 0 16px 36px rgba(68, 9, 68, 0.35);
  transform: translateY(-2px);
}

.float:focus-visible {
  outline: 3px solid var(--offcanvas-btn-bg-color, #f6b7f6);
  outline-offset: 4px;
}

.float.float-pulse {
  animation: pulse 1.7s infinite;
}

.float-ami {
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.float-ami:hover,
.float-ami:focus {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.float-ami-image {
  display: block;
  width: 100px;
  height: auto;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: drop-shadow(0 12px 28px rgba(68, 9, 68, 0.28));
}

.float-ami:hover .float-ami-image,
.float-ami:focus .float-ami-image {
  transform: translateY(-2px);
  filter: drop-shadow(0 16px 34px rgba(68, 9, 68, 0.35));
}

@media screen and (max-width: 991px) {
  .float-ami-image {
    width: 90px;
  }

  .ami-chat {
    right: 18px;
    bottom: 118px;
  }

  .ami-chat-dialog {
    width: min(360px, calc(100vw - 24px));
    max-height: min(560px, calc(100vh - 100px));
  }
}

@media screen and (max-width: 575px) {
  body.ami-enabled main.site-main,
  body.ami-enabled .application-shell {
    padding-bottom: 96px;
  }

  .ami-chat {
    right: 12px;
    left: 12px;
    bottom: 96px;
  }

  .ami-chat-dialog {
    width: 100%;
    max-height: min(72vh, 600px);
    border-radius: 24px;
    transform-origin: bottom center;
  }

  .ami-chat-header {
    padding: 16px;
  }

  .ami-chat-title {
    font-size: 20px;
  }

  .ami-chat-body {
    padding: 16px 16px 8px;
  }

  .ami-chat-form {
    padding: 14px 16px 16px;
  }

  .ami-message-bubble {
    max-width: 88%;
  }

  .float {
    right: 14px;
    bottom: 14px;
  }
}

@media screen and (min-width: 1200px) {
  .ami-chat {
    right: 20px;
    bottom: 112px;
  }

  .float {
    right: 18px;
    bottom: 18px;
  }

  .float-ami-image {
    width: clamp(68px, 9vw, 82px);
  }
}
