/* Real Time Rital 2 — Pseudo à l'extérieur, une unique bulle noire avec pointe.
   La teinte optionnelle est mélangée au fond : aucune seconde forme superposée. */
:root { --rt-chat-bubble-opacity: 0; }
#messages .message.rt-chat-bubble-row,
#messages .message.rt-chat-bubble-row:hover {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    margin: 7px 0 !important;
    padding: 3px 8px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    text-align: left !important;
}
#messages .message.rt-chat-bubble-row .rt-chat-bubble-sender {
    display:flex !important;
    align-items:center !important;
    flex:0 1 auto !important;
    max-width: min(35%, 290px);
    min-width:0;
    gap: 6px;
}
#messages .message.rt-chat-bubble-row .rt-chat-bubble-sender .sender {
    display:inline-block !important;
    flex:0 1 auto !important;
    min-width:0;
    margin:0 !important;
    padding:0 !important;
    white-space:normal !important;
    overflow-wrap:anywhere;
    text-align:left !important;
}
#messages .message.rt-chat-bubble-row .rt-chat-bubble-sender .salon-message-avatar {
    float:none !important;
    display:block !important;
    width:40px !important;
    height:40px !important;
    min-width:40px !important;
    min-height:40px !important;
    max-width:40px !important;
    max-height:40px !important;
    flex:0 0 40px !important;
    margin:0 6px 0 0 !important;
    object-fit:cover;
}
#messages .message.rt-chat-bubble-row .rt-chat-text-bubble {
    --rt-chat-bubble-rgb: 255,255,255;
    position:relative;
    display:flex;
    flex:1 1 0;
    align-items:flex-start;
    gap:12px;
    min-width:0;
    width:auto;
    max-width:100%;
    padding:10px 12px;
    margin:0;
    box-sizing:border-box;
    color:#eee;
    border-radius:15px;
    background-color:rgba(0,0,0,.76) !important;
    background-image:linear-gradient(rgba(var(--rt-chat-bubble-rgb),var(--rt-chat-bubble-opacity)),rgba(var(--rt-chat-bubble-rgb),var(--rt-chat-bubble-opacity))) !important;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.10),0 2px 7px rgba(0,0,0,.12) !important;
    isolation:isolate;
}
#messages .message.rt-chat-bubble-row .rt-chat-text-bubble::before {
    content:"";
    position:absolute;
    left:-6px;
    top:16px;
    width:13px;
    height:13px;
    transform:rotate(45deg);
    border-radius:2px;
    background-color:rgba(0,0,0,.76) !important;
    background-image:linear-gradient(rgba(var(--rt-chat-bubble-rgb),var(--rt-chat-bubble-opacity)),rgba(var(--rt-chat-bubble-rgb),var(--rt-chat-bubble-opacity))) !important;
    pointer-events:none;
    z-index:-1;
}
#messages .message.rt-chat-bubble-row .rt-chat-text-bubble > .message-text {
    display:block !important;
    flex:1 1 auto !important;
    min-width:0 !important;
    width:auto;
    max-width:100% !important;
    white-space:pre-wrap !important;
    overflow-wrap:anywhere;
    word-break:break-word;
    text-align:left;
    align-self:center;
    margin:0;
    padding:0;
}
#messages .message.rt-chat-bubble-row .rt-chat-text-bubble > .timestamp {
    display:block;
    flex:0 0 auto;
    align-self:flex-end !important;
    margin:0 0 0 auto !important;
    white-space:nowrap;
    font-size:.72em;
}
@media (max-width:768px) {
    #messages .message.rt-chat-bubble-row,
    #messages .message.rt-chat-bubble-row:has(.salon-message-avatar) {
        display:flex !important;
        flex-wrap:nowrap !important;
        align-items:flex-start !important;
        gap:9px !important;
        padding:3px 4px !important;
    }
    #messages .message.rt-chat-bubble-row .rt-chat-bubble-sender {max-width:43%;gap:2px;}
    #messages .message.rt-chat-bubble-row .rt-chat-bubble-sender .sender {font-size:.88em !important;}
    #messages .message.rt-chat-bubble-row .rt-chat-bubble-sender .salon-message-avatar {
        width:25px !important;height:25px !important;
        min-width:25px !important;min-height:25px !important;
        max-width:25px !important;max-height:25px !important;
        flex:0 0 25px !important;margin:0 3px 0 0 !important;
    }
    #messages .message.rt-chat-bubble-row .rt-chat-text-bubble {
        display:block;
        min-width:0;
        padding:8px 10px;
    }
    #messages .message.rt-chat-bubble-row .rt-chat-text-bubble > .timestamp {
        display:block;
        margin-top:4px !important;
        text-align:right;
    }
    #messages .message.rt-chat-bubble-row .rt-chat-text-bubble::before {top:12px;}
}

/* V2 — annonces Systeme : avatar BOT identique aux avatars membres,
   sans la bande / infobulle noire d'origine. Ne concerne pas les bots profils. */
#messages .message.rt-chat-system-bot-row,
#messages .message.rt-chat-system-bot-row:hover {
    background: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-left: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}
#messages .message.rt-chat-system-bot-row .rt-chat-system-bot-sender {
    flex: 0 0 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    gap: 0 !important;
}
#messages .message.rt-chat-system-bot-row .rt-chat-default-bot-avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    flex: 0 0 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    cursor: default !important;
    pointer-events: none !important;
}
#messages .message.rt-chat-system-bot-row .rt-chat-system-bot-sender .sender {
    display: none !important;
}
#messages .message.rt-chat-system-bot-row .rt-chat-bot-message-body {
    display: flex !important;
    align-items: center !important;
    flex: 1 1 0 !important;
    gap: 12px;
    min-width: 0 !important;
    max-width: 100%;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}
#messages .message.rt-chat-system-bot-row .rt-chat-bot-message-body > .message-text {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    align-self: center !important;
    color: #f3e9cf;
    font-family: 'Trebuchet MS', 'Segoe UI', sans-serif !important;
    font-weight: 750 !important;
    letter-spacing: .1px;
    line-height: 1.45;
    white-space: pre-wrap !important;
    overflow-wrap: anywhere;
    word-break: break-word;
}
#messages .message.rt-chat-system-bot-row .rt-chat-bot-message-body > .timestamp {
    display: block !important;
    flex: 0 0 auto !important;
    margin: 0 0 0 auto !important;
    align-self: center !important;
    font-size: .72em;
    white-space: nowrap;
}
@media (max-width: 768px) {
    #messages .message.rt-chat-system-bot-row .rt-chat-system-bot-sender {
        flex: 0 0 25px !important;
        width: 25px !important;
        min-width: 25px !important;
        max-width: 25px !important;
    }
    #messages .message.rt-chat-system-bot-row .rt-chat-default-bot-avatar {
        width: 25px !important;
        height: 25px !important;
        min-width: 25px !important;
        min-height: 25px !important;
        max-width: 25px !important;
        max-height: 25px !important;
        flex: 0 0 25px !important;
    }
    #messages .message.rt-chat-system-bot-row .rt-chat-bot-message-body {
        display: block !important;
    }
    #messages .message.rt-chat-system-bot-row .rt-chat-bot-message-body > .timestamp {
        display: block !important;
        margin-top: 4px !important;
        text-align: right;
        align-self: flex-end !important;
        font-size: .68em;
    }
}

/* V2 medias : photos, stickers, GIF, fichiers audio/video et YouTube
   dans la même forme noire teintée que les textes. Pas de deuxième superposition. */
#messages .message.rt-chat-bubble-row .rt-chat-text-bubble > img,
#messages .message.rt-chat-bubble-row .rt-chat-text-bubble > video,
#messages .message.rt-chat-bubble-row .rt-chat-text-bubble > iframe,
#messages .message.rt-chat-bubble-row .rt-chat-text-bubble > .rt-chat-media-wrap {
    display: block;
    max-width: 100% !important;
    min-width: 0;
    box-sizing: border-box;
    align-self: flex-start;
}
#messages .message.rt-chat-bubble-row .rt-chat-text-bubble > iframe {
    width: min(350px, 100%) !important;
    aspect-ratio: 350 / 197;
    height: auto !important;
}
#messages .message.rt-chat-bubble-row .rt-chat-text-bubble > .rt-chat-media-wrap,
#messages .message.rt-chat-bubble-row .rt-chat-text-bubble .rt-chat-media-player,
#messages .message.rt-chat-bubble-row .rt-chat-text-bubble .message-text img,
#messages .message.rt-chat-bubble-row .rt-chat-text-bubble .message-text iframe,
#messages .message.rt-chat-bubble-row .rt-chat-text-bubble .message-text video {
    max-width: 100% !important;
    box-sizing: border-box;
}
@media (max-width:768px) {
    #messages .message.rt-chat-bubble-row .rt-chat-text-bubble > img,
    #messages .message.rt-chat-bubble-row .rt-chat-text-bubble > video,
    #messages .message.rt-chat-bubble-row .rt-chat-text-bubble > iframe {
        max-height: 230px;
    }
}


/* V2 : médias opaques (photos, GIF, stickers, YouTube, MP3/MP4).
   Même fond teinté que les phrases. Une bordure colorée fine rend la teinte
   perceptible malgré la grande surface noire/image ; aucun élément superposé. */
#messages .message.rt-chat-media-bubble-row .rt-chat-text-bubble.rt-chat-media-bubble {
    flex-direction:column !important;
    align-items:flex-start !important;
    justify-content:center;
    gap:7px !important;
    min-height:48px;
    padding:11px 13px !important;
    border:1px solid rgba(var(--rt-chat-bubble-rgb),var(--rt-chat-bubble-opacity)) !important;
    background-color:rgba(0,0,0,.76) !important;
    background-image:linear-gradient(rgba(var(--rt-chat-bubble-rgb),var(--rt-chat-bubble-opacity)),rgba(var(--rt-chat-bubble-rgb),var(--rt-chat-bubble-opacity))) !important;
}
#messages .message.rt-chat-media-bubble-row .rt-chat-text-bubble.rt-chat-media-bubble > .timestamp {
    align-self:flex-end !important;
    margin:2px 0 0 auto !important;
}
#messages .message.rt-chat-media-bubble-row .rt-chat-text-bubble.rt-chat-media-bubble > .message-text {
    width:100% !important;
    flex:0 1 auto !important;
    align-self:stretch !important;
}
#messages .message.rt-chat-media-bubble-row .rt-chat-text-bubble.rt-chat-media-bubble > img,
#messages .message.rt-chat-media-bubble-row .rt-chat-text-bubble.rt-chat-media-bubble > video,
#messages .message.rt-chat-media-bubble-row .rt-chat-text-bubble.rt-chat-media-bubble > iframe,
#messages .message.rt-chat-media-bubble-row .rt-chat-text-bubble.rt-chat-media-bubble > .rt-chat-media-wrap {
    max-width:100% !important;
    min-width:0 !important;
    flex-shrink:1 !important;
}
