/* =========================================================================
   Messages — private DM inbox + thread header.
   The message log and composer are shared with Chat (css/chat.css).
   ========================================================================= */

.dm-list {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.dm-list .empty { padding: var(--s-7) var(--s-4); }

.dm-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  min-height: 72px;
  padding: var(--s-3) var(--s-4);
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  text-align: left;
  color: inherit;
}
.dm-row:first-child { border-top: 0; }
.dm-row:hover { background: var(--surface-2); }
.dm-row:active { background: var(--surface-3); }

.dm-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dm-name { font-weight: 600; font-size: .97rem; }
.dm-last {
  color: var(--muted);
  font-size: .85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-row.unread .dm-name { font-weight: 700; }
.dm-row.unread .dm-last { color: var(--ink); font-weight: 600; }

.dm-meta {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.dm-time { color: var(--muted); font-size: .74rem; white-space: nowrap; }

.dm-unread {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--red);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

/* --------------------------------------------------------- thread header */

.dm-head { align-items: center; }

.dm-peer {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: none;
  padding: 4px;
  margin-left: -4px;
  border-radius: var(--r-sm);
  text-align: left;
  color: inherit;
}
.dm-peer:hover { background: var(--surface-2); }

.dm-peer-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dm-peer-name {
  font-weight: 700;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dm-peer-note { color: var(--muted); font-size: .76rem; }

/* ------------------------------------------------------ typing indicator

   The other party’s reply arrives over the thread listener, and
   this sits in the conversation's notice slot while they type. */

.dm-typing {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0;
  padding: 6px var(--s-3);
  font-size: .78rem;
  color: var(--muted);
}

.dm-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.dm-typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  opacity: .35;
  animation: dm-typing-bounce 1.1s infinite ease-in-out;
}
.dm-typing-dots i:nth-child(2) { animation-delay: .18s; }
.dm-typing-dots i:nth-child(3) { animation-delay: .36s; }

@keyframes dm-typing-bounce {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  .dm-typing-dots i { animation: none; opacity: .6; }
}
