@import url('https://fonts.googleapis.com/css2?family=Courier+Prime&display=swap');

/* ============================================================
   JADIS FEEL - CSS RÉORGANISÉ + CORRECTIONS CODEX
   Date: 3 février 2026
   Structure: DESKTOP puis MOBILE RESPONSIVE avec corrections Codex
   ============================================================ */

/* ============================================================
   PARTIE 1 : DESKTOP (styles par défaut)
   ============================================================ */

/* ========================================
   JADIS FEEL - STYLE COMPLET
   Version : 31 Décembre 2025
   ======================================== */

/* Police OpenDyslexic pour accessibilité - Licence SIL Open Font License 1.1 */
@font-face {
    font-family: 'OpenDyslexic';
    src: url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/ttf/OpenDyslexic-Regular.woff2') format('woff2'),
         url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/ttf/OpenDyslexic-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'OpenDyslexic';
    src: url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/ttf/OpenDyslexic-Bold.woff2') format('woff2'),
         url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/ttf/OpenDyslexic-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

/* Licence : SIL Open Font License 1.1 pour OpenDyslexic */
.font-license-info {
    font-size: 0.7rem;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}
/* 
 * ===== SYSTÈME HUMEURS JADIS =====
 *
 * Les humeurs sont décrites dans le registre js/humeurs.js depuis le 18/09/2026. Cette
 * feuille de style n'en nomme aucune, sauf la sérénité pour sa couche ::after.
 *
 * Le Worker détecte l'humeur et renvoie le nom.
 * Les gradients humeurs sont appliqués selon l'humeur détectée.
 * 
 * Les gradients humeurs premium doivent être retrouvés (neutre)
 * → CSS existe ci-dessous, Worker doit détecter
 */

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        /* ========== BACKGROUND NORMAL INTERFACE ========== */
        body {
            height: 100vh;
            min-height: 100vh;
            /* 20/10/2026 : 100vh mesure la fenêtre barre d'adresse repliée ; sur téléphone, la hauteur
               réellement visible est plus petite. 100dvh suit la barre d'adresse ; un navigateur qui ne
               connaît pas dvh ignore ces deux lignes et garde 100vh. */
            height: 100dvh;
            min-height: 100dvh;
            display: flex;
            flex-direction: column;
            background-image: radial-gradient(
                circle farthest-corner at 10% 20%,
                rgba(240,139,139,1) 0%,
                rgba(243,252,166,1) 90%
            );
            font-family: serif;
            overflow: hidden;
            transition: background 3.2s cubic-bezier(0.22, 0.61, 0.36, 1);
            margin-left: 60px; /* Espace pour sidebar */
            position: relative;
            isolation: isolate;
            --mood-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
            --bloom-warm: linear-gradient(120deg, rgba(255,210,200,.06), rgba(255,220,190,.08), rgba(255,235,210,.06));
        }

        /* Fondu enchaîné du background humeur -> fond normal (sans flou global UI) */
        body::before {
            content: "";
            position: fixed;
            inset: 0;
            z-index: 0;
            pointer-events: none;
            background:
                linear-gradient(
                    to bottom,
                    rgba(22, 18, 20, 0.78) 0%,
                    rgba(22, 18, 20, 0.38) 65%,
                    transparent 100%
                ) top / 100% 0% no-repeat,
                linear-gradient(
                    to top,
                    rgba(22, 18, 20, 0.78) 0%,
                    rgba(22, 18, 20, 0.38) 65%,
                    transparent 100%
                ) bottom / 100% 0% no-repeat;
            opacity: 0;
            backdrop-filter: brightness(1) contrast(1);
            -webkit-backdrop-filter: brightness(1) contrast(1);
        }

        body::after {
            content: "";
            position: fixed;
            inset: 0;
            z-index: 0;
            pointer-events: none;
            background: var(--mood-overlay-gradient, transparent);
            background-size: 220% 220%;
            background-position: 0% 50%;
            opacity: 0;
        }

        body.mood-overlay-on::before {
            opacity: 0;
            animation: none;
        }

        body.mood-overlay-on::after {
            opacity: 1;
            background-size: var(--mood-overlay-size, 440% 440%);
            animation: var(--mood-overlay-animation-name, deriveHumeur) var(--mood-overlay-duration, 12s) var(--mood-overlay-ease, ease-in-out) infinite;
        }

        body.mood-overlay-fade::before {
            opacity: 1;
            animation: truffautShutterSoft var(--truffaut-blink-duration, 1.15s) var(--mood-ease) forwards;
        }

        body.mood-overlay-fade::after {
            background-size: var(--mood-overlay-size, 440% 440%);
            animation:
                var(--mood-overlay-animation-name, deriveHumeur) var(--mood-overlay-duration, 12s) var(--mood-overlay-ease, ease-in-out) infinite,
                moodDissolve var(--truffaut-blink-duration, 1.15s) var(--mood-ease) forwards;
        }

        /* L'unique animation de fond des humeurs (18/09/2026). Les six animations qu'elle
           remplace disaient toutes la même chose : un départ, une mi-course, puis le retour au
           départ. Les deux positions viennent du champ mouvement du registre js/humeurs.js.
           Les valeurs de repli sont celles de l'ancienne animation par défaut, moodGradientFlow. */
        @keyframes deriveHumeur {
            0% { background-position: var(--humeur-depart, 0% 50%); }
            50% { background-position: var(--humeur-milieu, 100% 50%); }
            100% { background-position: var(--humeur-depart, 0% 50%); }
        }

        @keyframes ondeZenVolutes {
            0% {
                background-position: 8% 30%, 92% 68%, 0% 50%;
            }
            50% {
                background-position: 62% 36%, 36% 46%, 100% 50%;
            }
            100% {
                background-position: 8% 30%, 92% 68%, 0% 50%;
            }
        }

        @keyframes sereneCloudDrift {
            0% {
                background-position: 0px 22%, 260px 76%, 0px 58%;
            }
            100% {
                background-position: 1080px 22%, 760px 76%, 1480px 58%;
            }
        }

        @keyframes truffautShutterSoft {
            0% {
                opacity: 0;
                background-size: 100% 0%, 100% 0%;
                backdrop-filter: brightness(1) contrast(1);
                -webkit-backdrop-filter: brightness(1) contrast(1);
            }
            32% {
                opacity: var(--truffaut-mid-opacity, 0.50);
                background-size: 100% 26%, 100% 26%;
                backdrop-filter: brightness(0.38) contrast(1.06) grayscale(0.06);
                -webkit-backdrop-filter: brightness(0.38) contrast(1.06) grayscale(0.06);
            }
            52% {
                opacity: var(--truffaut-peak-opacity, 0.52);
                background-size: 100% 47%, 100% 47%;
                backdrop-filter: brightness(0.12) contrast(1.12) grayscale(0.18);
                -webkit-backdrop-filter: brightness(0.12) contrast(1.12) grayscale(0.18);
            }
            76% {
                opacity: 0.46;
                background-size: 100% 22%, 100% 22%;
                backdrop-filter: brightness(0.52) contrast(1.03) grayscale(0.04);
                -webkit-backdrop-filter: brightness(0.52) contrast(1.03) grayscale(0.04);
            }
            100% {
                opacity: 0;
                background-size: 100% 0%, 100% 0%;
                backdrop-filter: brightness(1) contrast(1);
                -webkit-backdrop-filter: brightness(1) contrast(1);
            }
        }

        @keyframes truffautOpenFinal {
            0% {
                opacity: 1;
                background-size: 100% 51%, 100% 51%;
            }
            100% {
                opacity: 0;
                background-size: 100% 0%, 100% 0%;
            }
        }

        @keyframes moodDissolve {
            0% { opacity: 1; }
            100% { opacity: 0; }
        }

        /* ========== LE DÉCOR DE L'HUMEUR - FOND DE PAGE (body) ========== */
        /* Source des dégradés : gradients_jadis_feel.css - 3 novembre 2025.
           Depuis le 18/09/2026, les valeurs vivent dans le registre js/humeurs.js. Le script
           les pose en variables sur le corps de la page, avec l'attribut data-humeur, au
           moment où l'humeur change. Aucune humeur n'est nommée ici : un seul bloc couvre
           les six, et une septième n'aurait rien à ajouter dans ce fichier. */
        body[data-humeur] {
            background: var(--humeur-fond) !important;
            background-size: var(--humeur-taille) !important;
            animation: deriveHumeur var(--humeur-duree) var(--humeur-courbe) infinite;
        }

        /* La sérénité est la seule humeur à porter une couche par-dessus la page entière :
           son dégradé est translucide, et la couche lui donne sa densité. Aucune autre humeur
           n'a cette couche, c'est pourquoi ce bloc est le seul de la feuille de style à citer
           une humeur. */
        body[data-humeur="serenite"]::after {
            opacity: 1;
            background: var(--humeur-fond);
            background-size: var(--humeur-taille);
            background-position: var(--humeur-depart);
            animation: deriveHumeur var(--humeur-duree) var(--humeur-courbe) infinite;
            mix-blend-mode: normal;
        }

        /* ========== ANIMATIONS GRADIENTS HUMEURS ========== */
        /* Apparition douce du nouveau gradient */
        .fadeInHumeur {
            animation: fadeInGradient 1.8s ease-in-out;
        }

        /* Disparition douce de l'ancien gradient */
        .fadeOutHumeur {
            animation: fadeOutGradient 0.75s ease-in-out;
        }

        @keyframes fadeInGradient {
            from { opacity: 0.75; }
            to { opacity: 1; }
        }

        @keyframes fadeOutGradient {
            from { opacity: 1; }
            to { opacity: 0.75; }
        }


        /* ========== BOX HAUT COMPACTE (sur une ligne + petit sous-titre) ========== */
        .ruban-accueil {
            position: fixed;
            top: 15px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(255, 255, 255, 0.85);
            padding: 12px 42px 12px 30px;
            border-radius: 15px;
            backdrop-filter: blur(15px);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            z-index: 1000;
            text-align: center;
            max-width: 90%;
            border: 1px solid rgba(255, 255, 255, 0.5);
            animation: rubanAccueilAutoHide 10s cubic-bezier(0.4, 0, 0.2, 1) forwards;
            transition: opacity 0.6s ease, transform 0.6s ease;
        }

        @keyframes rubanAccueilAutoHide {
            0%   { opacity: 0; transform: translate(-50%, -10px); }
            15%  { opacity: 1; transform: translate(-50%, 0); }
            80%  { opacity: 1; transform: translate(-50%, 0); }
            100% { opacity: 0; transform: translate(-50%, -20px); }
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .ruban-accueil.is-hidden {
            opacity: 0;
            transform: translate(-50%, -20px);
            pointer-events: none;
        }

        .ruban-accueil.is-gone {
            display: none;
        }

        .ruban-titre {
            font-family: 'Prata', serif;
            font-size: 1.3rem;
            color: #3b1d3f;
            margin-bottom: 4px;
            font-weight: 400;
            white-space: nowrap;
        }

        .ruban-baseline {
            font-size: 0.85rem;
            color: #3b1d3f;
            font-style: italic;
            margin: 0;
            font-weight: 400;
            opacity: 0.85;
        }

        /* ========== HEADER ========== */
        .header {
            display: flex;
            align-items: center;
            padding: 15px 20px;
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border-bottom: 1px solid rgba(255, 255, 255, 0.2);
            margin-top: 70px;
            position: relative;
            z-index: 200;
            pointer-events: none;
        }

        .header button,
        .header a,
        .header input,
        .header select {
            pointer-events: auto;
        }

        /* Avatar avec nouveau visage + fallback */
        .jadis-avatar {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            margin-right: 15px;
            border: 3px solid #DAA520;
            box-shadow: 
                0 0 10px rgba(218, 165, 32, 0.6),
                inset 0 0 10px rgba(255, 215, 0, 0.3);
            object-fit: cover;
            filter: sepia(20%) contrast(110%);
            background: #f5f1eb;
        }

        .title {
            font-size: 1.5rem;
            color: #3b1d3f;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .treble-clef {
            font-size: 1.8rem;
            color: #2c1a2e;
            background: linear-gradient(
                135deg, 
                rgba(255, 255, 255, 0.4) 0%, 
                rgba(240, 139, 139, 0.3) 50%,
                rgba(243, 252, 166, 0.3) 100%
            );
            padding: 4px 8px;
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.3);
            backdrop-filter: blur(5px);
            font-weight: 900;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
            cursor: pointer;
            transition: all 0.3s ease;
            text-decoration: none;
            display: inline-block;
            position: relative;
            z-index: 100; /* Au-dessus de tous les éléments du header */
        }

        .treble-clef:hover {
            transform: scale(1.05);
        }

        /* ========== BOUTONS EXPORT EN HAUT (discrets) ========== */
        .export-zone {
            margin-left: auto;
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .export-btn {
            width: 32px;
            height: 32px;
            background: rgba(255, 255, 255, 0.3);
            border: 1px solid rgba(139, 69, 19, 0.2);
            border-radius: 8px;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.3s ease;
            backdrop-filter: blur(5px);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .export-btn:hover {
            background: rgba(139, 69, 19, 0.2);
            transform: translateY(-2px);
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
        }

        .status {
            font-size: 0.9rem;
            color: #666;
            font-style: italic;
            margin-left: 15px;
        }

        /* ========== PHRASE CENTRALE AVEC RUBAN COMME FOND ========== */
        .phrase-centrale {
            display: inline-block;
            text-align: center;
            padding: 12px 20px;
            color: #3b1d3f;
            font-style: italic;
            font-size: 1.2rem;
            line-height: 1.6;
            font-weight: 500;
            max-width: 90%;
            /* RUBAN VIOLET-VANILLE comme fond */
            background: radial-gradient(
                circle,
                rgba(255, 255, 255, 0.63) 2%,
                rgba(216, 131, 230, 0.79) 77%,
                rgba(206, 194, 252, 0.83) 100%
            );
            background-size: cover;
            background-repeat: no-repeat;
            /* Bords irréguliers (pas parfaitement arrondis) */
            border-radius: 8px 12px 10px 14px / 10px 8px 12px 9px;
            animation: fadeIn ease 4s;
            -webkit-animation: fadeIn ease 5s;
            -moz-animation: fadeIn ease 5s;
            -o-animation: fadeIn ease 5s;
            -ms-animation: fadeIn ease 5s;
            transition: opacity 0.8s ease, transform 0.8s ease;
        }

        .signature-jadis {
            margin-top: 10px;
            color: #3b1d3f;
            font-style: italic;
            font-size: 1rem;
            transition: opacity 0.8s ease, transform 0.8s ease;
        }

        .phrase-centrale.is-hidden,
        .signature-jadis.is-hidden {
            opacity: 0;
            transform: translateY(-10px);
            pointer-events: none;
        }

        .phrase-centrale.is-gone,
        .signature-jadis.is-gone {
            display: none;
        }

        /* ========== BARRE LATÉRALE GAUCHE ========== */
        .sidebar {
            position: fixed;
            left: 0;
            top: 0;
            width: 60px;
            height: 100vh;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-right: 1px solid rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px 0;
            gap: 25px;
            z-index: 1500;
            box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
        }

        .sidebar-btn {
            width: 40px;
            height: 40px;
            background: none;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 10px;
            transition: all 0.3s ease;
            position: relative;
        }

        .sidebar-btn:hover {
            background: rgba(232, 160, 235, 0.2);
            transform: scale(1.1);
        }

        .sidebar-btn::after {
            content: attr(data-tooltip);
            position: absolute;
            left: 70px;
            background: #3b1d3f;
            color: white;
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 0.8rem;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease;
            font-family: serif;
        }

        .sidebar-btn:hover::after {
            opacity: 1;
        }

        /* Canva en attente — chronique non terminée, persistance localStorage */
        @keyframes battementCoeur {
            0% { transform: scale(1); }
            14% { transform: scale(1.15); }
            28% { transform: scale(1); }
            42% { transform: scale(1.15); }
            70% { transform: scale(1); }
            100% { transform: scale(1); }
        }

        #chroniqueBtn.canva-en-attente {
            background: linear-gradient(135deg, #f3b8e8, #e8a0eb);
            animation: battementCoeur 1s ease-in-out;
        }

        /* === CANVA ENDORMI — AUCUNE CHRONIQUE ÉCRITE (23/08/2026) ===

           Objet : l'icône du canva tant qu'aucune chronique n'existe.
           Règle : la pâleur porte sur le <svg> seul, jamais sur le bouton.
           Sans cette règle : l'opacité du bouton s'appliquerait aussi à son ::after,
             qui dessine la bulle « Actif dès ta première chronique » — elle sortirait
             à 35 % et le grayscale effacerait son fond violet. Une opacité de parent
             ne se rattrape pas depuis l'enfant.
           25/08/2026 : correction, ces deux règles portaient sur le bouton lui-même. */
        #chroniqueBtn.canva-endormi svg {
            opacity: 0.35;
            filter: grayscale(1);
        }

        /* === REPRISE D'UNE CHRONIQUE ===
           Le choix reste près du champ pour distinguer les textes locaux avant l'envoi volontaire. */
        .chronique-choices {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 8px;
            margin: 0 16px 8px;
        }

        .chronique-choices button,
        .chronique-select {
            border: 1px solid rgba(111, 87, 65, .35);
            border-radius: 999px;
            padding: 7px 11px;
            background: rgba(255, 253, 246, .88);
            color: #6f5741;
            font-family: "Playfair Display", serif;
            font-size: .84rem;
            cursor: pointer;
        }

        .chronique-choice-label {
            color: #6f5741;
            font-family: "Playfair Display", serif;
            font-size: .84rem;
        }

        .chronique-choices button:hover,
        .chronique-choices button:focus-visible,
        .chronique-select:focus-visible {
            background: rgba(232, 160, 235, .18);
            outline: 2px solid rgba(111, 87, 65, .45);
            outline-offset: 2px;
        }

        .chronique-error:empty {
            display: none;
        }

        /* Badge humeur active */
        .mood-badge {
            position: fixed;
            top: 20px;
            left: 70px;
            background: rgba(232, 160, 235, 0.9);
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 0.75rem;
            color: #3b1d3f;
            font-weight: 500;
            backdrop-filter: blur(5px);
            z-index: 1400;
            display: none;
        }

        .mood-badge.active {
            display: block;
            animation: fadeIn 0.5s ease;
        }

        /* ========== PANNEAU CONVERSATIONS (couloir) ========== */
        .conversations-panel {
            position: fixed;
            left: 60px;
            top: 0;
            width: 300px;
            height: 100vh;
            background: rgba(255, 255, 255, 0.98);
            backdrop-filter: blur(15px);
            border-right: 1px solid rgba(0, 0, 0, 0.1);
            z-index: 1400;
            transform: translateX(-100%);
            transition: transform 0.3s ease;
            display: flex;
            flex-direction: column;
            box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
            overflow-y: auto;
        }

        .conversations-panel.open {
            transform: translateX(0);
        }

        .panel-header {
            padding: 20px;
            border-bottom: 1px solid rgba(0, 0, 0, 0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .panel-title {
            font-family: 'Prata', serif;
            font-size: 1.2rem;
            color: #3b1d3f;
        }

        .close-panel {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: #666;
            padding: 0;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.2s ease;
        }

        .close-panel:hover {
            background: rgba(0, 0, 0, 0.1);
            color: #3b1d3f;
        }

        .panel-search {
            padding: 15px;
            border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        }

        .panel-search input {
            width: 100%;
            padding: 10px 15px;
            border: 1px solid rgba(0, 0, 0, 0.2);
            border-radius: 20px;
            font-family: serif;
            font-size: 0.9rem;
            outline: none;
            transition: all 0.2s ease;
        }

        .panel-search input:focus {
            border-color: rgba(232, 160, 235, 0.8);
            box-shadow: 0 0 0 2px rgba(232, 160, 235, 0.2);
        }

        .conversations-list {
            flex: 1;
            overflow-y: auto;
            padding: 10px;
            min-height: 200px;
        }
        
        .settings-content {
            max-height: 300px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 4px;
            padding-left: 24px;
        }

        .conversation-item {
            padding: 12px;
            margin-bottom: 8px;
            background: rgba(248, 240, 252, 0.3);
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.2s ease;
            border: 1px solid transparent;
        }

        .conversation-item:hover {
            background: rgba(232, 160, 235, 0.2);
            border-color: rgba(232, 160, 235, 0.5);
            transform: translateX(5px);
        }

        .conversation-title {
            font-weight: 600;
            color: #3b1d3f;
            font-size: 0.9rem;
            margin-bottom: 4px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .conversation-meta {
            font-size: 0.75rem;
            color: #999;
            display: flex;
            gap: 10px;
        }

        .conversation-delete {
            float: right;
            background: none;
            border: none;
            color: #999;
            cursor: pointer;
            font-size: 0.9rem;
            padding: 0 5px;
            opacity: 0;
            transition: all 0.2s ease;
        }

        .conversation-item:hover .conversation-delete {
            opacity: 1;
        }

        .conversation-delete:hover {
            color: #d97706;
        }

        .conversations-vide { text-align: center; color: #999; padding: 20px; }
        .conversation-rouverte { text-align: center; color: #8a6a8e; font-size: 0.8rem; margin: 12px 0; }

        /* ========== PANNEAU PARAMÈTRES ========== */
        .settings-section {
            padding: 12px;
            border-bottom: 1px solid rgba(0, 0, 0, 0.1);
            flex-shrink: 0;
        }
        
        .settings-section:last-child {
            border-bottom: none;
            padding-bottom: 40px;
            margin-bottom: 20px;
        }

        .settings-section:last-child {
            border-bottom: none;
        }

        .settings-section-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
        }

        .settings-section-header svg {
            stroke: #3b1d3f;
            flex-shrink: 0;
        }

        .settings-section-header h4 {
            margin: 0;
            font-size: 0.9rem;
            color: #3b1d3f;
            font-family: 'Prata', serif;
            font-weight: 600;
        }
        
        .settings-section-header {
            cursor: pointer;
            user-select: none;
        }
        
        .hamburger-menu {
            margin-left: auto;
            font-size: 1.2rem;
            transition: transform 0.3s ease;
            color: #666;
        }
        
        .hamburger-menu.open {
            transform: rotate(90deg);
        }

        .settings-btn {
            padding: 8px 12px;
            background: rgba(232, 160, 235, 0.2);
            border: 1px solid rgba(232, 160, 235, 0.5);
            border-radius: 6px;
            font-family: serif;
            font-size: 0.8rem;
            color: #3b1d3f;
            cursor: pointer;
            transition: all 0.2s ease;
            text-align: left;
            outline: none !important;
            box-shadow: none !important;
            appearance: none !important;
            -webkit-appearance: none !important;
            -moz-appearance: none !important;
            margin-bottom: 2px;
        }

        .settings-btn:hover {
            background: rgba(232, 160, 235, 0.3);
            transform: translateX(3px);
        }

        .settings-btn.danger {
            background: rgba(231, 76, 60, 0.1);
            border-color: rgba(231, 76, 60, 0.3);
            color: #c0392b;
        }

        .settings-btn.danger:hover {
            background: rgba(231, 76, 60, 0.2);
        }

        .settings-btn.premium-locked {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .settings-info {
            font-size: 0.75rem;
            color: #666;
            margin: 0;
            padding: 2px 0;
        }

        .settings-warning {
            font-size: 0.7rem;
            color: #d97706;
            margin: 2px 0 0 0;
        }

        .settings-moderation-info {
            font-size: 0.7rem;
            color: #e11d48;
            margin: 4px 0 0 0;
            font-weight: 600;
            font-style: italic;
        }

        .settings-link {
            color: #3b82f6;
            text-decoration: none;
            font-size: 0.8rem;
            padding: 3px 0;
            transition: color 0.2s ease;
            display: block;
        }

        .settings-link:hover {
            color: #2563eb;
            text-decoration: underline;
        }
        
        .settings-link:last-of-type {
            color: #059669;
            font-weight: 600;
            border: 1px solid rgba(5, 150, 105, 0.2);
            border-radius: 4px;
            padding: 6px 8px;
            margin-top: 6px;
            background: rgba(5, 150, 105, 0.05);
            text-align: center;
        }
        
        .settings-link:last-of-type:hover {
            color: #047857;
            background: rgba(5, 150, 105, 0.1);
        }

        /* ========== BOUTON RETOUR HUMEUR (ton code) ========== */
        .btn-grad {
            background-image: linear-gradient(to right, #FF512F 0%, #DD2476 51%, #FF512F 100%);
            background-size: 200% auto;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            display: none; /* Caché par défaut - visible seulement si humeur active */
            align-items: center;
            justify-content: center;
            border: none;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(222, 98, 98, 0.3);
            transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), background-position 0.5s, opacity 0.3s ease;
            position: relative;
            z-index: 10;
            opacity: 0;
        }
        
        /* Visible seulement quand une humeur est active */
        body[data-humeur] .btn-grad {
            display: flex;
            opacity: 1;
        }

        .btn-grad:hover {
            background-position: right center;
            /* Pas de rotation au hover - rotation uniquement au clic */
        }

        .btn-grad:active {
            transform: scale(0.9);
        }

        /* ========== LA PHRASE CENTRALE PREND LA COULEUR DE L'HUMEUR ========== */
        /* Le dégradé vient du champ fondPhraseCentrale du registre js/humeurs.js, posé en
           variable sur le corps de la page par le script au moment où l'humeur change. */
        body[data-humeur] .phrase-centrale {
            background: var(--humeur-fond-phrase);
        }

        /* ========== BANDEAU ENCOURAGEMENT (round robin fadeIn/fadeOut) ========== */
        /* Sous l'en-tête, au lieu du milieu de la conversation : capture d'un invité, 07/11/2026. */
        .ruban-encouragement {
            position: fixed;
            top: 170px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(255, 255, 255, 0.92);
            padding: 10px 32px 10px 18px;
            border-radius: 12px;
            backdrop-filter: blur(10px);
            box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
            z-index: 999;
            font-family: 'Prata', serif;
            font-size: 0.85rem;
            color: #8B4513;
            font-style: italic;
            font-weight: 400;
            border: 2px solid #DAA520;
            max-width: 280px;
            text-align: center;
            display: none;
            opacity: 0;
            transition: opacity 1.5s ease-in-out;
            pointer-events: auto;
        }

        .ruban-encouragement.visible {
            display: block;
            opacity: 1;
        }

        /* La boîte Cloudflare passait sous le bouton « Mon envol » : capture d'un invité, 07/11/2026. */
        #preuve-anti-robot {
            position: fixed;
            left: 190px;
            bottom: 6px;
            z-index: 2100;
        }

        @media (max-width: 768px) {
            #preuve-anti-robot {
                left: 14px;
                bottom: 80px;
            }
        }

        /* Bouton croix X fermeture */
        .bulle-close {
            position: absolute;
            top: 8px;
            right: 8px;
            background: transparent;
            border: none;
            font-size: 18px;
            line-height: 1;
            cursor: pointer;
            color: #8B4513;
            opacity: 0.6;
            padding: 0;
            width: 20px;
            height: 20px;
            transition: opacity 0.2s ease;
        }

        .bulle-close:hover {
            opacity: 1;
        }

        .ruban-encouragement.clickable {
            cursor: pointer;
            pointer-events: auto;
        }

        .ruban-encouragement.clickable:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 18px rgba(218, 165, 32, 0.3);
        }

        /* ========== ZONE CHAT ========== */
        .chat-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            padding-bottom: 20px;
            min-height: 0;
            position: relative;
            z-index: 10;
        }

        .messages-area {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 15px;
            min-height: 200px;
            max-height: calc(100vh - 300px);
            pointer-events: auto !important;
        }

        .scroll-down-btn {
            position: absolute;
            bottom: 80px;
            right: 20px;
            z-index: 100;
            background: rgba(162, 2, 184, 0.692);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.4);
            border-radius: 50%;
            width: 42px;
            height: 42px;
            display: none;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            opacity: 0;
            pointer-events: none;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
            transition: opacity 0.25s ease, transform 0.2s ease, background 0.2s ease;
        }

        .scroll-down-btn.visible {
            opacity: 1;
            display: flex;
            pointer-events: auto;
        }

        .scroll-down-btn:hover {
            transform: translateY(-2px);
            background: rgba(162, 2, 184, 0.88);
        }

        .scroll-down-btn svg {
            width: 20px;
            height: 20px;
            stroke: currentColor;
            stroke-width: 2.5;
            fill: none;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        /* ========== BULLES MESSAGES ========== */
        .message {
            max-width: 70%;
            padding: 20px 18px; /* test scroll : vertical 12→20px */
            border-radius: 18px;
            font-size: 1rem;
            line-height: 1.4;
            animation: fadeInMessage 0.3s ease-out;
            position: relative;
            word-wrap: break-word;
            overflow-wrap: anywhere;
            white-space: pre-wrap;
            overflow-wrap: break-word;
            -ms-word-wrap: break-word;
        }

        .message.user {
            align-self: flex-end;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border-bottom-right-radius: 6px;
        }

        .message.jadis {
            align-self: flex-start;
            background: radial-gradient(
                circle,
                rgba(255, 255, 255, 0.95) 5%,
                rgba(248, 240, 252, 0.9) 40%,
                rgba(232, 160, 235, 0.7) 90%
            );
            color: #3b1d3f;
            border-bottom-left-radius: 6px;
        }

        @keyframes fadeInMessage {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* ========== ICÔNES RÉACTIONS ========== */
        .reactions-container {
            display: flex;
            gap: 6px;
            margin-top: 6px;
            padding-top: 4px;
            border-top: 1px solid rgba(0, 0, 0, 0.06);
        }

        .reaction-btn {
            all: unset;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.2s ease, color 0.2s ease;
        }

        .reaction-btn svg {
            width: 16px;
            height: 16px;
            stroke: #318285;
            flex-shrink: 0;
        }

        .reaction-btn:hover {
            color: #318285;
            transform: scale(1.2) rotate(-5deg);
        }

        .message.jadis .reaction-btn.active {
            color: #7a8fd8;
        }

        .message.jadis .reaction-btn.active svg {
            stroke: #7a8fd8;
            fill: #7a8fd8;
            opacity: 1;
        }

        /* Le dessin de l'icône copier garde son trait fixe sans cette classe, posée 1,4 seconde après une copie réussie. */
        .message.jadis .reaction-btn.copie-faite svg {
            stroke: #1b6f84;
            fill: #1b6f84;
        }

        .message.jadis .reaction-btn img {
            max-width: 16px;
            max-height: 16px;
            width: 16px;
            height: 16px;
        }

        .message.jadis .reaction-btn.active[data-reaction="heart"] svg,
        .message.jadis .reaction-btn.active[data-reaction="feather"] svg {
            animation: wiggle 300ms ease;
        }

        .message.jadis .reaction-btn.active[data-reaction="cafe"] svg {
            animation: wiggle 300ms ease;
        }

        @keyframes wiggle {
            0% { transform: rotate(0deg) scale(1); }
            25% { transform: rotate(-8deg) scale(1.06); }
            50% { transform: rotate(8deg) scale(1.06); }
            75% { transform: rotate(-6deg) scale(1.03); }
            100% { transform: rotate(0deg) scale(1); }
        }

        /* ========== SNIPPET OPTION B — Bloc cité avec bordure or ========== */
        /* Intégré depuis mock_snippet_interface_reelle.html — 18/04/2026 */
        .snippet-block {
            display: block;
            border-left: 2px solid #DAA520;
            background: rgba(218, 165, 32, 0.08);
            border-radius: 0 8px 8px 0;
            padding: 8px 12px;
            margin: 8px 0;
            font-style: italic;
            color: #5a3060;
            font-size: 0.92rem;
            line-height: 1.5;
            max-height: 5.8em; /* 4 lignes × line-height 1.45 */
            overflow: hidden;
            position: relative;
        }

        /* Dégradé de coupure si texte dépasse 4 lignes */
        .snippet-block.overflow::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 1.4em;
            background: linear-gradient(to bottom, transparent, rgba(248, 240, 252, 0.95));
        }

        /* ========== ACCESSIBILITÉ DYSLEXIE ========== */
        .dyslexia-mode {
            font-family: 'OpenDyslexic', 'Comic Sans MS', cursive !important;
            letter-spacing: 0.03em;
            word-spacing: 0.05em;
            line-height: 1.5;
            font-weight: 700 !important;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
            font-size: 0.95em;
        }

        .dyslexia-mode .phrase-centrale {
            filter: brightness(0.85);
            background: radial-gradient(
                circle,
                rgba(255, 255, 255, 0.4) 2%,
                rgba(216, 131, 230, 0.7) 77%,
                rgba(206, 194, 252, 0.75) 100%
            ) !important;
        }

        .dyslexia-mode .message {
            font-size: 1em;
            line-height: 1.5;
            letter-spacing: 0.03em;
            font-weight: 700 !important;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
            background: rgba(255, 255, 255, 0.95);
            border: 1px solid rgba(0,0,0,0.15);
        }

        .dyslexia-mode .message-input {
            font-size: 1em;
            line-height: 1.5;
            font-weight: 700 !important;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
        }

        /* Mode contraste élevé */
        .high-contrast .message {
            border: 2px solid #000;
            background: #fff;
            color: #000;
            font-weight: 700;
        }

        .high-contrast .message.user {
            background: #000;
            color: #fff;
            border-color: #fff;
            font-weight: 700;
        }

        .high-contrast .message-input {
            border: 2px solid #000;
            color: #000;
            font-weight: 700;
        }

        .high-contrast .phrase-centrale,
        .high-contrast .ruban-titre,
        .high-contrast .ruban-baseline {
            color: #000;
            font-weight: 700;
            text-shadow: none;
        }

        /* ========== ZONE SAISIE ========== */
        .input-area {
            display: flex;
            padding: 15px 20px;
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border-top: 1px solid rgba(255, 255, 255, 0.2);
            gap: 10px;
            min-height: 60px;
        }

        .message-input {
            flex: 1;
            padding: 12px 18px;
            border: none;
            border-radius: 25px;
            background: rgba(255, 255, 255, 0.9);
            font-family: serif;
            font-size: 1rem;
            outline: none;
            transition: all 0.3s ease;
        }

        .message-input:focus {
            box-shadow: 0 0 0 2px rgba(232, 160, 235, 0.5);
            background: rgba(255, 255, 255, 1);
        }

        .send-button {
            padding: 8px 16px;
            background: linear-gradient(135deg, #232160, #764ba2);
            color: white;
            border: none;
            border-radius: 20px;
            font-family: serif;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.3s ease;
            white-space: nowrap;
        }

        .send-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }

        .send-button:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        /* Cacher l'icône par défaut (desktop) */
        .send-icon {
            display: none;
        }

        /* Mobile uniquement : afficher flèche, cacher texte */
        @media (max-width: 768px) {
            .send-text {
                display: none;
            }

            .send-icon {
                display: inline-block;
                width: 18px;
                height: 18px;
            }
        }

        /* ========== BOUTON PIÈCES JOINTES (TROMBONE) ========== */
        .attach-button {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            background: transparent;
            border: 1px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            color: rgba(255, 255, 255, 0.6);
            cursor: not-allowed;
            transition: all 0.2s ease;
            flex-shrink: 0;
            /* État désactivé par défaut */
            filter: grayscale(1);
            opacity: 0.5;
        }

        /* État activé (après 1er message) */
        .attach-button.active {
            filter: grayscale(0);
            opacity: 1;
            cursor: pointer;
            color: #FF00FF;
            border-color: #FF00FF;
            box-shadow: 0 0 8px rgba(255, 0, 255, 0.4);
        }

        .attach-button.active:hover {
            background: rgba(255, 0, 255, 0.15);
            box-shadow: 0 0 12px rgba(255, 0, 255, 0.6);
        }

        .attach-button.active:active {
            transform: scale(0.95);
        }

        /* État consommé (fichier déjà envoyé) */
        .attach-button.consumed {
            filter: grayscale(1);
            opacity: 0.3;
            cursor: not-allowed;
            pointer-events: none;
        }

        .attach-button:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: rgba(255, 255, 255, 0.5);
            color: rgba(255, 255, 255, 0.9);
        }

        .attach-button:active {
            transform: scale(0.95);
        }

        /* ========== ZONE DE COLLAGE ========== */
        /* Reprend le fond, la police et le rose de focus du champ de saisie voisin. */
        .texte-apporte {
            margin: 0 0 10px;
            padding: 12px 14px;
            border-radius: 14px;
            background: rgba(255, 255, 255, 0.9);
        }

        .texte-apporte__mention {
            display: block;
            margin-bottom: 8px;
            font-family: serif;
            font-size: 0.9rem;
            color: rgba(35, 33, 96, 0.75);
        }

        .texte-apporte__champ {
            width: 100%;
            box-sizing: border-box;
            padding: 10px 12px;
            border: 1px solid rgba(35, 33, 96, 0.15);
            border-radius: 10px;
            background: #fff;
            font-family: serif;
            font-size: 0.95rem;
            line-height: 1.5;
            resize: vertical;
            outline: none;
            transition: box-shadow 0.3s ease;
        }

        .texte-apporte__champ:focus {
            box-shadow: 0 0 0 2px rgba(232, 160, 235, 0.5);
        }

        .texte-apporte__compteur {
            margin: 6px 2px 0;
            font-family: serif;
            font-size: 0.8rem;
            color: rgba(35, 33, 96, 0.55);
            transition: color 0.3s ease;
        }

        /* Cinquante derniers mots : la couleur prévient, elle ne bloque pas. */
        .texte-apporte__compteur--proche {
            color: #FF00FF;
        }

        /* Le dernier message : même discrétion que le compteur de mots, sous la zone de saisie. */
        .reste-messages {
            margin: 0;
            padding: 0 20px 8px;
            font-family: serif;
            font-size: 0.8rem;
            color: rgba(35, 33, 96, 0.55);
        }

        /* ========== PHRASE RGPD ========== */
        .rgpd-notice {
            position: fixed;
            bottom: 8px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 0.65rem;
            color: rgba(59, 29, 63, 0.5);
            font-style: italic;
            text-align: center;
            z-index: 500;
        }

        /* ========== MODAL PLAYLIST ========== */
        .playlist-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 2000;
        }

        .playlist-modal.show {
            display: flex;
        }

        .playlist-content {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 20px;
            padding: 20px;
            max-width: 400px;
            width: 90%;
            position: relative;
        }

        .close-modal {
            position: absolute;
            top: 10px;
            right: 15px;
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: #666;
        }

        .playlist-title {
            text-align: center;
            color: #3b1d3f;
            margin-bottom: 15px;
            font-size: 1.2rem;
        }

        .spotify-embed {
            width: 100%;
            height: 380px;
            border-radius: 12px;
        }

        /* ========== SCROLLBAR ========== */
        .messages-area::-webkit-scrollbar {
            width: 6px;
        }

        .messages-area::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.1);
        }

        .messages-area::-webkit-scrollbar-thumb {
            background: rgba(232, 160, 235, 0.5);
            border-radius: 3px;
        }

        .messages-area::-webkit-scrollbar-thumb:hover {
            background: rgba(232, 160, 235, 0.8);
        }

        /* ========== SYSTÈME TOASTS ========== */
        #toast-container {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 10000;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .toast {
            min-width: 250px;
            padding: 15px 20px;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            color: white;
            font-family: sans-serif;
            font-size: 0.95rem;
            animation: slideInToast 0.3s ease;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .toast.success { background: linear-gradient(135deg, #10b981, #059669); }
        .toast.error { background: linear-gradient(135deg, #c0392b, #96281b); }
        .toast.info { background: linear-gradient(135deg, #005F73, #0a7d8c); }
        .toast.warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
        .toast.micro { background: linear-gradient(135deg, #534AB7, #3C3489); }

        @keyframes slideInToast {
            from { opacity: 0; transform: translateX(100px); }
            to { opacity: 1; transform: translateX(0); }
        }

        @keyframes slideOutToast {
            from { opacity: 1; transform: translateX(0); }
            to { opacity: 0; transform: translateX(100px); }
        }

        .toast.dismissing { animation: slideOutToast 0.3s ease; }
        .toast-icon { font-size: 1.2rem; }

        /* Bandeau qui reste jusqu'à ce que l'invité le ferme (03/08/2026) — réservé aux échecs
           d'export. Prune, pour se distinguer des cinq autres sans crier à l'alerte. */
        .toast.persistant {
            background: linear-gradient(135deg, #6B2D5C, #4A1B3D);
            max-width: 420px;
            align-items: flex-start;
            padding-right: 12px;
        }

        .toast-fermer {
            background: none;
            border: none;
            color: rgba(255, 255, 255, 0.75);
            font-size: 1.35rem;
            line-height: 1;
            padding: 0 4px;
            margin-left: auto;
            cursor: pointer;
            transition: color 0.2s ease;
        }

        .toast-fermer:hover { color: #ffffff; }

        .toast-fermer:focus-visible {
            outline: 2px solid #ffffff;
            outline-offset: 2px;
            border-radius: 4px;
        }

        /* ========== MODALE D'ACCUEIL ========== */
        .modal-overlay-welcome {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.9);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 10000;
            transition: opacity 0.3s ease;
        }

        .modal-overlay-welcome.hidden {
            display: none;
        }

        .modal-overlay-welcome.show {
            display: flex;
            opacity: 1;
        }

        .modal-content-welcome {
            background: rgba(255, 255, 255, 0.98);
            border-radius: 25px;
            padding: 40px;
            max-width: 600px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
            border: 3px solid #DAA520;
            text-align: center;
            transform: translateY(0);
            transition: transform 0.3s ease, opacity 0.3s ease;
        }

        .modal-overlay-welcome.show .modal-content-welcome {
            transform: translateY(0);
            opacity: 1;
        }

        .welcome-header {
            margin-bottom: 30px;
        }

        .welcome-avatar {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            margin: 0 auto 20px;
            border: 4px solid #DAA520;
            box-shadow: 
                0 0 20px rgba(218, 165, 32, 0.4),
                0 0 40px rgba(218, 165, 32, 0.2);
            display: block;
            filter: sepia(20%) contrast(110%);
            background: #f5f1eb;
        }

        .blink-animation {
            animation: softGlow 8s infinite;
        }

        @keyframes softGlow {
            0%, 95%, 100% {
                filter: sepia(20%) contrast(110%) brightness(1);
                box-shadow: 
                    0 0 20px rgba(218, 165, 32, 0.4),
                    0 0 40px rgba(218, 165, 32, 0.2);
            }
            98% {
                filter: sepia(20%) contrast(110%) brightness(0.98);
                box-shadow: 
                    0 0 15px rgba(218, 165, 32, 0.3),
                    0 0 30px rgba(218, 165, 32, 0.15);
            }
        }

        .welcome-title {
            font-family: 'Prata', serif;
            font-size: 1.8rem;
            color: #3b1d3f;
            margin: 0;
            font-weight: 400;
            line-height: 1.2;
        }

        .welcome-content {
            text-align: left;
            margin-bottom: 30px;
        }

        .welcome-text {
            font-size: 1.1rem;
            color: #3b1d3f;
            margin-bottom: 25px;
            line-height: 1.6;
            font-style: italic;
            text-align: center;
        }

        .welcome-terms {
            background: rgba(248, 240, 252, 0.6);
            padding: 20px;
            border-radius: 15px;
            margin-bottom: 20px;
            border-left: 4px solid #DAA520;
        }

        .welcome-terms h4 {
            color: #3b1d3f;
            margin: 0 0 15px 0;
            font-family: 'Prata', serif;
            font-size: 1.1rem;
        }

        .welcome-terms ul {
            margin: 0;
            padding-left: 20px;
            color: #3b1d3f;
            line-height: 1.5;
        }

        .welcome-terms li {
            margin-bottom: 8px;
        }

        .welcome-terms strong {
            color: #8B4513;
        }

        .welcome-agreement {
            font-size: 0.95rem;
            color: #666;
            line-height: 1.5;
            text-align: center;
            margin: 0;
        }

        .welcome-actions {
            text-align: center;
        }

        .welcome-accept-btn {
            background: linear-gradient(135deg, #DAA520, #B8860B);
            color: white;
            border: none;
            padding: 15px 30px;
            border-radius: 25px;
            font-family: serif;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 5px 15px rgba(218, 165, 32, 0.3);
            text-transform: none;
        }

        .welcome-accept-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(218, 165, 32, 0.4);
            background: linear-gradient(135deg, #B8860B, #DAA520);
        }

        /* ========== MODALE ORIENTATION URGENCE 3114 ========== */
        .modal-overlay-urgence {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 9999;
            animation: fadeIn 0.3s ease;
        }

        .modal-overlay-urgence.show {
            display: flex;
        }

        .modal-content-urgence {
            background: rgba(255, 255, 255, 0.98);
            border-radius: 20px;
            padding: 30px;
            max-width: 600px;
            width: 90%;
            max-height: 85vh;
            overflow-y: auto;
            position: relative;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            border: 3px solid #e74c3c;
        }

        .modal-header-urgence {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .modal-title-urgence {
            font-family: 'Prata', serif;
            font-size: 1.6rem;
            color: #e74c3c;
            margin: 0;
        }

        .close-modal-urgence {
            background: none;
            border: none;
            font-size: 2rem;
            color: #666;
            cursor: pointer;
            line-height: 1;
            padding: 0;
            /* 18/09/2026 : 30 px ne s'atteint pas au doigt. La cible tactile passe à 40 px,
               valeur retenue le 18/09/2026. */
            width: 40px;
            height: 40px;
        }

        .close-modal-urgence:hover {
            color: #e74c3c;
        }

        .modal-text-urgence {
            font-size: 1rem;
            line-height: 1.6;
            color: #3b1d3f;
        }

        .modal-text-urgence p {
            margin-bottom: 15px;
        }

        .modal-text-urgence .italic {
            font-style: italic;
            color: #666;
        }

        .urgence-box {
            background: #fef2f2;
            padding: 20px;
            border-radius: 12px;
            margin: 15px 0;
            border-left: 4px solid #e74c3c;
        }

        .urgence-box h4 {
            color: #c0392b;
            margin-bottom: 10px;
            font-size: 1.2rem;
        }

        .urgence-box .numero {
            font-size: 1.8rem;
            font-weight: bold;
            color: #e74c3c;
            display: block;
            margin: 10px 0;
        }

        .urgence-box p {
            font-size: 0.9rem;
            margin: 5px 0;
        }

        .urgence-box a {
            color: #3b82f6;
            text-decoration: underline;
            transition: color 0.3s ease;
        }

        .urgence-box a:hover {
            color: #2563eb;
        }

        .urgence-box-dom {
            background: #fff9e6;
            border-left-color: #f59e0b;
        }

        .urgence-box-dom h4 {
            color: #d97706;
        }

        .modal-buttons-urgence {
            display: flex;
            gap: 10px;
            margin-top: 20px;
        }

        .modal-buttons-urgence button {
            flex: 1;
            padding: 12px 20px;
            border: none;
            border-radius: 25px;
            font-family: serif;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .btn-primary-urgence {
            /* 18/09/2026 : le blanc sur #e74c3c donnait 3,82, sous les 4,5 exigés. #d24537 monte
               à 4,52 et garde la teinte. Le second ton, #c0392b, passait déjà à 5,44. */
            background: linear-gradient(135deg, #d24537, #c0392b);
            color: white;
        }

        .btn-secondary-urgence {
            /* 18/09/2026 : le blanc sur #95a5a6 donnait un contraste de 2,56, là où 4,5 est
               exigé. « Je gère, merci » était illisible. #6d7879 garde la teinte et monte à 4,55. */
            background: #6d7879;
            color: white;
        }

        .btn-primary-urgence:hover,
        .btn-secondary-urgence:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }

        /* Sur un téléphone, « Oui, j'aimerais qu'on m'aide » tient dans une demi-colonne.
           Les deux boutons passent l'un sous l'autre, et gardent leur pleine largeur. */
        @media (max-width: 480px) {
            .modal-buttons-urgence {
                flex-direction: column;
            }
        }

        /* ========== ANIMATION PLUME ÉCRITURE JADIS ========== */
        .writing-indicator {
            position: fixed;
            bottom: 100px;
            left: 50%;
            transform: translateX(-50%);
            display: none;
            align-items: center;
            gap: 10px;
            background: transparent;
            padding: 0;
            border-radius: 0;
            box-shadow: none;
            z-index: 1000;
        }

        .writing-indicator.show {
            display: flex;
            animation: fadeInUp 0.3s ease;
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateX(-50%) translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateX(-50%) translateY(0);
            }
        }

        .plume-anime {
            display: inline-block;
            animation: plume-reelle 0.8s ease-in-out infinite;
            transform-origin: 8px 18px;
        }

        @keyframes plume-reelle {
            0% {
                transform: rotate(-8deg) translate(0px, 0px) scale(1);
                opacity: 0.95;
            }
            20% {
                transform: rotate(-3deg) translate(1px, -1px) scale(1.01);
                opacity: 1;
            }
            40% {
                transform: rotate(5deg) translate(2px, -2px) scale(0.99);
                opacity: 0.96;
            }
            60% {
                transform: rotate(1deg) translate(1px, -1px) scale(1.01);
                opacity: 1;
            }
            80% {
                transform: rotate(-5deg) translate(0px, 0px) scale(0.995);
                opacity: 0.94;
            }
            100% {
                transform: rotate(-8deg) translate(0px, 0px) scale(1);
                opacity: 0.95;
            }
        }

        .writing-text {
            font-style: italic;
            color: #0619D1;
            font-size: 0.95rem;
        }

        /* ========== MODULE EXPORT JADIS FEEL ========== */
        .export-container {
            position: relative;
            display: inline-block;
        }

        .jadis-export-trigger {
            background: rgba(255, 255, 255, 0.3);
            border: 2px solid #2c2c2c;
            color: #6f5741;
            width: 44px;
            height: 44px;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .jadis-export-trigger svg {
            width: 20px;
            height: 20px;
        }

        .jadis-export-trigger:hover {
            background: rgba(216, 191, 216, 0.3);
            border-color: #d8bfd8;
            color: #52804E;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(216, 191, 216, 0.4);
        }

        .export-menu {
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            background: #f5f5f0;
            border: 1px solid rgba(212, 165, 116, 0.3);
            border-radius: 8px;
            padding: 6px;
            display: none;
            flex-direction: column;
            gap: 2px;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
            z-index: 1100;
            min-width: 120px;
        }

        .export-menu.active {
            display: flex;
            animation: menuSlideIn 0.2s ease-out;
        }

        .export-menu button {
            background: transparent;
            border: none;
            color: #4a4a4a;
            padding: 8px 12px;
            text-align: left;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 500;
            font-size: 14px;
            transition: background 0.2s ease;
        }

        .export-menu button:hover {
            background: rgba(216, 191, 216, 0.2);
            color: #6f5741;
        }

        @keyframes menuSlideIn {
            from { 
                opacity: 0; 
                transform: translateY(10px); 
            }
            to { 
                opacity: 1; 
                transform: translateY(0); 
            }
        }

        .jadis-export-toast {
            position: fixed;
            top: 80px;
            left: 50%;
            transform: translateX(-50%) translateY(-24px);
            width: 90%;
            max-width: 380px;
            background: #f5f5f0;
            border: 2px solid #52804E;
            border-radius: 12px;
            padding: 20px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            z-index: 2000;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: transform 0.3s ease, opacity 0.25s ease, visibility 0s linear 0.25s;
        }

        .jadis-export-toast.active {
            transform: translateX(-50%) translateY(0);
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
            transition: transform 0.3s ease, opacity 0.25s ease, visibility 0s linear 0s;
        }

        .toast-question {
            font-size: 16px;
            font-weight: 600;
            color: #6f5741;
            margin: 0 0 15px 0;
            text-align: center;
        }

        #jadisTargetFormat {
            color: #5497A1;
            font-weight: 700;
        }

        .toast-buttons {
            display: flex;
            gap: 10px;
        }

        .toast-btn-confirm {
            flex: 2;
            background: #5497A1;
            color: #fff;
            border: none;
            padding: 12px;
            border-radius: 8px;
            font-weight: 700;
            font-size: 15px;
            cursor: pointer;
            transition: background 0.2s ease;
        }

        .toast-btn-confirm:hover {
            background: #47818c;
        }

        .toast-btn-cancel {
            flex: 1;
            background: transparent;
            color: #c41e3a;
            border: 2px solid #c41e3a;
            padding: 12px;
            border-radius: 8px;
            font-weight: 600;
            font-size: 15px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .toast-btn-cancel:hover {
            background: #c41e3a;
            color: #fff;
        }

        .toast-status {
            font-size: 14px;
            color: #4a4a4a;
            margin: 0 0 12px 0;
            text-align: center;
        }

        .progress-track {
            height: 8px;
            background: rgba(84, 151, 161, 0.15);
            border-radius: 4px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: #5497A1;
            width: 0%;
            transition: width 0.3s ease;
            border-radius: 4px;
        }

        /* ========================================
           TOAST EXPORT - VERSION MOBILE
           ======================================== */
        @media (max-width: 768px) {
            .jadis-export-toast {
                top: 20px;
                width: 85%;
                max-width: 320px;
                padding: 15px;
                font-size: 14px;
            }
            
            .toast-question {
                font-size: 14px;
                margin-bottom: 12px;
            }
            
            .toast-btn-confirm,
            .toast-btn-cancel {
                padding: 10px;
                font-size: 13px;
            }
            
            .toast-status {
                font-size: 12px;
            }
        }


/* ============================================================
   PARTIE 2 : MOBILE RESPONSIVE
   Corrections CODEX appliquées (Solutions A prioritaires)
   Date: 3 février 2026
   ============================================================ */


/* ============================================================
   CORRECTION 1 : HEADER - flex-wrap (Codex Solution A)
   ============================================================ */

@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        row-gap: 8px;
    }
    
    .title {
        flex: 1 1 100%;
    }
    
    .export-zone {
        width: 100%;
        justify-content: flex-end;
    }
}


/* ============================================================
   CORRECTION 2 : MENU EXPORT - Largeur bornée (Codex Solution A)
   ============================================================ */

.export-menu {
    max-width: min(240px, 90vw);
    right: 0;
    left: auto;
}


/* ============================================================
   CORRECTION 3 : TOAST - bottom calculé + safe-area (Codex Solution A)
   ============================================================ */

@media (max-width: 768px) {
    .jadis-export-toast {
        bottom: calc(70px + 60px + env(safe-area-inset-bottom) + 12px);
        top: auto;
    }
}


/* ============================================================
   CORRECTION 4 : RUBAN - Ancrage mobile + bouton X (Codex Solution A + B)
   ============================================================ */

@media (max-width: 768px) {
    .ruban-encouragement {
        top: auto;
        bottom: calc(70px + 60px + env(safe-area-inset-bottom) + 10px);
    }
    
    /* ========================================
       RÈGLE CRITIQUE MOBILE - Toast et Bulles
       ======================================== */
    /* Fix: Toast et ruban doivent TOUJOURS être visibles sur mobile
       Sans z-index élevé, ils sont cachés par d'autres éléments */
    .toast,
    #toast-container,
    .ruban-encouragement,
    .jadis-export-toast {
        z-index: 9999 !important; /* Au-dessus de TOUT */
    }
    
    /* Toast mobile : largeur adaptée */
    .toast {
        min-width: 200px;
        max-width: 90%;
        font-size: 14px;
        padding: 12px 16px;
    }
    
    /* Ruban mobile : largeur et position optimales */
    .ruban-encouragement {
        width: 92%;
        left: 4%;
        right: 4%;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .bulle-close {
        width: 28px;
        height: 28px;
        top: 6px;
        right: 6px;
    }
}


/* ============================================================
   CORRECTION 5 : CHAT - Supprime vh + padding (Codex Solution A + B)
   ============================================================ */

.messages-area {
    max-height: none;
    min-height: 0;
}

/* ============================================================
   ROLLBACK STABLE (28/03/2026) - rubans + signature OK, pas de scroll
   Si besoin de revenir en arrière, supprimer CORRECTION 5b ci-dessous
   et laisser uniquement CORRECTION 5 (max-height: none) actif.
   ============================================================ */

/* CORRECTION 5b : Desktop - padding corrigé (max-height géré par JS setChatHeight) */
@media (min-width: 769px) {
    .messages-area {
        padding-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .messages-area {
        padding-bottom: calc(70px + 60px + env(safe-area-inset-bottom));
        scroll-padding-bottom: calc(70px + 60px + env(safe-area-inset-bottom));
    }
    
    /* Stabiliser chatbox mobile - empêcher montée/descente */
    .chat-container {
        position: relative;
        /* 20/10/2026 : la hauteur fixe calc(100vh - 200px) supposait que tout ce qui précède la boîte
           (marge de 70px + en-tête) mesure 200px. Sur téléphone l'en-tête passe sur trois lignes et
           l'ensemble dépasse 240px : le bas de la boîte, zone de saisie comprise, sortait de l'écran.
           La boîte prend maintenant la place restante dans le corps (flex: 1 posé dans .chat-container
           plus haut) : son bas coïncide avec le bas de l'écran visible. */
        overflow: hidden;
    }
    
    .messages-area {
        position: relative;
        max-height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .scroll-down-btn {
        background: rgba(162, 2, 184, 0.692) !important;
        bottom: calc(70px + 68px + env(safe-area-inset-bottom));
        right: 14px;
        width: 34px;
        height: 34px;
    }

    .scroll-down-btn svg {
        width: 16px;
        height: 16px;
    }
}


/* ============================================================
   CORRECTION 6 : BOUTON ENVOI MOBILE - icône flèche 44x44
   ============================================================ */
@media (max-width: 768px) {
  .input-area {
    align-items: center;
    gap: 8px;
  }

  .message-input {
    min-width: 0;
  }

  .send-button {
    position: relative;
    z-index: 9999;
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    overflow: hidden;
    white-space: nowrap;
    text-indent: -9999px;
    font-size: 0;
    line-height: 0;
    color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-image: linear-gradient(to right, #FF512F 0%, #DD2476 51%, #FF512F 100%);
    background-size: 200% auto;
    box-shadow: 0 4px 15px rgba(222, 98, 98, 0.3);
  }

  .send-button::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 20px;
    height: 20px;
    pointer-events: none;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5'/%3E%3Cpath d='M5 12l7-7 7 7'/%3E%3C/svg%3E");
  }

  .send-button:hover,
  .send-button:active {
    transform: none;
    background-position: right center;
  }

  .send-button:disabled::before {
    opacity: 0.65;
  }
}


/* ============================================================
   ACCESSIBILITÉ - Reduced Motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   OPTIMISATION MOBILE - Réduction animations lourdes
   ============================================================ */
@media (max-width: 768px) {
    /* Désactiver les animations longues sur mobile pour performance */
    body.fadeInGradient,
    body.fadeOutGradient {
        animation-duration: 0.5s !important; /* Au lieu de 12s */
    }
    
    /* Réduire animations phrase centrale */
    .phrase-centrale {
        animation-duration: 1s !important; /* Au lieu de 4-5s */
    }
    
    /* Simplifier les transitions hover sur mobile (inutiles) */
    .reaction-btn:hover,
    .settings-btn:hover,
    .sidebar-btn:hover {
        transform: none !important; /* Pas de hover sur tactile */
    }
    
    /* Réduire shadow blur (performances) */
    .toast,
    .jadis-export-toast,
    .message {
        box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    }
}

/* ========== BOUTON BONBON RETOUR HUMEUR ========== */
.btn-reset-mood-bonbon {
    background: linear-gradient(to right, #DE6262 0%, #FFB88C 51%, #DE6262 100%);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    min-width: 42px;
    border: none;
    box-shadow: 0 4px 12px rgba(222, 98, 98, 0.35);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-reset-mood-bonbon svg {
    stroke: #000;
}

.btn-reset-mood-bonbon:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(222, 98, 98, 0.5);
}

.btn-reset-mood-bonbon:active {
    transform: scale(0.98);
}

        /* Toast bienvenue alpha */
        #showWelcomeGoldust {
            position: fixed;
            inset: 0;
            pointer-events: none;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            box-sizing: border-box;
            opacity: 0;
            visibility: hidden;
            transition: opacity 1.05s cubic-bezier(0.4, 0, 0.2, 1);
        }

        #showWelcomeGoldust.visible {
            opacity: 1;
            visibility: visible;
        }

        #goldust-canvas {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }

        #welcome-text {
            position: relative;
            z-index: 10;
            display: inline-block;
            font-family: 'Courier Prime', 'Courier New', Courier, monospace;
            font-size: clamp(1.2rem, 4vw, 2rem);
            color: #6f5741;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            width: 0;
            max-width: 34ch;
            border-right: 2px solid transparent;
            margin-top: -11vh;
            letter-spacing: 0.02em;
            line-height: 1.25;
            opacity: 1;
            transform: translateY(0);
            transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        }

        #welcome-text.typing {
            animation: typing 2.5s steps(30, end) forwards, blink-caret 0.75s step-end infinite;
            border-right-color: #6f5741;
        }

        #welcome-text.erasing {
            opacity: 0;
            transform: translateY(-6px);
            border-right-color: transparent;
        }

        @keyframes typing {
            from { width: 0 }
            to { width: 100% }
        }

        @keyframes blink-caret {
            from, to { border-color: transparent; }
            50% { border-color: #6f5741; }
        }

        /* Toast bienvenue alpha - adaptation mobile dédiée :
           garde le texte original sur deux lignes et le sépare clairement de l'alpha. */
        @media (max-width: 768px) {
            #showWelcomeGoldust {
                justify-content: center;
                padding: 0 16px 0 78px;
                overflow: hidden;
            }

            #welcome-text {
                font-size: clamp(0.88rem, 3.9vw, 1rem);
                max-width: 17ch;
                /* margin-top aligné sur Y_départ = height*0.44 : décale le texte sous le ruban central */
                margin-top: 12vh;
                line-height: 1.28;
                white-space: pre-line;
                border-right-width: 0;
            }
        }

/* ============================================================
   MICRO KOFI - ChatBox input
   Icône rétro studio/broadcast intégrée dans le champ texte
   Prévoit aussi l'état futur .is-recording sans activer d'API voix
   ============================================================ */

.input-area .chatbox-input-shell {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.input-area .chatbox-input-shell .message-input {
    width: 100%;
    padding-right: 58px;
}

.input-area .chatbox-mic-link {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    background:
        radial-gradient(circle at 30% 28%, rgba(255,255,255,0.88), rgba(255,255,255,0.08) 42%, rgba(255,255,255,0) 58%),
        linear-gradient(145deg, rgba(255,255,255,0.82), rgba(195,204,214,0.92) 42%, rgba(129,140,154,0.95) 100%);
    border: 1px solid rgba(84, 92, 102, 0.22);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.72),
        0 3px 8px rgba(45, 50, 58, 0.14);
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        filter 0.22s ease,
        background 0.22s ease;
    z-index: 3;
}

.input-area .chatbox-mic-icon {
    width: 24px;
    height: 24px;
    display: block;
    filter: drop-shadow(0 1px 0 rgba(255,255,255,0.45));
}

.input-area .chatbox-mic-link:hover {
    transform: translateY(-50%) scale(1.045);
    background:
        radial-gradient(circle at 30% 28%, rgba(255,255,255,0.95), rgba(255,255,255,0.14) 42%, rgba(255,255,255,0) 58%),
        linear-gradient(145deg, rgba(255,255,255,0.96), rgba(214,223,232,0.98) 42%, rgba(150,161,174,1) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.82),
        0 4px 12px rgba(35, 40, 47, 0.18);
    filter: saturate(1.04);
}

.input-area .chatbox-mic-link:focus-visible {
    outline: 2px solid rgba(91, 107, 128, 0.45);
    outline-offset: 2px;
}

.input-area .chatbox-mic-link:active {
    transform: translateY(-50%) scale(0.98);
}

.input-area .chatbox-mic-link.is-recording {
    animation: mic-recording-pulse 1.5s ease-in-out infinite;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.82),
        0 0 0 5px rgba(185, 41, 41, 0.28),
        0 0 0 11px rgba(185, 41, 41, 0.10),
        0 4px 16px rgba(120, 20, 20, 0.22);
}

@keyframes mic-recording-pulse {
    0% {
        transform: translateY(-50%) scale(1);
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.82),
            0 0 0 4px rgba(185, 41, 41, 0.30),
            0 0 0 9px rgba(185, 41, 41, 0.10),
            0 4px 14px rgba(120, 20, 20, 0.20);
    }
    50% {
        transform: translateY(-50%) scale(1.06);
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.82),
            0 0 0 8px rgba(185, 41, 41, 0.22),
            0 0 0 17px rgba(185, 41, 41, 0.07),
            0 4px 22px rgba(120, 20, 20, 0.28);
    }
    100% {
        transform: translateY(-50%) scale(1);
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.82),
            0 0 0 4px rgba(185, 41, 41, 0.30),
            0 0 0 9px rgba(185, 41, 41, 0.10),
            0 4px 14px rgba(120, 20, 20, 0.20);
    }
}

@media (max-width: 768px) {
    .input-area .chatbox-input-shell .message-input {
        padding-right: 56px;
    }

    .input-area .chatbox-mic-link {
        width: 34px;
        height: 34px;
        right: 9px;
    }

    .input-area .chatbox-mic-icon {
        width: 22px;
        height: 22px;
    }
}


/* ================================================================
   LE RENDEZ-VOUS DANS L’AGENDA (15/10/2026)
   Les deux liens posés sous la phrase du soir du fil de demain.
   ================================================================ */
.rendez-vous-fil {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

/* Le rendez-vous posé à la demande de l'invité (17/11/2026) : l'encart s'illumine trois fois, puis reste. */
.rendez-vous-pose { margin: 10px 0 4px; padding: 8px 12px; border-radius: 12px; background: #fbf6ee; color: #3b1d3f; font-weight: 600; border: 1px solid #b0307f; animation: rendez-vous-lueur 1.2s ease-in-out 3; }
@keyframes rendez-vous-lueur { 0%, 100% { box-shadow: 0 0 0 0 rgba(176, 48, 127, 0); } 50% { box-shadow: 0 0 0 6px rgba(176, 48, 127, 0.35); } }
@media (prefers-reduced-motion: reduce) { .rendez-vous-pose { animation: none; } }

/* 20/10/2026 : le bleu des liens internet, pour qu'on les reconnaisse comme liens, et un petit
   calendrier devant (choix de la conceptrice sur aperçu). Le calendrier est tracé en prune et non
   en bleu : de la couleur du lien, il se fondait dans le texte. */
.lien-rendez-vous {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #1a0dab;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lien-rendez-vous::before {
  content: '';
  flex: none;
  width: 19px;
  height: 19px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='4' width='18' height='17' rx='2.5' fill='white' stroke='%233b1d3f' stroke-width='1.6'/%3E%3Cpath d='M3 6.5A2.5 2.5 0 0 1 5.5 4h13A2.5 2.5 0 0 1 21 6.5V9H3z' fill='%23c94a4a'/%3E%3Cpath d='M8 2.2v3.6M16 2.2v3.6' stroke='%233b1d3f' stroke-width='1.8' stroke-linecap='round'/%3E%3Cpath d='M7 13h2M11 13h2M15 13h2M7 17h2M11 17h2' stroke='%233b1d3f' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}


/* ================================================================
   LA QUESTION DE LA NOTIFICATION (04/11/2026)
   La phrase de Jadis et ses deux boutons, sous les liens du rendez-vous.
   Le 05/11/2026, la conceptrice a relevé des phrases illisibles et deux choix de même couleur :
   la question se détache de son explication, et le oui prend le trait du bouton Ko-fi en vert mousse.
   ================================================================ */
.notification-fil {
  position: relative;
  margin-top: 0.8rem;
  color: #2b1726;
  font-size: 0.98rem;
  line-height: 1.45;
}

.notification-fil__phrase {
  margin: 0 0 0.4rem;
  white-space: pre-line;
}

.notification-fil__question {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.notification-fil__boutons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin-top: 0.6rem;
}

.notification-fil__bouton {
  padding: 0;
  border: none;
  background: none;
  color: #2b1726;
  font: inherit;
  font-size: 14.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Le 05/11/2026, la conceptrice a relevé un oui sans aucune joie en retour :
   la première ligne se détache, et un petit papier portant la plume s'envole. */
.notification-fil__joie {
  margin: 0 0 0.25rem;
  color: #8e1171;
  font-size: 1.2rem;
  font-weight: 700;
  animation: notificationJoie 0.45s ease-out;
}

.notification-fil__envol {
  position: absolute;
  left: 40px;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 30px;
  border-radius: 3px;
  background: #fbf9e2;
  box-shadow: 0 3px 8px rgba(43, 23, 38, 0.35);
  font-size: 16px;
  pointer-events: none;
  animation: notificationEnvol 1.8s ease-out forwards;
}

@keyframes notificationJoie {
  0% { transform: scale(0.85); opacity: 0; }
  60% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes notificationEnvol {
  0% { transform: translate(0, 0) rotate(-6deg); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(150px, -170px) rotate(24deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .notification-fil__joie { animation: none; }
  .notification-fil__envol { display: none; }
}

.notification-fil__bouton--oui {
  padding: 8px 18px;
  border: 2px solid #2b1726;
  border-radius: 999px;
  background: linear-gradient(135deg, #6b8f3a, #3f6224);
  box-shadow: 0 3px 0 #2b1726;
  color: #fbf9e2;
  font-size: 15.6px;
  font-weight: 700;
  text-decoration: none;
}

.notification-fil__bouton:disabled {
  opacity: 0.5;
  cursor: default;
}

/* .settings-btn pose son propre affichage, qui l'emporterait sur l'attribut hidden du bouton. */
#notificationBouton[hidden] {
  display: none;
}


/* ================================================================
   LE PARTAGE APRÈS LE RENDEZ-VOUS (01/11/2026)
   Une phrase et un bouton, qui paraissent dès que l'invité a cliqué
   sur un des deux liens du rendez-vous.
   ================================================================ */

.partage-rdv {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 0.8rem;
}

.partage-rdv[hidden] {
  display: none;
}

.partage-rdv-phrase {
  margin: 0;
  font-style: italic;
}

/* Rose pâle et bordeaux : la même famille que la pastille du site */
.partage-rdv-bouton {
  padding: 7px 16px;
  border: 1.5px solid #e7b9d6;
  border-radius: 999px;

  background: #fbe9f4;
  color: #8e1171;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.partage-rdv-bouton:hover {
  background: #f6d3ea;
}


/* ================================================================
   LA CARTE MENTALE (20/10/2026)
   La fenêtre qui montre à l'invité le fil de ses pages. Allure validée sur aperçu
   le 20/10/2026 ; le fond est remplacé par celui de l'humeur du moment.
   ================================================================ */
.carte-voile {
  position: fixed;
  inset: 0;
  /* Prune foncé : le voile clair d'origine virait au taupe sur le fond de la page (20/10/2026). */
  background: rgba(40, 18, 45, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.carte-fenetre {
  width: min(560px, 92vw);
  max-height: 92dvh;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 22px 22px 18px;
  border-radius: 18px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.7) 2%, rgba(255, 182, 193, 0.6) 77%, rgba(255, 105, 180, 0.7) 100%);
  box-shadow: 0 10px 40px rgba(59, 29, 63, 0.25);
  color: #3b1d3f;
  font-family: serif;
}

.carte-titre {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: normal;
  text-align: center;
}

.carte-dessin {
  display: block;
  width: 100%;
  height: auto;
}

.carte-lien {
  stroke: rgba(59, 29, 63, 0.45);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.carte-branche {
  fill: rgba(255, 255, 255, 0.75);
  stroke: rgba(59, 29, 63, 0.5);
  stroke-width: 1;
}

.carte-centre {
  fill: rgba(255, 255, 255, 0.92);
  stroke: #3b1d3f;
  stroke-width: 1.5;
}

.carte-texte {
  font-family: serif;
  font-size: 13px;
  fill: #3b1d3f;
  text-anchor: middle;
  dominant-baseline: middle;
}

.carte-texte-centre {
  font-size: 15px;
}

.carte-phrase {
  margin: 8px 6px 14px;
  font-style: italic;
  font-size: 0.95rem;
  text-align: center;
}

.carte-boutons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.carte-garder,
.carte-autre {
  padding: 8px 18px;
  border-radius: 20px;
  font-family: serif;
  font-size: 0.9rem;
  cursor: pointer;
}

.carte-garder {
  border: none;
  background: #3b1d3f;
  color: #fff;
}

.carte-autre {
  border: 1px solid rgba(59, 29, 63, 0.3);
  background: rgba(255, 255, 255, 0.8);
  color: #3b1d3f;
}

/* Les deux liens du rendez-vous, sous la phrase de Jadis. */
.carte-rendez-vous {
  display: flex;
  justify-content: center;
  margin: -6px 0 14px;
}


/* === EN-TÊTE COMPACT SUR TÉLÉPHONE — 07/11/2026 ===

   Objet : l'en-tête tient sur une seule ligne sous 768 px de large.
   Contexte : jusqu'au 07/11/2026, l'en-tête et sa marge occupaient 259 px sur un écran de 640 px.
   Constat : le 07/11/2026, une invitée sur téléphone ne voyait plus la ligne d'écriture.
   Piste : l'avatar, le titre et le bouton d'export se rangent côte à côte.
   Limite : le mot « En ligne » n'est plus affiché sur téléphone. */

@media (max-width: 768px) {

    /* L'en-tête perd sa marge de 70 px et passe sur une ligne. */
    .header {
        margin-top: 8px;
        padding: 6px 10px;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
    }

    /* L'avatar passe à 36 px pour laisser la place au titre. */
    .header .jadis-avatar {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
    }

    /* Le titre occupe la place restante, sur une ligne. */
    .header .title {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        font-size: 1.05rem;
        white-space: nowrap;
    }

    /* Le bouton d'export se place au bout de la ligne. */
    .header .export-zone {
        flex: 0 0 auto;
        width: auto;
        margin-left: auto;
    }

    /* Le mot « En ligne » est retiré pour faire tenir la ligne. */
    .header .status {
        display: none;
    }
}


/* === MARGE DES MESSAGES SUR TÉLÉPHONE — 07/11/2026 ===

   Objet : la zone des messages garde 12 px de marge basse sous 768 px de large.
   Contexte : la marge de 130 px réservait la place d'une ligne d'écriture posée par-dessus les messages.
   Constat : le 07/11/2026, la ligne d'écriture se place sous les messages, et ces 130 px restent vides.
   Piste : les messages récupèrent cette hauteur. */

@media (max-width: 768px) {

    .messages-area {
        padding-bottom: 12px;
        scroll-padding-bottom: 12px;
    }
}


/* === LIGNE D'ÉCRITURE SUR TÉLÉPHONE — 07/11/2026 ===

   Objet : le texte d'invitation tient dans le champ sous 768 px de large.
   Contexte : sur un écran de 360 px, le champ laissait 90 px au texte d'invitation.
   Constat : le 07/11/2026, « Écris ton message ici... » mesurait 148 px et se coupait.
   Piste : le champ perd du remplissage, et le texte d'invitation raccourcit dans le script. */

@media (max-width: 768px) {

    /* La zone autour du champ perd sa hauteur inutile. */
    .input-area {
        padding: 8px 10px;
        min-height: 0;
    }

    /* Le champ garde 46 px à droite pour le micro, et un texte trop long finit par trois points. */
    .input-area .chatbox-input-shell .message-input {
        padding: 10px 46px 10px 12px;
        text-overflow: ellipsis;
    }
}


/* === BOUTONS DE CHRONIQUE SUR TÉLÉPHONE — 07/11/2026 ===

   Objet : les deux boutons de chronique tiennent sur une ligne qui glisse sous 768 px de large.
   Contexte : sur un écran de 360 px, ces boutons occupaient deux lignes et 71 px de haut.
   Constat : le 07/11/2026, ces deux lignes réduisaient encore la place des messages.
   Limite : le second bouton est coupé au bord de l'écran, et se découvre en glissant du doigt. */

@media (max-width: 768px) {

    /* Les boutons restent sur une ligne, et la ligne glisse sans barre visible. */
    .chronique-choices {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: 0 10px 4px;
        scrollbar-width: none;
    }

    .chronique-choices::-webkit-scrollbar {
        display: none;
    }

    /* Chaque bouton garde son texte entier sur une ligne. */
    .chronique-choices button {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}


/* === BANDEAU SUR TÉLÉPHONE — 07/11/2026 ===

   Objet : le bandeau rubanEncouragement reste à l'écran sous 768 px de large.
   Contexte : sur téléphone, le bandeau gardait un décalage vers la gauche et sortait de l'écran.
   Piste : le bandeau se place à droite de la barre latérale, sans décalage. */

@media (max-width: 768px) {

    .ruban-encouragement {
        transform: none;
        left: 68px;
        right: 8px;
        width: auto;
    }
}


/* === FENÊTRE D'ANNONCE — 09/11/2026 ===

   Objet : la fenêtre d'annonce des 8 messages s'affiche au centre, sur un fond assombri.
   Contexte : le 07/11/2026, l'annonce passait par un petit bandeau clair.
   Constat : le 09/11/2026, la conceptrice a jugé ce bandeau envahissant, sa croix invisible, puis le fond prune trop proche du violet du deuil.
   Piste : une fenêtre pêche douce, des dates en gras fuchsia, une croix fuchsia, des cotillons sur la fenêtre et des confettis à l'ouverture. */

/* Le voile assombrit tout l'écran, au-dessus de la fenêtre « Mon envol ». */
.annonce-voile {
    position: fixed;
    inset: 0;
    z-index: 10030;
    display: grid;
    place-items: center;
    padding: 18px;
    box-sizing: border-box;
    background: rgba(30, 12, 26, 0.72);
}

/* Le fond pêche douce éblouit moins qu'un fond blanc sur un écran réglé très lumineux (choix de la conceptrice, 09/11/2026). */
.annonce-fenetre {
    position: relative;
    width: min(400px, 100%);
    max-height: calc(100% - 36px);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 26px 24px 20px;
    border-radius: 16px;
    background: #f0c9b5;
    color: #3d1f17;
    font-family: Georgia, serif;
}

/* Le titre se lit en premier, centré. */
.annonce-titre {
    margin: 0 30px 14px;
    font-size: 1.25rem;
    font-weight: 400;
    text-align: center;
    color: #3d1f17;
}

/* Chaque paragraphe garde de l'air autour de lui. */
.annonce-texte,
.annonce-prompt {
    margin: 0 0 12px;
    font-size: 1rem;
    line-height: 1.55;
}

/* Les dates et le nombre de messages ressortent en fuchsia foncé. */
.annonce-fenetre strong {
    color: #a3125f;
    font-weight: 700;
}

/* Le prompt du jour se détache dans un cadre, prêt à recopier. */
.annonce-prompt {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.45);
}

/* Le prompt du jour et son icône copier tiennent sur une ligne : le texte à gauche, l'icône à droite (10/11/2026). */
.annonce-prompt {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.annonce-prompt span {
    flex: 1;
}

/* L'icône copier garde 40 px pour le doigt, comme la croix, et reprend le bleu-vert des icônes de la boîte de conversation. */
.annonce-copier {
    flex: none;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.6);
    color: #318285;
    cursor: pointer;
}

/* Après une copie réussie, l'icône se remplit du bleu de la conversation pendant 1,4 seconde. */
.annonce-copier.copie-faite svg {
    fill: #1b6f84;
    stroke: #1b6f84;
}

/* La croix fuchsia se voit sur le fond pêche, et garde 40 px pour le doigt. */
.annonce-fermer {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #d01c80;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

/* Le bouton ferme la fenêtre et invite à commencer. */
.annonce-bouton {
    display: block;
    margin: 18px auto 0;
    padding: 11px 30px;
    border: none;
    border-radius: 28px;
    background: #d01c80;
    color: #ffffff;
    font-family: Georgia, serif;
    font-size: 1rem;
    cursor: pointer;
}

/* Le clavier voit où il se trouve. */
.annonce-fermer:focus-visible,
.annonce-bouton:focus-visible {
    outline: 2px solid #a3125f;
    outline-offset: 3px;
}

/* Les textes et les boutons passent au-dessus des cotillons. */
.annonce-fenetre > :not(.annonce-cotillon) {
    position: relative;
    z-index: 1;
}

/* La croix garde sa place en haut à droite, au-dessus des cotillons. */
.annonce-fenetre > .annonce-fermer {
    position: absolute;
    z-index: 2;
}

/* Un cotillon reste posé sur le bord de la fenêtre, sans recevoir les clics. */
.annonce-cotillon {
    position: absolute;
    z-index: 0;
    pointer-events: none;
}

/* Un ruban de cotillon est un petit rectangle. */
.annonce-cotillon--ruban {
    width: 7px;
    height: 16px;
    border-radius: 2px;
}

/* Un rond de cotillon est une pastille. */
.annonce-cotillon--rond {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

/* La fenêtre passe au-dessus des confettis qui tombent dans le voile : aucun confetti ne couvre le texte (10/11/2026). */
.annonce-fenetre {
    z-index: 1;
}

/* Un confetti tombe derrière la fenêtre d'annonce, dans le voile, en tournant, puis s'efface (10/11/2026). */
.annonce-confetti {
    position: fixed;
    top: -14px;
    z-index: 0;
    width: 8px;
    height: 13px;
    border-radius: 2px;
    pointer-events: none;
    animation: annonce-chute 2.4s ease-in forwards;
}

@keyframes annonce-chute {
    to {
        transform: translateY(105vh) rotate(540deg);
        opacity: 0.2;
    }
}

/* Aucun confetti pour un appareil réglé pour réduire les animations. */
@media (prefers-reduced-motion: reduce) {
    .annonce-confetti {
        display: none;
    }
}

/* La phrase du prompt est un bouton : même apparence que le texte, soulignée au survol (20/11/2026). */
.annonce-lancer { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.annonce-lancer:hover, .annonce-lancer:focus-visible { text-decoration: underline; }
