/* Démo One Two Trees : le langage du plan d'atelier.
   Titres et chiffres en DIN (la lettre des plans techniques), texte en police système.
   Vert sapin pour la marque et les gestes, chêne pour ce qui demande l'attention,
   et les couleurs du devis d'OTT (jaune, vert, bleu, slasheur) partout où il y a des heures. */

:root {
  --fond: #eceee9;
  --carte: #fff;
  --encre: #17221c;
  --ardoise: #56615a;
  --filet: #dde1da;
  --filet-fort: #c4cbc2;
  --sapin: #1d382b;
  --sapin-2: #2c5240;
  --sapin-clair: #e1eae3;
  --chene: #b07a34;
  --chene-texte: #85581d;
  --chene-pale: #f6eddf;
  --rouge: #b3261e;
  --rouge-pale: #fbe9e7;
  --jaune: #eab70c; --jaune-fond: #fcf1cc;
  --vert: #5ea83a; --vert-fond: #e5f2da;
  --bleu: #1e8fcb; --bleu-fond: #dbeef8;
  --slasheur: #8166c0; --slasheur-fond: #ece6f7;
  --aucun: #aeb5ad; --aucun-fond: #e9ece7;
  --rayon: 10px;
  --din: "DIN Alternate", "Bahnschrift", "DIN 2014", "DIN Next LT Pro", "Roboto Condensed", system-ui, sans-serif;
  --texte: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-family: var(--texte);
  font-size: 15px;
  line-height: 1.5;
  color: var(--encre);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--sapin-2); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--chene-texte); }
h1 { font-family: var(--din); font-weight: 700; font-size: 2.1rem; line-height: 1.1; margin: 0 0 .45rem; letter-spacing: 0; }
h2 { font-size: 1.02rem; font-weight: 650; margin: 0 0 .7rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
h3 { font-size: .92rem; margin: 1rem 0 .4rem; }
p { margin: 0 0 .7rem; }
code { font-size: .9em; background: var(--aucun-fond); padding: 1px 5px; border-radius: 4px; }
small { font-size: .8rem; }
b, strong { font-weight: 650; }
:focus-visible { outline: 2px solid var(--chene); outline-offset: 2px; }
::selection { background: var(--sapin-clair); }

.discret { color: var(--ardoise); }
.chapeau { font-size: 1.05rem; max-width: 72ch; }
.numero { font-family: var(--din); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ardoise); letter-spacing: .01em; }
.chiffre, .nombre { font-variant-numeric: tabular-nums; }
.din { font-family: var(--din); font-weight: 700; font-variant-numeric: tabular-nums; }

/* --- Cadre --- */
.cadre { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.menu {
  background: var(--sapin); color: #d6e3d9; padding: 20px 12px 14px; display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.menu a { color: inherit; text-decoration: none; }
.marque { display: flex; gap: 11px; align-items: center; padding: 2px 8px; }
.marque svg { width: 40px; height: 32px; fill: #bcd6c3; flex: none; }
.marque strong { display: block; font-family: var(--din); font-size: 1.12rem; line-height: 1.1; color: #fff; }
.marque small, .moi small { display: block; color: #9fbca8; font-size: .76rem; }
.menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.menu li a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 7px; font-size: .94rem; }
.menu li a svg { width: 19px; height: 19px; flex: none; opacity: .75; }
.menu li a:hover { background: rgb(255 255 255 / .07); color: #fff; }
.menu li a[aria-current] { background: rgb(255 255 255 / .12); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--chene); }
.menu li a[aria-current] svg { opacity: 1; }
.points-lien { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; border: 1px dashed rgb(255 255 255 / .28); font-size: .9rem; line-height: 1.3; }
.points-lien[aria-current], .points-lien:hover { background: rgb(255 255 255 / .07); color: #fff; }
.compte { background: var(--chene); color: #fff; border-radius: 99px; min-width: 24px; text-align: center; font-family: var(--din); font-weight: 700; font-size: .85rem; padding: 2px 7px; }
.moi { margin-top: auto; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 12px 8px 0; border-top: 1px solid rgb(255 255 255 / .12); }
.moi form { grid-column: 2; }
.moi .lien { color: #bcd6c3; font-size: .82rem; padding: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #bcd6c3; color: var(--sapin); display: grid; place-items: center; font-family: var(--din); font-weight: 700; grid-row: span 2; }

main { padding: 14px 36px 64px; max-width: 1480px; min-width: 0; }
.bandeau { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--ardoise); margin-bottom: 22px; }
.bandeau::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--chene); flex: none; }
.message { background: var(--sapin-clair); border-left: 4px solid var(--sapin); padding: 10px 14px; border-radius: 8px; animation: arrivee .35s ease-out; }
.erreur { background: var(--rouge-pale); color: var(--rouge); padding: 10px 14px; border-radius: 8px; }
.fil { font-size: .88rem; margin-bottom: .35rem; color: var(--ardoise); }
.fil a { color: var(--ardoise); }
@keyframes arrivee { from { opacity: 0; transform: translateY(-4px); } }

.entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.entete h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.entete h1 .numero { font-size: .62em; padding: 3px 8px; border: 1.5px solid var(--filet-fort); border-radius: 6px; color: var(--ardoise); }
.panneau .entete { margin-bottom: 8px; }
.panneau .entete h2 { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }

.panneau { background: var(--carte); border: 1px solid var(--filet); border-radius: var(--rayon); padding: 18px 22px; margin-bottom: 18px; }
.panneau.ouvert { background: transparent; border-style: dashed; border-color: var(--filet-fort); }
.panneau.alerte { border-color: #e6b8b4; background: #fff8f7; }
.grille-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; align-items: start; }
.grille-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 18px; }
.grille-version { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.grille-version > .panneau:last-child { position: sticky; top: 14px; }
.infos { background: var(--carte); border: 1px solid var(--filet); border-radius: var(--rayon); padding: 14px 20px; margin-bottom: 18px; }
.infos .discret { display: block; font-size: .8rem; }

.liste { list-style: none; padding: 0; margin: 0 0 .7rem; }
.liste li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--filet); }
.liste li:last-child { border-bottom: 0; }
.liste li .chiffre { margin-left: auto; }
.puces { margin: 0 0 .7rem; padding-left: 1.2rem; }
.puces li { margin-bottom: .3rem; }

/* --- Formulaires --- */
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=hidden]):not([type=radio]), select, textarea {
  border: 1px solid var(--filet-fort); border-radius: 7px; padding: 7px 10px; background: #fff; min-width: 0; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:not([type=checkbox]):focus, select:focus, textarea:focus { outline: none; border-color: var(--sapin-2); box-shadow: 0 0 0 3px rgb(44 82 64 / .15); }
input:disabled, select:disabled, textarea:disabled { background: #f4f5f2; color: var(--ardoise); border-style: dashed; }
input[type=checkbox] { accent-color: var(--sapin); width: 16px; height: 16px; }
fieldset { border: 0; padding: 0; margin: 0; display: contents; }
.formulaire { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 16px; align-items: end; }
.formulaire.serre { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.formulaire label, .pile label, label.bloc { display: flex; flex-direction: column; gap: 5px; font-size: .84rem; color: var(--ardoise); }
.formulaire .large { grid-column: 1 / -1; }
.pile { display: grid; gap: 14px; }
label.bloc { margin-top: 12px; }
.ligne-saisie { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; }
.ligne-saisie label { display: flex; flex-direction: column; gap: 5px; font-size: .84rem; color: var(--ardoise); }
.ligne-saisie input:not([type=hidden]), .ligne-saisie select { width: auto; }
.filtres { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filtres input[type=search] { max-width: 340px; }
.filtres select { width: auto; }
.case { display: inline-flex; gap: 8px; align-items: center; }
label.case { margin-top: 10px; color: var(--encre); font-size: .95rem; }
input.court { width: 5.5em !important; text-align: right; font-variant-numeric: tabular-nums; }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 15px;
  border: 1px solid var(--filet-fort); border-radius: 8px; background: #fff; color: var(--encre); text-decoration: none; cursor: pointer; white-space: nowrap;
  font-weight: 550; transition: background .15s, border-color .15s, color .15s;
}
.bouton:hover { border-color: var(--sapin-2); color: var(--sapin); }
.bouton.principal { background: var(--sapin); border-color: var(--sapin); color: #fff; }
.bouton.principal:hover { background: var(--sapin-2); border-color: var(--sapin-2); color: #fff; }
.bouton.danger, .lien.danger { color: var(--rouge); border-color: #e6b8b4; }
.bouton:active { transform: translateY(1px); }
.lien { background: none; border: 0; padding: 4px 0; color: var(--sapin-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.boutons { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
details.ajout { position: relative; }
details.ajout > summary { list-style: none; }
details.ajout > summary::-webkit-details-marker { display: none; }
details.ajout[open] > form { position: absolute; right: 0; top: 46px; z-index: 5; width: min(760px, 90vw); box-shadow: 0 18px 50px rgb(23 34 28 / .2); animation: arrivee .2s ease-out; }
details.repli > summary { cursor: pointer; color: var(--sapin-2); font-weight: 600; }
details.repli[open] > summary { margin-bottom: 12px; }

/* --- Tableaux --- */
.tableau-defile { overflow-x: auto; }
main > .tableau-defile:not(.planning-defile) { background: var(--carte); border: 1px solid var(--filet); border-radius: var(--rayon); padding: 4px 6px; margin-bottom: 18px; }
.tableau { width: 100%; border-collapse: collapse; }
.tableau th { text-align: left; font-size: .76rem; font-weight: 600; color: var(--ardoise); padding: 7px 10px; border-bottom: 1.5px solid var(--filet-fort); vertical-align: bottom; }
.tableau td { padding: 9px 10px; border-bottom: 1px solid var(--filet); vertical-align: top; }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau .nombre { text-align: right; white-space: nowrap; }
.tableau td.numero, .tableau td.date { white-space: nowrap; }
.tableau tr.total td { font-weight: 700; border-top: 1.5px solid var(--filet-fort); }
.tableau.compact td { padding: 6px 8px; }
.tableau.saisie td { padding: 4px 6px; vertical-align: middle; }
.tableau.saisie select { min-width: 210px; }
.tableau.liste-projets tbody tr { cursor: pointer; transition: background .12s; }
.tableau.liste-projets tbody tr:hover td { background: #f6f8f4; }
.tableau.liste-projets td { vertical-align: middle; }
.tableau.liste-projets td:not(:nth-child(2)) { white-space: nowrap; }
.tableau.liste-projets td:first-child { padding-left: 16px; }
.tableau.liste-projets td:last-child { padding-right: 16px; }
.tableau.liste-projets .nombre { font-family: var(--din); font-weight: 700; font-size: 1rem; }
.tableau.liste-projets a strong { color: var(--encre); }
.tableau.liste-projets tr:hover a strong { color: var(--sapin-2); }
.grille-temps th.activite { min-width: 74px; font-size: .72rem; line-height: 1.3; text-align: center; }
.grille-temps select.projet { min-width: 220px; }
.grille-temps input.court { width: 4.6em !important; }
.grille-temps td:last-child input { min-width: 140px; }
.tableau.saisie select { width: auto; max-width: 100%; }
.tableau.saisie td > select + .groupe { margin-left: 6px; }
.depasse { color: var(--rouge); }
td.plus, .plus { color: var(--chene-texte); font-weight: 600; }
.moins { color: var(--ardoise); }
tr.detail > td { padding-top: 0; border-bottom: 1px solid var(--filet-fort); }
tr.detail summary { cursor: pointer; font-size: .85rem; color: var(--sapin-2); }

/* --- Pastilles --- */
.statut, .version, .etiquette, .groupe {
  display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; padding: 2px 10px; border-radius: 99px; white-space: nowrap; vertical-align: middle; line-height: 1.5;
}
.statut::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.statut-en_attente, .version-envoyee { background: var(--chene-pale); color: var(--chene-texte); }
.statut-valide, .version-acceptee { background: var(--sapin-clair); color: var(--sapin-2); }
.statut-termine { background: var(--sapin); color: #fff; }
.statut-perdu, .version-remplacee { background: var(--aucun-fond); color: var(--ardoise); }
.statut-refuse { background: var(--rouge-pale); color: var(--rouge); }
.version-brouillon { background: #fff; color: var(--ardoise); border: 1px dashed var(--filet-fort); }
.etiquette { background: var(--aucun-fond); color: var(--ardoise); font-weight: 500; }
.groupe { font-size: .72rem; padding: 0 8px 0 6px; gap: 5px; }
.groupe::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--aucun); }
.groupe-jaune, .groupe-fond-jaune { background: var(--jaune-fond); color: #765800; }
.groupe-vert, .groupe-fond-vert { background: var(--vert-fond); color: #30601a; }
.groupe-bleu, .groupe-fond-bleu { background: var(--bleu-fond); color: #0b5a82; }
.groupe-slasheur, .groupe-fond-slasheur { background: var(--slasheur-fond); color: #51408a; }
.groupe-aucun, .groupe-fond-aucun { background: var(--aucun-fond); color: var(--ardoise); }
.groupe-jaune::before { background: var(--jaune); }
.groupe-vert::before { background: var(--vert); }
.groupe-bleu::before { background: var(--bleu); }
.groupe-slasheur::before { background: var(--slasheur); }

.a-confirmer {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--texte); font-size: .72rem; font-weight: 600; color: var(--chene-texte); letter-spacing: 0;
  border: 1px dashed var(--chene); border-radius: 99px; padding: 0 9px 0 4px; text-decoration: none; white-space: nowrap; vertical-align: middle; line-height: 1.7;
}
.a-confirmer::before { content: "?"; display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--chene); color: #fff; font-size: .62rem; }
.a-confirmer:hover { background: var(--chene-pale); color: var(--chene-texte); }

.jauge { display: inline-block; width: 140px; height: 8px; border-radius: 99px; background: var(--filet); overflow: hidden; vertical-align: middle; }
.jauge > span { display: block; height: 100%; background: var(--sapin); border-radius: 99px; }
.jauge.groupe-fond-jaune > span { background: var(--jaune); }
.jauge.groupe-fond-vert > span { background: var(--vert); }
.jauge.groupe-fond-bleu > span { background: var(--bleu); }
.jauge.groupe-fond-slasheur > span { background: var(--slasheur); }
.jauge.groupe-fond-aucun > span { background: var(--aucun); }
.jauge.depasse { outline: 2px solid #e6b8b4; }

/* --- La règle : heures saisies sur heures au devis, graduée comme un mètre d'atelier --- */
.regle {
  position: relative; height: 16px; border-radius: 3px; background-color: #f1f3ef;
  background-image: repeating-linear-gradient(90deg, var(--filet-fort) 0 1px, transparent 1px var(--pas, 10%));
  background-size: 100% 6px; background-repeat: no-repeat; background-position: 0 100%;
  box-shadow: inset 0 0 0 1px var(--filet);
}
.regle-reel { position: absolute; inset: 0; display: flex; border-radius: 3px; overflow: hidden; }
.regle-reel span { height: 100%; }
.regle-reel span + span { box-shadow: inset 1px 0 0 rgb(255 255 255 / .7); }
.regle-reel .g-jaune { background: var(--jaune); }
.regle-reel .g-vert { background: var(--vert); }
.regle-reel .g-bleu { background: var(--bleu); }
.regle-reel .g-slasheur { background: var(--slasheur); }
.regle-reel .g-aucun { background: var(--aucun); }
.regle-cote { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--encre); }
.regle-cote::before, .regle-cote::after { content: ""; position: absolute; left: -3px; width: 8px; height: 2px; background: var(--encre); }
.regle-cote::before { top: 0; }
.regle-cote::after { bottom: 0; }
.regle-depasse { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgb(179 38 30 / .55) 0 3px, rgb(255 255 255 / .35) 3px 6px); border-radius: 0 3px 3px 0; }
.regle.fine { height: 10px; }
.regle.fine .regle-cote { top: -4px; bottom: -4px; }
.mesure { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 6px; font-size: .84rem; color: var(--ardoise); }
.mesure .din { color: var(--encre); font-size: 1rem; }
.mesure .depasse .din, .mesure .din.depasse { color: var(--rouge); }

/* --- Accueil --- */
.accueil-tete { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 24px; align-items: end; margin-bottom: 26px; }
.accueil-tete h1 { font-size: 2.6rem; margin: 0; }
.accueil-tete .date-jour { margin: 0; color: var(--ardoise); text-align: right; font-size: .9rem; }
.resume { margin: 0 0 1rem; font-size: 1.2rem; line-height: 1.5; max-width: 64ch; color: var(--ardoise); }
.accueil-tete .resume { grid-column: 1 / -1; font-size: 1.32rem; line-height: 1.5; max-width: 60ch; margin: 10px 0 0; color: var(--ardoise); }
.resume b { font-family: var(--din); font-weight: 700; color: var(--sapin); font-size: 1.12em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.resume a { color: inherit; text-decoration: none; }
.resume a:hover b { color: var(--chene-texte); }
.tableau-bord { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.chantiers { list-style: none; margin: 0; padding: 0; }
.chantiers li { padding: 14px 0 16px; border-bottom: 1px solid var(--filet); }
.chantiers li:first-child { padding-top: 4px; }
.chantiers li:last-child { border-bottom: 0; padding-bottom: 4px; }
.chantier-tete { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.chantier-tete a { text-decoration: none; color: var(--encre); font-weight: 650; }
.chantier-tete a:hover { color: var(--sapin-2); }
.chantier-tete .numero { font-size: .9rem; }
.chantier-tete .quand { margin-left: auto; font-size: .84rem; color: var(--ardoise); }
.chantier-tete .encours { color: var(--sapin-2); font-weight: 600; }
.legende-groupes { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--ardoise); margin: 0; }
.legende-groupes span { display: inline-flex; align-items: center; gap: 6px; }
.legende-groupes i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.legende-groupes .cote-cle { width: 2px; height: 12px; background: var(--encre); border-radius: 0; }
.taches { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.taches a { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; align-items: center; padding: 11px 14px; border-radius: 8px; border: 1px solid var(--filet); text-decoration: none; color: var(--encre); transition: border-color .15s, background .15s; }
.taches a:hover { border-color: var(--sapin-2); background: #f7f9f6; color: var(--encre); }
.taches .din { font-size: 1.6rem; line-height: 1; min-width: 1.4ch; text-align: center; color: var(--sapin); grid-row: span 2; }
.taches .attention .din { color: var(--chene-texte); }
.taches small { color: var(--ardoise); font-size: .8rem; }
.taches .ok .din { color: var(--vert); }
.attente li { gap: 2px 12px; }
.attente li > a { font-weight: 600; text-decoration: none; color: var(--encre); }
.attente li > a:hover { color: var(--sapin-2); }
.attente .age { flex-basis: 100%; font-size: .8rem; color: var(--ardoise); }
.attente .age.vieux { color: var(--chene-texte); }
.attente .chiffre { font-family: var(--din); font-weight: 700; }
.semaine-atelier { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.semaine-atelier li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--filet); }
.semaine-atelier li:last-child { border-bottom: 0; }
.semaine-atelier a { text-decoration: none; color: var(--encre); font-weight: 600; }
.semaine-atelier a:hover { color: var(--sapin-2); }
.semaine-atelier .qui { grid-column: 2; font-size: .82rem; color: var(--ardoise); }
.semaine-atelier .din { grid-row: span 2; text-align: right; font-size: 1.15rem; }
.semaine-atelier .din small { display: block; font-family: var(--texte); font-weight: 400; font-size: .72rem; color: var(--ardoise); }
.visite { counter-reset: etape; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 22px; }
.visite li { counter-increment: etape; display: grid; grid-template-columns: 28px 1fr; gap: 0 8px; font-size: .9rem; }
.visite li::before { content: counter(etape); font-family: var(--din); font-weight: 700; color: var(--chene-texte); font-size: 1.15rem; line-height: 1.3; }
.visite a { font-weight: 600; }

/* --- Projet : le cartouche, comme sur un plan --- */
.cartouche { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--encre); gap: 1px; border: 1.5px solid var(--encre); border-radius: 4px; overflow: hidden; margin: 0 0 18px; }
.cartouche > div { background: var(--carte); padding: 9px 14px 10px; min-width: 0; }
.cartouche dt { font-size: .72rem; color: var(--ardoise); margin-bottom: 1px; }
.cartouche dd { margin: 0; }
.cartouche .fort { grid-row: span 2; display: flex; flex-direction: column; justify-content: center; }
.cartouche .fort dd { font-family: var(--din); font-weight: 700; font-size: 1.7rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.cartouche .fort dd small { display: block; font-family: var(--texte); font-weight: 400; font-size: .78rem; color: var(--ardoise); }
.cartouche dl { margin: 0; }
.statut-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.statut-form label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--ardoise); }
.statut-form select { width: auto; }
.ecarts-regles { display: grid; gap: 14px; margin: 6px 0 14px; }
.ecart-ligne { display: grid; grid-template-columns: 250px minmax(0, 1fr) 190px; gap: 16px; align-items: center; }
.ecart-ligne .valeurs { text-align: right; font-size: .86rem; color: var(--ardoise); font-variant-numeric: tabular-nums; }
.ecart-ligne .valeurs .din { color: var(--encre); font-size: 1rem; }
.ecart-ligne.total { border-top: 1.5px solid var(--filet-fort); padding-top: 14px; }
.ecart-ligne.total .libelle { font-weight: 650; }

/* --- Devis --- */
.onglets { display: flex; gap: 2px; border-bottom: 1px solid var(--filet-fort); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.onglets a { padding: 9px 14px; text-decoration: none; color: var(--ardoise); border-bottom: 3px solid transparent; white-space: nowrap; }
.onglets a:hover { color: var(--encre); }
.onglets a[aria-current] { color: var(--sapin); border-bottom-color: var(--sapin); font-weight: 600; }
.versions { display: flex; gap: 4px; }
.version-puce { display: inline-grid; place-items: center; min-width: 38px; height: 32px; border-radius: 7px; border: 1px solid var(--filet-fort); text-decoration: none; font-family: var(--din); font-weight: 700; background: #fff; color: var(--ardoise); }
.version-puce:hover { border-color: var(--sapin-2); color: var(--sapin); }
.version-puce.actuelle { background: var(--sapin); color: #fff; border-color: var(--sapin); }
.note-version { background: var(--chene-pale); border-radius: 8px; padding: 9px 14px; font-size: .9rem; }
.lot { padding-top: 16px; }
.lot.option { border-style: dashed; }
.lot-tete { border-bottom: 1px solid var(--filet); margin-bottom: 12px; }
.lot-tete h2 { display: flex; gap: 10px; align-items: center; margin-bottom: .2rem; font-size: 1.08rem; }
.lot-tete p { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: .5rem; }
.lot-tete strong.chiffre { margin-left: auto; font-family: var(--din); font-weight: 700; font-size: 1.3rem; }
.lignes-lot { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 4px 24px; }
.supprimer-lot { text-align: right; margin-top: -32px; }
.synthese h3 { margin-top: 1.2rem; }
.synthese tr.total td { font-family: var(--din); font-size: 1.12rem; }
.synthese .regle { margin: 4px 0 8px; }
.document { max-width: 860px; }
.document header { border-bottom: 2px solid var(--encre); margin-bottom: 16px; }
.document .totaux { max-width: 380px; margin-left: auto; margin-top: 12px; }
tr.cmp-ajoute td:first-child { box-shadow: inset 3px 0 0 var(--vert); }
tr.cmp-retire td { color: var(--ardoise); text-decoration: line-through; }
tr.cmp-retire td .etiquette { text-decoration: none; }
tr.cmp-modifie td:first-child { box-shadow: inset 3px 0 0 var(--chene); }

/* --- Temps --- */
.semaine { display: flex; gap: 6px; margin-bottom: 16px; align-items: stretch; overflow-x: auto; }
.semaine .jour { flex: 1; min-width: 110px; display: flex; flex-direction: column; padding: 8px 12px; border: 1px solid var(--filet); background: var(--carte); border-radius: 9px; text-decoration: none; color: var(--encre); transition: border-color .15s; }
.semaine .jour:hover { border-color: var(--sapin-2); }
.semaine .jour span { font-size: .8rem; color: var(--ardoise); }
.semaine .jour strong { font-family: var(--din); font-size: 1.15rem; }
.semaine .jour small { color: var(--ardoise); }
.semaine .jour.actuel { border-color: var(--sapin); box-shadow: inset 0 0 0 1px var(--sapin); background: #f7faf7; }
.semaine .jour.vide strong { color: var(--chene-texte); }
.semaine .fleche { display: grid; place-items: center; width: 38px; font-size: 1.4rem; text-decoration: none; border: 1px solid var(--filet); border-radius: 9px; background: var(--carte); }
.pied-journee { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--filet); margin-top: 16px; padding-top: 14px; }
.total-journee { margin: 0; font-size: 1.05rem; }
.total-journee strong { font-family: var(--din); font-size: 1.3rem; }
td.manque { background: var(--chene-pale); }
td.manque a { color: var(--chene-texte); font-weight: 600; }
.controle td a { text-decoration: none; }

/* --- Planning --- */
.palette { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; position: sticky; top: 0; background: var(--fond); padding: 8px 0; z-index: 3; }
.puce-projet {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 8px; border-radius: 99px; cursor: pointer; font-size: .85rem;
  border: 1px solid var(--filet-fort); background: #fff; border-left: 10px solid hsl(var(--teinte, 0) 42% 52%);
}
.puce-projet .numero { font-size: .82rem; }
.puce-projet[aria-checked="true"] { background: hsl(var(--teinte, 0) 50% 91%); border-color: hsl(var(--teinte, 0) 42% 38%); font-weight: 600; box-shadow: 0 0 0 2px hsl(var(--teinte, 0) 42% 38%); }
.puce-projet.gomme { border-left: 1px dashed var(--filet-fort); border-style: dashed; }
.puce-projet.gomme[aria-checked="true"] { background: var(--aucun-fond); box-shadow: 0 0 0 2px var(--ardoise); }
.planning-defile { border: 1px solid var(--filet); border-radius: var(--rayon); background: var(--carte); margin-bottom: 8px; }
.planning { border-collapse: collapse; font-size: .8rem; }
.planning th { font-weight: 600; color: var(--ardoise); padding: 5px 2px; white-space: nowrap; border-bottom: 1px solid var(--filet); }
.planning th.moment { font-weight: 400; font-size: .7rem; }
.planning th.aujourdhui { color: #fff; background: var(--sapin); }
.planning th.qui { position: sticky; left: 0; background: var(--carte); text-align: left; padding: 4px 12px; min-width: 156px; z-index: 1; }
.planning td { padding: 2px; border-bottom: 1px solid var(--filet); }
.planning .lundi { border-left: 2px solid var(--filet-fort); }
.planning td.passe { opacity: .5; }
.planning .case {
  width: 46px; height: 32px; border: 1px dashed var(--filet); border-radius: 5px; background: transparent; cursor: pointer;
  font-family: var(--din); font-weight: 700; font-size: .7rem; font-variant-numeric: tabular-nums; color: var(--encre); padding: 0; transition: background .12s;
}
.planning .case:hover { border-color: var(--sapin-2); background: var(--sapin-clair); }
.planning .case.pleine { border: 0; border-left: 3px solid hsl(var(--teinte) 42% 38%); background: hsl(var(--teinte) 50% 85%); }
.planning td.absent { background: repeating-linear-gradient(135deg, var(--aucun-fond) 0 6px, #fff 6px 12px); color: var(--ardoise); font-size: .7rem; text-align: center; }
.pastille-projet { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: hsl(var(--teinte) 42% 52%); vertical-align: middle; }

/* --- Suivi --- */
.barres { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding: 10px 0 0; border-bottom: 1.5px solid var(--encre); margin-bottom: 8px; }
.barre-mois { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; max-width: 76px; }
.barre-pile { position: relative; flex: 1; width: 100%; }
.barre-pile span { position: absolute; bottom: 0; border-radius: 3px 3px 0 0; }
.barre-pile .devise { left: 0; right: 0; background: #d3dbd4; }
.barre-pile .gagne { left: 20%; right: 20%; background: var(--sapin); }
.barre-mois small { color: var(--ardoise); }
.legende { font-size: .82rem; color: var(--ardoise); display: flex; gap: 6px 14px; align-items: center; }
.cle { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: -8px; }
.cle.devise { background: #d3dbd4; }
.cle.gagne { background: var(--sapin); }

/* --- Paie --- */
.choix { display: flex; gap: 4px; }
.puce { border: 1px solid var(--filet-fort); background: #fff; border-radius: 99px; padding: 1px 10px; cursor: pointer; font-size: .8rem; }
.puce.choisie { background: var(--sapin); color: #fff; border-color: var(--sapin); }
.paie td:nth-child(10) { min-width: 160px; }

/* --- Réglages, points --- */
.sommaire { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 16px; }
.point dl { display: grid; grid-template-columns: 190px 1fr; gap: 8px 16px; margin: 0 0 .6rem; }
.point dt { color: var(--ardoise); font-size: .86rem; }
.point dd { margin: 0; }
.point:target { border-color: var(--chene); box-shadow: 0 0 0 3px var(--chene-pale); }

/* --- Connexion : un plan coté sur fond sapin --- */
.acces { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr); background: var(--fond); }
.acces-plan { background: var(--sapin); color: #d6e3d9; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; overflow: hidden; }
.acces-plan .marque { padding: 0; }
.acces-plan .marque svg { width: 48px; height: 38px; }
.acces-plan .marque strong { font-size: 1.35rem; }
.acces-plan h1 { color: #fff; font-size: clamp(2rem, 3.2vw, 2.9rem); max-width: 19ch; margin: 0 0 12px; }
.acces-plan p { max-width: 52ch; color: #b8cfbf; font-size: 1.02rem; margin: 0; }
.acces-dessin { width: 100%; max-width: 600px; max-height: 50vh; display: block; }
.acces-dessin .trait { fill: none; stroke: #e7efe9; stroke-width: 1.6; }
.acces-dessin .fin { fill: none; stroke: #9fbca8; stroke-width: 1; }
.acces-dessin .cote { fill: none; stroke: var(--chene); stroke-width: 1; }
.acces-dessin text { font-family: var(--din); font-weight: 700; font-size: 13px; fill: #e0b979; }
.acces-dessin .trace { stroke-dasharray: 1; stroke-dashoffset: 1; animation: tracer 1.4s cubic-bezier(.6, 0, .3, 1) forwards; }
.acces-dessin .cote, .acces-dessin text { opacity: 0; animation: apparaitre .6s ease-out 1.3s forwards; }
@keyframes tracer { to { stroke-dashoffset: 0; } }
@keyframes apparaitre { to { opacity: 1; } }
.acces-carte { align-self: center; justify-self: center; width: min(400px, 100% - 40px); padding: 32px 0; }
.acces-carte h2 { font-family: var(--din); font-size: 1.7rem; font-weight: 700; margin-bottom: .3rem; }
.acces .pile { margin: 22px 0 18px; }
.acces .pile input { padding: 10px 12px; font-size: 1rem; }
.acces .bouton { width: 100%; min-height: 44px; font-size: 1rem; }
.comptes { border-top: 1px solid var(--filet-fort); padding-top: 14px; font-size: .9rem; }
.comptes summary { cursor: pointer; color: var(--sapin-2); font-weight: 600; }
.comptes ul { padding-left: 1.1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .acces-dessin .trace { stroke-dashoffset: 0; }
  .acces-dessin .cote, .acces-dessin text { opacity: 1; }
}

@media (max-width: 1100px) {
  .tableau-bord { grid-template-columns: minmax(0, 1fr); }
  .cartouche { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ecart-ligne { grid-template-columns: 150px minmax(0, 1fr); }
  .ecart-ligne .valeurs { grid-column: 2; text-align: left; }
}

/* --- Téléphone et tablette : une app, avec ses onglets en bas --- */
.onglets-bas, .avatar-bouton, .bandeau .court, .seul-mobile { display: none; }
.feuille {
  position: fixed; inset: auto 0 0; width: 100%; max-width: 560px; height: auto; max-height: 85vh; margin: 0 auto;
  border: 0; border-radius: 20px 20px 0 0; padding: 8px 14px calc(14px + env(safe-area-inset-bottom)); background: var(--carte); color: var(--encre);
  box-shadow: 0 -12px 40px rgb(23 34 28 / .25); overflow: auto;
}
.feuille::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--filet-fort); margin: 2px auto 12px; }
.feuille::backdrop { background: rgb(23 34 28 / .45); }
.feuille:popover-open { animation: monter .26s cubic-bezier(.2, .8, .2, 1); }
@keyframes monter { from { transform: translateY(100%); } }
.feuille-moi { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 0 6px 12px; border-bottom: 1px solid var(--filet); margin-bottom: 6px; }
.feuille-moi small { display: block; color: var(--ardoise); }
.feuille-moi .avatar { grid-row: auto; width: 42px; height: 42px; font-size: 1.1rem; }
.feuille .fermer { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--fond); font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ardoise); }
.feuille ul { list-style: none; margin: 0 0 10px; padding: 0; }
.feuille li a { display: flex; align-items: center; gap: 14px; padding: 13px 10px; border-radius: 12px; color: var(--encre); text-decoration: none; font-size: 1.02rem; font-weight: 550; }
.feuille li a svg { width: 22px; height: 22px; color: var(--sapin-2); flex: none; }
.feuille li a[aria-current] { background: var(--sapin-clair); color: var(--sapin); }
.feuille li a:active { background: var(--fond); }
.feuille .compte { margin-left: auto; }
.feuille form .bouton { width: 100%; min-height: 48px; color: var(--ardoise); }
.feuille form .bouton svg { width: 20px; height: 20px; }

@media (max-width: 960px) {
  :root { -webkit-tap-highlight-color: transparent; }
  a, button, summary, select, label { touch-action: manipulation; }
  .cadre { grid-template-columns: 1fr; }
  .sans-mobile, .bandeau .long { display: none; }
  .seul-mobile, .bandeau .court { display: inline; }

  /* Barre du haut : la marque et le compte */
  .menu {
    position: sticky; top: 0; z-index: 20; height: auto; overflow: visible; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px;
    padding: calc(8px + env(safe-area-inset-top)) 14px 8px; box-shadow: 0 1px 0 rgb(0 0 0 / .12);
  }
  .menu ul, .menu .points-lien, .menu .moi, .marque small { display: none; }
  .marque { padding: 0; gap: 9px; }
  .marque svg { width: 34px; height: 27px; }
  .marque strong { font-size: 1.05rem; }
  .avatar-bouton { display: block; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
  .avatar-bouton .avatar { width: 36px; height: 36px; }

  /* Onglets du bas */
  .onglets-bas {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgb(255 255 255 / .92); backdrop-filter: blur(14px) saturate(1.5); -webkit-backdrop-filter: blur(14px) saturate(1.5);
    border-top: 1px solid var(--filet);
  }
  .onglets-bas a, .onglets-bas button {
    display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 54px; padding: 4px 0 2px; border: 0; background: none; cursor: pointer;
    color: var(--ardoise); font: 600 .7rem/1.1 var(--texte); text-decoration: none; letter-spacing: .01em;
  }
  .onglet-icone { display: grid; place-items: center; width: 58px; height: 32px; border-radius: 99px; transition: background .2s, transform .12s; }
  .onglet-icone svg { width: 23px; height: 23px; }
  .onglets-bas [aria-current], .onglets-bas .actif { color: var(--sapin); }
  .onglets-bas [aria-current] .onglet-icone, .onglets-bas .actif .onglet-icone { background: var(--sapin-clair); }
  .onglets-bas [aria-current] svg, .onglets-bas .actif svg { stroke-width: 2.1; }
  .onglets-bas a:active .onglet-icone, .onglets-bas button:active .onglet-icone { transform: scale(.92); }

  main { padding: 14px 16px calc(92px + env(safe-area-inset-bottom)); }
  .bandeau { font-size: .76rem; margin-bottom: 14px; }

  /* Au doigt : des cibles de 44 px, et 16 px dans les champs pour que l'iPhone ne zoome pas */
  input:not([type=checkbox]):not([type=hidden]):not([type=radio]), select, textarea { font-size: 16px; min-height: 44px; }
  .bouton { min-height: 44px; }
  .lien { min-height: 36px; }
  .grille-version, .grille-2, .lignes-lot { grid-template-columns: minmax(0, 1fr); }
  .grille-version > .panneau:last-child { position: static; }
  .point dl { grid-template-columns: 1fr; gap: 2px; }
  .point dd { margin-bottom: 8px; }
  .entete { margin-bottom: 12px; }
  .entete > .ligne-saisie, .entete > .actions, .entete > .statut-form { width: 100%; justify-content: flex-start; }
  .entete > .ligne-saisie label { flex: 1 1 200px; }
  .entete > .ligne-saisie select { width: 100%; }
  details.ajout[open] { flex-basis: 100%; }
  details.ajout[open] > form { position: static; width: 100%; margin-top: 12px; box-shadow: none; }
  .filtres input[type=search] { max-width: none; flex: 1 1 100%; }
  .filtres select { flex: 1 1 0; min-width: 0; }
  .filtres .bouton { display: none; }
  .formulaire.serre { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tableau.saisie select, .grille-temps select.projet { min-width: 0; }

  /* Les tableaux larges défilent, première colonne fixe, une ombre dit qu'il y a une suite */
  .tableau-defile {
    background:
      linear-gradient(to left, var(--carte) 30%, rgb(255 255 255 / 0)) right / 40px 100% no-repeat local,
      linear-gradient(to left, rgb(23 34 28 / .14), rgb(23 34 28 / 0)) right / 14px 100% no-repeat scroll,
      var(--carte);
  }
  .tableau-defile > .tableau:not(.saisie):not(.cartes-mobile):not(.liste-projets):not(.liste-matiere) :is(th, td):first-child {
    position: sticky; left: 0; z-index: 1; background: var(--carte); box-shadow: 1px 0 0 var(--filet);
  }

  /* Accueil : ce qui est à faire d'abord */
  .accueil-tete { grid-template-columns: 1fr; margin-bottom: 18px; }
  .accueil-tete .date-jour { text-align: left; grid-row: 1; }
  .accueil-tete h1 { font-size: 2.1rem; }
  .accueil-tete .resume, .resume { font-size: 1.1rem; }
  .tableau-bord > div:last-child { order: -1; }

  /* Temps : la semaine défile, le pied de journée reste sous le pouce */
  .semaine { scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px 14px; padding: 0 16px; }
  .semaine .jour { min-width: 96px; scroll-snap-align: center; }
  .semaine .fleche { display: none; }
  .pied-journee {
    position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 5; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px;
    margin: 16px -16px -16px; padding: 10px 16px 12px; background: var(--carte); border-radius: 0 0 var(--rayon) var(--rayon); box-shadow: 0 -10px 24px rgb(23 34 28 / .08);
  }
  .total-journee .discret { display: none; }
  .pied-journee .boutons { display: contents; }
  .pied-journee .bouton:not(.principal) { min-height: 38px; padding: 5px 14px; }
  .pied-journee .bouton.principal { grid-column: 1 / -1; min-height: 48px; }

  /* Planning : la palette défile d'un trait, les noms restent à gauche */
  .palette { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; top: calc(51px + env(safe-area-inset-top)); margin: 0 -16px 10px; padding: 8px 16px; }
  .puce-projet { white-space: nowrap; flex: none; }
  .planning th.qui { min-width: 92px; padding: 4px 8px; }
  .planning th.qui .discret { display: none; }
  .planning .case { width: 44px; height: 38px; }

  /* Connexion */
  .acces { grid-template-columns: 1fr; }
  .acces-plan { padding: calc(24px + env(safe-area-inset-top)) 24px 24px; gap: 18px; }
  .acces-plan .marque span { display: block; }
  .acces-dessin { max-width: 420px; max-height: 26vh; }
  .acces-plan p { font-size: .95rem; }
}

@media (max-width: 960px) {
  /* Projets : une carte par projet (deux colonnes sur tablette) */
  main > .tableau-defile.defile-projets { background: none; border: 0; padding: 0; overflow: visible; }
  .liste-projets td:nth-child(2) a { text-decoration: none; }
  .liste-projets thead { display: none; }
  .liste-projets, .liste-projets tbody { display: block; }
  .liste-projets tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 10px; }
  .liste-projets tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline;
    grid-template-areas: "num . statut" "projet projet projet" "version date montant";
    background: var(--carte); border: 1px solid var(--filet); border-radius: 14px; padding: 12px 14px;
  }
  .liste-projets tr:active { background: #f6f8f4; }
  .tableau.liste-projets td, .tableau.liste-projets td:first-child, .tableau.liste-projets td:last-child { padding: 0; border: 0; background: none !important; }
  .liste-projets td:nth-child(1) { grid-area: num; font-size: .85rem; }
  .liste-projets td:nth-child(2) { grid-area: projet; font-size: 1.05rem; line-height: 1.3; padding: 2px 0 4px !important; }
  .liste-projets td:nth-child(2) br { display: block; }
  .liste-projets td:nth-child(5) { grid-area: statut; justify-self: end; }
  .liste-projets td:nth-child(6) { grid-area: date; font-size: .84rem; color: var(--ardoise); }
  .liste-projets td:nth-child(7) { grid-area: version; font-size: .84rem; }
  .liste-projets td:nth-child(8) { grid-area: montant; font-size: 1.15rem !important; }
  .liste-projets td:nth-child(3), .liste-projets td:nth-child(4), .liste-projets td:nth-child(9) { display: none; }

  /* Listes en cartes : chaque ligne devient une fiche « libellé : valeur » */
  .cartes-mobile thead { display: none; }
  .cartes-mobile, .cartes-mobile tbody, .cartes-mobile tr { display: block; }
  .cartes-mobile tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 18px; padding: 10px 0; border-bottom: 1px solid var(--filet); }
  .cartes-mobile td:first-child { grid-column: 1 / -1; }
  .cartes-mobile tbody tr:last-child { border-bottom: 0; }
  .tableau.cartes-mobile td { display: block; padding: 3px 0; border: 0; text-align: left; white-space: normal; }
  .tableau.cartes-mobile td:first-child { font-weight: 650; font-size: 1rem; padding-bottom: 2px; }
  .cartes-mobile td[data-label]::before { content: attr(data-label); display: block; color: var(--ardoise); font-size: .72rem; font-weight: 400; }
  .cartes-mobile td:first-child::before, .cartes-mobile td:empty { display: none; }
  .cartes-mobile tr.total { background: var(--fond); border-radius: 8px; padding: 10px; border: 0; }

  /* Matière notée : une ligne par saisie */
  .liste-matiere thead { display: none; }
  .liste-matiere, .liste-matiere tbody { display: block; }
  .liste-matiere tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 8px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--filet);
    grid-template-areas: "jour qui cout" "article article quantite" "chantier chantier suppr"; }
  .liste-matiere tbody tr:last-child { border-bottom: 0; }
  .tableau.liste-matiere td { padding: 0; border: 0; white-space: normal; }
  .liste-matiere td:nth-child(1) { grid-area: jour; font-weight: 650; }
  .liste-matiere td:nth-child(2) { grid-area: qui; color: var(--ardoise); }
  .liste-matiere td:nth-child(3) { grid-area: chantier; font-size: .86rem; }
  .liste-matiere td:nth-child(4) { grid-area: article; }
  .liste-matiere td:nth-child(5) { grid-area: quantite; color: var(--ardoise); }
  .liste-matiere td:nth-child(5)::before { content: "× "; }
  .liste-matiere td:nth-child(6) { grid-area: cout; font-family: var(--din); font-weight: 700; }
  .liste-matiere td:nth-child(7) { grid-area: suppr; justify-self: end; }

  /* Saisie de la journée : une fiche par projet, les activités en grille */
  .saisie-cartes thead { display: none; }
  .saisie-cartes, .saisie-cartes tbody { display: block; }
  .saisie-cartes tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); align-items: end; gap: 10px 8px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--filet); border-radius: 12px; background: #f8faf7; }
  .tableau.saisie-cartes td { display: block; padding: 0; border: 0; }
  .saisie-cartes td:first-child, .saisie-cartes td:last-child { grid-column: 1 / -1; }
  .saisie-cartes td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; padding-left: 6px; border-left: 3px solid var(--g, var(--aucun)); font-size: .74rem; line-height: 1.25; color: var(--ardoise); }
  .saisie-cartes input.court, .grille-temps input.court, .tableau.saisie-cartes select { width: 100% !important; }
  .grille-temps td:last-child input { min-width: 0; }
  .defile-temps { background: none !important; overflow: visible; }
}

@media (max-width: 560px) {
  .cartouche .fort { grid-row: auto; grid-column: 1 / -1; }
  h1 { font-size: 1.75rem; }
  .ecart-ligne { grid-template-columns: 1fr; gap: 6px; }
  .ecart-ligne .valeurs { grid-column: 1; }
  .panneau { padding: 16px; }
  .chantier-tete .quand { margin-left: 0; flex-basis: 100%; }
}

@media print {
  .onglets-bas, .feuille, .menu, .bandeau, .onglets, .actions, .fil, .message { display: none; }
  .cadre { display: block; }
  main { padding: 0; }
  .panneau { border: 0; }
  .a-confirmer { display: none; }
}
