.sera-ai-chatbot {
  --sera-ai-primary: #2f7d4b;
  --sera-ai-primary-dark: #24663c;
  --sera-ai-primary-light: #eaf5e8;
  --sera-ai-primary-border: #d9e6d8;
  --sera-ai-chatbot-green: var(--sera-ai-primary);
  --sera-ai-chatbot-green-dark: var(--sera-ai-primary-dark);
  --sera-ai-chatbot-green-soft: var(--sera-ai-primary-light);
  --sera-ai-chatbot-leaf: #244236;
  --sera-ai-chatbot-cream: #fffaf0;
  --sera-ai-chatbot-border: var(--sera-ai-primary-border);
  --sera-ai-chatbot-shadow: 0 18px 48px rgba(32, 58, 43, 0.18);
  box-sizing: border-box;
  color: var(--sera-ai-chatbot-leaf);
  font-family: inherit;
}

.sera-ai-chatbot *,
.sera-ai-chatbot *::before,
.sera-ai-chatbot *::after {
  box-sizing: border-box;
}

.sera-ai-chatbot__launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  background: var(--sera-ai-chatbot-green);
  box-shadow: 0 10px 24px rgba(36, 102, 60, 0.28);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  padding: 0 20px;
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease,
    transform 0.2s ease;
}

.sera-ai-chatbot__launcher:hover,
.sera-ai-chatbot__launcher:focus {
  background: var(--sera-ai-chatbot-green-dark);
  box-shadow: 0 14px 30px rgba(36, 102, 60, 0.34);
  outline: none;
  transform: translateY(-2px);
}

.sera-ai-chatbot__launcher:focus-visible,
.sera-ai-chatbot__close:focus-visible,
.sera-ai-chatbot__send:focus-visible,
.sera-ai-chatbot__language-button:focus-visible,
.sera-ai-chatbot__suggestion:focus-visible {
  box-shadow: 0 0 0 3px rgba(47, 125, 75, 0.28);
  outline: none;
}

.sera-ai-chatbot.is-active .sera-ai-chatbot__launcher {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.sera-ai-chatbot__launcher-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 18px;
  line-height: 1;
}

.sera-ai-chatbot__panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;
  width: min(390px, calc(100vw - 32px));
  height: min(600px, calc(100dvh - 48px));
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.98);
  transform-origin: right bottom;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0.22s ease;
  visibility: hidden;
}

.sera-ai-chatbot.is-active .sera-ai-chatbot__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.sera-ai-chatbot__inner {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  border: 1px solid rgba(217, 230, 216, 0.95);
  border-radius: 22px;
  background: #fffdf8;
  box-shadow: var(--sera-ai-chatbot-shadow);
}

.sera-ai-chatbot__header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: linear-gradient(135deg, #2f7d4b 0%, #3f9960 100%);
  color: #fff;
  padding: 15px 18px;
}

.sera-ai-chatbot__header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 22px;
  line-height: 1;
}

.sera-ai-chatbot__header-text {
  min-width: 0;
  align-self: center;
}

.sera-ai-chatbot__title {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
}

.sera-ai-chatbot__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}

.sera-ai-chatbot__close:hover,
.sera-ai-chatbot__close:focus {
  background: rgba(255, 255, 255, 0.26);
  outline: none;
  transform: rotate(4deg);
}

.sera-ai-chatbot__language {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
  padding: 8px 16px 6px;
  background: #fff;
  border-top: 1px solid rgba(217, 230, 216, 0.72);
}

.sera-ai-chatbot__language-button {
  min-height: 28px;
  border: 1px solid var(--sera-ai-primary-border);
  border-radius: 999px;
  background: #fff;
  color: #315642;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  padding: 5px 9px;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.sera-ai-chatbot__language-button:hover,
.sera-ai-chatbot__language-button:focus {
  border-color: var(--sera-ai-chatbot-green);
  outline: none;
  transform: translateY(-1px);
}

.sera-ai-chatbot__language-button.is-active {
  border-color: var(--sera-ai-chatbot-green);
  background: var(--sera-ai-chatbot-green);
  color: #fff;
}

.sera-ai-chatbot__messages {
  display: flex;
  flex: 1 1 150px;
  flex-direction: column;
  gap: 12px;
  min-height: 96px;
  overflow-y: auto;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.74) 0%, rgba(255, 255, 255, 0.96) 52%),
    #fffdf8;
  scroll-behavior: smooth;
}

.sera-ai-chatbot__message {
  display: flex;
}

.sera-ai-chatbot__message--user {
  justify-content: flex-end;
}

.sera-ai-chatbot__message--bot {
  justify-content: flex-start;
}

.sera-ai-chatbot__bubble {
  max-width: 86%;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.75;
  padding: 11px 14px;
  word-break: break-word;
}

.sera-ai-chatbot__message--bot .sera-ai-chatbot__bubble {
  border: 1px solid var(--sera-ai-primary-border);
  border-bottom-left-radius: 6px;
  background: var(--sera-ai-chatbot-green-soft);
  color: var(--sera-ai-chatbot-leaf);
}

.sera-ai-chatbot__message--user .sera-ai-chatbot__bubble {
  border-bottom-right-radius: 6px;
  background: var(--sera-ai-chatbot-green);
  color: #fff;
}

.sera-ai-chatbot__message--bot .sera-ai-chatbot__bubble a {
  color: var(--sera-ai-primary-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  word-break: break-all;
}

.sera-ai-chatbot__message--bot .sera-ai-chatbot__bubble a:hover,
.sera-ai-chatbot__message--bot .sera-ai-chatbot__bubble a:focus {
  color: #164f30;
}

.sera-ai-chatbot__message--pending .sera-ai-chatbot__bubble {
  color: #58705f;
}

.sera-ai-chatbot__message--pending .sera-ai-chatbot__bubble::after {
  display: inline-block;
  overflow: hidden;
  width: 1.25em;
  vertical-align: bottom;
  animation: sera-ai-chatbot-dots 1.25s steps(4, end) infinite;
  content: "...";
}

.sera-ai-chatbot__message--error .sera-ai-chatbot__bubble {
  border-color: #f2d5cc;
  background: #fff3ee;
  color: #8b2d20;
}

.sera-ai-chatbot__suggestions {
  flex: 0 0 auto;
  max-height: 128px;
  overflow-y: auto;
  padding: 8px 16px 12px;
  background: #fffdf8;
  border-top: 1px solid rgba(217, 230, 216, 0.72);
  -webkit-overflow-scrolling: touch;
}

.sera-ai-chatbot__suggestions.is-hidden {
  display: none;
}

.sera-ai-chatbot__suggestions-title {
  margin: 0 0 6px;
  color: #617466;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.sera-ai-chatbot__suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sera-ai-chatbot__suggestion {
  border: 1px solid var(--sera-ai-primary-border);
  border-radius: 999px;
  background: #fff;
  color: #315642;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  padding: 5px 9px;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.sera-ai-chatbot__suggestion:hover,
.sera-ai-chatbot__suggestion:focus {
  border-color: var(--sera-ai-chatbot-green);
  background: #f2f8ef;
  color: var(--sera-ai-chatbot-green-dark);
  outline: none;
  transform: translateY(-1px);
}

.sera-ai-chatbot__form {
  flex: 0 0 auto;
  border-top: 1px solid var(--sera-ai-chatbot-border);
  background: #fff;
  padding: 12px 16px 9px;
}

.sera-ai-chatbot__label {
  display: block;
  margin: 0 0 7px;
  color: #4d6355;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.sera-ai-chatbot__input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.sera-ai-chatbot__input {
  display: block;
  width: 100%;
  min-height: 48px;
  max-height: 112px;
  border: 1px solid var(--sera-ai-primary-border);
  border-radius: 14px;
  background: #fffdf8;
  color: var(--sera-ai-chatbot-leaf);
  font: inherit;
  font-size: 16px;
  line-height: 1.55;
  padding: 10px 12px;
  resize: none;
}

.sera-ai-chatbot__input::placeholder {
  color: #8b9b91;
}

.sera-ai-chatbot__input:focus {
  border-color: var(--sera-ai-chatbot-green);
  box-shadow: 0 0 0 3px rgba(47, 125, 75, 0.16);
  outline: none;
}

.sera-ai-chatbot__send {
  min-width: 68px;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: var(--sera-ai-chatbot-green);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  padding: 0 16px;
  transition:
    background-color 0.2s ease,
    opacity 0.2s ease,
    transform 0.2s ease;
}

.sera-ai-chatbot__send:hover,
.sera-ai-chatbot__send:focus {
  background: var(--sera-ai-chatbot-green-dark);
  outline: none;
  transform: translateY(-1px);
}

.sera-ai-chatbot__send:disabled {
  background: #a3b9a9;
  cursor: not-allowed;
  opacity: 0.82;
  transform: none;
}

.sera-ai-chatbot__note {
  flex: 0 0 auto;
  margin: 0;
  background: #fff;
  color: #6a7a70;
  font-size: 11px;
  line-height: 1.6;
  padding: 0 16px 14px;
}

.sera-ai-chatbot-pre-chatbot-page .post-password-form {
  box-sizing: border-box;
  max-width: 520px;
  margin: 80px auto 40px;
  padding: 24px;
  text-align: center;
}

.sera-ai-chatbot-pre-chatbot-page .post-password-form input[type="password"] {
  box-sizing: border-box;
  display: block;
  max-width: 320px;
  width: 100%;
  margin: 12px auto;
}

.sera-ai-chatbot-pre-chatbot-page .post-password-form input[type="submit"] {
  margin-top: 12px;
}

.sera-ai-chatbot-pre-chatbot-page .wpml-ls-statics-shortcode_actions {
  display: none !important;
}

@keyframes sera-ai-chatbot-dots {
  0% {
    width: 0;
  }

  100% {
    width: 1.25em;
  }
}

@media (max-width: 640px) {
  .sera-ai-chatbot__launcher {
    right: 14px;
    bottom: 14px;
    min-height: 52px;
    padding: 0 17px;
  }

  .sera-ai-chatbot__panel {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    height: min(620px, calc(100dvh - 24px));
  }

  .sera-ai-chatbot__inner {
    border-radius: 20px;
  }

  .sera-ai-chatbot__header {
    padding: 16px;
  }

  .sera-ai-chatbot__title {
    font-size: 17px;
  }

  .sera-ai-chatbot__language {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 7px 14px 6px;
    -webkit-overflow-scrolling: touch;
  }

  .sera-ai-chatbot__language-button {
    flex: 0 0 auto;
  }

  .sera-ai-chatbot__messages {
    flex-basis: 120px;
    min-height: 84px;
    padding: 14px;
  }

  .sera-ai-chatbot__bubble {
    max-width: 92%;
    font-size: 14px;
  }

  .sera-ai-chatbot__suggestions {
    max-height: 96px;
    padding: 7px 14px 10px;
  }

  .sera-ai-chatbot__suggestions-list {
    flex-wrap: wrap;
    padding-bottom: 2px;
  }

  .sera-ai-chatbot__suggestion {
    font-size: 11px;
    padding: 5px 8px;
  }

  .sera-ai-chatbot__form {
    padding: 12px 14px 9px;
  }

  .sera-ai-chatbot__input-row {
    gap: 8px;
  }

  .sera-ai-chatbot__send {
    min-width: 62px;
    padding: 0 13px;
  }

  .sera-ai-chatbot__note {
    padding: 0 14px 12px;
  }

  .sera-ai-chatbot-pre-chatbot-page .post-password-form {
    margin: 56px auto 32px;
    padding: 20px 16px;
  }
}

@media (max-width: 390px) {
  .sera-ai-chatbot__panel {
    height: min(620px, calc(100dvh - 20px));
  }

  .sera-ai-chatbot__header-icon {
    width: 34px;
    height: 34px;
    font-size: 20px;
  }

}
