/* Listes de chantier — styles PROPRES au module. La charte (charte.css) est
 * la source unique des tokens et des composants communs ; ici, seulement la
 * mise en page d'une liste qu'on coche d'un pouce, sur un téléphone, avec
 * des gants. Modèle : une liste de l'app Notes — titre, sections, cases. */

html { font-size: 17px; }
body { padding-bottom: 10rem; /* place pour le composeur fixé en bas */ }

header { max-width: 680px; padding: 1.1rem 1rem .6rem; }
header h1 { font-size: 1.6rem; }
.sous-projet { margin: .25rem 0 0; font-family: var(--serif); font-size: 1.05rem; color: var(--ink-2); }
.sous-projet .code { font-family: var(--mono); font-size: .8rem; margin-right: .5rem; }

main { max-width: 680px; margin: 1rem auto; padding: 1rem 1rem 1.25rem; }
main section + section { margin-top: 1.5rem; }
main h2.mono-label { margin: 0 0 .6rem; }
.explication { line-height: 1.5; margin: 0 0 1rem; }
code { font-family: var(--mono); font-size: .85em; color: var(--ink-2); }

.bandeau {
  position: sticky; top: 0; z-index: 5; padding: .6rem 1rem; font-size: .9rem; text-align: center;
  background: var(--accent-soft); color: var(--accent-deep); border-bottom: 1px solid var(--line-2);
}
.bandeau.erreur { background: var(--s-avis-soft); color: var(--s-avis-ink); }
.bandeau.ok { background: var(--s-option-soft); color: var(--s-option-ink); }

/* Connexion */
.carte-connexion { display: grid; gap: .75rem; max-width: 22rem; }
.carte-connexion label { display: grid; gap: .25rem; font-size: .85rem; color: var(--ink-2); }
.carte-connexion input { font-size: 1rem; padding: .6rem .7rem; }

/* Gestion : par destinataire, chaque liste se déplie */
.barre select, .barre input { font-size: 1rem; min-width: 12rem; max-width: 100%; }
.entete-section { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.entete-section .lien { font-size: .85rem; }
.groupe { margin-top: 1rem; }
.groupe-titre {
  display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
  margin: 0 0 .2rem; padding-bottom: .3rem; border-bottom: 2px solid var(--ink);
  font-family: var(--serif); font-size: 1.2rem; font-weight: 600;
}
.groupe-titre .tel { font-family: var(--sans); font-size: .85rem; font-weight: 400; color: var(--ink-2); }
.groupe-titre .compte { margin-left: auto; font-family: var(--sans); font-size: .8rem; font-weight: 400; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.groupe-titre.sans { border-bottom-color: var(--line-2); color: var(--ink-2); }
details.fiche { border-bottom: 1px solid var(--line); }
details.fiche > summary {
  list-style: none; cursor: pointer; padding: .7rem 0;
  display: grid; grid-template-columns: 1.1rem 1fr auto; column-gap: .5rem; align-items: baseline;
}
details.fiche > summary::-webkit-details-marker { display: none; }
details.fiche > summary::before { content: "›"; color: var(--ink-3); font-size: 1.2rem; line-height: 1; transition: transform .15s; }
details.fiche[open] > summary::before { transform: rotate(90deg); }
.fiche .nom { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.fiche .projet { grid-column: 2; font-size: .82rem; color: var(--ink-2); }
.fiche .projet .code { font-family: var(--mono); margin-right: .4rem; }
.fiche .progres { font-size: .85rem; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fiche .progres.complet { color: var(--s-option-ink); }
.fiche .corps { padding: 0 0 .9rem 1.6rem; display: grid; gap: .6rem; }
.fiche .actions { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; }
.fiche .actions .lien { font-size: .9rem; }
.fiche .actions .danger { color: var(--s-avis-ink); }
.fiche .actions .texto { font-weight: 600; }
.apercu { margin: 0; padding: 0; list-style: none; font-size: .92rem; }
.apercu .section-titre { font-size: .95rem; margin: .4rem 0 .1rem; }
.apercu li { display: flex; gap: .5rem; align-items: baseline; padding: .15rem 0; }
.apercu .coche { flex: 0 0 auto; width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 1.5px solid var(--line-2); font-size: .7rem; display: grid; place-items: center; color: transparent; }
.apercu li.termine .coche { background: var(--accent); border-color: var(--accent); color: #fff; }
.apercu li.a_valider .coche { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.apercu li.termine .txt, .apercu li.a_valider .txt { color: var(--ink-2); }
.apercu .txt small { color: var(--ink-3); }
.apercu .vide { color: var(--ink-3); font-style: italic; }

/* La liste */
.barre-liste { display: flex; gap: 1rem; flex-wrap: wrap; align-items: baseline; margin-bottom: .5rem; }
.barre-liste .lien { font-size: .9rem; }
.avancement { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: .9rem; margin-right: auto; }
.section-titre {
  margin: 1rem 0 .2rem; font-family: var(--serif); font-size: 1.1rem; font-weight: 600;
  color: var(--ink);
}
.sections > .section-titre:first-child { margin-top: .25rem; }
.items { list-style: none; margin: 0; padding: 0; }
.item {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .55rem 0; border-bottom: 1px solid var(--line);
}
.case {
  flex: 0 0 auto; width: 1.7rem; height: 1.7rem; margin-top: .05rem;
  border-radius: 50%; border: 2px solid var(--line-2); background: var(--sheet);
  padding: 0; display: grid; place-items: center; font-size: 1rem; line-height: 1;
  color: transparent; cursor: pointer;
}
.item.termine .case { background: var(--accent); border-color: var(--accent); color: #fff; }
/* À valider : demi-teinte — cerclé bronze, fond voile, coche bronze */
.item.a_valider .case { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.item.termine .item-texte, .item.a_valider .item-texte { color: var(--ink-2); }
.item .case[disabled] { cursor: default; opacity: .85; }
.item-valider { flex: 0 0 auto; font-size: .85rem; font-weight: 600; }
.case:hover { filter: none; }
.item-corps { flex: 1; min-width: 0; }
.item-texte { margin: 0; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.item-par { margin: .1rem 0 0; font-size: .75rem; color: var(--ink-3); }
.item-retirer { flex: 0 0 auto; color: var(--ink-3); font-size: 1.1rem; text-decoration: none; padding: 0 .2rem; }
.item-retirer:hover { color: var(--s-avis-ink); }
.item.attente { opacity: .55; }

/* Le composeur : fixé en bas, une main suffit */
.composeur-nom .composeur-ligne { align-items: center; }
.composeur-nom .signature { flex: 0 0 auto; }
.a-valider-pill { font-size: .78rem; color: var(--accent-deep); background: var(--accent-soft); padding: .05rem .45rem; border-radius: 4px; margin-left: .4rem; white-space: nowrap; }
.composeur {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  background: var(--sheet); border-top: 1px solid var(--line-2);
  padding: .55rem 1rem calc(.55rem + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgba(0,0,0,.06);
}
.composeur-ligne { display: flex; gap: .5rem; align-items: stretch; max-width: 680px; margin: 0 auto; }
.composeur-ligne + .composeur-ligne { margin-top: .4rem; }
.composeur input { flex: 1; min-width: 0; font-size: 1rem; padding: .5rem .7rem; }
.composeur #section { flex: 1.2; }
.composeur button.primaire { padding: .5rem 1rem; font-size: 1rem; }
.composeur button[disabled] { opacity: .55; cursor: wait; }
.signature { flex: 1; font-size: .85rem; color: var(--ink-2); align-self: center; }
.composeur .erreur { max-width: 680px; margin: .4rem auto 0; }

/* Tablette (iPad, 768 px et plus) : la page s'élargit, les sections se
 * rangent sur deux colonnes, le composeur tient sur une ligne. Le téléphone
 * reste la base ; rien ici ne change le geste, seulement l'usage de l'espace. */
@media (min-width: 768px) {
  html { font-size: 17px; }
  header, main, .composeur-ligne, .composeur .erreur, .demo-note { max-width: 960px; }
  main { padding: 1.4rem 1.6rem 1.6rem; }
  .sections { column-count: 2; column-gap: 2.5rem; }
  .sections > * { break-inside: avoid; }
  .sections > .section-titre { break-after: avoid; margin-top: .25rem; }
  .sections > .items { margin-bottom: 1rem; }
  .composeur { padding-block: .6rem; }
  .composeur-ligne { display: contents; }
  .composeur form, .composeur-ligne + .composeur-ligne { margin-top: 0; }
  .composeur { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
  .composeur #section { flex: 0 1 14rem; }
  .composeur #nom, .composeur .signature { flex: 0 1 14rem; }
  .composeur #texte { flex: 1 1 22rem; }
  .composeur .erreur { flex-basis: 100%; margin: 0; }
  #groupes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2.5rem; align-items: start; }
  .groupe { margin-top: .5rem; }
  .barre-liste { margin-bottom: .75rem; }
}
@media (min-width: 1100px) {
  header, main, .composeur-ligne, .composeur .erreur, .demo-note { max-width: 1100px; }
}
