/* B4U V2 — version épurée : la trousse commune des écrans « liste + fiche ».
   À gauche une liste sans bouton (on clique la ligne), à droite la fiche avec UNE action principale ;
   le reste des actions vit dans le menu « ⋯ ». Sur téléphone, on voit la liste, puis la fiche seule.
   Chaque écran peut ajouter sa propre feuille (css/<écran>.css) sans toucher à celle-ci. */

/* ───────── Les deux volets ───────── */
.principal:has(> .vue-duo) { height: 100vh; height: 100dvh; overflow: hidden; }
.vue.vue-duo { padding: 0; max-width: none; flex: 1; min-height: 0; display: flex; }
.duo { flex: 1; min-width: 0; display: grid; grid-template-columns: var(--duo-l, 400px) minmax(0, 1fr); min-height: 0; }
.duo.large { --duo-l: 436px; }
/* Chaque volet sert de repère à ses éléments hors flux (textes pour lecteurs d'écran) : sinon ils allongent la page. */
.duo-liste { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); border-right: 1px solid var(--bord); position: relative; }
.duo-tete { padding: 24px 20px 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.duo-tete > .titres { flex: 1; min-width: 0; }
.duo-tete h1 { font-size: 26px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.duo-tete .sous { color: var(--encre-2); margin-top: 2px; }
.duo-outils { padding: 4px 20px 0; display: flex; flex-direction: column; gap: 10px; }
.duo-outils .champ-recherche { max-width: none; flex: none; }
.duo-outils .onglets { margin-bottom: 0; gap: 16px; }
.duo-outils .onglet { padding: 8px 0 9px; gap: 6px; }
.duo-outils .onglet .n { color: var(--encre-3); font-weight: 600; }
.duo-defile { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px 12px; overscroll-behavior: contain; }
.duo-pied { padding: 12px 20px; border-top: 1px solid var(--ligne); color: var(--encre-2); font-size: 13.5px; }
.duo-fiche { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; position: relative; }
.fiche { padding: 24px 30px 60px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.fiche.etroite { max-width: 740px; margin: 0 auto; width: 100%; }
.duo-retour { display: none; }

/* ───────── Lignes de liste : pas de bouton, on clique la ligne ───────── */
.grp { font-size: 12.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--encre-2); padding: 16px 12px 6px; display: flex; align-items: baseline; gap: 6px; }
.grp.rouge { color: var(--t-rouge); }
.lg { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; align-items: center; padding: 12px; border-bottom: 1px solid var(--ligne); color: inherit; border-radius: 0; text-align: left; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; }
a.lg:hover, button.lg:hover { text-decoration: none; background: var(--survol); }
.lg.actif, .lg.actif:hover { background: var(--selection); box-shadow: inset 0 0 0 2px var(--bleu-600); border-radius: 12px; border-bottom-color: transparent; }
.lg-t { font-size: 15.5px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-t .mono { font-size: 13px; font-weight: 500; }
.lg-d { justify-self: end; font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.lg-s { font-size: 13.5px; color: var(--encre-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.lg-s.plein { grid-column: 1 / -1; display: block; }
.lg-s > .tronque { flex: 1; }
.lg-vide { padding: 28px 16px; color: var(--encre-2); text-align: center; }
.rouge-fort { color: var(--t-rouge); font-weight: 700; }
.lien-fort { font-weight: 700; }
button.lien { padding: 0; border: 0; background: none; color: var(--bleu-600); font-weight: 600; }
button.lien:hover { color: var(--bleu-800); text-decoration: underline; text-underline-offset: 2px; }

/* ───────── La fiche ───────── */
.tete-fiche { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.tete-fiche > .titres { flex: 1; min-width: 220px; }
.tete-fiche h2 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; overflow-wrap: anywhere; }
.tete-fiche h2 .mono { font-size: 20px; font-weight: 500; }
.tete-fiche .sous { color: var(--encre-2); margin-top: 2px; }
.btn-points { width: 40px; padding: 0; }
.carte.pad { padding: 16px 20px; }
.carte.pad > h3, .carte h3.t { font-size: 16px; font-weight: 800; }
.carte-titre { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.carte-titre h3 { font-size: 16px; font-weight: 800; }
.carte-titre .sous { color: var(--encre-2); }
.carte-titre .fin { margin-left: auto; font-weight: 700; }
.rg { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--ligne); min-width: 0; }
.rg > :first-child { min-width: 0; }
.rg.sans-trait { border-top: 0; }
.etq { display: block; font-size: 13.5px; font-weight: 600; color: var(--encre-2); }
a.carte-lien { display: flex; align-items: center; gap: 12px; padding: 14px 20px; color: var(--encre); flex-wrap: wrap; }
a.carte-lien:hover { text-decoration: none; border-color: var(--bord-fort); }
a.carte-lien > .corps { flex: 1; min-width: 180px; }
a.carte-lien b { font-size: 16px; }
a.carte-lien .ouvrir { font-weight: 700; color: var(--bleu-600); white-space: nowrap; }
.qui-fait { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.note-bas { color: var(--encre-2); font-size: 14px; text-align: center; }
.entree-ligne { width: 100%; height: 44px; border: 1px solid var(--bord-fort); border-radius: 10px; padding: 0 14px; background: var(--surface); }
.entree-ligne:focus { outline: none; border-color: var(--bleu-500); box-shadow: 0 0 0 3px var(--halo); }

/* Fil daté (« Où on en est », notes) */
.fil-suivi { display: flex; flex-direction: column; }
.fil-suivi .point-suivi { padding: 11px 0; border-top: 1px solid var(--ligne); overflow-wrap: anywhere; }
.fil-suivi .point-suivi > span { display: block; font-size: 13.5px; color: var(--encre-2); }
.fil-suivi .point-suivi > span b { color: var(--encre); }

/* Choix par pastilles (motif d'une procédure, d'un appel…) */
.choix { display: flex; flex-wrap: wrap; gap: 8px; }
.choix label { position: relative; }
.choix input { position: absolute; opacity: 0; inset: 0; }
.choix span { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--bord-fort); background: var(--surface); font-weight: 700; font-size: 14.5px; cursor: pointer; white-space: nowrap; }
.choix input:checked + span { background: var(--encre); border-color: var(--encre); color: #fff; }
.choix input:focus-visible + span { box-shadow: 0 0 0 3px var(--halo); }
.pastille-commande { display: inline-flex; align-items: center; gap: 8px; background: var(--selection); color: var(--bleu-800); border-radius: 9px; padding: 6px 12px; font-weight: 700; max-width: 100%; }
.pastille-commande .mono { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.duo-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ───────── Écran moyen ───────── */
@media (max-width: 1240px) {
  .duo, .duo.large { --duo-l: 340px; }
  .fiche { padding: 22px 22px 60px; }
}

/* ───────── Téléphone et petite tablette : un volet à la fois ───────── */
@media (max-width: 900px) {
  .principal:has(> .vue-duo) { height: auto; overflow: visible; }
  .vue.vue-duo { display: block; }
  .duo { display: block; }
  .duo-liste { border-right: 0; background: none; }
  .duo-defile, .duo-fiche { overflow: visible; }
  .duo-defile { background: var(--surface); border-top: 1px solid var(--bord); border-bottom: 1px solid var(--bord); margin-top: 10px; padding: 0 4px; }
  .duo-tete { padding: 18px 16px 6px; }
  .duo-outils { padding: 4px 16px 0; }
  .duo.ouvert > .duo-liste { display: none; }
  .duo:not(.ouvert) > .duo-fiche { display: none; }
  .fiche { padding: 14px 16px 40px; }
  .duo-retour { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--encre-2); margin: 0 0 -4px -4px; }
  .lg.actif, .lg.actif:hover { background: none; box-shadow: none; border-radius: 0; border-bottom-color: var(--ligne); }
  .tete-fiche h2 { font-size: 21px; }
  .tete-fiche h2 .mono { font-size: 17px; }
}
@media (max-width: 760px) {
  /* La barre du bas est fixe : la fin de la liste et de la fiche doit rester atteignable au-dessus d'elle. */
  .vue.vue-duo { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .duo-tete h1 { display: none; }
  .duo-tete .sous { font-size: 15px; margin-top: 0; }
  .duo-champs { grid-template-columns: 1fr; }
  .fiche .btn-primaire.principale { width: 100%; order: 5; height: 46px; }
}
