/* Atelier IAI — CSS pur, sans outil de construction.
   Couleurs et typographie de la maquette (orange et blanc). Les --orange-* sont la couleur du PROJET affiché :
   l'orange de l'atelier (et des deux pilotes) ici, la palette du projet ailleurs (voir « Projets », en bas). */

:root {
    --orange-700: #C2410C;   /* boutons, fonds sous texte blanc (contraste AA) */
    --orange-600: #EA580C;   /* barres, accents */
    --orange-300: #FDBA74;
    --orange-200: #FED7AA;
    --orange-100: #FFEDD5;
    --orange-50: #FFF7ED;
    --orange-25: #FFFBF7;
    --brun-800: #9A3412;
    --brun-900: #7C2D12;
    --texte: #1C1917;
    --gris-700: #57534E;
    --gris-500: #78716C;
    --gris-400: #A8A29E;
    --gris-200: #E7E5E4;
    --gris-100: #F5F5F4;
    --fond: #ffffff;
    --alerte: #B91C1C;

    --titre: 'Sora', 'Segoe UI', system-ui, sans-serif;
    --corps: 'Figtree', 'Segoe UI', system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;

    --rayon: 10px;
    --rayon-carte: 16px;
    --cible: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 200px; }
/* Repère discret « Nouveaux messages » de la Réflexion : ramène en bas d'un geste. */
.fil-repere { position: fixed; right: 12px; bottom: 16px; z-index: 20; padding: 8px 14px; border-radius: 999px; border: 1px solid #888; background: #fff; font-size: 14px; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.fil-repere[hidden] { display: none; }

body {
    margin: 0;
    background: var(--fond);
    color: var(--texte);
    font-family: var(--corps);
    font-size: 15px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

h1, h2, h3, p { margin: 0; }
a { color: var(--orange-700); }
a:hover { color: var(--brun-800); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--orange-600); outline-offset: 2px; }
input[type=range] { accent-color: var(--orange-600); width: 100%; min-height: var(--cible); }
svg { max-width: 100%; height: auto; }

.evitement { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--fond); padding: 10px 14px; border-radius: var(--rayon); }
.evitement:focus { left: 16px; }

/* Texte */
.chiffre { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.petit { font-size: 12.5px; }
.gris { color: var(--gris-500); }
.gris-fonce { color: var(--gris-700); }
.fonce { color: var(--brun-800); }
.aide { font-size: 13px; color: var(--gris-700); }
.titre-ecran { font-family: var(--titre); font-weight: 600; font-size: 24px; letter-spacing: -0.01em; }
.titre-section { font-family: var(--titre); font-weight: 600; font-size: 17px; }
.sous-titre { font-size: 13px; font-weight: 600; color: var(--gris-700); }
.vide { color: var(--gris-700); padding: 14px 0; }
.liste-simple { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

/* Mise en page */
.pile { display: flex; flex-direction: column; gap: 14px; }
.pile-serree { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.ligne__texte { flex: 1 1 280px; }
.ligne-titre { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.colonnes { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.colonnes > * { flex: 1 1 340px; min-width: 0; }
.tete-ecran { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }

/* Champs */
label { font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=datetime-local], textarea {
    width: 100%;
    min-height: var(--cible);
    border: 1px solid var(--orange-200);
    border-radius: var(--rayon);
    padding: 10px 14px;
    background: var(--orange-25);
    color: var(--texte);
}
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: var(--orange-600); }

/* Boutons */
.bouton {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--cible); padding: 10px 16px;
    border-radius: var(--rayon); font-weight: 600; font-size: 14.5px;
    text-decoration: none; text-align: center; border: 1px solid transparent;
}
.bouton--principal { background: var(--orange-700); color: #fff; }
.bouton--principal:hover { background: var(--brun-800); color: #fff; }
.bouton--second { background: var(--fond); color: var(--brun-800); border-color: var(--orange-200); }
.bouton--second:hover { background: var(--orange-50); color: var(--brun-900); }
.bouton--contour { background: var(--fond); color: var(--orange-700); border-color: var(--orange-200); font-weight: 500; }
.bouton--discret { background: transparent; color: var(--gris-700); border-color: var(--gris-200); font-weight: 500; }
.bouton--discret:hover { background: var(--gris-100); }
.bouton--large { width: 100%; }
.bouton:disabled, .bouton[aria-disabled=true] { background: var(--gris-100); color: var(--gris-700); border-color: var(--gris-200); cursor: not-allowed; }

/* Pastilles */
.pastille, .etat {
    display: inline-block; align-self: flex-start; white-space: nowrap;
    font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px;
}
.pastille--vif { background: var(--orange-700); color: #fff; }
.pastille--fonce { background: var(--brun-900); color: #fff; }
.pastille--clair { background: var(--orange-100); color: var(--brun-800); }
.pastille--file { background: var(--fond); color: var(--brun-800); border: 1px solid var(--orange-200); }
.pastille--gris { background: var(--gris-100); color: var(--gris-700); }
.pastille--alerte { background: #FEE2E2; color: var(--alerte); }
.etat { font-size: 13px; padding: 7px 12px; }
.etat--ouvert { background: var(--orange-100); color: var(--brun-800); }
.etat--ferme { background: var(--brun-900); color: #fff; }

/* Messages */
.message { padding: 12px 16px; border-radius: 12px; font-size: 14px; }
.message--fait { background: var(--orange-50); color: var(--brun-900); border: 1px solid var(--orange-200); }
.message--refus { background: #FEF2F2; color: var(--alerte); border: 1px solid #FECACA; }
.message p + p { margin-top: 4px; }

/* En-tête : une barre courte (marque, projet, Réflexion, Menu, état), puis les jauges. La même
   sur toutes les pages (Léo, 12/10) ; pensée d'abord pour le téléphone. */
/* L'en-tête reste en haut de l'écran pendant qu'on fait défiler la conversation (Léo, 13/10). */
/* Le trait du haut et la teinte de l'en-tête sont dans la couleur du projet (demande n° 104). */
.entete { position: sticky; top: 0; z-index: 30; border-top: 4px solid var(--orange-600); border-bottom: 1px solid var(--orange-200); background: var(--orange-25); padding: 10px 28px 12px; display: flex; flex-direction: column; gap: 10px; }
.entete__barre { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.marque { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; color: var(--texte); text-decoration: none; }
.marque:hover { color: var(--texte); }
/* Le logo de l'atelier IAI (SVG en ligne, App\Http\Logo) : toujours le même, toujours orange. */
.marque__logo { width: 40px; height: 40px; flex: 0 0 auto; display: block; }
.marque__textes { display: flex; flex-direction: column; }
.marque__nom { font-family: var(--titre); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.marque__sous { font-size: 12px; color: var(--gris-500); }
.jauges { display: flex; flex-wrap: wrap; gap: 8px 24px; min-width: 0; }
.jauge { flex: 1 1 150px; min-width: 140px; display: flex; flex-direction: column; gap: 6px; }
.jauge__haut { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.jauge__label { color: var(--gris-500); }
.jauge__piste { position: relative; height: 8px; border-radius: 99px; background: var(--orange-100); }
.jauge__rempli { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--orange-600); max-width: 100%; }
.jauge__repere { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--brun-900); }
.jauges__releve { flex-basis: 100%; }
.entete__droite { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.entete__droite .etat { text-decoration: none; }
/* Réservés au téléphone (voir plus bas) : le résumé du forfait et l'état en toutes lettres dans le panneau des jauges. */
.forfait-resume, .jauges__etat { display: none; }

/* Le menu : « Réflexion », puis « Menu », un petit panneau déroulant posé par-dessus l'écran. */
.menu { display: flex; align-items: center; gap: 6px; position: relative; }
.menu__reflexion, .menu__bouton {
    display: inline-flex; align-items: center; gap: 6px; min-height: var(--cible); padding: 8px 14px;
    border-radius: var(--rayon); font-size: 14.5px; font-weight: 600; color: var(--texte); text-decoration: none;
    border: 1px solid transparent; white-space: nowrap;
}
.menu__reflexion:hover, .menu__bouton:hover { background: var(--orange-50); color: var(--texte); }
.menu__reflexion--ici, .menu__reflexion--ici:hover { background: var(--orange-700); color: #fff; }
.menu__deroulant { position: relative; }
.menu__bouton { cursor: pointer; list-style: none; border-color: var(--orange-200); }
.menu__bouton::-webkit-details-marker { display: none; }
.menu__bouton::after { content: '▾'; font-size: 12px; color: var(--gris-500); }
.menu__deroulant[open] > .menu__bouton { background: var(--orange-50); }
.menu__deroulant[open] > .menu__bouton::after { content: '▴'; }
.menu__ici { font-weight: 500; color: var(--gris-700); }
.menu__panneau {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
    width: 280px; max-width: calc(100vw - 32px); padding: 8px;
    background: var(--fond); border: 1px solid var(--orange-200); border-radius: 14px;
    box-shadow: 0 12px 32px rgba(28, 25, 23, .14);
    display: flex; flex-direction: column; gap: 6px;
}
.menu__liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.menu__lien {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    min-height: var(--cible); padding: 10px 12px; border-radius: var(--rayon);
    font-size: 14.5px; font-weight: 500; color: var(--texte); text-decoration: none;
}
.menu__lien:hover { background: var(--orange-50); color: var(--texte); }
.menu__lien--ici, .menu__lien--ici:hover { background: var(--orange-100); color: var(--brun-900); font-weight: 600; }
.menu__compte { font-family: var(--mono); font-size: 12px; background: var(--brun-900); color: #fff; border-radius: 99px; padding: 1px 8px; }
.menu__encart { margin: 0; padding: 8px 12px 0; border-top: 1px solid var(--gris-200); font-size: 12px; color: var(--gris-500); }
.menu__sortie { margin: 0; padding: 0 4px 2px; }
.menu__deconnexion {
    background: none; border: 0; padding: 8px; min-height: 36px; font-size: 13px; color: var(--gris-700);
    text-decoration: underline; text-underline-offset: 2px;
}
.menu__deconnexion:hover { color: var(--texte); }

/* Contenu : toute la largeur, centré, sans colonne de côté. */
.principal {
    width: 100%; max-width: 1240px; margin: 0 auto; min-width: 0; padding: 24px 32px 48px;
    display: flex; flex-direction: column; gap: 24px;
}

/* Cartes */
.carte { border: 1px solid var(--orange-200); border-radius: var(--rayon-carte); padding: 20px 22px; background: var(--fond); min-width: 0; }
.carte--nouvelle { border: 1.5px solid var(--orange-300); padding: 18px 20px; }
.carte--liste { padding: 0; overflow: hidden; }
.encart { padding: 12px 14px; border-radius: 12px; background: var(--orange-50); color: var(--brun-900); font-size: 13.5px; display: flex; flex-direction: column; gap: 6px; }
.encart--alerte { background: #FEF2F2; color: var(--alerte); }

/* Demandes */
.demandes { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.liste { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ligne-demande {
    display: flex; flex-direction: column; gap: 6px; width: 100%; min-width: 0; max-width: 100%; overflow: hidden;
    min-height: var(--cible); padding: 14px 16px; border-radius: 14px;
    background: var(--fond); border: 1px solid var(--orange-200); color: var(--texte); text-decoration: none;
}
.ligne-demande:hover { background: var(--orange-25); color: var(--texte); }
.ligne-demande--choisie { background: var(--orange-50); border: 1.5px solid var(--orange-600); }
.ligne-demande__haut { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; min-width: 0; }
.ligne-demande__titre { font-weight: 600; font-size: 14.5px; min-width: 0; overflow-wrap: anywhere; }
.ligne-demande__sous { font-size: 12.5px; color: var(--gris-500); min-width: 0; overflow-wrap: anywhere; }
/* L'étape en cours (n° 263) : une ligne de texte qui passe à la ligne, lisible sur téléphone. */
.ligne-demande__etape { font-size: 12.5px; color: var(--gris-500); overflow-wrap: anywhere; }

.detail {
    flex: 999 1 460px; min-width: 0; border: 1px solid var(--orange-200); border-radius: var(--rayon-carte);
    padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; background: var(--fond);
}
.detail__tete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; }
.detail__titres { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 300px; }
.detail__etat { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail__numero { font-size: 15px; font-weight: 600; color: var(--gris-700); }
.detail__titre { font-family: var(--titre); font-weight: 600; font-size: 22px; letter-spacing: -0.01em; }
.citation { font-size: 13.5px; color: var(--gris-700); white-space: pre-line; }
.cout { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--orange-50); flex: 0 1 240px; min-width: 190px; }
.cout__label { font-size: 12px; color: var(--brun-800); }
.cout__valeur { font-size: 15px; color: var(--brun-900); }
/* La frise d'étapes (n° 364) : segments proportionnels à la durée ; fine dans la liste, détaillée sur la page. Lisible sur téléphone (passe à la ligne). */
.frise { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: 100%; overflow: hidden; }
.frise__barre { display: flex; gap: 1px; height: 12px; width: 100%; max-width: 100%; min-width: 0; overflow: hidden; }
.frise--fine .frise__barre { height: 6px; }
.frise__seg { display: block; min-width: 0; border-radius: 3px; background: var(--orange-600); }
.frise__barre > .frise__seg { flex-shrink: 1; }
/* Le segment en cours et le futur restent visibles même sur une demande de plusieurs jours (la barre est bornée à ~24 segments). */
.frise__barre > .frise__seg--cours { min-width: 6px; flex-shrink: 0; }
.frise__barre > .frise__seg--futur { min-width: 2px; }
.frise__seg--attente { background: var(--gris-500); }
.frise__seg--leo { background: #7b5ea7; }
.frise__seg--pause { background: repeating-linear-gradient(45deg, var(--gris-500) 0 4px, var(--orange-100) 4px 8px); }
.frise__seg--futur { background: var(--orange-100); opacity: .8; }
.frise__seg--cours { box-shadow: inset 0 0 0 2px var(--orange-200); animation: frise-cours 1.6s ease-in-out infinite; }
@keyframes frise-cours { 50% { opacity: .55; } }
.frise__seg:focus-visible { outline: 2px solid var(--brun-900); outline-offset: -2px; }
.frise__legende { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.frise__ligne { display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.frise__ligne--futur { color: var(--gris-500); }
.frise__pastille { flex: none; width: 10px; height: 10px; }
.barre { height: 6px; border-radius: 99px; background: var(--orange-100); position: relative; }
.barre__rempli { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--orange-600); }

.etapes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.etape { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.etape__barre { height: 6px; border-radius: 99px; background: var(--orange-100); }
.etape--faite .etape__barre { background: var(--orange-600); }
.etape--encours .etape__barre { background: var(--orange-300); }
.etape__nom { font-size: 12.5px; font-weight: 600; }
.etape__note { font-size: 11.5px; color: var(--gris-500); }

.resume { font-size: 14px; }
.journal {
    border-radius: 12px; background: var(--texte); color: var(--orange-100);
    padding: 14px 16px; font-family: var(--mono); font-size: 12.5px;
    display: flex; flex-direction: column; gap: 4px;
}
.journal__ligne { white-space: pre-wrap; }
.journal__heure { color: var(--orange-300); }

.risque { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--orange-300); font-size: 13.5px; color: #44403C; }
.risque__titre { font-size: 12px; color: var(--brun-800); font-weight: 600; }
.zones { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--orange-600); background: var(--orange-50); color: var(--brun-900); font-size: 13.5px; }
.zones__titre { font-size: 12px; font-weight: 600; color: var(--brun-800); }
.tests { font-size: 13.5px; }
.tests--echec { color: var(--alerte); }
.gestes { display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--orange-100); padding-top: 16px; }
.phrase { display: block; margin-top: 6px; font-family: var(--mono); font-weight: 500; color: var(--brun-900); }
.retouche > summary { list-style: none; width: fit-content; }
.retouche > summary::-webkit-details-marker { display: none; }
.retouche[open] > summary { margin-bottom: 12px; }

/* Forfait */
.chiffres-cles { display: flex; flex-wrap: wrap; gap: 16px; }
.chiffre-cle { flex: 1 1 220px; display: flex; flex-direction: column; gap: 8px; }
.chiffre-cle__valeur { font-family: var(--titre); font-weight: 600; font-size: 30px; color: var(--brun-900); font-variant-numeric: tabular-nums; }
.semaine { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: end; }
.semaine__jour { min-width: 0; }
.jour {
    display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%;
    min-height: var(--cible); background: transparent; border: 0; padding: 4px 0; border-radius: var(--rayon); color: var(--texte);
}
.jour:hover:not(:disabled) { background: var(--orange-25); }
.jour:disabled { cursor: default; }
.jour__budget-txt { color: var(--brun-900); white-space: nowrap; }
.jour__colonne { height: 170px; width: 100%; max-width: 64px; display: flex; align-items: flex-end; justify-content: center; position: relative; }
.jour__cadre { position: absolute; bottom: 0; left: 0; right: 0; border: 1.5px solid var(--orange-300); border-radius: 8px; background: var(--fond); }
.jour--aujourdhui .jour__cadre { background: var(--orange-50); }
.jour--repos .jour__cadre { border-style: dashed; border-color: var(--gris-200); }
.jour__utilise { position: absolute; bottom: 0; left: 6px; right: 6px; border-radius: 6px; background: var(--orange-600); }
.jour__utilise--depasse { background: var(--brun-900); }
.jour__nom { font-size: 13px; font-weight: 500; white-space: nowrap; }
.jour--aujourdhui .jour__nom { font-weight: 700; color: var(--orange-700); }
.jour--repos .jour__nom { color: var(--gris-500); }
.jour__etat { font-size: 11.5px; color: var(--gris-500); overflow-wrap: normal; }
.curseur__label { display: flex; justify-content: space-between; gap: 12px; }
.grille-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.economie { display: flex; gap: 12px; align-items: baseline; border-bottom: 1px solid var(--orange-100); padding-bottom: 10px; }
.economie__chiffre { font-size: 13px; color: var(--orange-700); min-width: 64px; }
.economie__titre { font-size: 14px; font-weight: 600; }

/* Historique */
.historique { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--orange-100); }
.historique:last-child { border-bottom: 0; }
.historique__etiquette { font-size: 12.5px; color: var(--orange-700); min-width: 90px; }
.historique__corps { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.historique__titre { font-size: 14.5px; font-weight: 600; color: var(--texte); text-decoration: none; }
.historique__titre:hover { text-decoration: underline; }
.historique__etats { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.historique__cout { min-width: 60px; }

@media (max-width: 720px) {
    /* Une demande choisie : son détail d'abord, la liste ensuite. */
    .demandes--choisie .detail { order: -1; }
}

/* Pages seules (connexion) */
.seule { background: var(--orange-25); min-height: 100vh; display: flex; justify-content: center; padding: 32px 16px; }
.seule__boite {
    width: 100%; max-width: 440px; align-self: flex-start;
    background: var(--fond); border: 1px solid var(--orange-200); border-radius: var(--rayon-carte);
    padding: 24px; display: flex; flex-direction: column; gap: 18px;
}
.seule__titre { font-family: var(--titre); font-weight: 600; font-size: 22px; }
.qr { background: #fff; padding: 8px; width: fit-content; border: 1px solid var(--orange-200); border-radius: 12px; }
.qr svg { display: block; width: 220px; max-width: 100%; height: auto; }
.cle-totp { word-break: break-all; }
.codes-secours { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.codes-secours li { padding: 10px 12px; background: var(--orange-50); border-radius: var(--rayon); text-align: center; }

/* Téléphone */
@media (max-width: 720px) {
    /* L'en-tête collé tient en UNE ligne (Léo, 16/10 : il mangeait un tiers de l'écran) : logo, projet,
       Réflexion, Menu, le résumé du forfait et un point d'état. Les jauges, l'avis de relevé et la ligne du
       relevé se replient dans un panneau posé sous la barre, qu'un appui sur le résumé déplie. */
    html { scroll-padding-top: 72px; }
    .entete { padding: 6px 12px 7px; gap: 5px; overflow-x: clip; }   /* jamais de défilement en largeur */
    .entete__barre { gap: 4px; flex-wrap: nowrap; }
    .marque { flex: 0 0 auto; }
    .marque__textes { display: none; }
    .marque__logo { width: 36px; height: 36px; }
    .menu__reflexion, .menu__bouton { padding: 8px 8px; font-size: 13.5px; gap: 4px; }
    .menu__ici { display: none; }
    .projets { flex: 0 1 auto; min-width: 0; }
    .projets__bouton { min-width: 0; }
    .projets__nom { min-width: 0; white-space: nowrap; }
    .forfait-resume {
        display: inline-flex; align-items: center; gap: 2px; min-height: var(--cible); padding: 4px 8px; flex: 0 0 auto;
        border: 1px solid var(--orange-200); border-radius: var(--rayon); background: var(--fond);
        font-family: var(--mono); font-size: 12.5px; font-weight: 500; color: var(--brun-800); text-decoration: none; white-space: nowrap;
    }
    .forfait-resume__avis { font-weight: 700; color: var(--alerte); }
    .entete--forfait-ouvert .forfait-resume { background: var(--orange-50); }
    /* Les jauges : un panneau par-dessus l'écran (comme le menu), fermé tant qu'on n'appuie pas sur le résumé. */
    .jauges { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 30; padding: 10px 12px 12px; gap: 8px; background: var(--fond); border-bottom: 1px solid var(--orange-200); box-shadow: 0 12px 32px rgba(28, 25, 23, .14); max-height: calc(100dvh - 80px); overflow-y: auto; overscroll-behavior: contain; }
    .entete--forfait-ouvert .jauges { display: flex; }
    .jauges__etat { display: block; flex-basis: 100%; font-weight: 600; color: var(--brun-800); }
    /* Le panneau prend la largeur de l'écran, sous la barre, par-dessus le contenu. */
    .menu, .menu__deroulant { position: static; }
    .menu__panneau { top: 100%; left: 12px; right: 12px; width: auto; max-width: none; max-height: calc(100dvh - 160px); overflow-y: auto; overscroll-behavior: contain; }
    .entete__droite { display: contents; }
    /* L'état n'est plus qu'un point (le texte reste lu par les lecteurs d'écran, et dit dans le panneau). */
    .entete__droite .etat { position: relative; flex: 0 0 auto; width: 14px; height: 14px; padding: 0; margin: 0 6px; font-size: 0; line-height: 0; color: transparent; border: 2px solid var(--orange-600); }
    /* Une cible un peu plus grande que le point, sans déborder sur ses voisins : elle ne dépasse pas sa marge (6px). */
    .entete__droite .etat::after { content: ''; position: absolute; inset: -6px; }
    .entete__droite .etat--ouvert { background: var(--orange-600); }
    .entete__droite .etat--ferme { background: var(--brun-900); border-color: var(--brun-900); }
    .jauge { flex: 1 1 100%; min-width: 0; gap: 4px; }
    .jauge__haut { font-size: 12.5px; }
    .principal { padding: 16px 16px 40px; }
    .detail { padding: 18px 16px; }
    .carte { padding: 16px; }
    .carte--liste { padding: 0; }
    .historique { padding: 14px 16px; }
    .etapes { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 12px; }
    .semaine { gap: 4px; }
    .jour__colonne { height: 130px; }
    .jour__budget-txt { font-size: 10.5px; }
    .jour__nom { font-size: 12px; }
    .jour__etat { font-size: 10.5px; }
    .titre-ecran { font-size: 21px; }
}

@media (prefers-reduced-motion: no-preference) {
    .bouton, .menu__lien, .menu__reflexion, .menu__bouton, .ligne-demande { transition: background-color .15s ease, color .15s ease; }
}

/* Projets (atelier.md « Projets ») : le sélecteur de la barre. Chaque projet a sa couleur (demande n° 104) :
   la feuille de style est écrite en orange (les --orange-*, celui de l'atelier et des deux pilotes), et
   l'écran d'un autre projet redéclare ces variables avec la palette de sa couleur (App\Reflexion\Couleur,
   `html:root` dans l'en-tête de la page). Le logo, lui, est toujours orange (App\Http\Logo). Le projet
   courant est montré dans sa couleur : le sélecteur, comme le trait du haut de l'en-tête. */
.projets__bouton { gap: 8px; max-width: 260px; background: var(--orange-700); border-color: var(--orange-700); color: #fff; }
.projets__bouton:hover, .menu__deroulant[open] > .projets__bouton { background: var(--brun-800); border-color: var(--brun-800); color: #fff; }
.projets__bouton::after { color: rgba(255, 255, 255, .85); }
.projets__nom { overflow: hidden; text-overflow: ellipsis; }
.projets__logo { display: none; }   /* le logo doublé n'existe que sur téléphone */
.projets__pilote, .projets__sommeil { font-size: 11px; font-weight: 600; border-radius: 99px; padding: 1px 8px; white-space: nowrap; }
.projets__pilote { background: var(--couleur-projet, var(--orange-700)); color: #fff; }
.projets__bouton .projets__pilote { background: #fff; color: var(--brun-800); }
.projets__sommeil { background: var(--gris-100); color: var(--gris-700); }
/* Les cartes qui attendent Léo dans chaque projet (plus d'écran « À vous », Léo, 13/10) ; un point si d'autres projets en ont. */
.projets__lien .projets__compte { margin-left: auto; }
.projets__ailleurs { width: 8px; height: 8px; border-radius: 99px; background: #fff; flex: 0 0 auto; }
.projets__groupe { margin: 4px 12px 2px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gris-500); }
/* Dans la liste, chaque projet porte SA couleur (--couleur-projet, posée sur le lien), quel que soit le projet affiché. */
.projets__point { width: 12px; height: 12px; border-radius: 99px; background: var(--couleur-projet, var(--orange-700)); flex: 0 0 auto; }
.projets__lien-nom { flex: 1 1 auto; min-width: 0; }
.sommeil { border: 1px solid var(--gris-200); background: var(--gris-100); color: var(--gris-700); border-radius: var(--rayon-carte); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.sommeil__titre { font-family: var(--titre); font-weight: 600; font-size: 17px; color: var(--texte); margin: 0; }
@media (max-width: 720px) {
    .projets__bouton { max-width: 120px; padding: 8px 8px; }
    .projets__bouton .projets__sommeil, .projets__bouton .projets__pilote { display: none; }
    /* Logo + flèche = une seule cible (Léo, 01/11 : la flèche seule, ~28 px, était trop dure à toucher). Le lien
       du logo est masqué ici ; le bouton Réflexion voisin ramène à la Réflexion. Pas d'espace mort : le logo est dans le bouton. */
    .marque { display: none; }
    .projets__bouton { min-width: 48px; min-height: var(--cible); justify-content: center; gap: 4px; padding: 4px 6px; background: var(--fond); border-color: var(--orange-200); color: var(--texte); }
    .projets__bouton::after { color: var(--gris-500); }
    .projets__bouton:hover, .projets[open] > .projets__bouton { background: var(--orange-50); border-color: var(--orange-200); color: var(--texte); }
    .projets__logo { display: block; width: 36px; height: 36px; flex: 0 0 auto; }
    .projets__ailleurs { background: var(--orange-600); }
    /* « Nouveaux messages ↓ » se pose au-dessus de la zone de saisie collée (sa hauteur est mesurée par atelier.js), jamais dessus. */
    .fil-repere { bottom: calc(var(--saisie-h, 0px) + 12px); }
}
/* Écrans très étroits (320 px) : la barre d'une ligne ne tient plus avec le nom du projet. Le logo porte déjà son
   initiale et le bouton garde son « ▾ » et son libellé pour les lecteurs d'écran ; le reste se serre. */
@media (max-width: 380px) {
    .entete__barre { gap: 3px; }
    .projets__nom { display: none; }
    .projets__bouton { gap: 4px; padding: 4px 6px; }
    .menu__reflexion, .menu__bouton { padding: 8px 6px; }
    .forfait-resume { padding: 4px 6px; }
    .entete__droite .etat { margin: 0 3px; }
    .entete__droite .etat::after { inset: -3px; }
}

/* Tableau de bord (n° 238) : téléphone d'abord (320 à 720 px), une colonne ; sur grand écran, la colonne des
   réglages (étape 4, encore cachée) se pose à droite. Les bandes d'un jour sont une ligne : date, barre, total. */
.tableau { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.tableau__principal, .tableau__vivant { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.tableau__section { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tableau__titre { font-family: var(--titre); font-weight: 600; font-size: 18px; margin: 0; }
.tableau__section .sous-titre { margin: 8px 0 0; }
.tableau__maintenant { list-style: none; margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--orange-50); display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.tableau__cles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tableau__cle { border: 1px solid var(--orange-200); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tableau__cle-nom { font-size: 13px; color: var(--gris-700); }
.tableau__cle-valeur { font-family: var(--titre); font-weight: 600; font-size: 22px; color: var(--brun-900); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tableau__neutre { margin: 0; color: var(--gris-700); }
.tableau__legende { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--gris-700); }
.tableau__legende li { display: flex; align-items: center; gap: 6px; }
.tableau__legende .bande { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.bandes { display: flex; flex-direction: column; border-top: 1px solid var(--gris-200); }
.bandes__jour { border-bottom: 1px solid var(--gris-200); }
.bandes__ligne { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: var(--cible); cursor: pointer; list-style: none; }
.bandes__ligne::-webkit-details-marker { display: none; }
.bandes__date { font-size: 13px; color: var(--gris-700); }
.bandes__barre { display: flex; height: 16px; border-radius: 4px; overflow: hidden; background: var(--gris-100); min-width: 0; }
.bandes__total { font-size: 13px; min-width: 44px; text-align: right; }
.bande { display: block; height: 100%; }
.bande--code { background: #15803D; }
.bande--petit_modele { background: #2563EB; }
.bande--claude, .bande--sessions { background: var(--orange-600); }
.bande--reflexion { background: var(--brun-900); }
.bande--autre { background: var(--gris-400); }
.bandes__detail, .tableau__liste { margin: 0; padding: 0 0 10px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.bandes__detail > div, .tableau__liste > div { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bandes__detail dt, .tableau__liste dt { color: var(--gris-700); }
.bandes__detail dd, .tableau__liste dd { margin: 0; }
.bandes__sous { padding-left: 14px; font-size: 13px; }
.tableau__demandes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tableau__demandes li { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.tableau__tableau { overflow-x: auto; }
.tableau__tableau table { border-collapse: collapse; width: 100%; font-size: 14px; }
.tableau__tableau th, .tableau__tableau td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--gris-200); white-space: nowrap; }
.tableau__tableau th:first-child { text-align: left; }
/* Simulation (n° 243) : la courbe prévue est en tirets bleus, le réel en trait plein orange ; une colonne sur téléphone. */
.simulation { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.simulation__hypotheses { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.simulation__hypothese { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--orange-200); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.simulation__hypothese--a-remplir { border-color: var(--orange-600); background: var(--orange-50); }
.simulation__demande { color: var(--brun-900); }
.simulation__nom { font-size: 14px; overflow-wrap: anywhere; }
.simulation__champs { display: flex; flex-wrap: wrap; gap: 8px; }
.simulation__champs label { display: flex; flex-direction: column; gap: 2px; flex: 1 1 90px; font-size: 13px; color: var(--gris-700); }
.simulation__hypothese input[type=number] { width: 100%; min-height: var(--cible); border: 1px solid var(--orange-200); border-radius: var(--rayon); padding: 8px 12px; background: var(--orange-25); color: var(--texte); }
.simulation__hypothese input::placeholder { color: var(--gris-400); opacity: 1; }
.simulation__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.simulation__courbe { width: 100%; height: auto; max-height: 220px; background: var(--orange-25); border-radius: 12px; }
.simulation__axe { stroke: var(--gris-200); stroke-width: 1; }
.simulation__reel { stroke: var(--orange-600); stroke-width: 2.5; fill: none; }
.simulation__prevu { stroke: #2563EB; stroke-width: 2.5; fill: none; stroke-dasharray: 6 4; }
.simulation__plafond { stroke: var(--brun-900); stroke-width: 1.5; fill: none; stroke-dasharray: 1 4; stroke-linecap: round; }
.simulation__trait { flex: none; }
.simulation__parts:empty { background: var(--gris-100); }
/* Réglages (n° 246) : une colonne sur téléphone, sous la colonne principale ; à droite sur grand écran. Un réglage qui ne se
   change pas d'ici (noyau, lecture seule) est grisé ; un verrouillé l'est davantage, avec sa raison. */
.tableau__reglages { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.reglages__fichier { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.reglages__titre { font-size: 15px; font-weight: 600; margin: 8px 0 0; overflow-wrap: anywhere; }
.reglages__formulaire { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.reglage { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--orange-200); border-radius: 12px; padding: 10px 12px; min-width: 0; overflow-wrap: anywhere; }
.reglage--lecture { border-color: var(--gris-200); background: var(--gris-100); }
.reglage--verrouille { border-color: var(--gris-200); background: var(--gris-100); color: var(--gris-700); }
.reglage__nom { font-size: 14px; }
.reglage__valeur { font-weight: 600; }
.reglage__champ { width: 100%; min-height: var(--cible); border: 1px solid var(--orange-200); border-radius: var(--rayon); padding: 8px 12px; background: var(--orange-25); color: var(--texte); }
.reglage__sens { color: var(--brun-900); }
.reglage__liste, .reglages__verrous { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.reglages__verrous { list-style: none; padding: 0; }
.reglages__actions { display: flex; flex-direction: column; gap: 4px; }
.r-carte__relache { font-weight: 600; }
@media (min-width: 721px) {
    .simulation__hypotheses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tableau__cles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
    .bandes__ligne { grid-template-columns: 64px minmax(0, 1fr) 72px; }
    .tableau:has(.tableau__reglages:not([hidden])) { grid-template-columns: minmax(0, 1fr) 320px; }
}
