/* Сообщения: окно (С18), списки и переписка (С22, С23, С32, С33) */
.msg-sheet { max-width: 520px; }
.msg-to { display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 16px; }
.msg-to__reply { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; text-align: right; }
.msg-chips { margin: 8px 0 14px; }
.msg-chips .chip { min-height: 40px; }
.msg-attach { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px 8px 12px; margin: -6px 0 16px; font-size: 14px; }
.msg-attach span { flex: 1; min-width: 0; }
.msg-attach .icon { color: var(--primary); flex: none; }
.msg-attach .sheet__close { margin: 0; width: 36px; height: 36px; }
.msg-phone-row { display: flex; gap: 8px; }
.msg-phone-row .input { flex: 1; min-width: 0; }
.msg-phone { margin: 0; display: flex; align-items: center; gap: 8px; }
.msg-code { max-width: 160px; font-size: 22px; letter-spacing: .3em; text-align: center; }
.msg-me { margin: -6px 0 14px; }
.msg-send { display: flex; gap: 14px; align-items: center; }
.msg-send p { margin: 0; }
.msg-send .btn { flex: none; min-width: 140px; }
.msg-done { text-align: center; }
.msg-done__icon { margin: 0 auto 14px; width: 64px; height: 64px; background: var(--ok-soft); color: var(--ok); }
.msg-done h1 { font-size: 26px; margin-bottom: 8px; }

.msg-list { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.msg-list li { border-top: 1px solid var(--line); }
.msg-list li:first-child { border-top: 0; }
.msg-list a { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 14px 18px; color: var(--text); }
.msg-list a:hover { background: #FAFBFD; text-decoration: none; }
.msg-list a[aria-current] { background: var(--primary-soft); }
.msg-list__top { display: flex; justify-content: space-between; gap: 10px; grid-column: 1; }
.msg-list__subj { font-size: 14px; grid-column: 1; }
.msg-list__last { font-size: 14px; grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-list .count-badge, .msg-list .badge, .msg-list .msg-wait { grid-column: 2; align-self: center; justify-self: end; }
.msg-wait { font-size: 12px; font-weight: 800; border-radius: 6px; padding: 2px 8px; white-space: nowrap; background: var(--line); color: var(--muted); }
.msg-wait--yellow { background: var(--warn-soft); color: var(--warn); }
.msg-wait--red { background: var(--error-soft); color: var(--error); }

.msg-split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.msg-split__list { max-height: 78vh; overflow-y: auto; }
.msg-chat { display: flex; flex-direction: column; min-height: 60vh; overflow: hidden; }
.msg-chat__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.msg-chat__title { flex: 1; min-width: 0; }
.msg-chat__title a { color: var(--text); }
.msg-back { display: none; width: 40px; height: 40px; place-items: center; color: var(--text); margin-left: -8px; }
.msg-feed { list-style: none; margin: 0; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; background: #FAFBFD; }
.msg { display: flex; flex-direction: column; max-width: 78%; }
.msg--mine { align-self: flex-end; align-items: flex-end; }
.msg--their { align-self: flex-start; }
.msg__bubble { padding: 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.msg--mine .msg__bubble { background: var(--primary-soft); border-color: #CFE0FB; }
.msg__bubble p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.msg__file { display: flex; gap: 8px; align-items: center; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--text); }
.msg__time { font-size: 12px; color: var(--muted-2); margin-top: 3px; }
.msg-review { margin: 0; padding: 10px 16px 0; font-weight: 700; }
.msg-quick { padding: 10px 16px 0; }
.msg-quick .chip { cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; }
.msg-reply { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 16px 14px; align-items: end; }
.msg-reply .textarea { min-height: 52px; }
.msg-reply__btns { display: flex; gap: 6px; }
@media (max-width: 860px) {
  .msg-send { flex-direction: column; align-items: stretch; }
  .msg-split { grid-template-columns: 1fr; }
  .msg-split .msg-split__list { display: none; }
  .msg-back { display: grid; }
  .msg { max-width: 90%; }
  .msg-hide-sm { display: none; }
  .msg-to__reply { display: none; }
  .msg-phone-row { flex-direction: column; }
}

/* Заявка на товар (С63) */
.msg-product { display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 16px; }
.msg-product img { border-radius: 8px; object-fit: cover; background: #fff; flex: none; }
.msg-product > div { min-width: 0; overflow-wrap: anywhere; }
.msg-qty .input { max-width: 200px; }
