/* ==========================================================================
   Live chat relay (/chat, and the "Chat" tab on a server's own listing page)
   --------------------------------------------------------------------------
   Added with src/views/chat.js and src/services/chat.js. A message list is a
   different shape from a review or a request reply · shorter lines, a lot
   more of them, no rich body · so this gets its own small block rather than
   being squeezed into reviews.css's primitives.
   ========================================================================== */

.chat-panel {
  padding: 16px;
}

.chat-filter {
  margin: 0 0 16px;
}

.chat-filter select {
  max-width: 260px;
}

.chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 520px;
  overflow-y: auto;
}

.chat-msg {
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
}

.chat-msg:hover {
  background: var(--panel-2);
  border-color: var(--border-soft);
}

.chat-msg-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}

.chat-msg-user {
  color: var(--text);
}

.chat-anon {
  color: var(--muted);
  font-style: italic;
}

.chat-msg-server {
  color: var(--cyan);
  text-decoration: none;
  font-size: 12px;
}

.chat-msg-server:hover {
  text-decoration: underline;
}

.chat-msg-time {
  font-size: 12px;
  margin-left: auto;
}

.chat-msg-body {
  margin: 2px 0 0;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-msg-report {
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  opacity: 0;
  transition: opacity .15s;
}

.chat-msg:hover .chat-msg-report,
.chat-msg-report:focus {
  opacity: 1;
}

.chat-msg-report:hover {
  color: var(--danger);
  text-decoration: underline;
}

.chat-empty,
.chat-empty-note {
  padding: 12px 4px;
}

.chat-servers {
  margin-top: 16px;
}

.chat-server-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-server-list li a {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
}

.chat-server-list li a:hover {
  border-color: var(--accent);
}

.chat-report-card {
  max-width: 640px;
  margin: 32px auto;
}

.chat-report-quote {
  margin: 12px 0;
  padding: 10px 14px;
  border-left: 3px solid var(--border);
  color: var(--muted);
  font-style: italic;
}

/* New rows the poller inserts, briefly highlighted so a page left open shows
   life without the whole list re-flowing attention onto itself. */
.chat-msg.is-new {
  animation: chat-flash 2s ease-out;
}

@keyframes chat-flash {
  from { background: color-mix(in srgb, var(--accent) 18%, transparent); }
  to { background: transparent; }
}
