/* ── THREAD: header, mensajes, burbujas ──────────────────────────── */
.thread-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  background: var(--white);
  min-height: 56px;
}
.th-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--purple);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.th-info { flex: 1; min-width: 0; }
.th-name { font-weight: 600; color: var(--ink); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.th-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

.hbtn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
  flex-shrink: 0;
}
.hbtn:hover { background: var(--surface); color: var(--ink); }
.hbtn-text {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  transition: all 0.1s;
}
.hbtn-text:hover { border-color: var(--purple); color: var(--purple); }
.hbtn-text.primary { background: var(--purple); color: white; border-color: var(--purple); }
.hbtn-text.primary:hover { opacity: 0.9; }
.hbtn-text.danger { border-color: var(--danger); color: var(--danger); }

/* Mensajes */
.thread-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.thread-messages::-webkit-scrollbar { width: 3px; }
.thread-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.msg-row { display: flex; align-items: flex-end; gap: 6px; }
.msg-row.user { justify-content: flex-end; }
.msg-row.ele, .msg-row.agent, .msg-row.note { justify-content: flex-start; }
.msg-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  margin-bottom: 2px;
}
.msg-avatar.ele    { background: var(--teal); color: white; }
.msg-avatar.agent  { background: var(--purple); color: white; }
.msg-avatar.spacer { background: transparent; }
.msg-bubble {
  max-width: 68%;
  padding: 9px 13px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}
.msg-bubble.user  { background: var(--purple); color: white; border-radius: 16px 16px 4px 16px; }
.msg-bubble.ele   { background: var(--surface); color: var(--body); border-radius: 16px 16px 16px 4px; }
.msg-bubble.agent { background: var(--white); border: 1px solid var(--purple); color: var(--body); border-radius: 16px 16px 16px 4px; }
.msg-bubble.note  { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.3); color: var(--body); border-radius: 16px 16px 16px 4px; }
.msg-time { font-size: 10px; color: var(--muted); margin-bottom: 4px; flex-shrink: 0; }
.note-label { font-size: 11px; color: var(--warning); font-weight: 600; display: block; margin-bottom: 3px; }

.ts-sep { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.ts-sep::before, .ts-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.ts-sep span { font-size: 11px; color: var(--muted); white-space: nowrap; }
