/* Extrait de student_dashboard.html. Ordre historique : 8. */
/* ── Textes et titres lisibles ── */
        #tpWorkspace *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(.tp-textbox):not(.tp-textbox-inner):not(textarea):not(input):not(select) {
            font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif !important;
            font-size: 12pt !important;
        }
        /* ── Inputs/textareas élève : JAMAIS z-index:1 ici ── */
        #tpWorkspace textarea,
        #tpWorkspace input[type="text"],
        #tpWorkspace input[type="number"] {
            font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif !important;
            font-size: 12pt !important;
            box-sizing: border-box !important;
            position: relative !important;
            z-index: 30 !important;
            pointer-events: auto !important;
            background: #f0f4ff !important;
            color: #1e293b !important;
            border: 2px solid #667eea !important;
            cursor: text !important;
        }
        /* 26/09/2026 — Arial 12 pt partout dans le sujet (présentation des sujets
           de baccalauréat), listes de choix comprises. */
        #tpWorkspace select {
            font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif !important;
            font-size: 12pt !important;
        }
        /* Textboxes : font-size et overflow gérés en JS via setProperty('important') */
        #tpWorkspace .tp-textbox-inner,
        #tpWorkspace .tp-textbox-inner * {
            font-family: Arial, sans-serif !important;
            overflow: hidden !important;
        }
        
        /* Textes principaux noirs sur fond clair */
        #tpWorkspace p,
        #tpWorkspace li,
        #tpWorkspace span,
        #tpWorkspace div:not([style*="background:linear-gradient"]):not([style*="background:#667eea"]):not([style*="background:#3b82f6"]):not([style*="background:#10b981"]) {
            color: #1e293b !important;
        }
        
        /* Titres bien visibles */
        #tpWorkspace h1,
        #tpWorkspace h2,
        #tpWorkspace h3,
        #tpWorkspace h4,
        #tpWorkspace h5,
        #tpWorkspace h6 {
            color: #0f172a !important;
            font-weight: 700 !important;
        }
        
        /* Texte blanc sur fond sombre/coloré */
        #tpWorkspace [style*="background:linear-gradient"] *,
        #tpWorkspace [style*="background:#667eea"] *,
        #tpWorkspace [style*="background:#3b82f6"] * {
            color: white !important;
        }
        
        /* Tailles de titres */
        #tpWorkspace h1 { font-size: 24pt !important; }
        #tpWorkspace h2 { font-size: 20pt !important; }
        #tpWorkspace h3 { font-size: 16pt !important; }
        #tpWorkspace h4 { font-size: 14pt !important; }
        
        /* Forcer le background transparent pour les spans */
        #tpWorkspace span:not([style*="background:linear-gradient"]):not([style*="background:#"]) {
            background: transparent !important;
        }
        
        /* Listes bien formatées */
        #tpWorkspace ul,
        #tpWorkspace ol {
            padding-left: 25px !important;
            margin: 10px 0 !important;
        }
        
        #tpWorkspace li {
            line-height: 1.6 !important;
            margin-bottom: 8px !important;
        }
        
        /* Tableaux lisibles */
        #tpWorkspace table {
            border-collapse: collapse !important;
        }
        
        #tpWorkspace th,
        #tpWorkspace td {
            padding: 10px !important;
            border: 1px solid #e5e7eb !important;
        }
        
        #tpWorkspace th {
            background: #f3f4f6 !important;
            color: #1e293b !important;
            font-weight: 700 !important;
        }
        
        #tpWorkspace td {
            color: #1e293b !important;
        }
        
        /* Contenu des zones de TP */
        #wsTPContentPart1,
        #wsTPContentPart2,
        #wsTPContentPart3,
        #wsTPContentPart4 {
            background: white !important;
        }
        
        /* ── Zones de réponse libre (wsResponsePart) ── */
        .ws-response-area,
        #wsResponsePart1, #wsResponsePart2, #wsResponsePart3, #wsResponsePart4 {
            pointer-events: auto !important;
            user-select: text !important;
            cursor: text !important;
            position: relative !important;
            z-index: 30 !important;
            background: #f0f4ff !important;
            color: #1e293b !important;
            border: 2px solid #667eea !important;
        }
        /* ── Tout le contenu TP : pointer-events auto par défaut ── */
        #wsTPContentPart1, #wsTPContentPart2,
        #wsTPContentPart3, #wsTPContentPart4,
        #wsTPContentPart1 *, #wsTPContentPart2 *,
        #wsTPContentPart3 *, #wsTPContentPart4 * {
            pointer-events: auto;
        }
        /* Seule exception : annotations prof en lecture seule */
        .tp-textbox, .tp-textbox-inner, .tp-textbox * {
            pointer-events: none !important;
        }

        /*
         * ✅ FIX LISIBILITÉ — Applique couleur sombre UNIQUEMENT aux éléments
         * sans couleur inline. Les sélecteurs :not() doivent être CHAÎNÉS SANS ESPACE
         * (un espace = sélecteur descendant, pas pseudo-classe chaînée).
         */
        [id^="wsTPContentPart"] *:not([style^="color:"]):not([style*=";color:"]):not([style*="; color:"]) {
            color: #1e293b !important;
        }

        /*
         * ✅ FIX BLOCS DARK (DELTALABapp) — 2 étapes :
         * 1. Le container fond sombre reçoit une couleur claire explicite
         * 2. Ses enfants sans couleur inline héritent cette couleur claire
         * Note : les enfants avec couleur inline ne sont pas touchés (protégés par :not() ci-dessus)
         */

        /* Étape 1 : couleur claire sur les containers sombres eux-mêmes */
        [id^="wsTPContentPart"] [style*="background:#0d1a2e"],
        [id^="wsTPContentPart"] [style*="background:#111f32"],
        [id^="wsTPContentPart"] [style*="background:#1e3a5f"],
        [id^="wsTPContentPart"] [style*="background:#0a0f1a"],
        [id^="wsTPContentPart"] [style*="background:linear-gradient(135deg,#0d1a2e"],
        [id^="wsTPContentPart"] [style*="background:linear-gradient(135deg,#111f32"],
        [id^="wsTPContentPart"] [style*="background:linear-gradient(135deg,#1e3a5f"] {
            color: #e2e8f0 !important;
        }

        /* Étape 2 : enfants sans couleur inline héritent #e2e8f0 du parent sombre */
        [id^="wsTPContentPart"] [style*="background:#0d1a2e"] *:not([style^="color:"]):not([style*=";color:"]):not([style*="; color:"]),
        [id^="wsTPContentPart"] [style*="background:#111f32"] *:not([style^="color:"]):not([style*=";color:"]):not([style*="; color:"]),
        [id^="wsTPContentPart"] [style*="background:#1e3a5f"] *:not([style^="color:"]):not([style*=";color:"]):not([style*="; color:"]),
        [id^="wsTPContentPart"] [style*="background:#0a0f1a"] *:not([style^="color:"]):not([style*=";color:"]):not([style*="; color:"]),
        [id^="wsTPContentPart"] [style*="background:linear-gradient(135deg,#0d1a2e"] *:not([style^="color:"]):not([style*=";color:"]):not([style*="; color:"]),
        [id^="wsTPContentPart"] [style*="background:linear-gradient(135deg,#111f32"] *:not([style^="color:"]):not([style*=";color:"]):not([style*="; color:"]),
        [id^="wsTPContentPart"] [style*="background:linear-gradient(135deg,#1e3a5f"] *:not([style^="color:"]):not([style*=";color:"]):not([style*="; color:"]) {
            color: inherit !important;
        }

        /* Volet 5 — même logique */
        #wsTPContentPart5 *:not([style^="color:"]):not([style*=";color:"]):not([style*="; color:"]) {
            color: #1e293b !important;
        }
        #wsTPContentPart5 [style*="background:#0d1a2e"],
        #wsTPContentPart5 [style*="background:#111f32"],
        #wsTPContentPart5 [style*="background:#1e3a5f"],
        #wsTPContentPart5 [style*="background:#0a0f1a"] {
            color: #e2e8f0 !important;
        }
        #wsTPContentPart5 [style*="background:#0d1a2e"] *:not([style^="color:"]):not([style*=";color:"]):not([style*="; color:"]),
        #wsTPContentPart5 [style*="background:#111f32"] *:not([style^="color:"]):not([style*=";color:"]):not([style*="; color:"]),
        #wsTPContentPart5 [style*="background:#1e3a5f"] *:not([style^="color:"]):not([style*=";color:"]):not([style*="; color:"]) {
            color: inherit !important;
        }
