:root {
        --sidebar-width: 260px;
        --sidebar-bg: #0f172a;
        --sidebar-link: #94a3b8;
        --sidebar-link-hover: #e2e8f0;
        --sidebar-active-bg: rgba(255,255,255,0.1);
        --topbar-height: 56px;
        --main-bg: #f8fafc;

        /* ===== Libermotus Design System ===== */
        --lm-sage: #6B7F5C; --lm-sage-dark: #4A5A3E; --lm-sage-light: #8FA67D;
        --lm-earth: #8B7355; --lm-earth-light: #B89B7A;
        --lm-cream: #F8F6F0; --lm-cream-dark: #EDE8DC;
        --lm-gold: #C4A35A; --lm-dark: #2C2C2C;
    }

    h1, h2, h3, h4, h5, h6 { font-family: 'Cormorant Garamond', serif; }
    html, body { height: 100%; background: var(--main-bg); font-family: 'Inter', system-ui, sans-serif; }

    /* ===== App shell ===== */
    .app-wrapper { display: flex; height: 100vh; overflow: hidden; }
    .app-sidebar { width: var(--sidebar-width); background: var(--sidebar-bg); color: #fff; display: flex; flex-direction: column; }
    .app-sidebar .brand { height: var(--topbar-height); display: flex; align-items: center; padding: 0 1.25rem; font-size: 1.25rem; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
    .app-sidebar .nav-section { flex: 1; padding: 1rem 0; overflow-y: auto; }
    .app-sidebar .nav-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 1.25rem; color: var(--sidebar-link); transition: all .15s; border-radius: 0; }
    .app-sidebar .nav-link:hover, .app-sidebar .nav-link:focus { color: var(--sidebar-link-hover); background: rgba(255,255,255,0.04); }
    .app-sidebar .nav-link.active { color: #fff; background: var(--sidebar-active-bg); position: relative; }
    .app-sidebar .nav-link.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--lm-gold); border-top-right-radius: 3px; border-bottom-right-radius: 3px; }
    .app-sidebar .sidebar-footer { padding: 0.75rem 1.25rem; border-top: 1px solid rgba(255,255,255,0.06); font-size: 0.875rem; color: var(--sidebar-link); }

    .offcanvas-sidebar { background: var(--sidebar-bg) !important; color: #fff; }
    .offcanvas-sidebar .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
    .offcanvas-sidebar .nav-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 1.25rem; color: var(--sidebar-link) !important; transition: all .15s; border-radius: 0; }
    .offcanvas-sidebar .nav-link:hover, .offcanvas-sidebar .nav-link:focus { color: var(--sidebar-link-hover) !important; background: rgba(255,255,255,0.04); }
    .offcanvas-sidebar .nav-link.active { color: #fff !important; background: var(--sidebar-active-bg); position: relative; }
    .offcanvas-sidebar .nav-link.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--lm-gold); border-top-right-radius: 3px; border-bottom-right-radius: 3px; }

    .app-topbar { display: flex; height: var(--topbar-height); background: #fff; border-bottom: 1px solid #e9ecef; align-items: center; padding: 0 1rem; gap: 0.75rem; position: sticky; top: 0; z-index: 1020; }
    .app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
    .app-content { flex: 1; overflow-y: auto; padding: 1.5rem 2rem; }
    /* footer sits in .app-main (pinned under the scroll area): keep its text
       aligned with .app-content instead of touching the viewport edges */
    .app-main > footer { padding-left: 2rem; padding-right: 2rem; }
    @media (max-width: 991.98px) { .app-sidebar { display: none !important; } .app-content { padding: 1rem 1rem 4.5rem; } .app-main > footer { padding-left: 1rem; padding-right: 1rem; } }

    /* ===== Typo & éléments LiberMotus ===== */
    .lm-title { font-family: 'Cormorant Garamond', serif; font-weight: 600; color: var(--lm-sage-dark); }
    .lm-section-title { font-family: 'Cormorant Garamond', serif; font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; color: var(--lm-sage-dark); margin-bottom: 1rem; }
    .lm-section-subtitle { color: var(--lm-earth); font-size: 1.1rem; font-weight: 300; margin-bottom: 3rem; }
    .lm-divider { width: 60px; height: 3px; background: var(--lm-gold); margin: 1.5rem auto; border-radius: 2px; }
    .lm-lead-quote { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; font-style: italic; color: var(--lm-sage-dark); border-left: 3px solid var(--lm-gold); padding-left: 1.5rem; margin: 2rem 0; }
    .lm-hero { position: relative; display: flex; align-items: center; padding: 3rem 0 4rem; overflow: hidden; }
    .lm-hero h1 { font-family: 'Cormorant Garamond', serif; font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 600; color: var(--lm-sage-dark); line-height: 1.1; margin-bottom: 1.5rem; }
    .lm-hero .subtitle { font-size: 1.15rem; color: var(--lm-earth); font-weight: 300; max-width: 520px; }
    .lm-section { padding: 3rem 0; }

    .lm-btn-primary { background-color: var(--lm-sage); border-color: var(--lm-sage); color: white; font-weight: 600; padding: 0.8rem 2rem; border-radius: 50px; font-size: 1.05rem; transition: all 0.3s; box-shadow: 0 4px 15px rgba(107,127,92,0.3); text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; border-width: 1px; border-style: solid; }
    .lm-btn-primary:hover { background-color: var(--lm-sage-dark); border-color: var(--lm-sage-dark); color: white; transform: translateY(-2px); box-shadow: 0 6px 25px rgba(107,127,92,0.4); }
    .lm-btn-outline { background-color: transparent; border: 2px solid var(--lm-sage); color: var(--lm-sage-dark); font-weight: 600; padding: 0.8rem 2rem; border-radius: 50px; font-size: 1.05rem; transition: all 0.3s; text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; }
    .lm-btn-outline:hover { background-color: var(--lm-sage); color: white; transform: translateY(-2px); }
    .lm-btn-cta { background-color: var(--lm-gold); border-color: var(--lm-gold); color: white; font-weight: 700; padding: 1rem 2.5rem; border-radius: 50px; font-size: 1.15rem; transition: all 0.3s; box-shadow: 0 4px 20px rgba(196,163,90,0.4); text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; border-width: 1px; border-style: solid; }
    .lm-btn-cta:hover { background-color: #B08D45; border-color: #B08D45; color: white; transform: translateY(-3px); box-shadow: 0 8px 30px rgba(196,163,90,0.5); }
    /* compact variant used by the admin list header actions */
    .lm-btn-sm { padding: 0.5rem 1.5rem; font-size: 0.9rem; }

    /* Bootstrap reads every card padding/color from the --bs-card-* variables,
       which it only declares on .card - lm-card replaces that class, so they
       are redeclared here (.card-body / .card-header would lose their padding
       otherwise). Spacers are set to 1.5rem to match the p-4 used on the
       public pages' cards. */
    .lm-card {
        --bs-card-spacer-y: 1.5rem;
        --bs-card-spacer-x: 1.5rem;
        --bs-card-title-spacer-y: 0.5rem;
        --bs-card-title-color: ;
        --bs-card-subtitle-color: ;
        --bs-card-border-width: 1px;
        --bs-card-border-color: var(--bs-border-color-translucent);
        --bs-card-border-radius: 12px;
        --bs-card-box-shadow: none;
        --bs-card-inner-border-radius: 12px;
        --bs-card-cap-padding-y: 0.5rem;
        --bs-card-cap-padding-x: 1rem;
        --bs-card-cap-bg: rgba(var(--bs-body-color-rgb), 0.03);
        --bs-card-cap-color: ;
        --bs-card-height: ;
        --bs-card-color: var(--bs-body-color);
        --bs-card-bg: #fff;
        --bs-card-img-overlay-padding: 1rem;
        --bs-card-group-margin: 0.75rem;
        position: relative;
        min-width: 0;
        word-wrap: break-word;
        background-clip: border-box;
        background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); border: 1px solid #e9ecef; transition: transform 0.2s, box-shadow 0.2s; overflow: hidden;
    }
    .lm-card-hover:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,0.08); }
    .lm-card-cream { background: var(--lm-cream); border-color: var(--lm-cream-dark); }

    .lm-icon-circle { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .lm-icon-circle.lm-icon-sage { background: rgba(107,127,92,0.1); color: var(--lm-sage); }
    .lm-icon-circle.lm-icon-gold { background: rgba(196,163,90,0.1); color: var(--lm-gold); }
    .lm-icon-circle.lm-icon-earth { background: rgba(139,115,85,0.1); color: var(--lm-earth); }

    .text-sage { color: var(--lm-sage) !important; }
    .lm-breadcrumb { background: transparent; }
    .lm-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: var(--lm-earth); }
    .lm-breadcrumb-active { color: var(--lm-earth) !important; }

    .lm-page-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
    .lm-page-header h1, .lm-page-header h2, .lm-page-header h3, .lm-page-header h4 { margin: 0; }

    .lm-empty-state { text-align: center; padding: 3rem 1.5rem; }
    .lm-empty-state .lm-empty-icon { font-size: 3rem; color: var(--lm-cream-dark); margin-bottom: 1rem; }
    .lm-empty-state .lm-empty-text { color: var(--lm-earth); font-size: 1.05rem; margin-bottom: 0.5rem; }

    /* ===== Bandeau d'information (site, singleton Cockpit `banniere`) ===== */
    /* Discret sous la même gouttière que .app-content : le texte grandit,
       le lien reste à droite et passe SOUS le texte en flex-wrap dès qu'il
       n'y a plus de place (demande utilisateur). */
    .lm-banner {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem 1.5rem;
        padding: 0.75rem 2rem;
        background: var(--lm-cream);
        border-bottom: 1px solid var(--lm-cream-dark);
        border-left: 3px solid var(--lm-gold);
        font-size: 0.95rem;
        line-height: 1.5;
    }
    .lm-banner-text { flex: 1 1 22rem; min-width: 0; }
    .lm-banner-text p { margin: 0; }
    .lm-banner-text p + p { margin-top: 0.35rem; }
    .lm-banner-text a { color: var(--lm-earth); text-decoration: underline; }
    .lm-banner-link {
        flex: 0 0 auto;
        margin-left: auto;
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        padding: 0.4rem 1.1rem;
        border-radius: 50px;
        background: var(--lm-sage);
        color: #fff;
        font-weight: 600;
        font-size: 0.9rem;
        text-decoration: none;
        transition: background 0.2s;
    }
    .lm-banner-link:hover, .lm-banner-link:focus { background: var(--lm-sage-dark); color: #fff; }
    @media (max-width: 991.98px) {
        .lm-banner { padding: 0.75rem 1rem; }
    }

    /* ===== Éditeur WYSIWYG du bandeau (console super admin, Quill) ===== */
    #banner-editor .ql-toolbar.ql-snow {
        border: 1px solid var(--bs-border-color);
        border-bottom: none;
        border-radius: 0.5rem 0.5rem 0 0;
        background: #fff;
    }
    #banner-editor .ql-container.ql-snow {
        border: 1px solid var(--bs-border-color);
        border-radius: 0 0 0.5rem 0.5rem;
        background: #fff;
        min-height: 9rem;
        font-family: inherit;
        font-size: 1rem;
    }
    #banner-editor .ql-editor { padding: 0.85rem 1rem; }
    #banner-editor .ql-editor.ql-blank::before {
        color: var(--bs-secondary-color);
        font-style: normal;
        left: 1rem;
        right: 1rem;
    }

    /* ===== Formulaires / auth ===== */
    .lm-auth-wrapper { min-height: 100vh; background: var(--lm-cream); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
    .lm-auth-card { background: #fff; border-radius: 16px; border: 1px solid var(--lm-cream-dark); box-shadow: 0 10px 40px rgba(0,0,0,0.06); width: 100%; max-width: 430px; padding: 2.5rem; }
    .lm-auth-card .lm-auth-title { font-family: 'Cormorant Garamond', serif; font-size: 2rem; font-weight: 600; color: var(--lm-sage-dark); }
    .lm-form-control { border-radius: 10px; border: 1px solid var(--lm-cream-dark); background: var(--lm-cream); padding: 0.75rem 1rem; }
    .lm-form-control:focus { border-color: var(--lm-sage); box-shadow: 0 0 0 0.2rem rgba(107,127,92,0.15); background: #fff; }

    /* Plain Bootstrap controls inside the auth card pick up the system,
       so the auth pages themselves need no design-specific classes. */
    .lm-auth-card .form-control { border-radius: 10px; border: 1px solid var(--lm-cream-dark); background: var(--lm-cream); padding: 0.75rem 1rem; }
    .lm-auth-card .form-control:focus { border-color: var(--lm-sage); box-shadow: 0 0 0 0.2rem rgba(107,127,92,0.15); background: #fff; }
    .lm-auth-card .btn { border-radius: 50px; font-weight: 600; }
    .lm-auth-card .btn-primary { background-color: var(--lm-sage); border-color: var(--lm-sage); box-shadow: 0 4px 15px rgba(107,127,92,0.3); }
    .lm-auth-card .btn-primary:hover, .lm-auth-card .btn-primary:focus { background-color: var(--lm-sage-dark); border-color: var(--lm-sage-dark); }
    .lm-auth-card .btn-dark { background-color: var(--lm-dark); border-color: var(--lm-dark); }
    .lm-auth-card .btn-outline-secondary { border-color: var(--lm-sage); color: var(--lm-sage-dark); }
    .lm-auth-card .btn-outline-secondary:hover { background-color: var(--lm-sage); border-color: var(--lm-sage); color: #fff; }
    .lm-auth-card .alert { border-radius: 12px; }
    .lm-auth-card a:not(.text-decoration-none) { color: var(--lm-sage-dark); font-weight: 600; }

    /* ===== Language switcher (sidebar, dark) ===== */
    .lang-switcher-btn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); color: var(--sidebar-link-hover); border-radius: 8px; font-size: 0.85rem; padding: 0.5rem 0.75rem; transition: background .15s, color .15s, border-color .15s; }
    .lang-switcher-btn:hover, .lang-switcher-btn:focus, .lang-switcher-btn:active, .lang-switcher-btn.show { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); color: #fff; box-shadow: none; }
    .lang-switcher .dropdown-menu { font-size: 0.875rem; }
    .lang-switcher .dropdown-item.active { background: var(--lm-sage); color: #fff; }
    /* light variant (auth pages, light backgrounds) */
    .lang-switcher-light .lang-switcher-btn { background: #fff; border-color: var(--lm-cream-dark); color: var(--lm-earth); }
    .lang-switcher-light .lang-switcher-btn:hover, .lang-switcher-light .lang-switcher-btn:focus,
    .lang-switcher-light .lang-switcher-btn:active, .lang-switcher-light .lang-switcher-btn.show { background: #fff; border-color: var(--lm-sage); color: var(--lm-sage-dark); }
    .lang-switcher-auth { max-width: 190px; }

    /* ===== Contenu d'étape /learn (HTML converti à l'import) ===== */
    .lm-step-content { max-width: 100%; overflow-wrap: break-word; }
    .lm-step-content p { margin-bottom: 1rem; line-height: 1.65; }
    .lm-step-content h2, .lm-step-content h3, .lm-step-content h4 {
        font-family: 'Cormorant Garamond', serif;
        color: var(--lm-sage-dark);
        margin: 1.5rem 0 0.75rem;
    }
    .lm-step-content ul, .lm-step-content ol { margin: 0 0 1rem; padding-left: 1.35rem; }
    .lm-step-content li { margin-bottom: 0.35rem; line-height: 1.6; }
    .lm-step-content blockquote {
        border-left: 3px solid var(--lm-gold);
        background: var(--lm-cream);
        color: var(--lm-earth);
        padding: 0.75rem 1rem;
        margin: 0 0 1rem;
        border-radius: 0 8px 8px 0;
    }
    .lm-step-content hr { margin: 1.5rem 0; opacity: 0.25; }
    .lm-step-content a { color: var(--lm-sage-dark); font-weight: 600; }
    .lm-step-content code { background: var(--lm-cream); padding: 0.1rem 0.35rem; border-radius: 4px; }

    /* Tableaux : traits de séparation + padding, et défilement horizontal sur
       mobile (le wrapping div est ajouté au rendu par CmsHtml::render). */
    .lm-table-wrap { overflow-x: auto; max-width: 100%; margin-bottom: 1rem; }
    .lm-step-content table {
        width: 100%;
        border-collapse: collapse;
        margin: 0;
        font-size: 0.95rem;
        background: #fff;
    }
    .lm-step-content th, .lm-step-content td {
        border: 1px solid rgba(44, 44, 44, 0.18);
        padding: 0.65rem 0.9rem;
        text-align: left;
        vertical-align: top;
        line-height: 1.5;
    }
    .lm-step-content thead th {
        background: var(--lm-cream);
        color: var(--lm-sage-dark);
        font-weight: 700;
        white-space: nowrap;
    }
    .lm-step-content tbody tr:nth-child(even) { background: rgba(44, 44, 44, 0.03); }
    .lm-step-content tbody tr:hover { background: rgba(107, 127, 92, 0.07); }

    /* ===== /learn : onglets (catégorie / outils numérotés / parcours) + mini-recherche ===== */
    .lm-tabs { border-bottom: 2px solid var(--lm-cream-dark); flex-wrap: wrap; gap: 0.25rem; }
    .lm-tabs .nav-link {
        border: 0; background: transparent; color: var(--lm-earth); font-weight: 600; font-size: 0.95rem;
        padding: 0.6rem 1rem; border-radius: 10px 10px 0 0; display: inline-flex; align-items: center;
        gap: 0.45rem; white-space: nowrap;
    }
    .lm-tabs .nav-link:hover, .lm-tabs .nav-link:focus { color: var(--lm-sage-dark); background: rgba(107,127,92,0.08); box-shadow: none; }
    .lm-tabs .nav-link.active {
        color: var(--lm-sage-dark); background: #fff; border: 0; border-bottom: 3px solid var(--lm-gold);
        margin-bottom: -2px; border-radius: 10px 10px 0 0;
    }
    .lm-search-icon { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); color: var(--lm-earth); pointer-events: none; }
    .lm-search-input { padding-left: 2.6rem; border-radius: 50px; }
    /* pastille « Outil 22 » de la liste numérotée */
    .lm-tool-no {
        font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 1rem; color: var(--lm-sage-dark);
        background: var(--lm-cream); border: 1px solid var(--lm-cream-dark); border-radius: 50px;
        padding: 0.3rem 0.8rem; white-space: nowrap; min-width: 6.5rem; text-align: center;
    }
    .lm-no-results { padding: 2.5rem 1rem; text-align: center; color: var(--lm-earth); }

    /* ===== /learn : menu flottant des outils (FAB + offcanvas) ===== */
    /* Fixe en bas à droite : z-index 1030 = sous le backdrop du tiroir (1040)
       et l'offcanvas (1045) Bootstrap, donc le bouton s'estompe derrière.
       bottom: 4.25rem = au-dessus du footer, qui reste TOUJOURS visible
       (hors zone scrollable, flex-shrink-0 après </main>) et ferait ~3.3rem
       (py-3 + ligne small) : à 1.25rem le FAB le chevauchait. */
    .lm-tools-fab {
        position: fixed; right: 1.25rem; bottom: 4.25rem; z-index: 1030;
        display: inline-flex; align-items: center; gap: 0.5rem;
        padding: 0.7rem 1.25rem; border-radius: 50px; border: 1px solid var(--lm-sage-dark);
        background: var(--lm-sage); color: #fff; font-weight: 600; font-size: 0.95rem;
        box-shadow: 0 6px 20px rgba(74, 90, 62, 0.35); cursor: pointer;
        transition: all 0.3s;
    }
    /* Petit écran : les deux spans du footer passent en 2 lignes (flex-wrap +
       gap-2, soit ~5rem au lieu de 3.3rem) : on remonte d'autant le FAB. */
    @media (max-width: 575.98px) {
        .lm-tools-fab { bottom: 5.75rem; }
    }
    .lm-tools-fab:hover, .lm-tools-fab:focus {
        background: var(--lm-sage-dark); border-color: var(--lm-sage-dark);
        color: #fff; transform: translateY(-2px); box-shadow: 0 8px 25px rgba(74, 90, 62, 0.45);
    }
    .lm-tools-fab .bi { font-size: 1.15rem; }
    .lm-tools-offcanvas { width: min(26rem, 100vw); }
    .lm-tools-menu-list { overflow-y: auto; }
    .lm-tools-menu-list .list-group-item { border-color: var(--lm-cream-dark); transition: background 0.2s, border-color 0.2s; }
    .lm-tools-menu-list .list-group-item:hover,
    .lm-tools-menu-list .list-group-item:focus { background: rgba(107, 127, 92, 0.06); border-color: var(--lm-sage-light); }
    /* Outil courant dans le tiroir : fond sage clair + trait d'accent */
    .lm-tools-menu-list .lm-tools-menu-current { background: rgba(107, 127, 92, 0.1); border-left: 3px solid var(--lm-gold); }

    /* ===== /book : lignes de l'index + navigation précédent/suivant ===== */
    /* Ligne-sommaire de l'index : survol sage + chevron qui glisse */
    .lm-book-line { border-color: var(--lm-cream-dark); border-radius: 10px; transition: background 0.2s, border-color 0.2s, transform 0.2s; }
    .lm-book-line:hover, .lm-book-line:focus { background: rgba(107,127,92,0.06); border-color: var(--lm-sage-light); transform: translateX(4px); }
    .lm-book-line .bi-chevron-right { transition: transform 0.2s; }
    .lm-book-line:hover .bi-chevron-right { transform: translateX(4px); color: var(--lm-sage-dark); }

    /* Mini-résumé sous le titre (champ Cockpit resumeCourt) : 2 lignes
       max sur desktop, gris discret pour rester un aperçu, pas un contenu */
    .lm-book-teaser {
        font-size: 0.88rem; line-height: 1.5; color: var(--lm-earth);
        margin-top: 0.35rem; font-weight: 300;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
        overflow: hidden;
    }
    @media (min-width: 768px) { .lm-book-teaser { -webkit-line-clamp: 3; } }

    /* Boutons Précédent / Suivant (page chapitre) : pilotule + titre du
       chapitre adjacent, le suivant prend le style primaire pour guider la
       lecture ; sous 480px les deux passent en pleine largeur. */
    .lm-book-nav-btn { flex: 1 1 16rem; max-width: 26rem; padding: 0.7rem 1.4rem; }
    .lm-book-nav-btn .lm-book-nav-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
    .lm-book-nav-btn .lm-book-nav-text small {
        font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
        font-weight: 700; opacity: 0.75;
    }
    .lm-book-nav-btn .lm-book-nav-text strong {
        display: block; font-size: 0.95rem; font-weight: 600; line-height: 1.3;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .lm-book-nav-next { margin-left: auto; text-align: right; }
    @media (max-width: 479.98px) {
        .lm-book-nav-btn { max-width: none; width: 100%; }
        .lm-book-nav-next { margin-left: 0; }
    }

    /* ===== /assistant : carte modèle + conversation ===== */
    /* Carte d'état du modèle (fichiers ONNX dans la Cache Storage) */
    .lm-asst-status { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; }
    .lm-asst-dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; flex-shrink: 0; }
    .lm-asst-dot.missing { background: #dc3545; }
    .lm-asst-dot.installed { background: var(--lm-gold); }
    .lm-asst-dot.ready { background: var(--lm-sage); }
    .lm-asst-dot.loading { background: var(--lm-gold); animation: lm-asst-pulse 1s ease-in-out infinite; }
    @keyframes lm-asst-pulse { 50% { opacity: 0.35; } }
    .lm-asst-files { font-size: 0.85rem; color: var(--lm-earth); font-family: ui-monospace, monospace; }

    /* Conversation : bulles + zone scrollable */
    .lm-asst-thread {
        display: flex; flex-direction: column; gap: 0.9rem;
        max-height: min(55vh, 520px); overflow-y: auto; padding: 0.25rem;
    }
    .lm-asst-msg { max-width: 88%; padding: 0.7rem 1rem; border-radius: 14px; line-height: 1.55; font-size: 0.97rem; white-space: pre-wrap; overflow-wrap: anywhere; }
    .lm-asst-msg.user { align-self: flex-end; background: var(--lm-sage); color: #fff; border-bottom-right-radius: 4px; }
    .lm-asst-msg.bot { align-self: flex-start; background: var(--lm-cream-dark, #f2efe8); border: 1px solid var(--lm-sage-light, #d9e0d2); border-bottom-left-radius: 4px; }
    .lm-asst-msg.bot.thinking { color: var(--lm-earth); font-style: italic; }
    /* Choix du parcours rendus sous la bulle-question (structure, jamais le LLM) */
    .lm-asst-choices { display: flex; flex-direction: column; gap: 0.6rem; max-width: 88%; }
    .lm-asst-choice { text-align: left; background: #fff; border: 1px solid var(--lm-sage-light, #d9e0d2); border-radius: 12px; padding: 0.75rem 1rem; font-size: 0.95rem; font-weight: 600; color: var(--lm-ink, #2f3a2a); cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.15s; }
    .lm-asst-choice:hover, .lm-asst-choice:focus-visible { border-color: var(--lm-sage); background: var(--lm-cream-dark, #f2efe8); transform: translateY(-1px); }
    .lm-asst-choice:disabled { opacity: 0.55; cursor: default; transform: none; }
    .lm-asst-msg a.lm-btn-primary { display: inline-block; margin-top: 0.6rem; }

    /* ===== /wizard : parcours guidé (arbre embarqué, 100 % navigateur) ===== */
    .lm-wz-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
    .lm-wz-badge { display: inline-block; background: var(--lm-sage); color: #fff; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; padding: 0.4rem 1rem; border-radius: 50px; }
    .lm-wz-nav { display: flex; gap: 0.75rem; }
    .lm-wz-navbtn { padding: 0.5rem 1.25rem; font-size: 0.9rem; }
    .lm-wz-title { font-size: 1.25rem; font-weight: 700; line-height: 1.35; margin: 0 0 1rem; }
    .lm-wz-aide { color: var(--lm-earth); font-size: 0.95rem; margin: 0 0 1.5rem; }
    .lm-wz-options { display: flex; flex-direction: column; gap: 1rem; }
    .lm-wz-option { text-align: left; background: #fff; border: 1px solid var(--lm-sage-light, #d9e0d2); border-radius: 12px; padding: 1.05rem 1.4rem; font-size: 1rem; font-weight: 600; color: var(--lm-ink, #2f3a2a); cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.15s; }
    .lm-wz-option:hover, .lm-wz-option:focus-visible { border-color: var(--lm-sage); background: var(--lm-cream-dark, #f2efe8); transform: translateY(-1px); }
    .lm-wz-final { text-align: center; padding: 1.5rem 0 1rem; }
    .lm-wz-final .lm-btn-primary { margin-top: 1.25rem; }
    .lm-wz-finaltext { color: var(--lm-earth); margin: 0.5rem 0 0; }

    /* Markdown rendu dans la bulle bot (renderMd : DOM createElement only).
       pre-wrap reste actif sur la bulle : les \n entre lignes de paragraphe
       sont voulus ; on neutralise seulement les marges par défaut des blocs. */
    .lm-asst-msg :is(p, ul, ol, h2, h3, h4, h5, h6, hr, pre) { margin: 0; }
    .lm-asst-msg p + p, .lm-asst-msg p + :is(ul, ol), .lm-asst-msg :is(ul, ol) + p,
    .lm-asst-msg p + h2, .lm-asst-msg p + h3, .lm-asst-msg p + h4, .lm-asst-msg p + h5, .lm-asst-msg p + h6,
    .lm-asst-msg :is(ul, ol) + h2, .lm-asst-msg :is(ul, ol) + h3 { margin-top: 0.55rem; }
    .lm-asst-msg :is(h2, h3, h4, h5, h6) { font-weight: 700; line-height: 1.3; }
    .lm-asst-msg h2 { font-size: 1.05rem; }
    .lm-asst-msg h3 { font-size: 1.02rem; }
    .lm-asst-msg :is(h4, h5, h6) { font-size: 1rem; }
    .lm-asst-msg :is(ul, ol) { padding-left: 1.25rem; }
    .lm-asst-msg :is(ul, ol) + :is(ul, ol) { margin-top: 0.35rem; }
    .lm-asst-msg li + li { margin-top: 0.15rem; }
    .lm-asst-msg li > :is(p, ul, ol) { margin: 0; }
    .lm-asst-msg hr { border: 0; border-top: 1px dashed rgba(74, 90, 62, 0.35); margin: 0.55rem 0; }
    .lm-asst-msg code { background: rgba(74, 90, 62, 0.12); padding: 0.05em 0.35em; border-radius: 4px; font-size: 0.9em; }
    .lm-asst-msg a { color: var(--lm-sage-dark); text-decoration: underline; }


    <!-- lm-fade EN PAUSE : les éléments .lm-fade s'affichent immédiatement.
         Le masquage est neutralisé et l'observer plus bas n'est pas émis. -->
    .lm-fade { opacity: 1; transform: none; }
