/* Marchk - feuille de style unique. CSS seul, aucun style en ligne, aucun CDN : polices Inter et Space Grotesk servies en local (static/fonts, licence OFL), logo SVG local.
   Direction : docs/agence/ux/DESIGN.md. Ratios de contraste texte/fond calculés (WCAG 2.1) : tous >= 4,5:1. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/static/fonts/inter-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/static/fonts/inter-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/space-grotesk-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
:root {
  /* Couleurs (texte sur fond : ratio calculé) */
  --marine: #0B2545;     /* 15,4:1 sur blanc ; 13,2:1 sur --bleu-50 ; blanc dessus 15,4:1 */
  --bleu: #13497B;       /* actions, liens : 9,3:1 sur blanc, 8,6:1 sur --fond ; blanc dessus 9,3:1 */
  --bleu-vif: #0F5A9E;   /* focus et accents graphiques : 7,1:1 sur blanc, 6,6:1 sur --fond (>= 3:1 requis pour un focus) */
  --or: #E8A33D;         /* accent graphique uniquement, JAMAIS en texte sur fond clair (2,2:1 sur blanc) ; 7,1:1 sur --marine */
  --or-fond: #FDF3E1;    /* fond d'accent ; texte --attention dessus 6,9:1 */
  --bleu-100: #CFDCEA;   /* bordures d'accent ; 11,1:1 sur --marine */
  --bleu-50: #E8EEF5;    /* fonds d'accent */
  --fond: #F5F7FA;
  --carte: #FFFFFF;
  --blanc: #FFFFFF;
  --texte: #14212E;      /* 16,3:1 sur blanc, 15,2:1 sur --fond */
  --discret: #4F5D6B;    /* 6,8:1 sur blanc, 6,3:1 sur --fond, 5,8:1 sur --bleu-50 */
  --bord: #DDE3EA;
  --ok: #1B6B3A;         --ok-fond: #E4F4EA;       /* 5,7:1 (6,5:1 sur blanc) */
  --attention: #7F4500;  --attention-fond: #FFF0D3; /* 6,8:1 (7,6:1 sur blanc) */
  --danger: #A01F1F;     --danger-fond: #FCEAEA;   /* 6,7:1 (7,8:1 sur blanc) */
  --info: #13497B;       --info-fond: #E8EEF5;     /* 7,9:1 */
  --payant: #5B3E96;     --payant-fond: #EEE8F8;   /* 6,8:1 */
  --traduit: #0B5F6B;    --traduit-fond: #E1F2F4;  /* 6,4:1 */
  --wa: #12633A;         --wa-fonce: #0C4A2B;      /* bouton WhatsApp : blanc dessus 7,3:1 */
  /* Espacements (base 4) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-6: 24px; --s-8: 32px;
  /* Rayons */
  --r-s: 8px; --r-m: 12px; --r-l: 16px; --r-pill: 999px;
  /* Texte */
  --t-xs: .75rem; --t-s: .875rem; --t-m: 1rem; --t-l: 1.125rem; --t-xl: 1.5rem; --t-chiffre: 2.25rem;
  /* Ombres */
  --ombre: 0 1px 2px rgba(6,38,66,.05), 0 4px 14px rgba(6,38,66,.06);
  --ombre-haut: 0 -4px 14px rgba(6,38,66,.06);
  /* Mesures */
  --cible: 44px;
  --h-nav: 58px;
  --bas-nav: calc(var(--h-nav) + env(safe-area-inset-bottom, 0px));
  --pile-systeme: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --police: "Inter", var(--pile-systeme);
  --police-titre: "Space Grotesk", var(--pile-systeme);
}

/* ===== Base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; min-width: 0; }
html { overflow-x: hidden; }
[hidden] { display: none !important; }
body, .main, .carte, .ligne-avis, .bandeau, .topbar, .bandeau-page, .bandeau-page h1, .carte-section h2 { max-width: 100%; overflow-wrap: anywhere; }
.nav a, .segment a, .btn, .btn-secondaire, .btn-danger, .btn-wa, .btn-lien, .pastille, .quitter { overflow-wrap: normal; }
body { font-family: var(--police); background: var(--fond); color: var(--texte); line-height: 1.5; font-size: var(--t-m); padding-bottom: var(--bas-nav); }
a { color: var(--bleu); }
h1, h2, .marque, .chiffre .nb { font-family: var(--police-titre); }
h1 { font-size: var(--t-xl); line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: var(--t-l); line-height: 1.3; }
h3 { font-size: var(--t-m); line-height: 1.35; }
.t-section { font-size: var(--t-l); margin-bottom: var(--s-2); }
.t-item { font-size: var(--t-m); }
p { margin: var(--s-1) 0; }
.discret { color: var(--discret); font-size: var(--t-s); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-seul { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid var(--bleu-vif); outline-offset: 2px; }
/* Sur fond sombre, le bleu de focus ne se voit pas (2,2:1 sur marine) : anneau or (7,1:1 sur marine, 4,3:1 sur bleu). */
.topbar :focus-visible, .lien-evitement:focus-visible { outline-color: var(--or); }
progress { width: 100%; height: 12px; accent-color: var(--bleu); }
.lien-evitement { position: absolute; left: var(--s-2); top: -60px; z-index: 100; background: var(--bleu); color: var(--blanc); padding: 0 var(--s-4); min-height: var(--cible); display: inline-flex; align-items: center; border-radius: var(--r-m); font-weight: 600; text-decoration: none; }
.lien-evitement:focus { top: var(--s-2); }

/* ===== Structure : mobile = en-tête + barre fixe en bas ; ordinateur = barre latérale ===== */
.app { min-height: 100vh; }
.topbar { background: var(--marine); color: var(--blanc); padding: var(--s-3) var(--s-4); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); }
.topbar-actions { display: flex; align-items: center; gap: var(--s-2); }
.marque { white-space: nowrap; font-weight: 700; font-size: var(--t-l); letter-spacing: -.01em; display: inline-flex; align-items: center; gap: var(--s-2); }
.logo { display: block; flex: none; }
.societe { display: block; font-size: var(--t-s); color: var(--bleu-100); }
.quitter { min-height: var(--cible); background: none; border: 1px solid var(--bleu-100); color: var(--blanc); border-radius: var(--r-pill); padding: 0 var(--s-4); font: inherit; font-size: var(--t-s); cursor: pointer; }
.form-quitter { margin: 0; }
.icone-aide { width: var(--cible); height: var(--cible); display: grid; place-items: center; color: var(--blanc); border: 1px solid var(--bleu-100); border-radius: var(--r-pill); }
.icone-aide[aria-current="page"] { background: var(--bleu); }
.side-haut, .side-bas { display: none; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; background: var(--carte); border-top: 1px solid var(--bord);
  padding-bottom: env(safe-area-inset-bottom, 0); box-shadow: var(--ombre-haut); }
.nav a { flex: 1; min-height: var(--h-nav); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-1);
  font-size: var(--t-xs); text-decoration: none; color: var(--discret); padding: var(--s-1) var(--s-1); }
.nav a[aria-current="page"] { color: var(--bleu); font-weight: 700; }
.nav a[aria-current="page"] .ic { stroke-width: 2.4; }
.lien-aide { display: flex; align-items: center; gap: var(--s-3); min-height: var(--cible); padding: 0 var(--s-3); margin-bottom: var(--s-2); border-radius: var(--r-m); text-decoration: none; color: var(--bleu); font-weight: 600; }
.lien-aide:hover, .lien-aide[aria-current="page"] { background: var(--bleu-50); }
.main { padding: var(--s-4) var(--s-4) var(--s-6); max-width: 1180px; }
.entete-page { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between; margin-bottom: var(--s-4); }
.entete-page .outils { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.entete-page .outils form { margin: 0; }
.grille { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); margin-top: var(--s-4); }
.grille > * { min-width: 0; }
.zone-stats { grid-area: stats; } .zone-dates { grid-area: dates; } .zone-avis { grid-area: avis; } .zone-analyses { grid-area: analyses; }
.grille.accueil { grid-template-areas: "dates" "avis" "analyses"; }

/* ===== Cartes ===== */
.carte { background: var(--carte); border-radius: var(--r-l); box-shadow: var(--ombre); padding: var(--s-4); }
.carte + .carte, .carte + .bandeau { margin-top: var(--s-4); }
.carte.ok { border-left: 5px solid var(--ok); }
.carte.attention { border-left: 5px solid var(--attention); }
.carte.compacte { padding: var(--s-3); border: 1px solid var(--bord); box-shadow: none; border-radius: var(--r-m); margin-bottom: var(--s-2); font-size: var(--t-m); }
.carte.compacte + .carte.compacte { margin-top: 0; }
.carte.compacte .titre { font-weight: 600; margin-bottom: var(--s-1); overflow-wrap: anywhere; }
.carte.compacte .detail { margin-top: var(--s-1); overflow-wrap: anywhere; }
.carte-tete { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin-bottom: var(--s-3); flex-wrap: wrap; }
.etat-vide { text-align: center; padding: var(--s-6) var(--s-2); color: var(--discret); list-style: none; }

/* ===== Chiffres-clés ===== */
.chiffres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.chiffre { display: block; min-width: 0; overflow-wrap: anywhere; background: var(--carte); border: 2px solid var(--bord); border-radius: var(--r-l); padding: var(--s-3); text-decoration: none; color: var(--texte); box-shadow: var(--ombre); }
.chiffre .pastille { white-space: normal; }
.chiffre:hover { background: var(--bleu-50); }
.chiffre .lib { display: flex; align-items: center; gap: var(--s-2); font-size: var(--t-s); font-weight: 600; line-height: 1.3; }
.chiffre .nb { display: block; font-size: var(--t-chiffre); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; margin-top: var(--s-1); }
.chiffre .nb small { font-size: var(--t-m); font-weight: 600; color: var(--discret); }
.chiffre .note { font-size: var(--t-s); margin-top: var(--s-1); display: block; }
.chiffre.neutre .lib { color: var(--discret); }
.chiffre.succes { border-color: var(--ok); }            .chiffre.succes .lib { color: var(--ok); }
.chiffre.danger { border-color: var(--danger); }        .chiffre.danger .lib { color: var(--danger); }
.chiffre.attention { border-color: var(--attention); }  .chiffre.attention .lib { color: var(--attention); }
.chiffre.info { border-color: var(--bleu-vif); }        .chiffre.info .lib { color: var(--bleu); }

/* ===== Pastilles ===== */
.pastille { display: inline-flex; align-items: center; gap: var(--s-1); font-size: var(--t-s); font-weight: 600; padding: 2px var(--s-3); border-radius: var(--r-pill); line-height: 1.5; white-space: nowrap; }
.pastille.ok { background: var(--ok-fond); color: var(--ok); }
.pastille.attention { background: var(--attention-fond); color: var(--attention); }
.pastille.danger { background: var(--danger-fond); color: var(--danger); }
.pastille.info { background: var(--info-fond); color: var(--info); }
.pastille.payant { background: var(--payant-fond); color: var(--payant); }
.pastille.traduit { background: var(--traduit-fond); color: var(--traduit); }
.pastille.neutre { background: var(--fond); color: var(--discret); }
.pastilles { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-2) 0; }

/* ===== Boutons ===== */
.btn, .btn-secondaire, .btn-danger, .btn-wa { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: var(--cible); padding: 0 var(--s-4); border-radius: var(--r-m);
  border: 1px solid var(--bleu); background: var(--bleu); color: var(--blanc); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--marine); }
.btn-secondaire { background: var(--carte); color: var(--bleu); border-color: var(--bleu-100); }
.btn-secondaire:hover { background: var(--bleu-50); }
.btn-danger { background: var(--carte); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-fond); }
.btn-wa { background: var(--wa); border-color: var(--wa); }
.btn-wa:hover { background: var(--wa-fonce); }
.btn-lien { min-height: var(--cible); padding: 0 var(--s-2); background: none; border: 0; color: var(--bleu); }
.btn-lien:hover { background: none; text-decoration: underline; }
.btn:disabled, .btn-secondaire:disabled, .btn-danger:disabled, .btn-wa:disabled { opacity: .55; cursor: not-allowed; }
.btn.plein { width: 100%; }
/* Liens-boutons : `.bandeau a` (0,1,1) et `a:visited` écrasaient la couleur de `.btn` (0,1,0). */
a.btn, .bandeau a.btn { color: var(--blanc); text-decoration: none; }
a.btn:visited { color: var(--blanc); }
a.btn:hover { color: var(--blanc); }
a.btn:focus-visible { color: var(--blanc); }
.bandeau a.btn-secondaire { color: var(--bleu); text-decoration: none; }
.bandeau a.btn-danger { color: var(--danger); text-decoration: none; }
.bandeau a.btn-wa { color: var(--blanc); text-decoration: none; }
.actions-ligne { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-4); }
.pagination .btn-secondaire[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.barre-enregistrer { position: sticky; bottom: calc(var(--bas-nav) + var(--s-2)); z-index: 5; display: flex; justify-content: flex-end; padding: var(--s-2) 0; }
.barre-enregistrer .btn { box-shadow: var(--ombre-haut); }

/* ===== Formulaires ===== */
.champ { margin-bottom: var(--s-3); }
.champ label, .etiquette { display: block; font-size: var(--t-s); font-weight: 600; margin-bottom: var(--s-1); }
.champ input[type=text], .champ input[type=tel], .champ input[type=email], .champ input[type=number], .champ input[type=url], .champ input[type=password],
.champ select, .champ-texte, .ajout input, .filtres select { width: 100%; min-height: var(--cible); font: inherit; border: 1px solid var(--discret); border-radius: var(--r-m);
  padding: 0 var(--s-3); background: var(--carte); color: var(--texte); }
input[type=url].champ-texte, input[type=file] { padding: var(--s-2) var(--s-3); }
.champ-fichier { border-style: dashed; background: var(--fond); }
.champ-code { text-align: center; text-transform: uppercase; letter-spacing: 1px; font-size: var(--t-l); font-weight: 600; }
.champ-code::placeholder { text-transform: none; letter-spacing: 0; font-size: var(--t-m); font-weight: 400; }
.req { color: var(--danger); }
fieldset.groupe { border: 0; padding: 0; }
fieldset.groupe legend { padding: 0; }
.duo { display: grid; gap: 0 var(--s-3); grid-template-columns: minmax(0, 1fr); }
.choix-grille { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.choix { display: flex; align-items: center; gap: var(--s-2); min-height: var(--cible); padding: var(--s-2) var(--s-3); line-height: 1.3; border: 1px solid var(--bord); border-radius: var(--r-m); background: var(--carte); cursor: pointer; }
.choix input, .pays-chip input { width: 20px; height: 20px; margin: 0; accent-color: var(--bleu); flex: none; align-self: center; }
.choix:has(input:checked), .pays-chip:has(input:checked) { background: var(--bleu-50); border-color: var(--bleu); }
.ajout { display: flex; gap: var(--s-2); margin-top: var(--s-2); flex-wrap: wrap; }
.ajout input { flex: 1 1 200px; width: auto; }
.tags { display: flex; flex-wrap: wrap; gap: var(--s-2); min-height: var(--s-2); }
.tag { display: inline-flex; align-items: center; gap: var(--s-1); background: var(--bleu-50); color: var(--marine); border-radius: var(--r-pill); padding: 2px var(--s-1) 2px var(--s-3); font-size: var(--t-m); }
.tag button { min-width: var(--cible); min-height: var(--cible); border: 0; background: none; font: inherit; font-size: var(--t-xl); color: var(--bleu); cursor: pointer; border-radius: var(--r-pill); }
.tag-input-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); min-height: var(--cible); padding: var(--s-1) var(--s-2); background: var(--carte); border: 1px solid var(--discret); border-radius: var(--r-m); cursor: text; }
.tag-input-wrap:focus-within { outline: 3px solid var(--bleu-vif); outline-offset: 1px; }
.champ .tag-input-wrap .tag-input { flex: 1 1 120px; width: auto; min-height: var(--cible); border: 0; outline: 0; padding: 0; font: inherit; background: none; color: var(--texte); }
.recherche { display: flex; align-items: center; gap: var(--s-2); min-height: var(--cible); background: var(--carte); border: 1px solid var(--discret); border-radius: var(--r-m); padding: 0 var(--s-3); }
.recherche input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; background: none; color: var(--texte); min-height: var(--cible); }
.recherche:focus-within { outline: 3px solid var(--bleu-vif); }
.filtres { display: grid; gap: var(--s-2); margin-bottom: var(--s-4); }
.filtres label { display: block; font-size: var(--t-s); font-weight: 600; margin-bottom: var(--s-1); }
.lien-analyse { display: grid; gap: var(--s-2); margin-top: var(--s-3); }
.lien-analyse .rangee { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.lien-analyse input[type=url] { flex: 1 1 220px; }
.sources-perso { list-style: none; display: grid; gap: var(--s-2); margin-bottom: var(--s-2); }
.sources-perso li { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); border: 1px solid var(--bord); border-radius: var(--r-m); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-3); }
.sources-perso .nom-src { overflow-wrap: anywhere; }
.htmx-indicator { display: none; margin: 0 0 var(--s-2); }
.htmx-indicator.htmx-request { display: block; }
.htmx-actif .filtres button[type="submit"] { display: none; }

/* ===== Onglets segmentés ===== */
.segment { display: inline-flex; background: var(--fond); border-radius: var(--r-m); padding: var(--s-1); gap: var(--s-1); }
.segment a { display: inline-flex; align-items: center; white-space: nowrap; min-height: var(--cible); padding: 0 var(--s-4); border-radius: var(--r-s); text-decoration: none; color: var(--discret); font-size: var(--t-m); font-weight: 600; }
.segment a[aria-current="true"] { background: var(--carte); color: var(--bleu); box-shadow: var(--ombre); }

/* ===== Liste d'avis : une seule structure (cartes empilées ; deux colonnes dès 720 px) ===== */
.liste-avis { list-style: none; display: grid; gap: var(--s-3); }
.ligne-avis { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--r-m); padding: var(--s-3) var(--s-4); }
.ligne-avis.ok { border-left: 5px solid var(--ok); }
.ligne-avis.attention { border-left: 5px solid var(--attention); }
.ligne-avis .titre { display: block; min-height: var(--cible); padding-top: 2px; font-weight: 700; color: var(--texte); text-decoration: none; }
.ligne-avis .titre:hover { color: var(--bleu); text-decoration: underline; }
.ligne-analyse { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); align-items: center; justify-content: space-between; }
.ligne-analyse .infos { flex: 1 1 200px; }
.ligne-analyse .infos .discret { display: block; }
.ligne-analyse > .discret { flex: 1 1 100%; }
.meta { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); font-size: var(--t-s); color: var(--discret); margin: var(--s-1) 0; }
.liste-avis.clients { margin-top: var(--s-4); }

/* ===== Dates limites (notifications) ===== */
.notifs { list-style: none; display: grid; gap: var(--s-1); }
.notifs a { display: flex; align-items: center; gap: var(--s-3); min-height: 56px; padding: var(--s-2) var(--s-3); border-radius: var(--r-m); text-decoration: none; color: var(--texte); }
.notifs a:hover { background: var(--bleu-50); }
.notifs .pic { width: 40px; height: 40px; border-radius: var(--r-m); background: var(--bleu-50); color: var(--bleu); display: grid; place-items: center; flex: none; }
.notifs .pic.danger { background: var(--danger-fond); color: var(--danger); }
.notifs .txt { flex: 1; min-width: 0; }
.notifs .txt strong { display: block; font-size: var(--t-m); line-height: 1.3; }
.notifs .txt span { font-size: var(--t-s); color: var(--discret); }

/* ===== Tableau (administration : vraies données tabulaires) ===== */
.table-defil { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; font-size: var(--t-m); }
.tableau caption { position: absolute; left: -9999px; }
.tableau th { text-align: left; color: var(--discret); font-weight: 600; font-size: var(--t-s); padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--bord); }
.tableau td { padding: var(--s-3); border-bottom: 1px solid var(--bord); vertical-align: middle; white-space: nowrap; }
.tableau td:first-child { white-space: normal; min-width: 200px; }
.tableau td.cellule-erreur { white-space: normal; min-width: 160px; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau tbody tr:hover td { background: var(--bleu-50); }

/* ===== Bandeaux (icône ou texte, jamais la couleur seule) ===== */
.bandeau { display: flex; gap: var(--s-3); border-radius: var(--r-m); padding: var(--s-3) var(--s-4); margin-bottom: var(--s-3); font-size: var(--t-m); }
.bandeau.attention { background: var(--attention-fond); color: var(--attention); }
.bandeau.danger { background: var(--danger-fond); color: var(--danger); }
.bandeau.succes { background: var(--ok-fond); color: var(--ok); }
.bandeau.info { background: var(--info-fond); color: var(--marine); }
.bandeau ul { margin: var(--s-1) 0 0 var(--s-4); }
.bandeau p { margin: var(--s-1) 0; }
.bandeau a { color: inherit; font-weight: 600; }
.bandeau.progression { display: block; }
.bandeau > div, .bandeau > span { min-width: 0; flex: 1; }
.bandeau > .ic { margin-top: 2px; }

/* ===== Détails, historique, fiche d'avis ===== */
details { margin: var(--s-2) 0; }
summary { min-height: var(--cible); display: flex; align-items: center; cursor: pointer; color: var(--bleu); font-weight: 600; }
.original { background: var(--fond); border-radius: var(--r-s); padding: var(--s-3); font-size: var(--t-m); }
.faq details { border-bottom: 1px solid var(--bord); margin: 0; }
.faq details:last-child { border-bottom: 0; }
.faq details p { padding: 0 0 var(--s-3); }
.veille-carte .stats { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); color: var(--discret); font-size: var(--t-m); }
.mini-avis { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: var(--s-2) 0; border-top: 1px solid var(--bord); }
.mini-avis a { color: var(--texte); display: inline-flex; align-items: center; min-height: var(--cible); }
.titre-avis { font-size: var(--t-xl); line-height: 1.3; margin: var(--s-1) 0 var(--s-2); }
.ligne-info { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); padding: var(--s-2) 0; border-bottom: 1px solid var(--bord); }
.ligne-info:last-child { border-bottom: 0; }
.ligne-info .nom { color: var(--discret); flex: 0 0 170px; }
.ligne-info .val { flex: 1 1 200px; font-weight: 600; overflow-wrap: anywhere; }

/* ===== Administration ===== */
.sous-titre { margin: var(--s-6) 0 var(--s-2); font-size: var(--t-m); color: var(--discret); }
.creer-code { display: grid; gap: var(--s-2); align-items: end; grid-template-columns: minmax(0, 1fr); margin-top: var(--s-1); }
.creer-code .champ { margin-bottom: 0; }
.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: var(--t-l); font-weight: 700; letter-spacing: 1px; overflow-wrap: anywhere; }
#zoneCode { margin-top: var(--s-3); }
.client-ligne { display: grid; gap: var(--s-2) var(--s-4); grid-template-columns: minmax(0, 1fr); }
.client-ligne h3 { overflow-wrap: anywhere; }
.client-ligne .client-meta { margin: 0; }
.form-ligne { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; margin: 0; }
.form-ligne select { flex: 1 1 140px; min-width: 0; }
.client-actions { margin-top: 0; }
.budget-ia progress { display: block; margin: var(--s-2) 0; }

/* ===== Connexion client et onboarding ===== */
body.page-connexion { display: flex; align-items: center; justify-content: center; min-height: 100vh; min-height: 100dvh; padding: var(--s-4); background: linear-gradient(160deg, var(--marine) 0%, var(--bleu) 100%); background-color: var(--marine); }
.page-connexion .carte { width: 100%; max-width: 380px; padding: var(--s-8) var(--s-6); border-radius: 24px; background: var(--carte); }
@media (max-width: 360px) { .page-connexion .carte { padding: var(--s-6) var(--s-4); } }
.page-connexion .carte h1 { margin-bottom: var(--s-1); }
.page-connexion .carte .discret { margin-bottom: var(--s-4); }
.marque-connexion { display: flex; align-items: center; justify-content: center; gap: var(--s-3); color: var(--marine); font-size: 2rem; letter-spacing: -.02em; margin-bottom: var(--s-4); }
.page-connexion .carte h1, .page-connexion .carte > .discret { text-align: center; }
.pied-connexion { text-align: center; margin-top: var(--s-4); }
body.page-onboarding { display: block; padding-bottom: 0; }
.onb { max-width: 640px; margin: 0 auto; padding: var(--s-4) var(--s-4) var(--s-8); }
.onb-intro { text-align: center; margin-bottom: var(--s-2); }
.stepper { list-style: none; display: flex; justify-content: center; align-items: center; gap: var(--s-2); margin: var(--s-3) 0 var(--s-2); }
.step-dot { width: 40px; height: 40px; border-radius: 50%; background: var(--bleu-50); color: var(--discret); display: grid; place-items: center; font-weight: 700; flex: none; }
.step-dot.active { background: var(--bleu); color: var(--blanc); }
.step-dot.done { background: var(--ok); color: var(--blanc); }
.step-line { width: 40px; height: 3px; border-radius: 2px; background: var(--bord); }
.step-line.done { background: var(--ok); }
.step-label { text-align: center; color: var(--discret); font-size: var(--t-s); margin-bottom: var(--s-4); }
.step-content { display: none; }
.step-content.active { display: block; }
.step-content h1 { font-size: var(--t-xl); }
.sous-etape { margin-bottom: var(--s-4); }
.type-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
.type-card { display: flex; flex-direction: column; gap: 2px; min-height: var(--cible); padding: var(--s-3) var(--s-4); text-align: left; font: inherit; color: var(--texte); background: var(--carte); border: 2px solid var(--bord); border-radius: var(--r-m); cursor: pointer; }
.type-card .name { font-weight: 700; }
.type-card .desc { font-size: var(--t-s); color: var(--discret); }
.type-card.selected { border-color: var(--bleu); background: var(--bleu-50); }
.pays-grid { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.pays-chip { display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--cible); padding: var(--s-2) var(--s-4); line-height: 1.3; border: 1px solid var(--bord); border-radius: var(--r-pill); background: var(--carte); cursor: pointer; }
.actions-onb { display: flex; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-6); flex-wrap: wrap; }
.actions-onb :is(.btn, .btn-secondaire) { flex: 1 1 140px; text-align: center; }

/* ===== Visite guidée « Marchk » (bulle rendue par le serveur ; visite.js ne fait que surligner la cible) ===== */
.visite { position: fixed; z-index: 60; left: 8px; right: 8px; bottom: calc(var(--bas-nav) + 8px); max-height: 40vh; max-height: 40dvh; overflow: auto;
  background: var(--carte); border: 2px solid var(--bleu-vif); border-radius: var(--r-l); box-shadow: var(--ombre-haut), var(--ombre); padding: var(--s-2) var(--s-3);
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "av etape pass" "texte texte texte" "act act act"; gap: var(--s-1) var(--s-2); align-items: center;
  animation: visite-entree 150ms ease-out; }
.visite-corps { display: contents; }
.visite-avatar { grid-area: av; width: 40px; height: 40px; }
.visite-etape { grid-area: etape; font-size: var(--t-s); font-weight: 700; color: var(--discret); }
.visite-etape:focus { outline: none; }
.visite-texte { grid-area: texte; font-size: .9375rem; line-height: 1.35; margin: 0; }
.visite form { margin: 0; }
.visite-actions { grid-area: act; display: flex; gap: var(--s-2); }
.visite-actions > form { flex: 1 1 0; min-width: 0; }
.visite-actions > .visite-form-suivant { flex-grow: 1.5; }
.visite-form-passer { grid-area: pass; }
.visite .btn, .visite .btn-secondaire { width: 100%; min-height: var(--cible); padding-inline: var(--s-2); white-space: nowrap; }
.visite .btn-lien { min-height: var(--cible); font-size: var(--t-s); white-space: nowrap; }
.visite-reprendre { position: fixed; z-index: 60; right: 8px; bottom: calc(var(--bas-nav) + 8px); margin: 0; }
.visite-reprendre .btn-secondaire { min-height: 48px; box-shadow: var(--ombre-haut), var(--ombre); font-weight: 600; }
.visite-mini { width: 32px; height: 32px; }
.visite-cible { outline: 3px solid var(--bleu-vif); outline-offset: 3px; border-radius: var(--r-m); scroll-margin-top: 72px; }
.visite-invitation-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-2) 0; }
@keyframes visite-entree { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (min-width: 900px) {
  .visite { left: auto; right: 24px; bottom: 24px; width: 360px; max-height: 60vh; padding: var(--s-3) var(--s-4); grid-template-columns: 56px minmax(0, 1fr) auto; }
  .visite-avatar { width: 56px; height: 56px; }
  .visite-reprendre { right: 24px; bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) { .visite { animation: none; } }

/* ===== Assistant DAO (dépôt, suivi, résultat) ===== */
#assistant { max-width: 820px; }
.quota { margin-bottom: var(--s-3); }
#resultat { margin-top: var(--s-4); }
#resultat:focus { outline: none; }
#resultat > .carte { margin-bottom: var(--s-4); }
.carte > .t-item { margin: var(--s-4) 0 var(--s-2); color: var(--bleu); }
.non-trouve { color: var(--discret); font-style: italic; font-weight: 400; }
.source { font-size: var(--t-s); color: var(--discret); margin-top: var(--s-1); overflow-wrap: anywhere; }
.jours { font-size: var(--t-m); font-weight: 700; margin: var(--s-2) 0; }
.pied-avis { margin-top: var(--s-4); }

/* ===== Écrans larges ===== */
@media (min-width: 720px) {
  .duo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ligne-avis:has(> .titre) { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-4); align-items: center; }
  .ligne-avis > .titre, .ligne-avis > .pastilles, .ligne-avis > .gratuit { grid-column: 1; }
  .ligne-avis > .meta { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; align-items: flex-end; }
}
@media (min-width: 560px) {
  .type-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions-onb :is(.btn, .btn-secondaire) { flex: 0 1 auto; }
}
/* ===== Menu : tiroir (téléphone) et barre latérale repliable (ordinateur) ===== */
.btn-menu, .tiroir { display: none; }
.topbar-gauche { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
/* Avec le tiroir, le nom de la société est en bas du tiroir : la barre du haut tient sur une ligne. */
.js-menu .topbar .societe { display: none; }
@media (max-width: 380px) { .topbar { padding: var(--s-2) var(--s-3); } .quitter { padding: 0 var(--s-3); } }
.btn-icone { width: var(--cible); height: var(--cible); display: grid; place-items: center; background: none; border: 1px solid var(--bord); color: var(--marine); border-radius: var(--r-m); cursor: pointer; padding: 0; }
.js-menu .btn-menu { display: grid; place-items: center; width: var(--cible); height: var(--cible); flex: none; background: none; border: 1px solid var(--bleu-100); color: var(--blanc); border-radius: var(--r-m); cursor: pointer; padding: 0; }
.js-menu .tiroir { display: block; position: fixed; inset: 0; z-index: 50; visibility: hidden; }
.tiroir-fond { position: absolute; inset: 0; background: rgba(11, 37, 69, .6); }
.tiroir-panneau { position: absolute; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); background: var(--carte); color: var(--texte); transform: translateX(-100%);
  display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-4); overflow-y: auto; }
.tiroir-haut { display: flex; align-items: center; justify-content: space-between; color: var(--marine); }
.menu-ouvert .tiroir { visibility: visible; }
.menu-ouvert .tiroir-panneau { transform: none; }
html.menu-ouvert, .menu-ouvert body { overflow: hidden; }
.tiroir-panneau { overscroll-behavior: contain; }
.nav-tiroir { display: flex; flex-direction: column; gap: var(--s-1); }
.nav-tiroir a { display: flex; align-items: center; gap: var(--s-3); min-height: var(--cible); padding: 0 var(--s-3); border-radius: var(--r-m); text-decoration: none; color: var(--texte); font-size: var(--t-m); }
.nav-tiroir a:hover { background: var(--fond); }
.nav-tiroir a[aria-current="page"] { background: var(--bleu); color: var(--blanc); font-weight: 700; }
.identite { display: flex; align-items: center; gap: var(--s-3); margin-top: auto; padding: var(--s-3) var(--s-2); border-top: 1px solid var(--bord); min-width: 0; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--marine); color: var(--blanc); display: grid; place-items: center; font-family: var(--police-titre); font-weight: 700; }
.nom-client { font-weight: 600; color: var(--marine); min-width: 0; overflow-wrap: anywhere; }
.side .quitter { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); }
@media (prefers-reduced-motion: no-preference) {
  .tiroir-panneau { transition: transform .2s ease-out; }
  .tiroir { transition: visibility 0s .2s; }
  .menu-ouvert .tiroir { transition-delay: 0s; }
}

@media (min-width: 900px) {
  body { padding-bottom: 0; display: grid; grid-template-columns: 248px minmax(0, 1fr); align-items: start; }
  .app { display: contents; }
  .topbar { display: none; }
  .side { grid-column: 1; position: sticky; top: 0; height: 100vh; background: var(--carte); border-right: 1px solid var(--bord);
    display: flex; flex-direction: column; padding: var(--s-6) var(--s-4); }
  .js-menu .btn-menu, .js-menu .tiroir { display: none; }
  .side-haut { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: 0 var(--s-2) var(--s-6); }
  .side-haut .marque { color: var(--marine); font-size: var(--t-xl); }
  .btn-replier { display: none; }
  .js-menu .btn-replier { display: grid; }
  .btn-replier:hover { background: var(--fond); }
  .nav { position: static; flex-direction: column; gap: var(--s-1); border: 0; box-shadow: none; padding: 0; background: none; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: var(--s-3); min-height: var(--cible); padding: 0 var(--s-3); border-radius: var(--r-m); font-size: var(--t-m); color: var(--texte); }
  .nav a:hover, .lien-aide:hover { background: var(--fond); }
  .nav a[aria-current="page"], .side .lien-aide[aria-current="page"] { background: var(--bleu); color: var(--blanc); font-weight: 700; }
  .nav a[aria-current="page"] .ic { stroke-width: 1.75; }
  .side-bas { display: flex; flex-direction: column; margin-top: auto; }
  .side-bas .lien-aide { margin-bottom: 0; }
  .side-bas .quitter { color: var(--bleu); border-color: var(--bleu-100); width: 100%; }
  .menu-replie body { grid-template-columns: 72px minmax(0, 1fr); }
  .menu-replie .side { padding-left: var(--s-2); padding-right: var(--s-2); }
  .menu-replie .side-haut { flex-direction: column; padding-left: 0; padding-right: 0; }
  .menu-replie .side .lib, .menu-replie .side .nom-client { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .menu-replie .side .nav a, .menu-replie .side .lien-aide { justify-content: center; padding: 0; }
  .menu-replie .side .identite { justify-content: center; padding-left: 0; padding-right: 0; }
  .menu-replie .side .quitter { padding: 0; }
  .main { grid-column: 2; padding: var(--s-6) var(--s-8) var(--s-8); width: 100%; }
  .chiffres { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filtres { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; }
  .barre-enregistrer { bottom: var(--s-3); }
  .creer-code { grid-template-columns: minmax(0, 420px) auto; }
  .client-ligne { grid-template-columns: minmax(150px, 1fr) minmax(0, 1.5fr) minmax(260px, 1.4fr) auto; align-items: center; }
  .form-ligne { flex-wrap: nowrap; }
  .form-ligne select { flex: 1 1 100px; }
  .client-ligne .client-nom .pastilles { margin: var(--s-1) 0 0; }
  .client-ligne .client-meta { flex-direction: column; gap: 0; }
}
@media (min-width: 1180px) {
  .grille.accueil { grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "avis dates" "analyses dates"; align-items: start; }
  .grille.admin { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grille.admin .large { grid-column: 1 / -1; }
}

/* ===== Mouvement : seulement couleur de fond, 150 ms, jamais si l'utilisateur demande moins d'animations ===== */
@media (prefers-reduced-motion: no-preference) {
  .btn, .btn-secondaire, .btn-danger, .btn-wa, .chiffre, .notifs a { transition: background-color .15s; }
}

/* ===== Impression ===== */
@media print {
  .nav, .side, .tiroir, .topbar, .barre-enregistrer, #formDepot, #envoi, #suivi, #liste, #btnImprimer, .carte:has(#formDepot), .carte:has(#liste) { display: none !important; }
  body { padding: 0; display: block; }
}

/* === C1b assistant/historique === */
.ligne-fichier { display: flex; align-items: center; gap: var(--s-2); }
.btn-retirer-fichier { display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--cible); height: var(--cible); border-radius: var(--r-m); border: 1px solid var(--bleu-100); background: var(--carte); color: var(--bleu); cursor: pointer; }
.btn-retirer-fichier:hover { background: var(--bleu-50); }
.btn-retirer-fichier:disabled { opacity: .55; cursor: not-allowed; }
.fichier-choisi { margin: var(--s-2) 0; font-weight: 600; overflow-wrap: anywhere; }
.regles-depot { margin: 0 0 var(--s-3) var(--s-4); color: var(--discret); font-size: var(--t-s); }
.regles-depot li + li { margin-top: var(--s-1); }
.champ-fichier { min-height: 64px; padding: var(--s-4) var(--s-3); width: 100%; }
#assistant .actions-ligne .btn, #assistant .actions-ligne .btn-secondaire { flex: 1 1 200px; }
.etapes-suivi { list-style: none; display: grid; gap: var(--s-1); margin: var(--s-2) 0 var(--s-3); }
.etapes-suivi li { padding: var(--s-1) 0; color: var(--discret); }
.etapes-suivi li::before { content: "\25CB\00a0"; }
.etapes-suivi li[data-etat="fait"]::before { content: "\2713\00a0"; color: var(--ok); }
.etapes-suivi li[data-etat="courante"] { color: var(--texte); font-weight: 700; }
.etapes-suivi li[data-etat="courante"]::before { content: "\25B6\00a0"; color: var(--bleu); }
#listeVide a { display: inline-flex; align-items: center; min-height: var(--cible); }
.veille-carte summary { flex-wrap: wrap; gap: var(--s-1) var(--s-2); }
.veille-carte .voir-plus { margin-left: auto; font-size: var(--t-s); font-weight: 600; color: var(--bleu); }
.veille-carte .voir-plus::after { content: "\00a0\25BE"; }
.veille-carte[open] .voir-plus::after { content: "\00a0\25B4"; }
.etat-vide p + p, .etat-vide p + a { margin-top: var(--s-2); }
@media (max-width: 480px) {
  .ligne-info .nom { flex-basis: 100%; }
  .ligne-analyse .btn-secondaire, .ligne-analyse .btn-danger { flex: 1 1 140px; }
  #resultat .carte { padding: var(--s-3); }
}

/* === C1b onboarding/profil/avis === */
.onb-titre { font-size: var(--t-xl); text-align: center; margin: var(--s-2) 0 0; }
.step-content h2 { font-size: var(--t-xl); }
.apres-onb { text-align: center; margin-top: var(--s-3); }
.carte-repliable summary { font-weight: 700; }
.htmx-actif .filtres button[type="submit"] { display: inline-flex; }
.liste-avis .titre { overflow-wrap: anywhere; }
.etat-vide a { font-weight: 600; }
@media (max-width: 480px) {
  .ligne-avis { padding: var(--s-3); }
  .ligne-avis .meta { flex-direction: column; gap: 2px; }
  .recherche { width: 100%; }
}

/* Profil : section Telegram (lisible à 360 px) */
#telegram { scroll-margin-top: var(--s-3); scroll-margin-bottom: calc(var(--bas-nav) + 72px); }
.lien-telegram { display: block; margin-bottom: var(--s-3); }   /* empilé : en rangée (flex de .bandeau), texte et boutons se chevauchaient sur téléphone */
.commande-liaison code { display: block; padding: var(--s-2); background: var(--carte); border: 1px solid var(--bord); border-radius: 6px; font-size: 1rem; overflow-wrap: anywhere; user-select: all; }
.actions-lien { display: flex; flex-direction: column; gap: var(--s-2); margin: var(--s-2) 0; }
.actions-lien .btn, .actions-lien .btn-secondaire, .actions-lien .btn-danger { width: 100%; text-align: center; justify-content: center; box-sizing: border-box; }
@media (min-width: 640px) { .actions-lien { flex-direction: row; flex-wrap: wrap; } .actions-lien .btn, .actions-lien .btn-secondaire { width: auto; } }
.liste-telegram { list-style: none; margin: 0 0 var(--s-3); padding: 0; }
.liste-telegram .pastille { white-space: normal; }
.liste-telegram .actions-ligne { flex: 1 1 100%; }
.liste-telegram form { margin: 0; }

/* ===== Accueil (lot 2b) : bandeau de résumé, cartes de chiffres, fiches d'avis ===== */
.hero-accueil { background: linear-gradient(135deg, var(--marine) 0%, var(--bleu) 130%); color: var(--blanc); border-radius: var(--r-l); padding: var(--s-6) var(--s-4); margin-bottom: var(--s-6); }
.hero-accueil h1 { color: var(--blanc); }
.hero-accueil .discret { color: var(--bleu-100); }   /* 11,1:1 sur marine, 6,9:1 sur --bleu */
.hero-accueil .hero-tete { margin-bottom: var(--s-6); }
.hero-accueil :focus-visible { outline-color: var(--or); }
.hero-accueil .btn, .hero-accueil a.btn, .hero-accueil a.btn:visited, .hero-accueil a.btn:hover, .hero-accueil a.btn:focus-visible { background: var(--or); border-color: var(--or); color: var(--marine); }  /* marine sur or 7,1:1 */
.hero-accueil .btn:hover, .hero-accueil a.btn:hover { background: var(--blanc); border-color: var(--blanc); }
.hero-accueil .btn-secondaire { background: transparent; color: var(--blanc); border-color: var(--bleu-100); }
.hero-accueil .btn-secondaire:hover { background: rgba(255,255,255,.14); }
.hero-accueil .btn-wa, .hero-accueil a.btn-wa { border-color: var(--blanc); }
.hero-accueil .zone-stats { margin-bottom: 0; }
.hero-accueil .chiffres { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); gap: var(--s-3); }
.hero-accueil .chiffre { border: 1px solid var(--bord); border-radius: var(--r-l); padding: var(--s-4); box-shadow: 0 6px 20px rgba(6,38,66,.14); }
.hero-accueil .chiffre:hover { background: var(--fond); }
.hero-accueil .chiffre .lib { color: var(--discret); font-weight: 500; margin-top: var(--s-3); }
.hero-accueil .chiffre .nb { color: var(--texte); }
.hero-accueil .chiffre .note { color: var(--discret); }
.pastille-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; }
.pastille-ic .ic { width: 20px; height: 20px; }
.hero-accueil .chiffre.info .pastille-ic { background: var(--info-fond); color: var(--info); }
.hero-accueil .chiffre.succes .pastille-ic { background: var(--ok-fond); color: var(--ok); }
.hero-accueil .chiffre.danger .pastille-ic { background: var(--danger-fond); color: var(--danger); }
.hero-accueil .chiffre.attention .pastille-ic { background: var(--or-fond); color: var(--attention); }
@media (max-width: 339px) { .hero-accueil { padding-inline: var(--s-3); } }
@media (min-width: 1024px) { .hero-accueil { padding: var(--s-8); } .hero-accueil .chiffres { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Sections : cartes aérées, titre avec filet d'or (accent graphique, pas du texte) */
.grille.accueil .carte { padding: var(--s-6); border: 1px solid var(--bord); }
.grille.accueil .carte-tete h2 { display: flex; align-items: center; gap: var(--s-2); }
.grille.accueil .carte-tete h2::before { content: ""; width: 4px; height: 1.1em; border-radius: 2px; background: var(--or); }
/* Fiches d'avis */
.liste-avis.fiches { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--s-4); }
.ligne-avis.fiche, .ligne-avis.fiche:has(> .titre) { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-4); border-radius: var(--r-l); border: 1px solid var(--bord); box-shadow: var(--ombre); }
.ligne-avis.fiche.ok, .ligne-avis.fiche.attention { border-left-width: 1px; }
.ligne-avis.fiche .titre { min-height: 0; display: inline-block; padding-block: 11px; font-family: var(--police-titre); font-size: var(--t-m); line-height: 1.35; }
.fiche .organisme { color: var(--discret); font-size: var(--t-s); }
.stats-fiche { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2) var(--s-3); margin-top: auto; padding-top: var(--s-3); border-top: 1px solid var(--bord); font-size: var(--t-s); }
.fiche > .pastilles, .fiche > .gratuit { margin-top: var(--s-1); }
.stats-fiche .st { display: flex; align-items: center; gap: var(--s-2); color: var(--discret); }
.stats-fiche .st .ic { width: 16px; height: 16px; }
.stats-fiche .st span { min-width: 0; overflow-wrap: anywhere; }
.stats-fiche .st.ok { color: var(--ok); } .stats-fiche .st.attention, .stats-fiche .st.delai-proche { color: var(--attention); }
.stats-fiche .st.delai-urgent { color: var(--danger); font-weight: 600; }
.fiche .stats-fiche { margin-top: var(--s-3); }
/* Accessibilité : la barre fixe du bas ne masque pas l'élément focalisé ; libellés de la barre coupables à 200 %. */
html { scroll-padding-bottom: calc(var(--bas-nav) + var(--s-2)); }
@media (max-width: 899px) { .nav a { text-align: center; font-size: clamp(.625rem, 3.1vw, .75rem); } }
.ligne-avis.fiche .titre-fiche { margin: 0; font-size: inherit; }

/* ===== Pages client (lot 3a) : bandeau de page léger, cartes de section, formulaires aérés ===== */
.bandeau-page { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--r-l); padding: var(--s-4); margin-bottom: var(--s-4); box-shadow: var(--ombre); }
.bandeau-page h1 { display: flex; align-items: stretch; gap: var(--s-2); }
.bandeau-page h1::before, .carte-section h2::before { content: ""; flex: none; width: 4px; min-height: 1.1em; border-radius: 2px; background: var(--or); }
.bandeau-page > div > .discret { margin-top: var(--s-1); }
.bandeau-detail { display: grid; gap: var(--s-1); }
.bandeau-detail .titre-avis { margin: 0; }
.bandeau-detail .pastilles { margin: var(--s-1) 0 0; }
.carte-section { padding: var(--s-4); border: 1px solid var(--bord); }
.carte-section h2 { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-3); }
.carte-section .champ { margin-bottom: var(--s-4); }
.carte-section .champ label, .carte-section .etiquette { margin-bottom: var(--s-2); }
.carte-section .duo { column-gap: var(--s-4); }
.carte-section.veille-carte, .carte-section.carte-repliable { padding: var(--s-3) var(--s-4); }
.carte-filtres { background: var(--fond); border: 1px solid var(--bord); border-radius: var(--r-l); padding: var(--s-4); gap: var(--s-3); }
.carte-filtres .btn { min-height: var(--cible); }
@media (min-width: 720px) { .carte-section { padding: var(--s-6); } .bandeau-page { padding: var(--s-4) var(--s-6); } }
@media (max-width: 400px) { .stats-fiche { grid-template-columns: minmax(0, 1fr); } }
/* ===== Connexion client : photo (Cytonn Photography, licence Unsplash, voir static/img/CREDITS.md) sous un voile marine à 60 % ===== */
/* La photo est portée par un calque fixe sur tout l'écran (et non par le fond du body, dont la hauteur suit le contenu) : elle couvre toute la hauteur. */
body.page-login { background: var(--marine); }
body.page-login::before { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(rgba(11, 37, 69, .6), rgba(11, 37, 69, .6)), url("/static/img/connexion-900.webp") center / cover no-repeat, var(--marine); }
@media (min-width: 720px) { body.page-login::before { background-image: linear-gradient(rgba(11, 37, 69, .6), rgba(11, 37, 69, .6)), url("/static/img/connexion-1600.webp"); } }
.page-login .connexion { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: var(--s-6); }
.page-login .connexion:focus { outline: none; }
/* Texte blanc sur photo : ombre forte pour rester lisible sur les zones claires de l'image. */
.accroche-connexion { margin: 0; color: var(--blanc); font-family: var(--police-titre); font-weight: 700; font-size: 1.375rem; line-height: 1.3; text-align: center; text-shadow: 0 2px 4px rgba(0, 0, 0, .7), 0 0 18px rgba(0, 0, 0, .55); }
.page-login .carte { max-width: 400px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35), 0 4px 12px rgba(0, 0, 0, .2); }
.page-login .champ label { display: block; text-align: center; }
.page-login .champ input { margin-top: var(--s-3); }
.page-login .btn.plein { margin-top: var(--s-6); border-radius: var(--r-pill); min-height: 52px; }
.page-login .carte h1 { margin-bottom: var(--s-6); }
/* « Marchk » à la hauteur du logo (56 px). */
.page-login .marque-connexion { font-size: 3rem; line-height: 1; }
@media (max-width: 340px) { .page-login .marque-connexion { font-size: 2.5rem; } }
@media (max-width: 340px) { .page-login .btn.plein { padding-inline: var(--s-3); font-size: .9375rem; } }
/* Admin : recherche dans la liste des clients (10 affichés, puis « Voir tous les clients »). */
.filtre-clients { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-2) var(--s-4); margin: var(--s-6) 0 var(--s-3); }
.filtre-clients .champ { flex: 1 1 240px; margin: 0; }
.filtre-clients .discret { margin: 0; }
#btnToutVoir { margin-top: var(--s-4); }
.page-login .carte > .discret:last-child { margin: var(--s-4) 0 0; }

/* Choix du modèle de l'assistant IA (/admin/assistant/modele) */
.fiche-modele { display: grid; gap: var(--s-2); margin: 0 0 var(--s-3); }
.fiche-modele > div { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); }
.fiche-modele dt { min-width: 140px; font-weight: 600; color: var(--marine); }
.fiche-modele dd { margin: 0; overflow-wrap: anywhere; }
.liste-modeles { display: grid; gap: var(--s-2); margin: var(--s-3) 0 var(--s-4); }
.choix-modele { align-items: flex-start; padding: var(--s-2) var(--s-3); }
.choix-modele input { margin-top: 2px; }
.choix-modele-texte { display: grid; gap: 2px; min-width: 0; }
.choix-modele-texte .discret { overflow-wrap: anywhere; }
.ligne-modele-ia { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin: 0 0 var(--s-3); }

/* --- Admin en onglets : pastilles du menu, filtres, alertes de la vue d'ensemble, onglet Sources ------------------ */
.ic-menu { position: relative; display: inline-flex; }
.pastille-menu { position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill);
  background: var(--danger); color: var(--blanc); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--carte); }
.nav-tiroir .pastille-menu { position: static; margin-left: auto; box-shadow: none; }
@media (max-width: 899px) { .js-menu .nav a.hors-barre { display: none; } }   /* sans JS, tout reste dans la barre */
.filtres.filtres-admin { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); align-items: end; }
.filtres-admin .champ { margin-bottom: 0; }
.actions-filtres { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.liste-alertes { list-style: none; display: grid; gap: var(--s-2); }
.alerte-lien { display: flex; align-items: center; gap: var(--s-3); min-height: var(--cible); padding: var(--s-2) var(--s-3); border-radius: var(--r-m);
  text-decoration: none; font-weight: 600; border-left: 5px solid currentColor; }
.alerte-lien span { flex: 1; }
.alerte-lien.danger { background: var(--danger-fond); color: var(--danger); }
.alerte-lien.attention { background: var(--attention-fond); color: var(--attention); }
.alerte-lien:hover span { text-decoration: underline; }
.alerte-lien .fleche { flex: none; }
.resume-etats { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0 0 var(--s-4); }
.resume-etats a { text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.resume-etats a:hover { text-decoration: underline; }
.resume-etats a[aria-current="true"] { outline: 2px solid currentColor; outline-offset: 1px; }
.source-ligne h3 a { color: var(--texte); text-decoration: none; display: inline-flex; align-items: center; gap: var(--s-1); }
.source-ligne h3 a:hover { color: var(--bleu); text-decoration: underline; }
.erreur-source { margin: var(--s-2) 0; font-size: var(--t-s); }
.fiche-source { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: var(--s-2) var(--s-4); margin: var(--s-2) 0 0; }
.fiche-source dt { font-size: var(--t-xs); color: var(--discret); }
.fiche-source dd { margin: 0; font-weight: 600; }

/* Zones d'annonce (role="status") présentes dès le chargement : cachées tant qu'elles sont vides */
.zone-annonce:empty { display: none; }
.lignes-info { margin: 0; }
.lignes-info dd { margin: 0; }

/* ===== Téléphone (T6) : accueil compact, filtres et sections repliables, cibles tactiles ===== */
.lib-court { display: none; }
.filtres-repliables { margin: 0 0 var(--s-3); }
.profil-bloc > summary, .filtres-repliables > summary { justify-content: space-between; gap: var(--s-2); list-style: none; }
.profil-bloc > summary::-webkit-details-marker, .filtres-repliables > summary::-webkit-details-marker { display: none; }
.profil-bloc > summary::after, .filtres-repliables > summary::after { content: ""; flex: none; width: 9px; height: 9px; margin: 0 var(--s-1) 3px 0; border: solid var(--bleu); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.profil-bloc[open] > summary::after, .filtres-repliables[open] > summary::after { margin-bottom: 0; margin-top: 6px; transform: rotate(-135deg); }
.filtres-repliables > summary { padding: 0 var(--s-4); background: var(--carte); border: 1px solid var(--bleu-100); border-radius: var(--r-m); }
.filtres-repliables[open] > summary { margin-bottom: var(--s-2); }
.filtres-repliables > summary .pastille { margin-left: var(--s-2); }
.filtres-repliables > summary { justify-content: flex-start; }
.filtres-repliables > summary::after { margin-left: auto; }
.carte.profil-bloc { --pad-bloc: var(--s-4); padding: 0; }
.profil-bloc > summary { padding: var(--s-2) var(--pad-bloc); }
.profil-bloc > summary h2 { margin: 0; }
.profil-bloc > :not(summary) { margin-left: var(--pad-bloc); margin-right: var(--pad-bloc); }
.profil-bloc[open] { padding-bottom: var(--pad-bloc); }
.profil-bloc[open] > summary { margin-bottom: var(--s-2); }
@media (min-width: 720px) { .carte.profil-bloc { --pad-bloc: var(--s-6); } }
@media (min-width: 900px) { .filtres-repliables[open] > summary { display: none; } .profil-bloc > summary { cursor: default; } }
@media (max-width: 899px) {
  html { scroll-padding-bottom: calc(var(--bas-nav) + 72px); }
  #formProfil { padding-bottom: var(--s-2); }
  .barre-enregistrer { background: linear-gradient(rgba(245, 247, 250, 0), var(--fond) 22%); padding-top: var(--s-4); }   /* dégradé : le texte ne passe pas à moitié sous le bouton */
  .barre-enregistrer .btn { width: 100%; }
  p a:not([class]) { padding-block: 12px; }   /* zone cliquable de 44 px autour des liens dans le texte */
}
@media (max-width: 599px) {
  .segment { display: flex; width: 100%; }
  .segment a { flex: 1 1 auto; justify-content: center; padding: 0 var(--s-2); font-size: .9375rem; }
  .choix-grille:not(#listeSources) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choix { padding-inline: var(--s-2); font-size: .875rem; overflow-wrap: break-word; }
  .hero-accueil { padding: var(--s-3); margin-bottom: var(--s-4); }
  .hero-accueil h1 { font-size: 1.25rem; }
  .hero-accueil .hero-tete { margin-bottom: var(--s-3); gap: var(--s-2); }
  .hero-accueil .outils { display: flex; flex-wrap: wrap; width: 100%; gap: var(--s-2); }
  .hero-accueil .outils > .btn, .hero-accueil .outils > .btn-secondaire, .hero-accueil .outils > .btn-wa { flex: 1 1 auto; padding: 0 var(--s-3); gap: var(--s-1); font-size: .875rem; white-space: nowrap; }
  .hero-accueil .outils .ic { width: 16px; height: 16px; }
  .lib-long { display: none; } .lib-court { display: inline; }
  .hero-accueil .chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
  .hero-accueil .chiffre { padding: var(--s-2) var(--s-3); box-shadow: none; }
  .hero-accueil .chiffre .pastille-ic { display: none; }
  .hero-accueil .chiffre .lib { margin-top: 0; font-size: var(--t-xs); font-weight: 600; }
  .hero-accueil .chiffre .nb { font-size: 1.625rem; margin-top: 0; }
  .hero-accueil .chiffre .note, .hero-accueil .chiffre .pastille { font-size: var(--t-xs); }
  .grille.accueil { grid-template-areas: "avis" "dates" "analyses"; }
  .grille.accueil .carte { padding: var(--s-4); }
}
