.wall-item-body-toggle.lefil-reading-toggle {
    position: static;
    width: 100%;
    height: auto;
    margin: 12px 0;
    padding: 0;
    text-align: center;
    background: none;
    z-index: auto;
}
.lefil-reading-toggle .wall-item-body-toggle-text {
    position: static;
    display: inline-block;
    width: auto;
    min-height: 40px;
    padding: 8px 16px !important;
    background: #176896 !important;
    color: #fff;
    border-radius: 4px;
    text-shadow: none;
    z-index: auto;
}


.lefil-external-share {
    clear: both;
    margin-top: 8px;
    text-align: center;
}

.wall-item-bottom .wall-item-tags .tag { display: none !important; }

/* Native controls: appearance only; preserve their geometry and handlers. */
.wall-item-container .wall-item-actions,
.wall-item-container .wall-item-actions-items {
    background-color: #E9F4F0 !important;
    border-radius: 4px;
}
.lefil-external-share > .lefil-share-toggle {
    background: #EAF4FB;
    border: 1px solid #176896;
    border-radius: 4px;
    color: #104D70;
    padding: 8px 12px;
}
.lefil-share-toggle .lefil-share-chevron {
    margin-left: 6px;
    transform: rotate(0deg);
}
.lefil-share-toggle[aria-expanded="true"] .lefil-share-chevron {
    transform: rotate(180deg);
}
.lefil-external-share .single-share-box-container > .title {
    display: none;
}

/* Agora : continuité visuelle entre les conteneurs natifs, sans déplacement DOM. */
@media screen {
    .wall-item-container.h-entry > article.media > .wall-item-actions {
        background: #E9F4F0 !important;
        border-radius: 8px 8px 0 0;
        padding: 12px 12px 8px;
    }
    .wall-item-container.h-entry > article.media > .wall-item-actions > .wall-item-actions-items {
        background: transparent !important;
        border-radius: 0;
        margin-left: 0;
        padding: 0;
    }
    .wall-item-container.h-entry > article.media > .lefil-external-share {
        background: #E9F4F0;
        margin: 0;
        padding: 0 12px 8px;
    }
    .wall-item-container.h-entry > article.media > .lefil-external-share .single-share-box-container {
        background: transparent;
        border-radius: 0;
        margin: 0;
        padding: 8px 0 0;
    }
    .wall-item-container.h-entry > article.media > .lefil-external-share .single-share-box-link {
        margin-top: 8px;
    }
    .wall-item-container.h-entry > article.media > .wall-item-responses {
        background: #E9F4F0;
        margin: 0;
        padding: 0 12px 12px;
        border-radius: 0 0 8px 8px;
    }
    .wall-item-container.h-entry:has(> .comment-container > .hide-comments-outer) > article.media {
        padding-bottom: 0;
    }
    .wall-item-container.h-entry:has(> .comment-container > .hide-comments-outer) > article.media > .wall-item-responses {
        border-radius: 0;
        padding-bottom: 8px;
    }
    .wall-item-container.h-entry > .comment-container > .hide-comments-outer {
        box-sizing: border-box;
        width: calc(100% - 20px);
        margin: 0 10px;
        padding: 0 12px 12px;
        background: #E9F4F0;
        border-radius: 0 0 8px 8px;
    }
}

/* Reactions et noms : meme surface, y compris lors du depliage natif. */
@media screen {
    .wall-item-container.h-entry > article.media > .wall-item-responses > div,
    .wall-item-container.h-entry > article.media > .wall-item-responses > div > p {
        background: transparent;
        border-radius: 0;
    }
    .wall-item-container.h-entry > article.media > .wall-item-responses .wall-item-like-expanded {
        overflow-wrap: anywhere;
    }
}

/* Federation : meme largeur de colonne que Communaute et Mes abonnements. */
@media screen and (min-width: 1200px) {
    body.mod-lefil main > .container:has(#lefil-federation) {
        width: 1372px;
        max-width: calc(100% - 40px);
    }
}

/* Federation : bouton Retour en haut aligne sur la colonne de publications,
   pas sur le bord de la fenetre (colonne = aside col-*-3 + contenu col-*-7,
   conteneur 1372px en >=1200px, 970px standard Bootstrap en 992-1199px). */
@media screen and (min-width: 1200px) {
    body.mod-lefil:has(#lefil-federation) #back-to-top {
        right: auto;
        left: calc(50vw + 463px);
    }
}
@media screen and (min-width: 992px) and (max-width: 1199px) {
    body.mod-lefil:has(#lefil-federation) #back-to-top {
        right: auto;
        left: calc(50vw + 329px);
    }
}
@media screen and (max-width: 768px) {
    body.mod-lefil:has(#lefil-federation) #back-to-top {
        right: 16px;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }
}

/* Federation : libelle visible dans le bouton (glyphe natif remplace), uniquement sur cette page. */
@media screen {
    body.mod-lefil:has(#lefil-federation) #back-to-top {
        min-height: 44px;
        line-height: 44px;
        padding: 0 14px;
        font-size: 0;
        white-space: nowrap;
        text-align: center;
    }
    body.mod-lefil:has(#lefil-federation) #back-to-top::after {
        content: "↑ Retour en haut";
        font-size: 15px;
    }
}

/* Federation : apparition orange du bouton, trois pulsations douces puis stable. */
@keyframes lefil-federation-backtotop-pulse {
    0%, 33.33%, 66.66%, 100% { opacity: 1; }
    16.66%, 50%, 83.33% { opacity: .65; }
}
@media screen {
    body.mod-lefil:has(#lefil-federation) #back-to-top {
        background-color: #D65A00;
        color: #fff;
        animation: lefil-federation-backtotop-pulse 3s ease-in-out 1;
    }
}
@media (prefers-reduced-motion: reduce) {
    body.mod-lefil:has(#lefil-federation) #back-to-top {
        animation: none;
    }
}
