.chat-ui.messenger {
    --chat-bg: #000000;
    --header-bg: #000000;
    --bubble-sent: #0084ff;
    --bubble-received: #303030;
    --accent: #0084ff;
    --status-seen: #93c5fd;
    --bubble-radius: 18px;

    font-family: "Helvetica Neue", -apple-system, Roboto, sans-serif;
}

/* ----- Header ----- */
.chat-ui.messenger .chat-header {
    height: 56px;
    padding: 6px 10px;
    background: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-ui.messenger .chat-back-arrow {
    color: #0084ff;
}

.chat-ui.messenger .wa-back-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: #0084ff;
}

/* Blue unread badge by the back chevron. */
.chat-ui.messenger .chat-unread {
    top: -0.15rem;
    right: -0.6rem;
    background: #0084ff;
    color: #ffffff;
    font-size: 0.58rem;
}

/* Avatar with a blue "active" ring (no green dot). */
.chat-ui.messenger .chat-avatar {
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, #00b2ff, #006aff);
    font-size: 0.62rem;
    border: 2px solid #000000;
    box-shadow: 0 0 0 2px #0084ff;
}

.chat-ui.messenger .chat-header-main {
    gap: 0.85rem;
}

.chat-ui.messenger .chat-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #ffffff;
}

.chat-ui.messenger .chat-subtitle {
    color: #8a8d91;
    font-size: 0.66rem;
}

.chat-ui.messenger .chat-header-actions {
    color: #0084ff;
    gap: 0.7rem;
}

.chat-ui.messenger .chat-header-action {
    color: #0084ff;
}

.chat-ui.messenger .chat-header-action-icon,
.chat-ui.messenger .chat-header-action-icon-video {
    width: 1.45rem;
    height: 1.45rem;
}

/* ----- Body + bubbles ----- */
.chat-ui.messenger .chat-body {
    background: #000000;
}

.chat-ui.messenger .chat-messages {
    padding: 0.7rem 0.7rem 5rem;
}

.chat-ui.messenger .bubble-row {
    margin-bottom: 0.5rem;
    align-items: flex-end;
}

.chat-ui.messenger .bubble-row-grouped {
    margin-bottom: 0.13rem;
}

/* Centered time separator above a cluster (grouped date/time). */
.chat-ui.messenger .bubble-row[data-sep] {
    margin-top: 1.5rem;
}

.chat-ui.messenger .bubble-row[data-sep]::before {
    content: attr(data-sep);
    position: absolute;
    left: 0;
    top: -1.15rem;
    width: 100%;
    text-align: center;
    color: #8a8d91;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.chat-ui.messenger .bubble {
    max-width: 70%;
    padding: 0.45rem 0.72rem;
    box-shadow: none;
    border: none;
    border-radius: 18px;
}

.chat-ui.messenger .bubble.sent {
    background: #0084ff;
}

.chat-ui.messenger .bubble.received {
    background: #303030;
    border: none;
}

/* Grouped bubbles: flatten the corners between same-sender messages. */
.chat-ui.messenger .bubble-row-sent:has(+ .bubble-row-sent) .bubble.sent {
    border-bottom-right-radius: 5px;
}

.chat-ui.messenger .bubble-row-grouped.bubble-row-sent .bubble.sent {
    border-top-right-radius: 5px;
}

.chat-ui.messenger .bubble-row-received:has(+ .bubble-row-received) .bubble.received {
    border-bottom-left-radius: 5px;
}

.chat-ui.messenger .bubble-row-grouped.bubble-row-received .bubble.received {
    border-top-left-radius: 5px;
}

.chat-ui.messenger .bubble-content {
    font-size: 0.88rem;
    line-height: 1.3;
    color: #ffffff;
}

/* Messenger doesn't show per-bubble time/ticks. */
.chat-ui.messenger .bubble-meta {
    display: none;
}

.chat-ui.messenger .bubble-sender {
    display: none;
}

/* ----- Sender avatar to the left of the last received bubble in a run ----- */
.chat-ui.messenger .row-avatar {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    margin-right: 6px;
}

.chat-ui.messenger .row-avatar-img {
    width: 26px;
    height: 26px;
    border-radius: 9999px;
    object-fit: cover;
}

.chat-ui.messenger .row-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 9999px;
    background: #3a3b3c;
    color: #ffffff;
    font-size: 0.58rem;
    font-weight: 600;
}

/* Reserve the avatar gutter but only show it on the last received bubble. */
.chat-ui.messenger .bubble-row-received:has(+ .bubble-row-received) .row-avatar {
    visibility: hidden;
}

.chat-ui.messenger .bubble-row-received .bubble-reaction {
    left: 2.4rem;
}

/* ----- Voice note play buttons ----- */
.chat-ui.messenger .bubble.received .voice-play {
    background: #0084ff;
    color: #ffffff;
}

.chat-ui.messenger .bubble.sent .voice-play {
    background: rgba(0, 0, 0, 0.28);
    color: #ffffff;
}

/* ----- Footer: blue action icons + "Aa" pill + thumbs-up ----- */
.chat-ui.messenger .chat-footer {
    padding: 6px 8px 9px;
    background: #000000;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    gap: 0;
}

.chat-ui.messenger .msgr-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.chat-ui.messenger .msgr-plus {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 9999px;
    background: #0084ff;
    color: #ffffff;
    cursor: pointer;
}

.chat-ui.messenger .msgr-plus svg {
    width: 11px;
    height: 11px;
}

.chat-ui.messenger .msgr-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: #0084ff;
    cursor: pointer;
}

.chat-ui.messenger .msgr-icon svg {
    width: 20px;
    height: 20px;
}

.chat-ui.messenger .msgr-send {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: #0084ff;
    cursor: pointer;
}

.chat-ui.messenger .msgr-send svg {
    width: 22px;
    height: 22px;
}

.chat-ui.messenger .msgr-field {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    min-height: 30px;
    padding: 0 32px 0 12px;
    background: #303030;
    border-radius: 9999px;
}

.chat-ui.messenger .msgr-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 0.9rem;
    padding: 6px 0;
}

.chat-ui.messenger .msgr-input::placeholder,
.chat-ui.messenger .msgr-input.composer-empty {
    color: #b0b3b8;
}

.chat-ui.messenger .msgr-emoji {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: #0084ff;
    cursor: pointer;
}

.chat-ui.messenger .msgr-emoji svg {
    width: 19px;
    height: 19px;
}

.chat-ui.messenger .msgr-like {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: #0084ff;
    cursor: pointer;
}

.chat-ui.messenger .msgr-like svg {
    width: 20px;
    height: 20px;
}

.chat-ui.messenger .system-note {
    color: #8a8d91;
    background: transparent;
    font-size: 0.66rem;
}
