
/* Avatar rendering for chat list + chat header. Profile images exist, so stop pretending initials are the peak of civilization. */
.conversation-avatar,
.chat-thread-avatar {
    overflow: hidden;
    flex: 0 0 auto;
}

.conversation-avatar img,
.chat-thread-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: inherit;
}

.conversation-avatar span,
.chat-thread-avatar span {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}

.chat-thread-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: var(--button-gradient);
    font-weight: 900;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
}

.chat-header {
    grid-template-columns: auto auto minmax(0, 1fr) repeat(5, auto);
}

@media (max-width: 420px) {
    .chat-thread-avatar {
        width: 38px;
        height: 38px;
    }

    .chat-header {
        gap: 8px;
    }
}

/* Chat header long-name clamp: long names should ellipsis, not invade the avatar/buttons like unpaid rent. */
.chat-header {
    grid-template-columns: auto auto minmax(0, 1fr) repeat(5, auto) !important;
    align-items: center;
}

.chat-header > div:not(.chat-thread-avatar) {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

#chatThreadTitle,
#chatThreadSubtitle {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#chatThreadTitle {
    line-height: 1.15;
}

#chatThreadSubtitle {
    line-height: 1.2;
}

@media (max-width: 420px) {
    .chat-header {
        grid-template-columns: auto auto minmax(0, 1fr) repeat(3, auto) !important;
    }

    #chatThreadTitle {
        font-size: 16px;
    }

    #chatThreadSubtitle {
        font-size: 11px;
    }
}
