/* ═══════════════════════════════════════════════════════════════
   Philo — Atelier de composition de l'explication de texte

   Deux colonnes : à gauche le devoir qui s'écrit, à droite la tâche
   du moment. Sur téléphone, la tâche passe devant et l'aperçu se
   replie sous elle : c'est la tâche qui doit tenir dans l'écran.
   ═══════════════════════════════════════════════════════════════ */

.cp-atelier {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 18px;
}

@media (max-width: 900px) {
  .cp-atelier {
    grid-template-columns: 1fr;
  }
  .cp-col--droite { order: 1; }
  .cp-col--gauche { order: 2; }
}

/* ── Aperçu du devoir ───────────────────────────────────────── */

.cp-apercu {
  background: #fff;
  border: 1px solid rgba(20, 20, 50, 0.1);
  border-radius: 16px;
  padding: 18px 20px 14px;
  box-shadow: 0 2px 14px rgba(20, 20, 50, 0.05);
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

@media (max-width: 900px) {
  .cp-apercu { position: static; max-height: none; }
}

.cp-apercu-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(20, 20, 50, 0.08);
}

.cp-apercu-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #26263a;
  flex: 1 1 auto;
}

.cp-jauge {
  flex: 0 0 90px;
  height: 5px;
  border-radius: 999px;
  background: rgba(20, 20, 50, 0.1);
  overflow: hidden;
}

.cp-jauge span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6a6ab0, #3f8f6b);
  transition: width 0.35s ease;
}

.cp-compte {
  font-size: 11.5px;
  color: #8a8aa0;
  white-space: nowrap;
}

.cp-apercu-corps {
  overflow-y: auto;
  padding: 14px 2px 8px;
  flex: 1 1 auto;
  min-height: 0;
}

.cp-bloc + .cp-bloc { margin-top: 16px; }

.cp-bloc h4 {
  margin: 0 0 5px;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #9a9ab4;
  font-weight: 600;
}

.cp-bloc p {
  margin: 0;
  font: 400 14.5px/1.75 Georgia, 'Times New Roman', serif;
  color: #2c2c3f;
  text-align: justify;
}

.cp-bloc--vide h4 { color: #c0c0d0; }

.cp-frag {
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s;
}

.cp-frag:hover { background: rgba(120, 120, 210, 0.13); }
.cp-frag--actif { background: rgba(120, 120, 210, 0.2); box-shadow: 0 0 0 1px rgba(90, 90, 180, 0.3); }

.cp-trou {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px dashed rgba(120, 120, 170, 0.5);
  background: rgba(240, 240, 250, 0.7);
  color: #7a7a99;
  font: 500 11.5px/1.6 system-ui, -apple-system, sans-serif;
  cursor: pointer;
  vertical-align: baseline;
}

.cp-trou:hover { border-color: #6a6ab0; color: #4a4a86; background: #eeeefb; }
.cp-trou--actif { border-style: solid; border-color: #6a6ab0; color: #3c3c72; background: #e8e8fb; }

.cp-apercu-pied {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 11px;
  border-top: 1px solid rgba(20, 20, 50, 0.08);
}

/* ── Tâche du moment ────────────────────────────────────────── */

.cp-tache {
  background: #fff;
  border: 1px solid rgba(20, 20, 50, 0.1);
  border-radius: 16px;
  padding: 18px 20px 20px;
  box-shadow: 0 2px 14px rgba(20, 20, 50, 0.05);
}

.cp-tache-fil {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cp-etape {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(20, 20, 50, 0.16);
  background: #fff;
  color: #8a8aa4;
  font: 600 11px system-ui, sans-serif;
  cursor: pointer;
  padding: 0;
  line-height: 22px;
}

.cp-etape--fait { background: #eaf3ee; border-color: #a9cfbb; color: #3f8f6b; }
.cp-etape--actif { background: #3c3c72; border-color: #3c3c72; color: #fff; }

.cp-tache-situe {
  font: 500 11px system-ui, sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #9a9ab4;
}

.cp-tache h3 {
  margin: 4px 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: #24243a;
}

.cp-facultatif {
  font: 500 10.5px system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9a9ab4;
  border: 1px solid rgba(20, 20, 50, 0.13);
  border-radius: 999px;
  padding: 1px 7px;
  vertical-align: middle;
}

.cp-consigne {
  margin: 0 0 8px;
  font: 400 14px/1.6 system-ui, -apple-system, sans-serif;
  color: #46465e;
}

.cp-forme {
  margin: 0 0 12px;
  font: 400 12.5px/1.55 system-ui, sans-serif;
  color: #7a7a96;
}

.cp-forme em { color: #55557a; }

.cp-extrait { margin: 0 0 12px; }

.cp-extrait summary {
  cursor: pointer;
  font: 500 12px system-ui, sans-serif;
  color: #6a6a90;
}

.cp-extrait blockquote {
  margin: 8px 0 0;
  padding: 10px 14px;
  border-left: 3px solid #c9c9e4;
  background: #f7f7fc;
  border-radius: 0 8px 8px 0;
  font: 400 13.5px/1.7 Georgia, serif;
  color: #3a3a55;
  max-height: 190px;
  overflow-y: auto;
}

.cp-champ {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(20, 20, 50, 0.16);
  border-radius: 10px;
  padding: 11px 13px;
  font: 400 14.5px/1.65 Georgia, serif;
  color: #26263a;
  resize: vertical;
  background: #fdfdff;
}

.cp-champ:focus {
  outline: none;
  border-color: #6a6ab0;
  box-shadow: 0 0 0 3px rgba(106, 106, 176, 0.14);
}

.cp-choix { display: flex; flex-wrap: wrap; gap: 7px; }

.cp-choix-btn {
  border: 1px solid rgba(20, 20, 50, 0.16);
  background: #fff;
  border-radius: 999px;
  padding: 7px 13px;
  font: 500 12.5px system-ui, sans-serif;
  color: #4a4a66;
  cursor: pointer;
}

.cp-choix-btn:hover { border-color: #6a6ab0; color: #3c3c72; }
.cp-choix-btn--on { background: #3c3c72; border-color: #3c3c72; color: #fff; }

.cp-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* ── Retour de l'IA ─────────────────────────────────────────── */

.cp-retour {
  margin-top: 13px;
  padding: 12px 14px;
  border-radius: 11px;
  font: 400 13.5px/1.6 system-ui, sans-serif;
}

.cp-retour--ok { background: #eef7f1; border: 1px solid #bfe0cd; color: #285f45; }
.cp-retour--revoir { background: #fff8ec; border: 1px solid #ebd5ab; color: #7a5713; }

.cp-retour strong { display: inline-block; margin-right: 8px; }

.cp-risque {
  display: inline-block;
  font: 600 10.5px system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.07);
}

.cp-retour p { margin: 7px 0 0; }

.cp-reformulation {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font: 400 13.5px/1.65 Georgia, serif;
}

.cp-reformulation .btn { margin-top: 7px; }

.cp-relecture {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(20, 20, 50, 0.1);
  box-shadow: 0 2px 14px rgba(20, 20, 50, 0.05);
  font: 400 13.5px/1.7 system-ui, sans-serif;
  color: #3a3a52;
}

.cp-relecture h4 { margin: 0 0 9px; font-size: 14px; color: #24243a; }

.cp-tache--fini { text-align: left; }
.cp-tache--fini h3 { margin-top: 0; }
