/*
 * Outil projets SST. Pensé d'abord pour le téléphone (une colonne, cibles
 * tactiles de 44 px au moins), élargi au-delà de 760 px.
 * Identité SST Prod (lifting, 26/11/2026) : pétrole #0F5C63, rouge REC #D7263D réservé aux
 * points et pastilles, police Unbounded pour les titres et les montants (charte, licence OFL),
 * police du système pour le texte. Contrastes WCAG 2.2 AA vérifiés pour chaque paire de couleurs.
 */

@font-face {
  font-family: "Unbounded"; src: url("/assets/polices/unbounded-latin.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
}

:root {
  --fond: #f4f7f7;
  --surface: #ffffff;
  --texte: #142224;
  --texte-doux: #4b5b5d;
  --bordure: #d6e2e3;
  --bordure-champ: #9fb4b6;
  --accent: #0f5c63;
  --accent-fonce: #0a464c;
  --accent-texte: #ffffff;
  --accent-pale: #e6f0f1;
  --lien: #0f5c63;
  --rec: #d7263d;
  --ok: #1b7a43;
  --ok-fond: #e5f4ea;
  --alerte: #8a5a00;
  /* Couleurs vives pour les barres et les bords (le texte garde les couleurs foncées, lisibles) */
  --ok-vif: #22a05a;
  --alerte-vif: #f08c00;
  --erreur-vif: #d7263d;
  --alerte-fond: #fff3d6;
  --erreur: #b3261e;
  --erreur-fond: #fde8e6;
  --info-fond: #e6f0f1;
  --prevu: #4b5b5d;
  --facture: #8a5a00;
  --paye: #1b7a43;
  --rayon: 12px;
  --ombre: 0 1px 2px rgba(15, 92, 99, .07), 0 2px 8px rgba(15, 92, 99, .04);
  --haut-onglets: 64px;
  --large-rail: 232px;
  --haut-tete: 64px;
  --titre: "Unbounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0f1b1c;
    --surface: #172526;
    --texte: #e8efef;
    --texte-doux: #9db0b2;
    --bordure: #2a3c3e;
    --bordure-champ: #4a6467;
    --accent: #7fc4ca;
    --accent-fonce: #0a3a3f;
    --accent-texte: #0f1b1c;
    --accent-pale: #1b3133;
    --lien: #8fd0d6;
    --ok: #6fcf97;
    --ok-fond: #15301f;
    --alerte: #f2c14e;
    --alerte-fond: #3a2e0f;
    --erreur: #ff8a80;
    --ok-vif: #4cc38a;
    --alerte-vif: #ffa94d;
    --erreur-vif: #ff6b61;
    --erreur-fond: #3b1714;
    --info-fond: #1b3133;
    --prevu: #9db0b2;
    --facture: #f2c14e;
    --paye: #6fcf97;
    --ombre: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
body.avec-onglets { padding-bottom: calc(var(--haut-onglets) + env(safe-area-inset-bottom) + 52px); }
a { color: var(--lien); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h2 { font-size: 1.05rem; font-weight: 600; }
h2 small { font-weight: 400; color: var(--texte-doux); font-size: .85rem; }
code { font-family: ui-monospace, Menlo, monospace; }
[hidden] { display: none !important; }
.icone { width: 22px; height: 22px; flex: none; }

/* En-tête */
.entete {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  min-height: 56px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--accent); color: var(--accent-texte);
}
.entete a { color: inherit; text-decoration: none; }
.entete-retour, .entete-action, .entete-marque {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; border-radius: 10px;
}
.entete-marque { font-weight: 700; letter-spacing: .04em; font-size: .85rem; opacity: .8; }
.entete-action { padding: 0 12px; font-weight: 600; background: rgba(255, 255, 255, .14); }
.entete-titre { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.entete-titre h1 { font-size: 1.15rem; line-height: 1.2; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Fil d'Ariane dans l'en-tête : pastilles sur une ligne, qui défile si elle est trop longue */
.fil { flex: 1; min-width: 0; }
.fil ol { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; min-width: 0; overflow: hidden; }
.fil ol::-webkit-scrollbar { display: none; }
.fil li { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; }
.fil li:first-child { flex: none; }
.fil li + li::before { flex: none; }
/* La page en cours ne se raccourcit qu'en dernier : ce sont les pastilles qui cèdent la place. */
.fil li:not(.fil-ici):not(:first-child) { min-width: 4em; }
/* Au téléphone : maison › section juste au-dessus › page. Le projet se voit aux onglets du bas. */
@media (max-width: 759px) {
  .fil li:not(:first-child):not(.fil-ici):not(:nth-last-child(2)) { display: none; }
}
.fil li + li::before { content: "›"; padding: 0 5px; opacity: .7; }
.fil a, .fil span {
  display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(255, 255, 255, .16); color: inherit;
}
.fil a:hover, .fil a:focus-visible { background: rgba(255, 255, 255, .28); }
.fil span { background: transparent; padding: 0 4px; opacity: .85; }
/* Menu principal : catégories, sous-menus déroulants */
.menu {
  position: sticky; top: var(--haut-menu, 56px); z-index: 18; display: flex; justify-content: space-between;
  padding: 0 2px; background: var(--surface); border-bottom: 1px solid var(--bordure);
}

.bandeau-env { font-size: .75rem; text-align: center; padding: 2px; background: var(--alerte-fond); color: var(--alerte); }

/* Contenu */
.contenu { max-width: 1100px; margin: 0 auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.carte {
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon);
  padding: 14px; box-shadow: var(--ombre); display: flex; flex-direction: column; gap: 10px;
}
.carte.vide { text-align: center; color: var(--texte-doux); }
.etroit { max-width: 440px; width: 100%; margin: 0 auto; }
.note { color: var(--texte-doux); font-size: .9rem; margin: 0; }
.centre { text-align: center; }
.resume { margin: 0; color: var(--texte-doux); font-size: .95rem; }
.section { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-doux); margin-top: 8px; }
.pile { display: flex; flex-direction: column; gap: 8px; }
.negatif { color: var(--erreur); }
.barre-bas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 4px 12px calc(4px + env(safe-area-inset-bottom)); font-size: .8rem; color: var(--texte-doux);
  background: var(--surface); border-top: 1px solid var(--bordure);
}
.barre-bas-ref { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body { padding-bottom: 52px; }
body.avec-onglets .barre-bas { bottom: calc(var(--haut-onglets) + env(safe-area-inset-bottom)); padding-bottom: 4px; }

/* Bandeaux */
.bandeau { border-radius: var(--rayon); padding: 10px 14px; border: 1px solid transparent; }
.bandeau ul { margin: 6px 0 0; padding-left: 20px; }
.bandeau-ok { background: var(--ok-fond); color: var(--ok); border-color: var(--ok); }
.bandeau-erreur { background: var(--erreur-fond); color: var(--erreur); border-color: var(--erreur); }
.bandeau-alerte { background: var(--alerte-fond); color: var(--alerte); border-color: var(--alerte); }
.bandeau-info { background: var(--info-fond); color: var(--texte); border-color: var(--bordure); }
#file-attente { margin: 8px 12px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Boutons */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--bordure); background: var(--surface); color: var(--texte);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.bouton.principal { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); }
.bouton.danger { color: var(--erreur); border-color: var(--erreur); background: transparent; }
.bouton.large { width: 100%; }
.bouton.petit { min-height: 36px; padding: 6px 12px; font-size: .88rem; border-radius: 8px; gap: 4px; margin-top: 8px; }
.bouton .icone { width: 18px; height: 18px; }
p .bouton.petit, .bandeau .bouton.petit { margin: 6px 0 0; }
.bouton.collant { position: sticky; bottom: calc(var(--haut-onglets) + env(safe-area-inset-bottom) + 8px); z-index: 5; box-shadow: 0 4px 12px rgba(0, 0, 0, .15); }
.lien { background: none; border: 0; padding: 0; font: inherit; color: var(--lien); text-decoration: underline; cursor: pointer; }
.lien.danger { color: var(--erreur); }

/* Formulaires */
.formulaire { display: flex; flex-direction: column; gap: 12px; }
.champ { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.champ label, fieldset legend { font-size: .9rem; font-weight: 600; }
input[type=text], input[type=search], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=number], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; font-size: 16px;
  color: var(--texte); background: var(--surface); border: 1px solid var(--bordure); border-radius: 10px;
}
input[readonly] { background: var(--fond); color: var(--texte-doux); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--lien); outline-offset: 1px; }
.avec-unite { display: flex; align-items: center; gap: 6px; }
.avec-unite span { color: var(--texte-doux); }
.aide { color: var(--texte-doux); font-size: .82rem; }
.erreur input, .erreur select, .erreur textarea, input.erreur { border-color: var(--erreur); border-width: 2px; background: var(--erreur-fond); }
fieldset.erreur { border-color: var(--erreur); }
.message-erreur { color: var(--erreur); font-size: .85rem; font-weight: 600; }
.case { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.case input { width: 22px; height: 22px; flex: none; }
.deux, .trois { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trois { grid-template-columns: 1fr; }
fieldset { border: 1px solid var(--bordure); border-radius: 10px; padding: 8px 12px 12px; margin: 0; }
.choix label { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.choix input[type=radio] { width: 22px; height: 22px; }
.paye-par-autre { margin-top: 4px; }
.segments { display: flex; padding: 0; border: 0; gap: 0; }
.segments legend { margin-bottom: 4px; }
.segments label { flex: 1; }
.segments input { position: absolute; opacity: 0; pointer-events: none; }
.segments span {
  display: flex; align-items: center; justify-content: center; min-height: 44px;
  border: 1px solid var(--bordure); background: var(--surface); font-weight: 600; cursor: pointer;
}
.segments label:first-of-type span { border-radius: 10px 0 0 10px; }
.segments label:last-of-type span { border-radius: 0 10px 10px 0; }
.segments label + label span { border-left: 0; }
.segments input:checked + span { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); }
.segments input:focus-visible + span { outline: 2px solid var(--lien); }
details summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 8px; min-height: 32px; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "▾"; margin-left: auto; color: var(--texte-doux); }
details[open] summary::after { content: "▴"; }
details > summary small { color: var(--texte-doux); }
details[open] > summary { margin-bottom: 10px; }
.montant-lecture { display: flex; flex-direction: column; min-height: 44px; justify-content: center; font-weight: 600; }
.montant-lecture small { font-weight: 400; color: var(--texte-doux); }
form[data-lecture] input, form[data-lecture] select, form[data-lecture] textarea { pointer-events: none; background: var(--fond); }

/* Justificatifs */
.boutons-piece { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.boutons-piece .bouton { flex-direction: column; gap: 4px; min-height: 72px; font-size: .9rem; }
.boutons-piece .bouton .icone { width: 26px; height: 26px; }
.apercus, .pieces { display: flex; flex-wrap: wrap; gap: 8px; }
.apercus figure, .piece { margin: 0; width: 104px; display: flex; flex-direction: column; gap: 4px; }
.apercus img, .piece img { width: 104px; height: 104px; object-fit: cover; border-radius: 8px; border: 1px solid var(--bordure); display: block; }
.apercus figcaption, .piece figcaption { font-size: .75rem; color: var(--texte-doux); word-break: break-word; }
/* Formulaire d'une dépense */
.form-depense { gap: 12px; }
.fd-champs { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.form-depense .carte { gap: 12px; }
.quatre { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-depense .champ-phase .aide { display: none; }
.piece-grande { display: block; border: 1px solid var(--bordure); border-radius: 10px; overflow: hidden; background: var(--fond); }
.piece-grande img { display: block; width: 100%; max-height: 70vh; object-fit: contain; }
.piece-grande iframe { display: block; width: 100%; height: 40vh; border: 0; }
.fd-piece .boutons-piece .bouton { min-height: 48px; flex-direction: row; }
.boutons-piece.avec-poubelle { grid-template-columns: 1fr 1fr auto; }
.boutons-piece .poubelle { min-width: 52px; padding: 0 12px; }
.boutons-piece .poubelle.a-confirmer { grid-column: 1 / -1; }
.piece-legende { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: .78rem; color: var(--texte-doux); background: var(--surface); border-top: 1px solid var(--bordure); }
.piece-legende span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.piece-legende .bouton.petit { min-height: 32px; padding: 0 10px; margin: 0; }
.vis-tete .bouton.petit, .vis-pied .bouton.petit, .filtres-actifs .bouton.petit, .barre-outils .bouton.petit { margin: 0; }
.agrandir-image { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.fd-piece .pieces .piece { width: 64px; }
.fd-piece .pieces .piece img, .fd-piece .pieces .piece .piece-fichier { width: 64px; height: 64px; }
.fd-piece .pieces .piece.actif img, .fd-piece .pieces .piece.actif .piece-fichier { outline: 3px solid var(--lien); outline-offset: 1px; }
.rangee-pastilles { display: flex; flex-wrap: wrap; gap: 6px; }
.choix.pastilles label { min-height: 40px; gap: 6px; padding: 0 12px; border: 1px solid var(--bordure); border-radius: 999px; background: var(--surface); }
.choix.pastilles label:has(input:checked) { border-color: var(--accent); background: var(--info-fond); font-weight: 600; }
.choix.pastilles input[type=radio] { width: 18px; height: 18px; }
.choix.pastilles .paye-par-autre { margin-top: 8px; }
.fd-qui { align-items: start; grid-template-columns: 1fr; }
.champ-case { justify-content: flex-end; padding-bottom: 8px; }
.fd-actions {
  position: sticky; bottom: calc(var(--haut-onglets) + env(safe-area-inset-bottom) + 8px); z-index: 5;
  display: flex; gap: 8px; padding: 8px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
.fd-actions .bouton.principal { flex: 1; }
.piece-fichier { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 104px; height: 104px; border: 1px solid var(--bordure); border-radius: 8px; font-size: .75rem; text-align: center; padding: 4px; overflow: hidden; color: var(--texte); }

/* Onglets du projet (en bas sur téléphone) */
.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  height: calc(var(--haut-onglets) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--bordure);
}
.onglet {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--texte-doux); text-decoration: none; font-size: .72rem; font-weight: 600;
}
.onglet.actif { color: var(--lien); }
.onglet-ajout .icone { width: 40px; height: 40px; padding: 8px; border-radius: 50%; background: var(--accent); color: var(--accent-texte); }
.onglet-ajout span { color: var(--texte); }

.synthese-colonnes { display: flex; flex-direction: column; gap: 12px; }

/* Projets */
.grille-projets { display: grid; gap: 12px; }
.carte.projet { text-decoration: none; color: inherit; gap: 6px; }
.projet-tete { display: flex; justify-content: space-between; align-items: center; }
.code { font-size: .8rem; color: var(--texte-doux); font-weight: 600; }
.carte.projet h3 { font-size: 1.1rem; }
.client { margin: 0; color: var(--texte-doux); font-size: .9rem; }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 0; }
.mini div { display: flex; flex-direction: column; }
.mini dt { font-size: .75rem; color: var(--texte-doux); }
.mini dd { margin: 0; font-weight: 600; font-size: .92rem; }
.signal { margin: 0; color: var(--alerte); font-size: .85rem; font-weight: 600; }
.titre-projet h2 { font-size: 1.25rem; }
.titre-projet p { margin: 4px 0 0; color: var(--texte-doux); }

/* Barres */
.barre { height: 8px; border-radius: 4px; background: var(--fond); border: 1px solid var(--bordure); overflow: hidden; }
.barre span { display: block; height: 100%; background: var(--ok-vif); }
.barre.proche span { background: var(--alerte-vif); }
.barre.depasse span { background: var(--erreur-vif); }

/* Tuiles et chiffres */
.tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tuile { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 10px 12px; display: flex; flex-direction: column; }
.tuile span { font-size: .8rem; color: var(--texte-doux); }
.tuile strong { font-size: 1.15rem; }
.tuile small { font-size: .75rem; color: var(--texte-doux); }
.chiffres { margin: 0; display: flex; flex-direction: column; }
.chiffres div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--bordure); }
.chiffres div:last-child { border-bottom: 0; }
.chiffres dt { color: var(--texte-doux); }
.chiffres dd { margin: 0; font-weight: 600; text-align: right; white-space: nowrap; }
.fiche { margin: 0; display: grid; grid-template-columns: 1fr; gap: 2px 12px; }
.fiche dt { color: var(--texte-doux); font-size: .85rem; margin-top: 6px; }
.fiche dd { margin: 0; }

.postes { display: flex; flex-direction: column; gap: 12px; }
.poste-tete { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.poste-tete small { font-weight: 400; color: var(--texte-doux); }
.poste-pied { font-size: .8rem; color: var(--texte-doux); margin-top: 2px; }
.poste.depasse .poste-tete strong { color: var(--erreur); }
.poste.proche .poste-tete strong { color: var(--alerte); }
.controles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.controles li { padding: 8px 10px; border-radius: 8px; }
.controles li.ok { color: var(--texte-doux); }
.controles li.a-voir { background: var(--alerte-fond); }
.controles li.a-voir { padding: 0; }
.controles li.a-voir a { display: flex; align-items: center; gap: 6px; padding: 10px 12px; color: var(--alerte); font-weight: 600; text-decoration: none; border-radius: 8px; }
.controles li.a-voir a::after { content: "›"; margin-left: auto; font-size: 1.2rem; }

/* Listes */
.filtres { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filtres a { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--bordure); background: var(--surface); color: var(--texte); text-decoration: none; font-size: .9rem; min-height: 40px; display: inline-flex; align-items: center; }
.filtres a.actif { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); }
.liste-depenses { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.depense { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 12px; color: inherit; text-decoration: none; }
.depense.sans-poste { border-left: 5px solid #e8892b; }
.depense.sans-date { border-left: 5px solid var(--erreur); }
.depense-haut { display: flex; justify-content: space-between; gap: 10px; }
.depense-titre { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.depense-montant { font-weight: 700; white-space: nowrap; text-align: right; display: flex; flex-direction: column; }
.depense-montant small { font-weight: 400; font-size: .78rem; color: var(--texte-doux); }
.bouton.a-confirmer, .lien.a-confirmer { background: var(--erreur); color: #fff; border-color: var(--erreur); text-decoration: none; padding: 2px 8px; border-radius: 8px; }
.bouton.a-confirmer { padding: 10px 16px; }
.depense-bas { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--texte-doux); font-size: .85rem; }
.puces { display: flex; flex-wrap: wrap; gap: 4px; }
.puce { display: inline-flex; align-items: center; gap: 3px; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--fond); border: 1px solid var(--bordure); color: var(--texte-doux); }
.puce .icone { width: 14px; height: 14px; }
.puce[class*=signal-] { background: var(--alerte-fond); color: var(--alerte); border-color: transparent; }
.puce.signal-sans_poste, .puce.signal-paye_sans_date { background: var(--erreur-fond); color: var(--erreur); }
.pastille { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--fond); color: var(--texte-doux); border: 1px solid var(--bordure); white-space: nowrap; }
.pastille-prevu, .pastille-a_facturer, .pastille-preparation { color: var(--prevu); }
.pastille-facture { color: var(--facture); border-color: var(--facture); }
.pastille-paye, .pastille-encaisse, .pastille-en_cours { color: var(--paye); border-color: var(--paye); }

/* Budget */
.budget-lignes { display: flex; flex-direction: column; }
.budget-ligne { display: grid; grid-template-columns: 1fr 9.5em; gap: 4px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--bordure); }
.budget-ligne label { display: flex; flex-direction: column; font-weight: 600; font-size: .95rem; }
.budget-ligne label small { font-weight: 400; color: var(--texte-doux); font-size: .78rem; }
.budget-ligne input { text-align: right; }
.budget-ligne .message-erreur { grid-column: 1 / -1; }
.budget-total { display: flex; justify-content: space-between; padding-top: 8px; font-size: 1.05rem; }
.budget-total.secondaire { font-size: .92rem; color: var(--texte-doux); }
.rangee-boutons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.carte.phase > summary strong { margin-left: auto; white-space: nowrap; }
.carte.phase > summary::after { margin-left: 0; }
.phase-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.lignes-budget { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ligne-budget { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--bordure); color: inherit; text-decoration: none; }
.lb-titre { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.lb-montant { display: flex; flex-direction: column; text-align: right; white-space: nowrap; font-weight: 700; }
.lb-titre small, .lb-montant small { font-weight: 400; font-size: .8rem; color: var(--texte-doux); }
/* Budget complet : un bloc par poste, ses lignes dessous */
.postes-budget { display: flex; flex-direction: column; gap: 18px; margin-bottom: 14px; }
/* Un poste : trait vertical à la couleur du cadran, filet neutre sous la tête */
.poste-budget { border-left: 4px solid var(--ok-vif); padding-left: 12px; }
.poste-budget.proche { border-left-color: var(--alerte-vif); }
.poste-budget.depasse { border-left-color: var(--erreur-vif); }
.pb-tete { display: flex; align-items: center; gap: 12px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--texte); }
.pb-titre { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pb-tete h3 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.pb-tete strong { white-space: nowrap; font-size: 1.15rem; align-self: flex-start; }
.cadran { flex: none; width: 48px; height: 48px; }
.cadran .fond-cadran { stroke: var(--bordure); }
.cadran .arc { stroke: var(--ok-vif); transition: stroke-dasharray .4s; }
.cadran.proche .arc { stroke: var(--alerte-vif); }
.cadran.depasse .arc { stroke: var(--erreur-vif); }
.cadran text { fill: var(--texte); font-size: 12px; font-weight: 700; }
.cadran text.long { font-size: 10.5px; letter-spacing: -.02em; }
.cadran.depasse text { fill: var(--erreur); }

/* Phases : liste triable */
.saisie-bouton { display: flex; gap: 8px; }
.saisie-bouton input { flex: 1; min-width: 0; }
.saisie-bouton .bouton { flex: none; }
.liste-phases { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.liste-phases .phase { display: flex; align-items: flex-start; gap: 4px; border-bottom: 1px solid var(--bordure); background: var(--surface); }
.liste-phases .phase:last-child { border-bottom: 0; }
.liste-phases .phase > details { flex: 1; min-width: 0; }
.liste-phases .phase.deplace { position: relative; z-index: 2; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); border-radius: 10px; }
.poignee { display: flex; align-items: center; justify-content: center; width: 40px; min-height: 56px; color: var(--texte-doux); cursor: grab; touch-action: none; user-select: none; }
.poignee .icone { fill: currentColor; stroke: none; }
.deplace .poignee { cursor: grabbing; color: var(--texte); }
.phase-tete { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 0; cursor: pointer; list-style: none; }
.phase-tete::-webkit-details-marker { display: none; }
.liste-phases details[open] > summary { margin-bottom: 0; }
.phase-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--fond); border: 1px solid var(--bordure); font-size: .85rem; font-weight: 700; }
.phase-nom { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; }
.phase-nom small { font-weight: 400; color: var(--texte-doux); font-size: .82rem; }
.liste-phases .phase:first-child [value=monter], .liste-phases .phase:last-child [value=descendre] { display: none; }
.phase-outils { display: flex; flex-direction: column; gap: 10px; padding: 4px 4px 14px 38px; }
.poste-budget .lignes-budget { margin: 2px 0 8px; padding-left: 10px; border-left: 1px solid var(--bordure); }
.poste-budget .lb-titre, .poste-budget .lb-montant { font-weight: 400; font-size: .95rem; }
.poste-budget .lb-montant { font-weight: 600; }
.barre-outils {
  position: sticky; top: var(--haut-collant, 80px); z-index: 10;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: -4px -12px 0; padding: 8px 12px; background: var(--fond);
  border-bottom: 1px solid transparent; transition: box-shadow .15s, border-color .15s;
}
.barre-outils::-webkit-scrollbar { display: none; }
.barre-outils.colle { border-bottom-color: var(--bordure); box-shadow: 0 4px 10px rgba(0, 0, 0, .08); }
.barre-outils .bouton { flex: 1 0 auto; white-space: nowrap; min-height: 44px; padding: 0 10px; gap: 4px; font-size: .92rem; }
.pb-pied { font-size: .82rem; color: var(--texte-doux); margin: 0; }
.poste-budget .ligne-budget { padding: 8px 0; }
.poste-budget .lignes-budget li:last-child .ligne-budget { border-bottom: 0; }
.champ-phase .phase-nouvelle { margin-top: 8px; }
.carte.lien-carte { text-decoration: none; color: inherit; }
.carte.lien-carte span { color: var(--lien); }
.tableau-defile { overflow-x: auto; margin: 0 -4px; }

/* Listes : recherche, filtres, bascule cartes / tableau */
.recherche-liste { display: flex; flex-direction: column; gap: 8px; }
.recherche-liste input[type=search] { min-height: 44px; }
.tri-liste { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--texte-doux); }
.tri-liste select { flex: 1; }
.grille-filtres select { width: 100%; }
.filtres-avances { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 8px 12px; }
.filtres-avances > summary { min-height: 40px; align-items: center; font-weight: 600; }
.filtres-avances .compte { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-texte); font-size: .78rem; }
.grille-filtres { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.grille-filtres .champ:last-child:nth-child(odd) { grid-column: 1 / -1; }
.liste-entete { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.liste-entete .resume { flex: 1 1 200px; }
.bascule-vue { display: inline-flex; border: 1px solid var(--bordure); border-radius: 10px; overflow: hidden; background: var(--surface); flex: none; }
.bascule-vue a { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; font-size: .88rem; font-weight: 600; color: var(--texte-doux); text-decoration: none; }
.bascule-vue a + a { border-left: 1px solid var(--bordure); }
.bascule-vue a.actif { background: var(--accent); color: var(--accent-texte); }
.depense-titre .numero { display: inline-block; font-size: .78rem; font-weight: 600; color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.carte-tableau { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); margin: 0; }
.tableau-liste { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.tableau-liste th, .tableau-liste td { padding: 6px 10px; border-bottom: 1px solid var(--bordure); text-align: left; vertical-align: top; white-space: nowrap; }
.tableau-liste thead th { position: sticky; top: 0; background: var(--surface); font-size: .78rem; color: var(--texte-doux); font-weight: 600; }
.tableau-liste thead th a { color: inherit; text-decoration: none; }
.tableau-liste thead th[aria-sort] a { color: var(--texte); }
.tableau-liste .nombre { text-align: right; }
.tableau-liste td.libelle { min-width: 200px; max-width: 380px; }
/* Deux lignes au plus par dépense : le fournisseur, puis la description coupée si elle est longue (texte entier au survol). */
.tableau-liste td.libelle span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tableau-liste td.libelle .tl-desc { font-size: .8rem; color: var(--texte-doux); }
.puce-avance { display: inline-flex; align-items: center; min-height: 20px; padding: 0 6px; border-radius: 999px; background: var(--fond); border: 1px solid var(--bordure); font-size: .72rem; color: var(--texte-doux); }
.tableau-liste .pastille { padding-top: 1px; padding-bottom: 1px; }
.tableau-liste .voir-pieces { min-height: 26px; padding: 0 8px; }
.tableau-liste td small { display: block; font-size: .74rem; color: var(--texte-doux); }
.tableau-liste tbody tr { cursor: pointer; }
.tableau-liste tbody tr:hover { background: var(--fond); }
.tableau-liste tbody tr:last-child td { border-bottom: 0; }
.tableau-liste tr.a-voir td:first-child { box-shadow: inset 4px 0 0 var(--alerte-vif); }
.signal-tableau { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--alerte-fond); color: var(--alerte); font-size: .72rem; font-weight: 700; }
.filtres-actifs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.puce-filtre { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; background: var(--info-fond); color: var(--texte); text-decoration: none; font-size: .88rem; font-weight: 600; }
.puce-filtre span { font-size: 1.1rem; line-height: 1; color: var(--texte-doux); }
[data-resultats] { display: flex; flex-direction: column; gap: 12px; transition: opacity .15s; }
[data-resultats].en-cours { opacity: .55; }
.carte.vide .bouton { align-self: center; }
.liste-depenses li { position: relative; }
.voir-pieces { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--bordure); background: var(--surface); color: var(--texte); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.voir-pieces .icone { width: 16px; height: 16px; }
.voir-pieces:hover { border-color: var(--lien); color: var(--lien); }
.depense { position: relative; }
.lien-etendu { color: inherit; text-decoration: none; }
.lien-etendu::after { content: ""; position: absolute; inset: 0; border-radius: var(--rayon); }
.lien-etendu:focus-visible::after { outline: 2px solid var(--lien); outline-offset: 2px; }
.depense .voir-pieces { position: relative; z-index: 1; min-height: 28px; padding: 0 8px; }
.depense-etat { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.numeros { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.numeros .numero { margin: 0; }
.puce.puce-falco { background: var(--info-fond); color: var(--texte); border-color: var(--lien); font-weight: 600; }
mark { background: #ffe066; color: #17212b; border-radius: 3px; padding: 0 1px; }
.visionneuse { width: min(920px, 96vw); max-height: 94vh; padding: 0; border: 0; border-radius: var(--rayon); background: var(--surface); color: var(--texte); box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.visionneuse::backdrop { background: rgba(10, 18, 24, .7); }
.visionneuse[open] { display: flex; flex-direction: column; }
.vis-tete, .vis-pied { display: flex; align-items: center; gap: 8px; padding: 10px 12px; flex-wrap: wrap; }
.vis-tete strong { flex: 1; }
.vis-tete span { color: var(--texte-doux); font-size: .88rem; }
.vis-corps { flex: 1; min-height: 0; overflow: auto; background: var(--fond); display: flex; justify-content: center; }
.vis-corps img { max-width: 100%; max-height: 74vh; object-fit: contain; display: block; }
.vis-corps iframe { width: 100%; height: 74vh; border: 0; }
.vis-pdf-ajuste { width: 100%; height: 74vh; overflow: auto; -webkit-overflow-scrolling: touch; position: relative; }
.vis-pdf-ajuste iframe { position: absolute; top: 0; left: 0; transform-origin: 0 0; background: #fff; }
.vis-pied { justify-content: flex-end; border-top: 1px solid var(--bordure); }
.resultats { list-style: none; margin: 0; padding: 0; }
.resultats a { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 52px; padding: 8px 0; border-bottom: 1px solid var(--bordure); color: inherit; text-decoration: none; }
.resultats li:last-child a { border-bottom: 0; }
.res-texte { display: flex; flex-direction: column; min-width: 0; }
.res-texte small { color: var(--texte-doux); font-size: .82rem; }
.res-montant { font-weight: 700; white-space: nowrap; }
.tableau-treso { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.tableau-treso th, .tableau-treso td { padding: 7px 3px; border-bottom: 1px solid var(--bordure); text-align: right; vertical-align: top; white-space: nowrap; }
.tableau-treso th:first-child { text-align: left; white-space: normal; }
.tableau-treso thead th { font-size: .78rem; color: var(--texte-doux); font-weight: 600; }
.tableau-treso td small { display: block; font-size: .74rem; color: var(--texte-doux); }
.tableau-treso tr.retard th { color: var(--erreur); }

/* Réglages */
.table-postes { display: flex; flex-direction: column; gap: 10px; }
.ligne-poste { display: grid; grid-template-columns: 1fr 5em; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--bordure); }
.ligne-poste select { grid-column: 1 / -1; }
.ligne-poste small { color: var(--texte-doux); align-self: center; text-align: right; }
.ligne-poste.masque input[type=text] { color: var(--texte-doux); text-decoration: line-through; }
.ligne-acces { display: grid; grid-template-columns: 1fr; gap: 8px; align-items: center; }
.ligne-acces > div { display: flex; flex-direction: column; }
.ligne-acces small { color: var(--texte-doux); }
form.ligne-acces { flex-direction: row; }
.journal { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: .9rem; }
.journal li small { display: block; color: var(--texte-doux); overflow-wrap: anywhere; }
.quand { color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.liste-simple { margin: 0; padding-left: 20px; }
.codes { columns: 2; font-size: 1.1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fiche-compte-tete { display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; text-align: left; }
.fiche-compte-tete > div { display: flex; flex-direction: column; min-width: 0; }
.fiche-compte-tete small { color: var(--texte-doux); overflow-wrap: anywhere; }
.sous-onglets { display: flex; gap: 4px; margin: 0 0 12px; }
.sous-onglets a { flex: 1 1 auto; text-align: center; white-space: nowrap; padding: 8px 6px; font-size: .92rem; border: 1px solid var(--bordure); border-radius: 999px; background: var(--surface); color: var(--texte); text-decoration: none; font-weight: 500; }
.sous-onglets a.actif { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
.ligne-acces { padding: 10px 0; border-bottom: 1px solid var(--bordure); }
.ligne-acces .segments span { padding-left: 6px; padding-right: 6px; font-size: .9rem; }
/* Accès au projet : chaque compte est une carte (nom, accès, bouton), pas une ligne de liste. */
form.carte.ligne-acces { padding: 14px 16px; border-bottom: 1px solid var(--bordure); }
.filtres-liste { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.filtres-liste input[type=search] { width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; border: 1px solid var(--bordure); border-radius: 10px; background: var(--surface); color: var(--texte); }
.filtres-liste .note:empty { display: none; }
.filtres-ligne { display: flex; gap: 8px; align-items: flex-start; }
.filtres-ligne input[type=search] { flex: 1; min-width: 0; }
.filtres-panneau { position: relative; flex: none; }
.filtres-panneau > summary { list-style: none; min-height: 44px; display: flex; align-items: center; white-space: nowrap; }
.filtres-panneau > summary::-webkit-details-marker { display: none; }
.filtres-panneau[open] > summary { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
.filtres-choix {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: min(340px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 12px; padding: 14px;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre);
}
.filtres-choix legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.filtres-periode { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.filtres-periode label { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.filtres-choix [data-filtre-effacer] { align-self: flex-start; }
.puces-filtre { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0; }
.puces-filtre input { position: absolute; opacity: 0; pointer-events: none; }
.puces-filtre span { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid var(--bordure); border-radius: 999px; background: var(--surface); font-size: .9rem; cursor: pointer; white-space: nowrap; }
.puces-filtre input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
.puces-filtre input:focus-visible + span { outline: 2px solid var(--lien); }
[data-filtrable] [hidden] { display: none !important; }
/* Messages passagers : sur le téléphone, par-dessus le titre de l'en-tête, entre le bouton
   Retour et les boutons de droite. Ils laissent passer les clics : on continue à travailler. */
.messages {
  position: fixed; z-index: 60; top: calc(env(safe-area-inset-top) + 8px); left: 56px; right: 148px;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.message-passager {
  pointer-events: none; padding: 8px 12px; border-radius: 12px; font-weight: 600; font-size: .9rem; line-height: 1.25;
  background: var(--ok-fond); color: var(--ok); border: 2px solid var(--ok);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22); transition: opacity .4s, transform .4s; animation: message-entree .25s ease-out;
}
.message-ok::before { content: "✓ "; }
.message-info { background: var(--info-fond); color: var(--texte); border-color: var(--lien); }
.message-passager.sortie { opacity: 0; transform: translateY(-8px); }
@keyframes message-entree { from { opacity: 0; transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .message-passager { animation: none; transition: none; } }
.mail-texte { font-size: .95rem; overflow-wrap: anywhere; }
.mdp-provisoire code { overflow-wrap: anywhere; font-size: 1.2rem; padding: 6px 10px; background: var(--fond); border-radius: 8px; display: inline-block; user-select: all; }
.qr { display: flex; justify-content: center; }
.qr img, .qr svg { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 8px; }
.cle-totp code { word-break: break-all; }
.etapes { margin: 0; padding-left: 20px; }
.pagination { display: flex; gap: 16px; justify-content: center; }

/* Ordinateur */
@media (min-width: 760px) {
  .contenu { padding: 20px; gap: 16px; }
  /* En-tête aligné sur le contenu */
  .entete { padding-left: max(12px, calc((100% - 1100px) / 2 + 8px)); padding-right: max(12px, calc((100% - 1100px) / 2 + 8px)); }
  .menu.menu, .onglets.onglets { padding-left: max(14px, calc((100% - 1100px) / 2 + 8px)); padding-right: max(14px, calc((100% - 1100px) / 2 + 8px)); }
  .entete-titre h1 { font-size: 1.3rem; }
  .barre-outils { margin: -8px -20px 0; padding: 8px 20px; }
  body.avec-onglets { padding-bottom: 52px; }
  body.avec-onglets .barre-bas { bottom: 0; padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
  .barre-bas { padding-left: max(12px, calc((100% - 1100px) / 2 + 8px)); padding-right: max(12px, calc((100% - 1100px) / 2 + 8px)); }
  /* En grand écran : dans le coin en bas à droite, hors de la colonne de travail. */
  .messages { top: auto; left: auto; right: 24px; bottom: 60px; width: 360px; }
  .message-passager { padding: 14px 18px; font-size: 1rem; }
  .message-passager.sortie { transform: translateY(8px); }
  @keyframes message-entree-bas { from { opacity: 0; transform: translateY(8px); } }
  .message-passager { animation-name: message-entree-bas; }
  .onglets {
    position: sticky; top: var(--haut-entete, 80px); bottom: auto; height: auto; padding: 0 20px;
    justify-content: flex-start; gap: 4px; border-top: 0; border-bottom: 1px solid var(--bordure); z-index: 15;
  }
  .menu { justify-content: flex-start; gap: 4px; padding: 0 14px; }
  .onglet { flex: none; flex-direction: row; gap: 6px; padding: 12px 14px; font-size: .92rem; border-bottom: 3px solid transparent; }
  .onglet.actif { border-bottom-color: var(--lien); }
  .onglet-ajout { order: 10; margin-left: auto; }
  .onglet-ajout .icone { width: 22px; height: 22px; padding: 3px; }
  .bouton.collant { position: static; box-shadow: none; width: auto; align-self: flex-start; }
  .fd-actions { bottom: 12px; }
  .fd-actions .bouton.principal { flex: 0 1 260px; }
  .bouton.large.danger { width: auto; align-self: flex-start; }
  .tuiles { grid-template-columns: repeat(4, 1fr); }
  .grille-projets { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .trois { grid-template-columns: repeat(3, 1fr); }
  .fiche { grid-template-columns: max-content 1fr; }
  .fiche dt { margin-top: 0; }
  .ligne-poste { grid-template-columns: 1fr 5em 15em auto 7em; align-items: center; }
  .ligne-poste select { grid-column: auto; }
  .ligne-acces { grid-template-columns: 1fr 22em; }
  form.carte.ligne-acces { grid-template-columns: 1fr 16em auto; }
  .formulaire > .carte, .form-depense > details { max-width: 760px; }
  /* Dépense : justificatif à gauche, qui reste en vue ; champs à droite */
  /* On lit de gauche à droite : les champs d'abord, le justificatif à droite */
  .form-depense { display: grid; grid-template-columns: 3fr minmax(260px, 2fr); gap: 16px; align-items: start; }
  .fd-champs { grid-column: 1; grid-row: 2; }
  .fd-piece { grid-column: 2; grid-row: 2 / span 2; }
  .form-depense > .bandeau { grid-column: 1 / -1; }
  .fd-piece { position: sticky; top: calc(var(--haut-collant, 120px) + 12px); }
  .fd-champs .carte, .fd-champs details.carte { max-width: none; }
  .fd-actions { grid-column: 1; grid-row: 3; }
  .form-depense:not(:has(> .bandeau)) .fd-champs { grid-row: 1; }
  .form-depense:not(:has(> .bandeau)) .fd-piece { grid-row: 1 / span 2; }
  .form-depense:not(:has(> .bandeau)) .fd-actions { grid-row: 2; }
  .quatre { grid-template-columns: 1.3fr 1fr 1.3fr .9fr; }
  .fd-qui { grid-template-columns: 1fr 270px; }
  .piece-grande iframe { height: 62vh; }
  .boutons-piece .bouton { flex-direction: row; min-height: 48px; }
  .liste-depenses .depense { display: grid; grid-template-columns: 1fr auto; }
  .liste-depenses .depense .depense-haut { grid-column: 1 / -1; }
  .budget-ligne { grid-template-columns: 1fr 12em; }
}
@media (min-width: 1000px) {
  .synthese-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
}

/* Travailleurs et planning (étape 2a) */
.depense.a-voir { box-shadow: inset 4px 0 0 var(--alerte-vif); }
.depense.annulee { opacity: .65; }
.depense.annulee .depense-titre, .journal li.annulee { text-decoration: line-through; }
.pastilles { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.pastille-a-inscrire, .pastille-double { color: var(--erreur); border-color: var(--erreur); }
.nav-semaine { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.nav-semaine > div { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.nav-semaine small { color: var(--texte-doux); }
.nav-semaine .bouton { min-width: 44px; justify-content: center; }
.jour-planning { margin-bottom: 10px; }
.jour-planning h2.section { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.jour-planning.vide h2.section { color: var(--texte-doux); font-weight: 500; }
.choix-personne { border: 0; padding: 0; margin: 0 0 4px; display: flex; flex-direction: column; gap: 6px; }
.choix-personne legend { margin-bottom: 4px; font-weight: 600; }
.choix-personne label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--bordure); border-radius: 10px; background: var(--surface); cursor: pointer; }
.choix-personne label:has(input:checked) { border-color: var(--accent); background: var(--info-fond); }
.choix-personne input { width: 20px; height: 20px; flex: none; }
.choix-personne span { display: flex; flex-direction: column; min-width: 0; }
.choix-personne small { color: var(--texte-doux); }
.choix-personne.erreur label { border-color: var(--erreur); }
.liste-ajout { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; }
.liste-ajout form { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--bordure); }
.liste-ajout span { display: flex; flex-direction: column; min-width: 0; }
.liste-ajout small { color: var(--texte-doux); }
/* Sept onglets de projet sur un téléphone étroit : libellés resserrés. */
@media (max-width: 430px) {
  .onglet { font-size: .64rem; letter-spacing: -.01em; min-width: 0; }
  .onglet span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Cases en pastilles (compétences, jours de la semaine) */
.choix-pastilles { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.choix-pastilles legend { width: 100%; margin-bottom: 4px; font-weight: 600; }
.choix-pastilles label { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--bordure); border-radius: 999px; background: var(--surface); cursor: pointer; }
.choix-pastilles label:has(input:checked) { border-color: var(--accent); background: var(--info-fond); }
.choix-pastilles input { width: 18px; height: 18px; }

/* Planning : suppression d'une ligne sans l'ouvrir */
.avec-suppression { display: flex; gap: 6px; align-items: stretch; }
.avec-suppression > a { flex: 1; min-width: 0; }
.avec-suppression form { display: flex; }
.supprimer-rapide { align-self: center; min-width: 40px; color: var(--erreur); }
.supprimer-rapide.a-confirmer { font-size: .8rem; max-width: 140px; white-space: normal; }

/* Réglages des compétences */
.ligne-competence { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--bordure); }
.ligne-competence.masque input[type=text] { color: var(--texte-doux); text-decoration: line-through; }
.ligne-competence small { color: var(--texte-doux); white-space: nowrap; }
@media (max-width: 600px) { .ligne-competence { grid-template-columns: 1fr 1fr; } }

/* Jobs : chiffres budget / planifié / reste */
.chiffres-job { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--bordure); }
.chiffres-job div { display: flex; flex-direction: column; }
.chiffres-job small { color: var(--texte-doux); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.chiffres-job span { color: var(--texte-doux); font-size: .85rem; }
.chiffres-job .negatif strong, .chiffres-job .negatif span { color: var(--erreur); }

/* Planning : compléter une ligne sur place */
.avec-suppression { flex-wrap: wrap; }
.completer { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0 0 6px 6px; }
.completer select { flex: 1 1 160px; min-height: 36px; }
.completer input { width: 86px; min-height: 36px; padding: 4px 8px; }
.ajout-off { display: flex; gap: 8px; align-items: center; margin-top: -4px; }
.ajout-off input { max-width: 200px; }
button.lien { background: none; border: 0; padding: 0; color: var(--lien); text-decoration: underline; cursor: pointer; font: inherit; }

/* Bascule de profil (site d'essai) */
.bandeau-env { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }
.bascule-profil { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.bascule-profil select { min-height: 26px; padding: 0 6px; font-size: .75rem; }
.choix-personne label[hidden] { display: none; }

/* 2a.0005 — en-tête : cloche (alertes) et profil */
.entete-cloche { position: relative; }
.entete-cloche .compteur {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--erreur-vif); color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center;
}
.entete-profil { padding: 0; width: 44px; border-radius: 50%; }
.groupe-alertes h2 { display: flex; align-items: center; gap: 8px; }
.groupe-alertes .compteur { font-size: .8rem; font-weight: 700; color: var(--erreur); }

/* Barre du bas : l'icône de copie suit l'adresse */
.barre-bas-ref { flex: 0 1 auto; }
.barre-bas-copier {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--bordure); border-radius: 8px; background: transparent; color: var(--texte-doux); cursor: pointer;
}
.barre-bas-copier .icone { width: 16px; height: 16px; }
.barre-bas-copier:hover { color: var(--texte); border-color: var(--texte-doux); }

/* Catalogue : catégories repliées, recherche */
details.categorie-catalogue > summary { cursor: pointer; display: flex; align-items: baseline; gap: 8px; list-style: none; }
details.categorie-catalogue > summary::-webkit-details-marker { display: none; }
details.categorie-catalogue { align-self: stretch; width: 100%; box-sizing: border-box; }
details.categorie-catalogue > summary small { color: var(--texte-doux); }
details.categorie-catalogue[open] > summary { margin-bottom: 10px; }
.ligne-competence[hidden] { display: none; }

/* Fiche job : poste en deux temps, nouveau poste */
details.nouveau-poste > summary { cursor: pointer; color: var(--lien); font-size: .9rem; }
details.nouveau-poste[open] > summary { margin-bottom: 8px; }
select option[hidden], select optgroup[hidden] { display: none; }

/* Semaine du planning : une seule carte par ligne */
.carte-ligne .titre-select {
  flex: 0 1 auto; width: auto; min-width: 0; max-width: 100%; min-height: 36px; padding: 2px 28px 2px 6px; margin-left: -6px;
  font-weight: 600; font-size: 1rem; border: 1px solid transparent; background-color: transparent; border-radius: 8px;
}
.carte-ligne .titre-select:hover, .carte-ligne .titre-select:focus { border-color: var(--bordure); background-color: var(--surface); }
.carte-ligne .depense-bas a { color: inherit; text-decoration: none; }
.carte-ligne .depense-bas a:hover { text-decoration: underline; }
.horaire-ligne { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; color: var(--texte-doux); font-size: .9rem; }
.horaire-ligne input { width: 74px; min-height: 34px; padding: 4px 8px; }
.horaire-ligne .duree { flex: 1; }
.carte-ligne.modifiee { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.depense.en-double { border-color: var(--erreur); box-shadow: inset 4px 0 0 var(--erreur); }
.enregistrer-tout {
  position: sticky; top: calc(var(--haut-entete, 56px) + 8px); z-index: 15; display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 8px 12px; border: 1px solid var(--accent); border-radius: var(--rayon); background: var(--surface);
}
.enregistrer-tout span { flex: 1; color: var(--texte-doux); }
.bandeau.pres-de-ligne { flex-basis: 100%; margin-top: 6px; font-weight: 600; }
.surlignee > .depense, .surlignee > form.depense { outline: 2px solid var(--accent); outline-offset: 2px; }
.surlignee.avec-suppression:has(.pres-de-ligne.bandeau-erreur) > .depense { outline-color: var(--erreur); }

/* Jours off : aperçu en clair */
.apercu-off { margin: -4px 0 0; font-size: .9rem; color: var(--texte-doux); }
.apercu-off.erreur { color: var(--erreur); font-weight: 600; }
.avec-suppression > form.carte-ligne { flex: 1; min-width: 0; flex-direction: column; }
.carte-ligne .depense-haut { align-items: center; }

/* 2a.0006 — listes filtrables (data-combo, choix des personnes) */
.combo { position: relative; }
.combo-saisie { width: 100%; }
.combo-liste {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; max-height: 320px; overflow-y: auto;
  margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--bordure); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.combo-liste li[role=option] { display: flex; flex-direction: column; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.combo-liste li[role=option] small { color: var(--texte-doux); font-size: .8rem; }
.combo-liste li[role=option] small:empty { display: none; }
.combo-liste li.actif, .combo-liste li[role=option]:hover { background: var(--info-fond); }
.combo-groupe { padding: 8px 10px 3px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-doux); }
.combo-vide { padding: 8px 10px; color: var(--texte-doux); font-size: .9rem; }
.choix-personne > .combo { margin-top: 6px; }
.choix-personne input.combo-saisie { width: 100%; height: auto; flex: 1; }
.choix-personne > .note { margin: 2px 0; }

/* Semaine : prix, commentaires, bouton d'ouverture */
.prix-ligne span, .notes-ligne span { color: var(--texte-doux); font-size: .85rem; }
.prix-ligne, .notes-ligne { grid-column: 1 / -1; }
.notes-ligne { flex-direction: column; align-items: flex-start; gap: 2px; }
.boutons-ligne { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.boutons-ligne form { display: flex; }
.ouvrir-ligne { min-width: 40px; display: inline-flex; align-items: center; justify-content: center; }
.ouvrir-ligne .icone { width: 16px; height: 16px; }

/* Catalogue en lecture : un poste par ligne, « Modifier » au bout */
.ligne-competence { grid-template-columns: 1fr auto auto auto; }
.ligne-competence.masque strong { color: var(--texte-doux); text-decoration: line-through; }
@media (max-width: 600px) { .ligne-competence { grid-template-columns: 1fr auto; } }
details.categorie-catalogue > summary .bouton { margin-left: auto; }

/* Fiche projet : accès réglés sur place */
#acces .ligne-acces { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
#acces .ligne-acces > div { flex: 1; min-width: 180px; }
#acces .ligne-acces select { width: auto; }
#acces .ligne-acces .champ { flex: 1; min-width: 220px; margin: 0; }
.titre-validation { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--bordure); }

/* Barre du bas : projets et pages récents */
.barre-bas-recents { margin-left: auto; display: flex; gap: 6px; flex: none; }
details.recents { position: relative; }
details.recents > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; cursor: pointer;
  border: 1px solid var(--bordure); border-radius: 8px; color: var(--texte-doux); font-size: .8rem; white-space: nowrap;
}
details.recents > summary::-webkit-details-marker { display: none; }
details.recents > summary .icone { width: 16px; height: 16px; }
details.recents[open] > summary, details.recents > summary:hover { color: var(--texte); border-color: var(--texte-doux); }
.recents-menu {
  position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 40; width: min(340px, calc(100vw - 24px)); max-height: 60vh; overflow-y: auto;
  padding: 8px; background: var(--surface); border: 1px solid var(--bordure); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.recents-menu > p:first-child { margin: 2px 6px 6px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-doux); }
.recents-menu ul { list-style: none; margin: 0; padding: 0; }
.recents-menu a { display: block; padding: 7px 8px; border-radius: 7px; color: var(--texte); text-decoration: none; font-size: .9rem; white-space: normal; }
.recents-menu a:hover { background: var(--info-fond); }
@media (max-width: 600px) { details.recents > summary span { display: none; } }

/* 2a.0009 — budget figé (version 1) */
.budget-fige h2 { margin-top: 0; }
.tableau-defilant { overflow-x: auto; }
.tableau-budget-fige { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .9rem; }
.tableau-budget-fige th, .tableau-budget-fige td { padding: 6px 8px; border-bottom: 1px solid var(--bordure); text-align: right; white-space: nowrap; }
.tableau-budget-fige th[scope=row], .tableau-budget-fige thead th:first-child { text-align: left; white-space: normal; }
.tableau-budget-fige thead th { color: var(--texte-doux); font-weight: 600; font-size: .8rem; }
.tableau-budget-fige tfoot th, .tableau-budget-fige tfoot td { font-weight: 700; border-bottom: 0; }
.tableau-budget-fige td.ecart { color: var(--alerte); font-weight: 600; }

/* 2a.0010 — budget : colonnes coût et client */
.budget-lignes.avec-client .budget-ligne { grid-template-columns: 1fr 9.5em 9.5em; }
.budget-ligne.entete-colonnes { padding: 0 0 4px; font-size: .75rem; font-weight: 600; color: var(--texte-doux); text-align: right; }
.pb-tete strong small { display: block; font-size: .78rem; font-weight: 400; color: var(--texte-doux); }
@media (max-width: 600px) { .budget-lignes.avec-client .budget-ligne { grid-template-columns: 1fr 1fr; } .budget-lignes.avec-client .budget-ligne > label { grid-column: 1 / -1; } }

/* 2a.0011 — budget : colonnes alignées, vente / achat / résultat */
.budget-lignes.avec-client .budget-ligne { grid-template-columns: 1fr 11em 11em; }
.budget-ligne .avec-unite .montant-lecture { flex: 1; text-align: right; font-weight: 700; padding: 0 13px; }
.budget-ligne.entete-colonnes span { padding-right: 22px; }
.tableau-budget-fige td.positif { color: var(--ok); font-weight: 600; }
.tableau-budget-fige td small { font-weight: 400; color: var(--texte-doux); }
.tableau-budget-fige tr.depasse th, .tableau-budget-fige tr.depasse td { color: var(--erreur); }

/* 2a.0012 — calculateur de marge */
.ligne-marge { display: grid; grid-template-columns: 1fr 7em 1fr auto; gap: 10px; align-items: start; }
.ligne-marge > .bouton-marge { margin-top: 1.75em; }
.bouton-marge { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 0; }
.bouton-marge .icone { width: 18px; height: 18px; }
input[data-marge-taux] { text-align: right; }
input[data-marge-taux].erreur { border-color: var(--erreur); }
.budget-lignes.avec-client .budget-ligne { grid-template-columns: 1fr 10em 6.5em 10em 40px; }
.marge-lecture { text-align: right; padding-right: 26px; color: var(--texte-doux); font-weight: 600; }
@media (max-width: 600px) {
  .ligne-marge { grid-template-columns: 1fr 1fr; }
  .ligne-marge > .bouton-marge { margin-top: 0; }
  .budget-lignes.avec-client .budget-ligne { grid-template-columns: 1fr 1fr; }
}

/* Relecture de 2a.0013 (2a.0014) */
/* Les colonnes sont en em : la taille du texte se règle sur les cellules, pas sur la rangée, pour garder les mêmes largeurs. */
.budget-ligne.entete-colonnes { font-size: inherit; }
.budget-ligne.entete-colonnes span { font-size: .75rem; padding-right: 22px; }
.barre-budget { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.barre-budget .bouton-ligne { flex: 1 1 50%; min-height: 44px; }
.bascule-usage { flex-direction: row; gap: 0; }
.bascule-usage button { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 0; background: none; font: inherit; font-size: .88rem; font-weight: 600; color: var(--texte-doux); cursor: pointer; }
.bascule-usage button + button { border-left: 1px solid var(--bordure); }
.bascule-usage button.actif { background: var(--accent); color: var(--accent-texte); }
.menu-parametres { position: relative; }
.menu-parametres summary { list-style: none; cursor: pointer; }
.menu-parametres summary::-webkit-details-marker { display: none; }
.menu-parametres summary::after { content: ' ▾'; }
.menu-parametres > div { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; display: flex; flex-direction: column; min-width: 240px; padding: 6px; background: var(--surface); border: 1px solid var(--bordure); border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.menu-parametres a { padding: 10px; border-radius: 6px; color: inherit; text-decoration: none; }
.menu-parametres a:hover { background: var(--fond); }
.retour-page { margin: 0 0 10px; }
.liste-cases { display: flex; flex-direction: column; gap: 6px; }
.barre-liste { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.synthese-colonne { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (min-width: 760px) { .synthese-colonne { gap: 16px; } }
.acces-fiche { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--bordure); }
.acces-fiche h3 { margin: 0 0 4px; font-size: 1rem; }
.client-ligne { display: flex; gap: 8px; align-items: flex-start; }
.client-ligne > :first-child { flex: 1; min-width: 0; }
.client-ligne .combo { flex: 1; min-width: 0; }
.client-ligne .bouton { flex: none; }
.nouveau-client { margin: 10px 0 0; padding: 12px; border: 1px solid var(--bordure); border-radius: 10px; display: flex; flex-direction: column; gap: 12px; }
.nouveau-client legend { font-weight: 600; padding: 0 6px; }
.tva-recherche { display: flex; gap: 8px; align-items: flex-end; }
.tva-recherche .champ { flex: 1; min-width: 0; }
table.chiffres-job { display: table; width: 100%; border-collapse: collapse; margin-top: 8px; border-top: 1px solid var(--bordure); font-variant-numeric: tabular-nums; }
table.chiffres-job th, table.chiffres-job td { padding: 4px 8px 4px 0; text-align: right; font-size: .9rem; font-weight: 400; }
table.chiffres-job thead th { color: var(--texte-doux); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
table.chiffres-job tbody th { text-align: left; color: var(--texte-doux); }
table.chiffres-job tbody td { font-weight: 600; }
table.chiffres-job .quantites td, table.chiffres-job .quantites th { color: var(--texte-doux); font-size: .82rem; font-weight: 400; }
table.chiffres-job td.negatif { color: var(--erreur); }
.calendrier { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; margin-top: 4px; }
.cal-mois { flex: 1 1 240px; max-width: 320px; }
.cal-mois strong { display: block; margin-bottom: 4px; text-transform: capitalize; text-align: center; }
.cal-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-entete { text-align: center; font-size: .72rem; color: var(--texte-doux); }
.cal-jour { aspect-ratio: 1; min-height: 30px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: none; font: inherit; font-size: .85rem; color: inherit; cursor: pointer; }
.cal-jour:hover { border-color: var(--bordure); }
.cal-jour.aujourdhui { border: 2px solid var(--accent); border-radius: 50%; font-weight: 700; }
.cal-jour.dans-projet, .calendrier-legende .repere { background: var(--info-fond); }
.cal-jour.choisi { background: var(--accent); color: var(--accent-texte); font-weight: 600; }
.calendrier-legende .repere { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; border: 1px solid var(--bordure); }
.competences-choisies { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.groupe-competences strong { display: block; font-size: .8rem; color: var(--texte-doux); font-weight: 600; margin-bottom: 2px; }
.groupe-competences > div { display: flex; flex-wrap: wrap; gap: 6px; }
.puce-competence { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border: 1px solid var(--bordure); border-radius: 999px; background: var(--info-fond); font-size: .9rem; }
.puce-competence button { min-width: 24px; min-height: 24px; padding: 0; border: 0; background: none; cursor: pointer; font-size: 1rem; color: var(--texte-doux); text-decoration: none; }
.formulaire.form-budget > .carte { max-width: none; }
.depense > table.chiffres-job { grid-column: 1 / -1; }
.tableau-projets td:not(.nombre) { white-space: normal; }

/* Essais de 2a.0014 (2a.0015) */
.tuiles-cinq { grid-template-columns: 1fr 1fr; }
@media (min-width: 760px) { .tuiles.tuiles-cinq { grid-template-columns: repeat(5, 1fr); } }
.booking-collant { position: sticky; top: var(--haut-collant, 80px); z-index: 9; display: flex; flex-direction: column; gap: 6px; margin: -6px 0 0; padding: 6px 0; background: var(--fond); }
.booking-haut { display: flex; align-items: center; gap: 8px; }
.booking-haut .sous-onglets { flex: 1; margin: 0; min-width: 0; }
.booking-haut .bouton { flex: none; }
.booking-collant .nav-semaine { margin: 0; }
.booking-collant ~ .enregistrer-tout { top: calc(var(--haut-collant, 80px) + 112px); }
[id^="affectation-"] { scroll-margin-top: 260px; }
.liste-jobs { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.carte-job { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); }
.carte-job.a-voir { box-shadow: inset 4px 0 0 var(--alerte-vif); }
.carte-job summary { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; list-style: none; }
.carte-job summary::-webkit-details-marker { display: none; }
.carte-job summary::before { content: '▸'; color: var(--texte-doux); }
.carte-job[open] summary::before { content: '▾'; }
.job-titre { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.job-titre small { color: var(--texte-doux); }
.job-detail { padding: 0 12px 10px; }
.job-detail .note { margin: 0 0 4px; }
.carte.reinitialiser { margin-top: 12px; align-items: center; justify-content: space-between; flex-direction: row; flex-wrap: wrap; }
.barre-liste .bouton.principal { margin-right: auto; }

/* Extranet Amplo : titre de semaine, liste des versions, calendrier (2b). */
.tete-semaine { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.tete-semaine h2 { margin: 0; font-size: 1.15rem; }
.tete-semaine h2 small { display: block; font-size: .8rem; font-weight: 400; color: var(--texte-doux); }
.choix-versions { position: relative; margin-left: auto; }
.choix-versions > summary { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 10px; border: 1px solid var(--bordure); border-radius: 8px; background: var(--surface); font-weight: 600; }
.choix-versions[open] > summary { margin-bottom: 0; }
.choix-versions ul { position: absolute; right: 0; z-index: 20; min-width: 300px; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--bordure); border-radius: 8px; box-shadow: 0 4px 14px rgba(0, 0, 0, .14); }
.choix-versions li a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; border-radius: 6px; color: var(--texte); text-decoration: none; }
.choix-versions li a:hover, .choix-versions li a[aria-current] { background: var(--fond); }
.choix-versions li small { display: block; font-size: .75rem; color: var(--texte-doux); }
.calendrier-semaines tbody tr { cursor: pointer; }
.calendrier-semaines tbody tr:hover { background: var(--fond); }
.calendrier-semaines .semaine-courante { font-weight: 700; background: var(--fond); box-shadow: inset 3px 0 0 var(--accent); }
.calendrier-semaines .hors-mois { color: var(--texte-doux); opacity: .55; }
.tableau-liste tr.annulee td { text-decoration: line-through; color: var(--texte-doux); }

/* Défiger depuis la carte : la ligne, la personne ou le job (2b). */
.menu-defiger { position: relative; }
.menu-defiger > summary { min-height: 0; }
.menu-defiger[open] > summary { margin-bottom: 0; }
.menu-defiger > form { position: absolute; right: 0; z-index: 12; flex-direction: column; flex-wrap: nowrap; width: max-content; max-width: 340px; margin-top: 4px; padding: 6px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.menu-defiger > form .bouton { text-align: left; }

/* Correction en lot des lignes du planning */
.lot-filtres { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0; font-size: .9rem; color: var(--texte-doux); }
.lot-filtres label { display: flex; align-items: center; gap: 6px; }
.lot-filtres select { width: auto; min-height: 34px; padding: 2px 28px 2px 8px; }
.lot-portee { display: inline-flex; border: 1px solid var(--bordure); border-radius: 999px; overflow: hidden; background: var(--surface); }
.lot-portee a { padding: 6px 14px; color: var(--texte); text-decoration: none; font-weight: 500; }
.lot-portee a.actif { background: var(--accent); color: var(--accent-texte); }
.lot-barre {
  position: sticky; top: calc(var(--haut-collant, 80px) + 112px); z-index: 8; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 10px;
  padding: 8px 12px; border: 1px solid var(--accent); border-radius: var(--rayon); background: var(--surface);
}
.lot-case-tout { display: flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.lot-resume { flex: 1 1 200px; min-width: 0; font-size: .9rem; color: var(--texte-doux); }
.lot-resume strong { color: var(--texte); }
.lot-barre .bouton:disabled { opacity: .5; cursor: not-allowed; }
.lot-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 14px; }
.lot-champ { margin: 0; }
.lot-champ label { display: flex; align-items: center; gap: 6px; }
.lot-case { font-weight: 500; }
.lot-champ select:has(option:checked:not([value=""])), .lot-actif input[type="text"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.lot-horaire { grid-column: span 2; }
.lot-horaire-champs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--texte-doux); font-size: .9rem; }
.lot-horaire-champs input { flex: 0 1 74px; width: 74px; min-width: 0; }
.lot-jour h2.section { display: flex; align-items: baseline; gap: 8px; }
.lot-jour h2.section label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.lot-jour h2.section small { font-weight: 400; color: var(--texte-doux); }
.lot-table td.lot-coche { width: 28px; padding-right: 0; }
.lot-table label { cursor: pointer; }
.lot-table .lot-notes { white-space: normal; font-size: .82rem; color: var(--texte-doux); }
.lot-table tr.annulee td:not(:last-child) { color: var(--texte-doux); text-decoration: line-through; }
.lot-table tr.lot-refusee td { border-bottom: 0; background: var(--erreur-fond); }
.lot-table tr.lot-motif td { padding-top: 0; white-space: normal; font-weight: 600; color: var(--erreur); background: var(--erreur-fond); }
.lot-actions { margin-top: 12px; }
@media (max-width: 560px) { .lot-horaire { grid-column: auto; } }

/* Impression d'une demande de prix ou d'un bon : le document, rien d'autre. */
@media print {
  body:has(.bon-doc) header, body:has(.bon-doc) .menu, body:has(.bon-doc) .onglets, body:has(.bon-doc) .barre-bas, body:has(.bon-doc) .bandeau-env, body:has(.bon-doc) .bandeau,
  body:has(.bon-doc) .rangee-boutons, body:has(.bon-doc) form, body:has(.bon-doc) .booking-collant, body:has(.bon-doc) .section { display: none !important; }
  body:has(.bon-doc) .carte { border: 0; box-shadow: none; padding: 0; }
  body:has(.bon-doc) summary, body:has(.bon-doc) .entete-document { display: none !important; }
  body:has(.bon-doc) .versions-anciennes { border: 0; padding: 0; margin: 0; }
  body.impression-unique details.version-bon:not([data-a-imprimer]) { display: none !important; }
  body.impression-unique main > .carte:has(.bon-doc) { display: none !important; }
}
/* Le bouton Infosheet au bout d'une mission (PA, G11). */
.depense-bas .pastilles:has(.bouton) { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
/* Sous-menu du menu Travailleurs (PA, H8). */
/* Fiche du projet : les cadres côte à côte sur ordinateur (PA, H9). */
.fiche-colonnes, .fiche-colonne { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 900px) {
  .fiche-colonnes { flex-direction: row; align-items: flex-start; gap: 16px; }
  .fiche-colonne { flex: 1 1 0; min-width: 0; gap: 16px; }
}
/* Un document et ses versions (PA, G5, G6). */
.version-bon > summary { align-items: center; }
.version-bon > summary > span { flex: 1 1 auto; min-width: 0; }
.version-bon > summary::after { margin-left: 4px; }
.versions-anciennes { margin: 6px 0 12px 14px; padding-left: 12px; border-left: 2px solid var(--bordure); }
.versions-anciennes > summary { color: var(--lien); font-size: .9rem; }
.versions-anciennes > .carte { margin-top: 8px; }
.versions-anciennes .depense { margin-top: 6px; }
.entete-document { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.entete-document h2 { margin: 0; }
.refus-bon { margin-top: 14px; }
/* Infosheet (PA, G11). */
/* Infosheet (lifting, lot 2) : le projet en grand, tes jours, puis les contacts. */
.infosheet-tete { padding: 18px 0 22px; margin-bottom: 6px; border-bottom: 1px solid var(--bordure); }
.infosheet-type { margin: 0 0 6px; font-size: .85rem; color: var(--texte-doux); }
.coque .infosheet-tete h2, .infosheet-tete h2 { margin: 0 0 6px; font-family: var(--titre); font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; line-height: 1.15; letter-spacing: -.01em; color: var(--accent); }
.infosheet-tete p { margin: 0; color: var(--texte-doux); }
.infosheet-tete .infosheet-periode { margin-top: 10px; color: var(--texte); font-weight: 600; }
.infosheet-jours { list-style: none; margin: 0 0 8px; padding: 0; border-top: 1px solid var(--bordure); }
.infosheet-jours > li { display: grid; grid-template-columns: minmax(150px, 210px) 1fr; gap: 4px 16px; align-items: start; padding: 12px 2px; border-bottom: 1px solid var(--bordure); }
.infosheet-date { font-weight: 600; }
.infosheet-jobs { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.infosheet-job { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.infosheet-quoi { display: flex; flex-direction: column; min-width: 0; }
.infosheet-quoi small { color: var(--texte-doux); overflow-wrap: anywhere; }
.infosheet-passes { margin: 4px 0 8px; }
.infosheet-passes > summary { cursor: pointer; padding: 10px 2px; color: var(--texte-doux); font-weight: 600; }
.infosheet-passes .infosheet-jours { color: var(--texte-doux); }
@media (max-width: 640px) {
  .infosheet-jours > li { grid-template-columns: 1fr; }
}
.contact-role { display: block; color: var(--texte-doux); font-size: .78rem; font-weight: 600; }
.contacts-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 8px; }
.contact-fiche { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--bordure); border-radius: 10px; font-size: .92rem; overflow-wrap: anywhere; }

/* ---------- Calendriers (étape 2d) ---------- */
.cal { margin: 0 0 12px; border: 1px solid var(--bordure); border-radius: var(--rayon); overflow: hidden; background: var(--surface); }
.cal-tete { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--bordure); }
.cal-tete div { padding: 6px 4px; font-size: .75rem; font-weight: 600; color: var(--texte-doux); text-align: center; text-transform: uppercase; letter-spacing: .03em; }
.cal-semaine { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-height: 84px; row-gap: 2px; }
.cal-semaine + .cal-semaine { border-top: 1px solid var(--bordure); }
.cal-case { border-left: 1px solid var(--bordure); }
.cal-semaine > .cal-case:first-child { border-left: 0; }
.cal-case.hors-mois { background: var(--fond); }
.cal-case.periode { background: var(--info-fond); }
.cal-case.indispo { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--alerte-fond) 6px 12px); }
.cal-case.cal-alerte { box-shadow: inset 0 0 0 2px var(--erreur-vif); border-radius: 4px; }
.cal-num { position: relative; z-index: 1; justify-self: start; margin: 4px 6px 0; font-size: .8rem; font-weight: 600; color: var(--texte-doux); text-decoration: none; }
a.cal-num { color: var(--lien); text-decoration: underline; }
.cal-case.aujourdhui { border-top: 3px solid var(--accent); }
.cal-contenu { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 2px 5px 6px; min-width: 0; }
.cal-chiffre { font-size: .85rem; font-weight: 600; }
.cal-puce { display: block; max-width: 100%; padding: 1px 6px; border-radius: 6px; font-size: .72rem; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; border: 1px solid transparent; }
.cal-puce small { display: block; font-size: .68rem; opacity: .85; }
.cal-confirme { background: var(--accent); color: var(--accent-texte); }
.cal-prebook { background: var(--surface); color: var(--accent); border-color: var(--accent); border-style: dashed; }
.cal-annule { background: var(--fond); color: var(--texte-doux); text-decoration: line-through; }
.cal-ailleurs { background: var(--fond); color: var(--texte-doux); border-color: var(--bordure); }
.cal-vide { background: var(--alerte-fond); color: var(--alerte); border-color: var(--alerte-vif); }
.cal-mention { font-size: .7rem; font-weight: 600; color: var(--alerte); }
.cal-barre { position: relative; z-index: 1; margin: 0 3px; padding: 1px 6px; border-radius: 5px; font-size: .72rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.cal-barre a { color: inherit; text-decoration: none; }
.barre-0 { background: #2f6690; } .barre-1 { background: #7a4f9a; } .barre-2 { background: #2f7d6d; }
.barre-3 { background: #9a5a2f; } .barre-4 { background: #3d5a80; } .barre-5 { background: #8a3d5c; }
.cal-barre.barre-close { opacity: .55; }
.cal-legende { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 14px; padding: 0; list-style: none; font-size: .8rem; color: var(--texte-doux); }
.cal-legende li { display: flex; align-items: center; gap: 6px; }
.cal-legende .echantillon { display: inline-block; width: 18px; height: 12px; border-radius: 3px; border: 1px solid var(--bordure); }
.cal-legende .echantillon.cal-alerte { border: 2px solid var(--erreur-vif); }
.cal-legende .echantillon.periode { background: var(--info-fond); }
.cal-legende .echantillon.indispo { background: repeating-linear-gradient(135deg, transparent 0 3px, var(--alerte-fond) 3px 6px); }
.cal-filtres { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 0 0 12px; }
.cal-filtres label { display: flex; flex-direction: column; gap: 2px; font-size: .78rem; color: var(--texte-doux); }
.cal-filtres select { min-height: 38px; max-width: 16rem; }
.agenda-bloc { display: flex; flex-direction: column; gap: 10px; }
.agenda-bloc p { margin: 0; }
.copie-ligne { display: flex; gap: 6px; }
.copie-ligne input { flex: 1; min-width: 0; font-size: .82rem; }
.aide-details summary { cursor: pointer; font-weight: 600; }
.aide-details ol { margin: 6px 0 0; padding-left: 20px; }
.agenda-bloc .boutons { display: flex; flex-wrap: wrap; gap: 8px; }
details.carte > summary { cursor: pointer; }
.liste-cal { list-style: none; padding-left: 0; }
.liste-cal li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 3px 0; }
.liste-cal li form { margin: 0; }
@media (max-width: 600px) {
  .cal-semaine { min-height: 64px; }
  .cal-puce { font-size: .62rem; padding: 0 3px; }
  .cal-puce small { display: none; }
  .cal-barre { font-size: .62rem; padding: 0 3px; }
}
nav.bascule-vue { align-self: flex-start; width: max-content; margin: 0 0 12px; }
/* Essais de 2d.0001 : case entière cliquable, cloche, phases, filtres à recherche. */
a.cal-case.cal-lien { display: block; text-decoration: none; cursor: pointer; }
a.cal-case.cal-lien:hover { background-color: var(--info-fond); }
a.cal-case.cal-lien.periode:hover { filter: brightness(.96); }
.cal-num-lien { color: var(--lien); }
.cal-cloche { position: relative; z-index: 1; justify-self: end; margin: 3px 5px 0 0; color: var(--erreur); }
.cal-cloche .icone, .cal-cloche-legende .icone { width: 16px; height: 16px; }
.cal-cloche-legende { color: var(--erreur); display: inline-flex; }
.carte h2 .icone { width: 18px; height: 18px; vertical-align: -3px; color: var(--erreur); }
.cal-phase { font-size: .68rem; font-weight: 600; color: var(--lien); }
.filtre-recherche input[type="search"] { min-height: 38px; min-width: 14rem; }
.carte-alerte { border-color: var(--erreur-vif); }
.jour-planning { scroll-margin-top: 285px; }
.bloc-annulation textarea { min-height: 6rem; }
/* Essais de 2d.0002 : raccourcis de l'espace, retirer un jour, phases de la fiche. */
.raccourcis-cal { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.raccourcis-cal .icone { width: 16px; height: 16px; margin-right: 4px; vertical-align: -3px; }
.retirer-jour { display: inline-flex; gap: 6px; align-items: center; }
.retirer-jour input[type="date"] { min-height: 34px; }
.tableau-phases input { width: 100%; min-height: 38px; box-sizing: border-box; }
.tableau-phases th[scope="row"] { font-weight: 600; text-align: left; }
.choix-ligne { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-weight: 400; }
/* Essais de 2d.0003 : cloches pleines, carte des indisponibilités en deux temps. */
.cal-cloche .icone, .cal-cloche-legende .icone, .carte h2 .icone { fill: var(--erreur-vif); stroke: var(--erreur); }
.separateur { border: 0; border-top: 1px solid var(--bordure); margin: 16px 0 8px; }
.sous-titre-carte { margin: 8px 0 6px; font-size: .95rem; }

/* ---------- Étape 2e : le téléphone ---------- */
/* Appeler et Mail, partout où une personne a un numéro ou une adresse (PA, E5). */
.contact-boutons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.contact-boutons .bouton { gap: 6px; max-width: 100%; }
.contact-boutons .icone { width: 16px; height: 16px; flex: none; }
.contact-adresse { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* Calendrier général : les filtres dans un panneau, à côté du mois (PA, E4). */
.filtres-choix .cal-filtres { flex-direction: column; align-items: stretch; margin: 0; }
.filtres-choix .cal-filtres select { max-width: none; }
.filtres-panneau .compte { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-left: 6px; border-radius: 10px; background: var(--accent); color: var(--accent-texte); font-size: .75rem; }
.filtres-panneau[open] .compte { background: var(--accent-texte); color: var(--accent); }
/* « Indisponible » ne déborde plus sur la case voisine. */
.cal-mention { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Éléments propres au téléphone, cachés sur ordinateur. */
.profil-menu, .onglet-plus, .seulement-telephone, .onglets.onglets-booking { display: none; }

@media (max-width: 759px) {
  /* Haut de page : Accueil et le nom du projet ; Réglages et version sous le profil (PA, E3, E6). */
  .entete { gap: 6px; }
  .entete-action, .entete-retour { min-width: 42px; min-height: 42px; }
  .fil li + li::before { padding: 0 2px; }
  .fil li:not(:first-child):not(.fil-ici) { display: none; }
  .entete-plus { padding: 0; width: 44px; font-size: 1.5rem; font-weight: 500; }
  .entete-plus span { display: none; }
  .profil-menu { display: block; position: relative; flex: none; }
  .profil-menu > summary { list-style: none; cursor: pointer; }
  .profil-menu > summary::-webkit-details-marker { display: none; }
  .entete .profil-menu > summary::after, .onglets .onglet-plus > summary::after, .onglets .onglet-plus[open] > summary::after, .entete .profil-menu[open] > summary::after { content: none; }
  .profil-panneau {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 230px;
    display: flex; flex-direction: column; padding: 6px; color: var(--texte);
    background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  }
  .profil-panneau strong { padding: 8px 12px 4px; }
  .profil-panneau a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--texte); }
  .profil-panneau .icone { width: 20px; height: 20px; }
  .profil-version { margin-top: 4px; padding: 8px 12px 4px; border-top: 1px solid var(--bordure); font-size: .8rem; color: var(--texte-doux); }

  /* Menu : un bouton qui ouvre toute la liste (PA, E1). */

  /* Onglets du projet : Booking, Dépenses, Ajouter au centre, Synthèse, Plus (PA, E2). */
  .onglet-second { display: none; }
  .onglet { font-size: .72rem; letter-spacing: 0; }
  .onglet-plus { display: flex; position: static; }
  .onglet-plus > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; height: 100%; }
  .onglet-plus > summary::-webkit-details-marker { display: none; }
  .onglet-plus[open] > summary { color: var(--lien); }
  .onglets-plus {
    position: fixed; right: 8px; bottom: calc(var(--haut-onglets) + env(safe-area-inset-bottom) + 8px); z-index: 31; min-width: 210px;
    display: flex; flex-direction: column; padding: 6px;
    background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  }
  .onglets-plus a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 8px; font-size: .95rem; color: var(--texte); text-decoration: none; }
  .onglets-plus a.actif { color: var(--lien); }
  .onglets-plus .icone { width: 22px; height: 22px; }
  .onglet-ajout .icone { width: 54px; height: 54px; padding: 13px; margin-top: -20px; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }

  /* Barre de version, derniers projets et dernières pages : pas au téléphone (PA, E6). */
  .barre-bas { display: none; }
  body { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  body.avec-onglets { padding-bottom: calc(var(--haut-onglets) + env(safe-area-inset-bottom) + 20px); }

  /* Sous-onglets : une rangée qui défile ; En lot reste sur ordinateur et iPad (PA, E7). */
  .sous-onglets { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .sous-onglets::-webkit-scrollbar { display: none; }
  .sous-onglets a { flex: none; padding: 8px 12px; }
  .seulement-ordi { display: none !important; }
  /* Booking : sa propre barre du bas, à la place des onglets du projet (PA, F6 de 2e.0001). */
  body:has(.onglets-booking) .onglets:not(.onglets-booking) { display: none; }
  .onglets.onglets-booking { display: flex; }
  .booking-haut { display: none; }
  .onglet-remonter { color: var(--texte); }
  /* Accueil et listes : les cartes seulement, sans le choix Cartes ou Tableau (PA, F14 et H2). */
  .bascule-vue, .barre-liste:has(> .bascule-vue:only-child) { display: none; }
  /* Tableaux de budget de la synthèse : une carte par poste, chaque montant avec son libellé (PA, F7). */
  .tableau-budget-fige thead { display: none; }
  .tableau-budget-fige, .tableau-budget-fige tbody, .tableau-budget-fige tfoot, .tableau-budget-fige tr { display: block; }
  .tableau-budget-fige tr { margin-bottom: 8px; padding: 8px 12px; border: 1px solid var(--bordure); border-radius: 10px; background: var(--surface); }
  .tableau-budget-fige tfoot tr { background: var(--fond); }
  .tableau-budget-fige th[scope=row] { display: block; padding: 0 0 4px; border: 0; text-align: left; font-weight: 700; }
  .tableau-budget-fige td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; white-space: normal; }
  .tableau-budget-fige td::before { content: attr(data-libelle); color: var(--texte-doux); font-weight: 400; text-align: left; }
  .tableau-budget-fige td:empty { display: none; }
  .seulement-telephone { display: block; }
}

/* ---------- Étape 3a : devis ---------- */
.devis-tete { display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; }
.devis-tete > div { display: flex; flex-direction: column; min-width: 0; }
.devis-tete small { color: var(--texte-doux); }
.titre-section { margin: 18px 0 8px; font-size: 1.1rem; }
/* Les cadres du devis prennent toute la largeur, comme son cadre du haut (PA, E2, E9). */
.devis-form .carte, .devis-doc-carte { max-width: none; }
.devis-entete-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; align-items: start; }
.devis-entete-grille h2 { margin-top: 0; }
.devis-jusqu { margin: 0 0 6px; }
.info-bulle { display: inline-block; position: relative; font-size: .9rem; font-weight: 400; vertical-align: middle; }
.info-bulle > summary { list-style: none; cursor: pointer; color: var(--lien); padding: 0 4px; }
.info-bulle > summary::-webkit-details-marker { display: none; }
.info-bulle > p { position: absolute; z-index: 20; left: 0; top: 1.6em; width: min(300px, 80vw); margin: 0; padding: 10px 12px; background: var(--surface); border: 1px solid var(--bordure); border-radius: 8px; box-shadow: var(--ombre); font-size: .85rem; color: var(--texte); }
.devis-table { width: 100%; border-collapse: collapse; }
.devis-table th { text-align: left; font-size: .8rem; font-weight: 600; color: var(--texte-doux); padding: 6px; border-bottom: 1px solid var(--bordure); }
.devis-table td { padding: 6px; border-bottom: 1px solid var(--bordure); vertical-align: top; }
.devis-table .nombre { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.devis-table input[type=text], .devis-table textarea { width: 100%; box-sizing: border-box; margin-top: 4px; font-size: .88rem; border: 1px solid transparent; background: transparent; padding: 3px 6px; border-radius: 6px; resize: vertical; }
.devis-table input[type=text]:hover, .devis-table textarea:hover, .devis-table input[type=text]:focus, .devis-table textarea:focus { border-color: var(--bordure); background: var(--surface); }
.devis-bloc-tete td { background: var(--fond); padding-top: 10px; }
.devis-poignee { width: 22px; cursor: grab; color: var(--texte-doux); user-select: none; touch-action: none; font-size: 1.1rem; line-height: 1.6; text-align: center; }
.en-deplacement { opacity: .6; outline: 2px dashed var(--lien); }
.devis-desc { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.devis-desc small { color: var(--texte-doux); font-size: .78rem; }
.devis-crayon .icone { width: 16px; height: 16px; }
.devis-remise { display: inline-flex; gap: 4px; align-items: center; }
.devis-remise input { width: 80px; text-align: right; }
.devis-remise select { width: auto; }
.devis-table .devis-remise input { margin-top: 0; border-color: var(--bordure); background: var(--surface); }
.devis-remise-col { width: 150px; }
.devis-simplifie .devis-detaille-seul { display: none; }
.devis-remises-cat { margin-top: 12px; }
.devis-remises-cat > summary { cursor: pointer; font-weight: 600; }
.devis-remises-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 6px 16px; margin-top: 8px; }
.devis-remise-ligne { display: flex; align-items: center; gap: 8px; }
.devis-remise-ligne > span:first-child { flex: 1; }
.devis-pied { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.devis-remise-globale { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.devis-totaux { display: grid; grid-template-columns: auto auto; justify-content: end; gap: 4px 24px; margin: 0; }
.devis-totaux dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.devis-echeances { display: flex; flex-direction: column; gap: 6px; }
.devis-echeance { display: grid; grid-template-columns: minmax(0, 1fr) 100px 64px 150px 110px auto; gap: 6px; align-items: center; }
.devis-echeance input, .devis-echeance select { width: 100%; box-sizing: border-box; min-width: 0; }
.devis-echeance.erreur { background: var(--erreur-fond); }
.devis-montant { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.devis-ajout { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.rangee-boutons.collant { position: sticky; bottom: calc(var(--haut-onglets) + env(safe-area-inset-bottom) + 8px); z-index: 5; background: var(--fond); padding: 8px 0; }
@media (max-width: 759px) {
  .devis-table thead { display: none; }
  .devis-table, .devis-table tbody, .devis-table tr, .devis-table td { display: block; width: auto; }
  .devis-table tr { display: grid; grid-template-columns: 22px 24px 1fr auto; gap: 4px 8px; padding: 8px 0; border-bottom: 1px solid var(--bordure); }
  .devis-table td { border: 0; padding: 0; }
  .devis-table tr > td:nth-child(3) { grid-column: 3 / 5; }
  .devis-table tr > td:nth-child(4), .devis-table tr > td:nth-child(5) { display: none; }
  .devis-table tr > td:nth-child(6) { grid-column: 3; text-align: left; font-weight: 600; }
  .devis-table tr > td:nth-child(7) { grid-column: 4; }
  .devis-remises-grille { grid-template-columns: 1fr; }
  .devis-echeance { grid-template-columns: 1fr 1fr; padding: 6px 0; border-bottom: 1px solid var(--bordure); }
  .devis-echeance > input:first-child { grid-column: 1 / -1; }
  .rangee-boutons.collant { position: static; }
}
/* 0004 : lignes reprises ou non, remise par ligne, fenêtre d'ajout, versions (PA, tour 5). */
.devis-case-col, .devis-case { width: 24px; text-align: center; }
.devis-case input { width: auto; margin: 4px 0 0; }
.devis-exclu td:not(.devis-case):not(.devis-poignee) { opacity: .45; }
.devis-exclu .devis-desc { text-decoration: line-through; }
.devis-remise-montant { display: block; text-align: right; font-size: .78rem; color: var(--texte-doux); min-height: 1em; }
.devis-ajout-bouton { margin: 12px 0 0; }
.devis-fenetre { box-sizing: border-box; width: min(640px, 94vw); max-width: 94vw; max-height: 88dvh; overflow: auto; margin: auto; border: 0; border-radius: var(--rayon); background: var(--surface); color: var(--texte); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); padding: 18px; }
.devis-fenetre::backdrop { background: rgba(10, 18, 24, .55); }
.devis-fenetre h2 { margin-top: 0; }
.devis-versions { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.devis-versions li { padding: 6px 10px; border-left: 3px solid var(--lien); }
.devis-versions li.devis-version-passee { border-left-color: var(--bordure); color: var(--texte-doux); }
/* 0005 : sous-total par poste, liste des devis, fenêtre de création, iPhone (PA, tour 6). */
.devis-bloc-pied td { font-size: .88rem; color: var(--texte-doux); padding-top: 4px; }
.devis-bloc-pied td .nombre, .devis-bloc-pied strong { color: var(--texte); }
.devis-liste td:nth-child(2) { white-space: normal; }
.devis-liste tbody + tbody tr:first-child td { border-top: 2px solid var(--bordure); }
.devis-liste tr.devis-version-passee td { color: var(--texte-doux); }
.choix-liste { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 10px; }
.choix-liste label { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--bordure); border-radius: 8px; cursor: pointer; }
.choix-liste input { width: auto; margin-top: 3px; }
.champ-vise { outline: 3px solid var(--lien); outline-offset: 4px; border-radius: 6px; }
@media (max-width: 759px) {
  /* 16 px : sous cette taille, l'iPhone zoome au toucher d'un champ et la page se décale (PA, I9). */
  .devis-form input, .devis-form select, .devis-form textarea, .devis-fenetre input, .devis-fenetre select { font-size: 16px !important; }
  .devis-remise input { width: 72px; }
  .devis-table tr.devis-bloc-pied > td:nth-child(1), .devis-table tr.devis-bloc-pied > td:nth-child(2), .devis-table tr.devis-bloc-pied > td:nth-child(7) { display: none; }
  .devis-table tr.devis-bloc-pied > td:nth-child(3) { grid-column: 1 / 4; }
  .devis-table tr.devis-bloc-pied > td:nth-child(6) { grid-column: 4; }
  .devis-fenetre { padding: 14px; }
  /* La bulle ⓘ reste dans l'écran : elle prend la largeur du cadre Validité (PA, I9). */
  .devis-validite { position: relative; }
  .devis-validite .info-bulle { position: static; }
  .devis-validite .info-bulle > p { left: 0; right: 0; width: auto; }
}
/* 0006 : version 1 et budget d'aujourd'hui côte à côte (PA, L1 de 3a). */
.tableau-v1-aujourdhui small.ecart-v1 { display: block; font-size: .75rem; color: var(--alerte); font-weight: 600; }
.tableau-v1-aujourdhui tr.nouveau-v1 th small { color: var(--alerte); font-weight: 400; }
.tableau-v1-aujourdhui td:nth-child(even) { color: var(--texte-doux); }
.tableau-v1-aujourdhui .valeur-v1 { display: inline-block; text-align: right; }

/* Étape 3b : acceptation des devis (page du client et cartes de la version). */
.devis-accord { max-width: 900px; margin: 0 auto; }
.case-accord { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 14px; font-size: 16px; line-height: 1.4; cursor: pointer; }
.case-accord input { width: 22px; height: 22px; margin-top: 1px; flex: none; }
.case-accord.en-erreur span { color: var(--erreur, #b42318); }
.devis-refus summary { cursor: pointer; font-weight: 600; }
.devis-refus form { margin-top: 12px; }
.carte-accord { border-left: 4px solid var(--paye); }
/* Étape 3b : une couleur par état de devis (PA, G5 et G8 du tour 3). */
.pastille-devis-brouillon { border-style: dashed; font-style: italic; }
.pastille-devis-a_valider, .pastille-devis-valide { color: var(--facture); border-color: var(--facture); }
.pastille-devis-envoye { color: var(--lien); border-color: var(--lien); }
.pastille-devis-expire { color: var(--alerte); border-color: var(--alerte); background: var(--alerte-fond); }
.pastille-devis-accepte { color: var(--ok); border-color: var(--ok); background: var(--ok-fond); }
.pastille-devis-refuse { color: var(--erreur); border-color: var(--erreur); background: var(--erreur-fond); }
.pastille-devis-remplace { text-decoration: line-through; }
.pastille-devis-annule { color: var(--surface); border-color: var(--texte-doux); background: var(--texte-doux); }
/* La ligne entière s'ouvre : le numéro n'a plus l'air d'un lien (PA, I5 du tour 4). */
.devis-liste td a { color: inherit; text-decoration: none; font-weight: 600; }
.sous-onglets a small { font-weight: 700; opacity: .75; margin-left: 2px; }
/* Étape 3b, 0007 : catalogue bilingue. */
.table-traductions { display: grid; gap: 6px; }
.ligne-traduction { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; }
.ligne-traduction.masque span { color: var(--texte-doux); }
.ligne-traduction.propose input { background: var(--alerte-fond); border-color: var(--alerte); }
.ligne-traduction.manque input { border-color: var(--erreur); }
@media (max-width: 760px) { .ligne-traduction { grid-template-columns: 1fr; gap: 2px; margin-bottom: 6px; } .ligne-traduction input { font-size: 16px; } }
/* Étape 3b : fiche de facturation, à recopier dans Falco. */
.fiche-copie .fiche-ligne { display: contents; }
.fiche-copie dd { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.fiche-valeur { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fiche-copier { flex: none; padding: 2px 10px; font-size: 13px; }
.fiche-lignes td.libelle .fiche-copier { margin-left: 6px; }
.fiche-deduction td { color: var(--gris, #555); }
.fiche-totaux { margin: 14px 0 0 auto; min-width: 280px; border-collapse: collapse; }
.fiche-totaux td { padding: 5px 8px; border-bottom: 1px solid var(--trait, #ddd); }
.liste-echeances-devis { padding-left: 18px; }
.liste-echeances-devis li { margin: 6px 0; }
@media print { .fiche-copier { display: none !important; } }

/* ---------- Étape catalogue : produits hors personnel ---------- */
.defaut-invisible { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ligne-produit { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.5fr) auto; }
.ligne-produit > strong small { display: block; font-weight: normal; color: var(--texte-doux); }
.ligne-produit > small { white-space: normal; }
.ligne-produit .a-traduire { color: #9a5b00; }
.groupe-produits { margin-top: 10px; }
.groupe-produits h3 { font-size: 1rem; margin: 8px 0 2px; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.groupe-produits h3 small { font-weight: normal; color: var(--texte-doux); }
.choix-produit { border: 1px dashed var(--bordure); border-radius: 8px; padding: 10px; margin-bottom: 12px; }
.choix-produit .cherche-produit { margin-bottom: 6px; }
.choix-produit select { width: 100%; }
.ajout-catalogue { margin-top: 8px; }
.champ-anglais { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.champ-anglais .champ { flex: 1 1 260px; margin: 0; }
.choix-mode { border: 0; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 16px; }
.choix-mode legend { font-weight: 600; margin-bottom: 4px; }
.lb-titre .lb-produit { display: inline-block; margin-left: 6px; font-size: .75rem; padding: 0 6px; border-radius: 9px; background: var(--fond); color: var(--texte-doux); }
.ligne-reprise { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--bordure); align-items: center; }
.ligne-reprise > small, .ligne-reprise > label:last-child { grid-column: 2; }
.reprise-champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.reprise-champs > input[type=text] { grid-column: span 2; }
.reprise-champs .avec-unite input { min-width: 0; width: 100%; }
@media (max-width: 760px) {
  .reprise-champs { grid-template-columns: 1fr 1fr; }
  .reprise-champs > input[type=text] { grid-column: 1 / -1; }
  .ligne-reprise { grid-template-columns: 1fr; }
  .ligne-reprise > small, .ligne-reprise > label:last-child { grid-column: 1; }
  .ligne-produit { grid-template-columns: 1fr auto; }
  .ligne-produit > small { grid-column: 1 / -1; }
}

.resultats-produit { list-style: none; margin: 0 0 8px; padding: 0; border: 1px solid var(--bordure); border-radius: 8px; max-height: 320px; overflow-y: auto; background: var(--surface); }
.resultats-produit li + li { border-top: 1px solid var(--bordure); }
.resultats-produit button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; font: inherit; color: inherit; cursor: pointer; min-height: 44px; }
.resultats-produit button:hover, .resultats-produit button:focus-visible { background: var(--fond); }
.resultats-produit small { display: block; color: var(--texte-doux); }
.resultats-produit .aucun { padding: 10px 12px; color: var(--texte-doux); }

/* Refus en plein écran (PA, RQ1 du tour 3 du catalogue) : fermé d'un clic dessus ou à côté. */
.fenetre-alerte { width: min(560px, calc(100% - 32px)); max-width: none; max-height: calc(100% - 32px); padding: 0; border: 0; border-radius: 14px; background: var(--surface); color: var(--texte); box-shadow: 0 12px 40px rgba(0, 0, 0, .35); cursor: pointer; }
.fenetre-alerte::backdrop { background: rgba(0, 0, 0, .55); }
.fenetre-alerte-corps { padding: 24px; border-top: 6px solid var(--erreur, #c0392b); }
.fenetre-alerte h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 1.2rem; }
.fenetre-alerte h2 .icone { width: 24px; height: 24px; color: var(--erreur, #c0392b); }
.fenetre-alerte p { margin: 0 0 12px; line-height: 1.5; }
.fenetre-alerte .note { margin: 0; }
@media (max-width: 760px) { .fenetre-alerte { width: 100%; height: 100%; max-height: none; border-radius: 0; } .fenetre-alerte-corps { min-height: 100%; padding: 32px 20px; } }

/* Téléphone (PA, T15 du tour 3 du catalogue) : barre d'actions du bas, mode lecture ou édition,
   Simple ou Complet visible dans le budget, Paramètres dans l'écran. */
.barre-actions { display: none; }
@media (max-width: 759px) {
  .barre-actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
    height: calc(var(--haut-onglets, 64px) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--bordure);
  }
  .barre-action {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0;
    padding: 0 4px; border: 0; background: none; font: inherit; font-size: .72rem; color: var(--texte); text-decoration: none; cursor: pointer;
  }
  .barre-action span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .barre-action .icone { width: 24px; height: 24px; }
  .barre-action[aria-pressed="true"] { color: var(--lien); font-weight: 600; }
  body.avec-barre-actions { padding-bottom: calc(var(--haut-onglets, 64px) + env(safe-area-inset-bottom) + 20px); }
  body.avec-mode-edition:not(.mode-edition) .edition-seulement { display: none !important; }
  .barre-budget .bascule-usage { display: flex; }
  /* Paramètres s'ouvre sous son bouton (PA, U5 du tour 4), aligné à gauche ou à droite selon la place (app.js). */
  .menu-parametres > div { left: 0; right: auto; max-width: calc(100vw - 24px); }
  .menu-parametres.a-droite > div { left: auto; right: 0; }
  .menu-parametres a { min-height: 44px; display: flex; align-items: center; }
}

/* + central d'une page hors projet (accueil : une dépense) et choix du projet (PA, Q2 du tour 4). */
.plus-flottant { display: none; }
.choix-projet-depense { display: grid; gap: 10px; }
.choix-projet-depense .lien-carte { display: flex; flex-direction: column; gap: 2px; margin: 0; }
@media (max-width: 759px) {
  .plus-flottant {
    position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
    display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; color: var(--texte); text-decoration: none;
  }
  .plus-flottant .icone { width: 54px; height: 54px; padding: 13px; border-radius: 50%; background: var(--accent); color: var(--accent-texte); box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
  .plus-flottant span { padding: 1px 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--bordure); font-weight: 600; }
  body:has(.plus-flottant) { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
}

/* Tour 5 (cat.2026.0006) : au téléphone, le + Ligne est dans la barre du bas ; en haut du budget
   restent Simple/Complet et Paramètres (PA, V4 du tour 5). */
@media (max-width: 759px) {
  body.avec-onglets .barre-budget .bouton-ligne { display: none; }
}

/* Étape cloche : nouvelles, croix, réglages des alertes. */
.liste-nouvelles li.nouvelle { display: flex; align-items: flex-start; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--bordure); }
.liste-nouvelles li.nouvelle:last-child { border-bottom: 0; padding-bottom: 0; }
.nouvelle-texte { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.nouvelle-texte .aide { display: block; margin-top: 2px; }
.nouvelle.non-lue .nouvelle-texte > a, .nouvelle.non-lue .nouvelle-texte { font-weight: 600; }
.nouvelle.non-lue .nouvelle-texte .aide { font-weight: 400; }
.nouvelle-croix { margin: 0; }
.bouton-croix { width: 36px; height: 36px; border: 1px solid var(--bordure); border-radius: 50%; background: var(--surface); color: var(--texte-doux); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.bouton-croix:hover, .bouton-croix:focus-visible { color: var(--erreur); border-color: var(--erreur); }
.tableau-alertes td { white-space: normal; }
.tableau-alertes td + td, .tableau-alertes th + th { text-align: center; width: 70px; }
.tableau-alertes input[type=checkbox] { width: 22px; height: 22px; }

/* Cloche, tour 2 : point rouge sur ce qui mène à une chose à faire (PA, Z1). */
.point-alerte { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--erreur-vif, #d93025); margin-left: 5px; vertical-align: top; flex: none; }
.onglet { position: relative; }
.onglet .point-alerte { position: absolute; top: 4px; right: calc(50% - 18px); margin: 0; }
@media (min-width: 760px) {
  .onglet .point-alerte { position: static; margin-left: 2px; align-self: flex-start; }
}

/* ==========================================================================
   Lifting graphique (lf.2026, PA tours 1 et 2) : piste B « feuille de service ».
   En-tête blanc avec le logo :02 en couleur, menu en colonne pétrole à gauche sur
   ordinateur (réduit à ses icônes sur un écran moyen, ouvert par le bouton Menu au
   téléphone), barre du bas pétrole au téléphone, rien ne défile de gauche à droite.
   ========================================================================== */

body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
h1, h2, h3 { color: var(--texte); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.aller-contenu { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--accent); color: var(--accent-texte); font-weight: 700; }
.aller-contenu:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--lien); outline-offset: 2px; }

/* Point REC qui clignote (charte : allumé 0,96 s, atténué 0,64 s, cycle 1,6 s ; PA, S1 du tour 1). */
@keyframes sst-rec { 0%, 59.9% { opacity: 1; } 60%, 100% { opacity: .15; } }
.rec { animation: sst-rec 1.6s infinite; }
@media (prefers-reduced-motion: reduce) { .rec { animation: none; } }

/* ---------- En-tête ---------- */
.coque .entete {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px;
  min-height: var(--haut-tete); padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top));
  background: var(--surface); color: var(--texte); border-bottom: 1px solid var(--bordure);
}
.coque .entete a { color: inherit; text-decoration: none; }
.entete-logo { display: flex; align-items: center; flex: none; width: calc(var(--large-rail) - 16px); }
.entete-logo .logo-02 { width: 140px; height: auto; display: block; }
.entete-symbole { display: none; flex: none; }
.entete-symbole .logo-carre { width: 34px; height: 34px; display: block; border-radius: 3px; }
.coque .entete-retour { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; border-radius: 10px; color: var(--accent); }
.coque .entete-retour:hover { background: var(--accent-pale); }
.coque .entete-titre { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 0; text-align: left; }
.coque .entete-titre h1 { font-family: var(--titre); font-weight: 700; font-size: 1.2rem; line-height: 1.2; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--texte); }
.titre-telephone { display: none; }
.coque .fil ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0; }
.coque .fil li { display: flex; align-items: center; min-width: 0; }
.coque .fil li + li::before { content: "›"; padding: 0 6px; color: var(--texte-doux); opacity: 1; }
.coque .fil a, .coque .fil span { display: inline; min-height: 0; padding: 0; border-radius: 0; background: none; font-size: .8rem; font-weight: 600; color: var(--texte-doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28ch; }
.coque .fil a:hover { color: var(--accent); text-decoration: underline; }
.etiquette-env { flex: none; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--alerte-fond); color: var(--alerte); border: 1px solid currentColor; }
.entete-recherche { display: flex; align-items: center; gap: 8px; min-height: 40px; min-width: 220px; padding: 0 12px; border: 1.5px solid var(--bordure); border-radius: 10px; color: var(--texte-doux) !important; font-size: .9rem; }
.entete-recherche:hover { border-color: var(--accent); }
.entete-recherche .icone { width: 18px; height: 18px; }
.coque .entete-action { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 10px; background: var(--accent); color: var(--accent-texte) !important; font-weight: 700; font-size: .9rem; }
.coque .entete-action .icone { width: 18px; height: 18px; }
.coque .entete-action:hover { background: var(--accent-fonce); }
@media (prefers-color-scheme: dark) { .coque .entete-action:hover { background: var(--lien); } }
.entete-bouton { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 0; border-radius: 10px; background: none; color: var(--accent); cursor: pointer; font: inherit; }
.entete-bouton:hover { background: var(--accent-pale); }
.entete-bouton .icone { width: 22px; height: 22px; }
.entete-menu { display: none; }
.entete-menu .point-alerte { position: absolute; top: 7px; right: 7px; margin: 0; box-shadow: 0 0 0 2px var(--surface); }
.coque .entete .compteur { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--rec); color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.coque .profil-menu { display: block; position: relative; flex: none; }
.coque .profil-menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; min-height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-texte); font-weight: 700; }
.coque .profil-menu > summary::-webkit-details-marker { display: none; }
.coque .profil-menu > summary::after { content: none; }
.coque .profil-panneau {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 45; min-width: 250px;
  display: flex; flex-direction: column; padding: 6px; color: var(--texte);
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: 0 10px 30px rgba(15, 40, 42, .2);
}
.coque .profil-panneau strong { padding: 8px 12px 4px; }
.coque .profil-panneau a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--texte); }
.coque .profil-panneau a:hover { background: var(--accent-pale); }
.coque .profil-panneau .icone { width: 20px; height: 20px; color: var(--accent); }
.coque .profil-panneau .bascule-profil { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; margin: 4px 0; border-top: 1px solid var(--bordure); border-bottom: 1px solid var(--bordure); font-size: .85rem; }
.coque .profil-panneau .bascule-profil select { min-height: 40px; font-size: 15px; }
.coque .profil-version { display: block; margin-top: 4px; padding: 8px 12px 4px; border-top: 1px solid var(--bordure); font-size: .8rem; color: var(--texte-doux); }

/* ---------- Colonne du menu (rail) ---------- */
.rail {
  position: fixed; z-index: 35; left: 0; top: var(--haut-tete); bottom: 0; width: var(--large-rail);
  display: flex; flex-direction: column; gap: 2px; padding: 12px 10px 24px; overflow-y: auto; overscroll-behavior: contain;
  background: #0f5c63; color: #d9eaeb;
}
@media (prefers-color-scheme: dark) { .rail { background: #0a3a3f; } }
.rail-tete { display: none; }
.rail-recherche { display: none; }
.rail-parties { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rail-partie {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px;
  color: #e3f0f1; text-decoration: none; font-weight: 600; font-size: .95rem; cursor: pointer; list-style: none;
}
.rail-partie::-webkit-details-marker { display: none; }
.rail details > summary.rail-partie::after { content: ""; width: 7px; height: 7px; margin-left: auto; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); opacity: .8; }
.rail details[open] > summary.rail-partie::after { transform: rotate(-135deg) translateY(-1px); }
.rail-partie .icone { width: 22px; height: 22px; flex: none; }
.rail-partie:hover, .rail-liens a:hover { background: rgba(255, 255, 255, .1); }
.rail a.rail-partie.actif, .rail-groupe.actif > summary { background: #fff; color: #0f5c63; }
@media (prefers-color-scheme: dark) { .rail a.rail-partie.actif, .rail-groupe.actif > summary { background: #e8efef; color: #0a3a3f; } }
.rail .point-alerte { margin-left: 0; box-shadow: 0 0 0 2px #0f5c63; }
.rail-liens { list-style: none; margin: 2px 0 6px; padding: 0 0 0 22px; display: flex; flex-direction: column; }
.rail-liens a { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 8px; color: #d9eaeb; text-decoration: none; font-size: .9rem; border-left: 2px solid rgba(255, 255, 255, .18); border-radius: 0 8px 8px 0; }
.rail-liens a.actif { color: #fff; font-weight: 700; border-left-color: #fff; background: rgba(255, 255, 255, .12); }
.rail-sep { height: 1px; margin: 10px 12px; background: rgba(255, 255, 255, .2); }
.rail-voile { display: none; }

/* Colonne de contenu, à droite du rail */
.coque.avec-rail .cadre { margin-left: var(--large-rail); min-width: 0; }
.coque .contenu { max-width: 1180px; }
.coque.avec-rail .barre-bas { left: var(--large-rail); }

/* Écran moyen (iPad en portrait) : le rail se réduit à ses icônes, les liens s'ouvrent à côté. */
@media (min-width: 760px) and (max-width: 1099px) {
  :root { --large-rail: 76px; }
  .entete-logo { width: auto; margin-right: 8px; }
  .rail { padding: 10px 8px; overflow: visible; }
  .rail-partie { flex-direction: column; justify-content: center; gap: 2px; min-height: 58px; padding: 6px 2px; font-size: .68rem; text-align: center; }
  .rail-partie span:not(.point-alerte):not(.sr-only) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rail details > summary.rail-partie::after { display: none; }
  .rail .point-alerte { position: absolute; margin: 0; transform: translate(14px, -18px); }
  .rail-groupe { position: relative; }
  .rail-groupe:not([open]) .rail-liens { display: none; }
  .rail-groupe[open] .rail-liens {
    position: absolute; left: calc(100% + 10px); top: 0; z-index: 50; min-width: 250px; margin: 0; padding: 6px;
    background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: 0 10px 30px rgba(15, 40, 42, .25);
  }
  .rail-groupe[open] .rail-liens a { color: var(--texte); border-left: 0; border-radius: 8px; }
  .rail-groupe[open] .rail-liens a:hover { background: var(--accent-pale); }
  .rail-groupe[open] .rail-liens a.actif { color: var(--accent); background: var(--accent-pale); }
  .entete-recherche { min-width: 0; }
  .entete-recherche span { display: none; }
}
/* Repli choisi sur ordinateur (PA, T5 de 0001) : les mêmes règles que l'écran moyen. */
@media (min-width: 1100px) {
  body.rail-reduit { --large-rail: 76px; }
  body.rail-reduit .entete-logo { width: auto; margin-right: 8px; }
  body.rail-reduit .rail { padding: 10px 8px; overflow: visible; }
  body.rail-reduit .rail-partie { flex-direction: column; justify-content: center; gap: 2px; min-height: 58px; padding: 6px 2px; font-size: .68rem; text-align: center; }
  body.rail-reduit .rail-partie span:not(.point-alerte):not(.sr-only) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.rail-reduit .rail details > summary.rail-partie::after { display: none; }
  body.rail-reduit .rail .point-alerte { position: absolute; margin: 0; transform: translate(14px, -18px); }
  body.rail-reduit .rail-groupe { position: relative; }
  body.rail-reduit .rail-groupe:not([open]) .rail-liens { display: none; }
  body.rail-reduit .rail-groupe[open] .rail-liens {
    position: absolute; left: calc(100% + 10px); top: 0; z-index: 50; min-width: 250px; margin: 0; padding: 6px;
    background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: 0 10px 30px rgba(15, 40, 42, .25);
  }
  body.rail-reduit .rail-groupe[open] .rail-liens a { color: var(--texte); border-left: 0; border-radius: 8px; }
  body.rail-reduit .rail-groupe[open] .rail-liens a:hover { background: var(--accent-pale); }
  body.rail-reduit .rail-groupe[open] .rail-liens a.actif { color: var(--accent); background: var(--accent-pale); }
  body.rail-reduit .entete-recherche { min-width: 0; }
  body.rail-reduit .entete-recherche span { display: none; }
}

/* ---------- Onglets du projet ---------- */
@media (min-width: 760px) {
  .coque .onglets {
    position: sticky; top: var(--haut-tete); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
    height: auto; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--bordure); border-top: 0;
  }
  .coque .onglet { flex: none; flex-direction: row; gap: 7px; padding: 14px 12px 11px; font-size: .93rem; font-weight: 600; color: var(--texte-doux); border-bottom: 3px solid transparent; }
  .coque .onglet:hover { color: var(--accent); }
  .coque .onglet.actif { color: var(--accent); border-bottom-color: var(--accent); }
  .coque .onglet .icone { width: 19px; height: 19px; }
  .coque .onglet-ajout { order: 10; margin-left: auto; padding: 0; border: 0; }
  .coque .onglet-ajout .icone { width: 20px; height: 20px; padding: 0; background: none; color: inherit; }
  .coque .onglet-ajout { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 10px; background: var(--accent); color: var(--accent-texte); }
  .coque .onglet-ajout span { color: var(--accent-texte); }
  .coque .onglet-ajout:hover { background: var(--accent-fonce); color: var(--accent-texte); }
  .coque .onglet-plus { display: none; }
  .actions-projet { order: 11; position: relative; margin-left: 8px; }
  .coque .onglets:not(:has(.onglet-ajout)) .actions-projet { margin-left: auto; }
  .actions-projet > summary { margin: 0; }
  .actions-projet > summary::after { content: none; }
  .actions-projet-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px; display: flex; flex-direction: column; padding: 6px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: 0 10px 30px rgba(15, 40, 42, .2); }
  .actions-projet-menu a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--texte); text-decoration: none; }
  .actions-projet-menu a:hover { background: var(--accent-pale); }
  .actions-projet-menu .icone { width: 20px; height: 20px; color: var(--accent); }
}
.onglets-plus-titre { margin: 6px 14px 2px; font-size: .78rem; font-weight: 700; color: var(--texte-doux); }

/* Sous-parties (Booking, Ventes, Annuaire…) : des pastilles qui passent à la ligne (PA, N2 du tour 2 :
   rien ne défile de gauche à droite). */
.coque .sous-onglets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 4px; overflow: visible; }
.coque .sous-onglets a { flex: none; padding: 8px 14px; min-height: 40px; display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; font-weight: 600; border: 1.5px solid var(--bordure); border-radius: 999px; background: var(--surface); color: var(--texte); }
.coque .sous-onglets a:hover { border-color: var(--accent); }
.coque .sous-onglets a.actif { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
.coque .booking-haut { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.coque .booking-haut .sous-onglets { flex: 1 1 auto; }

/* ---------- Contenu ---------- */
.coque .carte { border-color: transparent; box-shadow: var(--ombre); }
@media (prefers-color-scheme: dark) { .coque .carte { border-color: var(--bordure); } }
.coque .carte h2, .coque .titre-section, .coque h2.section { font-family: var(--titre); font-weight: 600; letter-spacing: -.005em; }
.coque .carte h2 { font-size: 1rem; }
.coque h2.section { text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--texte-doux); }
.titre-page { margin: 4px 0 0; font-family: var(--titre); font-weight: 700; font-size: clamp(1.4rem, 3.2vw, 1.9rem); line-height: 1.1; letter-spacing: -.015em; color: var(--texte); }
.coque .titre-section { font-size: 1.1rem; margin: 8px 0 0; }
.coque .tuile strong, .coque .mini dd, .coque .chiffres dd, .coque .budget-total strong, .coque .rangee-montant { font-family: var(--titre); font-weight: 600; letter-spacing: -.01em; }
.coque .bouton { border-radius: 10px; border: 1.5px solid var(--bordure-champ); color: var(--texte); }
.coque .bouton:hover { border-color: var(--accent); color: var(--accent); }
.coque .bouton.principal { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
.coque .bouton.principal:hover { background: var(--accent-fonce); border-color: var(--accent-fonce); color: var(--accent-texte); }
@media (prefers-color-scheme: dark) { .coque .bouton.principal:hover { background: var(--lien); border-color: var(--lien); } }
.coque .bouton.danger { color: var(--erreur); border-color: var(--erreur); }
.coque input[type=text], .coque input[type=search], .coque input[type=email], .coque input[type=tel], .coque input[type=password], .coque input[type=date], .coque input[type=number], .coque select, .coque textarea { border: 1.5px solid var(--bordure-champ); }
.coque input:focus, .coque select:focus, .coque textarea:focus { outline: 3px solid var(--lien); outline-offset: 1px; border-color: var(--accent); }
.coque .point-alerte { background: var(--rec); }
.coque .barre span { background: var(--accent); }
.coque .barre.proche span { background: var(--alerte-vif); }
.coque .barre.depasse span { background: var(--rec); }

/* ---------- Accueil « Aujourd'hui » ---------- */
.accueil-grille { display: grid; gap: 12px; }
@media (min-width: 900px) { .accueil-grille { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.liste-faire, .liste-qui { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.liste-faire a, .liste-qui a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 6px 4px; border-bottom: 1px dashed var(--bordure); color: var(--texte); text-decoration: none; }
.liste-faire li:last-child a, .liste-qui li:last-child a { border-bottom: 0; }
.liste-faire a:hover, .liste-qui a:hover { color: var(--accent); }
.liste-faire .nb { font-family: var(--titre); font-weight: 700; color: var(--accent); }
.liste-faire li.en-plus { display: none; }
.liste-qui a { flex-wrap: wrap; justify-content: flex-start; gap: 2px 10px; }
.liste-qui .qui { font-weight: 600; min-width: 9em; }
.liste-qui .a-pourvoir { color: var(--erreur); }
.liste-qui .quoi { color: var(--texte-doux); font-size: .9rem; }
.accueil-qui h3 { margin: 6px 0 0; font-size: .82rem; font-weight: 700; color: var(--texte-doux); }
.lien-tout { align-self: flex-start; font-weight: 600; color: var(--lien); }
.rangees-projets { display: flex; flex-direction: column; gap: 8px; }
.rangee-projet { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre); color: var(--texte); text-decoration: none; }
@media (prefers-color-scheme: dark) { .rangee-projet { border: 1px solid var(--bordure); } }
.rangee-projet:hover { outline: 2px solid var(--accent); }
.code-projet { font-family: var(--titre); font-weight: 700; font-size: .78rem; color: #fff; background: #0f5c63; padding: 8px 9px; border-radius: 6px; white-space: nowrap; }
.rangee-texte { display: flex; flex-direction: column; min-width: 0; }
.rangee-texte strong { font-size: 1rem; }
.rangee-texte small { color: var(--texte-doux); }
.rangee-texte .signal { color: var(--alerte); font-weight: 600; }
.rangee-montant { text-align: right; font-size: 1rem; white-space: nowrap; }
.rangee-montant small { display: block; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-weight: 400; font-size: .75rem; color: var(--texte-doux); }
@media (max-width: 520px) { .rangee-projet { grid-template-columns: minmax(0, 1fr) auto; } .code-projet { display: none; } }
.prochaine-mission { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--rayon); background: #0f5c63; color: #fff; }
.prochaine-mission h2 { color: #fff; font-family: var(--titre); font-weight: 700; font-size: 1.25rem; margin: 2px 0 4px; }
.prochaine-mission p { margin: 0; color: #e3f0f1; }
.prochaine-mission .prochaine-quand { font-size: .82rem; font-weight: 600; color: #cfe3e5; }
.prochaine-mission .bouton { align-self: flex-start; margin-top: 10px; background: #fff; color: #0f5c63; border-color: #fff; }

/* ---------- Téléphone ---------- */
@media (max-width: 759px) {
  :root { --haut-tete: 56px; }
  .coque .entete { padding: 6px 8px; padding-top: calc(6px + env(safe-area-inset-top)); gap: 4px; }
  .entete-logo { display: none; }
  .entete-symbole { display: flex; padding: 3px; }
  .coque .entete-titre h1 { font-size: 1.02rem; }
  .coque .entete-titre .fil { display: none; }
  .coque .entete-titre h1.titre-ordi { display: none; }
  .titre-telephone { display: block; font-family: var(--titre); font-weight: 700; font-size: 1.02rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--texte) !important; }
  .entete-recherche { display: none; }
  .coque .entete-action { width: 42px; padding: 0; justify-content: center; }
  .coque .entete-action span { display: none; }
  .entete-menu { display: inline-flex; }
  .etiquette-env { display: none; }
  .entete-symbole { margin-right: 6px; }
  .coque .onglets .onglet-second { display: none; }
  .coque .profil-menu > summary { width: 38px; height: 38px; min-height: 38px; }

  /* Le menu s'ouvre par-dessus la page, depuis la gauche. */
  .coque.avec-rail .cadre { margin-left: 0; }
  .rail { top: 0; width: min(86vw, 330px); z-index: 60; transform: translateX(-105%); transition: transform .2s ease; padding: calc(10px + env(safe-area-inset-top)) 12px calc(24px + env(safe-area-inset-bottom)); box-shadow: 8px 0 30px rgba(0, 0, 0, .25); }
  .menu-ouvert .rail { transform: none; }
  @media (prefers-reduced-motion: reduce) { .rail { transition: none; } }
  .rail-tete { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 8px 12px; font-family: var(--titre); font-weight: 700; color: #fff; }
  .rail-fermer { width: 44px; height: 44px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
  .rail-recherche { display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 0 0 8px; padding: 0 12px; border-radius: 10px; background: #fff; color: #4b5b5d; text-decoration: none; }
  .rail-recherche .icone { width: 20px; height: 20px; color: #0f5c63; }
  .rail-partie { min-height: 50px; font-size: 1rem; }
  .menu-ouvert .rail-voile { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(10, 30, 32, .45); }
  .menu-ouvert { overflow: hidden; }
  .coque .barre-bas { display: none; }

  /* Barre du bas pétrole : projet (Synthèse, Booking, +, Dépenses, Ventes, Plus), espace du travailleur,
     actions du catalogue. */
  .coque .onglets, .coque .barre-actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; align-items: stretch;
    height: calc(var(--haut-onglets) + env(safe-area-inset-bottom)); padding: 6px 4px env(safe-area-inset-bottom);
    background: #0f5c63; border-top: 0;
  }
  @media (prefers-color-scheme: dark) { .coque .onglets, .coque .barre-actions { background: #0a3a3f; } }
  .coque .onglet, .coque .barre-action { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; margin: 0 2px; border-radius: 12px; color: #d9eaeb; font-size: .68rem; font-weight: 600; text-decoration: none; }
  .coque .onglet span, .coque .barre-action span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .coque .onglet .icone, .coque .barre-action .icone { width: 22px; height: 22px; }
  .coque .onglet.actif, .coque .onglet-plus[open] > summary, .coque .barre-action[aria-pressed="true"] { background: #fff; color: #0f5c63; }
  @media (prefers-color-scheme: dark) { .coque .onglet.actif, .coque .onglet-plus[open] > summary, .coque .barre-action[aria-pressed="true"] { background: #e8efef; color: #0a3a3f; } }
  .coque .onglet-plus { display: flex; position: static; padding: 0; background: none !important; }
  .coque .onglet-plus > summary { color: #d9eaeb; border-radius: 12px; }
  .coque .onglet-plus.actif > summary { background: rgba(255, 255, 255, .16); color: #fff; }
  .coque .onglet-ajout { background: none !important; }
  .coque .onglet-ajout .icone { width: 46px; height: 46px; padding: 11px; margin-top: 0; border-radius: 14px; background: #fff; color: #0f5c63; box-shadow: none; }
  .coque .onglet-ajout span { color: #fff; }
  .coque .onglet-ajout { justify-content: flex-end; gap: 0; }
  .coque .onglet .point-alerte { position: absolute; top: 4px; right: calc(50% - 18px); box-shadow: 0 0 0 2px #0f5c63; }
  .actions-projet { display: none; }
  .coque .onglets-plus { bottom: calc(var(--haut-onglets) + env(safe-area-inset-bottom) + 8px); }
  .coque .booking-collant { position: static; margin: 0; padding: 0; }
  .coque .plus-flottant .icone { background: #0f5c63; border-radius: 16px; }
  .coque .sous-onglets a { padding: 7px 12px; min-height: 40px; font-size: .88rem; }
  .accueil-faire .liste-faire li.en-plus { display: none; }
}
@media (max-width: 380px) {
  .coque .onglet, .coque .barre-action { font-size: .62rem; margin: 0 1px; }
}

/* Mode sombre : le logo :02 en couleur devient le négatif sur pétrole (charte) ; le symbole reste. */
@media (prefers-color-scheme: dark) {
  .coque .entete { background: #0f5c63; border-bottom-color: #0a3a3f; color: #fff; }
  .coque .entete-titre h1, .coque .titre-telephone { color: #fff !important; }
  .coque .fil a, .coque .fil span, .coque .fil li + li::before { color: #cfe3e5; }
  .entete-logo .logo-02 path { fill: #fff; }
  .entete-bouton, .coque .entete-retour { color: #fff; }
  .entete-bouton:hover, .coque .entete-retour:hover { background: rgba(255, 255, 255, .12); }
  .entete-recherche { border-color: rgba(255, 255, 255, .4); color: #e3f0f1 !important; }
  .coque .entete-action { background: #fff; color: #0f5c63 !important; }
  .coque .profil-menu > summary { background: #fff; color: #0f5c63; }
  .coque .entete .compteur { box-shadow: 0 0 0 2px #0f5c63; }
}

/* Espace du travailleur (lifting, A2) */
.a-repondre { flex-direction: row; align-items: center; gap: 12px; border: 2px solid var(--accent) !important; color: var(--texte); text-decoration: none; }
.a-repondre .point-alerte { margin: 0; width: 10px; height: 10px; }
.a-repondre span:last-child { display: flex; flex-direction: column; }
.a-repondre small { color: var(--texte-doux); }
.liste-a-venir { list-style: none; margin: 0; padding: 0; }
.liste-a-venir a { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 48px; padding: 8px 2px; border-bottom: 1px dashed var(--bordure); color: var(--texte); text-decoration: none; }
.liste-a-venir li:last-child a { border-bottom: 0; }
.liste-a-venir .periode { font-weight: 700; }
.liste-a-venir .quoi { display: flex; flex-direction: column; min-width: 0; }
.liste-a-venir .quoi small, .liste-a-venir .etat small { color: var(--texte-doux); }
.liste-a-venir .etat { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
@media (max-width: 420px) { .liste-a-venir a { grid-template-columns: minmax(0, 1fr) auto; } .liste-a-venir .periode { grid-column: 1 / -1; } }
.missions-passees > summary { align-items: center; min-height: 44px; }
.aide-page { color: var(--texte-doux); font-size: .92rem; }
.aide-page > summary { min-height: 44px; align-items: center; font-weight: 600; color: var(--lien); }

/* Retours des essais de 0001 */
.coque .contenu { max-width: none; margin: 0; }
.rail-liens a.fort { font-weight: 700; color: #fff; }
.rail-sous-titre { margin: 10px 0 2px 14px; font-size: .74rem; font-weight: 700; color: #b9d6d8; }
.rail-replier { display: flex; align-items: center; gap: 10px; min-height: 40px; margin-top: auto; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: #cfe3e5; font: inherit; font-size: .85rem; cursor: pointer; }
.rail-replier:hover { background: rgba(255, 255, 255, .1); }
.rail-replier .icone { width: 20px; height: 20px; flex: none; }
.rail-reduit .rail-replier .icone { transform: rotate(180deg); }
.rail-reduit .rail-replier span { display: none; }
@media (max-width: 1099px) { .rail-replier { display: none; } }
@media (min-width: 760px) and (max-width: 1099px) { .rail-sous-titre { color: var(--texte-doux); } .rail-groupe[open] .rail-liens a.fort { color: var(--accent); } }
body.rail-reduit .rail-sous-titre { color: var(--texte-doux); }
body.rail-reduit .rail-groupe[open] .rail-liens a.fort { color: var(--accent); }
.groupe-alertes:target { outline: 3px solid var(--accent); outline-offset: 2px; }
.groupe-alertes, .titre-section { scroll-margin-top: calc(var(--haut-tete) + 16px); }
@media (max-width: 759px) { .coque .action-doublon { display: none; } }
@media (min-width: 760px) { .coque .onglet-ajout:not(.ajout-ordi) { display: none; } }

/* Lecture d'abord au téléphone et sur iPad (lifting, PA T1 et T2 du tour 1). */
.bouton-modifier { display: none; }
body.tactile .bouton-modifier {
  position: fixed; z-index: 32; right: 14px; bottom: calc(16px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-texte); font: inherit; font-weight: 700; box-shadow: 0 6px 18px rgba(15, 40, 42, .3); cursor: pointer;
}
body.tactile .bouton-modifier[aria-pressed="true"] { background: var(--surface); color: var(--accent); border: 2px solid var(--accent); }
body.tactile .bouton-modifier .icone { width: 20px; height: 20px; }
body.tactile.avec-onglets .bouton-modifier, body.tactile.avec-barre-actions .bouton-modifier { bottom: calc(var(--haut-onglets) + env(safe-area-inset-bottom) + 12px); }
@media (min-width: 760px) { body.tactile.avec-onglets .bouton-modifier { bottom: calc(16px + env(safe-area-inset-bottom)); } }
form.en-lecture input:not([type=hidden]):not([type=checkbox]):not([type=radio]), form.en-lecture select, form.en-lecture textarea {
  border-color: transparent !important; background: transparent !important; box-shadow: none; outline: none;
  padding-left: 0; padding-right: 0; min-height: 0; color: var(--texte); font-weight: 600; resize: none;
  -webkit-appearance: none; appearance: none; pointer-events: none; text-overflow: ellipsis; opacity: 1;
}
form.en-lecture ::placeholder { color: transparent; }
form.en-lecture button, form.en-lecture .bouton.collant, form.en-lecture .fd-actions, form.en-lecture .boutons-piece,
form.en-lecture .edition-seulement, form.en-lecture .aide, form.en-lecture [data-ajout-competence] { display: none !important; }
form.en-lecture .case, form.en-lecture .segments, form.en-lecture .choix, form.en-lecture label { pointer-events: none; }
form.en-lecture .case input:not(:checked) + span { color: var(--texte-doux); }
form.en-lecture .segments input:not(:checked) + span { opacity: .45; }
form.en-lecture .avec-unite { gap: 4px; }
form.en-lecture .avec-unite input { flex: 0 1 auto; width: auto; max-width: 100%; }
body.tactile.avec-mode-edition:not(.mode-edition) .edition-seulement { display: none !important; }
/* iPad : la barre d'actions des catalogues (Modifier, + Produit…) reste en bas, à droite de la colonne. */
@media (min-width: 760px) {
  body.tactile .barre-actions { position: fixed; left: var(--large-rail); right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--bordure); }
  body.tactile .barre-action { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--bordure-champ); border-radius: 10px; background: var(--surface); color: var(--texte); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
  body.tactile .barre-action .icone { width: 20px; height: 20px; }
  body.tactile .barre-action[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
  body.tactile.avec-barre-actions .barre-bas { display: none; }
  body.tactile.avec-barre-actions { padding-bottom: 80px; }
}
form.en-lecture input::-webkit-calendar-picker-indicator { display: none; }
form.en-lecture select { background-image: none !important; }
body.lecture-abord .boutons-ligne form, body.lecture-abord .jour-planning h2 .bouton { display: none; }
/* Enregistrer reste collé en bas de l'écran sur les pages à formulaire (PA, P2 du tour 2). */
form[data-fiche] > button.bouton.principal, form[data-fiche] > .rangee-boutons:last-child, .coque .bouton.collant {
  position: sticky; z-index: 6; bottom: calc(52px + env(safe-area-inset-bottom)); box-shadow: 0 6px 18px rgba(15, 40, 42, .18);
}
form[data-fiche] > .rangee-boutons:last-child { padding: 8px; background: var(--surface); border-radius: var(--rayon); }
@media (min-width: 760px) { .coque .bouton.collant, form[data-fiche] > button.bouton.principal { width: auto; align-self: flex-start; min-width: 260px; } }
@media (max-width: 759px) {
  form[data-fiche] > button.bouton.principal, form[data-fiche] > .rangee-boutons:last-child, .coque .bouton.collant { bottom: calc(16px + env(safe-area-inset-bottom)); }
  body.avec-onglets form[data-fiche] > button.bouton.principal, body.avec-onglets .bouton.collant, body.avec-onglets form[data-fiche] > .rangee-boutons:last-child { bottom: calc(var(--haut-onglets) + env(safe-area-inset-bottom) + 10px); }
}
/* « ? » des explications (PA, P3 du tour 2). */
.bouton-aide { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-left: 8px; border: 1.5px solid var(--bordure-champ); border-radius: 50%; background: var(--surface); color: var(--accent); font: 700 .95rem/1 var(--titre); cursor: pointer; vertical-align: middle; }
.bouton-aide[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
.entete .bouton-aide { width: 32px; height: 32px; margin-left: 0; }
@media (prefers-color-scheme: dark) { .entete .bouton-aide { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); } }
.aide-repliable { border-left: 3px solid var(--accent); padding-left: 10px; }
/* Facturée ou Encaissée d'un geste (PA, P2 du tour 2). */
.echeance { display: flex; flex-direction: column; gap: 6px; }
.echeance-rapide { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.echeance > .echeance-rapide { justify-content: flex-end; padding: 0 4px 6px; }
.echeance-rapide input[type=date] { width: auto; min-height: 36px; padding: 4px 8px; font-size: 15px; }
.echeance-rapide .bouton.petit { margin: 0; }
td .echeance-rapide { margin-top: 6px; }
form.en-lecture .lien-demande { pointer-events: auto; }
.lien-demande { margin: 0 !important; }
/* Page du client (PA, E1 du tour 2) */
.entete-signature { width: auto; }
.entete-signature .logo-02 { width: 210px; }
@media (max-width: 759px) { .coque .entete-signature { display: flex; } .entete-signature .logo-02 { width: 200px; } }
.devis-accord-form { scroll-margin-top: calc(var(--haut-tete) + 16px); }
/* Demande de prix : quand, où, combien (PA, E2 du tour 2). */
.resume-demande { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 0; padding: 12px; border-radius: 10px; background: var(--accent-pale); }
.resume-demande dt { font-size: .8rem; color: var(--texte-doux); }
.resume-demande dd { margin: 0; font-weight: 700; }

/* Job : qui fait ce job (PA, N2 de la 0002, S2 de la 0003) — liste filtrable et pastilles. */
.choix-personnes-job { margin: 22px 0 6px; padding-top: 18px; border-top: 1px solid var(--bordure); }
.choix-personnes-job h2 { margin: 0 0 4px; }
.choix-personnes-job .champ { max-width: 420px; margin-top: 10px; }
.puces-personnes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.puces-personnes:empty { display: none; }
.fleche-semaine { position: relative; }
.fleche-semaine .point-alerte { position: absolute; top: -4px; right: -4px; margin: 0; }

/* Le nom de l'outil, STaSy à cédille REC (PA, tour 8 du lifting). */
.marque-outil { display: inline-block; font-family: var(--titre); font-weight: 700; letter-spacing: -.02em; line-height: 1; color: var(--accent); }
.marque-outil .cedille { position: relative; display: inline-block; }
.marque-outil .cedille i { position: absolute; left: 50%; bottom: -.3em; width: .24em; height: .24em; margin-left: -.12em; border-radius: 50%; background: var(--rec); }
.connexion-marque { text-align: center; margin: 12px auto 22px; }
.connexion-marque .marque-outil { font-size: clamp(2.4rem, 8vw, 3.2rem); }
.connexion-marque p { margin: 18px 0 0; color: var(--texte-doux); }

/* ---------- Documents : devis, demande de prix, bon de commande (lifting, lot 2) ----------
   PA : « un emballage, le logo au-dessus, de l'air ; les parties lisibles, pas empilées ; les
   conditions bien séparées des détails ». Une feuille blanche, la même dans les deux thèmes. */
.doc {
  --doc-encre: #142224; --doc-doux: #4b5b5d; --doc-filet: #d6e2e3; --doc-petrole: #0f5c63; --doc-pale: #e6f0f1;
  max-width: 820px; margin: 0 auto; padding: 40px 44px 44px; background: #fff; color: var(--doc-encre);
  border-radius: 6px; font-size: 14.5px; line-height: 1.5; color-scheme: light;
}
.devis-doc-carte .doc, .carte > .doc { box-shadow: 0 0 0 1px var(--doc-filet); }
.doc p { margin: 0; }
.doc small { display: block; color: var(--doc-doux); font-size: 12.5px; line-height: 1.4; }
.doc .nombre { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.doc-brouillon { margin: 0 0 24px !important; padding: 10px 14px; border-radius: 6px; background: #fff3d6; color: #8a5a00; text-align: center; }
.doc-logo img { display: block; width: 168px; height: auto; }
.coque .doc .doc-titre, .doc .doc-titre { margin: 44px 0 4px; font-family: var(--titre); font-size: 2rem; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; color: var(--doc-petrole); }
.doc .doc-sous { color: var(--doc-doux); font-size: 15px; }
.doc-conditions .doc-sous { margin-bottom: 4px; }
.doc-faits { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px 20px; margin: 26px 0 0; padding: 14px 0; border-top: 1px solid var(--doc-filet); border-bottom: 1px solid var(--doc-filet); }
.doc-faits div { min-width: 0; }
.doc-faits dt { font-size: 12px; color: var(--doc-doux); }
.doc-faits dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0 36px; }
.doc-partie { padding: 18px 22px 20px; border: 1px solid var(--doc-filet); border-radius: 10px; overflow-wrap: anywhere; }
.doc-partie-sst { background: var(--doc-pale); border-color: var(--doc-pale); }
.doc-partie h3 { margin: 0 0 8px; font-size: 12px; font-weight: 400; color: var(--doc-petrole); }
.doc-partie strong { font-size: 15px; }
.doc-contact { margin-top: 12px !important; }
.doc-contact span { display: block; font-size: 12px; color: var(--doc-doux); }
.doc-h { margin: 34px 0 10px; font-family: var(--titre); font-size: 1.05rem; font-weight: 600; color: var(--doc-petrole); }
.doc-table { width: 100%; border-collapse: collapse; }
.doc-table th { padding: 6px 8px; border-bottom: 2px solid var(--doc-petrole); font-size: 12.5px; font-weight: 400; color: var(--doc-doux); text-align: left; }
.doc-table td { padding: 8px; border-bottom: 1px solid var(--doc-filet); vertical-align: top; }
.doc-table th:first-child, .doc-table td:first-child { padding-left: 0; }
.doc-table th:last-child, .doc-table td:last-child { padding-right: 0; }
.doc-lignes tr.doc-bloc td { padding-top: 22px; border-bottom: 0; color: var(--doc-petrole); font-weight: 700; }
.doc-lignes tr.doc-remise td { color: var(--doc-doux); }
.doc-lignes tr.doc-retrait td:first-child { padding-left: 18px; }
.doc-lignes tr.doc-sous-total td { font-weight: 700; }
.doc-totaux { width: min(100%, 360px); margin: 18px 0 0 auto; border-collapse: collapse; }
.doc-totaux td { padding: 7px 14px; border-bottom: 1px solid var(--doc-filet); }
.doc-totaux tr.doc-gras td { font-weight: 700; }
.doc-totaux tr.doc-total td { border: 0; background: var(--doc-petrole); color: #fff; font-weight: 700; font-size: 16px; padding-top: 11px; padding-bottom: 11px; }
.doc-totaux tr.doc-total td:first-child { border-radius: 8px 0 0 8px; }
.doc-totaux tr.doc-total td:last-child { border-radius: 0 8px 8px 0; }
.doc-doux, .doc-vide { color: var(--doc-doux); }
.doc-offre { color: #8a5a00 !important; }
.doc-mission tr.doc-annulee td { color: var(--doc-doux); text-decoration: line-through; }
.doc-mission td:first-child { white-space: nowrap; }
/* Les conditions : leur propre partie, sur fond pâle, après un vrai blanc. */
.doc-conditions { margin: 48px -44px -44px; padding: 34px 44px 40px; background: #f4f8f8; border-top: 2px solid var(--doc-petrole); border-radius: 0 0 6px 6px; }
.coque .doc .doc-titre-conditions, .doc .doc-titre-conditions { margin: 0 0 2px; font-family: var(--titre); font-size: 1.35rem; font-weight: 700; color: var(--doc-petrole); }
.doc-conditions .doc-h { margin-top: 24px; font-size: .95rem; }
.doc-articles { font-size: 13px; line-height: 1.55; }
.doc-articles p + p { margin-top: 10px; }
.doc-colonnes { columns: 2 300px; column-gap: 32px; }
.doc-colonnes p { break-inside: avoid; }
.doc-cp { font-size: 14px; }
.doc-projet { margin-top: 14px !important; font-size: 12.5px; color: #8a5a00; }
@media (max-width: 680px) {
  .doc { padding: 24px 18px 28px; font-size: 14px; border-radius: 0; }
  .coque .doc .doc-titre, .doc .doc-titre { margin-top: 30px; font-size: 1.6rem; }
  .doc-parties { grid-template-columns: 1fr; gap: 12px; }
  .doc-faits { grid-template-columns: 1fr 1fr; }
  .doc-conditions { margin: 36px -18px -28px; padding: 26px 18px 30px; }
  .doc-table td, .doc-table th { padding: 7px 5px; }
  .doc .nombre { white-space: normal; }
  /* Sans défilement de côté : la quantité et le prix unitaire passent sous la description. */
  .doc-lignes:not(.doc-simple) thead { display: none; }
  .doc-lignes:not(.doc-simple) tr { display: grid; grid-template-columns: auto auto 1fr auto; column-gap: 8px; border-bottom: 1px solid var(--doc-filet); padding: 8px 0; }
  .doc-lignes:not(.doc-simple) td { border: 0; padding: 0 !important; }
  .doc-lignes:not(.doc-simple) td:first-child { grid-column: 1 / 4; grid-row: 1; }
  .doc-lignes:not(.doc-simple) td:last-child { grid-column: 4; grid-row: 1; }
  .doc-lignes:not(.doc-simple) td:nth-child(2):not(:last-child), .doc-lignes:not(.doc-simple) td:nth-child(3):not(:last-child) { grid-row: 2; font-size: 12.5px; color: var(--doc-doux); text-align: left; }
  .doc-lignes:not(.doc-simple) td:nth-child(2):not(:last-child) { grid-column: 1; }
  .doc-lignes:not(.doc-simple) td:nth-child(2):not(:last-child)::after { content: " ×"; }
  .doc-lignes:not(.doc-simple) td:nth-child(3):not(:last-child) { grid-column: 2; }
  .doc-lignes:not(.doc-simple) tr.doc-bloc td { grid-column: 1 / -1; }
  .doc-lignes tr.doc-bloc { padding-top: 18px; border-bottom: 0; }
  .doc-mission thead { display: none; }
  .doc-mission tr { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--doc-filet); }
  .doc-mission td { border: 0; padding: 0 !important; }
  .doc-mission td:nth-child(1) { grid-row: 1 / 4; font-weight: 600; }
  .doc-echeances tr { display: grid; grid-template-columns: 1fr auto; padding: 8px 0; border-bottom: 1px solid var(--doc-filet); }
  .doc-echeances td { border: 0; padding: 0 !important; }
  .doc-echeances td:first-child { grid-column: 1 / -1; }
}
@media print {
  .doc { max-width: none; padding: 0; box-shadow: none !important; font-size: 12px; }
  .doc-conditions { margin: 32px 0 0; padding: 20px 0 0; background: none; break-before: page; }
  .doc-totaux tr.doc-total td { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .doc-partie-sst { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* Page d'accord du client (lifting, lot 2) : un mot d'accueil, l'essentiel, les deux gestes ; le devis
   en feuille ; l'accord ; le contact. */
.devis-accord { max-width: 900px; }
.accord-intro { padding: 36px 4px 28px; }
.accord-bonjour { margin: 0 0 6px; font-size: 1.05rem; color: var(--texte-doux); }
.coque .accord-titre, .accord-titre { margin: 0; font-family: var(--titre); font-size: clamp(1.45rem, 3.4vw, 2.1rem); font-weight: 700; line-height: 1.15; letter-spacing: -.01em; color: var(--accent); }
.accord-texte { max-width: 62ch; margin: 14px 0 0; font-size: 1.02rem; line-height: 1.55; }
.accord-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 24px; margin: 26px 0 0; padding: 16px 0; border-top: 1px solid var(--bordure); border-bottom: 1px solid var(--bordure); }
.accord-chiffres dt { font-size: .82rem; color: var(--texte-doux); }
.accord-chiffres dd { margin: 2px 0 0; font-weight: 700; font-size: 1.12rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.accord-boutons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.accord-feuille { margin: 8px 0 28px; }
.accord-feuille .doc { box-shadow: 0 0 0 1px var(--bordure), 0 6px 24px rgba(15, 92, 99, .08); }
.coque .accord-form-titre, .accord-form-titre { font-size: 1.3rem; margin: 0 0 4px; }
.devis-accord-form .note { margin: 0 0 14px; }
.accord-contact { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px 24px; margin: 22px 0 40px; padding: 18px 22px; border-radius: var(--rayon); background: var(--accent-pale); }
.accord-contact p { margin: 2px 0 0; color: var(--texte-doux); }
.accord-contact-qui { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.accord-contact-qui > span:first-child { font-weight: 600; }
@media (max-width: 680px) {
  .accord-intro { padding: 22px 2px 18px; }
  .accord-chiffres { grid-template-columns: 1fr 1fr; }
  .accord-boutons .bouton { flex: 1 1 100%; justify-content: center; }
  .accord-feuille { margin-left: -12px; margin-right: -12px; }
}

/* Tour du téléphone et de l'iPad (lifting) : rien ne dépasse sur le côté, et aucun champ ne fait
   zoomer l'iPhone (moins de 16 px). */
.lb-montant small { white-space: normal; }
@media (max-width: 600px) {
  .budget-lignes.avec-client .budget-ligne, .ligne-marge { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .budget-ligne > *, .ligne-marge > * { min-width: 0; }
  .depense-bas { flex-wrap: wrap; }
  .depense-bas .pastilles:has(.bouton) { flex-shrink: 1; flex-wrap: wrap; }
  .tableau-phases, .tableau-phases tbody { display: block; }
  .tableau-phases thead { display: none; }
  .tableau-phases tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--bordure); }
  .tableau-phases th, .tableau-phases td { display: block; padding: 0; border: 0; min-width: 0; }
  .tableau-phases tr > :first-child { grid-column: 1 / -1; }
  .tableau-phases td:nth-child(2)::before, .tableau-phases td:nth-child(3)::before { display: block; font-size: .8rem; color: var(--texte-doux); }
  .tableau-phases td:nth-child(2)::before { content: 'Du'; }
  .tableau-phases td:nth-child(3)::before { content: 'Au'; }
}
@media (max-width: 759px) {
  #bascule, #lien-agenda { font-size: 16px; }
}
.mini { grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5em), 1fr)); }
.mini > div { min-width: 0; }
@media (min-width: 760px) and (max-width: 1099px) { .tuiles.tuiles-cinq { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
@media (min-width: 1100px) { .tuiles.tuiles-cinq { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
/* Booking en lecture au téléphone : une ligne sans horaire ne montre pas « – pause » vide ; la pastille
   « Horaire à compléter » le dit déjà. */
.lecture-abord .horaire-ligne:has(input[name=debut]:placeholder-shown):has(input[name=fin]:placeholder-shown) { display: none; }
/* Budget Simple au téléphone (lifting, tour 10, essai E1) : le nom du poste sur sa ligne, puis coût,
   marge et vente côte à côte, chacun avec son libellé ; le bouton de calcul monte à droite du nom. */
@media (max-width: 600px) {
  .budget-lignes.avec-client .entete-colonnes { display: none; }
  .budget-lignes.avec-client .budget-ligne { grid-template-columns: minmax(0, 1fr) minmax(0, 4.8em) minmax(0, 1fr); gap: 6px 8px; }
  .budget-lignes.avec-client .budget-ligne > label { grid-column: 1 / 3; }
  .budget-lignes.avec-client .budget-ligne > .bouton-marge { grid-row: 1; grid-column: 3; justify-self: end; }
  .budget-lignes.avec-client .budget-ligne > span:last-child:empty { display: none; }
  .budget-lignes.avec-client .budget-ligne > :nth-child(n+2):nth-child(-n+4) { display: flex; flex-wrap: wrap; align-items: center; column-gap: 4px; padding: 0; text-align: left; }
  .budget-lignes.avec-client .budget-ligne > :nth-child(n+2):nth-child(-n+4)::before { flex: 0 0 100%; font-size: .78rem; font-weight: 400; color: var(--texte-doux); }
  .budget-lignes.avec-client .budget-ligne > :nth-child(2)::before { content: 'Coût'; }
  .budget-lignes.avec-client .budget-ligne > :nth-child(3)::before { content: 'Marge'; }
  .budget-lignes.avec-client .budget-ligne > :nth-child(4)::before { content: 'Vente'; }
  .budget-lignes.avec-client .budget-ligne > label { grid-row: 1; }
  .budget-lignes.avec-client .budget-ligne > :nth-child(2) { grid-row: 2; grid-column: 1; }
  .budget-lignes.avec-client .budget-ligne > :nth-child(3) { grid-row: 2; grid-column: 2; }
  .budget-lignes.avec-client .budget-ligne > :nth-child(4) { grid-row: 2; grid-column: 3; }
  .budget-lignes.avec-client .budget-ligne .montant-lecture { white-space: nowrap; }
  form.en-lecture .budget-lignes.avec-client .budget-ligne .avec-unite input { padding-left: 0; padding-right: 0; text-align: left; }
  form.en-lecture .budget-lignes.avec-client .budget-ligne .avec-unite input { flex: 0 1 auto; width: auto; }
  form.en-lecture .budget-lignes.avec-client .budget-ligne .avec-unite { justify-content: flex-start; }
  form.en-lecture .budget-lignes.avec-client .budget-ligne .avec-unite:has(input:placeholder-shown) > span { visibility: hidden; }
  .budget-lignes.avec-client .budget-ligne .avec-unite input { flex: 1 1 0; width: 0; min-width: 0; padding-left: 6px; padding-right: 6px; }
  .budget-lignes.avec-client .budget-ligne .avec-unite .montant-lecture { flex: 0 1 auto; padding: 0; min-height: 0; text-align: left; }
  .budget-lignes.avec-client .budget-ligne .marge-lecture { padding-right: 0; min-height: 0; }
}
/* Booking en lecture (PA, C1 du tour 10) : la carte ouvre la ligne ; plus de colonne de crayon. */
body.lecture-abord .avec-suppression > .boutons-ligne { display: none; }
body.lecture-abord form.carte-ligne.en-lecture { cursor: pointer; }
/* Accueil au téléphone (PA, Z1 du tour 10) : trois tuiles ; chacune ouvre son bloc dans un panneau
   qui monte du bas. Sur ordinateur et iPad, les blocs restent affichés comme avant. */
.accueil-tuiles { display: none; }
@media (max-width: 759px) {
  .accueil-tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: 8px; margin: 14px 0 4px; }
  .accueil-tuile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 124px; padding: 12px 10px; hyphens: auto; border: 1px solid var(--bordure); border-radius: 14px; background: var(--surface); color: var(--texte); font: inherit; text-align: left; cursor: pointer; }
  .accueil-tuile .icone { width: 24px; height: 24px; color: var(--accent); margin-bottom: auto; }
  .accueil-tuile strong { font-family: var(--titre); font-size: 2rem; line-height: 1.05; letter-spacing: -.02em; margin-top: 10px; }
  .accueil-tuile .tuile-titre { font-weight: 700; }
  .accueil-tuile small { color: var(--texte-doux); font-size: .82rem; }
  .accueil-grille [data-panneau], .contenu > [data-panneau] { display: none; }
  .accueil-depense { display: none; }
  .panneau-accueil { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 86dvh; padding: 0; border: 0; border-radius: 20px 20px 0 0; background: var(--fond, var(--surface)); color: var(--texte); box-shadow: 0 -10px 30px rgba(0, 0, 0, .2); }
  .panneau-accueil::backdrop { background: rgba(10, 30, 32, .45); }
  .panneau-accueil[open] { display: flex; flex-direction: column; }
  .panneau-corps { overflow-y: auto; padding: 8px 14px calc(18px + env(safe-area-inset-bottom)); }
  .panneau-corps [data-panneau] { display: block; margin: 0; }
  .panneau-corps .accueil-faire .liste-faire li.en-plus { display: block; }
  .panneau-fermer { align-self: flex-end; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 6px 6px 0 0; border: 0; border-radius: 50%; background: transparent; color: var(--texte); cursor: pointer; }
  .panneau-fermer .icone { width: 22px; height: 22px; }
  /* + Dépense en pastille, au centre en bas, sans mot flottant dessous (PA, C2 des tours 10 et 11). */
  .plus-flottant { left: 50%; right: auto; transform: translateX(-50%); flex-direction: row; gap: 6px; min-height: 48px; padding: 0 18px 0 14px; border-radius: 24px; background: var(--accent); color: var(--accent-texte); font-size: 1rem; font-weight: 600; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
  .plus-flottant.plus-flottant .icone { width: 22px; height: 22px; padding: 0; border-radius: 0; background: none; box-shadow: none; color: inherit; }
  .plus-flottant span { padding: 0; border: 0; background: none; }
  body:has(.plus-flottant) { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
}
/* iPad en portrait : le tableau « version 1 et aujourd'hui » défilait sur le côté ; une carte par poste,
   deux par rangée, comme au téléphone. */
@media (min-width: 760px) and (max-width: 1099px) {
  .tableau-v1-aujourdhui thead { display: none; }
  .tableau-v1-aujourdhui, .tableau-v1-aujourdhui tfoot, .tableau-v1-aujourdhui tr { display: block; }
  .tableau-v1-aujourdhui tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-bottom: 8px; }
  .tableau-v1-aujourdhui tr { padding: 8px 12px; border: 1px solid var(--bordure); border-radius: 10px; background: var(--surface); }
  .tableau-v1-aujourdhui tfoot tr { background: var(--fond); }
  .tableau-v1-aujourdhui th[scope=row] { display: block; padding: 0 0 4px; border: 0; text-align: left; font-weight: 700; }
  .tableau-v1-aujourdhui td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; white-space: normal; }
  .tableau-v1-aujourdhui td::before { content: attr(data-libelle); color: var(--texte-doux); font-weight: 400; text-align: left; }
  .tableau-v1-aujourdhui td:empty { display: none; }
}
/* Accueil du téléphone, tour 12 (PA, A1) : bonjour, quatre raccourcis, :02 en filigrane dont le point
   du haut clignote comme un voyant REC quand quelqu'un travaille ce jour-là. */
.accueil-bonjour, .accueil-raccourcis, .accueil-choisir, .accueil-filigrane { display: none; }
@media (max-width: 759px) {
  .accueil-bonjour { display: block; margin: 6px 0 0; font-family: var(--titre); font-weight: 600; font-size: 1.15rem; color: var(--accent); }
  .accueil-raccourcis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin: 12px 0 0; position: relative; z-index: 1; }
  .accueil-raccourcis a { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 12px; border: 1px solid var(--bordure); border-radius: 12px; background: var(--surface); color: var(--texte); font-weight: 600; font-size: .9rem; line-height: 1.2; text-decoration: none; }
  .accueil-raccourcis a span { min-width: 0; overflow-wrap: anywhere; }
  .accueil-raccourcis .icone { flex: none; width: 20px; height: 20px; color: var(--accent); }
  .accueil-choisir { display: block; margin: 8px 0 0; text-align: right; font-size: .85rem; position: relative; z-index: 1; }
  .accueil-filigrane { display: block; position: fixed; left: 0; right: 0; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 0; pointer-events: none; text-align: center; }
  .accueil-filigrane svg { width: min(80vw, 340px); height: auto; }
  .accueil-filigrane .fil-chiffres { fill: var(--accent); opacity: .08; }
  .accueil-filigrane .fil-points { opacity: .3; animation: sst-rec-fil 1.6s infinite; }
  .accueil-tuiles { position: relative; z-index: 1; }
}
@keyframes sst-rec-fil { 0%, 59.9% { opacity: .35; } 60%, 100% { opacity: .08; } }
@media (prefers-reduced-motion: reduce) { .accueil-filigrane .fil-points { animation: none; } }
@media (max-height: 640px) and (max-width: 759px) { .accueil-filigrane { display: none; } }
