/* Interface de l'éditeur : barre du haut, colonne latérale (import, tuto, étapes), zone d'édition. Variables : visionneuse.css. */
body.app { font-size: 16px; line-height: 1.5; }
.app-barre { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 20px; background: color-mix(in srgb, var(--carte) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--bord); }
.marque { display: flex; align-items: center; gap: 10px; }
.marque h1 { font-size: 1.25rem; margin: 0; }
.logo { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-texte); display: grid; place-items: center; font-weight: 800; }
.statut { margin: 12px 20px 0; padding: 10px 14px; border-radius: 10px; background: var(--accent-doux); font-weight: 600; }
.statut:empty { display: none; }
.app-corps { display: grid; gap: 20px; max-width: 1500px; margin: 0 auto; padding: 20px; align-items: start; }
.app-lateral { display: grid; gap: 16px; position: sticky; top: 72px; max-height: calc(100vh - 92px); overflow-y: auto; padding-right: 2px; }
.edition { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px 18px; box-shadow: var(--ombre); min-width: 0; }
.carte h2 { font-size: 1.05rem; margin: 0 0 10px; }
.carte h3 { font-size: 0.95rem; margin: 16px 0 6px; }
label { display: block; font-weight: 600; font-size: 0.9rem; margin: 12px 0 4px; }
input[type='text'], input[type='password'], textarea { width: 100%; font: inherit; padding: 9px 11px; border: 1px solid var(--bord); border-radius: 10px; background: var(--fond); color: var(--texte); }
textarea { resize: vertical; min-height: 9rem; }
input:focus-visible, textarea:focus-visible, .depot:focus-within { outline: 3px solid var(--accent); outline-offset: 1px; }
.rangee { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.rangee.centre { justify-content: center; }
.bouton-principal { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); font-weight: 600; }
.bouton-principal:hover { filter: brightness(1.08); }
.mini { font: inherit; font-size: 0.85rem; cursor: pointer; border: 1px solid var(--bord); background: var(--carte); color: var(--texte); border-radius: 8px; padding: 2px 8px; flex: none; }
.mini:hover:not(:disabled) { border-color: var(--accent); }
.mini:disabled, .bouton:disabled { opacity: 0.4; cursor: default; }
.cache { display: none; }
.aide { color: var(--discret); font-size: 0.88rem; margin: 6px 0; }
.pied-app { text-align: center; }
.depot { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 18px 12px; border: 2px dashed var(--bord); border-radius: 12px; transition: border-color 0.15s, background 0.15s; }
.depot span { color: var(--discret); font-size: 0.85rem; }
.depot.survol { border-color: var(--accent); background: var(--accent-doux); }
.liste-etapes { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; }
.liste-etapes li { display: flex; gap: 4px; align-items: center; min-width: 0; }
.etape-choix { flex: 1 1 auto; min-width: 0; text-align: left; font: inherit; font-size: 0.92rem; cursor: pointer; padding: 7px 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--texte); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etape-choix:hover { background: var(--fond); }
.liste-etapes li.courante .etape-choix { background: var(--accent-doux); border-color: var(--accent); font-weight: 700; }
.liste-quiz { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.liste-quiz li { display: flex; gap: 8px; justify-content: space-between; align-items: flex-start; font-size: 0.92rem; padding: 8px 10px; border: 1px solid var(--bord); border-radius: 10px; }
.liste-quiz li span, .liste-quiz li a { min-width: 0; overflow-wrap: anywhere; }
.liste-quiz li.aide { border-style: dashed; color: var(--discret); }
.apercu-image { max-width: 100%; border: 1px solid var(--bord); border-radius: 10px; margin-bottom: 8px; }
.bloc-image { margin-top: 12px; }
#apercu-etape .etape { box-shadow: none; padding: 14px; }
dialog.apercu { width: min(900px, 96vw); max-height: 96vh; border: 0; border-radius: var(--rayon); padding: 12px; background: var(--fond); color: var(--texte); }
dialog.apercu::backdrop, dialog.annot::backdrop, dialog.reglages::backdrop { background: rgb(0 0 0 / 60%); }
dialog.annot, dialog.reglages { border: 0; border-radius: var(--rayon); padding: 18px; background: var(--carte); color: var(--texte); max-width: 96vw; }
.annot-zone { max-height: 70vh; overflow: auto; margin: 8px 0; }
.annot-canvas { max-width: 100%; height: auto; cursor: crosshair; touch-action: none; display: block; }
.annot-barre, .annot-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.annot-barre [aria-pressed='true'] { border-color: var(--accent); background: var(--accent-doux); font-weight: 700; }
.reglages { width: min(520px, 96vw); }
@media (max-width: 1180px) { .edition { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 880px) {
  .app-corps { padding: 12px 12px 110px; }
  .app-lateral { position: static; max-height: none; overflow: visible; }
  .app-barre { padding: 8px 12px; }
}

/* Parcours guidé : phases, en-tête de phase, barre de progression fixe en bas. */
.app-corps { padding-bottom: 110px; }
.phase { display: grid; gap: 16px; min-width: 0; }
.phase[hidden] { display: none; }
.phase-entete { margin-bottom: 4px; }
.phase-compteur { margin: 0; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.phase-entete h2 { font-size: 1.6rem; margin: 2px 0 4px; letter-spacing: -0.01em; }
.phase-consigne { margin: 0; color: var(--discret); max-width: 70ch; }
.phase-importer, .phase-quiz, .phase-publier { max-width: 860px; margin: 0 auto; width: 100%; }
.phase-importer .depot { padding: 36px 16px; }
.phase-grille { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.centre-texte { text-align: center; }
.recap-liste { margin: 6px 0 0; padding-left: 20px; }
.parcours { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; background: color-mix(in srgb, var(--carte) 94%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--bord); box-shadow: 0 -4px 16px rgb(0 0 0 / 8%); }
.parcours .bouton { min-width: 150px; }
.stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex: 1; justify-content: center; min-width: 0; }
.stepper li { display: flex; align-items: center; }
.stepper li + li::before { content: ''; width: 28px; height: 2px; background: var(--bord); margin-right: 6px; }
.stepper-lien { display: flex; align-items: center; gap: 8px; font: inherit; font-size: 0.92rem; cursor: pointer; padding: 6px 12px 6px 6px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--discret); }
.stepper-lien:hover { background: var(--fond); }
.stepper-lien:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pastille { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; background: var(--fond); border: 1px solid var(--bord); color: var(--discret); }
.stepper-lien.courant { color: var(--texte); font-weight: 700; background: var(--accent-doux); border-color: var(--accent); }
.stepper-lien.courant .pastille { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
.stepper-lien.fait .pastille { background: var(--juste); border-color: var(--juste); color: #fff; font-size: 0; }
.stepper-lien.fait .pastille::after { content: '✓'; font-size: 0.85rem; }
.parcours #suivant[hidden] { display: block; visibility: hidden; }
@media (max-width: 1180px) { .phase-grille { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .parcours { padding: 8px 10px; gap: 6px; }
  .parcours .bouton { min-width: 0; padding: 8px 10px; }
  .stepper li + li::before { display: none; }
  .stepper li:not(:has(.courant)) { display: none; }
  .stepper-lien { padding: 4px 12px 4px 4px; }
}

/* Accueil : lancer un tuto, rechercher, catalogue et tutos de l'auteur. */
.phase-accueil { max-width: 980px; margin: 0 auto; width: 100%; }
.accueil-hero { padding: 28px 26px; background: linear-gradient(135deg, var(--accent-doux), var(--carte)); }
.accueil-hero h2 { font-size: 1.7rem; margin-bottom: 6px; letter-spacing: -0.01em; }
.bouton.grand { padding: 12px 22px; font-size: 1.05rem; }
.accueil-recherche input { width: 100%; font: inherit; font-size: 1.05rem; padding: 12px 16px; border: 1px solid var(--bord); border-radius: 999px; background: var(--carte); color: var(--texte); box-shadow: var(--ombre); }
.tuto-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tuto-carte { border: 1px solid var(--bord); border-radius: 12px; padding: 14px 16px; background: var(--fond); min-width: 0; }
.tuto-carte h3 { margin: 0 0 4px; font-size: 1rem; overflow-wrap: anywhere; }
.tuto-carte h3 a { color: var(--texte); text-decoration: none; }
.tuto-carte h3 a:hover { color: var(--accent); text-decoration: underline; }
.tuto-resume { margin: 0 0 6px; color: var(--discret); font-size: 0.92rem; }
.tuto-liste > .aide { grid-column: 1 / -1; }
.visibilite { border: 1px solid var(--bord); border-radius: 12px; padding: 8px 14px 12px; margin: 14px 0 10px; display: grid; gap: 8px; }
.visibilite legend { font-weight: 600; font-size: 0.9rem; padding: 0 6px; }
.option { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 0; cursor: pointer; }
.option input { margin-top: 4px; }
.option span { display: grid; }
.option small { color: var(--discret); }
.parcours[hidden] { display: none; }

/* Chapitres dans la liste, images multiples dans l'éditeur, rapport d'import. */
.liste-etapes li.chapitre-ligne .etape-choix { font-weight: 700; color: var(--accent); background: transparent; border-bottom: 1px solid var(--bord); border-radius: 0; margin-top: 8px; }
.liste-etapes li.chapitre-ligne.courante .etape-choix { background: var(--accent-doux); border-radius: 9px; }
.image-ligne { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--bord); border-radius: 12px; margin-bottom: 10px; }
.image-ligne .apercu-image { margin-bottom: 0; max-height: 220px; object-fit: contain; background: var(--fond); }
.rapport { border-left: 5px solid var(--juste); }
.rapport h2 { margin-bottom: 6px; }
#etape h2.chapitre-titre, #apercu-etape h2.chapitre-titre { font-size: 1.5rem; }

.liste-etapes li.sous-chapitre { margin-left: 16px; padding-left: 8px; border-left: 2px solid var(--bord); }

.choix-documents { display: grid; gap: 8px; margin: 10px 0; }
.choix-document { text-align: left; overflow-wrap: anywhere; }
