@import "/styles/icons.wxss";

/* Row: compact two-line layout per list density spec.
 * No divider — rhythm comes from padding, font hierarchy, and hover bg. */
.row {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg);
  gap: var(--space-3);
  min-height: 88rpx;
}

/* No full-row accent background for unread — only title weight + badge */
.row--hover {
  background: var(--color-muted);
}

.row__icon-wrap {
  position: relative;
  width: 48rpx;
  height: 48rpx;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.row__avatar {
  width: 48rpx;
  height: 48rpx;
  border-radius: var(--radius-pill);
  background: var(--color-muted);
}

/* Icon glyph sizing — mask shape comes from .icon--{shape}, color from .row__icon--{kind} */
.row__icon {
  width: 36rpx;
  height: 36rpx;
}

/* Neutral icon palette aligned with Web inbox — single muted color so the
 * list reads as a system rather than a rainbow. The badge still carries
 * the urgency signal. */
.row__icon--channel,
.row__icon--human-dm,
.row__icon--agent-dm,
.row__icon--service-dm,
.row__icon--thread,
.row__icon--task,
.row__icon--machine {
  background-color: var(--color-inbox-icon);
}

.row__body {
  flex: 1;
  min-width: 0;
}

.row__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
}

.row__title {
  font-size: var(--text-base);
  color: var(--color-fg);
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.row--unread .row__title {
  font-weight: var(--font-medium);
}

.row__time {
  font-size: var(--text-sm);
  color: #b2b2b2;
  flex-shrink: 0;
  margin-left: var(--space-2);
}

.row__muted {
  flex-shrink: 0;
  margin-left: 6rpx;
  color: #b2b2b2;
}

.row__preview {
  display: flex;
  align-items: center;
  gap: 6rpx;
  margin-top: 4rpx;
  font-size: var(--text-sm);
  color: #888888;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row__preview-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.row__assignee {
  display: flex;
  align-items: center;
  gap: 4rpx;
  max-width: 42%;
  min-width: 0;
  flex-shrink: 0;
}

.row__assignee-avatar,
.row__assignee-initials {
  width: 24rpx;
  height: 24rpx;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.row__assignee-avatar {
  display: block;
}

.row__assignee-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-avatar-fg);
  background: var(--color-avatar-human);
  font-size: 12rpx;
  font-weight: var(--font-semibold);
  line-height: 1;
}

.row__assignee-initials--agent {
  background: var(--color-avatar-agent);
}

.row__assignee-initials--service {
  background: var(--color-avatar-service);
}

.row__assignee-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row__assignee-separator {
  flex-shrink: 0;
}

.row__mention {
  color: var(--color-info);
  margin-right: 6rpx;
  font-weight: var(--font-semibold);
}

/* Unread badge — corner of icon, replaces tile-based accent.
 * Uses --color-primary so it tracks the theme: near-black in light,
 * near-white in dark. Avoid --color-destructive here so unread stays
 * distinct from error/destructive states. */
.row__badge {
  position: absolute;
  top: -4rpx;
  right: -8rpx;
  min-width: 28rpx;
  height: 28rpx;
  padding: 0 6rpx;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: var(--color-primary-fg);
  font-size: var(--text-xs);
  line-height: 28rpx;
  text-align: center;
  box-sizing: border-box;
  border: 2rpx solid var(--color-bg);
}

.row__manual-unread {
  position: absolute;
  top: -2rpx;
  right: -4rpx;
  width: 16rpx;
  height: 16rpx;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  border: 2rpx solid var(--color-bg);
  box-sizing: border-box;
}
