.lpai-chatbot,
.lpai-chatbot * {
  box-sizing: border-box;
}

.lpai-chatbot {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17211d;
}

.lpai-chatbot__button {
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  color: #073f46 !important;
  cursor: pointer;
  box-shadow: none !important;
  display: grid;
  place-items: center;
}

.lpai-chatbot__button svg {
  display: block !important;
  width: 54px !important;
  height: 54px !important;
  max-width: none !important;
  max-height: none !important;
  color: #073f46 !important;
  overflow: visible;
  flex: 0 0 54px;
}

.lpai-chatbot__button img,
.lpai-chatbot__mark img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  display: block;
}

.lpai-chatbot__teaser {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(286px, calc(100vw - 96px));
  border: 1px solid #d6e2dd;
  border-radius: 8px;
  background: #fff;
  color: #17211d;
  box-shadow: 0 14px 35px rgba(20, 32, 28, .18);
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
}

.lpai-chatbot__teaser span {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.lpai-chatbot__teaser strong {
  display: inline-block;
  margin-top: 6px;
  color: var(--lpai-accent, #0f7a5f);
  font-size: 12px;
}

.lpai-chatbot--open .lpai-chatbot__teaser,
.lpai-chatbot--teaser-hidden .lpai-chatbot__teaser {
  display: none;
}

.lpai-chatbot__panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: min(390px, calc(100vw - 28px));
  height: min(620px, calc(100vh - 116px));
  background: #fff;
  border: 1px solid #dfe8e3;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(20, 32, 28, .26);
  display: none;
  grid-template-rows: auto 1fr auto;
}

.lpai-chatbot--open .lpai-chatbot__panel {
  display: grid;
}

.lpai-chatbot__header {
  min-height: 64px;
  padding: 14px 16px;
  background: #f4f8f6;
  border-bottom: 1px solid #dfe8e3;
  display: flex;
  align-items: center;
  gap: 12px;
}

.lpai-chatbot__mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--lpai-accent, #0f7a5f);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.lpai-chatbot__title {
  font-size: 15px;
  font-weight: 750;
  line-height: 1.2;
}

.lpai-chatbot__subtitle {
  font-size: 12px;
  color: #5d6b65;
  margin-top: 2px;
}

.lpai-chatbot__close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  color: #33413b;
}

.lpai-chatbot__reset {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border: 1px solid #cfe1db;
  border-radius: 8px;
  background: #fff;
  color: #073f46;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.lpai-chatbot__reset span {
  display: block;
  color: #073f46;
  font-size: 23px;
  font-weight: 700;
  line-height: 1;
}

.lpai-chatbot__reset:hover {
  background: #e9f5f1;
}

.lpai-chatbot__messages {
  padding: 16px;
  overflow-y: auto;
  background: #fbfcfb;
}

.lpai-chatbot__msg {
  max-width: 86%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.lpai-chatbot__msg--assistant {
  background: #edf5f1;
  border: 1px solid #d8e9e1;
}

.lpai-chatbot__msg--user {
  background: var(--lpai-accent, #0f7a5f);
  color: #fff;
  margin-left: auto;
}

.lpai-chatbot__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 14px;
}

.lpai-chatbot__quick button {
  border: 1px solid #cfdcd6;
  border-radius: 999px;
  background: #fff;
  color: #26342f;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 12px;
}

.lpai-chatbot__links {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.lpai-chatbot__links a,
.lpai-chatbot__links button {
  display: block;
  width: 100%;
  border: 1px solid #c6d8d0;
  border-radius: 8px;
  background: #fff;
  color: #123b31;
  padding: 8px 10px;
  text-decoration: none;
  font-weight: 700;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.lpai-chatbot__links a:hover,
.lpai-chatbot__links button:hover {
  border-color: var(--lpai-accent, #0f7a5f);
}

.lpai-chatbot__form {
  padding: 12px;
  border-top: 1px solid #dfe8e3;
  background: #fff;
  display: flex;
  gap: 8px;
}

.lpai-chatbot__input {
  min-width: 0;
  flex: 1;
  min-height: 42px;
  max-height: 100px;
  resize: none;
  border: 1px solid #cdd9d3;
  border-radius: 8px;
  padding: 10px 11px;
  font: inherit;
  font-size: 14px;
  outline: none;
}

.lpai-chatbot__input:focus {
  border-color: var(--lpai-accent, #0f7a5f);
  box-shadow: 0 0 0 3px rgba(15, 122, 95, .14);
}

.lpai-chatbot__send {
  width: 44px;
  height: 42px;
  border: 2px solid #0f7a5f !important;
  border-radius: 8px;
  background: #eef8f4 !important;
  color: #073f46 !important;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow: none;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}

.lpai-chatbot__send span {
  display: block !important;
  color: #073f46 !important;
  font-family: Arial, sans-serif !important;
  font-size: 29px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  transform: translateX(1px);
}

.lpai-chatbot__send:hover {
  transform: translateY(-1px);
  background: #eef8f4 !important;
  box-shadow: 0 6px 14px rgba(7, 63, 70, .12);
}

.lpai-chatbot__send:disabled {
  opacity: .55;
  cursor: wait;
}

.lpai-chatbot__form--stopped {
  opacity: .72;
}

.lpai-chatbot__form--stopped .lpai-chatbot__input,
.lpai-chatbot__form--stopped .lpai-chatbot__send {
  cursor: not-allowed;
}

@media (max-width: 560px) {
  .lpai-chatbot {
    right: 14px;
    bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  }

  .lpai-chatbot__panel {
    position: fixed;
    right: 8px;
    left: 8px;
    bottom: calc(164px + env(safe-area-inset-bottom, 0px));
    top: auto;
    width: auto;
    height: min(460px, calc(100vh - 190px));
    height: min(460px, calc(100dvh - 190px));
    max-height: 64dvh;
    border-radius: 7px;
    box-shadow: 0 14px 40px rgba(20, 32, 28, .2);
  }

  .lpai-chatbot__button {
    width: 44px;
    height: 44px;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .lpai-chatbot__button svg {
    width: 44px !important;
    height: 44px !important;
    flex-basis: 44px;
  }

  .lpai-chatbot__header {
    min-height: 50px;
    padding: 8px 10px;
    gap: 8px;
  }

  .lpai-chatbot__mark {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    font-size: 13px;
    flex: 0 0 30px;
  }

  .lpai-chatbot__title {
    font-size: 13px;
    line-height: 1.15;
  }

  .lpai-chatbot__subtitle {
    font-size: 10px;
    line-height: 1.2;
    margin-top: 1px;
  }

  .lpai-chatbot__reset,
  .lpai-chatbot__close {
    width: 30px;
    height: 30px;
    border-radius: 6px;
  }

  .lpai-chatbot__reset span {
    font-size: 19px;
  }

  .lpai-chatbot__messages {
    padding: 10px;
  }

  .lpai-chatbot__msg {
    max-width: 94%;
    margin-bottom: 8px;
    padding: 8px 9px;
    font-size: 13px;
    line-height: 1.38;
    border-radius: 7px;
  }

  .lpai-chatbot__quick {
    display: grid;
    gap: 6px;
    margin: 2px 0 8px;
  }

  .lpai-chatbot__quick button {
    width: 100%;
    border-radius: 7px;
    padding: 8px 9px;
    font-size: 11px;
    line-height: 1.25;
    text-align: left;
  }

  .lpai-chatbot__links {
    gap: 6px;
    margin-top: 8px;
  }

  .lpai-chatbot__links a,
  .lpai-chatbot__links button {
    padding: 7px 9px;
    border-radius: 7px;
    font-size: 12px;
  }

  .lpai-chatbot__form {
    padding: 8px;
    gap: 6px;
  }

  .lpai-chatbot__input {
    min-height: 36px;
    max-height: 72px;
    padding: 8px 9px;
    font-size: 13px;
  }

  .lpai-chatbot__send {
    width: 38px;
    height: 36px;
    border-radius: 7px;
  }

  .lpai-chatbot__send span {
    font-size: 24px !important;
  }

  .lpai-chatbot__teaser {
    bottom: 56px;
    width: min(250px, calc(100vw - 84px));
    padding: 9px 10px;
  }

  .lpai-chatbot__teaser span {
    font-size: 12px;
  }
}
