/* Стил за /chat — допълва Tailwind, не го замества.
   Цветовете следват палитрата на сайта: slate-950 фон, teal акцент. */

.chat-root {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* --- лог на разговора ------------------------------------------------------ */

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 18rem;
  max-height: 60vh;
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid rgb(30 41 59); /* slate-800 */
  border-radius: 0.75rem;
  background: rgb(2 6 23 / 0.6); /* slate-950/60 */
  scroll-behavior: smooth;
}

.chat-log:empty::before {
  content: "Задай първия си въпрос.";
  color: rgb(100 116 139); /* slate-500 */
  font-size: 0.875rem;
}

.chat-msg {
  display: flex;
}

.chat-msg--user {
  justify-content: flex-end;
}

.chat-msg__body {
  max-width: 85%;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg--user .chat-msg__body {
  background: rgb(13 148 136); /* teal-600 */
  color: white;
  border-bottom-right-radius: 0.25rem;
}

.chat-msg--assistant .chat-msg__body {
  background: rgb(30 41 59); /* slate-800 */
  color: rgb(226 232 240); /* slate-200 */
  border-bottom-left-radius: 0.25rem;
}

/* --- цитати ---------------------------------------------------------------- */

.chat-sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
}

.chat-sources__label {
  font-size: 0.75rem;
  color: rgb(148 163 184); /* slate-400 */
  margin-right: 0.25rem;
}

.chat-chip {
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: rgb(20 184 166 / 0.15); /* teal-500/15 */
  border: 1px solid rgb(20 184 166 / 0.4);
  color: rgb(94 234 212); /* teal-300 */
}

/* --- статус ---------------------------------------------------------------- */

.chat-status {
  min-height: 1.25rem;
  font-size: 0.8125rem;
  color: rgb(148 163 184); /* slate-400 */
}

.chat-status--warn {
  color: rgb(251 191 36); /* amber-400 */
}

.chat-status--error {
  color: rgb(248 113 113); /* red-400 */
}

/* --- форма ----------------------------------------------------------------- */

.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.chat-input {
  flex: 1;
  resize: none;
  max-height: 8rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgb(51 65 85); /* slate-700 */
  background: rgb(15 23 42); /* slate-900 */
  color: rgb(241 245 249); /* slate-100 */
  font-size: 0.9375rem;
  line-height: 1.5;
}

.chat-input:focus {
  outline: none;
  border-color: rgb(20 184 166); /* teal-500 */
  box-shadow: 0 0 0 3px rgb(20 184 166 / 0.15);
}

.chat-input:disabled {
  opacity: 0.6;
}

.chat-btn {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.chat-btn--send {
  background: rgb(13 148 136); /* teal-600 */
  color: white;
}

.chat-btn--send:hover:not(:disabled) {
  background: rgb(20 184 166); /* teal-500 */
}

.chat-btn--send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-btn--stop {
  background: rgb(51 65 85); /* slate-700 */
  color: rgb(226 232 240);
}

.chat-btn--stop:hover {
  background: rgb(71 85 105); /* slate-600 */
}

.chat-hint {
  font-size: 0.75rem;
  color: rgb(71 85 105); /* slate-600 */
  text-align: right;
}

.hidden {
  display: none !important;
}
