#chat-widget-mount {
  width: min(720px, 100%);
  margin: 28px auto 0;
  text-align: left;
}

.faq-ai .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.faq-chat-note {
  max-width: 520px;
  margin: 20px auto 0;
  color: rgba(255, 255, 255, 0.7);
}

.faq-ai {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background: rgba(7, 7, 14, 0.72);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(18px);
}

.faq-ai-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(110deg, rgba(255, 157, 136, 0.14), rgba(185, 156, 255, 0.12));
}

.faq-ai-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  flex: 0 0 40px;
}

.faq-ai-avatar .dog-emoji {
  width: 36px;
  height: 36px;
}

.faq-ai-header strong,
.faq-ai-header small {
  display: block;
}

.faq-ai-header small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.56);
}

.faq-ai-reset {
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 8px 10px;
}

.faq-ai-messages {
  display: flex;
  min-height: 250px;
  max-height: 440px;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 18px;
}

.faq-ai-message {
  max-width: 82%;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px 16px 16px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.55;
  padding: 11px 13px;
  white-space: pre-wrap;
}

.faq-ai-message.assistant {
  white-space: normal;
}

.faq-ai-message.assistant > :first-child {
  margin-top: 0;
}

.faq-ai-message.assistant > :last-child {
  margin-bottom: 0;
}

.faq-ai-message.assistant p,
.faq-ai-message.assistant ul {
  margin: 0.65em 0;
}

.faq-ai-message.assistant h1,
.faq-ai-message.assistant h2,
.faq-ai-message.assistant h3,
.faq-ai-message.assistant h4,
.faq-ai-message.assistant h5,
.faq-ai-message.assistant h6 {
  margin: 0.9em 0 0.4em;
  background: none;
  color: #fff;
  font-size: 1.05rem;
  line-height: 1.25;
  -webkit-text-fill-color: initial;
}

.faq-ai-message.assistant code {
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
  color: #ffd2c7;
  padding: 0.12em 0.35em;
}

.faq-ai-message.assistant a {
  color: #ffc3b4;
  text-underline-offset: 3px;
}

.faq-ai-message.assistant a::after {
  content: " ↗";
  display: inline-block;
  font-size: 0.82em;
  font-weight: 900;
}

.faq-table-wrap {
  max-width: 100%;
  margin: 0.8em 0;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
}

.faq-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(0, 0, 0, 0.16);
  font-size: 0.85rem;
}

.faq-table-wrap th,
.faq-table-wrap td {
  min-width: 130px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.faq-table-wrap th {
  background: rgba(191, 168, 255, 0.13);
  color: #fff;
}

.faq-table-wrap th:last-child,
.faq-table-wrap td:last-child {
  border-right: 0;
}

.faq-table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.faq-ai-message.user {
  align-self: flex-end;
  border: 0;
  border-radius: 16px 6px 16px 16px;
  background: linear-gradient(135deg, #ffb7a5, #bfa8ff);
  color: #17131d;
  font-weight: 700;
}

.faq-ai-message.pending {
  color: rgba(255, 255, 255, 0.56);
  font-style: italic;
}

.faq-ai-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px;
}

.faq-ai-form textarea {
  width: 100%;
  min-height: 46px;
  max-height: 120px;
  resize: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.24);
  color: #fff;
  font: inherit;
  line-height: 1.4;
  outline: none;
  padding: 12px 13px;
}

.faq-ai-form textarea:focus {
  border-color: rgba(191, 168, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(191, 168, 255, 0.1);
}

.faq-ai-form button {
  width: 48px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #ffb7a5, #bfa8ff);
  color: #17131d;
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 900;
}

.faq-ai-form button:disabled,
.faq-ai-form textarea:disabled {
  cursor: wait;
  opacity: 0.55;
}

.faq-ai-note {
  margin: 0;
  padding: 0 14px 13px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.72rem;
  text-align: center;
}

.faq-ai-note a {
  color: #c9b6ff;
}

@media (max-width: 600px) {
  .faq-ai-messages {
    min-height: 220px;
    padding: 12px;
  }

  .faq-ai-message {
    max-width: 90%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-ai * {
    scroll-behavior: auto !important;
  }
}
