/* Team messaging — boards, direct messages, threads, reactions. */

.msg-unread-badge {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  margin-left: 4px;
  border-radius: 100px;
  background: var(--accent-color);
  color: var(--text-inverse);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.msg-unread-badge[hidden] { display: none; }

.msg-inbox__row--unread td:first-child a { font-weight: 800; }

.msg-new-dm {
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 420px;
  margin-bottom: 12px;
}

/* ── Feed ─────────────────────────────────────────────────────────────── */
.msg-feed { max-width: 820px; }
.msg-feed__earlier { text-align: center; margin-bottom: 12px; }
.msg-list:not(:empty) + .msg-empty { display: none; }

.msg {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border: var(--border-width) solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-surface);
  margin-bottom: 10px;
}
.msg--mentions-me { border-left: 3px solid var(--accent-color); }
.msg--deleted { opacity: 0.7; }
.msg--reply {
  background: var(--bg-sunken);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.msg__avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-light);
  color: var(--accent-color);
  font-size: 12px;
  font-weight: 700;
}
.msg--reply .msg__avatar { width: 28px; height: 28px; font-size: 11px; }

.msg__main { flex: 1; min-width: 0; }
.msg__head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.msg__author { font-size: 14px; }
.msg__time { font-size: 12px; color: var(--text-muted); }

.msg__body { display: block; margin-top: 2px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.msg__body p { margin: 0 0 6px; }
.msg__body p:last-of-type { margin-bottom: 0; }
.msg__deleted-note { font-style: italic; color: var(--text-muted); }
.msg__edited { font-size: 12px; color: var(--text-muted); margin-left: 4px; }

.msg__mention {
  background: var(--accent-light);
  color: var(--accent-color);
  border-radius: 4px;
  padding: 0 3px;
  font-weight: 600;
}
.msg__mention.is-me { background: var(--accent-color); color: var(--text-inverse); }

.msg__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 13px;
}
.msg__reactions { display: flex; gap: 6px; }
.msg__react-form { display: inline; }
.msg__react {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: var(--border-width) solid var(--border-color);
  border-radius: 100px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}
.msg__react:hover { background: var(--bg-raised); }
.msg__react.is-active {
  border-color: var(--accent-color);
  background: var(--accent-light);
  color: var(--accent-color);
}
.msg__react-count:empty { display: none; }

.msg__replies { color: var(--accent-color); font-weight: 600; }
.msg__actions { display: inline-flex; gap: 10px; margin-left: auto; }
.msg__actions form { display: inline; }
.msg__actions form[hidden], .msg__action[hidden] { display: none; }
.msg__action {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}
.msg__action:hover { color: var(--text-primary); text-decoration: underline; }

.msg__thread-frame { display: block; }
.msg-thread { margin-top: 10px; padding-left: 8px; border-left: 2px solid var(--border-color); }

/* ── Composer ─────────────────────────────────────────────────────────── */
.msg-composer {
  margin-top: 14px;
  padding: 12px;
  border: var(--border-width) solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-surface);
}
.msg-composer--reply, .msg-composer--edit { margin-top: 6px; padding: 8px; }
.msg-composer__field { position: relative; }
.msg-composer__input { width: 100%; resize: vertical; }
.msg-composer__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.msg-composer__actions .field__hint { margin-right: auto; }

.msg-composer__suggest {
  position: absolute;
  left: 0;
  bottom: calc(100% + 4px);
  z-index: 20;
  min-width: 220px;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: var(--border-width) solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-surface);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.15);
}
.msg-composer__suggest[hidden] { display: none; }
.msg-composer__suggest li { padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.msg-composer__suggest li.is-active, .msg-composer__suggest li:hover { background: var(--bg-raised); }

@media (max-width: 640px) {
  .msg { padding: 10px; gap: 10px; }
  .msg__avatar { width: 28px; height: 28px; font-size: 11px; }
  .msg-composer__actions .field__hint { display: none; }
  .msg-new-dm { max-width: none; }
}
