/* Page « Atelier » — couleurs du brief du matin, polices du système (aucun chargement extérieur). */
:root {
  --fond: #FCFCFB; --fond2: #F7F6F2; --carte: #FFFFFF; --encre: #2E2C27; --doux: #4A4843;
  --gris: #6B6A63; --trait: #E4E3DC; --champ: #CFCDC4; --argile: #C6613F; --argile-fonce: #AE5133;
  --moi: #F3E2D7; --attend-fond: #FDF0E6; --attend-bord: #F2C9A8; --attend-texte: #6E2F08;
  --attend-point: #D9692A; --fini-fond: #E6F0E8; --fini-texte: #1F4D2B; --travail-fond: #EEF0F4;
  --travail-texte: #2C3550; --travail-point: #5B6B94; --erreur-fond: #FBE9E7; --erreur-texte: #8A1F14;
  --titre: Georgia, "Times New Roman", serif;
  --texte: -apple-system, "Segoe UI", system-ui, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font: 16px/1.45 var(--texte); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--argile); outline-offset: 2px; }
.chargement { padding: 24px; color: var(--gris); }

/* Connexion */
.connexion { min-height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 26px;
  max-width: 420px; margin: 0 auto; padding: 32px max(24px, env(safe-area-inset-left)) 32px max(24px, env(safe-area-inset-right)); }
.surtitre { font-size: 12px; color: var(--gris); letter-spacing: .04em; text-transform: uppercase; }
.connexion h1 { margin: 4px 0 6px; font: 600 34px var(--titre); }
.connexion p { margin: 0; color: var(--doux); }
.champ { display: flex; flex-direction: column; gap: 6px; }
.champ label { font-weight: 600; font-size: 14px; }
.champ input { height: 50px; padding: 0 14px; border: 1px solid var(--champ); border-radius: 10px; background: var(--carte); font-size: 16px; }
.champ input.code { height: 56px; font-size: 24px; font-weight: 600; letter-spacing: .2em; }
.aide { font-size: 13px; color: var(--gris); }
.bouton { min-height: 50px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--argile); color: #fff; font-weight: 600; font-size: 17px; }
.bouton:hover { background: var(--argile-fonce); }
.bouton:disabled { opacity: .6; cursor: default; }
.message-erreur { color: var(--erreur-texte); background: var(--erreur-fond); padding: 10px 12px; border-radius: 10px; font-size: 14px; }

/* Mise en page générale */
.cadre { height: 100%; display: flex; }
.colonne { width: 100%; height: 100%; display: flex; flex-direction: column; min-width: 0; }
.entete { padding: 16px 20px 12px; padding-top: max(16px, env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--trait); }
.entete h1 { margin: 2px 0 0; font: 600 26px var(--titre); }
.nouvelle { height: 44px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--argile); color: #fff; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.onglets { display: flex; gap: 8px; padding: 12px 20px; }
.onglet { height: 36px; padding: 0 14px; border-radius: 18px; border: 0; background: #F1EFEA; font-size: 14px; font-weight: 500; }
.onglet.actif { background: var(--encre); color: var(--fond); }
.onglets { flex-wrap: wrap; }
.onglet.raccourci { display: inline-flex; align-items: center; text-decoration: none; color: var(--encre); background: transparent; border: 1px solid var(--champ); }
.liste { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 16px 16px; }
.pied { padding: 12px 20px; padding-bottom: max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--trait); font-size: 13px; color: var(--gris); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.lien-discret { border: 0; background: none; color: var(--gris); text-decoration: underline; font-size: 13px; padding: 8px 0; }
.vide { color: var(--gris); padding: 20px 4px; }

/* Cartes de discussion */
.carte { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 14px; background: var(--carte); border: 1px solid var(--trait); text-align: left; width: 100%; }
.carte.attend { background: var(--attend-fond); border-color: var(--attend-bord); }
.carte.choisie { box-shadow: 0 0 0 2px var(--encre) inset; }
.carte .haut { display: flex; justify-content: space-between; gap: 8px; }
.carte .titre { font-weight: 600; }
.carte .heure { font-size: 12px; color: var(--gris); white-space: nowrap; }
.carte .apercu { font-size: 14px; color: var(--doux); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pastille { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 13px; font-weight: 600; }
.pastille::before { content: ""; width: 8px; height: 8px; border-radius: 4px; }
.pastille.attend { background: #F7D3B5; color: var(--attend-texte); } .pastille.attend::before { background: var(--attend-point); }
.pastille.termine { background: var(--fini-fond); color: var(--fini-texte); } .pastille.termine::before { background: #3E8A52; }
.pastille.travaille { background: var(--travail-fond); color: var(--travail-texte); } .pastille.travaille::before { background: var(--travail-point); animation: pulse 1.4s infinite; }
.pastille.erreur { background: var(--erreur-fond); color: var(--erreur-texte); } .pastille.erreur::before { background: #C0392B; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .pastille.travaille::before { animation: none; } }

/* Discussion */
.barre { padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--trait); }
.retour { width: 44px; height: 44px; border: 0; background: none; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.barre .titre { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barre .etat { font-size: 13px; color: var(--gris); }
.barre .etat.attend { color: #8A4A1E; font-weight: 500; }
.fil { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.bulle { max-width: 88%; padding: 12px 14px; font-size: 15px; overflow-wrap: anywhere; }
.bulle p { margin: 0 0 8px; } .bulle p:last-child { margin-bottom: 0; }
.bulle ul { margin: 0 0 8px; padding-left: 20px; }
.bulle.moi { align-self: flex-end; background: var(--moi); border-radius: 16px 16px 4px 16px; white-space: pre-wrap; }
.bloc-claude { align-self: flex-start; max-width: 92%; display: flex; flex-direction: column; gap: 6px; }
.bulle.claude { background: var(--carte); border: 1px solid var(--trait); border-radius: 16px 16px 16px 4px; max-width: 100%; }
.bulle.claude.attend { background: var(--attend-fond); border-color: var(--attend-bord); }
.bulle.claude.erreur { background: var(--erreur-fond); border-color: #F0C3BD; }
.etapes { font-size: 13px; color: var(--gris); }
.etapes summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.etapes ul { margin: 4px 0 0; padding-left: 18px; }
.travail-en-cours { align-self: flex-start; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--travail-texte); background: var(--travail-fond); padding: 10px 14px; border-radius: 14px; }
.saisie { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; padding-bottom: max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--trait); background: var(--fond); }
.saisie textarea { flex: 1; min-height: 48px; max-height: 40vh; padding: 12px 14px; border: 1px solid var(--champ); border-radius: 14px; background: var(--carte); font-size: 16px; resize: none; }
.envoyer { width: 48px; height: 48px; border: 0; border-radius: 14px; background: var(--argile); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.envoyer:disabled { opacity: .5; cursor: default; }
.masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Dépôt */
.fichier { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--carte); border: 1px solid var(--trait); text-align: left; width: 100%; }
.fichier .nom { font-weight: 600; overflow-wrap: anywhere; }
.fichier .info { font-size: 13px; color: var(--gris); }
.lecture { flex: 1; overflow-y: auto; padding: 16px 20px; }
.lecture pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 15px/1.5 var(--texte); }
.actions { display: flex; gap: 8px; padding: 10px 16px; padding-bottom: max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--trait); }
.secondaire { min-height: 44px; padding: 0 16px; border: 1px solid var(--champ); border-radius: 10px; background: var(--carte); font-weight: 500; }

/* Ordinateur : liste à gauche, contenu à droite */
.panneau-vide { flex: 1; display: none; align-items: center; justify-content: center; color: var(--gris); }
@media (min-width: 900px) {
  .cadre .colonne.liste-col { width: 360px; flex-shrink: 0; border-right: 1px solid var(--trait); background: var(--fond2); }
  .cadre .colonne.detail-col { flex: 1; }
  .cadre .detail-col .fil, .cadre .detail-col .saisie, .cadre .detail-col .lecture { width: 100%; max-width: 860px; margin: 0 auto; }
  .panneau-vide { display: flex; }
  .retour.mobile { display: none; }
}
@media (max-width: 899px) {
  .cadre.detail .liste-col { display: none; }
  .cadre:not(.detail) .detail-col { display: none; }
}
