.chats-msg-row:hover .chats-msg-actions { opacity: 1; }
.chats-msg-actions { opacity: 0; transition: opacity 0.15s; }
.chats-channel-item.active { background: rgba(255,106,18,0.12); }
.chats-channel-item.active .chats-ch-name { color: #ff6a12; font-weight: 700; }
.chats-channel-item:hover:not(.active) { background: rgba(255,255,255,0.04); }
.chats-msg-deleted { font-style: italic; color: #6b7280; }
.chats-msg-edited { font-size: 10px; color: #6b7280; margin-left: 4px; }
.chats-attachment-preview-card {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 100%;
  padding: 0.5rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem;
  background: rgba(19,21,23,0.8);
}
.chats-attachment-preview-thumb {
  width: 4rem;
  height: 4rem;
  border-radius: 0.5rem;
  object-fit: cover;
  flex-shrink: 0;
}
.chats-attachment-preview-name { max-width: 240px; }
.chats-attachment-img {
  display: block;
  max-width: 100%;
  max-height: 20rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem;
  object-fit: contain;
  cursor: zoom-in;
  transition: border-color 0.15s, opacity 0.15s;
}
.chats-attachment-img:hover { border-color: rgba(255,106,18,0.45); opacity: 0.92; }
.chats-attachment-lightbox {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
}
.chats-attachment-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255,255,255,0.1);
  transition: background 0.15s;
}
.chats-attachment-lightbox-close:hover { background: rgba(255,255,255,0.2); }
.chats-attachment-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 0.75rem;
  object-fit: contain;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.55);
}

/* Markdown rendering */
.chats-markdown { font-size: 0.875rem; color: #e2e8f0; line-height: 1.6; }
.chats-markdown p { margin: 0 0 0.5em; }
.chats-markdown p:last-child { margin-bottom: 0; }
.chats-markdown h1, .chats-markdown h2, .chats-markdown h3,
.chats-markdown h4, .chats-markdown h5, .chats-markdown h6 {
  font-weight: 700; color: #fdfffd; margin: 0.75em 0 0.35em;
}
.chats-markdown h1 { font-size: 1.1rem; }
.chats-markdown h2 { font-size: 1rem; }
.chats-markdown h3 { font-size: 0.9rem; }
.chats-markdown strong { font-weight: 700; color: #fdfffd; }
.chats-markdown em { font-style: italic; color: #cbd5e1; }
.chats-markdown code {
  font-family: ui-monospace, monospace; font-size: 0.8rem;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px; padding: 0.1em 0.4em; color: #ff6a12;
}
.chats-markdown pre {
  background: #0d0f11; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 0.85rem 1rem; overflow-x: auto;
  margin: 0.5em 0;
}
.chats-markdown pre code {
  background: none; border: none; padding: 0;
  color: #94a3b8; font-size: 0.8rem;
}
.chats-markdown ul, .chats-markdown ol {
  padding-left: 1.25rem; margin: 0.35em 0;
}
.chats-markdown ul { list-style: disc; }
.chats-markdown ol { list-style: decimal; }
.chats-markdown li { margin: 0.15em 0; }
.chats-markdown blockquote {
  border-left: 3px solid #ff6a12; padding-left: 0.75rem;
  margin: 0.5em 0; color: #94a3b8; font-style: italic;
}
.chats-markdown a { color: #ff6a12; text-decoration: underline; }
.chats-markdown a:hover { color: #ff9a44; }
.chats-markdown hr { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 0.75em 0; }
.chats-markdown table { border-collapse: collapse; width: 100%; margin: 0.5em 0; font-size: 0.8rem; }
.chats-markdown th, .chats-markdown td { border: 1px solid rgba(255,255,255,0.1); padding: 0.35rem 0.6rem; text-align: left; }
.chats-markdown th { background: rgba(255,255,255,0.05); font-weight: 700; color: #fdfffd; }

/* Typing indicator dots */
.chats-typing-dots { display: inline-flex; gap: 2px; align-items: center; margin-left: 2px; }
.chats-typing-dots span {
  display: block; width: 3px; height: 3px;
  background: currentColor; border-radius: 50%;
  animation: chats-dot 1.2s infinite ease-in-out;
}
.chats-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.chats-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chats-dot {
  0%, 60%, 100% { opacity: 0.2; transform: translateY(0); }
  30%            { opacity: 1;   transform: translateY(-2px); }
}

/* Step bubble */
.chats-step-tool {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: #8b93a1; line-height: 1.6;
}
.chats-step-tool .material-icons { font-size: 11px; color: #6b7280; }
.chats-step-tool.chats-step-tool-active { color: #ff6a12; font-weight: 600; }
.chats-step-tool.chats-step-tool-active .material-icons { color: #ff6a12; }

@keyframes chats-avatar-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,106,18,0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(255,106,18,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,106,18,0); }
}
.chats-avatar-pulse { animation: chats-avatar-pulse 0.6s ease-out; }
