.faq-chat {
  --faq-accent: #157b83;
  border: 1px solid #dce8eb;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  margin: 24px 0;
  box-shadow: 0 8px 28px rgba(22, 64, 76, .06);
  color: #263c46;
}
.faq-chat * { box-sizing: border-box; }
.faq-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid #dce8eb;
  background: #f4fafb;
}
.faq-chat__header strong { display: block; font-size: 18px; }
.faq-chat__header div > span { display: block; margin-top: 4px; font-size: 12px; color: #607782; }
.faq-chat__badge { border-radius: 20px; padding: 4px 10px; background: #e0f2f1; font-size: 12px; white-space: nowrap; color: #17686e; }
.faq-chat__messages {
  height: 400px;
  height: clamp(260px, 48vh, 480px);
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fafcfd;
}
.faq-chat__message { margin-bottom: 20px; max-width: 94%; }
.faq-chat__message:last-child { margin-bottom: 0; }
.faq-chat__message--user { margin-left: auto; }
.faq-chat__author { margin-bottom: 6px; color: #617581; font-size: 12px; }
.faq-chat__message--user .faq-chat__author { text-align: right; }
.faq-chat__body { padding: 12px 16px; border: 1px solid #e0e8ed; border-radius: 4px 14px 14px; background: #fff; overflow-wrap: anywhere; line-height: 1.75; }
.faq-chat__message--user .faq-chat__body { background: #e5f4f3; border-color: #d4eae7; border-radius: 14px 4px 14px 14px; white-space: pre-wrap; }
.faq-chat__body--plain { white-space: pre-wrap; }
.faq-chat .faq-chat__body > :first-child { margin-top: 0; }
.faq-chat .faq-chat__body > :last-child { margin-bottom: 0; }
.faq-chat .faq-chat__body p { margin: 8px 0; }
.faq-chat .faq-chat__body pre { overflow-x: auto; padding: 12px; margin: 10px 0; white-space: pre; }
.faq-chat .faq-chat__body code { white-space: pre-wrap; }
.faq-chat .faq-chat__body pre code { white-space: pre; }
.faq-chat .faq-chat__body table { display: block; max-width: 100%; overflow-x: auto; }
.faq-chat .faq-chat__body a { color: var(--faq-accent); text-decoration: underline; }
.faq-chat__form { padding: 18px 24px 12px; border-top: 1px solid #dce8eb; }
.faq-chat__form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.faq-chat__form textarea { display: block; width: 100%; min-height: 90px; max-height: 220px; resize: vertical; padding: 12px; border: 1px solid #ccd9de; border-radius: 8px; font: inherit; font-size: 14px; color: inherit; background: #fff; }
.faq-chat textarea:focus-visible, .faq-chat button:focus-visible, .faq-chat__messages:focus-visible { outline: 2px solid var(--faq-accent); outline-offset: 2px; }
.faq-chat__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.faq-chat__actions span { font-size: 12px; color: #647983; }
.faq-chat__actions button { border: 0; border-radius: 8px; padding: 9px 24px; background: var(--faq-accent); color: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.faq-chat__actions button:disabled { opacity: .65; cursor: wait; }
.faq-chat .faq-chat__status { margin: 8px 0 0; min-height: 22px; font-size: 13px; color: #617581; }
.faq-chat .faq-chat__status--error { color: #b43b35; }
.faq-chat__note { padding: 0 24px 18px; font-size: 12px; color: #647983; line-height: 1.6; }
@media (max-width: 600px) {
  .faq-chat { margin: 16px 0; border-radius: 12px; }
  .faq-chat__header, .faq-chat__messages, .faq-chat__form { padding: 16px; }
  .faq-chat__message { max-width: 98%; }
  .faq-chat__note { padding: 0 16px 16px; }
  .faq-chat__actions span { font-size: 11px; }
}
