/* Page « Créer » (composeur) : un OUTIL qui tient dans l'écran, sans défilement de la page (demande de Stéphane du 30/10),
   sur le modèle du Studio vidéo de l'appli : grand aperçu à gauche, étapes numérotées à droite, barre d'action en bas.
   Sur téléphone : une étape à la fois, avec Précédent / Suivant. S'appuie sur site-2.css et /midi/viewer.css.
   Bleu plutôt que violet, jamais de jaune, contraste fort. Le texte pour Google (et le pied du site) vient après l'outil. */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* ---------- l'outil : hauteur de l'écran moins la barre du site (--cr-nav, mesurée par create.js) ---------- */
.cr-outil{height:calc(100vh - var(--cr-nav,70px));height:calc(100dvh - var(--cr-nav,70px));min-height:540px;max-width:1440px;margin:0 auto;padding:2px 24px 0;display:flex;flex-direction:column}
.cr-tete{flex:none;display:flex;align-items:flex-end;justify-content:space-between;gap:16px;padding:0 2px 10px}
.cr-kick{display:block;font-size:12.5px;font-weight:900;letter-spacing:.14em;text-transform:uppercase;color:var(--blue2);margin-bottom:2px}
.cr-tete h1{font-size:clamp(21px,2.1vw,28px);line-height:1.15}
.cr-corps{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1.12fr) minmax(0,1fr);gap:18px}
.cr-apercu,.cr-reglages{min-height:0;background:var(--panel);border:1.5px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);display:flex;flex-direction:column;overflow:hidden}

/* ---------- aperçu (gauche) ---------- */
.cr-apercu{padding:14px}
.cr-vide{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:6px;border-radius:16px;background:radial-gradient(600px 300px at 50% 100%,rgba(37,99,235,.35),transparent 70%),#06101f;color:#c9d6f0;padding:24px;font-size:15.5px}
.cr-vide b{color:#fff;font-size:20px}
.cr-vide .cr-notes{font-size:46px;line-height:1;background:linear-gradient(135deg,#60a5fa,#22d3ee);-webkit-background-clip:text;background-clip:text;color:transparent;margin-bottom:6px}
#cr-morceau{flex:1;min-height:0;display:flex;flex-direction:column}
#cr-morceau[hidden],.cr-vide[hidden]{display:none}
.cr-entete{flex:none;display:flex;align-items:baseline;gap:10px 14px;flex-wrap:wrap;margin:0 2px 8px}
.cr-entete h2{font-size:22px}
.cr-surtitre{font-size:12px;font-weight:900;letter-spacing:.12em;text-transform:uppercase;color:var(--blue2)}
.cr-etiquettes{display:flex;flex-wrap:wrap;gap:6px}
.cr-etiquettes span{font-size:12.5px;font-weight:800;color:#1e3a8a;background:#eaf1ff;border-radius:999px;padding:2px 9px}
.cr-lecteur{flex:1;min-height:0;display:flex}
.cr-lecteur .pvv{flex:1;margin:0;display:flex;flex-direction:column;min-height:0;box-shadow:none}
.cr-lecteur .pvv-stage{flex:1;min-height:150px;aspect-ratio:auto}
.cr-actions{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:10px}
.cr-actions .btn{display:inline-flex;align-items:center;gap:8px;padding:10px 16px;font-weight:800;font-size:15.5px;border-radius:12px}
.cr-actions .btn[disabled]{opacity:.55;cursor:progress}
.cr-recomposer{margin-left:auto;font:inherit;font-weight:800;font-size:14.5px;color:var(--blue2);background:none;border:0;cursor:pointer;padding:6px 4px}
.cr-recomposer[disabled]{opacity:.5;cursor:not-allowed}

/* ---------- étapes (droite) ---------- */
.cr-onglets{flex:none;display:flex;gap:4px;padding:8px;border-bottom:1.5px solid var(--line);background:var(--panel2);overflow-x:auto;scrollbar-width:none}
.cr-onglets::-webkit-scrollbar{display:none}
.cr-onglet{flex:1 1 auto;display:flex;align-items:center;justify-content:center;gap:7px;padding:8px 10px;border:0;border-radius:12px;background:none;font:inherit;font-weight:800;font-size:14.5px;color:var(--mut);cursor:pointer;white-space:nowrap}
.cr-onglet:hover{color:var(--txt)}
.cr-onglet[aria-selected="true"]{background:#fff;color:var(--blue2);box-shadow:0 1px 4px rgba(20,33,61,.12)}
.cr-onglet:focus-visible,.cr-choix:focus-visible,.cr-pas:focus-visible{outline:3px solid rgba(37,99,235,.45);outline-offset:2px}
.cr-num{display:inline-grid;place-items:center;width:23px;height:23px;border-radius:50%;background:#e3e9f5;color:var(--mut);font-size:12.5px;font-weight:900;flex:none}
.cr-onglet[aria-selected="true"] .cr-num{background:var(--grad);color:#fff}
.cr-onglet.pret .cr-num{background:#10b981;color:#fff}
.cr-panneaux{flex:1;min-height:0;overflow:auto;padding:16px 18px 18px}
.cr-panneau[hidden]{display:none}
.cr-q{font-size:19px;margin:0 0 12px;display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.cr-q small{font-size:14px;font-weight:700;color:var(--mut)}
.cr-sous{margin:14px 0 8px;font-weight:900;font-size:14.5px}
.cr-q + .cr-sous{margin-top:0}

.cr-choix{position:relative;font:inherit;color:var(--txt);background:#fff;border:2px solid var(--line2);border-radius:14px;cursor:pointer;transition:border-color .15s,background .15s,box-shadow .15s}
.cr-choix:hover{border-color:var(--blue)}
.cr-choix[aria-pressed="true"]{border-color:var(--blue2);background:#eaf1ff;box-shadow:inset 0 0 0 1px var(--blue2)}
.cr-verrou{background:#f7f9fd}
.cr-badge{display:inline-block;align-self:flex-start;margin-top:4px;font-size:10.5px;font-weight:900;letter-spacing:.06em;text-transform:uppercase;color:#fff;background:var(--blue2);border-radius:999px;padding:2px 8px;line-height:1.5}
.cr-styles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.cr-style{text-align:left;padding:8px 11px;display:flex;flex-direction:column;gap:0;min-height:58px}
.cr-style b{font-size:15px;line-height:1.25}
.cr-style small{font-size:12.5px;line-height:1.3;color:var(--mut);font-weight:600}
.cr-puces{display:flex;flex-wrap:wrap;gap:8px}
.cr-puces .cr-choix{padding:8px 14px;border-radius:999px;font-weight:700;font-size:15px}
.cr-niveaux{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.cr-durees{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.cr-niveaux .cr-choix,.cr-durees .cr-choix{padding:9px 4px;display:flex;flex-direction:column;align-items:center;line-height:1.2;min-height:62px;justify-content:center}
.cr-niveaux b,.cr-durees b{font-size:17px}
.cr-niveaux small{font-size:12px;font-weight:700;color:var(--mut)}
.cr-niveaux .cr-badge,.cr-durees .cr-badge{align-self:center}
.cr-formes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.cr-formes .cr-choix{display:flex;flex-direction:column;align-items:center;text-align:center;gap:2px;padding:12px 10px}
.cr-formes b{font-size:16px}
.cr-formes small{font-size:13px;color:var(--mut);font-weight:600}
.cr-forme-dessin{display:flex;align-items:center;gap:5px;height:50px;margin-bottom:6px}
.cr-forme-dessin i{display:block;width:8px;border-radius:4px;background:linear-gradient(180deg,#60a5fa,#1d4ed8);height:10px}
.cr-f0 i:nth-child(odd){height:16px;opacity:.75}
.cr-f1 i{height:14px}.cr-f1 i:nth-child(1),.cr-f1 i:nth-child(5){transform:translateY(-10px)}.cr-f1 i:nth-child(3),.cr-f1 i:nth-child(7){transform:translateY(10px)}
.cr-f2 i:nth-child(1),.cr-f2 i:nth-child(7){height:8px}.cr-f2 i:nth-child(2),.cr-f2 i:nth-child(6){height:22px}.cr-f2 i:nth-child(3),.cr-f2 i:nth-child(5){height:36px}.cr-f2 i:nth-child(4){height:48px}
.cr-f3 i{height:44px}.cr-f3 i:nth-child(even){height:20px;transform:translateY(-12px)}.cr-f3 i:nth-child(3n){background:linear-gradient(180deg,#34d399,#0d9488)}
.cr-phrase{margin-top:16px;border:1.5px dashed var(--line2);border-radius:14px;padding:12px 14px;background:var(--panel2)}
.cr-phrase-t{margin:0 0 8px;font-weight:800}
.cr-phrase-t small{font-weight:700;color:var(--mut)}
.cr-phrase-ligne{display:flex;gap:8px;flex-wrap:wrap}
.cr-phrase input{flex:1 1 220px;min-width:0;font:inherit;font-size:16px;padding:9px 12px;border:2px solid var(--line2);border-radius:12px;background:#fff;color:var(--txt)}
.cr-phrase input:focus{outline:none;border-color:var(--blue)}
.cr-phrase button{font:inherit;font-weight:800;padding:9px 14px;border-radius:12px;border:2px solid var(--blue2);background:#fff;color:var(--blue2);cursor:pointer}
.cr-aide{font-size:13.5px;color:var(--mut);margin:6px 0 0}
.cr-message{margin:10px 0 0;padding:9px 13px;border-radius:12px;font-weight:700;font-size:14.5px;background:#eef3ff;color:#1e3a8a;border:1.5px solid #c7d6fb}
.cr-message.erreur{background:#fdecea;color:#9f1d14;border-color:#f5c2bd}
.cr-message a{text-decoration:underline;font-weight:800}

/* partition (étape 5) */
.cr-zone-partition{display:flex;flex-direction:column;gap:10px}
.cr-attente{padding:30px 14px;text-align:center;color:var(--mut);font-weight:700;border:1.5px dashed var(--line2);border-radius:14px;margin:0}
.cr-pdf-ligne{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.cr-pdf-ligne .btn{display:inline-flex;align-items:center;gap:8px;padding:10px 16px;font-weight:800;border-radius:12px}
.cr-pdf-ligne .btn[disabled]{opacity:.55;cursor:progress}
.cr-pages{display:flex;gap:10px;overflow-x:auto;background:#eef2f8;padding:10px;border-radius:14px}
.cr-feuille{flex:0 0 132px;background:#fff;box-shadow:0 2px 10px rgba(20,33,61,.12);aspect-ratio:210/297;position:relative}
@media (min-height:850px) and (min-width:761px){.cr-feuille{flex-basis:180px}}
.cr-feuille img{position:absolute;inset:0;width:100%;height:100%}
.cr-pied{position:absolute;left:5.2%;right:5.2%;bottom:2.4%;display:flex;justify-content:space-between;border-top:1px solid #d1d5db;padding-top:.6%;font:6px Helvetica,Arial,sans-serif;color:#6b7280}
.cr-pied b{color:#1d4ed8;font-weight:400}
.cr-droits{font-size:13.5px;color:var(--mut);margin:0;line-height:1.5}
.cr-appli{margin:0;padding:10px 13px;border-radius:12px;background:var(--grad-soft);font-size:14.5px;font-weight:700}
.cr-appli a{color:var(--blue2);text-decoration:underline}

/* ---------- navigation téléphone (cachée sur PC) ---------- */
.cr-nav-tel{display:none}

/* ---------- barre d'action (bas) ---------- */
.cr-barre{flex:none;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:12px 4px 14px}
.cr-barre-g{min-width:0}
.cr-resume{margin:0;font-weight:800;font-size:15.5px;color:var(--txt);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cr-quota{margin:0;font-size:14px;color:var(--mut);font-weight:700}
.cr-barre .cr-message{margin:4px 0 0;padding:5px 11px;font-size:14px}
#cr-composer{flex:none;min-width:290px;font-size:18px;gap:10px;display:inline-flex;align-items:center;justify-content:center}
#cr-composer[disabled]{opacity:.55;cursor:not-allowed;box-shadow:none}
body.cr-occupe .cr-reglages .cr-choix,body.cr-occupe .cr-phrase button{pointer-events:none;opacity:.7}

/* ---------- après l'outil : texte et pied du site ---------- */
.cr-apres{padding:28px 0 56px}
.cr-apres .lead-line{max-width:80ch}
.cr-points{margin:18px 0 0;display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.cr-points div{background:var(--panel);border:1.5px solid var(--line);border-radius:18px;padding:18px}
.cr-points b{display:block;font-size:17px;margin-bottom:4px}
.cr-points p{margin:0;color:var(--mut);font-size:15.5px;line-height:1.55}

/* ---------- écrans moyens ---------- */
@media (max-width:1180px){
  .cr-onglet-t{font-size:13.5px}
  .cr-onglet{padding:8px 7px;gap:5px}
  .cr-styles{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-height:700px) and (min-width:761px){
  .cr-tete{padding-bottom:6px}
  .cr-style{min-height:52px;padding:6px 10px}
  .cr-panneaux{padding:12px 16px}
  .cr-barre{padding:8px 4px 10px}
}

/* ---------- téléphone : une étape à la fois ---------- */
@media (max-width:760px){
  .cr-outil{padding:0 12px;min-height:480px}
  .cr-tete{padding-bottom:6px}
  .cr-tete h1{font-size:19px}
  .cr-kick{font-size:11px}
  .cr-corps{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr);gap:10px}
  .cr-apercu{display:none;padding:10px}
  /* étape 5 : le morceau puis sa partition ; ce cadre-là défile (le lecteur, puis les pages et le PDF) */
  .cr-outil[data-etape="5"] .cr-corps{grid-template-rows:max-content max-content;overflow-y:auto;align-content:start}
  .cr-outil[data-etape="5"] .cr-apercu,.cr-outil[data-etape="5"] .cr-reglages{min-height:max-content}
  .cr-outil[data-etape="5"] .cr-reglages,.cr-outil[data-etape="5"] .cr-panneaux,.cr-outil[data-etape="5"] .cr-apercu{overflow:visible}
  .cr-outil[data-etape="5"] .cr-apercu,.cr-outil[data-etape="5"] #cr-morceau,.cr-outil[data-etape="5"] .cr-lecteur,.cr-outil[data-etape="5"] .cr-lecteur .pvv{display:block;width:100%;height:auto}
  .cr-outil[data-etape="5"] #cr-morceau[hidden],.cr-outil[data-etape="5"] .cr-vide[hidden]{display:none}
  .cr-outil[data-etape="5"] .cr-vide{display:flex}
  .cr-outil[data-etape="5"] .cr-apercu{display:flex}
  .cr-outil[data-etape="5"] .cr-lecteur .pvv-stage{flex:none;aspect-ratio:1.9}
  .cr-outil[data-etape="5"] .cr-vide{padding:14px;font-size:14px}
  .cr-outil[data-etape="5"] .cr-vide .cr-notes{font-size:30px}
  .cr-onglets{padding:6px;gap:2px}
  .cr-onglet{flex:0 0 auto;padding:7px 8px}
  .cr-onglet .cr-onglet-t{display:none}
  .cr-onglet[aria-selected="true"]{flex:1 1 auto}
  .cr-onglet[aria-selected="true"] .cr-onglet-t{display:inline}
  .cr-panneaux{padding:12px}
  .cr-q{font-size:17px;margin-bottom:10px}
  .cr-kick{display:none}
  .cr-tete h1{font-size:17px}
  .cr-styles{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .cr-style{min-height:44px;padding:6px 9px;flex-direction:row;align-items:center;justify-content:space-between;gap:6px}
  .cr-style b{font-size:14.5px}
  .cr-style small{display:none}
  .cr-style .cr-badge{margin:0;align-self:center;font-size:9.5px;padding:1px 6px}
  .cr-puces{gap:5px}
  .cr-puces .cr-choix{padding:5px 10px;font-size:14px}
  .cr-attente{padding:18px 12px}
  .cr-q{margin-bottom:8px}
  .cr-phrase{margin-top:12px;padding:10px}
  .cr-phrase-t{display:none}
  .cr-phrase .cr-aide{display:none}
  .cr-phrase input{font-size:15px;padding:8px 10px}
  .cr-phrase button{padding:8px 10px;font-size:14px}
  .cr-niveaux .cr-choix,.cr-durees .cr-choix{min-height:54px;padding:6px 4px}
  .cr-niveaux{grid-template-columns:repeat(3,minmax(0,1fr))}
  .cr-formes .cr-choix{padding:10px 6px}
  .cr-nav-tel{flex:none;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px;border-top:1.5px solid var(--line);background:var(--panel2)}
  .cr-pas{font:inherit;font-weight:800;font-size:15px;color:var(--blue2);background:#fff;border:2px solid var(--line2);border-radius:12px;padding:8px 14px;cursor:pointer}
  .cr-pas[disabled]{visibility:hidden}
  .cr-pas-n{font-weight:800;color:var(--mut);font-size:14px}
  .cr-barre{flex-direction:column;align-items:stretch;gap:6px;padding:8px 0 10px}
  .cr-resume{display:none}
  .cr-quota{text-align:center;font-size:13px}
  .cr-barre .cr-message{font-size:13px}
  #cr-composer{min-width:0;width:100%;font-size:17px;padding:13px 16px}
  .cr-actions .btn{padding:9px 12px;font-size:14.5px}
  .cr-points{grid-template-columns:1fr}
}
