:root {
    --belly-grad: linear-gradient(135deg, #ffaf65 0%, #ed6ea0 100%);
    --bg-main: #000000;
    --bg-card: #121212;
    --bg-input: #16181c;
    --text-main: #ffffff;
    --text-secondary: #71767b;
    --border: #2f3336;
    --hover: #181818;
    --bubble: #2f3336;
}

html[data-theme="dark-blue"] {
    --bg-main: #0a192f;
    --bg-card: #112240;
    --bg-input: #1d2d50;
    --text-main: #e6f1ff;
    --text-secondary: #8899a6;
    --border: #233554;
    --hover: #1d2d50;
    --bubble: #233554;
}

html[data-theme="light"] {
    --bg-main: #ffffff;
    --bg-card: #f7f9f9;
    --bg-input: #eff3f4;
    --text-main: #0f1419;
    --text-secondary: #536471;
    --border: #dfe3e6;
    --hover: #f0f0f0;
    --bubble: #eff3f4;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; }
body {
    background: var(--bg-main);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
}
button, input, textarea { color: inherit; }
button { cursor: pointer; }
.border-gray { border-color: var(--border) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-belly {
    background: var(--belly-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.btn-belly {
    background: var(--belly-grad);
    color: white;
    transition: filter .2s, transform .1s;
}
.btn-belly:hover { filter: brightness(1.08); }
.btn-belly:active { transform: scale(.98); }

#authScreen {
    background: radial-gradient(circle at 20% 20%, rgba(255,175,101,.12), transparent 28%),
                radial-gradient(circle at 80% 70%, rgba(237,110,160,.12), transparent 28%),
                rgba(0,0,0,.76);
    backdrop-filter: blur(12px);
}
.auth-card, .modal-card { background: color-mix(in srgb, var(--bg-main) 93%, transparent); }
.auth-tab {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 12px;
    font-weight: 700;
    color: var(--text-secondary);
}
.auth-tab.active {
    background: var(--belly-grad);
    color: white;
    border-color: transparent;
}

.auth-brand { display:flex; flex-direction:column; align-items:center; gap:10px; }
.brand-stack { display:flex; align-items:center; gap:10px; }
.brand-logo { width:42px; height:42px; object-fit:contain; border-radius:10px; }
.brand-auth-logo { width:88px; height:88px; object-fit:contain; border-radius:18px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.side-logo { width:42px; height:42px; object-fit:contain; border-radius:10px; }
.belly-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    outline: none;
}
.belly-input:focus { border-color: #ed6ea0; }

#app { display: flex; }
.left-sidebar {
    width: 255px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 14px 14px 18px;
}
.brand-btn { width: fit-content; padding: 8px 12px 16px; }
.sidebar-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px 14px;
    border-radius: 999px;
    font-size: 19px;
    text-align: left;
    transition: background .15s;
}
.sidebar-item i { width: 24px; text-align: center; }
.sidebar-item:hover, .hover-row:hover, .round-btn:hover { background: var(--hover); }
.sidebar-item.active { font-weight: 800; }
.sidebar-item.active i {
    background: var(--belly-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.notif-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f43f5e;
    color: white;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    border: 2px solid var(--bg-main);
}
.post-main-btn {
    width: 100%;
    border-radius: 999px;
    padding: 12px;
    font-size: 17px;
    font-weight: 800;
    margin-top: 16px;
}
.post-icon { display: none; }
.appearance-box { margin-top: 18px; padding: 12px; border-radius: 16px; }
.appearance-label, .field-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: .08em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.theme-dot { width: 24px; height: 24px; border-radius: 50%; border-width: 1px; }
.mini-profile {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 10px; border-radius: 999px; text-align: left;
}
.logout-btn {
    margin-top: 4px; width: 100%; display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 999px; color: var(--text-secondary);
}
.logout-btn:hover { background: rgba(244,63,94,.12); color: #fb7185; }

.main-column {
    width: min(650px, calc(100vw - 610px));
    min-width: 0;
    overflow-y: auto;
    height: 100vh;
}
.main-column::-webkit-scrollbar, .chat-box::-webkit-scrollbar, .messages-users::-webkit-scrollbar { width: 0; }
.right-sidebar { width: 350px; flex-shrink: 0; padding: 14px 18px; }
.side-card {
    background: var(--bg-card); border-radius: 20px; padding: 16px; margin-bottom: 16px;
}
.side-card h2 { font-size: 20px; font-weight: 800; margin-bottom: 10px; }

.spa-page { display: none; min-height: 100%; }
.spa-page.active { display: block; }
#page-messages.active { display: flex; height: 100%; }
.sticky-glass {
    background: color-mix(in srgb, var(--bg-main) 90%, transparent);
    backdrop-filter: blur(12px);
}
.page-header { position: sticky; top: 0; z-index: 30; padding: 14px 16px; }
.page-header h1, .messages-title h1, .profile-header h1 { font-size: 20px; font-weight: 800; }

.composer { display: flex; gap: 12px; padding: 16px; }
.composer textarea, .modal-textarea {
    width: 100%; min-height: 72px; background: transparent; resize: none; outline: none; font-size: 20px;
}
.composer-actions { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; }
.media-btn {
    color: #f472b6; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; cursor: pointer;
}
.media-btn:hover { background: rgba(244,114,182,.1); }
.avatar {
    background: #27272a; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 48px; height: 48px; border-radius: 50%; }
.avatar-md { width: 42px; height: 42px; border-radius: 50%; }
.image-preview-wrap { position: relative; margin: 10px 0; }
.image-preview-wrap img {
    width: 100%; max-height: 330px; object-fit: cover; border-radius: 18px; border: 1px solid var(--border);
}
.preview-close {
    position: absolute; top: 8px; left: 8px; width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,.72); color: white;
}

.post-card {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
    display: block;
    width: 100%;
    text-align: left;
}
.post-card:hover { background: var(--hover); }

.post-head {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    text-align: left;
}

.post-body {
    min-width: 0;
    flex: 1 1 auto;
    width: auto;
    display: block;
    text-align: left;
}

.post-meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
    text-align: left;
}

.verified-badge {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
    display: inline-block;
    flex-shrink: 0;
}

.post-content {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 8px 0 0 0;
    padding: 0;
    text-align: left;
    text-indent: 0;
    position: static;
    left: auto;
    right: auto;
    transform: none;
    align-self: auto;
    justify-self: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.post-content p,
.post-content div,
.post-content span {
    text-align: left;
}

.post-content a { color: #38bdf8; }

.post-image {
    display: block;
    width: 100%;
    max-height: 430px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid var(--border);
    margin-top: 12px;
    margin-left: 0;
    margin-right: 0;
}

.post-actions {
    max-width: 480px;
    margin-top: 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 14px;
    text-align: left;
}

.action-btn { display: flex; align-items: center; gap: 7px; transition: color .15s; }
.action-btn.comment:hover { color: #38bdf8; }
.action-btn.repost:hover, .action-btn.repost.active { color: #22c55e; }
.action-btn.like:hover, .action-btn.like.active { color: #ec4899; }
.comments-box { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.comment-row { display: flex; gap: 10px; padding: 9px 0; }
.comment-input-row { display: flex; gap: 8px; margin-bottom: 10px; }
.comment-input-row input {
    flex: 1; min-width: 0; background: transparent; border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; outline: none;
}

.search-box { position: relative; }
.search-box i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); }
.search-box input {
    width: 100%; padding: 11px 14px 11px 46px; background: var(--bg-input); border: 1px solid transparent; border-radius: 999px; outline: none;
}
.search-box input:focus { border-color: #ed6ea0; }
.search-user, .notification-row {
    display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); transition: background .15s;
}
.search-user:hover, .notification-row:hover { background: var(--hover); }
.empty-state, .empty-chat { color: var(--text-secondary); padding: 48px 20px; text-align: center; }
.notification-icon { width: 30px; padding-top: 2px; text-align: center; font-size: 22px; }

.messages-page { overflow: hidden; }
.messages-users { width: 270px; flex-shrink: 0; overflow-y: auto; }
.messages-title { padding: 15px; }
.message-user {
    width: 100%; display: flex; align-items: center; gap: 10px; padding: 13px; border-bottom: 1px solid var(--border); text-align: left;
}
.message-user:hover, .message-user.active { background: var(--hover); }
.chat-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-header { height: 64px; padding: 12px 16px; display: flex; align-items: center; }
.chat-box { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 9px; }
.empty-chat { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.empty-chat i { font-size: 55px; margin-bottom: 14px; }
.msg-row { display: flex; width: 100%; }
.msg-row.mine { justify-content: flex-end; }
.msg-bubble { max-width: 78%; padding: 10px 14px; border-radius: 18px; background: var(--bubble); overflow-wrap: anywhere; }
.msg-row.mine .msg-bubble { background: var(--belly-grad); color: white; border-bottom-right-radius: 4px; }
.msg-row:not(.mine) .msg-bubble { border-bottom-left-radius: 4px; }
.msg-time { font-size: 10px; opacity: .65; margin-top: 4px; }
.message-composer { padding: 13px; }
.message-input-box {
    display: flex; align-items: center; gap: 8px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 18px; padding: 8px 12px;
}
.message-input-box input { flex: 1; min-width: 0; background: transparent; outline: none; }

.profile-header {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 8px 14px;
}
.round-btn { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.profile-banner { height: 200px; background: #27272a center/cover no-repeat; }
.profile-info { padding: 0 16px 14px; }
.profile-avatar-wrap { display: flex; justify-content: space-between; align-items: flex-start; }
.profile-avatar {
    width: 128px; height: 128px; margin-top: -64px; border-radius: 50%; border: 4px solid var(--bg-main); background: #27272a;
    overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 900;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-action { margin-top: 12px; border: 1px solid var(--border); border-radius: 999px; padding: 7px 15px; font-weight: 800; }
.profile-action.primary { background: white; color: black; border-color: white; }
.profile-tabs { display: flex; border-bottom: 1px solid var(--border); }
.profile-tab { flex: 1; padding: 14px; text-align: center; color: var(--text-secondary); position: relative; font-weight: 700; }
.profile-tab.active { color: var(--text-main); }
.profile-tab.active::after {
    content: ""; position: absolute; bottom: 0; left: 50%; width: 58px; height: 4px; border-radius: 999px; transform: translateX(-50%); background: var(--belly-grad);
}

.modal {
    position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.62); backdrop-filter: blur(5px);
    display: flex; justify-content: center; align-items: flex-start; padding: 72px 16px 16px;
}
.modal-card {
    width: 100%; max-width: 540px; border-radius: 22px; padding: 16px; max-height: calc(100vh - 90px); overflow-y: auto;
}
.file-choice {
    display: inline-flex; align-items: center; gap: 8px; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 999px; padding: 8px 13px; cursor: pointer; font-size: 13px;
}
.toast {
    position: fixed; z-index: 200; right: 22px; bottom: 22px; max-width: min(380px, calc(100vw - 44px));
    background: var(--bg-card); border: 1px solid var(--border); color: var(--text-main); border-radius: 14px; padding: 11px 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.hidden { display: none !important; }

@media (max-width: 1050px) {
    .right-sidebar { display: none; }
    .main-column { width: calc(100vw - 255px); flex: 1; }
}
@media (max-width: 720px) {
    .left-sidebar { width: 68px; padding-left: 7px; padding-right: 7px; }
    .nav-label, .post-label, .appearance-label, .mini-profile .profile-copy { display: none; }
    .sidebar-item { justify-content: center; padding-left: 0; padding-right: 0; }
    .post-icon { display: inline; }
    .appearance-box { padding: 8px 4px; }
    .appearance-box > div { flex-direction: column; align-items: center; }
    .main-column { width: calc(100vw - 68px); }

    /* Le nom "BI-PER" du logo déborde de la sidebar réduite à 68px
       et venait se superposer au contenu de la page suivante. */
    .left-sidebar .brand-stack span { display: none; }
    .brand-btn { padding: 8px 0 16px; display: flex; justify-content: center; width: 100%; }

    /* Messages sur mobile : on ne squeeze plus la liste des conversations
       en colonne de 76px (illisible). À la place, la liste prend tout
       l'écran, et la conversation ouverte glisse par-dessus en plein écran. */
    .messages-page { position: relative; }
    .messages-users { width: 100%; border-right: none; }
    .chat-panel {
        position: absolute;
        inset: 0;
        background: var(--bg-main);
        transform: translateX(100%);
        transition: transform .22s ease;
        z-index: 20;
    }
    .messages-page.chat-open .messages-users { display: none; }
    .messages-page.chat-open .chat-panel { transform: translateX(0); }
    .chat-header { padding-left: 54px; }
    .mobile-chat-back {
        display: none;
        position: absolute;
        left: 10px;
        top: 10px;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        background: var(--bg-card);
        border: 1px solid var(--border);
        z-index: 25;
    }
    .messages-page.chat-open .mobile-chat-back { display: flex; }
}

.verified-badge-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-left: 4px;
    cursor: help;
}

.verified-badge {
    width: 16px;
    height: 16px;
    display: inline-block;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25));
}

/* =========================================================
   BI-PER - POSTS : ALIGNEMENT NORMAL
   ========================================================= */

#feed .post-card,
#feed .post-card .post-body,
#feed .post-card .post-content,
#feed .post-card .post-head,
#feed .post-card .post-meta,
#feed .post-card .post-actions {
    text-align: left !important;
}

#feed .post-card .post-head {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    width: 100% !important;
}

#feed .post-card .post-body {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
}

#feed .post-card .post-meta {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    width: 100% !important;
}

#feed .post-card .post-content {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 8px 0 0 0 !important;
    padding: 0 !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    text-indent: 0 !important;
    align-self: auto !important;
    justify-self: auto !important;
    white-space: pre-wrap !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

#feed .post-card .post-content > *,
#feed .post-card .post-content span,
#feed .post-card .post-content div,
#feed .post-card .post-content p,
#feed .post-card .post-content a {
    text-align: left !important;
    display: inline !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    transform: none !important;
}

#feed .post-card .post-image {
    display: block !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

#feed .post-card .post-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    max-width: 480px !important;
}

/* Si Tailwind glisse une classe utilitaire dessus */
#feed .post-card .text-center { text-align: left !important; }
#feed .post-card .mx-auto { margin-left: 0 !important; margin-right: 0 !important; }
#feed .post-card .justify-center { justify-content: flex-start !important; }
#feed .post-card .items-center { align-items: flex-start !important; }

/* =========================================================
   BI-PER — COMPOSER : TEXTE TOUJOURS À GAUCHE
   ========================================================= */
#homePostText,
#modalPostText,
.composer textarea,
.modal-textarea {
    text-align: left !important;
    text-indent: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* =========================================================
   BLOC A — FEATURES FRONTEND
   ========================================================= */

/* Compteur de caractères */
.char-count {
    font-size: 13px;
    color: var(--text-secondary);
    margin-right: auto;
    margin-left: 10px;
    font-variant-numeric: tabular-nums;
}
.char-count.warn { color: #f59e0b; }
.char-count.danger { color: #f43f5e; font-weight: 700; }

/* Like animé */
@keyframes biperLikePop {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.4); }
    55%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}
.action-btn.like i.like-pop {
    animation: biperLikePop .38s ease;
    display: inline-block;
}

/* Bandeau "X nouveaux posts" */
.new-posts-banner {
    display: none;
    width: calc(100% - 32px);
    margin: 10px 16px;
    padding: 10px;
    border-radius: 999px;
    background: var(--belly-grad);
    color: white;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.new-posts-banner.show { display: block; }

/* Filtre par hashtag */
.hashtag-link {
    color: #38bdf8;
    cursor: pointer;
}
.hashtag-link:hover { text-decoration: underline; }
.hashtag-filter-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.hashtag-filter-bar.show { display: flex; }
.hashtag-filter-bar button {
    color: var(--text-secondary);
    font-weight: 700;
}
.hashtag-filter-bar button:hover { color: var(--text-main); }

/* Timestamps live */
.live-time { cursor: default; }

/* Lightbox images */
.post-image { cursor: zoom-in; }
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0,0,0,.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    backdrop-filter: blur(4px);
}
.lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.lightbox-close:hover { background: rgba(255,255,255,.22); }

/* Bouton Message sur le profil */
.profile-action-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.profile-action-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
}

/* =========================================================
   BLOC B — TEMPS RÉEL
   ========================================================= */

/* Statut en ligne */
.avatar-holder {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}
.online-dot {
    display: none;
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--bg-main);
}
.online-dot.show { display: block; }

/* Badge non-lu Messages */
.message-user { position: relative; }
.message-user.unread .message-user-copy .font-bold { font-weight: 900; }
.unread-dot {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--belly-grad);
    flex-shrink: 0;
}

/* Indicateur "en train d'écrire..." */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    font-size: 12px;
    color: var(--text-secondary);
}
.typing-dots {
    display: inline-flex;
    gap: 3px;
}
.typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: biperTypingBounce 1.1s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes biperTypingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* =========================================================
   BLOC B — TEMPS RÉEL (statut en ligne, typing, non-lu)
   ========================================================= */

/* Statut en ligne : point vert sur l'avatar */
.avatar-holder {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}
.online-dot {
    display: none;
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--bg-main);
    z-index: 2;
}
.online-dot.show { display: block; }

/* Indicateur "en train d'écrire..." */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 18px 8px;
    font-size: 12px;
    color: var(--text-secondary);
}
.typing-indicator.hidden { display: none !important; }
.typing-dots {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}
.typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: biperTyping 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes biperTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: .4; }
    30%           { transform: translateY(-4px); opacity: 1; }
}

/* Conversation non lue */
.message-user.unread .font-bold { color: var(--text-main); }
.message-user.unread .text-secondary { color: var(--text-main) !important; font-weight: 600; }
.unread-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--belly-grad);
    margin-left: auto;
    flex-shrink: 0;
}