/* ═══════════════════════════════════════════════════════════════════
   TOEFL iBT — CSS
   Direction : moderne & motivante — app d'entraînement haute performance
   Palette : bleu #1f7cff · orange #ff8c00 · fond #f4f7ff
   Police : DM Sans (corps) + DM Mono (scores/timer)
═══════════════════════════════════════════════════════════════════ */

/* Google Fonts removed — polices système */

/* ── Variables ─────────────────────────────────────────────────── */
:root {
    --blue:        #1f7cff;--blue-text:        #1067e6;
    --blue-dark:   #1260d4;
    --blue-light:  #e8f1ff;
    --blue-mid:    #c2d9ff;
    --orange:      #ff8c00;
    --orange-light:#fff3e0;
    --green:       #10b981;
    --green-light: #d1fae5;
    --red:         #ef4444;
    --red-light:   #fee2e2;
    --teal:        #06b6d4;
    --teal-light:  #cffafe;
    --bg:          #f4f7ff;
    --surface:     #ffffff;
    --surface-2:   #f8faff;
    --border:      #e2e8f8;
    --border-strong:#c5d0f0;
    --text:        #1a2340;
    --text-2:      #4a5578;
    --text-3:      #8892b0;
    --radius-sm:   6px;
    --radius:      12px;
    --radius-lg:   20px;
    --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow:      0 4px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
    --shadow-lg:   0 12px 40px rgba(0,0,0,.14), 0 4px 12px rgba(0,0,0,.08);
    --font:        'Inter', 'Inter-fallback', system-ui, sans-serif;
    --font-mono:   Arial, 'DM Mono', 'Fira Code', monospace;
    --transition:  0.22s cubic-bezier(0.4, 0, 0.2, 1)}

/* ── Reset & base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased}

/* ── Container ─────────────────────────────────────────────────── */
.container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: calc(100% - 400px);
    max-width: 960px;
    box-shadow: var(--shadow);
    box-sizing: border-box;
    padding: 32px 36px;
    margin: 0 auto;
    border: 1px solid var(--border)}

/* ── Headings ──────────────────────────────────────────────────── */
h2 {
    margin: 0;
    padding: 24px 0 20px;
    text-align: left;
    color: var(--orange);
    font-size: 1.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-family: var(--font)}

h3 {
    color: var(--blue-text);
    margin-top: 0;
    padding-top: 10px;
    font-size: 1.2rem;
    font-weight: 600}

/* ── Section doc (passage de lecture) ─────────────────────────── */
.section-doc {
    background: var(--surface-2);
    border: 1px solid var(--border);
    
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin: 1.25rem 0;
    font-size: .96rem;
    line-height: 1.75;
    color: var(--text);
    text-align: justify;
    white-space: pre-line;
    position: relative;
    transition: border-color var(--transition), box-shadow var(--transition)}

.section-doc::before {
    content: "📘";
    display: inline-block;
    margin-right: .5rem;
    font-size: .9rem;
    vertical-align: middle}

.section-doc:hover {
    border-left-color: var(--orange);
    box-shadow: var(--shadow-sm)}

/* ── Timer ─────────────────────────────────────────────────────── */
#fixed-timer-container {
    position: sticky;
    top: 12px;
    z-index: 500;
    width: fit-content;
    margin-left: auto;
    margin-top: -52px;   /* remonte au niveau du h2 */
    margin-bottom: 16px;
    display: flex;
    align-items: center}

#progress-bar-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 36px;
    min-width: 200px;
    background: #2a2d35;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 18px;
    border: none;
    outline: none;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    padding: 0}

#progress-bar {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: 0;
    border-radius: 18px;
    /* transition gérée dynamiquement par le JS (couleur + pulsation) */
    background: hsl(120, 85%, 38%); /* vert initial — le JS prend le relais dès le 1er tick */
    z-index: 1;
    opacity: 1}

#timer-text {
    position: relative;
    z-index: 2;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 14px;
    white-space: nowrap;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 8px}

#timer-text .label {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    font-family: var(--font)}

#timer-text .time {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: .5px;
    color: #fff}

/* ── Questions ─────────────────────────────────────────────────── */
.question {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    padding: 20px 22px;
    text-align: justify;
    transition: border-color var(--transition), box-shadow var(--transition);
    counter-reset: letter}

.question:hover {
    border-color: var(--blue-mid);
    box-shadow: var(--shadow-sm)}

p {
    font-weight: 600;
    margin: 0;
    padding-bottom: 12px;
    text-align: justify;
    color: var(--text);
    font-size: .97rem}

/* ── Labels radio/checkbox ─────────────────────────────────────── */
.question label {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px 8px 44px;
    margin-bottom: 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
    counter-increment: letter;
    font-weight: 400;
    color: var(--text-2);
    font-size: .95rem}

.question label:hover {
    /* Fond bleu clair retiré (décision Boris 08/2026) : alignement sur le
       style TOEIC — seule la pastille-lettre se remplit, le texte passe en bleu. */
    color: var(--blue-text);
    font-weight: 600}

.question label::before {
    content: counter(letter, upper-alpha);
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--blue);
    background: var(--surface);
    color: var(--blue-text);
    font-weight: 700;
    font-size: .78em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    font-family: var(--font-mono)}

.question input[type=checkbox],
.question input[type=radio] {
    position: absolute;
    opacity: 0;
    pointer-events: none}

.question label:has(input[type=radio]:checked),
.question label:has(input[type=checkbox]:checked) {
    /* Fond bleu clair retiré (décision Boris 08/2026) : alignement sur le
       style TOEIC — seule la pastille-lettre se remplit, le texte passe en bleu. */
    color: var(--blue-text);
    font-weight: 600}

.question label:has(input[type=radio]:checked)::before,
.question label:has(input[type=checkbox]:checked)::before {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,.18)}

/* ── Sentence (écoute) ─────────────────────────────────────────── */
.sentence {
    display: block;
    width: fit-content;
    margin: 0 auto 12px auto;
    text-align: center;
    font-size: 1em;
    font-weight: 500;
    background: var(--surface-2);
    padding: 10px 20px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    white-space: pre-wrap;
    box-shadow: var(--shadow-sm);
    max-width: 90%;
    color: var(--text)}

/* ── Timing list (speaking) ────────────────────────────────────── */
.timing-container { position: relative}

.timing-list {
    margin: .5em 0;
    padding-left: 28px;
    list-style: none}

.timing-list li {
    padding: 3px 0;
    margin: 2px 0;
    line-height: 1.4;
    color: var(--text-3);
    font-weight: 400;
    font-size: .93rem;
    transition: color var(--transition)}

.timing-list li.active {
    color: var(--blue-text);
    font-weight: 600}

#timing-arrow {
    position: absolute;
    left: 6px;
    top: 0;
    transition: top .3s ease;
    color: var(--blue-text);
    font-weight: 700}

/* ── Boutons ────────────────────────────────────────────────────── */
.btn-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px}

.btn, .btn-margin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 28px;
    background: var(--blue);
    border: 2px solid var(--blue);
    border-radius: 50px;
    color: #fff;
    font-weight: 600;
    font-size: .95rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    width: fit-content;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
    letter-spacing: .2px}

.btn-margin { margin-bottom: 20px}

.btn:hover, .btn-margin:hover {
    background: transparent;
    color: var(--blue-text);
    box-shadow: 0 6px 20px rgba(0,0,0,.10);
    transform: translateY(-1px)}

.btn-show-content {
    background: var(--blue);
    color: #fff;
    border: none;
    padding: .65em 1.4em;
    font-size: .95rem;
    font-family: var(--font);
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
    transition: all var(--transition);
    font-weight: 600;
    user-select: none;
    display: inline-block;
    margin-bottom: 20px;
    text-align: center}

.btn-show-content:hover {
    background: var(--blue-dark);
    box-shadow: 0 6px 20px rgba(0,0,0,.14);
    transform: translateY(-1px)}

.btn-show-content:disabled {
    background: var(--border-strong);
    color: var(--text-3);
    cursor: not-allowed;
    box-shadow: none;
    transform: none}

.btn-play-audio {
    background: var(--blue);
    color: #fff;
    padding: 11px 26px;
    border: 2px solid var(--blue);
    border-radius: 50px;
    cursor: pointer;
    font-size: .95rem;
    font-weight: 600;
    font-family: var(--font);
    transition: all var(--transition);
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
    display: inline-flex;
    align-items: center;
    gap: 8px}

.btn-play-audio:hover {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
    box-shadow: 0 6px 20px rgba(0,0,0,.14);
    transform: translateY(-1px)}

/* ── Images ─────────────────────────────────────────────────────── */
.image-container { margin: 16px 0}

.image-container img {
    max-width: 300px;
    width: 100%;
    height: auto;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm)}

/* ── Audio / media ──────────────────────────────────────────────── */
#groupId { margin-top: 20px}

.media-pair-container {
    justify-content: center;
    display: flex}

.media-pair {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 15px 0;
    width: fit-content}

.media-pair audio,
.media-pair img { width: 300px}

.media-pair img {
    margin-bottom: 0;
    border-radius: var(--radius);
    border: 1.5px solid var(--border)}

.audio-wrapper { position: relative; max-width: 100%}

.audio-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(26,35,64,.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    color: #fff;
    border-radius: var(--radius)}

.overlay-content { text-align: center}

/* ── Zone de texte (writing / speaking) ────────────────────────── */
.user_response {
    width: 100%;
    box-sizing: border-box;
    font-family: var(--font);
    font-size: 1em;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    resize: vertical;
    margin-bottom: 10px;
    background: var(--surface-2);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
    line-height: 1.6}

.user_response:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0,0,0,.10);
    background: var(--surface)}

.word_count {
    font-size: .83em;
    color: var(--text-3);
    text-align: right;
    margin-top: -8px;
    margin-bottom: 20px;
    font-family: var(--font-mono)}

/* ── Drag & Drop ────────────────────────────────────────────────── */
.option-crochets {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
    font-size: .72em;
    font-family: var(--font-mono);
    text-align: center;
    margin: 0;
    vertical-align: middle;
    flex-shrink: 0}

.dropzone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    background: var(--surface-2);
    color: var(--text);
    margin-top: 6px;
    margin-bottom: 6px;
    box-sizing: border-box;
    overflow: visible;
    position: relative;
    pointer-events: auto;
    transition: border-color var(--transition), background var(--transition)}

.dropzone:hover {
    border-color: var(--blue);
    background: var(--blue-light)}

.dropzone ul {
    min-height: 180px;
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px}

li.empty {
    min-height: 42px;
    border: 1.5px dashed var(--border-strong);
    border-radius: 21px;
    margin: 0;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    user-select: auto;
    pointer-events: auto;
    transition: none !important;
    background: rgba(255,255,255,.5)}

li.fixed { font-size: .85em}
li.empty .o-drag-drop { margin: 0 !important}

.brief-summary {
    text-align: center;
    font-weight: 700;
    font-size: 1em;
    color: var(--text);
    margin: 0;
    user-select: none}

.o-drag-drop {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    height: auto;
    margin: 0 5px 5px 0;
    padding: 10px 14px 10px 46px;
    font-size: .85em;
    background: var(--surface);
    color: var(--text);
    border: 1.5px solid var(--border);
    border-radius: 22px;
    cursor: grab;
    user-select: auto;
    pointer-events: auto;
    box-sizing: border-box;
    text-align: left;
    vertical-align: middle;
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: all var(--transition);
    word-break: break-word;
    font-family: var(--font)}

.o-drag-drop:hover {
    border-color: var(--blue);
    box-shadow: 0 4px 12px rgba(0,0,0,.10);
    transform: translateY(-1px)}

.o-drag-drop::before {
    content: attr(data-letter);
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--blue);
    background: var(--surface);
    color: var(--blue-text);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-family: var(--font-mono);
    transition: all var(--transition)}

.o-drag-drop.dropped::before {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.18)}

.o-drag-drop.dropped {
    font-weight: 600;
    color: var(--blue-text);
    border-color: var(--blue-mid);
    background: var(--blue-light)}

/* ── Résultats — statuts ────────────────────────────────────────── */
.correct   { color: var(--green); font-weight: 700}
.incorrect { color: var(--red);   font-weight: 700}

.parts-wrapper {
    display: inline-block;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 14px 20px;
    margin-top: 10px;
    margin-bottom: 10px;
    border-radius: var(--radius)}

.part-line { margin: 5px 0; font-size: .95rem; color: var(--text-2)}

.gray-text {
    color: var(--text-3);
    font-style: italic;
    font-size: .93rem;
    opacity: 0;
    animation: fadeIn .5s ease .4s forwards}

/* ── Résultats — layout ─────────────────────────────────────────── */
.sample-answer {
    color: var(--green);
    font-weight: 700;
    padding: 0; margin: 0}

.user-answer {
    white-space: pre-wrap;
    color: var(--blue-text);
    font-weight: 600;
    font-size: .95rem}

.user-answers {
    list-style: none;
    padding-left: 0;
    margin-top: 0;
    margin-bottom: .5em;
    font-size: .95rem}

.user-answers li {
    font-size: .95rem;
    margin-bottom: .15em;
    color: var(--text-2)}

.answer {
    white-space: pre-wrap;
    color: var(--green);
    font-weight: 700;
    font-size: .95rem}

.answer-correct,
li.answer-correct  { color: #0a7c55; font-weight: 700; font-size: .95rem}
.answer-incorrect,
li.answer-incorrect { color: #b91c1c; font-weight: 700; font-size: .95rem}

.user-answer-section {
    margin: 10px 0;
    font-size: .95rem}

.answer-label { font-weight: 600; color: var(--text-2)}

.expected-text strong,
.user-answer-section strong {
    font-weight: 700;
    margin-right: 3px}

.part-section { margin-bottom: 2em}

.instruction {
    padding: 12px 0;
    color: var(--text-2);
    font-size: .95rem;
    font-style: italic}

.part-title {
    margin: 0;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--blue-text);
    padding-bottom: 8px}

.question-text {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text)}

.question-info {
    font-style: italic;
    font-size: .88rem;
    color: var(--text-3)}

.question-block {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 10px;
    transition: box-shadow var(--transition)}

.question-block:hover {
    box-shadow: var(--shadow)}

.question-block--no-bg {
    background: transparent;
    border: none;
    box-shadow: none;
    padding-left: 0;
    padding-right: 0}
.question-block--no-bg:hover {
    box-shadow: none}


.part-score { font-weight: 700; color: var(--blue-text); font-family: var(--font-mono)}

.special-mention {
    color: var(--teal);
    font-weight: 700;
    font-size: .93rem;
    margin-top: .3em;
    margin-bottom: 0;
    padding-bottom: 0}

.expected-answers {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: .3em}

.expected-label {
    color: var(--teal);
    font-weight: 700;
    font-size: .93rem;
    margin: 0;
    padding: 0;
    white-space: nowrap}

.expected-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--teal);
    font-weight: 600;
    font-size: .93rem;
    margin: 0;
    padding: 0}

/* ── Score card ─────────────────────────────────────────────────── */
.score-card {
    background: var(--surface);
    border: 2px solid var(--orange);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 20px auto;
    max-width: 900px;
    box-shadow: 0 4px 20px rgba(255,140,0,.15);
    text-align: center;
    font-size: 1.1em;
    color: var(--text);
    position: relative;
    overflow: hidden}

.score-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,140,0,.04) 0%, transparent 60%);
    pointer-events: none}

.score-bar {
    height: 12px;
    background: var(--bg);
    border-radius: 14px;
    overflow: hidden;
    margin: 10px 0;
    font-weight: 700;
    font-size: 13px;
    position: relative;
    border: 1px solid var(--border)}

.score-fill {
    height: 100%;
    line-height: 12px;
    border-radius: 14px;
    width: 0;
    transition: width 1.2s ease-out;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    /* background-color injecté inline par PHP */
}

/* Pourcentage affiché en absolu au centre de la barre,
   toujours lisible quelle que soit la largeur du fill */
.score-fill::after {
    content: attr(data-label);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: var(--text);
    font-weight: 700;
    font-size: 12px;
    white-space: nowrap;
    mix-blend-mode: normal;
    text-shadow: 0 0 4px #fff, 0 0 4px #fff;
    pointer-events: none}


/* ── Accordéons résultats ───────────────────────────────────────── */
.accord-container {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin: 20px auto;
    max-width: min(900px, 100%);
    width: 100%;
    box-sizing: border-box;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    user-select: none;
    transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition)}
/* Pointer UNIQUEMENT sur les containers qui sont de vrais accordéons cliquables
   (contenant un .accord-content). Les containers utilisés comme simples
   wrappers stylés pour les vignettes de score, le score global, etc. n'ont
   donc pas de pointer puisqu'ils ne sont pas cliquables. */
.accord-container:has(.accord-content) {
    cursor: pointer}
/* Quand l'accordéon est ouvert, le pointer ne reste que sur le header
   (cliquer ailleurs n'a pas l'air cliquable, même si le clic ferme). */
.accord-container.is-open,
.accord-container:has(.accord-content.active) {
    cursor: auto}

.accord-container:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--blue-mid);
    transform: translateY(-2px)}

.accord-header {
    margin: 0;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--blue-text);
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    border-radius: var(--radius);
    transition: color var(--transition)}

.accord-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 4px;
    cursor: auto;
    user-select: text;
    font-size: .97rem;
    color: var(--text-2);
    transition: max-height .4s ease, padding .3s ease;
    line-height: 1.65}

.accord-content.active {
    padding: 18px 4px 6px;
    max-height: none}

.accord-header .arrow {
    font-weight: 900;
    color: inherit;
    transition: transform .35s ease;
    user-select: none;
    margin-right: 12px;
    font-size: 1rem}

.accord-header.open .arrow { transform: rotate(90deg)}

/* ── Résultats header ───────────────────────────────────────────── */
.results-header {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--blue-text);
    display: block;
    margin-bottom: 16px;
    padding-bottom: 0;
    position: relative}

/* ── Score global banner (élément autonome, pas un accordéon) ───── */
.score-global-banner {
    background: linear-gradient(135deg, var(--blue-dark) 0%, #0d3a8a 100%);
    color: #fff;
    text-align: center;
    padding: 28px 32px;
    margin: 20px auto;
    max-width: 900px;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm)}

.score-global-banner::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,.07);
    pointer-events: none}

.score-global-banner::after {
    content: '';
    position: absolute;
    bottom: -30px; left: -30px;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: rgba(255,140,0,.1);
    pointer-events: none}

.results-header-label {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,.7);
    margin-bottom: 8px}

.results-header-score {
    font-size: 3.6rem;
    font-weight: 800;
    font-family: var(--font-mono);
    line-height: 1.05;
    margin-bottom: 12px;
    text-shadow: 0 2px 16px rgba(0,0,0,.2)}

.results-header-total {
    font-size: 1.3rem;
    font-weight: 400;
    opacity: .85}

.results-header-cefr {
    display: inline-block;
    background: rgba(255,255,255,.15);
    border: 1.5px solid rgba(255,255,255,.3);
    border-radius: 24px;
    padding: 5px 18px;
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: .5px;
    margin-bottom: 10px}

.results-header-note {
    font-size: .75rem;
    opacity: .65}

/* ── Description CECRL inline (carte hero, calque TOEIC) ────────────── */
.cecrl-inline-block {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 12px;
    margin-top: 4px;
    width: 100%}
.cecrl-inline-block__title {
    font-size: .95rem;
    font-weight: 700;
    margin: 0 0 6px;
    letter-spacing: .01em}
.cecrl-inline-block__desc {
    font-size: .88rem;
    line-height: 1.55;
    margin: 0;
    opacity: .9;
    text-align: justify}

.section-score-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 14px 0;
    font-size: 1.05rem;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp .5s ease forwards}

.section-score-line:nth-of-type(1) { animation-delay: .15s}
.section-score-line:nth-of-type(2) { animation-delay: .25s}
.section-score-line:nth-of-type(3) { animation-delay: .35s}
.section-score-line:nth-of-type(4) { animation-delay: .45s}

.section-name {
    font-weight: 600;
    color: var(--text-2);
    transition: color var(--transition)}

.section-score-line:hover .section-name { color: var(--blue-text)}
.section-score-value { color: var(--blue-text); font-weight: 700; font-family: var(--font-mono); font-size: 1.05rem}

/* ── CECRL accordion ────────────────────────────────────────────── */
.cecrl-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px;
    font-family: var(--font)}

.cecrl-accordion {
    margin-bottom: 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    overflow: hidden;
    transition: all .3s ease;
    box-shadow: var(--shadow-sm)}

.cecrl-accordion:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px)}

.cecrl-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    transition: background var(--transition), color var(--transition);
    background: var(--surface-2)}

.cecrl-accordion-header:hover {
    background: var(--blue-light);
    color: var(--blue-text)}

.cecrl-accordion.active-level .cecrl-accordion-header {
    background: linear-gradient(135deg, var(--blue) 0%, var(--teal) 100%);
    color: #fff}

.cecrl-accordion.active-level { border-color: var(--blue); box-shadow: var(--shadow)}

.cecrl-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s ease, padding .3s ease;
    padding: 0 22px;
    background: var(--surface);
    color: var(--text-2);
    line-height: 1.65}

.cecrl-accordion.open .cecrl-accordion-content {
    max-height: 600px;
    padding: 18px 22px}

.cecrl-accordion-toggle {
    font-size: 1.2rem;
    transition: transform .35s ease;
    color: inherit}

.cecrl-accordion.open .cecrl-accordion-toggle { transform: rotate(180deg)}

.cecrl-level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--blue-light);
    color: var(--blue-dark);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: .78rem;
    font-weight: 700;
    margin-left: 10px;
    letter-spacing: .4px;
    text-transform: uppercase;
    font-family: var(--font-mono);
    transition: transform .2s ease}

.cecrl-level-badge:hover { transform: scale(1.04)}

.cecrl-range {
    color: var(--text-3);
    font-size: .88rem;
    font-weight: 400;
    margin-left: 10px}

.active-level .cecrl-range { color: rgba(255,255,255,.8)}

.cefr-level {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text)}

.level-label {
    font-weight: 700;
    color: var(--blue-text);
    text-transform: uppercase;
    letter-spacing: .5px;
    background: var(--blue-light);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    display: inline-block;
    font-family: var(--font-mono);
    font-size: .88rem}

.level-mention {
    font-size: 1.05rem;
    color: var(--text-2);
    font-weight: 500}

.cecrl-level-badge-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--blue-light);
    color: var(--blue-dark);
    font-weight: 700;
    font-size: .85rem;
    margin-right: 10px;
    font-family: var(--font-mono);
    transition: all .2s ease;
    flex-shrink: 0}

.cecrl-accordion.active-level .cecrl-level-badge-mini {
    background: rgba(255,255,255,.2);
    color: #fff}

.cecrl-level-badge-text {
    margin-right: 8px;
    background: var(--blue-light);
    color: var(--blue-text);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: .78rem;
    text-transform: uppercase;
    font-family: var(--font-mono)}

/* ── Score global ───────────────────────────────────────────────── */
.overall-score {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text)}

.score-value {
    /* Harmonisé avec .level-label (ligne ~1185) : même langage visuel
       (bleu-sur-bleu-clair, même radius), juste un peu plus grand car le
       contenu est plus dense (5 caractères vs 2). Le score "fort" en
       gradient blanc-sur-bleu-foncé reste exclusivement réservé à la
       bannière .score-global-banner — ce qu'on voit ici est un résumé
       inline secondaire qui doit s'intégrer à la phrase, pas la dominer. */
    font-size: 1rem;
    font-weight: 800;
    color: var(--blue-text);
    background: var(--blue-light);
    padding: 3px 11px;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin: 0 4px;
    font-family: var(--font-mono);
    vertical-align: baseline;
    letter-spacing: .03em}

.error {
    font-size: 1rem;
    color: var(--red);
    font-weight: 600;
    margin: 10px 0;
    background: var(--red-light);
    padding: 10px 14px;
    border-radius: var(--radius-sm)}

/* ── Légende couleurs ───────────────────────────────────────────── */
.color-legend {
    text-align: center;
    margin: 24px auto;
    padding: 18px 24px;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 800px}

.color-legend-title {
    margin: 0 0 14px 0;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    text-align: center}

.color-legend-items {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap}

.color-legend-item {
    display: flex;
    align-items: center;
    gap: 8px}

.color-legend-circle {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid;
    flex-shrink: 0}

.color-legend-circle.correct   { background: var(--green); border-color: var(--green)}
.color-legend-circle.incorrect { background: var(--red);   border-color: var(--red)}
.color-legend-circle.expected  { background: var(--teal);  border-color: var(--teal)}

.color-legend-label { font-weight: 600; font-size: .9rem}
.color-legend-label.correct   { color: var(--green)}
.color-legend-label.incorrect { color: var(--red)}
.color-legend-label.expected  { color: var(--teal)}

/* ── Questions avec image ───────────────────────────────────────── */
.question.question-with-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center}

.question.question-with-image .question-media-options {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 0 auto;
    max-width: 500px}

.question.question-with-image .image-side {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: var(--radius);
    width: 100%;
    max-width: 420px}

.question.question-with-image .image-side img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--radius)}

.question.question-with-image .options-side {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 420px;
    margin-bottom: 10px}

.question.question-with-image .options-side label.option {
    margin: 0;
    font-size: 1.05em;
    white-space: nowrap}

/* ── Questions horizontales ─────────────────────────────────────── */
.question.question-horizontal { display: flex; flex-direction: column}

.question.question-horizontal label {
    display: inline-flex;
    margin-right: 20px;
    margin-bottom: 10px}

.question.question-horizontal > label { display: inline-flex; width: auto; margin-right: 30px}

.question.question-horizontal label::before {
    position: relative;
    left: auto;
    margin-right: 8px;
    transform: translateY(0)}

.question.question-horizontal label:has(input[type=radio]:checked)::before {
    transform: scale(1.1)}

.question.question-horizontal .options-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    width: 100%}

/* ── Pricing section ────────────────────────────────────────────── */
.section-pricing p { margin: 12px 0}

/* ── Utilitaires ────────────────────────────────────────────────── */
.text-center { text-align: center}

/* ── Animations ─────────────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px)}
    to   { opacity: 1; transform: translateY(0)}
}

@keyframes fadeIn {
    from { opacity: 0}
    to   { opacity: 1}
}

@keyframes fillUp {
    from { transform: scaleX(0)}
    to   { transform: scaleX(1)}
}

/* ── Media queries ──────────────────────────────────────────────── */
@media (min-width: 768px) {
    form:has(.question.question-horizontal) {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        align-items: start}
    form:has(.question.question-horizontal) > :not(.question) { grid-column: 1 / -1}
    .question.question-horizontal { grid-column: span 1}
}

/* ════════════════════════════════════════════════════════════════════
   NOUVEAU TEST — Classes toefl-* + score card + boutons résultats
════════════════════════════════════════════════════════════════════ */

/* ── Hero : page-subtitle en blanc ─────────────────────────────── */
.page-subtitle {
    color: #fff !important;
    opacity: .92}

/* ── Steps nav — intégré dans toefl-section-header, avant h2 ────── */
.toefl-steps-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 6px 10px}
.toefl-step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-strong);
    flex-shrink: 0;
    transition: all var(--transition)}
.toefl-step-dot.current {
    background: var(--blue);
    box-shadow: 0 0 0 3px rgba(0,0,0,.12);
    transform: scale(1.25)}
.toefl-step-dot.done {
    background: var(--green)}
/* Indicateur textuel supprimé — masqué si encore présent dans le HTML */
.toefl-step-indicator {
    display: none}


/* ── Boutons résultats ──────────────────────────────────────────── */
/* Boutons empilés verticalement et centrés (même apparence que la
   page résultats du TOEIC SW : un bouton par ligne, centré). */
.toefl-btn-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 14px;
    padding: 28px 0 16px}
.btn-toefl-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 28px;
    min-height: 46px;
    line-height: 1.2;
    background: var(--blue);
    border: 2px solid var(--blue);
    border-radius: 50px;
    color: #fff;
    font-weight: 600;
    font-size: .95rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
    letter-spacing: .2px;
    box-sizing: border-box;
    vertical-align: middle}
.btn-toefl-submit:hover {
    background: #fff;
    border-color: var(--blue);
    color: var(--blue-text);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,.10)}
/* ── Boutons Start (listening, speaking) ── */
.btn-toefl-submit.btn-start {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff}
.btn-toefl-submit.btn-start:hover {
    background: #fff;
    border-color: var(--blue);
    color: var(--blue-text);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,.10)}
.btn-toefl-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 28px;
    min-height: 46px;
    line-height: 1.2;
    background: var(--blue);
    border: 2px solid var(--blue);
    border-radius: 50px;
    color: #fff;
    font-weight: 600;
    font-size: .95rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    letter-spacing: .2px;
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
    box-sizing: border-box;
    vertical-align: middle}
.btn-toefl-back:hover {
    background: #fff;
    border-color: var(--blue);
    color: var(--blue-text);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,.10)}

/* ── Boutons navigation résultats (redo / restart / home) ────────── */
/* Même couleur que .btn-toefl-submit (bleu), survol : fond blanc + texte bleu */
.btn-toefl-submit.btn-redo,
.btn-toefl-submit.btn-restart,
.btn-toefl-submit.btn-home {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff}
.btn-toefl-submit.btn-redo:hover,
.btn-toefl-submit.btn-restart:hover,
.btn-toefl-submit.btn-home:hover {
    background: #fff;
    border-color: var(--blue);
    color: var(--blue-text);
    box-shadow: 0 6px 20px rgba(0,0,0,.10);
    transform: translateY(-1px)}

/* ── Barre de navigation résultats (boutons empilés, centrés) ──── */
/* Même apparence que la page résultats du TOEIC SW : un bouton par
   ligne, centré. Les wrappers (.toefl-nav-side, .toefl-nav-center)
   utilisent display:contents pour disparaître du layout flex et
   laisser les boutons devenir enfants directs de .toefl-nav-bar. */
.toefl-nav-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin: 20px 0 8px}

.toefl-nav-bar .toefl-nav-side,
.toefl-nav-bar .toefl-nav-center {
    display: contents}

/* ── Bouton "Retour au programme" — aligné avec la même gouttière ── */
.toefl-nav-home {
    display: flex;
    justify-content: center;
    margin: 14px 0 20px}

/* ── Conteneur principal ────────────────────────────────────────── */
.toefl-ibt-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 16px 40px}

/* ── En-tête de section ─────────────────────────────────────────── */
.toefl-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px auto 24px;
    max-width: 900px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap}
/* Les dots (toefl-steps-nav) viennent avant h2 dans le DOM */
.toefl-section-header h2 { margin: 0; padding: 0; flex: 1}
.toefl-section-icon { font-size: 1.8rem; line-height: 1}
.toefl-section-badge {
    display: none; /* supprimé du PHP */
}

/* ── Instruction ────────────────────────────────────────────────── */
.toefl-instruction {
    color: var(--text);
    font-size: .97rem;
    font-style: normal;
    padding: 8px 0 12px;
    margin: 0;
    font-weight: 600;
    line-height: 1.5;
    text-align: left}

/* ── Listening section intro block ──────────────────────────────── */
.toefl-section-intro {
    background: #f0f4ff;
    
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 20px}
.toefl-section-intro .toefl-instruction {
    padding: 2px 0;
    margin: 0;
    font-weight: 400}
.toefl-section-intro .toefl-instruction:first-child {
    font-weight: 700;
    font-size: 1rem}
.toefl-no-return {
    color: #c0392b !important;
    margin-top: 6px !important}

.toefl-not-answered {
    color: #888;
    font-style: italic;
    font-size: 0.9rem;
    margin: 0;
    padding: 0;
    white-space: nowrap}

/* ── Best-response options list (results page) ──────────────────── */
.toefl-br-options {
    list-style: none;
    padding: 0;
    margin: 6px 0 8px;
    display: flex;
    flex-direction: column;
    gap: 5px}
.toefl-br-options li {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fafafa;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 8px}
/* No-border variant for Q1–Q8 best-response */
.toefl-br-options--no-border {
    gap: 2px}
.toefl-br-options--no-border li {
    border: none;
    background: none;
    padding: 2px 6px;
    line-height: 1.3}
.toefl-br-options--no-border li.br-opt-correct {
    background: #e8f8e8;
    border-radius: 4px}
.toefl-br-options--no-border li.br-opt-incorrect {
    background: #fdecea;
    border-radius: 4px}
.toefl-br-options li .option-letter {
    flex-shrink: 0}
.toefl-br-options li.br-opt-correct {
    background: #e8f8e8;
    border-color: #4caf50;
    color: #2e7d32;
    font-weight: 600}
.toefl-br-options li.br-opt-incorrect {
    background: #fdecea;
    border-color: #e53935;
    color: #b71c1c;
    font-weight: 600}

/* ── Q1–8 best-response: no colored background on options ────────── */
.question-block--no-bg .toefl-br-options li.br-opt-correct,
.question-block--no-bg .toefl-br-options--no-border li.br-opt-correct,
.question-block--no-bg .toefl-br-options li.br-opt-incorrect,
.question-block--no-bg .toefl-br-options--no-border li.br-opt-incorrect {
    background: transparent;
    border-color: transparent;
    color: inherit;
    font-weight: inherit}

/* ── Unified result options list (all MCQ sections) ─────────────── */
.toefl-result-options {
    list-style: none;
    padding: 0;
    margin: 5px 0 6px;
    display: flex;
    flex-direction: column;
    gap: 4px}
.toefl-result-options li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 8px 4px 18px; /* 18px = width of the arrow slot */
    font-size: 0.9rem;
    line-height: 1.4}
/* Expected row: no indent since arrow fills the slot */
.toefl-result-options li.toefl-opt-expected {
    padding-left: 0}
.toefl-opt-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-weight: 700;
    font-size: .75em;
    font-family: var(--font-mono);
    overflow: hidden;
    white-space: nowrap;
    margin-top: 1px}
.toefl-opt-badge--neutral  { background: var(--blue);  border: 2px solid var(--blue);  color: #fff}
.toefl-opt-badge--correct  { background: var(--green); border: 2px solid var(--green); color: #fff}
.toefl-opt-badge--incorrect{ background: var(--red);   border: 2px solid var(--red);   color: #fff}
.toefl-opt-badge--expected { background: var(--blue);  border: 2px solid var(--blue);  color: #fff}
.toefl-opt-text--correct   { color: var(--green); font-weight: 700}
.toefl-opt-text--incorrect { color: #b91c1c; font-weight: 700}
.toefl-opt-text--expected  { color: var(--blue-text); font-weight: 700}
/* Arrow preceding the expected-answer option */
.toefl-opt-expected::before {
    content: '\2192';
    display: inline-flex;
    align-items: center;
    color: var(--blue-text);
    font-weight: 700;
    font-size: 1.05em;
    width: 18px;
    flex-shrink: 0;
    margin-top: 2px}

/* ✅ following the correct-answer option */
.toefl-opt-correct::after {
    content: '✅';
    display: inline-flex;
    align-items: center;
    font-size: 1.05em;
    flex-shrink: 0;
    margin-left: 6px}

/* ❌ following the incorrect-answer option */
.toefl-opt-incorrect::after {
    content: '❌';
    display: inline-flex;
    align-items: center;
    font-size: 1.05em;
    flex-shrink: 0;
    margin-left: 6px}

/* ── Always-visible transcript block (sections 2+) ─────────────── */
.toefl-transcript-always {
    display: block !important;
    margin-bottom: 12px}

/* ── Tight transcript for sections 2+ in results ───────────────── */
.toefl-transcript-tight {
    line-height: 1.35 !important;
    text-align: justify;
    white-space: pre-wrap}
.toefl-transcript-tight br {
    display: block;
    margin: 0;
    content: ""}

/* ── Transcript label ───────────────────────────────────────────── */
.toefl-transcript-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-3);
    margin: 1rem 0 3px}

/* ── Listening best-response options (audio-only, no text) ─────── */
.toefl-question label:has(input[type=radio]) .option-letter:only-child {
    min-width: 2rem}

/* ── Bloc question ──────────────────────────────────────────────── */
.toefl-question {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    padding: 18px 22px;
    transition: border-color var(--transition), box-shadow var(--transition);
    box-shadow: 0 2px 8px rgba(0,0,0,.07), 0 1px 3px rgba(0,0,0,.05)}
.toefl-question:hover {
    border-color: var(--blue-mid);
    box-shadow: 0 6px 20px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.08)}
.toefl-question-prompt {
    font-weight: 600;
    font-size: .97rem;
    color: var(--text);
    margin: 0 0 12px 0;
    padding: 0;
    text-align: left;
    line-height: 1.5}
.toefl-question-num {
    display: inline-block;
    background: #1a2340;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 2px 7px;
    border-radius: 10px;
    margin-right: 6px;
    vertical-align: middle;
    letter-spacing: .3px}

/* ── Labels radio — pastilles style ancienne version ────────────── */
.toefl-question label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    margin-bottom: 0;
    border-radius: var(--radius-sm);
    font-weight: 400;
    font-size: .95rem;
    color: var(--text-2);
    transition: background var(--transition), color var(--transition);
    line-height: 1.45}
.toefl-question label:hover {
    /* Fond bleu clair retiré (décision Boris 08/2026) : alignement sur le
       style TOEIC — seule la pastille-lettre se remplit, le texte passe en bleu. */
    color: var(--blue-text);
    font-weight: 600}
.toefl-question input[type=radio],
.toefl-question input[type=checkbox] {
    position: absolute;
    opacity: 0;
    pointer-events: none}
.toefl-question label .option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    border: 2px solid var(--blue);
    background: var(--surface);
    color: var(--blue-text);
    font-weight: 700;
    font-size: .75em;
    font-family: var(--font-mono);
    overflow: hidden;
    white-space: nowrap;
    transition: all var(--transition)}
.toefl-question label:has(input[type=radio]:checked),
.toefl-question label:has(input[type=checkbox]:checked) {
    /* Fond bleu clair retiré (décision Boris 08/2026) : alignement sur le
       style TOEIC — seule la pastille-lettre se remplit, le texte passe en bleu. */
    color: var(--blue-text);
    font-weight: 600}
.toefl-question label:has(input[type=radio]:checked) .option-letter,
.toefl-question label:has(input[type=checkbox]:checked) .option-letter {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
    padding-left: 0;
    transform: scale(1.12);
    box-shadow: 0 2px 8px rgba(0,0,0,.18)}

/* ── Pastilles résultats ────────────────────────────────────────── */
.user-answers li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .95rem;
    margin-bottom: .15em}
.user-answers li .option-letter,
.expected-text .option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-weight: 700;
    font-size: .75em;
    font-family: var(--font-mono);
    overflow: hidden;
    white-space: nowrap}
.answer-correct .option-letter {
    background: var(--green); border: 2px solid var(--green); color: #fff; padding-left: 0}
.answer-incorrect .option-letter {
    background: var(--red); border: 2px solid var(--red); color: #fff; padding-left: 0}
/* Couleur du texte de la réponse fournie */
.user-answers li.answer-correct  { color: #0a7c55}
.user-answers li.answer-incorrect { color: #b91c1c}
.expected-text .option-letter {
    background: var(--teal); border: 2px solid var(--teal); color: #fff; padding-left: 0}

/* ── Éléments divers ────────────────────────────────────────────── */
.toefl-speaker-label {
    font-size: .85rem; font-weight: 600; color: var(--text-3);
    text-transform: uppercase; letter-spacing: .8px;
    margin: 0 0 6px 0; padding: 0}
.toefl-prompt-bubble {
    background: var(--surface-2); border: 1.5px solid var(--border);
     border-radius: var(--radius);
    padding: 10px 16px; margin-bottom: 12px;
    font-style: italic; font-size: .97rem; color: var(--text); line-height: 1.55}
.toefl-source-text {
    background: var(--surface-2);
    border: 1px solid var(--text);
    border-radius: var(--radius);
    padding: 16px 20px; margin-bottom: 20px; font-size: .95rem;
    line-height: 1.6; color: var(--text); white-space: pre-line; text-align: justify}
/* Email body: pas de pre-line, espacement compact entre les <br> */
.toefl-email-headers ~ br,
.toefl-source-text br { line-height: 1.6}
.toefl-source-text:has(.toefl-email-headers) {
    white-space: normal}
.toefl-source-title {
    display: block; font-size: .72rem; font-weight: 700; letter-spacing: 1.2px;
    color: var(--text); text-transform: uppercase; margin-bottom: 10px;
    font-family: var(--font-mono)}
.toefl-email-headers {
    display: flex; flex-direction: column; gap: 2px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px; margin-bottom: 12px;
    font-size: .88rem; color: var(--text-2)}
.toefl-email-template {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 12px;
    font-size: .9rem; color: var(--text-2); line-height: 1.5}
.toefl-email-template p {
    margin: 0;
    padding: 0 0 4px 0;
    font-weight: 400}
/* ── Fill-in-the-blanks — paragraphe de test ────────────────────── */
.toefl-fill-para {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
    font-size: .97rem;
    margin-bottom: 16px;
    padding: 18px 22px;
    line-height: 2.4;
    color: var(--text);
    text-align: justify;
    transition: border-color var(--transition), box-shadow var(--transition);
    box-shadow: 0 2px 8px rgba(0,0,0,.07), 0 1px 3px rgba(0,0,0,.05)}

.toefl-fill-para:hover {
    border-color: var(--blue-mid);
    box-shadow: 0 6px 20px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.08)}

/* Groupe numéro + champ : collés en inline */
.toefl-blank-group {
    display: inline;
    white-space: nowrap}

/* Numéro en exposant au-dessus du champ */
.toefl-blank-num {
    font-family: var(--font-mono);
    font-size: .62em;
    font-weight: 700;
    color: var(--blue-text);
    vertical-align: super;
    margin-right: 1px;
    letter-spacing: 0;
    line-height: 1;
    user-select: none}

/* Champ de saisie inline */
.toefl-blank-input {
    display: inline-block;
    border: none;
    border-bottom: 2.5px solid var(--blue);
    background: transparent;
    color: var(--blue-dark);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: .93em;
    padding: 0 2px 1px;
    margin: 0 2px;
    text-align: center;
    vertical-align: baseline;
    outline: none;
    border-radius: 0;
    transition: border-color var(--transition), background var(--transition);
    /* placeholder underscores shown via HTML attribute */
}
.toefl-blank-input::placeholder {
    color: var(--border-strong);
    letter-spacing: 2px;
    font-weight: 400}
.toefl-blank-input:focus {
    border-bottom-color: var(--orange);
    background: var(--orange-light);
    border-radius: 3px 3px 0 0;
    color: #b45309}


/* ── Fill-in: cases lettre individuelle (grille collée) ──────────────────── */
.toefl-letter-boxes {
    display: inline-flex;
    vertical-align: middle;
    margin: 0 4px;
    /* Bordure extérieure commune */
    border: 2px solid var(--blue);
    border-radius: 4px;
    overflow: hidden; /* clip les coins des cases intérieures */
}
.toefl-letter-box {
    display: inline-block;
    width: 26px;
    height: 26px;
    /* Pas de bordure propre : séparateur interne uniquement à gauche (sauf 1ère case) */
    border: none;
    border-left: 1px solid var(--blue-mid);
    background: transparent;
    color: var(--blue-dark);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: .93em;
    text-align: center;
    padding: 0;
    outline: none;
    transition: background var(--transition), color var(--transition);
    caret-color: transparent;
    border-radius: 0;
    position: relative;
    z-index: 0}
/* Pas de séparateur avant la première case */
.toefl-letter-box:first-child {
    border-left: none}
/* Case active : fond orange, texte orange-foncé, z-index pour que la surbrillance
   ne soit pas clippée par le overflow:hidden du conteneur */
.toefl-letter-box:focus {
    background: var(--orange-light);
    color: #b45309;
    z-index: 1;
    /* Indicateur visuel de focus sur le groupe entier via outline sur le parent */
}
/* Quand une case du groupe est focalisée, souligner le groupe */
.toefl-letter-boxes:focus-within {
    border-color: var(--orange);
    box-shadow: 0 0 0 2px var(--orange-light)}
/* Cases remplies */
.toefl-letter-box.filled {
    background: var(--blue-light)}

/* ── Fill-in — résultats ────────────────────────────────────────── */
.toefl-fill-result-block {
    padding: 8px 14px;
    border-left: none;
    border: none;
    background: none;
    box-shadow: none;
    margin-bottom: 6px}
/* Numéro de lacune dans les résultats */
.toefl-blank-num-result {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: .75rem;
    flex-shrink: 0;
    margin-right: 4px}
.toefl-fill-result-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    font-size: .9rem}
/* Pastille mot tapé / correct */
.toefl-fill-word-result {
    display: inline-block;
    border-radius: var(--radius-sm);
    padding: 2px 10px;
    font-family: var(--font-mono);
    font-size: .92rem;
    font-weight: 700;
    letter-spacing: .4px}
.toefl-fill-word-result.fill-correct {
    background: var(--green-light);
    color: #0a7c55;
    border: 1.5px solid var(--green)}
.toefl-fill-word-result.fill-incorrect {
    background: var(--red-light);
    color: #b91c1c;
    border: 1.5px solid var(--red);
    text-decoration: line-through;
    text-decoration-color: #b91c1c80}
.toefl-fill-arrow {
    color: var(--text-3);
    font-size: .85rem;
    flex-shrink: 0}
/* Mot complet entre parenthèses */
.toefl-fill-fullword {
    font-size: .8rem;
    color: var(--text-3);
    font-family: var(--font-mono);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1px 8px;
    margin-left: 2px;
    white-space: nowrap}

/* ── Fill-in — correction paragraphe (résultats) ────────────────── */
.toefl-fill-para--result {
    border-color: var(--border);
    background: var(--surface-2);
    line-height: 2.4;
    word-break: break-word}

/* Groupe : numéro exposant + chip(s) de correction, inline */
.toefl-corr-group {
    display: inline;
    white-space: nowrap}

/* Puce de correction commune */
.toefl-corr-chip {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: .88em;
    font-weight: 700;
    border-radius: 4px;
    padding: 1px 7px;
    margin: 0 1px;
    vertical-align: baseline;
    white-space: nowrap}

/* Réponse vide ou attendue */
.toefl-corr-empty, 
.toefl-corr-expected {
    background: var(--surface-3, #e5e7eb);
    color: var(--text-3);
    border: 1.5px solid var(--border-strong, #9ca3af)}

/* Réponse correcte — vert */
.toefl-corr-correct {
    background: var(--green-light);
    color: #0a7c55;
    border: 1.5px solid var(--green)}

/* Réponse incorrecte — rouge barré */
.toefl-corr-incorrect {
    background: var(--red-light);
    color: #b91c1c;
    border: 1.5px solid var(--red);
    text-decoration: line-through;
    text-decoration-color: #b91c1c80}



/* Numéro exposant dans le paragraphe-correction (légèrement plus visible) */
.toefl-blank-num--result {
    color: var(--text-3)}

/* ── Legacy (kept for backward compat) ──────────────────────────── */
.toefl-fill-paragraph {
    background: var(--surface-2); border: 1px solid var(--border);
     border-radius: var(--radius);
    padding: 18px 22px; margin-bottom: 20px;
    font-size: .96rem; line-height: 2; color: var(--text); text-align: justify}
.toefl-fill-paragraph input[type=text] {
    border: none; border-bottom: 2px solid var(--blue);
    background: transparent; color: var(--blue-text);
    font-weight: 600; font-family: var(--font-mono);
    font-size: .92em; padding: 0 4px; text-align: center;
    outline: none; transition: border-color var(--transition); vertical-align: baseline}
.toefl-fill-paragraph input[type=text]:focus {
    border-bottom-color: var(--orange); background: var(--orange-light)}
.toefl-audio-wrapper {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px}
.toefl-audio-icon { font-size: 1.2rem; flex-shrink: 0}
.toefl-audio-wrapper audio { flex: 1; height: 36px; min-width: 0}
.toefl-textarea {
    width: 100%; box-sizing: border-box; font-family: var(--font); font-size: 1em;
    padding: 14px 16px; border: 1.5px solid var(--border); border-radius: var(--radius);
    resize: vertical; margin-bottom: 6px; background: var(--surface-2); color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition); line-height: 1.65}
.toefl-textarea:focus {
    outline: none; border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0,0,0,.08); background: var(--surface)}
.toefl-word-count {
    font-size: .82em; color: var(--text-3); text-align: right;
    margin-bottom: 16px; font-family: var(--font-mono)}
.toefl-word-count.warn { color: var(--orange)}
.toefl-word-count.ok   { color: var(--green)}
.toefl-context {
    font-size: .93rem; color: var(--text-2); font-style: italic;
    margin: 0 0 10px 0; padding: 0; font-weight: 400; text-align: left}
.toefl-passage {
    background: var(--surface-2); border: 1px solid var(--border);
     border-radius: var(--radius);
    padding: 18px 22px; margin-bottom: 20px; font-size: .96rem;
    line-height: 1.65; color: var(--text); text-align: justify}
/*.toefl-discussion-posts { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px}
.toefl-post { display: flex; align-items: flex-start; gap: 10px}
.toefl-post.professor .toefl-post-bubble { border-left-color: var(--blue)}
.toefl-post-avatar { font-size: 1.3rem; line-height: 1; flex-shrink: 0; margin-top: 2px}
.toefl-post-bubble {
    background: var(--surface-2); border: 1px solid var(--border);
    
    border-radius: 0 var(--radius) var(--radius) var(--radius);
    padding: 10px 14px; font-size: .93rem; line-height: 1.6; color: var(--text); flex: 1}
.toefl-post-speaker {
    font-size: .78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .6px; color: var(--text-3); margin-bottom: 4px;
    font-family: var(--font-mono)}*/
.toefl-discussion-posts { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px}
.toefl-post { display: flex; align-items: flex-start; gap: 10px}
.toefl-post.professor .toefl-post-bubble { border-left-color: var(--blue)}
.toefl-post-avatar { width: 54px; height: 54px; border-radius: 50%; overflow: hidden; flex-shrink: 0; margin-top: 2px; background: var(--surface-2)}
.toefl-post-avatar .toefl-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block}
.toefl-post-bubble {
    background: var(--surface-2); border: 1px solid var(--border);
    
    border-radius: 0 var(--radius) var(--radius) var(--radius);
    padding: 10px 14px; font-size: .93rem; line-height: 1.6; color: var(--text); flex: 1}
.toefl-post-speaker {
    font-size: .78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .6px; color: var(--text-3); margin-bottom: 4px;
    font-family: var(--font-mono)}
/* ═══════════════════════════════════════════════════════════════
   Writing — Build a Sentence  (drag-and-drop)
   ═══════════════════════════════════════════════════════════════ */
.bs-hint {
    font-size: .82rem; color: var(--text-3); margin: 0 0 10px}
.bs-frame {
    background: var(--surface-2); border: 1.5px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px;
    font-size: 1.05rem; line-height: 3.6; color: var(--text);
    margin-bottom: 12px}
/* ── Build-a-sentence : correction per-word ─────────────────────── */

/* Conteneur d'un gap dans la correction */
.toefl-corr-gap {
    display: inline;
    white-space: normal}

/* Séparateur → entre réponse donnée et réponse attendue (inutilisé mais conservé) */
.toefl-corr-sep { display: none}

/* Ligne "✓ Expected: ..." affichée sous la frame */
.toefl-corr-expected-line {
    margin: 6px 0 0;
    font-size: .88rem;
    color: var(--text-2)}
.toefl-corr-expected-label {
    color: var(--green);
    font-weight: 700;
    margin-right: 4px}

/* Fine bordure colorée sur la frame — même couleur neutre que les autres sections */
.answer-correct .toefl-fill-para--result,
.answer-incorrect .toefl-fill-para--result {
    border-color: var(--border)}

.toefl-corr-group {
    display: inline;
    white-space: normal}

.bs-gap {
    display: inline-flex; align-items: center; gap: 4px;
    vertical-align: middle; margin: 0 3px}
/* Slot individuel vide */
.bs-slot {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 72px; height: 34px;
    border-bottom: 2.5px solid var(--blue);
    background: rgba(31,124,255,.07);
    border-radius: 4px 4px 0 0;
    padding: 0 6px;
    cursor: default;
    font-size: .88rem;
    transition: background .12s, border-color .12s;
    white-space: nowrap;
    vertical-align: middle}
/* Slot survolé pendant drag */
.bs-slot.bs-slot-over {
    background: var(--blue-light);
    border-bottom-color: var(--blue);
    border-bottom-width: 3px}
/* Slot rempli */
.bs-slot.bs-slot-full {
    background: var(--blue);
    border-bottom-color: var(--blue);
    gap: 5px; padding: 0 6px 0 10px;
    cursor: default}
.bs-slot-txt {
    color: #fff; font-weight: 600; font-size: .88rem;
    cursor: grab; user-select: none}
.bs-slot-txt:active { cursor: grabbing}
.bs-slot-rm {
    color: rgba(255,255,255,.8); font-size: .82rem; cursor: pointer;
    padding: 1px 3px; border-radius: 50%;
    transition: background .12s;
    pointer-events: all}
.bs-slot-rm:hover { background: rgba(255,255,255,.25); color: #fff}

/* Wordbank */
.toefl-wordbank {
    display: flex; flex-wrap: wrap; gap: 8px; padding: 12px;
    background: var(--surface-2); border: 1px dashed var(--border-strong);
    border-radius: var(--radius); margin-top: 8px;
    transition: background .12s}
.toefl-wordbank.bs-bank-over { background: var(--blue-light)}
.toefl-word-chip {
    display: inline-block; padding: 5px 12px;
    background: var(--surface); border: 1.5px solid var(--blue-mid);
    border-radius: 20px; font-size: .88rem; font-weight: 600;
    color: var(--blue-dark); cursor: grab; user-select: none;
    transition: all .12s; box-shadow: var(--shadow-sm)}
.toefl-word-chip:hover:not(.used) {
    background: var(--blue-light); border-color: var(--blue);
    transform: translateY(-1px); box-shadow: var(--shadow)}
.toefl-word-chip:active { cursor: grabbing}
.toefl-word-chip.used { opacity: .32; cursor: default; pointer-events: none}
.toefl-timing-container {
    margin: 8px 0; padding: 8px 12px;
    background: var(--surface-2); border-radius: var(--radius-sm);
    font-size: .9rem; color: var(--text-2)}
.toefl-timing-list { list-style: none; padding: 0; margin: 0}
.toefl-transcript-toggle {
    background: none; border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); padding: 4px 10px;
    font-size: .82rem; color: var(--text-3); cursor: pointer;
    margin-bottom: 8px; transition: all var(--transition)}
.toefl-transcript-toggle:hover { color: var(--blue-text); border-color: var(--blue-mid)}
.toefl-transcript-body {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 10px 14px;
    font-size: .88rem; color: var(--text-2); line-height: 1.6;
    margin-bottom: 10px}
/* ── Full scoring rubric (all descriptor levels) ── */
.toefl-rubric { margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: visible}

/* ── Scoring rubric table — scroll horizontal sur écrans étroits ── */
details > div[style*="overflow-x"],
details > .toefl-rubric-wrap,
details[open] { overflow-x: auto; -webkit-overflow-scrolling: touch}

/* Wrapper scrollable autour du tableau de rubric (généré inline par PHP) */
details > div { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%}

/* Garantit que le tableau ne dépasse pas son wrapper */
.toefl-rubric table,
details table { min-width: 400px; max-width: none}
.toefl-rubric-crit { border-bottom: 2px solid var(--border)}
.toefl-rubric-crit:last-child { border-bottom: none}
.toefl-rubric-crit-head { background: var(--surface-2); padding: 5px 11px; font-weight: 700; font-size: .85rem; color: var(--text); border-bottom: 1px solid var(--border)}
.toefl-rubric-weight { font-weight: 400; color: var(--text-2)}
.toefl-rubric-row { display: flex; align-items: flex-start; gap: 10px; padding: 5px 11px; border-bottom: 1px solid var(--border); font-size: .85rem; line-height: 1.4}
.toefl-rubric-row:last-child { border-bottom: none}
.toefl-rubric-score { flex: 0 0 34px; text-align: center; font-weight: 800; font-size: .75rem; padding: 2px 3px; border-radius: 4px}
.toefl-rubric-row--high { background: #f0fdf4}
.toefl-rubric-row--high .toefl-rubric-score { background: var(--green-light); color: #059669; border: 1px solid var(--green)}
.toefl-rubric-row--high .toefl-rubric-desc { color: #059669; font-weight: 600}
.toefl-rubric-row--mid .toefl-rubric-score { background: #fef3c7; color: #92400e; border: 1px solid #fbbf24}
.toefl-rubric-row--mid .toefl-rubric-desc { color: var(--text-2)}
.toefl-rubric-row--low { background: #fff5f5}
.toefl-rubric-row--low .toefl-rubric-score { background: var(--red-light); color: #b91c1c; border: 1px solid var(--red)}
.toefl-rubric-row--low .toefl-rubric-desc { color: #b91c1c; font-weight: 600}
.toefl-rubric-desc { flex: 1}
/* ── Open writing labels ── */
.toefl-open-label { font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .5px; display: block; margin: 8px 0 3px}
.toefl-open-label--user   { color: var(--blue-text)}
.toefl-open-label--sample { color: var(--green)}
.toefl-open-answer--user  {  font-weight: 600; color: var(--blue-dark)}
.toefl-sample-answer {
    background: var(--green-light); border: 1px solid var(--green);
     border-radius: var(--radius);
    padding: 12px 16px; font-size: .93rem; color: var(--text);
    line-height: 1.65; margin-top: 8px;
    text-align: justify}
.toefl-sample-label {
    font-weight: 700; color: var(--green); font-size: .88rem;
    margin: 6px 0 2px 0; padding: 0; text-transform: uppercase; letter-spacing: .5px}
.toefl-result-section-title {
    font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
    color: var(--text-3); border-bottom: 1px solid var(--border);
    padding-bottom: 6px; margin: 1.4rem 0 .8rem}

/* ─── Per-question explanations (training results page) ──────────────────── */
.toefl-explanation {
    margin-top: 10px;
    padding: 10px 14px;
    background: var(--blue-light);
    
    border-radius: var(--radius-sm);
    font-size: .87rem;
    line-height: 1.55;
    color: var(--text)}
.toefl-explanation-summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--blue-dark);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 2px 0;
    list-style: none;
    user-select: none}
.toefl-explanation-summary::-webkit-details-marker { display: none}
.toefl-explanation-summary::before {
    content: '▸';
    display: inline-block;
    width: 1em;
    transition: transform .15s ease}
.toefl-explanation[open] .toefl-explanation-summary::before {
    transform: rotate(90deg)}
.toefl-explanation-body {
    margin-top: 6px;
    text-align: justify}
.toefl-explanation-list {
    margin: 14px 0 6px;
    display: flex;
    flex-direction: column;
    gap: 8px}
.toefl-explanation-row {
    display: flex;
    align-items: flex-start;
    gap: 10px}
.toefl-explanation-qid {
    flex: 0 0 auto;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
    font-size: .78rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    min-width: 42px;
    text-align: center;
    margin-top: 6px;
    line-height: 1.2}
.toefl-explanation-row .toefl-explanation {
    flex: 1;
    margin-top: 0}


@media (max-width: 900px) {
    h2 { font-size: 1.4rem}
    .container { padding: 20px; margin: 0 12px; width: calc(100% - 24px)}
    .section-doc { margin: 6px; padding: 12px}
    .results-header { max-width: 400px; padding: 16px; margin: 16px 20px; font-size: 1.35rem}
    .accord-container { max-width: 100%; padding: 16px; margin: 16px auto}
    .accord-header { font-size: 1.25rem}
    .accord-content { font-size: .93rem}
    .section-score-line { font-size: .97rem}
    .score-global-banner {
        margin-left: -16px;
        margin-right: -16px;
        margin-top: 0;
        max-width: none;
        border-radius: 0;
        padding: 22px 24px}
}

@media (max-width: 600px) {
    .container { padding: 16px; margin: 0 8px}
    .results-header { max-width: 100%; padding: 14px; margin: 12px 16px; font-size: 1.15rem}
    .accord-container { max-width: 100%; padding: 14px; margin: 12px auto}
    .accord-header { font-size: 1.1rem}
    .accord-content { font-size: .9rem}
    .section-score-line { flex-direction: column; align-items: flex-start; gap: 4px; font-size: .88rem}
    /* Sur mobile, le header autour fait 1.15rem (cf. .results-header juste
       au-dessus). Le score à 1.6rem créait un contraste violent — on aligne
       sur la taille du header avec un léger boost pour rester lisible. */
    .score-value { font-size: 1rem; padding: 3px 10px}
    .btn, .btn-margin { padding: 10px 22px; font-size: .9rem}
    .score-global-banner { padding: 20px 20px; font-size: .95rem}
}

@media (max-width: 767px) {
    .question.question-horizontal { display: flex; flex-direction: column}
    .question.question-with-image .image-side { max-width: 90%}
    .question.question-with-image .image-side img { max-height: 180px}
    .question.question-with-image .options-side { gap: 10px}
}

/* ═══════════════════════════════════════════════════════════════════
   @media print — Export PDF via window.print()
═══════════════════════════════════════════════════════════════════ */
@media print {

    /* ── Masquer tout ce qui n'est pas les résultats ── */
    .toefl-steps-nav,
    .toefl-btn-container,
    audio,
    .toefl-transcript-toggle,
    .cecrl-accordion-toggle {
        display: none !important}

    /* ── Fond blanc, encres économisées ── */
    body, .toefl-ibt-container {
        background: #fff !important;
        color: #000 !important}

    /* ── Neutraliser TOUS les overflow:hidden et max-height susceptibles
          de tronquer le contenu scrollable ── */
    .accord-container,
    .accord-content,
    .cecrl-accordion,
    .cecrl-accordion-content,
    .toefl-source-text,
    .toefl-passage,
    .toefl-sample-answer,
    .toefl-transcript-body,
    .toefl-discussion-posts,
    .toefl-rubric,
    .score-global-banner,
    .question-block,
    .toefl-fill-para {
        overflow: visible !important;
        max-height: none !important;
        height: auto !important}

    /* ── Ouvrir les accordéons résultats ── */
    .accord-content {
        display: block !important}

    /* ── Ouvrir les accordéons CEFR ── */
    .cecrl-accordion-content {
        display: block !important}
    
    /* ── Ouvrir les <details> natifs (scoring rubric) ── */
    details {
        display: block !important}
    details > summary {
        display: none !important}

    /* ── Transcripts toujours visibles ── */
    .toefl-transcript-body {
        display: block !important}

    /* ── Barres de score : forcer couleurs et largeur ── */
    .score-bar {
        border: 1px solid #ccc !important;
        background: #eee !important;
        overflow: visible !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact}
    .score-fill {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        min-height: 24px}
    .score-fill::after {
        text-shadow: 0 0 3px rgba(0,0,0,.5);
        color: var(--text) !important}

    /* ── Éviter les coupures au milieu d'un bloc ── */
    .accord-container,
    .score-global-banner,
    .question-block {
        break-inside: avoid;
        page-break-inside: avoid}

    /* ── Liens non soulignés ── */
    a { text-decoration: none; color: #000}
}
/* ── Fill-in-the-blanks — correctif débordement mobile ─────────── */
@media (max-width: 600px) {

    /* Le paragraphe ne dépasse plus de son conteneur */
    .toefl-fill-para {
        overflow-x: hidden;
        word-break: break-word;
        overflow-wrap: break-word;
        padding: 14px 14px;
        line-height: 2.6; /* légèrement plus espacé pour les grilles inline */
    }

    /* Le groupe (numéro + grille) peut passer à la ligne si besoin */
    .toefl-blank-group {
        white-space: normal;
        display: inline-flex;
        align-items: baseline;
        vertical-align: middle;
        flex-wrap: nowrap; /* la grille reste d'un bloc mais peut aller à la ligne */
    }

    /* Cases légèrement plus petites sur très petit écran */
    .toefl-letter-box {
        width: 22px;
        height: 24px;
        font-size: .85em}

    /* Limite la largeur totale de la grille pour les mots très longs */
    .toefl-letter-boxes {
        max-width: calc(100% - 24px); /* laisse la place au numéro exposant */
        flex-wrap: wrap; /* si vraiment trop long, les cases passent à la ligne */
    }

    /* Résultats : chips de correction */
    .toefl-corr-chip {
        max-width: 100%;
        white-space: normal;
        word-break: break-all}

    .toefl-corr-group {
        white-space: normal}

    /* Paragraphe de résultats */
    .toefl-fill-para--result {
        overflow-x: hidden;
        word-break: break-word}
}

/* ── Mode tap mobile : sélection en attente ─────────────────────── */
.toefl-word-chip.bs-tap-selected {
    background: var(--orange-light); border-color: var(--orange);
    color: var(--orange); box-shadow: 0 0 0 3px rgba(255,140,0,.25), var(--shadow-sm);
    transform: translateY(-2px)}
.bs-slot.bs-tap-selected {
    border-color: var(--orange) !important; background: var(--orange-light) !important;
    box-shadow: 0 0 0 3px rgba(255,140,0,.25)}
/* Slots vides mis en évidence quand un chip est sélectionné */
.toefl-question:has(.bs-tap-selected.toefl-word-chip) .bs-slot:not(.bs-slot-full) {
    border-color: var(--orange); background: var(--orange-light); cursor: pointer}
.toefl-question:has(.bs-tap-selected.toefl-word-chip) .bs-slot:not(.bs-slot-full):hover {
    background: #ffe0b2}
/* Mode clic : option .o-drag-drop sélectionnée */
.o-drag-drop.click-selected {
    border-color: var(--orange); background: var(--orange-light); color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255,140,0,.25), var(--shadow-sm);
    cursor: pointer; transform: translateY(-2px)}
.o-drag-drop.click-selected::before {
    border-color: var(--orange); background: var(--orange); color: #fff}
.question.drop-enabled:has(.click-selected) li.empty {
    border-color: var(--orange); background: var(--orange-light); cursor: pointer}
.question.drop-enabled:has(.click-selected) li.empty:hover { background: #ffe0b2}

/* ── Training : Build-a-Sentence tap/click (bs-word / bs-bank) ──────────────── */
.bs-word {
    display: inline-block; padding: 5px 12px;
    background: var(--surface); border: 1.5px solid var(--blue-mid);
    border-radius: 20px; font-size: .88rem; font-weight: 600;
    color: var(--blue-dark); cursor: pointer; user-select: none;
    transition: all .12s; box-shadow: var(--shadow-sm)}
.bs-word:hover {
    background: var(--blue-light); border-color: var(--blue);
    transform: translateY(-1px); box-shadow: var(--shadow)}
/* Mot sélectionné en attente de dépôt */
.bs-word.bs-selected, .bs-slot.bs-selected {
    background: var(--orange-light) !important; border-color: var(--orange) !important;
    color: var(--orange) !important;
    box-shadow: 0 0 0 3px rgba(255,140,0,.25), var(--shadow-sm) !important;
    transform: translateY(-2px)}
/* Slots disponibles mis en évidence quand un mot est sélectionné */
.bs-slot.bs-available {
    border-bottom-color: var(--orange);
    background: var(--orange-light);
    cursor: pointer}
.bs-slot.bs-available:hover {
    background: #ffe0b2}
/* Banque de mots (training) */
.bs-bank {
    display: flex; flex-wrap: wrap; gap: 8px; padding: 12px;
    background: var(--surface-2); border: 1px dashed var(--border-strong);
    border-radius: var(--radius); margin-top: 8px}

/* ════════════════════════════════════════════════════════════════════════════
   Section scores — 4 large tiles (Reading / Listening / Writing / Speaking)
   ════════════════════════════════════════════════════════════════════════════ */
.toefl-score-tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 8px}
.toefl-score-tile {
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 160px}
.toefl-score-tile:hover {
    box-shadow: var(--shadow);
    border-color: var(--blue-mid);
    transform: translateY(-2px)}
.toefl-score-tile__head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;        /* permet au label "unscored" (texte long) de passer à la ligne */
    min-width: 0;           /* autorise les enfants flex à rétrécir si nécessaire */
}
.toefl-score-tile__icon {
    font-size: 2.1rem;
    line-height: 1;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--blue-light);
    color: var(--blue-text)}
.toefl-score-tile__name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    flex: 1 1 auto;
    min-width: 0;           /* indispensable pour que le texte puisse rétrécir/wrapper */
    overflow-wrap: anywhere}
.toefl-score-tile__score {
    font-family: var(--font-mono);
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--blue-text);
    line-height: 1;
    white-space: nowrap;    /* "1.0/6" reste sur une ligne — c'est court, c'est lisible */
    flex-shrink: 0;         /* le score numérique ne rétrécit jamais */
}
.toefl-score-tile__score--unscored {
    font-family: var(--font);
    font-size: .85rem;
    font-weight: 500;
    font-style: italic;
    color: var(--text-3);
    /* Override des règles de la classe de base : ce label peut être long
       ("aucun audio enregistré", "no audio recorded") → il doit pouvoir
       wrapper et rétrécir, contrairement à un score numérique. */
    white-space: normal;
    flex: 0 1 auto;
    text-align: right;
    overflow-wrap: anywhere}
.toefl-score-tile__sub {
    font-size: .8rem;
    color: var(--text-3);
    margin: -4px 0 0 64px}
.toefl-score-tile .score-bar {
    margin: 0;
    height: 28px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden}
.toefl-score-tile .score-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 1.2s cubic-bezier(.4,0,.2,1)}
.toefl-score-tile__note {
    font-size: .78rem;
    color: var(--text-3);
    margin: 0;
    line-height: 1.4}
.toefl-score-tile__empty {
    font-size: .82rem;
    color: var(--text-3);
    font-style: italic;
    margin: 0}

@media (max-width: 720px) {
    .toefl-score-tiles { grid-template-columns: 1fr; gap: 12px}
    .toefl-score-tile  { min-height: 0; padding: 14px 16px}
    .toefl-score-tile__icon { width: 44px; height: 44px; font-size: 1.7rem}
    .toefl-score-tile__score { font-size: 1.35rem}

    /* Sur viewport étroit (≤720px), le label "unscored" — typiquement
       "no audio recorded" / "aucun audio enregistré" — ne tient plus à
       côté du nom. Grâce à flex-wrap:wrap sur le head, il bascule sur
       une seconde ligne, alignée avec le nom (icône + gap = 56px). */
    .toefl-score-tile__score--unscored {
        flex-basis: 100%;
        text-align: left;
        margin-left: 56px;
        font-size: .8rem;
        line-height: 1.4}
    /* Sur très petit écran (~320px), le sub avec margin-left:64px peut
       déborder. On l'aligne avec l'icône+gap mobile. */
    .toefl-score-tile__sub { margin-left: 56px}
}

/* ═══════════════════════════════════════════════════════════════════
   TRAINING — AI feedback & answer blocks (classes utilisées dans
   toefl-ibt-training-{en,fr}.php pour le rendu des résultats).
═══════════════════════════════════════════════════════════════════ */

/* Bloc « Votre réponse » / « Correction » dans la page résultats des
   tâches d'écriture (open-writing). Encadré clair pour distinguer la
   réponse de l'utilisateur de l'exemple corrigé. */
.toefl-answer-block {
    margin: 12px 0;
    padding: 0}
.toefl-answer-block + .toefl-answer-block {
    margin-top: 16px}

/* Wrapper <details> qui contient le retour IA dépliable */
.toefl-ai-feedback-details {
    margin: 10px 0 6px;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition)}
.toefl-ai-feedback-details[open] {
    border-left-color: var(--blue-dark);
    box-shadow: var(--shadow-sm)}

/* Le résumé cliquable (titre du retour IA) */
.toefl-ai-feedback-summary {
    cursor: pointer;
    padding: 10px 14px;
    font-weight: 700;
    color: var(--text);
    font-size: .92rem;
    background: var(--blue-light);
    border-bottom: 1px solid transparent;
    user-select: none;
    transition: background var(--transition);
    list-style: none}
.toefl-ai-feedback-summary::-webkit-details-marker { display: none}
.toefl-ai-feedback-summary::marker { content: ''}
.toefl-ai-feedback-summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 8px;
    transition: transform var(--transition);
    color: var(--blue-dark)}
.toefl-ai-feedback-details[open] .toefl-ai-feedback-summary::before {
    transform: rotate(90deg)}
.toefl-ai-feedback-details[open] .toefl-ai-feedback-summary {
    border-bottom-color: var(--border)}
.toefl-ai-feedback-summary:hover { background: var(--blue-mid)}

/* Corps du retour IA (tableau de critères + erreurs + suggestion) */
.toefl-ai-feedback-box {
    padding: 12px 14px 14px;
    background: var(--surface);
    font-size: .85rem;
    line-height: 1.55;
    color: var(--text)}
.toefl-ai-feedback-box p { margin: 0 0 6px}
.toefl-ai-feedback-box table {
    width: 100%;
    border-collapse: collapse;
    margin: 4px 0 10px}
.toefl-ai-feedback-box ul {
    margin: 4px 0 6px;
    padding-left: 1.4em}

/* Wrapper par question pour build-a-sentence (hook neutre, styles
   réels appliqués sur .bs-frame / .bs-bank / .bs-slot). */
.bs-question {
    margin-bottom: 18px}

/* ═══════════════════════════════════════════════════════════════════
   PAGE RÉSULTATS SPEAKING — blocs "Votre réponse" et "Réponse modèle"
   Inspiré de .user-answer-block / .sample-answer-block du TOEIC SW :
   wrapper unique pour audio + transcription côté utilisateur (bleu),
   wrapper symétrique pour la réponse modèle (vert). Évite la
   fragmentation visuelle de l'ancienne mise en page (libellés
   indépendants empilés via .toefl-open-label).

   Utilisé par :
   - toefl-ibt-{fr,en}.php          (renderSpeakingAiBlock + take-an-interview)
   - toefl-ibt-training-{fr,en}.php (renderTrnSpeakingAiBlock + take-an-interview)
═══════════════════════════════════════════════════════════════════ */

.user-answer-block {
    margin: 8px 0 14px;
    padding: 10px 14px;
    
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius)}
.user-answer-label {
    display: block;
    font-weight: 700;
    font-size: .76rem;
    color: var(--blue-dark);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 6px}
.user-answer-lines {
    color: var(--text-2);
    font-weight: 400;
    font-size: .92rem;
    line-height: 1.6}
.user-answer-line {
    margin: 4px 0 0;
    color: var(--text-2);
    font-weight: 400;
    white-space: pre-wrap}
/* Variante : placeholder italique grisé (aucun enregistrement /
   aucune parole détectée). Remplace les inline styles dans les
   renderers PHP, conformément à la séparation contenu / style. */
.user-answer-line--empty {
    font-style: italic;
    color: var(--text-3);
    font-weight: 400}
.user-answer-block audio {
    width: 100%;
    max-width: 480px;
    display: block;
    margin: 0 0 4px}

.sample-answer-block {
    margin: 8px 0 14px;
    padding: 10px 14px;
    
    background: var(--surface);
    border: 1.5px solid var(--green);
    border-radius: var(--radius)}
.sample-answer-label {
    display: block;
    font-weight: 700;
    font-size: .76rem;
    color: #065f46;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 6px}
.sample-answer-block .answer-block {
    color: var(--text-2);
    font-weight: 400;
    font-size: .92rem;
    line-height: 1.6}
.sample-answer-block .answer-line {
    color: var(--text-2);
    font-weight: 400;
    font-size: .92rem;
    line-height: 1.6;
    white-space: pre-wrap;
    margin: 4px 0 0}
.sample-answer-block audio {
    width: 100%;
    max-width: 480px;
    display: block;
    margin: 0 0 6px}

/* ═══════════════════════════════════════════════════════════════════
   SPEAKING — UI d'enregistrement en cours (cercle minuteur + pastille
   « 🎙️ ENREGISTREMENT »). Anciennement inline dans les sections
   speaking de toefl-ibt-{fr,en}.php (style="..." + <style nonce>) ;
   centralisé ici pour respecter la séparation contenu / présentation.

   Le wrapper .toefl-spk-timer-area est en flex quand visible, ce qui
   aligne verticalement le cercle (48px de haut) et la pastille REC
   (~20px de haut) sur leur axe central — l'ancien text-align:center
   + vertical-align:middle ne le faisait pas proprement.

   JS (inline dans le PHP de la section speaking) bascule l'attribut
   `display` :
   - timer-area    : 'none' ↔ 'flex'
   - rec-inline    : 'none' ↔ 'inline-flex'
   - next-area     : 'none' ↔ 'block'
   - done-wrap     : 'none' ↔ 'block'
═══════════════════════════════════════════════════════════════════ */

.toefl-spk-timer-area {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 1rem}

.toefl-spk-timer-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2.5px solid var(--blue);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue-text);
    flex-shrink: 0}

@keyframes toeflRecPulse {
    0%, 100% { opacity: 1;  transform: scale(1)}
    50%      { opacity: .4; transform: scale(.85)}
}

.toefl-rec-inline {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 3px 11px;
    border-radius: 14px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1.2;
    user-select: none;
    flex-shrink: 0}

.toefl-rec-inline .rec-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 6px rgba(255, 255, 255, .7);
    animation: toeflRecPulse 1.1s ease-in-out infinite}

.toefl-spk-next-area {
    display: none;
    margin-top: 1.2rem;
    text-align: right}

.toefl-spk-done-wrap {
    display: none;
    text-align: center;
    padding: 1.4rem 0}

/* =====================================================================
   Accordéons de résultats : teinte bleue RETIRÉE (décision Boris 08/2026 :
   ni dégradé pleine carte, ni bandeau d'en-tête teinté — rendu neutre,
   les styles de base .accord-container / .accord-header s'appliquent).
   ===================================================================== */

/* Bandeau de moyenne globale */
.score-hero-card{
    background:#1f7cff;
}
.score-hero-card,
.score-hero-card *{
    color:#fff;
    opacity:1;
}

/* ─── Lien-bouton dans .btn-container (« Retour à la préparation »…) ───
   2026-10-13 : bouton pilule commun à toutes les certifications (modèle : css/training-hub.css), blanc au survol.
   Les <button> d'action ne sont pas concernés. */
.btn-container a.btn,
body.dark-mode .btn-container a.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 28px; min-height: 46px; line-height: 1.2; box-sizing: border-box;
  background: #1f7cff; border: 2px solid #1f7cff; border-radius: 50px; color: #fff;
  font-family: inherit; font-weight: 600; font-size: .95rem; letter-spacing: .2px;
  text-align: center; text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12); transform: none;
  transition: all .22s cubic-bezier(0.4, 0, 0.2, 1);
  width: auto; margin: 0;
}
.btn-container a.btn:hover, .btn-container a.btn:focus-visible,
body.dark-mode .btn-container a.btn:hover, body.dark-mode .btn-container a.btn:focus-visible {
  background: #fff; border-color: #1f7cff; color: var(--brand-text, #1067e6);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .10); text-decoration: none; transform: none;
}

/* MARGES LATÉRALES SUR MOBILE (14/11/2026). Même marge pour tout le site :
   --gutter, défini dans navbar-footer/critical.php (12 px à 375 px, 24 px au
   plus). Seules les marges EXTÉRIEURES de la page sont réglées ici ; le
   retrait intérieur des cartes ne change pas. Repli : l'ancienne valeur.
   Avant : 12 px sous 900 px, puis sous 600 px 8 px À GAUCHE et 16 px à
   droite (margin 0 8px avec une largeur toujours calc(100% - 24px)). */
@media (max-width:900px){.container{margin-left:var(--gutter,12px);margin-right:var(--gutter,12px);width:calc(100% - 2 * var(--gutter,12px))}}
