.bgarc-chat {
  max-width: 900px;
  margin: 28px auto;
  border-radius: 22px;
  overflow: hidden;
  background: #fffaf2;
  border: 1px solid rgba(120, 71, 35, 0.18);
  box-shadow: 0 14px 34px rgba(72, 39, 15, 0.11);
  font-family: inherit;
}

.bgarc-chat * {
  box-sizing: border-box;
}

.bgarc-chat__head {
  padding: 24px;
  color: #fff;
  background: linear-gradient(135deg, #8b2f20, #d8842f);
}

.bgarc-chat__head h2 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 28px;
  line-height: 1.15;
}

.bgarc-chat__head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
}

.bgarc-chat__panel {
  padding: 22px;
}

.bgarc-chat__label {
  display: block;
  margin: 12px 0 7px;
  font-weight: 700;
  color: #432212;
}

.bgarc-chat__products,
.bgarc-chat__preferences,
.bgarc-chat__input {
  width: 100%;
  border: 1px solid rgba(92, 53, 24, 0.22);
  border-radius: 14px;
  background: #fff;
  color: #2c1b10;
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bgarc-chat__products {
  min-height: 110px;
  resize: vertical;
  padding: 14px;
}

.bgarc-chat__preferences,
.bgarc-chat__input {
  padding: 13px 14px;
}

.bgarc-chat__products:focus,
.bgarc-chat__preferences:focus,
.bgarc-chat__input:focus {
  border-color: #b9542a;
  box-shadow: 0 0 0 3px rgba(185, 84, 42, 0.14);
}

.bgarc-chat__messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 190px;
  max-height: 520px;
  overflow-y: auto;
  margin: 18px 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed rgba(92, 53, 24, 0.18);
}

.bgarc-chat__message {
  width: fit-content;
  max-width: min(760px, 92%);
  padding: 13px 15px;
  border-radius: 16px;
  white-space: normal;
  line-height: 1.55;
}

.bgarc-chat__message--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid rgba(92, 53, 24, 0.12);
  color: #2d2016;
}

.bgarc-chat__message--user {
  align-self: flex-end;
  background: #8b2f20;
  color: #fff;
}

.bgarc-chat__message--loading {
  opacity: 0.78;
}

.bgarc-chat__form {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.bgarc-chat__input {
  flex: 1;
}

.bgarc-chat__button {
  border: 0;
  border-radius: 14px;
  padding: 0 20px;
  min-width: 116px;
  background: #b94824;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.bgarc-chat__button:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.bgarc-chat__button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.bgarc-chat__notice {
  margin: 14px 0 0;
  padding: 11px 13px;
  border-radius: 12px;
  background: #fff3cd;
  color: #735100;
}

@media (max-width: 640px) {
  .bgarc-chat {
    margin: 18px 10px;
    border-radius: 18px;
  }

  .bgarc-chat__head,
  .bgarc-chat__panel {
    padding: 18px;
  }

  .bgarc-chat__head h2 {
    font-size: 23px;
  }

  .bgarc-chat__form {
    flex-direction: column;
  }

  .bgarc-chat__button {
    min-height: 46px;
  }
}
