.aifc-chat {
  border: 1px solid #d9dee7;
  border-radius: 8px;
  color: #1f2937;
  background: #ffffff;
  max-width: 760px;
  margin: 24px auto;
  padding: 24px;
}

.aifc-chat__header {
  margin-bottom: 16px;
}

.aifc-chat__title {
  font-size: 1.5rem;
  line-height: 1.4;
  margin: 0 0 8px;
}

.aifc-chat__lead,
.aifc-chat__notice p,
.aifc-chat__status {
  margin: 0;
}

.aifc-chat__notice {
  border-left: 4px solid #6b7280;
  background: #f6f7f9;
  margin: 0 0 18px;
  padding: 12px 14px;
  font-size: 0.92rem;
}

.aifc-chat__notice p + p {
  margin-top: 8px;
}

.aifc-chat__messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.aifc-message {
  border-radius: 8px;
  max-width: 88%;
  padding: 12px 14px;
}

.aifc-message p {
  margin: 0;
  white-space: pre-wrap;
}

.aifc-message--bot {
  align-self: flex-start;
  background: #eef2f7;
}

.aifc-message--user {
  align-self: flex-end;
  background: #e6f4ef;
}

.aifc-chat__form {
  display: grid;
  gap: 10px;
}

.aifc-chat--complete .aifc-chat__form,
.aifc-chat__form[hidden] {
  display: none !important;
}

.aifc-chat--final-pending .aifc-chat__label,
.aifc-chat--final-pending .aifc-chat__input,
.aifc-chat--final-pending .aifc-chat__actions {
  display: none !important;
}

.aifc-chat__label {
  font-weight: 700;
}

.aifc-chat__input {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #b8c0cc;
  border-radius: 8px;
  padding: 12px;
  font: inherit;
  resize: vertical;
}

.aifc-chat__input:focus {
  border-color: #2563eb;
  outline: 2px solid rgba(37, 99, 235, 0.18);
}

.aifc-chat__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.aifc-chat__count {
  color: #4b5563;
  font-size: 0.92rem;
}

.aifc-chat__button {
  border: 0;
  border-radius: 8px;
  background: #1f6feb;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 44px;
  padding: 10px 18px;
}

.aifc-chat__button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.aifc-chat__status {
  color: #4b5563;
  min-height: 1.5em;
}

.aifc-chat__waiting {
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #fbfcfe;
  overflow: hidden;
  padding: 12px 14px;
}

.aifc-chat__waiting[hidden] {
  display: none !important;
}

.aifc-chat__waiting-track {
  display: flex;
  gap: 18px;
  min-width: max-content;
  animation: aifc-waiting-slide 15s linear infinite;
}

.aifc-chat__waiting-track p {
  color: #374151;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
}

.aifc-chat__privacy {
  border-top: 1px solid #e5e7eb;
  color: #4b5563;
  font-size: 0.86rem;
  line-height: 1.7;
  margin: 10px 0 0;
  padding-top: 10px;
}

.aifc-chat__help {
  color: #4b5563;
  font-size: 0.84rem;
  line-height: 1.6;
  margin: 0;
}

@keyframes aifc-waiting-slide {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-45%);
  }
}

.aifc-result {
  border: 1px solid #c8d1df;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 18px;
}

.aifc-result__title {
  font-size: 1.25rem;
  margin: 0 0 10px;
}

.aifc-result__body {
  line-height: 1.9;
  margin: 0 0 14px;
  white-space: pre-wrap;
}

.aifc-result__notice {
  border-left: 4px solid #8a6d1d;
  background: #fff8e5;
  color: #4d3b10;
  font-size: 0.92rem;
  line-height: 1.7;
  margin: 0 0 12px;
  padding: 10px 12px;
}

.aifc-result__affiliate {
  margin: 12px 0;
}

.aifc-result__affiliate a {
  color: #1559c7;
  font-weight: 700;
}

.aifc-result__disclaimer {
  border-top: 1px solid #d9dee7;
  color: #4b5563;
  font-size: 0.9rem;
  margin: 14px 0 0;
  padding-top: 12px;
}

@media (max-width: 600px) {
  .aifc-chat {
    margin: 16px 0;
    padding: 16px;
  }

  .aifc-message {
    max-width: 100%;
  }

  .aifc-chat__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .aifc-chat__button {
    width: 100%;
  }
}
