.pai-product-question-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 48px !important;
  margin: 12px 0 0 !important;
  padding: 11px 18px !important;
  border: 1px solid #698d65 !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  color: #698d65 !important;
  box-shadow: none !important;
  font-family: inherit !important;
  font-size: 16px !important;
  font-style: normal !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  letter-spacing: normal !important;
  text-align: center !important;
  text-decoration: none !important;
  text-indent: 0 !important;
  text-transform: none !important;
  white-space: normal !important;
  opacity: 1 !important;
  visibility: visible !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.pai-product-question-button:hover,
.pai-product-question-button:focus {
  border-color: #698d65 !important;
  background: #ffffff !important;
  color: #698d65 !important;
  outline: none !important;
}

html.pai-modal-open,
body.pai-modal-open {
  overflow: hidden !important;
}

.pai-product-chat {
  position: fixed;
  inset: 0;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.pai-product-chat[hidden] {
  display: none !important;
}

.pai-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 31, 23, .58);
  backdrop-filter: blur(2px);
}

.pai-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  width: min(560px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 32px));
  height: min(720px, calc(100dvh - 32px));
  overflow: hidden;
  transform: translate(-50%, -50%);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .3);
}

.pai-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 12px 16px;
  background: #698d65;
  color: #fff;
}

.pai-modal-title {
  font-size: 16px;
  font-weight: 700;
}

.pai-product-name {
  max-width: 440px;
  margin-top: 3px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.3;
  opacity: .9;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pai-close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}

.pai-messages {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  background: #f5f7f4;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.pai-message {
  width: fit-content;
  max-width: 86%;
  margin-bottom: 10px;
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.pai-assistant {
  margin-right: auto;
  border-bottom-left-radius: 5px;
  background: #fff;
  color: #222;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.pai-user {
  margin-left: auto;
  border-bottom-right-radius: 5px;
  background: #698d65;
  color: #fff;
}

.pai-message a {
  color: inherit;
  text-decoration: underline;
}

.pai-form {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e6e8e5;
  background: #fff;
}

.pai-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 46px;
  max-height: 120px;
  padding: 11px 12px;
  resize: none;
  border: 1px solid #d6dbd4;
  border-radius: 12px;
  outline: none;
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
}

.pai-input:focus {
  border-color: #698d65;
  box-shadow: 0 0 0 2px rgba(105, 141, 101, .14);
}

.pai-send {
  flex: 0 0 auto;
  width: 112px;
  min-width: 112px;
  min-height: 46px;
  padding: 0 15px;
  border: 0;
  border-radius: 12px;
  background: #698d65;
  color: #fff;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  cursor: pointer;
}

.pai-send:disabled,
.pai-input:disabled {
  opacity: .65;
}

.pai-note {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 0 10px 8px;
  background: #fff;
  color: #777;
  font-size: 10px;
  text-align: center;
}

.pai-language-box {
  max-width: 420px;
  margin: 80px auto 0;
  padding: 20px;
  border-radius: 16px;
  background: #fff;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .08);
}

.pai-language-question {
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 700;
}

.pai-language-buttons {
  display: flex;
  gap: 10px;
}

.pai-language-buttons button {
  flex: 1;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: #698d65;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 520px) {
  .pai-product-question-button {
    min-height: 48px;
    font-size: 15px !important;
  }

  .pai-modal {
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    transform: none;
    border-radius: 0;
  }

  .pai-header {
    min-height: 62px;
    padding:
      max(10px, env(safe-area-inset-top))
      12px
      10px;
  }

  .pai-product-name {
    max-width: calc(100vw - 90px);
  }

  .pai-messages {
    padding: 12px;
  }

  .pai-message {
    max-width: 92%;
  }

  .pai-form {
    padding: 9px 9px 7px;
  }

  .pai-send {
    width: 104px;
    min-width: 104px;
    padding: 0 10px;
    font-size: 14px;
    white-space: nowrap;
  }

  .pai-note {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .pai-language-box {
    margin: auto 0;
  }

  .pai-language-buttons {
    flex-direction: column;
  }

  .pai-language-buttons button {
    width: 100%;
  }
}


.pai-phone-link {
  display: inline-block;
  font-weight: 700;
  color: #52704f !important;
  text-decoration: underline !important;
  white-space: nowrap;
  cursor: pointer;
}
