/* ════════ Messagerie chantiers (/chantiers/messagerie) ════════ */

:root {
    --msg-accent: var(--messagerie-color);
    --msg-accent-dark: #00838f;
    --msg-border: #e3e8ee;
    --msg-bg: #f5f7fa;
    --msg-mine: #e0f7fa;
}

body {
    background: var(--msg-bg);
}

main.full-height {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}

/* ─ Module non souscrit ─ */
.msg-no-module {
    margin: 48px auto;
    padding: 0 16px;
    max-width: 480px;
    text-align: center;
    color: #455a64;
}

.msg-no-module > .material-icons {
    font-size: 56px;
    color: var(--msg-accent);
}

.msg-no-module > h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 8px 0;
    color: #263238;
}

.msg-no-module .db-me-btn {
    width: auto;
    margin-top: 8px;
}

/* ─ Mise en page : liste des chantiers | fil ─ */
.msg-app {
    flex: 1;
    min-height: 0;
    display: flex;
    width: 100%;
    background: #fff;
}

.msg-sidebar {
    width: 340px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--msg-border);
    min-height: 0;
}

.msg-sidebar-head {
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--msg-border);
}

.msg-sidebar-head h1 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    color: #263238;
}

.msg-sidebar-head h1 > .material-icons {
    color: var(--msg-accent);
}

.msg-search {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border-radius: 10px;
    background: var(--msg-bg);
}

.msg-search > .material-icons {
    font-size: 20px;
    color: #90a4ae;
}

.msg-search > input {
    flex: 1;
    min-width: 0;
    height: 36px;
    border: none;
    background: none;
    outline: none;
    font: inherit;
    font-size: 14px;
}

.msg-show-done {
    display: block;
    margin-top: 8px;
}

.msg-show-done > span {
    font-size: 13px !important;
    color: #546e7a;
}

.msg-chantiers {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.msg-chantiers-empty {
    padding: 24px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #78909c;
}

.msg-chantier {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid #f0f3f6;
    background: none;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.msg-chantier:hover {
    background: #f7fafc;
}

.msg-chantier.active {
    background: var(--msg-mine);
}

.msg-chantier-dot {
    width: 10px;
    height: 10px;
    margin-top: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.msg-chantier-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.msg-chantier-top,
.msg-chantier-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
}

.msg-chantier-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    color: #263238;
}

.msg-chantier-top > time {
    flex-shrink: 0;
    font-size: 11px;
    color: #90a4ae;
}

.msg-chantier-preview {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: #78909c;
}

.msg-chantier.unread .msg-chantier-name,
.msg-chantier.unread .msg-chantier-preview {
    font-weight: 700;
    color: #263238;
}

.msg-chantier.unread time {
    color: var(--msg-accent-dark);
    font-weight: 600;
}

.msg-badge {
    flex-shrink: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--msg-accent-dark);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    box-sizing: border-box;
}

/* ─ Fil ─ */
.msg-thread {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.msg-thread.dragging::after {
    content: 'Déposez les photos ou les documents ici';
    position: absolute;
    inset: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px dashed var(--msg-accent);
    border-radius: 12px;
    background: rgba(224, 247, 250, .85);
    color: var(--msg-accent-dark);
    font-weight: 700;
    pointer-events: none;
}

.msg-thread-empty {
    margin: auto;
    padding: 24px;
    text-align: center;
    color: #90a4ae;
}

.msg-thread-empty > .material-icons {
    font-size: 48px;
}

.msg-thread-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.msg-thread-inner.hidden {
    display: none;
}

.msg-thread-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--msg-border);
}

.msg-back {
    display: none;
    border: none;
    background: none;
    padding: 4px;
    cursor: pointer;
    color: #455a64;
}

.msg-thread-title {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
}

.msg-thread-title > span {
    font-size: 16px;
    font-weight: 700;
    color: #263238;
}

.msg-thread-title > small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: #78909c;
    cursor: help;
}

.msg-canaux {
    display: flex;
    gap: 4px;
    padding: 3px;
    border-radius: 10px;
    background: var(--msg-bg);
}

.msg-canal {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    background: none;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #607d8b;
    cursor: pointer;
    white-space: nowrap;
}

.msg-canal > .material-icons {
    font-size: 18px;
}

.msg-canal.active {
    background: #fff;
    color: var(--msg-accent-dark);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

.msg-canal.hidden {
    display: none;
}

.msg-messages {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 12px 14px;
    background: var(--msg-bg);
}

.msg-more {
    text-align: center;
    margin-bottom: 8px;
}

.msg-more-btn {
    border: 1px solid var(--msg-border);
    border-radius: 16px;
    background: #fff;
    padding: 4px 14px;
    font: inherit;
    font-size: 13px;
    color: var(--msg-accent-dark);
    cursor: pointer;
}

.msg-loading {
    display: flex;
    justify-content: center;
    padding: 24px;
}

.msg-error,
.msg-thread-start {
    margin: 24px auto;
    max-width: 420px;
    text-align: center;
    font-size: 14px;
    color: #78909c;
}

.msg-thread-start > .material-icons {
    font-size: 40px;
    color: var(--msg-accent);
}

.msg-day {
    display: flex;
    justify-content: center;
    margin: 14px 0 8px;
}

.msg-day > span {
    padding: 2px 12px;
    border-radius: 12px;
    background: #e3e8ee;
    font-size: 12px;
    font-weight: 600;
    color: #546e7a;
}

.msg-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    position: relative;
}

.msg-item.grouped {
    margin-top: 3px;
}

.msg-avatar,
.msg-avatar-space {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
}

.msg-bubble {
    max-width: min(640px, 75%);
    padding: 7px 11px;
    border-radius: 4px 14px 14px 14px;
    background: #fff;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .08);
    min-width: 0;
}

.msg-item.grouped .msg-bubble {
    border-radius: 14px;
}

.msg-item.mine {
    flex-direction: row-reverse;
}

.msg-item.mine .msg-bubble {
    background: var(--msg-mine);
    border-radius: 14px 4px 14px 14px;
}

.msg-item.mine.grouped .msg-bubble {
    border-radius: 14px;
}

.msg-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}

.msg-meta > b {
    font-size: 13px;
    color: var(--msg-accent-dark);
}

.msg-meta > time {
    font-size: 11px;
    color: #90a4ae;
}

.msg-text {
    font-size: 14px;
    line-height: 1.45;
    color: #263238;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.msg-text a {
    text-decoration: underline;
}

.msg-photos {
    display: grid;
    gap: 4px;
    margin-top: 6px;
    grid-template-columns: repeat(2, minmax(0, 160px));
}

.msg-photos.n1 {
    grid-template-columns: minmax(0, 320px);
}

.msg-photo {
    padding: 0;
    border: none;
    background: #eceff1;
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
    line-height: 0;
}

.msg-photo > img {
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: cover;
}

.msg-photos:not(.n1) .msg-photo > img {
    aspect-ratio: 1;
    height: 100%;
}

.msg-pending {
    margin-top: 2px;
    font-size: 11px;
    color: #90a4ae;
}

.msg-delete {
    align-self: center;
    border: none;
    background: none;
    padding: 4px;
    color: #b0bec5;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s;
}

.msg-item:hover .msg-delete,
.msg-delete:focus-visible {
    opacity: 1;
}

.msg-delete:hover {
    color: #e53935;
}

.msg-delete > .material-icons {
    font-size: 18px;
}

/* ─ Saisie ─ */
.msg-composer {
    padding: 8px 14px 10px;
    border-top: 1px solid var(--msg-border);
    background: #fff;
}

.msg-composer.sending {
    opacity: .7;
}

.msg-composer-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.msg-attach-btns {
    display: flex;
    gap: 8px;
}

/* Smartphone : photo et pièce jointe en boutons flottants au-dessus de la saisie, à droite, pour laisser
   toute la largeur au champ de texte ; marge sous les messages pour que les boutons ne cachent pas le dernier */
@media (max-width: 600px) {
    .msg-composer {
        position: relative;
    }

    .msg-attach-btns {
        position: absolute;
        right: 14px;
        bottom: calc(100% + 12px);
        flex-direction: column;
        gap: 10px;
        z-index: 2;
    }

    .msg-attach-btns .msg-photo-btn,
    .msg-attach-btns .msg-photo-btn:hover {
        width: 46px;
        height: 46px;
        background: #fff;
        color: var(--msg-accent-dark);
        box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    }

    .msg-messages {
        padding-bottom: 124px;
    }
}

.msg-photo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    color: #607d8b;
    cursor: pointer;
}

.msg-photo-btn:hover {
    background: var(--msg-bg);
    color: var(--msg-accent-dark);
}

#msg-text {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    max-height: 160px;
    padding: 9px 12px;
    border: 1px solid var(--msg-border);
    border-radius: 20px;
    resize: none;
    outline: none;
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
}

#msg-text:focus {
    border-color: var(--msg-accent);
}

.msg-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: var(--msg-accent-dark);
    color: #fff;
    cursor: pointer;
}

.msg-send:disabled {
    background: #cfd8dc;
    cursor: default;
}

.msg-composer-hint:empty {
    display: none;
}

.msg-composer-hint {
    margin-top: 4px;
    font-size: 12px;
    color: #78909c;
}

.msg-pending-photos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.msg-pending-photos.hidden {
    display: none;
}

.msg-pending-photo {
    position: relative;
    width: 72px;
}

.msg-pending-photo > img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.msg-pending-photo > span {
    display: block;
    font-size: 11px;
    color: #78909c;
    text-align: center;
}

.msg-pending-photo > button {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #455a64;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msg-pending-photo > button > .material-icons {
    font-size: 14px;
}

.msg-pending-info {
    font-size: 12px;
    color: #78909c;
}

/* ─ Photo en grand ─ */
.msg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .88);
    padding: 16px;
    box-sizing: border-box;
}

.msg-lightbox.hidden {
    display: none;
}

.msg-lightbox > img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.msg-lightbox-close,
.msg-lightbox-download {
    position: absolute;
    top: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    cursor: pointer;
}

.msg-lightbox-close {
    right: 12px;
}

.msg-lightbox-download {
    right: 60px;
}

/* ─ Téléphone : un seul panneau à la fois ─ */
@media (max-width: 800px) {
    .msg-app {
        border: none;
    }

    .msg-sidebar {
        width: 100%;
        border-right: none;
    }

    .msg-thread {
        display: none;
    }

    .msg-app.thread-open .msg-sidebar {
        display: none;
    }

    .msg-app.thread-open .msg-thread {
        display: flex;
    }

    .msg-back {
        display: block;
    }

    .msg-canaux {
        width: 100%;
    }

    .msg-canal {
        flex: 1;
        justify-content: center;
    }

    .msg-bubble {
        max-width: 85%;
    }

    .msg-delete {
        opacity: 1;
    }
}

/* ─ Documents joints ─ */
.msg-files {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.msg-file,
.msg-pending-doc {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 360px;
    padding: 7px 10px;
    border: 1px solid var(--msg-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, .7);
    color: #263238;
    font-size: 13px;
    text-decoration: none;
}

.msg-file:hover {
    border-color: var(--msg-accent);
    background: #fff;
}

.msg-file > .material-icons:first-child,
.msg-pending-doc > .material-icons:first-child {
    font-size: 22px;
    color: var(--msg-accent-dark);
}

.msg-file-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.msg-file-size {
    flex-shrink: 0;
    font-size: 11px;
    color: #78909c;
}

.msg-file-dl {
    font-size: 18px;
    color: #90a4ae;
}

.msg-pending-docs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.msg-pending-docs.hidden {
    display: none;
}

.msg-pending-doc > button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #455a64;
    color: #fff;
    cursor: pointer;
}

.msg-pending-doc > button > .material-icons {
    font-size: 14px;
}

/* ─ Onglets « Tous » / « Non lus » de la liste des chantiers ─ */
.msg-filters {
    display: flex;
    flex-wrap: wrap; /* « Tout marquer comme lu » sur sa propre ligne, sous les onglets */
    gap: 6px;
    margin-top: 10px;
}

.msg-filter {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: none;
    border-radius: 999px;
    background: var(--msg-bg);
    color: #546e7a;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.msg-filter:hover {
    background: #e8edf2;
}

.msg-filter.active {
    background: var(--msg-mine);
    color: var(--msg-accent-dark);
}

.msg-filter-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--msg-accent-dark);
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    box-sizing: border-box;
}

.msg-filter-count.hidden {
    display: none;
}

/* ─ Barre « non lus » au-dessus du premier message non lu ─ */
.msg-unread-bar {
    display: flex;
    justify-content: center;
    margin: 16px -14px 6px;
    padding: 5px 0;
    background: color-mix(in srgb, var(--msg-accent) 22%, transparent);
}

.msg-unread-bar > span {
    padding: 2px 14px;
    border-radius: 12px;
    background: #fff;
    color: var(--msg-accent-dark);
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

/* ─ Couleur du fil « Tout le monde » (orange), « Responsables » garde le bleu-vert ─ */
.msg-thread.canal-equipe {
    --msg-accent: #ffa726;
    --msg-accent-dark: #e65100;
    --msg-mine: #fff3e0;
    --msg-bg: #fbf6f0;
}

/* ─ Chantier sans message : choix du fil ─ */
.msg-canal-choice {
    max-width: 520px;
    margin: 40px auto;
    text-align: center;
    color: #546e7a;
}

.msg-canal-choice > p {
    margin: 0 0 16px;
    font-size: 15px;
}

.msg-canal-choice-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 480px) {
    .msg-canal-choice-buttons {
        grid-template-columns: minmax(0, 1fr);
    }
}

.msg-canal-choice-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 18px 14px;
    border: 2px solid var(--msg-border);
    border-radius: 14px;
    background: #fff;
    font: inherit;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.msg-canal-choice-btn[data-canal="responsables"] {
    --choice: #00838f;
    --choice-soft: #e0f7fa;
}

.msg-canal-choice-btn[data-canal="equipe"] {
    --choice: #e65100;
    --choice-soft: #fff3e0;
}

.msg-canal-choice-btn .material-icons {
    font-size: 32px;
    color: var(--choice);
}

.msg-canal-choice-btn b {
    font-size: 15px;
    color: #263238;
}

.msg-canal-choice-btn small {
    font-size: 12px;
    color: #78909c;
}

.msg-canal-choice-btn:hover,
.msg-canal-choice-btn.active {
    border-color: var(--choice);
    background: var(--choice-soft);
}

/* ─ Espace de stockage utilisé, en bas de la liste des chantiers ─ */
.msg-storage {
    display: block;
    flex-shrink: 0;
    padding: 10px 14px 12px;
    border-top: 1px solid var(--msg-border);
    background: #fafbfc;
    color: #546e7a;
}

.msg-storage.hidden {
    display: none;
}

a.msg-storage[href]:hover {
    background: #f1f4f8;
}

.msg-storage-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 12px;
}

.msg-storage-label > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.msg-storage-label .material-icons {
    font-size: 16px;
    color: #64b5f6;
}

.msg-storage-label > b {
    color: #263238;
    font-weight: 600;
    white-space: nowrap;
}

.msg-storage-bar {
    height: 6px;
    border-radius: 3px;
    background: #e3e8ee;
    overflow: hidden;
}

.msg-storage-bar > span {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: #64b5f6;
    transition: width .4s ease;
}

.msg-storage[data-level="high"] .msg-storage-bar > span {
    background: #ffb74d;
}

.msg-storage[data-level="full"] .msg-storage-bar > span {
    background: #e57373;
}

/* ─ Tout marquer comme lu (ligne sous les onglets Tous / Non lus) ─ */
.msg-read-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-basis: 100%;
    justify-content: flex-start;
    padding: 4px 8px;
    white-space: nowrap;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--msg-accent-dark);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.msg-read-all i {
    font-size: 16px;
}

.msg-read-all:hover,
.msg-read-all:focus-visible {
    background: var(--msg-mine);
}

.msg-read-all.hidden {
    display: none;
}

.msg-read-all-modal {
    max-width: 480px;
}

.msg-read-all-modal h5 i {
    color: var(--msg-accent-dark);
}

.msg-read-all-modal .msg-read-all-confirm {
    background: var(--msg-accent-dark);
}

/* ─ Notifications du navigateur : cloche à côté du titre, invitation sous le titre ─ */
.msg-notif-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-left: auto;
    border: none;
    border-radius: 50%;
    background: none;
    color: #78909c;
    cursor: pointer;
}

.msg-notif-btn:hover,
.msg-notif-btn:focus-visible {
    background: var(--msg-bg);
}

.msg-notif-btn[data-state="on"] {
    color: var(--msg-accent-dark);
}

.msg-notif-btn[data-state="denied"] {
    color: #b0bec5;
}

.msg-notif-btn.hidden,
.msg-notif-invite.hidden {
    display: none;
}

.msg-notif-btn i {
    font-size: 22px;
}

.msg-notif-invite {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding: 8px 6px 8px 10px;
    border-radius: 10px;
    background: var(--msg-mine);
    color: #37474f;
    font-size: 12px;
    line-height: 1.35;
}

.msg-notif-invite > i {
    color: var(--msg-accent-dark);
    font-size: 20px;
}

.msg-notif-invite > span {
    flex: 1;
    min-width: 0;
}

.msg-notif-invite-on {
    flex-shrink: 0;
    padding: 5px 12px;
    border: none;
    border-radius: 999px;
    background: var(--msg-accent-dark);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.msg-notif-invite-close {
    display: inline-flex;
    flex-shrink: 0;
    padding: 2px;
    border: none;
    border-radius: 50%;
    background: none;
    color: #78909c;
    cursor: pointer;
}

.msg-notif-invite-close i {
    font-size: 18px;
}

/* ─ Noms des pièces jointes (renamePiece) ─ */
.msg-file-row {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.msg-file-row > .msg-file {
    flex: 1;
}

.msg-photo-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.msg-photo-wrap > .msg-photo {
    width: 100%;
}

.msg-photo-name {
    margin-top: 3px;
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #37474f;
}

.msg-piece-rename {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: none;
    color: #78909c;
    cursor: pointer;
}

.msg-piece-rename i.material-icons {
    font-size: 18px;
}

.msg-piece-rename:hover {
    background: rgba(255, 255, 255, .9);
    color: var(--msg-accent-dark);
}

.msg-photo-wrap > .msg-piece-rename {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}

@media (hover: hover) {
    .msg-piece-rename {
        opacity: 0;
        transition: opacity .15s;
    }

    .msg-file-row:hover > .msg-piece-rename,
    .msg-photo-wrap:hover > .msg-piece-rename,
    .msg-piece-rename:focus-visible {
        opacity: 1;
    }
}

/* ─ Noms des pièces jointes avant l'envoi ─ */
.msg-pending-photo {
    width: 112px;
}

.msg-pending-photo > img {
    width: 112px;
    height: 84px;
}

.msg-pending-name {
    width: 100%;
    min-width: 0;
    height: 26px;
    margin-top: 3px;
    padding: 0 6px;
    border: 1px solid var(--msg-border);
    border-radius: 6px;
    background: #fff;
    color: #263238;
    font: inherit;
    font-size: 12px;
    box-sizing: border-box;
}

.msg-pending-name:focus {
    border-color: var(--msg-accent);
    outline: none;
}

.msg-pending-doc > .msg-pending-name {
    flex: 1;
    width: auto;
    margin: 0;
    font-weight: 600;
}

.msg-pending-ext {
    flex: none;
    color: #78909c;
    font-size: 12px;
}
