/* Carnet de Garde — direction « Le Fil ».
   Un seul flux de journées, la plus récente en haut. Pas d'onglets, pas de
   calendrier, pas d'écran de saisie séparé : la carte du jour est dans le flux.

   Règle de composition tenue partout :
     carte blanche  = quelque chose à faire
     ligne sur le papier = quelque chose de fait
     carte verte    = un total */

:root {
  /* Le gris et le gris pâle sont réglés pour 4,5:1 au moins sur le papier et le vert
     pâle (mesuré le 2 octobre 2026) : en dessous, une partie des gens ne lit plus. */
  --papier:      #F4F6F8;
  --carte:       #FFFFFF;
  --encre:       #10161C;
  --gris:        #535E69;
  --gris-pale:   #626D78;
  --trait:       #E3E8ED;
  --vert:        #0F766E;
  --vert-fonce:  #0B5A54;
  --vert-pale:   #E4F0EE;
  --sur-vert:    #FFFFFF;
  --orange:      #C2410C;
  --orange-pale: #FDF0E8;
  --or:          #8C5D06;
  --or-pale:     #FDF3E7;
  --or-trait:    #F0D9B8;
  --ombre:       0 3px 14px rgba(16, 22, 28, .06);

  --serif: "Fraunces", Georgia, serif;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* L'apparence suit le téléphone, sauf choix contraire sur la page du foyer (« Sur cet
   appareil ») : index.html pose alors data-theme sur <html> avant le premier
   affichage. Chaque règle sombre existe donc deux fois — selon le téléphone quand
   rien n'est forcé, et forcée. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --papier:      #0E1214;
    --carte:       #171C1F;
    --encre:       #E8EDEF;
    --gris:        #8A959D;
    --gris-pale:   #808B93;
    --trait:       #262D31;
    --vert:        #4FBFA8;
    --vert-fonce:  #6FD3BE;
    --vert-pale:   #16302C;
    --sur-vert:    #08201C;
    --orange:      #E8845A;
    --orange-pale: #2A1B14;
    --or:          #D2A54A;
    --or-pale:     #251E12;
    --or-trait:    #43361F;
    --ombre:       0 3px 14px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
    --papier:      #0E1214;
    --carte:       #171C1F;
    --encre:       #E8EDEF;
    --gris:        #8A959D;
    --gris-pale:   #808B93;
    --trait:       #262D31;
    --vert:        #4FBFA8;
    --vert-fonce:  #6FD3BE;
    --vert-pale:   #16302C;
    --sur-vert:    #08201C;
    --orange:      #E8845A;
    --orange-pale: #2A1B14;
    --or:          #D2A54A;
    --or-pale:     #251E12;
    --or-trait:    #43361F;
    --ombre:       0 3px 14px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

/* Les titres de page sont de vrais titres pour les lecteurs d'écran ; leur allure,
   elle, reste celle des classes qui les habillent. */
h1.titre, h2.titre, h1.titre-page, h1.salut { margin: 0; font-size: inherit; }
/* Un titre que seuls les lecteurs d'écran lisent : la page en a besoin pour qu'on y
   navigue de titre en titre, l'écran n'en a pas la place. */
.visuellement-cache {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; color: inherit; }
a { color: var(--vert); }
:focus-visible { outline: 2px solid var(--vert); outline-offset: 2px; border-radius: 6px; }

/* ---------- structure ---------- */

.app { min-height: 100dvh; display: flex; flex-direction: column; }

.entete {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 18px 12px;
  max-width: 520px; margin: 0 auto; width: 100%;
}

.marque {
  font-family: var(--serif); font-size: 19px; font-weight: 700;
  letter-spacing: -.01em; text-decoration: none; color: var(--encre);
  display: inline-flex; align-items: center; gap: 9px;
}
.marque img { border-radius: 7px; flex: 0 0 auto; }

.roue {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--trait); background: var(--carte);
  display: grid; place-items: center; color: var(--gris);
  text-decoration: none; font-size: 15px; flex: 0 0 auto;
}
.roue:hover { border-color: var(--vert); color: var(--vert); }

/* Qui est connecté. Poussé à droite, juste avant la roue des réglages. */
.compte {
  margin-left: auto; display: flex; flex-direction: column; align-items: flex-end;
  gap: 1px; min-width: 0; line-height: 1.25;
}
.compte .qui {
  font-size: 12.5px; font-weight: 600; color: var(--encre);
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Un bouton depuis que la déconnexion passe par MSAL : il garde l'allure d'un lien discret. */
.compte .deconnexion {
  font: inherit; font-size: 11px; color: var(--gris); text-decoration: none;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.compte .deconnexion:hover { color: var(--vert); text-decoration: underline; }

.contenu {
  flex: 1; width: 100%; max-width: 520px; margin: 0 auto;
  padding: 0 18px 40px;
  display: flex; flex-direction: column; gap: 13px;
}

/* Le lien vers les avis, en bas de chaque page pendant la bêta (MainLayout). */
.lien-avis {
  margin: -16px auto 0; padding: 0 18px 22px; text-align: center;
  font-size: 12.5px; color: var(--gris);
  /* Pas avant la page : seul au milieu d'un écran encore vide, il intriguait (F-13). */
  animation: sq-apparait 0s linear 1s both;
}
.lien-avis .lien { color: var(--vert); font-weight: 600; font-size: inherit; text-decoration: none; }
.lien-avis .lien:hover { text-decoration: underline; }

/* ---------- la carte du jour ---------- */

.carte {
  background: var(--carte); border-radius: 16px;
  padding: 15px 15px 14px; box-shadow: var(--ombre);
  display: flex; flex-direction: column; gap: 11px;
}

.carte .quand { font-family: var(--serif); font-size: 20px; font-weight: 700; line-height: 1.15; }
.carte .prevu { font-size: 12.5px; color: var(--gris); margin-top: -7px; }

/* La date passe au-dessus du titre quand celui-ci est une question. */
.carte .prevu.avant { margin-top: 0; margin-bottom: -7px; }

/* Trois réponses, une seule dominante. Les deux secondaires se ressemblent
   entre elles, pas au « Oui » : l'une est une réponse, les autres des issues. */
.reponses { display: flex; flex-direction: column; gap: 8px; }
.reponses .autres { display: flex; gap: 8px; }
.reponses .autres > .secondaire { flex: 1; padding: 11px 8px; font-size: 13.5px; }

.badge {
  display: inline-block; font-size: 11px; border-radius: 5px; padding: 1px 6px;
  border: 1px solid var(--or-trait); background: var(--or-pale); color: var(--or);
  vertical-align: 1px;
}

/* Ce qu'un « Comme prévu » enregistre vraiment : posé sur le papier, à
   l'intérieur de la carte, pour se lire comme une note et non comme un formulaire. */
.recap-jour {
  background: var(--papier); border-radius: 11px; padding: 11px 12px;
  display: flex; flex-direction: column; gap: 7px;
}
.recap-jour .l {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-size: 12.5px; color: var(--gris);
}
.recap-jour .l b { font-family: var(--mono); font-size: 12.5px; font-weight: 500; color: var(--encre); }
.recap-jour .l b.rien { color: var(--gris-pale); font-family: var(--sans); }
.recap-jour .l b.plus { color: var(--vert); }
.recap-jour .l.total { border-top: 1px solid var(--trait); padding-top: 8px; }
.recap-jour .l.total b { color: var(--vert); font-weight: 600; }

.principal {
  background: var(--vert); color: var(--sur-vert); border: 0; border-radius: 12px;
  padding: 14px; font-size: 15px; font-weight: 600; width: 100%; cursor: pointer;
}
.principal:hover:not(:disabled) { background: var(--vert-fonce); }
.principal:disabled { opacity: .5; cursor: not-allowed; }

.lien {
  background: none; border: 0; color: var(--vert);
  font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 2px;
}

.discret {
  background: none; border: 0; color: var(--gris);
  font-size: 12.5px; cursor: pointer; padding: 2px;
}
.discret:hover { color: var(--orange); }

/* ---------- horaires ---------- */

.heures { display: flex; gap: 10px; }

.heures label {
  flex: 1; background: var(--papier); border: 1px solid var(--trait);
  border-radius: 11px; padding: 8px 11px 9px;
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
}

.heures label span {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gris); font-weight: 500;
}

.heures label input {
  font-family: var(--mono); font-size: 18px; font-weight: 500;
  background: transparent; border: 0; color: var(--encre); width: 100%; padding: 0;
}

.duree {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; font-size: 12.5px; color: var(--gris);
}
.duree b { font-family: var(--mono); color: var(--encre); font-weight: 500; }

.puce { font-size: 11.5px; font-weight: 500; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.puce.ok { background: var(--vert-pale); color: var(--vert); }
.puce.ecart { background: var(--orange-pale); color: var(--orange); }
.puce.doux { background: var(--papier); color: var(--gris); border: 1px solid var(--trait); }

/* ---------- indemnités : visibles, jamais cachées ---------- */

.indemnites { display: flex; flex-direction: column; gap: 7px; }

.indemnite {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--trait); border-radius: 11px;
  background: var(--papier); font-size: 13.5px; cursor: pointer;
  text-align: left; width: 100%;
}
.indemnite:hover { border-color: var(--vert); }
.indemnite .gauche { display: flex; align-items: center; gap: 10px; }
.indemnite .montant { font-family: var(--mono); font-size: 13px; color: var(--gris); }
.indemnite[aria-pressed="true"] { border-color: var(--vert); background: var(--vert-pale); }
.indemnite[aria-pressed="true"] .montant { color: var(--vert); font-weight: 600; }

.case {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--gris-pale); flex: 0 0 auto;
  display: grid; place-items: center; background: var(--carte);
}
.indemnite[aria-pressed="true"] .case { background: var(--vert); border-color: var(--vert); }
.indemnite[aria-pressed="true"] .case::after {
  content: ""; width: 9px; height: 5px;
  border-left: 2px solid var(--sur-vert); border-bottom: 2px solid var(--sur-vert);
  transform: rotate(-45deg) translate(1px, -1px);
}

/* ---------- ce qui s'est passé ---------- */

.choix { display: flex; flex-direction: column; gap: 7px; }

.choix .famille {
  font-size: 11px; letter-spacing: .11em; text-transform: uppercase;
  color: var(--gris); margin-top: 4px;
}
.choix .famille.maintenu { color: var(--vert); }
.choix .famille.reduit { color: var(--orange); }

.choix button {
  background: var(--papier); border: 1px solid var(--trait); border-radius: 11px;
  padding: 12px; font-size: 13.5px; text-align: left; cursor: pointer; min-height: 44px;
}
.choix button:hover { border-color: var(--vert); }
.choix button[aria-pressed="true"] { border-width: 1.5px; font-weight: 600; }
.choix button.normale[aria-pressed="true"] { background: var(--vert); border-color: var(--vert); color: var(--sur-vert); }
.choix button.maintenu[aria-pressed="true"] { background: var(--vert-pale); border-color: var(--vert); color: var(--vert); }
.choix button.reduit[aria-pressed="true"] { background: var(--orange-pale); border-color: var(--orange); color: var(--orange); }
.choix button.apart[aria-pressed="true"] { background: var(--or-pale); border-color: var(--or); color: var(--or); }

.champ-note {
  background: var(--papier); border: 1px solid var(--trait); border-radius: 11px;
  padding: 8px 11px 9px; display: flex; flex-direction: column; gap: 1px;
}
.champ-note span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gris); font-weight: 500; }
.champ-note input,
.champ-note textarea {
  border: 0; background: transparent; color: var(--encre); font-size: 14px;
  width: 100%; padding: 0; font-family: var(--sans); resize: vertical; line-height: 1.4;
}

/* ---------- les lignes du fil ---------- */

.jour {
  display: flex; align-items: stretch; gap: 11px;
  padding: 11px 4px; border: 0; border-bottom: 1px solid var(--trait);
  background: none; width: 100%; text-align: left; cursor: pointer;
}
.jour:hover { background: rgba(15, 118, 110, .05); }

/* Un filet de 2 px là où il y avait une pastille pleine de 9 px, et seulement sur
   les journées qui sortent de l'ordinaire : une ponctuation présente sur chaque
   ligne n'est plus une ponctuation, c'est une texture de fond. */
.jour .bande { width: 2px; border-radius: 2px; background: transparent; flex: 0 0 auto; }
.jour .bande.absente { background: var(--gris-pale); }
.jour .bande.oubli { background: var(--orange); }
.jour .bande.ferie { background: var(--or); }

.jour .corps-jour { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.jour .haut { display: flex; align-items: center; justify-content: space-between; gap: 11px; }

.jour .texte { min-width: 0; font-size: 13.5px; }
.jour .texte small { display: block; color: var(--gris); font-size: 11.5px; white-space: nowrap; }

.jour .total {
  font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--encre);
  font-variant-numeric: tabular-nums; white-space: nowrap; flex: 0 0 auto;
}
.jour .total.plus { color: var(--vert); }
.jour .total.moins { color: var(--orange); }

/* Le détail commente la ligne entière, il n'appartient pas à la colonne des euros :
   deux textes qui se disputaient la largeur coupaient toujours la durée. */
.jour .detail {
  font-family: var(--mono); font-size: 11px; color: var(--gris-pale);
  text-align: right; margin-top: 3px;
}

/* ---------- la carte du mois ---------- */

.mois {
  background: var(--vert); color: var(--sur-vert); border: 0; border-radius: 16px;
  padding: 14px 15px; display: flex; flex-direction: column; gap: 5px;
  text-align: left; cursor: pointer; width: 100%; box-shadow: var(--ombre);
}
.mois:hover { background: var(--vert-fonce); }
.mois .m { font-family: var(--serif); font-size: 16.5px; font-weight: 700; }
.mois .l { display: flex; justify-content: space-between; font-size: 12.5px; color: rgba(255,255,255,.88); }
.mois .l b { font-family: var(--mono); font-weight: 500; }
.mois .total {
  border-top: 1px solid rgba(255, 255, 255, .3); padding-top: 7px; margin-top: 3px;
  font-size: 15px; font-weight: 600; display: flex; justify-content: space-between;
}
.mois .total b { font-family: var(--mono); }
.mois .ouvrir { font-size: 11.5px; color: rgba(255,255,255,.8); margin-top: 3px; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mois .l { color: rgba(8, 32, 28, .8); }
  :root:not([data-theme="light"]) .mois .ouvrir { color: rgba(8, 32, 28, .72); }
  :root:not([data-theme="light"]) .mois .total { border-top-color: rgba(8, 32, 28, .25); }
}
:root[data-theme="dark"] .mois .l { color: rgba(8, 32, 28, .8); }
:root[data-theme="dark"] .mois .ouvrir { color: rgba(8, 32, 28, .72); }
:root[data-theme="dark"] .mois .total { border-top-color: rgba(8, 32, 28, .25); }

/* ---------- bandeaux ---------- */

.fait {
  display: flex; align-items: center; gap: 9px;
  background: var(--vert-pale); border-radius: 12px; padding: 12px 14px;
  font-size: 13.5px; color: var(--vert); font-weight: 600;
}

.rattrapage {
  background: var(--or-pale); border: 1px solid var(--or-trait); border-radius: 14px;
  padding: 13px 14px; display: flex; flex-direction: column; gap: 9px;
}
.rattrapage .t { font-size: 13.5px; font-weight: 600; color: var(--or); }
.rattrapage .s { font-size: 12.5px; color: var(--or); margin-top: -6px; }
.rattrapage button {
  background: var(--or); color: var(--carte); border: 0; border-radius: 10px;
  padding: 11px; font-size: 13px; font-weight: 600; cursor: pointer;
}

.avis {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px;
  border-radius: 11px; border: 1px solid var(--trait); background: var(--carte); font-size: 13px;
}
.avis .pastille { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; background: var(--vert); }
.avis .corps { display: flex; flex-direction: column; gap: 2px; }
.avis .corps b { font-weight: 600; }
.avis .corps span { color: var(--gris); font-size: 12.5px; }
.avis.attention { border-color: var(--or-trait); background: var(--or-pale); }
.avis.attention .pastille { background: var(--or); }
.avis.alerte { border-color: var(--orange); background: var(--orange-pale); }
.avis.alerte .pastille { background: var(--orange); }

.fin-fil { text-align: center; font-size: 12.5px; color: var(--gris-pale); padding: 14px 0 4px; }
.aide { font-size: 12.5px; color: var(--gris); margin: 0; }
.aide.centre { text-align: center; }

/* ---------- panneaux dépliés ---------- */

.panneau {
  background: var(--carte); border-radius: 16px; padding: 15px;
  box-shadow: var(--ombre); display: flex; flex-direction: column; gap: 9px;
}
.panneau .titre { font-family: var(--serif); font-size: 17px; font-weight: 700; }
.panneau .section { font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--gris); font-weight: 600; }

.rang { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; color: var(--gris); }
.rang b { font-family: var(--mono); color: var(--encre); font-weight: 500; font-size: 13px; }
.rang small { display: block; font-size: 11.5px; color: var(--gris-pale); font-family: var(--sans); }
.rang .libelle { display: flex; flex-direction: column; }
.rang + .rang { border-top: 1px solid var(--trait); padding-top: 9px; }
.rang.total { border-top: 1.5px solid var(--vert); padding-top: 9px; margin-top: 3px; }
.rang.total b { color: var(--vert); font-size: 15.5px; font-weight: 600; }
.rang.retrait b { color: var(--orange); }

/* ---------- l'état au repos ----------
   Rien à faire ce soir. Ce n'est donc pas une carte blanche — le blanc reste
   réservé à ce qui attend un geste — mais l'emplacement, lui, ne bouge pas. */

.repos {
  border: 1.5px solid var(--vert-pale); border-radius: 16px;
  padding: 17px 15px; display: flex; flex-direction: column; gap: 4px;
  align-items: center; text-align: center;
}
.repos .t { font-family: var(--serif); font-size: 21px; font-weight: 700; color: var(--vert); }
.repos .s { font-size: 13px; color: var(--gris); }
.repos .n { font-family: var(--mono); font-size: 11.5px; color: var(--gris-pale); margin-top: 3px; }

/* ---------- le repère de semaine ----------
   La semaine ISO décide des heures complémentaires et majorées : la montrer,
   c'est donner au fil la structure qui décide déjà de l'argent. */

.semaine {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 11px 4px 3px; border-top: 1.5px solid var(--trait); margin-top: 5px;
}
.semaine:first-child { border-top: 0; margin-top: 0; padding-top: 2px; }
.semaine .l {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--gris-pale); font-weight: 700;
}
.semaine .h {
  font-family: var(--mono); font-size: 11px; color: var(--gris-pale);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.semaine .h.complementaire { color: var(--or); }
.semaine .h.majoree { color: var(--orange); font-weight: 500; }

/* ---------- la pile des versions du contrat ----------
   Un avenant est une modification datée : la pile le montre comme tel, chaque
   version disant ce qu'elle change et sur quelle période elle a régné. */

.pile { display: flex; flex-direction: column; }

.pile .etape {
  display: grid; grid-template-columns: 16px 1fr; gap: 12px;
  position: relative; padding-bottom: 12px;
}
.pile .etape:not(:last-child)::before {
  content: ""; position: absolute; left: 7px; top: 17px; bottom: 0;
  width: 1.5px; background: var(--trait);
}
.pile .rond {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--trait); background: var(--carte); margin-top: 4px; z-index: 1;
}
.pile .etape.actif .rond { border-color: var(--vert); background: var(--vert); }

.pile .bloc { background: var(--papier); border-radius: 10px; padding: 10px 12px; }
.pile .etape.actif .bloc { background: var(--vert-pale); }

.pile .dt {
  display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--gris-pale); font-weight: 600;
}
.pile .ti { display: block; font-family: var(--serif); font-size: 15px; font-weight: 600; margin: 1px 0 4px; }
.pile .df { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--gris); }
.pile .df s { color: var(--gris-pale); text-decoration-thickness: 1px; }
.pile .df em { font-style: normal; color: var(--encre); font-family: var(--mono); font-size: 11.5px; }

.avertissement { border-left: 2px solid var(--or); padding: 2px 0 2px 13px; color: var(--gris); font-size: 12px; }

.retour {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: 0; color: var(--vert);
  font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 2px; text-decoration: none;
}

/* ---------- contrat ---------- */

.paire { display: flex; gap: 10px; }
.paire > * { flex: 1; min-width: 0; }

.champ {
  background: var(--papier); border: 1px solid var(--trait); border-radius: 11px;
  padding: 8px 11px 9px; display: flex; flex-direction: column; gap: 1px;
}
.champ > span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gris); font-weight: 500; }
.champ input {
  font-family: var(--mono); font-size: 16px; font-variant-numeric: tabular-nums;
  background: transparent; border: 0; color: var(--encre); width: 100%; padding: 0;
}
.champ input[type="text"] { font-family: var(--sans); }
.champ textarea {
  font-family: var(--sans); font-size: 15px; background: transparent; border: 0;
  color: var(--encre); width: 100%; padding: 0; resize: vertical; line-height: 1.4;
}

/* Une grille nommée plutôt qu'un flex qui déborde : à 375 px, les deux heures
   passaient à la ligne en laissant le tiret orphelin en fin de première ligne. */
.ligne-jour {
  display: grid; align-items: center; gap: 8px 10px;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "nom plage duree";
}
.ligne-jour.sans { grid-template-columns: auto 1fr; grid-template-areas: "nom duree"; }
.ligne-jour .nom-jour {
  grid-area: nom; min-width: 104px; text-align: left; padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--trait); background: var(--papier); font-size: 13px; cursor: pointer;
}
.ligne-jour .nom-jour[aria-pressed="true"] { background: var(--vert-pale); border-color: var(--vert); color: var(--vert); font-weight: 600; }
.ligne-jour .plage { grid-area: plage; display: flex; align-items: center; gap: 6px; }
.ligne-jour .heure {
  font-family: var(--mono); font-size: 14px; padding: 7px 9px; min-width: 0;
  border: 1px solid var(--trait); border-radius: 9px; background: var(--carte); color: var(--encre);
}
.ligne-jour .tiret { color: var(--gris-pale); }
.ligne-jour .duree-jour { grid-area: duree; justify-self: end; font-family: var(--mono); font-size: 12.5px; color: var(--gris); }
.ligne-jour .duree-jour.vide { font-family: var(--sans); font-style: italic; color: var(--gris-pale); }

@media (max-width: 560px) {
  .ligne-jour {
    grid-template-columns: auto 1fr;
    grid-template-areas: "nom duree" "plage plage";
  }
  .ligne-jour .plage { justify-content: flex-start; }
}

.secondaire {
  background: transparent; border: 1px solid var(--trait); border-radius: 12px;
  padding: 12px; font-size: 14px; font-weight: 500; cursor: pointer; width: 100%;
}
.secondaire:hover { border-color: var(--vert); color: var(--vert); }

/* ---------- connexion ---------- */

/* La mise en page d'une page entière (connexion, chargement) : un bloc, jamais un
   message. « p.aide.centre » ne fait que centrer son texte — l'habiller ainsi lui
   donnait les deux tiers de l'écran (campagne de test du 8 octobre 2026, F-01). */
div.centre {
  min-height: 65dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px;
}
.centre h1 { font-family: var(--serif); font-size: 28px; margin: 0; }
.centre p { color: var(--gris); margin: 0; max-width: 34ch; }
.centre .principal,
.centre .secondaire { max-width: 260px; width: 100%; }

/* ============================================================
   Ordinateur : le fil garde sa largeur. Les côtés servent à
   sauter dans le temps et à garder les chiffres sous les yeux.
   ============================================================ */

/* ---------- outils de saisie en lot ---------- */

.outils { display: flex; gap: 8px; flex-wrap: wrap; }
.outils button {
  flex: 1 1 auto; padding: 9px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--trait); background: var(--papier); color: var(--gris); font-size: 12.5px;
}
.outils button:hover { border-color: var(--vert); color: var(--vert); }
.outils button.actif { background: var(--vert-pale); border-color: var(--vert); color: var(--vert); font-weight: 600; }

.panneau.outil { border-color: var(--vert); }

/* ---------- navigation entre mois ---------- */

/* Le rail est masqué sous 1000 px : ces deux flèches sont alors le seul moyen
   de changer de mois. */
.nav-mois { display: flex; gap: 8px; }
.nav-mois button {
  flex: 1 1 0; padding: 11px 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--trait); background: transparent; color: var(--gris);
  font-size: 12.5px; font-weight: 500;
}
.nav-mois button:hover:not(:disabled) { border-color: var(--vert); color: var(--vert); }
.nav-mois button:disabled { opacity: .4; cursor: default; }

@media (min-width: 1000px) { .nav-mois { display: none; } }

/* ---------- avis dans le fil ---------- */

/* Sur ordinateur la colonne latérale porte déjà ces avis ; sur téléphone elle
   n'existe pas, et sans ce bloc le total du mois s'afficherait sans réserve. */
.avis-fil { display: flex; flex-direction: column; gap: 8px; }

@media (min-width: 1000px) { .avis-fil { display: none; } }

.mois .encours {
  font-size: 11.5px; color: rgba(255,255,255,.8); margin-top: 2px; font-style: italic;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mois .encours { color: rgba(8, 32, 28, .72); }
}
:root[data-theme="dark"] .mois .encours { color: rgba(8, 32, 28, .72); }

/* ---------- report vers Pajemploi ---------- */

.rang .copier {
  border: 1px solid var(--trait); background: var(--papier); color: var(--gris);
  border-radius: 8px; padding: 4px 9px; font-size: 11px; cursor: pointer; flex: 0 0 auto;
  align-self: center;
}
.rang .copier:hover { border-color: var(--vert); color: var(--vert); }

/* Le formulaire Pajemploi en colonnes fixes : le libellé, le chiffre aligné à droite,
   puis la place du bouton « Copier », réservée même vide. En rangée flexible, le chiffre
   d'une ligne avec « Copier » se plaçait au milieu de l'espace libre, à une position
   qui dépendait de la longueur du libellé : en faisant défiler, les chiffres sautaient
   d'une ligne à l'autre et semblaient mal affichés (retour du 8 octobre 2026). */
.zone-formulaire .rang {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 64px;
  column-gap: 10px; align-items: start;
}
.zone-formulaire .rang > .libelle { grid-column: 1; }
/* Une valeur longue (la période d'emploi) passe sur deux lignes plutôt que d'écraser
   le libellé et son explication. */
.zone-formulaire .rang > b { grid-column: 2; text-align: right; max-width: 13ch; }
.zone-formulaire .rang > .copier { grid-column: 3; justify-self: end; align-self: start; margin-top: -3px; }

.rang small.reserve {
  color: var(--or); font-style: italic; margin-top: 4px; max-width: 46ch;
}

/* ---------- actions destructrices ---------- */

.discret.danger { color: var(--orange); font-weight: 600; }

.deconnexion {
  display: block; text-align: center; text-decoration: none; color: var(--gris);
}
.deconnexion:hover { color: var(--orange); border-color: var(--orange); }

@media (min-width: 1000px) {
  .app { max-width: 1180px; margin: 0 auto; }

  .entete { max-width: none; padding: 20px 26px 14px; border-bottom: 1px solid var(--trait); }
  .marque { font-size: 22px; }

  .cadre { display: grid; grid-template-columns: 186px minmax(0, 1fr) 310px; align-items: start; flex: 1; }

  .contenu { max-width: 470px; padding: 22px 26px 48px; }

  .rail {
    padding: 22px 16px 26px; border-right: 1px solid var(--trait);
    display: flex; flex-direction: column; gap: 3px; position: sticky; top: 0;
  }
  .rail .annee {
    font-size: 11px; letter-spacing: .13em; text-transform: uppercase;
    color: var(--gris); font-weight: 600; margin: 10px 0 4px;
  }
  .rail button {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 9px; border: 0; background: none;
    font-size: 13px; color: var(--gris); cursor: pointer; text-align: left; width: 100%;
  }
  .rail button small { font-family: var(--mono); font-size: 11px; }
  /* Un mois pas encore rapatrié n'a pas de compteur : la pastille dit qu'il
     contient tout de même quelque chose, sans avoir à le charger. */
  .rail button small.saisi { color: var(--vert); font-size: 15px; line-height: 1; }
  .rail button:hover { background: var(--papier); color: var(--encre); }
  .rail button.actif { background: var(--vert-pale); color: var(--vert); font-weight: 600; }

  .cote {
    padding: 22px 20px 26px; border-left: 1px solid var(--trait);
    display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0;
  }
  .cote .titre { font-family: var(--serif); font-size: 17px; font-weight: 700; }

  /* Sur ordinateur, une bande verte pleine largeur pour deux lettres serait
     disproportionnée : les trois réponses tiennent sur une ligne, le « Oui »
     gardant sa couleur et le double de place. */
  .carte .reponses { flex-direction: row; align-items: stretch; }
  .carte .reponses .principal { width: auto; flex: 0 0 auto; padding: 13px 40px; }
  .carte .reponses .autres { flex: 1; }
}

@media (max-width: 999px) {
  .rail, .cote { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- politique de confidentialité : du texte long, qui doit se lire ---------- */
.politique h2 { font-family: var(--serif); font-size: 19px; margin: 22px 0 6px; }
.politique h3 { font-size: 15px; margin: 16px 0 4px; }
.politique p, .politique li { color: var(--encre); }
.politique ul { padding-left: 20px; margin: 6px 0; }
.politique li { margin: 4px 0; }
.politique i { color: var(--gris); }

/* Sur ordinateur, une page de lecture plutôt qu'une colonne de téléphone : le texte
   en plus grand, sur une largeur qui se lit (environ 70 signes par ligne), et à
   gauche un sommaire qui reste en place pendant qu'on fait défiler. */
.sommaire-texte { display: flex; flex-direction: column; gap: 2px; }
.sommaire-texte .entete-sommaire {
  font-size: 11px; letter-spacing: .13em; text-transform: uppercase; font-weight: 600;
  color: var(--gris); margin: 4px 0 6px;
}
.sommaire-texte .entete-sommaire ~ .entete-sommaire { margin-top: 20px; }
.sommaire-texte a {
  font-size: 13.5px; color: var(--encre); text-decoration: none; padding: 5px 10px;
  border-radius: 8px; line-height: 1.35;
}
.sommaire-texte a:hover { background: var(--vert-pale); color: var(--vert); }
.politique h2 { scroll-margin-top: 20px; }

@media (min-width: 1000px) {
  .contenu.politique {
    max-width: 1020px; display: grid; grid-template-columns: 220px minmax(0, 1fr);
    column-gap: 36px; align-items: start;
  }
  .politique > .retour { grid-column: 1 / -1; }
  .politique > .sommaire-texte { grid-column: 1; position: sticky; top: 20px; }
  .politique > .panneau { grid-column: 2; padding: 34px 48px 40px; }
  .politique .panneau .titre { font-size: 30px; }
  .politique .panneau p, .politique .panneau li { font-size: 15px; line-height: 1.65; max-width: 70ch; }
  .politique .panneau p.aide { font-size: 13px; }
  .politique h2 { font-size: 22px; margin-top: 30px; }
  .politique h3 { font-size: 16px; }
}

/* Les rubriques du formulaire Pajemploi, à l'intérieur d'un même panneau. */
.panneau .rang + .section { margin-top: 10px; padding-top: 12px; border-top: 1.5px solid var(--trait); color: var(--vert); }

/* ---------- la barre de navigation ----------
   Quatre destinations, les mêmes sur tous les écrans. Sur téléphone, elle est en
   bas, sous le pouce ; sur ordinateur, dans l'en-tête. */

.onglets { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.onglets a {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 4px 0; border-radius: 10px; text-decoration: none; color: var(--gris); font-size: 11px;
}
.onglets a.actif { color: var(--vert); font-weight: 600; }
.onglets svg {
  width: 46px; height: 28px; padding: 4px 12px; border-radius: 14px;
  stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.onglets a.actif svg { background: var(--vert-pale); }
/* Le retour à l'accueil n'est pas une destination du module : un trait le sépare. */
.onglets .vers-accueil { border-right: 1px solid var(--trait); border-radius: 0; }
.onglets .pastille-onglet {
  position: absolute; top: 4px; left: calc(50% + 9px);
  width: 8px; height: 8px; border-radius: 50%; background: var(--orange); border: 2px solid var(--carte);
}

@media (max-width: 999px) {
  .onglets {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--carte); border-top: 1px solid var(--trait);
    padding: 5px 6px calc(7px + env(safe-area-inset-bottom));
  }
  /* Le contenu ne doit pas finir sous la barre. */
  .app.avec-onglets { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  /* Clavier ouvert pour saisir des horaires : la barre remonterait avec lui et
     masquerait le champ. Elle s'efface le temps de la saisie. */
  body:has(input:focus, textarea:focus, select:focus) .onglets { display: none; }
}

@media (min-width: 1000px) {
  .onglets { display: flex; gap: 4px; margin-left: 22px; }
  .onglets a { flex-direction: row; gap: 7px; padding: 7px 13px; font-size: 13.5px; }
  .onglets a:hover { background: var(--papier); color: var(--encre); }
  .onglets a.actif { background: var(--vert-pale); }
  .onglets svg { width: 18px; height: 16px; padding: 0; border-radius: 0; }
  .onglets a.actif svg { background: none; }
  .onglets .pastille-onglet { top: 5px; left: 22px; }
  .entete .compte { margin-left: auto; }
}

/* ---------- écrans larges : la déclaration du mois et l'année ----------
   Sur téléphone, rien ne change : les panneaux s'empilent dans l'ordre du code.
   Sur ordinateur, ils se rangent sur deux colonnes au lieu d'une bande de 470 px. */

.voisins { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.voisins a { text-decoration: none; color: var(--gris); }
.voisins a:hover { color: var(--vert); }

/* Les rubriques sans chiffre du formulaire, regroupées dans le panneau. */
.rubriques-courtes, .rubrique { display: flex; flex-direction: column; gap: 9px; }
.rubrique > .section { margin-top: 10px; padding-top: 12px; border-top: 1.5px solid var(--trait); color: var(--vert); }

.liste-mois { display: flex; flex-direction: column; gap: 9px; }

/* Les journées du fil : sur téléphone, un regroupement sans effet — la liste
   reste celle de toujours. */
.jours { display: contents; }
/* Sur téléphone, les journées déjà posées à l'avance (des congés, le plus souvent) ne
   passent plus devant la carte du jour : elles se rangent dans « À venir », sous elle
   (F-03). Sur ordinateur, la grille les garde à leur place. */
@media (max-width: 999px) {
  .jours > .futur { display: none; }
}
.a-venir-resume {
  border: 1px dashed var(--trait); border-radius: 14px; padding: 4px 12px;
}
.a-venir-resume > summary {
  cursor: pointer; padding: 8px 0; font-size: 13px; font-weight: 600; color: var(--vert);
}
.a-venir-resume .jour { border-top: 1px solid var(--trait); }
/* Amenée à l'écran par « Les saisir à la suite » : un peu d'air au-dessus. */
#carte-ouverte { scroll-margin-top: 12px; }
#carte-ouverte:focus { outline: none; }

/* Le formulaire du contrat : sur ordinateur, trois colonnes par sujet. Sur
   téléphone, colonnes et regroupement s'effacent, et « order » remet les blocs
   dans l'ordre de toujours — l'adaptation en dernier, avant l'enregistrement. */
@media (max-width: 999px) {
  .formulaire-contrat, .colonne-contrat { display: contents; }
  .bloc-enfant { order: 1; }
  .bloc-horaires { order: 2; }
  .bloc-remuneration { order: 3; }
  .bloc-indemnites { order: 4; }
  .bloc-complementaires { order: 5; }
  .bloc-majorees { order: 6; }
  .bloc-feries { order: 7; }
  .bloc-adaptation { order: 8; }
  .ecran-contrat > .apres-formulaire { order: 9; }
}

/* Sur téléphone, les deux colonnes de l'écran du mois n'existent pas : leurs
   panneaux reprennent leur place dans la pile, et les montants restent en dernier,
   après les détails et les avis, comme avant. */
@media (max-width: 999px) {
  .colonne-principale, .colonne-laterale { display: contents; }
  .ecran-mois .zone-montants { order: 1; }
}

.tableau-mois { width: 100%; border-collapse: collapse; font-size: 13px; }
.tableau-mois th {
  text-align: right; font-size: 11px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--gris); font-weight: 600; padding: 0 0 6px 12px;
}
.tableau-mois th:first-child { text-align: left; padding-left: 0; }
.tableau-mois td { padding: 8px 0 8px 12px; border-top: 1px solid var(--trait); color: var(--gris); text-align: right; }
.tableau-mois td:first-child { text-align: left; padding-left: 0; }
.tableau-mois td a { color: var(--encre); text-decoration: none; font-weight: 500; }
.tableau-mois td a:hover { color: var(--vert); }
.tableau-mois td.montant { font-family: var(--mono); color: var(--encre); white-space: nowrap; }
.tableau-mois td.etat { font-size: 12px; }
.tableau-mois .reserve { color: var(--or); font-style: italic; }

@media (max-width: 999px) {
  .seulement-large { display: none; }
}

@media (min-width: 1000px) {
  .seulement-mobile { display: none; }

  .contenu.large { max-width: 1180px; }

  .ecran-mois, .ecran-annee {
    display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 16px 18px; align-items: start;
    /* La zone de contenu remplit la hauteur de la fenêtre : sans cela, la grille
       répartit l'espace en trop entre ses lignes, et les panneaux descendent. */
    align-content: start;
  }
  .ecran-mois > *, .ecran-annee > * { grid-column: 1 / -1; }

  .colonne-principale, .colonne-laterale { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
  .ecran-mois > .colonne-principale { grid-column: 1; }
  .ecran-mois > .colonne-laterale { grid-column: 2; }
  /* À droite, ce qui se fait après avoir déclaré — clore, puis reporter bulletin
     et CMG —, avant les détails et les avis. */
  .colonne-laterale > * { order: 2; }
  .colonne-laterale > .zone-cloture { order: 0; }
  .colonne-laterale > .zone-montants { order: 1; }

  .rubriques-courtes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }

  /* Les mois tiennent toute la hauteur à gauche ; à droite, les impôts puis les congés. */
  .ecran-annee > .zone-annee { grid-column: 1; grid-row: span 2; }
  .ecran-annee > .zone-impots { grid-column: 2; }
  .ecran-annee > .zone-conges { grid-column: 2; }
}

/* ---------- écran large : le contrat ----------
   Trois colonnes fixées à la main : la répartition automatique d'un navigateur
   laissait une colonne presque vide, à cause du long bloc des jours fériés. */
@media (min-width: 1000px) {
  .formulaire-contrat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 18px; align-items: start; }
  .colonne-contrat { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

  /* Un bouton ou une carte de 1 180 px de large se lirait mal. */
  .ecran-contrat > .principal { width: auto; min-width: 320px; align-self: flex-start; padding: 14px 40px; }
  .ecran-contrat > .carte { max-width: 560px; }
}

/* ---------- écran large : la page du foyer ----------
   Deux colonnes : le foyer et ses membres, puis les choix et les données. Sur
   téléphone, les colonnes s'effacent : rien ne bouge. */
@media (max-width: 999px) {
  .colonne-foyer { display: contents; }
}
@media (min-width: 1000px) {
  .ecran-foyer {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px;
    align-items: start; align-content: start;
  }
  .ecran-foyer > * { grid-column: 1 / -1; }
  .ecran-foyer > .colonne-foyer { grid-column: auto; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
  .ecran-foyer > .retour { justify-self: start; }
}

/* ---------- écran large : le fil en grille ----------
   Le mois entier sous les yeux : une ligne par semaine, une colonne par jour
   d'accueil. Chaque case garde tout ce que dit la ligne du téléphone. */
@media (min-width: 1000px) {
  .cadre .contenu { max-width: none; }

  .jours {
    display: grid; grid-template-columns: 96px repeat(var(--colonnes), minmax(0, 1fr));
    column-gap: 8px; align-items: stretch;
  }
  .jours > * { margin-bottom: 8px; }

  .entete-jour {
    font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--gris); font-weight: 600; padding: 0 4px;
  }

  /* La semaine devient l'en-tête de sa ligne : son nom, puis ses heures. */
  .jours .semaine {
    flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px;
    border-top: 0; margin-top: 0; padding: 4px 0;
  }
  .jours .semaine .l { font-size: 11px; letter-spacing: .06em; }

  .jours .jour {
    border: 1px solid var(--trait); border-radius: 11px; background: var(--carte);
    padding: 8px 9px; min-height: 64px;
  }
  .jours .jour:hover { border-color: var(--vert); background: var(--carte); }
  .jours .jour .haut { flex-direction: column; align-items: flex-start; gap: 3px; }
  .jours .jour .texte small { white-space: normal; }
  .jours .jour .detail { text-align: left; }

  /* Un jour d'accueil à venir : en pointillé, sur le papier, sans réaction au survol. */
  .jours .jour.a-venir {
    background: transparent; border-style: dashed; cursor: default; color: var(--gris-pale);
  }
  .jours .jour.a-venir:hover { border-color: var(--trait); }
  .jours .jour.a-venir .texte { color: var(--gris); }

  /* La case d'une journée dont la carte est ouverte juste en dessous. */
  .jours .case-carte { border: 2px solid var(--vert); cursor: default; }
  .jours .case-carte small { color: var(--vert); font-weight: 600; }

  .jours .carte { margin: 0 0 14px; }
}

/* ---------- la colonne de droite du fil, en vert ----------
   Le même habit que le bloc du mois sur téléphone : fond vert, texte clair, total
   souligné. Les couleurs de remplacement valent en clair comme en sombre. */
.cote .synthese {
  background: var(--vert); color: var(--sur-vert); border-radius: 16px;
  padding: 14px 15px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--ombre);
}
.cote .synthese .titre { color: var(--sur-vert); margin-bottom: 2px; }
.cote .synthese .rang { color: rgba(255, 255, 255, .88); font-size: 12.5px; }
.cote .synthese .rang b { color: var(--sur-vert); }
.cote .synthese .rang + .rang { border-top-color: rgba(255, 255, 255, .18); }
.cote .synthese .rang.retrait b { color: var(--sur-vert); }
.cote .synthese .rang.total { border-top: 1px solid rgba(255, 255, 255, .45); }
.cote .synthese .rang.total b { color: var(--sur-vert); font-size: 16px; }
.cote .synthese .aide { color: rgba(255, 255, 255, .8); font-style: italic; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cote .synthese .rang { color: rgba(8, 32, 28, .8); }
  :root:not([data-theme="light"]) .cote .synthese .rang + .rang { border-top-color: rgba(8, 32, 28, .2); }
  :root:not([data-theme="light"]) .cote .synthese .rang.total { border-top-color: rgba(8, 32, 28, .35); }
  :root:not([data-theme="light"]) .cote .synthese .aide { color: rgba(8, 32, 28, .72); }
}
:root[data-theme="dark"] .cote .synthese .rang { color: rgba(8, 32, 28, .8); }
:root[data-theme="dark"] .cote .synthese .rang + .rang { border-top-color: rgba(8, 32, 28, .2); }
:root[data-theme="dark"] .cote .synthese .rang.total { border-top-color: rgba(8, 32, 28, .35); }
:root[data-theme="dark"] .cote .synthese .aide { color: rgba(8, 32, 28, .72); }

/* ---------- l'en-tête sur ordinateur ----------
   Une bande blanche sur toute la largeur de la fenêtre, avec un filet dessous : la
   barre de navigation se détache du contenu, comme dans la maquette. L'en-tête
   reste dans la colonne de 1 180 px de l'app ; les deux ombres étendent son fond
   et son filet jusqu'aux bords, et le découpage les empêche de déborder au-dessus. */
@media (min-width: 1000px) {
  .entete {
    background: var(--carte); border-bottom: 0;
    box-shadow: 0 0 0 100vmax var(--carte), 0 1px 0 100vmax var(--trait);
    clip-path: inset(0 -100vmax -1px);
    position: relative; z-index: 1;
  }
}

/* ---------- le mois clos, dans le fil ----------
   Un cadenas dans le rail, un bandeau en tête du fil, une ligne dans le total du
   mois : un mois déclaré se reconnaît avant qu'on essaie d'y toucher. */
.cadenas {
  width: 12px; height: 12px; vertical-align: -1px; margin-left: 4px;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round;
}
.avis.clos { border-color: var(--vert); background: var(--vert-pale); }
.avis.clos > .cadenas { width: 16px; height: 16px; margin: 2px 0 0; color: var(--vert); flex: 0 0 auto; }
.avis.clos .corps b { color: var(--vert); }
.avis.clos .rappel { color: var(--encre); font-weight: 500; }
.avis.clos .lien { align-self: flex-start; padding: 2px 0; }
.mois .l.clos, .cote .synthese .rang.clos { font-size: 12px; }
.mois .l.clos .cadenas, .cote .synthese .rang.clos .cadenas { margin: 0 4px 0 0; }

/* ---------- l'accueil de Tribulle : une tuile par module ---------- */
.accueil .tete-accueil { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.accueil .salut { font-family: var(--serif); font-size: 23px; font-weight: 700; margin: 4px 2px 0; }
.accueil .personnaliser { flex: 0 0 auto; margin-bottom: 2px; }
.accueil .salut small { display: block; font-family: var(--sans); font-size: 13px; font-weight: 400; color: var(--gris); margin-top: 2px; }

/* Deux colonnes : une vignette normale prend la ligne entière, deux réduites la
   partagent. Sur ordinateur, six colonnes : trois normales, ou six réduites. */
.tuiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.tuiles > .tuile { grid-column: span 2; }
.tuiles > .tuile.reduite { grid-column: span 1; }
.tuile {
  background: var(--carte); border: 1px solid var(--trait); border-radius: 16px; padding: 14px 15px;
  display: flex; flex-direction: column; gap: 7px; box-shadow: var(--ombre);
  text-decoration: none; color: var(--encre);
}
a.tuile:hover { border-color: var(--vert); }
.tuile .t { font-family: var(--serif); font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.tuile .t img { flex: 0 0 auto; border-radius: 9px; }
.tuile .s { font-size: 12.5px; color: var(--gris); margin-top: -3px; }
.tuile .l {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  font-size: 13px; color: var(--gris); border-top: 1px solid var(--trait); padding-top: 7px;
}
.tuile .l small { display: block; font-size: 11px; color: var(--gris-pale); }
.tuile .l b { color: var(--encre); font-weight: 500; text-align: right; }
.tuile .l b.a-faire { color: var(--vert); font-weight: 600; }
.tuile .l b.alerte { color: var(--orange); font-weight: 600; }
.tuile .l b.conges { color: var(--or); font-weight: 600; }
/* La réduite : le module, puis une seule chose, en grand. */
.tuile.reduite { min-height: 118px; gap: 4px; padding: 12px 13px; }
.tuile.reduite .t { font-size: 15.5px; gap: 8px; }
.tuile.reduite .t img { border-radius: 7px; }
.tuile.reduite .valeur {
  margin-top: auto; font-family: var(--serif); font-size: 17px; font-weight: 700; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tuile.reduite .valeur.chiffre { font-family: var(--mono); font-weight: 600; }
.tuile.reduite .valeur.a-faire { color: var(--vert); }
.tuile.reduite .valeur.alerte { color: var(--orange); }
.tuile.reduite .valeur.conges { color: var(--or); }
.tuile.reduite .valeur.rien { color: var(--gris-pale); font-family: var(--sans); font-size: 14px; font-weight: 500; }
.tuile.reduite .quoi { font-size: 12px; color: var(--gris); line-height: 1.35; }
.tuile.reduite .plus {
  align-self: flex-start; font-size: 11.5px; font-weight: 600; color: var(--orange);
  background: var(--orange-pale); border-radius: 99px; padding: 1px 8px;
}

@media (min-width: 1000px) {
  /* Même hauteur par rangée (F-12). */
  .tuiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ---------- personnaliser l'accueil ---------- */
.reglages-vignettes { display: flex; flex-direction: column; }
.reglage-vignette { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--trait); }
.reglage-vignette:first-child { border-top: 0; }
.reglage-vignette img { flex: 0 0 auto; border-radius: 8px; }
.reglage-vignette .nom { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; }
.reglage-vignette.masquee img, .reglage-vignette.masquee .nom { opacity: .6; }
.reglage-vignette .taille { display: flex; flex: 0 0 auto; border: 1px solid var(--trait); border-radius: 99px; overflow: hidden; }
.reglage-vignette .taille > button {
  font: inherit; font-size: 12px; font-weight: 600; padding: 5px 9px; border: 0;
  background: var(--carte); color: var(--gris); cursor: pointer;
}
.reglage-vignette .taille > button.actif { background: var(--vert); color: var(--sur-vert); }
.icone-reglage {
  flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--trait); border-radius: 9px; background: var(--carte); color: var(--encre);
  font: inherit; font-size: 14px; cursor: pointer;
}
.icone-reglage:hover:not(:disabled) { border-color: var(--vert); color: var(--vert); }
.icone-reglage:disabled { color: var(--trait); cursor: default; }
.icone-reglage svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.secondaire.petit { width: auto; flex: 0 0 auto; padding: 6px 13px; font-size: 13px; border-radius: 99px; }

.tuile .l b.rien { color: var(--gris-pale); font-weight: 400; }

/* ---------- les retours des utilisateurs ---------- */
.carte-avis {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-top: 4px;
  border: 1.5px dashed var(--vert); border-radius: 14px; text-decoration: none; color: var(--encre);
}
.carte-avis:hover { background: var(--vert-pale); }
/* Sans compte rendu à lire, la carte ouvre la feuille sur place : un bouton, habillé comme le lien. */
button.carte-avis { width: 100%; background: none; font: inherit; text-align: left; cursor: pointer; }
.carte-avis .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--vert-pale); color: var(--vert); display: grid; place-items: center; flex: 0 0 auto; }
.carte-avis svg, .genre svg, .types-retour svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto;
}
.carte-avis b { display: block; font-size: 14px; }
.carte-avis span span { font-size: 12.5px; color: var(--gris); }

.ligne-lien { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; color: var(--encre); font-size: 13.5px; padding: 2px 0; }
.ligne-lien + .ligne-lien { border-top: 1px solid var(--trait); padding-top: 9px; }
.ligne-lien small { display: block; font-size: 11.5px; color: var(--gris); }
.ligne-lien b { color: var(--vert); font-size: 18px; font-weight: 400; }

.types-retour { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.types-retour button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 9px;
  border: 1px solid var(--trait); border-radius: 12px; background: var(--papier); color: var(--gris);
  font-size: 12.5px; cursor: pointer;
}
.types-retour button.actif { border-color: var(--vert); background: var(--vert-pale); color: var(--vert); font-weight: 600; }
.types-retour svg { width: 20px; height: 20px; }

.carte-retour {
  background: var(--carte); border-radius: 14px; padding: 11px 13px; box-shadow: var(--ombre);
  display: flex; flex-direction: column; gap: 6px; border: 0; text-align: left; width: 100%; font: inherit; color: var(--encre);
}
.carte-retour.cliquable { cursor: pointer; }
.carte-retour.cliquable:hover { outline: 1px solid var(--vert); }
.carte-retour p, .texte-retour { margin: 0; font-size: 14px; white-space: pre-line; }
.carte-retour small { font-size: 11.5px; color: var(--gris-pale); }
.tete-retour { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.genre { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gris); }
.statut-retour { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.statut-retour.envoye { background: var(--papier); color: var(--gris); border: 1px solid var(--trait); }
.statut-retour.lu { background: var(--or-pale); color: var(--or); }
.statut-retour.prevu { background: var(--vert-pale); color: var(--vert); }
.statut-retour.fait { background: var(--vert); color: var(--sur-vert); }
.statut-retour.ecarte { background: var(--papier); color: var(--gris-pale); text-decoration: line-through; }
.reponse-retour { border-left: 2px solid var(--vert); padding: 2px 0 2px 10px; font-size: 13px; color: var(--gris); white-space: pre-line; }
.reponse-retour b { color: var(--vert); font-weight: 600; }
.texte-plein { margin: 0; font-size: 14.5px; white-space: pre-line; }

@media (min-width: 1000px) {
  .ecran-retours { max-width: 760px; }
}
/* ---------- les squelettes de chargement ----------
   La forme de la page en gris clair, à la place de ce qui arrive. Invisible le
   premier quart de seconde : une page qui répond vite ne clignote pas. Puis une
   pulsation lente de l'opacité — une seule propriété animée, presque rien à calculer —
   et aucune animation si le téléphone demande de les réduire. */
.squelette { display: flex; flex-direction: column; gap: 11px; animation: sq-apparait 0s linear .25s both; }
.squelette.en-ligne { gap: 7px; }
@keyframes sq-apparait { from { visibility: hidden; } to { visibility: visible; } }

.sq {
  display: block; background: var(--trait); border-radius: 6px; flex: 0 0 auto;
  animation: sq-pulse 1.6s ease-in-out .25s infinite;
}
@keyframes sq-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .sq { animation: none !important; } }

.sq.t { height: 11px; }
.sq.t.petit { height: 9px; }
.sq.titre { height: 19px; border-radius: 7px; }
.tuile .sq.titre-attendu { width: 9.5em; }
.sq.chiffre { height: 12px; width: 52px; margin-left: auto; }
.sq.bloc { flex: 1; height: 52px; border-radius: 11px; }
.sq.bouton { height: 46px; border-radius: 12px; opacity: .7; }
.sq.case { width: 22px; height: 22px; border-radius: 7px; }

.sq-carte { background: var(--carte); border-radius: 16px; padding: 15px; display: flex; flex-direction: column; gap: 11px; box-shadow: var(--ombre); }
.sq-paire { display: flex; gap: 10px; }
.sq-jour { display: flex; align-items: center; gap: 11px; padding: 11px 4px; border-bottom: 1px solid var(--trait); }
.sq-jour:last-child { border-bottom: 0; }
.sq-pile { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.sq-panneau { gap: 0; }
.sq-panneau > .sq.petit { margin-bottom: 4px; }
.sq-article { display: flex; align-items: center; gap: 11px; padding: 8px 0; }
.sq-l { align-items: center; }
.sq-repas { cursor: default; }
.sq-repas .q { display: flex; }

/* ============================================================
   Le module Menus : la semaine, le carnet de recettes.
   ============================================================ */

.tete-page { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.titre-page { font-family: var(--serif); font-size: 21px; font-weight: 700; line-height: 1.2; }
.tete-page .voisins { gap: 14px; }

/* Un lien qui a l'habit d'un bouton. */
a.bouton-lien { display: block; text-align: center; text-decoration: none; }
a.secondaire.bouton-lien { color: var(--encre); }
a.principal.bouton-lien { color: var(--sur-vert); }
.secondaire.danger { color: var(--orange); border-color: var(--orange); }

.recherche {
  width: 100%; border: 1px solid var(--trait); border-radius: 11px; padding: 10px 12px;
  font: inherit; font-size: 14px; background: var(--carte); color: var(--encre);
}

.puces { display: flex; gap: 6px; flex-wrap: wrap; }

/* Un choix parmi trois, à parts égales : les réglages « Sur cet appareil ». */
.groupe-choix { display: flex; flex-direction: column; gap: 6px; }
.libelle-choix { font-size: 14px; font-weight: 600; }
.segments { display: flex; gap: 6px; }
.segments > button {
  flex: 1; min-width: 0; font: inherit; font-size: 13.5px; padding: 8px 4px; border-radius: 10px;
  border: 1px solid var(--trait); background: var(--carte); color: var(--encre); cursor: pointer;
}
.segments > button.actif { background: var(--vert-pale); border-color: var(--vert); color: var(--vert-fonce); font-weight: 600; }
.puces > button, .puces > span {
  font-size: 12.5px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--trait);
  color: var(--gris); background: var(--carte); cursor: pointer;
}
.puces > span { cursor: default; }
.puces > button:hover:not(:disabled) { border-color: var(--vert); color: var(--vert); }
.puces > button.actif { background: var(--vert-pale); color: var(--vert); border-color: var(--vert-pale); font-weight: 600; }

.liste-recettes { display: flex; flex-direction: column; gap: 0; }
.ligne-recette {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 10px 4px; border: 0; border-bottom: 1px solid var(--trait); background: none;
  font-size: 14px; text-align: left; text-decoration: none; color: var(--encre); cursor: pointer; width: 100%;
}
.ligne-recette:last-child { border-bottom: 0; }
.ligne-recette:hover { background: rgba(15, 118, 110, .05); }
.ligne-recette small { display: block; color: var(--gris); font-size: 11.5px; }
.ligne-recette b { font-weight: 500; font-size: 11.5px; color: var(--gris); white-space: nowrap; }
.ligne-recette.choisie { background: var(--vert-pale); border-radius: 9px; padding-left: 9px; padding-right: 9px; }

.parts { display: flex; align-items: center; gap: 10px; }
.parts button {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--trait);
  background: var(--carte); font-size: 16px; cursor: pointer; display: grid; place-items: center;
}
.parts button:hover:not(:disabled) { border-color: var(--vert); color: var(--vert); }
.parts button:disabled { opacity: .4; cursor: default; }
.parts b { font-family: var(--mono); font-size: 16px; font-weight: 500; min-width: 2ch; text-align: center; }

/* ---------- la semaine ---------- */

.semaine-menus { display: flex; flex-direction: column; gap: 9px; }
.jour-menu {
  background: var(--carte); border: 1px solid var(--trait); border-radius: 13px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 2px;
}
.jour-menu .j { font-size: 12.5px; font-weight: 600; display: flex; justify-content: space-between; }
.jour-menu .j small { color: var(--vert); font-weight: 500; }
/* Les sept jours passent d'une semaine à l'autre : un intertitre discret le dit. */
.sep-semaine {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gris);
  font-weight: 600; text-align: center; padding: 2px 0;
}
.jour-menu.auj { border: 2px solid var(--vert); }
.jour-menu.auj .j { color: var(--vert); }

.repas-menu {
  display: flex; gap: 9px; align-items: baseline; width: 100%; text-align: left;
  padding: 7px 2px; border: 0; background: none; font-size: 14px; cursor: pointer; border-radius: 8px;
}
.repas-menu + .repas-menu { border-top: 1px dotted var(--trait); border-radius: 0; }
.repas-menu:hover:not(:disabled) { background: rgba(15, 118, 110, .05); }
.repas-menu .q {
  width: 36px; flex: 0 0 auto; font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--gris-pale);
}
.repas-menu .p small { color: var(--gris-pale); font-size: 11.5px; margin-left: 5px; }
.repas-menu.vide .p { color: var(--gris-pale); font-style: italic; }
.repas-menu.libre .p { color: var(--gris); }
/* Le repas qu'on déplace, et la case qu'on survole en le faisant glisser. */
.repas-menu { user-select: none; -webkit-user-select: none; }
.repas-menu[aria-disabled="true"] { opacity: .6; cursor: default; }
.repas-menu.source { outline: 2px dashed var(--or); outline-offset: -2px; }
.repas-menu.survol { background: var(--vert-pale); outline: 2px solid var(--vert); outline-offset: -2px; }
.repas-menu[draggable="true"] { cursor: grab; }

.actions-semaine { display: flex; gap: 10px; }

/* La feuille qui monte du bas pour choisir un repas. */
.voile {
  position: fixed; inset: 0; z-index: 30; background: rgba(16, 22, 28, .35);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.feuille {
  background: var(--carte); border-radius: 18px 18px 0 0;
  padding: 12px 16px calc(18px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px; max-height: 88dvh; overflow-y: auto;
  width: 100%; max-width: 560px; margin: 0 auto;
}
.feuille .poignee { width: 38px; height: 4px; border-radius: 2px; background: var(--trait); align-self: center; flex: 0 0 auto; }
.tete-feuille { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tete-feuille .t { font-family: var(--serif); font-size: 18px; font-weight: 700; }
.feuille .section { font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--gris); font-weight: 600; margin-top: 4px; }
.feuille .liste-recettes { max-height: 40dvh; overflow-y: auto; flex: 0 0 auto; }
/* Une feuille ne fait jamais défiler la page derrière elle : arrivé au bout de la
   liste, le doigt s'arrête (retour d'un utilisateur, 6 octobre 2026). La page
   elle-même est figée tant qu'une feuille est ouverte (index.html). */
.voile, .feuille, .feuille .defile, .feuille .liste-recettes { overscroll-behavior: contain; }
html.feuille-ouverte, html.feuille-ouverte body { overflow: hidden; }
/* Choisir un repas : la feuille prend toute la hauteur, l'en-tête, la recherche et
   les étiquettes restent en place, et une seule zone défile — la liste des recettes
   n'est plus une petite fenêtre dans une feuille qui défile aussi. */
.feuille.haute { height: 92dvh; overflow: hidden; }
.feuille.haute .defile { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.feuille.haute .liste-recettes { max-height: none; overflow: visible; }
.panneau.encadre { box-shadow: none; border: 1px solid var(--trait); }

/* ---------- le carnet et la fiche ---------- */

.zone-liste, .zone-fiche { display: flex; flex-direction: column; gap: 11px; min-width: 0; }
/* Sur téléphone, la liste ou la fiche, jamais les deux : la règle générale qui masque
   « seulement-large » est déclarée plus haut, elle perdrait contre le display ci-dessus. */
@media (max-width: 999px) { .zone-liste.seulement-large, .zone-fiche.seulement-large { display: none; } }
a.lien { text-decoration: none; }
.tete-fiche { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.fiche-colonnes { display: flex; flex-direction: column; gap: 14px; }
.colonne-fiche { display: flex; flex-direction: column; gap: 7px; }
.ingredient {
  display: flex; justify-content: space-between; gap: 12px; font-size: 14px;
  padding: 5px 0; border-bottom: 1px dotted var(--trait);
}
.ingredient b { font-family: var(--mono); font-weight: 500; font-size: 13px; white-space: nowrap; }
.etape-recette { display: flex; gap: 10px; font-size: 14px; align-items: flex-start; }
.etape-recette > span { white-space: pre-line; }
.etape-recette i {
  font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: var(--vert-pale);
  color: var(--vert); display: grid; place-items: center; font-size: 11.5px; font-weight: 600; flex: 0 0 auto;
}

/* ---------- écrire une recette ---------- */

.formulaire-recette, .colonne-recette { display: flex; flex-direction: column; gap: 13px; }
.ajout { display: flex; gap: 8px; align-items: center; }
.ajout input, .ligne-ingredient input, .ligne-ingredient select, .etape-recette textarea {
  border: 1px solid var(--trait); border-radius: 9px; padding: 8px 9px; min-width: 0;
  font: inherit; font-size: 14px; background: var(--papier); color: var(--encre);
}
.ajout input { flex: 1; }
.ligne-ingredient { display: grid; grid-template-columns: 64px 70px minmax(0, 1fr) 28px; gap: 6px; align-items: center; }
.ligne-ingredient input[type="number"] { font-family: var(--mono); }
.etape-recette textarea { flex: 1; resize: vertical; line-height: 1.4; }
.moins {
  border: 0; background: none; color: var(--gris-pale); font-size: 18px; cursor: pointer;
  width: 28px; height: 32px; padding: 0; flex: 0 0 auto;
}
.moins:hover { color: var(--orange); }
.lien.a-gauche { align-self: flex-start; }

@media (min-width: 1000px) {
  /* La semaine en grille : une colonne par jour, le midi puis le soir. Les cartes de
     jour s'effacent, leurs cases se placent dans la grille. */
  .semaine-menus { display: grid; grid-template-columns: 54px repeat(7, minmax(0, 1fr)); gap: 8px; }
  .jour-menu { display: contents; }
  .jour-menu .j {
    font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--gris);
    padding: 0 4px; flex-direction: column;
  }
  .jour-menu .j small { text-transform: none; letter-spacing: 0; }
  .q-ligne {
    grid-column: 1; align-self: center; font-size: 11px; text-transform: uppercase;
    letter-spacing: .08em; color: var(--gris-pale);
  }
  .repas-menu {
    flex-direction: column; gap: 2px; min-height: 66px; padding: 8px 9px;
    background: var(--carte); border: 1px solid var(--trait); border-radius: 11px; font-size: 13px;
  }
  .repas-menu + .repas-menu { border-top: 1px solid var(--trait); border-radius: 11px; }
  .repas-menu:hover:not(:disabled) { border-color: var(--vert); background: var(--carte); }
  .repas-menu .q { display: none; }
  .repas-menu .p small { display: block; margin-left: 0; }
  .repas-menu.vide { background: transparent; border-style: dashed; }
  .jour-menu.auj .repas-menu { border: 2px solid var(--vert); }
  .actions-semaine > .secondaire { width: auto; padding: 11px 22px; }

  /* Sur ordinateur, la feuille devient une fenêtre au milieu de l'écran. */
  .voile { justify-content: center; align-items: center; }
  .feuille { border-radius: 18px; max-width: 520px; max-height: 80dvh; padding-bottom: 18px; }
  .feuille.haute { height: 80dvh; }
  .feuille .poignee { display: none; }

  .ecran-recettes { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px; align-items: start; align-content: start; }
  .zone-fiche .principal.bouton-lien { width: auto; align-self: flex-start; padding: 12px 26px; }
  .fiche-colonnes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 22px; }

  .formulaire-recette { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
  .colonne-recette > .principal { width: auto; align-self: flex-start; padding: 13px 40px; }
}

/* ---------- la liste de courses ----------
   Ce qui reste à prendre, par rayon ; ce qui est pris descend dans le panier, replié
   en bas. La liste raccourcit au fil des courses au lieu de se remplir de coches. */

.champ select {
  font: inherit; font-size: 15px; background: transparent; border: 0; color: var(--encre);
  width: 100%; padding: 0;
}

.avancement { height: 6px; border-radius: 3px; background: var(--trait); overflow: hidden; }
.avancement span { display: block; height: 100%; background: var(--vert); border-radius: 3px; transition: width .2s; }

.tete-page .aide .lien { margin-left: 10px; font-size: 12.5px; }
.ajout-article { display: flex; gap: 8px; }
.ajout-article .plus {
  flex: 0 0 auto; width: 44px; border-radius: 11px; border: 0; background: var(--vert);
  color: var(--sur-vert); font-size: 22px; cursor: pointer;
}
.ajout-article .plus:disabled { opacity: .4; cursor: default; }

.rayons { display: flex; flex-direction: column; gap: 11px; }
.rayon { gap: 2px; }
.nom-rayon {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--vert);
  font-weight: 600; margin-bottom: 2px;
}
.rayon.a-ranger { border: 1.5px dashed var(--or-trait); box-shadow: none; }
.rayon.a-ranger .nom-rayon { color: var(--or); }
.rayon.a-ranger > .aide { font-size: 11.5px; margin: -2px 0 4px; }
/* Ranger d'un geste : le rayon se choisit sur la ligne, sans ouvrir l'article. */
/* L'éditeur des rayons : un nom, puis monter, descendre, supprimer. */
.lignes-rayons { display: flex; flex-direction: column; gap: 6px; max-height: 46dvh; overflow-y: auto; flex: 0 0 auto; }
.ligne-rayon { display: flex; align-items: center; gap: 2px; }
.champ-rayon {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--trait); border-radius: 9px; background: var(--papier); padding: 0 9px;
}
.champ-rayon input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--encre); padding: 8px 0; }
.champ-rayon small { flex: 0 0 auto; font-size: 11px; color: var(--gris); }
.ligne-rayon .moins:disabled { opacity: .3; cursor: default; }

.choix-rayon {
  flex: 0 0 auto; max-width: 128px; font: inherit; font-size: 12.5px; color: var(--or);
  background: var(--or-pale); border: 1px solid var(--or-trait); border-radius: 9px; padding: 6px 6px;
}

.article {
  display: flex; align-items: center; gap: 11px; padding: 6px 0;
  border: 0; border-bottom: 1px solid var(--trait); background: none; width: 100%; text-align: left;
}
.article:last-child { border-bottom: 0; }
.article .coche {
  width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--gris-pale);
  background: var(--carte); flex: 0 0 auto; cursor: pointer; padding: 0; display: grid; place-items: center;
}
.article .coche:hover { border-color: var(--vert); }
.article .coche[aria-checked="true"], .article .coche.cochee { background: var(--vert); border-color: var(--vert); }
.article .coche[aria-checked="true"]::after, .article .coche.cochee::after {
  content: ""; width: 10px; height: 5px;
  border-left: 2px solid var(--sur-vert); border-bottom: 2px solid var(--sur-vert);
  transform: rotate(-45deg) translate(1px, -1px);
}
.corps-article {
  flex: 1; min-width: 0; display: flex; flex-direction: column; background: none; border: 0;
  padding: 4px 0; text-align: left; cursor: pointer; font-size: 14.5px;
}
.corps-article .n { color: var(--encre); }
.corps-article .o { font-size: 11.5px; color: var(--gris); display: inline-flex; align-items: center; gap: 4px; }
.icone-recette { width: 12px; height: 12px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.2; }
.article .qte { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.article.achete .n, .article.achete .qte { color: var(--gris-pale); text-decoration: line-through; }
.article.achete .corps-article { cursor: default; }

.panier {
  border: 1px solid var(--trait); border-radius: 16px; padding: 10px 14px;
  display: flex; flex-direction: column; gap: 6px; background: transparent;
}
.panier-tete { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panier-tete .deplier {
  background: none; border: 0; padding: 6px 0; font-size: 14px; font-weight: 600;
  color: var(--vert); cursor: pointer; text-align: left;
}
.panier-tete .secondaire { width: auto; padding: 8px 14px; font-size: 13px; }
.contenu-panier { display: flex; flex-direction: column; gap: 6px; }
/* Sur téléphone, le panier replié ne montre que son en-tête, et les deux colonnes de
   l'ordinateur s'effacent : l'ordre de toujours. */
@media (max-width: 999px) {
  .panier:not(.ouvert) .contenu-panier { display: none; }
  .colonne-courses, .colonne-panier { display: contents; }
}

.liste-propositions { display: flex; flex-direction: column; max-height: 50dvh; overflow-y: auto; flex: 0 0 auto; }
.liste-propositions .article { cursor: pointer; }

.actions-semaine { flex-direction: column; }

@media (min-width: 1000px) {
  /* Deux colonnes : ce qu'il reste à prendre, puis le panier, toujours déplié. Le
     bandeau du haut et la barre d'avancement les surmontent toutes les deux. */
  .ecran-courses {
    display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 16px 18px; align-items: start; align-content: start;
  }
  .ecran-courses > * { grid-column: 1 / -1; }
  .ecran-courses > .colonne-courses { grid-column: 1; }
  .ecran-courses > .colonne-courses:last-child { grid-column: 1 / -1; }
  .ecran-courses > .colonne-panier { grid-column: 2; position: sticky; top: 16px; }
  .colonne-courses, .colonne-panier { display: flex; flex-direction: column; gap: 13px; min-width: 0; }
  .rayons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; align-items: start; }
  /* Un seul rayon prend toute la colonne, plutôt qu'une demi-carte à côté du vide. */
  .rayons:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
  .colonne-panier .panier { background: var(--carte); border: 0; box-shadow: var(--ombre); }

  .actions-semaine { flex-direction: row; }
  .actions-semaine > .principal { width: auto; padding: 11px 22px; }
}

/* ---------- le module Cadeaux ----------
   Les listes du foyer, une liste vue du foyer, et la page partagée sans compte
   (/offrir/…), qui reprend les mêmes lignes d'idées. */
.listes-cadeaux { display: flex; flex-direction: column; gap: 11px; }
.carte-liste-cadeaux {
  background: var(--carte); border-radius: 16px; box-shadow: var(--ombre); padding: 13px 15px;
  display: flex; flex-direction: column; gap: 3px; color: inherit; text-decoration: none;
}
.carte-liste-cadeaux:hover { outline: 1.5px solid var(--vert); }
.carte-liste-cadeaux .nom { font-family: var(--serif); font-size: 18px; font-weight: 700; }
.carte-liste-cadeaux .l { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--gris); }
.carte-liste-cadeaux .l b { color: var(--encre); font-weight: 600; }
.jauge { display: block; height: 5px; border-radius: 3px; background: var(--trait); overflow: hidden; margin-top: 5px; }
.jauge span { display: block; height: 100%; background: var(--vert); border-radius: 3px; }
.listes-passees summary { cursor: pointer; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--gris); font-weight: 600; padding: 4px 0 10px; }
.listes-passees .aide { margin-top: 8px; }

.sous-titre { margin: -8px 0 0; }
.partage-cadeaux {
  border: 1.5px dashed var(--vert); border-radius: 16px; background: var(--carte);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 9px;
}
.partage-cadeaux .section { color: var(--vert); }
.partage-cadeaux .url {
  font-family: var(--mono); font-size: 12px; color: var(--gris); background: var(--papier);
  border-radius: 8px; padding: 7px 9px; overflow-wrap: anywhere;
}
.partage-cadeaux .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.partage-cadeaux .actions > button { flex: 1; width: auto; min-width: 0; padding: 9px 10px; font-size: 13.5px; }
.colonne-lien, .colonne-idees { display: flex; flex-direction: column; gap: 13px; min-width: 0; }

.idees-cadeaux { gap: 0; padding-top: 4px; padding-bottom: 4px; }
.idee-cadeau {
  display: flex; align-items: center; gap: 12px; padding: 10px 0; width: 100%;
  border: 0; border-top: 1px solid var(--trait); background: none; text-align: left; font: inherit; color: inherit;
}
.idees-cadeaux > .idee-cadeau:first-child { border-top: 0; }
button.idee-cadeau { cursor: pointer; }
.idee-cadeau .corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1.3; }
.idee-cadeau .n { font-size: 15px; font-weight: 600; }
.idee-cadeau small { font-size: 12px; color: var(--gris); }
.idee-cadeau small.coup-de-coeur { color: var(--or); font-weight: 600; }
.idee-cadeau .lien-magasin { font-size: 12.5px; color: var(--vert); font-weight: 600; text-decoration: none; }
.idee-cadeau .corps .lien { align-self: flex-start; padding: 0; font-size: 12.5px; }
.idee-cadeau.prise .n, .carte-offrir.prise .n { color: var(--gris); }
.carte-offrir.mienne { outline: 2px solid var(--vert); outline-offset: -2px; }
.etat-cadeau {
  flex: 0 0 auto; font-size: 12px; font-weight: 600; border-radius: 99px; padding: 3px 10px;
  max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.etat-cadeau.libre { color: var(--gris); border: 1px solid var(--trait); }
.etat-cadeau.pris { color: var(--vert-fonce); background: var(--vert-pale); }

.principal.petit { width: auto; flex: 0 0 auto; padding: 7px 13px; font-size: 13px; border-radius: 99px; }

.offrir .tete-offrir { text-align: center; display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.offrir .marque-liste { font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--gris); font-weight: 600; }
.offrir .tete-offrir .aide { margin: 0; }

/* Sur ordinateur : les idées à gauche, le lien et l'avancement à droite. */
@media (min-width: 1000px) {
  .ecran-liste-cadeaux {
    display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 16px 18px; align-items: start; align-content: start;
    /* Le lien vient avant les idées dans la page (il passe en tête sur téléphone) :
       « dense » remonte les idées à sa hauteur, dans la colonne de gauche. */
    grid-auto-flow: row dense;
  }
  .ecran-liste-cadeaux > * { grid-column: 1 / -1; }
  .ecran-liste-cadeaux > .colonne-idees { grid-column: 1; grid-row: span 2; }
  .ecran-liste-cadeaux > .colonne-lien { grid-column: 2; position: sticky; top: 16px; }
  .listes-cadeaux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; align-items: start; }
  .colonne-idees > .principal { width: auto; align-self: flex-start; padding: 11px 22px; }
}

/* ---------- les photos des cadeaux ----------
   Des copies réduites, servies par l'API : jamais une image chargée depuis le site
   d'un magasin. */
.vignette-cadeau { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; background: var(--papier); }
.vignette-cadeau.vide { border: 1.5px dashed var(--trait); background: none; }
.bloc-photo { display: flex; gap: 12px; align-items: center; }
.photo-cadeau {
  width: 96px; height: 96px; border-radius: 12px; flex: 0 0 auto; position: relative; overflow: hidden;
  background: var(--papier); display: grid; place-items: center;
}
.photo-cadeau img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-cadeau.vide { border: 1.5px dashed var(--trait); background: none; color: var(--gris-pale); font-size: 24px; }
/* La même pulsation que les squelettes, et comme eux immobile si le téléphone le demande. */
.photo-cadeau.attente { background: var(--trait); animation: sq-pulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .photo-cadeau.attente { animation: none; } }
.photo-cadeau .source {
  position: absolute; left: 5px; bottom: 5px; font-size: 11px; font-weight: 600; line-height: 1.3;
  background: rgba(16, 22, 28, .62); color: #FFFFFF; border-radius: 6px; padding: 1px 6px;
}
.actions-photo { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; align-items: flex-start; }
.prises { display: flex; flex-direction: column; }
/* Une explication repliée : « Comment c'est compté ? » ouvre le détail (F-17). */
details.comment > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--vert); padding: 4px 0; }
details.comment > .aide { margin-top: 6px; }
.prises .lien { padding: 0; font-size: 13px; }
.actions-prise { display: flex; gap: 10px; align-items: center; }
.actions-prise .secondaire { width: auto; padding: 6px 12px; font-size: 13px; }
.actions-photo .aide { margin: 0; }
.actions-photo .lien { padding: 0; font-size: 13px; }
/* Le champ de fichier se cache derrière son bouton : le libellé fait le geste. */
.bouton-fichier { position: relative; width: auto; padding: 8px 14px; font-size: 13.5px; cursor: pointer; text-align: center; }
.bouton-fichier input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.bouton-fichier:focus-within { outline: 2px solid var(--vert); outline-offset: 2px; }

.cartes-offrir { display: flex; flex-direction: column; gap: 12px; }
.carte-offrir {
  background: var(--carte); border-radius: 16px; box-shadow: var(--ombre); padding: 10px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.carte-offrir .idee-cadeau { border-top: 0; padding: 4px 0; }
.photo-offrir { border: 0; padding: 0; background: var(--papier); border-radius: 12px; overflow: hidden; cursor: zoom-in; display: block; width: 100%; }
/* L'objet en entier, jamais rogné : une photo de produit en hauteur perdrait le cadeau lui-même. */
.photo-offrir img { width: 100%; height: 200px; object-fit: contain; display: block; }
.feuille-photo img { width: 100%; height: auto; max-height: 70dvh; object-fit: contain; border-radius: 12px; background: var(--papier); }

@media (min-width: 1000px) {
  .offrir { max-width: 1040px; }
  .cartes-offrir { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
}
