.chats-msg-reaction {
  font-size: 13px;
  line-height: 1.2;
  padding: 2px 6px;
  border-radius: 10px;
  background: #232529;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  transition: background 0.15s, border-color 0.15s;
}
.chats-msg-reaction:hover { background: #2c3036; }
.chats-msg-reaction-mine {
  background: #3a2415;
  border-color: rgba(255, 106, 18, 0.25);
}
.chats-msg-highlight {
  background: rgba(255, 106, 18, 0.18) !important;
  transition: background 0.4s ease;
}
.chats-msg-pinned {
  box-shadow: inset 2px 0 0 #ff6a12;
}
.chats-pinned-bar-inner .line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chats-msg-search-hit .line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chats-delivery-status {
  font-size: 14px !important;
  vertical-align: middle;
  user-select: none;
}
.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-image-queue-wrap { max-width: 100%; }
.chats-image-queue-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chats-image-queue-item {
  position: relative;
  flex-shrink: 0;
}
.chats-image-queue-thumb {
  width: 4rem;
  height: 4rem;
  border-radius: 0.5rem;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.1);
}
.chats-image-queue-remove {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #131517;
  border: 1px solid rgba(255,255,255,0.15);
  color: #9ca3af;
  cursor: pointer;
}
.chats-image-queue-remove:hover { color: #f87171; border-color: rgba(248,113,113,0.4); }
#chats-main-panel.chats-drop-active {
  outline: 2px dashed rgba(255,106,18,0.55);
  outline-offset: -4px;
  background: rgba(255,106,18,0.04) !important;
}
.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; }

/* ─── Voice messages (#608) ─────────────────────────────────── */

.chats-voice {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 280px;
  padding: 0.4rem 0.55rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.chats-voice--expired {
  opacity: 0.75;
}
.chats-voice-play {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 106, 18, 0.15);
  color: #ff6a12;
  flex-shrink: 0;
  transition: background 0.15s;
}
.chats-voice-play:hover:not(:disabled) { background: rgba(255, 106, 18, 0.28); }
.chats-voice-play:disabled {
  background: rgba(107, 114, 128, 0.2);
  color: #6b7280;
  cursor: default;
}
.chats-voice-play .material-icons { font-size: 18px; }
.chats-voice-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 28px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.chats-voice-wave--live { cursor: default; }
.chats-voice-bar {
  flex: 1;
  min-width: 2px;
  max-width: 4px;
  border-radius: 9999px;
  background: #ff6a12;
  opacity: 0.45;
  align-self: center;
  transition: opacity 0.1s, background 0.1s;
}
.chats-voice-bar--played { opacity: 1; background: #ff8a3d; }
.chats-voice-bar--expired { background: #6b7280; opacity: 0.5; }
.chats-voice-time {
  font-size: 10px;
  color: #9ca3af;
  flex-shrink: 0;
  min-width: 4.5rem;
  text-align: right;
}
.chats-voice--expired .chats-voice-time { color: #6b7280; min-width: auto; }
.chats-voice-btn--active {
  color: #ff6a12 !important;
  background: rgba(255, 106, 18, 0.12);
}
.chats-voice-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #ef4444;
  flex-shrink: 0;
  animation: chats-voice-pulse 1s ease-in-out infinite;
}
@keyframes chats-voice-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.chats-voice-recording {
  padding: 0.6rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 106, 18, 0.25);
  background: rgba(19, 21, 23, 0.85);
}

/* Token ring (#673/#1083) — fills with 5h plan window, not context */
.lf-token-ring-fg {
  transition: stroke 0.25s ease, stroke-dashoffset 0.35s ease;
}
