.bp-chat-message-list {
    max-height: 24rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(var(--bs-primary-rgb, 13, 110, 253), 0.08), rgba(var(--bs-primary-rgb, 13, 110, 253), 0.02))
        var(--bs-body-bg);
    border: 1px solid rgba(var(--bs-primary-rgb, 13, 110, 253), 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 12px 32px rgba(15, 23, 42, 0.12);
}

.bp-chat-message {
    display: flex;
    flex-direction: column;
    align-self: flex-start;
    max-width: 82%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    background: var(--bs-body-bg);
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bp-chat-message:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 38px rgba(15, 23, 42, 0.16);
}

.bp-chat-message__meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--bs-secondary-color);
}

.bp-chat-message__author {
    color: var(--bs-body-color);
}

.bp-chat-message__separator {
    font-size: 0.65rem;
    opacity: 0.6;
}

.bp-chat-message__time {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
}

.bp-chat-message__content {
    margin-top: 0.35rem;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.95rem;
    line-height: 1.5;
}

.bp-chat-message--self {
    margin-left: auto;
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.22), rgba(25, 135, 84, 0.35));
    border-color: rgba(25, 135, 84, 0.45);
}

.bp-chat-message--self .bp-chat-message__author {
    color: rgba(15, 81, 50, 0.95);
}

.bp-chat-message--self .bp-chat-message__time {
    color: rgba(15, 81, 50, 0.7);
}

.bp-chat-message--other {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.14), rgba(13, 202, 240, 0.28));
    border-color: rgba(13, 202, 240, 0.45);
}

.bp-chat-message--other .bp-chat-message__author {
    color: rgba(4, 74, 92, 0.95);
}

.bp-chat-message--other .bp-chat-message__time {
    color: rgba(4, 74, 92, 0.7);
}

.bp-chat-message--system {
    align-self: center;
    max-width: 100%;
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.18), rgba(108, 117, 125, 0.32));
    border-color: rgba(108, 117, 125, 0.45);
    color: var(--bs-secondary-color);
}

.bp-chat-form[aria-disabled="true"] textarea {
    pointer-events: none;
    opacity: 0.6;
}

.bp-chat-summary {
    margin-bottom: 1rem;
}

.bp-chat-summary__panel {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
    border-radius: 0.9rem;
    background: linear-gradient(120deg, rgba(var(--bs-primary-rgb, 13, 110, 253), 0.12), rgba(255, 255, 255, 0.9));
    border: 1px solid rgba(var(--bs-primary-rgb, 13, 110, 253), 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.bp-chat-summary__headline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.bp-chat-summary__type {
    font-weight: 600;
    font-size: 1rem;
    color: var(--bs-body-color);
}

.bp-chat-summary__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(220, 53, 69, 0.12);
    color: rgba(132, 32, 41, 0.95);
    border: 1px solid rgba(220, 53, 69, 0.22);
}

.bp-chat-summary__roles {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bp-chat-summary__role {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
}

.bp-chat-summary__divider {
    font-size: 0.85rem;
    color: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.6);
}

.bp-chat-summary__meta {
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

/* Chat triggers */

.bp-chat-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.bp-chat-trigger__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--bs-danger-text-emphasis, var(--bs-danger));
}

/* Chat preview cards */

.chat-preview {
    border: 1px solid rgba(var(--bs-primary-rgb, 13, 110, 253), 0.15);
    border-radius: 0.9rem;
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb, 13, 110, 253), 0.06), transparent 80%) var(--bs-body-bg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-preview__title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--bs-secondary-color);
}

.chat-preview__list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.chat-preview__item {
    border-radius: 0.85rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-preview__item:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.chat-preview__item--buyer {
    border-left: 4px solid rgba(var(--bs-primary-rgb, 13, 110, 253), 0.7);
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb, 13, 110, 253), 0.12), rgba(255, 255, 255, 0.85));
}

.chat-preview__item--seller {
    border-left: 4px solid rgba(var(--bs-success-rgb, 25, 135, 84), 0.7);
    background: linear-gradient(135deg, rgba(var(--bs-success-rgb, 25, 135, 84), 0.12), rgba(255, 255, 255, 0.85));
}

.chat-preview__item--system {
    border-left: 4px solid rgba(var(--bs-secondary-rgb, 108, 117, 125), 0.6);
    background: linear-gradient(135deg, rgba(var(--bs-secondary-rgb, 108, 117, 125), 0.12), rgba(255, 255, 255, 0.85));
}

.chat-preview__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.chat-preview__role {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--bs-body-color);
}

.chat-preview__item--buyer .chat-preview__role {
    color: rgba(6, 70, 142, 0.9);
}

.chat-preview__item--seller .chat-preview__role {
    color: rgba(15, 81, 50, 0.9);
}

.chat-preview__item--system .chat-preview__role {
    color: rgba(71, 85, 105, 0.9);
}

.chat-preview__time {
    font-size: 0.7rem;
    color: var(--bs-secondary-color);
    letter-spacing: 0.04em;
}

.chat-preview__message {
    margin: 0;
    font-size: 0.9rem;
    color: var(--bs-body-color);
    line-height: 1.45;
    word-break: break-word;
}

@media (max-width: 576px) {
    .chat-preview {
        padding: 0.85rem;
    }

    .chat-preview__item {
        padding: 0.65rem;
    }
}
