.chery-local-chat {
  font-family: HarmonyOS_Sans, Arial, sans-serif;
  position: fixed;
  right: clamp(12px, 2vw, 28px);
  bottom: clamp(12px, 2vw, 28px);
  z-index: 999999;
}

.chery-local-chat__button {
  border: none;
  border-radius: 999px;
  background: #a4896c;
  color: #ffffff;
  padding: clamp(12px, 1.2vw, 15px) clamp(18px, 2vw, 24px);
  font-size: clamp(14px, 1vw, 16px);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

.chery-local-chat__button:hover,
.chery-local-chat__button:focus {
  background: #a4896c;
  color: #000000;
}

.chery-local-chat__window {
  display: none;
  width: min(390px, calc(100vw - 24px));
  height: min(640px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  background: #ffffff;
  border-radius: clamp(16px, 2vw, 22px);
  overflow: hidden;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.24);
}

.chery-local-chat.is-open .chery-local-chat__window {
  display: flex;
  flex-direction: column;
}

.chery-local-chat.is-open .chery-local-chat__button {
  display: none;
}

.chery-local-chat__header {
  background: #2f2f2c;
  color: #ffffff;
  padding: clamp(14px, 1.6vw, 18px);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.chery-local-chat__header strong {
  display: block;
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.2;
}

.chery-local-chat__header span {
  display: block;
  margin-top: 5px;
  font-size: clamp(12px, 1vw, 13px);
  line-height: 1.35;
  opacity: 0.85;
}

.chery-local-chat__close {
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: clamp(26px, 3vw, 30px);
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.chery-local-chat__messages {
  flex: 1;
  min-height: 0;
  padding: clamp(12px, 1.4vw, 16px);
  overflow-y: auto;
  background: #f7f7f5;
}

.chery-local-chat__message {
  max-width: min(86%, 520px);
  padding: clamp(10px, 1.1vw, 12px) clamp(12px, 1.3vw, 14px);
  margin-bottom: 10px;
  border-radius: 16px;
  font-size: clamp(14px, 1vw, 15px);
  line-height: 1.45;
  color: #343434;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chery-local-chat__message--bot {
  background: #ffffff;
  margin-right: auto;
}

.chery-local-chat__message--user {
  background: #a4896c;
  color: #ffffff;
  margin-left: auto;
}

.chery-local-chat__suggestions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 14px;
  background: #ffffff;
  scrollbar-width: thin;
}

.chery-local-chat__suggestions button {
  white-space: nowrap;
  border: 1px solid rgba(164, 137, 108, 0.35);
  background: #ffffff;
  color: #343434;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: clamp(12px, 0.9vw, 13px);
  cursor: pointer;
}

.chery-local-chat__form {
  display: flex;
  gap: 8px;
  padding: clamp(10px, 1.3vw, 14px);
  background: #ffffff;
  border-top: 1px solid #eeeeee;
}

.chery-local-chat__form input {
  flex: 1;
  min-width: 0;
  border: 1px solid #dddddd;
  border-radius: 999px;
  padding: 12px 14px;
  font-size: clamp(14px, 1vw, 15px);
  color: #343434;
  outline: none;
}

.chery-local-chat__form input:focus {
  border-color: #a4896c;
}

.chery-local-chat__form button {
  flex: 0 0 auto;
  border: none;
  border-radius: 999px;
  background: #a4896c;
  color: #ffffff;
  padding: 0 clamp(14px, 1.4vw, 18px);
  font-size: clamp(13px, 1vw, 14px);
  cursor: pointer;
}

.chery-local-chat__link {
  display: inline-block;
  margin-top: 9px;
  color: #a4896c;
  font-weight: 700;
  text-decoration: none;
}

.chery-local-chat__link:hover,
.chery-local-chat__link:focus,
.chery-local-chat a:hover,
.chery-local-chat a:focus {
  color: #a4896c;
  text-decoration: underline;
}

@media (max-width: 480px) {
  .chery-local-chat {
    right: 10px;
    bottom: 10px;
    left: 10px;
  }

  .chery-local-chat__button {
    margin-left: auto;
    display: block;
  }

  .chery-local-chat__window {
    width: 100%;
    height: min(620px, calc(100dvh - 20px));
    max-height: calc(100dvh - 20px);
    border-radius: 16px;
  }

  .chery-local-chat__form {
    gap: 6px;
  }

  .chery-local-chat__form button {
    padding: 0 13px;
  }
}

@media (max-width: 360px) {
  .chery-local-chat__header span {
    display: none;
  }

  .chery-local-chat__form {
    flex-direction: column;
  }

  .chery-local-chat__form button {
    min-height: 42px;
  }
}

@media (max-height: 560px) {
  .chery-local-chat__window {
    height: calc(100dvh - 20px);
  }

  .chery-local-chat__suggestions {
    display: none;
  }

  .chery-local-chat__header {
    padding: 12px 14px;
  }
}

@media (min-width: 900px) {
  .chery-local-chat__window {
    width: min(420px, calc(100vw - 48px));
  }
}

@media (min-width: 1600px) {
  .chery-local-chat__window {
    width: 440px;
    height: 680px;
  }
}