/* css/chat.css — вкладка «Чат» (зеркало ленты бота) */

.chat-view {
  grid-area: 1 / 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-transcript {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 14px 14px 10px;
  scrollbar-width: thin;
}

.chat-row {
  display: flex;
  margin: 6px 0;
}

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

.chat-bubble {
  max-width: min(78%, 680px);
  padding: 9px 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14.5px;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow);
}

.chat-row.user .chat-bubble {
  background: var(--user);
  border-color: transparent;
}

.chat-meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

.chat-row.user .chat-meta {
  text-align: right;
}

.chat-img {
  max-width: min(78%, 480px);
  margin: 6px 0;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.chat-empty {
  margin: 30px auto;
  max-width: 260px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.chat-activity {
  margin: 0 14px 6px;
  padding: 7px 11px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.chat-activity-line + .chat-activity-line {
  margin-top: 2px;
}

.chat-composer {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0));
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.chat-composer textarea {
  flex: 1 1 auto;
  min-height: 40px;
  max-height: 160px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  resize: none;
  font-size: 14.5px;
}

.chat-composer textarea:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.chat-send {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
}

.chat-send:active {
  transform: scale(0.94);
}

.chat-down {
  position: absolute;
  right: 18px;
  bottom: 74px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.chat-down:active {
  transform: scale(0.92);
}
