:root {
    --wa-header-bg: #0b141a;
}

.chat-ui.whatsapp {
    --chat-bg: #0b141a;
    --header-bg: #111b21;
    --bubble-sent: #005c4b;
    --bubble-received: #202c33;
    --accent: #25d366;
    --status-seen: #53bdeb;
}

.chat-ui.whatsapp .chat-header {
    height: 56px;
    padding: 6px 10px;
    box-sizing: border-box;
    background: var(--wa-header-bg);
    border-top: none;
}

.chat-ui.whatsapp .chat-header-main {
    gap: 0.6rem;
}

.chat-ui.whatsapp .chat-back-arrow {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1;
}

.chat-ui.whatsapp .wa-back-icon {
    width: 1.2rem;
    height: 1.2rem;
    color: #e9edef;
}

.chat-ui.whatsapp .chat-avatar {
    width: 1.95rem;
    height: 1.95rem;
    font-size: 0.66rem;
}

.chat-ui.whatsapp .chat-title {
    font-weight: 600;
}

.chat-ui.whatsapp .chat-header-name {
    font-weight: 600;
}

.chat-ui.whatsapp .chat-subtitle {
    margin-top: 0;
    font-size: 0.63rem;
    opacity: 0.6;
}

.chat-ui.whatsapp .chat-header-actions {
    margin-left: auto;
    gap: 0.45rem;
    transform: translateY(-0.5px);
}

.chat-ui.whatsapp .chat-header-action {
    width: 1.8rem;
    height: 1.8rem;
}

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

/* Wallpaper lives on the fixed-height chat container, not the flexible chat-body
   — otherwise the composer growing (during typing) shrinks chat-body and the
   `cover` background visibly zooms. The body stays transparent over it. */
.chat-ui.whatsapp {
    background-image: url('/images/chat/whatsapp-chat-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #0b141a;
}

.chat-ui.whatsapp .chat-body {
    background: transparent;
}

.chat-ui.whatsapp .chat-messages {
    background-color: transparent;
    background-image: none;
    padding: 0.38rem 0.48rem 6px;
}

.chat-ui.whatsapp .bubble-row {
    position: relative;
    display: flex;
    max-width: 100%;
    margin-bottom: 7px;
}

.chat-ui.whatsapp .bubble-row-grouped {
    margin-bottom: 2px;
}

.chat-ui.whatsapp .bubble-row-sent {
    justify-content: flex-end;
}

.chat-ui.whatsapp .bubble-row-received {
    justify-content: flex-start;
}

.chat-ui.whatsapp .bubble {
    position: relative;
    max-width: 78%;
    padding: 6px 9px 7px;
    box-shadow: none;
    border: none;
}

.chat-ui.whatsapp .bubble.sent {
    background: #005c4b;
    border-radius: 14px 14px 4px 14px;
}

.chat-ui.whatsapp .bubble.received {
    background: #202c33;
    border: none;
    border-radius: 14px 14px 14px 4px;
}

.chat-ui.whatsapp .bubble-content {
    font-size: 0.82rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: #e9edef;
}

.chat-ui.whatsapp .bubble-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-ui.whatsapp .bubble-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    margin-top: 1px;
    white-space: nowrap;
}

.chat-ui.whatsapp .bubble-time {
    font-size: 0.6rem;
    line-height: 1;
    color: rgba(233, 237, 239, 0.65);
}

.chat-ui.whatsapp .bubble-status {
    font-size: 0.62rem;
    line-height: 1;
    color: rgba(233, 237, 239, 0.55);
}

.chat-ui.whatsapp .bubble-status.status-seen {
    color: #53bdeb;
}

.chat-ui.whatsapp .chat-footer {
    display: flex;
    align-items: center;
    padding: 6px 8px 8px;
    background: #0b141a;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    gap: 0;
}

.chat-ui.whatsapp .chat-footer-plus,
.chat-ui.whatsapp .chat-footer-icon {
    width: 29px;
    height: 29px;
    font-size: 1.75rem;
    opacity: 0.85;
    color: #8696a0;
    padding: 0;
}

.chat-ui.whatsapp .chat-footer-icon svg {
    width: 1.05rem;
    height: 1.05rem;
}

.chat-ui.whatsapp .wa-camera-icon {
    width: 1.4rem;
    height: 1.4rem;
    color: #aebac1;
}

.chat-ui.whatsapp .input-wrapper,
.chat-ui.whatsapp .chat-footer-input-wrap {
    display: flex;
    align-items: flex-end;
    min-height: 25px;
    flex: 1;
    border-radius: 18px;
    background: #2a3942;
    padding: 6px 10px;
    margin: 0 6px;
    border: none;
    box-shadow: none;
}

.chat-ui.whatsapp .wa-input-inner {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    width: 100%;
}

.chat-ui.whatsapp .wa-emoji-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.chat-ui.whatsapp .wa-emoji-icon {
    width: 1.1rem;
    height: 1.1rem;
    color: #aebac1;
}

.chat-ui.whatsapp .wa-sticker-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 1px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.chat-ui.whatsapp .wa-sticker-icon {
    width: 1.2rem;
    height: 1.2rem;
    color: #aebac1;
}

.chat-ui.whatsapp .chat-footer-plus,
.chat-ui.whatsapp .icon-plus {
    margin-right: 6px;
}

.chat-ui.whatsapp .wa-emoji-btn,
.chat-ui.whatsapp .icon-emoji {
    margin-right: 6px;
}

.chat-ui.whatsapp .chat-footer-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e9edef;
    font-size: 14px;
    line-height: 18px;
    padding: 0 6px;
}

.chat-ui.whatsapp .chat-input,
.chat-ui.whatsapp .chat-footer-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e9edef;
    font-size: 14px;
    line-height: 18px;
    padding: 0 6px;
}

.chat-ui.whatsapp .chat-input::placeholder,
.chat-ui.whatsapp .chat-footer-input::placeholder,
.chat-ui.whatsapp .chat-footer-input.composer-empty {
    color: #8696a0;
}

.chat-ui.whatsapp .chat-footer-actions {
    display: flex;
    align-items: center;
    gap: 0;
}

.chat-ui.whatsapp .chat-footer-actions .chat-footer-icon,
.chat-ui.whatsapp .icon-camera,
.chat-ui.whatsapp .icon-mic {
    margin-left: 10px;
}

.chat-ui.whatsapp .footer-icon,
.chat-ui.whatsapp .chat-footer-icon,
.chat-ui.whatsapp .chat-footer-plus {
    width: 25px;
    height: 25px;
    opacity: 0.85;
    color: #8696a0;
}

.chat-ui.whatsapp .icon-mic.active {
    color: #00a884;
}

/* Green circular send button shown while the sender is typing. */
.chat-ui.whatsapp .wa-send {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-left: 8px;
    border: none;
    border-radius: 9999px;
    background: #00a884;
    color: #ffffff;
    cursor: pointer;
}

.chat-ui.whatsapp .wa-send svg {
    width: 18px;
    height: 18px;
    margin-left: 1px;
}

/* Time tucks onto the last line of text bubbles (WhatsApp behaviour). The
   trailing spacer in the text reserves room; the meta sits over it. */
.chat-ui.whatsapp .bubble.type-text .bubble-content {
    position: relative;
}
.chat-ui.whatsapp .bubble.type-text .bubble-meta {
    position: absolute;
    right: 0;
    bottom: -1px;
    margin-top: 0;
}
.chat-ui.whatsapp .bubble.type-text .bubble-meta-spacer {
    display: inline-block;
    height: 0.6rem;
    width: 58px;
}
.chat-ui.whatsapp .bubble.type-text.received .bubble-meta-spacer {
    width: 34px;
}

/* Reply quote bar/name: coloured (never white) and contrasting on each bubble. */
.chat-ui.whatsapp .bubble.sent .bubble-reply {
    border-left-color: #8fe3cb;
    background: rgba(255, 255, 255, 0.10);
}
.chat-ui.whatsapp .bubble.sent .bubble-reply-name {
    color: #8fe3cb;
}
.chat-ui.whatsapp .bubble.received .bubble-reply {
    border-left-color: #34d399;
    background: rgba(0, 0, 0, 0.22);
}
.chat-ui.whatsapp .bubble.received .bubble-reply-name {
    color: #34d399;
}

/* Chat intro: "Today" pill + amber end-to-end-encryption notice. */
.chat-ui.whatsapp .chat-day-sep span {
    background: #1d282f;
    color: #e9edef;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}
.chat-ui.whatsapp .wa-encryption-notice {
    max-width: 88%;
    margin: 0 auto;
    padding: 7px 12px 8px;
    border-radius: 8px;
    background: rgba(13, 24, 30, 0.72);
    color: #f4d999;
    font-size: 0.68rem;
    line-height: 1.4;
    text-align: center;
}
.chat-ui.whatsapp .wa-encryption-notice .wa-lock {
    width: 0.7rem;
    height: 0.7rem;
    display: inline-block;
    vertical-align: -0.1em;
    margin-right: 2px;
}
.chat-ui.whatsapp .wa-encryption-notice b {
    font-weight: 700;
}