/* CollabQuiz - Creation : questions, banques, imports, exports, Nuage et attributions.
 * Ordre des feuilles : style, creator, content, game, results, autonomous.
 * Conserver les surcharges et les media queries dans leur ordre relatif.
 */


.question-editor {
  display: grid;
  gap: 14px;
}

.question-card {
  box-shadow: none;
  border: 1px solid #e2e8f0;
}

/* ===== Banque compacte ===== */
.bank-panel {
  padding: 16px;
}

.bank-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.bank-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.bank-title h2 {
  margin: 0;
  font-size: 1.2rem;
}

.bank-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #1e40af;
  color: white;
  font-weight: 900;
  box-shadow: 0 8px 18px #1e40af35;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  margin-left: 4px;
  border-radius: 999px;
  background: #2563eb;
  color: white;
  font-size: .85rem;
}

.bank-actions {
  margin-left: auto;
}

.export-menu {
  position: relative;
}

.export-menu > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.export-menu > summary::-webkit-details-marker {
  display: none;
}

.export-menu[open] > summary {
  background: #dbeafe;
  border-color: #60a5fa;
}

.export-menu-options {
  position: absolute;
  z-index: 25;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  min-width: 175px;
  padding: 6px;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
}

.export-menu-options .btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  white-space: nowrap;
}

.qcm-pdf-workspace {
  display: grid;
  grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.qcm-pdf-settings {
  min-width: 0;
}

.qcm-pdf-options,
.qcm-pdf-checkboxes {
  display: grid;
  gap: 10px;
}

.qcm-pdf-options {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.qcm-layout-options {
  margin-top: 16px;
}

.qcm-pdf-options label,
.qcm-pdf-checkboxes label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  cursor: pointer;
}

.qcm-pdf-options input,
.qcm-pdf-checkboxes input {
  width: auto;
  margin-top: .2em;
  flex: 0 0 auto;
}

.qcm-pdf-checkboxes {
  margin-top: 16px;
}

#qcmPdfStatus {
  min-height: 1.4em;
  margin: 14px 0 0;
}

.qcm-pdf-settings .modal-buttons {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.qcm-pdf-preview {
  min-width: 0;
}

.qcm-pdf-preview-paper {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #e2e8f0;
}

#qcmPdfPreviewFrame {
  display: block;
  width: 100%;
  height: min(70vh, 760px);
  min-height: 640px;
  border: 0;
  background: white;
}

#qcmPdfPreviewMessage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 20px;
  text-align: center;
  background: rgba(241, 245, 249, .94);
}

#qcmPdfPreviewMessage.hidden {
  display: none;
}

@media(max-width:900px) {
  .qcm-pdf-workspace {
    grid-template-columns: 1fr;
  }

  .qcm-pdf-preview-paper,
  #qcmPdfPreviewFrame {
    min-height: 520px;
  }

  #qcmPdfPreviewFrame {
    height: 68vh;
  }
}

.bank-panel .actions {
  margin-bottom: 0;
}

.bank-panel #bankHint {
  margin: 6px 0 4px;
}

.active-bank-name,
.active-bank-save-status {
  display: inline-block;
  max-width: min(32vw, 280px);
  overflow: hidden;
  color: #64748b;
  font-size: .78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-bank-name {
  padding-left: 10px;
  border-left: 1px solid #cbd5e1;
}

.active-bank-save-status {
  font-weight: 500;
}

.working-copy-notice {
  margin: 4px 0 0;
  color: #64748b;
}

.local-storage-notice {
  padding: 12px 14px;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
}

.bank-library-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.bank-library-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid #dbe5f4;
  border-left: 8px solid #2563eb;
  border-radius: 16px;
  background: #f8fafc;
}

.bank-select-control {
  align-self: stretch;
  display: flex;
  align-items: flex-start;
  padding-top: 3px;
  cursor: pointer;
}

.bank-select-control input {
  width: 20px;
  height: 20px;
  margin: 0;
}

.bank-library-card h3,
.bank-library-card p {
  margin: 0;
}

.bank-library-card-meta {
  display: grid;
  gap: 5px;
}

.bank-provenance {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 0.84rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.bank-provenance a { text-decoration: underline; }

.bank-storage-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.bank-origin-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: .76rem;
  font-weight: 700;
}

.bank-origin-badge.cloud {
  background: #dbeafe;
  color: #1e3a8a;
}

.bank-sync-state {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 700;
}

.bank-sync-state.pending {
  background: #fff3cd;
  color: #7a4b00;
}

.bank-sync-state.syncing {
  background: #e0f2fe;
  color: #075985;
}

.bank-sync-state.up-to-date {
  background: #dcfce7;
  color: #166534;
}

.bank-sync-state.unavailable,
.bank-sync-state.error,
.bank-sync-state.conflict {
  background: #f1f5f9;
  color: #64748b;
}

/* Actions sur une ligne dédiée : les métadonnées gardent toute la largeur. */
.bank-library-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}
.bank-library-card-actions {
  grid-column: 2;
  justify-content: flex-start;
  min-width: 0;
}
.bank-library-card-actions > button,
.bank-library-card-actions > details > summary {
  white-space: nowrap;
}
.bank-library-more-menu .export-menu-options .danger {
  color: #991b1b;
}

.bank-library-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.bank-library-edit-actions { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.bank-library-edit-actions > button { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }

.collections-section {
  margin: 22px 0 10px;
  padding-top: 18px;
  border-top: 1px solid #dbe5f4;
}

.collections-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.collections-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.collection-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}

.collection-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid #dbe5f4;
  border-radius: 12px;
  background: #f8fafc;
}

.collection-filter.active {
  border-color: #1e40af;
  background: #1e40af;
  color: white;
}

.collection-filter > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.collection-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: .78rem;
}

.collection-filter.active .collection-count {
  background: rgba(255, 255, 255, .22);
  color: white;
}

.bank-collection-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 3px 0;
}

.bank-collection-tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e3a8a;
  font-size: .76rem;
  font-weight: 700;
}

.bank-collection-tag.unclassified {
  background: #e2e8f0;
  color: #475569;
}

.bank-bulk-actions {
  position: sticky;
  top: 10px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid #93c5fd;
  border-radius: 14px;
  background: #eff6ff;
  box-shadow: 0 8px 24px #1e40af18;
}

.save-bank-conflict {
  padding: 12px 14px;
  border: 1px solid #f59e0b;
  border-radius: 12px;
  background: #fffbeb;
  color: #78350f;
}

.save-bank-conflict p {
  margin: 0;
}

.export-format-choices {
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #dbe5f4;
  border-radius: 14px;
}

.export-format-choices label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}

.export-warning {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7ed;
  color: #9a3412;
}

.backup-status {
  margin: 7px 0 0;
}

.backup-status:empty {
  display: none;
}

.library-transfer {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #dbe4ee;
  border-radius: 14px;
  background: #f8fafc;
}

.library-transfer > summary {
  cursor: pointer;
  font-weight: 700;
}

.library-transfer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.library-transfer-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
}

.library-transfer-group h3 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 1rem;
}

.transfer-destination {
  position: relative;
}

.transfer-destination > summary {
  display: block;
  list-style: none;
  text-align: center;
}

.transfer-destination > summary::-webkit-details-marker {
  display: none;
}

.transfer-options {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.transfer-options .btn,
.transfer-main-action {
  width: 100%;
}

.nuage-status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #e2e8f0;
}

.nuage-status {
  margin: 0;
  color: #475569;
}

.nuage-files-list {
  display: grid;
  gap: 8px;
}

.nuage-bank-list {
  display: grid;
  gap: 5px;
  margin: 8px 0 14px;
}

.nuage-bank-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  cursor: pointer;
}

.nuage-bank-choice:hover,
.nuage-bank-choice:focus-within {
  border-color: #60a5fa;
  background: #f8fbff;
}

.nuage-bank-choice:has(input:checked) {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 1px #2563eb inset;
}

.nuage-bank-choice input {
  margin: 0;
}

.nuage-bank-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nuage-bank-meta {
  color: #64748b;
  font-size: .86rem;
  text-align: right;
}

.nuage-archive-summary {
  margin: 6px 0 12px;
  font-weight: 600;
}

.nuage-restore-all {
  width: 100%;
}

.nuage-bank-prompt {
  margin: 0;
}

.nuage-choice-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  color: #64748b;
  font-size: .84rem;
}

.nuage-choice-separator::before,
.nuage-choice-separator::after {
  content: "";
  flex: 1;
  border-top: 1px solid #cbd5e1;
}

.nuage-file {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
}

.nuage-file span {
  color: #64748b;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .library-transfer-grid {
    grid-template-columns: 1fr;
  }

  .library-transfer-group {
    grid-template-columns: 1fr;
  }

  .nuage-status-row {
    align-items: flex-start;
  }

  .nuage-bank-choice {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .nuage-bank-meta {
    grid-column: 2;
    text-align: left;
  }

  .nuage-file {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

.restore-backup-summary {
  margin: 14px 0 18px;
  padding: 14px;
  border-radius: 14px;
  background: #eff6ff;
  color: #1e3a8a;
}

.restore-backup-summary p {
  margin: 4px 0;
}

.restore-conflicts {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 14px;
  border: 1px solid #dbe5f4;
  border-radius: 14px;
}

.restore-conflicts legend {
  padding: 0 6px;
  font-weight: 800;
}

.restore-conflicts label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
}

.restore-conflicts input {
  width: auto;
  margin: 0;
}

.collection-choice-list {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.collection-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #dbe5f4;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
}

.collection-choice input {
  width: 20px;
  height: 20px;
  margin: 0;
}

.collection-choice small {
  color: #64748b;
}

.question-table-wrap {
  overflow: auto;
  border: 1px solid #dbe5f4;
  border-radius: 14px;
  margin-top: 12px;
}

.question-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  font-size: .88rem;
}

.question-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f6f8fc;
  color: #475569;
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .03em;
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid #dbe5f4;
}

.question-table td {
  padding: 7px 6px;
  border-bottom: 1px solid #e8eef8;
  vertical-align: middle;
}

.question-table tr:last-child td {
  border-bottom: 0;
}

.question-image-editor {
  display: grid;
  gap: 7px;
  min-width: 220px;
  margin-top: 6px;
}

.add-question-image-btn {
  justify-self: start;
}

.question-image-editor-preview {
  display: grid;
  place-items: center;
  min-height: 100px;
  max-height: 220px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid #dbe5f4;
  border-radius: 12px;
  background: #f8fafc;
}

.question-image-editor-preview img {
  max-height: 202px;
}

.question-image-alt-label {
  margin-top: 2px;
  color: #475569;
  font-size: .78rem;
  font-weight: 700;
}

.question-image-meta {
  margin: -7px 0 0;
  font-size: .75rem;
}

.image-quiz-stats {
  margin: 8px 0;
  font-weight: 700;
}

.col-num {
  width: 42px;
  text-align: center;
  color: #475569;
  font-weight: 900;
}

.col-actions {
  width: 88px;
  text-align: center;
  white-space: nowrap;
}

.compact-input {
  width: 100%;
  min-width: 130px;
  margin: 0 !important;
  padding: 8px 10px !important;
  border-radius: 8px !important;
  font-size: .88rem !important;
  background: #f7f9fd !important;
}

.question-input {
  min-width: 260px;
  resize: vertical;
  line-height: 1.25;
  min-height: 38px;
  max-height: 80px;
}

.good-input {
  border-color: #047857 !important;
  background: #ecfdf5 !important;
}

.wrong-input {
  border-color: #ff6b6b !important;
  background: #fff7f7 !important;
}

.question-multiple-badge {
  display: inline-flex;
  width: fit-content;
  margin: 2px 0 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b21b6;
  font-weight: 800;
}

/* ===== Liste compacte et édition des questions ===== */
.question-compact-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.question-compact-card {
  position: relative;
  display: grid;
  grid-template-columns: 34px 42px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid #dbe5f4;
  border-radius: 16px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.question-compact-card:nth-child(even) {
  background: #f8fafc;
}

.question-compact-card + .question-compact-card {
  margin-top: 2px;
}

.question-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #1e3a8a;
  font-weight: 900;
}

.question-drag-handle {
  align-self: stretch;
  width: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  font-size: 1.45rem;
  line-height: 1;
  cursor: grab;
  touch-action: none;
}

.question-drag-handle:hover,
.question-drag-handle:focus-visible {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
}

.question-drag-handle:active {
  cursor: grabbing;
}

.question-compact-card.is-dragging {
  opacity: .45;
  border-style: dashed;
}

.question-compact-card.drop-before::before,
.question-compact-card.drop-after::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 4px;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 0 0 3px #dbeafe;
}

.question-compact-card.drop-before::before {
  top: -9px;
}

.question-compact-card.drop-after::after {
  bottom: -9px;
}

.question-compact-main {
  min-width: 0;
}

.question-compact-title {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 7px;
  color: #172554;
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.question-correct-summary,
.question-wrong-summary {
  overflow: hidden;
  margin: 3px 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-correct-summary {
  color: #047857;
  font-weight: 800;
}

.question-wrong-summary {
  color: #64748b;
  font-size: .86rem;
}

.question-thumbnail-button {
  display: grid;
  place-items: center;
  width: 108px;
  height: 82px;
  padding: 5px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  cursor: zoom-in;
}

.question-thumbnail {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.question-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.question-compact-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
  max-width: 230px;
}

.question-empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 34px 20px;
  border: 1px dashed #93c5fd;
  border-radius: 16px;
  background: #f8fafc;
  text-align: center;
}

.question-empty-state p {
  margin: 0;
}

.question-edit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.question-edit-header h2,
.question-edit-header p {
  margin: 0;
}

.question-modal-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  font-size: 1.55rem;
}

#questionEditForm {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

#questionEditForm > label,
.question-edit-image-fieldset > label,
.question-edit-answers label {
  margin: 2px 0 -5px;
  color: #334155;
  font-weight: 800;
}

#questionEditForm input,
#questionEditForm textarea {
  margin: 0;
}

#questionEditForm textarea {
  min-height: 92px;
  resize: vertical;
}

.question-formula-assistant {
  position: sticky;
  top: -1px;
  z-index: 3;
  display: grid;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: rgba(239, 246, 255, .97);
  box-shadow: 0 5px 14px rgba(30, 64, 175, .08);
}

.question-formula-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.question-formula-target-label {
  color: #475569;
}

.question-formula-toolbar {
  display: grid;
  gap: 7px;
}

.question-formula-toolbar .mini-actions {
  margin: 0;
}

.question-formula-help,
.question-formula-status {
  margin: 0;
}

.question-formula-status:empty {
  display: none;
}

.question-formula-preview {
  min-height: 44px;
  padding: 10px 12px;
  overflow-wrap: anywhere;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: white;
  color: #0f172a;
}

#questionEditForm [aria-invalid="true"] {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px #fee2e2;
}

.question-edit-image-fieldset,
.question-edit-answers {
  display: grid;
  gap: 10px;
  margin: 5px 0;
  padding: 14px;
  border: 1px solid #dbe5f4;
  border-radius: 14px;
}

.question-edit-image-fieldset legend,
.question-edit-answers legend {
  padding: 0 7px;
  color: #1e3a8a;
  font-weight: 900;
}

.question-edit-answers-help {
  margin: -2px 0 2px;
}

.question-edit-answer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.question-edit-answer-input {
  min-width: 0;
}

.question-edit-correct-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 142px;
  padding: 9px 11px;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  background: #f0fdf4;
  color: #166534;
  font-weight: 800;
  cursor: pointer;
}

.question-edit-correct-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #15803d;
}

.question-edit-image-preview {
  display: grid;
  place-items: center;
  width: min(100%, 360px);
  min-height: 120px;
  max-height: 230px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid #dbe5f4;
  border-radius: 12px;
  background: #f8fafc;
}

.question-edit-image-preview img {
  display: block;
  max-width: 100%;
  max-height: 212px;
  object-fit: contain;
}

.question-edit-error {
  margin: 4px 0 0;
  border-left: 4px solid #dc2626;
  color: #991b1b;
}

.question-edit-navigation {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.question-edit-navigation > :last-child {
  justify-self: end;
}

.question-edit-navigation strong {
  color: #475569;
}

.question-image-lightbox {
  cursor: zoom-out;
}

/* ===== Aperçu joueur dans la modale prof ===== */
.preview-modal-content {
  max-width: 720px;
  width: min(94vw, 720px);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.student-preview-card {
  background: var(--card-bg, #ffffff);
  border-radius: 24px;
  padding: 24px;
  margin: 20px 0;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.student-preview-card .answers {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.student-preview-card .answerBtn {
  width: 100%;
  text-align: center;
}

.correct-preview {
  background: #d1fae5 !important;
  border: 2px solid #047857 !important;
  color: #065f46 !important;
  font-weight: 700;
}

@media(max-width:760px) {

  .bank-toolbar {
    align-items: flex-start;
  }

  .bank-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .export-menu-options {
    right: auto;
    left: 0;
  }

  .question-compact-card {
    grid-template-columns: 34px 40px minmax(0, 1fr);
    align-items: start;
  }

  .question-compact-main {
    grid-column: 3;
  }

  .question-thumbnail-button {
    grid-column: 2 / 4;
    width: 108px;
  }

  .question-compact-actions {
    grid-column: 2 / 4;
    justify-content: flex-start;
    max-width: none;
  }

  .question-table {
    font-size: .82rem;
  }

  .compact-input {
    font-size: .82rem !important;
  }

  .question-input {
    min-width: 210px;
  }
}

@media(max-width:640px) {

  .active-bank-name {
    max-width: calc(100vw - 90px);
  }

  .bank-library-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .bank-library-card-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .collections-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .collection-filter {
    max-width: 100%;
  }

  .collection-choice {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .collection-choice small {
    grid-column: 2;
  }




  .question-edit-modal-content,
  .question-image-lightbox-content {
    width: 96vw;
    max-height: 96vh;
    padding: 18px 14px;
    border-radius: 18px;
  }

  .question-edit-navigation {
    grid-template-columns: 1fr 1fr;
  }

  .question-edit-navigation strong {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
  }

  .question-edit-navigation > button:first-child {
    grid-column: 1;
  }

  .question-edit-navigation > button:last-child {
    grid-column: 2;
    width: 100%;
  }

  .question-edit-footer .btn,
  .question-edit-footer .primary {
    width: 100%;
  }

  .question-edit-answer-row {
    grid-template-columns: 1fr;
  }

  .question-edit-correct-toggle {
    min-width: 0;
  }
}
/* ===== Génération IA CollabQuiz ===== */
.ai-preview-modal-content {
  max-width: 900px;
  width: min(94vw, 900px);
}

.ai-preview-list {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

.ai-question-preview {
  border: 1px solid #dbe5f4;
  border-radius: 18px;
  padding: 16px;
  background: #f8fafc;
}

.ai-question-preview h3 {
  margin-top: 0;
  color: #2563eb;
}

.ai-question-text {
  font-weight: 800;
  margin: 8px 0 12px;
}

.ai-answer-list {
  display: grid;
  gap: 8px;
}

.ai-answer-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #dbe5f4;
  border-radius: 12px;
  background: white;
  font-weight: 700;
  cursor: pointer;
}

.ai-answer-choice input {
  width: auto;
  margin: 0;
}

.ai-answer-good {
  border-color: #047857;
  background: #ecfdf5;
  color: #065f46;
}

.ai-insert-box {
  margin-top: 18px;
  padding: 14px;
  border-radius: 18px;
  background: #eef6ff;
  border: 1px solid #bfdbfe;
}

.ai-insert-box h3 {
  margin-top: 0;
}

/* ===== Modale IA éditable ===== */
.ai-question-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.ai-edit-question {
  min-height: 64px;
  resize: vertical;
  font-weight: 700;
  background: white;
}

.ai-answer-choice .ai-edit-answer {
  flex: 1;
  margin: 0;
  border: 0;
  background: transparent;
  font-weight: 700;
  padding: 6px 4px;
}

.ai-answer-choice .ai-edit-answer:focus {
  outline: 2px solid #2563eb;
  border-radius: 8px;
  background: white;
}

.ai-answer-good .ai-edit-answer {
  color: #065f46;
}

/* ===== IA / import : disposition formulaire ===== */
.import-grid,
.ai-generation-grid {
  align-items: end;
}

.ai-generation-grid {
  margin-top: 4px;
}

/* ===== Questions : choix progressif de la méthode ===== */
#otherExportStatus {
  white-space: pre-line;
  max-height: 35vh;
  overflow-y: auto;
}

.question-section-heading,
.method-panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.question-section-heading h2,
.question-section-heading p,
.method-panel-heading h3,
.method-panel-heading p {
  margin-bottom: 0;
}

.question-total {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  font-size: .9rem;
  font-weight: 700;
}

.add-questions-title {
  margin: 26px 0 12px;
  font-size: 1rem;
  color: #334155;
}

.question-method-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.question-method {
  min-width: 0;
  min-height: 132px;
  padding: 18px;
  border: 1px solid #dbe5f4;
  background: #f8fafc;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.question-method:hover,
.question-method.active {
  border-color: #2563eb;
  box-shadow: 0 9px 22px #1e40af1f;
  transform: translateY(-2px);
}

.question-method.active {
  background: #eff6ff;
  color: #1e3a8a;
}

.question-method-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 3px;
  border-radius: 11px;
  background: #e8eef8;
  font-size: 1.15rem;
}

.question-method small {
  color: #64748b;
  font-weight: 600;
  line-height: 1.35;
}

.question-method-panel {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid #bfdbfe;
  border-radius: 18px;
  background: #f8fbff;
}

.question-method-panel:focus {
  outline: none;
}

.field-help {
  display: block;
  margin-top: -7px;
  color: #64748b;
  font-size: .82rem;
}

.primary-method-action {
  margin-bottom: 8px;
}

.secondary-options {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #dbe5f4;
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
}

.secondary-options summary {
  color: #334155;
  font-weight: 800;
  cursor: pointer;
}

.compact-actions {
  margin: 12px 0 4px;
}

.question-more-options {
  width: fit-content;
  max-width: 100%;
}

.csv-format-hint {
  margin: 0;
  color: #475569;
  overflow-wrap: anywhere;
}

@media(max-width:900px) {
  .question-method-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media(max-width:560px) {
  .cq-create-page .geometry-constructions [data-tool] {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .cq-create-page .other-export-content #otherExportDestination {
    height: 140px;
    min-height: 0;
    max-height: 140px;
  }

  #otherExportStatus {
    max-height: 18vh;
  }

  .question-section-heading,
  .method-panel-heading {
    flex-direction: column;
  }

  .question-method-grid {
    grid-template-columns: 1fr;
  }

  .question-method {
    min-height: 0;
  }

  .question-method-panel {
    padding: 16px;
  }

  .close-method-panel {
    align-self: flex-end;
    margin-top: -44px;
  }

  #importQuestionPanel .close-method-panel {
    margin-top: 0;
  }
}

/* ===== Surbrillance question ajoutée ou déplacée ===== */
.question-compact-card.question-row-highlight {
  animation: questionRowFlash 1.8s ease;
}

@keyframes questionRowFlash {
  0%, 70% {
    background: #fef3c7;
  }
  100% {
    background: #fff;
  }
}


/* ===== Statut génération IA ===== */
.ai-status {
  margin: 6px 0 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-weight: 700;
  text-align: left;
}

/* Choix de destinations pour les futurs exports, sans toucher aux exports existants. */
.other-export-content { max-width: 480px; }
.other-export-content select { width: 100%; margin: 5px 0 14px; }
.other-export-content #otherExportStatus { margin: 8px 0 16px; }

/* Menus Exporter : éviter les découpes et les superpositions. */
.export-menu[open] { z-index: 1000; }
.export-menu-options {
  position: fixed;
  z-index: 10000;
  top: auto;
  right: auto;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
}

/* Liste unique des formats dans la modale d'export. */
.other-export-content #otherExportDestination {
  display: block;
  width: 100%;
  max-height: min(380px, 50vh);
  min-height: 220px;
  overflow-y: auto;
  margin: 8px 0 14px;
}
.other-export-content #otherExportDestination option { padding: 8px 10px; }


/* Panneau de menu export au niveau du body, indépendant des cartes. */
.floating-export-menu {
  position: fixed !important;
  z-index: 2147483000 !important;
  right: auto !important;
  bottom: auto !important;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
}

/* Le panneau dans <details> sert uniquement aux gestionnaires JS :
   seul son clone flottant, attaché au body, doit être visible. */
details.export-menu > .export-menu-options,
details.export-menu[open] > .export-menu-options {
  display: none !important;
}
body > .floating-export-menu {
  display: grid !important;
  position: fixed !important;
  z-index: 2147483000 !important;
  margin: 0 !important;
  /* left/top sont calculés par JavaScript */
}

/* Import de questions : indicateurs compacts sur une seule ligne. */
.import-analysis-counters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; gap: 0.5rem; }
.import-analysis-counter { display: flex; align-items: center; justify-content: center; gap: 0.4rem; min-width: 0; }
.import-analysis-counter strong { font-size: 1.1rem; }
.import-analysis-counter span { font-size: 0.85rem; }
.import-image-note { color: var(--text-muted, #475569); margin: 0.35rem 0; }
@media (max-width: 560px) { .import-analysis-counter { flex-direction: column; gap: 0.1rem; } }

/* Import : miniature a droite du texte, comme dans Questions de la partie. */
.import-compact-card {
  grid-template-columns: 34px 34px 42px minmax(0, 1fr) auto auto;
}
.import-compact-selection {
  display: flex;
  align-items: center;
  justify-content: center;
}
.import-compact-selection input {
  width: 18px;
  height: 18px;
  margin: 0;
}
.import-compact-card > .question-thumbnail-button {
  grid-column: 5;
  grid-row: 1;
}
.import-compact-card > .question-compact-actions {
  grid-column: 6;
  grid-row: 1;
}
@media (max-width: 680px) {
  .import-compact-card { grid-template-columns: 34px 34px 40px minmax(0, 1fr); }
  .import-compact-card > .question-thumbnail-button {
    grid-column: 4; grid-row: 2;
  }
  .import-compact-card > .question-compact-actions {
    grid-column: 4; grid-row: 3;
  }
}

.bank-question-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 10px 12px;
  border: 1px solid #dbe5f4;
  border-radius: 12px;
  background: #f8fafc;
}
.bank-question-main-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.bank-question-add-selection { margin-left: auto; }
.bank-question-save-states {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  min-height: 1.2rem;
}
.bank-question-save-states .active-bank-save-status { max-width: none; }
.bank-question-compact-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.bank-question-compact-stats { margin: 0; font-weight: 700; }
.bank-question-compact-summary .compact-actions { margin: 0; }
@media (max-width: 680px) {
  .bank-question-toolbar,
  .bank-question-main-actions { align-items: stretch; }
  .bank-question-main-actions { width: 100%; }
  .bank-question-main-actions > .btn,
  .bank-question-main-actions > .export-menu { flex: 1 1 auto; }
  .bank-question-main-actions > .export-menu > summary { justify-content: center; }
  .bank-question-add-selection { width: 100%; margin-left: 0; }
  .bank-question-compact-summary { align-items: flex-start; }
}

/* Import de QCM : présentation compacte et dépôt de fichiers. */
.import-upload-layout { display:grid; grid-template-columns:minmax(0, 2fr) minmax(0, 3fr); gap:1.25rem; align-items:stretch; margin:0.75rem 0 1rem; }
.import-upload-info { min-width:0; padding:0.4rem 0.25rem; }
.import-upload-info h4 { margin:0 0 0.65rem; }
.import-upload-info p { margin:0.45rem 0; }
.import-upload-info .import-format-details { margin-top:0.7rem; }
.import-drop-zone { border:2px dashed #8daaff; border-radius:12px; min-height:170px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:0.5rem; padding:1rem; text-align:center; transition:background .15s,border-color .15s; }
.import-drop-zone.drag-over { background:#eaf1ff; border-color:#315fd1; }
.import-drop-zone p { margin:0; }
.import-drop-icon { font-size:1.6rem; line-height:1.2; }
.import-file-input { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.import-browse-label { display:inline-flex; cursor:pointer; padding:0.5rem 0.9rem; }
.import-file-input:focus-visible + .import-file-name { outline:2px solid #315fd1; }
.import-file-name { overflow-wrap:anywhere; max-width:100%; }
.import-analysis-summary { padding:0.65rem 0.9rem; }
.import-analysis-summary h4 { margin:0 0 0.55rem; }
.import-analysis-counters { display:flex; flex-wrap:wrap; gap:0.6rem 1.5rem; justify-content:space-between; }
.import-analysis-counter { flex-direction:row; gap:0.35rem; white-space:nowrap; }
@media(max-width:700px) { .import-upload-layout { display:flex; flex-direction:column; } .import-drop-zone { order:-1; min-height:150px; } .import-analysis-counters { gap:0.5rem 1rem; } }

/* Accès direct aux banques publiques dans la page Créer. */
.question-method-public { grid-column: 1 / -1; min-height: 96px; }
.public-banks-creator { margin: 14px 0 22px; }
.public-catalog-results { scroll-margin-top: 16px; }
.public-catalog-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; margin-top: 18px; }
.public-catalog-pagination[hidden] { display: none; }
.public-catalog-pagination button { min-width: 40px; min-height: 44px; margin: 0; white-space: nowrap; }
.public-catalog-pagination [aria-current="page"] { outline: 2px solid #2864d8; outline-offset: 1px; font-weight: 800; }
.public-catalog-loading { display: flex; align-items: center; gap: 9px; }
.public-catalog-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid #cbd5e1;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: public-catalog-spin .8s linear infinite;
}
@keyframes public-catalog-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .public-catalog-loading::before { animation: none; border-top-color: #2563eb; }
}

/* Présentation des banques publiques : informations pédagogiques et attribution. */
.public-bank-card { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding:16px 18px; border:1px solid #dbe5f4; border-radius:14px; background:#f8fafc; }
.public-bank-content { flex:1; min-width:0; }
.public-bank-title { margin:0 0 9px; font-size:1.08rem; line-height:1.35; overflow-wrap:anywhere; }
.public-bank-metadata { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 8px; }
.public-bank-tag { display:inline-block; padding:4px 9px; border-radius:999px; background:#e8effb; color:#1e3a6d; font-size:.82rem; }
.public-bank-description { margin:7px 0; line-height:1.5; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; overflow:hidden; }
.public-bank-keywords { margin:6px 0; font-size:.84rem; color:#526178; }
.public-bank-credit { margin:9px 0 0; font-size:.84rem; color:#475569; }
.public-bank-action { flex:0 0 auto; align-self:center; }
@media (max-width:650px) { .public-bank-card { flex-direction:column; gap:12px; } .public-bank-action { align-self:stretch; } }

/* V7 : deux vues dédiées aux banques publiques, sans quitter Créer. */
.public-banks-workspace { display:flex; flex-direction:column; gap:14px; }
.public-banks-workspace > .btn:first-child { align-self:flex-start; }
.public-bank-detail-header { padding:16px 18px; border:1px solid #dbe5f4; border-radius:14px; background:#f8fafc; }
.public-bank-detail-header h2 { margin:0 0 12px; }
.public-bank-detail-header p { margin:8px 0; }

/* Bibliothèque : quatre actions visibles, autres actions regroupées. */
.bank-library-card-actions { justify-content: flex-end; align-items: center; }
.bank-library-share-placeholder { opacity: .75; cursor: not-allowed; }
.bank-share-soon { font-size: .7em; font-weight: 500; }
.bank-library-more-options { min-width: 235px; }
.bank-more-heading { padding: 9px 8px 3px; color: #64748b; font-size: .7rem; font-weight: 800; letter-spacing: .06em; }
.bank-more-separator { height: 1px; margin: 5px 4px; background: #dbe5f4; }
@media (max-width: 720px) { .bank-library-card-actions { justify-content: flex-start; } }

/* Bibliotheque : actions centrees verticalement sur ecran large. */
@media (min-width: 761px) {
  .bank-library-card { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
  .bank-library-card-actions { grid-column: 3; align-self: center; justify-content: flex-end; }
}

/* Confirmation des conflits Nuage : modale native, accessible et responsive. */
.cloud-conflict-dialog {
  width: min(92vw, 480px); max-height: min(90vh, 680px);
  padding: 0; border: 1px solid var(--border-color, #d6dce5);
  border-radius: 14px; color: inherit; background: var(--card-bg, #fff);
  box-shadow: 0 16px 55px rgba(0,0,0,.22);
}
.cloud-conflict-dialog::backdrop { background: rgba(15,23,42,.58); }
.cloud-conflict-dialog-content { padding: 24px; }
.cloud-conflict-dialog h2 { margin: 0 0 12px; font-size: 1.25rem; }
.cloud-conflict-dialog p { margin: 0 0 12px; line-height: 1.5; }
.cloud-conflict-dialog-bank { font-weight: 600; overflow-wrap: anywhere; }
.cloud-conflict-dialog-detail { font-size: .92rem; opacity: .82; }
.cloud-conflict-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.cloud-conflict-dialog .cloud-conflict-destructive { background: #a83232; color: #fff; border-color: #a83232; }
.cloud-conflict-dialog .cloud-conflict-destructive:hover { background: #872626; }
@media (max-width: 440px) { .cloud-conflict-dialog-content { padding: 18px; } }

/* Nom alternatif lors d'une sauvegarde Nuage déjà existante. */
.nuage-save-rename-label { display: block; margin: 12px 0 6px; font-weight: 600; }
.nuage-save-rename-input { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #9ca3af; border-radius: 8px; font: inherit; }
.nuage-save-rename-error { color: #a83232; font-size: .9rem; margin: 6px 0 0; }

/* Synthèse de consultation : à droite des crédits, sans en-tête redondant. */
.bank-detail-info-row { display:flex; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; gap:8px 20px; margin-top:8px; }
.bank-detail-info-row .public-bank-credit { margin:0; flex:1 1 230px; }
.bank-detail-summary { margin-left:auto; text-align:right; min-width:0; }
.bank-detail-summary .bank-question-compact-summary { display:block; }
.bank-detail-summary .bank-question-compact-stats { font-size:.84rem; }
.bank-detail-summary .import-analysis-notices { margin-top:4px; text-align:left; }
#publicBankImportHost > .compact-actions { justify-content:flex-end; margin:0 0 8px; }
@media (max-width:680px) {
  .bank-detail-summary { margin-left:0; text-align:left; width:100%; }
  #publicBankImportHost > .compact-actions { justify-content:flex-start; }
}


/* Six accès compacts, mêmes actions, icônes vectorielles. */
.question-method-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.question-method-grid > .question-method,
.question-method-grid > .question-method-more > summary.question-method {
  min-height: 92px; padding: 12px 10px; align-items: center;
  justify-content: center; text-align: center; gap: 8px;
}
.question-method-grid .question-method-icon { margin: 0; width: 34px; height: 34px; flex: 0 0 34px; }
.question-method-svg { width: 21px; height: 21px; }
.question-method-grid .question-method > span:last-child { font-size: .85rem; font-weight: 750; line-height: 1.2; }
.question-method-grid .question-method-public { grid-column: auto; min-height: 92px; }
.question-method-grid .question-method-more { position: relative; margin: 0; padding: 0; border: 0; background: transparent; width: auto; max-width: none; min-width: 0; }
.question-method-grid .question-method-more > summary { list-style: none; cursor: pointer; border-radius: 14px; height: 100%; }
.question-method-grid .question-method-more > summary::-webkit-details-marker { display: none; }
.question-method-grid .question-method-more[open] > summary { border-color: #2563eb; background: #eff6ff; }
.question-method-more-content { position: absolute; z-index: 15; right: 0; top: calc(100% + 6px); min-width: 225px; padding: 10px; margin: 0; border: 1px solid #dbe5f4; border-radius: 12px; background: #fff; box-shadow: 0 12px 24px #1e293b20; }
.question-method-more-content .btn { white-space: normal; }
@media (max-width: 900px) { .question-method-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .question-method-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .question-method-grid > .question-method, .question-method-grid > .question-method-more > summary.question-method { min-height: 80px; padding: 9px 6px; } }

/* Navigation compacte entre les espaces de banques (2026-10-24). */
.cq-legacy-back { display: none !important; }
.cq-bank-nav-row { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.cq-bank-nav { display: flex; align-items: center; gap: 7px; }
.cq-bank-nav-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 39px; height: 39px; padding: 8px; border: 1px solid #dce5f4;
  border-radius: 11px; background: #edf3fc; color: #17366e; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.cq-bank-nav-btn svg { width: 21px; height: 21px; flex: none; }
.cq-bank-nav-btn:hover:not(:disabled), .cq-bank-nav-btn:focus-visible { background: #dce9ff; border-color: #9db8f2; }
.cq-bank-nav-btn.is-active { background: #2148b5; color: #fff; border-color: #2148b5; cursor: default; opacity: 1; }
.cq-bank-nav-tooltip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; background: #1a2944; color: #fff; font-size: 12px;
  font-weight: 600; line-height: 1.3; padding: 6px 9px; border-radius: 6px;
  pointer-events: none; opacity: 0; visibility: hidden; z-index: 30;
}
.cq-bank-nav-btn:hover .cq-bank-nav-tooltip,
.cq-bank-nav-btn:focus-visible .cq-bank-nav-tooltip { opacity: 1; visibility: visible; }
@media (max-width: 520px) {
  .cq-bank-nav { gap: 5px; }
  .cq-bank-nav-btn { width: 36px; height: 36px; padding: 7px; }
}

/* Bibliothèque : barre d'actions compacte à six emplacements. */
.cq-library-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
  margin: 14px 0 10px;
}
.cq-library-actions > button,
.cq-library-actions > .cq-library-connect > button,
.cq-library-actions > .cq-library-menu > summary {
  width: 100%;
  min-height: 43px;
  padding: 9px 7px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  text-align: center;
  font-size: .88rem;
  white-space: normal;
}
.cq-library-connect { min-width: 0; }
.cq-library-connect > button.hidden { display: none !important; }
.cq-library-menu { position: relative; min-width: 0; }
.cq-library-menu > summary { cursor: pointer; list-style: none; }
.cq-library-menu > summary::-webkit-details-marker { display: none; }
.cq-library-menu-panel {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 30;
  width: max(210px, 100%);
  max-width: min(280px, 90vw);
  padding: 9px;
  display: grid;
  gap: 6px;
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15,23,42,.16);
}
.cq-library-menu-panel .btn { width: 100%; text-align: left; }
.cq-library-menu-heading {
  padding: 7px 4px 2px;
  font-weight: 700;
  font-size: .83rem;
  color: #475569;
}
.cq-library-menu-heading:not(:first-child) { border-top: 1px solid #e2e8f0; margin-top: 4px; }
.cq-library-status {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 43px;
  margin: 0;
  padding: 6px;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  background: #f8fafc;
  overflow-wrap: anywhere;
  font-size: .82rem;
}
@media (max-width: 1050px) { .cq-library-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cq-library-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Icônes monochromes des actions de la bibliothèque */
.cq-library-actions .cq-action-icon { width: 1.1em; height: 1.1em; display: inline-block; vertical-align: -0.18em; flex: 0 0 auto; color: currentColor; }

/* En-têtes harmonisés : banques personnelles, publiques et détail */
.cq-bank-nav-row.bank-toolbar { justify-content: space-between; align-items: center; margin-bottom: 0; flex-wrap: wrap; }
.cq-bank-nav-row .bank-title { flex-wrap: nowrap; }
.cq-bank-nav-row .bank-title h2 { margin: 0; font-size: 1.2rem; }
.cq-bank-nav-row .bank-icon svg { width: 21px; height: 21px; }
#publicBanksScreen .public-banks-creator { margin-top: 0; }
#publicBanksScreen .public-banks-workspace, #publicBankQuestionsScreen .public-banks-workspace { gap: 12px; }
.public-bank-card-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.deferred-quiz-modal-content { width: min(620px, 94vw); }
.assignment-form { display: grid; gap: 9px; }
.assignment-form input,
.assignment-form select { width: 100%; }
.assignment-verification {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
}
.assignment-verification h3,
.assignment-verification p { margin: 0; }
.assignment-session-status { color: #1e3a8a; }
.assignment-check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 5px;
}
.assignment-check-row input { width: auto; }
.assignment-experimental-note {
  padding: 11px 13px;
  border: 1px solid #f59e0b;
  border-radius: 12px;
  background: #fffbeb;
  color: #78350f;
}
.assignment-activation-status {
  width: fit-content;
  margin: 10px auto 6px;
  padding: 7px 12px;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-weight: 700;
  text-align: center;
}
.assignment-activation-status.is-active { color: #166534; background: #f0fdf4; }
.assignment-activation-status.is-pending { color: #92400e; background: #fffbeb; }
.deferred-quiz-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.deferred-quiz-link-row input { min-width: 0; }
.deferred-quiz-qr {
  display: grid;
  width: 244px;
  min-height: 244px;
  margin: 20px auto 8px;
  padding: 12px;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
}
.deferred-quiz-qr img,
.deferred-quiz-qr canvas { max-width: 100%; height: auto; }
.deferred-quiz-qr.is-pending {
  border-style: dashed;
  opacity: .58;
}

@media (max-width: 700px) {
  .public-bank-card-actions { width: 100%; justify-content: stretch; }
  .public-bank-card-actions > * { flex: 1 1 auto; }
  .deferred-quiz-link-row { grid-template-columns: 1fr; }
}

/* ===== Page Créer : identité graphique 2026 ===== */
body.cq-create-page {
  --cq-primary: #213f91;
  --cq-action: #2864d8;
  --cq-teal: #0d9488;
  --cq-orange: #f59e0b;
  --cq-purple: #8b5cf6;
  --cq-danger: #ef4444;
  --cq-background: #f3f6fb;
  --cq-surface: #fff;
  --cq-border: #e2e8f0;
  --cq-text: #17243b;
  --cq-shadow: 0 12px 34px rgba(23, 36, 59, .08);
  position: relative;
  overflow-x: hidden;
  background-color: var(--cq-background);
  background-image:
    radial-gradient(ellipse at -4% 18%, rgba(93, 213, 191, .18) 0 5.5vw, transparent 5.6vw),
    radial-gradient(ellipse at 103% 36%, rgba(92, 202, 245, .16) 0 7vw, transparent 7.1vw),
    radial-gradient(circle at 1.5% 61%, rgba(139, 92, 246, .08) 0 12px, transparent 13px),
    radial-gradient(circle at 98.5% 69%, rgba(40, 100, 216, .14) 0 8px, transparent 9px),
    linear-gradient(180deg, #eef6ff 0, #f7f9fd 42%, #f3f6fb 100%);
  background-attachment: scroll;
  color: var(--cq-text);
}

body.cq-create-page::before,
body.cq-create-page::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 55% 45% 0 0;
  opacity: .62;
}

body.cq-create-page::before {
  left: -9vw;
  bottom: -92px;
  width: 48vw;
  height: 210px;
  background:
    radial-gradient(ellipse at 76% 8%, rgba(93, 213, 191, .34) 0 9%, transparent 9.5%),
    linear-gradient(145deg, rgba(93, 213, 191, .32), rgba(80, 151, 239, .15));
  transform: rotate(4deg);
}

body.cq-create-page::after {
  right: -10vw;
  bottom: -104px;
  width: 44vw;
  height: 224px;
  background:
    radial-gradient(ellipse at 22% 5%, rgba(88, 211, 194, .28) 0 10%, transparent 10.5%),
    linear-gradient(145deg, rgba(92, 177, 245, .18), rgba(32, 69, 181, .28));
  transform: rotate(-4deg);
}

.cq-create-page .app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1460px;
  gap: 24px;
  padding: 0 26px 44px;
}

.cq-create-page .app::before,
.cq-create-page .app::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 150px;
  height: 250px;
  pointer-events: none;
  opacity: .72;
}

.cq-create-page .app::before {
  top: 250px;
  left: -112px;
  background:
    radial-gradient(ellipse at 84% 22%, rgba(74, 204, 183, .46) 0 18%, transparent 19%),
    radial-gradient(ellipse at 70% 49%, rgba(45, 181, 166, .38) 0 22%, transparent 23%),
    radial-gradient(ellipse at 91% 75%, rgba(92, 202, 245, .34) 0 19%, transparent 20%);
  transform: rotate(11deg);
}

.cq-create-page .app::after {
  top: 470px;
  right: -116px;
  background:
    radial-gradient(ellipse at 18% 19%, rgba(92, 202, 245, .38) 0 20%, transparent 21%),
    radial-gradient(ellipse at 30% 48%, rgba(74, 204, 183, .42) 0 22%, transparent 23%),
    radial-gradient(ellipse at 8% 77%, rgba(40, 100, 216, .22) 0 18%, transparent 19%);
  transform: rotate(-9deg);
}

.cq-create-page .home-banner {
  margin-inline: -26px;
  padding: 18px 52px 20px;
  border-radius: 0 0 52px 52px;
  background: linear-gradient(112deg, #174aa8 0%, #0f3485 58%, #12347e 100%);
  box-shadow: 0 12px 30px rgba(20, 55, 134, .22);
}

.cq-create-page .home-banner-content {
  width: min(1356px, 100%);
  margin: 0 auto;
}

.cq-create-page .cq-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.cq-create-page .cq-brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  filter: drop-shadow(0 5px 8px rgba(2, 19, 65, .24));
}

.cq-create-page .cq-brand-mark svg { width: 100%; height: 100%; }

.cq-create-page .home-banner h1 {
  font-size: clamp(1.55rem, 2.2vw, 2.1rem);
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1;
}

.cq-create-page .home-banner h1 span { color: #5ccaf5; }
.cq-create-page .home-banner p { margin-top: 7px; font-size: .92rem; font-weight: 650; }

.cq-create-page .home-banner-actions {
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
}

.cq-create-page .home-banner .home-nav-icon-button {
  display: inline-flex;
  width: auto;
  height: 46px;
  min-width: 46px;
  padding: 0 15px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: #fff;
  font-size: .9rem;
  box-shadow: none;
}

.cq-create-page .home-banner .home-nav-icon-button:hover,
.cq-create-page .home-banner .home-nav-icon-button:focus-visible {
  background: rgba(255, 255, 255, .12);
}

.cq-create-page .home-banner .home-nav-icon-button[aria-current="page"] {
  background: linear-gradient(135deg, #2977ef, #1f67da);
  color: #fff;
  box-shadow: 0 8px 18px rgba(4, 31, 98, .24);
}

.cq-create-page .home-banner-actions:has(#backToQuestionsBtn:not(.hidden)) > .cq-create-nav-link {
  display: none;
}

.cq-create-page #backToQuestionsBtn:not(.hidden) {
  background: linear-gradient(135deg, #2977ef, #1f67da);
  box-shadow: 0 8px 18px rgba(4, 31, 98, .24);
}

.cq-create-page .home-nav-icon {
  width: 21px;
  height: 21px;
}

.cq-create-page img.home-nav-icon {
  filter: brightness(0) invert(1);
}

.cq-create-page .screen.active { gap: 22px; }

.cq-create-page #questionsScreen > .panel {
  border: 1px solid rgba(203, 217, 239, .82);
  border-radius: 24px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--cq-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.cq-create-page #questionManager { padding: 20px 22px 22px; }

.cq-create-page .question-section-heading { align-items: center; }
.cq-create-page .question-section-heading h2 { font-size: clamp(1.25rem, 2vw, 1.65rem); }
.cq-create-page .question-section-heading p { margin: 5px 0 0; }

.cq-create-page .cq-section-title,
.cq-create-page .bank-title { color: #0e2055; }

.cq-create-page .cq-section-step {
  display: inline-grid;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #367af0, #1357cf);
  color: #fff;
  box-shadow: 0 9px 18px rgba(40, 100, 216, .20);
  font-size: 1.3rem;
  font-weight: 900;
}

.cq-create-page .cq-section-step-teal {
  background: linear-gradient(145deg, #16bbaa, #059687);
  box-shadow: 0 9px 18px rgba(13, 148, 136, .2);
}

.cq-create-page .question-total {
  padding: 9px 15px;
  background: #edf5ff;
  color: #1355c5;
  font-weight: 850;
}

.cq-create-page .context-help-actions {
  position: static;
  display: flex;
  min-height: 34px;
  justify-content: flex-end;
  align-items: center;
  margin: 2px 0 8px;
}

.cq-create-page #helpBtn {
  padding: 7px 10px;
  color: #385275;
  background: transparent;
  font-weight: 700;
}

.cq-create-page .question-method-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0;
}

.cq-create-page .question-method-grid > .question-method {
  min-height: 144px;
  padding: 16px 10px 14px;
  justify-content: center;
  gap: 7px;
  border-color: rgba(187, 205, 232, .52);
  border-radius: 15px;
  color: #10204e;
  box-shadow: none;
}

.cq-create-page .question-method-grid > .question-method:nth-child(1) { background: linear-gradient(145deg, #eff7ff, #e5f1ff); }
.cq-create-page .question-method-grid > .question-method:nth-child(2) { background: linear-gradient(145deg, #edfcfa, #dcf7f3); }
.cq-create-page .question-method-grid > .question-method:nth-child(3) { background: linear-gradient(145deg, #f7f2ff, #eee6ff); }
.cq-create-page .question-method-grid > .question-method:nth-child(4) { background: linear-gradient(145deg, #fff8ed, #ffedda); }
.cq-create-page .question-method-grid > .question-method:nth-child(5) { background: linear-gradient(145deg, #fff2f6, #ffe4eb); }
.cq-create-page .question-method-grid > .question-method:nth-child(6) { background: linear-gradient(145deg, #f2f6fb, #e7edf6); }

.cq-create-page .question-method-grid > .question-method:hover,
.cq-create-page .question-method-grid > .question-method.active {
  border-color: #75a5ef;
  box-shadow: 0 10px 22px rgba(31, 75, 160, .12);
  transform: translateY(-3px);
}

.cq-create-page .question-method-grid .question-method-icon {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .58);
}

.cq-create-page .question-method-icon img { width: 25px; height: 25px; }
.cq-create-page .question-method:nth-child(1) .question-method-icon img { filter: invert(35%) sepia(94%) saturate(1823%) hue-rotate(206deg); }
.cq-create-page .question-method:nth-child(2) .question-method-icon img { filter: invert(48%) sepia(70%) saturate(1166%) hue-rotate(130deg); }
.cq-create-page .question-method:nth-child(3) .question-method-icon img { filter: invert(43%) sepia(85%) saturate(1735%) hue-rotate(239deg); }
.cq-create-page .question-method:nth-child(4) .question-method-icon img { filter: invert(59%) sepia(96%) saturate(1214%) hue-rotate(352deg); }
.cq-create-page .question-method:nth-child(5) .question-method-icon img { filter: invert(31%) sepia(95%) saturate(2639%) hue-rotate(337deg); }

.cq-create-page .question-method-grid .question-method > span:nth-last-child(2) {
  font-size: .94rem;
  font-weight: 850;
}

.cq-create-page .question-method-grid .question-method small {
  color: #405476;
  font-size: .78rem;
  font-weight: 500;
  text-align: center;
}

.cq-create-page .cq-demo-icon {
  width: 27px;
  height: 27px;
  color: #17366e;
}

.cq-create-page .question-method-panel {
  border-color: #c9dafa;
  background: #f7faff;
  box-shadow: inset 0 1px 0 #fff;
}

.cq-create-page .bank-panel {
  padding: 20px 22px;
  border-color: #78a9f4 !important;
  box-shadow: 0 12px 34px rgba(40, 100, 216, .10) !important;
}

.cq-create-page .bank-title { flex-wrap: nowrap; }
.cq-create-page .bank-title h2 { font-size: clamp(1.18rem, 2vw, 1.55rem); }
.cq-create-page .bank-title .cq-section-step { margin-right: 4px; }
.cq-create-page .bank-title .bank-icon svg { width: 20px; height: 20px; }
.cq-create-page .active-bank-name,
.cq-create-page .active-bank-save-status { min-width: 0; overflow-wrap: anywhere; }

.cq-create-page .cq-menu-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  vertical-align: -.2em;
}

.cq-create-page .export-menu > summary,
.cq-create-page .export-menu-options .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cq-create-page .bank-actions { align-items: center; justify-content: flex-end; }
.cq-create-page .bank-toolbar,
.cq-create-page .bank-title,
.cq-create-page .bank-actions,
.cq-create-page .bank-actions > * { min-width: 0; }

.cq-create-page .bank-actions .btn,
.cq-create-page .bank-actions .primary,
.cq-create-page .bank-actions summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid #d7e3f5;
  border-radius: 12px;
  background: #eff4fb;
  color: #132856;
  box-shadow: none;
}

.cq-create-page .bank-actions #toggleBankBtn {
  border-color: var(--cq-action);
  background: linear-gradient(135deg, #2f7bf1, #1763d8);
  color: #fff;
}

.cq-create-page .bank-actions .danger {
  border-color: #ffd1d8;
  background: #fff0f2;
  color: #cf2438;
}

.cq-create-page .bank-actions > button::before,
.cq-create-page .bank-actions > details > summary::before {
  content: "";
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  background: currentColor;
  mask: var(--cq-action-icon) center / contain no-repeat;
  -webkit-mask: var(--cq-action-icon) center / contain no-repeat;
}

.cq-create-page #toggleBankBtn { --cq-action-icon: url("../graphiques/icones/afficher.svg"); }
.cq-create-page #addQuestionToolbarBtn { --cq-action-icon: url("../graphiques/icones/ajouter.svg"); }
.cq-create-page #previewQuestionsBtn { --cq-action-icon: url("../graphiques/icones/apercu.svg"); }
.cq-create-page #saveBankMenu > summary { --cq-action-icon: url("../graphiques/icones/sauvegarder.svg"); }
.cq-create-page #exportBankMenu > summary { --cq-action-icon: url("../graphiques/icones/exporter.svg"); }
.cq-create-page #clearBankBtn { --cq-action-icon: url("../graphiques/icones/supprimer.svg"); }

.cq-create-page #bankHint { margin: 13px 0 0; padding-left: 66px; line-height: 1.5; }

.cq-create-page .launch-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  overflow: visible;
  padding: 20px 24px !important;
  background:
    radial-gradient(circle at 8% 130%, rgba(13, 148, 136, .19) 0 95px, transparent 96px),
    radial-gradient(circle at 88% 150%, rgba(40, 100, 216, .18) 0 150px, transparent 151px),
    linear-gradient(110deg, #f8fcff, #eaf5ff) !important;
}

.cq-create-page .launch-header { min-width: 0; }
.cq-create-page .launch-header h2 { margin-bottom: 0; font-size: clamp(1.25rem, 2vw, 1.6rem); }
.cq-create-page .launch-header p { margin: 5px 0 0 66px; }
.cq-create-page .launch-panel .actions {
  display: grid; grid-template-columns: minmax(230px, 330px) repeat(2, minmax(110px, auto));
  gap: 12px; align-items: center; margin: 0; min-width: 0;
}
.cq-create-page .launch-action { position: relative; min-width: 0; }
.cq-create-page .launch-action > button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-width: 0; }
.cq-create-page .launch-action .cq-bank-nav-tooltip {
  width: min(260px, 75vw); white-space: normal; left: 0; transform: none;
  transition: opacity .15s ease .3s, visibility 0s linear .3s; pointer-events: auto;
}
.cq-create-page #assignActivityAction .cq-bank-nav-tooltip { left: auto; right: 0; }
.cq-create-page .launch-action:hover .cq-bank-nav-tooltip,
.cq-create-page .launch-action:focus-within .cq-bank-nav-tooltip { opacity: 1; visibility: visible; }
.cq-create-page .launch-action:focus-within .cq-bank-nav-tooltip { transition-delay: 0s; }
.cq-create-page .launch-action:focus-visible { outline: 3px solid #193f85; outline-offset: 3px; border-radius: 15px; }
.cq-create-page .launch-panel label { color: #19315d; }
.cq-create-page .activity-cards { border: 0; padding: 0; margin: 0; min-width: 0; width: min(330px, 100%); }
.cq-create-page .activity-card-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cq-create-page .activity-card {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; min-width: 0; margin: 0; padding: 11px 6px; border: 1px solid #cbd6e4;
  border-radius: 13px; background: #edf3ff; cursor: pointer; text-align: center;
  font-size: .8rem; line-height: 1.2; overflow-wrap: anywhere;
  transition: transform .18s ease, box-shadow .18s ease;
}
.cq-create-page .activity-card:nth-child(2) { background: #e7f6ef; }
.cq-create-page .activity-card:nth-child(3) { background: #f3edfc; }
.cq-create-page .activity-card img { width: 26px; height: 26px; }
.cq-create-page .activity-card:has(input:checked) { border-color: #8b9fb8; box-shadow: 0 2px 7px rgba(25, 49, 93, .12); font-weight: 700; }
@media (hover: hover) {
  .cq-create-page .activity-card:hover { transform: scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .cq-create-page .activity-card { transition: none; }
  .cq-create-page .activity-card:hover { transform: none; }
}
.cq-create-page .activity-card:has(input:focus-visible) { outline: 3px solid #193f85; outline-offset: 2px; }
.cq-create-page #launchActivityBtn {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: linear-gradient(135deg, #174fbd, #123b99);
  box-shadow: 0 10px 22px rgba(22, 65, 154, .2);
}

@media (max-width: 1100px) {
  .cq-create-page .home-banner .home-nav-icon-button { padding-inline: 11px; }
  .cq-create-page .question-method-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cq-create-page .question-method-grid > .question-method { min-height: 126px; }
  .cq-create-page .launch-panel { grid-template-columns: 1fr; }
  .cq-create-page .launch-panel .actions { justify-content: flex-start; }
}

@media (max-width: 820px) {
  .cq-create-page .app { padding-inline: 16px; }
  .cq-create-page .home-banner { margin-inline: -16px; padding-inline: 22px; border-radius: 0 0 34px 34px; }
  .cq-create-page .home-banner-content { flex-direction: column; align-items: stretch; }
  .cq-create-page .cq-brand { justify-content: center; }
  .cq-create-page .home-banner-actions { justify-content: center; }
  .cq-create-page .bank-title { align-items: flex-start; }
  .cq-create-page .bank-actions { width: 100%; justify-content: flex-start; }
  .cq-create-page #bankHint { padding-left: 0; }
  .cq-create-page .app::before { left: -126px; }
  .cq-create-page .app::after { right: -128px; }
}

@media (max-width: 620px) {
  .cq-create-page .app { gap: 16px; padding: 0 10px 28px; }
  .cq-create-page .home-banner { margin-inline: -10px; padding: 14px 12px 18px; border-radius: 0 0 24px 24px; }
  .cq-create-page .cq-brand-mark { width: 46px; height: 46px; }
  .cq-create-page .home-banner p { font-size: .8rem; }
  .cq-create-page .home-banner-actions { width: 100%; gap: 3px; }
  .cq-create-page .home-banner .home-nav-icon-button { flex: 1 1 20%; height: 43px; padding: 0 7px; gap: 5px; font-size: .75rem; }
  .cq-create-page .home-nav-icon { width: 18px; height: 18px; }
  .cq-create-page #questionsScreen > .panel { border-radius: 18px; }
  .cq-create-page #questionManager,
  .cq-create-page .bank-panel,
  .cq-create-page .launch-panel { padding: 16px !important; }
  .cq-create-page .question-section-heading { align-items: flex-start; }
  .cq-create-page .cq-section-step { width: 42px; height: 42px; flex-basis: 42px; font-size: 1.1rem; }
  .cq-create-page .question-total { align-self: flex-start; }
  .cq-create-page .context-help-actions { min-height: 30px; margin: 0 0 7px; }
  .cq-create-page .question-method-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
  .cq-create-page .question-method-grid > .question-method { min-height: 118px; padding-inline: 7px; }
  .cq-create-page .question-method-grid .question-method > span:nth-last-child(2) { font-size: .84rem; }
  .cq-create-page .question-method-grid .question-method small { font-size: .7rem; }
  .cq-create-page .bank-title { flex-wrap: wrap; }
  .cq-create-page .bank-title h2 { flex: 1 1 calc(100% - 58px); }
  .cq-create-page .bank-actions > button,
  .cq-create-page .bank-actions > details { flex: 1 1 calc(50% - 8px); }
  .cq-create-page .bank-actions > details > summary { justify-content: center; width: 100%; }
  .cq-create-page .bank-actions .btn,
  .cq-create-page .bank-actions .primary { justify-content: center; width: 100%; }
  .cq-create-page .launch-header p { margin-left: 0; }
  .cq-create-page .launch-panel .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cq-create-page .activity-cards { grid-column: 1 / -1; }
  .cq-create-page .activity-cards,
  .cq-create-page #launchActivityBtn { width: 100%; min-width: 0; }
  .cq-create-page .app::before,
  .cq-create-page .app::after { opacity: .42; }
}

@media (max-width: 410px) {
  .cq-create-page .home-banner .home-nav-icon-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cq-create-page .home-banner .home-nav-icon-button { flex-basis: 44px; }
  .cq-create-page .question-method-grid { gap: 8px; }
  .cq-create-page .question-method-grid > .question-method { min-height: 112px; }
}

/* ===== Créer : pictogrammes harmonisés et aperçu joueur 2026 ===== */
.cq-create-page .cq-ui-icon,
.cq-create-page .preview-correct-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  vertical-align: -.18em;
}

.cq-create-page img.cq-ui-icon {
  object-fit: contain;
  filter: invert(38%) sepia(74%) saturate(991%) hue-rotate(185deg);
}

.cq-create-page .local-storage-notice,
.cq-create-page .bank-origin-badge,
.cq-create-page .bank-library-card-actions > button,
.cq-create-page .bank-library-card-actions > details > summary,
.cq-create-page .bank-library-card-actions .export-menu-options button,
.cq-create-page .question-compact-actions > button,
.cq-create-page [data-formula-action="preview"],
.cq-create-page #previewConsultedBankBtn {
  align-items: center;
  gap: 7px;
}

.cq-create-page .local-storage-notice { display: flex; }
.cq-create-page .local-storage-notice .cq-ui-icon { margin-top: 1px; }
.cq-create-page .bank-origin-badge { gap: 5px; }
.cq-create-page .bank-origin-badge .cq-ui-icon { width: 14px; height: 14px; flex-basis: 14px; }

.cq-create-page .bank-library-card-actions > button,
.cq-create-page .bank-library-card-actions > details > summary,
.cq-create-page .bank-library-card-actions .export-menu-options button,
.cq-create-page .question-compact-actions > button,
.cq-create-page [data-formula-action="preview"],
.cq-create-page #previewConsultedBankBtn {
  display: inline-flex;
}

.cq-create-page .question-drag-handle .cq-ui-icon { width: 20px; height: 20px; }
.cq-create-page .question-compact-actions .icon-btn .cq-ui-icon { width: 17px; height: 17px; }

.cq-create-page .preview-modal-content {
  display: flex;
  width: min(1040px, 96vw);
  max-width: 1040px;
  height: min(820px, 92dvh);
  max-height: 92dvh;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(40, 100, 216, .14);
  border-radius: 26px;
  background: #f3f6fb;
  box-shadow: 0 24px 70px rgba(19, 45, 105, .24);
  flex-direction: column;
}

.cq-create-page .preview-modal-content .preview-header {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  min-height: 78px;
  padding: 14px 20px;
  color: #fff;
  background: linear-gradient(112deg, #174aa8 0%, #0f3485 58%, #12347e 100%);
  box-shadow: 0 7px 20px rgba(20, 55, 134, .18);
}

.cq-create-page .preview-title-group {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.cq-create-page .preview-title-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 14px;
}

.cq-create-page .preview-title-icon img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
}

.cq-create-page .preview-title-group h2,
.cq-create-page .preview-title-group p { margin: 0; }
.cq-create-page .preview-title-group h2 { color: #fff; font-size: clamp(1.15rem, 2vw, 1.45rem); }
.cq-create-page .preview-title-group p { margin-top: 3px; color: #dbeafe; font-size: .82rem; }

.cq-create-page .preview-close-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .28);
  box-shadow: none;
}

.cq-create-page .preview-close-button:hover,
.cq-create-page .preview-close-button:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, .22);
}

.cq-create-page .preview-progress-row {
  display: flex;
  flex: 0 0 auto;
  min-height: 52px;
  padding: 9px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cq-create-page .preview-counter,
.cq-create-page .preview-local-note {
  margin: 0;
  font-size: .84rem;
  font-weight: 800;
}

.cq-create-page .preview-counter {
  padding: 6px 11px;
  color: #fff;
  background: #2864d8;
  border-radius: 999px;
}

.cq-create-page .preview-local-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #52627a;
}

.cq-create-page .student-preview-card {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 20px;
  padding: clamp(18px, 2.5vw, 28px);
  overflow-y: auto;
  flex-direction: column;
  background:
    radial-gradient(circle at 100% 0, rgba(92, 202, 245, .13), transparent 190px),
    #fff;
  border: 1px solid #dce6f5;
  border-radius: 21px;
  box-shadow: 0 10px 28px rgba(23, 36, 59, .09);
  scrollbar-color: #a8bce6 transparent;
  scrollbar-width: thin;
}

.cq-create-page .student-preview-card > * {
  flex-shrink: 0;
}

.cq-create-page .student-preview-card #previewExplanation {
  flex: 0 0 auto;
  white-space: normal;
}

.cq-create-page .student-preview-card #previewExplanationText {
  white-space: pre-wrap;
}

.cq-create-page .student-preview-card #previewTeamBadge {
  width: fit-content;
  margin: 0 0 10px;
  color: #0f766e;
  background: #dff7f2;
  border: 1px solid #a7e4d9;
}

.cq-create-page .student-preview-card #previewQuestionText {
  max-width: 900px;
  margin: 0 auto 14px;
  color: #152d66;
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
}

.cq-create-page .student-preview-card #previewQuestionImage {
  width: min(620px, 100%);
  margin: 0 auto 14px;
}

.cq-create-page .student-preview-card #previewQuestionImage img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(220px, 30dvh);
  margin: 0 auto;
  object-fit: contain;
  border-radius: 14px;
}

.cq-create-page .student-preview-card .answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.cq-create-page .student-preview-card .answers[data-answer-count="1"] { grid-template-columns: 1fr; }
.cq-create-page .student-preview-card .answers[data-answer-count] > :last-child:nth-child(odd) { grid-column: 1 / -1; }

.cq-create-page .student-preview-card .answerBtn {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: clamp(76px, 11dvh, 112px);
  margin: 0;
  padding: 14px 16px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #16305e;
  background: #f7faff;
  border: 2px solid #cbd9ee;
  border-radius: 17px;
  box-shadow: 0 5px 14px rgba(23, 36, 59, .06);
  font-size: clamp(.92rem, 1.55vw, 1.08rem);
  font-weight: 750;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
  white-space: normal;
}

.cq-create-page .student-preview-card .answerBtn:hover { transform: none; }
.cq-create-page .student-preview-card .correct-preview {
  color: #065f46 !important;
  background: #dcfce7 !important;
  border-color: #0d9488 !important;
}

.cq-create-page .preview-correct-marker {
  display: inline-grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  color: #fff;
  background: #0d9488;
  border-radius: 999px;
}

.cq-create-page .preview-correct-icon { width: 15px; height: 15px; }
.cq-create-page .preview-correction-note {
  display: inline-flex;
  margin: 13px 0 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #52627a;
  background: transparent;
  font-size: .82rem;
  text-align: center;
}

.cq-create-page .preview-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  flex: 0 0 auto;
  justify-content: center;
  gap: 12px;
  margin: 0;
  padding: 14px 20px 18px;
}

.cq-create-page .preview-navigation button {
  display: inline-flex;
  min-width: 210px;
  min-height: 46px;
  margin: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 13px;
}

@media (max-width: 600px) {
  .cq-create-page .preview-modal-content {
    width: calc(100vw - 12px);
    height: calc(100dvh - 12px);
    max-height: calc(100dvh - 12px);
    border-radius: 20px;
  }

  .cq-create-page .preview-modal-content .preview-header { min-height: 66px; padding: 10px 12px; }
  .cq-create-page .preview-title-group { gap: 9px; }
  .cq-create-page .preview-title-icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
  .cq-create-page .preview-title-icon img { width: 21px; height: 21px; }
  .cq-create-page .preview-title-group p { display: none; }
  .cq-create-page .preview-close-button { padding: 7px 9px; }
  .cq-create-page .preview-progress-row { min-height: 45px; padding: 7px 11px; }
  .cq-create-page .preview-local-note { font-size: .75rem; }
  .cq-create-page .student-preview-card { margin-inline: 9px; padding: 16px 13px; border-radius: 17px; }
  .cq-create-page .student-preview-card #previewQuestionText { font-size: clamp(1.15rem, 6vw, 1.5rem); }
  .cq-create-page .student-preview-card .answers { grid-template-columns: 1fr; gap: 9px; margin-top: 4px; }
  .cq-create-page .student-preview-card .answers[data-answer-count] > :last-child:nth-child(odd) { grid-column: auto; }
  .cq-create-page .student-preview-card .answerBtn { min-height: 62px; padding: 11px 12px; }
  .cq-create-page .preview-navigation {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 9px 12px;
  }
  .cq-create-page .preview-navigation button { min-width: 0; min-height: 50px; padding: 8px; font-size: .82rem; }
}

@media (max-width: 370px) {
  .cq-create-page .preview-title-group h2 { font-size: 1rem; }
  .cq-create-page .preview-close-button .cq-ui-icon { display: none; }
  .cq-create-page .preview-local-note { max-width: 145px; }
}

.cq-create-page #aiQuestionPanelTitle,
.cq-create-page #importQuestionPanelTitle,
.cq-create-page #aiPreviewTitle,
.cq-create-page #helpModalTitle,
.cq-create-page .help-modal-content h3,
.cq-create-page .help-tip strong,
.cq-create-page #copyPromptBtn,
.cq-create-page #playConsultedBankBtn,
.cq-create-page #proposeDeferredBankBtn,
.cq-create-page #launchActivityBtn {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cq-create-page .import-drop-icon img {
  display: block;
  width: 48px;
  height: 48px;
  margin: auto;
  filter: invert(38%) sepia(74%) saturate(991%) hue-rotate(185deg);
}

.cq-create-page .cq-icon-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cq-create-page .cq-icon-label::before,
.cq-create-page .cq-cloud-label::before,
.cq-create-page #questionImageStats::before,
.cq-create-page .bank-sync-state::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background: currentColor;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.cq-create-page .cq-icon-ai::before {
  mask-image: url("../graphiques/icones/ia.svg");
  -webkit-mask-image: url("../graphiques/icones/ia.svg");
}

.cq-create-page .cq-icon-add::before,
.cq-create-page .cq-icon-image::before,
.cq-create-page #questionImageStats::before {
  mask-image: url("../graphiques/icones/ajouter.svg");
  -webkit-mask-image: url("../graphiques/icones/ajouter.svg");
}

.cq-create-page .cq-cloud-label,
.cq-create-page #questionImageStats,
.cq-create-page .bank-sync-state {
  align-items: center;
  gap: 6px;
}

.cq-create-page .cq-cloud-label,
.cq-create-page #questionImageStats { display: flex; }

.cq-create-page .cq-cloud-label::before,
.cq-create-page .bank-sync-state::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 16.6A4.5 4.5 0 0 0 18 8h-1.3A7 7 0 0 0 3.2 10.5 4.5 4.5 0 0 0 6 19h12a4 4 0 0 0 2-2.4z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 16.6A4.5 4.5 0 0 0 18 8h-1.3A7 7 0 0 0 3.2 10.5 4.5 4.5 0 0 0 6 19h12a4 4 0 0 0 2-2.4z'/%3E%3C/svg%3E");
}

.cq-create-page #nuageFilesTitle::before { width: 24px; height: 24px; flex-basis: 24px; }
.cq-create-page #questionImageStats::before,
.cq-create-page .bank-sync-state::before { width: 14px; height: 14px; flex-basis: 14px; }

.cq-create-page .footer-link-icon {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  vertical-align: -.18em;
  filter: invert(38%) sepia(74%) saturate(991%) hue-rotate(185deg);
}

.cq-create-page #helpModal h3 { display: flex; align-items: center; gap: 8px; }

/* TEST UX — Boutons et menus moins gras sur la page Créer */

.cq-create-page .bank-actions button,
.cq-create-page .bank-actions summary,
.cq-create-page .export-menu-options button,
.cq-create-page .cq-library-actions button,
.cq-create-page .cq-library-actions summary,
.cq-create-page .cq-library-menu-panel button,
.cq-create-page .cq-library-menu-heading {
  font-weight: 600;
}


/* TEST UX — Boutons des cartes de banques */
.cq-create-page .bank-card button {
  font-weight: 600;
}

/* ===== Éditeur de questions : finition de la modale ===== */
.cq-create-page #questionEditModal {
  padding: 16px;
}

.cq-create-page .question-edit-modal-content {
  display: flex;
  flex-direction: column;
  width: min(880px, 96vw);
  max-height: min(92dvh, 900px);
  padding: 0;
  overflow: hidden;
  border: 1px solid #d9e4f3;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(19, 40, 86, .24);
}

.cq-create-page #questionEditModal .question-edit-header {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  align-items: center;
  padding: 18px 22px;
  color: #fff;
  background:
    radial-gradient(circle at 86% 10%, rgba(255, 255, 255, .13) 0 64px, transparent 65px),
    linear-gradient(135deg, #213f91, #173475);
}

.cq-create-page #questionEditModal .question-edit-header h2 {
  color: #fff;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -.015em;
}

.cq-create-page #questionEditModal .question-edit-header p {
  margin-top: 3px;
  color: #dbeafe;
  font-weight: 500;
}

.cq-create-page #questionEditModal .question-modal-close {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 12px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.cq-create-page #questionEditModal .question-modal-close:hover {
  background: rgba(255, 255, 255, .2);
}

.cq-create-page #questionEditModal .question-modal-close svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.cq-create-page #questionEditForm {
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 20px 22px 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  gap: 11px;
  background: linear-gradient(180deg, #f8fbff 0, #fff 150px);
  scrollbar-gutter: stable;
}

.cq-create-page #questionEditForm > label,
.cq-create-page .question-edit-image-fieldset > label,
.cq-create-page .question-edit-answers label {
  margin: 5px 0 -4px;
  color: #253b65;
  font-weight: 600;
}

.cq-create-page #questionEditForm select,
.cq-create-page #questionEditForm input:not([type="checkbox"]):not([type="file"]),
.cq-create-page #questionEditForm textarea {
  min-width: 0;
  min-height: 46px;
  margin: 0;
  border: 1px solid #cbd9ec;
  border-radius: 12px;
  background: #fff;
  color: #172b50;
  box-shadow: inset 0 1px 2px rgba(19, 40, 86, .03);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.cq-create-page #questionEditForm textarea {
  min-height: 108px;
  line-height: 1.5;
}

.cq-create-page #questionEditForm select:hover,
.cq-create-page #questionEditForm input:not([type="checkbox"]):not([type="file"]):hover,
.cq-create-page #questionEditForm textarea:hover {
  border-color: #9db7dc;
}

.cq-create-page #questionEditForm select:focus,
.cq-create-page #questionEditForm input:not([type="checkbox"]):not([type="file"]):focus,
.cq-create-page #questionEditForm textarea:focus {
  border-color: #2864d8;
  outline: none;
  box-shadow: 0 0 0 3px rgba(40, 100, 216, .16);
}

.cq-create-page .question-formula-assistant {
  position: relative;
  top: auto;
  z-index: 1;
  gap: 10px;
  margin: 5px 0 2px;
  padding: 12px 14px;
  border-color: #bfd5f2;
  border-radius: 14px;
  background: #eff6ff;
  box-shadow: none;
}

.cq-create-page #toggleQuestionFormulaBtn {
  min-height: 38px;
  border-color: #a9c5eb;
  background: #fff;
  color: #213f91;
  font-weight: 600;
}

.cq-create-page .question-formula-target-label {
  color: #526888;
  font-weight: 500;
}

.cq-create-page .question-formula-toolbar .mini-actions {
  gap: 7px;
}

.cq-create-page .question-formula-toolbar .btn {
  min-height: 38px;
  border-radius: 10px;
  font-weight: 600;
}

.cq-create-page .question-formula-preview {
  border-color: #b9cce8;
  border-radius: 11px;
  background: #fff;
}

.cq-create-page .question-edit-image-fieldset,
.cq-create-page .question-edit-answers {
  min-width: 0;
  gap: 11px;
  margin: 7px 0;
  padding: 15px;
  border-color: #d7e3f3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(31, 63, 127, .045);
}

.cq-create-page .question-edit-image-fieldset {
  background: linear-gradient(135deg, #fff, #f6fbff);
}

.cq-create-page .question-edit-image-fieldset legend,
.cq-create-page .question-edit-answers legend {
  color: #213f91;
  font-weight: 600;
}

.cq-create-page .question-edit-image-preview {
  width: min(100%, 420px);
  border-color: #cbd9ec;
  border-radius: 13px;
  background: #f3f6fb;
}

.cq-create-page .question-edit-image-fieldset .mini-actions {
  margin: 0;
  gap: 8px;
}

.cq-create-page .question-edit-answer-row {
  gap: 11px;
  padding: 9px;
  border: 1px solid #e2eaf5;
  border-radius: 13px;
  background: #f8fafc;
}

.cq-create-page .question-edit-correct-toggle {
  justify-content: center;
  min-width: 154px;
  min-height: 44px;
  margin: 0;
  padding: 8px 11px;
  border-color: #bedbc9;
  border-radius: 11px;
  background: #f1faf5;
  color: #24613f;
  font-weight: 600;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.cq-create-page .question-edit-correct-toggle:has(input:checked) {
  border-color: #0d9488;
  background: #e7f8f5;
  color: #0b625d;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, .08);
}

.cq-create-page .question-edit-correct-toggle:focus-within {
  outline: 3px solid rgba(40, 100, 216, .2);
  outline-offset: 2px;
}

.cq-create-page .question-edit-correct-toggle input {
  accent-color: #0d9488;
}

.cq-create-page .question-edit-error {
  padding: 11px 13px;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: 10px;
  background: #fff7f7;
}

.cq-create-page .question-edit-navigation {
  margin-top: 9px;
}

.cq-create-page .question-edit-navigation .btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  font-weight: 600;
}

.cq-create-page .question-edit-navigation .cq-ui-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cq-create-page .question-edit-navigation strong {
  color: #526888;
  font-weight: 600;
}

.cq-create-page .question-edit-footer {
  position: sticky;
  z-index: 4;
  bottom: 0;
  gap: 9px;
  margin: 4px -22px 0;
  padding: 14px 22px 16px;
  border-top: 1px solid #dbe5f2;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -10px 24px rgba(19, 40, 86, .06);
  backdrop-filter: blur(8px);
}

.cq-create-page .question-edit-footer button {
  min-height: 44px;
  font-weight: 600;
}

.cq-create-page #finishQuestionEditBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cq-create-page #finishQuestionEditBtn::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background: currentColor;
  mask: url("../graphiques/icones/sauvegarder.svg") center / contain no-repeat;
  -webkit-mask: url("../graphiques/icones/sauvegarder.svg") center / contain no-repeat;
}

.cq-create-page #questionEditModal button:focus-visible,
.cq-create-page #questionEditModal select:focus-visible,
.cq-create-page #questionEditModal input:focus-visible,
.cq-create-page #questionEditModal textarea:focus-visible {
  outline: 3px solid rgba(40, 100, 216, .28);
  outline-offset: 2px;
}

.cq-create-page #questionEditModal .question-modal-close:focus-visible {
  outline-color: rgba(255, 255, 255, .8) !important;
}

@media (max-width: 620px) {
  .cq-create-page #questionEditModal {
    padding: 6px;
  }

  .cq-create-page .question-edit-modal-content {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
    border-radius: 18px;
  }

  .cq-create-page #questionEditModal .question-edit-header {
    padding: 13px 14px;
  }

  .cq-create-page #questionEditModal .question-edit-header h2 {
    font-size: 1.18rem;
  }

  .cq-create-page #questionEditModal .question-modal-close {
    width: 40px;
    height: 40px;
  }

  .cq-create-page #questionEditForm {
    padding: 15px 14px 0;
    scrollbar-gutter: auto;
  }

  .cq-create-page .question-formula-assistant,
  .cq-create-page .question-edit-image-fieldset,
  .cq-create-page .question-edit-answers {
    padding: 12px;
  }

  .cq-create-page .question-formula-launcher {
    align-items: flex-start;
    flex-direction: column;
  }

  .cq-create-page .question-formula-toolbar .mini-actions > * {
    flex: 1 1 130px;
  }

  .cq-create-page .question-edit-answer-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .cq-create-page .question-edit-correct-toggle {
    width: 100%;
    min-width: 0;
  }

  .cq-create-page .question-edit-navigation {
    gap: 8px;
  }

  .cq-create-page .question-edit-navigation .btn {
    justify-content: center;
    min-width: 0;
    padding-inline: 10px;
  }

  .cq-create-page .question-edit-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-inline: -14px;
    padding: 12px 14px 14px;
  }

  .cq-create-page .question-edit-footer .btn,
  .cq-create-page .question-edit-footer .primary {
    width: 100%;
    min-width: 0;
    padding-inline: 10px;
  }
}
.cq-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cq-brand-mark {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex-shrink: 0;
}

.cq-brand-text h1 {
  font-family: "Inter", sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.1;
  color: #FFFFFF;
  margin: 0;
}

.cq-brand-text h1 span {
  color: #38BDF8;
}

.cq-brand-text p {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #FFFFFF;
  margin: 5px 0 0;
}

.cq-brand {
  display: flex;
  align-items: center;
}

.cq-brand-logo {
  display: block;
  width: 280px;
  /* au lieu de 310px */
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

@media (max-width: 600px) {
  .cq-brand-logo {
    width: 180px;
  }
}
.cq-brand a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.cq-brand-logo {
  display: block;
  width: 220px;
  max-width: 100%;
  height: auto;
  transition: opacity 0.2s ease;
}

.cq-brand a:hover .cq-brand-logo {
  opacity: 0.85;
}

/* Styles statiques de creer.html : conserver les trois blocs dans leur ordre d'origine. */

#questionEditModal.import-edit-mode label[for="questionEditType"], #questionEditModal.import-edit-mode #questionEditType { display:none !important; }
#importQuestionPanel .import-format-short { margin: 10px 0 6px; }
#importQuestionPanel .import-format-details { margin: 0 0 14px; }
#importQuestionPanel .import-analysis-summary { border:1px solid #d7e0ed; border-radius:12px; padding:14px; margin:12px 0; }
#importQuestionPanel .import-analysis-summary h4 { margin:0 0 12px; }
#importQuestionPanel .import-analysis-counters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
#importQuestionPanel .import-analysis-counter { text-align:center; display:flex; flex-direction:column; gap:4px; min-width:0; }
#importQuestionPanel .import-analysis-counter strong { font-size:1.45rem; }
#importQuestionPanel .import-analysis-counter span { font-size:.78rem; overflow-wrap:anywhere; }
#importQuestionPanel .import-analysis-notices { margin-top:12px; }
#importQuestionPanel .import-analysis-notices summary { cursor:pointer; }
@media(max-width:440px) { #importQuestionPanel .import-analysis-counters { grid-template-columns:repeat(2,minmax(0,1fr)); } }
#importQuestionPanel .import-compact-list { margin: 12px 0; }
#importQuestionPanel .import-compact-card { display:flex; align-items:center; gap:12px; }
#importQuestionPanel .import-compact-selection { flex:0 0 auto; display:flex; align-items:center; justify-content:center; padding:8px; }
#importQuestionPanel .import-compact-selection input { width:18px; height:18px; margin:0; }
#importQuestionPanel .import-compact-card .question-compact-main { min-width:0; flex:1; }
#importQuestionPanel .import-question-warning { color:#a65d00; font-size:.85em; }
@media(max-width:600px) { #importQuestionPanel .import-compact-card { flex-wrap:wrap; } #importQuestionPanel .import-compact-card .question-compact-actions { margin-left:auto; } }

/* Synthèse compacte : libellé, compteurs et état des images sur la même ligne. */
#importQuestionPanel .import-analysis-summary { display:flex; align-items:center; flex-wrap:wrap; column-gap:1.25rem; row-gap:.55rem; padding:10px 14px; }
#importQuestionPanel .import-analysis-summary h4 { margin:0; font-size:.88rem; white-space:nowrap; }
#importQuestionPanel .import-analysis-counters { display:flex; flex:1 1 auto; align-items:center; justify-content:flex-start; flex-wrap:wrap; column-gap:1.3rem; row-gap:.4rem; min-width:0; }
#importQuestionPanel .import-analysis-counter { display:inline-flex; flex-direction:row; align-items:baseline; gap:.35rem; text-align:left; white-space:nowrap; }
#importQuestionPanel .import-analysis-counter strong { font-size:1rem; line-height:1.3; }
#importQuestionPanel .import-analysis-counter span { font-size:.84rem; }
#importQuestionPanel .import-image-note { margin:0; font-size:.84rem; color:#475569; }
#importQuestionPanel .import-analysis-notices { flex-basis:100%; margin-top:0; }
@media(max-width:440px) { #importQuestionPanel .import-analysis-counters { display:flex; flex-wrap:wrap; } }

/* En-têtes harmonisés, uniquement sur l'écran principal de création. */
#questionsScreen .cq-section-title { display:flex; align-items:center; gap:12px; }
#questionsScreen .cq-section-icon { display:inline-flex; align-items:center; justify-content:center; flex:0 0 36px; width:36px; height:36px; border-radius:11px; background:#2045b5; color:#fff; box-shadow:0 5px 12px rgba(32,69,181,.16); }
#questionsScreen .cq-section-icon svg { width:19px; height:19px; }
#questionsScreen .bank-title .bank-icon svg { width:19px; height:19px; }

.public-catalog-filters { display:flex; flex-wrap:wrap; gap:12px; margin:16px 0; }
.public-catalog-filters label { display:flex; flex-direction:column; gap:6px; flex:1 1 180px; min-width:0; }
.public-catalog-filters input, .public-catalog-filters select { width:100%; min-width:0; box-sizing:border-box; }
.public-catalog-credits { margin-top:20px; }
.public-catalog-credits summary { cursor:pointer; font-weight:600; }

/* Actions CollabQuiz : mêmes boutons et menu flottant que Mes banques. */
.public-bank-card:has(.community-bank-actions) { flex-wrap: wrap; }
.public-bank-card:has(.community-bank-actions) .public-bank-content { flex: 1 1 240px; min-width: 0; }
.community-bank-actions { flex: 0 1 auto; max-width: 100%; align-items: center; }
.community-bank-actions > .public-bank-action,
.community-bank-actions > .community-bank-more { flex: 0 0 auto; }
.community-bank-actions .public-bank-action,
.community-bank-more > summary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.community-bank-actions svg { width: 18px; height: 18px; flex: 0 0 18px; }
.community-bank-more-options { max-width: calc(100vw - 16px); min-width: min(250px, calc(100vw - 16px)); }
.community-bank-more-options .btn { white-space: normal; display: inline-flex; align-items: center; gap: 7px; }
.community-bank-more-options svg { width: 18px; height: 18px; flex: 0 0 18px; }
@media (max-width: 700px) {
  .community-bank-actions { width: 100%; justify-content: flex-start; }
}
@media (max-width: 650px) {
  .public-bank-card:has(.community-bank-actions) .public-bank-content { flex: 0 1 auto; width: 100%; }
}

/* Ne pas présenter les résultats précédents sous la source en cours de chargement. */
#bacCatalogList[aria-busy="true"],
#bacCatalogList[aria-busy="true"] + .public-catalog-pagination { visibility: hidden; }
