/*
 * 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.
 * L'identité visuelle de SST est encore à créer : couleurs sobres en attendant.
 */

:root {
  --fond: #f3f5f7;
  --surface: #ffffff;
  --texte: #17212b;
  --texte-doux: #5b6773;
  --bordure: #d9dee3;
  --accent: #1f3a4d;
  --accent-texte: #ffffff;
  --lien: #1d5c86;
  --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: #e03a2f;
  --alerte-fond: #fff3d6;
  --erreur: #b3261e;
  --erreur-fond: #fde8e6;
  --info-fond: #e7f0f7;
  --prevu: #5b6773;
  --facture: #8a5a00;
  --paye: #1b7a43;
  --rayon: 12px;
  --ombre: 0 1px 2px rgba(0, 0, 0, .06);
  --haut-onglets: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0f161c;
    --surface: #18222b;
    --texte: #e8edf1;
    --texte-doux: #9aa7b2;
    --bordure: #2c3a46;
    --accent: #7fb3d5;
    --accent-texte: #0f161c;
    --lien: #8cc4ea;
    --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: #172b3a;
    --prevu: #9aa7b2;
    --facture: #f2c14e;
    --paye: #6fcf97;
    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) + 12px); }
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, .entete-loupe {
  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.fil-ici { flex: 0 0 auto; max-width: 70%; }
.fil li.fil-ici h1 { overflow: hidden; text-overflow: ellipsis; }
.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; }
.fil .fil-accueil { width: 32px; padding: 0; justify-content: center; }
.fil .fil-accueil .icone { width: 16px; height: 16px; }
/* Menu principal : catégories, sous-menus déroulants */
.menu {
  position: relative; z-index: 18; display: flex; justify-content: space-between;
  padding: 0 2px; background: var(--surface); border-bottom: 1px solid var(--bordure);
}
.menu-cat > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 4px;
  min-height: 44px; padding: 0 7px; font-size: .84rem; font-weight: 600; color: var(--texte-doux);
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.menu-cat > summary::-webkit-details-marker { display: none; }
.menu-cat > summary::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
.menu-cat[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.menu-cat.actif > summary { color: var(--texte); border-bottom-color: var(--lien); }
.menu-sous {
  position: absolute; left: 8px; right: 8px; top: 100%; margin: 4px 0 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18); display: flex; flex-direction: column;
}
.menu-sous a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--texte); text-decoration: none; }
.menu-sous a:hover, .menu-sous a:focus-visible { background: var(--fond); }

@media (max-width: 380px) {
  .menu-cat > summary { padding: 0 4px; font-size: .78rem; gap: 3px; }
}

.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); }
.pied { text-align: center; font-size: .85rem; color: var(--texte-doux); padding: 16px 12px 24px; }
body.avec-onglets .pied { padding-bottom: 8px; }

/* 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=email], 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; }
.lien-ajout { display: inline-block; padding: 10px 0 2px; }
.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 */
.entete-loupe { flex: none; background: rgba(255, 255, 255, .14); }
.entete-loupe .icone { width: 20px; height: 20px; }
.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-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; }
.barre-outils-simple { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.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; }
.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 {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
  bottom: calc(env(safe-area-inset-bottom) + 16px); width: min(480px, calc(100% - 32px));
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
body.avec-onglets .messages { bottom: calc(var(--haut-onglets) + env(safe-area-inset-bottom) + 12px); }
.message-passager {
  pointer-events: auto; cursor: pointer; padding: 14px 18px; border-radius: 12px; font-weight: 600;
  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: 0; }
  /* En grand écran : en haut, au centre, là où s'affichaient les anciens messages. */
  .messages, body.avec-onglets .messages { bottom: auto; top: 150px; }
  .message-passager.sortie { transform: translateY(-8px); }
  .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; }
  .menu-cat > summary { padding: 0 12px; font-size: .9rem; }
  .menu-cat { position: relative; }
  .menu-sous { left: 0; right: auto; min-width: 280px; }
  .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; }
  .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; }
}
