/* Чат потока, блок «Телеграм» в профиле, ожидание подтверждения входа. */

.chat-note{margin:22px 0 0;max-width:720px;padding:14px 16px;border-radius:var(--r-sm);background:var(--card);border:1px solid var(--line);
  color:var(--muted);font-size:15px}
.chat-note.on{border-color:rgba(61,214,140,.35);background:var(--green-wash);color:var(--soft)}

.chat{margin-top:26px;display:flex;flex-direction:column;padding:0;overflow:hidden}
.chat-list{list-style:none;margin:0;padding:20px 22px;display:flex;flex-direction:column;gap:12px;
  max-height:min(62vh,640px);min-height:220px;overflow-y:auto;overscroll-behavior:contain}
.chat-empty{margin:0;padding:0 22px 20px;font-size:15px}
.msg{max-width:min(620px,86%);align-self:flex-start;background:var(--card-2);border:1px solid var(--line);
  border-radius:16px 16px 16px 6px;padding:10px 14px 12px}
.msg.mine{align-self:flex-end;background:var(--blue-wash);border-color:var(--blue-line);border-radius:16px 16px 6px 16px}
.msg.author{border-color:rgba(245,181,68,.4)}
.msg.author .msg-who{color:var(--amber)}
.msg.off{opacity:.45;border-style:dashed}
.msg-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;font-size:13px}
.msg-who{font-weight:700;color:var(--ink)}
.msg-who a{text-decoration:none}
.msg-who a:hover{text-decoration:underline}
.msg-src{font-size:12px;color:var(--blue-2)}
.msg-src.bad,.bad{color:var(--red)}
.msg-at{margin-left:auto;font-size:12px;color:var(--dim)}
.msg-body{margin-top:4px;font-size:15.5px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--soft)}
.msg-act{margin-top:6px}
.msg-btn{border:1px solid var(--line-2);background:rgba(255,255,255,.04);border-radius:8px;padding:3px 10px;font-size:12px;
  cursor:pointer;color:var(--muted)}
.msg-btn:hover{color:var(--ink)}

.chat-form{border-top:1px solid var(--line);padding:16px 22px 18px;display:flex;flex-direction:column;gap:10px;background:var(--card)}
textarea.input.chat-input{min-height:56px;max-height:220px;resize:vertical}
.chat-send{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}
.chat-send .error{margin-right:auto}
.chat-count{font-size:13px;color:var(--muted)}
.chat-count.over{color:var(--red)}
.chat-hint{margin:0;font-size:12px;color:var(--dim)}

/* кабинет: чат и справка о боте рядом */
.chat-cols{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:24px;align-items:start}
.chat-side{position:sticky;top:84px}
.chat-side .row{font-size:14px}
.chat-group{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-top:1px solid var(--line)}
.chat-group span{font-size:14px;overflow-wrap:anywhere}

/* профиль: Телеграм */
.tg-block{max-width:none}
.tg-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:12px}
.tg-block p{margin:0}
.tg-block .l-actions form{margin:0}

/* второй шаг входа */
.wait-line{display:flex;align-items:center;gap:12px;margin:22px 0 0;color:var(--muted);font-size:15px}
.wait-dot{width:12px;height:12px;border-radius:50%;background:var(--blue);box-shadow:0 0 0 0 rgba(90,135,255,.6);
  animation:wait-pulse 1.6s ease-out infinite}
@keyframes wait-pulse{0%{box-shadow:0 0 0 0 rgba(90,135,255,.6)}100%{box-shadow:0 0 0 14px rgba(90,135,255,0)}}

@media (max-width:980px){
  .chat-cols{grid-template-columns:1fr}
  .chat-side{position:static}
}
@media (max-width:640px){
  .chat-list{padding:16px 14px;max-height:66vh}
  .chat-form{padding:14px}
  .msg{max-width:92%}
  .chat-hint{display:none}
}
