        :root {
            --bg: #161616; --card: #313131; --text: rgba(255,255,255,0.87); --muted: rgba(255,255,255,0.60);
            --orange: #ff8c00; --yellow: #ffd700; --sep: #444;
            --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; }
        body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); padding-bottom: 40px; overflow-x: hidden; transition: background 0.3s, color 0.3s; }

        /* 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); }
        .logo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
        .header-name { font-size: 17px; 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: 0 4px 16px rgba(0,0,0,0.35);
            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 */
        }
        .latest-edition-bg {
            position: absolute; inset: 0; border-radius: 20px;
            pointer-events: none; z-index: 0; overflow: hidden;
        }
        .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;
        }
        .bg-layer {
            position: absolute; inset: 0; border-radius: 20px;
            background-size: cover; background-position: center;
            opacity: 0; transition: opacity 0.55s ease;
        }
        .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); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
        .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 8px rgba(0,0,0,0.6), 0 1px 3px rgba(0,0,0,0.8); }
        .latest-edition.has-image .latest-date { color: rgba(255,255,255,0.7); }
        .latest-edition.has-image .latest-badge { background: rgba(255,140,0,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: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); padding-left: 4px; }
        .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: 0; 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: 0 2px 10px rgba(0,0,0,0.28);
            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;
        }
        .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); 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); 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: absolute; 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: 1px solid rgba(255,215,0,0.4); 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: 6000;
            background: var(--bg);
            display: none; flex-direction: column;
            transform-origin: top left;
            will-change: transform, border-radius, opacity;
        }
        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;
        }
        #tiktok-slides::-webkit-scrollbar { display: none; }

        /* Chaque slide = un article pleine page, snappée */
        .tiktok-slide {
            min-height: 100vh;
            padding: max(80px, calc(env(safe-area-inset-top) + 64px)) 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;
        }
        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 */
        .tiktok-category {
            font-size: 12px; font-weight: 800; text-transform: uppercase;
            letter-spacing: 1.2px; color: var(--orange);
            padding: 0 24px; margin-bottom: 14px;
        }

        /* Grand titre éditorial */
        .tiktok-headline {
            font-size: clamp(28px, 8vw, 42px);
            font-weight: 800;
            line-height: 1.1;
            letter-spacing: -0.02em;
            color: var(--text);
            padding: 0 24px;
            margin-bottom: 22px;
            text-transform: uppercase;
        }

        .tiktok-divider {
            height: 1px;
            background: var(--sep);
            margin: 0 24px 22px;
        }
        .tiktok-body {
            font-size: 16px;
            line-height: 1.72;
            color: var(--text);
            padding: 0 24px;
            flex: 1;
        }

        .tiktok-article-img {
            width: calc(100% - 48px);
            margin: 20px 24px 0;
            height: 180px;
            object-fit: cover;
            border-radius: 12px;
            display: block;
            opacity: 0.9;
        }

        /* 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: #fff; 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 svg { fill: #fff; 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; }

        /* ── 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: flex; 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.06);
            backdrop-filter: blur(40px) saturate(180%) brightness(1.1);
            -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(1.1);
            border-radius: 32px;
            padding: 7px 7px;
            display: flex; align-items: center; justify-content: space-around;
            gap: 0;
            border: 0.5px 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),
                inset 0 0.5px 0 rgba(255,255,255,0.20);
            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.28);
            border-color: rgba(255,255,255,0.55);
            box-shadow:
                0 6px 24px rgba(0,0,0,0.07),
                0 1px 3px rgba(0,0,0,0.05),
                inset 0 0.5px 0 rgba(255,255,255,0.90);
        }

        /* Blob indicator — glisse doucement, rebond léger */
        #tab-indicator {
            position: absolute;
            top: 7px; height: calc(100% - 14px);
            background: rgba(255,140,0,0.11);
            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(255,140,0,0.09); }

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

        /* 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: 700;
            color: rgba(255,255,255,0.35);
            letter-spacing: 0.3px;
            transition: color 0.2s;
            opacity: 0.8;
        }
        body.day .tab-label { color: rgba(0,0,0,0.3); }
        .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 PROFIL */
        .profil-page { padding: 18px 16px 110px; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
        .profil-header { display: flex; align-items: center; gap: 14px; padding: 20px; background: var(--card); border-radius: 17px; border: none; box-shadow: 0 2px 10px rgba(0,0,0,0.28); }
        .profil-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--orange); display: flex; align-items: center; justify-content: center; font-size: 24px; 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; }
        .profil-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); padding-left: 4px; }
        .streak-card {
            background: var(--card); border-radius: 14px; padding: 14px 16px;
            font-size: 14px; font-weight: 600; color: var(--text);
            display: flex; align-items: center; gap: 6px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.18);
        }
        .streak-record { font-weight: 500; color: var(--muted); font-size: 12px; }
        .profil-card { background: var(--card); border-radius: 14px; border: none; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.28); }
        .profil-row { display: flex; align-items: center; padding: 16px 18px; gap: 14px; border-bottom: 1px solid var(--sep); }
        .profil-row:last-child { border-bottom: none; }
        .profil-row-icon { width: 32px; height: 32px; border-radius: 7px; background: rgba(255,140,0,0.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .profil-row-icon svg { color: var(--orange); }
        .profil-row-label { flex: 1; font-size: 15px; font-weight: 500; }
        .profil-row-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

        /* 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); 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: 12px;
            padding: 10px 14px; border: 1px solid var(--sep);
            transition: border-color 0.2s;
        }
        .search-input-wrap:focus-within { border-color: var(--orange); }
        .search-input-wrap svg { color: var(--muted); flex-shrink: 0; }
        #searchInput {
            flex: 1; background: none; border: none; outline: none;
            font-family: 'DM Sans', sans-serif; font-size: 15px; 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(255,140,0,0.12);
            display: flex; align-items: center; justify-content: center; flex-shrink: 0;
        }
        .result-keyword-icon svg { color: var(--orange); }
        .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(255,140,0,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); }
        #authEmail, #authPassword {
            flex: 1; background: none; border: none; outline: none;
            font-family: 'DM Sans', sans-serif; font-size: 15px; color: var(--text);
        }
        #authEmail::placeholder, #authPassword::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: 'DM Sans', 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); color: #000;
        }
        .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); }
        .auth-btn {
            width: 100%; max-width: 340px;
            background: var(--orange); color: #000;
            border: none; border-radius: 12px;
            padding: 15px; font-family: 'DM Sans', 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: 12px; font-weight: 500; 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: 'DM Sans', sans-serif; cursor: pointer; transition: border-color 0.2s, background 0.2s; white-space: nowrap; }
        .mot-pill:active { background: rgba(255,140,0,0.12); border-color: var(--orange); }

        /* Lien déconnexion dans profil */
        .logout-btn {
            width: 100%; background: none; border: none;
            color: #f44336; font-family: 'DM Sans', sans-serif;
            font-size: 15px; font-weight: 600; 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(110px + 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 {
            flex: 1;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
            align-content: start;
        }
        .interet-card {
            display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between;
            gap: 10px;
            min-height: 100px;
            padding: 16px;
            border-radius: 18px;
            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: 26px; line-height: 1; }
        .interet-card .interet-name {
            font-size: 14.5px; font-weight: 700; color: var(--text); letter-spacing: 0.1px;
        }
        .interet-card.selected {
            border-color: var(--orange);
            background: rgba(255,140,0,0.10);
        }
        .interet-card.selected .interet-name { color: var(--orange); }

        .interets-confirm-btn {
            margin-top: 20px;
            width: 100%;
            padding: 15px 0;
            border: none; border-radius: 16px;
            background: var(--orange);
            color: #1a1a1a;
            font-family: 'DM Sans', sans-serif;
            font-size: 15px; font-weight: 800; letter-spacing: 0.2px;
            cursor: pointer;
            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;
        }
        #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;
            padding: max(80px, calc(env(safe-area-inset-top) + 64px)) 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-x: 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 — même style/couleur que .tiktok-category */
        .interet-category {
            font-size: 12px; font-weight: 800; text-transform: uppercase;
            letter-spacing: 1.2px; color: var(--orange);
            padding: 0 24px; margin-bottom: 14px;
        }
        .interet-headline {
            font-size: clamp(28px, 8vw, 42px);
            font-weight: 800;
            line-height: 1.1;
            letter-spacing: -0.02em;
            color: var(--text);
            padding: 0 24px;
            margin-bottom: 22px;
            text-transform: uppercase;
        }
        .interet-divider {
            height: 1px;
            background: var(--sep);
            margin: 0 24px 22px;
        }
        .interet-body {
            font-size: 16px;
            line-height: 1.72;
            color: var(--text);
            padding: 0 24px;
            flex: 1;
        }
        .interet-article-img {
            width: calc(100% - 48px);
            margin: 20px 24px 0;
            margin-bottom: 4px;
            height: 180px;
            object-fit: cover;
            border-radius: 12px;
            display: block;
            opacity: 0.9;
        }
        /* Source inline — favicon rond, juste après le dernier paragraphe du résumé */
        .interet-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 .interet-source-icon { background: #ddd; border-color: #bbb; }
        .interet-source-icon img { width: 12px; height: 12px; border-radius: 50%; object-fit: contain; }

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