/* --- CABINET DE CURIOSIT?S --- Palette moderne & ?trange */
:root {
/* Fonds - ivoire sombre, comme un vieux parchemin dans l'obscurit? */
--bg: #0e0d0b;
--bg-card: #17160f;
--bg-elevated: #201e16;
/* Textes - ivoire et patine */
--text: #e4dfd3;
--text-secondary: #a09882;
--muted: #635d4e;
/* Accents - bleu ardoise, s?pia, bordeaux */
--accent: #5a7a8a;          /* Bleu ardoise - l'encre */
--accent-secondary: #8b7355; /* S?pia dor? - le temps */
--accent-tertiary: #6b3a3a;  /* Bordeaux profond - le myst?re */
--accent-purple: #5c5470;    /* Prune gris? - le cr?pusculaire */
--border: #2a2821;
--glow: 0 0 40px rgba(125,132,113,0.08);
/* Ombres - encre et vieux bois */
--pixel-shadow: #08080a;
--pixel-highlight: #3d3a30;
/* Header background */
--bg-header: rgba(13,13,13,0.95);
/* Overlay & Ambiance */
--overlay-bg: rgba(0,0,0,0.85);
--ambiance-bg: linear-gradient(135deg, rgba(14,13,11,0.95), rgba(28,26,23,0.95));
--ambiance-badge-bg: rgba(255,255,255,0.1);
--ambiance-badge-border: rgba(255,255,255,0.1);
}

/* --- MODE CLAIR - Parchemin ?clair? --- */
[data-theme="light"] {
/* Fonds - parchemin et papier ancien */
--bg: #f8f5ef;
--bg-card: #fffdf8;
--bg-elevated: #f0ebe1;
--bg-header: rgba(248,245,239,0.95);
/* Textes - encre et s?pia */
--text: #2c2416;
--text-secondary: #5a5045;
--muted: #8a7f70;
/* Accents - prune, rose, bordeaux (?l?gance litt?raire) */
--accent: #6b5a7a;          /* Prune doux - l'?l?gance */
--accent-secondary: #7a5a6a; /* Rose ancien */
--accent-tertiary: #8c3d3d;  /* Bordeaux ?l?gant */
--accent-purple: #5f4a6e;    /* Prune profond */
--border: #d8d2c4;
--glow: 0 0 40px rgba(155,107,74,0.1);
/* Ombres douces */
--pixel-shadow: #d0c9ba;
--pixel-highlight: #ffffff;
/* Overlay & Ambiance - mode clair */
--overlay-bg: rgba(255,255,255,0.9);
--ambiance-bg: linear-gradient(135deg, rgba(248,245,239,0.97), rgba(240,235,225,0.97));
--ambiance-badge-bg: rgba(0,0,0,0.05);
--ambiance-badge-border: rgba(0,0,0,0.1);
}

/* --- MODE CLAIR - Styles spécifiques pour les likes --- */
[data-theme="light"] .extrait-action.like-btn.liked,
[data-theme="light"] .btn-like.active {
    color: #c0392b !important;
}

[data-theme="light"] .extrait-action.like-btn.liked .like-icon,
[data-theme="light"] .btn-like.active .like-icon {
    color: #c0392b !important;
}

[data-theme="light"] .extrait-action.like-btn.liked .like-count {
    color: #c0392b !important;
}

/* ---------------------------------------------------------------------------
   ?? PIXEL ART DESIGN SYSTEM
   --------------------------------------------------------------------------- */

/* Police pixel pour les titres */
@font-face {
    font-family: 'Pixel';
    src: local('Courier New'), local('Consolas'), local('monospace');
}

/* ---------------------------------------------------------------------------
   ?? MOBILE FIRST - Style Twitter-like (< 900px)
   --------------------------------------------------------------------------- */

/* ====== MOBILE DRAWER OVERLAY ====== */
.mobile-drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1199;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mobile-drawer-overlay.open {
    opacity: 1;
}

/* ====== MOBILE BOTTOM NAVIGATION (style Twitter) ====== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 2px solid var(--border);
    padding: 0.5rem 0;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    z-index: 200;
    justify-content: space-around;
    /* Pixel art border effect */
    box-shadow: 
        0 -4px 0 var(--pixel-shadow),
        inset 0 2px 0 var(--pixel-highlight);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    min-width: 60px;
}

.mobile-nav-item.active {
    color: var(--accent);
}

.mobile-nav-item.active::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--accent);
    /* Pixel dot */
    box-shadow: 
        4px 0 0 var(--accent),
        -4px 0 0 var(--accent);
}

.mobile-nav-icon {
    font-size: 1.4rem;
}

.mobile-nav-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mobile-nav-badge {
    position: absolute;
    top: 0.2rem;
    right: 0.8rem;
    min-width: 16px;
    height: 16px;
    background: var(--accent);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    /* Pixel border */
    box-shadow: 0 2px 0 var(--pixel-shadow);
}

.mobile-nav-badge:not(:empty) {
    display: flex;
}

/* ====== MOBILE PROFILE BUTTON (Header) ====== */
.mobile-profile-btn {
    display: none;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    z-index: 10;
}

/* Mobile logo */
.mobile-logo {
    display: none;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.mobile-profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    /* Pixel border effect */
    border: 2px solid var(--border);
    box-shadow: 2px 2px 0 var(--pixel-shadow);
    transition: all 0.2s;
}

.mobile-profile-btn:active .mobile-profile-avatar {
    transform: scale(0.92);
    box-shadow: 1px 1px 0 var(--pixel-shadow);
}

/* ====== DRAWER CLOSE BUTTON ====== */
.drawer-close-btn {
    display: none;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    z-index: 20;
    transition: all 0.15s;
    opacity: 0.7;
}

.drawer-close-btn:active {
    transform: scale(0.95);
    opacity: 1;
    background: var(--bg-elevated);
}

/* ====== DRAWER QUICK ACTIONS ====== */
.drawer-quick-actions {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    margin: -0.5rem -0.25rem 0.75rem;
    background: var(--bg-elevated);
    border-radius: 8px;
    border: 2px solid var(--border);
    box-shadow: 3px 3px 0 var(--pixel-shadow);
}

.drawer-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 0;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 2px 2px 0 var(--pixel-shadow);
}

.drawer-action-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 0 0 0 var(--pixel-shadow);
}

/* Bouton déconnexion mobile - style distinct */
.drawer-logout-mobile {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
    margin-top: 0.5rem;
}

.drawer-logout-mobile:hover {
    background: rgba(239, 68, 68, 0.2);
}

.drawer-action-btn span {
    font-size: 1.1rem;
}

.drawer-lang-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    box-shadow: 2px 2px 0 var(--pixel-shadow);
}

.drawer-lang-selector span {
    font-size: 1.1rem;
}

.drawer-lang-selector select {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;

}

.drawer-lang-selector select option {
    background: var(--bg-card);
    color: var(--text);
}

/* ====== DESKTOP MEDIA QUERY (> 900px) ====== */
@media screen and (min-width: 901px) {
    /* Header desktop sur une seule ligne */
    header {
        left: 260px !important;
        right: 0 !important;
    }
    
    .header-inner {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
    }
    
    .header-title {
        display: block !important;
        flex-shrink: 0 !important;
        max-width: 200px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .search-container {
        flex: 1 !important;
        min-width: 150px !important;
        max-width: 300px !important;
    }
    
    .header-actions {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 0.35rem !important;
        flex-shrink: 0 !important;
    }
    
    .header-btn {
        display: inline-flex !important;
        padding: 0.3rem 0.5rem !important;
        font-size: 0.65rem !important;
        white-space: nowrap !important;
    }
    
    .notif-btn,
    .user-menu,
    .lang-selector {
        display: flex !important;
        flex-shrink: 0 !important;
    }
    
    /* Masquer éléments mobile sur desktop */
    .mobile-profile-btn,
    .mobile-logo,
    .mobile-bottom-nav,
    .mobile-drawer-overlay,
    .mobile-notif-btn {
        display: none !important;
    }
}

/* ====== MOBILE MEDIA QUERIES ====== */
@media screen and (max-width: 900px) {
    /* === MOBILE: Tout le drawer est g?r? par mobile.css === */
    /* Ne pas d?finir de styles pour .stats-panel ici ! */
    
    /* Afficher les ?l?ments mobile basiques */
    .mobile-bottom-nav {
        display: flex !important;
    }
    
    .mobile-profile-btn {
        display: flex !important;
    }
    
    .mobile-logo {
        display: block !important;
    }
    
    .mobile-drawer-overlay {
        display: block !important;
    }

    /* ---------------------------------------------------------------
       HEADER MOBILE - Simple et ergonomique
       Layout: [Avatar profil] [Logo] [Recherche]
       --------------------------------------------------------------- */
    
    header {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        border-bottom: 2px solid var(--border) !important;
        box-shadow: 0 4px 0 var(--pixel-shadow) !important;
    }
    
    .header-inner {
        width: 100% !important;
        padding: 0.5rem 0.75rem !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 0.75rem !important;
        justify-content: flex-start !important;
    }
    
    /* MASQUER les ?l?ments desktop sur mobile */
    .header-actions,
    .lang-selector,
    .user-menu,
    .notif-btn,
    .favorites-btn,
    .header-title {
        display: none !important;
    }
    
    /* Avatar profil - ORDRE 1 - ? gauche, bien visible */
    .mobile-profile-btn {
        display: flex !important;
        order: 1 !important;
        flex-shrink: 0 !important;
        width: 42px !important;
        height: 42px !important;
        padding: 0 !important;
        background: none !important;
        border: none !important;
    }
    
    .mobile-profile-avatar {
        width: 42px !important;
        height: 42px !important;
        font-size: 1.3rem !important;
    }
    
    /* Logo - ORDRE 2 - compact */
    .mobile-logo {
        display: flex !important;
        order: 2 !important;
        flex-shrink: 0 !important;
        font-size: 1.5rem !important;
    }
    
    /* Recherche - ORDRE 3 - prend tout l'espace restant */
    .search-container {
        order: 3 !important;
        flex: 1 !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
    }
    
    .search-input {
        width: 100% !important;
        font-size: 16px !important;
        padding: 0.5rem 0.75rem 0.5rem 2.25rem !important;
        border-radius: 20px !important;
        border: 2px solid var(--border) !important;
        box-shadow: 2px 2px 0 var(--pixel-shadow) !important;
    }
    
    .search-input:focus {
        box-shadow: 2px 2px 0 var(--accent) !important;
    }
    
    /* CONTENU PRINCIPAL */
    main {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        padding-top: 150px !important; /* Espace pour header (56px) + exploration (~94px) */
        padding-bottom: 5rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Exploration container */
    .exploration-container {
        position: fixed !important;
        top: 58px !important; /* Petit espace sous le header mobile */
        left: 0 !important;
        right: 0 !important;
        z-index: 90 !important;
        padding-top: 2px !important;
        /* Pixel border */
        border-bottom: 2px solid var(--border) !important;
        box-shadow: 0 4px 0 var(--pixel-shadow) !important;
    }
    
    .exploration-tabs {
        padding: 0 0.5rem !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }
    
    .exploration-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .exploration-tab {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.7rem !important;
        white-space: nowrap !important;
    }
    
    .ambiance-bar {
        padding: 0.5rem !important;
    }
    
    .ambiance-pill {
        padding: 0.4rem 0.75rem !important;
        font-size: 0.7rem !important;
        /* Pixel style */
        border-radius: 4px !important;
        border: 2px solid var(--border) !important;
        box-shadow: 2px 2px 0 var(--pixel-shadow) !important;
    }
    
    .ambiance-pill.active {
        box-shadow: 2px 2px 0 var(--accent) !important;
    }
    
    /* CARDS */
    .card {
        border-radius: 0 !important;
        margin-bottom: 1.5rem !important;
        /* Pixel art style */
        border: 2px solid var(--border) !important;
        box-shadow: 4px 4px 0 var(--pixel-shadow) !important;
    }
    
    .card:hover {
        box-shadow: 6px 6px 0 var(--pixel-shadow) !important;
    }
    
    .card::before {
        width: 3px !important;
    }
    
    .card-head {
        padding: 1rem 1rem 0.5rem !important;
    }
    
    .card-body {
        padding: 0.75rem 1rem !important;
        font-size: 0.95rem !important;
        line-height: 1.7 !important;
    }
    
    .card-foot {
        padding: 0.75rem 1rem !important;
        position: relative !important;
        z-index: 2 !important;
        background: var(--bg-card) !important;
    }
    
    /* Actions des cartes sur mobile - 4 boutons sur une ligne */
    .card-foot .actions {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        gap: 0.25rem !important;
        width: 100% !important;
        position: relative !important;
        z-index: 3 !important;
    }
    
    .card-foot .actions .btn {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        justify-content: center !important;
        padding: 0.5rem 0.3rem !important;
        font-size: 0.85rem !important;
        white-space: nowrap !important;
        overflow: visible !important;
        position: relative !important;
        z-index: 4 !important;
    }
    
    /* Like button plus visible */
    .card-foot .actions .btn:first-child {
        background: rgba(230, 57, 70, 0.1) !important;
        border-color: var(--accent) !important;
        color: var(--accent) !important;
        font-size: 1.1rem !important;
    }
    
    .card-foot .actions .btn:first-child.active {
        background: var(--accent) !important;
        color: white !important;
    }

    .like-with-count {
        display: contents;
    }

    .like-with-count .btn-like {
        background: rgba(230, 57, 70, 0.06);
        border: 1px solid rgba(230, 57, 70, 0.25);
        color: var(--text);
        padding: 0 1rem;
        border-radius: 0;
        font-size: 0.65rem;
        height: 2.4rem;
        transition: all 0.15s ease;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }

    .like-with-count .btn-like .like-icon {
        font-size: 1.2rem;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        color: var(--accent);
        text-shadow:
            1px 0 var(--border),
            -1px 0 var(--border),
            0 1px var(--border),
            0 -1px var(--border);
    }

    .like-with-count .btn-like:hover {
        color: var(--text);
        border-color: var(--accent);
        background: rgba(212, 165, 116, 0.08);
    }

    .like-with-count .btn-like.active {
        background: transparent;
        border-color: transparent;
        color: var(--accent);
    }

    .like-with-count .btn-like .like-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 22px;
        padding: 0.15rem 0.5rem;
        border-radius: 999px;
        border: 1px solid rgba(230, 57, 70, 0.2);
        font-size: 0.8rem;
        font-weight: 600;
        line-height: 1;
        color: var(--text);
        background: rgba(230, 57, 70, 0.06);
    }

    .like-with-count .btn-like .like-count.clickable:hover {
        border-color: var(--accent);
        color: var(--accent);
        background: rgba(212, 165, 116, 0.08);
    }

    .like-with-count .btn-like.active .like-count {
        border-color: transparent;
        color: var(--text-secondary);
        background: transparent;
    }

    .like-count {
        font-size: 0.75rem;
        color: var(--text-secondary);
        border: 1px solid var(--border);
        border-radius: 999px;
        padding: 0.1rem 0.45rem;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
    }

    .like-count.clickable {
        cursor: pointer;
        transition: all 0.15s ease;
    }

    .like-count.clickable:hover {
        color: var(--accent);
        border-color: transparent;
        background: transparent;
    }
    
    /* Masquer les mots-cl?s sur mobile (trop encombrant) */
    .card-keywords {
        display: none !important;
    }
    
    /* Masquer le texte des boutons sur mobile - ic?nes seulement */
    .btn .btn-text {
        display: none !important;
    }
    
    /* Garder le compteur de commentaires visible sur mobile */
    .btn-comment .comment-count {
        display: inline !important;
        margin-left: 2px;
    }
    
    /* Boutons pixel style */
    .btn, .btn-suite {
        border-radius: 0 !important;
        border: 2px solid var(--border) !important;
        box-shadow: 2px 2px 0 var(--pixel-shadow) !important;
    }
    
    .btn:active, .btn-suite:active {
        box-shadow: 0 0 0 var(--pixel-shadow) !important;
        transform: translate(2px, 2px) !important;
    }
    
    /* Banni?re reco */
    .reco-banner {
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 1rem !important;
        border-radius: 0 !important;
        border: 2px solid var(--border) !important;
        box-shadow: 4px 4px 0 var(--pixel-shadow) !important;
    }
    
    /* Body */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    /* Ambiance intro - FIXED sous les headers */
    .ambiance-intro {
        position: fixed !important;
        top: 125px !important; /* Juste sous header + exploration */
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        padding: 0.75rem !important;
        padding-top: 2.8rem !important; /* Espace pour le bouton fermer */
        max-height: 45vh !important;
        overflow-y: auto !important;
        z-index: 85 !important;
        background: var(--bg-card) !important;
        border-bottom: 2px solid var(--accent-secondary) !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.4) !important;
    }
    
    /* Quand l'intro est visible, le main doit ?tre d?cal? sous elle */
    body.has-ambiance-intro main {
        padding-top: 340px !important; /* header + exploration + intro */
    }
    
    .ambiance-intro h2 {
        font-size: 1.1rem !important;
        margin-bottom: 0.4rem !important;
        margin-top: 0 !important;
        text-align: center !important;
    }
    
    .ambiance-intro p {
        font-size: 0.8rem !important;
        margin-bottom: 0.5rem !important;
        text-align: center !important;
    }
    
    .ambiance-intro .period-badge {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.5rem !important;
        margin-bottom: 0.4rem !important;
    }
    
    .ambiance-intro .ambiance-tags {
        gap: 0.4rem !important;
        margin-top: 0.5rem !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    
    .ambiance-intro .ambiance-tag {
        font-size: 0.65rem !important;
        padding: 0.25rem 0.6rem !important;
    }
    
    .ambiance-intro .close-intro {
        position: fixed !important;
        top: 130px !important; /* Juste en dessous du bord haut de l'encart */
        right: 0.75rem !important;
        font-size: 1.2rem !important;
        width: 2.2rem !important;
        height: 2.2rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: var(--accent-tertiary) !important;
        border: 2px solid var(--text) !important;
        border-radius: 50% !important;
        color: var(--text) !important;
        transform: none !important;
        z-index: 100 !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.5) !important;
    }
    
    /* Progress bar */
    .progress {
        left: 0 !important;
    }
}

/* SMARTPHONES - ENCORE PLUS COMPACT */
@media screen and (max-width: 500px) {
    .mobile-nav-item {
        padding: 0.4rem 0.5rem !important;
        min-width: 50px !important;
    }
    
    .mobile-nav-icon {
        font-size: 1.2rem !important;
    }
    
    .mobile-nav-label {
        font-size: 0.55rem !important;
    }
    
    .mobile-profile-avatar {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.85rem !important;
    }
    
    .header-inner::after {
        font-size: 1rem !important;
    }
    
    .search-input {
        padding: 0.4rem 0.6rem 0.4rem 1.75rem !important;
    }
    
    main {
        padding: 4rem 0.5rem 4.5rem 0.5rem !important;
    }
    
    .card-body {
        font-size: 0.9rem !important;
    }
    
    .exploration-tab {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.65rem !important;
    }
    
    .ambiance-pill {
        padding: 0.35rem 0.6rem !important;
        font-size: 0.65rem !important;
    }
    
    .ambiance-pill .ambiance-name {
        display: none !important;
    }
    
    .ambiance-pill .ambiance-icon {
        font-size: 1.1rem !important;
    }
    
    /* Overlays et modales plein ?cran sur mobile */
    .favorites-overlay,
    .search-results-overlay,
    .reader-overlay {
        padding-bottom: 60px !important; /* Espace pour la nav bottom */
    }
    
    .favorites-view {
        padding: 1rem !important;
        padding-bottom: 80px !important;
    }
    
    .favorites-header {
        padding: 0.75rem 0 !important;
        margin-bottom: 1rem !important;
    }
    
    .favorites-title {
        font-size: 0.7rem !important;
    }
    
    /* Feed social mobile */
    .feed-tabs {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        padding-bottom: 0.5rem !important;
        scrollbar-width: none !important;
    }
    
    .feed-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .feed-tab {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        padding: 0.4rem 0.6rem !important;
        font-size: 0.7rem !important;
    }
    
    /* Auth modal mobile */
    .auth-modal {
        align-items: flex-start !important;
        padding-top: 2rem !important;
    }
    
    .auth-box {
        width: 95% !important;
        max-width: 400px !important;
        border-radius: 0 !important;
        border: 2px solid var(--border) !important;
        box-shadow: 4px 4px 0 var(--pixel-shadow) !important;
    }
    
    /* Messages modal mobile */
    .messages-modal {
        flex-direction: column !important;
    }
    
    .messages-sidebar {
        width: 100% !important;
        max-height: 40vh !important;
        border-right: none !important;
        border-bottom: 2px solid var(--border) !important;
    }
    
    .messages-main {
        flex: 1 !important;
        min-height: 50vh !important;
    }
    
    /* Profile modal mobile */
    .user-profile-content {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
    }
    
    /* Feed loading centr? sur mobile */
    .feed-loading {
        padding: 3rem 1rem !important;
        margin: 0 auto !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    .feed-loading span {
        display: block !important;
        word-wrap: break-word !important;
    }
    
    /* Toast sur mobile */
    .toast {
        left: 1rem !important;
        right: 1rem !important;
        bottom: 80px !important;
        transform: translateX(0) translateY(100px) !important;
        max-width: none !important;
    }
    
    .toast.show {
        transform: translateX(0) translateY(0) !important;
    }
}

/* --------------------------------------------------------------------------- */

/* ?? Reset et body import?s depuis base.css */

/* Stats Panel - Style ?pur? + pixel touches */
.stats-panel {
position: fixed;
left: 0;
top: 0;
bottom: 0;
width: 260px;
background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg) 100%);
border-right: 2px solid var(--border);
padding: 1.5rem 1.25rem;
padding-top: 0.75rem;
overflow-y: auto;
z-index: 101;
display: flex;
flex-direction: column;
gap: 1.5rem;
/* Pixel shadow effect */
box-shadow: 4px 0 0 var(--pixel-shadow);
}
.stats-logo {
font-size: 0.75rem;
font-weight: 700;
letter-spacing: 0.25em;
color: var(--text);
text-transform: uppercase;
padding-bottom: 1rem;
border-bottom: 2px solid var(--border);
/* Pixel text effect */
text-shadow: 1px 1px 0 var(--pixel-shadow);
}
.stats-section h3 {
font-size: 0.65rem;
font-weight: 600;
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--muted);
margin-bottom: 0.75rem;
}
.big-number {
font-size: 3rem;
font-weight: 700;
background: linear-gradient(135deg, var(--text), var(--text-secondary));
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
line-height: 1;
}
.big-number-label {
font-size: 0.75rem;
color: var(--muted);
margin-top: 0.25rem;
}
.mini-stats {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 0.75rem;
margin-top: 0.75rem;
}
.mini-stat {
background: var(--bg-elevated);
padding: 0.75rem;
border-radius: 8px;
border: 1px solid var(--border);
}
.mini-stat-value {
font-size: 1.4rem;
font-weight: 600;
color: var(--text);
}
.mini-stat-label {
font-size: 0.7rem;
color: var(--muted);
margin-top: 0.2rem;
}

/* Author bars */
.author-bars {
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.author-bar {
display: flex;
align-items: center;
gap: 0.75rem;
}
.author-bar-name {
font-size: 0.75rem;
color: var(--text-secondary);
width: 100px;
flex-shrink: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.author-bar-track {
flex: 1;
height: 6px;
background: var(--bg);
border-radius: 3px;
overflow: hidden;
}
.author-bar-fill {
height: 100%;
border-radius: 3px;
transition: width 0.5s ease;
}
.author-bar-count {
font-size: 0.7rem;
color: var(--muted);
width: 24px;
text-align: right;
}

/* Genre pills - Design attractif */
.genres-section {
    background: linear-gradient(135deg, rgba(255,69,58,0.05), rgba(191,90,242,0.05)) !important;
    border: 1px solid rgba(255,69,58,0.15) !important;
    border-radius: 12px !important;
}
.genres-section h3 {
    color: var(--accent) !important;
    font-size: 0.85rem !important;
}
.genre-chart {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}
.genre-pill {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.8rem;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.genre-pill:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(255,69,58,0.15);
}
.genre-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 6px currentColor;
}

/* Connexions */
.connections-section { margin-top: 0.5rem; }
.connections-hint {
font-size: 0.7rem;
color: var(--muted);
margin-bottom: 0.75rem;
}
.connection-graph {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.connection-item {
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: 8px;
padding: 0.6rem 0.75rem;
cursor: pointer;
transition: all 0.2s;
}
.connection-item:hover {
border-color: var(--accent);
transform: translateX(3px);
/* Fin du fichier */
display: flex;
align-items: flex-start;
gap: 0.5rem;
padding: 0.5rem 0.6rem;
background: transparent;
border-left: 2px solid var(--accent);
margin-bottom: 0.6rem;
cursor: pointer;
transition: all 0.2s;
}
.favorite-item:hover {
background: var(--bg-elevated);
padding-left: 0.8rem;
}
.favorite-content {
flex: 1;
min-width: 0;
}
.favorite-title {
font-size: 0.7rem;
font-weight: 600;
color: var(--text);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.favorite-author {
font-size: 0.6rem;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.05em;
}
.favorite-preview {
display: none; /* Simplifi? */
}
.favorite-remove {
background: none;
border: none;
color: var(--muted);
cursor: pointer;
padding: 0.2rem;
font-size: 0.7rem;
opacity: 0;
transition: all 0.2s;
}
.favorite-item:hover .favorite-remove {
opacity: 1;
}
.favorite-remove:hover {
color: var(--accent);
}
.favorites-empty {
font-size: 0.75rem;
color: var(--muted);
text-align: center;
padding: 1rem;
font-style: italic;
}
.source-badge {
font-size: 0.55rem;
padding: 0.15rem 0.4rem;
border-radius: 3px;
background: rgba(191,90,242,0.2);
color: var(--accent-purple);
margin-left: 0.3rem;
}

/* Path visualization */
.reading-path {
display: flex;
align-items: center;
gap: 0.3rem;
flex-wrap: wrap;
margin-top: 0.5rem;
font-size: 0.65rem;
}
.path-node {
padding: 0.2rem 0.4rem;
background: var(--bg-elevated);
border-radius: 4px;
color: var(--text-secondary);
max-width: 80px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.path-arrow { color: var(--muted); }

/* Recommandation banner */
.reco-banner {
background: linear-gradient(135deg, rgba(255,69,58,0.15), rgba(191,90,242,0.15));
border: 1px solid rgba(255,69,58,0.3);
border-radius: 12px;
padding: 1.25rem;
margin-bottom: 1.5rem;
display: none;
/* Positionnement identique au main */
margin-left: 260px;
max-width: 720px;
margin-right: auto;
margin-left: calc(260px + (100% - 260px - 720px) / 2);
padding-left: 2rem;
padding-right: 2rem;
position: relative;
z-index: 10;
}
.reco-banner.show { display: block; }
.reco-title {
font-size: 0.7rem;
text-transform: uppercase;
letter-spacing: 0.1em;
color: var(--accent);
margin-bottom: 0.5rem;
}
.reco-text {
font-size: 0.85rem;
color: var(--text-secondary);
line-height: 1.5;
}
.reco-authors {
display: flex;
flex-wrap: wrap;
gap: 0.4rem;
margin-top: 0.75rem;
}
.reco-author {
padding: 0.35rem 0.7rem;
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: 6px;
font-size: 0.75rem;
color: var(--text);
cursor: pointer;
transition: all 0.2s;
}
.reco-author:hover {
border-color: var(--accent);
background: rgba(255,69,58,0.1);
}

/* Main content */
header {
position: fixed;
top: 0;
left: 260px;
right: 0;
z-index: 100;
background: var(--bg-header);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border-bottom: 2px solid var(--border);
border-left: none;
/* Pixel shadow */
box-shadow: 0 4px 0 var(--pixel-shadow);
overflow: visible;
/* Headroom transition */
transition: transform 0.3s ease;
}
.header-inner {
padding: 0.75rem 1.5rem;
display: flex;
align-items: center;
gap: 1rem;
overflow: visible;
flex-wrap: nowrap;
}
.header-title {
font-family: 'Courier New', monospace;
font-size: 0.75rem;
font-weight: 700;
letter-spacing: 0.15em;
text-transform: uppercase;
color: var(--muted);
white-space: nowrap;
flex-shrink: 0;
/* Subtle pixel effect */
text-shadow: 1px 1px 0 var(--pixel-shadow);
}
.header-actions { display: flex; gap: 0.4rem; align-items: center; flex-shrink: 0; flex-wrap: wrap; overflow: visible; }

/* S?parateur entre groupes */
.header-separator {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 0.3rem;
}

/* Ic?nes Lucide dans le header */
.header-icon {
    width: 15px;
    height: 15px;
    stroke-width: 2;
    vertical-align: middle;
}

/* Boutons avec texte */
.header-btn.btn-with-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.header-btn.btn-with-text .header-icon {
    margin-right: 0;
}
.header-btn.btn-with-text.accent {
    color: var(--accent);
    border-color: var(--accent);
}
.header-btn.btn-with-text.accent:hover {
    background: var(--accent);
    color: white;
}

/* Boutons ic?ne seule */
.header-btn.btn-icon {
    padding: 0.4rem;
    position: relative;
}
.header-btn.btn-icon .header-icon {
    margin: 0;
}

/* Badge sur bouton ic?ne */
.btn-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--accent);
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover .header-icon {
    color: var(--accent);
}
.lang-icon.header-icon {
    color: var(--text-secondary);
}
.notif-title-icon {
    width: 14px;
    height: 14px;
    stroke-width: 2;
    vertical-align: middle;
    margin-right: 4px;
}

.header-btn {
background: transparent;
border: 2px solid var(--border);
/* Pixel button style */
box-shadow: 2px 2px 0 var(--pixel-shadow);
transition: all 0.15s ease;
}
.header-btn:hover { 
border-color: var(--text); 
color: var(--text);
box-shadow: 3px 3px 0 var(--pixel-shadow);
transform: translate(-1px, -1px);
}
.header-btn:active {
box-shadow: 0 0 0 var(--pixel-shadow);
transform: translate(2px, 2px);
}
.header-btn {
color: var(--muted);
padding: 0.4rem 0.8rem;
border-radius: 2px;
font-size: 0.7rem;
font-weight: 500;
letter-spacing: 0.05em;
cursor: pointer;
transition: all 0.2s;
text-transform: uppercase;
}
.header-btn:hover { border-color: var(--text); color: var(--text); }

/* Bouton refresh avec animation */
.header-btn.refresh-btn {
background: linear-gradient(135deg, var(--accent), var(--accent-purple));
border-color: var(--accent);
color: white;
}
.header-btn.refresh-btn:hover {
border-color: var(--accent);
color: white;
box-shadow: 0 0 12px rgba(230, 57, 70, 0.4), 3px 3px 0 var(--pixel-shadow);
}
.header-btn.refresh-btn:active {
transform: translate(2px, 2px) rotate(180deg);
transition: all 0.3s ease;
}

/* Language selector */
.lang-selector {
display: flex;
align-items: center;
gap: 0.5rem;
}
.lang-select {
background: var(--bg-elevated);
border: 1px solid var(--border);
color: var(--text);
padding: 0.5rem 0.75rem;
border-radius: 8px;
font-size: 0.8rem;
cursor: pointer;
transition: all 0.2s;
appearance: none;
padding-right: 1.5rem;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238e8e93' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 0.5rem center;
}
.lang-select:hover { border-color: var(--text); }
.lang-select:focus { border-color: var(--text); }
.lang-icon { font-size: 0.9rem; }

/* Search Bar */
.search-container {
position: relative;
flex: 1;
min-width: 200px;
max-width: 400px;
margin: 0 1rem;
}
.search-input-wrapper {
position: relative;
display: flex;
align-items: center;
}
.search-input {
width: 100%;
padding: 0.6rem 1rem 0.6rem 2.5rem;
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: 25px;
color: var(--text);
font-size: 0.85rem;
transition: all 0.2s;
min-width: 150px;
}
.search-input:focus {

border-color: var(--accent);
box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}
.search-input::placeholder {
color: var(--muted);
}
.search-icon {
position: absolute;
left: 0.85rem;
color: var(--muted);
font-size: 0.9rem;
pointer-events: none;
}
.search-clear {
position: absolute;
right: 0.75rem;
background: none;
border: none;
color: var(--muted);
cursor: pointer;
font-size: 1rem;
display: none;
padding: 0.25rem;
}
.search-clear.visible { display: block; }
.search-clear:hover { color: var(--text); }

/* Variable CSS pour la hauteur de l'exploration (mise à jour par JS) */
:root {
    --exploration-height: 150px; /* Valeur par défaut */
}

main {
margin-left: 260px;
max-width: 720px;
margin-right: auto;
margin-left: calc(260px + (100% - 260px - 720px) / 2);
padding: 2rem;
padding-top: calc(64px + var(--exploration-height) + 10px); /* header + exploration + marge */
padding-bottom: 4rem;
}

/* Cacher les éléments mobiles sur desktop */
@media (min-width: 901px) {
    .mobile-profile-panel,
    .mobile-profile-subtitle,
    .mobile-profile-content,
    #mobileProfileLoggedOut,
    #mobileProfileLoggedIn,
    .mobile-nav,
    .mobile-drawer {
        display: none !important;
    }
}

@media (max-width: 1100px) {
main { margin-left: 260px; margin-right: 1rem; }
.reco-banner { margin-left: 260px; margin-right: 1rem; max-width: none; }
}

/* Territoire vide */
.territory-empty {
font-size: 0.75rem;
color: var(--muted);
text-align: center;
padding: 1rem 0.5rem;
font-style: italic;
}

/* Search Results Overlay */
.search-results-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.9);
z-index: 400;
display: none;
overflow-y: auto;
}
.search-results-overlay.open { display: block; }
.search-results-container {
max-width: 800px;
margin: 0 auto;
padding: 2rem;
}
.search-results-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
padding-bottom: 1rem;
border-bottom: 1px solid var(--border);
}
.search-results-title {
font-size: 1.25rem;
font-weight: 600;
color: var(--text);
}
.search-results-query {
color: var(--accent);
}
.search-results-close {
background: none;
border: none;
color: var(--text);
font-size: 1.5rem;
cursor: pointer;
padding: 0.5rem;
}
.search-results-tabs {
display: flex;
gap: 0.5rem;
margin-bottom: 1.5rem;
flex-wrap: wrap;
}
.search-tab {
padding: 0.5rem 1rem;
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: 20px;
color: var(--text-secondary);
font-size: 0.8rem;
cursor: pointer;
transition: all 0.2s;
}
.search-tab:hover { border-color: var(--text); color: var(--text); }
.search-tab.active {
background: var(--accent);
border-color: var(--accent);
color: white;
}
.search-tab .count {
margin-left: 0.35rem;
opacity: 0.7;
}
.search-results-grid {
display: grid;
gap: 1rem;
}
.search-result-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 8px;
padding: 1rem 1.25rem;
cursor: pointer;
transition: all 0.2s;
}
.search-result-card:hover {
border-color: var(--accent);
transform: translateY(-2px);
}
.search-result-title {
font-size: 1rem;
font-weight: 600;
color: var(--text);
margin-bottom: 0.35rem;
}
.search-result-author {
font-size: 0.85rem;
color: var(--accent);
margin-bottom: 0.5rem;
}
.search-result-snippet {
font-size: 0.8rem;
color: var(--text-secondary);
line-height: 1.5;
display: -webkit-box;
-webkit-line-clamp: 3;
line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
.search-result-snippet mark {
background: rgba(230, 57, 70, 0.3);
color: var(--text);
padding: 0 0.15rem;
border-radius: 2px;
}
.search-result-meta {
display: flex;
gap: 0.75rem;
margin-top: 0.75rem;
font-size: 0.7rem;
color: var(--muted);
}
.search-result-source {
display: flex;
align-items: center;
gap: 0.35rem;
}
.search-loading {
text-align: center;
padding: 3rem;
color: var(--muted);
}
.search-no-results {
text-align: center;
padding: 3rem;
color: var(--muted);
}
.search-no-results-icon {
font-size: 3rem;
margin-bottom: 1rem;
}

.card {
background: var(--bg-card);
border: 2px solid var(--border);
border-radius: 0;
margin-bottom: 2.5rem;
overflow: visible; /* Permet aux boutons de rester visibles */
opacity: 0;
transform: translateY(20px);
transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
z-index: 1;
/* Pixel art shadow */
box-shadow: 4px 4px 0 var(--pixel-shadow);
}
.card::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 4px;
height: 100%;
background: linear-gradient(180deg, var(--accent) 0%, var(--accent-purple) 100%);
/* Pixel stepped gradient */
background: var(--accent);
}
.card:hover { 
transform: translateY(-3px); 
box-shadow: 6px 6px 0 var(--pixel-shadow), -2px -2px 0 var(--accent);
z-index: 10; /* Passe au-dessus des autres cartes au hover */
}
.card.show { opacity: 1; transform: translateY(0); }
.card.show:hover { transform: translateY(-3px); z-index: 10; }

.card-head {
padding: 1.5rem 1.5rem 0.75rem;
padding-left: 1.75rem;
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 1rem;
border-bottom: 2px dashed var(--border);
}
.author {
font-family: 'Playfair Display', serif;
font-size: 1.1rem;
font-weight: 600;
color: var(--text);
letter-spacing: 0.02em;
}
.work {
font-size: 0.8rem;
color: var(--muted);
margin-top: 0.25rem;
font-weight: 400;
font-style: italic;
}
.tag {
font-size: 0.55rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.12em;
padding: 0.35rem 0.75rem;
background: transparent;
color: var(--muted);
border: 2px solid var(--border);
border-radius: 0;
/* Pixel effect */
box-shadow: 2px 2px 0 var(--pixel-shadow);
transition: all 0.15s ease;
}
.tag:hover {
transform: translate(-1px, -1px);
box-shadow: 3px 3px 0 var(--pixel-shadow);
}
.tag.poésie { border-color: var(--accent-purple); color: var(--accent-purple); }
.tag.fable { border-color: var(--accent-tertiary); color: var(--accent-tertiary); }
.tag.nouvelle { border-color: var(--accent-secondary); color: var(--accent-secondary); }
.tag.mystique { border-color: #c9a227; color: #c9a227; }
.tag.philosophie { border-color: #8b7355; color: #a08060; }
.tag.roman { border-color: #c44569; color: #c44569; }
.tag.théâtre { border-color: #3d9be9; color: #3d9be9; }
.tag.conte { border-color: var(--accent-secondary); color: var(--accent-secondary); }

/* -----------------------------------------------------------
   EXPLORATION - Kaléidoscope (filtres croisés)
   ----------------------------------------------------------- */
.exploration-container {
position: fixed;
top: 64px;
left: 260px;
right: 0;
z-index: 90;
background: var(--bg);
border-bottom: 1px solid var(--border);
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
padding: 0.5rem 0;
transition: transform 0.3s ease, opacity 0.3s ease, max-height 0.4s ease;
max-height: 500px;
overflow: hidden;
display: flex;
flex-direction: column;
}

/* Le toggle doit être en bas sur desktop */
.exploration-toggle {
order: 99;
}

/* ?tat r?tract? au scroll */
.exploration-container.collapsed {
max-height: 42px;
opacity: 0.95;
padding: 0;
}

.exploration-container.collapsed .filter-row {
display: none !important;
}

.exploration-container.collapsed .filter-subchips {
display: none !important;
}

.exploration-container.collapsed .filter-summary {
display: none !important;
}

/* Bouton pour d?plier/replier - Barre horizontale en bas */
.exploration-toggle {
position: relative;
width: 100%;
height: 32px;
margin-top: 0.25rem;
background: linear-gradient(to bottom, transparent, rgba(90, 122, 138, 0.1));
border: none;
border-top: 1px dotted var(--border);
border-radius: 0;
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
cursor: pointer;
font-size: 0.75rem;
color: var(--text-secondary);
transition: all 0.2s ease;
z-index: 10;
}

.exploration-toggle::before {
content: "";
}

.exploration-toggle #toggleFiltersText {
font-size: 0.75rem;
letter-spacing: 0.03em;
}

.exploration-toggle::after {
content: "";
display: inline-block;
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 7px solid currentColor;
transform: translateY(-1px);
}

.exploration-toggle:hover {
background: rgba(90, 122, 138, 0.15);
color: var(--accent);
}

.exploration-container.collapsed .exploration-toggle {
background: var(--accent);
color: white;
height: 36px;
border-top: none;
}

.exploration-container.collapsed .exploration-toggle::before {
content: "";
}

.exploration-container.collapsed .exploration-toggle::after {
border-bottom: 0;
border-top: 7px solid currentColor;
transform: translateY(1px);
}

.exploration-container.collapsed .exploration-toggle:hover {
background: var(--accent-secondary);
}

/* Ligne de filtres */
.filter-row {
display: flex;
align-items: center;
padding: 0.35rem 1rem;
gap: 0.75rem;
}

.filter-label {
font-size: 0.75rem;
font-weight: 600;
color: var(--text-secondary);
min-width: 70px;
flex-shrink: 0;
font-family: 'Cormorant Garamond', serif;
letter-spacing: 0.02em;
}

.filter-chips {
display: flex;
gap: 0.4rem;
overflow-x: auto;
scrollbar-width: none;
-ms-overflow-style: none;
padding: 0.2rem 0;
}
.filter-chips::-webkit-scrollbar { display: none; }

.filter-chip {
padding: 0.3rem 0.7rem;
background: transparent;
border: 1px solid var(--border);
border-radius: 14px;
font-size: 0.75rem;
color: var(--text-secondary);
cursor: pointer;
transition: all 0.15s ease;
white-space: nowrap;
flex-shrink: 0;
}

.filter-chip:hover {
border-color: var(--text-secondary);
color: var(--text);
background: rgba(255,255,255,0.03);
}

.filter-chip.active {
background: var(--accent);
border-color: var(--accent);
color: white;
font-weight: 500;
}

.filter-chip[data-value="all"].active {
background: var(--bg-elevated);
border-color: var(--text-secondary);
color: var(--text);
}

/* S?parateur de filtres */
.filter-separator {
color: var(--text-secondary);
opacity: 0.3;
font-size: 0.9rem;
margin: 0 0.2rem;
user-select: none;
flex-shrink: 0;
}

/* Cat?gories parentes (d?pliables) */
.filter-chip.filter-parent {
background: rgba(212, 165, 116, 0.1);
border-color: var(--accent);
color: var(--accent);
font-weight: 500;
}

.filter-chip.filter-parent:hover {
background: rgba(212, 165, 116, 0.2);
}

.filter-chip.filter-parent.expanded {
background: var(--accent);
color: white;
}

/* Conteneur des sous-cat?gories */
.filter-subchips {
display: flex;
gap: 0.4rem;
padding: 0.4rem 0 0.4rem 70px;
overflow-x: auto;
scrollbar-width: none;
-ms-overflow-style: none;
animation: slideDown 0.2s ease-out;
flex-wrap: wrap;
}
.filter-subchips::-webkit-scrollbar { display: none; }

@keyframes slideDown {
from {
opacity: 0;
transform: translateY(-5px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

/* Sous-cat?gories (enfants) */
.filter-chip.filter-child {
background: rgba(255,255,255,0.03);
border-style: dashed;
font-size: 0.7rem;
padding: 0.25rem 0.6rem;
}

.filter-chip.filter-child:hover {
border-style: solid;
}

.filter-chip.filter-child.active {
background: var(--accent);
border-style: solid;
border-color: var(--accent);
color: white;
}

/* R?sum? des filtres */
.filter-summary {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.5rem 1rem;
background: rgba(212, 165, 116, 0.1);
border-top: 1px solid var(--border);
margin-top: 0.25rem;
}

.filter-summary-text {
flex: 1;
display: flex;
flex-wrap: wrap;
gap: 0.4rem;
align-items: center;
min-width: 0;
font-size: 0.8rem;
color: var(--accent);
font-weight: 500;
}

.filter-tag {
display: inline-flex;
align-items: center;
gap: 0.35rem;
padding: 0.2rem 0.5rem;
border-radius: 999px;
border: 1px solid rgba(212, 165, 116, 0.35);
background: rgba(212, 165, 116, 0.08);
color: var(--accent);
white-space: nowrap;
}

.filter-tag-removable {
padding-right: 0.25rem;
}

.filter-tag-label {
min-width: 0;
}

.filter-tag-remove {
border: none;
background: none;
color: var(--accent);
opacity: 0.6;
cursor: pointer;
font-size: 0.95rem;
line-height: 1;
padding: 0 0.25rem;
}

.filter-tag-remove:hover {
opacity: 1;
}

.filter-free-input {
flex: 0 0 220px;
max-width: 40vw;
min-width: 160px;
background: rgba(255, 255, 255, 0.06);
border: 1px solid var(--border);
color: var(--text);
border-radius: 10px;
padding: 0.35rem 0.6rem;
font-size: 0.85rem;

}

.filter-free-input:focus {
border-color: rgba(212, 165, 116, 0.8);
box-shadow: 0 0 0 2px rgba(212, 165, 116, 0.2);
}

.filter-summary-clear,
.filter-summary-random {
background: none;
border: none;
font-size: 1rem;
cursor: pointer;
padding: 0.3rem;
opacity: 0.85;
color: var(--text);
transition: opacity 0.2s;
}

.filter-summary-clear:hover,
.filter-summary-random:hover {
opacity: 1;
color: var(--accent);
}

.filter-summary-go {
background: var(--accent);
border: none;
border-radius: 14px;
padding: 0.4rem 1rem;
font-size: 0.8rem;
font-weight: 600;
color: white;
cursor: pointer;
transition: all 0.2s;
}

.filter-summary-go:hover {
transform: translateY(-1px);
box-shadow: 0 2px 8px rgba(212, 165, 116, 0.4);
}

/* -----------------------------------------------------------
   SIDEBAR - Barres de territoires cliquables
   ----------------------------------------------------------- */
.territory-bars {
display: flex;
flex-direction: column;
gap: 0.5rem;
}

.territory-bar {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.4rem 0.6rem;
border-radius: 6px;
cursor: pointer;
transition: all 0.2s;
}

.territory-bar:hover {
background: rgba(255,255,255,0.05);
}

.territory-bar-label {
font-size: 0.75rem;
color: var(--text-secondary);
min-width: 70px;
}

.territory-bar-track {
flex: 1;
height: 6px;
background: var(--bg-elevated);
border-radius: 3px;
overflow: hidden;
}

.territory-bar-fill {
height: 100%;
background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
border-radius: 3px;
transition: width 0.3s ease;
}

.territory-bar-value {
font-size: 0.7rem;
color: var(--muted);
min-width: 30px;
text-align: right;
}

.territory-bar:hover .territory-bar-label {
color: var(--accent);
}

.territory-bar:hover .territory-bar-fill {
filter: brightness(1.2);
}

/* Anciennes classes conserv?es pour compatibilit? */
.exploration-tabs {
display: flex;
gap: 0;
padding: 0 1rem;
border-bottom: 2px solid var(--border);
background: var(--bg);
}

.exploration-tab {
padding: 0.6rem 1.2rem;
background: none;
border: none;
border-bottom: 2px solid transparent;
color: var(--text-secondary);
font-size: 0.85rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
display: flex;
align-items: center;
gap: 0.4rem;
}

.exploration-tab:hover {
color: var(--text);
background: rgba(255,255,255,0.03);
}

.exploration-tab.active {
color: var(--accent);
border-bottom-color: var(--accent);
}

/* Ambiances de lecture */
.ambiance-bar {
display: flex;
gap: 0.5rem;
padding: 0.75rem 1rem;
background: var(--bg-card);
overflow-x: auto;
scrollbar-width: none;
-ms-overflow-style: none;
}
.ambiance-bar::-webkit-scrollbar { display: none; }
.ambiance-pill {
display: flex;
align-items: center;
gap: 0.4rem;
padding: 0.5rem 1rem;
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: 20px;
font-size: 0.8rem;
color: var(--text-secondary);
cursor: pointer;
transition: all 0.2s;
white-space: nowrap;
flex-shrink: 0;
}
.ambiance-pill:hover {
border-color: var(--text-secondary);
color: var(--text);
transform: translateY(-1px);
}
.ambiance-pill.active {
background: var(--accent);
border-color: var(--accent);
color: white;
box-shadow: 0 2px 8px rgba(255,69,58,0.3);
}
.ambiance-pill .ambiance-icon {
font-size: 1rem;
}
.ambiance-pill .ambiance-name {
font-weight: 500;
}
.ambiance-intro {
position: relative;
margin-left: 260px;
margin-top: 0; /* Pas de marge car d?j? dans le flux apr?s exploration */
z-index: 85;
padding: 1rem 1.5rem;
text-align: center;
background: var(--ambiance-bg);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border-bottom: 1px solid var(--accent-secondary);
box-shadow: 0 2px 12px rgba(0,0,0,0.15);
animation: fadeIn 0.5s ease;
}
.ambiance-intro .close-intro {
position: absolute;
right: 1rem;
top: 50%;
transform: translateY(-50%);
background: none;
border: none;
color: var(--muted);
cursor: pointer;
font-size: 1.2rem;
opacity: 0.6;
transition: opacity 0.2s;
}
.ambiance-intro .close-intro:hover {
opacity: 1;
}
.ambiance-intro h2 {
font-family: 'Playfair Display', serif;
font-size: 1.5rem;
color: var(--text);
margin-bottom: 0.5rem;
}
.ambiance-intro .period-badge {
display: inline-block;
padding: 0.2rem 0.6rem;
background: var(--ambiance-badge-bg);
border-radius: 12px;
font-size: 0.75rem;
color: var(--accent-secondary);
font-style: normal;
margin-bottom: 0.5rem;
border: 1px solid var(--ambiance-badge-border);
}
.ambiance-intro p {
font-size: 0.9rem;
color: var(--text-secondary);
font-style: italic;
max-width: 500px;
margin: 0 auto;
}
.ambiance-intro .ambiance-tags {
display: flex;
justify-content: center;
gap: 0.5rem;
margin-top: 0.75rem;
flex-wrap: wrap;
}
.ambiance-intro .ambiance-tag {
font-size: 0.7rem;
padding: 0.25rem 0.6rem;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 12px;
color: var(--muted);
cursor: pointer;
transition: all 0.2s ease;
}
.ambiance-intro .ambiance-tag:hover {
background: var(--accent);
color: white;
border-color: var(--accent);
transform: translateY(-1px);
}
.ambiance-intro .ambiance-tag.more-authors {
cursor: default;
opacity: 0.7;
}
.ambiance-intro .ambiance-tag.more-authors:hover {
background: var(--bg-card);
color: var(--muted);
border-color: var(--border);
transform: none;
}

/* Ajustement du main quand l'intro d'ambiance est visible - plus n?cessaire avec position relative */
/* body.has-ambiance-intro main { padding ajust? automatiquement } */

/* Language badge */
.lang-badge {
font-size: 0.6rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.05em;
padding: 0.25rem 0.5rem;
background: rgba(255,255,255,0.1);
color: var(--muted);
border-radius: 4px;
margin-left: 0.5rem;
}
.lang-badge.en { background: rgba(0,82,180,0.2); color: #64b5f6; }
.lang-badge.de { background: rgba(255,204,0,0.2); color: #ffd54f; }
.lang-badge.it { background: rgba(0,140,69,0.2); color: #81c784; }
.lang-badge.es { background: rgba(198,11,30,0.2); color: #e57373; }
.lang-badge.pt { background: rgba(0,102,0,0.2); color: #66bb6a; }
.lang-badge.ru { background: rgba(0,57,166,0.2); color: #7986cb; }

/* Badge publique/privée pour les collections */
.collection-card-badges {
    margin-top: 4px;
    margin-bottom: 2px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.collection-card-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
    letter-spacing: 0.2px;
}

.collection-card-badge.public {
    background: rgba(46, 204, 113, 0.15);
    border-color: rgba(46, 204, 113, 0.35);
    color: #7be9a6;
}

.collection-card-badge.private {
    background: rgba(231, 76, 60, 0.12);
    border-color: rgba(231, 76, 60, 0.35);
    color: #ff9a8c;
}
.lang-badge.la { background: rgba(139,90,43,0.2); color: #bcaaa4; }
.lang-badge.zh { background: rgba(222,41,16,0.2); color: #ef5350; }
.lang-badge.ja { background: rgba(188,0,45,0.2); color: #f06292; }
.lang-badge.ar { background: rgba(0,122,61,0.2); color: #4db6ac; }
.lang-badge.el { background: rgba(13,94,175,0.2); color: #4fc3f7; }

.card-body {
padding: 1.25rem 1.5rem 1.25rem 1.75rem;
font-size: 1.05rem;
line-height: 1.85;
position: relative;
color: var(--text-secondary);
font-weight: 300;
cursor: default;
}
.card-body .like-heart-overlay {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) scale(0);
font-size: 2.6rem;
color: var(--accent-secondary);
pointer-events: none;
opacity: 0;
z-index: 10;
filter: drop-shadow(0 0 8px rgba(107, 58, 58, 0.45));
}
.card-body .like-heart-overlay.animate {
animation: likeHeartPop 0.8s ease-out forwards;
}
@keyframes likeHeartPop {
0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
15% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
30% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}
.text-teaser {
white-space: pre-wrap;
}
.text-full {
display: none;
white-space: pre-wrap;
animation: fadeIn 0.4s ease;
}
.text-full.visible { display: block; }
@keyframes fadeIn {
from { opacity: 0; transform: translateY(-10px); }
to { opacity: 1; transform: translateY(0); }
}

/* Bouton Suite - style brutaliste */
.btn-suite {
display: inline-flex;
align-items: center;
gap: 0.75rem;
margin-top: 1.25rem;
padding: 0.6rem 1.25rem;
background: transparent;
border: 1px solid var(--accent);
border-radius: 0;
color: var(--accent);
font-size: 0.7rem;
font-weight: 600;
letter-spacing: 0.1em;
text-transform: uppercase;
cursor: pointer;
transition: all 0.2s ease;
}
.btn-suite:hover {
background: var(--accent);
color: var(--bg);
}
.btn-suite.exhausted {
border-color: var(--muted);
color: var(--muted);
cursor: default;
}
.btn-suite .arrow {
transition: transform 0.3s;
}
.btn-suite:hover .arrow {
transform: translateX(3px);
}

/* Lien vers la source après lecture complète */
.btn-source-link {
display: inline-flex;
align-items: center;
gap: 0.5rem;
margin-top: 1.25rem;
padding: 0.6rem 1.25rem;
background: transparent;
border: 1px solid var(--muted);
color: var(--muted);
font-size: 0.7rem;
font-weight: 600;
letter-spacing: 0.1em;
text-transform: uppercase;
text-decoration: none;
transition: all 0.2s ease;
}
.btn-source-link:hover {
border-color: var(--accent);
color: var(--accent);
}

/* Chunks de texte r?v?l?s progressivement */
.text-chunk {
margin-top: 1rem;
padding-top: 0.75rem;
}
.text-chunk + .text-chunk {
border-top: 1px dotted var(--border);
}

.card-foot {
padding: 1.25rem 1.75rem;
border-top: 1px solid var(--border);
display: flex;
flex-direction: column;
gap: 0.75rem;
position: relative;
z-index: 2; /* S'assure que les boutons sont toujours cliquables */
background: var(--bg-card); /* Fond pour éviter la transparence */
}
.card-keywords {
display: flex;
flex-wrap: wrap;
gap: 0.4rem;
padding-bottom: 0.5rem;
}
.keyword-tag {
font-size: 0.65rem;
padding: 0.25rem 0.6rem;
background: rgba(255,255,255,0.03);
border: 1px solid var(--border);
border-radius: 12px;
color: var(--muted);
cursor: pointer;
transition: all 0.2s ease;
text-transform: lowercase;
}
.keyword-tag:hover {
background: var(--accent);
border-color: var(--accent);
color: white;
transform: translateY(-1px);
}
.keyword-tag::before {
content: '#';
opacity: 0.5;
}
.actions {
display: flex;
gap: 0.4rem;
flex-wrap: wrap;
justify-content: flex-start;
align-items: center;
position: relative;
z-index: 5; /* Toujours au-dessus pour être cliquable */
}

/* Like button (desktop/global) - cœur plus grand et aligné avec le compteur */
.card-foot .actions .btn-like {
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0;
    font-size: 0.65rem;
    min-height: 32px;
}

.card-foot .actions .btn-like .like-icon {
    font-size: 1.2rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    color: var(--accent);
    text-shadow:
        1px 0 var(--border),
        -1px 0 var(--border),
        0 1px var(--border),
        0 -1px var(--border);
}

.card-foot .actions .btn-like .like-count {
    font-size: 0.8rem;
    min-width: 22px;
    padding: 0.15rem 0.5rem;
    border: none !important;
    background: transparent !important;
}

/* Boutons d'action individuels */
.btn-like { transition: all 0.2s ease; }
.btn-like.active {
    background: transparent !important;
    border-color: transparent !important;
    color: #e74c3c !important;
    animation: likePopIn 0.3s ease;
}
.btn-like.active .like-icon {
    color: #e74c3c !important;
    text-shadow: none;
}
@keyframes likePopIn {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Minimum touch target size */
.btn, .extrait-action {
    min-height: 36px;
    min-width: 36px;
}

.btn {
background: transparent;
border: 1px solid var(--border);
color: var(--text-secondary);
padding: 0 1rem;
height: 2.4rem;
border-radius: 0;
cursor: pointer;
font-family: inherit;
font-size: 0.65rem;
font-weight: 600;
letter-spacing: 0.05em;
text-transform: uppercase;
transition: all 0.2s ease;
text-decoration: none;
display: inline-flex;
align-items: center;
gap: 0.4rem;
}
.btn:hover { border-color: var(--text); color: var(--text); }
.btn.active {
background: var(--accent);
border-color: var(--accent);
color: white;
}

.feed-loading {
text-align: center;
padding: 4rem 1rem;
color: var(--muted);
font-size: 0.75rem;
letter-spacing: 0.1em;
text-transform: uppercase;
width: 100%;
max-width: 100%;
box-sizing: border-box;
}
.spinner {
width: 24px;
height: 24px;
border: 2px solid var(--border);
border-top-color: var(--accent);
border-radius: 50%;
margin: 0 auto 1rem;
animation: spin 0.8s linear infinite;
}
.spinner-small {
width: 16px;
height: 16px;
border: 2px solid var(--border);
border-top-color: var(--accent);
border-radius: 50%;
display: inline-block;
animation: spin 0.8s linear infinite;
vertical-align: middle;
margin-right: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------------
   ? BANDEAU "NOUVEAUX TEXTES" (style Twitter)
   --------------------------------------------------------------------------- */
.new-texts-banner {
position: fixed;
    top: 60px;
left: 50%;
transform: translateX(-50%) translateY(-100px);
background: linear-gradient(135deg, var(--accent), var(--accent-purple));
color: white;
padding: 0.75rem 1.5rem;
border-radius: 20px;
font-size: 0.85rem;
font-weight: 600;
cursor: pointer;
z-index: 150;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 4px 20px rgba(230, 57, 70, 0.4), 4px 4px 0 var(--pixel-shadow);
display: flex;
align-items: center;
gap: 0.5rem;
}
.new-texts-banner.visible {
transform: translateX(-50%) translateY(0);
}
.new-texts-banner:hover {
transform: translateX(-50%) translateY(-2px);
box-shadow: 0 6px 24px rgba(230, 57, 70, 0.5), 5px 5px 0 var(--pixel-shadow);
}
.new-texts-banner:active {
transform: translateX(-50%) translateY(2px);
box-shadow: 0 2px 10px rgba(230, 57, 70, 0.3), 2px 2px 0 var(--pixel-shadow);
}

/* Sentinelle invisible en haut du feed pour le scroll infini vers le haut */
.top-scroll-sentinel {
    height: 1px;
    width: 100%;
    pointer-events: none;
    margin-bottom: 0;
}

/* Indicateur de chargement en haut du feed */
.top-loading-indicator {
text-align: center;
padding: 1.5rem;
color: var(--muted);
font-size: 0.8rem;
letter-spacing: 0.1em;
text-transform: uppercase;
background: var(--bg-card);
border: 2px solid var(--border);
margin-bottom: 1.5rem;
animation: fadeIn 0.3s ease;
}

/* Pull to refresh indicator */
.pull-indicator {
position: fixed;
top: 60px;
left: 50%;
transform: translateX(-50%);
background: var(--bg-card);
border: 1px solid var(--accent-secondary);
color: var(--accent-secondary);
padding: 0.6rem 1.2rem;
border-radius: 20px;
font-size: 0.8rem;
z-index: 200;
box-shadow: 0 4px 16px rgba(0,0,0,0.4);
opacity: 0;
transition: opacity 0.2s;
}

/* Animation pour les nouvelles cartes ins?r?es en haut */
.card.card-new {
opacity: 0;
transform: translateY(-30px);
}
.card.card-new.show {
opacity: 1;
transform: translateY(0);
animation: slideInFromTop 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideInFromTop {
from {
    opacity: 0;
    transform: translateY(-30px);
}
to {
    opacity: 1;
    transform: translateY(0);
}
}

/* Highlight temporaire pour les nouvelles cartes */
.card.card-highlight {
box-shadow: 0 0 0 3px var(--accent), 4px 4px 0 var(--pixel-shadow);
animation: pulseHighlight 1.5s ease-in-out;
}
@keyframes pulseHighlight {
0%, 100% { box-shadow: 0 0 0 3px var(--accent), 4px 4px 0 var(--pixel-shadow); }
50% { box-shadow: 0 0 0 5px var(--accent), 0 0 20px rgba(230, 57, 70, 0.3), 4px 4px 0 var(--pixel-shadow); }
}

/* Bouton scroll to top avec indicateur de nouveaux contenus */
.scroll-top-btn {
position: fixed;
bottom: 2rem;
right: 2rem;
width: 48px;
height: 48px;
background: var(--bg-elevated);
border: 2px solid var(--border);
border-radius: 50%;
color: var(--text);
font-size: 1.2rem;
cursor: pointer;
z-index: 100;
opacity: 0;
transform: translateY(20px);
transition: all 0.3s ease;
box-shadow: 4px 4px 0 var(--pixel-shadow);
display: flex;
align-items: center;
justify-content: center;
}
.scroll-top-btn.visible {
opacity: 1;
transform: translateY(0);
}
.scroll-top-btn:hover {
background: var(--accent);
border-color: var(--accent);
transform: translateY(-2px);
box-shadow: 5px 5px 0 var(--pixel-shadow);
}
.scroll-top-btn.has-new {
background: linear-gradient(135deg, var(--accent), var(--accent-purple));
border-color: var(--accent);
animation: bounceNew 2s ease-in-out infinite;
}
.scroll-top-btn.has-new::after {
content: '?';
position: absolute;
top: -8px;
right: -8px;
font-size: 0.8rem;
}
@keyframes bounceNew {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-5px); }
}

/* Mobile : ajuster le bandeau nouveaux textes */
@media screen and (max-width: 900px) {
.new-texts-banner {
    top: auto;
    bottom: 80px;
    font-size: 0.8rem;
    padding: 0.6rem 1.25rem;
}
.scroll-top-btn {
    bottom: 5rem;
    right: 1rem;
    width: 44px;
    height: 44px;
}
}

.toast {
position: fixed;
bottom: 2rem;
left: 50%;
transform: translateX(-50%) translateY(100px);
background: var(--bg-elevated);
border: 1px solid var(--accent);
color: var(--text);
padding: 0.9rem 1.75rem;
border-radius: 12px;
font-size: 0.85rem;
font-weight: 500;
z-index: 9999;
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* Toast mobile: au-dessus de la barre de navigation */
@media screen and (max-width: 900px) {
    .toast {
        bottom: 5rem;
    }
}

.progress {
position: fixed;
top: 0;
left: 280px;
right: 0;
height: 2px;
background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
z-index: 1000;
transition: width 0.1s;
}

/* Reader overlay */
.reader-overlay {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background: var(--bg);
z-index: 200;
display: none;
flex-direction: column;
animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.reader-overlay.open { display: flex; }
.reader-header {
padding: 1.25rem 2rem;
background: var(--bg-card);
border-bottom: 1px solid var(--border);
display: flex;
justify-content: space-between;
align-items: center;
}
.reader-title {
font-family: 'Playfair Display', serif;
font-size: 1.1rem;
font-weight: 400;
color: var(--text);
}
.reader-close {
background: var(--bg-elevated);
border: 1px solid var(--border);
color: var(--text);
width: 44px;
height: 44px;
border-radius: 12px;
font-size: 1.2rem;
cursor: pointer;
transition: all 0.2s;
display: flex;
align-items: center;
justify-content: center;
}
.reader-close:hover { border-color: var(--accent); color: var(--accent); }

/* Bouton fermer flottant en bas */
.floating-close-btn {
position: fixed;
bottom: 24px;
left: 50%;
transform: translateX(-50%);
background: var(--bg-card);
border: 1px solid var(--border);
color: var(--text);
padding: 0.75rem 2rem;
border-radius: 30px;
font-size: 0.9rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
box-shadow: 0 4px 20px rgba(0,0,0,0.3);
z-index: 100;
}
.floating-close-btn:hover {
background: var(--accent);
color: white;
border-color: var(--accent);
transform: translateX(-50%) scale(1.05);
}

.reader-content {
flex: 1;
overflow-y: auto;
padding: 3rem 2rem;
font-size: 1.15rem;
line-height: 2.2;
max-width: 700px;
margin: 0 auto;
width: 100%;
font-weight: 300;
}

/* Navigateur de Cat?gories - Barre flottante en bas */
.category-nav {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: var(--bg-card);
border-top: 1px solid var(--border);
padding: 0.75rem 1.5rem;
padding-right: 6rem; /* Espace pour le bouton fermer */
animation: slideUp 0.3s ease;
z-index: 100;
box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
max-height: 40vh;
overflow-y: auto;
}
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.cat-breadcrumbs {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
align-items: center;
font-size: 0.9rem;
margin-bottom: 1rem;
font-family: 'Courier Prime', monospace;
}
.cat-crumb {
cursor: pointer;
color: var(--muted);
transition: color 0.2s;
}
.cat-crumb:hover { color: var(--accent); text-decoration: underline; }
.cat-crumb.active { color: var(--text); font-weight: bold; pointer-events: none; }
.cat-sep { color: var(--border); }

.cat-subcategories {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.cat-pill {
display: inline-flex;
align-items: center;
padding: 0.3rem 0.8rem;
background: var(--bg);
border: 1px solid var(--border);
border-radius: 999px;
font-size: 0.8rem;
cursor: pointer;
transition: all 0.2s;
color: var(--text-secondary);
}
.cat-pill:hover {
border-color: var(--accent);
color: var(--accent);
transform: translateY(-2px);
}
.cat-pill .count {
font-size: 0.7em;
margin-left: 0.4rem;
opacity: 0.6;
}
.cat-close {
position: absolute;
top: 0.5rem;
right: 1rem;
background: var(--danger);
border: none;
color: white;
font-size: 0.85rem;
cursor: pointer;
padding: 0.4rem 0.8rem;
border-radius: 6px;
font-weight: 500;
}
.cat-close:hover { background: var(--danger); }

.empty-state {
text-align: center;
padding: 3rem 1rem;
color: var(--muted);
font-style: italic;
line-height: 1.8;
}

/* Branches enrichies */
.branches-container {
display: flex;
flex-direction: column;
gap: 1rem;
}
.branch-group {
background: var(--card-bg);
border-radius: 8px;
padding: 0.8rem;
border: 1px solid var(--border);
}
.branch-group-title {
font-size: 0.75rem;
font-weight: 600;
color: var(--accent);
margin-bottom: 0.5rem;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.branch-items {
display: flex;
flex-wrap: wrap;
gap: 0.4rem;
}

/* Favorites View Overlay */
.favorites-overlay {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background: var(--overlay-bg);
z-index: 250;
display: none;
animation: fadeIn 0.3s ease;
overflow-y: auto;
overflow-anchor: none;
}
.favorites-overlay.open { display: block; }
.favorites-view {
max-width: 900px;
margin: 0 auto;
padding: 2rem;
padding-bottom: 80px;
overflow-anchor: none;
}
.favorites-header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 1rem;
margin-bottom: 1rem;
border-bottom: 1px solid var(--border);
position: sticky;
top: 0;
background: var(--bg);
z-index: 10;
padding-top: 1rem;
margin-top: -1rem;
}
.favorites-title {
font-size: 0.8rem;
font-weight: 700;
letter-spacing: 0.2em;
color: var(--accent);
}
.favorites-grid {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.collections-view {
display: flex;
flex-direction: column;
gap: 0.6rem;
overflow-anchor: none;
}
.collections-list {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.collection-card {
background: var(--bg-card);
border: 2px solid var(--border);
padding: 0.7rem 0.85rem;
display: flex;
align-items: center;
gap: 0.6rem;
cursor: pointer;
transition: all 0.2s ease;
box-shadow: 2px 2px 0 var(--pixel-shadow);
}
.collection-card:hover {
border-color: var(--accent);
box-shadow: 4px 4px 0 var(--pixel-shadow);
}
.collection-card-emoji {
width: 36px;
height: 36px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
font-size: 1rem;
background: var(--bg-elevated);
border: 1px solid var(--border);
flex-shrink: 0;
}
.collection-card-info {
flex: 1;
min-width: 0;
}
.collection-card-name {
font-size: 1rem;
font-weight: 600;
color: var(--text);
}
.collection-card-count {
font-size: 0.8rem;
color: var(--muted);
margin-top: 0.15rem;
}
.collection-card-desc {
font-size: 0.85rem;
color: var(--text-secondary);
line-height: 1.4;
margin-top: 0.35rem;
}
.collection-card-actions {
display: flex;
gap: 0.35rem;
}
.collection-card-action {
width: 32px;
height: 32px;
display: inline-flex;
align-items: center;
justify-content: center;
border: 1px solid var(--border);
background: var(--bg-elevated);
color: var(--text-secondary);
cursor: pointer;
transition: all 0.2s ease;
}
.collection-card-action:hover {
border-color: var(--accent);
color: var(--accent);
}
.collection-view {
display: flex;
flex-direction: column;
gap: 1rem;
}
.collection-view-header {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.collection-description {
font-size: 0.9rem;
color: var(--text-secondary);
line-height: 1.6;
}
.collection-items {
display: flex;
flex-direction: column;
gap: 1rem;
overflow-anchor: none;
}
.collection-item-card {
background: var(--bg-card);
border: 2px solid var(--border);
border-radius: 10px;
padding: 0.9rem 1rem;
box-shadow: 2px 2px 0 var(--pixel-shadow);
transition: border-color 0.2s ease;
overflow-anchor: none;
contain: layout paint;
}
.collection-item-card:active,
.collection-item-content:active {
transform: none;
}
.collection-item-card.expanded {
border-color: var(--accent);
}
.collection-item-content {
cursor: pointer;
width: 100%;
display: flex;
flex-direction: column;
}
.collection-item-header {
display: flex;
flex-direction: column;
gap: 0.2rem;
margin-bottom: 0.25rem;
}
.collection-item-title {
font-size: 1rem;
font-weight: 600;
color: var(--text);
}
.collection-item-author {
font-size: 0.8rem;
color: var(--muted);
font-style: italic;
}
.collection-item-text-container {
width: 100%;
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
gap: 0;
}
.collection-item-preview,
.collection-item-full {
width: 100%;
display: block;
font-size: 0.97rem;
line-height: 1.55;
color: var(--text-secondary);
white-space: pre-wrap;
word-wrap: break-word;
max-width: 100%;
padding: 0.4rem 0.6rem;
background: var(--bg-elevated);
border-radius: 6px;
border-left: 2px solid var(--accent);
}
.collection-item-preview,
.collection-item-full {
overflow: hidden;
will-change: opacity, transform;
transition: opacity 0.18s ease, transform 0.18s ease, padding 0.2s ease, border 0.2s ease, background 0.2s ease;
}
.collection-item-preview {
max-height: 360px;
min-height: 0;
opacity: 1;
}
.collection-item-full {
max-height: none;
height: 0;
opacity: 0;
padding: 0;
margin: 0;
border-left-color: transparent;
background: transparent;
transform: translateY(-2px);
}
.collection-item-card.expanded .collection-item-preview {
height: 0;
opacity: 0;
padding: 0;
margin: 0;
border-left-color: transparent;
background: transparent;
transform: translateY(-2px);
}
.collection-item-card.expanded .collection-item-full {
height: auto;
opacity: 1;
padding: 0.4rem 0.6rem;
margin-top: 0.25rem;
border-left-color: var(--accent);
background: var(--bg-elevated);
transform: translateY(0);
}
.collection-item-note {
margin-top: 0.75rem;
padding: 0.5rem 0.75rem;
background: var(--bg-elevated);
border: 1px dashed var(--border);
border-radius: 8px;
color: var(--text-secondary);
font-size: 0.85rem;
line-height: 1.5;
}
.collection-item-actions {
display: flex;
gap: 0.4rem;
margin-top: 0.5rem;
}
.item-action {
background: var(--bg-elevated);
border: 1px solid var(--border);
color: var(--text-secondary);
padding: 0.35rem 0.6rem;
border-radius: 6px;
cursor: pointer;
transition: all 0.2s ease;
}
.item-action:hover {
border-color: var(--accent);
color: var(--accent);
}
.collection-item-expand {
    margin-top: 0.2rem;
    width: 100%;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.4rem 0.65rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.2s ease;
}
.collection-item-expand:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.collection-item-expand:active {
    transform: translateY(1px);
    box-shadow: none;
}
.collection-item-expand.is-hidden {
    display: none;
}
.collection-item-expand .expand-icon {
    font-size: 0.95rem;
    opacity: 0.8;
}
.collection-item-expand .expand-label {
    line-height: 1.2;
}
.collection-item-card.expanded .collection-item-expand {
    background: rgba(90,122,138,0.15);
    border-color: var(--accent);
    color: var(--accent);
}
.fav-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-left: 4px solid var(--accent);
padding: 1.5rem;
transition: all 0.2s;
}
.fav-card:hover {
border-color: var(--accent);
box-shadow: -4px 4px 0 var(--border);
}
.fav-card-head {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 1rem;
}
.fav-card-author {
font-family: 'Playfair Display', serif;
font-size: 1rem;
font-weight: 600;
color: var(--text);
}
.fav-card-title {
font-size: 0.8rem;
color: var(--muted);
font-style: italic;
margin-top: 0.25rem;
}
.fav-card-text {
font-size: 0.95rem;
line-height: 1.8;
color: var(--text-secondary);
white-space: pre-wrap;
}
.fav-card-actions {
margin-top: 1rem;
padding-top: 1rem;
border-top: 1px solid var(--border);
display: flex;
gap: 0.5rem;
}
.fav-empty {
text-align: center;
padding: 4rem 2rem;
color: var(--muted);
}
.fav-empty-icon {
font-size: 3rem;
margin-bottom: 1rem;
opacity: 0.3;
}
.fav-empty-text {
font-size: 0.8rem;
letter-spacing: 0.1em;
text-transform: uppercase;
}

/* Cartes de likes locaux */
.favorite-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    padding: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.favorite-card:hover {
    border-color: var(--accent);
    box-shadow: -4px 4px 0 var(--border);
    transform: translateX(4px);
}
.favorite-card-content {
    flex: 1;
    min-width: 0;
}
.favorite-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}
.favorite-card-author {
    font-size: 0.85rem;
    color: var(--accent);
    font-style: italic;
    margin-bottom: 0.5rem;
}
.favorite-card-preview {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.favorite-card-remove {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.2s;
    opacity: 0.5;
}
.favorite-card-remove:hover {
    color: var(--accent-tertiary);
    opacity: 1;
}

/* === NOUVEAU DESIGN LIKES === */
.likes-empty {
    text-align: center;
    padding: 4rem 2rem;
}
.likes-empty-icon {
    font-size: 4rem;
    color: var(--accent);
    margin-bottom: 1rem;
    opacity: 0.4;
}
.likes-empty h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.likes-empty p {
    color: var(--muted);
    font-size: 0.9rem;
}
.likes-header-info {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
}
.likes-count {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-family: 'Playfair Display', serif;
}
.likes-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.liked-text-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0;
    display: flex;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: slideInUp 0.4s ease forwards;
    opacity: 0;
    transform: translateY(10px);
    position: relative;
}
@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.liked-text-card:hover {
    border-color: var(--accent);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    transform: translateY(-3px);
}
.liked-card-accent {
    width: 5px;
    background: linear-gradient(180deg, var(--accent), var(--accent-secondary));
    flex-shrink: 0;
}
.liked-text-main {
    flex: 1;
    min-width: 0;
    padding: 1.25rem 1.5rem;
}
.liked-text-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}
.liked-text-author {
    color: var(--accent-secondary);
    font-weight: 500;
}
.liked-text-dot {
    color: var(--muted);
}
.liked-text-time {
    color: var(--muted);
}
.liked-text-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    margin: 0 0 0.75rem 0;
}
.liked-text-excerpt {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.liked-text-cta {
    display: flex;
    align-items: center;
}
.liked-cta-text {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
    transition: all 0.2s;
}
.liked-text-card:hover .liked-cta-text {
    transform: translateX(4px);
}
.liked-text-remove {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
}
.liked-text-card:hover .liked-text-remove {
    opacity: 1;
}
.liked-text-remove:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

/* Trending view styles */
.trending-view {
max-width: 700px;
}
.trending-subtitle {
text-align: center;
font-size: 0.85rem;
color: var(--muted);
margin-bottom: 2rem;
font-style: italic;
}
.trending-feed {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.trending-loading {
text-align: center;
padding: 3rem;
color: var(--muted);
}
.trending-card {
background: var(--bg-card);
border: 2px solid var(--border);
border-radius: 0;
overflow: hidden;
transition: all 0.3s ease;
box-shadow: 2px 2px 0 var(--pixel-shadow);
}
.trending-card:hover {
border-color: var(--accent-secondary);
transform: translateY(-2px);
box-shadow: 4px 6px 0 var(--pixel-shadow), 0 10px 20px rgba(0,0,0,0.25);
}
.trending-card-header {
padding: 1rem 1.25rem;
background: linear-gradient(135deg, rgba(90,122,138,0.12), rgba(107,58,58,0.10));
border-bottom: 1px solid var(--border);
display: flex;
justify-content: space-between;
align-items: center;
}
.trending-card-author {
display: flex;
align-items: center;
gap: 0.75rem;
cursor: pointer;
}
.trending-card-author:hover .trending-username {
color: var(--accent);
}
.trending-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
display: flex;
align-items: center;
justify-content: center;
font-size: 0.9rem;
font-weight: 600;
color: white;
}
.trending-username {
font-size: 0.85rem;
font-weight: 600;
color: var(--text);
transition: color 0.2s;
}
.trending-time {
font-size: 0.7rem;
color: var(--muted);
}
.trending-rank {
font-size: 1.5rem;
opacity: 0.3;
color: var(--accent-secondary);
}
.trending-card-body {
padding: 1.25rem;
}
.trending-text {
font-size: 1.05rem;
line-height: 1.85;
color: var(--text);
font-family: inherit;
white-space: pre-wrap;
margin-bottom: 1rem;
}
.trending-source {
font-size: 0.8rem;
color: var(--muted);
font-style: normal;
padding-top: 0.75rem;
border-top: 1px solid var(--border);
}
.trending-source strong {
color: var(--text-secondary);
}
.trending-card-footer {
padding: 0.75rem 1.25rem;
background: rgba(255,255,255,0.03);
display: flex;
justify-content: space-between;
align-items: center;
}
.trending-stats {
display: flex;
gap: 1.5rem;
}
.trending-stat {
display: flex;
align-items: center;
gap: 0.4rem;
font-size: 0.85rem;
color: var(--muted);
}
.trending-stat.clickable {
cursor: pointer;
transition: color 0.2s ease;
}
.trending-stat.clickable:hover {
color: var(--text);
}
.trending-stat.hot {
color: var(--accent-tertiary);
}
.trending-actions {
display: flex;
gap: 0.5rem;
}
.trending-action-btn {
background: transparent;
border: 1px solid var(--border);
color: var(--muted);
padding: 0.4rem 0.8rem;
border-radius: 0;
font-size: 0.75rem;
cursor: pointer;
transition: all 0.2s;
}
.trending-action-btn:hover {
background: var(--accent-secondary);
border-color: var(--accent-secondary);
color: white;
}
.trending-action-btn.liked {
background: var(--accent-secondary);
border-color: var(--accent-secondary);
color: white;
}
.trending-empty {
text-align: center;
padding: 4rem 2rem;
color: var(--muted);
}
.trending-empty-icon {
font-size: 3rem;
margin-bottom: 1rem;
opacity: 0.3;
}

/* Bouton favoris dans le header */
.favorites-btn {
color: var(--accent) !important;
border-color: var(--accent) !important;
}
.favorites-btn:hover {
background: var(--accent) !important;
color: var(--bg) !important;
}

/* Statistiques de lecture - Version compacte inline */
.reading-stats-section {
    background: transparent;
    border: none;
    padding: 0.5rem 0 !important;
}
.reading-stats-section h3 {
    display: none;
}
.reading-stats-compact {
    padding: 0.5rem !important;
}
.reading-stats-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 0.4rem 0;
}
.reading-inline-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.reading-inline-icon {
    opacity: 0.6;
    font-size: 0.7rem;
}
.reading-inline-sep {
    opacity: 0.3;
}
.streak-inline {
    color: var(--accent);
}
.reading-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.reading-stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
}
.reading-stat-item:last-child {
border-bottom: none;
}
.reading-stat-icon {
font-size: 1.1rem;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
background: var(--bg-elevated);
border-radius: 8px;
flex-shrink: 0;
}
.reading-stat-content {
flex: 1;
display: flex;
flex-direction: column;
}
.reading-stat-value {
font-family: 'Playfair Display', serif;
font-size: 1.1rem;
font-weight: 700;
color: var(--text);
line-height: 1.2;
}
.reading-stat-label {
font-size: 0.7rem;
color: var(--muted);
line-height: 1.2;
}
.streak-item .reading-stat-value {
color: var(--accent);
}
.streak-section {
margin-top: 0.75rem;
padding-top: 0.75rem;
border-top: 1px solid var(--border);
}
.streak-bar {
height: 4px;
background: var(--border);
border-radius: 2px;
overflow: hidden;
margin-bottom: 0.5rem;
}
.streak-progress {
height: 100%;
background: linear-gradient(90deg, var(--accent), #ff9500);
width: 0%;
transition: width 0.5s ease;
}
.streak-hint {
font-size: 0.7rem;
color: var(--muted);
text-align: center;
font-style: italic;
}
.weekly-chart {
display: flex;
justify-content: space-between;
align-items: flex-end;
height: 40px;
gap: 4px;
margin-top: 0.75rem;
padding-top: 0.75rem;
border-top: 1px solid var(--border);
}
.weekly-bar {
flex: 1;
background: var(--border);
min-height: 4px;
transition: all 0.3s;
position: relative;
}
.weekly-bar.active {
background: var(--accent);
}
.weekly-bar.today {
background: linear-gradient(to top, var(--accent), #ff9500);
box-shadow: 0 0 8px rgba(255,69,58,0.5);
}
.weekly-bar::after {
content: attr(data-day);
position: absolute;
bottom: -15px;
left: 50%;
transform: translateX(-50%);
font-size: 0.55rem;
color: var(--muted);
}

/* Fun stat */
.fun-stat {
margin-top: 1rem;
padding: 0.75rem;
background: linear-gradient(135deg, rgba(255,69,58,0.1), rgba(191,90,242,0.1));
border-radius: 10px;
font-size: 0.75rem;
color: var(--text-secondary);
text-align: center;
font-style: italic;
transition: opacity 0.3s;
}

/* Reading path */
.reading-path {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.25rem;
margin-top: 0.75rem;
padding: 0.5rem;
background: var(--bg-elevated);
border-radius: 8px;
font-size: 0.7rem;
}
.path-node {
background: var(--bg-card);
padding: 0.25rem 0.5rem;
border-radius: 4px;
color: var(--text-secondary);
border: 1px solid var(--border);
}
.path-node:last-of-type { 
color: var(--accent); 
border-color: var(--accent); 
}
.path-arrow { color: var(--text-muted); font-size: 0.6rem; }

/* Related authors (dans les cartes) */
.related-authors {
padding: 1rem 1.5rem;
background: linear-gradient(135deg, rgba(255,69,58,0.05), rgba(191,90,242,0.05));
border-top: 1px solid var(--border);
}
.related-title {
font-size: 0.75rem;
color: var(--text-secondary);
margin-bottom: 0.75rem;
font-weight: 500;
}
.related-list {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.related-btn {
background: var(--bg-elevated);
border: 1px solid var(--border);
color: var(--text);
padding: 0.4rem 0.8rem;
border-radius: 20px;
font-size: 0.8rem;
cursor: pointer;
transition: all 0.2s;
}
.related-btn:hover {
border-color: var(--accent);
color: var(--accent);
transform: scale(1.05);
}
.no-related {
font-size: 0.8rem;
color: var(--text-muted);
display: flex;
align-items: center;
gap: 0.75rem;
}
.btn-small {
padding: 0.3rem 0.6rem;
font-size: 0.75rem;
}
.explore-hint {
font-size: 0.85rem;
opacity: 0.7;
transition: opacity 0.2s, transform 0.2s;
cursor: pointer;
}
.card-head:hover .explore-hint {
opacity: 1;
transform: scale(1.1);
}

/* -----------------------------------------------------------
   ?? SOCIAL FEATURES - Style Twitter/X
   ----------------------------------------------------------- */

/* Modal Auth */
.auth-modal {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background: var(--overlay-bg);
z-index: 500;
display: none;
align-items: center;
justify-content: center;
animation: fadeIn 0.3s ease;
}
.auth-modal.open { display: flex; }
.auth-box {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 16px;
padding: 2rem;
width: 100%;
max-width: 400px;
margin: 1rem;
}
.auth-title {
font-family: 'Playfair Display', serif;
font-size: 1.5rem;
color: var(--text);
margin-bottom: 0.5rem;
text-align: center;
}
.auth-subtitle {
font-size: 0.85rem;
color: var(--muted);
text-align: center;
margin-bottom: 1.5rem;
}
.auth-input {
width: 100%;
padding: 0.9rem 1rem;
background: var(--bg);
border: 1px solid var(--border);
border-radius: 8px;
color: var(--text);
font-size: 0.95rem;
margin-bottom: 0.75rem;
transition: border-color 0.2s;
}
.auth-input:focus {

border-color: var(--accent);
}
.auth-input::placeholder { color: var(--muted); }
.auth-btn {
width: 100%;
padding: 0.9rem;
background: var(--accent);
border: none;
border-radius: 8px;
color: white;
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
margin-top: 0.5rem;
}
.auth-btn:hover { background: var(--accent-hover); transform: scale(1.02); }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-btn.secondary {
background: transparent;
border: 1px solid var(--border);
color: var(--text-secondary);
}
.auth-btn.secondary:hover { border-color: var(--text); color: var(--text); }
.auth-divider {
display: flex;
align-items: center;
margin: 1.25rem 0;
color: var(--muted);
font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
content: '';
flex: 1;
height: 1px;
background: var(--border);
}
.auth-divider span { padding: 0 1rem; }
.auth-switch {
text-align: center;
margin-top: 1.25rem;
font-size: 0.85rem;
color: var(--muted);
}
.auth-switch a {
color: var(--accent);
cursor: pointer;
text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }
.auth-forgot {
text-align: right;
margin-top: 0.25rem;
margin-bottom: 1rem;
font-size: 0.8rem;
}
.auth-forgot a {
color: var(--text-secondary);
cursor: pointer;
text-decoration: none;
}
.auth-forgot a:hover { color: var(--accent); text-decoration: underline; }
.auth-success {
background: rgba(42, 157, 143, 0.15);
border: 1px solid var(--accent-tertiary);
color: var(--accent-tertiary);
padding: 0.75rem;
border-radius: 8px;
margin-bottom: 1rem;
font-size: 0.85rem;
display: none;
}
.auth-success.show { display: block; }
.auth-close {
position: absolute;
top: 1rem;
right: 1rem;
background: none;
border: none;
color: var(--muted);
font-size: 1.5rem;
cursor: pointer;
}
.auth-close:hover { color: var(--text); }
.auth-error {
background: rgba(255,69,58,0.1);
border: 1px solid var(--accent);
color: var(--accent);
padding: 0.75rem;
border-radius: 8px;
font-size: 0.85rem;
margin-bottom: 1rem;
display: none;
}
.auth-error.show { display: block; }

/* User menu in header */
.user-menu {
position: relative;
display: flex;
align-items: center;
gap: 0.5rem;
}
.user-avatar {
width: 32px;
height: 32px;
border-radius: 50%;
background: linear-gradient(135deg, var(--accent), var(--accent-purple));
display: flex;
align-items: center;
justify-content: center;
font-size: 0.9rem;
cursor: pointer;
border: 2px solid transparent;
transition: border-color 0.2s;
}
.user-avatar:hover { border-color: var(--accent); }
.user-avatar img {
width: 100%;
height: 100%;
border-radius: 50%;
object-fit: cover;
}
.user-dropdown {
position: fixed;
top: 60px;
right: 1rem;
margin-top: 0;
background: var(--bg-card);
border: 1px solid var(--accent-secondary);
border-radius: 12px;
min-width: 200px;
display: none;
box-shadow: 0 12px 48px rgba(0,0,0,0.6);
z-index: var(--z-modal);
}
.user-dropdown.open { display: block; }
.user-dropdown-item {
padding: 0.75rem 1rem;
display: flex;
align-items: center;
gap: 0.6rem;
color: var(--text-secondary);
font-size: 0.85rem;
cursor: pointer;
transition: all 0.2s;
}
.user-dropdown-item:first-child { border-radius: 12px 12px 0 0; }
.user-dropdown-item:last-child { border-radius: 0 0 12px 12px; }
.user-dropdown-item:hover {
background: var(--bg-elevated);
color: var(--text);
}
.user-dropdown-item.danger:hover { color: var(--accent); }
.user-dropdown-divider {
height: 1px;
background: var(--border);
margin: 0.25rem 0;
}

/* Social Feed Tab */
.feed-tabs {
display: flex;
gap: 0;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 8px;
padding: 0.25rem;
margin-bottom: 1rem;
position: sticky;
top: 60px;
z-index: 9;
}
.feed-tab {
flex: 1;
padding: 0.6rem 1rem;
background: transparent;
border: none;
color: var(--muted);
font-size: 0.8rem;
font-weight: 500;
cursor: pointer;
border-radius: 6px;
transition: all 0.2s;
}
.feed-tab:hover { color: var(--text); }
.feed-tab.active {
background: var(--accent);
color: white;
}
.feed-refresh {
padding: 0.5rem 0.7rem;
background: transparent;
border: none;
color: var(--muted);
font-size: 1rem;
cursor: pointer;
border-radius: 6px;
transition: all 0.3s;
margin-left: 0.5rem;
}
.feed-refresh:hover {
color: var(--accent);
transform: rotate(180deg);
}
.feed-refresh.spinning {
animation: spin 1s linear infinite;
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.feed-live-indicator {
padding: 0.4rem 1rem;
font-size: 0.75rem;
color: var(--muted);
text-align: center;
border-bottom: 1px solid var(--border);
}
.feed-live-indicator.new-content {
background: rgba(42, 157, 143, 0.1);
color: var(--accent);
cursor: pointer;
}

/* Share button on cards */
.btn-share {
background: transparent;
border: 1px solid var(--border);
color: var(--accent-tertiary);
}
.btn-share .share-icon {
    font-size: 1.3rem;
    line-height: 1;
}
.btn-share:hover {
background: var(--accent-tertiary);
color: var(--bg);
border-color: var(--accent-tertiary);
}

/* Comment button on cards */
.btn-comment {
background: transparent;
border: 1px solid var(--border);
color: var(--text-muted);
font-size: 1.1rem;
}
.btn-comment:hover {
background: rgba(255,255,255,0.05);
border-color: var(--text-muted);
}

/* Collection button on cards */
.btn-collection {
background: transparent;
border: 1px solid var(--border);
color: var(--text-muted);
font-size: 1.1rem;
}
.btn-collection:hover {
background: rgba(255,255,255,0.05);
border-color: var(--accent);
color: var(--accent);
}

/* Uniform border for all action buttons */
.card-foot .actions .btn {
    border: 1px solid var(--border) !important;
    border-radius: 6px;
}

/* Selection highlight for sharing */
.text-selectable::selection {
background: rgba(42, 157, 143, 0.4);
}

/* Share Modal */
.share-modal {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background: var(--overlay-bg);
z-index: var(--z-modal);
display: none;
align-items: center;
justify-content: center;
}
.share-modal.open { display: flex; }
.share-box {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 16px;
padding: 1.5rem;
width: 100%;
max-width: 500px;
margin: 1rem;
}
.share-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
}
.share-title {
font-size: 1rem;
font-weight: 600;
color: var(--text);
}
.share-preview {
background: var(--bg);
border-left: 3px solid var(--accent-tertiary);
padding: 1rem;
margin-bottom: 1rem;
border-radius: 0 8px 8px 0;
}
.share-preview-text {
font-family: 'Playfair Display', serif;
font-size: 1.1rem;
font-style: italic;
color: var(--text);
line-height: 1.6;
margin-bottom: 0.75rem;
}
.share-preview-source {
font-size: 0.8rem;
color: var(--muted);
}
.share-commentary {
width: 100%;
padding: 0.9rem;
background: var(--bg);
border: 1px solid var(--border);
border-radius: 8px;
color: var(--text);
font-size: 0.9rem;
resize: vertical;
min-height: 80px;
margin-bottom: 1rem;
font-family: inherit;
}
.share-commentary:focus { border-color: var(--accent-tertiary); }
.share-actions {
display: flex;
gap: 0.75rem;
justify-content: flex-end;
}
.share-btn {
padding: 0.7rem 1.5rem;
border-radius: 8px;
font-size: 0.85rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
}
.share-btn.primary {
background: var(--accent-tertiary);
border: none;
color: white;
}
.share-btn.primary:hover { background: #25877b; }
.share-btn.secondary {
background: transparent;
border: 1px solid var(--border);
color: var(--text-secondary);
}
.share-btn.secondary:hover { border-color: var(--text); color: var(--text); }

/* -----------------------------------------------------------
   ?? COMMENTAIRES
   ----------------------------------------------------------- */
.comments-section {
border-top: 1px solid var(--border);
margin-top: 0.75rem;
padding-top: 0.75rem;
}
.comments-toggle {
display: flex;
align-items: center;
gap: 0.5rem;
background: none;
border: none;
color: var(--text-secondary);
font-size: 0.8rem;
cursor: pointer;
padding: 0.25rem 0;
transition: color 0.2s;
}
.comments-toggle:hover { color: var(--text); }
.comments-container {
display: none;
margin-top: 0.75rem;
}
.extrait-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.extrait-action.like-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s;
    min-height: 32px;
}
.extrait-action.like-btn .like-icon {
font-size: 0.95rem;
line-height: 1;
}
.extrait-action.like-btn:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.08);
}
.extrait-action.like-btn.liked {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    border-color: transparent;
}
.extrait-actions .like-btn .like-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    padding: 0 0.3rem;
    border-radius: 0;
    border: none !important;
    background: transparent !important;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    margin-left: 0.15rem;
}
.extrait-actions .like-btn .like-count.clickable:hover {
    border: none !important;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}
.extrait-action.like-btn.liked .like-count {
    border: none !important;
    color: #e74c3c !important;
    background: transparent !important;
}
.like-count, .share-count, .collections-count, .comment-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0 0.25rem;
    border-radius: 4px;
    background: transparent;
    border: none !important;
    min-width: 1.2rem;
    transition: opacity 0.2s ease, color 0.2s ease;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

/* Séparateur vertical entre icône et compteur - DÉSACTIVÉ pour un rendu plus propre */
.like-count::before, .share-count::before, .collections-count::before, .comment-count::before {
    display: none;
}

/* Masquer le compteur quand il vaut 0 */
.like-count.is-zero,
.share-count.is-zero,
.collections-count.is-zero,
.comment-count.is-zero {
    display: none !important;
}

/* Modal des likers / sharers */
.likers-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
}
.likers-modal.open {
    display: flex;
}
.likers-content {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    width: min(520px, 92vw);
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.likers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--border);
}
.likers-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text);
}
.likers-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
}
.likers-close:hover {
    color: var(--accent);
}
.likers-list {
    overflow-y: auto;
    padding: 0.75rem 1rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.liker-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.liker-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.liker-info {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.liker-name {
    font-weight: 600;
    color: var(--text);
}
.liker-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Modal des collections d'un extrait */
.extrait-collections-modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.75);
z-index: var(--z-modal);
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
transition: opacity 0.3s ease;
pointer-events: auto;
}
.extrait-collections-modal.open {
opacity: 1;
}
.extrait-collections-content {
background: var(--bg-card);
border: 2px solid var(--border);
border-radius: 12px;
padding: 1.5rem;
max-width: 500px;
width: 90%;
max-height: 70vh;
overflow-y: auto;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
pointer-events: auto;
z-index: var(--z-toast);
}
.extrait-collections-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
padding-bottom: 0.75rem;
border-bottom: 2px solid var(--border);
}
.extrait-collections-header h3 {
font-size: 1.25rem;
color: var(--text);
margin: 0;
}
.extrait-collections-header button {
background: transparent;
border: none;
color: var(--text-muted);
font-size: 1.5rem;
cursor: pointer;
padding: 0.25rem 0.5rem;
transition: color 0.2s ease;
}
.extrait-collections-header button:hover {
color: var(--accent);
}
.extrait-collections-list {
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.extrait-collections-list .collection-item {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.75rem 1rem;
background: var(--bg-elevated);
border: 2px solid var(--border);
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
pointer-events: auto;
}
.extrait-collections-list .collection-item:hover {
border-color: var(--accent);
background: rgba(90, 122, 138, 0.1);
transform: translateX(4px);
}
.extrait-collections-list .collection-emoji {
font-size: 1.5rem;
}
.extrait-collections-list .collection-name {
flex: 1;
font-size: 1rem;
font-weight: 600;
color: var(--text);
}
.extrait-actions .like-btn .like-count,
.extrait-actions .share-btn .share-count,
.extrait-actions .collection-btn .collections-count {
border: none !important;
background: transparent !important;
box-shadow: none !important;
}
.comments-container.open { display: block; }
.comments-list {
max-height: 300px;
overflow-y: auto;
margin-bottom: 0.75rem;
}
.comment-item {
display: flex;
gap: 0.6rem;
padding: 0.6rem 0;
border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
width: 28px;
height: 28px;
border-radius: 50%;
background: linear-gradient(135deg, var(--accent-purple), var(--accent));
display: flex;
align-items: center;
justify-content: center;
font-size: 0.7rem;
color: white;
font-weight: 600;
flex-shrink: 0;
}
.comment-content {
flex: 1;
min-width: 0;
}
.comment-header {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.2rem;
}
.comment-username {
font-size: 0.8rem;
font-weight: 600;
color: var(--text);
cursor: pointer;
}
.comment-username:hover { color: var(--accent); }
.comment-time {
font-size: 0.65rem;
color: var(--muted);
}
.comment-text {
font-size: 0.8rem;
color: var(--text-secondary);
line-height: 1.4;
}
.comment-actions {
display: flex;
align-items: center;
gap: 0.75rem;
margin-top: 0.4rem;
}
.comment-like-btn {
background: none;
border: none;
color: var(--muted);
font-size: 0.75rem;
cursor: pointer;
padding: 0.2rem 0.4rem;
border-radius: 10px;
transition: all 0.2s;
display: flex;
align-items: center;
gap: 0.3rem;
}
.comment-like-btn:hover {
background: rgba(255,69,58,0.1);
color: var(--accent);
}
.comment-like-btn.liked {
color: var(--accent);
}
.comment-like-btn.liked .like-icon {
animation: likePopComment 0.3s ease;
}
@keyframes likePopComment {
0% { transform: scale(1); }
50% { transform: scale(1.3); }
100% { transform: scale(1); }
}
.comment-like-count {
font-size: 0.7rem;
min-width: 12px;
}
.comment-actions-inline {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.comment-actions-toggle {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    border-radius: 999px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

/* Menu d'actions déplacé dans le footer */

@media (hover: hover) {
    .comment-actions-toggle { display: none; }
}

.comment-delete,
.comment-edit {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.1rem 0.3rem;
}

.comment-delete:hover { color: #e74c3c; }

/* Réactions commentaires (emoji) */
.comment-reactions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.comment-reaction-pill {
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.05);
    color: var(--text);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    line-height: 1.4;
    min-height: 24px;
    touch-action: manipulation;
    pointer-events: auto;
}

.comment-reaction-pill.mine {
    border-color: var(--accent);
    background: rgba(212, 165, 116, 0.16);
}

.comment-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: 6px;
    width: 100%;
}

.comment-footer-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

@media (hover: hover) {
    .comment-item:hover .comment-footer-actions { opacity: 1; pointer-events: auto; }
}

.comment-item.show-actions .comment-footer-actions { opacity: 1; pointer-events: auto; }

@media (hover: none) {
    .comment-footer-actions { opacity: 1; pointer-events: auto; }
}

.comment-react-btn {
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border-radius: 999px;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-react-btn:hover { background: rgba(255,255,255,0.12); }

.comment-reaction-picker {
    position: fixed;
    z-index: var(--z-modal);
    display: flex;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--border);
    background: rgba(20,20,20,0.96);
    backdrop-filter: blur(6px);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}

.comment-reaction-emoji {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 6px;
    border-radius: 10px;
}

.comment-reaction-emoji:hover { background: rgba(255,255,255,0.08); }
.comment-input-area {
display: flex;
gap: 0.5rem;
align-items: flex-end;
}
.comment-input {
flex: 1;
background: var(--bg);
border: 1px solid var(--border);
border-radius: 16px;
padding: 0.5rem 0.9rem;
font-size: 0.8rem;
color: var(--text);

resize: none;
max-height: 80px;
min-height: 32px;
}
.comment-input:focus { border-color: var(--accent); }
.comment-send {
background: var(--accent-tertiary);
border: none;
border-radius: 50%;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: white;
font-size: 0.8rem;
transition: transform 0.2s;
flex-shrink: 0;
}
.comment-send:hover { transform: scale(1.05); }
.comment-send:disabled { opacity: 0.5; cursor: not-allowed; }
.comments-empty {
text-align: center;
padding: 1rem;
color: var(--muted);
font-size: 0.8rem;
}

/* Extrait Card (social feed) */
.extrait-card {
background: var(--bg-card);
border: 2px solid var(--border);
border-radius: 10px;
padding: 1.25rem 1.5rem;
margin-bottom: 1rem;
transition: all 0.2s;
box-shadow: 2px 2px 0 var(--pixel-shadow);
}
.extrait-card:hover {
border-color: var(--accent);
box-shadow: 4px 4px 0 var(--pixel-shadow);
}
.extrait-header {
display: flex;
align-items: center;
gap: 0.75rem;
margin-bottom: 0.75rem;
}
.extrait-avatar {
width: 40px;
height: 40px;
border-radius: 50%;
background: linear-gradient(135deg, var(--accent), var(--accent-purple));
display: flex;
align-items: center;
justify-content: center;
font-size: 1rem;
flex-shrink: 0;
}
.extrait-avatar img {
width: 100%;
height: 100%;
border-radius: 50%;
object-fit: cover;
}
.extrait-user-info {
flex: 1;
min-width: 0;
}
.extrait-username {
font-weight: 600;
font-size: 0.9rem;
color: var(--text);
}
.extrait-username-link {
cursor: pointer;
transition: color 0.2s;
}
.extrait-username-link:hover {
color: var(--accent);
}
.extrait-time {
font-size: 0.75rem;
color: var(--muted);
margin-top: 0.1rem;
}
.extrait-text {
font-size: 1rem;
line-height: 1.75;
color: var(--text-secondary);
font-weight: 300;
white-space: pre-wrap;
margin: 0.5rem 0 0.75rem;
}
.btn-voir-plus {
display: inline-flex;
align-items: center;
gap: 0.4rem;
padding: 0.4rem 0.75rem;
border-radius: 999px;
border: 1px solid var(--border);
background: var(--bg-elevated);
color: var(--text-secondary);
font-size: 0.75rem;
cursor: pointer;
transition: all 0.2s ease;
}
.btn-voir-plus:hover {
border-color: var(--accent);
color: var(--accent);
}

/* Bouton de repli flottant en bas du texte déplié */
.collapse-text-btn {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}
.collapse-text-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-card);
}

.extrait-source {
font-size: 0.8rem;
color: var(--muted);
display: flex;
align-items: center;
gap: 0.4rem;
flex-wrap: wrap;
}
.extrait-source strong {
color: var(--text);
font-weight: 600;
}
.source-link {
color: var(--accent);
text-decoration: none;
font-size: 0.9rem;
opacity: 0.7;
transition: opacity 0.2s, transform 0.2s;
margin-left: 0.4rem;
}
.source-link:hover { 
    color: var(--accent-secondary); 
    opacity: 1;
    transform: translateX(2px);
}
/* Source link dans le titre du feed principal */
.card-head .work .source-link {
    font-size: 1rem;
    vertical-align: middle;
}
.extrait-commentary {
margin-top: 0.75rem;
padding: 0.6rem 0.75rem;
background: var(--bg-elevated);
border: 1px dashed var(--border);
border-radius: 8px;
color: var(--text-secondary);
font-size: 0.9rem;
line-height: 1.6;
}
.extrait-action {
background: transparent;
border: 1px solid var(--border);
color: var(--text-secondary);
padding: 0.25rem 0.6rem;
border-radius: 999px;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 0.35rem;
transition: all 0.2s;
}
.extrait-action:hover {
border-color: var(--accent);
color: var(--accent);
}

/* ---------------------------------------------------------------------------
   Feed communautaire & Collections - overrides lisibilité
   --------------------------------------------------------------------------- */
#socialOverlay .extrait-card {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
}
#socialOverlay .extrait-text,
#socialOverlay .extrait-commentary,
#socialOverlay .extrait-source {
    font-style: normal !important;
    color: var(--text-secondary) !important;
}
#socialOverlay .extrait-text {
    font-size: 1rem !important;
    line-height: 1.75 !important;
    font-weight: 400 !important;
    transition: opacity 0.35s ease !important;
}
#socialOverlay .extrait-source strong {
    color: var(--text) !important;
}
.collection-item-preview,
.collection-item-full,
.collection-item-note,
.collection-description {
    font-style: normal !important;
}
.follow-btn {
padding: 0.3rem 0.8rem;
border-radius: 20px;
border: 1px solid var(--accent);
background: transparent;
color: var(--accent);
font-size: 0.75rem;
cursor: pointer;
transition: all 0.2s;
margin-left: auto;
}
.follow-btn:hover {
background: var(--accent);
color: white;
}
.follow-btn.following {
background: var(--accent-tertiary);
border-color: var(--accent-tertiary);
color: white;
}
.follow-btn.following:hover {
background: #dc3545;
border-color: #dc3545;
}
.user-profile-modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: var(--overlay-bg);
display: flex;
align-items: center;
justify-content: center;
z-index: var(--z-modal);
opacity: 0;
visibility: hidden;
transition: all 0.3s;
padding: 2rem;
}
.user-profile-modal.above-messages {
    z-index: 2600;
}
.user-profile-modal.open {
opacity: 1;
visibility: visible;
}
.user-profile-content {
background: var(--bg-card);
border-radius: 16px;
padding: 0;
max-width: 700px;
width: 100%;
max-height: 90vh;
border: 1px solid var(--border);
display: flex;
flex-direction: column;
overflow: hidden;
}
.profile-header-section {
padding: 1rem;
border-bottom: 1px solid var(--border);
position: relative;
}

.profile-close-x {
position: absolute;
top: 0.75rem;
right: 0.75rem;
width: 28px;
height: 28px;
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 50%;
border: 1px solid var(--border);
background: rgba(255,255,255,0.04);
color: var(--text-secondary);
font-size: 0.9rem;
cursor: pointer;
opacity: 0.7;
transition: all 0.15s;
}

.profile-close-x:hover {
opacity: 1;
background: var(--bg-elevated);
color: var(--text);
}
.profile-header {
display: flex;
align-items: center;
gap: 1rem;
}
.profile-avatar-large {
width: 50px;
height: 50px;
border-radius: 50%;
background: linear-gradient(135deg, var(--accent), var(--accent-purple));
display: flex;
align-items: center;
justify-content: center;
font-size: 1.25rem;
font-weight: 600;
color: white;
flex-shrink: 0;
}
.profile-info {
flex: 1;
}
.profile-info h3 {
font-size: 1.1rem;
margin-bottom: 0.15rem;
}
.profile-last-seen {
font-size: 0.7rem;
color: var(--text-muted);
margin-bottom: 0.3rem;
display: flex;
align-items: center;
gap: 0.25rem;
}
.profile-last-seen .online-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: #22c55e;
animation: pulse-online 2s infinite;
}
@keyframes pulse-online {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
.profile-stats {
display: flex;
gap: 1rem;
font-size: 0.75rem;
color: var(--text-secondary);
}
.profile-stat {
cursor: pointer;
transition: color 0.2s;
}
.profile-stat:hover {
color: var(--text);
}
.profile-stat strong {
color: var(--text);
font-weight: 600;
}
.profile-actions {
display: flex;
gap: 0.75rem;
margin-top: 0.6rem;
}
.profile-actions button {
padding: 0.5rem 1rem;
border-radius: 8px;
border: none;
cursor: pointer;
font-weight: 500;
font-size: 0.8rem;
}
.btn-follow-large {
background: var(--accent);
color: white;
}
.btn-follow-large.following {
background: var(--accent-tertiary);
}
.btn-close-profile {
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
padding: 0;
background: transparent;
color: var(--text-secondary);
border: 1px solid var(--border) !important;
border-radius: 50%;
font-size: 0;
line-height: 1;
opacity: 0.7;
}
.btn-close-profile::after {
content: '✕';
font-size: 0.85rem;
}
.btn-close-profile:hover {
color: var(--text);
opacity: 1;
}

/* Bouton fermer flottant dans modal profil */
.profile-floating-close {
position: sticky;
bottom: 0;
left: 0;
right: 0;
width: 100%;
background: var(--bg-card);
border: none;
border-top: 1px solid var(--border);
color: var(--text-secondary);
padding: 0.6rem;
font-size: 0.75rem;
font-weight: 400;
cursor: pointer;
transition: all 0.2s;
opacity: 0.7;
display: none;
}
.profile-floating-close:hover {
background: var(--bg-elevated);
color: var(--text);
opacity: 1;
}

/* Profile Tabs */
.profile-tabs {
display: flex;
flex-wrap: wrap;
border-bottom: 1px solid var(--border);
position: sticky;
top: 0;
background: var(--bg-card);
z-index: 5;
overflow-x: visible;
}
.profile-tab {
flex: 1 1 20%;
padding: 0.65rem 0.4rem;
background: none;
border: none;
color: var(--text-secondary);
font-size: 0.75rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
border-bottom: 2px solid transparent;
min-width: 0;
text-align: center;
touch-action: manipulation;
display: flex;
flex-direction: column;
align-items: center;
gap: 0.2rem;
}
.profile-tab .tab-emoji {
font-size: 1.1rem;
line-height: 1;
}
.profile-tab .tab-label {
font-size: 0.7rem;
line-height: 1.1;
}
.profile-tab:hover {
color: var(--text);
background: var(--bg-elevated);
}
.profile-tab.active {
color: var(--accent);
border-bottom-color: var(--accent);
}

@media screen and (max-width: 520px) {
    .profile-tab {
        padding: 0.6rem 0.3rem;
    }
    .profile-tab .tab-emoji {
        font-size: 1.2rem;
    }
    .profile-tab .tab-label {
        font-size: 0.65rem;
    }
}
/* Profile Content */
.profile-content {
flex: 1;
overflow-y: auto;
padding: 1rem;
}
.profile-extraits-list {
display: flex;
flex-direction: column;
gap: 1rem;
}
.profile-extrait-card {
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: 10px;
padding: 1rem;
}
.profile-extrait-text {
font-family: inherit;
font-size: 0.95rem;
line-height: 1.6;
color: var(--text);
margin-bottom: 0.5rem;
font-style: normal;
}
.profile-voir-plus {
display: block;
width: 100%;
padding: 0.4rem;
margin-bottom: 0.75rem;
background: var(--bg);
border: 1px dashed var(--border);
border-radius: 6px;
color: var(--accent);
font-size: 0.75rem;
cursor: pointer;
text-align: center;
transition: all 0.2s;
}
.profile-voir-plus:hover {
background: var(--bg-elevated);
border-color: var(--accent);
}
.profile-extrait-source {
font-size: 0.75rem;
color: var(--text-secondary);
}
.profile-extrait-source strong {
color: var(--text);
}
.profile-extrait-meta {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 0.5rem;
padding-top: 0.5rem;
border-top: 1px solid var(--border);
font-size: 0.7rem;
color: var(--muted);
}
.profile-empty {
text-align: center;
padding: 2rem;
color: var(--muted);
}
.profile-empty-icon {
font-size: 2.5rem;
margin-bottom: 0.75rem;
}
.profile-empty-text {
font-size: 0.85rem;
}
/* Friends list inside profile */
.friends-list {
margin-top: 1rem;
}
.friends-list h4 {
font-size: 0.8rem;
color: var(--text-secondary);
margin-bottom: 0.75rem;
}
.friend-item {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.5rem;
border-radius: 8px;
cursor: pointer;
transition: background 0.2s;
}
.friend-item:hover {
background: var(--bg-elevated);
}
.friend-avatar {
width: 32px;
height: 32px;
border-radius: 50%;
background: linear-gradient(135deg, var(--accent-purple), var(--accent));
display: flex;
align-items: center;
justify-content: center;
font-size: 0.8rem;
color: white;
font-weight: 600;
}
.btn-follow-small {
padding: 0.35rem 0.75rem;
font-size: 0.7rem;
border-radius: 20px;
border: 1px solid var(--accent);
background: transparent;
color: var(--accent);
cursor: pointer;
font-weight: 600;
transition: all 0.2s;
margin-left: auto;
}
.btn-follow-small:hover {
background: var(--accent);
color: white;
}
.btn-follow-small.following {
border-color: var(--accent-tertiary);
color: var(--accent-tertiary);
}
.btn-follow-small.following:hover {
background: rgba(42, 157, 143, 0.2);
}

/* -----------------------------------------------------------
   ?? MESSAGERIE
   ----------------------------------------------------------- */
.messages-modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: var(--overlay-bg);
z-index: 2500;
display: flex;
opacity: 0;
visibility: hidden;
transition: all 0.3s;
}
.messages-modal.open {
opacity: 1;
visibility: visible;
}
.messages-sidebar {
width: 280px;
background: var(--bg-card);
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
}
.messages-sidebar-header {
padding: 1rem;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: space-between;
}
.messages-sidebar-title {
font-size: 1rem;
font-weight: 600;
}
.messages-close {
background: none;
border: none;
color: var(--text-secondary);
font-size: 1.25rem;
cursor: pointer;
padding: 0.25rem;
}
.messages-close:hover { color: var(--text); }
.messages-list {
flex: 1;
overflow-y: auto;
}
.messages-empty {
padding: 2rem;
text-align: center;
color: var(--muted);
font-size: 0.85rem;
}
.conversation-item {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.85rem 1rem;
cursor: pointer;
transition: background 0.2s;
border-bottom: 1px solid var(--border);
}
.conversation-item:hover {
background: var(--bg-elevated);
}
.conversation-item.active {
background: var(--bg-elevated);
border-left: 3px solid var(--accent);
}
.conversation-avatar {
width: 42px;
height: 42px;
border-radius: 50%;
background: linear-gradient(135deg, var(--accent), var(--accent-purple));
display: flex;
align-items: center;
justify-content: center;
font-size: 1rem;
color: white;
font-weight: 600;
flex-shrink: 0;
}
.conversation-info {
flex: 1;
min-width: 0;
}
.conversation-name {
font-size: 0.85rem;
font-weight: 500;
color: var(--text);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.conversation-preview {
font-size: 0.75rem;
color: var(--muted);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.conversation-meta {
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 0.25rem;
}
.conversation-time {
font-size: 0.65rem;
color: var(--muted);
}
.conversation-unread {
width: 18px;
height: 18px;
background: var(--accent);
border-radius: 50%;
font-size: 0.6rem;
color: white;
display: flex;
align-items: center;
justify-content: center;
font-weight: 600;
}

/* Conversation avec messages non lus */
.conversation-item.has-unread {
background: rgba(212, 165, 116, 0.08);
}
.conversation-item.has-unread .conversation-name {
font-weight: 700;
color: var(--accent);
}
.conversation-item.has-unread .conversation-preview {
color: var(--text);
font-weight: 500;
}
.messages-main {
flex: 1;
display: flex;
flex-direction: column;
background: var(--bg);
}
.messages-main-empty {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
color: var(--muted);
font-size: 0.9rem;
}
.chat-header {
padding: 1rem;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
gap: 0.75rem;
background: var(--bg-card);
}
.chat-header-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
background: linear-gradient(135deg, var(--accent-purple), var(--accent));
display: flex;
align-items: center;
justify-content: center;
font-size: 0.9rem;
color: white;
font-weight: 600;
}
.chat-header-name {
font-weight: 500;
}
.chat-messages {
flex: 1;
overflow-y: auto;
padding: 1rem;
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.chat-message {
max-width: 70%;
padding: 0.65rem 0.9rem;
border-radius: 16px;
font-size: 0.85rem;
line-height: 1.4;
}
.chat-message.sent {
align-self: flex-end;
background: var(--accent);
color: white;
border-bottom-right-radius: 4px;
}
.chat-message.received {
align-self: flex-start;
background: var(--bg-elevated);
border: 1px solid var(--border);
border-bottom-left-radius: 4px;
}
.chat-message-time {
font-size: 0.6rem;
color: rgba(255,255,255,0.6);
margin-top: 0.25rem;
text-align: right;
display: flex;
align-items: center;
justify-content: flex-end;
gap: 0.3rem;
}
.chat-message.received .chat-message-time {
color: var(--muted);
}

/* Indicateur de lecture */
.msg-read-indicator {
font-size: 0.65rem;
opacity: 0.6;
letter-spacing: -2px;
}
.msg-read-indicator.read {
color: #4ade80;
opacity: 1;
}
.chat-message.received .msg-read-indicator {
display: none;
}
.chat-input-area {
padding: 1rem;
border-top: 1px solid var(--border);
background: var(--bg-card);
display: flex;
gap: 0.75rem;
}
.chat-input {
flex: 1;
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: 20px;
padding: 0.65rem 1rem;
color: var(--text);
font-size: 0.85rem;

}
.chat-input:focus {
border-color: var(--accent);
}
.chat-send {
background: var(--accent);
border: none;
border-radius: 50%;
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: white;
font-size: 1rem;
transition: transform 0.2s;
}
.chat-send:hover {
transform: scale(1.05);
}
.chat-send:disabled {
opacity: 0.5;
cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════
   💬 MESSAGERIE - Actions / Réactions / "Modifié"
   ═══════════════════════════════════════════════════════════ */

.chat-message {
    position: relative;
    display: flex;
    flex-direction: column;
    padding-bottom: 0.25rem;
}

.msg-body {
    display: block;
    margin-bottom: 2px;
    white-space: pre-wrap;
}

.msg-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
    align-items: center;
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
}

@media (hover: hover) {
    .chat-message:hover .msg-actions { opacity: 1; pointer-events: auto; }
}

.chat-message.show-actions .msg-actions {
    opacity: 1;
    pointer-events: auto;
}

/* Sur mobile (pas de hover), toujours afficher les actions */
@media (hover: none) {
    .msg-actions {
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}

.msg-action-btn {
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border-radius: 999px;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msg-action-btn:hover { background: rgba(255,255,255,0.12); }

.msg-reactions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.chat-message.sent .msg-reactions { justify-content: flex-end; }
.chat-message.received .msg-reactions { justify-content: flex-start; }

.msg-reaction-pill {
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.05);
    color: var(--text);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    line-height: 1.4;
    min-height: 24px;
    touch-action: manipulation;
    pointer-events: auto;
}

.msg-reaction-pill.mine {
    border-color: var(--accent);
    background: rgba(212, 165, 116, 0.16);
}

.msg-reaction-picker {
    position: fixed;
    z-index: 3000;
    display: flex;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--border);
    background: rgba(20,20,20,0.96);
    backdrop-filter: blur(6px);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}

.msg-reaction-emoji {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 6px;
    border-radius: 10px;
}

.msg-reaction-emoji:hover { background: rgba(255,255,255,0.08); }

.msg-edited-label {
    font-size: 0.65rem;
    font-style: italic;
    opacity: 0.75;
}

.msg-footer {
    margin-top: 8px;
    padding-top: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    row-gap: 6px;
    width: 100%;
    position: static !important;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.msg-footer-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-wrap: wrap;
    position: static !important;
}

.msg-footer .msg-actions {
    margin-left: 0;
}

.msg-footer .chat-message-time {
    margin-top: 0;
}

.msg-menu-btn {
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.2);
    color: var(--text);
    border-radius: 999px;
    width: 26px;
    height: 26px;
    font-size: 16px;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
}

.chat-message.show-actions .msg-menu-btn {
    opacity: 0.35;
}

/* Sur mobile, cacher le menu ⋯ car les actions sont toujours visibles */
@media (hover: none) {
    .msg-menu-btn { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   💬 COMMENTAIRES - Édition (bouton discret)
   ═══════════════════════════════════════════════════════════ */

.comment-edit {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--muted);
    opacity: 0.85;
}

.comment-edited-label {
    font-size: 0.7em;
    font-style: italic;
    color: var(--text-secondary);
    opacity: 0.85;
}

@media (hover: hover) {
    .comment-edit { opacity: 0; }
    .comment-item:hover .comment-edit { opacity: 1; }
}

.comment-edit:hover { opacity: 1; }
.btn-message {
padding: 0.5rem 0.75rem;
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: 6px;
color: var(--text-secondary);
font-size: 0.75rem;
cursor: pointer;
transition: all 0.2s;
}
.btn-message:hover {
border-color: var(--accent-purple);
color: var(--text);
}
.messages-badge {
position: absolute;
top: -5px;
right: -5px;
background: var(--accent);
color: white;
font-size: 0.6rem;
padding: 0.15rem 0.4rem;
border-radius: 10px;
font-weight: 600;
}
@media (max-width: 700px) {
.messages-sidebar { width: 100%; }
.messages-main { display: none; }
.messages-modal.chat-open .messages-sidebar { display: none; }
.messages-modal.chat-open .messages-main { display: flex; }
.chat-back {
    display: block;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    margin-right: 0.5rem;
}
}
@media (min-width: 701px) {
.chat-back { display: none; }
}

/* -----------------------------------------------------------
   ?? NOTIFICATIONS
   ----------------------------------------------------------- */
.notif-btn {
position: relative;
}
.notif-badge {
position: absolute;
top: -5px;
right: -5px;
background: #e74c3c;
color: white;
font-size: 0.6rem;
padding: 0.15rem 0.4rem;
border-radius: 10px;
font-weight: 600;
min-width: 16px;
text-align: center;
}
.notif-dropdown {
position: fixed;
top: 60px;
right: 4rem;
width: 340px;
max-height: 70vh;
background: var(--bg-card);
border: 1px solid var(--accent-secondary);
border-radius: 12px;
box-shadow: 0 12px 48px rgba(0,0,0,0.6);
z-index: var(--z-modal);
display: none;
overflow: hidden;
}
.notif-dropdown.open { display: block; }
.notif-header {
padding: 0.75rem 1rem;
border-bottom: 1px solid var(--border);
display: flex;
justify-content: space-between;
align-items: center;
}
.notif-title {
font-weight: 600;
font-size: 0.9rem;
}
.notif-mark-read {
background: none;
border: none;
color: var(--accent);
font-size: 0.75rem;
cursor: pointer;
}
.notif-mark-read:hover { text-decoration: underline; }
.notif-list {
max-height: 350px;
overflow-y: auto;
}
.notif-empty {
padding: 2rem;
text-align: center;
color: var(--muted);
font-size: 0.85rem;
}
.notif-item {
display: flex;
gap: 0.75rem;
padding: 0.75rem 1rem;
cursor: pointer;
transition: background 0.2s;
border-bottom: 1px solid var(--border);
}
.notif-item:hover { background: var(--bg-elevated); }
.notif-item.unread { background: rgba(230, 126, 34, 0.1); }
.notif-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
background: linear-gradient(135deg, var(--accent), var(--accent-purple));
display: flex;
align-items: center;
justify-content: center;
font-size: 0.85rem;
color: white;
font-weight: 600;
flex-shrink: 0;
}
.notif-content {
flex: 1;
min-width: 0;
}
.notif-text {
font-size: 0.8rem;
color: var(--text);
line-height: 1.4;
}
.notif-text strong { color: var(--accent); }
.notif-time {
font-size: 0.65rem;
color: var(--muted);
margin-top: 0.2rem;
}
.notif-icon {
font-size: 1rem;
flex-shrink: 0;
}

/* Discover Users Grid */
.discover-header {
text-align: center;
margin-bottom: 1.5rem;
padding-bottom: 1rem;
border-bottom: 1px solid var(--border);
}
.discover-header h3 {
font-size: 1.1rem;
color: var(--text);
margin-bottom: 0.5rem;
}
.discover-header p {
font-size: 0.85rem;
color: var(--muted);
}
.discover-grid {
display: grid;
gap: 0.75rem;
}
.discover-card {
display: flex;
align-items: center;
gap: 1rem;
padding: 1rem;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 12px;
transition: all 0.2s;
}
.discover-card:hover {
border-color: var(--accent);
transform: translateX(4px);
}
.discover-avatar {
width: 48px;
height: 48px;
border-radius: 50%;
background: linear-gradient(135deg, var(--accent), var(--accent-purple));
display: flex;
align-items: center;
justify-content: center;
font-size: 1.25rem;
font-weight: 600;
color: white;
cursor: pointer;
flex-shrink: 0;
}
.discover-info {
flex: 1;
cursor: pointer;
}
.discover-name {
font-weight: 600;
color: var(--text);
font-size: 1rem;
}
.discover-stats {
font-size: 0.8rem;
color: var(--muted);
margin-top: 0.2rem;
}

/* Feed d'activit? */
.activity-feed {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.activity-filters {
display: flex;
gap: 0.5rem;
margin-bottom: 1rem;
flex-wrap: wrap;
}
.activity-filter {
padding: 0.4rem 0.8rem;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 20px;
font-size: 0.8rem;
color: var(--text-secondary);
cursor: pointer;
transition: all 0.2s;
display: flex;
align-items: center;
gap: 0.4rem;
}
.activity-filter:hover {
border-color: var(--accent);
color: var(--text);
}
.activity-filter.active {
background: var(--accent);
color: white;
border-color: var(--accent);
}
.activity-filter .filter-count {
background: rgba(255,255,255,0.2);
padding: 0.1rem 0.4rem;
border-radius: 10px;
font-size: 0.7rem;
}
.activity-filter.active .filter-count {
background: rgba(255,255,255,0.3);
}
.activity-item {
display: flex;
align-items: flex-start;
gap: 0.75rem;
padding: 0.75rem 1rem;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 12px;
cursor: pointer;
transition: all 0.2s;
}
.activity-item:hover {
border-color: var(--accent);
background: var(--bg-elevated);
}
.activity-item.highlight {
border-color: var(--accent);
background: linear-gradient(135deg, rgba(255,69,58,0.1), transparent);
animation: activityHighlight 2s ease;
}
@keyframes activityHighlight {
0% { transform: translateX(-10px); opacity: 0; }
100% { transform: translateX(0); opacity: 1; }
}
.activity-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
display: flex;
align-items: center;
justify-content: center;
font-size: 0.9rem;
font-weight: 600;
color: white;
cursor: pointer;
flex-shrink: 0;
}
.activity-avatar.comment { background: linear-gradient(135deg, #5ac8fa, #007aff); }
.activity-avatar.follow { background: linear-gradient(135deg, #bf5af2, #9b59b6); }
.activity-avatar.share { background: linear-gradient(135deg, #30d158, #27ae60); }
.activity-content {
flex: 1;
min-width: 0;
}
.activity-text {
font-size: 0.9rem;
color: var(--text);
line-height: 1.4;
}
.activity-text strong {
color: var(--accent);
cursor: pointer;
}
.activity-text strong:hover {
text-decoration: underline;
}
.activity-snippet {
font-size: 0.8rem;
color: var(--muted);
font-style: italic;
margin-top: 0.3rem;
line-height: 1.3;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.activity-comment-preview {
font-size: 0.8rem;
color: var(--text);
margin-top: 0.3rem;
padding: 0.5rem;
background: var(--bg-elevated);
border-radius: 8px;
border-left: 2px solid var(--accent);
}
.activity-time {
font-size: 0.75rem;
color: var(--muted);
margin-top: 0.25rem;
}
.activity-icon {
font-size: 1.2rem;
flex-shrink: 0;
}
.activity-icon.like { animation: heartPulse 1s ease infinite; }
@keyframes heartPulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.1); }
}
.activity-section-title {
font-size: 0.75rem;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 1px;
padding: 0.5rem 0;
margin-top: 0.5rem;
border-top: 1px solid var(--border);
}
.activity-section-title:first-child {
border-top: none;
margin-top: 0;
}

.btn-close-profile {
background: var(--bg-elevated);
color: var(--text);
border: 1px solid var(--border) !important;
}
.friends-list {
margin-top: 1.5rem;
border-top: 1px solid var(--border);
padding-top: 1rem;
}
.friends-list h4 {
font-size: 0.85rem;
color: var(--muted);
margin-bottom: 0.75rem;
}
.friend-item {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.5rem 0;
cursor: pointer;
}
.friend-item:hover {
background: var(--bg-elevated);
margin: 0 -1rem;
padding: 0.5rem 1rem;
border-radius: 8px;
}
.friend-avatar {
width: 32px;
height: 32px;
border-radius: 50%;
background: var(--accent-purple);
display: flex;
align-items: center;
justify-content: center;
font-size: 0.8rem;
color: white;
}
.extrait-time {
font-size: 0.75rem;
color: var(--muted);
}
.extrait-text {
font-family: inherit;
font-size: 1.1rem;
font-style: normal;
color: var(--text);
line-height: 1.7;
padding: 1rem;
background: var(--bg);
border-left: 3px solid var(--accent-tertiary);
border-radius: 0 8px 8px 0;
margin-bottom: 0.75rem;
}
.extrait-source {
font-size: 0.8rem;
color: var(--text-secondary);
margin-bottom: 0.5rem;
}
.extrait-source strong {
color: var(--text);
}
.extrait-commentary {
font-size: 0.9rem;
color: var(--text-secondary);
line-height: 1.5;
margin-top: 0.75rem;
padding-top: 0.75rem;
border-top: 1px solid var(--border);
}
.extrait-actions {
display: flex;
gap: 1.5rem;
margin-top: 1rem;
padding-top: 0.75rem;
border-top: 1px solid var(--border);
}
.extrait-action {
display: flex;
align-items: center;
gap: 0.4rem;
background: none;
border: none;
color: var(--muted);
font-size: 0.85rem;
cursor: pointer;
transition: all 0.2s;
padding: 0.3rem 0;
}
.extrait-action:hover { color: var(--text); }
.extrait-action.liked { color: #e74c3c; }
.extrait-action .icon { font-size: 1.1rem; }

/* Wrapper pour le bouton share + badge annulation */
.share-btn-wrapper {
    position: relative;
    display: inline-flex;
}

.unshare-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
    padding: 0;
}

.unshare-badge:hover {
    opacity: 1;
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: scale(1.1);
}

/* --- ANIMATIONS LIKE STYLE TWITTER/INSTA --- */
.extrait-action.like-btn {
    transition: transform 0.15s ease, color 0.2s ease;
}

.extrait-action.like-btn:active {
    transform: scale(0.85);
}

.extrait-action.like-btn.like-animating {
    animation: likePopAnimation 0.35s ease-out;
}

.extrait-action.like-btn .like-icon {
    display: inline-block;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.extrait-action.like-btn.liked .like-icon {
    animation: heartBeat 0.35s ease-out;
    color: #e74c3c;
}

.extrait-action.like-btn .like-count {
    font-weight: 600;
    min-width: 1.2em;
    text-align: center;
    border: none !important;
    background: transparent !important;
}

@keyframes likePopAnimation {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.35); }
    30% { transform: scale(1); }
    45% { transform: scale(1.2); }
    60% { transform: scale(1); }
}

/* Empty social feed */
.social-empty {
text-align: center;
padding: 3rem 1rem;
color: var(--muted);
}
.social-empty-icon {
font-size: 3rem;
margin-bottom: 1rem;
opacity: 0.3;
}
.social-empty-title {
font-size: 1rem;
color: var(--text);
margin-bottom: 0.5rem;
}
.social-empty-text {
font-size: 0.85rem;
}

/* Profile section in sidebar */
.profile-section {
background: var(--bg-elevated);
border-radius: 12px;
padding: 1rem;
margin-bottom: 1rem;
}
.profile-header {
display: flex;
align-items: center;
gap: 0.75rem;
margin-bottom: 0.75rem;
}
.profile-avatar {
width: 40px;
height: 40px;
border-radius: 50%;
background: linear-gradient(135deg, var(--accent), var(--accent-purple));
display: flex;
align-items: center;
justify-content: center;
font-size: 1rem;
}
.profile-name {
font-weight: 600;
font-size: 0.9rem;
color: var(--text);
}
.profile-stats {
display: flex;
gap: 1rem;
font-size: 0.75rem;
color: var(--muted);
}
.profile-stat strong {
color: var(--text);
}
.login-prompt {
text-align: center;
padding: 0.75rem;
}
.login-prompt-text {
font-size: 0.8rem;
color: var(--muted);
margin-bottom: 0.75rem;
}
.login-prompt-btn {
background: var(--accent);
border: none;
color: white;
padding: 0.5rem 1rem;
border-radius: 6px;
font-size: 0.8rem;
cursor: pointer;
transition: all 0.2s;
}
.login-prompt-btn:hover { background: var(--accent-hover); }

/* -----------------------------------------------------------
   ?? RESPONSIVE MOBILE (iPhone & petits ?crans)
   Safari-compatible avec !important pour forcer les styles
   ----------------------------------------------------------- */

/* Tablettes et petits ?crans */
@media screen and (max-width: 768px) {
    /* Le drawer est g?r? par mobile.css - NE PAS LE CACHER ICI */
    
    /* Header mobile */
    header {
        left: 0 !important;
        right: 0 !important;
    }
    .header-inner {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
        -webkit-box-pack: justify;
        justify-content: space-between;
    }
    .header-title {
        font-size: 0.65rem;
        letter-spacing: 0.05em;
    }
    .search-container {
        min-width: 100px;
        max-width: none;
        -webkit-box-flex: 1;
        flex: 1;
        margin: 0 0.5rem;
    }
    .search-input {
        padding: 0.5rem 0.75rem 0.5rem 2rem;
        font-size: 16px; /* 16px emp?che le zoom auto sur iOS */
    }
    .header-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.65rem;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Main content - FORCER le centrage */
    main {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 4.5rem 0.75rem 5rem !important;
        max-width: 100% !important;
    }
    
    /* Cards */
    .card {
        padding: 1.25rem;
        border-radius: 12px;
    }
    .card-quote {
        font-size: 1.1rem;
        line-height: 1.6;
    }
    .card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Modals */
    .auth-modal-content,
    .share-modal-content,
    .detail-modal-content {
        width: 95%;
        max-width: none;
        margin: 1rem;
        padding: 1.25rem;
        border-radius: 16px;
    }
    
    /* Social feed tabs */
    .exploration-tabs {
        padding: 0 0.5rem;
        gap: 0.25rem;
    }
    .exploration-tab {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
    }
    
    /* Feed items */
    .feed-card {
        padding: 1rem;
    }
    .feed-quote {
        font-size: 1rem;
    }
    
    /* Messages modal */
    .messages-modal-content {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }
    
    /* Notifications dropdown */
    .notif-dropdown {
        width: 100vw;
        max-width: 100vw;
        right: -1rem;
        border-radius: 0 0 12px 12px;
    }
    
    /* User dropdown */
    .user-dropdown {
        width: 200px;
        right: 0;
    }
}

/* iPhone et tr?s petits ?crans */
@media screen and (max-width: 480px) {
    /* Le drawer est g?r? par mobile.css */
    
    /* Header ultra compact */
    header {
        left: 0 !important;
    }
    .header-inner {
        padding: 0.4rem 0.5rem;
        gap: 0.35rem;
    }
    .header-title {
        display: none !important; /* Cacher le titre sur tr?s petits ?crans */
    }
    .search-container {
        margin: 0 0.25rem;
        min-width: 80px;
    }
    .search-input {
        padding: 0.45rem 0.6rem 0.45rem 1.8rem;
        font-size: 16px; /* 16px emp?che le zoom auto sur iOS */
        border-radius: 20px;
    }
    .search-icon {
        left: 0.6rem;
        font-size: 0.8rem;
    }
    .header-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.6rem;
        min-height: 36px;
        min-width: 36px;
        display: -webkit-box;
        display: flex;
        -webkit-box-align: center;
        align-items: center;
        -webkit-box-pack: center;
        justify-content: center;
    }
    /* Cacher certains boutons header sur mobile */
    .lang-selector {
        display: none !important;
    }
    
    /* Main content */
    main {
        margin-left: 0 !important;
        padding: 4rem 0.5rem 5rem !important;
    }
    
    /* Cards encore plus compactes */
    .card {
        padding: 1rem;
        border-radius: 10px;
    }
    .card-quote {
        font-size: 1rem;
        line-height: 1.5;
    }
    .card-source {
        font-size: 0.75rem;
    }
    .card-actions {
        display: -webkit-box;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .card-action {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
        min-height: 36px;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Bouton flottant d'action */
    .float-btn {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
    }
    
    /* Auth modal */
    .auth-modal-content {
        padding: 1rem;
    }
    .auth-modal-content h2 {
        font-size: 1.25rem;
    }
    .auth-input {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    .auth-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Feed tabs scroll horizontal */
    .exploration-container {
        padding: 0;
    }
    .exploration-tabs {
        padding: 0 0.25rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .exploration-tabs::-webkit-scrollbar {
        display: none;
    }
    .exploration-tab {
        padding: 0.35rem 0.5rem;
        font-size: 0.65rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Detail modal full screen */
    .detail-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
    }
    
    /* Share modal */
    .share-modal-content {
        padding: 1rem;
    }
    .share-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    .share-option {
        padding: 0.75rem 0.5rem;
        font-size: 0.65rem;
    }
    .share-option-icon {
        font-size: 1.25rem;
    }
    
    /* Reco banner */
    .reco-banner {
        padding: 1rem;
        margin: 0 0.5rem;
    }
    .reco-text {
        font-size: 0.8rem;
    }
    
    /* Ambiance intro */
    .ambiance-intro {
        padding: 1rem;
        margin: 0.5rem;
        border-radius: 12px;
    }
    .ambiance-intro h2 {
        font-size: 1.2rem;
    }
    .ambiance-intro p {
        font-size: 0.8rem;
    }
    
    /* Achievement popup */
    .achievement-popup {
        bottom: 1rem;
        right: 0.5rem;
        left: 0.5rem;
        padding: 1rem;
    }
    .achievement-icon {
        font-size: 2rem;
    }
    .achievement-name {
        font-size: 1rem;
    }
    
    /* Toast notifications */
    .toast {
        left: 0.5rem;
        right: 0.5rem;
        bottom: 1rem;
        max-width: none;
    }
    
    /* Comments section */
    .comments-section {
        padding: 0.75rem;
    }
    .comment-input {
        font-size: 0.85rem;
    }
    
    /* Profile page */
    .profile-page-header {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
    .profile-page-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    .profile-page-stats {
        justify-content: center;
    }
}

/* Fix pour le safe area sur iPhone (notch) */
@supports (padding: max(0px)) {
    header {
        padding-top: max(0px, env(safe-area-inset-top));
    }
    main {
        padding-bottom: max(5rem, calc(5rem + env(safe-area-inset-bottom)));
    }
    .float-btn {
        bottom: max(1rem, calc(1rem + env(safe-area-inset-bottom)));
    }
    .achievement-popup {
        bottom: max(2rem, calc(2rem + env(safe-area-inset-bottom)));
    }
    .toast {
        bottom: max(1rem, calc(1rem + env(safe-area-inset-bottom)));
    }
}

/* Am?lioration du touch sur mobile */
@media (hover: none) and (pointer: coarse) {
    /* Zones de tap plus grandes */
    .card-action,
    .header-btn,
    .exploration-tab,
    .auth-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* D?sactiver les effets hover qui ne marchent pas bien sur touch */
    .card:hover {
        transform: none;
    }
    .card-action:hover {
        transform: none;
    }
    
    /* Feedback visuel pour tap */
    .card-action:active,
    .header-btn:active,
    .auth-btn:active {
        opacity: 0.7;
        transform: scale(0.98);
    }
}

/* -----------------------------------------------------------
   ?? MOBILE RESPONSIVE - SAFARI iOS & ANDROID
   Version compl?te et robuste
   Note: Le drawer mobile est g?r? dans mobile.css
   ----------------------------------------------------------- */

/* ====== TABLETTES ET MOBILE (< 900px) ====== */
@media screen and (max-width: 900px) {
    /* SIDEBAR devient DRAWER - g?r? dans mobile.css, ne pas masquer ici */
    /* On laisse mobile.css g?rer le drawer */
    
    /* Body - emp?cher le scroll horizontal */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
        position: relative !important;
    }
    
    /* HEADER - Pleine largeur */
    header {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        width: 100% !important;
        z-index: 1000 !important;
    }
    
    .header-inner {
        padding: 0.5rem 0.75rem !important;
        gap: 0.5rem !important;
        -webkit-box-pack: justify !important;
        justify-content: space-between !important;
    }
    
    .header-title {
        font-size: 0.65rem !important;
        display: block !important;
    }
    
    /* Search */
    .search-container {
        -webkit-box-flex: 1 !important;
        flex: 1 !important;
        min-width: 100px !important;
        max-width: none !important;
        margin: 0 0.5rem !important;
    }
    
    .search-input {
        font-size: 16px !important; /* Emp?che zoom iOS */
        padding: 0.5rem 0.75rem 0.5rem 2rem !important;
        border-radius: 20px !important;
    }
    
    /* Header actions */
    .header-actions {
        display: -webkit-box !important;
        display: -webkit-flex !important;
        display: flex !important;
        -webkit-box-align: center !important;
        -webkit-align-items: center !important;
        align-items: center !important;
        gap: 0.25rem !important;
        -webkit-flex-shrink: 0 !important;
        flex-shrink: 0 !important;
    }
    
    .header-btn {
        padding: 0.35rem 0.5rem !important;
        font-size: 0.85rem !important;
        min-height: 36px !important;
        min-width: 36px !important;
        display: -webkit-box !important;
        display: -webkit-flex !important;
        display: flex !important;
        -webkit-box-align: center !important;
        -webkit-align-items: center !important;
        align-items: center !important;
        -webkit-box-pack: center !important;
        -webkit-justify-content: center !important;
        justify-content: center !important;
    }
    
    /* Cacher s?lecteur de langue */
    .lang-selector {
        display: none !important;
    }
    
    /* MAIN CONTENT */
    main {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 4.5rem 1rem 5rem 1rem !important;
        min-height: 100vh !important;
        -webkit-box-sizing: border-box !important;
        box-sizing: border-box !important;
    }
    
    /* Cards */
    .card {
        padding: 1.25rem !important;
        margin-bottom: 1rem !important;
        border-radius: 12px !important;
        max-width: 100% !important;
    }
    
    .card-quote {
        font-size: 1.05rem !important;
        line-height: 1.6 !important;
    }
    
    .card-actions {
        display: -webkit-box !important;
        display: -webkit-flex !important;
        display: flex !important;
        -webkit-flex-wrap: wrap !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }
    
    .card-action {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.75rem !important;
        min-height: 40px !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    
    /* RECO BANNER */
    .reco-banner {
        margin: 0 !important;
        padding: 1rem !important;
        border-radius: 12px !important;
        max-width: 100% !important;
    }
    
    /* EXPLORATION TABS */
    .exploration-container {
        padding: 0 !important;
    }
    
    .exploration-tabs {
        display: -webkit-box !important;
        display: -webkit-flex !important;
        display: flex !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        padding: 0 0.5rem !important;
        gap: 0.5rem !important;
    }
    
    .exploration-tabs::-webkit-scrollbar {
        display: none !important;
    }
    
    .exploration-tab {
        -webkit-flex-shrink: 0 !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        padding: 0.5rem 0.75rem !important;
        font-size: 0.75rem !important;
    }
    
    /* MODALS */
    .auth-modal-content,
    .detail-modal-content,
    .share-modal-content,
    .favorites-modal-content {
        width: 95% !important;
        max-width: 400px !important;
        max-height: 90vh !important;
        margin: auto !important;
        border-radius: 16px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* DROPDOWNS - Style bottom sheet mobile */
    .user-dropdown,
    .notif-dropdown {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 70vh !important;
        border-radius: 20px 20px 0 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        z-index: 2000 !important;
    }
    
    .user-dropdown-item {
        padding: 1rem 1.25rem !important;
        min-height: 50px !important;
        font-size: 1rem !important;
    }
    
    /* FLOATIN BUTTON */
    .float-btn {
        bottom: 1rem !important;
        right: 1rem !important;
        width: 56px !important;
        height: 56px !important;
        z-index: 900 !important;
    }
}

/* ====== SMARTPHONES (< 480px) ====== */
@media screen and (max-width: 480px) {
    /* Le drawer est g?r? par mobile.css */
    
    /* Header ultra compact */
    .header-inner {
        padding: 0.4rem 0.5rem !important;
        gap: 0.3rem !important;
    }
    
    .header-title {
        display: none !important; /* Masquer titre sur petit ?cran */
    }
    
    .search-container {
        margin: 0 0.25rem !important;
    }
    
    .search-input {
        padding: 0.4rem 0.5rem 0.4rem 1.75rem !important;
    }
    
    .header-btn {
        padding: 0.3rem !important;
        font-size: 0.9rem !important;
        min-width: 34px !important;
        min-height: 34px !important;
    }
    
    /* Main */
    main {
        padding: 4rem 0.5rem 5rem 0.5rem !important;
    }
    
    /* Cards compactes */
    .card {
        padding: 1rem !important;
        border-radius: 10px !important;
    }
    
    .card-quote {
        font-size: 0.95rem !important;
        line-height: 1.55 !important;
    }
    
    .card-source {
        font-size: 0.7rem !important;
    }
    
    .card-action {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.7rem !important;
        min-height: 36px !important;
    }
    
    /* Auth modal */
    .auth-modal-content {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
    }
    
    .auth-input {
        font-size: 16px !important; /* Emp?che zoom iOS */
        padding: 0.75rem !important;
    }
    
    .auth-btn {
        padding: 0.85rem !important;
        font-size: 1rem !important;
        min-height: 48px !important;
    }
    
    /* Detail modal plein ?cran */
    .detail-modal-content {
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
    }
    
    /* Share options */
    .share-options {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    .share-option {
        padding: 0.6rem 0.4rem !important;
        font-size: 0.6rem !important;
    }
    
    /* Toast */
    .toast {
        left: 0.5rem !important;
        right: 0.5rem !important;
        bottom: 1.5rem !important;
        max-width: none !important;
    }
    
    /* Achievement popup */
    .achievement-popup {
        left: 0.5rem !important;
        right: 0.5rem !important;
        bottom: 1.5rem !important;
    }
    
    /* Profile page */
    .profile-page-header {
        -webkit-flex-direction: column !important;
        flex-direction: column !important;
        text-align: center !important;
        padding: 1rem !important;
    }
    
    .profile-page-avatar {
        width: 60px !important;
        height: 60px !important;
    }
}

/* ====== TR?S PETITS ?CRANS (< 375px) - iPhone SE, etc ====== */
@media screen and (max-width: 375px) {
    .header-inner {
        padding: 0.35rem 0.4rem !important;
    }
    
    .search-input {
        min-width: 60px !important;
        padding: 0.35rem 0.4rem 0.35rem 1.5rem !important;
        font-size: 14px !important;
    }
    
    .header-btn {
        min-width: 30px !important;
        min-height: 30px !important;
        font-size: 0.8rem !important;
    }
    
    main {
        padding: 3.75rem 0.4rem 4.5rem 0.4rem !important;
    }
    
    .card {
        padding: 0.85rem !important;
    }
    
    .card-quote {
        font-size: 0.9rem !important;
    }
    
    .card-action {
        padding: 0.35rem 0.5rem !important;
        min-height: 32px !important;
    }
}

/* ====== SAFE AREA iOS (Notch iPhone X+) ====== */
@supports (padding-top: env(safe-area-inset-top)) {
    @media screen and (max-width: 900px) {
        header {
            padding-top: env(safe-area-inset-top) !important;
        }
        
        main {
            padding-bottom: calc(5rem + env(safe-area-inset-bottom)) !important;
        }
        
        .float-btn {
            bottom: calc(1rem + env(safe-area-inset-bottom)) !important;
        }
        
        .toast,
        .achievement-popup {
            bottom: calc(1.5rem + env(safe-area-inset-bottom)) !important;
        }
        
        .user-dropdown,
        .notif-dropdown {
            padding-bottom: env(safe-area-inset-bottom) !important;
        }
    }
}

/* ====== TOUCH DEVICES ====== */
@media (hover: none) and (pointer: coarse) {
    /* Zones de tap Apple-compliant (44x44 minimum) */
    .card-action,
    .header-btn,
    .exploration-tab,
    .auth-btn,
    .user-dropdown-item {
        min-height: 44px !important;
    }
    
    /* D?sactiver hover effects */
    .card:hover,
    .card-action:hover,
    .header-btn:hover {
        transform: none !important;
        -webkit-transform: none !important;
    }
    
    /* Touch feedback */
    .card-action:active,
    .header-btn:active,
    .auth-btn:active,
    .exploration-tab:active {
        opacity: 0.7 !important;
        transform: scale(0.97) !important;
        -webkit-transform: scale(0.97) !important;
    }
    
    /* Smooth scrolling */
    .exploration-tabs,
    .favorites-section,
    .user-dropdown,
    .notif-dropdown,
    main {
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Emp?cher s?lection accidentelle */
    .card-action,
    .header-btn,
    .exploration-tab {
        -webkit-user-select: none !important;
        user-select: none !important;
        -webkit-touch-callout: none !important;
    }
}

/* ====== ORIENTATION PAYSAGE MOBILE ====== */
@media screen and (max-width: 900px) and (orientation: landscape) {
    header {
        padding-top: 0 !important;
    }
    
    main {
        padding-top: 3.5rem !important;
        padding-bottom: 3rem !important;
    }
    
    .auth-modal-content,
    .detail-modal-content {
        max-height: 95vh !important;
    }
    
    .user-dropdown,
    .notif-dropdown {
        max-height: 80vh !important;
    }
}

/* ====== FORCE REPAINT SAFARI (Bug fix) ====== */
@media screen and (max-width: 900px) {
    .stats-panel {
        -webkit-backface-visibility: hidden !important;
        backface-visibility: hidden !important;
        -webkit-perspective: 1000 !important;
        perspective: 1000 !important;
    }
}

/* ---------------------------------------------------------------------------
   ?? COMMENTAIRES INLINE - Directement sous les cartes
   --------------------------------------------------------------------------- */

.inline-comment-box {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    margin-top: -1px;
}

.inline-comment-box.open {
    max-height: 300px;
    opacity: 1;
    padding: 0.75rem 1rem;
}

.inline-comments-list {
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}

.inline-comment-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px dotted var(--border);
    animation: fadeInUp 0.2s ease;
}

.inline-comment-item:last-child {
    border-bottom: none;
}

.inline-comment-item.new {
    background: rgba(230, 57, 70, 0.1);
    border-radius: 4px;
    padding-left: 0.5rem;
    margin-left: -0.5rem;
}

.inline-comment-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    flex-shrink: 0;
}

.inline-comment-content {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.inline-comment-content strong {
    color: var(--text);
    font-weight: 600;
    margin-right: 0.3rem;
}

.inline-comment-input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.inline-comment-input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--text);

    transition: border-color 0.2s ease;
}

.inline-comment-input:focus {
    border-color: var(--accent);
}

.inline-comment-input::placeholder {
    color: var(--muted);
}

.inline-comment-send {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.inline-comment-send:hover {
    transform: scale(1.1);
    background: var(--accent-secondary);
}

.inline-comment-send:active {
    transform: scale(0.95);
}

/* Animation */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------------------
   ?? SHARE MODAL AM?LIOR?
   --------------------------------------------------------------------------- */

.share-text-selectable {
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
    line-height: 1.7;
}

.share-text-selectable::selection {
    background: var(--accent);
    color: white;
}

.share-char-count {
    font-size: 0.75rem;
    text-align: right;
    margin-top: 0.5rem;
    color: var(--muted);
}

#sharePreviewText {
    max-height: 250px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.share-preview {
    position: relative;
}

.btn-reset-share {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--accent-tertiary);
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.8;
}

.btn-reset-share:hover {
    opacity: 1;
}

/* ---------------------------------------------------------------------------
   ?? VOIR PLUS - Chargement depuis Wikisource
   --------------------------------------------------------------------------- */

.btn-voir-plus {
    display: inline-block;
    margin: 0.5rem 0;
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: 1px dashed var(--accent-tertiary);
    color: var(--accent-tertiary);
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-voir-plus:hover {
    background: var(--accent-tertiary);
    color: white;
    border-style: solid;
}
.btn-voir-plus.exhausted {
    border-color: var(--muted);
    color: var(--muted);
    cursor: default;
}

.full-text-loaded {
    white-space: pre-line;
    line-height: 1.7;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
}

.extrait-source .source-link {
    margin-left: 0.5rem;
    color: var(--accent-tertiary);
    text-decoration: none;
    font-size: 0.8rem;
}

.extrait-source .source-link:hover {
    text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   ?? PROFIL SIDEBAR - Styles desktop
   --------------------------------------------------------------------------- */

/* Header profil avec avatar */
.profile-header-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-elevated);
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 0.75rem;
}

.profile-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-purple, #9b5de5));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    border: 2px solid var(--border);
}

.profile-name-large {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

/* Stats row */
.profile-stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.profile-stat-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.25rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 0;
}

.profile-stat-btn:hover {
    background: var(--bg-lighter);
    border-color: var(--accent);
}

.profile-stat-btn .stat-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}

.profile-stat-btn .stat-label {
    font-size: 0.65rem;
    color: var(--muted);
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Bouton d?connexion */
.drawer-logout-btn {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.drawer-logout-btn:hover {
    background: rgba(230, 57, 70, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

/* Section stats avec titre styl? */
.stats-section h3 {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Grand nombre stats */
.stats-section .big-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stats-section .big-number-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mini stats grid */
.stats-section .mini-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.stats-section .mini-stat {
    background: var(--bg-elevated);
    padding: 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    text-align: center;
}

.stats-section .mini-stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
}

.stats-section .mini-stat-label {
    font-size: 0.65rem;
    color: var(--muted);
    margin-top: 0.15rem;
}



/* MODAL LIKERS - Voir qui a like */

.likers-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px);
    z-index: var(--z-modal) !important;
    display: none;
    align-items: center;
    justify-content: center;
}

.likers-modal.open {
    display: flex !important;
}

.likers-content {
    background: var(--bg-card);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.likers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.likers-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.likers-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.likers-close:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.likers-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.likers-loading,
.likers-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.liker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    transition: background 0.2s;
}

.liker-item:hover {
    background: var(--bg-elevated);
}

.liker-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    flex-shrink: 0;
}

.liker-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.liker-username {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.liker-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.liker-follow-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.liker-follow-btn:hover {
    background: var(--accent);
    color: var(--bg);
}

.liker-follow-btn.following {
    background: var(--bg-elevated);
    border-color: var(--border);
    color: var(--text-muted);
}

.liker-follow-btn.following:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.like-count.clickable {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 8px;
    transition: background 0.2s;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: -8px;
}

.like-count.clickable:hover {
    background: transparent;
    color: var(--text);
}

/* Grouper c?ur + compteur */
.extrait-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.extrait-action.like-btn {
    padding-right: 4px;
}

/* ═══════════════════════════════════════════════════════════
   📚 COLLECTIONS - Listes personnalisées de favoris
   ═══════════════════════════════════════════════════════════ */

/* ====== MODAL PICKER DE COLLECTION ====== */
.collection-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
}

.collection-picker-modal.open {
    display: flex;
}

.collection-picker-content {
    background: var(--bg-card);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.2s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.collection-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.collection-picker-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.collection-picker-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--muted);
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.collection-picker-close:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.collection-picker-item-preview {
    padding: 12px 20px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.picker-preview-title {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.picker-preview-author {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 2px;
}

.collection-picker-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    max-height: 300px;
}

.collection-picker-empty {
    padding: 30px 20px;
    text-align: center;
    color: var(--muted);
    font-style: italic;
}

.collection-picker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.collection-picker-item:hover {
    background: var(--bg-elevated);
}

.collection-picker-item.in-collection {
    background: rgba(90, 122, 138, 0.1);
}

.collection-picker-emoji {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.collection-picker-info {
    flex: 1;
    min-width: 0;
}

.collection-picker-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    display: block;
}

.collection-picker-count {
    font-size: 0.75rem;
    color: var(--muted);
}

.collection-picker-check {
    font-size: 1.2rem;
    color: var(--muted);
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.collection-picker-item.in-collection .collection-picker-check {
    color: var(--accent);
}

.collection-picker-create {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
}

.collection-picker-create-btn {
    width: 100%;
    padding: 12px;
    background: var(--bg-elevated);
    border: 2px dashed var(--border);
    border-radius: 12px;
    cursor: pointer;
    color: var(--muted);
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.collection-picker-create-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(90, 122, 138, 0.05);
}

.collection-picker-create-btn span {
    font-size: 1.2rem;
    font-weight: 300;
}

/* Formulaire nouvelle collection dans picker */
.collection-picker-new-form {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
}

.collection-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.collection-input:focus {

    border-color: var(--accent);
}

.collection-emoji-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.emoji-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.emoji-btn:hover {
    border-color: var(--accent);
    transform: scale(1.1);
}

.emoji-btn.selected {
    border-color: var(--accent);
    background: rgba(90, 122, 138, 0.2);
}

.collection-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-cancel,
.btn-create {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
}

.btn-cancel:hover {
    border-color: var(--text);
    color: var(--text);
}

.btn-create {
    background: var(--accent);
    border: none;
    color: white;
}

.btn-create:hover {
    filter: brightness(1.1);
}

/* ====== MODAL DE CRÉATION/ÉDITION ====== */
.collection-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 310;
    display: none;
    align-items: center;
    justify-content: center;
}

.collection-modal.open {
    display: flex;
}

.collection-modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.2s ease;
}

.collection-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.collection-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.collection-modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--muted);
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.collection-modal-close:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.collection-form {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.collection-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.collection-textarea:focus {

    border-color: var(--accent);
}

.emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.emoji-btn-large {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.emoji-btn-large:hover {
    border-color: var(--accent);
    transform: scale(1.1);
}

.emoji-btn-large.selected {
    border-color: var(--accent);
    background: rgba(90, 122, 138, 0.2);
    box-shadow: 0 0 0 2px rgba(90, 122, 138, 0.3);
}

.color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-btn {
    width: 32px;
    height: 32px;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.color-btn:hover {
    transform: scale(1.15);
}

.color-btn.selected {
    border-color: white;
    box-shadow: 0 0 0 3px var(--accent);
    transform: scale(1.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.collection-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
}

.btn-primary {
    padding: 10px 24px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    filter: brightness(1.1);
}

/* ====== VUE LISTE DES COLLECTIONS ====== */
.collections-view {
    padding: 20px;
}

.collections-header {
    margin-bottom: 20px;
}

.btn-new-collection {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--accent);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-new-collection:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn-new-collection span {
    font-size: 1.2rem;
    font-weight: 400;
}

.collections-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.collections-empty {
    text-align: center;
    padding: 60px 20px;
}

.collections-empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.collections-empty-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.collections-empty-text {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.btn-create-first {
    padding: 12px 24px;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-create-first:hover {
    filter: brightness(1.1);
}

/* Carte collection */
.collection-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-elevated);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.collection-card:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.collection-card-emoji {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.collection-card-info {
    flex: 1;
    min-width: 0;
}

.collection-card-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.collection-card-count {
    font-size: 0.8rem;
    color: var(--muted);
}

.collection-card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collection-card-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.collection-card:hover .collection-card-actions {
    opacity: 1;
}

.collection-card-action {
    width: 32px;
    height: 32px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.collection-card-action:hover {
    border-color: var(--accent);
    background: rgba(90, 122, 138, 0.1);
}

/* ====== VUE CONTENU D'UNE COLLECTION ====== */
.collection-view {
    padding: 20px;
}

.collection-view-header {
    margin-bottom: 20px;
}

.btn-back-collections {
    padding: 8px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-back-collections:hover {
    border-color: var(--accent);
}

.collection-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 12px;
    font-style: italic;
}

.collection-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.collection-empty {
    text-align: center;
    padding: 60px 20px;
}

.collection-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.collection-empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.collection-empty-text {
    color: var(--muted);
    font-size: 0.85rem;
}

/* Item dans une collection */
.collection-item-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    background: var(--bg-elevated);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.collection-item-card:hover {
    border-color: var(--accent);
}

.collection-item-card.expanded {
    border-color: var(--accent);
    background: var(--bg-card);
}

.collection-item-content {
    flex: 1;
    min-width: 0;
    width: 100%;
    cursor: pointer;
}

.collection-item-header {
    margin-bottom: 6px;
}

.collection-item-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 2px;
    color: var(--text);
}

.collection-item-author {
    font-size: 0.8rem;
    color: var(--muted);
}

.collection-item-text-container {
    margin-top: 2px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.collection-item-card:not(.expanded):not(.loading) .collection-item-text-container {
    gap: 0;
}

.collection-item-preview,
.collection-item-full {
    font-size: 0.97rem;
    color: var(--text-secondary);
    line-height: 1.55;
    font-family: 'Cormorant Garamond', Georgia, serif;
    padding: 0.4rem 0.6rem;
    background: var(--bg-elevated);
    border-radius: 6px;
    border-left: 2px solid var(--accent);
    width: 100%;
    white-space: pre-wrap;
    word-wrap: break-word;
    min-height: 0;
    max-height: none;
    transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.2s ease, border 0.2s ease, background 0.2s ease;
}

.collection-item-preview {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.collection-item-full {
    max-height: 0;
    overflow: hidden;
    padding: 0;
    border-left-color: transparent;
    background: transparent;
    opacity: 0;
}

.collection-full-text {
    white-space: pre-wrap;
    line-height: 1.7;
}

.collection-loading {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    color: var(--muted);
    font-style: italic;
}

.collection-loading .loading-line {
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.12), rgba(255,255,255,0.06));
    animation: collectionShimmer 1.2s ease-in-out infinite;
}

.collection-loading .loading-line.short {
    width: 65%;
}

.collection-loading .loading-label {
    font-size: 0.8rem;
}

@keyframes collectionShimmer {
    0% { opacity: 0.45; }
    50% { opacity: 0.8; }
    100% { opacity: 0.45; }
}

.collection-item-card.loading .collection-item-full {
    max-height: 220px;
    opacity: 1;
}

.collection-item-card.loading .collection-item-preview {
    opacity: 1;
    max-height: none;
}

.collection-item-card.expanded .collection-item-preview {
    padding: 0;
    border-left-color: transparent;
    background: transparent;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

.collection-item-card.expanded .collection-item-full {
    padding: 0.4rem 0.6rem;
    border-left-color: var(--accent);
    background: var(--bg-elevated);
    opacity: 1;
    max-height: 70vh;
    overflow-y: auto;
}

.collection-error {
    padding: 20px;
    text-align: center;
    color: var(--muted);
}

.collection-error a {
    color: var(--accent);
    text-decoration: underline;
}

.collection-item-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    padding: 4px 9px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--accent);
    font-size: 0.76rem;
    cursor: pointer;
    transition: all 0.2s;
}

.collection-item-expand:disabled {
    opacity: 0.6;
    cursor: default;
}

.collection-item-expand:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.collection-item-card.expanded .collection-item-expand {
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.collection-item-note {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(90, 122, 138, 0.08);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--muted);
    font-style: italic;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.collection-item-note .note-icon {
    color: var(--accent);
    font-style: normal;
}

.collection-item-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-start;
}

/* Ergonomie "Like-like" : Cercle, sans bordure par défaut, feedback tactile */
.item-action {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    color: var(--text-secondary); /* Visibilité mode nuit corrigée */
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0.8;
}

.item-action:hover {
    opacity: 1;
    background: var(--bg-elevated);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: scale(1.15);
}

.item-action:active {
    transform: scale(0.9);
}

/* Bouton "Texte Complet" (Reload) - Style Hero */
.item-action.action-load {
    width: auto;
    height: auto;
    padding: 0.45rem 0.75rem;
    gap: 0.5rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    color: var(--accent);
    background: rgba(90, 122, 138, 0.08); /* Légère teinte pour l'affordance */
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    opacity: 1;
}

.item-action.action-load:hover {
    background: var(--accent);
    color: #fff; /* Contraste fort au survol */
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(90, 122, 138, 0.35);
}

.item-action.action-load .icon {
    font-size: 1rem;
    line-height: 1;
}

.item-action.action-load .label {
    line-height: 1.1;
}

/* Bouton "Ouvrir Source" */
.item-action.action-open:hover {
    color: var(--accent-secondary);
    background: rgba(139, 115, 85, 0.1);
    transform: translate(3px, -3px);
}

/* Bouton "Supprimer" */
.item-action.action-delete {
    color: var(--muted);
}

.item-action.action-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    transform: rotate(90deg) scale(1.1);
}

/* ====== BOUTON COLLECTION SUR LES CARTES ====== */
/* Fix: Always visible */
.card-btn-collection {
    opacity: 1; /* Was 0 */
    transition: opacity 0.2s;
}

.card:hover .card-btn-collection {
    opacity: 1;
}

.card-btn-collection:hover {
    color: var(--accent);
    background: rgba(90, 122, 138, 0.1);
}

/* SIDEBAR SETTINGS */
.sidebar-settings { padding: 10px 20px; border-bottom: 2px solid var(--border); }
.sidebar-section-title { font-size: 0.8rem; font-weight: bold; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }
.sources-btn { width: 100%; justify-content: flex-start; background: rgba(255,255,255,0.03); border: 1px solid var(--border); padding: 10px; border-radius: 6px; }
.sources-btn:hover { background: rgba(255,255,255,0.1); }

/* DESKTOP SETTINGS SECTION */
.desktop-settings-section { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem; margin-bottom: 0.75rem; border-bottom: 2px solid var(--border); }


/* Compact Settings Styles */
.settings-mini-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 12px;
    font-family: var(--font-pixel);
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    border-radius: 4px;
    height: 32px;
}
.settings-mini-btn:hover {
    background: var(--accent-secondary);
    color: white;
    border-color: var(--accent-secondary);
}

.compact-desktop-lang select {
    padding: 4px 24px 4px 6px;
    font-size: 0.8rem;
    height: 32px;
    width: auto;
    border: none;
    background: transparent;
    color: var(--text-muted);
}
.compact-desktop-lang {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    height: 32px;
}
.compact-desktop-lang:hover {
    border-color: var(--text);
}

.drawer-preferences-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 1rem;
}
.drawer-icon-btn {
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 2px 2px 0 var(--border);
}
.drawer-icon-btn:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* SIDEBAR SETTINGS */
.sidebar-settings { padding: 10px 20px; border-bottom: 2px solid var(--border); }
.sidebar-section-title { font-size: 0.8rem; font-weight: bold; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }

.sources-btn { 
    display: flex;
    align-items: center;
    width: 100%; 
    justify-content: flex-start; 
    background: rgba(255,255,255,0.03); 
    border: 1px solid var(--border); 
    padding: 10px; 
    border-radius: 6px; 
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.sources-btn:hover { background: rgba(255,255,255,0.1); }

/* DESKTOP SETTINGS SECTION */
.desktop-settings-section { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem; margin-bottom: 0.75rem; border-bottom: 2px solid var(--border); }


/* Modal fix */
#sourceSettingsModal.open { display: flex !important; }

/* ═══════════════════════════════════════════════════════════
   💬 MESSAGERIE - Réactions & Édition
   ═══════════════════════════════════════════════════════════ */

.chat-message { position: relative; }

.msg-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.chat-message:hover .msg-actions { opacity: 1; }

.msg-react-btn,
.msg-edit-btn {
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border-radius: 8px;
    padding: 2px 6px;
    font-size: 12px;
    cursor: pointer;
}

.msg-react-btn:hover,
.msg-edit-btn:hover { background: rgba(255,255,255,0.12); }

.msg-reactions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.msg-reaction-pill {
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.05);
    color: var(--text);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
}

.msg-reaction-pill.mine {
    border-color: var(--accent);
    background: rgba(212, 165, 116, 0.16);
}

.msg-reaction-picker {
    position: fixed;
    z-index: 3000;
    display: flex;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--border);
    background: rgba(20,20,20,0.96);
    backdrop-filter: blur(6px);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}

.msg-reaction-emoji {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 6px;
    border-radius: 10px;
}

.msg-reaction-emoji:hover { background: rgba(255,255,255,0.08); }

.msg-edited { color: var(--text-secondary); font-size: 11px; }

.chat-edit-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: rgba(212, 165, 116, 0.08);
    color: var(--text);
    font-size: 13px;
}

.chat-edit-cancel {
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border-radius: 10px;
    padding: 4px 8px;
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════
   💬 COMMENTAIRES - Édition
   ═══════════════════════════════════════════════════════════ */

.comment-edit {
    border: none;
    background: transparent;
    cursor: pointer;
    opacity: 0.7;
}

.comment-edit:hover { opacity: 1; }

.comment-edited {
    margin-left: 6px;
    color: var(--text-secondary);
    font-size: 11px;
}

.comment-edit-input {
    width: 100%;
    min-height: 56px;
    resize: vertical;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    color: var(--text);
}

.comment-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.comment-edit-save,
.comment-edit-cancel {
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
}

.comment-edit-save:hover,
.comment-edit-cancel:hover { background: rgba(255,255,255,0.12); }
/* ═══════════════════════════════════════════════════════
   ACTIONS D'EXTRAITS UNIFIÉES
   ═══════════════════════════════════════════════════════ */

.extrait-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.extrait-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text);
}

.extrait-action:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.extrait-action .icon {
    font-size: 1rem;
    line-height: 1;
}

/* Bouton Like spécifique */
.extrait-action.like-btn {
    padding-right: 0.5rem;
}

/* Compteurs intégrés dans les boutons */
.extrait-action .share-count,
.extrait-action .collections-count {
    margin-left: 0.25rem;
}

.extrait-action.like-btn.liked {
    background: rgba(231, 76, 60, 0.1);
    border-color: transparent;
    color: #e74c3c;
}

/* hover sur compteurs */
.like-count:hover,
.share-count:hover,
.collections-count:hover,
.comment-count:hover {
    color: var(--text);
}

/* Harmoniser les compteurs sans contour */
.extrait-actions .like-btn .like-count,
.extrait-actions .share-btn .share-count,
.extrait-actions .collection-btn .collections-count {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Bouton Voir collections */
.view-collections-btn {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--primary);
}

.view-collections-btn:hover {
    background: rgba(var(--primary-rgb), 0.2);
}

/* Modal des collections d'un extrait */
.extrait-collections-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.extrait-collections-modal.open {
    opacity: 1;
}

.extrait-collections-content {
    background: var(--bg);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 400px;
    width: 90%;
    max-height: 60vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.extrait-collections-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.extrait-collections-header h3 {
    font-size: 1.1rem;
    margin: 0;
}

.extrait-collections-header button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.extrait-collections-header button:hover {
    background: var(--bg-hover);
}

.extrait-collections-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.collection-item {
    display: flex;
    transition: background 0.2s ease;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.collection-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateX(4px);
}

.collection-item .collection-emoji {
    font-size: 1.2rem;
}

.collection-item .collection-name {
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   MENTIONS @pseudo
   ═══════════════════════════════════════════════════════════ */

.mention {
    color: var(--accent);
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    padding: 0 2px;
    border-radius: 3px;
}

.mention:hover {
    color: var(--accent-secondary);
    background: rgba(90, 122, 138, 0.15);
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════
                              NOTIFICATION HIGHLIGHT
   ═══════════════════════════════════════════════════════════════ */
@keyframes notification-highlight {
    0% { 
        box-shadow: 0 0 0 3px var(--accent), var(--glow);
        transform: scale(1.01);
    }
    50% { 
        box-shadow: 0 0 15px 5px rgba(90, 122, 138, 0.4), var(--glow);
        transform: scale(1.02);
    }
    100% { 
        box-shadow: var(--glow);
        transform: scale(1);
    }
}

.extrait-card.highlight-notification {
    animation: notification-highlight 2s ease-out;
    position: relative;
    z-index: 10;
}

/* Fin du fichier */