/* Assistant IA — système de design (lot D). Source : docs/design/Brief_design.md.
   Toutes les couleurs sont des variables : le mode sombre (hors V1) ne demandera que de les redéfinir.
   Contrastes vérifiés automatiquement par tests/test_design.py (texte ≥ 4,5:1, icônes et bords ≥ 3:1). */

/* Police hébergée sur notre serveur : Inter 4.001 (licence SIL OFL : polices/OFL.txt). Fichier variable
   (graisses 100 à 900, taille optique 14 à 32), réduit aux caractères latins (français, €, ponctuation).
   Zéro non barré ; chiffres à chasse fixe disponibles (tnum). L'italique est rare : simulé par le navigateur. */
@font-face {
  font-family: "Inter";
  src: url("polices/Inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root, ::backdrop {   /* ::backdrop : le voile du panneau n'hérite pas des variables, on les lui donne */
  /* --- Marque « Pétrole et sable » (brief §3, aussi celle du logo) --- */
  --sable: #f2e8d8;          /* fonds sélectionnés, survol, fond d'accent doux (jamais de Lagon écrit dessus : 4,2:1) */
  --sauge: #a9c5b4;          /* fonds et repères seulement : trop pâle pour une icône sur blanc (1,9:1) */
  --lagon: #2f7a76;          /* action principale : boutons, liens, icône active (5:1 avec le blanc) */
  --petrole: #1f4f5a;        /* titres forts, texte sur Sable (7,5:1) */
  --degrade-marque: linear-gradient(90deg, var(--sable) 0%, var(--sauge) 35%, var(--lagon) 65%, var(--petrole) 100%);
  --icone-active: var(--lagon);     /* icône de l'onglet actif, repère du jour */

  /* --- Interface --- */
  --fond: #ffffff;           /* fond de page : blanc (cartes délimitées par leur contour) */
  --fond-menu: #f8f2e8;      /* menu latéral et barre d'onglets : Sable éclairci vers le blanc */
  --survol: #f7f3ec;         /* survol d'une ligne ou d'une carte (visible sur fond blanc) */
  --surface: #ffffff;        /* cartes, panneaux */
  --texte: #22201c;          /* encre foncée chaude */
  --texte-secondaire: #6b655c;  /* gris chaud */
  --bord: #e2dacb;           /* contours des cartes et séparateurs (visibles sur fond blanc) */
  --bord-champ: #8c857a;     /* contour des champs (≥ 3:1) */
  --accent: #2f7a76;         /* Lagon : boutons, liens */
  --accent-survol: #276661;
  --accent-clair: #f2e8d8;   /* Sable : fonds sélectionnés */
  --accent-sur-clair: #1f4f5a;  /* Pétrole : texte posé sur le Sable */
  --sur-accent: #ffffff;     /* texte sur l'accent */
  --focus: #2f7a76;
  --ok: #2b8a46;             /* pastille « tout fonctionne » du système (pas une priorité) */
  --sur-couleur: #ffffff;    /* symbole blanc sur une pastille de couleur (✓, !) */
  --message-fond: var(--petrole);   /* message « Reporté… · Annuler » en bas de l'écran */
  --message-texte: var(--sur-accent);
  --message-bouton: var(--sable);   /* 7,5:1 sur le Pétrole */
  --surlignage: #f8e3a6;     /* mots trouvés par la recherche de la FAQ (texte foncé posé dessus) */

  /* --- Priorités : jamais seules (toujours libellé + icône) --- */
  --urgent: #d92d20;          --urgent-fond: #fdecec;     --urgent-texte: #9b1c1c;
  /* Trois niveaux (14/10/2026, demande utilisateur) : Urgent rouge, Important jaune, Info gris ardoise. */
  --important: #a37800;       --important-fond: #fff7d1;  --important-texte: #6b4e00;   /* jaune */
  --info: #5b6b7a;            --info-fond: #e9edf1;       --info-texte: #3d4a57;   /* gris ardoise */

  /* --- Statuts --- */
  --statut-neutre-fond: #ececea;   --statut-neutre-texte: #45443f;   /* gris neutre, distinct du Sable */
  --statut-cours-fond: #e8f0fc;    --statut-cours-texte: #1f4f99;
  --statut-termine-fond: #eaf3ec;  --statut-termine-texte: #2f5a3d;

  /* --- Typographie --- */
  --police: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --taille-titre-page: 1.5rem;      /* 24 px */
  --taille-titre-section: 1.125rem; /* 18 px */
  --taille-titre-element: 0.875rem;  /* 14 px, semi-gras */
  --taille-carte-ligne: 0.8125rem;   /* 13 px : client · projet sous le titre d'une carte */
  --taille-saisie: 0.9375rem;        /* 15 px ; 16 px sur écran tactile (sinon l'iPhone zoome) */
  --taille-texte: 1rem;             /* 16 px */
  --taille-secondaire: 0.875rem;    /* 14 px */
  --interligne: 1.5;
  --interligne-serre: 1.25;
  --graisse-normale: 400;
  --graisse-moyenne: 600;
  --graisse-forte: 700;

  /* --- Espacements (pas de 4 px) --- */
  --esp-1: 0.25rem;  /* 4 */
  --esp-2: 0.5rem;   /* 8 */
  --esp-3: 0.75rem;  /* 12 */
  --esp-4: 1rem;     /* 16 : marge latérale mobile */
  --esp-5: 1.5rem;   /* 24 */
  --esp-6: 2rem;     /* 32 */
  --esp-7: 3rem;     /* 48 */
  --cible-tactile: 2.75rem; /* 44 px minimum (zone cliquable) */
  --hauteur-bouton: 2.25rem; /* 36 px (taille visible) */

  /* --- Rayons --- */
  --rayon-petit: 0.25rem;   /* étiquettes, champs, boutons */
  --rayon: 0.5rem;           /* cartes, panneaux */
  --rayon-grand: 0.75rem;    /* feuille mobile */
  --rayon-pilule: 999px;

  /* --- Ombres (légères, teintées de l'encre chaude) --- */
  --teinte-ombre: 34 32 28;  /* rouge vert bleu de l'encre, sans virgules */
  --ombre-1: 0 1px 2px rgb(var(--teinte-ombre) / 0.06), 0 1px 3px rgb(var(--teinte-ombre) / 0.04);
  --ombre-2: 0 4px 12px rgb(var(--teinte-ombre) / 0.08), 0 1px 3px rgb(var(--teinte-ombre) / 0.05);
  --ombre-3: 0 12px 32px rgb(var(--teinte-ombre) / 0.14);
  --ombre-haut: 0 -2px 12px rgb(var(--teinte-ombre) / 0.06);

  /* --- Mise en page --- */
  --hauteur-entete: 3.5rem;
  --hauteur-onglets: 4rem;
  --largeur-menu: 15rem;
  --largeur-menu-replie: 4rem;
  --epaisseur-filet: 3px;
}

/* ===================== Base ===================== */
*, *::before, *::after { box-sizing: border-box; }

.d-corps {
  margin: 0;
  min-height: 100vh;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police);
  font-size: var(--taille-texte);
  line-height: var(--interligne);
  font-feature-settings: "cv05" 1; /* l minuscule avec queue : ne se confond plus avec I majuscule */
  -webkit-text-size-adjust: 100%;
}

.d-corps a { color: var(--accent); }
.d-corps a:hover { color: var(--accent-survol); }

.d-corps :focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--rayon-petit);
}

.d-cache {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.d-evitement { position: absolute; left: var(--esp-4); top: -4rem; z-index: 50;
  padding: var(--esp-2) var(--esp-3); background: var(--surface); border-radius: var(--rayon-petit); }
.d-evitement:focus { top: var(--esp-2); }

.d-chiffres { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ===================== En-tête (filet en dégradé dessous) ===================== */.d-entete {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: var(--esp-3);
  height: calc(var(--hauteur-entete) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(var(--esp-4), env(safe-area-inset-right)) 0 max(var(--esp-4), env(safe-area-inset-left));
  background: var(--surface);
}
.d-entete::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: var(--epaisseur-filet); background: var(--degrade-marque);
}

.d-marque { display: flex; align-items: center; min-height: var(--cible-tactile); }
.d-marque img { display: block; width: 26px; height: auto; }

/* Alerte système : un simple triangle en haut à droite, seulement s'il y a un souci. */
.d-alerte-systeme {
  display: grid; place-items: center;
  width: var(--cible-tactile); height: var(--cible-tactile); margin-right: calc(-1 * var(--esp-2));
  border-radius: var(--rayon);
}
.d-alerte-systeme svg { width: 24px; height: 24px; }
.d-alerte-systeme svg path:first-child { fill: currentColor; stroke: currentColor; }
.d-alerte-systeme svg path + path { stroke: var(--sur-couleur); }
.d-alerte-rouge  { color: var(--urgent) !important; }
.d-alerte-orange { color: var(--important) !important; }
.d-alerte-systeme:hover { background: var(--survol); }

/* État du système en pied de page : une ligne discrète. */
.d-pied {
  display: flex; align-items: center; gap: var(--esp-2); flex-wrap: wrap;
  margin-top: var(--esp-6); padding-top: var(--esp-3); border-top: 1px solid var(--bord);
  color: var(--texte-secondaire); font-size: 0.8125rem;
}
.d-pied a { color: var(--texte-secondaire) !important; display: inline-flex; align-items: center; gap: var(--esp-1);
  min-height: var(--cible-tactile); }
.d-pied a:hover { color: var(--accent) !important; }
.d-point { width: 0.5rem; height: 0.5rem; border-radius: 50%; flex: none; background: var(--texte-secondaire); }
.d-point-vert { background: var(--ok); }
.d-point-orange { background: var(--important); }
.d-point-rouge { background: var(--urgent); }

/* ===================== Contenu ===================== */
.d-contenu {
  max-width: 72rem;
  padding: var(--esp-5) max(var(--esp-4), env(safe-area-inset-right))
           calc(var(--hauteur-onglets) + var(--esp-6) + env(safe-area-inset-bottom)) max(var(--esp-4), env(safe-area-inset-left));
}

.d-titre-page {
  margin: 0 0 var(--esp-5);
  font-size: var(--taille-titre-page); line-height: var(--interligne-serre); font-weight: var(--graisse-forte);
}

/* ===================== Barre d'onglets (téléphone) ===================== */
.d-onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--fond-menu);
  border-top: 1px solid var(--bord);
  box-shadow: var(--ombre-haut);
  padding-bottom: env(safe-area-inset-bottom);
}
.d-onglets ul {
  display: grid; grid-template-columns: repeat(5, 1fr);
  margin: 0 auto; padding: 0; list-style: none; max-width: 32rem;
}
.d-onglets a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--hauteur-onglets);
  color: var(--texte-secondaire) !important; text-decoration: none;
  font-size: 0.75rem; font-weight: var(--graisse-moyenne); line-height: 1.1; text-align: center;
}
.d-onglets svg, .d-menu svg {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.d-onglets a[aria-current="page"] { color: var(--accent-sur-clair) !important; }   /* Pétrole : lisible sur le Sable */
.d-onglets a[aria-current="page"] svg { color: var(--icone-active); }
.d-onglets a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 22%; right: 22%;
  height: var(--epaisseur-filet); border-radius: 0 0 3px 3px; background: var(--degrade-marque);
}

.d-onglet-plus {
  display: grid; place-items: center;
  width: 3.25rem; height: 3.25rem; margin-top: -1.25rem;
  border-radius: 50%; background: var(--accent); color: var(--sur-accent);
  box-shadow: var(--ombre-2), 0 0 0 4px var(--fond-menu);
}
.d-onglet-plus svg { stroke-width: 2.4; }
.d-onglet-capture:hover .d-onglet-plus { background: var(--accent-survol); }
.d-onglet-capture[aria-current="page"]::before { display: none; }

/* ===================== Menu latéral (ordinateur) ===================== */
.d-menu { display: none; }

@media (min-width: 1024px) {
  .d-onglets { display: none; }

  .d-corps {
    display: grid;
    grid-template-columns: var(--largeur-menu) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }
  /* En-tête limité à la largeur du menu (logo au-dessus du menu, pas de grand bandeau vide) ; le contenu
     occupe toute la hauteur à droite ; l'alerte système reste en haut à droite de l'écran. */
  .d-entete { grid-column: 1; grid-row: 1; justify-content: center; padding-left: 0; padding-right: 0;
    background: var(--surface); border-right: 1px solid var(--bord); }   /* fond blanc, logo centré */
  .d-menu { grid-column: 1; grid-row: 2; }
  .d-contenu { grid-column: 2; grid-row: 1 / span 2; }
  .d-alerte-systeme { position: fixed; top: var(--esp-3); right: var(--esp-4); z-index: 30; margin: 0;
    background: var(--surface); box-shadow: var(--ombre-1); }

  .d-menu {
    display: flex; flex-direction: column; gap: var(--esp-4);
    position: sticky; top: var(--hauteur-entete);
    height: calc(100vh - var(--hauteur-entete));
    padding: var(--esp-5) var(--esp-3);
    background: var(--fond-menu);
    border-right: 1px solid var(--bord);
  }
  .d-menu ul { display: flex; flex-direction: column; gap: var(--esp-1); flex: 1; margin: 0; padding: 0; list-style: none; }
  .d-menu .d-menu-bas { margin-top: auto; }
  .d-menu li a {
    position: relative;
    display: flex; align-items: center; gap: var(--esp-3);
    min-height: var(--cible-tactile); padding: 0 var(--esp-3);
    border-radius: var(--rayon);
    color: var(--texte) !important; text-decoration: none; font-weight: var(--graisse-moyenne);
  }
  .d-menu li a svg { color: var(--texte-secondaire); }
  .d-menu li a:hover { background: var(--surface); }
  .d-menu li a[aria-current="page"] { background: var(--surface); color: var(--accent-sur-clair) !important; box-shadow: var(--ombre-1); }
  .d-menu li a[aria-current="page"] svg { color: var(--icone-active); }
  .d-menu li a[aria-current="page"]::before {
    content: ""; position: absolute; left: calc(-1 * var(--esp-3)); top: 20%; bottom: 20%;
    width: 4px; border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, var(--sauge), var(--lagon), var(--petrole));
  }
  .d-menu-capture { width: 100%; }

  .d-contenu { padding: var(--esp-6) var(--esp-6) var(--esp-7); }
}

/* ===================== Boutons ===================== *//* Compacts à l'œil (36 px), mais la zone cliquable reste à 44 px grâce à ::after. */
.d-bouton {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--esp-1);
  min-height: var(--hauteur-bouton); padding: 0 var(--esp-3);
  border: 1px solid transparent; border-radius: var(--rayon-petit);
  font: inherit; font-size: var(--taille-secondaire); font-weight: var(--graisse-moyenne); line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s;
}
.d-bouton::after { content: ""; position: absolute; inset: calc((var(--hauteur-bouton) - var(--cible-tactile)) / 2) 0; }
.d-bouton svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.d-bouton-principal { background: var(--accent); color: var(--sur-accent) !important; }
.d-bouton-principal:hover { background: var(--accent-survol); }
.d-bouton-secondaire { background: var(--surface); color: var(--accent) !important; border-color: var(--accent); }
.d-bouton-secondaire:hover { background: var(--accent-clair); color: var(--accent-sur-clair) !important; }
.d-bouton-discret { background: transparent; color: var(--accent) !important; padding: 0 var(--esp-2); }
.d-bouton-discret:hover { background: var(--accent-clair); color: var(--accent-sur-clair) !important; }
.d-bouton[disabled], .d-bouton[aria-disabled="true"] {
  background: var(--statut-neutre-fond); color: var(--statut-neutre-texte) !important;
  border-color: transparent; cursor: not-allowed;
}
.d-boutons { display: flex; flex-wrap: wrap; gap: var(--esp-2); align-items: center; }

/* Bouton-icône (ex. Signaler un problème) : drapeau seul, libellé lu par les lecteurs d'écran et au survol. */
.d-bouton-icone {
  display: inline-grid; place-items: center;
  width: var(--cible-tactile); height: var(--cible-tactile); margin: calc(-1 * var(--esp-2)) calc(-1 * var(--esp-2)) calc(-1 * var(--esp-2)) auto;
  border-radius: var(--rayon-petit); color: var(--texte-secondaire) !important;
}
.d-bouton-icone svg { width: 16px; height: 16px; }
.d-bouton-icone:hover { color: var(--accent-sur-clair) !important; background: var(--accent-clair); }

/* ===================== Titres, sections, textes ===================== */
.d-titre-section {
  margin: 0 0 var(--esp-3);
  font-size: var(--taille-titre-section); line-height: var(--interligne-serre); font-weight: var(--graisse-forte);
}
.d-section { margin: 0 0 var(--esp-6); }
.d-secondaire { color: var(--texte-secondaire); font-size: var(--taille-secondaire); }
.d-texte-lignes { white-space: pre-line; overflow-wrap: anywhere; }
/* Bouton qui n'utilise que l'IA, quand l'IA est indisponible : grisé, la raison au survol (title). */
[data-ia-coupee], [data-ia-coupee]:hover { opacity: .45; cursor: not-allowed; }
.d-icone { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.125em; }

/* ===================== Étiquettes ===================== */
.d-etiquette {
  display: inline-flex; align-items: center; gap: var(--esp-1);
  padding: 0.125rem var(--esp-2);
  border: 1px solid transparent; border-radius: var(--rayon-petit);
  font-size: var(--taille-secondaire); font-weight: var(--graisse-moyenne); line-height: 1.4;
  white-space: nowrap;
}
.d-etiquettes { display: flex; flex-wrap: wrap; gap: var(--esp-2); align-items: center; }

.d-prio-urgent     { background: var(--urgent-fond);     color: var(--urgent-texte); }
.d-prio-important  { background: var(--important-fond);  color: var(--important-texte); }
.d-prio-info       { background: var(--info-fond);       color: var(--info-texte); }

.d-statut-neutre  { background: var(--statut-neutre-fond);  color: var(--statut-neutre-texte); }
.d-statut-cours   { background: var(--statut-cours-fond);   color: var(--statut-cours-texte); }
.d-statut-valider { background: var(--accent-clair);        color: var(--accent-sur-clair); }
.d-statut-termine { background: var(--statut-termine-fond); color: var(--statut-termine-texte); }

.d-type { background: var(--surface); color: var(--texte-secondaire); border-color: var(--bord); }

/* Échéance : chiffres alignés ; proposée non confirmée = pointillés + « à confirmer », jamais de rouge. */
.d-echeance {
  display: inline-flex; align-items: center; gap: var(--esp-1);
  font-size: var(--taille-secondaire); font-weight: var(--graisse-moyenne);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.d-echeance-depassee { color: var(--urgent-texte); }
.d-echeance-a-confirmer {
  padding: 0.0625rem var(--esp-2);
  border: 1.5px dashed var(--bord-champ); border-radius: var(--rayon-petit);
  color: var(--texte-secondaire); font-weight: var(--graisse-normale);
}
/* Dans une carte, toutes les échéances ont le même cadre : le texte s'aligne, pointillés ou non. */
.d-carte .d-echeance { padding: 0.0625rem var(--esp-2); border: 1.5px solid transparent; margin-right: calc(-1 * var(--esp-2)); }
.d-carte .d-echeance-a-confirmer { border: 1.5px dashed var(--bord-champ); }
/* Date proposée (non validée) et dépassée : en rouge aussi, mais pas en gras, toujours en pointillés. */
.d-echeance-a-confirmer.d-echeance-depassee { color: var(--urgent-texte); font-weight: var(--graisse-normale);
  border-color: var(--urgent); }

/* ===================== Carte d'élément (repliée : l'essentiel ; dépliée : le reste) ===================== */.d-cartes { display: flex; flex-direction: column; gap: var(--esp-2); margin: 0; padding: 0; list-style: none; }

.d-carte {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--bord); border-radius: var(--rayon);
  overflow: hidden;
}
/* Trait de priorité à gauche, doublé par la forme de l'icône (jamais la couleur seule). */
.d-carte::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.d-carte-urgent::before     { background: var(--urgent); }
.d-carte-important::before  { background: var(--important); }
.d-carte-info::before       { background: var(--info); }

.d-carte > details > summary {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0 var(--esp-2); align-items: center;
  padding: var(--esp-2) var(--esp-3) var(--esp-2) calc(var(--esp-3) + 3px);
  cursor: pointer; list-style: none;
}
.d-carte > details > summary::-webkit-details-marker { display: none; }
.d-carte > details > summary:hover { background: var(--survol); }
.d-carte-prio { align-self: center; grid-row: span 2; display: inline-flex; }
.d-carte-prio .d-icone { width: 1.125rem; height: 1.125rem; }
.d-carte-urgent .d-carte-prio     { color: var(--urgent); }
.d-carte-important .d-carte-prio  { color: var(--important); }
.d-carte-info .d-carte-prio       { color: var(--info); }
.d-carte-titre {
  font-size: var(--taille-titre-element); font-weight: var(--graisse-moyenne); line-height: var(--interligne-serre);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.d-carte-lien {
  grid-column: 2 / 4; color: var(--texte-secondaire); font-size: var(--taille-carte-ligne);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.d-carte-detail {
  display: flex; flex-direction: column; gap: var(--esp-2);
  padding: 0 var(--esp-3) var(--esp-3) calc(var(--esp-3) + 3px + 1.125rem + var(--esp-2));
  font-size: var(--taille-secondaire);
}
.d-carte-detail p { margin: 0; }
.d-carte-bas { display: flex; align-items: center; gap: var(--esp-2); flex-wrap: wrap; }
.d-source { color: var(--texte-secondaire); font-size: 0.8125rem; }

/* ===================== Champs ===================== */
.d-champ { margin: 0 0 var(--esp-4); }
.d-champ label, .d-champ .d-libelle { display: block; margin-bottom: var(--esp-1); font-weight: var(--graisse-moyenne); }
.d-aide { margin: var(--esp-1) 0 0; color: var(--texte-secondaire); font-size: var(--taille-secondaire); }

.d-saisie {
  display: block; width: 100%;
  min-height: var(--cible-tactile); padding: var(--esp-2) var(--esp-3);
  background: var(--surface); color: var(--texte);
  border: 1px solid var(--bord-champ); border-radius: var(--rayon-petit);
  font: inherit; font-size: var(--taille-saisie);
}
@media (pointer: coarse) { .d-saisie { font-size: max(16px, var(--taille-saisie)); } } /* pas de zoom automatique sur iPhone */
textarea.d-saisie { min-height: 6rem; resize: vertical; }
select.d-saisie { appearance: none; padding-right: var(--esp-6);
  background-image: linear-gradient(45deg, transparent 50%, var(--texte-secondaire) 50%),
                    linear-gradient(135deg, var(--texte-secondaire) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat; }
.d-saisie:hover { border-color: var(--texte-secondaire); }
.d-saisie:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--accent); }
.d-saisie::placeholder { color: var(--texte-secondaire); }

.d-champ-erreur .d-saisie { border-color: var(--urgent); border-width: 2px; }
.d-erreur { display: flex; gap: var(--esp-1); margin: var(--esp-1) 0 0; color: var(--urgent-texte);
  font-size: var(--taille-secondaire); font-weight: var(--graisse-moyenne); }

.d-case { display: flex; align-items: center; gap: var(--esp-2); min-height: var(--cible-tactile); cursor: pointer; }
.d-case input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--accent); }

/* ===================== Onglets de filtre (légers) ===================== */
.d-filtres { display: flex; gap: var(--esp-1); margin: 0 0 var(--esp-4); padding: 0; list-style: none;
  border-bottom: 1px solid var(--bord); overflow-x: auto; scrollbar-width: none; }
.d-filtres a {
  display: inline-flex; align-items: center; gap: var(--esp-1);
  min-height: var(--cible-tactile); padding: 0 var(--esp-3);
  color: var(--texte-secondaire) !important; text-decoration: none; white-space: nowrap;
  font-size: var(--taille-secondaire); font-weight: var(--graisse-moyenne);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.d-filtres a:hover { color: var(--texte) !important; }
.d-filtres a[aria-current="true"] { color: var(--accent) !important; border-bottom-color: var(--accent); }
.d-compte { font-size: 0.75rem; font-variant-numeric: tabular-nums; color: var(--texte-secondaire); }

/* ===================== Vue semaine (toute la semaine d'un coup) ===================== */.d-semaine-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--esp-2); margin: 0 0 var(--esp-2); }
.d-semaine-nav strong { font-variant-numeric: tabular-nums; }

/* Téléphone : un jour par ligne (jour à gauche, éléments à droite). À partir de 768 px : 5 colonnes. */
.d-semaine { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none;
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); }
.d-semaine-jour { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: var(--esp-2); align-items: center;
  padding: var(--esp-2) var(--esp-3); border-top: 1px solid var(--bord); }
.d-semaine-jour:first-child { border-top: 0; }
.d-semaine-date { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; font-variant-numeric: tabular-nums; }
.d-semaine-date small { color: var(--texte-secondaire); font-size: 0.75rem; }
.d-semaine-date strong { font-size: var(--taille-texte); }
.d-semaine-jour[aria-current="date"] .d-semaine-date strong { color: var(--accent); }
.d-semaine-jour[aria-current="date"] .d-semaine-date::after {   /* aujourd'hui : petit trait Lagon */
  content: ""; width: 1.25rem; height: 3px; margin-top: 3px; border-radius: 2px; background: var(--icone-active);
}
.d-semaine-elements { display: flex; flex-direction: column; gap: var(--esp-1); margin: 0; padding: 0; list-style: none;
  font-size: var(--taille-secondaire); }
.d-semaine-elements li { display: flex; align-items: flex-start; gap: var(--esp-1); min-width: 0; line-height: 1.35; }
.d-semaine-elements .d-icone { flex: none; color: var(--accent); margin-top: 0.1em; }
.d-semaine-elements span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-semaine-heure { flex: none; font-weight: var(--graisse-forte); font-variant-numeric: tabular-nums; }
.d-semaine-rien { color: var(--texte-secondaire); }

@media (min-width: 768px) {
  .d-semaine { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .d-semaine-jour { grid-template-columns: 1fr; align-content: start; min-height: 7rem;
    border-top: 0; border-left: 1px solid var(--bord); }
  .d-semaine-jour:first-child { border-left: 0; }
  .d-semaine-date { flex-direction: row; align-items: center; gap: var(--esp-1); flex-wrap: wrap; }
  .d-semaine-jour[aria-current="date"] .d-semaine-date::after { flex-basis: 100%; }
  .d-semaine-elements span { white-space: normal; }
}

/* ===================== État vide ===================== */
.d-vide {
  display: flex; gap: var(--esp-3); align-items: flex-start;
  padding: var(--esp-4); border: 1px dashed var(--bord-champ); border-radius: var(--rayon);
  background: var(--surface);
}
.d-vide .d-icone { width: 1.5rem; height: 1.5rem; color: var(--accent); }
.d-vide p { margin: 0; }

/* ===================== Grille de la démonstration ===================== */
.d-grille { display: grid; gap: var(--esp-5); margin: 0 0 var(--esp-6); }
.d-grille > .d-section { margin: 0; }
@media (min-width: 768px) { .d-grille-2 { grid-template-columns: 1fr 1fr; } }
.d-panneau { padding: var(--esp-4); background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); }

/* Échéance centrée verticalement dans la carte repliée, comme l'icône de priorité (téléphone et ordinateur). */
.d-carte > details > summary .d-carte-titre { grid-column: 2; grid-row: 1; }
.d-carte > details > summary .d-carte-lien { grid-column: 2; grid-row: 2; }
.d-carte > details > summary .d-echeance { grid-column: 3; grid-row: 1 / span 2; align-self: center; }

/* ===================== Suivis réels (D2) ===================== */

.d-section-titre { display: flex; align-items: center; justify-content: space-between; gap: var(--esp-3); flex-wrap: wrap;
  min-height: 2rem; margin-bottom: var(--esp-3); }
.d-section-titre .d-titre-section { margin: 0; }
.d-section-titre .d-titre-section { display: inline-flex; align-items: baseline; gap: var(--esp-2); }
.d-liens { display: inline-flex; gap: var(--esp-4); font-size: var(--taille-secondaire); }
.d-alertes { margin-bottom: var(--esp-5); }
.d-carte:not([class*="d-carte-"]) .d-carte-prio { color: var(--texte-secondaire); }

/* Bloc repliable (« Plus tard », « Découper en étapes ») */
.d-plier { margin-top: var(--esp-3); }
.d-plier > summary {
  display: inline-flex; align-items: center; gap: var(--esp-1);
  min-height: var(--cible-tactile); cursor: pointer; list-style: none;
  color: var(--accent); font-size: var(--taille-secondaire); font-weight: var(--graisse-moyenne);
}
.d-plier > summary::-webkit-details-marker { display: none; }
.d-plier > summary .d-icone { transition: transform 0.15s; }
.d-plier[open] > summary .d-icone { transform: rotate(90deg); }
.d-plus-tard > summary { font-size: var(--taille-texte); color: var(--texte); }

/* Actions d'un suivi */
.d-actions { display: flex; flex-direction: column; gap: var(--esp-2); padding-top: var(--esp-2); border-top: 1px solid var(--bord); }
.d-actions form { margin: 0; }
.d-saisie-courte { width: auto; flex: 1 1 10rem; min-height: var(--hauteur-bouton); padding: 0 var(--esp-2); }
.d-saisie-date { width: auto; min-height: var(--hauteur-bouton); padding: 0 var(--esp-2); }

/* Détail d'un suivi (gabarit commun suivis_macros.corps) */
.d-corps-suivi dl { display: grid; grid-template-columns: 1fr; gap: var(--esp-1); margin: 0; }
.d-corps-suivi dl > div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: var(--esp-2); }
.d-corps-suivi dt { color: var(--texte-secondaire); }
.d-corps-suivi dd { margin: 0; overflow-wrap: anywhere; }
.d-corps-suivi .texte-libre { white-space: pre-line; }
.d-corps-suivi .discret { color: var(--texte-secondaire); }
.d-corps-suivi .texte-vert { color: var(--info-texte); }
.d-corps-suivi .texte-orange { color: var(--important-texte); }
.d-corps-suivi .sous-liste { margin: 0; padding-left: 1.1rem; }
.d-corps-suivi .fait { text-decoration: line-through; color: var(--texte-secondaire); }
.d-corps-suivi .annule { text-decoration: line-through; }
.d-corps-suivi .coulisses { margin-top: var(--esp-2); }
.d-corps-suivi .coulisses > summary { min-height: var(--cible-tactile); display: flex; align-items: center;
  cursor: pointer; color: var(--accent); font-weight: var(--graisse-moyenne); }
@media (max-width: 480px) {
  .d-corps-suivi dl > div { grid-template-columns: 1fr; gap: 0; }
}

/* Ligne 2 des actions : liens discrets ; un bloc ouvert prend toute la largeur. */
.d-actions-secondaires { gap: 0 var(--esp-4); font-size: var(--taille-secondaire); }
.d-actions-secondaires .d-plier { margin: 0; }
.d-actions-secondaires .d-plier > summary { font-size: var(--taille-secondaire); }
.d-actions-secondaires .d-plier[open] { order: 10; flex-basis: 100%; }
.d-actions-secondaires .d-plier[open] > summary { color: var(--texte); }
.d-lien-action {
  display: inline-flex; align-items: center; min-height: var(--cible-tactile); padding: 0;
  background: none; border: 0; cursor: pointer;
  font: inherit; font-size: var(--taille-secondaire); font-weight: var(--graisse-moyenne);
  color: var(--accent) !important; text-decoration: none;
}
.d-lien-action:hover { text-decoration: underline; }

/* Éléments de la semaine cliquables ; page « Semaine en détail ». */
.d-semaine-lien { display: flex; align-items: flex-start; gap: var(--esp-1); min-width: 0;
  color: var(--texte) !important; text-decoration: none; border-radius: var(--rayon-petit); }
a.d-semaine-lien:hover span { text-decoration: underline; }
.d-semaine-lien .d-icone { flex: none; color: var(--accent); margin-top: 0.1em; }
.d-semaine-detail { display: grid; gap: var(--esp-3); margin: var(--esp-3) 0; }
.d-semaine-bloc .d-titre-section { display: flex; align-items: center; gap: var(--esp-2); font-size: var(--taille-texte); }
.d-aujourdhui { border-color: var(--accent); }
.d-semaine-elements-detail { font-size: var(--taille-texte); gap: var(--esp-2); }
.d-semaine-elements-detail span { white-space: normal; }
.d-semaine-elements-detail .d-semaine-lien { min-height: var(--hauteur-bouton); align-items: center; }

/* Absence (congés, RTT…) écrite juste sous le jour. */
.d-absence { display: block; font-style: normal; font-size: 0.75rem; font-weight: var(--graisse-moyenne);
  color: var(--statut-cours-texte); margin: 0; }
.d-semaine-date .d-absence { margin-top: 2px; white-space: nowrap; line-height: 1.2; }
.d-semaine-bloc .d-absence { margin: calc(-1 * var(--esp-2)) 0 var(--esp-2); font-size: var(--taille-secondaire); }

/* Semaine en détail : sur ordinateur, les jours côte à côte. */
@media (min-width: 1024px) {
  .d-semaine-detail { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: stretch; }
  .d-semaine-bloc .d-titre-section { flex-wrap: wrap; font-size: var(--taille-secondaire); }
  .d-semaine-elements-detail { font-size: var(--taille-secondaire); }
  .d-semaine-elements-detail .d-semaine-lien { min-height: 0; align-items: flex-start; }
  .d-semaine-elements-detail .d-secondaire { display: block; font-size: 0.75rem; }
}
@media (min-width: 768px) { .d-semaine-date .d-absence { flex-basis: 100%; } }

/* ===================== Menu latéral repliable (ordinateur) ===================== */

.d-menu-replier { margin: 0; }
.d-menu-replier button {
  display: flex; align-items: center; gap: var(--esp-3); width: 100%;
  min-height: var(--cible-tactile); padding: 0 var(--esp-3);
  background: none; border: 0; border-radius: var(--rayon); cursor: pointer;
  font: inherit; font-size: var(--taille-secondaire); color: var(--texte-secondaire);
}
.d-menu-replier button:hover { background: var(--surface); color: var(--texte); }

@media (min-width: 1024px) {
  .d-menu-replie { grid-template-columns: var(--largeur-menu-replie) minmax(0, 1fr); }
  .d-menu-replie .d-menu { padding-left: var(--esp-2); padding-right: var(--esp-2); }
  .d-menu-replie .d-menu-libelle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .d-menu-replie .d-menu li a, .d-menu-replie .d-menu-replier button { justify-content: center; padding: 0; }
  .d-menu-replie .d-menu-capture { padding: 0; }
  .d-menu-replie .d-menu li a[aria-current="page"]::before { left: calc(-1 * var(--esp-2)); }
}

/* ===================== Accueil en zones (brief §5) ===================== */

.d-accueil { display: flex; flex-direction: column; }
.d-zones { display: grid; gap: var(--esp-4); }
.d-zone { padding: var(--esp-4); background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); }
.d-zone .d-section-titre { margin-bottom: var(--esp-2); min-height: 0; }
.d-zone .d-titre-section { font-size: var(--taille-texte); margin: 0; }
.d-zone-liste { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; font-size: var(--taille-secondaire); }
.d-zone-liste li { display: flex; justify-content: space-between; align-items: baseline; gap: var(--esp-2);
  min-height: 2rem; padding: var(--esp-1) 0; border-top: 1px solid var(--bord); }
.d-zone-liste li:first-child { border-top: 0; }
.d-zone-liste a, .d-zone-liste .d-zone-titre { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--texte) !important; text-decoration: none; }
.d-zone-liste a:hover { text-decoration: underline; }
.d-zone-meta { flex: none; color: var(--texte-secondaire); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.d-zone-meta.d-echeance-depassee { color: var(--urgent-texte); }
.d-zone-groupes { display: flex; gap: var(--esp-2); flex-wrap: wrap; margin: 0 0 var(--esp-2); }
.d-zones-changer { margin: var(--esp-2) 0 0; font-size: 0.8125rem; text-align: right; }
.d-zones-changer a { color: var(--texte-secondaire) !important; }

@media (min-width: 768px) {
  .d-zones { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  /* Haut : À faire + semaine ; la semaine reste visible au défilement mais s'arrête à la fin de ce bloc
     (elle ne passe jamais sur les zones de résumé, qui sont en dehors). */
  .d-accueil-haut { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem); gap: 0 var(--esp-6);
    align-items: start; }
  .d-accueil-semaine { position: sticky; top: var(--esp-4); }   /* plus d'en-tête au-dessus du contenu sur ordinateur */
  /* Dans la colonne de droite, la semaine garde la présentation « un jour par ligne ». */
  .d-accueil-semaine .d-semaine { display: flex; flex-direction: column; }
  .d-accueil-semaine .d-semaine-jour { grid-template-columns: 3.5rem minmax(0, 1fr); min-height: 0;
    border-left: 0; border-top: 1px solid var(--bord); }
  .d-accueil-semaine .d-semaine-jour:first-child { border-top: 0; }
  .d-accueil-semaine .d-semaine-date { flex-direction: column; align-items: flex-start; }
  .d-accueil-semaine .d-semaine-elements span { white-space: nowrap; }
}

/* Titre de la semaine avec flèches ‹ › ; « Voir en détail » en bas. */
.d-fleches { display: inline-flex; gap: var(--esp-1); }
.d-fleches .d-bouton-icone { margin: 0; width: 2rem; height: 2rem; position: relative; }
.d-fleches .d-bouton-icone::after { content: ""; position: absolute; inset: -0.375rem 0; }   /* zone tactile 44 px */
.d-semaine-pied { display: flex; justify-content: space-between; align-items: baseline; gap: var(--esp-3); flex-wrap: wrap;
  font-size: var(--taille-secondaire); }
.d-semaine-pied .d-aide { margin: var(--esp-2) 0 0; }
.d-actualiser { display: flex; align-items: center; justify-content: space-between; gap: var(--esp-2); flex-wrap: wrap;
  margin-top: var(--esp-3); font-size: var(--taille-secondaire); }

/* Menu replié : le contenu récupère la place libérée par le menu. */
@media (min-width: 1024px) {
  .d-menu-replie .d-contenu { max-width: calc(72rem + var(--largeur-menu) - var(--largeur-menu-replie)); }
}

/* ===================== Panneau de mise à jour (D2, étape 4) ===================== */
/* Téléphone : feuille qui monte du bas, plein écran. Ordinateur : panneau qui glisse depuis la droite. */

.d-feuille {
  position: fixed; inset: 0; margin: 0;
  width: 100%; max-width: none; height: 100%; max-height: none;
  padding: 0; border: 0; background: var(--surface); color: var(--texte);
  display: none; flex-direction: column; overflow: hidden;
  box-shadow: var(--ombre-3);
}
.d-feuille[open] { display: flex; animation: d-monte 0.2s ease-out; }
.d-feuille::backdrop { background: rgb(var(--teinte-ombre) / 0.4); }
@keyframes d-monte { from { transform: translateY(100%); } to { transform: none; } }
@keyframes d-glisse { from { transform: translateX(100%); } to { transform: none; } }

.d-feuille-tete {
  display: flex; align-items: center; justify-content: space-between; gap: var(--esp-3);
  padding: calc(var(--esp-3) + env(safe-area-inset-top)) var(--esp-4) var(--esp-3);
  border-bottom: 1px solid var(--bord);
}
.d-feuille-tete .d-titre-section { margin: 0; }
.d-feuille-fermer { margin: 0; }
.d-feuille-corps { flex: 1; overflow-y: auto; padding: var(--esp-4) var(--esp-4) calc(var(--esp-6) + env(safe-area-inset-bottom)); }
.d-feuille-sujet { margin: 0 0 var(--esp-3); font-weight: var(--graisse-moyenne); }
.d-feuille .d-actions { border-top: 0; padding-top: 0; margin-bottom: var(--esp-4); padding-bottom: var(--esp-4);
  border-bottom: 1px solid var(--bord); }
.d-feuille-pied { position: sticky; bottom: calc(-1 * var(--esp-6)); padding: var(--esp-3) 0; background: var(--surface); }

.d-formulaire { margin: 0; }
.d-champs-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--esp-3); }
.d-champ label .d-secondaire { font-weight: var(--graisse-normale); }

/* Sélecteur projet ou devis (macro commune suivis_macros.choix_lien), au nouveau style. */
.d-choix-dossier fieldset { border: 0; margin: 0; padding: 0; }
.d-choix-dossier legend { margin-bottom: var(--esp-1); font-weight: var(--graisse-moyenne); }
.d-choix-dossier .discret { color: var(--texte-secondaire); font-size: var(--taille-secondaire); }
.d-choix-dossier .choix-lien { display: flex; align-items: baseline; gap: var(--esp-2); min-height: 2rem; padding: var(--esp-1) 0;
  font-weight: var(--graisse-normale); font-size: var(--taille-secondaire); cursor: pointer; }
.d-choix-dossier .choix-lien input { accent-color: var(--accent); flex: none; }
.d-choix-dossier .choix-lien[hidden] { display: none; }
.d-choix-dossier .liste-liens .choix-lien.ancien { display: none; }
.d-choix-dossier fieldset:has(.voir-anciens input:checked) .choix-lien.ancien:not([hidden]) { display: flex; }
.d-choix-dossier .liste-liens .choix-lien.sous-projet { padding-left: var(--esp-5); }
.d-choix-dossier .autres-liens > summary { min-height: var(--cible-tactile); display: flex; align-items: center; cursor: pointer;
  color: var(--accent); font-weight: var(--graisse-moyenne); font-size: var(--taille-secondaire); }
.d-choix-dossier .filtre-liens { display: block; width: 100%; min-height: var(--cible-tactile); margin: 0 0 var(--esp-2);
  padding: var(--esp-2) var(--esp-3); border: 1px solid var(--bord-champ); border-radius: var(--rayon-petit);
  font: inherit; font-size: var(--taille-saisie); background: var(--surface); color: var(--texte); }
.d-choix-dossier .liste-liens { max-height: 16rem; overflow-y: auto; padding: var(--esp-1) var(--esp-3);
  border: 1px solid var(--bord); border-radius: var(--rayon-petit); }
.d-choix-dossier .voir-anciens { display: flex; gap: var(--esp-2); align-items: center; margin-top: var(--esp-2);
  font-size: var(--taille-secondaire); font-weight: var(--graisse-normale); }
@media (pointer: coarse) { .d-choix-dossier .filtre-liens { font-size: max(16px, var(--taille-saisie)); } }

@media (min-width: 1024px) {
  .d-feuille { left: auto; width: min(32rem, 100%); border-left: 1px solid var(--bord); }
  .d-feuille[open] { animation-name: d-glisse; }
}

/* Champ compact : l'intitulé est dans le cadre, en petit au-dessus de la valeur (panneau de mise à jour). */
.d-champ-int {
  position: relative; margin: 0 0 var(--esp-2); padding: 0.3rem var(--esp-3) 0.15rem;
  background: var(--surface); border: 1px solid var(--bord-champ); border-radius: var(--rayon-petit);
}
.d-champ-int:focus-within { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--accent); }
.d-champ-int label { display: block; margin: 0; font-size: 0.6875rem; font-weight: var(--graisse-moyenne);
  color: var(--texte-secondaire); line-height: 1.2; }
.d-champ-int .d-saisie { min-height: 1.75rem; padding: 0; border: 0; border-radius: 0; background-color: transparent; }
.d-champ-int .d-saisie:focus-visible { outline: none; }
.d-champ-int select.d-saisie { background-position: calc(100% - 8px) 50%, calc(100% - 3px) 50%; padding-right: var(--esp-4); }
.d-champ-int textarea.d-saisie { min-height: 2.75rem; }
.d-champs-2 > .d-champ-int { margin-bottom: var(--esp-2); }
.d-feuille .d-champs-2 { gap: 0 var(--esp-2); }
.d-feuille .d-choix-dossier { margin: var(--esp-1) 0 var(--esp-2); }
.d-feuille .d-choix-dossier legend { font-size: var(--taille-secondaire); }
.d-plus-details { margin: 0 0 var(--esp-2); }
.d-plus-details > summary { min-height: 2.25rem; }
.d-plus-details[open] > summary { margin-bottom: var(--esp-1); }
.d-feuille-corps { padding-top: var(--esp-3); }
.d-feuille .d-actions { gap: var(--esp-1); margin-bottom: var(--esp-3); padding-bottom: var(--esp-2); }
.d-feuille-sujet { margin-bottom: var(--esp-2); }

/* Carte dépliée condensée : « Projet et devis » et « Pourquoi… » côte à côte ; actions sur une ligne. */
.d-corps-suivi { display: flex; flex-wrap: wrap; gap: 0 var(--esp-4); align-items: center; }
.d-corps-suivi > dl { flex-basis: 100%; }
.d-corps-suivi .coulisses { margin-top: var(--esp-1); }
.d-corps-suivi .coulisses > summary { min-height: 2rem; font-size: var(--taille-secondaire); }
.d-corps-suivi .coulisses[open] { order: 10; flex-basis: 100%; }
.d-actions-carte { padding-top: var(--esp-2); }
.d-actions-carte > .d-boutons { gap: var(--esp-2) var(--esp-3); }
.d-actions-carte .d-lien-action { min-height: var(--hauteur-bouton); }

/* ===================== Pages au nouveau style (D3) ===================== */

.d-intro { margin: 0; max-width: 40rem; }

/* Groupes repliables (En attente, Projets…) */
.d-groupe { margin: 0 0 var(--esp-5); }
.d-groupe > summary {
  display: flex; align-items: center; gap: var(--esp-2);
  min-height: var(--cible-tactile); margin-bottom: var(--esp-2); cursor: pointer; list-style: none;
}
.d-groupe > summary::-webkit-details-marker { display: none; }
.d-groupe > summary .d-titre-section { margin: 0; }
.d-groupe > summary .d-icone { color: var(--texte-secondaire); transition: transform 0.15s; }
.d-groupe[open] > summary .d-icone { transform: rotate(90deg); }

/* Filtres par personne : pastilles qu'on allume / éteint ; ligne 1 « Interne », ligne 2 les personnes. */
.d-pastilles-filtre { display: flex; flex-direction: column; gap: var(--esp-2); margin: var(--esp-3) 0 var(--esp-5); }
.d-pastilles-ligne { display: flex; flex-wrap: wrap; gap: var(--esp-2); align-items: center; }
.d-pastille-filtre {
  display: inline-flex; flex-direction: column; justify-content: center; min-height: var(--hauteur-bouton);
  padding: 0.125rem var(--esp-3); line-height: 1.15;
  border: 1px solid var(--bord-champ); border-radius: var(--rayon-pilule);
  color: var(--texte) !important; text-decoration: none; font-size: var(--taille-secondaire);
}
.d-pastille-filtre small { font-size: 0.625rem; color: var(--texte-secondaire); }
.d-pastille-filtre:hover { background: var(--survol); }
.d-pastille-filtre[aria-pressed="true"] { background: var(--accent-clair); border-color: var(--accent-sur-clair);
  color: var(--accent-sur-clair) !important; font-weight: var(--graisse-moyenne); }
.d-pastille-filtre[aria-pressed="true"] small { color: var(--accent-sur-clair); }
.d-pastille-filtre[aria-disabled="true"] { color: var(--texte-secondaire) !important; cursor: default; background: none; }
.d-pastille-interne { border-style: dashed; }

/* En attente : ligne « N attentes à relancer » (filtre) ; semaine à droite sur ordinateur seulement. */
.d-relancer { margin: var(--esp-3) 0 0; font-size: var(--taille-secondaire); font-weight: var(--graisse-moyenne); }
.d-relancer a, .d-relancer span { display: inline-flex; align-items: center; gap: var(--esp-1); color: var(--urgent-texte) !important; }
.d-relancer .d-icone { color: var(--urgent); }
.d-semaine-laterale { display: none; }
@media (min-width: 1024px) { .d-semaine-laterale { display: block; } }

/* À valider : étiquette de ce qu'il faut décider, proposition de l'assistant, confiance des dossiers candidats. */
.d-carte-valider::before { background: var(--accent); }
.d-carte-valider .d-carte-prio { color: var(--accent); }
.d-etiquette-mini { padding: 0 var(--esp-1); font-size: 0.6875rem; margin-right: var(--esp-1); }
.d-proposition { padding: var(--esp-2) var(--esp-3); background: var(--survol); border-radius: var(--rayon-petit); }
.d-proposition p { margin: 0 0 var(--esp-1); }
.d-proposition p:last-child { margin-bottom: 0; }
.d-liste-simple { margin: 0 0 var(--esp-1); padding-left: var(--esp-3); }
.d-liste-simple li { margin-bottom: var(--esp-1); }
.d-avertissement { margin: 0; color: var(--important-texte); }
.d-choix-dossier .confiance { display: inline-block; margin-left: var(--esp-1); padding: 0 var(--esp-1);
  border: 1px solid currentColor; border-radius: var(--rayon-petit); font-size: 0.6875rem; }
.d-choix-dossier .confiance-fort { color: var(--statut-termine-texte); }
.d-choix-dossier .confiance-moyen { color: var(--important-texte); }
.d-choix-dossier .confiance-faible { color: var(--texte-secondaire); }
.d-actions-carte .d-saisie-courte { flex: 1 1 14rem; }

/* Projets : recherche, portée, cartes (icône dossier / devis), liste des suivis d'un projet. */
.d-recherche { display: flex; gap: var(--esp-2); margin: 0 0 var(--esp-2); max-width: 32rem; }
.d-recherche .d-saisie { flex: 1; }
.d-portee { margin: 0 0 var(--esp-5); }
.d-carte-projet::before { background: var(--bord); }
.d-carte-projet .d-carte-prio { color: var(--texte-secondaire); }
.d-corps-suivi .texte-rouge { color: var(--urgent-texte); }
.d-suivis-projet { margin: 0; padding: 0; list-style: none; }
.d-suivis-projet li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--esp-1); padding: 0.125rem 0; }
.d-mini-prio .d-icone { width: 0.9rem; height: 0.9rem; vertical-align: -0.1em; }
.d-mini-urgent { color: var(--urgent); }
.d-mini-important { color: var(--important); }
.d-mini-info, .d-mini-aucune { color: var(--info); }

/* ===================== Formulaires « classiques » au nouveau style (D3, étape 4) =====================
   Capture, confirmation d'une capture, nouveau suivi, page Modifier : leurs éléments existants (classes héritées
   de style.css) sont habillés ici, dans le conteneur .d-classique ; les formulaires eux-mêmes ne changent pas. */

.d-classique { max-width: 48rem; }
.d-classique label { display: block; margin: var(--esp-3) 0 var(--esp-1); font-weight: var(--graisse-moyenne); font-size: var(--taille-secondaire); }
.d-classique input:not([type=radio]):not([type=checkbox]):not([type=hidden]):not([type=file]),
.d-classique select, .d-classique textarea {
  display: block; width: 100%; min-height: var(--cible-tactile); padding: var(--esp-2) var(--esp-3);
  background: var(--surface); color: var(--texte); border: 1px solid var(--bord-champ); border-radius: var(--rayon-petit);
  font: inherit; font-size: var(--taille-saisie);
}
@media (pointer: coarse) {
  .d-classique input:not([type=radio]):not([type=checkbox]), .d-classique select, .d-classique textarea { font-size: max(16px, var(--taille-saisie)); }
}
.d-classique textarea { resize: vertical; }
.d-classique input:focus-visible, .d-classique select:focus-visible, .d-classique textarea:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--accent); }
.d-classique input[type=radio], .d-classique input[type=checkbox] { accent-color: var(--accent); width: auto; }
.d-classique input[type=file] { font: inherit; font-size: var(--taille-secondaire); }

.d-classique button {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--esp-1);
  min-height: var(--hauteur-bouton); margin-top: var(--esp-4); padding: 0 var(--esp-4);
  background: var(--accent); color: var(--sur-accent); border: 1px solid transparent; border-radius: var(--rayon-petit);
  font: inherit; font-size: var(--taille-secondaire); font-weight: var(--graisse-moyenne); cursor: pointer;
}
.d-classique button:hover { background: var(--accent-survol); }
.d-classique button.secondaire { background: var(--surface); color: var(--accent); border-color: var(--accent); }
.d-classique button.secondaire:hover { background: var(--accent-clair); color: var(--accent-sur-clair); }
.d-classique button.petit { margin-top: 0; }
.d-classique .bouton, .d-classique .secondaire-bouton {
  display: inline-flex; align-items: center; min-height: var(--hauteur-bouton); padding: 0 var(--esp-4);
  border: 1px solid var(--accent); border-radius: var(--rayon-petit); color: var(--accent) !important;
  text-decoration: none; font-size: var(--taille-secondaire); font-weight: var(--graisse-moyenne);
}
.d-classique .annuler-lien { margin-left: var(--esp-3); font-size: var(--taille-secondaire); }

.d-classique .discret { color: var(--texte-secondaire); font-size: var(--taille-secondaire); }
.d-classique label .discret { font-weight: var(--graisse-normale); }
.d-classique .petit-texte { font-size: 0.8125rem; margin: var(--esp-1) 0 0; }
.d-classique .texte-orange { color: var(--important-texte); }
.d-classique .texte-libre { white-space: pre-line; }
.d-classique .alerte { color: var(--urgent-texte); font-weight: var(--graisse-moyenne); }
.d-classique .explication { margin: 0 0 var(--esp-3); color: var(--accent-sur-clair); }

.d-classique .bandeau { margin: 0 0 var(--esp-4); padding: var(--esp-2) var(--esp-3); border-radius: var(--rayon-petit);
  font-weight: var(--graisse-moyenne); font-size: var(--taille-secondaire); }
.d-classique .bandeau-vert { background: var(--statut-termine-fond); color: var(--statut-termine-texte); }
.d-classique .bandeau-orange { background: var(--important-fond); color: var(--important-texte); }
.d-classique .bandeau-rouge { background: var(--urgent-fond); color: var(--urgent-texte); }
.d-classique .doublons ul { margin: var(--esp-1) 0; padding-left: var(--esp-5); font-weight: var(--graisse-normale); }

.d-classique .deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--esp-3); }
.d-classique fieldset { border: 0; margin: var(--esp-3) 0 0; padding: 0; min-width: 0; }
.d-classique legend { font-weight: var(--graisse-moyenne); font-size: var(--taille-secondaire); margin-bottom: var(--esp-1); padding: 0; }
.d-classique .raccourcis .choix, .d-classique .dates-candidates .choix {
  display: inline-flex; align-items: center; gap: var(--esp-1); margin: var(--esp-1) var(--esp-3) var(--esp-1) 0;
  font-weight: var(--graisse-normale); }
.d-classique .dates-candidates { display: flex; flex-wrap: wrap; }
.d-classique .plus-de-champs { margin-top: var(--esp-3); }
.d-classique .plus-de-champs > summary { min-height: var(--cible-tactile); display: flex; align-items: center; cursor: pointer;
  color: var(--accent); font-weight: var(--graisse-moyenne); font-size: var(--taille-secondaire); }

/* Sélecteur projet ou devis et recherche (mêmes règles que dans le panneau). */
.d-classique .choix-lien { display: flex; align-items: baseline; gap: var(--esp-2); margin: 0; padding: var(--esp-1) 0;
  font-weight: var(--graisse-normale); font-size: var(--taille-secondaire); cursor: pointer; }
.d-classique .choix-lien[hidden] { display: none; }
.d-classique .liste-liens .choix-lien.ancien { display: none; }
.d-classique fieldset:has(.voir-anciens input:checked) .choix-lien.ancien:not([hidden]) { display: flex; }
.d-classique .liste-liens .choix-lien.sous-projet { padding-left: var(--esp-5); }
.d-classique .autres-liens > summary { min-height: var(--cible-tactile); display: flex; align-items: center; cursor: pointer;
  color: var(--accent); font-weight: var(--graisse-moyenne); font-size: var(--taille-secondaire); }
.d-classique .liste-liens { max-height: 16rem; overflow-y: auto; padding: var(--esp-1) var(--esp-3);
  border: 1px solid var(--bord); border-radius: var(--rayon-petit); }
.d-classique .filtre-liens { margin-bottom: var(--esp-2); }
.d-classique .voir-anciens { display: flex; gap: var(--esp-2); align-items: center; font-weight: var(--graisse-normale); }

/* Capture : texte d'origine, alertes, cartes d'éléments à confirmer, dernières captures. */
.d-classique .texte-brut { padding: var(--esp-3); background: var(--survol); border-radius: var(--rayon); margin-bottom: var(--esp-4); }
.d-classique .texte-brut h2 { margin: 0 0 var(--esp-1); font-size: var(--taille-secondaire); }
.d-classique .texte-brut p { margin: 0; }
.d-classique .alertes-capture { margin: 0 0 var(--esp-4); padding: var(--esp-2) var(--esp-3) var(--esp-2) var(--esp-6);
  background: var(--important-fond); color: var(--important-texte); border-radius: var(--rayon-petit); font-size: var(--taille-secondaire); }
.d-classique .carte { margin: var(--esp-3) 0 0; padding: var(--esp-2) var(--esp-4) var(--esp-4); background: var(--surface);
  border: 1px solid var(--bord); border-radius: var(--rayon); }
.d-classique .carte-nouvelle { border-style: dashed; }
.d-classique .carte legend { padding: 0 var(--esp-1); }
.d-classique .carte label { margin-top: var(--esp-2); }
.d-classique .garder { display: inline-flex; align-items: center; gap: var(--esp-2); margin: 0; }
.d-classique .genre { font-size: 0.75rem; font-weight: var(--graisse-forte); text-transform: uppercase; letter-spacing: 0.03em; color: var(--accent-sur-clair); }
.d-classique .genre-attente { color: var(--important-texte); }
.d-classique .genre-decision, .d-classique .genre-livrable-termine { color: var(--statut-termine-texte); }
.d-classique .actions-capture { display: flex; gap: var(--esp-2); margin: var(--esp-4) 0; }
.d-classique .captures { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--esp-2); font-size: var(--taille-secondaire); }
.d-classique .sous-liste { margin: var(--esp-1) 0; padding-left: var(--esp-5); }
.d-classique .bloc { margin-top: var(--esp-6); }
.d-classique .bloc-titre h2 { font-size: var(--taille-titre-section); margin: 0 0 var(--esp-2); }
.d-menu-capture[aria-current="page"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.d-onglets .d-onglet-capture[aria-current="page"] svg { color: var(--sur-accent); }   /* le « + » reste blanc sur son rond */

/* Pages de gestion (Système, Tri des mails, Tri rapide, fiche d'un mail, délais) : mêmes éléments hérités. */
.d-classique.d-large { max-width: none; }
.d-classique .carte { padding: var(--esp-4); margin: 0 0 var(--esp-4); }
.d-classique .carte h2, .d-classique h2 { font-size: var(--taille-titre-section); margin: 0 0 var(--esp-2); }
.d-classique .sous-titre { font-size: var(--taille-texte); margin: var(--esp-3) 0 var(--esp-1); }
.d-classique .bloc-titre { display: flex; align-items: baseline; justify-content: space-between; gap: var(--esp-3); flex-wrap: wrap; }
.d-classique .compteur { display: inline-block; min-width: 1.4rem; padding: 0 var(--esp-1); border-radius: var(--rayon-pilule);
  background: var(--accent-clair); color: var(--accent-sur-clair); font-size: 0.75rem; font-weight: var(--graisse-moyenne); text-align: center; }
.d-classique .texte-vert { color: var(--statut-termine-texte); }
.d-classique .texte-rouge { color: var(--urgent-texte); }

.d-classique .pastilles { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--esp-2); font-size: var(--taille-secondaire); }
.d-classique .pastille { display: flex; align-items: center; gap: var(--esp-2); flex-wrap: wrap; }
.d-classique .point { width: 0.6rem; height: 0.6rem; border-radius: 50%; flex: none; background: var(--bord-champ); }
.d-classique .point-vert { background: var(--ok); }
.d-classique .point-orange { background: var(--important); }
.d-classique .point-jaune { background: var(--important); }
.d-classique .point-rouge { background: var(--urgent); }

.d-classique .jauges { display: grid; gap: var(--esp-3); }
@media (min-width: 768px) { .d-classique .carte .jauges { grid-template-columns: repeat(3, 1fr); } }
.d-classique .jauge-titre { display: flex; justify-content: space-between; font-size: var(--taille-secondaire); }
.d-classique .jauge-barre { display: block; width: 100%; height: 0.4rem; margin: var(--esp-1) 0; }
.d-classique .jauge-fond { fill: var(--statut-neutre-fond); }
.d-classique .barre-vert { fill: var(--ok); }
.d-classique .barre-orange { fill: var(--important); }
.d-classique .barre-rouge { fill: var(--urgent); }
.d-classique .chiffres { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--esp-3); margin: 0 0 var(--esp-4); }
@media (min-width: 768px) { .d-classique .chiffres { grid-template-columns: repeat(4, 1fr); } }
.d-classique .chiffres dt { font-size: 0.8125rem; color: var(--texte-secondaire); }
.d-classique .chiffres dd { margin: 0; font-weight: var(--graisse-forte); font-variant-numeric: tabular-nums; }
.d-classique .executions { list-style: none; margin: 0 0 var(--esp-2); padding: 0; display: grid; gap: var(--esp-2); font-size: var(--taille-secondaire); }
.d-classique .executions li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-1) var(--esp-2); }
.d-classique .actions { display: flex; flex-wrap: wrap; gap: 0 var(--esp-3); }
.d-classique .reglages input { max-width: 12rem; }
.d-classique .choix-pseudo select { max-width: 24rem; }

/* Feuille de temps : mes horaires (Système, lot 12) */
.d-classique .horaires-jour { border: 1px solid var(--bord); border-radius: var(--rayon); margin: 0 0 var(--esp-2);
  padding: var(--esp-2) var(--esp-3) var(--esp-3); display: grid; grid-template-columns: 4.5rem minmax(0, 8rem) minmax(0, 9rem);
  gap: var(--esp-2) var(--esp-3); align-items: center; }
.d-classique .horaires-jour legend { font-weight: var(--graisse-forte); padding: 0 var(--esp-1); }
.d-classique .horaires-jour label { margin: 0; }
.d-classique .horaires-jour input, .d-classique .horaires-jour select { width: 100%; margin: 0; }
.d-classique .horaires-ok { background: var(--statut-termine-fond); color: var(--statut-termine-texte);
  padding: var(--esp-2) var(--esp-3); border-radius: var(--rayon); }
.d-classique .horaires-erreur { background: var(--urgent-fond); color: var(--urgent-texte);
  padding: var(--esp-2) var(--esp-3); border-radius: var(--rayon); }

/* Listes de lignes dépliables (Tri des mails, fiche d'un mail) */
.d-classique .lignes { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; }
.d-classique .ligne + .ligne { border-top: 1px solid var(--bord); }
.d-classique .ligne > summary { display: flex; flex-direction: column; gap: 2px; padding: var(--esp-2) var(--esp-3); cursor: pointer; list-style: none; }
.d-classique .ligne > summary::-webkit-details-marker { display: none; }
.d-classique .ligne > summary:hover { background: var(--survol); }
@media (min-width: 768px) {
  .d-classique .ligne > summary { flex-direction: row; justify-content: space-between; align-items: baseline; gap: var(--esp-3); }
  .d-classique .ligne-meta { text-align: right; flex: none; max-width: 50%; }
}
.d-classique .ligne-titre { font-weight: var(--graisse-moyenne); font-size: var(--taille-secondaire); line-height: 1.3; }
.d-classique .ligne-meta { color: var(--texte-secondaire); font-size: 0.8125rem; }
.d-classique .detail { margin: 0; padding: var(--esp-2) var(--esp-3); display: grid; gap: var(--esp-1); font-size: var(--taille-secondaire); }
.d-classique .detail > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: var(--esp-2); }
.d-classique .detail dt { color: var(--texte-secondaire); }
.d-classique .detail dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .d-classique .detail > div { grid-template-columns: 1fr; gap: 0; } }
.d-classique .coulisses { padding: 0 var(--esp-3) var(--esp-2); font-size: var(--taille-secondaire); }
.d-classique .coulisses > summary { color: var(--accent); font-weight: var(--graisse-moyenne); cursor: pointer; min-height: 2rem; display: flex; align-items: center; }
.d-classique .actions-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-2) var(--esp-3); padding: 0 var(--esp-3) var(--esp-3); }
.d-classique .action-groupe { display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-2); }
.d-classique .action-groupe form { display: contents; }
.d-classique .action-groupe input[type="text"], .d-classique .reclasser input[type="text"] { flex: 1 1 12rem; width: auto; min-width: 0; min-height: var(--hauteur-bouton); }
.d-classique .reclasser { display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-2); width: 100%; }
.d-classique .important { display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-1) var(--esp-2); }
.d-classique .texte-mail .texte-libre { margin-top: var(--esp-2); }

/* Onglets et filtres du tri ; tableau des délais ; alertes ; tri rapide */
.d-classique .onglets, .d-classique .filtres { display: flex; flex-wrap: wrap; gap: var(--esp-2); margin: 0 0 var(--esp-3); align-items: center; }
.d-classique .onglets a, .d-classique .filtre {
  display: inline-flex; align-items: center; gap: var(--esp-1); min-height: var(--hauteur-bouton); padding: 0 var(--esp-3);
  border: 1px solid var(--bord-champ); border-radius: var(--rayon-pilule); color: var(--texte) !important; text-decoration: none;
  font-size: var(--taille-secondaire); }
.d-classique .onglets a[aria-current="page"], .d-classique .filtre.actif {
  background: var(--accent-clair); border-color: var(--accent-sur-clair); color: var(--accent-sur-clair) !important; font-weight: var(--graisse-moyenne); }
.d-classique .tableau-delais { width: 100%; border-collapse: collapse; font-size: var(--taille-secondaire); font-variant-numeric: tabular-nums; }
.d-classique .tableau-delais th, .d-classique .tableau-delais td { text-align: left; padding: var(--esp-1) var(--esp-2); border-bottom: 1px solid var(--bord); }
.d-classique .tableau-delais th { color: var(--texte-secondaire); font-weight: var(--graisse-moyenne); }
.d-classique .alertes { display: grid; gap: var(--esp-2); margin: 0 0 var(--esp-4); }
.d-classique .alerte-ligne { padding: var(--esp-2) var(--esp-3); border-radius: var(--rayon-petit); border: 1px solid var(--bord); }
.d-classique .alerte-rouge { background: var(--urgent-fond); color: var(--urgent-texte); }
.d-classique .alerte-orange { background: var(--important-fond); color: var(--important-texte); }
.d-classique .alerte-texte { white-space: pre-line; margin: var(--esp-2) 0; font-size: var(--taille-secondaire); color: var(--texte); }
.d-classique .lignes-tri .ligne-titre { font-weight: var(--graisse-normale); }
.d-classique .ligne-tri { display: grid; grid-template-columns: auto 1fr; gap: 0 var(--esp-2); padding: var(--esp-2) var(--esp-3); margin: 0;
  font-weight: var(--graisse-normale); cursor: pointer; }
.d-classique .ligne-tri + .ligne-tri { border-top: 1px solid var(--bord); }
/* Case seule à gauche (taille fixe, en haut), titre puis ligne grise empilés à droite */
.d-classique .ligne-tri input[type=checkbox] { grid-row: 1 / span 2; align-self: start; justify-self: start;
  width: 1.125rem; height: 1.125rem; margin: 0.15rem 0 0; }
.d-classique .ligne-tri .ligne-titre { grid-column: 2; font-weight: var(--graisse-moyenne); text-align: left; }
.d-classique .ligne-tri .ligne-meta { grid-column: 2; text-align: left; color: var(--texte-secondaire);
  font-size: var(--taille-secondaire); }
.d-classique .barre-tri { margin-bottom: var(--esp-3); }
.d-classique .barre-tri button { margin-top: 0; }
.d-classique .a-venir { color: var(--texte-secondaire); }
.d-classique .source { font-size: 0.75rem; color: var(--texte-secondaire); border: 1px solid var(--bord); border-radius: var(--rayon-petit); padding: 0 var(--esp-1); white-space: nowrap; }

/* Pages sans menu (connexion, erreur) : une boîte centrée. */
.d-seul { display: grid; place-items: center; min-height: 100vh; padding: var(--esp-4); background: var(--fond-menu); }
@media (min-width: 1024px) {   /* sans menu : la grille « menu + contenu » des autres pages ne s'applique pas */
  .d-corps.d-seul { grid-template-columns: 1fr; grid-template-rows: 1fr; }
}
.d-seul-boite { width: 100%; max-width: 22rem; padding: var(--esp-6) var(--esp-5); background: var(--surface);
  border: 1px solid var(--bord); border-radius: var(--rayon-grand); box-shadow: var(--ombre-2); }
.d-seul-logo { display: block; margin: 0 auto var(--esp-4); }
.d-seul-boite .d-titre-page { text-align: center; }
.d-seul-boite button { width: 100%; }

/* Drapeau « Signaler un problème » au bout de la ligne d'actions d'une carte. */
.d-actions-carte .d-signaler { margin: 0 0 0 auto; }

/* Anti-oubli (lot 6) : dans la zone de l'accueil, cartes plus serrées ; décisions annulables. */
.d-zone-oublis .d-cartes { gap: var(--esp-1); }
.d-zone-oublis .d-carte-lien { white-space: normal; }
.d-zone-oublis .d-actions-carte .d-bouton { padding: 0 var(--esp-2); }
.d-en-ligne { display: inline; margin: 0 0 0 var(--esp-2); }
.d-en-ligne .d-lien-action { min-height: 0; }
.d-carte-detail .sous-liste { margin: var(--esp-1) 0 0; padding-left: var(--esp-5); }

/* Profil rédactionnel (lot 7a) : lecture confortable du texte de l'utilisateur, saisie en grand */
.d-classique .profil-texte { max-width: 44rem; line-height: 1.55; }
.d-classique .profil-texte h2 { font-size: var(--taille-titre-section); margin: var(--esp-6) 0 var(--esp-2); }
.d-classique .profil-texte h3 { font-size: var(--taille-texte); margin: var(--esp-6) 0 var(--esp-2); }
.d-classique .profil-texte h4 { font-size: var(--taille-texte); margin: var(--esp-4) 0 var(--esp-1); }
.d-classique .profil-texte p { margin: 0 0 var(--esp-3); }
.d-classique .profil-texte ul, .d-classique .profil-texte ol { margin: 0 0 var(--esp-3); padding-left: var(--esp-6); }
.d-classique .profil-saisie { width: 100%; min-height: 60vh; line-height: 1.5; }
.d-classique .liste-versions { margin: 0; padding-left: var(--esp-4); }
.d-classique .liste-versions li { margin: var(--esp-1) 0; }
.d-classique .tableau-defilant { overflow-x: auto; }   /* tableau large : il défile seul, jamais la page */
.d-classique .carte-validation .texte-validation { margin: var(--esp-2) 0 var(--esp-3); padding-left: var(--esp-3);
  border-left: 3px solid var(--bord); line-height: 1.5; }
.d-classique .ligne-decision { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--esp-1) var(--esp-3); }
.d-classique .liste-registres { list-style: none; margin: var(--esp-4) 0 0; padding: 0; display: grid; gap: var(--esp-2); }
.d-classique .liste-registres .carte { margin: 0; }
.d-classique .liste-registres p { margin: var(--esp-1) 0 var(--esp-2); }
.d-classique .apercu-signature { padding: var(--esp-3); border: 1px solid var(--bord); border-radius: var(--rayon-petit); }

/* Brouillons (lot 7b) : aperçu comme dans un mail (texte, signature, historique) */
.d-classique .apercu-mail { margin: var(--esp-3) 0; padding: var(--esp-4); border: 1px solid var(--bord);
  border-radius: var(--rayon-petit); line-height: 1.5; }
.d-classique .apercu-signature-mail { margin-top: var(--esp-2); }
.d-classique .apercu-historique { margin: var(--esp-3) 0 0; padding-top: var(--esp-2); border-top: 1px solid var(--bord); }
.d-classique .brouillon-saisie { width: 100%; min-height: 40vh; line-height: 1.5; }
.d-classique .actions-brouillon { align-items: center; gap: var(--esp-2) var(--esp-3); margin-bottom: var(--esp-4); }
.d-classique .regenerer { display: grid; gap: var(--esp-1); }
.d-classique .regenerer button { justify-self: start; }
.d-classique .version-precedente { margin: var(--esp-3) 0; padding-left: var(--esp-3); border-left: 3px solid var(--bord); }

/* Traitement long en cours (lot 7b) : roue avant le texte du bouton (panneau.js, data-attente) */
.d-en-cours::before { content: ""; display: inline-block; width: 0.9em; height: 0.9em; margin-right: 0.45em;
  vertical-align: -0.12em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: d-tourne 0.8s linear infinite; }
@keyframes d-tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .d-en-cours::before { animation: none; border-right-color: currentColor; } }
.d-classique .liste-retouches { margin: var(--esp-2) 0 0; padding: 0; list-style: none; display: grid; gap: var(--esp-2); }
.d-classique .liste-retouches del { color: var(--urgent-texte); }
.d-classique .liste-retouches ins { color: var(--statut-termine-texte); text-decoration: none; font-weight: var(--graisse-moyenne); }
.proposition-profil del { color: var(--urgent-texte); }
.proposition-profil ins { color: var(--statut-termine-texte); text-decoration: none; font-weight: var(--graisse-moyenne); }

/* ===== Message après un choix (« Reporté au 02/11 : … · Annuler »), en bas, au-dessus de la barre d'onglets ===== */
.d-message-choix {
  position: fixed; z-index: 30; left: var(--esp-4); right: var(--esp-4);
  bottom: calc(4.5rem + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: var(--esp-3);
  padding: var(--esp-2) var(--esp-2) var(--esp-2) var(--esp-4);
  background: var(--message-fond); color: var(--message-texte);
  border-radius: var(--rayon); box-shadow: var(--ombre-3);
  font-size: var(--taille-secondaire); line-height: var(--interligne-serre);
  animation: d-message-part 0.3s ease 10s forwards;
}
.d-message-choix[hidden] { display: none; }
.d-message-choix span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.d-message-choix button {
  flex: none; min-height: var(--cible-tactile); padding: 0 var(--esp-3);
  background: none; border: 0; border-radius: var(--rayon-petit); cursor: pointer;
  color: var(--message-bouton); font: inherit; font-weight: var(--graisse-moyenne);
}
.d-message-choix button:focus-visible { outline: 2px solid var(--message-bouton); }
@keyframes d-message-part { to { opacity: 0; visibility: hidden; } }
@media (min-width: 1024px) {
  .d-message-choix { left: auto; right: var(--esp-5); bottom: var(--esp-5); max-width: 32rem; }
}

/* FAQ (lot 10b) : accordéons par thème puis par question, réponses lisibles sur téléphone. */
.d-faq-chapeau { margin-bottom: var(--esp-5); }
.d-faq { max-width: 46rem; }
.d-faq-theme { margin-bottom: var(--esp-3); border-bottom: 1px solid var(--bord); }
.d-faq-theme > summary { margin-bottom: 0; }
.d-faq-contenu { padding: 0 0 var(--esp-3) var(--esp-5); }
.d-faq-intro p { margin: 0 0 var(--esp-2); }
.d-faq-question { border-top: 1px solid var(--bord); }
.d-faq-question > summary {
  display: flex; align-items: flex-start; gap: var(--esp-2); padding: var(--esp-3) 0;
  min-height: var(--cible-tactile); cursor: pointer; list-style: none;
  font-weight: var(--graisse-moyenne); line-height: var(--interligne-serre);
}
.d-faq-question > summary::-webkit-details-marker { display: none; }
.d-faq-question > summary:hover { background: var(--survol); }
.d-faq-question > summary .d-icone { flex: none; margin-top: 0.05rem; color: var(--texte-secondaire); transition: transform 0.15s; }
.d-faq-question[open] > summary .d-icone { transform: rotate(90deg); }
.d-faq-reponse { padding: 0 0 var(--esp-4) var(--esp-5); line-height: var(--interligne); }
.d-faq-reponse p { margin: 0 0 var(--esp-3); }
.d-faq-reponse ul, .d-faq-reponse ol { margin: 0 0 var(--esp-3); padding-left: var(--esp-5); }
.d-faq-reponse li { margin-bottom: var(--esp-1); }
.d-faq-reponse li > p { margin: var(--esp-1) 0; }
.d-faq-reponse code { font-size: 0.875em; padding: 0 0.2em; background: var(--survol); border-radius: var(--rayon-petit); overflow-wrap: anywhere; }
.d-faq-reponse pre { margin: 0 0 var(--esp-3); padding: var(--esp-2) var(--esp-3); background: var(--survol);
  border: 1px solid var(--bord); border-radius: var(--rayon-petit); overflow-x: auto; }
.d-faq-reponse pre code { padding: 0; background: none; overflow-wrap: normal; }
.d-faq-reponse blockquote { margin: 0 0 var(--esp-3); padding-left: var(--esp-3); border-left: 3px solid var(--sauge); }
.d-faq-reponse a { color: var(--accent); }
.d-faq-table { overflow-x: auto; margin: 0 0 var(--esp-3); }
.d-faq-table table { border-collapse: collapse; font-size: var(--taille-secondaire); }
.d-faq-table th, .d-faq-table td { padding: var(--esp-1) var(--esp-2); border: 1px solid var(--bord); text-align: left; vertical-align: top; }
@media (prefers-reduced-motion: reduce) { .d-faq-question > summary .d-icone { transition: none; } }
.d-faq-recherche { max-width: 46rem; margin: 0 0 var(--esp-4); }
.d-faq-recherche .d-saisie { width: 100%; }
.d-faq-resultat { margin: var(--esp-2) 0 0; min-height: 1.25rem; }
.d-faq mark { background: var(--surlignage); color: var(--texte); border-radius: 2px; padding: 0 1px; }
.d-faq-lien { margin: 0; }
.d-faq-lien .d-lien-action { min-height: var(--hauteur-bouton); }
.d-faq-question:target > summary, .d-faq-theme:target > summary { background: var(--survol); }
.d-faq-question, .d-faq-theme { scroll-margin-top: 4.5rem; }   /* pas caché sous l'en-tête fixe */
.d-faq-poser { margin: var(--esp-3) 0 0; padding: var(--esp-3) var(--esp-4); border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); }
.d-faq-poser p { margin: 0 0 var(--esp-3); overflow-wrap: anywhere; }
.d-faq-poser p:last-child { margin: var(--esp-3) 0 0; }
.d-faq-merci { max-width: 46rem; margin: 0 0 var(--esp-4); padding: var(--esp-2) var(--esp-3); border-radius: var(--rayon-petit);
  background: var(--accent-clair); color: var(--accent-sur-clair); }

/* Lien « ? » à côté du titre de chaque page : vers le thème de l'aide qui la concerne (lot 10b). */
.d-titre-ligne { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--esp-3); margin: 0 0 var(--esp-5); }
.d-titre-ligne .d-titre-page { margin: 0; }
/* Nom propre (« d-aide-page ») : « d-aide » est le petit texte d'aide (légende de la semaine, aides de champ). */
.d-aide-page {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: var(--cible-tactile); height: var(--cible-tactile); margin: -0.5rem -0.625rem 0 0;
  color: var(--texte-secondaire); border-radius: var(--rayon-pilule);
}
.d-aide-page svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.d-aide-page:hover { color: var(--accent); background: var(--survol); }
@media (min-width: 1024px) {   /* le triangle d'alerte occupe le coin en haut à droite : le « ? » suit le titre */
  .d-titre-ligne { justify-content: flex-start; }
  .d-aide-page { margin: -0.375rem 0 0 -0.25rem; }
}

/* Nouveautés (lot 10c) : journal lisible, pastille « Nouveau » tant que la dernière entrée n'est pas vue. */
.d-nouveautes { max-width: 46rem; }
.d-nouveaute { padding: 0 0 var(--esp-3); margin: 0 0 var(--esp-4); border-bottom: 1px solid var(--bord); }
.d-nouveaute .d-titre-section { margin: 0 0 var(--esp-2); }
.d-nouveaute .d-faq-reponse { padding: 0; }
.d-pastille-nouveau {
  display: inline-block; margin-left: var(--esp-1); padding: 0 var(--esp-2); border-radius: var(--rayon-pilule);
  background: var(--accent-clair); color: var(--accent-sur-clair);
  font-size: 0.75rem; font-weight: var(--graisse-moyenne); line-height: 1.5; vertical-align: middle;
}
.d-menu-replie .d-menu .d-pastille-nouveau { display: none; }

/* Feuille de temps : page « Ma journée » (lot 12) */
.d-temps-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-2) var(--esp-3); margin-bottom: var(--esp-3); }
.d-temps-furious { margin-left: auto; }
.d-temps-nav a[aria-label] { font-size: 1.5rem; line-height: 1; padding: 0 var(--esp-2); text-decoration: none; min-width: 44px; text-align: center; }
.d-temps-total { margin-bottom: var(--esp-3); }
.d-temps-liste { list-style: none; margin: 0 0 var(--esp-4); padding: 0; display: grid; gap: var(--esp-2); }
.d-temps-liste > li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--esp-2);
  padding: var(--esp-2) var(--esp-3); border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); }
.d-temps-heure { font-variant-numeric: tabular-nums; color: var(--texte-secondaire); font-size: var(--taille-secondaire); }
.d-temps-trou { border-style: dashed !important; background: transparent !important; color: var(--texte-secondaire); }
.d-temps-saisi { background: var(--statut-termine-fond) !important; }
.d-temps-a-confirmer { border-style: dashed !important; }
.d-temps-bloc summary { cursor: pointer; list-style: none; }
.d-temps-bloc summary::-webkit-details-marker { display: none; }
.d-temps-bloc .d-carte-detail { padding-left: 0; margin-left: 0; }
.d-temps-detail { font-style: italic; }
.d-temps-envoi { display: flex; flex-wrap: wrap; gap: var(--esp-2); align-items: center; margin-bottom: var(--esp-3); }
.d-temps-message { margin-bottom: var(--esp-3); }
.d-temps-edition { display: grid; gap: var(--esp-2); margin-bottom: var(--esp-3); padding-bottom: var(--esp-3);
  border-bottom: 1px solid var(--bord); }
.d-temps-edition label { display: grid; gap: 2px; font-size: var(--taille-secondaire); }
.d-temps-edition input { width: 100%; }
.d-temps-heures { display: grid; grid-template-columns: 1fr 1fr; gap: var(--esp-2); }
.d-temps-envoi-liste { list-style: none; margin: 0 0 var(--esp-3); padding: 0; display: grid; gap: var(--esp-1); }
/* Jauges de la feuille de temps (accueil, lot 12) */
.d-temps-jauges { margin-top: var(--esp-4); }
.d-jauge { display: grid; gap: 4px; margin-bottom: var(--esp-2); text-decoration: none; color: inherit; }
.d-jauge-titre { font-size: var(--taille-secondaire); }
.d-jauge-barre { display: block; width: 100%; height: 10px; border-radius: 5px; overflow: hidden; }
.d-jauge-fond { fill: var(--statut-neutre-fond); }
.d-jauge-furious { fill: var(--statut-termine-texte); }
.d-jauge-brouillon { fill: var(--sauge); }
.d-temps-reponse { display: grid; gap: var(--esp-2); margin-top: var(--esp-2); }
.d-temps-reponse textarea { width: 100%; }
.d-temps-trou summary { cursor: pointer; }
.d-temps-envoi select, .d-temps-reponse textarea { font: inherit; padding: var(--esp-2); border: 1px solid var(--bord);
  border-radius: var(--rayon); background: var(--surface); color: inherit; min-height: 40px; }

/* ===== Lot 13 : bon de commande (numéro à copier, liens) et carte « à vérifier » ===== */
.d-bdc { margin: 0 0 var(--esp-3); padding: var(--esp-3); border: 1px solid var(--bord); border-radius: 8px; background: var(--surface); }
.d-bdc-numero { display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-2); margin: 0 0 var(--esp-2); }
.d-bdc-numero strong { font-size: var(--taille-titre-element); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; overflow-wrap: anywhere; user-select: all; }
.d-bouton-copier .d-icone { width: 1.1em; height: 1.1em; }
.d-bouton-copier.d-copie-faite { border-color: var(--ok); color: var(--ok); }
/* Lot 17 : justificatif SNCF (PDF déposés : nom long coupé, jamais de défilement horizontal). */
.d-sncf-pdfs { list-style: none; margin: 0 0 var(--esp-2); padding: 0; display: grid; gap: var(--esp-1); }
.d-sncf-pdfs li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--esp-1) var(--esp-2); }
.d-sncf-pdfs a { overflow-wrap: anywhere; min-width: 0; }
.d-sncf input[type="file"] { max-width: 100%; }
.d-bdc dl { display: grid; grid-template-columns: 1fr; gap: var(--esp-1); margin: 0 0 var(--esp-2); }
.d-bdc dl > div { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: var(--esp-2); }
.d-bdc dt { color: var(--texte-secondaire); }
.d-bdc dd { margin: 0; overflow-wrap: anywhere; }
.d-bdc .discret, .d-formulaire-bdc .discret { color: var(--texte-secondaire); font-size: var(--taille-secondaire); }
.d-bdc .texte-orange { color: var(--important-texte); }
.d-bdc .d-boutons { margin: 0; }
.d-formulaire-bdc .d-champ span { display: block; margin-bottom: var(--esp-1); font-weight: var(--graisse-moyenne); }
.d-choix-devis { border: 0; margin: 0 0 var(--esp-3); padding: 0; min-width: 0; }
.d-choix-devis legend { padding: 0; margin-bottom: var(--esp-1); font-weight: var(--graisse-moyenne); }
.d-choix-devis .d-choix { display: flex; align-items: baseline; gap: var(--esp-2); min-height: 2.75rem; padding: var(--esp-1) 0; overflow-wrap: anywhere; }
.d-choix-devis input { accent-color: var(--accent); flex: none; }
/* Lot 14 : dépôt du PDF du BDC, page « Bons de commande » */
.d-bdc-depot { margin: 0 0 var(--esp-2); }
.d-bdc-depot p { margin: 0 0 var(--esp-1); }
.d-bdc-depot .texte-vert, .d-liste-bdc .texte-vert { color: var(--info-texte); }
.d-bdc-depot .texte-orange, .d-liste-bdc .texte-orange { color: var(--important-texte); }
.d-bdc-depot .d-icone, .d-liste-bdc .d-icone { width: 1em; height: 1em; vertical-align: -0.125em; margin-right: var(--esp-1); }
.d-liste-bdc .d-carte { padding: var(--esp-3); }
.d-ligne-bdc { display: flex; align-items: flex-start; gap: var(--esp-2); }
.d-ligne-bdc input { flex: none; width: 1.25rem; height: 1.25rem; margin-top: 0.15rem; accent-color: var(--accent); }
.d-ligne-bdc label { min-width: 0; overflow-wrap: anywhere; }
.d-case-vide { flex: none; width: 1.25rem; }
.d-conditions-bdc { margin: var(--esp-1) 0 0 calc(1.25rem + var(--esp-2)); overflow-wrap: anywhere; }
.d-intro + .d-section { margin-top: var(--esp-5); }

/* Lot 15 : carte « Facture fournisseur » */
.d-facture .texte-rouge { color: var(--urgent-texte); font-weight: 600; }
.d-boutons-inline { display: inline-flex; gap: 8px; margin-left: 8px; vertical-align: middle; }
.d-boutons-inline .d-bouton { min-height: 28px; padding: 2px 10px; }
.d-mois { margin: 8px 0; }
.d-mois > summary { cursor: pointer; padding: 6px 0; }
.d-choix-achat { margin: 6px 0; }
.d-choix-achat > summary { cursor: pointer; color: var(--lagon); }
.d-choix-achat select { max-width: 100%; }

/* Page Factures fournisseurs : compacte, comme les cartes de l'accueil */
.d-factures { font-size: var(--taille-secondaire); }
.d-factures .d-carte { padding: var(--esp-2) var(--esp-3); }
.d-factures .d-carte p, .d-factures .d-coches { margin: 2px 0; }
.d-factures .d-lien-action { min-height: 0; font-size: var(--taille-secondaire); }
.d-ligne-facture { display: flex; gap: var(--esp-2); align-items: flex-start; }
.d-ligne-facture input[type=checkbox] { margin-top: 3px; flex: none; }
.d-coches { list-style: none; padding: 0; }
.d-coches .d-icone, .d-coches svg { width: 14px; height: 14px; }
.d-inline { display: inline; }
.d-inline .d-lien-action { margin-left: var(--esp-2); }
.d-barre-actions { display: flex; flex-wrap: wrap; gap: var(--esp-2) var(--esp-3); align-items: center;
  position: sticky; bottom: 0; background: var(--fond); padding: var(--esp-2) 0; border-top: 1px solid var(--bord); }
.d-liste-historique { padding-left: var(--esp-4); margin: 4px 0; }
.d-liste-historique li { margin: 2px 0; }
.d-reglage > summary { cursor: pointer; }
.d-factures .d-choix-achat select { font-size: var(--taille-secondaire); }
.d-factures .liste-liens { max-height: 18rem; overflow-y: auto; border: 1px solid var(--bord); border-radius: var(--rayon-petit); padding: var(--esp-1) var(--esp-2); margin: var(--esp-2) 0; }
.d-factures .choix-lien { display: block; padding: 2px 0; }
.d-factures .choix-lien[hidden] { display: none; }
.d-calcul { margin: var(--esp-2) 0; }
.d-factures [data-si-reste][hidden] { display: none; }

/* « Pas un suivi » / « Pas moi » sur les cartes (lot 19) : « Pas moi » ouvert prend toute la largeur. */
.d-pas-moi { margin: 0; }
.d-pas-moi > summary { min-height: var(--hauteur-bouton); }
.d-pas-moi[open] { order: 10; flex-basis: 100%; }
.d-pas-moi[open] > summary { color: var(--texte); }
.d-pas-moi-choix { display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-2) var(--esp-3); }
.d-pas-moi-choix .d-champ-ligne { display: inline-flex; align-items: center; gap: var(--esp-2);
  font-size: var(--taille-secondaire); white-space: nowrap; }
.d-pas-moi-choix .d-champ-ligne .d-saisie { flex: 0 1 auto; width: auto; }
.d-pas-moi-portee { display: inline-flex; flex-wrap: wrap; gap: var(--esp-1) var(--esp-3); font-size: var(--taille-secondaire); }
.d-pas-moi-portee label { display: inline-flex; align-items: center; gap: var(--esp-1); min-height: var(--cible-tactile); }
