/* ══════════════════════════════════════════════════════════════════════
   Exercise blocks — editor, viewer & print styles
   ══════════════════════════════════════════════════════════════════════ */

/* ── Exercise toolbar ─────────────────────────────────────────────── */
.pe-exercise-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
}
.pe-exercise-toolbar .pe-toolbar-group {
  border-right: 1px solid #ddd;
}
.pe-exercise-toolbar .pe-toolbar-group:last-child { border-right: none;
}
/* Override fixed 32x32 for exercise buttons — auto width with label */
.pe-exercise-toolbar .pe-toolbar-btn {
  width: auto;
  height: 30px;
  padding: 0 10px;
  gap: 5px;
  font-size: 13px;
}
.pe-exercise-toolbar .pe-toolbar-btn .pe-toolbar-btn-text {
  font-size: 12px;
  white-space: nowrap;
}

/* ── Exercise block in editor (atomic, non-editable) ─────────────── */
.pe-exercise-block {
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  margin: 4pt 0;
  padding: 8px 12px;
  background: #fafbfc;
  position: relative;
  cursor: default;
  user-select: none;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  page-break-inside: avoid;
}
.pe-exercise-block:hover {
  border-color: var(--primary, #0b3e66);
  box-shadow: 0 0 0 1px var(--primary, #0b3e66);
}
.pe-exercise-block.ProseMirror-selectednode {
  border-color: var(--primary, #0b3e66);
  box-shadow: 0 0 0 2px rgba(11, 62, 102, 0.3);
}

/* Badge type */
.pe-exo-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-bottom: 4px;
  color: #fff;
}
.pe-exo-badge-qcm { background: #2980b9; }
.pe-exo-badge-qcu { background: #27ae60; }
.pe-exo-badge-vf  { background: #e67e22; }
.pe-exo-badge-highlight { background: #8e44ad; }
.pe-exo-badge-free { background: #34495e; }
.pe-exo-badge-oral { background: #e67e22; }
.pe-exo-badge-prononciation { background: #8e44ad; }

/* Question text */
.pe-exo-question {
  font-weight: 600;
  font-size: 10pt;
  margin-bottom: 1em;
  line-height: 1.3;
  color: #333;
}

/* Points */
.pe-exo-points {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 9px;
  color: #888;
  font-weight: 600;
}

/* Choices list */
.pe-exo-choices {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pe-exo-choices li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  margin: 2px 0;
  border-radius: 4px;
  background: #fff;
  border: 1px solid #e8e8e8;
  font-size: 9pt;
  line-height: 1.2;
}
.pe-exo-choices li .pe-exo-indicator {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border: 1.5px solid #bbb;
  border-radius: 3px;
  background: #fff;
}
.pe-exo-choices li .pe-exo-indicator.pe-exo-radio {
  border-radius: 50%;
}

/* Teacher view: show correct answers */
.pe-exo-choices li.pe-exo-correct {
  background: #e8f5e9;
  border-color: #4caf50;
}
.pe-exo-choices li.pe-exo-correct .pe-exo-indicator {
  background: #4caf50;
  border-color: #4caf50;
}

/* Free text exercise — auto-expanding answer zone */
.pe-exo-free-zone {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 4px 8px;
  background: #fff;
  min-height: 2.4em;
}
.pe-exo-free-line {
  border-bottom: 1px solid #e0e0e0;
  height: 1.4em;
}
.pe-exo-free-expand {
  text-align: center;
  color: #bbb;
  padding: 2px 0 1px;
  font-size: 12px;
}
/* Inline free-text zone: remove container styling when it wraps a textarea */
.pe-exo-free-inline { border: none; padding: 0; background: transparent; }
/* Inline textarea for free-text answers (non-DST documents) */
.pe-exo-free-textarea {
  width: 100%; min-height: 60px; padding: 8px; border: 1px solid #d1d5db;
  border-radius: 6px; font-family: inherit; font-size: 13px; line-height: 1.5;
  resize: vertical; background: #fefefe; color: #1f2937;
}
.pe-exo-free-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(59,130,246,0.15); }
.pe-exo-free-textarea::placeholder { color: #9ca3af; }

/* Clickable free zone (student DST mode) */
.pe-exo-free-clickable {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1565c0;
  font-size: 13px;
  padding: 10px 12px;
  transition: background 0.15s, border-color 0.15s;
}
.pe-exo-free-clickable:hover {
  background: #e3f0fa;
  border-color: #90caf9;
}
.pe-exo-free-clickable i { font-size: 14px; }

/* Selected choices — always visible regardless of parent class */
.pe-exo-choices li.pe-exo-selected {
  background: #e3f2fd;
  border-color: #42a5f5;
}
.pe-exo-choices li.pe-exo-selected .pe-exo-indicator {
  background: #42a5f5;
  border-color: #42a5f5;
}

/* Interactive choices (DST student inline answering) */
.pe-exo-choices.pe-exo-interactive li {
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
}
.pe-exo-choices.pe-exo-interactive li:hover {
  background: #e3f0fa;
  border-color: #90caf9;
}
.pe-exo-choices.pe-exo-interactive li.pe-exo-selected {
  background: #e3f2fd;
  border-color: #42a5f5;
}
.pe-exo-choices.pe-exo-interactive li.pe-exo-selected .pe-exo-indicator {
  background: #42a5f5;
  border-color: #42a5f5;
}

/* Submitted choices (read-only after submission) */
.pe-exo-choices.pe-exo-submitted li {
  pointer-events: none;
  opacity: 0.8;
}
.pe-exo-choices.pe-exo-submitted li.pe-exo-selected {
  background: #e8f5e9;
  border-color: #81c784;
}
.pe-exo-choices.pe-exo-submitted li.pe-exo-selected .pe-exo-indicator {
  background: #66bb6a;
  border-color: #66bb6a;
}

/* Interactive highlight zones (DST student inline answering) */

/* Submitted highlight (read-only after submission) */
.pe-exo-hl-submitted .pe-exo-highlight-zone {
  pointer-events: none;
}
.pe-exo-hl-submitted .pe-exo-highlight-zone.pe-exo-highlight-selected {
  background: #ffeb3b;
  opacity: 0.8;
}

/* Answered state checkmark (choices & highlight only — libre has its own) */
.pe-exo-answered:not(:has(.pe-exo-free-clickable)) {
  position: relative;
}
.pe-exo-answered:not(:has(.pe-exo-free-clickable))::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 8px;
  right: 8px;
  color: #2e7d32;
  font-size: 12px;
  background: #e8f5e9;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Answered state */
.pe-exo-answered .pe-exo-free-clickable {
  color: #2e7d32;
  background: #e8f5e9;
  border-color: #a5d6a7;
}
.pe-exo-answered .pe-exo-free-clickable::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-left: auto;
  color: #2e7d32;
}

/* ═══════════════════════════════════════════════════════════════
   DST Answer Editor — full-space Tiptap editor for libre answers
   ═══════════════════════════════════════════════════════════════ */

.dst-answer-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* ─── New DST split-view layout (subject left ⇆ answer right) ─────────── */
/* .fsv-content est en flex-direction:column par défaut — on force la rangée
   pendant le mode split-actif pour que sujet et réponse soient côte-à-côte. */
.dst-split-active {
  flex-direction: row !important;
  justify-content: stretch !important;
  align-items: stretch !important;
}
.dst-split-active .docview-editor.dst-subject-pane {
  flex: 1; min-width: 0; min-height: 0; overflow: hidden;
}
/* Force les wrappers internes du PageEditor à pouvoir rétrécir sous la
   largeur de la page A4 (sinon ils gardent leur min-content = ~793px et
   le panneau hôte refuse de tenir à 50% de sa part flex). */
.dst-split-active .docview-editor.dst-subject-pane .pe-wrapper,
.dst-split-active .docview-editor.dst-subject-pane .pe-pages-container,
.dst-split-active .dst-answer-pane .dst-answer-editor-mount,
.dst-split-active .dst-answer-pane .pe-wrapper,
.dst-split-active .dst-answer-pane .pe-pages-container {
  min-width: 0 !important;
}
.dst-split-active .dst-answer-pane {
  flex: 1; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-left: 1px solid #e5e7eb;
}
.dst-split-active .dst-divider {
  width: 6px; flex-shrink: 0; cursor: col-resize;
  background: #e5e7eb; transition: background .15s;
}
.dst-split-active .dst-divider:hover { background: var(--primary, #2563eb); }

/* Vue : Sujet seul → panneau réponse + divider cachés */
.dst-view-subject .dst-answer-pane,
.dst-view-subject .dst-divider { display: none !important; }
.dst-view-subject .docview-editor.dst-subject-pane { flex: 1 1 100% !important; }

/* Vue : Réponse seule → sujet + divider cachés */
.dst-view-answer .docview-editor.dst-subject-pane,
.dst-view-answer .dst-divider { display: none !important; }
.dst-view-answer .dst-answer-pane { flex: 1 1 100% !important; }

/* Top bar : toggle (gauche) + meta + close (droite) */
.dst-answer-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px; background: #f8fafc;
  border-bottom: 1px solid #e5e7eb; flex-shrink: 0;
}
.dst-toggle-group {
  display: inline-flex; background: #fff; border: 1px solid #d1d5db;
  border-radius: 8px; padding: 2px; gap: 2px;
}
.dst-toggle-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; font-size: 12px; font-weight: 600;
  color: #475569; background: transparent; border: none; border-radius: 6px;
  cursor: pointer; transition: background .12s, color .12s;
}
.dst-toggle-btn:hover { background: #f1f5f9; color: #1e293b; }
.dst-toggle-btn.is-active {
  background: var(--primary, #2563eb); color: #fff;
}
.dst-toggle-btn.is-active:hover { background: var(--primary-dark, #1d4ed8); }
.dst-toggle-btn i { font-size: 12px; }

.dst-answer-meta {
  margin-left: auto; display: inline-flex; align-items: center; gap: 10px;
}
.dst-answer-score {
  font-size: 12px; font-weight: 700; color: #475569;
  padding: 3px 8px; background: #e2e8f0; border-radius: 12px;
}
.dst-answer-close {
  width: 30px; height: 30px; border: none; border-radius: 6px;
  background: transparent; color: #64748b; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.dst-answer-close:hover { background: #fee2e2; color: #b91c1c; }

/* En-tête « rappel de la question » : encart bleu persistant */
.dst-answer-question {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
  border-bottom: 1px solid #dbeafe;
  border-left: 4px solid var(--primary, #2563eb);
  flex-shrink: 0;
}
.dst-answer-question-icon {
  flex-shrink: 0; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary, #2563eb); color: #fff;
  border-radius: 50%; font-size: 14px;
}
.dst-answer-question-body {
  flex: 1; font-size: 14px; line-height: 1.55; color: #1e293b;
}
.dst-answer-question-body p { margin: 0 0 6px; }
.dst-answer-question-body p:last-child { margin-bottom: 0; }

/* Mount du PageEditor : remplit la place restante */
.dst-answer-editor-mount {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
}

.dst-editor {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Header: badge + score + back button */
.dst-editor-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #eaecef;
  flex-shrink: 0;
}
.dst-editor-score {
  font-size: 13px;
  font-weight: 600;
  color: #666;
}
.dst-editor-back {
  margin-left: auto;
  border: none;
  background: none;
  color: #1565c0;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  transition: background 0.15s;
}
.dst-editor-back:hover { background: #e3f0fa; }

/* Question text (read-only) */
.dst-editor-question {
  padding: 10px 16px;
  font-size: 14px;
  color: #333;
  background: #fffde7;
  border-bottom: 1px solid #f0e68c;
  flex-shrink: 0;
}

/* Tiptap editor content area */
.dst-editor-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.dst-editor-content .ProseMirror {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  outline: none;
  font-size: 14px;
  line-height: 1.6;
  min-height: 0;
}
.dst-editor-content .ProseMirror p { margin: 0 0 8px; }
.dst-editor-content .ProseMirror:focus { box-shadow: none; }

/* Toolbar */
.dst-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  background: #fff;
  border-bottom: 1px solid #eaecef;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.dst-tb-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  border-radius: 4px;
  cursor: pointer;
  color: #555;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.dst-tb-btn:hover { background: #f0f0f0; color: #111; }
.dst-tb-btn.is-active { background: #e3f0fa; color: #1565c0; }
.dst-tb-sep {
  width: 1px;
  height: 18px;
  background: #ddd;
  margin: 0 4px;
  flex-shrink: 0;
}

/* ── Split view (PC: subject left, divider, answer right) ───────────── */
.dst-split-view {
  display: flex !important;
  flex-direction: row !important;
}
.dst-split-view .dst-subject-panel {
  flex: 1;
  min-width: 0;
  overflow: auto;
}
.dst-divider {
  width: 5px;
  background: #ccc;
  cursor: col-resize;
  flex-shrink: 0;
  transition: background 0.15s;
  position: relative;
}
.dst-divider:hover, .dst-divider:active { background: #999; }
.dst-divider::after {
  content: ''; position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 3px; height: 30px;
  border-left: 1px solid #aaa;
  border-right: 1px solid #aaa;
}
.dst-split-view .dst-answer-panel {
  flex: 1;
  min-width: 0;
}

/* DST submit button in docview header */
.dst-submit-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 16px; border: none; border-radius: 6px;
  background: var(--primary, #cf1578); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.dst-submit-btn:hover { filter: brightness(1.1); }
.dst-submit-btn:disabled { opacity: 0.6; cursor: default; filter: none; }
.dst-export-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 1px solid #ccc; border-radius: 6px;
  background: #fff; color: #555; font-size: 14px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.dst-export-btn:hover { background: #f0f6fb; border-color: #90caf9; color: #1565c0; }
.dst-export-btn:disabled { opacity: 0.5; cursor: default; }
/* DST prefetch indicator (in header) */
.dst-prefetch-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  color: #90caf9;
  font-size: 14px;
  animation: er-prefetch-pulse 2s ease-in-out infinite;
}
.dst-prefetch-indicator .fa-cloud-check {
  color: #66bb6a;
  animation: none;
}
/* DST offline banner */
.dst-offline-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 16px; background: #fff3e0; color: #e65100;
  font-size: 13px; border-bottom: 1px solid #ffe0b2;
  flex-shrink: 0;
}
.dst-offline-banner i { font-size: 14px; }

/* ── DST barème side panel (teacher) ───────────────────── */
.dst-bareme-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}
.dst-bareme-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #eaecef;
  flex-shrink: 0;
}
.dst-bareme-title { font-weight: 600; font-size: 14px; flex: 1; }
.dst-bareme-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.dst-bareme-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 12px 0 6px;
}
.dst-bareme-label:first-child { margin-top: 0; }
.dst-bareme-consigne {
  padding: 8px 12px;
  background: #fffde7;
  border: 1px solid #f0e68c;
  border-radius: 6px;
  font-size: 13px;
  color: #333;
  line-height: 1.5;
}
.dst-bareme-total {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #f0f6fb;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #1565c0;
  margin: 12px 0;
}
.dst-bareme-total i { font-size: 12px; }
.dst-bareme-eval { display: flex; flex-direction: column; gap: 10px; }
.dst-bareme-block {
  border: 1px solid #eaecef;
  border-radius: 6px;
  padding: 10px;
  background: #fafafa;
}
.dst-bareme-row1 {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.dst-bareme-row1 .ff-textarea { flex: 1; min-width: 0; font-size: 13px; }
.dst-bareme-score {
  width: 55px;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 13px;
  text-align: center;
  flex-shrink: 0;
}
.dst-bareme-pts { font-size: 12px; color: #999; flex-shrink: 0; }
.dst-bareme-row2 {
  display: flex;
  gap: 10px;
  padding: 6px 0 2px;
  flex-wrap: wrap;
}
.dst-bareme-content .exo-add-choice-btn {
  margin-top: 10px;
}
/* Barème panel: 30% default width */
.dst-split-view .dst-bareme-panel { flex: 0.4; }
.dst-split-view:has(.dst-bareme-panel) .dst-subject-panel { flex: 1; }

/* Editing highlight on the exercise block in the document */
.pe-exo-editing {
  outline: 2px solid #1565c0;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Highlight exercise */
.pe-exo-highlight-text {
  line-height: 1.8;
  font-size: 9pt;
  color: #333;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent calc(1.8em - 1px),
    #e0e0e0 calc(1.8em - 1px),
    #e0e0e0 1.8em
  );
  background-position: 0 6px;
}
.pe-exo-highlight-zone {
  background: #ffeb3b;
  border-radius: 2px;
  padding: 1px 0;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Edit overlay button */
.pe-exo-edit-btn {
  position: absolute;
  top: 8px;
  right: 44px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: var(--primary, #0b3e66);
  color: #fff;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.pe-exercise-block:hover .pe-exo-edit-btn {
  display: flex;
}

/* Question mode buttons (teacher) */
.pe-exo-mode-btns {
  position: absolute; top: 8px; right: 80px;
  display: none; gap: 2px;
}
.pe-exercise-block:hover .pe-exo-mode-btns { display: flex; }
.pe-exo-mode-btn {
  width: 28px; height: 28px; border: 1px solid #d1d5db; border-radius: 4px;
  background: #fff; color: #94a3b8; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
  transition: all .15s;
}
.pe-exo-mode-btn:hover { border-color: #6b7280; color: #374151; }
.pe-exo-mode-btn.active.pe-exo-mode-readonly { background: #22c55e; color: #fff; border-color: #22c55e; }
.pe-exo-mode-btn.active.pe-exo-mode-writing { background: #22c55e; color: #fff; border-color: #22c55e; }
.pe-exo-mode-btn.active.pe-exo-mode-correction { background: #f59e0b; color: #fff; border-color: #f59e0b; }

/* Delete button */
.pe-exo-delete-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: #e74c3c;
  color: #fff;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.pe-exercise-block:hover .pe-exo-delete-btn {
  display: flex;
}

/* ── Exercise edit modal ─────────────────────────────────────────── */
.exo-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0;
}
.exo-modal-body label {
  font-weight: 600;
  font-size: 13px;
  color: #333;
  margin-bottom: 2px;
}
.exo-modal-body textarea,
.exo-modal-body input[type="text"],
.exo-modal-body input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
}
.exo-modal-body textarea {
  resize: vertical;
  min-height: 60px;
}
.exo-modal-body textarea:focus,
.exo-modal-body input:focus {
  outline: none;
  border-color: var(--primary, #0b3e66);
  box-shadow: 0 0 0 2px rgba(11, 62, 102, 0.15);
}

/* Points row */
.exo-points-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.exo-points-row input[type="number"] {
  width: 80px;
}

/* Choices editor */
.exo-choices-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.exo-choice-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.exo-choice-row input[type="text"] {
  flex: 1;
}
.exo-choice-row input[type="checkbox"],
.exo-choice-row input[type="radio"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.exo-choice-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: #f5f5f5;
  color: #999;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.exo-choice-remove:hover {
  background: #fee;
  color: #e74c3c;
}
.exo-add-choice-btn {
  align-self: flex-start;
  padding: 6px 14px;
  border: 1px dashed #bbb;
  border-radius: 6px;
  background: transparent;
  color: #666;
  cursor: pointer;
  font-size: 13px;
}
.exo-add-choice-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Highlight text editor in modal */
.exo-highlight-editor {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px 12px;
  min-height: 80px;
  line-height: 1.8;
  font-size: 13px;
  cursor: text;
  white-space: pre-wrap;
}
.exo-highlight-editor .exo-hl-zone {
  background: #ffeb3b;
  border-radius: 2px;
  cursor: pointer;
}
.exo-highlight-editor .exo-hl-zone:hover {
  background: #fdd835;
}

/* Error message */
.exo-error {
  color: #e74c3c;
  font-size: 12px;
  font-weight: 600;
}

/* File chips in exercise modal */
.exo-files-container {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.exo-file-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; background: #f0f4f8; border: 1px solid #d0d8e0;
  border-radius: 14px; font-size: 12px; color: #333;
}
.exo-file-chip i { color: #666; }
.exo-file-chip-remove {
  border: none; background: none; cursor: pointer; color: #e74c3c;
  padding: 0 2px; font-size: 11px; line-height: 1;
}
.exo-file-chip-remove:hover { color: #c0392b; }
.exo-file-upload-row { margin-top: -6px; }
.exo-file-upload-row input[type="file"] { font-size: 12px; }

/* Video / doc texte inputs in modal */
.exo-video-input, .exo-doc-texte-input { font-size: 12px !important; }

/* ── Prefetch progress screen ────────────────────────────────────── */
.er-prefetch {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  min-height: 300px;
}
.er-prefetch-icon {
  font-size: 48px;
  color: var(--primary, #0b3e66);
  margin-bottom: 20px;
  animation: er-prefetch-pulse 2s ease-in-out infinite;
}
@keyframes er-prefetch-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.95); }
}
.er-prefetch-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 6px;
}
.er-prefetch-sub {
  font-size: 13px;
  color: #777;
  margin-bottom: 24px;
}
.er-prefetch-bar-wrap {
  width: 100%;
  max-width: 320px;
  height: 8px;
  background: #e8e8e8;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.er-prefetch-bar {
  height: 100%;
  width: 0;
  background: var(--primary, #0b3e66);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.er-prefetch-status {
  font-size: 13px;
  color: #999;
  margin-bottom: 20px;
}
.er-prefetch-skip {
  font-size: 13px;
}
/* Prefetch inside FullscreenViewer (dark background) */
.fsv-content .er-prefetch-icon { color: #93c5fd; }
.fsv-content .er-prefetch-title { color: #fff; }
.fsv-content .er-prefetch-sub { color: #9ca3af; }
.fsv-content .er-prefetch-bar-wrap { background: rgba(255,255,255,.15); }
.fsv-content .er-prefetch-status { color: #9ca3af; }

/* ── Closed mode (dates passed) — read-only answers + correction ── */
.pe-exo-block--closed .pe-exo-choices,
.pe-exo-block--closed .pe-exo-highlight-text,
.pe-exo-block--closed .pe-exo-free-readonly { pointer-events: none; user-select: none; }
.pe-exo-free-zone--closed {
  border: none !important; background: none !important;
  padding: 4px 0 !important;
}
.pe-exo-free-readonly {
  font-size: 13px; color: #1f2937; line-height: 1.6;
  white-space: pre-wrap; min-height: 20px;
  padding: 4px 0;
}
.pe-exo-free-readonly:empty::after {
  content: attr(data-empty);
  color: #9ca3af; font-style: italic;
}
.pe-exo-correction {
  margin-top: 10px; border-top: 2px solid #3b82f6;
  padding-top: 8px;
  width: 100%; box-sizing: border-box;
}
.pe-exo-correction-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: #3b82f6; margin-bottom: 6px;
  display: flex; align-items: center; gap: 5px;
}
.pe-exo-correction-label i { font-size: 12px; }
.pe-exo-correction-textarea {
  width: 100%; box-sizing: border-box;
  min-height: 60px; padding: 8px 10px;
  border: 1px solid #bfdbfe; border-radius: 6px;
  font-size: 13px; color: #1e3a5f; line-height: 1.5;
  background: #eff6ff; resize: vertical;
  font-family: inherit;
}
.pe-exo-correction-textarea:focus {
  outline: none; border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}
.pe-exo-correction-textarea::placeholder { color: #93c5fd; }

/* ── Print styles ────────────────────────────────────────────────── */
@media print {
  .pe-exercise-block {
    page-break-inside: auto;
  }
  .pe-exo-edit-btn,
  .pe-exo-delete-btn {
    display: none !important;
  }
  .pe-exo-choices li {
    background: #fff;
  }
  .pe-exo-choices li.pe-exo-correct {
    background: #fff;
    border-color: #ccc;
  }
  .pe-exo-choices li.pe-exo-correct .pe-exo-indicator {
    background: #fff;
    border-color: #bbb;
  }
  .pe-exo-highlight-text {
    border: 0.5pt solid #ccc;
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    background-image: repeating-linear-gradient(
      to bottom,
      transparent,
      transparent calc(1.8em - 1px),
      #ccc calc(1.8em - 1px),
      #ccc 1.8em
    );
  }
  .pe-exo-highlight-zone {
    background: transparent;
    border-bottom: 1pt solid #999;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   ExerciseViewer — standalone exercise player
   ══════════════════════════════════════════════════════════════════════ */
.ev-loading, .ev-error {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 40px; color: #888; font-size: 15px;
}
.ev-error { color: #e74c3c; }

.ev-header { padding: 0 0 12px; border-bottom: 1px solid #eaecef; }
.ev-title-row { display: flex; align-items: center; gap: 12px; }

/* Live exercise overrides */
.live-item-exercise .ev-header { border-bottom: none; padding: 8px 16px 4px; }
.live-item-exercise .ev-title-row { gap: 8px; flex-wrap: nowrap; }
.live-item-exercise .ev-title-row h2 { font-size: 14px; font-weight: 500; color: #e5e7eb; margin: 0; padding: 0; border: none; flex: 1; }
.live-item-exercise .ev-meta { display: inline; font-size: 12px; padding: 0; color: #94a3b8; }
.live-item-exercise .ev-previous { display: none; }
.live-item-exercise .ev-footer { display: flex; justify-content: center; gap: 8px; }
.live-item-exercise .ev-next-btn { min-width: auto; width: auto; padding: 6px 20px; font-size: 13px; }
.live-item-exercise .ev-prev-btn { width: auto; padding: 6px 20px; font-size: 13px; }
.live-item-exercise .ev-submit-btn { min-width: auto; width: auto; padding: 6px 20px; font-size: 13px; }
.live-item-exercise .ev-locked-banner { display: none; }
.live-item-exercise .ev-progress { display: none; }
.live-item-exercise .ev-progress-bar { display: none; }
/* Live: progress counter top right */
.live-item-exercise .ev-live-progress {
  font-size: 13px; font-weight: 600; color: #94a3b8; white-space: nowrap;
}
/* Hide internal exercise timer in live (timer is on fsv-footer) */
.live-item-exercise .ev-live-timer-bar { display: none; }
/* Hide default timer in live */
.live-item-exercise .ev-timer-strip { display: none; }
.live-item-exercise .ev-timer-badge { display: none; }
/* Live locked state — answers and navigation blocked */
.ev-live-locked .ev-choice { pointer-events: none; opacity: 0.6; }
.ev-live-locked textarea { pointer-events: none; opacity: 0.6; }
.ev-live-locked .ev-trous-input { pointer-events: none; opacity: 0.6; }
.ev-live-locked .ev-next-btn,
.ev-live-locked .ev-prev-btn,
.ev-live-locked .ev-submit-btn { pointer-events: none; opacity: 0.35; }
.ev-meta { font-size: 13px; color: #888; padding: 4px 24px 0; }
.ev-description { font-size: 14px; color: #555; padding: 8px 24px 0; line-height: 1.5; }
.ev-locked-banner {
  margin: 10px 24px 0; padding: 8px 14px; border-radius: 6px;
  background: #fef3c7; color: #92400e; font-size: 13px;
  display: flex; align-items: center; gap: 8px;
  border: 1px solid #fde68a;
}
.ev-locked-banner i { font-size: 13px; color: #d97706; }

/* Timer — thin fixed strip under header + floating countdown badge */
.ev-timer-strip {
  position: fixed; top: var(--header-height, 56px); left: 0; right: 0;
  height: 3px; background: #e5e7eb; z-index: 999;
}
.ev-timer-strip-fill {
  height: 100%; width: 0; transition: width 0.3s linear;
  background: var(--success, #49bf67);
}
.ev-timer-badge {
  position: fixed; top: calc(var(--header-height, 56px) + 8px); right: 16px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 14px;
  font-size: 12px; font-weight: 600; color: #fff;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
  z-index: 999; pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.ev-timer-badge i { font-size: 11px; }
.ev-timer-badge.ev-timer-warn { background: rgba(234,88,12,0.85); }
.ev-timer-badge.ev-timer-danger { background: rgba(220,38,38,0.85); animation: ev-timer-pulse 1s infinite; }
@keyframes ev-timer-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }

.ev-questions { padding: 16px 24px; display: flex; flex-direction: column; gap: 16px; }

/* Question row: number left, card right */
.ev-question-row { display: flex; gap: 12px; align-items: flex-start; }
.ev-q-left {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex-shrink: 0; width: 42px; padding-top: 14px;
}
.ev-q-num {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary, #3b82f6); color: #fff;
  font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.ev-q-left .pe-exo-badge { font-size: 9px; padding: 1px 5px; }
.ev-q-points { font-size: 11px; color: #6b7280; font-weight: 600; white-space: nowrap; }

/* Question header (used in editor detail) */
.ev-q-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ee-header-spacer { flex: 1; min-width: 0; }
/* Inline critère field in bareme header */
.bar-critere-input {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
  border: none;
  border-bottom: 1px solid transparent;
  background: none;
  padding: 2px 4px;
  resize: none;
  overflow: hidden;
  line-height: 1.4;
  transition: border-color 0.2s;
}
.bar-critere-input:focus {
  outline: none;
  border-bottom-color: var(--primary, #0b3e66);
}
.bar-critere-input::placeholder {
  color: #bbb;
  font-weight: 400;
  font-style: italic;
}
.ee-header-actions { display: flex; gap: 4px; flex-shrink: 0; }
.ev-q-header .ev-q-num { width: auto; height: auto; background: none; color: #333; font-size: 16px; border-radius: 0; }
.ev-q-header .pe-exo-badge { flex-shrink: 0; margin-bottom: 0; }

.ev-question-card {
  border: 1px solid #e0e0e0; border-radius: 8px; padding: 16px;
  background: #fafbfc; position: relative; flex: 1; min-width: 0;
}
.ev-q-video { margin: 8px 0; }
.ev-q-video iframe { max-width: 100%; border-radius: 6px; }

/* Interactive choices */
.ev-choices li { cursor: default; transition: background 0.15s, border-color 0.15s; }
.ev-choices li[style*="cursor: pointer"]:hover { background: #e8f0fe; border-color: #90caf9; }
.ev-choice.ev-selected { background: #e3f2fd !important; border-color: #42a5f5 !important; }
.ev-choice.ev-selected .pe-exo-indicator { background: #42a5f5; border-color: #42a5f5; }

/* Result highlights */
.ev-answer-correct { background: #e8f5e9 !important; border-color: #4caf50 !important; }
.ev-answer-wrong { background: #ffebee !important; border-color: #ef5350 !important; }

/* Trous (fill-in-the-blank) viewer */
.ev-trous-wrap { line-height: 2.2; }
.ev-trous-phrase { font-size: 14px; color: #333; }
.ev-trous-input {
  display: inline-block; padding: 3px 8px; margin: 0 2px; border: none;
  border-bottom: 2px solid var(--primary, #0b3e66); background: #f8f9fa;
  font-size: 14px; font-family: inherit; text-align: center; border-radius: 0;
}
.ev-trous-input:focus { background: #fff; border-bottom-color: #4f8cff; outline: none; }
.ev-trous-answer-preview {
  display: inline-block; padding: 2px 8px; margin: 0 2px;
  background: #e3f0fc; border: 1px dashed #4f8cff; border-radius: 4px;
  font-weight: 500; color: #1565c0;
}
.ev-trous-pts { font-size: 10px; color: #6b7280; margin-left: 2px; font-weight: 400; }
.ev-trous-result { display: inline-block; padding: 2px 6px; margin: 0 2px; border-radius: 3px; font-weight: 500; }
.ev-trous-correct { background: #e8f5e9; color: #2e7d32; }
.ev-trous-wrong { background: #fce4e4; color: #c62828; text-decoration: line-through; }
.ev-trous-correction { display: inline-block; padding: 2px 6px; margin: 0 2px; color: #2e7d32; font-weight: 600; font-size: 13px; }

/* Free text */
.ev-free-wrap { display: flex; flex-direction: column; gap: 8px; }
.ev-free-label { font-weight: 500; font-size: 13px; color: #555; }
.ev-free-textarea {
  width: 100%; border: 1px solid #ddd; border-radius: 6px; padding: 10px 12px;
  font-size: 14px; font-family: inherit; resize: vertical; background: #fff;
}
.ev-free-textarea:focus { border-color: var(--primary, #0b3e66); outline: none; box-shadow: 0 0 0 2px rgba(11,62,102,0.15); }
.ev-free-answer { font-size: 13px; color: #4caf50; padding: 4px 8px; background: #e8f5e9; border-radius: 4px; }
.ev-free-editor { border: 1px solid #d1d5db; border-radius: 8px; overflow: hidden; }
.ev-free-editor .ff-rich-toolbar { border-bottom: 1px solid #e5e7eb; }
.ev-free-editor .tiptap { min-height: 80px; padding: 10px 12px; font-size: 14px; }

/* Submit / Navigation */
.ev-footer { padding: 16px 24px; text-align: center; }
.ev-submit-btn { min-width: 200px; padding: 10px 24px; font-size: 15px; }
.ev-next-btn { min-width: 160px; padding: 10px 24px; font-size: 15px; }

/* Sequential mode — progress */
.ev-progress { padding: 8px 24px 0; font-size: 13px; font-weight: 600; color: #6b7280; }
.ev-progress-bar { height: 4px; background: #e5e7eb; border-radius: 2px; margin: 6px 24px 8px; overflow: hidden; }
.ev-progress-fill { height: 100%; background: var(--primary, #3b82f6); border-radius: 2px; transition: width .3s ease; }

/* Entrainement — running score */
.ev-running-score {
  display: flex; align-items: center; gap: 8px; padding: 8px 24px;
  font-size: 14px; font-weight: 600; color: var(--primary, #3b82f6);
}
.ev-running-score i { font-size: 14px; }

/* Devoir — submitted confirmation */
.ev-devoir-done { background: #e8f5e9; color: #2e7d32; }

/* Score banner */
.ev-score-banner {
  display: flex; align-items: center; gap: 12px; padding: 14px 24px;
  border-radius: 8px; margin: 16px 24px; font-size: 18px; font-weight: 700;
}
.ev-score-pass { background: #e8f5e9; color: #2e7d32; }
.ev-score-fail { background: #ffebee; color: #c62828; }
.ev-score-icon { font-size: 28px; }

/* Previous attempts */
.ev-previous { padding: 16px 24px; }
.ev-previous-title { font-size: 14px; font-weight: 600; color: #555; margin-bottom: 8px; }
.ev-prev-row {
  display: flex; align-items: center; gap: 16px; padding: 8px 12px;
  background: #f5f5f5; border-radius: 6px; margin-bottom: 4px; font-size: 13px;
}
.ev-prev-essai { font-weight: 600; color: #333; }
.ev-prev-score { color: var(--primary, #0b3e66); font-weight: 600; }
.ev-prev-date { color: #999; margin-left: auto; }

/* Document texte (custom HTML content for a question) */
.ev-q-doc-texte {
  font-size: 14px; line-height: 1.6; color: #333;
  padding: 12px 16px; margin: 8px 0;
  background: #f8f9fa; border: 1px solid #e8e8e8; border-radius: 6px;
  max-height: 400px; overflow-y: auto;
}
.ev-q-doc-texte img { max-width: 100%; height: auto; border-radius: 4px; }
.ev-q-doc-texte table { border-collapse: collapse; width: 100%; }
.ev-q-doc-texte table td, .ev-q-doc-texte table th {
  border: 1px solid #ddd; padding: 6px 10px; font-size: 13px;
}

/* Attached files (images, audio, links) */
.ev-q-files {
  display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0;
  align-items: flex-start;
}
.ev-q-file-img {
  max-width: 300px; max-height: 220px; object-fit: contain;
  border-radius: 6px; border: 1px solid #e0e0e0;
  cursor: pointer; transition: box-shadow 0.15s;
}
.ev-q-file-img:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.ev-q-file-audio { width: 100%; }
.ev-q-file-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; background: #f0f4f8; border: 1px solid #d0d8e0;
  border-radius: 6px; color: var(--primary, #0b3e66); font-size: 13px;
  text-decoration: none; transition: background 0.15s;
}
.ev-q-file-link:hover { background: #e0e8f0; }

/* Image + answers side-by-side */
.ev-q-img-row {
  display: flex; gap: 16px; align-items: flex-start; margin-top: 6px;
}
.ev-q-img-col {
  flex-shrink: 0; max-width: 45%; display: flex; flex-direction: column; gap: 8px;
}
.ev-q-img-col .ev-q-file-img {
  max-width: 100%; max-height: 300px;
}
.ev-q-ans-col {
  flex: 1; min-width: 0;
}
@media (max-width: 600px) {
  .ev-q-img-row { flex-direction: column; }
  .ev-q-img-col { max-width: 100%; }
}

/* Embed video */
.ev-q-video { margin: 10px 0; }
.ev-q-video iframe {
  max-width: 100%; width: 560px; height: 315px;
  border: none; border-radius: 8px;
}

/* ══════════════════════════════════════════════════════════════════════
   ExerciseEditor — WYSIWYG split-panel question editor
   Layout: header + ribbon (top), question list (left), detail (right)
   ══════════════════════════════════════════════════════════════════════ */

/* Remove ALL parent padding/max-width so editor fills full width+height */
.ee-root-active { padding: 0 !important; margin: 0 !important; max-width: none !important; }

.ee-root { display: flex; flex-direction: column; height: calc(100vh - var(--header-height, 56px) - 30px); overflow: hidden; }

/* Header bar */
.ee-header-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; border-bottom: 1px solid #eaecef;
  background: #fff; flex-shrink: 0;
}
.ee-status-badge {
  font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 10px;
  margin-left: auto; white-space: nowrap; display: flex; align-items: center; gap: 5px;
}
.ee-status-badge i { font-size: 10px; }
.ee-status-author { background: #fef3c7; color: #92400e; }
.ee-status-write  { background: #dbeafe; color: #1e40af; }
.ee-status-read   { background: #f3f4f6; color: #6b7280; }
.ee-back-btn {
  width: 34px; height: 34px; border: none; background: none;
  border-radius: 6px; cursor: pointer; color: #555; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.ee-back-btn:hover { background: #f0f0f0; color: #111; }
.ee-title {
  font-size: 16px; font-weight: 600; color: #222; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Ribbon */
.ee-ribbon {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 16px; border-bottom: 1px solid #e0e0e0;
  background: #fafbfc; flex-shrink: 0; flex-wrap: wrap;
}
.ee-ribbon .pe-toolbar-btn {
  width: auto; height: 32px; padding: 0 10px; gap: 5px;
  font-size: 13px; display: inline-flex; align-items: center;
}
.ee-btn-label { font-size: 12px; white-space: nowrap; }
.ee-new-btn {
  background: var(--primary, #0b3e66); color: #fff !important;
  border-radius: 6px;
}
.ee-new-btn:hover { opacity: 0.9; background: var(--primary, #0b3e66) !important; }
.ee-new-btn .ee-btn-label { color: #fff; }
.ee-sep { width: 1px; height: 24px; background: #ddd; margin: 0 4px; flex-shrink: 0; }

/* Type selector bar */
.ee-type-bar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.ee-type-bar.ee-hidden { display: none; }
.ee-type-btn { font-size: 12px !important; }
.ee-type-btn:hover { background: #e8f0fe; }

/* Ribbon right */
.ee-ribbon-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.ee-save-btn { color: #555; }
.ee-save-btn.is-active { background: var(--primary); color: #fff; }
.ee-save-ok { background: #4caf50 !important; color: #fff !important; }

/* ── Split panel ─────────────────────────────────────────────────── */
.ee-split {
  flex: 1; display: flex; overflow: hidden;
}

/* Left panel — question list */
.ee-panel-left {
  width: 260px; min-width: 200px; max-width: 320px;
  border-right: 1px solid #e0e0e0; background: #f8f9fa;
  overflow-y: auto; flex-shrink: 0;
}

/* Right panel — question detail */
.ee-panel-right {
  flex: 1; overflow-y: auto; padding: 20px 24px;
  background: #fff;
}

/* ── Question list items ─────────────────────────────────────────── */
.ee-qlist {
  display: flex; flex-direction: column;
}
.ee-qlist-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid #eee;
  transition: background 0.12s;
  min-height: 40px;
}
.ee-qlist-item:hover { background: #eef2f7; }
.ee-qlist-item { cursor: grab; }
.ee-qlist-dragging { visibility: hidden; }
.ee-qlist-item.is-selected {
  background: #dbe8f4; border-left: 3px solid var(--primary, #0b3e66);
}
.ee-qlist-num {
  font-weight: 700; font-size: 14px; color: #888;
  width: 22px; text-align: center; flex-shrink: 0;
}
.ee-qlist-title {
  flex: 1; font-size: 12px; color: #555;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ee-qlist-dirty {
  color: #e67e22; font-size: 16px; flex-shrink: 0; line-height: 1;
}
.ee-qlist-item .pe-exo-badge {
  font-size: 7px; padding: 1px 4px; flex-shrink: 0;
}

/* Empty list */
.ee-qlist-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 40px 16px; color: #bbb; text-align: center;
}
.ee-qlist-empty i { font-size: 24px; }
.ee-qlist-empty span { font-size: 12px; }

/* ── Detail panel ────────────────────────────────────────────────── */
.ee-detail { position: relative; }

/* ee-detail-toolbar: removed — buttons now inline in ev-q-header */
.ee-card-btn {
  width: 28px; height: 28px; border: none; border-radius: 4px;
  background: #f5f5f5; color: #888; cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.ee-card-btn:hover { background: #e8e8e8; color: #333; }
.ee-card-btn-danger:hover { background: #fee; color: #e74c3c; }

/* Empty detail (no selection) */
.ee-detail-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 20px; color: #ccc; gap: 16px;
}
.ee-detail-empty i { font-size: 40px; }
.ee-detail-empty p { font-size: 14px; margin: 0; }

/* Points */
.ee-pts-wrap {
  display: flex; align-items: center; gap: 4px; margin-left: auto;
}
.ee-pts-input {
  width: 50px; height: 26px; border: 1px solid #ddd; border-radius: 4px;
  text-align: center; font-size: 13px; padding: 0 4px;
}
.ee-pts-input:focus { outline: none; border-color: var(--primary); }
.ee-pts-auto { background: #f3f4f6; color: #6b7280; cursor: default; border-style: dashed; }
.ee-pts-label { font-size: 11px; color: #999; }
.ee-pts-orig { font-size: 11px; color: #9ca3af; font-style: italic; margin-left: 4px; }

/* Baremes mode */
.ee-baremes-label { font-size: 13px; font-weight: 600; color: var(--primary, #3b82f6); display: flex; align-items: center; gap: 6px; }
.ee-reset-btn { color: #6b7280; }
.ee-field-ro { padding: 6px 0; font-size: 14px; color: #374151; }
.ee-section-label { font-size: 11px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; display: block; }
.ee-section-bareme {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  color: var(--primary, #3b82f6);
}
.ee-consigne-ro { color: #4b5563; line-height: 1.5; }
.ee-choices-ro { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
.ee-choices-ro li { padding: 6px 10px; border-radius: 6px; background: #f3f4f6; font-size: 13px; color: #374151; display: flex; align-items: center; gap: 6px; }
.ee-choice-ro-correct { background: #ecfdf5; color: #065f46; font-weight: 500; }
.ee-choice-ro-icon { font-size: 11px; color: #059669; flex-shrink: 0; }
.ee-choice-ro-text { flex: 1; min-width: 0; }
.ee-choice-ro-score { font-size: 11px; color: #6b7280; flex-shrink: 0; margin-left: auto; }
.ee-choice-ro-correct .ee-choice-ro-score { color: #059669; font-weight: 600; }
.ee-choice-ro-score-input {
  width: 52px; padding: 2px 4px; font-size: 12px; text-align: center;
  border: 1px solid #d1d5db; border-radius: 4px; flex-shrink: 0; margin-left: auto;
}
.ee-choice-ro-score-input:focus { outline: none; border-color: var(--primary); }
.ee-choice-ro-correct .ee-choice-ro-score-input { border-color: #059669; }

/* Evaluation lines editor */
.ee-eval-editor { display: flex; flex-direction: column; gap: 8px; }
.ee-eval-block {
  border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px; background: #fafbfc;
}
.ee-eval-row1 { display: flex; align-items: center; gap: 8px; }
.ee-eval-label { flex: 1; min-width: 0; font-size: 13px; }
.ee-eval-score {
  width: 60px; padding: 4px 6px; font-size: 13px; text-align: center;
  border: 1px solid #d1d5db; border-radius: 4px;
}
.ee-eval-score:focus { outline: none; border-color: var(--primary); }
.ee-eval-row2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ee-eval-type-label { font-size: 12px; color: #6b7280; font-weight: 500; }
.ee-eval-radio { font-size: 12px; color: #374151; display: flex; align-items: center; gap: 3px; cursor: pointer; }
.ee-eval-radio input { margin: 0; }
.ee-eval-expl { font-size: 12px; color: #4b5563; }
.ee-eval-ai { font-size: 12px; color: #6366f1; font-style: italic; }
.ee-eval-expl::placeholder { color: #9ca3af; }
.ee-eval-ai::placeholder { color: #a5b4fc; }

/* Evaluation lines read-only */
.ee-eval-ro { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.ee-eval-ro-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-radius: 6px; background: #f3f4f6; font-size: 13px;
}
.ee-eval-ro-label { flex: 1; min-width: 0; color: #374151; }
.ee-eval-ro-type { font-size: 10px; color: #6b7280; background: #e5e7eb; padding: 1px 6px; border-radius: 3px; }

/* Two-column body inside detail */
.ee-card-body {
  display: flex; gap: 16px; margin-top: 12px;
}
.ee-media-zone {
  width: 200px; flex-shrink: 0;
}
.ee-content-zone { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }

/* Media zone */
.ee-media-inner {
  border: 1px dashed #ddd; border-radius: 6px; padding: 8px;
  min-height: 80px; position: relative;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
}
.ee-media-file {
  position: relative;
}
.ee-media-preview {
  max-width: 100%; max-height: 180px; object-fit: contain; border-radius: 4px;
  display: block; width: 100%;
}
.ee-media-fallback {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; background: #f5f5f5; border-radius: 4px;
  font-size: 11px; color: #888; word-break: break-all;
}
.ee-media-fallback i { color: #bbb; font-size: 14px; flex-shrink: 0; }
.ee-media-file-link {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; background: #f0f4f8; border: 1px solid #d0d8e0;
  border-radius: 4px; font-size: 11px; color: var(--primary, #0b3e66);
  text-decoration: none; word-break: break-all;
}
.ee-media-file-link:hover { background: #e0e8f0; }
.ee-media-file-remove {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px; border: none; border-radius: 50%;
  background: rgba(0,0,0,0.5); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 9px;
  opacity: 0; transition: opacity 0.15s;
}
.ee-media-file:hover .ee-media-file-remove { opacity: 1; }
.ee-media-file-remove:hover { background: #e74c3c; }
.ee-media-video { width: 100%; position: relative; }
.ee-media-video iframe { max-width: 100%; height: auto; aspect-ratio: 16/9; border-radius: 4px; }
.ee-media-audio-wrap {
  padding: 8px; background: #f8f9fb; border: 1px solid var(--border, #dde1e7);
  border-radius: var(--radius, 8px);
}
.ee-media-audio-wrap .ee-audio-filename { margin-bottom: 6px; }
.ee-media-audio { width: 100%; max-height: 36px; border-radius: 4px; }
.ee-media-remove {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border: none; border-radius: 50%;
  background: rgba(0,0,0,0.5); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 10px;
}
.ee-media-remove:hover { background: #e74c3c; }

.ee-media-actions {
  display: flex; flex-direction: column; gap: 6px; width: 100%;
}
.ee-media-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border: 1px dashed #ccc; border-radius: 6px;
  background: #fafbfc; cursor: pointer; font-size: 12px; color: #666;
  transition: border-color 0.15s;
}
.ee-media-btn:hover { border-color: var(--primary); color: var(--primary); }
.ee-media-btn-active {
  border-style: solid; border-color: var(--primary); color: var(--primary);
  background: #fdf0f5;
}
.ee-media-btn-active i { color: var(--primary); }
.ee-hidden-input { display: none; }

/* Fields */
.ee-field {
  width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px;
  font-size: 13px; font-family: inherit; box-sizing: border-box;
}
.ee-field:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(11,62,102,0.12); }
.ee-title-input { font-weight: 600; font-size: 14px; }
.ee-auto-ta { resize: none; overflow: hidden; }
.ee-consigne-input { min-height: 40px; }
.ee-label { font-weight: 600; font-size: 12px; color: #555; margin-top: 4px; }

/* Choices editor */
.ee-choices-editor { display: flex; flex-direction: column; gap: 6px; }
.ee-choice-row {
  display: flex; align-items: flex-start; gap: 8px;
}
.ee-choice-check { flex-shrink: 0; width: 18px; height: 18px; cursor: pointer; }
.ee-choice-text { flex: 1; }
.ee-choice-score {
  width: 55px; height: 28px; border: 1px solid #ddd; border-radius: 4px;
  text-align: center; font-size: 12px; flex-shrink: 0;
}

/* VF labels */
.ee-vf-label { font-size: 14px; font-weight: 500; color: #333; flex: 1; }

/* Free text editor */
.ee-free-editor { display: flex; flex-direction: column; gap: 10px; }
.ee-free-subq {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px; border: 1px solid #eee; border-radius: 6px; background: #fafbfc;
}
.ee-free-answer-input { resize: vertical; min-height: 40px; }
.ee-free-row { display: flex; align-items: center; gap: 8px; }

/* Trous editor */
.ee-trous-editor { display: flex; flex-direction: column; gap: 8px; }

/* Toolbar */
.ee-trous-toolbar { display: flex; gap: 4px; padding: 4px; background: #f5f6f8; border: 1px solid #e0e3e8; border-bottom: none; border-radius: 6px 6px 0 0; }
.ee-trous-tb-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 28px; border: 1px solid transparent; border-radius: 4px; background: none; color: #555; cursor: pointer; font-size: 13px; }
.ee-trous-tb-btn:hover { background: #e3e6ea; color: #333; }
.ee-trous-tb-highlight { color: #d4a017; }
.ee-trous-tb-highlight:hover { background: #fef3cd; color: #b8860b; }
.ee-trous-tb-eraser { color: #888; }
.ee-trous-tb-active { background: #dbeafe !important; border-color: #93c5fd; color: #1d4ed8 !important; }

/* Contenteditable */
.ee-trous-ce {
  min-height: 80px; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 0 0 6px 6px;
  font-size: 14px; font-family: inherit; line-height: 1.8; background: #fff; outline: none;
  white-space: pre-wrap; word-wrap: break-word;
}
.ee-trous-ce:focus { border-color: #4f8cff; box-shadow: 0 0 0 2px rgba(79,140,255,0.15); }
.ee-trous-ce:empty:before { content: attr(data-placeholder); color: #aaa; pointer-events: none; }
.ee-trous-ce mark.ee-trous-mark {
  background: #fff3cd; padding: 1px 4px; border-radius: 3px; border: 1px solid #ffe082;
  color: #7c5e00; font-weight: 500; cursor: default;
}
.ee-trous-eraser-mode mark.ee-trous-mark { cursor: pointer; border-style: dashed; border-color: #e57373; }
.ee-trous-eraser-mode mark.ee-trous-mark:hover { background: #fce4e4; border-color: #c62828; color: #c62828; }

/* Gap table */
.ee-trous-gaps { margin-top: 4px; }
.ee-trous-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ee-trous-table th { text-align: left; padding: 6px 8px; background: #f5f6f8; border-bottom: 2px solid #dee2e6; font-weight: 600; font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.3px; }
.ee-trous-table td { padding: 6px 8px; border-bottom: 1px solid #eaecef; vertical-align: middle; }
.ee-trous-td-num { width: 30px; color: #9ca3af; font-weight: 600; text-align: center; }
.ee-trous-td-answer { font-weight: 500; color: #1e293b; vertical-align: middle; }
.ee-trous-answer-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ee-trous-answer-wrap .ee-trous-tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 12px; font-size: 12px; line-height: 1.4; white-space: nowrap; }
.ee-trous-tag-main { background: #fef3c7; color: #92400e; font-weight: 600; }
.ee-trous-tag-variant { background: #e0e7ff; color: #3730a3; }
.ee-trous-tag-remove { margin-left: 5px; cursor: pointer; font-size: 13px; font-weight: 700; color: #6366f1; opacity: 0.6; line-height: 1; }
.ee-trous-tag-remove:hover { opacity: 1; color: #dc2626; }
.ee-trous-variants { display: contents; }
.ee-trous-add-variant { display: inline-flex; align-items: center; justify-content: center; background: none; border: 1px dashed #cbd5e1; border-radius: 12px; width: 22px; height: 22px; padding: 0; cursor: pointer; color: #9ca3af; font-size: 11px; flex-shrink: 0; }
.ee-trous-add-variant:hover { border-color: #4f8cff; color: #4f8cff; }
.ee-trous-tag-editing { outline: none; border: 1px dashed #6366f1; min-width: 40px; cursor: text; background: #eef2ff; }
.ee-trous-tag-editing:focus { box-shadow: 0 0 0 2px rgba(99,102,241,0.2); border-style: solid; }
.ee-trous-td-pos { width: 60px; text-align: center; color: #6b7280; font-size: 12px; }
.ee-trous-td-score { width: 80px; }
.ee-trous-score-input { width: 60px; padding: 4px 6px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 13px; text-align: center; }
.ee-trous-score-input:focus { border-color: #4f8cff; outline: none; box-shadow: 0 0 0 2px rgba(79,140,255,0.15); }
.ee-trous-total { padding: 8px 0; font-size: 13px; color: #374151; text-align: right; }
.ee-trous-empty { padding: 12px; color: #9ca3af; font-size: 12px; font-style: italic; text-align: center; }

/* Info box */
.ee-info {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 8px 12px; background: #e8f4fd; border-radius: 6px;
  font-size: 12px; color: #0d6efd; line-height: 1.4;
}
.ee-info i { margin-top: 2px; flex-shrink: 0; }

/* Classement */
.ee-order-num { font-weight: 700; font-size: 14px; color: #888; width: 24px; text-align: center; flex-shrink: 0; }

/* Edit button in ExerciseViewer (hamburger) */
.ev-edit-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: none; background: var(--primary, #0b3e66);
  border-radius: 6px; cursor: pointer; color: #fff; font-size: 16px;
  margin-left: auto;
}
.ev-edit-btn:hover { opacity: 0.9; }

/* ── Prononciation viewer (type 9) ── */
.ev-pron-wrap { display: flex; flex-direction: column; gap: 12px; }
.ev-pron-words { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; background: #f8f9fa; border-radius: 8px; }
.ev-pron-word { display: inline-block; padding: 6px 14px; background: #e5e7eb; color: #374151; border-radius: 20px; font-size: 15px; font-weight: 500; transition: all 0.3s ease; }
.ev-pron-word.ev-pron-correct { background: #d1fae5; color: #065f46; box-shadow: 0 0 0 2px #34d399; }
.ev-pron-status { font-size: 13px; color: #6b7280; text-align: center; }
.ev-pron-status.ev-pron-listening { color: #dc2626; font-weight: 600; }
.ev-pron-status.ev-pron-listening::before { content: ''; display: inline-block; width: 8px; height: 8px; background: #dc2626; border-radius: 50%; margin-right: 6px; animation: ev-pron-pulse 1s infinite; }
@keyframes ev-pron-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.ev-pron-status.ev-pron-done { color: #059669; font-weight: 600; }
.ev-pron-score { text-align: center; font-size: 14px; font-weight: 600; color: #374151; }
.ev-pron-controls { display: flex; justify-content: center; gap: 10px; }
.ev-pron-mic { padding: 8px 20px; border: none; border-radius: 8px; background: #4f8cff; color: white; font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.2s; }
.ev-pron-mic:hover { background: #3b7ae0; }
.ev-pron-mic.ev-pron-mic-active { background: #dc2626; }
.ev-pron-mic.ev-pron-mic-active:hover { background: #b91c1c; }
.ev-pron-reset { padding: 8px 16px; border: 1px solid #d1d5db; border-radius: 8px; background: white; color: #6b7280; font-size: 13px; cursor: pointer; }
.ev-pron-reset:hover { background: #f3f4f6; }
.ev-pron-unsupported { padding: 12px; background: #fef3c7; color: #92400e; border-radius: 8px; font-size: 13px; }

/* ── Expression orale viewer (type 11) ── */
.ev-oral-wrap { display: flex; flex-direction: column; gap: 12px; }
.ev-oral-layout { display: flex; gap: 24px; align-items: center; }
@media (max-width: 600px) { .ev-oral-layout { flex-direction: column; gap: 16px; } }

/* Left column: big round button — fixed width, no grow */
.ev-oral-left { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 0 0 auto; }
.ev-oral-bigbtn { width: 80px; height: 80px; border-radius: 50%; border: none; cursor: pointer; font-size: 28px; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.ev-oral-bigbtn-idle { background: #4f8cff; color: white; }
.ev-oral-bigbtn-idle:hover { background: #3b7ae0; transform: scale(1.05); }
.ev-oral-bigbtn-recording { background: #dc2626; color: white; animation: ev-oral-pulse 1.5s infinite; }
.ev-oral-bigbtn-recording:hover { background: #b91c1c; }
@keyframes ev-oral-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.4); } 50% { box-shadow: 0 0 0 12px rgba(220,38,38,0); } }
.ev-oral-bigbtn-play { background: #059669; color: white; }
.ev-oral-bigbtn-play:hover { background: #047857; transform: scale(1.05); }
.ev-oral-rerecord { padding: 4px 12px; border: 1px solid #d1d5db; border-radius: 6px; background: white; color: #6b7280; font-size: 12px; cursor: pointer; white-space: nowrap; }
.ev-oral-rerecord:hover { background: #f3f4f6; }

/* Right column: status, timer, waveform, playback */
.ev-oral-right { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ev-oral-timer { font-size: 24px; font-weight: 700; color: #374151; font-variant-numeric: tabular-nums; letter-spacing: 2px; }
.ev-oral-waveform { width: 100%; height: 60px; border-radius: 8px; background: #f8f9fa; border: 1px solid #e5e7eb; }
.ev-oral-status { font-size: 13px; color: #6b7280; }
.ev-oral-status-recording { color: #dc2626; font-weight: 600; }
.ev-oral-status-recording::before { content: ''; display: inline-block; width: 8px; height: 8px; background: #dc2626; border-radius: 50%; margin-right: 6px; animation: ev-pron-pulse 1s infinite; }
.ev-oral-status-done { color: #059669; font-weight: 600; }
.ev-oral-playback { width: 100%; }
.ev-oral-audio { width: 100%; display: none; } /* hidden — playback via big button */

/* ── Prononciation editor (type 9) ── */
.ee-prononciation-editor { display: flex; flex-direction: column; gap: 10px; }
.ee-pron-row { display: flex; align-items: center; gap: 10px; }
.ee-pron-label { font-size: 13px; font-weight: 600; color: #374151; white-space: nowrap; }
.ee-pron-text-label { margin-bottom: -6px; }
.ee-pron-select { padding: 4px 8px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; background: white; }
.ee-pron-select:focus { border-color: #4f8cff; outline: none; box-shadow: 0 0 0 2px rgba(79,140,255,0.15); }
.ee-pron-textarea { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; font-family: inherit; line-height: 1.6; resize: vertical; min-height: 80px; }
.ee-pron-textarea:focus { border-color: #4f8cff; outline: none; box-shadow: 0 0 0 2px rgba(79,140,255,0.15); }
.ee-pron-preview { background: #f8f9fa; border-radius: 6px; padding: 10px 12px; }
.ee-pron-wordcount { font-size: 12px; color: #6b7280; margin-bottom: 6px; font-weight: 500; }
.ee-pron-words { display: flex; flex-wrap: wrap; gap: 5px; }
.ee-pron-word { display: inline-block; padding: 3px 10px; background: #e0e7ff; color: #3730a3; border-radius: 12px; font-size: 13px; font-weight: 500; }

/* Badge for texte à trous type */
.pe-exo-badge-trous { background: #16a085; }
.pe-exo-badge-reperage { background: #e67e22; }

/* Repérage editor — word cloud */
.ee-reperage-editor { display: flex; flex-direction: column; gap: 8px; }
.ee-reperage-group { display: flex; flex-direction: column; }
.ee-reperage-group .ee-trous-toolbar { border-radius: 6px 6px 0 0; border: 1px solid #e0e3e8; border-bottom: none; }
.ee-reperage-cloud {
  padding: 12px; background: #fff; border: 1px solid #d1d5db; border-radius: 0 0 6px 6px;
  line-height: 2.2; user-select: none; min-height: 40px;
}
.ee-reperage-token {
  display: inline-block; padding: 3px 8px; margin: 2px 1px; border-radius: 4px;
  font-size: 14px; cursor: pointer; border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.ee-reperage-token:hover { background: #e3f0fc; border-color: #93c5fd; }
.ee-reperage-selected {
  background: #fff3cd !important; border-color: #ffe082 !important;
  font-weight: 600; color: #7c5e00;
}
.ee-reperage-eraser-mode .ee-reperage-selected { border-style: dashed; border-color: #e57373 !important; }
.ee-reperage-eraser-mode .ee-reperage-selected:hover { background: #fce4e4 !important; border-color: #c62828 !important; color: #c62828; }

/* ─── AudioPlayer ───────────────────────────────────────────────────────── */
.ap-player {
  width: 100%; border-radius: var(--radius, 8px); overflow: hidden;
  border: 1px solid var(--border, #dde1e7); background: var(--bg-card, #fff);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.ap-wave-wrap {
  position: relative; width: 100%; height: 80px;
  background: linear-gradient(180deg, #f8f9fb 0%, #f0f2f5 100%);
  cursor: pointer;
}
.ap-wave { display: block; width: 100%; height: 100%; }
.ap-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-light, #999); font-size: 18px;
}
.ap-bar {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px; background: #f5f6f8; border-top: 1px solid var(--border, #dde1e7);
}
.ap-btn {
  width: 30px; min-width: 30px; height: 30px; border: none; border-radius: 50%;
  background: transparent; color: var(--text-secondary, #6b6b6b);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 12px; transition: background .15s, color .15s; flex-shrink: 0;
}
.ap-btn:hover { background: var(--primary, #cf1578); color: #fff; }
.ap-time {
  font-size: 11px; color: var(--text-light, #999); font-variant-numeric: tabular-nums;
  margin-left: 4px; white-space: nowrap; min-width: 70px;
}
.ap-freq { flex: 1; height: 28px; min-width: 40px; border-radius: 4px; }

/* Compact variant for inline use (exercise editor media zone) */
.ap-player.ap-compact .ap-wave-wrap { height: 36px; }
.ap-player.ap-compact .ap-bar { padding: 4px 8px; }
.ap-player.ap-compact .ap-btn { width: 26px; min-width: 26px; height: 26px; font-size: 10px; }
.ap-player.ap-compact .ap-time { display: none; }
.ap-player.ap-compact .ap-freq { height: 22px; flex: 1; }

/* ─── Audio section in media zone ───────────────────────────────────────── */
.ee-audio-section {
  border-top: 1px solid var(--border, #dde1e7); margin-top: 8px; padding-top: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.ee-audio-row {
  position: relative;
}
.ee-audio-hover-del {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  width: 22px; height: 22px; border: none; border-radius: 50%;
  background: rgba(0,0,0,0.5); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 10px;
  opacity: 0; transition: opacity 0.15s;
}
.ee-audio-row:hover .ee-audio-hover-del { opacity: 1; }
.ee-audio-hover-del:hover { background: var(--error, #f34541); }

/* ─── Document texte zone ──────────────────────────────────────────────── */
.ee-doc-texte-zone { margin-top: 8px; }
.ee-doc-texte-preview {
  border: 1px solid var(--border, #dde1e7); border-radius: var(--radius, 8px);
  background: #fafbfc; overflow: hidden;
}
.ee-doc-texte-label {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--text-secondary, #6b6b6b);
  border-bottom: 1px solid var(--border, #dde1e7); background: #f0f2f5;
}
.ee-doc-texte-label i { color: var(--primary, #cf1578); }
.ee-doc-texte-content {
  padding: 8px 10px; font-size: 12px; line-height: 1.5;
  color: var(--text, #1a1a1a); max-height: 120px; overflow-y: auto;
}
.ee-doc-texte-content p { margin: 0 0 4px; }
.ee-doc-texte-actions {
  display: flex; gap: 4px; padding: 4px 8px; justify-content: flex-end;
  border-top: 1px solid var(--border, #dde1e7);
}
.ee-doc-texte-action {
  width: 26px; min-width: 26px; height: 26px; border: none; border-radius: 50%;
  background: transparent; color: var(--text-light, #999); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
  transition: background .15s, color .15s; flex-shrink: 0;
}
.ee-doc-texte-action:hover { background: var(--primary, #cf1578); color: #fff; }
.ee-doc-texte-action-del:hover { background: var(--error, #f34541); color: #fff; }

/* ─── Audio modal dropzone ──────────────────────────────────────────────── */
.ee-audio-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 32px 16px;
  border: 2px dashed var(--border, #dde1e7); border-radius: var(--radius, 8px);
  background: #fafbfc; cursor: pointer; transition: border-color .15s, background .15s;
  text-align: center; color: var(--text-secondary, #6b6b6b);
}
.ee-audio-dropzone i { font-size: 28px; color: var(--text-light, #999); }
.ee-audio-dropzone span { font-size: 13px; }
.ee-audio-dropzone .ee-audio-formats { font-size: 11px; color: var(--text-light, #999); }
.ee-audio-dropzone:hover,
.ee-audio-dropzone.ee-audio-dragover {
  border-color: var(--primary, #cf1578); background: #fdf0f5;
}
.ee-audio-dropzone.ee-audio-dragover i { color: var(--primary, #cf1578); }
.ee-audio-preview { margin-top: 12px; }
.ee-audio-filename {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--text, #1a1a1a);
  margin-bottom: 10px;
}
.ee-audio-filename i { color: var(--primary, #cf1578); }

/* ── Classement (ordering) editor ──────────────────────────────── */
.ee-classement-input-wrap { margin-bottom: 10px; }
.ee-classement-input-field { width: 100%; padding: 8px 12px; border: 1px solid #d0d5dd; border-radius: 8px; font-size: 14px; }
.ee-classement-input-field:focus { border-color: #4f46e5; outline: none; box-shadow: 0 0 0 2px rgba(79,70,229,.15); }
.ee-classement-pills {
  display: flex; flex-wrap: wrap; gap: 8px; min-height: 44px;
  padding: 10px; background: #f8f9fa; border-radius: 8px; border: 1px solid #e0e0e0; margin-bottom: 8px;
}
.ee-classement-empty { color: #999; font-size: 13px; padding: 8px; }
.ee-classement-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: #fff; border: 2px solid #e0e3e8; border-radius: 20px;
  padding: 5px 10px 5px 6px; font-size: 13px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.05); transition: border-color .15s, box-shadow .15s;
  user-select: none;
}
.ee-classement-pill:hover { border-color: #4f46e5; box-shadow: 0 2px 6px rgba(0,0,0,.1); }
.ee-classement-pill.selected { border-color: #4f46e5; background: #eef2ff; box-shadow: 0 0 0 2px rgba(79,70,229,.2); }
.ee-classement-pill-live { border-style: dashed; border-color: #a5b4fc; background: #f5f7ff; opacity: .85; }
.ee-classement-pill-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; background: #4f46e5; color: #fff;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.ee-classement-pill-word { font-weight: 500; white-space: nowrap; cursor: grab; }
.ee-classement-pill-badge {
  font-size: 10px; color: #6b7280; background: #f3f4f6; border-radius: 8px;
  padding: 1px 6px; font-weight: 500; white-space: nowrap;
}
/* ── Edit panel (score + delete, below pills) ──────────────── */
.ee-classement-edit-panel {
  display: none; align-items: center; gap: 10px;
  padding: 8px 12px; background: #eef2ff; border: 1px solid #c7d2fe;
  border-radius: 8px; margin-bottom: 8px; font-size: 13px;
}
.ee-classement-ep-label { color: #333; white-space: nowrap; }
.ee-classement-ep-pts {
  width: 60px; height: 28px; border: 1px solid #c7d2fe; border-radius: 6px;
  text-align: center; font-size: 13px; background: #fff;
}
.ee-classement-ep-pts:focus { border-color: #4f46e5; outline: none; }
.ee-classement-ep-del {
  background: none; border: 1px solid #fca5a5; color: #ef4444; border-radius: 6px;
  padding: 4px 10px; cursor: pointer; font-size: 12px; white-space: nowrap;
  transition: background .15s;
}
.ee-classement-ep-del:hover { background: #fef2f2; }
.ee-classement-ep-close {
  background: none; border: none; cursor: pointer; color: #999;
  font-size: 14px; margin-left: auto; padding: 4px;
}
.ee-classement-ep-close:hover { color: #333; }
/* ── Total + merge ──────────────────────────────────────────── */
.ee-classement-total { font-size: 13px; color: #555; padding: 6px 0; }
.ee-classement-total-val { font-weight: 700; color: #1a1a1a; }
.ee-classement-merge-btn { margin-top: 4px; }
.ee-merge-mode .ee-classement-pill { cursor: pointer; }
.ee-merge-mode .ee-classement-pill:hover { border-color: #f59e0b; background: #fffbeb; }

/* ── Crossword editor ─────────────────────────────────────── */
.ee-cw-wordlist { margin-bottom: 8px; }
.ee-cw-row { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.ee-cw-header { font-size: 12px; font-weight: 600; color: #666; padding-bottom: 2px; border-bottom: 1px solid #e0e0e0; margin-bottom: 4px; }
.ee-cw-col-word { width: 120px; flex-shrink: 0; }
.ee-cw-col-clue { flex: 1; }
.ee-cw-col-pts { width: 45px; text-align: center; flex-shrink: 0; }
.ee-cw-col-del { width: 28px; flex-shrink: 0; }
.ee-cw-word-input { width: 120px; flex-shrink: 0; text-transform: uppercase; font-weight: 600; }
.ee-cw-clue-input { flex: 1; }
.ee-cw-pts-input { width: 45px; text-align: center; border: 1px solid #d0d5dd; border-radius: 4px; padding: 4px 2px; font-size: 13px; }
.ee-cw-del-btn { background: none; border: none; cursor: pointer; color: #ccc; font-size: 12px; padding: 4px; transition: color .15s; }
.ee-cw-del-btn:hover { color: #ef4444; }
.ee-cw-row-excluded { background: #fef2f2; border-left: 3px solid #ef4444; border-radius: 4px; padding-left: 4px; }
.ee-cw-row-excluded .ee-cw-word-input { color: #ef4444; text-decoration: line-through; }
.ee-cw-remove-excluded {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px;
  padding: 4px 10px; font-size: 12px; background: #fef2f2; color: #ef4444;
  border: 1px solid #fca5a5; border-radius: 6px; cursor: pointer;
  transition: background .15s;
}
.ee-cw-remove-excluded:hover { background: #fee2e2; }
.ee-cw-gen-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.ee-cw-gen-btn { font-size: 13px; padding: 6px 14px; }
.ee-cw-gen-msg { font-size: 12px; }
/* Grid preview */
.ee-cw-preview { margin-top: 10px; }
.ee-cw-preview-row { display: flex; gap: 16px; align-items: flex-start; }
.ee-cw-grid { display: inline-block; border: 1px solid #333; }
.ee-cw-grid-row { display: flex; }
.ee-cw-cell {
  position: relative; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  border: 0.5px solid #ccc;
}
.ee-cw-cell-blank { background: #1a1a1a; }
.ee-cw-cell-letter { background: #fff; color: #333; }
.ee-cw-cell-num {
  position: absolute; top: 1px; left: 2px; font-size: 7px; font-weight: 600;
  color: #4f46e5; line-height: 1;
}
/* Clues */
.ee-cw-clues { flex: 1; min-width: 0; }
.ee-cw-clues-title { font-size: 13px; font-weight: 600; color: #333; margin: 4px 0 2px; }
.ee-cw-clue-line { font-size: 12px; color: #555; padding: 1px 0; }

/* ── Repérage image editor ────────────────────────────────── */
.ee-ri-toolbar {
  display: flex; gap: 4px; margin-bottom: 8px; padding: 4px;
  background: #f8f9fa; border-radius: 8px; border: 1px solid #e0e0e0;
}
.ee-ri-tool-btn {
  width: 34px; height: 34px; border: 1px solid transparent; border-radius: 6px;
  background: none; cursor: pointer; font-size: 14px; color: #555;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.ee-ri-tool-btn:hover { background: #e0e3e8; color: #333; }
.ee-ri-tool-btn.active { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.ee-ri-canvas {
  position: relative; background: #f0f0f0; border-radius: 8px;
  border: 1px solid #d0d5dd; overflow: hidden; min-height: 200px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.ee-ri-img { width: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.ee-ri-svg {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  cursor: crosshair;
}
.ee-ri-noimg { color: #999; font-size: 13px; padding: 24px; text-align: center; }
/* Zone list */
.ee-ri-list { margin-bottom: 6px; }
.ee-ri-list-empty { color: #999; font-size: 13px; padding: 8px 0; }
.ee-ri-list-row {
  display: flex; align-items: center; gap: 6px; padding: 5px 8px;
  border-radius: 6px; cursor: pointer; transition: background .1s;
}
.ee-ri-list-row:hover { background: #f3f4f6; }
.ee-ri-list-row.selected { background: #eef2ff; }
.ee-ri-list-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ee-ri-list-type { font-size: 12px; color: #888; width: 20px; text-align: center; flex-shrink: 0; }
.ee-ri-list-label {
  flex: 1; border: 1px solid #e0e0e0; border-radius: 4px; padding: 3px 6px;
  font-size: 13px; min-width: 0;
}
.ee-ri-list-label:focus { border-color: #4f46e5; outline: none; }
.ee-ri-list-score {
  width: 50px; border: 1px solid #e0e0e0; border-radius: 4px; padding: 3px 4px;
  font-size: 13px; text-align: center;
}
.ee-ri-list-score:focus { border-color: #4f46e5; outline: none; }
.ee-ri-list-ptlbl { font-size: 11px; color: #888; }
.ee-ri-list-del {
  background: none; border: none; cursor: pointer; color: #ccc; font-size: 12px;
  padding: 2px 4px; transition: color .15s;
}
.ee-ri-list-del:hover { color: #ef4444; }

/* ── Highlight / Surlignage viewer (student) ──────────────── */
.ev-highlight-wrap { padding: 4px 0; }
.ev-hl-info { font-size: 13px; color: #666; margin-bottom: 8px; }
.ev-hl-info i { color: #f59e0b; margin-right: 4px; }
.ev-hl-text {
  padding: 14px 18px; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px;
  font-size: 15px; line-height: 1.8; color: #1a1a1a; cursor: text; user-select: text;
  margin-bottom: 8px;
}
.ev-hl-text::selection { background: #fef08a; }
.ev-hl-text *::selection { background: #fef08a; }
.ev-hl-found {
  background: #bbf7d0; color: #166534; border-radius: 3px; padding: 1px 2px;
  transition: background .3s;
}
.ev-hl-miss-flash { border-color: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,.3); transition: box-shadow .1s; }
.ev-hl-progress { font-size: 12px; color: #888; }

/* ── Word search viewer (student) ─────────────────────────── */
.ev-ws-wrap { padding: 4px 0; }
.ev-ws-row { display: flex; gap: 20px; align-items: flex-start; }
.ev-ws-canvas { position: relative; flex-shrink: 0; }
.ev-ws-grid { display: inline-block; border: 2px solid #1a1a1a; user-select: none; -webkit-user-select: none; }
.ev-ws-grid-row { display: flex; }
.ev-ws-cell {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; text-transform: uppercase; color: #1a1a1a;
  background: #fff; border: 0.5px solid #e0e0e0; cursor: pointer;
  user-select: none; -webkit-user-select: none;
}
.ev-ws-cell:hover { background: #f0f4ff; }
.ev-ws-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
/* Word pills */
.ev-ws-list { flex: 1; min-width: 0; }
.ev-ws-list-title { font-size: 14px; font-weight: 600; color: #333; margin-bottom: 8px; }
.ev-ws-pill {
  display: inline-block; padding: 4px 12px; margin: 3px 4px;
  background: #f3f4f6; color: #333; border-radius: 16px; font-size: 13px; font-weight: 600;
  text-transform: uppercase; transition: all .2s;
}
.ev-ws-pill-found { text-decoration: line-through; }
.ev-ws-progress { font-size: 12px; color: #888; margin-top: 10px; padding-top: 6px; border-top: 1px solid #e0e0e0; }
/* Editor preview */
.ee-ws-pill-excluded { border-color: #ef4444; background: #fef2f2; }
.ee-ws-pill-excluded .ee-classement-pill-word { color: #ef4444; text-decoration: line-through; }
/* Input pill — inline word entry */
.ee-ws-input-pill { border-style: dashed; border-color: #a5b4fc; background: #f5f7ff; cursor: text; }
.ee-ws-input-pill:focus-within { border-color: #4f46e5; background: #eef2ff; }
.ee-ws-pill-input {
  border: none; background: transparent; outline: none;
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  width: 60px; min-width: 30px; padding: 0; color: #333;
}
.ee-ws-pill-input::placeholder { color: #aaa; font-weight: 400; text-transform: none; }
.ee-ws-pills-input { cursor: text; }
.ee-ws-pill-excluded .ee-classement-pill-num { background: #ef4444; }
.ee-ws-cell-word { background: #eef2ff; font-weight: 700; color: #4f46e5; }
.ee-ws-word-pill {
  display: inline-block; padding: 3px 10px; margin: 2px 3px;
  background: #f3f4f6; border-radius: 12px; font-size: 12px; font-weight: 600;
  text-transform: uppercase;
}
.ee-ws-wordlist-preview { flex: 1; }
@media (max-width: 600px) {
  .ev-ws-row { flex-direction: column; }
  .ev-ws-cell { width: 28px; height: 28px; font-size: 13px; }
}

/* ── Crossword viewer (student) ───────────────────────────── */
.ev-cw-wrap { padding: 4px 0; }
.ev-cw-row { display: flex; gap: 20px; align-items: flex-start; }
.ev-cw-grid { display: inline-block; border: 2px solid #1a1a1a; flex-shrink: 0; }
.ev-cw-grid-row { display: flex; }
.ev-cw-cell {
  position: relative; width: 32px; height: 32px;
  border: 0.5px solid #ccc;
}
.ev-cw-cell-blank { background: #1a1a1a; }
.ev-cw-cell-letter { background: #fff; }
.ev-cw-cell-highlight { background: #eef2ff; }
.ev-cw-cell-num {
  position: absolute; top: 1px; left: 2px; font-size: 8px; font-weight: 600;
  color: #4f46e5; line-height: 1; pointer-events: none; z-index: 1;
}
.ev-cw-input {
  width: 100%; height: 100%; border: none; background: transparent;
  text-align: center; font-size: 16px; font-weight: 700; text-transform: uppercase;
  caret-color: #4f46e5; outline: none; padding: 0;
}
.ev-cw-input:focus { background: #c7d2fe; }
/* Clues */
.ev-cw-clues { flex: 1; min-width: 0; max-height: 400px; overflow-y: auto; }
.ev-cw-clues-title { font-size: 14px; font-weight: 600; color: #333; margin: 8px 0 4px; }
.ev-cw-clue-line {
  font-size: 13px; color: #555; padding: 3px 6px; border-radius: 4px;
  cursor: pointer; transition: background .1s;
}
.ev-cw-clue-line:hover { background: #f3f4f6; }
.ev-cw-clue-active { background: #eef2ff; color: #1a1a1a; font-weight: 500; }
/* Correct/wrong feedback */
.ev-cw-cell-correct .ev-cw-input { color: #16a34a; }
.ev-cw-cell-wrong .ev-cw-input { color: #ef4444; }
@media (max-width: 600px) {
  .ev-cw-row { flex-direction: column; }
  .ev-cw-cell { width: 28px; height: 28px; }
  .ev-cw-input { font-size: 14px; }
}

/* ── Repérage image viewer (student) ──────────────────────── */
.ev-ri-wrap { padding: 4px 0; }
.ev-ri-row { display: flex; gap: 16px; align-items: flex-start; }
.ev-ri-canvas {
  position: relative; flex: 1; min-width: 0;
  background: #f0f0f0; border-radius: 8px; border: 1px solid #d0d5dd; overflow: hidden;
}
.ev-ri-canvas-inner { position: relative; display: inline-block; max-width: 100%; max-height: 100%; }
.ev-ri-img { display: block; max-width: 100%; max-height: 100%; user-select: none; -webkit-user-drag: none; }
.ev-ri-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; cursor: crosshair; }
.ev-ri-list {
  width: 200px; flex-shrink: 0; background: #f8f9fa; border-radius: 8px;
  border: 1px solid #e0e0e0; padding: 10px;
}
.ev-ri-list-title { font-size: 13px; font-weight: 600; color: #333; margin-bottom: 8px; }
.ev-ri-list-item {
  display: flex; align-items: center; gap: 6px; padding: 4px 0;
  font-size: 13px; color: #666; transition: color .15s;
}
.ev-ri-list-item.found { color: #111; font-weight: 500; }
/* Draggable pin marker */
.ev-ri-icon {
  position: relative; width: 26px; height: 34px; flex-shrink: 0;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 3px;
  color: #fff; font-size: 11px; font-weight: 700;
  cursor: grab; user-select: none;
  transition: opacity .15s, transform .1s;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.25));
}
/* Pin shape via SVG background */
.ev-ri-icon::before {
  content: '';
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 34'%3E%3Cpath d='M13 0C5.8 0 0 5.8 0 13c0 9.75 13 21 13 21s13-11.25 13-21C26 5.8 20.2 0 13 0z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 34'%3E%3Cpath d='M13 0C5.8 0 0 5.8 0 13c0 9.75 13 21 13 21s13-11.25 13-21C26 5.8 20.2 0 13 0z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.ev-ri-icon span { position: relative; z-index: 1; }
.ev-ri-icon:hover:not(.ev-ri-icon-placed) { transform: scale(1.15) translateY(-2px); }
.ev-ri-icon:active:not(.ev-ri-icon-placed) { cursor: grabbing; }
.ev-ri-icon-placed { opacity: .35; cursor: default !important; filter: grayscale(.5); }
.ev-ri-list-label { flex: 1; }
.ev-ri-label-placed { text-decoration: line-through; color: #999; }
.ev-ri-list-check { color: #16a34a; font-size: 12px; width: 16px; text-align: center; }
.ev-ri-canvas-hover { box-shadow: 0 0 0 3px rgba(79,70,229,.4); }
.ev-ri-progress { font-size: 12px; color: #888; margin-top: 8px; padding-top: 6px; border-top: 1px solid #e0e0e0; }

@media (max-width: 600px) {
  .ev-ri-row { flex-direction: column; }
  .ev-ri-list { width: 100%; }
}

/* ── Classement viewer (student) ───────────────────────────── */
.ev-classement-wrap { padding: 4px 0; }
.ev-cl-label { font-size: 13px; font-weight: 600; color: #555; margin-bottom: 6px; }
.ev-cl-label-src { margin-top: 16px; }
.ev-cl-dropzone {
  display: flex; flex-wrap: wrap; gap: 8px;
  min-height: 48px; padding: 10px;
  background: #f0f4ff; border: 2px dashed #c7d2fe; border-radius: 10px;
}
.ev-cl-slot {
  display: inline-flex; align-items: center; gap: 5px;
  min-width: 60px; min-height: 38px; padding: 5px 12px 5px 6px;
  background: #fff; border: 2px solid #e0e3e8; border-radius: 20px;
  font-size: 14px; transition: border-color .15s, background .15s;
}
.ev-cl-slot-filled { border-color: #4f46e5; background: #eef2ff; cursor: pointer; }
.ev-cl-slot-filled:hover { background: #e0e7ff; }
.ev-cl-slot-over { border-color: #4f46e5; background: #dbeafe; border-style: solid; }
.ev-cl-slot-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: #d0d5dd; color: #fff; font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.ev-cl-slot-filled .ev-cl-slot-num { background: #4f46e5; }
.ev-cl-slot-word { font-weight: 500; }
.ev-cl-slot-placeholder { color: #bbb; font-size: 16px; letter-spacing: 2px; }
.ev-cl-srczone {
  display: flex; flex-wrap: wrap; gap: 8px;
  min-height: 44px; padding: 10px;
  background: #f8f9fa; border: 1px solid #e0e0e0; border-radius: 10px;
}
.ev-cl-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fff; border: 2px solid #d0d5dd; border-radius: 20px;
  padding: 6px 14px; font-size: 14px; cursor: grab;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: border-color .15s, box-shadow .15s, transform .1s;
  user-select: none;
}
.ev-cl-pill:hover { border-color: #4f46e5; box-shadow: 0 2px 8px rgba(0,0,0,.12); transform: translateY(-1px); }
.ev-cl-pill:active { cursor: grabbing; }
.ev-cl-pill-dragging { opacity: .3; }
.ev-cl-pill-word { font-weight: 500; }
.ev-cl-done { color: #16a34a; font-size: 13px; padding: 6px 0; }
.ev-cl-done i { margin-right: 4px; }
/* Correction feedback */
.ev-cl-slot-correct { border-color: #16a34a; background: #f0fdf4; }
.ev-cl-slot-correct .ev-cl-slot-num { background: #16a34a; }
.ev-cl-slot-wrong { border-color: #ef4444; background: #fef2f2; }
.ev-cl-slot-wrong .ev-cl-slot-num { background: #ef4444; }

/* ══════════════════════════════════════════════════════════════
   ExerciseRunner — question-by-question presentation
   ══════════════════════════════════════════════════════════════ */

/* Header */
.er-header { display: flex; align-items: center; gap: 12px; width: 100%; }
.er-title {
  font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; color: inherit;
}
.er-timer {
  font-size: 13px; font-weight: 700; color: #fbbf24;
  font-variant-numeric: tabular-nums; padding: 2px 8px;
  background: rgba(251,191,36,.1); border-radius: 4px;
}
.er-timer.er-timer-danger { color: #f87171; background: rgba(248,113,113,.1); animation: er-blink 1s infinite; }
@keyframes er-blink { 50% { opacity: .3; } }
.er-counter {
  margin-left: auto; font-size: 13px; color: #fff; font-weight: 600;
  white-space: nowrap; letter-spacing: .3px;
  padding: 3px 10px; background: rgba(49,130,206,.3); border-radius: 6px;
}

/* Timer bar */
.er-timer-bar {
  height: 4px; background: rgba(255,255,255,.1); flex-shrink: 0;
  position: relative; width: 100%;
}
.er-timer-bar-fill {
  height: 100%; width: 0%; border-radius: 0 2px 2px 0;
  background: #38bdf8; /* default sky blue — overridden by JS */
  transition: width .3s linear, background .5s;
}
.er-timer-bar-fill.er-timer-warning { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.er-timer-bar-fill.er-timer-danger { background: #ef4444; }

/* Feedback banner */
.er-feedback {
  padding: 10px 16px; border-radius: 8px; font-size: 14px;
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.er-feedback i { font-size: 16px; flex-shrink: 0; }
.er-feedback-info { background: #1e3a5f; color: #93c5fd; }
.er-feedback-success { background: #14532d; color: #86efac; }
.er-feedback-error { background: #7f1d1d; color: #fca5a5; }
.er-feedback-partial { background: #78350f; color: #fcd34d; }

/* Question card */
/* ── Question card — white card on dark viewer ── */
.er-card {
  position: relative; background: #fff; border-radius: 14px; padding: 20px 24px;
  max-width: 940px; margin: 0 auto; width: 100%;
  box-shadow: 0 8px 40px rgba(0,0,0,.2), 0 1px 0 rgba(255,255,255,.08);
  color: #2d3748;
}
.er-card label, .er-card span, .er-card p, .er-card div,
.er-card h1, .er-card h2, .er-card h3, .er-card h4, .er-card h5 { color: inherit; }

/* Exercise title inside card */
.er-card-title {
  font-size: 14px; font-weight: 300; color: #8c8c9c; text-align: center;
  padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid #eaecf0;
}

/* Document texte (support text) */
.er-doc-texte {
  font-size: 13px; line-height: 1.7; color: #4a5568;
  padding: 14px 18px; background: #fffff0; border-radius: 10px;
  border: 1px solid #fefcbf; border-left: 3px solid #d69e2e;
}
.er-doc-texte p { margin: 0 0 12px; line-height: 1.7; }
.er-doc-texte b, .er-doc-texte strong { color: #1a1a2e; }
.er-doc-texte .document_titre_article { font-weight: 700; font-size: 14px; color: #1a1a2e; margin-bottom: 8px; }
.er-doc-texte .document_source_article { font-style: italic; color: #6b7280; font-size: 12px; margin-top: 8px; }

.er-consigne {
  font-size: 15px; line-height: 1.6; color: #2b6cb0; font-weight: 600;
  margin-bottom: 14px; padding: 10px 14px;
  background: linear-gradient(135deg, #ebf8ff, #f0fff4); border-radius: 8px;
  border-left: 3px solid #3182ce;
}
.er-consigne p { margin: 0 0 8px; }

/* Body: media (left) + answers (right) */
.er-body { display: flex; flex-direction: column; gap: 12px; }
.er-body-with-media { flex-direction: row; align-items: flex-start; gap: 18px; }
.er-media-panel { flex: 0 0 45%; max-width: 45%; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 60vh; }
.er-answer-panel { flex: 1; min-width: 0; }

/* Word search: landscape → grid left, consigne+words right */
@media (orientation: landscape) and (min-width: 768px) {
  .er-body-wordsearch {
    flex-direction: row;
    align-items: flex-start;
  }
  .er-body-wordsearch .er-answer-wrap {
    flex: 0 0 auto;
  }
  .er-body-wordsearch .er-ws-side {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
}
.er-image-wrap { }
.er-image { width: 100%; max-height: 50vh; object-fit: contain; border-radius: 10px; box-shadow: 0 2px 16px rgba(0,0,0,.12); }

/* Editable fields */
.er-card input[type="text"], .er-card input[type="number"], .er-card textarea, .er-card select {
  background: #fff; color: #1a1a1a; border: 1px solid #d0d5dd; border-radius: 6px;
}
.er-card input[type="text"].ev-trous-input {
  background: transparent; border: none; border-bottom: 2px dashed #b0c4de;
  border-radius: 0; font-size: 14px; padding: 2px 4px; margin: 0 3px;
  text-align: left; min-width: 28px; color: #2563eb; font-weight: 600;
}
.er-card input[type="text"].ev-trous-input:hover {
  background: #f8fafc; border-bottom-style: solid; border-bottom-color: #93c5fd;
}
.er-card input[type="text"].ev-trous-input:focus {
  background: #eff6ff; border-bottom: 2px solid #2563eb; box-shadow: none; outline: none;
}
.er-card input[type="text"].ev-trous-input::placeholder { color: #c5d5e8; font-weight: 400; }
.er-card input[type="text"]:focus, .er-card input[type="number"]:focus, .er-card textarea:focus, .er-card select:focus {
  border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}
.er-card input::placeholder, .er-card textarea::placeholder { color: #9ca3af; }

/* ── QCM / QCU / VF choices — runner custom renderer ── */
.er-choices { display: flex; flex-direction: column; gap: 8px; }
.er-choices-hint {
  font-size: 12px; color: #6b7280; font-style: italic; margin-bottom: 4px;
}
.er-choices-list { display: flex; flex-direction: column; gap: 6px; }

.er-choice-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: #fff; border: 1.5px solid #e5e7eb; border-radius: 10px;
  cursor: pointer; transition: all .18s; user-select: none;
}
.er-choice-item:hover {
  background: #ebf8ff; border-color: #63b3ed;
  transform: translateX(3px); box-shadow: 0 2px 8px rgba(49,130,206,.08);
}
.er-choice-item.er-choice-selected {
  background: #ebf8ff; border-color: #3182ce;
  box-shadow: 0 0 0 2px rgba(49,130,206,.2), 0 2px 8px rgba(49,130,206,.1);
}

/* Circular indicator */
.er-choice-indicator {
  width: 26px; height: 26px; min-width: 26px; border: 2px solid #bee3f8;
  border-radius: 50%; background: #ebf8ff; display: flex; align-items: center;
  justify-content: center; transition: all .18s; flex-shrink: 0;
}
.er-choice-check-icon { color: transparent; font-size: 12px; transition: color .15s; }
.er-choice-item.er-choice-selected .er-choice-indicator {
  border-color: #3182ce; background: #3182ce;
  box-shadow: 0 2px 6px rgba(49,130,206,.3);
}
.er-choice-item.er-choice-selected .er-choice-check-icon { color: #fff; }

/* Label */
.er-choice-label { font-size: 14px; color: #2d3748; font-weight: 500; line-height: 1.4; }

/* Old ev- classes fallback in runner card */
.er-answer-wrap .ev-q-choices { gap: 10px; }
.er-answer-wrap .ev-q-choice {
  background: #fff; border: 1.5px solid #e0e4ea; color: #333; border-radius: 10px;
  padding: 14px 18px; transition: all .15s; cursor: pointer;
}

/* Trous / Repérage texte */
/* Trous in runner card */
.er-card .ev-trous-wrap { color: #333; line-height: 2.4; }
.er-card .ev-trous-phrase { font-size: 15px; color: #1a1a2e; }
.er-card .ev-trous-answer-preview {
  display: inline-block; background: #dbeafe; color: #1d4ed8; padding: 2px 10px;
  border-radius: 6px; font-weight: 600; margin: 0 3px; border: 1px solid #93c5fd;
}
.er-card .ev-trous-result { font-size: 16px; padding: 3px 10px; border-radius: 6px; font-weight: 600; }
.er-card .ev-trous-correct { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.er-card .ev-trous-wrong { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; text-decoration: line-through; }
.er-card .ev-trous-correction {
  display: inline-block; padding: 3px 10px; margin: 0 3px; color: #166534;
  font-weight: 700; font-size: 15px; background: #f0fdf4; border-radius: 6px; border: 1px dashed #86efac;
}

/* Free text (Tiptap) */
.er-card .ev-free-wrap textarea, .er-card .ev-free-wrap .tiptap, .er-card .ev-free-wrap .ProseMirror {
  background: #fff; color: #1a1a1a; border-color: #d0d5dd;
}

/* Classement (ordering) */
.er-card .ev-cl-dropzone { background: #f8faff; border-color: #3b82f6; }
.er-card .ev-cl-slot { background: #fff; border-color: #d0d5dd; color: #1a1a1a; }
.er-card .ev-cl-slot-filled { border-color: #3b82f6; background: #eff6ff; }
.er-card .ev-cl-slot-placeholder { color: #bbb; }
.er-card .ev-cl-srczone { background: #f8f9fa; border-color: #d0d5dd; }
.er-card .ev-cl-pill { background: #fff; border-color: #d0d5dd; color: #1a1a1a; }
.er-card .ev-cl-pill:hover { border-color: #3b82f6; }
.er-card .ev-cl-label { color: #6b7280; }
.er-card .ev-cl-done { color: #16a34a; }

/* Mots croisés (crossword) */
.er-card .ev-cw-grid { border-color: #d0d5dd; }
.er-card .ev-cw-cell { border-color: #e0e4ea; }
.er-card .ev-cw-cell-blank { background: #1e293b; }
.er-card .ev-cw-cell-letter { background: #fff; }
.er-card .ev-cw-cell-highlight { background: #dbeafe; }
.er-card .ev-cw-input { color: #1a1a1a; caret-color: #2563eb; }
.er-card .ev-cw-input:focus { background: #bfdbfe; }
.er-card .ev-cw-cell-num { color: #3b82f6; }
.er-card .ev-cw-clues-title { color: #333; }
.er-card .ev-cw-clue-line { color: #555; }
.er-card .ev-cw-clue-line:hover { background: #f0f6ff; }
.er-card .ev-cw-clue-active { background: #dbeafe; color: #1e3a5f; }

/* Mots mêlés (word search) */
.er-card .ev-ws-grid { border-color: #d0d5dd; }
.er-card .ev-ws-cell { background: #fff; color: #1a1a1a; border-color: #e0e0e0; }
.er-card .ev-ws-cell:hover { background: #f0f6ff; }
.er-card .ev-ws-list-title { color: #333; }
.er-card .ev-ws-pill { background: #f1f5f9; color: #333; border: 1px solid #d0d5dd; }
.er-card .ev-ws-progress { color: #6b7280; border-color: #e0e4ea; }

/* Surlignage (highlight) */
.er-card .ev-hl-info { color: #6b7280; }
.er-card .ev-hl-text { background: #fff; border-color: #d0d5dd; color: #1a1a1a; }
.er-card .ev-hl-text::selection { background: #fef08a; }
.er-card .ev-hl-text *::selection { background: #fef08a; }
.er-card .ev-hl-found { background: #bbf7d0; color: #166534; }
.er-card .ev-hl-progress { color: #6b7280; }

/* Repérage image */
.er-card .ev-ri-canvas {
  background: #f8f9fa; border-color: #d0d5dd;
  max-height: 55vh; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.er-card .ev-ri-canvas-inner { max-height: 55vh; }
.er-card .ev-ri-img {
  max-height: 55vh; width: auto; max-width: 100%; object-fit: contain;
}
.er-card .ev-ri-list { background: #f8f9fa; border-color: #d0d5dd; }
.er-card .ev-ri-list-title { color: #333; }
.er-card .ev-ri-list-item { color: #555; }
.er-card .ev-ri-list-item.found { color: #111; }
.er-card .ev-ri-progress { color: #888; border-color: #e0e4ea; }

/* Prononciation */
.er-card .ev-pron-words { color: #333; }
.er-card .ev-pron-word { color: #555; }
.er-card .ev-pron-word.correct { color: #16a34a; }

/* Expression orale */
.er-card .ev-oral-wrap { color: #333; }
.er-card .ev-oral-timer { color: #6b7280; }
.er-card .ev-oral-bigbtn { border-color: #d0d5dd; }

/* Info boxes */
.er-card .ev-hl-info i { color: #f59e0b; }

/* Footer */
.er-footer { display: flex; align-items: center; gap: 10px; width: 100%; }
.er-badge {
  font-size: 12px; font-weight: 600; padding: 5px 14px; border-radius: 14px;
  white-space: nowrap; letter-spacing: .3px;
}
.er-badge-default { background: rgba(255,255,255,.2); color: #e2e8f0; }
.er-badge-qcm { background: #805ad5; color: #fff; }
.er-badge-qcu { background: #319795; color: #fff; }
.er-badge-vf { background: #38a169; color: #fff; }
.er-badge-free { background: #dd6b20; color: #fff; }
.er-badge-trous { background: #d53f8c; color: #fff; }
.er-badge-reperage { background: #e53e3e; color: #fff; }
.er-badge-highlight { background: #d69e2e; color: #fff; }
.er-badge-classement { background: #3182ce; color: #fff; }
.er-badge-crossword { background: #38b2ac; color: #fff; }
.er-badge-wordsearch { background: #c05621; color: #fff; }
.er-badge-prononciation { background: #6b46c1; color: #fff; }
.er-badge-oral { background: #b83280; color: #fff; }
.er-badge-repimage { background: #c53030; color: #fff; }

.er-validate {
  font-weight: 600; background: #38a169; border-color: #38a169;
  color: #fff; padding: 7px 20px; border-radius: 8px; font-size: 13px;
}
.er-validate:hover { background: #2f855a; }
.er-btn-label { }

/* Completion screen */
.er-done {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 60px 24px; text-align: center;
}
.er-done-icon { font-size: 64px; color: #34d399; }
.er-done-title { font-size: 24px; font-weight: 700; color: #f1f5f9; margin-bottom: 8px; }
.er-done-sub { font-size: 15px; color: #94a3b8; line-height: 1.5; }
.er-done-info {
  font-size: 13px; color: #94a3b8; margin-top: 20px; max-width: 400px;
  text-align: center; line-height: 1.6; background: rgba(255,255,255,.05);
  padding: 14px 18px; border-radius: 8px; border: 1px solid #334155;
}
.er-done-info i { margin-right: 6px; color: #fbbf24; }
.er-done-info strong { color: #fbbf24; }

/* Startup sync overlay */
.er-sync-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 99998; background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: er-sync-fade-in .3s;
}
@keyframes er-sync-fade-in { from { opacity: 0; } to { opacity: 1; } }
.er-sync-box {
  background: #1e293b; border-radius: 16px; padding: 32px 36px;
  max-width: 440px; width: 90%; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.er-sync-icon { font-size: 40px; color: #60a5fa; margin-bottom: 12px; }
.er-sync-title { font-size: 18px; font-weight: 700; color: #f1f5f9; margin-bottom: 6px; }
.er-sync-desc { font-size: 13px; color: #94a3b8; margin-bottom: 12px; }
.er-sync-list { text-align: left; margin-bottom: 16px; }
.er-sync-item {
  font-size: 13px; color: #cbd5e1; padding: 6px 10px;
  background: rgba(255,255,255,.05); border-radius: 6px; margin-bottom: 4px;
}
.er-sync-item i { color: #60a5fa; margin-right: 6px; width: 14px; }
.er-sync-status { font-size: 14px; color: #94a3b8; margin-bottom: 4px; }
.er-sync-box .fsv-nav-btn { margin: 0 auto; }

/* Answer status indicator */
.er-answer-status {
  padding: 6px 14px; border-radius: 6px; font-size: 12px;
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.er-answer-status i { font-size: 13px; }
.er-status-synced { background: rgba(5,150,105,.12); color: #34d399; }
.er-status-local { background: rgba(217,119,6,.12); color: #fbbf24; }

/* Image zoom overlay */
.er-zoom-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 99999; background: rgba(0,0,0,.9); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out; animation: er-zoom-in .2s;
}
@keyframes er-zoom-in { from { opacity: 0; } to { opacity: 1; } }
.er-zoom-img {
  max-width: 92vw; max-height: 92vh; object-fit: contain;
  border-radius: 6px; box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
.er-zoom-close {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: none; color: #fff;
  font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.er-zoom-close:hover { background: rgba(255,255,255,.3); }

/* Offline / online banners */
.er-offline-banner {
  padding: 8px 14px; background: #78350f; color: #fcd34d; border-radius: 6px;
  font-size: 13px; display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  animation: er-banner-in .3s;
}
.er-offline-banner i { font-size: 14px; }
.er-online-banner {
  padding: 8px 14px; background: #14532d; color: #86efac; border-radius: 6px;
  font-size: 13px; display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  animation: er-banner-in .3s;
}
.er-online-banner i { font-size: 14px; }
@keyframes er-banner-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Toast — non-blocking save confirmation */
.er-toast {
  position: fixed; top: 56px; right: 20px;
  background: rgba(22,101,52,.9); color: #fff; font-size: 11px; font-weight: 500;
  padding: 5px 14px; border-radius: 16px; z-index: 99999;
  animation: er-toast-in .2s ease-out; pointer-events: none;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
}
.er-toast i { margin-right: 4px; font-size: 10px; }
.er-toast-out { opacity: 0; transition: opacity .3s; }
@keyframes er-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Export button */
.er-export-btn { font-size: 12px; color: #94a3b8; border-color: #475569; }
.er-export-btn:hover { color: #e2e8f0; border-color: #64748b; }
.er-export-btn i { margin-right: 4px; }

/* Import modal */
.er-import-dropzone {
  border: 2px dashed #d0d5dd; border-radius: 10px; padding: 28px 16px;
  text-align: center; color: #888; font-size: 13px; line-height: 1.6;
  cursor: pointer; transition: all .15s; margin: 10px 0;
}
.er-import-dropzone:hover, .er-import-dropzone.dragover {
  border-color: #4f46e5; background: #f5f3ff; color: #4f46e5;
}
.er-import-dropzone i { font-size: 28px; margin-bottom: 6px; display: block; color: #aaa; }
.er-import-dropzone:hover i, .er-import-dropzone.dragover i { color: #4f46e5; }
.er-import-status { font-size: 13px; color: #555; padding: 6px 0; line-height: 1.5; }

/* ── Mobile responsive ──────────────────────────────────── */
/* ── ExerciseRunner — Mobile (< 700px) ── */
@media (max-width: 700px) {
  .er-body-with-media { flex-direction: column; gap: 8px; }
  .er-media-panel { flex: none; max-width: 100%; max-height: none; overflow-y: visible; }
  .er-image-wrap { max-width: 100%; }
  .er-image { max-height: 30vh; }
  .er-btn-label { display: none; }
  .er-footer { gap: 6px; }
  .er-badge { font-size: 10px; padding: 2px 6px; }
  .er-counter { font-size: 12px; }
  .er-title { font-size: 13px; max-width: 40vw; }
}

/* ── ExerciseRunner — Mobile Portrait: optimized ── */
@media (max-width: 600px) {
  /* Card: full width, no margins, minimal padding, strict containment */
  .er-card {
    padding: 8px 6px; border-radius: 0; max-width: 100%;
    margin: 0; box-shadow: none; width: 100%;
    overflow-x: hidden; word-break: break-word;
  }

  /* Body & panels: strict width containment */
  .er-body { max-width: 100%; overflow-x: hidden; gap: 6px; }
  .er-answer-panel { max-width: 100%; overflow-x: hidden; min-width: 0; }
  .er-media-panel { max-width: 100%; overflow: hidden; max-height: none; }
  .er-answer-wrap { max-width: 100%; overflow-x: hidden; }

  /* Timer bar */
  .er-timer-bar { margin-bottom: 4px; }

  /* Consigne */
  .er-consigne { font-size: 13px; margin-bottom: 6px; line-height: 1.4; }

  /* Document texte: collapsed by default, no independent scroll */
  .er-doc-texte {
    font-size: 12px; padding: 8px; line-height: 1.5;
    max-height: 20vh; overflow-y: auto; margin-bottom: 0;
  }
  .er-doc-texte p { margin: 0 0 6px; }

  /* Image: limited height */
  .er-image { max-height: 25vh; border-radius: 6px; }

  /* ── QCM/QCU/VF — touch-friendly ── */
  .er-choices-list { gap: 5px; }
  .er-choices-hint { font-size: 10px; margin-bottom: 2px; }
  .er-choice-item {
    padding: 10px 10px; gap: 10px; border-radius: 8px;
    min-height: 40px; /* thumb-friendly tap target */
  }
  .er-choice-indicator { width: 24px; height: 24px; min-width: 24px; border-width: 2px; }
  .er-choice-check-icon { font-size: 11px; }
  .er-choice-label { font-size: 13px; }

  /* ── Trous ── */
  .er-card input[type="text"].ev-trous-input { font-size: 13px; padding: 2px 3px; }
  .er-card .ev-trous-phrase { font-size: 13px; line-height: 2.2; }

  /* ── Grids (crossword, wordsearch) — horizontal scroll ── */
  .er-card .ev-cw-row,
  .er-card .ev-ws-row { flex-direction: column; gap: 8px; }
  .er-card .ev-cw-grid,
  .er-card .ev-ws-grid {
    overflow-x: auto; max-width: 100%; display: block;
    -webkit-overflow-scrolling: touch; padding-bottom: 4px;
  }
  .er-card .ev-cw-cell,
  .er-card .ev-ws-cell { width: 26px; height: 26px; font-size: 12px; }
  .er-card .ev-cw-input { font-size: 12px; }
  .er-card .ev-cw-clues { max-height: 150px; font-size: 12px; }

  /* ── Classement ── */
  .er-card .ev-cl-slot { padding: 4px 8px; min-width: 36px; font-size: 12px; }
  .er-card .ev-cl-pill { padding: 5px 10px; font-size: 12px; min-height: 32px; }
  .er-card .ev-cl-dropzone,
  .er-card .ev-cl-srczone { padding: 6px; gap: 5px; }
  .er-card .ev-cl-label { font-size: 11px; }

  /* ── Highlight ── */
  .er-card .ev-hl-text { font-size: 13px; padding: 8px; }

  /* ── Repérage image ── */
  .er-card .ev-ri-row { flex-direction: column; gap: 8px; }
  .er-card .ev-ri-canvas { max-width: 100%; overflow-x: auto; }
  .er-card .ev-ri-list { width: 100%; flex-direction: row; flex-wrap: wrap; gap: 4px; }

  /* ── Oral / Prononciation ── */
  .er-card .ev-oral-layout { flex-direction: column; gap: 10px; }
  .er-card .ev-oral-bigbtn { width: 56px; height: 56px; font-size: 20px; }
  .er-card .ev-pron-word { font-size: 14px; padding: 3px 6px; }

  /* ── Free text ── */
  .er-card .ev-free-wrap textarea,
  .er-card .ev-free-wrap .ProseMirror { font-size: 14px; min-height: 80px; }

  /* ── Answer status toast ── */
  .er-answer-status { font-size: 11px; padding: 4px 8px; margin-bottom: 4px; }
}

/* ── Competence chip picker (question detail) ─────────────────────── */
.ee-comp-row {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 0 6px; flex-wrap: wrap;
}
.ee-comp-chips {
  display: flex; align-items: center; gap: 3px; flex-wrap: wrap;
}
.ee-comp-sep {
  color: #aaa; font-size: 11px; margin: 0 1px;
}
.ee-comp-chip {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 11px; line-height: 1;
  padding: 3px 7px; border-radius: 3px;
  max-width: 200px; white-space: nowrap;
}
.ee-comp-chip-label {
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.ee-comp-chip.is-clickable { cursor: pointer; transition: filter 0.12s; }
.ee-comp-chip.is-clickable:hover { filter: brightness(0.92); }
.ee-comp-chip-1 { background: #e3f0fa; color: #1565c0; }
.ee-comp-chip-2 { background: #e8f5e9; color: #2e7d32; }
.ee-comp-chip-3 { background: #fff3e0; color: #e65100; }
/* Stable wrapper for picker + navigate button */
.ee-comp-section { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ee-comp-picker-wrap { display: contents; }
/* Empty pill — no competences defined, links to CompetencePanel */
.ee-comp-chip-empty {
  background: #f0f0f0; color: #999; cursor: pointer;
  transition: background 0.15s, color 0.15s;
  gap: 4px;
}
.ee-comp-chip-empty:hover { background: #e3f0fa; color: #1565c0; }
/* Round "+" button to navigate to CompetencePanel (when competences exist) */
.ee-comp-add-btn {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #ccc;
  background: none; color: #aaa; font-size: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; transition: border-color 0.15s, color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.ee-comp-add-btn:hover { border-color: #1565c0; color: #1565c0; background: #e3f0fa; }
/* Validation modal */
.ee-valid-modal { padding: 4px 0; }
.ee-valid-label { font-weight: 600; margin: 0 0 8px; }
.ee-valid-errors { margin: 0; padding-left: 20px; color: #c62828; font-size: 13px; }
.ee-valid-errors li { margin-bottom: 4px; }
/* Global validation: clickable question links */
.ee-valid-question-row { margin-bottom: 10px; }
.ee-valid-question-row:last-child { margin-bottom: 0; }
.ee-valid-question-link { font-weight: 600; color: #1565c0; text-decoration: none; }
.ee-valid-question-link:hover { text-decoration: underline; }
.ee-valid-question-row .ee-valid-errors { margin-top: 2px; }
/* Field error highlight */
.ee-field-error {
  outline: 2px solid #e53935 !important;
  outline-offset: 1px;
  border-radius: 4px;
  animation: ee-field-pulse 1.5s ease-in-out 2;
}
@keyframes ee-field-pulse {
  0%, 100% { outline-color: #e53935; }
  50% { outline-color: #ff8a80; }
}
/* × inside last chip */
.ee-comp-chip-x {
  cursor: pointer; opacity: 0.5; font-size: 13px; font-weight: 700;
  line-height: 1; margin-left: 2px; transition: opacity 0.12s; flex-shrink: 0;
}
.ee-comp-chip:hover .ee-comp-chip-x { opacity: 1; }
.ee-comp-chip-x:hover { color: #c62828; }
.ee-comp-clear {
  border: none; background: none; color: #999; font-size: 11px;
  cursor: pointer; padding: 2px 4px; border-radius: 3px;
  line-height: 1;
}
.ee-comp-clear:hover { color: #e53935; background: #fde8e8; }
.ee-comp-pick {
  border: 1px dashed #ccc; background: none; color: #666;
  font-size: 11px; padding: 3px 8px; border-radius: 3px;
  cursor: pointer; white-space: nowrap; line-height: 1;
}
.ee-comp-pick:hover { border-color: #30b0f3; color: #30b0f3; }
.ee-comp-pick i { margin-right: 3px; }
.ee-comp-none { color: #bbb; font-size: 11px; }

/* ── Drill-down dropdown (single column) ──────────────────────────── */
.ee-comp-dd {
  z-index: 9000; background: #fff;
  border: 1px solid #dde1e7; border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  display: flex; flex-direction: column;
  width: min(300px, 85vw); max-height: min(320px, 60vh);
}
/* Breadcrumb nav */
.ee-comp-dd-nav {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 10px 6px; border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0; flex-wrap: wrap;
}
.ee-comp-dd-nav-sep { color: #bbb; font-size: 10px; }
.ee-comp-dd-nav-item {
  font-size: 11px; color: #30b0f3; cursor: pointer;
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ee-comp-dd-nav-item:hover { text-decoration: underline; }
.ee-comp-dd-nav-item.is-current {
  color: #333; font-weight: 600; cursor: default;
}
.ee-comp-dd-nav-item.is-current:hover { text-decoration: none; }
/* Items list */
.ee-comp-dd-list {
  flex: 1; overflow-y: auto; padding: 2px 0; min-height: 0;
}
.ee-comp-dd-list::-webkit-scrollbar { width: 4px; }
.ee-comp-dd-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }
.ee-comp-dd-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; font-size: 12px; color: #333;
  cursor: pointer; border-left: 2px solid transparent;
  line-height: 1.3;
}
.ee-comp-dd-item:hover { background: #f0f6fb; }
.ee-comp-dd-item.is-selected {
  background: #e3f0fa; border-left-color: #30b0f3; font-weight: 600;
}
.ee-comp-dd-item-text {
  flex: 1; min-width: 0; word-break: break-word;
}
.ee-comp-dd-arrow {
  flex-shrink: 0; color: #bbb; font-size: 10px;
}
.ee-comp-dd-item:hover .ee-comp-dd-arrow { color: #30b0f3; }
.ee-comp-dd-empty {
  padding: 16px 10px; font-size: 11px; color: #aaa; text-align: center; font-style: italic;
}
.ee-comp-dd-foot {
  display: flex; justify-content: flex-end; padding: 6px 10px;
  border-top: 1px solid #eee; flex-shrink: 0;
}

/* Responsive */
@media (max-width: 700px) {
  .ee-split { flex-direction: column; }
  .ee-panel-left { width: 100%; max-width: none; border-right: none; border-bottom: 1px solid #e0e0e0; max-height: 200px; }
  .ee-card-body { flex-direction: column; }
  .ee-media-zone { width: 100%; }
  .ee-comp-chip { max-width: 120px; }
}
