/* stream */
.stream {
    position: relative;
    background-color: white;
    padding-top: 1px;
    min-height: 600px;
    margin-top: 1px;
    zoom: 1;
}

[data-bs-theme="dark"] .stream {
    background-color: transparent; /* let parent dark surface show through */
}






.tweet {
    padding: 10px;
    font-size: 13px;
    position: relative;
    zoom: 1;
}



.tweet-content {
    min-height: 48px;
}

.tweet-row {
    display: block;
    position: relative;
    line-height: 15px;
}

.tweet-screen-name {
    font-weight: bold;
    color: #333 !important;
}

.tweet-age {
    color: #999;
    font-size: 12px;
}

/* Override the !important above so screen name stays readable on dark. */
[data-bs-theme="dark"] .tweet-screen-name {
    color: #e9edef !important;
}

[data-bs-theme="dark"] .tweet-age {
    color: rgba(233, 237, 239, 0.55);
}

.tweet-corner {
    display: inline-block;
    margin-right: 10px;
}

.tweet-meta {
    color: #999;
    font-size: 11px;
    font-style: normal;
}

.tweet-text {
    padding: 0;
    font-family: Arial, "Helvetica Neue", sans-serif;
    line-height: 17px;
    word-wrap: break-word;
}

.vip .tweet-text {
    font-weight: bold;
}

.tweet-timestamp {
    display:block;
}

.tweet-timestamp, .tweet-contributors {
    color: #999 !important;
    font-size: 11px;
}





.tweet-content {

    .ml_message {
        flex-grow: 1;
    }


    .ml_message div.bubble {
        background: #d9fdd3;
        margin: 0px;
        display: block;
        padding: 0.7rem 0.9rem;
        border-radius: 1rem;
        border-top-left-radius: 3px;
        width: auto;
        display: inline-block;
        position: relative;
        max-width: 80%;
    }

    .ml_message div.bubble::after {
        content: '';
        position: absolute;
        top: 0px;
        left: -10px;
        width: 0;
        height: 0;
        border: 10px solid transparent;
        border-left-color: transparent;
        border-right-color: transparent;
        border-top-color: #d9fdd3;
    }


    .chat_row_me {
        .ml_message div.bubble {
            background: #effdde;
            float: right;
            border-top-left-radius: 1rem;
            border-top-right-radius: 3px;
        }

        .ml_message div.bubble::after {
            content: '';
            position: absolute;
            top: 0px;
            right: -10px;
            width: 0;
            height: 0;
            border: 10px solid transparent;
            border-left-color: transparent;
            border-right-color: transparent;
            border-top-color: #effdde;
            left: auto;
        }
    }

    .ml_not_show_name {
        .ml_message div.bubble {
            margin-top: 3px !important;
            border-top-right-radius: 1rem;

        }

        .ml_message div.bubble::after {
            border: 0px none !important;
        }

    }


    .ml_time {
        color: #88c27b;
        font-size: 11px;
        display: inline-block;

        text-align: right;
        margin-top: 0.4em;
        margin-left: 0.8em;
        margin-right: -5px;
        margin-bottom: -5px;
        float: right;

        div {
            display: inline-block;
        }
    }

    .chat_row_me {
        .ml_time {
            color: #88c27b;

            div {
            }
        }

    }

    /* Dark theme: bubbles + reply preview + ml_time were hardcoded
       light. Reuse the webapp.css chat palette so the colours match. */
    [data-bs-theme="dark"] & {
        .ml_message div.bubble {
            background: #202c33;             /* --chat-incoming-bg */
            color: #e9edef;
        }
        .ml_message div.bubble::after {
            border-top-color: #202c33;
        }
        .chat_row_me .ml_message div.bubble {
            background: #005c4b;             /* --chat-outgoing-bg */
            color: #e9edef;
        }
        .chat_row_me .ml_message div.bubble::after {
            border-top-color: #005c4b;
        }
        .ml_time, .chat_row_me .ml_time {
            color: rgba(233, 237, 239, 0.55);
        }
        /* Reply preview uses bg-light (hardcoded #f8f9fa). Re-paint dark. */
        .ml_message .reply-block.bg-light {
            background-color: #111b21 !important;
            border-color: #2a373f !important;
            color: #e9edef;
        }
        .ml_message .reply-block .text-muted {
            color: rgba(233, 237, 239, 0.55) !important;
        }
    }
}
/* Mobile: stack avatar above bubble, let bubble claim 100% width. */
@media (max-width: 575.98px) {
    .stream-item-content {
        flex-direction: column;
        align-items: stretch !important;
    }
    .stream-item-content .tweet-image {
        margin-bottom: 8px;
        align-self: flex-start !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px;
    }
    .stream-item-content .tweet-image .tweet-screen-name,
    .stream-item-content .tweet-image .tweet-age {
        margin-left: 0;
    }
    .stream-item-content .tweet-content {
        padding-left: 0 !important;
    }
    .tweet-content .ml_message div.bubble {
        max-width: 100%;
    }
}
