/* ============================================================================
 * eleve.css — Styles de l'interface élève
 * ----------------------------------------------------------------------------
 * Phase 1 (Sessions F1, F2). Charge par eleves/index.html.
 *
 * Contraintes (spec 00 §9 « Contraintes d'affichage — interface élève ») :
 *   - Compatible vidéoprojection en classe (grandes polices, contrastes forts,
 *     boutons larges identifiables à distance)
 *   - Compatible smartphone (mobile-first, layout vertical, cibles ≥ 44×44 px)
 *   - Pas de hover requis (tactile)
 *   - Pas de raccourcis clavier indispensables
 *
 * Charte visuelle : palette Sauge écosystème (style.css fournit la base).
 * ============================================================================ */


/* Note : palette --warning/--success/--error définie globalement dans style.css
 * depuis Session H-a (auparavant override local nécessaire). */


/* Reset doux */
.eleve-body {
    background: var(--background);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.eleve-body * {
    box-sizing: border-box;
}

/* Skip link a11y (spec 15) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-dark);
    color: var(--white);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 1000;
}
.skip-link:focus { top: 0; }

:focus-visible {
    outline: 3px solid var(--primary-dark);
    outline-offset: 2px;
}


/* ----------------------------------------------------------------------------
 * Header minimal (avec bandeau mode visiteur si applicable)
 * ---------------------------------------------------------------------------- */

.eleve-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}
.eleve-header h1 {
    font-size: 18px;
    color: var(--text);
    margin: 0;
}

.bandeau-visiteur {
    background: var(--warning-bg);
    color: var(--text);
    text-align: center;
    padding: 10px 16px;
    font-size: 14px;
    border-bottom: 2px solid var(--warning);
}
.bandeau-visiteur strong { color: var(--text); }

/* ----------------------------------------------------------------------------
 * Mode intégration (iframe ENT ONE, blog…) — classe `embed-mode` sur <html>,
 * posée par le script inline de eleves/index.html (?embed=1 ou page dans un iframe).
 * Header, footer et navbar écosystème masqués ; barre compacte avec lien
 * « Ouvrir dans un nouvel onglet » (secours si le cadre est trop petit).
 * ---------------------------------------------------------------------------- */

.barre-embed { display: none; }
.embed-mode .barre-embed {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 12px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-light);
}
.barre-embed-titre {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--text);
}
.barre-embed-titre svg { width: 16px; height: 16px; }
.barre-embed-lien {
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    padding: 4px 10px;
    background: var(--secondary);
    white-space: nowrap;
}
.barre-embed-lien:hover,
.barre-embed-lien:focus-visible { background: var(--primary-light); }

.embed-mode .eleve-header,
.embed-mode .eleve-footer,
.embed-mode .eco-navbar,
.embed-mode [data-ecosystem-nav] {
    display: none !important;
}
.embed-mode body.eco-has-navbar { padding-top: 0 !important; }
.embed-mode .eleve-body { min-height: 0; background: var(--white); }
.embed-mode .eleve-main { padding-top: 12px; }

/* ----------------------------------------------------------------------------
 * Container principal des écrans
 * ---------------------------------------------------------------------------- */

.eleve-main {
    flex: 1;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 20px 80px;
}

.eleve-ecran {
    display: none; /* caché par défaut, JS active 1 écran à la fois */
}
.eleve-ecran.is-actif {
    display: block;
}

/* ----------------------------------------------------------------------------
 * Écran d'accueil (spec 04)
 * ---------------------------------------------------------------------------- */

.eleve-meta {
    text-align: center;
    color: var(--text-light);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.eleve-titre {
    text-align: center;
    color: var(--text);
    font-size: 30px;
    font-weight: 500;
    margin-bottom: 24px;
}

.eleve-encart {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 16px;
}
.eleve-encart-label {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 6px;
}
.eleve-encart-contenu {
    font-size: 17px;
    color: var(--text);
    line-height: 1.5;
}

/* Bouton TTS (▶ Écouter) inline */
.btn-tts-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    margin-left: 8px;
    vertical-align: middle;
    min-height: 36px;
    min-width: 36px;
}
.btn-tts-inline:hover { background: var(--primary-light); }
.btn-tts-inline.is-playing { background: var(--primary-light); border-color: var(--primary-dark); }

/* Mention RGPD discrete (spec 16) */
.eleve-rgpd {
    background: var(--secondary);
    padding: 12px 16px;
    border-radius: var(--radius-small);
    font-size: 13px;
    color: var(--text-light);
    text-align: center;
    margin: 16px 0;
}

/* Saisie pseudo */
.eleve-pseudo-bloc {
    margin: 24px 0;
}
.eleve-pseudo-bloc label {
    display: block;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    font-size: 16px;
}
.eleve-pseudo-bloc input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-small);
    font-size: 17px;
    color: var(--text);
    background: var(--white);
    height: 48px;
    transition: border-color 0.15s ease;
}
.eleve-pseudo-bloc input:focus {
    outline: none;
    border-color: var(--primary-dark);
}
.eleve-pseudo-erreur {
    color: var(--error);
    font-size: 13px;
    margin-top: 6px;
    display: none;
}
.eleve-pseudo-bloc.is-erreur .eleve-pseudo-erreur { display: block; }
.eleve-pseudo-bloc.is-erreur input { border-color: var(--error); }

/* Choix mode (2 boutons côte à côte desktop, empilés mobile) */
.eleve-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 24px 0;
}
.eleve-mode-btn {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.eleve-mode-btn:hover:not(:disabled) {
    border-color: var(--primary-dark);
    background: var(--primary-light);
}
.eleve-mode-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.eleve-mode-btn-titre {
    font-weight: 700;
    color: var(--text);
    font-size: 18px;
    margin-bottom: 4px;
}
.eleve-mode-btn-sous {
    color: var(--text-light);
    font-size: 13px;
}
.eleve-mode-btn.is-primary {
    background: var(--primary);
    border-color: var(--primary-dark);
}

/* Lien visiteur discret en bas */
.eleve-visiteur-link {
    display: block;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    text-decoration: underline;
    margin-top: 24px;
    padding: 12px;
}
.eleve-visiteur-link:hover { color: var(--text); }
/* Version papier (livret PDF / Word) — bloc visible sous les modes, boutons 48 px.
   Le bouton principal de l'écran reste « Démarrer sans aide » : ici, boutons secondaires. */
.eleve-papier {
    margin: 0 0 8px;
    padding: 14px 16px;
    background: var(--secondary);
    border-radius: var(--radius);
    text-align: center;
}
.eleve-papier-titre {
    margin: 0 0 10px;
    font-size: 16px;
    color: var(--text);
}
.eleve-papier-titre .vp-label-court { display: none; }
.eleve-papier-boutons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
/* Spécificité renforcée : .eleve-btn-secondaire (plus bas dans le fichier) impose
   width: 100% / margin auto, ce qui empilait les deux boutons. */
.eleve-papier .eleve-papier-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    min-width: 200px;
    margin: 0;
    text-decoration: none;
    font-size: 16px;
}
.eleve-papier .eleve-papier-btn:hover,
.eleve-papier .eleve-papier-btn:focus-visible { border-color: var(--primary-dark); background: var(--primary-light); }


/* ----------------------------------------------------------------------------
 * Écran consigne (transition simple)
 * ---------------------------------------------------------------------------- */

.eleve-consigne-bloc {
    text-align: center;
    padding: 32px 16px;
}
.eleve-consigne-bloc h2 {
    color: var(--text);
    font-size: 24px;
    margin-bottom: 16px;
}


/* ----------------------------------------------------------------------------
 * Écran support (spec 12 — texte uniquement V1)
 * ---------------------------------------------------------------------------- */

.eleve-support-titre {
    color: var(--text);
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

.btn-tts-large {
    display: block;
    margin: 0 auto 24px;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 20px;
    font-size: 15px;
    color: var(--text);
    cursor: pointer;
    min-height: 48px;
}
.btn-tts-large:hover { background: var(--primary-light); }
.btn-tts-large.is-playing { background: var(--primary-light); border-color: var(--primary-dark); }

.eleve-support-texte {
    max-width: 680px;
    margin: 0 auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    font-size: 18px;
    line-height: 1.7;
    color: var(--text);
}
.eleve-support-texte p { margin: 0 0 1em; }
.eleve-support-texte h1, .eleve-support-texte h2, .eleve-support-texte h3 {
    color: var(--text);
    margin: 1em 0 0.5em;
}
.eleve-support-texte h1 { font-size: 24px; }
.eleve-support-texte h2 { font-size: 20px; }
.eleve-support-texte h3 { font-size: 18px; }
.eleve-support-texte ul, .eleve-support-texte ol {
    margin: 0 0 1em 1.5em;
}

/* Support principal vidéo YouTube (Phase 2-A) */
.support-youtube-iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    background: #000;
}

/* Support principal audio uploadé (Session 23) */
.support-audio-principal {
    display: block;
    width: 100%;
    margin: 8px 0;
}

/* Remettre dans l'ordre (Phase 2-D — Session 26) */
.remettre-ordre-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.remettre-ordre-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    padding: 12px 14px;
}
.remettre-ordre-num {
    background: var(--primary-light);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}
.remettre-ordre-contenu {
    flex: 1;
    min-width: 0;
    color: var(--text);
    font-size: 16px;
    line-height: 1.4;
}
.remettre-ordre-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}
.remettre-ordre-btn {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    padding: 8px 14px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    min-width: 48px;
    min-height: 44px;
    color: var(--text);
}
.remettre-ordre-btn:hover:not(:disabled) {
    background: var(--primary-light);
    border-color: var(--primary-dark);
}
.remettre-ordre-btn:disabled { opacity: 0.4; cursor: not-allowed; }
@media (max-width: 600px) {
    .remettre-ordre-btn {
        min-width: 52px;
        min-height: 48px;
        font-size: 22px;
    }
    .remettre-ordre-actions { gap: 6px; }
}

/* Association (Phase 2-D — Session 26) */
.assoc-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.assoc-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.assoc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-small);
    cursor: pointer;
    font-size: 16px;
    font-family: inherit;
    color: var(--text);
    text-align: left;
    min-height: 48px;
    transition: all 0.15s ease;
}
.assoc-item:hover { border-color: var(--primary); }
.assoc-item.is-selected {
    border-color: var(--primary-dark);
    background: var(--primary-light);
}
.assoc-item.is-associe { background: var(--secondary); }
.assoc-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}
@media (max-width: 600px) {
    .assoc-wrap {
        grid-template-columns: 1fr;
        gap: 28px; /* espacement vertical accru entre les 2 listes empilees */
    }
    /* Separateur visuel entre les 2 colonnes en mobile */
    .assoc-col + .assoc-col {
        position: relative;
        padding-top: 20px;
    }
    .assoc-col + .assoc-col::before {
        content: '';
        position: absolute;
        top: 0;
        left: 10%;
        right: 10%;
        height: 1px;
        background: linear-gradient(to right, transparent, var(--border) 20%, var(--border) 80%, transparent);
    }
    .assoc-item { min-height: 52px; font-size: 17px; padding: 14px 16px; }
    .assoc-badge { width: 36px; height: 36px; font-size: 16px; }
}

/* Association : case texte sur plusieurs lignes (ex. une strophe) ou case image (02/11/2026) */
.assoc-texte {
    white-space: pre-line; /* garde les retours à la ligne saisis (un vers par ligne) */
    line-height: 1.45;
}
.assoc-item.has-image {
    justify-content: center;
    padding: 8px;
    position: relative;
}
.assoc-image {
    display: block;
    max-width: 100%;
    max-height: 190px;
    border-radius: var(--radius-small);
}
.assoc-item.has-image .assoc-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    box-shadow: 0 0 0 3px var(--white);
}
.assoc-item.has-image.is-selected,
.assoc-item.has-image.is-associe { padding: 6px; }
@media (max-width: 600px) {
    .assoc-image { max-height: 240px; }
}

/* Texte à trous (Phase 2-D — Session 26) */
.texte-trous-wrap {
    display: block;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    font-size: 18px;
    line-height: 1.9;
    color: var(--text);
    margin-bottom: 16px;
    min-height: 60px;
}
.texte-trous-text {
    /* texte natif, hérite styles parent */
    vertical-align: middle;
}
.texte-trous-input {
    display: inline-block;
    box-sizing: border-box;
    min-width: 80px; /* Safari iOS ignore parfois l'attribut HTML size, on force une largeur min CSS */
    height: 40px;
    padding: 4px 10px;
    margin: 4px 2px;
    border: 2px solid var(--primary-dark);
    border-bottom-width: 3px;
    border-radius: var(--radius-small);
    font-size: 17px;
    font-family: inherit;
    background: var(--primary-light);
    color: var(--text);
    text-align: center;
    vertical-align: middle;
}
.texte-trous-input:focus {
    outline: none;
    background: var(--white);
    border-color: var(--text);
}

/* Mes résultats — Phase 3 Session 25 */
.mes-resultats-tentative {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 16px;
}
.mes-resultats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 12px;
}
.mes-resultats-score {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.mes-resultats-attente {
    background: var(--warning-bg);
    border-left: 4px solid var(--warning);
    padding: 8px 12px;
    border-radius: var(--radius-small);
    font-size: 14px;
    margin-bottom: 12px;
}
.mes-resultats-reponse {
    padding: 12px 0;
    border-bottom: 1px dashed var(--border);
}
.mes-resultats-reponse:last-child { border-bottom: none; }
.mes-resultats-enonce {
    font-weight: 600;
    margin-bottom: 6px;
}
.mes-resultats-rep-eleve {
    color: var(--text);
    margin-bottom: 6px;
}
.mes-resultats-verdict {
    margin-top: 6px;
    font-weight: 600;
    font-size: 14px;
}
.mes-resultats-verdict.is-ok { color: var(--success); }
.mes-resultats-verdict.is-no { color: var(--error); }
.mes-resultats-verdict.is-na { color: var(--text-light); }

.mes-resultats-commentaire {
    margin-top: 8px;
    padding: 10px 14px;
    background: var(--primary-light);
    border-left: 4px solid var(--primary-dark);
    border-radius: var(--radius-small);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

/* Canvas d'annotation libre (Phase 3 — Session 25) */
.annotation-wrap {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 16px;
}
.annotation-toolbox {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.annotation-btn-couleur {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: transform 0.1s ease, border-color 0.15s ease;
}
.annotation-btn-couleur:hover { transform: scale(1.1); }
.annotation-btn-couleur.is-active {
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--text);
}
.annotation-btn-tool {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-small);
    padding: 6px 12px;
    font-size: 18px;
    cursor: pointer;
    min-height: 36px;
    min-width: 44px;
    transition: background 0.15s ease;
}
.annotation-btn-tool:hover { background: var(--secondary); }
.annotation-btn-tool.is-active {
    background: var(--primary-light);
    border-color: var(--primary-dark);
}
.annotation-stage {
    position: relative;
    width: 100%;
    background: var(--secondary);
    border-radius: var(--radius-small);
    overflow: hidden;
}
.annotation-image {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    pointer-events: none;
}
.annotation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    cursor: crosshair;
    /* Un doigt dessine (pas de défilement) ; deux doigts pincent pour agrandir
       la page (2026-11-11, avant : none = aucun zoom possible sur le texte) */
    touch-action: pinch-zoom;
}

/* Support principal image (Session 24) */
.support-image-wrap {
    text-align: center;
}
.support-image-principale {
    max-width: 100%;
    max-height: 75vh;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    background: var(--white);
    cursor: zoom-in;
}
.support-image-legende {
    color: var(--text-light);
    font-size: 14px;
    margin-top: 8px;
    font-style: italic;
}
/* Zone latérale "avec aide" : image cap pour ne pas écraser le reste */
.questions-support .support-image-principale {
    max-height: 280px;
    cursor: default;
}
/* Zone latérale : canvas d'annotation (image dessinable pour justifier la réponse) */
.questions-support .annotation-wrap {
    padding: 8px;
    margin-bottom: 12px;
}
.questions-support .annotation-toolbox {
    margin-bottom: 8px;
    gap: 4px;
}
.questions-support .annotation-btn-couleur {
    width: 28px;
    height: 28px;
}
.questions-support .annotation-btn-tool {
    padding: 4px 8px;
    min-height: 28px;
    min-width: 36px;
    font-size: 14px;
}

/* Support principal lien externe (iframe Drive / écosystème, Session 24) */
.support-lien-iframe {
    width: 100%;
    height: 70vh;
    min-height: 480px;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    background: var(--white);
}
/* Réduit la hauteur dans la zone latérale "avec aide" pour ne pas écraser
   les autres supports en stack. La zone parent a overflow-y: auto donc
   l'élève peut scroller pour tout voir. */
.questions-support .support-lien-iframe {
    height: 280px;
    min-height: 220px;
}
.questions-support .support-youtube-iframe {
    max-height: 220px;
}

/* Mode mixte oral + écrit (Phase 2-B) */
.support-mixte-oral { /* container neutral pour le rendu de l'oral */ }
.support-mixte-ecrit {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
}
.support-mixte-ecrit p { margin: 0 0 0.8em; }
.support-mixte-ecrit p:last-child { margin-bottom: 0; }

/* Tabs (mode libre) */
.support-mixte-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.support-mixte-tab {
    background: transparent;
    border: none;
    padding: 10px 18px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}
.support-mixte-tab:hover { color: var(--text); }
.support-mixte-tab.is-active {
    color: var(--text);
    font-weight: 600;
    border-bottom-color: var(--primary-dark);
}

.support-texte-bloc {
    /* utilisé dans .support-mixte-ecrit ou seul */
}
.eleve-support-texte:has(.support-youtube-iframe) {
    padding: 0;
    overflow: hidden;
    background: transparent;
    border: none;
}

/* Titre support dans la zone "avec aide" pendant les questions */
.questions-support-titre {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}


/* ----------------------------------------------------------------------------
 * Bouton principal d'avancement (« Démarrer », « Commencer les questions »)
 * ---------------------------------------------------------------------------- */

.eleve-btn-principal {
    display: block;
    width: 100%;
    max-width: 360px;
    margin: 24px auto 0;
    padding: 16px 24px;
    background: var(--primary-dark);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    min-height: 56px;
    transition: background 0.15s ease;
}
.eleve-btn-principal:hover:not(:disabled) {
    background: var(--text);
}
.eleve-btn-principal:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.eleve-btn-secondaire {
    display: block;
    width: 100%;
    max-width: 360px;
    margin: 12px auto 0;
    padding: 12px 24px;
    background: var(--white);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    cursor: pointer;
    min-height: 48px;
}
.eleve-btn-secondaire:hover { background: var(--secondary); }


/* ----------------------------------------------------------------------------
 * Footer minimal
 * ---------------------------------------------------------------------------- */

.eleve-footer {
    text-align: center;
    color: var(--text-light);
    font-size: 12px;
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--white);
}


/* ----------------------------------------------------------------------------
 * Messages d'erreur (activité introuvable, etc.)
 * ---------------------------------------------------------------------------- */

.eleve-message-erreur {
    text-align: center;
    padding: 60px 20px;
}
.eleve-message-erreur h2 {
    color: var(--error);
    margin-bottom: 12px;
}
.eleve-message-erreur p {
    color: var(--text-light);
    margin-bottom: 24px;
}


/* ----------------------------------------------------------------------------
 * Responsive smartphone (cf. spec 04 et 12)
 * ---------------------------------------------------------------------------- */

@media (max-width: 600px) {
    .eleve-main {
        padding: 16px 16px 100px;
    }

    .eleve-titre {
        font-size: 22px;
    }

    .eleve-encart-contenu {
        font-size: 15px;
    }

    .eleve-modes {
        grid-template-columns: 1fr; /* empilés mobile */
    }

    .eleve-pseudo-bloc input {
        font-size: 16px; /* évite zoom auto iOS */
    }

    .eleve-support-texte {
        font-size: 16px;
        line-height: 1.6;
        padding: 20px 18px;
    }
    .eleve-support-titre { font-size: 18px; }
}


/* ----------------------------------------------------------------------------
 * Reduced motion (a11y — spec 15)
 * ---------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .eleve-mode-btn,
    .btn-tts-inline,
    .btn-tts-large,
    .eleve-btn-principal {
        transition: none;
    }
}


/* ============================================================================
 * Écran questions (spec 07) — séquence interactive
 * ============================================================================ */

/* Indicateur de progression */
.questions-progress {
    margin-bottom: 16px;
}
.progress-label {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 6px;
    text-align: center;
}
.progress-bar {
    height: 8px;
    background: var(--secondary);
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--primary-dark);
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* Layout principal (mode avec aide = split desktop, vertical mobile) */
.questions-layout {
    display: block; /* défaut sans aide = pleine largeur */
}
.questions-layout.is-avec-aide {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 24px;
    align-items: start;
}

/* Zone support (visible seulement si avec_aide) */
.questions-support {
    display: none;
}
.questions-layout.is-avec-aide .questions-support {
    display: block;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    max-height: 85vh;
    overflow-y: auto;
    font-size: 18px;
    line-height: 1.7;
    color: var(--text);
    /* Ombre intérieure en bas si débordement → indicateur visuel de scroll */
    background-image:
        linear-gradient(to bottom, var(--white), var(--white) 30%, transparent 30%),
        linear-gradient(to top, rgba(0,0,0,0.08), transparent 30%);
    background-attachment: local, local;
    background-repeat: no-repeat;
    background-size: 100% 30px, 100% 30px;
    background-position: top, bottom;
}
.questions-support h1, .questions-support h2, .questions-support h3 {
    color: var(--text);
    margin: 0.8em 0 0.4em;
}
.questions-support p { margin: 0 0 0.7em; }

/* Zone question + réponses */
.questions-zone {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: opacity 0.3s ease;
}
.questions-zone.is-fading {
    opacity: 0;
}

.question-enonce {
    font-size: 22px;
    color: var(--text);
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Image de la question (QCM illustré) — au-dessus de l'énoncé */
.question-image {
    margin: 0 0 20px;
    text-align: center;
}
.question-image img {
    max-width: 100%;
    max-height: 40vh;
    border-radius: var(--radius-small);
    border: 1px solid var(--border);
}

/* QCM — radio/checkbox larges */
.choix-elev-liste {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.choix-elev-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-small);
    cursor: pointer;
    min-height: 56px;
    transition: all 0.15s ease;
}
.choix-elev-item:hover { border-color: var(--primary); }
.choix-elev-item:has(input:checked) {
    border-color: var(--primary-dark);
    background: var(--primary-light);
}
.choix-elev-item input {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
}
.choix-elev-texte {
    font-size: 17px;
    color: var(--text);
    flex: 1;
}

/* Vrai/Faux — 2 gros boutons */
.vf-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.vf-btn {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 16px;
    cursor: pointer;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    min-height: 100px;
    transition: all 0.15s ease;
}
.vf-btn:hover { border-color: var(--primary); }
.vf-btn.is-selected {
    border-color: var(--primary-dark);
    background: var(--primary-light);
}

/* Question ouverte */
.ouverte-textarea {
    width: 100%;
    min-height: 120px;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-small);
    font-size: 17px;
    color: var(--text);
    background: var(--white);
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 8px;
}
.ouverte-textarea:focus {
    outline: none;
    border-color: var(--primary-dark);
}
.ouverte-compteur {
    text-align: right;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 16px;
}
.ouverte-compteur.is-warning { color: var(--warning); }
.ouverte-compteur.is-error { color: var(--error); }

/* Bouton Valider pleine largeur */
.btn-valider {
    width: 100%;
    padding: 16px;
    background: var(--primary-dark);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    min-height: 56px;
    transition: background 0.15s ease;
}
.btn-valider:hover:not(:disabled) {
    background: var(--text);
}
.btn-valider:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Correction immédiate (ajout 2026-11-12) : verdict sous la question, réponses
 * figées, bouton « Question suivante → ». Le sens ne repose pas sur la couleur
 * seule (✓ / ✗ dans le texte) ; texte en --text pour le contraste. */
.verdict-immediat {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    border-left-width: 8px;
    color: var(--text);
    font-size: 18px;
    line-height: 1.5;
}
.verdict-immediat.is-ok { border-color: var(--success); background: var(--success-bg); }
.verdict-immediat.is-no { border-color: var(--error); background: var(--error-bg); }
.verdict-immediat-titre { font-weight: 700; }
.verdict-immediat-detail { margin-top: 6px; font-size: 17px; }
.btn-suivant { margin-top: 12px; }
/* Propositions corrigées (QCM, vrai/faux) : la sélection n'est plus verte par
 * défaut ; chaque état porte sa couleur du thème ET son signe ✓ / ✗ (spec 15). */
/* (spécificité 0,3,0 : passe devant .choix-elev-item:has(input:checked), 0,2,1,
 * et reste derrière les états .is-juste / .is-fausse / .is-attendue, 0,4,0) */
.choix-elev-liste.is-corrigee .choix-elev-item {
    border-color: var(--border);
    background: var(--white);
}
.vf-buttons.is-corrigee .vf-btn {
    border-color: var(--border);
    background: var(--white);
}
.choix-elev-liste.is-corrigee .choix-elev-item.is-juste,
.choix-elev-liste.is-corrigee .choix-elev-item.is-attendue,
.vf-buttons.is-corrigee .vf-btn.is-juste,
.vf-buttons.is-corrigee .vf-btn.is-attendue {
    border-color: var(--success);
    background: var(--success-bg);
}
.choix-elev-liste.is-corrigee .choix-elev-item.is-fausse,
.vf-buttons.is-corrigee .vf-btn.is-fausse {
    border-color: var(--error);
    background: var(--error-bg);
}
.reponse-marque {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    color: var(--text);
}
.vf-btn .reponse-marque { margin-left: 10px; }
.questions-zone.is-verrouillee .choix-elev-item,
.questions-zone.is-verrouillee .vf-btn,
.questions-zone.is-verrouillee .assoc-item,
.questions-zone.is-verrouillee .texte-trous-input,
.questions-zone.is-verrouillee .remettre-ordre-btn {
    cursor: default;
    pointer-events: none;
}


/* ----------------------------------------------------------------------------
 * Responsive smartphone — split mode avec aide devient vertical
 * ---------------------------------------------------------------------------- */

/* Grands écrans (≥1100px) : on élargit la zone support pour les iframes Drive
   et on augmente la hauteur des médias. Le main est aussi élargi quand on
   est en mode questions avec aide (via :has()), sinon il reste à 720px max
   pour les autres écrans (accueil/consigne/support/résultat). */
@media (min-width: 1100px) {
    .eleve-main:has(.questions-layout.is-avec-aide.is-actif),
    .eleve-main:has(#ecran-questions.is-actif .questions-layout.is-avec-aide) {
        max-width: 1300px;
    }
    .questions-layout.is-avec-aide {
        grid-template-columns: 65% 35%;
    }
    .questions-layout.is-avec-aide .questions-support {
        max-height: 88vh;
        font-size: 19px;
    }
    .questions-support .support-lien-iframe {
        height: 380px;
        min-height: 300px;
    }
    .questions-support .support-youtube-iframe {
        max-height: 300px;
    }
}

/* Très grands écrans (≥1500px) : encore plus de place */
@media (min-width: 1500px) {
    .eleve-main:has(.questions-layout.is-avec-aide.is-actif),
    .eleve-main:has(#ecran-questions.is-actif .questions-layout.is-avec-aide) {
        max-width: 1500px;
    }
    .questions-layout.is-avec-aide {
        grid-template-columns: 70% 30%;
    }
    .questions-layout.is-avec-aide .questions-support {
        font-size: 20px;
    }
    .questions-support .support-lien-iframe {
        height: 480px;
        min-height: 380px;
    }
    .questions-support .support-youtube-iframe {
        max-height: 360px;
    }
}

@media (max-width: 700px) {
    .questions-layout.is-avec-aide {
        display: block;
    }
    .questions-layout.is-avec-aide .questions-support {
        max-height: 50vh;
        margin-bottom: 16px;
    }
    .questions-support .support-lien-iframe {
        height: 220px;
        min-height: 180px;
    }
    .questions-support .support-youtube-iframe {
        max-height: 180px;
    }
    .question-enonce {
        font-size: 18px;
    }
    .choix-elev-texte {
        font-size: 16px;
    }
    .vf-btn {
        font-size: 18px;
        min-height: 80px;
    }
    .vf-buttons {
        grid-template-columns: 1fr;
    }
}


/* ----------------------------------------------------------------------------
 * Reduced motion (a11y) — étendre
 * ---------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .progress-bar-fill,
    .questions-zone,
    .choix-elev-item,
    .vf-btn,
    .btn-valider {
        transition: none;
    }
}


/* ============================================================================
 * Supports complémentaires (panneau collapsible — Phase 2-C lite)
 * ============================================================================ */

.comp-eleve-details {
    max-width: 720px;
    margin: 24px auto 0;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
}
.comp-eleve-summary {
    cursor: pointer;
    padding: 14px 18px;
    font-weight: 600;
    color: var(--text);
    font-size: 16px;
    list-style: none;
    user-select: none;
}
.comp-eleve-summary::-webkit-details-marker { display: none; }
.comp-eleve-summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.2s ease;
    font-size: 12px;
}
.comp-eleve-details[open] .comp-eleve-summary::before {
    transform: rotate(90deg);
}
.comp-eleve-summary:hover { background: var(--primary-light); border-radius: var(--radius); }

.comp-eleve-liste {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 18px 18px;
}

.comp-eleve-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    padding: 0;
}
/* Chaque aide est un <details> individuel : en-tête cliquable + corps */
.comp-eleve-item-summary {
    cursor: pointer;
    padding: 12px 14px;
    font-weight: 600;
    color: var(--text);
    font-size: 15px;
    list-style: none;
    user-select: none;
}
.comp-eleve-item-summary::-webkit-details-marker { display: none; }
.comp-eleve-item-summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.2s ease;
    font-size: 11px;
    color: var(--text-light);
}
.comp-eleve-item[open] > .comp-eleve-item-summary::before {
    transform: rotate(90deg);
}
.comp-eleve-item-summary:hover { background: var(--primary-light); border-radius: var(--radius-small); }
.comp-eleve-item-corps {
    padding: 0 14px 14px;
}

.comp-eleve-youtube-iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    border-radius: var(--radius-small);
}

.comp-eleve-texte-contenu {
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
}
.comp-eleve-texte-contenu p { margin: 0 0 0.6em; }

.comp-eleve-audio {
    width: 100%;
    margin-top: 4px;
}

.comp-eleve-lien-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}
.comp-eleve-lien-bouton {
    display: inline-block;
    padding: 6px 12px;
    background: var(--white);
    border: 1px solid var(--primary-dark);
    border-radius: var(--radius-small);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s ease;
}
.comp-eleve-lien-bouton:hover { background: var(--primary-light); }
.comp-eleve-lien-iframe {
    width: 100%;
    height: 600px;
    max-height: 80vh;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    background: var(--white);
}
@media (max-width: 700px) {
    .comp-eleve-lien-iframe { height: 480px; }
}

/* Aide image */
.comp-eleve-image {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    background: var(--white);
}
.comp-eleve-image-legende {
    color: var(--text-light);
    font-size: 14px;
    margin-top: 6px;
    font-style: italic;
}

/* Aide document PDF (Word = bouton téléchargement seul) */
.comp-eleve-doc-iframe {
    width: 100%;
    height: 600px;
    max-height: 80vh;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    background: var(--white);
}
@media (max-width: 700px) {
    .comp-eleve-doc-iframe { height: 480px; }
}


/* ============================================================================
 * Page résultat (spec 08)
 * ============================================================================ */

.resultat-conteneur {
    text-align: center;
    padding: 32px 16px;
    max-width: 540px;
    margin: 0 auto;
}

.resultat-titre {
    color: var(--text);
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 8px;
}

.resultat-sous-titre {
    color: var(--text-light);
    font-size: 16px;
    margin-bottom: 24px;
}

/* Anneau SVG */
.anneau-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 16px auto 8px;
}
.anneau-svg {
    display: block;
    width: 200px;
    height: 200px;
    transform: rotate(-90deg); /* commence en haut */
}
@media (max-width: 600px) {
    .anneau-svg { width: 160px; height: 160px; }
}
.anneau-bg {
    fill: none;
    stroke: var(--secondary);
    stroke-width: 14;
}
.anneau-fg {
    fill: none;
    stroke-width: 14;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out;
}
.anneau-fg.is-success { stroke: var(--success); }
.anneau-fg.is-warning { stroke: var(--warning); }
.anneau-fg.is-error { stroke: var(--error); }

.anneau-score-central {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.anneau-score-chiffre {
    font-size: 42px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}
.anneau-score-pct {
    font-size: 18px;
    color: var(--text-light);
    margin-top: 6px;
}

/* Message d'encouragement */
.message-encouragement {
    font-size: 18px;
    color: var(--text);
    margin: 16px auto 24px;
    padding: 12px 20px;
    background: var(--secondary);
    border-radius: var(--radius);
    max-width: 480px;
    line-height: 1.4;
}
.message-encouragement.is-success { background: var(--success-bg); }
.message-encouragement.is-warning { background: var(--warning-bg); }
.message-encouragement.is-error { background: var(--error-bg); }

.message-aucune-question {
    font-size: 16px;
    color: var(--text);
    background: var(--secondary);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 16px auto 24px;
    max-width: 480px;
    line-height: 1.5;
}

/* Critères auto-évaluation */
.criteres-bloc {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 16px auto 24px;
    text-align: left;
    max-width: 540px;
}
.criteres-bloc h3 {
    color: var(--text);
    margin-bottom: 4px;
}
.criteres-bloc-sous {
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 12px;
}
.criteres-liste {
    list-style: none;
    padding: 0;
    margin: 0;
}
.critere-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    cursor: pointer;
    border-radius: var(--radius-small);
    min-height: 44px;
    transition: background 0.1s ease;
}
.critere-item:hover { background: var(--secondary); }
.critere-item input {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
}
.critere-texte {
    color: var(--text);
    font-size: 16px;
}

/* Bouton Refaire (principal) */
.btn-refaire {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 8px auto 0;
    padding: 16px 24px;
    background: var(--primary-dark);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    min-height: 56px;
    transition: background 0.15s ease;
}
.btn-refaire:hover { background: var(--text); }

/* État de sauvegarde (pour INSERT BDD) */
.resultat-status {
    margin-top: 16px;
    padding: 8px 12px;
    border-radius: var(--radius-small);
    font-size: 13px;
    display: inline-block;
}
.resultat-status.is-saving {
    background: var(--secondary);
    color: var(--text-light);
}
.resultat-status.is-saved {
    background: var(--success-bg);
    color: var(--text);
}
.resultat-status.is-error {
    background: var(--error-bg);
    color: var(--error);
}


/* ----------------------------------------------------------------------------
 * Responsive smartphone — résultat
 * ---------------------------------------------------------------------------- */

@media (max-width: 600px) {
    .anneau-wrapper {
        width: 160px;
        height: 160px;
    }
    .anneau-score-chiffre { font-size: 32px; }
    .resultat-titre { font-size: 22px; }
    .message-encouragement { font-size: 16px; }
}


/* ----------------------------------------------------------------------------
 * Reduced motion (a11y) — étendre encore
 * ---------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .anneau-fg,
    .btn-refaire {
        transition: none;
    }
}


/* =============================================================================
 * Mode non lecteur (Cycle 1 + CP) — Session 32
 * ============================================================================= */

.grille-avatars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
}
@media (max-width: 480px) {
    .grille-avatars { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}

.avatar-btn {
    background: var(--white);
    border: 3px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 6px 8px;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    transition: all 0.15s ease;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.avatar-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.avatar-btn.is-selected {
    border-color: var(--primary-dark);
    background: var(--primary-light);
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--shadow);
}
.avatar-emoji {
    font-size: 44px;
    line-height: 1;
}
.avatar-nom {
    font-size: 14px;
    color: var(--text);
    font-weight: 600;
}

.hidden { display: none !important; }


/* =============================================================================
 * Adaptations visuelles mode non lecteur (Cycle 1 + CP) — Session 32 commit 3
 * ============================================================================= */

/* Energique class sur eleve-main quand activite.mode_non_lecteur === true */
.eleve-main.is-non-lecteur {
    /* Plus d'espace lateral pour les gros doigts */
    padding-bottom: 100px;
}

/* Enonce question agrandi */
.eleve-main.is-non-lecteur .question-enonce {
    font-size: 22px;
    line-height: 1.5;
    font-weight: 600;
}

/* Choix QCM : texte plus gros, items plus hauts */
.eleve-main.is-non-lecteur .choix-elev-item {
    padding: 18px 20px;
    min-height: 64px;
    font-size: 18px;
    border-width: 3px;
}
.eleve-main.is-non-lecteur .choix-elev-texte {
    font-size: 18px;
}

/* Vrai / Faux : boutons plus gros */
.eleve-main.is-non-lecteur .vf-btn {
    min-height: 72px;
    font-size: 24px;
    font-weight: 700;
    padding: 16px 24px;
    border-width: 3px;
}

/* Bouton Valider plus visible */
.eleve-main.is-non-lecteur .btn-valider {
    font-size: 20px;
    padding: 18px 32px;
    min-height: 64px;
    font-weight: 700;
}

/* Bouton TTS inline plus visible */
.eleve-main.is-non-lecteur .btn-tts-inline {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 16px;
    font-size: 15px;
    background: var(--primary-light);
    border-color: var(--primary-dark);
    color: var(--text);
    font-weight: 600;
}

/* Encarts (objectif, consigne) : titre plus visible + audio plus voyant */
.eleve-main.is-non-lecteur .eleve-encart-contenu {
    font-size: 19px;
    line-height: 1.6;
}

/* Modes sans/avec aide : boutons plus gros sur la page d'accueil */
.eleve-main.is-non-lecteur .eleve-mode-btn {
    min-height: 110px;
    padding: 24px 16px;
}
.eleve-main.is-non-lecteur .eleve-mode-btn-titre {
    font-size: 22px;
}
.eleve-main.is-non-lecteur .eleve-mode-btn-sous {
    font-size: 15px;
}

/* Texte a trous : champs plus gros */
.eleve-main.is-non-lecteur .texte-trous-wrap {
    font-size: 22px;
    line-height: 2.4;
}
.eleve-main.is-non-lecteur .texte-trous-input {
    font-size: 20px;
    height: 50px;
    min-width: 100px;
}

/* Association : items plus gros */
.eleve-main.is-non-lecteur .assoc-item {
    min-height: 64px;
    font-size: 18px;
    padding: 16px 18px;
    border-width: 3px;
}
.eleve-main.is-non-lecteur .assoc-badge {
    width: 40px;
    height: 40px;
    font-size: 17px;
}

/* Remettre dans l'ordre : items + boutons fleches plus gros */
.eleve-main.is-non-lecteur .remettre-ordre-item {
    padding: 16px 18px;
}
.eleve-main.is-non-lecteur .remettre-ordre-num {
    width: 48px;
    height: 48px;
    font-size: 20px;
}
.eleve-main.is-non-lecteur .remettre-ordre-contenu {
    font-size: 18px;
}
.eleve-main.is-non-lecteur .remettre-ordre-btn {
    min-width: 60px;
    min-height: 56px;
    font-size: 26px;
}

/* Indicateur progression plus voyant */
.eleve-main.is-non-lecteur .progress-label {
    font-size: 16px;
    font-weight: 600;
}

/* Consigne sur ecran d'accueil bien visible */
.eleve-main.is-non-lecteur .eleve-titre {
    font-size: 32px;
}


/* ============================================================================
 * Ajout 2026-11-02 — panneau « Relire la consigne » / « Les aides »,
 * palette d'annotation nommée, et mode intégré tenant dans une page de
 * cahier multimédia ONE (790 × 575) SANS défilement intérieur.
 * Décisions Paul du 02/11/2026 (proposition de l'agent NSAD Compréhension).
 * Tout ce qui suit `.embed-mode` ne touche pas la page complète.
 * ============================================================================ */

/* --- Commun aux deux modes ------------------------------------------------ */

/* Groupes de la boîte à outils d'annotation : transparents hors cadre */
.annotation-couleurs,
.annotation-outils { display: contents; }
.annotation-couleur-nom { display: none; }

/* Bouton « Relire la consigne » (ligne de l'énoncé) */
.btn-relire {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 14px;
    margin-left: 8px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    border: 2px solid var(--primary-dark);
    border-radius: var(--radius-small);
    cursor: pointer;
    vertical-align: middle;
}
.btn-relire:hover,
.btn-relire:focus-visible { background: var(--primary-light); }

/* Panneau : hors cadre, il recouvre la page (ce n'est pas une fenêtre du navigateur) */
.panneau-embed {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--white);
    overflow: auto;
    padding: 24px max(20px, calc((100vw - 720px) / 2));
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.panneau-embed[hidden],
.panneau-aides-liste[hidden],
.barre-embed-btn[hidden] { display: none !important; }
.panneau-embed-titre { font-size: 20px; color: var(--text); margin: 0; outline: none; }
.panneau-embed-consigne { font-size: 17px; line-height: 1.5; color: var(--text); margin: 0; }
.panneau-embed-sous-titre { font-size: 18px; color: var(--text); margin: 4px 0 0; }
.panneau-embed-criteres { margin: 0 0 0 1.4em; padding: 0; color: var(--text); }
.panneau-embed-criteres li { font-size: 17px; line-height: 1.45; }
.panneau-embed-fermer { margin: auto auto 0; flex-shrink: 0; }
.panneau-embed .btn-tts-inline { min-height: 48px; min-width: 48px; font-size: 16px; }

.pastille-visiteur { display: none; }

/* --- Mode intégré : le cadre -------------------------------------------- */

.embed-mode,
.embed-mode body { height: 100%; }
.embed-mode .eleve-body { min-height: 0; height: 100vh; }
.embed-mode .eleve-main {
    position: relative;
    max-width: none;
    padding: 8px 16px;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.embed-mode .eleve-ecran.is-actif {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* Barre du haut : 56 px, textes 16 px, boutons 48 px */
.embed-mode .barre-embed {
    min-height: 56px;
    padding: 4px 12px;
    font-size: 16px;
    gap: 12px;
    flex-shrink: 0;
}
.embed-mode .barre-embed-titre { font-size: 16px; white-space: nowrap; }
.embed-mode .barre-embed-lien {
    font-size: 16px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    margin-left: auto;
}
.embed-mode .barre-embed-btn {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 14px;
    font-size: 16px;
    font-family: inherit;
    font-weight: 600;
    color: var(--text);
    background: var(--white);
    border: 2px solid var(--primary-dark);
    border-radius: var(--radius-small);
    cursor: pointer;
    white-space: nowrap;
}
.embed-mode .barre-embed-btn:hover,
.embed-mode .barre-embed-btn:focus-visible { background: var(--primary-light); }
/* « Aides » seulement sur l'écran des questions (depuis le 2026-11-11, plus sur le support) */
.embed-mode body:not([data-ecran="ecran-questions"]) #btn-aides-embed { display: none; }
/* Progression des questions déplacée dans la barre (eleve.js) */
.embed-mode .barre-embed .questions-progress {
    display: none;
    flex: 1 1 auto;
    align-items: center;
    gap: 10px;
    margin: 0;
    min-width: 0;
}
.embed-mode body[data-ecran="ecran-questions"] .barre-embed .questions-progress { display: flex; }
.embed-mode .barre-embed .progress-label { font-size: 16px; margin: 0; white-space: nowrap; color: var(--text); }
.embed-mode .barre-embed .progress-bar { flex: 1 1 auto; }

/* Mode visiteur : pastille dans la barre au lieu du bandeau de 48 px */
.embed-mode body.is-visiteur #bandeau-visiteur { display: none !important; }
.embed-mode body.is-visiteur .barre-embed-titre { display: none; }
.embed-mode body.is-visiteur .pastille-visiteur {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 14px;
    font-size: 16px;
    font-family: inherit;
    font-weight: 600;
    color: var(--text);
    background: var(--warning-bg);
    border: 1px solid var(--warning);
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
}

/* Panneau : dans le cadre, il recouvre la zone de l'activité, sous la barre */
.embed-mode .panneau-embed {
    position: absolute;
    inset: 0;
    padding: 12px 16px;
    gap: 8px;
}
.embed-mode .panneau-aides-liste .comp-eleve-lien-iframe,
.embed-mode .panneau-aides-liste .comp-eleve-doc-iframe { height: var(--h-aide, 220px); max-height: none; }
.embed-mode .panneau-aides-liste .comp-eleve-image { max-height: var(--h-aide, 220px); width: auto; margin: 0 auto; }
.embed-mode .panneau-aides-liste .comp-eleve-lien-actions { margin-bottom: 4px; }
.embed-mode .panneau-aides-liste .comp-eleve-item-summary { min-height: 48px; display: flex; align-items: center; font-size: 16px; }

/* Les volets « Supports complémentaires — aides » sont remplacés par le bouton « Aides » */
.embed-mode .comp-eleve-details { display: none !important; }

/* Boutons ▶ Écouter : 48 px */
.embed-mode .btn-tts-inline { min-height: 48px; min-width: 48px; font-size: 16px; }

/* --- Écran 1 : accueil (type, cycle, objectif et consigne hors cadre) ---- */
.embed-mode .eleve-meta,
.embed-mode #ecran-accueil .eleve-encart { display: none; }
.embed-mode #ecran-accueil .eleve-titre { font-size: 22px; margin: 4px 0 12px; }
.embed-mode .eleve-rgpd { font-size: 16px; margin: 0 0 12px; padding: 8px 12px; }
.embed-mode .eleve-pseudo-bloc { margin: 0 0 12px; }
.embed-mode .eleve-modes { margin: 0 0 8px; gap: 12px; }
.embed-mode .eleve-mode-btn { min-height: 76px; padding: 10px 16px; }
.embed-mode .eleve-mode-btn-sous { font-size: 16px; }
/* Version papier en mode intégré : une seule ligne (texte court + 2 boutons 48 px) */
.embed-mode .eleve-papier {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 8px 12px;
    margin: 0 0 8px;
}
.embed-mode .eleve-papier-titre { margin: 0; }
.embed-mode .eleve-papier-titre .vp-label-long { display: none; }
.embed-mode .eleve-papier-titre .vp-label-court { display: inline; }
.embed-mode .eleve-papier .eleve-papier-btn { min-width: 0; padding: 10px 16px; font-size: 16px; }
.embed-mode .liens-secondaires { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.embed-mode .liens-secondaires .eleve-visiteur-link {
    margin: 0 !important;
    font-size: 16px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
}

/* --- Écran 2 : consigne + critères ------------------------------------- */
.embed-mode .eleve-consigne-bloc { padding: 0; }
.embed-mode .eleve-consigne-bloc h2 { font-size: 20px; margin: 0 0 8px; }
.embed-mode .eleve-encart { padding: 10px 16px; margin-bottom: 8px; }
.embed-mode .eleve-encart-label { font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--text); }
.embed-mode #consigne-criteres li { font-size: 17px; line-height: 1.45; }
.embed-mode .eleve-btn-principal { margin: 8px auto 0; flex-shrink: 0; }

/* --- Écran 3 : support (l'image s'ajuste à la place restante, eleve.js) -- */
.embed-mode .eleve-support-titre { font-size: 18px; margin: 0 0 6px; }
/* En-tête de l'écran support (eleve.js) : titre ou onglets + « Commencer les questions »
   sur une seule ligne, pour laisser la hauteur à l'image du texte */
.embed-mode .support-entete-embed {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 6px;
    flex-shrink: 0;
}
.embed-mode .support-entete-embed .eleve-support-titre { flex: 1 1 auto; margin: 0; text-align: left; }
.embed-mode .support-entete-embed .support-mixte-tabs { flex: 1 1 auto; margin: 0; }
.embed-mode .support-entete-embed #btn-vers-questions {
    margin: 0 0 0 auto;
    width: auto;
    max-width: none;
    padding: 0 18px;
    flex-shrink: 0;
}
.embed-mode #ecran-support .btn-tts-large { margin: 0 auto 8px; }
.embed-mode #support-contenu.eleve-support-texte:has(.support-image-wrap) { padding: 0; border: 0; background: none; }
.embed-mode .support-mixte-tabs { margin-bottom: 6px; }
.embed-mode .support-mixte-tab { min-height: 48px; font-size: 16px; }
.embed-mode .support-image-principale { cursor: default; }
.embed-mode .support-image-legende { font-size: 16px; margin-top: 4px; }

/* --- Écran 4 : question d'annotation = image à gauche, outils à droite ---- */
.embed-mode #ecran-questions > .questions-progress { display: none; }
.embed-mode .questions-layout.is-question-annotation { display: flex; flex: 1 1 auto; min-height: 0; }
.embed-mode .questions-layout.is-question-annotation .questions-support { display: none !important; }
.embed-mode .questions-zone.is-annotation {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 184px;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 8px 12px;
}
.embed-mode .is-annotation .question-enonce {
    grid-column: 1 / -1;
    grid-row: 1;
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.embed-mode .is-annotation .question-enonce .btn-tts-inline,
.embed-mode .is-annotation .question-enonce .btn-relire { margin-left: 0; }
.embed-mode .is-annotation .annotation-wrap { display: contents; }
.embed-mode .is-annotation .annotation-stage {
    grid-column: 1;
    grid-row: 2 / 4;
    justify-self: center;
    align-self: start;
    width: fit-content;
    max-width: 100%;
    background: none;
    border: 1px solid var(--border);
}
.embed-mode .is-annotation .annotation-image { width: auto; max-width: none; }
.embed-mode .is-annotation .annotation-toolbox {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    align-self: start;
}
.embed-mode .is-annotation .annotation-couleurs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.embed-mode .is-annotation .annotation-outils { display: flex; gap: 8px; }
.embed-mode .is-annotation .annotation-btn-couleur {
    width: auto;
    height: 48px;
    border-radius: var(--radius-small);
    background: var(--white) !important;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 5px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text);
    transform: none;
    min-width: 0;
    overflow: hidden;
}
.embed-mode .is-annotation .annotation-btn-couleur::before {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--c);
    border: 1px solid rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}
.embed-mode .is-annotation .annotation-couleur-nom { display: inline; }
.embed-mode .is-annotation .annotation-btn-tool { flex: 1 1 0; min-height: 48px; min-width: 48px; padding: 0; }
.embed-mode .is-annotation .btn-valider {
    grid-column: 2;
    grid-row: 3;
    min-height: 56px;
    padding: 8px;
    font-size: 17px;
}

/* Image plus haute que le cadre (2026-11-11 soir) : la zone de l'image défile,
   la consigne, les couleurs et « Valider » restent fixes ; ▲ ▼ pour le toucher. */
.annotation-defilement { display: none; }
.embed-mode .is-annotation .annotation-stage.is-defilante {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.embed-mode .is-annotation.is-image-defilante .annotation-defilement { display: flex; gap: 8px; }
.embed-mode .is-annotation .annotation-btn-defil { font-size: 20px; }
.embed-mode .support-image-wrap.is-defilante {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
}
.embed-mode .support-image-wrap.is-defilante .support-image-principale { border: 0; border-radius: 0; }

/* --- Écran 5 : résultat sur deux colonnes -------------------------------- */
.embed-mode .resultat-conteneur {
    max-width: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
    align-content: start;
}
.embed-mode .resultat-conteneur > * { grid-column: 1; }
.embed-mode .resultat-titre { font-size: 22px; margin: 0 0 4px; }
.embed-mode .resultat-sous-titre { margin: 0 0 8px; }
.embed-mode .anneau-wrapper,
.embed-mode .anneau-svg { width: 120px; height: 120px; }
.embed-mode .anneau-score-chiffre { font-size: 28px; }
.embed-mode .resultat-status { font-size: 16px; margin: 0 auto 8px; }
.embed-mode .criteres-bloc { grid-column: 2; grid-row: 1 / span 8; margin: 0; padding: 12px 16px; max-width: none; }
.embed-mode .criteres-bloc-sous { font-size: 16px; }
.embed-mode .critere-item { min-height: 48px; padding: 6px 8px; }
.embed-mode .btn-refaire { margin: 8px auto 0; }
.embed-mode .panneau-embed-fermer { margin: auto auto 0; }

/* ============================================================================
 * Ajout 2026-11-03 — option A (décision Paul, élèves de CE2 allophones) :
 * en mode intégré, une question QCM d'une activité dont le support de départ
 * est un TEXTE (sans image) = texte à gauche (~52 %), question à droite (~48 %),
 * le tout dans le cadre de 575 px ; seule la colonne du texte défile. eleve.js
 * place la colonne sur la phrase citée dans l'énoncé et la surligne.
 * L'écran « texte » (avant les questions) tient aussi dans le cadre.
 * Rien hors `.embed-mode` ; pas de :has() (iPad anciens).
 * Réservé pour l'instant à l'activité 112 : les classes is-support-texte,
 * is-qcm-texte, is-2-colonnes et mark.citation-texte ne sont posées par eleve.js
 * que pour les activités de ACTIVITES_TEXTE_COTE_A_COTE (garde
 * optionATexteCoteACote) ; ailleurs ces règles ne s'appliquent pas.
 * ============================================================================ */

/* --- Écran texte : le texte défile dans son cadre, la ligne du haut reste --- */
.embed-mode #ecran-support.is-support-texte {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}
.embed-mode #ecran-support.is-support-texte .support-entete-embed #btn-tts-support {
    margin: 0;
    padding: 0 14px;
    min-height: 48px;
    font-size: 16px;
    flex-shrink: 0;
    white-space: nowrap;
}
.embed-mode #ecran-support.is-support-texte #support-contenu {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 12px 18px;
    font-size: 18px;
    line-height: 1.55;
}
.embed-mode #ecran-support.is-support-texte #support-contenu p { margin: 0 0 0.6em; }
.embed-mode #ecran-support.is-support-texte .support-mixte-tabs { flex-shrink: 0; }

/* --- Question QCM sur un texte : deux colonnes ---------------------------- */
@media (min-width: 600px) {
    .embed-mode .questions-layout.is-qcm-texte {
        display: grid;
        grid-template-columns: minmax(0, 52fr) minmax(0, 48fr);
        grid-template-rows: minmax(0, 1fr);
        gap: 12px;
        flex: 1 1 auto;
        min-height: 0;
        align-items: stretch;
    }
    /* Colonne du texte : seule partie qui défile */
    .embed-mode .questions-layout.is-qcm-texte .questions-support {
        max-height: none;
        min-height: 0;
        overflow-y: auto;
        padding: 10px 14px;
        font-size: 17px;
        line-height: 1.5;
    }
    .embed-mode .questions-layout.is-qcm-texte .questions-support p { margin: 0 0 0.55em; }
    .embed-mode .questions-layout.is-qcm-texte .questions-support-titre { font-size: 17px; margin-bottom: 4px; }
    /* Colonne de la question : énoncé, propositions, « Valider » toujours visible */
    .embed-mode .questions-layout.is-qcm-texte .questions-zone {
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow-y: auto;
        padding: 10px 8px 8px;
    }
    .embed-mode .questions-layout.is-qcm-texte .question-enonce {
        font-size: 18px;
        line-height: 1.35;
        margin: 0 0 8px;
        flex-shrink: 0;
    }
    .embed-mode .questions-layout.is-qcm-texte .question-enonce .btn-tts-inline { margin-left: 6px; }
    .embed-mode .questions-layout.is-qcm-texte .question-enonce .btn-relire { margin: 4px 0 0 6px; }
    .embed-mode .questions-layout.is-qcm-texte .choix-elev-liste {
        gap: 8px;
        margin: 0 0 8px;
        flex-shrink: 0;
    }
    .embed-mode .questions-layout.is-qcm-texte .choix-elev-item {
        min-height: 52px;
        padding: 4px 4px 4px 6px;
        gap: 5px;
    }
    .embed-mode .questions-layout.is-qcm-texte .choix-elev-item input { width: 18px; height: 18px; }
    .embed-mode .questions-layout.is-qcm-texte .choix-elev-texte {
        font-size: 17px;
        line-height: 1.25;
        min-width: 0;
    }
    /* ▶ des propositions réduits à 44 × 44 px (minimum de la spec 15), sans marge propre */
    .embed-mode .questions-layout.is-qcm-texte .choix-elev-item .btn-tts-inline {
        min-height: 44px;
        min-width: 44px;
        width: 44px;
        padding: 0;
        margin-left: 0;
        justify-content: center;
        flex-shrink: 0;
    }
    /* 2 × 2 (eleve.js revient à une colonne si un libellé ne tient pas sur une ligne) */
    .embed-mode .questions-layout.is-qcm-texte .choix-elev-liste.is-2-colonnes {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .embed-mode .questions-layout.is-qcm-texte .choix-elev-liste.is-2-colonnes .choix-elev-texte {
        white-space: nowrap;
        overflow: hidden;
    }
    /* Police plus large (Verdana sur iPad) : 16 px, jamais moins */
    .embed-mode .questions-layout.is-qcm-texte .choix-elev-liste.is-compact .choix-elev-texte { font-size: 16px; }
    .embed-mode .questions-layout.is-qcm-texte .btn-valider {
        margin-top: auto;
        position: sticky;
        bottom: 0;
        flex-shrink: 0;
        min-height: 52px;
        padding: 10px;
        font-size: 18px;
    }
}

/* Phrase citée dans l'énoncé, surlignée dans le texte (fond léger, contraste
   du texte 5,7:1 sur ce jaune) */
.embed-mode mark.citation-texte {
    background: #FFF1B8;
    color: inherit;
    border-radius: 3px;
    padding: 1px 0;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}


/* ============================================================================
   Menu « Aides » flottant + fenêtre d'aide — page complète (ajout 2026-11-11).
   Visible sur les écrans support et questions seulement. Jamais dans le cadre
   ONE (le mode intégré garde « Aides (N) » dans sa barre du haut).
   ============================================================================ */
.aides-fab {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 900; /* sous le panneau consigne (1000) et la fenêtre d'aide (950) */
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}
/* Pendant les questions seulement (décision Paul 2026-11-11) : une aide ouverte
   avant l'effort ne soutient rien, et l'enseignant ne saurait plus qui a eu besoin de quoi */
body[data-ecran="ecran-questions"] .aides-fab { display: flex; }
.aides-fab.is-vide { display: none !important; }
/* Correction 2026-11-11 (défaut signalé par Paul) : la boîte du menu garde la
   taille de la liste repliée (invisible) et recouvrait « Commencer les
   questions », « Valider la réponse » et le 3e onglet (cadre ONE, téléphone).
   La boîte laisse passer les clics ; seuls la bouée et la liste dépliée les reçoivent. */
.aides-fab { pointer-events: none; }
.aides-fab-bouton,
.aides-fab.is-ouvert .aides-fab-liste { pointer-events: auto; }
/* Cadre ONE : pas de bouée (c'est « Aides (N) » dans la barre du haut qui déplie),
   la colonne s'ouvre sous la barre, à droite, et tient dans le cadre */
.embed-mode .aides-fab {
    top: 64px;
    right: 12px;
    bottom: auto;
    align-items: flex-end;
}
.embed-mode .aides-fab-bouton { display: none; }
.embed-mode .aides-fab-liste {
    transform-origin: top right;
    max-height: calc(100vh - 80px);
}
.embed-mode .aides-fab:not(.is-ouvert) .aides-fab-liste { transform: scale(.9) translateY(-12px); }
.embed-mode .aide-btn { font-size: 16px; min-height: 48px; }
.embed-mode .aide-fenetre { max-height: calc(100vh - 24px); padding: 14px 16px; }
.embed-mode .aide-fenetre-corps .comp-eleve-lien-iframe,
.embed-mode .aide-fenetre-corps .comp-eleve-doc-iframe,
.embed-mode .aide-fenetre-corps .comp-eleve-youtube-iframe { min-height: 55vh; }
.aides-fab-liste {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding: 4px;
    transform-origin: bottom right;
    transition: transform .18s ease, opacity .18s ease;
}
.aides-fab:not(.is-ouvert) .aides-fab-liste {
    opacity: 0;
    transform: scale(.9) translateY(12px);
    pointer-events: none;
}
.aide-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    max-width: min(92vw, 420px);
    padding: 0 16px 0 14px;
    background: var(--white);
    color: var(--text);
    border: 2px solid var(--primary-dark);
    border-radius: 999px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    cursor: pointer;
    text-align: left;
}
.aide-btn svg { width: 26px; height: 26px; flex: 0 0 auto; color: var(--primary-dark); }
.aide-icone-img { width: 28px; height: 28px; flex: 0 0 auto; object-fit: contain; display: block; }
.aide-btn-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aide-btn:hover,
.aide-btn:focus-visible { background: var(--primary-light); outline: 3px solid var(--primary-dark); outline-offset: 2px; }
.aides-fab-bouton {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 60px;
    min-width: 60px;
    padding: 0 20px 0 16px;
    background: var(--primary-dark);
    color: var(--white);
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
    cursor: pointer;
}
.aides-fab-bouton svg { width: 30px; height: 30px; }
/* Bouée verte de la planche rendue blanche sur le bouton vert foncé (contraste) */
.aides-fab-bouton .aide-icone-img { width: 32px; height: 32px; filter: brightness(0) invert(1); }
.aides-fab-bouton:hover { background: var(--text); }
.aides-fab-bouton:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.aides-fab.is-ouvert .aides-fab-lbl-ouvrir,
.aides-fab:not(.is-ouvert) .aides-fab-lbl-fermer { display: none; }
.aide-btn-txt { display: flex; flex-direction: column; min-width: 0; }
.aide-btn-sous { font-size: 13px; font-weight: 400; color: var(--text-light); white-space: nowrap; }
.aide-btn-sous:empty { display: none; }
/* Aide verrouillée : ouvrable après la précédente (le motif est écrit dessous) */
.aide-btn.is-verrouillee {
    background: var(--secondary);
    color: var(--text-light);
    border-color: var(--border);
    border-style: dashed;
    cursor: default;
    box-shadow: none;
}
.aide-btn.is-verrouillee .aide-icone-img { opacity: .45; }
.aide-btn.is-verrouillee:hover { background: var(--secondary); }
/* Ligne d'état du menu : « 1 aide ouverte sur 4 · il en reste 3 » */
.aides-fab-etat {
    max-width: min(92vw, 420px);
    padding: 6px 14px;
    background: var(--text);
    color: var(--white);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-align: right;
}
/* Mode sans aide avec des aides disponibles : la bouée dit « Besoin d'aide ? » */
.aides-fab.is-sans-aide .aides-fab-lbl-ouvrir { font-size: 0; }
.aides-fab.is-sans-aide .aides-fab-lbl-ouvrir::before { content: "Besoin d'aide ?"; font-size: 17px; }
/* Mode sans aide : seule la consigne est proposée → libellé « Consigne » */
.aides-fab.is-consigne-seule .aides-fab-lbl-ouvrir { font-size: 0; }
.aides-fab.is-consigne-seule .aides-fab-lbl-ouvrir::before { content: "Consigne"; font-size: 17px; }
/* Voile léger derrière la colonne dépliée : l'élève voit qu'il est « dans le menu » */
body.aides-menu-ouvert::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(74, 99, 93, .18);
    z-index: 890;
}

/* --- Fenêtre d'aide --- */
.aide-voile {
    position: fixed;
    inset: 0;
    z-index: 950;
    background: rgba(74, 99, 93, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.aide-voile[hidden] { display: none !important; }
.aide-fenetre {
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 720px;
    max-height: 92vh;
    overflow: auto;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.aide-fenetre-entete { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.aide-fenetre-icone svg { width: 30px; height: 30px; color: var(--primary-dark); display: block; }
.aide-fenetre-icone .aide-icone-img { width: 32px; height: 32px; }
.aide-fenetre-titre { flex: 1; font-size: 20px; color: var(--text); margin: 0; outline: none; }
.aide-fenetre-fermer {
    flex: 0 0 auto;
    min-width: 48px;
    min-height: 48px;
    border: 2px solid var(--border);
    background: var(--white);
    border-radius: 50%;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: var(--text);
}
.aide-fenetre-fermer:hover,
.aide-fenetre-fermer:focus-visible { border-color: var(--primary-dark); background: var(--secondary); }
.aide-fenetre-corps .comp-eleve-item-corps { padding: 0; }
.aide-fenetre-corps .comp-eleve-audio { width: 100%; min-height: 48px; }
.aide-fenetre-corps .comp-eleve-image { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.aide-fenetre-corps .comp-eleve-lien-iframe,
.aide-fenetre-corps .comp-eleve-doc-iframe,
.aide-fenetre-corps .comp-eleve-youtube-iframe { width: 100%; min-height: 60vh; border: 0; }
.aide-fenetre-retour { margin-top: 16px; }
@media (prefers-reduced-motion: reduce) {
    .aides-fab-liste { transition: none; }
}


/* --- Barre d'écoute (enregistrements) : en bas, sans voile, texte lisible --- */
.aide-barre {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 940;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px max(16px, calc((100vw - 720px) / 2));
    background: var(--white);
    border-top: 2px solid var(--primary-dark);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .12);
}
.aide-barre[hidden] { display: none !important; }
.aide-barre-icone .aide-icone-img { width: 32px; height: 32px; }
.aide-barre-centre { flex: 1 1 auto; min-width: 0; }
.aide-barre-titre {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    outline: none;
    margin-bottom: 4px;
}
.aide-barre-corps .comp-eleve-item-corps { padding: 0; }
.aide-barre-corps .comp-eleve-audio { width: 100%; min-height: 40px; margin: 0; }
/* La page garde de la place sous le texte, et la bouée remonte au-dessus de la barre */
body.aide-barre-ouverte .eleve-main { padding-bottom: 120px; }
body.aide-barre-ouverte .aides-fab { bottom: 112px; }
/* Cadre ONE : barre compacte, bouée absente de toute façon */
.embed-mode .aide-barre { padding: 6px 12px; gap: 8px; }
.embed-mode .aide-barre-titre { font-size: 14px; margin-bottom: 0; flex: 0 1 38%; }
/* Cadre ONE : titre et lecteur sur une seule ligne (barre ~60 px au lieu de 100) */
.embed-mode .aide-barre-centre { display: flex; align-items: center; gap: 10px; }
.embed-mode .aide-barre-corps { flex: 1 1 auto; min-width: 0; }
.embed-mode body.aide-barre-ouverte .eleve-main { padding-bottom: 8px; }


/* ============================================================================
   Page large + image à sa taille réelle (ajout 2026-11-11, défaut 1 signalé par
   Paul). Hors cadre ONE seulement : écran support dont un support de départ est
   une image, et question d'annotation (classe posée par eleve.js, sans :has()).
   Les autres écrans et types de questions gardent 720 px.
   ============================================================================ */
html:not(.embed-mode) .eleve-main.is-large { max-width: 1360px; }
html:not(.embed-mode) .eleve-main.is-large .eleve-support-texte { max-width: none; }
/* Un texte en onglet à côté des images garde une largeur de lecture */
html:not(.embed-mode) .eleve-main.is-large .support-texte-bloc { max-width: 680px; margin: 0 auto; }
html:not(.embed-mode) .eleve-main.is-large #support-contenu .support-image-principale {
    display: block;
    width: 100%;        /* toute la largeur disponible… */
    max-height: none;   /* …sans plafond de hauteur (la page défile) */
    margin: 0 auto;     /* …et jamais plus que sa taille réelle (max-width posé par eleve.js) */
}
/* « Commencer les questions » reste atteignable quelle que soit la hauteur de l'image */
html:not(.embed-mode) .eleve-main.is-large #btn-vers-questions {
    position: sticky;
    bottom: 16px;
    z-index: 5;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
}

/* « Agrandir l'image » : sous l'image, bouton secondaire (≥ 48 px) */
.btn-agrandir-image {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    margin: 10px auto 0;
    padding: 0 18px;
    background: var(--white);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
}
.btn-agrandir-image svg { width: 20px; height: 20px; }
.btn-agrandir-image:hover,
.btn-agrandir-image:focus-visible { background: var(--secondary); border-color: var(--primary-dark); }
.annotation-wrap .btn-agrandir-image { display: flex; width: max-content; }
.embed-mode .btn-agrandir-image { display: none; }

/* Visionneuse plein écran */
.image-plein-ecran {
    position: fixed;
    inset: 0;
    z-index: 960;
    background: rgba(245, 245, 240, .98);
}
.image-plein-ecran[hidden] { display: none; }
.image-plein-ecran-fermer {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    min-height: 48px;
    min-width: 48px;
    padding: 0 18px;
    background: var(--text);
    color: var(--white);
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    cursor: pointer;
}
.image-plein-ecran-fermer:focus-visible { outline: 3px solid var(--primary-dark); outline-offset: 3px; }
.image-plein-ecran-defile {
    position: absolute;
    inset: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 72px 16px 24px;
}
.image-plein-ecran-defile img {
    display: block;
    width: auto;
    max-width: none; /* taille réelle : lisible, on défile */
    margin: 0 auto;
    border: 1px solid var(--border);
    background: var(--white);
}
body.image-plein-ecran-ouverte { overflow: hidden; }

/* Support de départ visé par l'aide qui vient d'être ouverte (2026-11-11 soir) */
.questions-support .is-support-cible {
    outline: 3px solid var(--primary-dark);
    outline-offset: 6px;
    border-radius: var(--radius-small);
    transition: outline-color .3s;
}

/* ----------------------------------------------------------------------------
   Aides de la question (ajout 2026-11-13) : groupe « Pour cette question » en
   tête du menu, confirmation « Tu as essayé ? », signal sur la bouée
   ---------------------------------------------------------------------------- */
.aide-btn[hidden] { display: none; }
.aides-fab-intertitre {
    max-width: min(92vw, 420px);
    padding: 4px 14px;
    background: var(--white);
    color: var(--text);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    text-align: right;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.aide-btn-question { border-color: var(--text); }
.aide-btn-question.is-verrouillee { border-color: var(--border); }
.aide-confirmation {
    max-width: min(92vw, 420px);
    padding: 12px 14px;
    background: var(--white);
    border: 2px solid var(--text);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.aide-confirmation-question { margin: 0 0 10px; font-size: 17px; font-weight: 700; color: var(--text); }
.aide-confirmation-boutons { display: flex; flex-wrap: wrap; gap: 10px; }
.aide-confirmation-btn {
    min-height: 48px;
    padding: 0 16px;
    background: var(--white);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: 999px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}
.aide-confirmation-btn.is-principal { background: var(--text); color: var(--white); border-color: var(--text); }
.aide-confirmation-btn:hover,
.aide-confirmation-btn:focus-visible { outline: 3px solid var(--primary-dark); outline-offset: 2px; }
/* Texte d'une aide de question dans la fenêtre d'aide */
.aide-question-texte { font-size: 18px; line-height: 1.6; color: var(--text); white-space: pre-line; max-width: 60ch; }
/* Signal : la bouée dit qu'une aide existe pour la question en cours (texte, pas la couleur seule) */
.aides-fab-bouton { position: relative; }
.aides-fab-signal {
    position: absolute;
    right: 8px;
    top: -14px;
    padding: 2px 10px;
    background: var(--white);
    color: var(--text);
    border: 2px solid var(--text);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}
.aides-fab.is-ouvert .aides-fab-signal,
.aides-fab.is-sans-aide .aides-fab-signal { display: none; }
/* Cadre ONE : le bouton « Aides (N) » de la barre porte le même signal */
.embed-mode .barre-embed-btn.a-aide-question { border: 2px solid var(--text); font-weight: 700; }
.embed-mode .barre-embed-btn.a-aide-question::after { content: " · question"; }


/* ============================================================================
 * Annotation sur téléphone (ajout 2026-11-13, décision Paul)
 * Ajouts seulement : rien de ce qui précède n'est modifié.
 * ============================================================================ */

/* ◀ ▶ : visibles seulement quand l'image est agrandie au-delà de sa zone */
.annotation-btn-defil-h { display: none; }

/* --- A. Page complète, téléphone : image agrandie, défilement dans sa zone --- */
html:not(.embed-mode) .annotation-wrap.is-agrandie .annotation-stage {
    overflow: auto;
    max-height: 70vh;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
html:not(.embed-mode) .annotation-wrap.is-agrandie .annotation-image { max-width: none; }
html:not(.embed-mode) .annotation-wrap.is-agrandie .annotation-defilement {
    display: flex;
    gap: 8px;
    flex-basis: 100%;
}
html:not(.embed-mode) .annotation-wrap.is-agrandie .annotation-btn-defil {
    display: block;
    flex: 1 1 0;
    min-height: 44px;
    font-size: 18px;
}

/* --- B et C. Mode intégré dans un cadre de téléphone (cahier) :
       les outils passent au-dessus de l'image, qui prend toute la largeur --- */
@media (max-width: 600px), (max-height: 480px) {
    .embed-mode .questions-zone.is-annotation {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto minmax(0, 1fr) auto;
        gap: 6px 8px;
    }
    .embed-mode .is-annotation .annotation-toolbox {
        grid-column: 1;
        grid-row: 2;
        flex-direction: row;
        align-items: center;
        gap: 3px;
        min-width: 0;
    }
    /* Les trois groupes se fondent en une seule rangée de boutons */
    .embed-mode .is-annotation .annotation-couleurs,
    .embed-mode .is-annotation .annotation-outils,
    .embed-mode .is-annotation.is-image-defilante .annotation-defilement { display: contents; }
    .embed-mode .is-annotation .annotation-btn-couleur,
    .embed-mode .is-annotation .annotation-btn-tool {
        flex: 1 1 0;
        min-width: 30px;
        max-width: 44px;
        width: auto;
        height: 40px;
        min-height: 40px;
        padding: 0;
        justify-content: center;
    }
    .embed-mode .is-annotation .annotation-btn-couleur::before { width: 22px; height: 22px; }
    .embed-mode .is-annotation .annotation-couleur-nom { display: none; }
    .embed-mode .is-annotation .annotation-outils > :first-child,
    .embed-mode .is-annotation .annotation-defilement > :first-child { margin-left: 5px; }
    .embed-mode .is-annotation .annotation-btn-defil { font-size: 16px; }
    .embed-mode .is-annotation .annotation-stage { grid-column: 1 / -1; grid-row: 3; }
    .embed-mode .is-annotation .btn-valider {
        grid-column: 2;
        grid-row: 2;
        align-self: center;
        min-height: 44px;
        padding: 4px 10px;
        font-size: 15px;
        white-space: nowrap;
    }
}

/* C. Cadre étroit (téléphone debout) : boutons sur plusieurs rangées,
      « Valider » sous l'image, image agrandie qui défile aussi de côté */
@media (max-width: 600px) {
    .embed-mode .questions-zone.is-annotation { grid-template-columns: minmax(0, 1fr); }
    .embed-mode .is-annotation .annotation-toolbox { flex-wrap: wrap; gap: 4px; }
    .embed-mode .is-annotation .annotation-btn-couleur,
    .embed-mode .is-annotation .annotation-btn-tool { flex: 0 0 40px; }
    .embed-mode .is-annotation .annotation-outils > :first-child,
    .embed-mode .is-annotation .annotation-defilement > :first-child { margin-left: 0; }
    .embed-mode .is-annotation .btn-valider { grid-column: 1; grid-row: 4; min-height: 48px; font-size: 17px; }
    .embed-mode .is-annotation .annotation-stage.is-defilante-h { overflow-x: auto; }
    .embed-mode .is-annotation.is-image-defilante-h .annotation-btn-defil-h { display: block; }
}
