/* DM Inbox conversation list — hairline-divided list rows */
.dm-list {
  --dm-content-inset: var(--inline-space);

  display: flex;
  flex-direction: column;
  padding: var(--inline-space);
  padding-block-start: var(--dm-content-inset);
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Rows ride the shared .list-row rhythm (patterns.css); these rules carry
   only what's DM-specific: unread weighting, the accent dot, and the two-line
   trailing meta. */
.dm-conversation {
  align-items: flex-start;
  border-radius: var(--border-radius-md);
  transition: background-color 150ms ease-out;

  &.unread {
    .dm-conversation__names {
      font-weight: 700;
    }

    .dm-conversation__preview {
      color: var(--color-text-muted);
    }
  }
}

.dm-conversation__avatar {
  --avatar-size: 34px;

  margin-top: 2px;
}

.dm-conversation__names {
  color: var(--color-text);
  line-height: 1.3;
}

.dm-conversation__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  padding-block-start: 2px;
}

.dm-conversation__time {
  font-size: 0.6875rem;
  color: var(--color-text-subtle);
  white-space: nowrap;

  .dm-conversation.unread & {
    font-weight: 600;
  }
}

.dm-conversation__sender {
  font-weight: 600;
  margin-inline-end: 0.25rem;
}

.dm-conversation__badge {
  width: 8px;
  height: 8px;
  background: var(--color-accent-brand);
  border-radius: 50%;
  flex-shrink: 0;
  animation: badge-in 200ms cubic-bezier(0.25, 1, 0.5, 1) both;
}

/* Numeric unread badge — mirrors the sidebar DM rows */
.dm-conversation__count {
  background-color: var(--color-accent-brand);
  border-radius: 9px;
  color: var(--color-text-reversed);
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.4;
  padding: 1px 7px;
}

/* Presence dot on a 1:1 row's avatar */
.dm-conversation__presence {
  block-size: 10px;
  border: 2px solid var(--color-bg);
  bottom: -2px;
  inline-size: 10px;
  position: absolute;
  right: -2px;
  z-index: 1;
}

.dm-conversation__avatar .avatar {
  position: relative;
}

.dm-conversation--current {
  background-color: var(--color-selected);
}

/* The rail: its own 54px header aligned with the app navbar, the compose
   bar, then the scrolling list */
.dm-rail__header {
  align-items: center;
  block-size: var(--navbar-height);
  border-block-end: 1px solid var(--color-border);
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  padding-inline: 16px;
}

.dm-rail__title {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0;
}

.dm-rail__empty {
  padding: 20px 16px;
  text-align: center;
}

#list-rail {
  .dm-list {
    --dm-content-inset: 0;

    flex: 1 1 auto;
    min-block-size: 0;
    padding: 8px;
  }
}

/* New message compose screen: an editable To: picker over a first-message
   composer, filling the DM main pane. */
.dm-new {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-block-size: 0;
}

.dm-new__to {
  align-items: flex-start;
  border-block-end: 1px solid var(--color-border);
  display: flex;
  flex-shrink: 0;
  gap: 12px;
  padding: 11px 18px;
}

.dm-new__to-label {
  color: var(--color-text-subtle);
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  padding-block-start: 7px;
}

.dm-new__hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.dm-new__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.dm-new__blurb {
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 8px auto 0;
  max-inline-size: 38ch;
}

.dm-new__composer {
  align-items: center;
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  margin: 6px 20px 18px;
  padding: 4px 10px 4px 4px;
}

.dm-new__input {
  background: transparent;
  border: none;
  flex: 1;
  font-family: inherit;
  font-size: 15px;
  min-inline-size: 0;
  outline: none;
  padding: 13px 14px;
}

.dm-new__send {
  flex-shrink: 0;
}

/* The inbox's select-a-conversation pane (split widths only — below them
   the rail is the screen and #main-content is hidden) */
.dm-empty-pane {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  min-block-size: 0;
  padding: var(--block-space);
}
