/* Обсуждение наряда (w0.1): лента комментариев с файлами в карточке наряда. Макет-ориентир DealDiscussion. Только var(--…) токенов пакета, классы rd-chat-*. */

.rd-chat { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rd-chat *, .rd-chat *::before, .rd-chat *::after { box-sizing: border-box; }
.rd-chat button, .rd-chat textarea { font-family: inherit; }
.rd-chat-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rd-chat-note { margin: 0; font-size: var(--fs-meta); color: var(--text-muted); }

/* Лента: старые выше */
.rd-chat-feed { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.rd-chat-msg { display: flex; gap: 12px; padding: 8px 0; }
.rd-chat-msg + .rd-chat-msg { border-top: 1px solid var(--line); }
.rd-chat-msg__b { flex: 1; min-width: 0; }
.rd-chat-mh { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.rd-chat-mh b { font-size: var(--fs-body); font-weight: 600; color: var(--text-primary); }
.rd-chat-mh__t { font-size: var(--fs-label); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rd-chat-del { margin-left: auto; padding: 0; border: none; background: none; font-size: var(--fs-label); color: var(--text-muted); cursor: pointer; }
.rd-chat-del:hover, .rd-chat-del:focus-visible { color: var(--state-late-text); }
.rd-chat-tx { margin-top: 2px; font-size: var(--fs-body); line-height: 1.5; color: var(--text-body); white-space: pre-wrap; overflow-wrap: anywhere; }
.rd-chat-tx--gone { font-style: italic; color: var(--text-faint); }

/* Файлы строками: значок, имя, размер; щелчок — скачать */
.rd-chat-files { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.rd-chat-file { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 32px; padding: 4px 10px; border: none; border-radius: var(--r-chip); background: var(--bg-page); font-size: var(--fs-meta); color: var(--text-primary); text-align: left; cursor: pointer; }
.rd-chat-file:hover { background: var(--bg-hover); }
.rd-chat-file:focus-visible { outline: none; box-shadow: inset 0 0 0 1.5px var(--brand-blue); }
.rd-chat-file__i { display: inline-flex; color: var(--text-secondary); flex-shrink: 0; }
.rd-chat-file__n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-chat-file__s { flex-shrink: 0; font-size: var(--fs-label); color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Поле ввода */
.rd-chat-cmp { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.rd-chat-who { margin: 0; font-size: var(--fs-label); color: var(--text-muted); }
.rd-chat-box { border-radius: var(--r-button); background: var(--bg-page); padding: 8px 10px 6px; }
.rd-chat-box:focus-within { background: var(--bg-surface); box-shadow: inset 0 0 0 1.5px var(--brand-blue); }
.rd-chat-in { display: block; width: 100%; min-height: 44px; padding: 2px 2px; border: none; background: transparent; font-size: var(--fs-body); line-height: 1.45; color: var(--text-primary); resize: vertical; }
.rd-chat-in::placeholder { color: var(--text-faint); }
.rd-chat-in:focus, .rd-chat-in:focus-visible { outline: none; }
.rd-chat-tools { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.rd-chat-tl { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: none; border-radius: var(--r-chip); background: transparent; color: var(--text-secondary); cursor: pointer; }
.rd-chat-tl:hover { background: var(--bg-hover); }
.rd-chat-tl:focus-visible { outline: none; box-shadow: inset 0 0 0 1.5px var(--brand-blue); }
.rd-chat-hint { flex: 1; min-width: 0; font-size: var(--fs-label); color: var(--text-faint); }
.rd-chat-bad { margin: 0; font-size: var(--fs-meta); color: var(--state-late-text); }

/* Выбранные файлы до отправки */
.rd-chat-picked { display: flex; flex-direction: column; gap: 6px; }
.rd-chat-chips { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.rd-chat-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 28px; padding: 0 4px 0 10px; border-radius: var(--r-chip); background: var(--bg-page); font-size: var(--fs-meta); color: var(--text-primary); }
.rd-chat-chip__n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-chat-chip__x { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: none; border-radius: var(--r-chip); background: transparent; color: var(--text-muted); cursor: pointer; }
.rd-chat-chip__x:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Телефон: одна колонка, пальцевые цели, поле 16px без увеличения страницы */
@media (max-width: 767px) {
  .rd-chat-hint { display: none; }
  .rd-chat-tools { justify-content: space-between; }
  .rd-chat-tl { width: 44px; height: 44px; }
  .rd-chat-file { min-height: 44px; }
  .rd-chat-del { min-height: 32px; }
  .rd-card .rd-chat-in { min-height: 64px; font-size: 16px; }
}
