        @import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Montserrat:wght@600&display=swap');

        :root {
            --primary-color: #007a4d;
            --secondary-color: #f7a823;
            --background-color: #f8f9fa;
            --text-color: #343a40;
            --header-bg: #ffffff;
            --nav-bg: #e9ecef;
            --nav-hover-bg: #d8dcdf;
            --border-color: #dee2e6;
            --shadow: 0 4px 15px rgba(0,0,0,0.1);
            --toc-width: 350px;
        }
        
        /* Style pour la mise en évidence temporaire de la cible du scroll */
        .scroll-target-highlight {
            transition: background-color 0.5s ease;
            background-color: #f7d423 !important;
        }

        .landing-search-container {
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 600px;
    margin: 0 auto 2em;
    position: relative;
    padding: 0 10px;
    box-sizing: border-box;
    gap: 8px; /* Espacement entre les éléments enfants */
}

@media (min-width: 768px) {
    .landing-search-container {
        width: 80%;
        padding: 0;
    }
}
        
        .landing-search-input {
            width: 100%;
            padding: 15px 20px;
            border: 2px solid var(--primary-color);
            border-radius: 30px;
            font-size: 1.1em;
            box-shadow: var(--shadow);
            transition: all 0.3s ease;
        }
        
        .landing-search-input:focus {
            outline: none;
            border-color: var(--secondary-color);
            box-shadow: 0 0 10px rgba(247, 168, 35, 0.3);
        }
        
        .landing-search-results {
            display: none;
            position: absolute;
            width: 100%;
            max-height: 300px;
            overflow-y: auto;
            background: white;
            border: 1px solid var(--border-color);
            border-radius: 0 0 10px 10px;
            box-shadow: var(--shadow);
            z-index: 100;
            margin-top: -5px;
        }
        
        .landing-search-result-item {
            padding: 12px 20px;
            border-bottom: 1px solid var(--border-color);
            cursor: pointer;
            transition: background 0.2s;
        }
        
        .landing-search-result-item:hover {
            background: var(--nav-bg);
        }
        
        .landing-search-result-item .doc-title {
            font-weight: bold;
            color: var(--primary-color);
        }
        
        .landing-search-result-item .doc-meta {
            font-size: 0.9em;
            color: #666;
        }
        
        .landing-search-result-item .doc-excerpt {
            font-size: 0.9em;
            color: #555;
            margin-top: 5px;
            font-style: italic;
        }
        
        .install-prompt {
            display: none;
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: white;
            padding: 15px 20px;
            border-radius: 8px;
            box-shadow: var(--shadow);
            z-index: 1000;
            max-width: 90%;
            text-align: center;
        }
        
        .install-prompt button {
            background: var(--primary-color);
            color: white;
            border: none;
            padding: 8px 15px;
            border-radius: 5px;
            margin: 5px;
            cursor: pointer;
        }
        
        .install-prompt button.secondary {
            background: var(--nav-bg);
            color: var(--text-color);
        }
        
        .styled-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.95em;
            margin: 25px 0;
        }

        .styled-table th, .styled-table td {
            border: 1px solid var(--border-color);
            padding: 12px 15px;
            text-align: left;
            vertical-align: top;
        }

        .styled-table thead th {
            background-color: var(--primary-color);
            color: var(--header-bg);
            font-weight: 600;
        }

        .styled-table tbody tr:nth-child(even) {
            background-color: var(--nav-bg);
        }

        .styled-table tbody tr:hover {
            background-color: var(--nav-hover-bg);
        }

        .styled-table ul {
            margin: 0.5rem 0 0 0;
            padding-left: 20px;
            font-size: 0.9em;
            color: #555;
        }

        .section-header {
            font-weight: bold;
        }

        html {
            scroll-behavior: smooth;
        }

        body {
            font-family: 'Lato', sans-serif;
            margin: 0;
            padding: 0;
            background-color: var(--background-color);
            color: var(--text-color);
            line-height: 1.7;
            overflow-x: hidden;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }

        input, textarea, [contenteditable] {
            -webkit-user-select: text;
            -moz-user-select: text;
            -ms-user-select: text;
            user-select: text;
        }

        #landing-page {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            padding: 2rem;
            text-align: center;
        }
        
        #landing-page h1 {
            font-family: 'Montserrat', sans-serif;
            color: var(--primary-color);
            font-size: 2.8em;
            margin-bottom: 0.5em;
        }

        #landing-page p {
            font-size: 1.2em;
            color: #555;
            max-width: 800px;
            margin-bottom: 2.5em;
        }

        .document-selection {
            display: flex;
            gap: 2rem;
            flex-wrap: wrap;
            justify-content: center;
        }

        .doc-card {
            background: var(--header-bg);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 1.5rem 2rem;
            width: 350px;
            box-shadow: var(--shadow);
            cursor: pointer;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            text-align: left;
            display: flex;
            flex-direction: column;
        }

        .doc-card:hover {
            transform: translateY(-10px);
            box-shadow: 0 8px 25px rgba(0,0,0,0.15);
        }

        .doc-card h2 {
            font-family: 'Montserrat', sans-serif;
            color: var(--primary-color);
            margin-top: 0;
            font-size: 1.3em;
            border-bottom: 2px solid var(--secondary-color);
            padding-bottom: 10px;
        }
        
        #scrollTopBtn, #scrollBottomBtn {
            position: fixed;
            right: 20px;
            width: 50px;
            height: 50px;
            border: none;
            border-radius: 50%;
            background-color: rgba(51, 51, 51, 0.7);
            color: white;
            cursor: pointer;
            font-size: 18px;
            z-index: 99;
            display: none;
            transition: opacity 0.3s;
        }
        
        #scrollTopBtn {
            bottom: 80px;
        }
        
        #scrollBottomBtn {
            bottom: 20px;
        }
        
        #scrollTopBtn:hover, #scrollBottomBtn:hover {
            background-color: rgba(85, 85, 85, 0.9);
        }
        
        .show-buttons {
            display: block !important;
            opacity: 1;
        }
        
        .hide-buttons {
            opacity: 0;
            display: none !important;
        }
        
        #scrollTopBtn {
            bottom: 80px;
        }
        
        #scrollBottomBtn {
            bottom: 20px;
        }
        
        #scrollTopBtn:hover, #scrollBottomBtn:hover {
            background-color: #555;
        }

        .document-viewer {
            display: none;
        }
        
        .container {
            display: flex;
            min-height: 100vh;
            position: relative;
        }

        #toc1, #toc2, #toc3, #toc4, #toc5, #toc6, #toc7, #toc8, #toc9, #toc10, #toc11, #toc12, #toc13, #toc14, #toc15, #toc16, #toc17, #toc18, #toc19, #toc20 {
            display: none !important;
        }

        .toc h2 {
            font-family: 'Montserrat', sans-serif;
            color: var(--primary-color);
            margin-top: 0;
            font-size: 1.4em;
            border-bottom: 2px solid var(--secondary-color);
            padding-bottom: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .back-button {
            font-size: 0.8em;
            font-weight: bold;
            text-decoration: none;
            color: var(--primary-color);
            background: var(--nav-hover-bg);
            padding: 5px 10px;
            border-radius: 5px;
            cursor: pointer;
        }
        
        .search-container {
            position: relative;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .searchInput {
            width: 100%;
            padding: 12px;
            border: 1px solid var(--border-color);
            border-radius: 5px;
            box-sizing: border-box;
            font-size: 1em;
            font-family: 'Lato', sans-serif;
        }
        
        .search-controls {
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .search-nav {
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: 4px;
            padding: 5px 10px;
            cursor: pointer;
            transition: background 0.3s;
        }
        
        .search-nav:hover {
            background: var(--secondary-color);
        }
        
        .search-nav:disabled {
            background: #ccc;
            cursor: not-allowed;
        }
        
        .match-count {
            font-size: 0.9em;
            color: #666;
            min-width: 50px;
            text-align: center;
        }
        
        .toc-list {
            overflow-y: auto;
            flex-grow: 1;
        }

        .toc-list ul {
            list-style-type: none;
            padding-left: 0;
        }

        .toc-list li a {
            display: block;
            text-decoration: none;
            color: var(--text-color);
            padding: 6px 15px;
            border-radius: 5px;
            font-weight: 700;
            transition: background-color 0.3s, color 0.3s;
            font-size: 0.95em;
        }

        .toc-list li a:hover, .toc-list li a.active {
            background-color: var(--nav-hover-bg);
            color: var(--primary-color);
        }
        
        .toc-list ul ul { padding-left: 15px; }
        .toc-list ul ul li a { font-weight: 400; font-size: 0.9em;}
        .toc-list ul ul ul { padding-left: 15px; }
        .toc-list ul ul ul li a { font-size: 0.85em; color: #555; }
        .toc-list ul ul ul ul { padding-left: 15px; }
        .toc-list ul ul ul ul li a { font-size: 0.8em; color: #666; }

        main {
            padding-top: 60px;
            flex-grow: 1;
            padding: 20px 40px;
            min-width: 0;
            position: relative;
            transition: margin-left 0.4s ease;
        }

        header {
            background-color: var(--header-bg);
            padding: 20px 40px;
            border-bottom: 1px solid var(--border-color);
            box-shadow: var(--shadow);
            margin: -20px -40px 30px -40px;
            text-align: center;
        }
        
        header h1 {
            color: var(--primary-color);
            font-family: 'Montserrat', sans-serif;
            margin: 0;
        }
        
        header p {
            color: #666;
            margin: 5px 0 0;
        }

        section {
            margin-bottom: 40px;
            padding-top: 20px;
        }

        h2 {
            font-family: 'Montserrat', sans-serif;
            color: var(--primary-color);
            border-bottom: 1px solid #ccc;
            padding-bottom: 8px;
        }

        h3, h4, h5 {
            text-align: center;
            font-family: 'Montserrat', sans-serif;
            color: var(--primary-color);
            border-bottom: 1px solid #ccc;
            padding-bottom: 8px;
        }
        
        h3 { color: #333; border-color: #ddd;}
        h4 { color: #444; border: none; font-style: italic;}
        h5 { color: #555; border: none; font-size: 1em;}

        .article {
            background: #fff;
            padding: 15px 20px;
            margin-bottom: 15px;
            border-left: 4px solid var(--secondary-color);
            border-radius: 0 5px 5px 0;
            box-shadow: 0 2px 5px rgba(0,0,0,0.05);
            transition: all 0.3s ease-in-out;
        }
        
        .article ul {
            padding-left: 20px;
        }

        .no-results {
            display: none;
            text-align: center;
            padding: 40px;
            font-size: 1.2em;
            color: #777;
        }
        
        .highlight {
            background-color: #ffeb3b;
            padding: 0 2px;
            border-radius: 2px;
        }
        
        .highlight.current {
            background-color: var(--secondary-color);
            color: white;
            font-weight: bold;
        }
        
        .search-results-bar {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            background-color: var(--header-bg);
            padding: 10px 20px;
            border-bottom: 1px solid var(--border-color);
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: space-between;
            transform: translateY(0);
            transition: transform 0.3s ease;
        }

        .search-results-bar.hidden {
            transform: translateY(-100%);
        }

        .search-results-info {
            font-size: 0.9em;
            color: var(--primary-color);
        }

        .close-results-bar {
            background: none;
            border: none;
            color: var(--primary-color);
            cursor: pointer;
            font-size: 1.2em;
            padding: 5px;
        }

        #floating-toc-container {
            display: none;
            position: fixed;
            top: 15px;
            left: 15px;
            z-index: 1001;
        }

        #toc-toggle-button {
            width: 45px;
            height: 45px;
            background: var(--primary-color);
            border: none;
            border-radius: 50%;
            color: white;
            font-size: 24px;
            cursor: pointer;
            box-shadow: var(--shadow);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background-color 0.3s, transform 0.3s;
        }

        #toc-toggle-button:hover {
            background: var(--secondary-color);
            transform: scale(1.1);
        }

        #floating-toc-panel {
            position: fixed;
            top: 0;
            left: 0;
            width: var(--toc-width);
            height: 100vh;
            background-color: var(--nav-bg);
            border-right: 1px solid var(--border-color);
            box-shadow: 5px 0 15px rgba(0,0,0,0.1);
            transform: translateX(-100%);
            transition: transform 0.4s ease;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            padding: 25px;
            box-sizing: border-box;
            overflow-y: auto;
        }

        #floating-toc-panel.open {
            transform: translateX(0);
        }
        
        .main-content-shifted {
            margin-left: var(--toc-width);
        }
        table { max-width: 100%; overflow-x: auto; border-collapse: collapse; margin-top: 1em; }
        td, th { border: 1px solid #ddd; padding: 8px; text-align: left; }
        th {background-color: #f2f2f2; }

        @media (max-width: 768px) {
    .container {
        flex-direction: column;
        height: auto;
    }

    main {
        padding: 15px;
        margin-left: 0 !important;
    }

    .document-selection {
        flex-direction: column;
        gap: 1rem;
        align-items: center; /* Ajout pour centrer les cartes */
        width: 100%;
        max-width: 400px; /* Largeur maximale du conteneur */
        margin: 0 auto; /* Centrage du conteneur */
        padding: 0 15px; /* Padding pour les petits écrans */
        box-sizing: border-box;
    }

    .doc-card {
        width: 100%;
        max-width: 350px; /* Largeur maximale des cartes */
        margin-bottom: 1rem;
        padding: 1.2rem; /* Légèrement augmenté pour meilleure lisibilité */
        margin-left: auto; /* Centrage supplémentaire */
        margin-right: auto;
    }

    .doc-card h2 {
        font-size: 1.1em;
    }

    /* Reste de votre configuration mobile existante */
    #floating-toc-panel {
        width: 85%;
        max-width: 300px;
        padding: 15px;
    }

    #toc-toggle-button {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    #landing-page h1 {
        font-size: 1.8em;
        margin-top: 20px;
    }
    
    #landing-page p {
        font-size: 1em;
        margin-bottom: 1.5em;
    }
    
    .landing-search-input {
        padding: 12px 15px;
        font-size: 1em;
    }

     /* Styles pour tous les H1 et H2 du site */
    h1, h2 {
        word-break: break-word; /* Force le retour à la ligne pour les mots longs */
        overflow-wrap: break-word; /* Alternative pour les navigateurs modernes */
    }

    /* Styles spécifiques pour les titres des documents */
    .document-viewer header h1, .document-viewer header h2 {
        font-size: 5vw; /* Taille de police basée sur la largeur de la vue */
        white-space: normal; /* Permet le retour à la ligne */
    }
}

        @media (max-width: 480px) {
            header {
                padding: 15px !important;
            }
            
            .article {
                padding: 10px !important;
            }

            #floating-toc-panel {
                width: 90%;
                padding: 10px;
            }

            #landing-page h1 {
                font-size: 1.5em;
            }

            #landing-page p {
                font-size: 0.9em;
            }
            
            .install-prompt {
                width: 90%;
                bottom: 10px;
                padding: 10px;
            }
        }

