:root {
            --bg: #0a0a0a; --card: #161717; --text: rgba(255,255,255,0.87); --muted: rgba(255,255,255,0.60);
            --orange: #e8842a; --orange-muted: #e8842a; --yellow: #ffd700; --sep: #333;
            --orange-gradient: linear-gradient(135deg, #f8952f, var(--orange));
            --card-main: #313131;
        }
        body.day {
            --bg: #f2f2ee; --card: #ffffff; --text: #111111; --muted: #888;
            --sep: #e2e2dc; --card-main: #ffffff;
        }
        * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
        /* Masquer toutes les scrollbars — feel "app natif" */
        * { scrollbar-width: none; }
        *::-webkit-scrollbar { display: none; }
        /* Pas de rebond élastique ni de pull-to-refresh natif du navigateur
           (le pull-to-refresh maison, géré en JS, continue de fonctionner) */
        html, body { overscroll-behavior: none; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: var(--bg); color: var(--text); padding-bottom: 40px;
            overflow-x: hidden; transition: background 0.3s, color 0.3s;
            -webkit-font-smoothing: antialiased;
            /* Pas de loupe/menu "copier" en appui long sur l'interface (boutons, tab bar…) */
            user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
        }
        /* …mais le texte des articles et les champs de saisie restent sélectionnables */
        .tiktok-body, .interet-body, .fs-content, .tiktok-headline, .interet-headline,
        input, textarea {
            user-select: text; -webkit-user-select: text;
        }

        /* SPLASH */
        #splash { position: fixed; inset: 0; background: var(--bg); z-index: 99999; display: flex; align-items: center; justify-content: center; pointer-events: none; }
        

        /* HEADER */
        header { position: sticky; top: 0; z-index: 100; background: rgba(17,17,17,0.95); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--sep); padding: 14px 18px; display: flex; align-items: center; gap: 10px; transition: background 0.3s; }
        body.day header { background: rgba(242,242,238,0.95); }
        /* Header de la home : overlay transparent par-dessus la carte full-bleed */
        #home-header {
            background: transparent;
            backdrop-filter: none; -webkit-backdrop-filter: none;
            border-bottom: none;
            padding-top: max(14px, env(safe-area-inset-top));
        }
        body.day #home-header { background: transparent; }

        /* Header de la page Profil : défile avec le contenu, pas figé en haut */
        #page-profil > header { position: static; }
        #page-debats > header { position: static; }

        /* Barre du haut épurée : icônes nues (loupe + cloche), même taille et
           même traitement pour les deux. */
        #home-header .home-icon-btn {
            width: 36px; height: 36px;
            display: flex; align-items: center; justify-content: center;
            background: transparent; border: none; border-radius: 50%;
            cursor: pointer; flex-shrink: 0;
        }
        #home-header .home-icon-btn svg {
            width: 20px; height: 20px;
            color: rgba(255,255,255,0.92);
            filter: drop-shadow(0 1px 5px rgba(0,0,0,0.55));
        }
        /* Mode jour : icônes sombres pour rester lisibles sur fond clair */
        body.day #home-header .home-icon-btn svg {
            color: rgba(0,0,0,0.75);
            filter: none;
        }
        .logo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
        .header-name { font-size: 19px; font-weight: 800; letter-spacing: 1px; flex: 1; }
        .hbtn { width: 34px; height: 34px; border-radius: 50%; border: none; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); transition: color 0.25s; }
        #themeBtn { color: var(--muted); }

        /* MAIN */
        #mainContent { padding: 18px 16px 110px; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

        /* CARTE PRINCIPALE */
        .latest-edition {
            background: var(--card-main); border-radius: 17px; padding: 22px;
            cursor: pointer; position: relative; border: none;
            transition: transform 0.3s, box-shadow 0.3s;
            box-shadow: none;
            height: 55svh;
            min-height: 55svh;
            max-height: 55svh;
            display: flex; flex-direction: column; justify-content: flex-start;
            overflow: hidden;
            touch-action: pan-y; /* laisse passer le scroll vertical */
        }
        /* Version full-bleed dégradée : uniquement quand il y a une image de fond.
           La carte sort des marges de #mainContent et remonte sous le header transparent,
           sans toucher au DOM ni au JS. */
        .latest-edition.has-image {
            background: transparent;
            /* marge visible en haut/côtés (comme les autres cartes) ; le bas
               reste sans arrondi car il se fond dans le fond via le dégradé */
            border-radius: 20px 20px 0 0;
            box-shadow: none;
            padding: 22px 22px 30px;
            height: 55svh;
            min-height: 55svh;
            max-height: 55svh;
            justify-content: flex-end; /* texte ancré en bas, comme la maquette */
        }
        .latest-edition-bg {
            position: absolute; inset: 0; border-radius: 20px;
            pointer-events: none; z-index: 0; overflow: hidden;
        }
        .latest-edition.has-image .latest-edition-bg { border-radius: 20px 20px 0 0; }
        .latest-edition-bg::after {
            content: ''; position: absolute; inset: 0; border-radius: 20px;
            background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.6) 100%);
            z-index: 1;
        }
        /* Dégradé bas seulement, pour fondre l'image dans le fond de l'app */
        .latest-edition.has-image .latest-edition-bg::after {
            border-radius: 20px 20px 0 0;
            background:
                linear-gradient(to bottom,
                    rgba(0,0,0,0) 0%,
                    rgba(0,0,0,0) 50%,
                    rgba(0,0,0,0.45) 80%,
                    var(--bg) 100%);
        }
        .bg-layer {
            position: absolute; inset: 0; border-radius: 20px;
            background-size: cover; background-position: center;
            opacity: 0; transition: opacity 0.55s ease;
        }
        .latest-edition.has-image .bg-layer { border-radius: 20px 20px 0 0; }
        .bg-layer.visible { opacity: 1; }
        .latest-edition > *:not(.latest-edition-bg):not(.card-actions) { position: relative; z-index: 1; }
        .latest-edition > .card-actions { position: absolute; z-index: 1; }
        .latest-edition.pressing { transform: scale(0.98); }
        .latest-badge { display: inline-block; background: var(--orange); color: #000; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; padding: 4px 10px; border-radius: 17px; margin-bottom: 12px; position: relative; overflow: hidden; white-space: nowrap; align-self: flex-start; }
        .latest-badge::after { content: none; }
        .latest-date { font-size: 13px; font-weight: 600; margin-bottom: 6px; line-height: 1.2; color: #777; letter-spacing: 0.3px; }
        .ticker-title {
            font-size: clamp(22px, 7vw, 32px); font-weight: 800; line-height: 1.1;
            letter-spacing: -0.02em; color: #111;
            display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
            transition: color 0.4s ease;
        }
        .latest-edition.has-image .ticker-title { color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,0.85), 0 1px 5px rgba(0,0,0,0.95); }
        .latest-edition.has-image .latest-date { color: rgba(255,255,255,0.75); text-shadow: 0 1px 8px rgba(0,0,0,0.8), 0 1px 3px rgba(0,0,0,0.9); }
        .latest-edition.has-image .latest-badge { background: rgba(232,132,42,0.9); }
        .latest-edition.has-image .ticker-dot-small { background: rgba(255,255,255,0.35); }
        .latest-edition.has-image .ticker-dot-small.active { background: #fff; }
        .ticker-dot-small { width: 5px; height: 5px; border-radius: 50%; background: rgba(0,0,0,0.15); transition: background 0.3s; }
        .ticker-dot-small.active { background: var(--orange); }
        .latest-preview { font-size: 14px; line-height: 1.6; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

        /* TICKER DE TITRES dans la carte principale */
        .latest-ticker {
            flex: 1; position: relative; overflow: hidden; min-height: 0; margin-top: 14px;
            touch-action: pan-y; /* laisse le scroll vertical passer au parent ; le swipe horizontal est géré en JS */
        }
        .ticker-slide {
            position: absolute; top: 0; left: 0; right: 0;
            opacity: 0;
            transform: translateY(16px);
            transition: opacity 0.4s ease, transform 0.4s ease;
            pointer-events: none;
        }
        .ticker-slide.active {
            opacity: 1; transform: translateY(0); pointer-events: auto;
        }
        .ticker-slide.exit {
            opacity: 0 !important; transform: translateY(-16px) !important;
        }
        .ticker-num {
            display: flex; gap: 5px; margin-top: 10px; align-items: center;
        }

        /* BOUTONS DANS LA CARTE */
        .card-actions { display: none; }

        /* ARCHIVES HORIZONTALES */
        .archives-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); padding-left: 4px; margin-top: 8px; }
        .archives-fade-wrap {
            position: relative;
        }
        .archives-fade-wrap::before,
        .archives-fade-wrap::after {
            content: ''; position: absolute; top: 0; bottom: 6px; width: 5px;
            z-index: 2; pointer-events: none;
        }
        .archives-fade-wrap::before {
            left: -5px;
            background: linear-gradient(to right, var(--bg) 0%, transparent 100%);
        }
        .archives-fade-wrap::after {
            right: -5px;
            background: linear-gradient(to left, var(--bg) 0%, transparent 100%);
        }
        .archives-scroll-wrap {
            overflow-x: auto; overflow-y: hidden;
            display: flex; gap: 12px;
            scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
            padding-bottom: 6px; scrollbar-width: none;
            margin-top: -6px; padding-left: 0; padding-right: 16px;
        }
        .archives-scroll-wrap::-webkit-scrollbar { display: none; }
        .older-edition {
            background: var(--card); border-radius: 12px; padding: 16px;
            cursor: pointer; border: none; position: relative;
            transition: transform 0.3s, box-shadow 0.3s;
            box-shadow: none;
            min-width: 200px; max-width: 220px; width: 200px;
            height: 200px; min-height: 200px; max-height: 200px;
            scroll-snap-align: start; flex-shrink: 0;
            overflow: hidden;
            display: flex; flex-direction: column;
        }
        .older-edition-img {
            width: calc(100% + 32px); margin: 10px -16px -16px;
            margin-top: auto;
            height: 100px; object-fit: cover;
            display: block; opacity: 1;
            border-radius: 0 0 12px 12px;
            /* Fondu en haut de l'image : transition douce et large vers le fond de la carte */
            -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.5) 35%, #000 70%);
            mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.5) 35%, #000 70%);
        }
        .older-edition:active { opacity: 0.7; }
        .older-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
        .older-date { font-size: 14px; font-weight: 800; line-height: 1.2; }
        .older-badge { font-size: 10px; font-weight: 700; color: var(--orange-muted); text-transform: uppercase; letter-spacing: 0.5px; }
        .older-preview { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; }

        /* LECTEUR */
        .fs-reader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg); z-index: 5000; transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.32,0.94,0.6,1); display: flex; flex-direction: column; }
        .fs-reader.open { transform: translateY(0); }
        .fs-header { display: flex; align-items: center; justify-content: space-between; padding: max(16px, env(safe-area-inset-top)) 16px 14px; border-bottom: 1px solid var(--sep); background: var(--bg); }
        .close-btn { background: transparent; border: none; color: var(--text); cursor: pointer; padding: 8px; margin-left: -8px; }
        .fs-title { font-size: 14px; font-weight: 700; color: var(--text); }
        .fs-content { padding: 20px 20px 60px; overflow-y: auto; flex: 1; font-size: 16px; line-height: 1.75; color: var(--text); }
        .fs-para { margin-bottom: 32px; padding-bottom: 28px; border-bottom: 1px solid var(--sep); }
        .fs-para:last-child { border-bottom: none; margin-bottom: 0; }
        .fs-para b { display: block; color: var(--orange-muted); font-size: 1.08em; font-weight: 800; margin-bottom: 10px; line-height: 1.3; }

        /* CULTURE G */
        .yellow-word { color: var(--text); font-weight: bold; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
        .source-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: #222; margin-left: 6px; vertical-align: middle; text-decoration: none; border: 1px solid #333; }
        body.day .source-icon { background: #ddd; border-color: #bbb; }
        .source-icon img { width: 12px; height: 12px; border-radius: 50%; object-fit: contain; }
        .culture-tooltip { position: fixed; background: #222; color: #fff; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.4; max-width: 240px; box-shadow: 0 10px 25px rgba(0,0,0,0.8); border: none; z-index: 9999; opacity: 0; visibility: hidden; transform: translateY(10px) scale(0.95); transition: all 0.2s cubic-bezier(0.16,1,0.3,1); text-align: center; pointer-events: none; }
        .culture-tooltip.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); pointer-events: auto; }
        .culture-tooltip::after { content:''; position:absolute; bottom:-7px; left:50%; transform:translateX(-50%); border-width:7px 7px 0; border-style:solid; border-color:#222 transparent transparent transparent; }

        /* MODE ARTICLE (ex-tiktok) */
        #tiktokMode {
            position: fixed; inset: 0; z-index: 8700;
            background: var(--bg);
            display: none; flex-direction: column;
            transform-origin: top left;
            will-change: transform, border-radius, opacity;
            touch-action: none; /* évite que le geste de fermeture fasse aussi défiler la page derrière */
        }
        body.day #tiktokMode { background: var(--bg); }
        body:not(.day) #tiktokMode { background: var(--bg); }

        #tiktokMode.open { display: flex; }

        #tiktokMode.animating-in {
            transition:
                transform 400ms cubic-bezier(0.32, 0.72, 0, 1),
                border-radius 400ms cubic-bezier(0.32, 0.72, 0, 1),
                opacity 180ms ease;
        }
        #tiktokMode.animating-out {
            transition:
                transform 360ms cubic-bezier(0.4, 0, 0.6, 1),
                border-radius 360ms cubic-bezier(0.4, 0, 0.6, 1),
                opacity 260ms ease;
        }

        #tiktok-inner-fade {
            opacity: 0;
            transition: opacity 180ms ease 240ms;
            display: contents;
        }
        #tiktokMode.content-visible #tiktok-inner-fade {
            opacity: 1;
        }

        #tiktok-header {
            position: absolute; top: 0; left: 0; right: 0; z-index: 10;
            padding: max(16px, env(safe-area-inset-top)) 18px 12px;
            display: flex; align-items: center; justify-content: space-between;
            background: transparent;
        }
        #tiktok-close {
            background: none; border: none; cursor: pointer;
            color: var(--text);
            width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
        }

        #tiktok-counter {
            font-size: 12px; font-weight: 700;
            color: #999; letter-spacing: 0.5px;
        }

        /* Le conteneur scrollable — scroll snappé carte par carte */
        #tiktok-slides {
            flex: 1; overflow-y: auto; scrollbar-width: none;
            padding: 0;
            scroll-snap-type: y mandatory;
            -webkit-overflow-scrolling: touch;
            touch-action: pan-y; /* le scroll normal entre slides reste géré nativement */
        }
        #tiktok-slides::-webkit-scrollbar { display: none; }

        /* Chaque slide = un article pleine page, snappée.
           100dvh (hauteur dynamique) : suit la barre d'URL du navigateur. 100vh est
           trop grand quand la barre est visible (snap décalé), 100svh trop petit
           quand elle est masquée (la slide suivante dépasse en bas). */
        .tiktok-slide {
            min-height: 100vh;
            min-height: 100dvh;
            /* le contenu démarre vers les 3/4 de l'image de fond (image ~ 48svh) */
            padding: calc(48svh * 0.72) 0 80px;
            border-bottom: 1px solid rgba(0,0,0,0.08);
            display: flex; flex-direction: column;
            scroll-snap-align: start;
            scroll-snap-stop: always;
            position: relative;
            overflow: hidden;
        }
        body:not(.day) .tiktok-slide { border-bottom-color: rgba(255,255,255,0.07); }

        .tiktok-slide:last-child { border-bottom: none; }

        /* Zone catégorie / badge — pill orange.
           NB: sur le lecteur d'édition Home, .tiktok-category porte le "moment"
           (MATIN/SOIR) — non désiré en pastille → masqué. La pastille reste sur
           le feed Intérêts qui utilise .interet-category. */
        .tiktok-category {
            display: none;
        }

        /* Grand titre éditorial — casse normale.
           Hauteur réservée fixe (≈ 3 lignes) + texte ancré en bas : le titre grandit
           vers le HAUT, donc la barre orange (et le paragraphe qui suit) reste toujours
           exactement à la même hauteur, quel que soit le nombre de lignes du titre. */
        .tiktok-headline {
            position: relative; z-index: 2;
            font-size: clamp(25px, 7.2vw, 38px);
            font-weight: 800;
            line-height: 1.1;
            letter-spacing: -0.02em;
            color: #fff;
            padding: 0 24px;
            margin-bottom: 22px;
            text-transform: none;
            text-shadow: 0 2px 14px rgba(0,0,0,0.6);
            /* Titre ancré en HAUT (comme l'ancienne version → texte/image haut) + hauteur
               réservée fixe : la barre orange qui suit reste toujours à la même hauteur,
               quel que soit le nombre de lignes du titre. */
            min-height: 3.3em; /* 3 lignes × line-height 1.1 */
        }

        .tiktok-divider {
            position: relative; z-index: 2;
            height: 3px; width: 40px;
            background: var(--orange);
            border-radius: 2px;
            margin: 0 24px 22px;
        }

        /* ── MODE JOUR : lisibilité sur les slides d'article ──
           Le titre (uniquement quand aucune image n'est derrière) et les icônes
           d'action (toujours placées sous l'image, donc sur fond clair uni) sont
           blancs par défaut : illisibles sur le fond clair du mode jour. On les
           repasse en sombre. Les slides AVEC image gardent leur titre blanc sur
           l'image, et le cœur "liké" garde l'orange. */
        body.day .tiktok-slide:not(:has(.tiktok-article-img)) .tiktok-headline,
        body.day .interet-slide:not(:has(.interet-article-img)) .interet-headline {
            color: #111; text-shadow: none;
        }
        body.day .tiktok-slide .heart-btn:not(.liked) svg,
        body.day .tiktok-slide .sources-btn:not(.open) svg,
        body.day .tiktok-slide .debat-btn svg,
        body.day .interet-slide .heart-btn:not(.liked) svg,
        body.day .interet-slide .sources-btn:not(.open) svg,
        body.day .interet-slide .debat-btn svg {
            stroke: #111;
        }
        body.day .tiktok-slide .heart-btn:not(.liked) .heart-count,
        body.day .interet-slide .heart-btn:not(.liked) .heart-count {
            color: #111;
        }
        .tiktok-body {
            position: relative; z-index: 2;
            font-size: 14.5px;
            line-height: 1.7;
            color: var(--text);
            /* sécurité : marge droite réservée pour la colonne des boutons
               cœur/partage afin que le texte ne passe jamais dessous */
            padding: 0 64px 0 24px;
            flex: 1;
        }

        /* Image en arrière-plan plein écran, ancrée en haut, avec fondu vers le bas */
        .tiktok-article-img {
            position: absolute;
            top: 0; left: 0;
            width: 100%;
            height: 48svh;
            object-fit: cover;
            border-radius: 0;
            margin: 0;
            display: block;
            opacity: 1;
            z-index: 0;
            /* Fondu : l'image se fond dans le fond de la slide vers le bas
               (et légèrement en haut sous la barre d'état) */
            -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, #000 30%, #000 55%, transparent 100%);
            mask-image: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, #000 30%, #000 55%, transparent 100%);
        }

        /* Sources en bas */
        .tiktok-sources {
            margin-top: 28px;
            padding: 18px 24px 0;
            border-top: 1px solid rgba(0,0,0,0.1);
            display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
        }
        body:not(.day) .tiktok-sources { border-top-color: rgba(255,255,255,0.1); }
        .tiktok-source-pill {
            display: inline-flex; align-items: center; gap: 5px;
            padding: 4px 10px; border-radius: 20px;
            border: 1px solid rgba(0,0,0,0.12);
            background: rgba(0,0,0,0.04);
            text-decoration: none;
            transition: background 0.15s;
        }
        body:not(.day) .tiktok-source-pill {
            border-color: rgba(255,255,255,0.15);
            background: rgba(255,255,255,0.05);
        }
        .tiktok-source-pill:active { background: rgba(0,0,0,0.1); }
        .tiktok-source-pill img { width: 13px; height: 13px; border-radius: 50%; object-fit: contain; }
        .tiktok-source-pill span {
            font-size: 11px; font-weight: 600; color: #555; letter-spacing: 0.2px;
        }
        body:not(.day) .tiktok-source-pill span { color: #aaa; }

        /* Boutons cœur / partage — alignés sur l'image en bas de slide */
        .tiktok-slide-actions {
            position: absolute;
            right: 14px;
            /* Image = 180px. Son centre est à 90px depuis le bas de la slide.
               Le groupe fait ~(30px heart + 4px gap-txt + 22px gap + 30px share) = ~86px.
               Pour que le milieu du groupe soit au centre de l'image :
               bottom = 90px - 43px = 47px    */
            bottom: 47px;
            transform: none;
            display: flex; flex-direction: column; align-items: center; gap: 22px;
            z-index: 50;
        }
        .slide-action-btn {
            display: flex; flex-direction: column; align-items: center; gap: 4px;
            background: none; border: none; cursor: pointer; padding: 0;
            color: #fff; -webkit-tap-highlight-color: transparent;
        }
        .slide-action-btn svg {
            width: 30px; height: 30px;
            filter: drop-shadow(0 1px 4px rgba(0,0,0,0.5));
            transition: transform 0.2s ease, fill 0.2s ease, color 0.2s ease, opacity 0.2s ease;
        }
        .slide-action-btn:active svg { transform: scale(0.85); }
        .heart-btn svg { fill: none; stroke: #fff; }
        .heart-btn .heart-count {
            font-size: 12px; font-weight: 700; color: #fff;
            text-shadow: 0 1px 4px rgba(0,0,0,0.5);
        }
        .heart-btn.liked svg {
            fill: var(--orange); stroke: var(--orange);
            animation: heartPop 0.35s ease;
        }
        .heart-btn.liked .heart-count { color: var(--orange); }
        @keyframes heartPop {
            0% { transform: scale(1); }
            35% { transform: scale(1.35); }
            100% { transform: scale(1); }
        }
        .share-btn {
            width: 36px; height: 36px; border-radius: 50%;
            border: none; cursor: pointer;
            background: rgba(0,0,0,0.30);
            backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
            display: flex; align-items: center; justify-content: center;
            color: #fff; flex-shrink: 0;
        }
        .share-btn svg { width: 18px; height: 18px; fill: none; stroke: #fff; }
        .share-btn .share-check {
            display: none; color: var(--orange); fill: none; stroke: var(--orange);
        }
        .share-btn.copied svg:first-child { display: none; }
        .share-btn.copied .share-check { display: block; }

        /* Bouton "Sources" + pastille qui se déroule vers la gauche */
        .sources-btn-wrap { position: relative; display: flex; align-items: center; }
        .sources-btn {
            background: none; border: none;
            transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
        }
        .sources-btn svg { width: 30px; height: 30px; fill: none; stroke: #fff; }
        .debat-btn { background: none; border: none; }
        .debat-btn svg { width: 28px; height: 28px; fill: none; stroke: #fff; filter: drop-shadow(0 1px 4px rgba(0,0,0,0.5)); }

        .likes-filtre-bar { display: flex; gap: 8px; padding: 14px 18px 4px; }
        .likes-filtre-btn {
            padding: 6px 14px; border-radius: 100px; border: none;
            background: var(--bg); color: var(--muted);
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 12.5px; font-weight: 400;
            cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
        }
        .likes-filtre-btn.active { background: var(--orange); color: #1a1a1a; }
        .likes-item {
            margin: 8px 18px; padding: 16px 16px; border-radius: 16px;
            background: var(--card); border: 1px solid var(--sep);
            cursor: pointer;
        }
        .likes-item span { font-size: 14px; font-weight: 400; color: var(--text); line-height: 1.35; }
        .sources-btn.open {
            transform: rotate(180deg);
        }
        .sources-btn.open svg { stroke: var(--orange); }
        .sources-pill {
            position: absolute; right: 100%; top: 50%; transform: translateY(-50%);
            margin-right: 0;
            display: flex; align-items: center; gap: 8px;
            background: rgba(0,0,0,0.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
            border: 1px solid rgba(255,255,255,0.16);
            border-radius: 20px;
            padding: 8px 0; max-width: 0; overflow: hidden; white-space: nowrap;
            opacity: 0;
            transition: max-width 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.35s cubic-bezier(0.4,0,0.2,1), padding 0.35s cubic-bezier(0.4,0,0.2,1), margin-right 0.35s cubic-bezier(0.4,0,0.2,1), background 0.35s cubic-bezier(0.4,0,0.2,1);
        }
        .sources-pill.open {
            max-width: 220px; opacity: 1; padding: 8px 14px; margin-right: 10px;
            background: var(--orange);
        }
        .sources-pill span { color: #1a1a1a; font-size: 12px; font-weight: 700; flex-shrink: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
        .sources-pill .source-icon { flex-shrink: 0; margin-left: 0; }

        /* ── ANIMATION CŒUR DOUBLE-TAP ── */
        .doubletap-heart {
            position: fixed;
            pointer-events: none;
            z-index: 9999;
            width: 72px;
            height: 72px;
            transform: translate(-50%, -50%) scale(0);
            animation: dtHeartAnim 0.60s cubic-bezier(0.32, 0.72, 0, 1) forwards;
        }
        @keyframes dtHeartAnim {
            0%   { transform: translate(-50%, -50%) scale(0) rotate(-15deg); opacity: 1; }
            15%  { transform: translate(-50%, -50%) scale(1.3) rotate(8deg);  opacity: 1; }
            30%  { transform: translate(-50%, -50%) scale(1.0) rotate(-4deg); opacity: 1; }
            50%  { transform: translate(-50%, -50%) scale(1.1) rotate(0deg);  opacity: 1; }
            75%  { transform: translate(-50%, -50%) scale(1.0) rotate(0deg);  opacity: 0.7; }
            100% { transform: translate(-50%, -50%) scale(0.8) rotate(0deg);  opacity: 0; }
        }


        /* Barre de progression en haut (fine ligne) */
        .tiktok-progress {
            display: none; /* dots de pagination masqués (non désirés) */
            gap: 3px; margin-bottom: 0; flex: 1; max-width: 160px;
        }
        .tiktok-dot {
            flex: 1; height: 2px; border-radius: 2px;
            background: rgba(0,0,0,0.15); transition: background 0.3s;
        }
        body:not(.day) .tiktok-dot { background: rgba(255,255,255,0.15); }
        .tiktok-dot.active { background: #111; }
        body:not(.day) .tiktok-dot.active { background: #f0f0f0; }

        /* L'ancien conteneur fixe est désormais caché — les boutons sont dans chaque slide */
        #tiktokActions { display: none !important; }

        /* SKELETON LOADER */
        @keyframes shimmer {
            0% { background-position: -400px 0; }
            100% { background-position: 400px 0; }
        }
        .skeleton {
            border-radius: 10px;
            background: linear-gradient(90deg, var(--sep) 25%, rgba(255,255,255,0.06) 50%, var(--sep) 75%);
            background-size: 800px 100%;
            animation: shimmer 1.4s infinite linear;
        }
        body.day .skeleton {
            background: linear-gradient(90deg, #e8e8e2 25%, #f3f3ee 50%, #e8e8e2 75%);
            background-size: 800px 100%;
            animation: shimmer 1.4s infinite linear;
        }
        .skeleton-card { background: var(--card); border-radius: 20px; padding: 22px; border: 1px solid var(--sep); display: flex; flex-direction: column; gap: 12px; }
        .skeleton-line { height: 14px; }
        .skeleton-title { height: 28px; width: 70%; }
        .skeleton-badge { height: 22px; width: 80px; border-radius: 20px; }

        /* SCROLL HINT (indicateur de scroll dans le lecteur article) */
        .scroll-hint {
            position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
            display: flex; flex-direction: column; align-items: center; gap: 4px;
            opacity: 1; transition: opacity 0.4s;
            pointer-events: none;
        }
        .scroll-hint.hidden { opacity: 0; }
        .scroll-hint-arrow {
            width: 28px; height: 28px; border-radius: 50%;
            background: rgba(0,0,0,0.07); display: flex; align-items: center; justify-content: center;
            animation: bounceDown 1.6s ease-in-out infinite;
        }
        body:not(.day) .scroll-hint-arrow { background: rgba(255,255,255,0.1); }
        .scroll-hint-arrow svg { color: #555; }
        body:not(.day) .scroll-hint-arrow svg { color: #aaa; }
        .scroll-hint-label { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: #888; }
        @keyframes bounceDown {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(5px); }
        }

        /* SWIPE DOWN INDICATOR (poignée en haut du modal article) */
        .drag-handle {
            width: 36px; height: 4px; border-radius: 2px;
            background: rgba(0,0,0,0.15); margin: 10px auto 0;
            flex-shrink: 0;
        }
        body:not(.day) .drag-handle { background: rgba(255,255,255,0.2); }



        .empty { text-align: center; color: var(--muted); font-size: 14px; margin-top: 40px; }
        #splash {
            position: fixed; inset: 0; background: var(--bg); z-index: 99999;
            display: flex; align-items: center; justify-content: center;
            pointer-events: none;
        }
        #splash-logo {
            width: 100px; height: 100px; border-radius: 25px; object-fit: cover;
            animation: logoPop 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.2s both;
            box-shadow: 0 8px 30px rgba(0,0,0,0.35), 0 20px 60px rgba(0,0,0,0.2), 0 2px 8px rgba(0,0,0,0.4);
        }
        @keyframes logoPop {
            0% { opacity: 0; transform: translateY(40px) scale(0.7); }
            100% { opacity: 1; transform: translateY(0) scale(1); }
        }
        #splash.fade-out {
            animation: splashOut 0.5s ease forwards;
        }
        @keyframes splashOut {
            0% { opacity: 1; }
            100% { opacity: 0; visibility: hidden; }
        }

        /* PAGES WRAPPER */
        #pages-wrapper { display: block; }
        .page { display: none; min-height: 100vh; }
        .page.active-page { display: block; }
        #page-home { position: relative; overflow: hidden; }
        body { overflow-x: hidden; }

        /* TAB BAR FLOTTANTE — liquid glass */
        #tab-bar {
            position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
            z-index: 1000;
            background: rgba(255,255,255,0.22);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border-radius: 32px;
            padding: 4px 7px;
            display: flex; align-items: center; justify-content: space-around;
            gap: 0;
            border: 1px solid rgba(255,255,255,0.18);
            box-shadow:
                0 8px 32px rgba(0,0,0,0.28),
                0 1px 4px rgba(0,0,0,0.15);
            transition: background 0.3s, transform 0.35s cubic-bezier(0.25,1.1,0.5,1), padding 0.35s cubic-bezier(0.25,1.1,0.5,1);
            min-width: 150px;
            position: fixed;
            transform-origin: bottom center;
        }
        body.day #tab-bar {
            background: rgba(255,255,255,0.22);
            border: 1px solid rgba(0,0,0,0.1);
            box-shadow:
                0 6px 24px rgba(0,0,0,0.07),
                0 1px 3px rgba(0,0,0,0.05);
        }

        /* Blob indicator — glisse doucement, rebond léger */
        #tab-indicator {
            position: absolute;
            top: 4px; height: calc(100% - 8px);
            background: rgba(255,255,255,0.16);
            border-radius: 24px;
            pointer-events: none;
            transition:
                left 0.32s cubic-bezier(0.25,1.1,0.5,1),
                width 0.32s cubic-bezier(0.25,1.1,0.5,1);
            will-change: left, width;
        }
        body.day #tab-indicator { background: rgba(0,0,0,0.08); }

        /* Chaque onglet */
        .tab-item {
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            cursor: pointer; position: relative;
            padding: 3px 21px; border-radius: 21px;
            transition: padding 0.35s cubic-bezier(0.25,1.1,0.5,1);
            gap: 2px;
            -webkit-tap-highlight-color: transparent;
            min-width: 60px;
            background: transparent !important;
        }
        #tab-bar.shrunk .tab-item {
            padding: 3px 16px;
        }

        /* Icône wrapper — pas de scale, juste fill/outline */
        .tab-icon-wrap {
            display: flex; align-items: center; justify-content: center;
        }

        /* Icône outline par défaut, filled quand active */
        .tab-icon {
            display: flex; align-items: center;
            color: rgba(255,255,255,0.92);
            transition: color 0.2s ease;
        }
        /* SVG inactif : outline */
        .tab-icon svg {
            fill: none;
            transition: fill 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease;
        }
        body.day .tab-icon { color: rgba(0,0,0,0.75); }

        /* SVG actif : filled orange */
        .tab-item.active .tab-icon { color: var(--orange); }
        .tab-item.active .tab-icon svg {
            fill: var(--orange);
            stroke: var(--orange);
            stroke-width: 0;
        }
        /* Home spécifique (viewBox 100x100) */
        #tab-home.active .tab-icon svg {
            fill: var(--orange);
            stroke: var(--orange);
            stroke-width: 0 !important;
        }

        /* Label */
        .tab-label {
            font-size: 10px; font-weight: 500;
            color: rgba(255,255,255,0.92);
            letter-spacing: 0.3px;
            transition: color 0.2s;
            opacity: 0.8;
        }
        body.day .tab-label { color: rgba(0,0,0,0.75); }
        .tab-item.active .tab-label { color: var(--orange); opacity: 1; }

        /* Tap : micro feedback subtil, un seul rebond très atténué */
        @keyframes tabIconTap {
            0%   { transform: scale(1); }
            45%  { transform: scale(0.93); }
            100% { transform: scale(1); }
        }
        .tab-icon-wrap.tab-tapped {
            animation: tabIconTap 0.22s ease-out forwards;
        }

        .tab-bubble { display: none; }

        /* PAGE BIENTÔT DISPONIBLE */
        .coming-soon {
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            min-height: 70vh; gap: 16px; padding: 40px 20px 110px; text-align: center;
        }
        .coming-soon .cs-icon {
            font-size: 48px; animation: float 3s ease-in-out infinite;
        }
        @keyframes float {
            0%,100% { transform: translateY(0); }
            50% { transform: translateY(-8px); }
        }
        .coming-soon h2 {
            font-size: 22px; font-weight: 800; color: var(--text);
        }
        .coming-soon p {
            font-size: 14px; color: var(--muted); max-width: 240px; line-height: 1.6;
        }

        /* PAGE DÉBATS */
        .debat-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); padding-left: 4px; margin-bottom: 10px; }
        .debat-pop-scroll {
            display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none;
            padding-bottom: 4px; margin: 0 -16px; padding-left: 16px; padding-right: 16px;
        }
        .debat-pop-scroll::-webkit-scrollbar { display: none; }
        .debat-card {
            position: relative; flex-shrink: 0;
            width: 180px; height: 220px; border-radius: 16px;
            background-color: var(--card); background-size: cover; background-position: center;
            cursor: pointer; overflow: hidden;
        }
        .debat-card::before {
            content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0.38);
        }
        .debat-card-overlay {
            position: absolute; left: 0; right: 0; bottom: 0; padding: 12px;
            background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.55) 60%, transparent 100%);
        }
        .debat-card-titre {
            font-size: 13.5px; font-weight: 800; color: #fff; line-height: 1.3;
            display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
        }
        .debat-card-meta { font-size: 11px; color: rgba(255,255,255,0.7); margin-top: 6px; }
        .debat-pastille {
            display: inline-block; background: var(--orange-gradient); color: #1a1a1a;
            font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;
            padding: 3px 9px; border-radius: 20px; margin-bottom: 8px;
        }
        .debat-recents-list { display: flex; flex-direction: column; gap: 14px; }
        .debat-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
        .debat-row-thumb {
            width: 64px; height: 64px; border-radius: 12px; flex-shrink: 0;
            background-color: var(--card); background-size: cover; background-position: center;
        }
        .debat-row-titre {
            font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3;
            display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
        }
        .debat-row-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

        /* Avatar au bas de chaque message de discussion */
        .message-avatar {
            width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
            background: var(--orange); color: #000; font-size: 12px; font-weight: 800;
            display: flex; align-items: center; justify-content: center;
            cursor: pointer;
        }
        /* Stats dans le popup profil sommaire (clic sur un avatar) */
        .profil-message-stat {
            display: flex; align-items: center; gap: 5px;
            color: var(--text); font-size: 13px; font-weight: 700;
        }
        .profil-message-stat svg { color: var(--orange); }
        #profilMessageCouronne svg { color: var(--muted); }
        #profilMessageCouronne.actif svg { color: var(--orange); }

        /* PAGE PROFIL */
        .profil-page { padding: 18px 16px 110px; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
        .profil-header { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 6px 4px 4px; background: transparent; border-radius: 0; border: none; box-shadow: none; }
        .profil-avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--orange); display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; color: #000; flex-shrink: 0; }
        .profil-name { font-size: 18px; font-weight: 800; }
        .profil-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
        .pseudo-edit-btn { background: none; border: none; padding: 3px; color: var(--muted); cursor: pointer; display: flex; align-items: center; opacity: 0.7; }
        .pseudo-edit-btn:hover { opacity: 1; color: var(--orange-muted); }
        .profil-chips-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
        .profil-chip {
            display: inline-flex; align-items: center; gap: 7px;
            padding: 10px 17px; border-radius: 22px;
            background: var(--card); font-size: 15px; font-weight: 700; color: var(--text);
            cursor: pointer;
        }
        .profil-chip svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--orange-muted); }
        #streak-display.profil-chip svg { color: var(--orange); }
        .profil-chip-premium { background: #1a1a1a; color: rgba(255,255,255,0.35); font-size: 14px; }
        .profil-chip-premium svg { color: rgba(255,255,255,0.3); }
        .profil-chip-premium.active { color: #fff; }
        .profil-chip-premium.active svg { color: var(--orange); }
        /* Mode jour : même traitement que les autres chips (le fond noir dur jurait
           au milieu des chips claires) */
        body.day .profil-chip-premium { background: var(--card); color: rgba(0,0,0,0.4); }
        body.day .profil-chip-premium svg { color: rgba(0,0,0,0.35); }
        body.day .profil-chip-premium.active { color: #111; }
        body.day .profil-chip-premium.active svg { color: var(--orange); }
        .profil-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); padding-left: 4px; }
        .profil-card { background: var(--card); border-radius: 14px; border: none; overflow: hidden; box-shadow: none; }
        .profil-row { display: flex; align-items: center; padding: 14px 16px; gap: 10px; border-bottom: 1px solid var(--sep); }
        .profil-row:last-child { border-bottom: none; }
        .profil-row-icon { width: 20px; height: 20px; border-radius: 7px; background: transparent; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .profil-row-icon svg { color: var(--orange-muted); width: 20px; height: 20px; }
        .profil-row-label { flex: 1; font-size: 15px; font-weight: 500; }
        .profil-row-sub { display: none; }

        /* ── MODE NUIT : profil plus sombre & contrasté (style maquette) ──
           Cartes plus profondes que le fond, séparateurs plus discrets, icônes
           plus douces. N'affecte QUE le mode nuit (body:not(.day)). */
        body:not(.day) .profil-row {
            border-bottom-color: rgba(255,255,255,0.06);
        }

        /* TOGGLE SWITCH */
        .toggle-switch {
            position: relative; width: 48px; height: 26px; cursor: pointer; flex-shrink: 0;
        }
        .toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
        .toggle-track {
            position: absolute; inset: 0; border-radius: 11px;
            background: var(--sep); transition: background 0.3s;
        }
        .toggle-switch input:checked + .toggle-track { background: var(--orange); }
        .toggle-thumb {
            position: absolute; top: 3px; left: 3px;
            width: 20px; height: 20px; border-radius: 50%;
            background: #fff; transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
            box-shadow: 0 1px 4px rgba(0,0,0,0.3);
        }
        .toggle-switch input:checked ~ .toggle-thumb { transform: translateX(22px); }


        /* PULL TO REFRESH */
        .ptr-indicator {
            position: absolute; top: -50px; left: 50%; transform: translateX(-50%);
            width: 36px; height: 36px; border-radius: 50%;
            background: var(--card); border: 1px solid var(--sep);
            display: flex; align-items: center; justify-content: center;
            box-shadow: 0 4px 14px rgba(0,0,0,0.15);
            transition: opacity 0.2s;
            pointer-events: none; z-index: 50;
        }
        .ptr-indicator svg { color: var(--orange-muted); transition: transform 0.3s; }
        @keyframes ptrSpin { to { transform: rotate(360deg); } }
        .ptr-indicator.spinning svg { animation: ptrSpin 0.6s linear infinite; }

        /* ── PAGE RECHERCHE ── */
        .search-page { display: flex; flex-direction: column; height: 100vh; }
        .search-header { padding: 14px 16px; border-bottom: 1px solid var(--sep); background: var(--bg); position: sticky; top: 0; z-index: 10; }
        body.day .search-header { background: var(--bg); }
        .search-input-wrap {
            display: flex; align-items: center; gap: 10px;
            background: var(--card); border-radius: 10px;
            padding: 10px 14px; border: 1px solid var(--sep);
        }
        .search-input-wrap svg { color: var(--muted); flex-shrink: 0; }
        #searchInput {
            flex: 1; min-width: 0; background: none; border: none; outline: none;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 16px; color: var(--text);
        }
        #searchInput::placeholder { color: var(--muted); }
        #searchClear {
            background: none; border: none; color: var(--muted); cursor: pointer;
            padding: 2px; display: none; align-items: center; justify-content: center;
        }
        #searchClear.visible { display: flex; }
        .search-body { flex: 1; overflow-y: auto; padding: 16px 16px 110px; }

        /* Historique */
        .history-section { margin-bottom: 20px; }
        .history-title {
            font-size: 11px; font-weight: 700; text-transform: uppercase;
            letter-spacing: 0.8px; color: var(--muted); margin-bottom: 10px; padding-left: 2px;
        }
        .history-item {
            display: flex; align-items: center; gap: 10px;
            padding: 11px 14px; background: var(--card);
            border-radius: 10px; border: 1px solid var(--sep);
            margin-bottom: 6px; cursor: pointer;
            transition: opacity 0.15s;
        }
        .history-item:active { opacity: 0.7; }
        .history-item svg { color: var(--muted); flex-shrink: 0; }
        .history-item-text { flex: 1; font-size: 14px; }
        .history-delete {
            background: none; border: none; color: var(--muted);
            cursor: pointer; padding: 4px; display: flex; align-items: center;
            border-radius: 50%;
        }
        .history-delete:active { background: rgba(0,0,0,0.08); }

        /* Résultats */
        .results-section {}
        .results-group-title {
            font-size: 11px; font-weight: 700; text-transform: uppercase;
            letter-spacing: 0.8px; color: var(--muted); margin: 16px 0 8px; padding-left: 2px;
        }
        .result-keyword {
            display: flex; align-items: center; gap: 12px;
            padding: 13px 16px; background: var(--card);
            border-radius: 10px; border: 1px solid var(--sep);
            margin-bottom: 6px; cursor: pointer;
            transition: border-color 0.2s, transform 0.15s;
        }
        .result-keyword:active { transform: scale(0.98); }
        .result-keyword-icon {
            width: 34px; height: 34px; border-radius: 8px;
            background: rgba(232,132,42,0.12);
            display: flex; align-items: center; justify-content: center; flex-shrink: 0;
        }
        .result-keyword-icon svg { color: var(--orange-muted); }
        .result-keyword-word { font-size: 14px; font-weight: 700; }
        .result-keyword-def { font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
        .result-article {
            background: var(--card); border-radius: 10px;
            border: 1px solid var(--sep); margin-bottom: 8px;
            cursor: pointer; overflow: hidden;
            transition: border-color 0.2s, transform 0.15s;
        }
        .result-article:active { transform: scale(0.98); }
        .result-article-inner { padding: 14px 16px; }
        .result-article-date { font-size: 11px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
        .result-article-excerpt { font-size: 13px; line-height: 1.55; color: var(--text); }
        /* Surligné dans l'article */
        mark {
            background: rgba(232,132,42,0.28); color: inherit;
            border-radius: 3px; padding: 0 2px;
        }
        .no-results {
            text-align: center; color: var(--muted); font-size: 14px;
            margin-top: 40px; line-height: 1.6;
        }
        .no-results span { display: block; font-size: 32px; margin-bottom: 10px; }

        /* ── ÉCRAN AUTH ── */
        #authScreen {
            position: fixed; inset: 0; z-index: 999999;
            background: var(--bg);
            display: flex; flex-direction: column;
            align-items: center; justify-content: center;
            padding: 32px 28px;
            gap: 0;
        }
        #authScreen.hidden { display: none; }
        .auth-logo {
            width: 80px; height: 80px; border-radius: 20px; object-fit: cover;
            margin-bottom: 28px;
            box-shadow: 0 8px 30px rgba(0,0,0,0.25);
        }
        .auth-title {
            font-size: 26px; font-weight: 800; letter-spacing: 1px;
            margin-bottom: 6px; color: var(--text);
        }
        .auth-sub {
            font-size: 14px; color: var(--muted); text-align: center;
            line-height: 1.5; margin-bottom: 36px; max-width: 260px;
        }
        .auth-input-wrap {
            width: 100%; max-width: 340px;
            background: var(--card); border: 1px solid var(--sep);
            border-radius: 12px; padding: 14px 16px;
            display: flex; align-items: center; gap: 10px;
            transition: border-color 0.2s; margin-bottom: 12px;
        }
        .auth-input-wrap:focus-within { border-color: var(--orange); }
        .auth-input-wrap svg { color: var(--muted); flex-shrink: 0; }
        .eye-toggle {
            background: none; border: none; padding: 0; margin: 0;
            cursor: pointer; color: var(--muted); flex-shrink: 0;
            display: flex; align-items: center; transition: color 0.2s;
        }
        .eye-toggle:hover { color: var(--orange-muted); }
        /* Tous les inputs auth (login, reset, nouveau mot de passe) — 16px minimum
           pour éviter le zoom automatique d'iOS au focus */
        .auth-input-wrap input {
            flex: 1; min-width: 0; background: none; border: none; outline: none;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 16px; color: var(--text);
        }
        .auth-input-wrap input::placeholder { color: var(--muted); }
        .auth-toggle-link {
            margin-top: 18px; font-size: 13px; color: var(--muted);
            text-align: center;
        }
        .auth-toggle-link span {
            color: var(--orange); font-weight: 700; cursor: pointer;
            text-decoration: underline; text-underline-offset: 3px;
        }
        /* AUTH MODE TOGGLE */
        .auth-mode-toggle {
            display: flex; width: 100%; max-width: 340px;
            background: var(--card); border-radius: 12px;
            padding: 4px; gap: 4px;
            margin-bottom: 20px;
            border: 1px solid var(--sep);
        }
        .auth-mode-btn {
            flex: 1; padding: 10px 0;
            border: none; border-radius: 9px;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            font-size: 14px; font-weight: 700;
            cursor: pointer;
            transition: background 0.2s, color 0.2s;
            background: transparent; color: var(--muted);
        }
        .auth-mode-btn.active {
            background: var(--orange-gradient); color: #1a1a1a;
        }
        .auth-mode-btn:not(.active) {
            background: transparent; color: var(--orange);
        }

        .auth-forgot {
            width: 100%; max-width: 340px; text-align: right;
            margin-top: -4px; margin-bottom: 16px;
        }
        .auth-forgot span {
            font-size: 12px; color: var(--muted); cursor: pointer;
            text-decoration: underline; text-underline-offset: 3px;
            transition: color 0.2s;
        }
        .auth-forgot span:hover { color: var(--orange-muted); }
        .auth-btn {
            width: 100%; max-width: 340px;
            background: var(--orange-gradient); color: #1a1a1a;
            border: none; border-radius: 14px;
            padding: 15px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            font-size: 15px; font-weight: 800; cursor: pointer;
            transition: opacity 0.2s, transform 0.15s;
            margin-bottom: 0;
        }
        .auth-btn:active { transform: scale(0.97); opacity: 0.85; }
        .auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .auth-msg {
            margin-top: 16px; font-size: 13px; text-align: center;
            color: var(--muted); line-height: 1.5; max-width: 300px;
            min-height: 40px;
        }
        .auth-msg.success { color: #4caf50; }
        .auth-msg.error { color: #f44336; }

        /* ── MEDIA SLOT ── */
        .auth-sub { font-size: 14px; color: var(--muted); text-align: center; line-height: 1.6; margin-bottom: 2px; max-width: 260px; }
        .media-slot-container { height: 30px; overflow: hidden; display: flex; justify-content: center; margin-top: 0; margin-bottom: 28px; }
        .media-slot-inner { display: flex; flex-direction: column; }
        .media-slot-item { height: 30px; display: flex; align-items: center; justify-content: center; gap: 6px; flex-shrink: 0; }
        .media-slot-item img { width: 16px; height: 16px; border-radius: 50%; object-fit: contain; }
        .media-slot-item strong { font-size: 16px; font-weight: 800; color: var(--text); white-space: nowrap; }

        /* MOTS RÉCENTS */
        .mots-recents-section { display: flex; flex-direction: column; gap: 10px; }
        .mots-recents-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); padding-left: 4px; }
        .mots-recents-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
        .mots-recents-scroll::-webkit-scrollbar { display: none; }
        .mot-pill { flex-shrink: 0; background: transparent; border: 1.5px solid #555; color: var(--text); border-radius: 17px; padding: 6px 14px; font-size: 13px; font-weight: 600; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; cursor: pointer; transition: border-color 0.2s, background 0.2s; white-space: nowrap; }
        .mot-pill:active { background: rgba(232,132,42,0.12); border-color: var(--orange-muted); }

        /* Lien déconnexion dans profil */
        .logout-btn {
            width: 100%; background: none; border: none;
            color: #f44336; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            font-size: 15px; font-weight: 500; cursor: pointer;
            padding: 16px 18px; text-align: left; display: flex;
            align-items: center; gap: 10px;
        }
        .logout-btn svg { color: #f44336; }

        /* ── NOTIFICATIONS: animations & interactions ── */
        @keyframes fadeInBg {
            0% { opacity: 0; }
            100% { opacity: 1; }
        }
        @keyframes fadeOutBg {
            0% { opacity: 1; }
            100% { opacity: 0; }
        }
        @keyframes slideUpPopup {
            0% { transform: translateY(100%); opacity: 0; }
            100% { transform: translateY(0); opacity: 1; }
        }
        @keyframes slideDownPopup {
            0% { transform: translateY(0); opacity: 1; }
            100% { transform: translateY(100%); opacity: 0; }
        }
        @keyframes slideInRight {
            0% { transform: translateX(100%); opacity: 0; }
            100% { transform: translateX(0); opacity: 1; }
        }
        @keyframes slideOutRight {
            0% { transform: translateX(0); opacity: 1; }
            100% { transform: translateX(100%); opacity: 0; }
        }
        .notif-item {
            cursor: pointer; -webkit-tap-highlight-color: transparent;
            transition: background 0.15s ease;
        }
        .notif-item:active { background: rgba(255,255,255,0.04); }
        body.day .notif-item:active { background: rgba(0,0,0,0.03); }
        .notif-detail-handle {
            width: 36px; height: 4px; border-radius: 2px;
            background: rgba(255,255,255,0.2); margin: 10px auto 4px;
            flex-shrink: 0;
        }
        body.day .notif-detail-handle { background: rgba(0,0,0,0.15); }

        /* ══════════ PAGE INTÉRÊTS ══════════ */
        #page-interets { position: relative; min-height: 100vh; }

        /* ── Panneau de sélection des sujets ── */
        #interets-select-panel {
            display: flex; flex-direction: column;
            min-height: 100vh;
            padding: max(28px, env(safe-area-inset-top)) 20px calc(180px + env(safe-area-inset-bottom));
        }
        .interets-select-header { margin-bottom: 24px; }
        .interets-select-title {
            font-size: 26px; font-weight: 800; letter-spacing: -0.01em;
            color: var(--text); margin-bottom: 8px;
        }
        .interets-select-sub {
            font-size: 14px; line-height: 1.5; color: var(--muted);
        }
        .interets-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
            align-content: start;
        }
        .interet-card {
            display: flex; flex-direction: row; align-items: center; justify-content: flex-start;
            gap: 10px;
            min-height: 56px;
            padding: 12px 14px;
            border-radius: 14px;
            background: var(--card);
            border: 1.5px solid var(--sep);
            cursor: pointer;
            transition: border-color 0.18s ease, background 0.18s ease, transform 0.15s ease;
            -webkit-tap-highlight-color: transparent;
        }
        .interet-card:active { transform: scale(0.97); }
        .interet-card .interet-emoji { font-size: 22px; line-height: 1; }
        .interet-card .interet-name {
            font-size: 14px; font-weight: 500; color: var(--text); letter-spacing: 0.1px;
        }
        .interet-card.selected {
            border-color: var(--orange);
            background: rgba(232,132,42,0.10);
        }
        .interet-card.selected .interet-name { color: var(--orange); }

        .interets-confirm-btn {
            position: fixed;
            left: 20px; right: 20px;
            bottom: calc(96px + env(safe-area-inset-bottom));
            z-index: 60;
            width: auto;
            padding: 15px 0;
            border: none; border-radius: 14px;
            background: var(--orange-gradient);
            color: #1a1a1a;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            font-size: 15px; font-weight: 800; letter-spacing: 0.2px;
            cursor: pointer;
            box-shadow: none;
            transition: opacity 0.2s ease, transform 0.15s ease;
        }
        .interets-confirm-btn:active { transform: scale(0.98); }
        .interets-confirm-btn:disabled {
            opacity: 0.35; cursor: default;
        }

        /* ── Feed plein écran type TikTok ── */
        #interets-feed {
            position: fixed; inset: 0; z-index: 10;
            background: var(--bg);
            display: none; flex-direction: column;
            overflow: hidden;
        }
        .page#page-interets.active-page #interets-feed.visible { display: flex; }

        #interets-feed-header {
            position: absolute; top: 0; right: 0; z-index: 20;
            padding: max(16px, env(safe-area-inset-top)) 16px 12px;
            display: flex; align-items: center; gap: 10px;
        }
        #interets-settings-btn {
            width: 36px; height: 36px; border-radius: 50%;
            border: none; cursor: pointer;
            background: rgba(0,0,0,0.30);
            backdrop-filter: blur(10px);
            display: flex; align-items: center; justify-content: center;
            color: #fff;
        }

        #interets-slides {
            flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
            scroll-snap-type: y mandatory;
            -webkit-overflow-scrolling: touch;
        }
        #interets-slides::-webkit-scrollbar { display: none; }

        .interet-slide {
            min-height: 100vh;
            min-height: 100dvh;
            padding: calc(48svh * 0.72) 0 130px;
            border-bottom: 1px solid rgba(0,0,0,0.08);
            display: flex; flex-direction: column;
            scroll-snap-align: start;
            scroll-snap-stop: always;
            position: relative;
            overflow: hidden;
        }
        body:not(.day) .interet-slide { border-bottom-color: rgba(255,255,255,0.07); }
        .interet-slide:last-child { border-bottom: none; }

        /* Badge catégorie — pill orange */
        .interet-category {
            position: relative; z-index: 2;
            display: inline-block; align-self: flex-start;
            font-size: 12px; font-weight: 800; text-transform: uppercase;
            letter-spacing: 1px; color: #1a1a1a;
            background: var(--orange-gradient);
            padding: 6px 14px; border-radius: 20px;
            margin: 0 24px 14px;
        }
        /* Même principe que .tiktok-headline : hauteur réservée fixe + ancrage bas,
           pour que la barre orange reste toujours à la même hauteur. */
        .interet-headline {
            position: relative; z-index: 2;
            font-size: clamp(25px, 7.2vw, 38px);
            font-weight: 800;
            line-height: 1.1;
            letter-spacing: -0.02em;
            color: #fff;
            padding: 0 24px;
            margin-bottom: 22px;
            text-transform: none;
            text-shadow: 0 2px 14px rgba(0,0,0,0.6);
            /* Titre ancré en haut + hauteur réservée fixe (voir .tiktok-headline). */
            min-height: 3.3em; /* 3 lignes × line-height 1.1 */
        }
        .interet-divider {
            position: relative; z-index: 2;
            height: 3px; width: 40px;
            background: var(--orange);
            border-radius: 2px;
            margin: 0 24px 22px;
        }
        .interet-body {
            position: relative; z-index: 2;
            font-size: 14.5px;
            line-height: 1.7;
            color: var(--text);
            padding: 0 64px 0 24px;
            flex: 1;
        }
        .interet-article-img {
            position: absolute;
            top: 0; left: 0;
            width: 100%;
            height: 48svh;
            object-fit: cover;
            border-radius: 0;
            margin: 0;
            display: block;
            opacity: 1;
            z-index: 0;
            -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, #000 30%, #000 55%, transparent 100%);
            mask-image: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, #000 30%, #000 55%, transparent 100%);
        }

        .interet-feed-loader {
            display: flex; align-items: center; justify-content: center;
            min-height: 30vh;
            color: var(--muted);
            font-size: 13px;
        }