.user-list,
.chat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.user-item,
.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.user-item:hover,
.chat-item:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transform: translateY(-1px);
}

.user-item.active,
.chat-item.active {
  border-color: color-mix(in srgb, var(--accent) 80%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.user-item.online .avatar,
.chat-item.online .avatar {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-2) 50%, transparent);
}

.user-item.unread::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 20%, transparent);
}

.chat-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.chat-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-pin {
  font-size: 12px;
  color: color-mix(in srgb, var(--accent) 75%, var(--text));
}

.chat-time {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}

.chat-preview {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-unread {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-2) 70%, transparent);
  color: var(--text);
  font-size: 11px;
  display: grid;
  place-items: center;
  padding: 0 6px;
}

.chat-empty {
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--stroke);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.chat-enter {
  animation: chatFadeIn var(--anim-fast) var(--ease-out);
}

@keyframes chatFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent) 35%, transparent),
    color-mix(in srgb, var(--accent-2) 20%, transparent)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
}

.avatar.has-image {
  background: var(--panel-2);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-meta span {
  font-size: 14px;
}

.user-meta small {
  color: var(--muted);
  font-size: 12px;
}

.back-button {
  display: none;
  border: 1px solid var(--stroke);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}
