/* ── Causette — Professional B&W ──────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design Tokens ───────────────────────────────────────────── */
:root {
    /* Fond & surfaces */
    --bg-main:     #FFFFFF;
    --bg-side:     #F8F8F8;
    --bg-hover:    #F0F0F0;
    --bg-active:   #0D0D0D;
    --bg-input:    #F5F5F5;
    --bg-msg-in:   #F0F0F0;
    --bg-msg-out:  #0D0D0D;

    /* Bordures */
    --border:      #E8E8E8;
    --border-focus:#0D0D0D;

    /* Texte */
    --text:        #0D0D0D;
    --text-mid:    #6B6B6B;
    --text-dim:    #AAAAAA;
    --text-invert: #FFFFFF;

    /* Composants */
    --badge-bg:    #0D0D0D;
    --badge-text:  #FFFFFF;
    --dot-online:  #3DAD72;
    --dot-offline: #D0D0D0;
    --dot-away:    #F0A030;

    /* Layout */
    --sidebar-w:   340px;
    --radius-sm:   8px;
    --radius-md:   12px;
    --radius-lg:   20px;
    --radius-pill: 100px;
    --radius-item: 10px;

    /* Champ de saisie */
    --input-border: #C8C8C8;
    --focus-ring:   rgba(13,13,13,.08);

    /* Ombres */
    --shadow-card: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --shadow-msg:  0 1px 2px rgba(0,0,0,.06);
}

/* ── Dark mode ───────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-main:     #1C1C1C;
        --bg-side:     #161616;
        --bg-hover:    #242424;
        --bg-active:   #FFFFFF;
        --bg-input:    #242424;
        --bg-msg-in:   #2A2A2A;
        --bg-msg-out:  #FFFFFF;
        --border:      #2E2E2E;
        --border-focus:#FFFFFF;
        --text:        #F0F0F0;
        --text-mid:    #9A9A9A;
        --text-dim:    #636363;
        --text-invert: #161616;
        --badge-bg:    #FFFFFF;
        --badge-text:  #161616;
        --dot-offline: #3A3A3A;
        --input-border: #4A4A4A;
        --focus-ring:   rgba(255,255,255,.10);
        --shadow-card: 0 1px 3px rgba(0,0,0,.5), 0 4px 16px rgba(0,0,0,.4);
        --shadow-msg:  0 1px 2px rgba(0,0,0,.4);
    }
}
:root[data-theme="dark"] {
    --bg-main:     #1C1C1C;
    --bg-side:     #161616;
    --bg-hover:    #242424;
    --bg-active:   #FFFFFF;
    --bg-input:    #242424;
    --bg-msg-in:   #2A2A2A;
    --bg-msg-out:  #FFFFFF;
    --border:      #2E2E2E;
    --border-focus:#FFFFFF;
    --text:        #F0F0F0;
    --text-mid:    #9A9A9A;
    --text-dim:    #636363;
    --text-invert: #161616;
    --badge-bg:    #FFFFFF;
    --badge-text:  #161616;
    --dot-offline: #3A3A3A;
    --input-border: #4A4A4A;
    --focus-ring:   rgba(255,255,255,.10);
    --shadow-card: 0 1px 3px rgba(0,0,0,.5), 0 4px 16px rgba(0,0,0,.4);
    --shadow-msg:  0 1px 2px rgba(0,0,0,.4);
}
:root[data-theme="light"] {
    --bg-main:     #FFFFFF;
    --bg-side:     #F8F8F8;
    --bg-hover:    #F0F0F0;
    --bg-active:   #0D0D0D;
    --bg-input:    #F5F5F5;
    --bg-msg-in:   #F0F0F0;
    --bg-msg-out:  #0D0D0D;
    --border:      #E8E8E8;
    --border-focus:#0D0D0D;
    --text:        #0D0D0D;
    --text-mid:    #6B6B6B;
    --text-dim:    #AAAAAA;
    --text-invert: #FFFFFF;
    --badge-bg:    #0D0D0D;
    --badge-text:  #FFFFFF;
    --dot-offline: #D0D0D0;
    --input-border: #C8C8C8;
    --focus-ring:   rgba(13,13,13,.08);
    --shadow-card: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --shadow-msg:  0 1px 2px rgba(0,0,0,.06);
}

/* ── Base ─────────────────────────────────────────────────────── */
body {
    font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-main);
    color: var(--text);
    height: 100vh; height: 100dvh;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── Auth Screen ──────────────────────────────────────────────── */
#auth-screen {
    display: none;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg-side);
}

.auth-card {
    background: var(--bg-main);
    border-radius: 18px;
    padding: 44px 40px;
    width: 400px;
    max-width: 95vw;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 34px;
}
.auth-logo-icon {
    width: 40px; height: 40px;
    background: var(--text);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.auth-logo-icon svg { width: 22px; height: 22px; fill: var(--text-invert); }
.auth-logo-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.5px;
}

.auth-form { display: flex; flex-direction: column; }
.auth-form h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 22px;
    color: var(--text);
}

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.form-group input {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    outline: none;
    background: var(--bg-input);
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus {
    border-color: var(--border-focus);
    background: var(--bg-main);
    box-shadow: 0 0 0 3px rgba(13,13,13,.06);
}
.form-group input::placeholder { color: var(--text-dim); }

.btn-primary {
    background: var(--bg-active);
    color: var(--text-invert);
    border: none;
    border-radius: var(--radius-sm);
    padding: 13px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    width: 100%;
    letter-spacing: .01em;
    margin-top: 4px;
}
.btn-primary:hover:not(:disabled)  { opacity: .85; }
.btn-primary:active:not(:disabled) { transform: scale(.98); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

.auth-switch {
    text-align: center;
    color: var(--text-mid);
    font-size: 13px;
    margin-top: 18px;
}
.auth-switch a {
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border-bottom: 1.5px solid var(--text);
}

/* ── App Layout ───────────────────────────────────────────────── */
#app-screen {
    display: none;
    width: 100%;
    height: 100vh; height: 100dvh;
}
.app-container {
    display: flex;
    width: 100%;
    height: 100vh; height: 100dvh;
    overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-width: 260px;
    background: var(--bg-side);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 18px 16px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon-wrap {
    width: 32px; height: 32px;
    background: var(--text);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.brand-icon-wrap svg { width: 16px; height: 16px; fill: var(--text-invert); }
.brand-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.4px;
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.theme-toggle {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--bg-main);
    color: var(--text-mid);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .15s, color .15s, background .15s;
    flex-shrink: 0;
}
.theme-toggle svg { width: 15px; height: 15px; }
.theme-toggle:hover {
    border-color: var(--text);
    color: var(--text);
    background: var(--bg-hover);
}

.plus-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--bg-main);
    color: var(--text-mid);
    font-size: 19px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .15s, color .15s, background .15s;
}
.plus-btn:hover {
    border-color: var(--text);
    color: var(--text);
    background: var(--bg-hover);
}

.dm-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--bg-active);
    background: var(--bg-active);
    color: var(--text-invert);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: opacity .15s, transform .12s;
    flex-shrink: 0;
}
.dm-btn svg { width: 14px; height: 14px; }
.dm-btn:hover { opacity: .78; transform: scale(1.08); }
body.anon-mode .dm-btn { display: none; }

/* Petit avatar dans le header (gardé pour compatibilité) */
.user-av-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-invert);
    font-family: inherit;
    flex-shrink: 0;
    transition: opacity .15s;
}
.user-av-btn:hover { opacity: .8; }

/* ── Footer utilisateur (bas de sidebar) ─────────────────────── */
.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-side);
    flex-shrink: 0;
}

.user-av-footer {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    cursor: default;
    font-family: inherit;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
}

.footer-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.footer-username {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.footer-status {
    font-size: 11.5px;
    color: var(--dot-online);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}
.footer-status::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--dot-online);
    flex-shrink: 0;
}

.logout-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-mid);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s, border-color .15s;
    flex-shrink: 0;
}
.logout-btn svg { width: 15px; height: 15px; }
.logout-btn:hover {
    background: rgba(192,48,32,.09);
    border-color: #C03020;
    color: #C03020;
}

/* ── Recherche ────────────────────────────────────────────────── */
.search-wrap {
    padding: 0 14px 14px;
    position: relative;
}
.search-wrap svg {
    position: absolute;
    left: 26px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px; height: 14px;
    color: var(--text-dim);
    pointer-events: none;
}
.search-wrap input {
    width: 100%;
    background: var(--bg-main);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 9px 16px 9px 36px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    color: var(--text);
    outline: none;
    transition: border-color .15s;
}
.search-wrap input::placeholder { color: var(--text-dim); }
.search-wrap input:focus { border-color: var(--border-focus); }

/* ── Feed ─────────────────────────────────────────────────────── */
.conv-feed {
    flex: 1;
    overflow-y: auto;
    padding: 4px 10px 16px;
}
.conv-feed::-webkit-scrollbar { width: 4px; }
.conv-feed::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.conv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px;
    cursor: pointer;
    border-radius: var(--radius-item);
    transition: background .12s;
    position: relative;
    margin-bottom: 2px;
}
.conv-item:hover  { background: var(--bg-hover); }
.conv-item.active {
    background: var(--bg-active);
}
.conv-item.active .conv-name,
.conv-item.active .conv-preview,
.conv-item.active .conv-time     { color: var(--text-invert) !important; }
.conv-item.active .conv-preview  { opacity: .65; }
.conv-item.active .conv-time     { opacity: .5; }

/* ── Avatars ──────────────────────────────────────────────────── */
.conv-av {
    position: relative;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
}
.av-circle {
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    color: white;
    position: absolute;
    top: 0; left: 0;
    width: 46px; height: 46px;
    font-size: 15px;
    overflow: hidden;
}

/* Groupe : deux cercles superposés */
.conv-av.is-group { width: 50px; }
.av-back {
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    color: white;
    position: absolute;
    bottom: 0; right: 0;
    width: 32px; height: 32px;
    font-size: 11px;
    overflow: hidden;
}
.av-front {
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    color: white;
    position: absolute;
    top: 0; left: 0;
    width: 32px; height: 32px;
    font-size: 11px;
    border: 2.5px solid var(--bg-side);
    z-index: 1;
    overflow: hidden;
}
.conv-item.active .av-front { border-color: var(--bg-active); }
.conv-item:hover  .av-front { border-color: var(--bg-hover); }

/* Point de statut */
.status-dot {
    width: 11px; height: 11px;
    border-radius: 50%;
    border: 2px solid var(--bg-side);
    position: absolute;
    bottom: 1px; right: 1px;
    z-index: 2;
}
.conv-item.active .status-dot { border-color: var(--bg-active); }
.conv-item:hover  .status-dot { border-color: var(--bg-hover); }
.s-online  { background: var(--dot-online); }
.s-offline { background: var(--dot-offline); }
.s-away    { background: var(--dot-away); }

/* ── Corps de l'item ──────────────────────────────────────────── */
.conv-body { flex: 1; min-width: 0; }
.conv-top  { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.conv-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conv-time {
    font-size: 11px;
    color: var(--text-dim);
    white-space: nowrap;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.conv-bot  { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.conv-preview {
    font-size: 12.5px;
    color: var(--text-mid);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.conv-badge {
    background: var(--badge-bg);
    color: var(--badge-text);
    font-size: 10.5px;
    font-weight: 800;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: var(--radius-pill);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.empty-list {
    padding: 36px 16px;
    color: var(--text-dim);
    font-size: 13px;
    text-align: center;
    font-weight: 500;
    line-height: 1.7;
}

/* ── User Menu ────────────────────────────────────────────────── */
.user-menu-wrap { position: relative; }
#user-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-main);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    min-width: 188px;
    padding: 6px;
    z-index: 200;
    border: 1px solid var(--border);
}
.user-menu-name {
    padding: 8px 10px 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.menu-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-mid);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    transition: background .12s, color .12s;
}
.menu-item:hover { background: var(--bg-hover); color: var(--text); }
.menu-item.danger { color: #C03020; }
.menu-item.danger:hover { background: rgba(192,48,32,.07); color: #C03020; }
.menu-item svg { flex-shrink: 0; opacity: .7; }

/* ── Zone de chat ─────────────────────────────────────────────── */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
    min-width: 0;
}

/* État vide */
#empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
}
.empty-chat-icon { width: 56px; height: 56px; color: var(--border); }
#empty-state p {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dim);
}

/* Panel de chat */
#chat-panel { display: none; flex-direction: column; height: 100%; }

/* ── Topbar ───────────────────────────────────────────────────── */
.chat-topbar {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-main);
    flex-shrink: 0;
}
.topbar-av { position: relative; flex-shrink: 0; width: 40px; height: 40px; }
.topbar-av .av-circle { width: 40px; height: 40px; font-size: 13px; }
.topbar-av.is-group   { width: 44px; }
.topbar-av .av-back   { width: 27px; height: 27px; font-size: 9px; }
.topbar-av .av-front  { width: 27px; height: 27px; font-size: 9px; border-width: 2px; border-color: var(--bg-main); }

.topbar-info { flex: 1; min-width: 0; }
#chat-name-header {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#chat-subtitle { font-size: 12px; color: var(--text-mid); font-weight: 500; margin-top: 1px; }

#chat-options-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-mid);
    transition: background .12s, color .12s;
    flex-shrink: 0;
}
#chat-options-btn:hover { background: var(--bg-hover); color: var(--text); }

/* ── Messages ─────────────────────────────────────────────────── */
#messages-panel {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: var(--bg-main);
}
#messages-panel::-webkit-scrollbar { width: 5px; }
#messages-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.date-sep { text-align: center; padding: 14px 0 8px; }
.date-sep span {
    background: var(--bg-side);
    color: var(--text-mid);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 13px;
    border-radius: var(--radius-pill);
    letter-spacing: .03em;
    border: 1px solid var(--border);
}

.msg-row { display: flex; align-items: flex-end; gap: 8px; max-width: 70%; }
.msg-row.mine   { align-self: flex-end;   flex-direction: row-reverse; }
.msg-row.theirs { align-self: flex-start; }

.msg-av {
    width: 26px; height: 26px; min-width: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 800; color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.msg-wrap { display: flex; flex-direction: column; gap: 2px; }
.msg-sender-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-mid);
    padding-left: 14px;
    margin-bottom: 1px;
    letter-spacing: .01em;
}

.msg-bubble {
    padding: 9px 14px;
    border-radius: 18px;
    display: flex;
    align-items: flex-end;
    gap: 9px;
    line-height: 1.5;
}
.mine   .msg-bubble {
    background: var(--bg-msg-out);
    color: var(--text-invert);
    border-bottom-right-radius: 4px;
}
.theirs .msg-bubble {
    background: var(--bg-msg-in);
    color: var(--text);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-msg);
}

.msg-text { font-size: 14px; word-break: break-word; font-weight: 500; }
.msg-time {
    font-size: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: flex-end;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}
.mine   .msg-time { color: rgba(255,255,255,.45); }
.theirs .msg-time { color: var(--text-dim); }
.msg-read { font-size: 10px; margin-left: 1px; }
.mine .msg-read { color: rgba(255,255,255,.5); }

.no-msgs, .error-msg {
    color: var(--text-mid);
    text-align: center;
    margin: auto;
    font-size: 14px;
    font-weight: 500;
}
.loading-msgs { display: flex; align-items: center; justify-content: center; height: 100%; }

/* ── Saisie de message ────────────────────────────────────────── */
.msg-input-bar {
    padding: 14px 18px;
    border-top: 2px solid var(--border);
    background: var(--bg-side);
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-shrink: 0; /* empêche le panel messages d'écraser la barre */
}
#msg-input {
    flex: 1;
    background: var(--bg-main);
    border: 2px solid var(--input-border);
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    outline: none;
    resize: none;
    color: var(--text);
    min-height: 54px;
    max-height: 180px;
    line-height: 1.6;
    transition: border-color .15s, box-shadow .15s;
    display: block;
}
#msg-input::placeholder { color: var(--text-dim); }
#msg-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.send-btn {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--bg-active);
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: opacity .15s, transform .1s;
    margin-bottom: 3px;
}
.send-btn:hover  { opacity: .8; }
.send-btn:active { transform: scale(.9); }
.send-btn svg    { width: 17px; height: 17px; fill: var(--text-invert); }

/* ── Modaux ───────────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(13,13,13,.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.modal-card {
    background: var(--bg-main);
    border-radius: 18px;
    padding: 28px;
    width: 460px;
    max-width: 95vw;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}
.modal-header h2 { font-size: 17px; font-weight: 800; color: var(--text); }
.modal-close {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--bg-hover);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-mid);
    display: flex; align-items: center; justify-content: center;
    transition: background .12s, color .12s;
}
.modal-close:hover { background: var(--border); color: var(--text); }

.modal-body { display: flex; flex-direction: column; gap: 16px; }
.modal-body .form-group input,
.modal-body .form-group textarea {
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    outline: none;
    resize: vertical;
    color: var(--text);
    transition: border-color .15s;
}
.modal-body .form-group input:focus,
.modal-body .form-group textarea:focus { border-color: var(--border-focus); background: var(--bg-main); }
.modal-body .form-group input::placeholder,
.modal-body .form-group textarea::placeholder { color: var(--text-dim); }

.members-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    padding: 6px;
    display: flex; flex-direction: column; gap: 2px;
}
.member-check {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    transition: background .12s;
}
.member-check:hover { background: var(--bg-main); }
.member-check input[type=checkbox] {
    width: 15px; height: 15px;
    accent-color: var(--text);
    cursor: pointer;
}
.member-av-sm {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800; color: white;
    overflow: hidden;
    flex-shrink: 0;
}

/* Bouton chat privé dans la liste membres */
.btn-dm-member {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1.5px solid var(--border-focus);
    background: none;
    color: var(--text);
    font-size: 12px; font-weight: 600;
    cursor: pointer; font-family: inherit;
    transition: background .13s, color .13s;
    white-space: nowrap;
}
.btn-dm-member svg { width: 12px; height: 12px; }
.btn-dm-member:hover { background: var(--bg-active); color: var(--text-invert); border-color: var(--bg-active); }

/* Item cliquable dans le modal DM */
.dm-user-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .12s;
}
.dm-user-item:hover { background: var(--bg-side); }
.dm-user-item .conv-name { font-weight: 700; font-size: 13.5px; }
.dm-user-item .conv-preview { font-size: 12px; color: var(--text-dim); }

/* Membres dans le modal info */
.member-row {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    transition: background .12s;
}
.member-row:hover { background: var(--bg-side); }
.member-av-md {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800; color: white;
    flex-shrink: 0;
    overflow: hidden;
}
/* Images dans les conteneurs d'avatar — remplissage complet */
.av-circle img, .av-back img, .av-front img,
.msg-av img, .member-av-sm img, .member-av-md img,
.user-av-footer img {
    width: 100%; height: 100%;
    display: block;
    object-fit: cover;
}

.member-uname { flex: 1; font-size: 14px; font-weight: 700; }
.role-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--border);
}
.role-admin  { background: var(--text); color: var(--text-invert); border-color: var(--text); }
.role-member { background: transparent; color: var(--text-mid); }

/* ── Toasts ───────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 26px; right: 26px;
    background: var(--text);
    color: var(--text-invert);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    z-index: 9999;
    transform: translateY(14px);
    opacity: 0;
    transition: all .24s cubic-bezier(.34,1.56,.64,1);
    box-shadow: var(--shadow-card);
    max-width: 300px;
}
.toast.show       { transform: translateY(0); opacity: 1; }
.toast-success    { background: #1A6E3A; }
.toast-error      { background: #A02818; }

/* ── Spinner ──────────────────────────────────────────────────── */
.spin-sm {
    width: 22px; height: 22px;
    border: 2.5px solid var(--border);
    border-top-color: var(--text);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Bouton retour mobile (masqué sur desktop) ───────────────── */
#mobile-back-btn {
    display: none;
    width: 38px; height: 38px;
    border-radius: 50%;
    border: none;
    background: none;
    cursor: pointer;
    align-items: center; justify-content: center;
    color: var(--text-mid);
    flex-shrink: 0;
    transition: background .12s, color .12s;
    margin-right: 2px;
}
#mobile-back-btn svg { width: 22px; height: 22px; }
#mobile-back-btn:hover { background: var(--bg-hover); color: var(--text); }

/* ── Responsive mobile ───────────────────────────────────────── */
@media (max-width: 680px) {

    /* Viewport dynamique (hauteur correcte avec le clavier) */
    body            { height: 100dvh; overflow: hidden; }
    #app-screen     { height: 100dvh; }
    .app-container  { height: 100dvh; }

    /* ── Sidebar plein écran ──────────────────────────────────── */
    :root { --sidebar-w: 100vw; }
    .sidebar { width: 100%; min-width: 0; }

    /* Sidebar header : réduire un peu */
    .sidebar-header { padding: 16px 14px 12px; }
    .brand-name { font-size: 18px; }

    /* ── Chat : masqué par défaut, full quand .chat-open ─────── */
    .chat-main { display: none; }
    .app-container.chat-open .sidebar   { display: none; }
    .app-container.chat-open .chat-main { display: flex; width: 100%; }

    /* ── Bouton retour ───────────────────────────────────────── */
    #mobile-back-btn { display: flex; }

    /* ── Topbar ──────────────────────────────────────────────── */
    .chat-topbar { padding: 10px 12px; gap: 8px; }
    #chat-name-header { font-size: 14px; }

    /* ── Bulles de messages ──────────────────────────────────── */
    .msg-row { max-width: 86%; }
    #messages-panel { padding: 16px 12px; }

    /* ── Barre de saisie ─────────────────────────────────────── */
    .msg-input-bar {
        padding: 10px 10px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }
    #msg-input {
        font-size: 16px; /* évite le zoom iOS */
        padding: 11px 16px;
        min-height: 48px;
    }
    .send-btn { width: 44px; height: 44px; }

    /* ── Modales — bottom sheet ──────────────────────────────── */
    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal-card {
        width: 100%;
        max-width: 100%;
        max-height: 90dvh;
        border-radius: 20px 20px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    /* ── Écran d'auth — plein écran scrollable ───────────────── */
    #auth-screen {
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .auth-card {
        width: 100%;
        max-width: 100%;
        min-height: 100%;
        border-radius: 0;
        padding: 28px 20px 48px;
        box-shadow: none;
        border: none;
    }

    /* ── Toasts ──────────────────────────────────────────────── */
    .toast {
        left: 12px;
        right: 12px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        max-width: none;
    }

    /* ── Footer sidebar ──────────────────────────────────────── */
    .sidebar-footer {
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    }
}

/* ── Mode anonyme ─────────────────────────────────────────────── */

/* Auth screen en modal overlay (sur l'app) */
#auth-screen {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(13,13,13,.55);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
}

/* Bouton fermer la modale auth */
.auth-dismiss {
    position: absolute;
    top: 16px; right: 18px;
    width: 28px; height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--bg-hover);
    color: var(--text-mid);
    font-size: 14px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .12s, color .12s;
}
.auth-dismiss:hover { background: var(--border); color: var(--text); }
.auth-card { position: relative; }

/* ── Boutons OAuth ──────────────────────────────────────── */
.oauth-section {
    margin-top: 6px;
}
.oauth-sep {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 16px;
    color: var(--text-dim);
    font-size: 12px;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.oauth-sep::before,
.oauth-sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .14s, box-shadow .14s, opacity .14s;
    border: 1.5px solid var(--border);
    background: var(--bg-main);
    color: var(--text);
    margin-bottom: 10px;
}
.oauth-btn svg { flex-shrink: 0; width: 20px; height: 20px; }
.oauth-btn:hover:not(:disabled) { background: var(--bg-hover); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.oauth-btn:active:not(:disabled) { transform: scale(.98); }
.oauth-btn:disabled { opacity: .4; cursor: not-allowed; }

.apple-btn { background: var(--bg-active); color: var(--text-invert); border-color: transparent; }
.apple-btn svg { fill: var(--text-invert); }
.apple-btn:hover:not(:disabled) { opacity: .88; background: var(--bg-active); }

/* Lien parcourir anonymement */
.auth-anon-link {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-dim);
}
.auth-anon-link a {
    color: var(--text-mid);
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    border-bottom: 1px dashed var(--text-dim);
    transition: color .12s, border-color .12s;
}
.auth-anon-link a:hover { color: var(--text); border-color: var(--text); }

/* Footer anonyme */
.anon-footer { gap: 11px; }
.anon-footer-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1.5px dashed var(--border);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--text-dim);
}
.anon-footer-icon svg { width: 18px; height: 18px; }
.anon-footer .footer-status { color: var(--text-dim); }
.anon-footer .footer-status::before { background: var(--dot-offline); }

/* Bouton Se connecter (dans footer anon) */
.anon-login-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-mid);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s, border-color .15s;
    flex-shrink: 0;
}
.anon-login-btn svg { width: 15px; height: 15px; }
.anon-login-btn:hover {
    background: var(--bg-active);
    border-color: var(--bg-active);
    color: var(--text-invert);
}

/* Bandeau "Connectez-vous" dans la barre de saisie */
#anon-input-notice {
    width: 100%;
    display: none;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-input);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-mid);
    font-size: 13.5px;
    font-weight: 600;
}
#anon-input-notice svg {
    width: 18px; height: 18px;
    flex-shrink: 0;
    color: var(--text-dim);
}
#anon-input-notice span { flex: 1; }
#anon-notice-login {
    background: var(--bg-active);
    color: var(--text-invert);
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .15s;
    flex-shrink: 0;
}
#anon-notice-login:hover { opacity: .82; }

/* En mode anon : masquer bouton nouveau groupe */
body.anon-mode #new-group-btn { display: none; }

/* En mode anon : empêcher la copie des messages */
body.anon-mode #messages-panel { user-select: none; -webkit-user-select: none; }

/* ── Bandeau demande d'adhésion ───────────────────────────────── */
#join-request-notice {
    width: 100%;
    display: none;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-mid);
}
#join-request-notice.state-none {
    background: var(--bg-input);
    border: 2px dashed var(--border);
}
#join-request-notice.state-pending {
    background: rgba(240,160,48,.08);
    border: 2px dashed rgba(240,160,48,.35);
    color: #9A6010;
}
#join-request-notice.state-rejected {
    background: rgba(192,48,32,.06);
    border: 2px dashed rgba(192,48,32,.25);
    color: #A03020;
}
#join-request-notice svg {
    width: 18px; height: 18px;
    flex-shrink: 0;
    color: currentColor;
    opacity: .7;
}
#join-request-notice span { flex: 1; }
#join-request-notice button {
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity .15s;
}
#join-request-notice .btn-join-send {
    background: var(--bg-active);
    color: var(--text-invert);
}
#join-request-notice .btn-join-send:hover { opacity: .82; }
#join-request-notice .btn-pending {
    background: rgba(240,160,48,.15);
    color: #9A6010;
    cursor: default;
}

/* Groupes non-membres dans le feed */
.conv-item.non-member { opacity: .82; }
.join-chip {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--bg-main);
    color: var(--text-mid);
    border: 1.5px solid var(--border);
    white-space: nowrap;
    flex-shrink: 0;
}
.join-chip.pending {
    background: rgba(240,160,48,.12);
    color: #9A6010;
    border-color: rgba(240,160,48,.3);
}

/* ── Liste des demandes en attente (modal info groupe) ─────────── */
.requests-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.requests-section-title {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: .06em;
    display: flex;
    align-items: center;
    gap: 7px;
}
.pending-badge {
    background: #F0A030;
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
}
.request-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-side);
}
.request-row .member-av-sm { flex-shrink: 0; }
.request-uname { flex: 1; font-size: 13.5px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-actions { display: flex; gap: 5px; }
.btn-accept, .btn-reject {
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: opacity .15s;
}
.btn-accept { background: #1A6E3A; color: white; }
.btn-accept:hover { opacity: .82; }
.btn-reject { background: var(--bg-hover); color: var(--text-mid); }
.btn-reject:hover { background: rgba(192,48,32,.1); color: #C03020; }

/* ── Actions de message (like + supprimer) ────────────────────── */
.msg-row { position: relative; }

/* Barre d'actions flottante (apparaît au survol) */
.msg-actions {
    display: none;
    position: absolute;
    top: -18px;
    align-items: center;
    gap: 1px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px 4px;
    box-shadow: var(--shadow-card);
    z-index: 20;
    white-space: nowrap;
}
.msg-row.mine   .msg-actions { right: 0; }
.msg-row.theirs .msg-actions { left: 34px; }
.msg-row:hover  .msg-actions { display: flex; }

.msg-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 3px 5px;
    border-radius: 14px;
    line-height: 1;
    display: flex; align-items: center; gap: 2px;
    color: var(--text-dim);
    font-family: inherit;
    transition: background .12s, transform .1s, color .12s;
}
.msg-action-btn:hover { background: var(--bg-hover); transform: scale(1.15); color: var(--text); }
.msg-action-btn.liked { color: #e0245e; }
.msg-action-btn.delete-btn:hover { background: rgba(192,48,32,.09); color: #C03020; }

/* Compteur de likes sur la bulle */
.msg-likes {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 3px;
    padding: 0 4px;
}
.msg-row.mine .msg-likes { color: rgba(255,255,255,.55); }

/* ── Bouton répondre ─────────────────────────────────────────── */
.msg-action-btn.reply-btn { font-size: 14px; }

/* ── Barre de réponse (au-dessus du champ de saisie) ─────────── */
#reply-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px 8px 16px;
    background: var(--bg-side);
    border-top: 2px solid var(--bg-active);
    animation: slideDown .15s ease;
}
@keyframes slideDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }

#reply-bar-preview {
    flex: 1; min-width: 0;
    border-left: 3px solid var(--bg-active);
    padding-left: 9px;
    display: flex; flex-direction: column; gap: 2px;
}
#reply-bar-sender {
    font-size: 11.5px; font-weight: 800;
    color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#reply-bar-content {
    font-size: 12px; color: var(--text-mid);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#reply-cancel {
    flex-shrink: 0;
    width: 26px; height: 26px;
    border-radius: 50%; border: none;
    background: var(--bg-hover);
    color: var(--text-mid);
    cursor: pointer; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    transition: background .12s, color .12s;
}
#reply-cancel:hover { background: var(--bg-active); color: var(--text-invert); }

/* Surbrillance temporaire d'un message ciblé */
@keyframes msgHighlight {
    0%   { background: var(--bg-hover); }
    60%  { background: var(--bg-hover); }
    100% { background: transparent; }
}
.msg-row.msg-highlight .msg-bubble {
    animation: msgHighlight 1.4s ease forwards;
    border-radius: 18px;
}

/* ── Citation dans la bulle ───────────────────────────────────── */
.msg-reply-quote {
    display: flex; flex-direction: column; gap: 2px;
    padding: 5px 10px;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: opacity .12s;
}
.msg-reply-quote:hover { opacity: .75; }
.theirs .msg-reply-quote {
    background: var(--bg-hover);
    border-left: 3px solid var(--text-mid);
}
.mine .msg-reply-quote {
    background: rgba(255,255,255,.15);
    border-left: 3px solid rgba(255,255,255,.6);
}
.msg-reply-quote-sender {
    font-size: 11px; font-weight: 800;
    color: inherit; opacity: .9;
}
.msg-reply-quote-text {
    font-size: 12px; opacity: .75;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 280px;
}

/* ── Modal profil ────────────────────────────────────────────── */
.profile-card { max-width: 440px; width: 100%; }

.profile-body { display: flex; flex-direction: column; gap: 0; padding: 0; overflow-y: auto; max-height: 80vh; }

.profile-hero {
    display: flex; align-items: center; gap: 18px;
    padding: 20px 22px 18px;
    border-bottom: 1px solid var(--border);
}
.profile-av {
    width: 72px; height: 72px; border-radius: 50%;
    overflow: hidden; flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
}
.profile-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-hero-info { flex: 1; min-width: 0; }
.profile-username { font-size: 19px; font-weight: 800; color: var(--text); line-height: 1.2; }
.profile-email    { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.profile-status-row {
    display: flex; align-items: center; gap: 7px;
    margin-top: 8px; font-size: 12px; color: var(--text-mid);
}
.status-dot-lg {
    width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
}
.status-dot-lg.online  { background: var(--dot-online); }
.status-dot-lg.offline { background: var(--dot-offline); }
.status-dot-lg.away    { background: var(--dot-away); }
.profile-since { margin-left: auto; font-size: 11px; color: var(--text-dim); white-space: nowrap; }

.profile-stats {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 1px; background: var(--border);
    border-bottom: 1px solid var(--border);
}
.profile-stat {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 14px 8px;
    background: var(--bg-main);
}
.profile-stat-val  { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.profile-stat-lbl  { font-size: 10.5px; color: var(--text-dim); text-align: center; font-weight: 500; }

.profile-section {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 10px;
}
.profile-section:last-child { border-bottom: none; }
.profile-section-title {
    font-size: 11px; font-weight: 800; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-dim);
    margin-bottom: 2px;
}

.profile-danger-zone { border-top: 1.5px solid rgba(192,48,32,.25); }
.profile-danger-desc { font-size: 12.5px; color: var(--text-mid); line-height: 1.55; }
.btn-danger {
    align-self: flex-start;
    padding: 7px 16px; border-radius: var(--radius-sm);
    border: 1.5px solid rgba(192,48,32,.45);
    background: none; color: #C03020;
    font-size: 13px; font-weight: 700; cursor: pointer;
    font-family: inherit; transition: background .14s, color .14s, border-color .14s;
}
.btn-danger:hover { background: rgba(192,48,32,.08); border-color: #C03020; }
.btn-danger-confirm {
    flex: 1; padding: 8px 14px; border-radius: var(--radius-sm);
    border: none; background: #C03020; color: #fff;
    font-size: 13px; font-weight: 700; cursor: pointer;
    font-family: inherit; transition: opacity .14s;
}
.btn-danger-confirm:hover   { opacity: .85; }
.btn-danger-confirm:disabled{ opacity: .5; cursor: not-allowed; }
.btn-cancel-delete {
    padding: 8px 14px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--border); background: none;
    color: var(--text-mid); font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: border-color .14s;
}
.btn-cancel-delete:hover { border-color: var(--text-mid); }

/* ── Actions de groupe (quitter / supprimer) ─────────────────── */
.group-actions-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    margin-top: 6px;
}

.btn-leave-group, .btn-delete-group {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    text-align: center;
}
.btn-leave-group {
    background: transparent;
    color: var(--text-mid);
}
.btn-leave-group:hover {
    background: var(--bg-hover);
    border-color: var(--text-mid);
    color: var(--text);
}
.btn-delete-group {
    background: transparent;
    color: #C03020;
    border-color: rgba(192,48,32,.3);
}
.btn-delete-group:hover {
    background: rgba(192,48,32,.08);
    border-color: #C03020;
}
