:root {
  --encre: #1c2b33;
  --encre-2: #51606a;
  --encre-3: #7b8790;
  --fond: #f7f4ee;
  --surface: #ffffff;
  --surface-2: #fbf9f5;
  --bord: #e3ddd2;
  --bord-fort: #cfc7b8;
  --primaire: #14506b;
  --primaire-fonce: #0d3a4f;
  --primaire-clair: #e4eff3;
  --accent: #c8553d;
  --accent-fonce: #a7412c;
  --accent-clair: #fbeae5;
  --ok: #1a6b43;
  --ok-fond: #e3f3ea;
  --attention: #8a5a00;
  --attention-fond: #fdf1d7;
  --alerte: #a8261e;
  --alerte-fond: #fbe9e7;
  --neutre: #55626b;
  --neutre-fond: #eceff1;
  --rayon: 12px;
  --rayon-petit: 8px;
  --ombre: 0 1px 2px rgba(28, 43, 51, .06), 0 4px 14px rgba(28, 43, 51, .05);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font: 16px/1.5 var(--sans); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h1 { font-family: var(--serif); font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0; }
a { color: var(--primaire); }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid #f0a35e; outline-offset: 2px; border-radius: 4px; }

/* Bandeau de la maquette */
.bandeau { background: #1c2b33; color: #f3efe7; font-size: .86rem; }
.bandeau-int { max-width: 1180px; margin: 0 auto; padding: 8px 16px; display: flex; gap: 10px 18px; align-items: center; flex-wrap: wrap; }
.bandeau strong { color: #ffd9a8; font-weight: 600; }
.bandeau label { margin-left: auto; display: flex; gap: 8px; align-items: center; min-width: 0; }
.bandeau label > span { white-space: nowrap; }
.bandeau select { background: #2b3d47; color: #fff; border: 1px solid #4a5d68; border-radius: 6px; padding: 5px 8px; width: 330px; max-width: 100%; min-height: 0; min-width: 0; }

/* En-tête */
.entete { background: var(--surface); border-bottom: 1px solid var(--bord); position: sticky; top: 0; z-index: 20; }
.entete-int { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--encre); font-weight: 700; letter-spacing: -.01em; }
.logo svg { flex: none; }
.logo small { display: block; font-weight: 500; font-size: .7rem; color: var(--encre-3); letter-spacing: .04em; text-transform: uppercase; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.nav a { text-decoration: none; color: var(--encre-2); padding: 7px 11px; border-radius: 8px; font-size: .94rem; font-weight: 500; white-space: nowrap; }
.nav a:hover { background: var(--fond); color: var(--encre); }
.nav a.actif { background: var(--primaire-clair); color: var(--primaire-fonce); }
.outils { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.pastille-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; color: var(--encre-2); text-decoration: none; }
.pastille-btn:hover { background: var(--fond); color: var(--encre); }
.pastille-btn .compte { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.moi { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--encre); padding: 4px 8px 4px 4px; border-radius: 10px; }
.moi:hover { background: var(--fond); }
.moi .txt { font-size: .84rem; line-height: 1.2; max-width: 170px; }
.moi .txt span { display: block; color: var(--encre-3); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primaire); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; flex: none; }
.avatar.petit { width: 26px; height: 26px; font-size: .68rem; }

/* Mise en page */
main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; min-height: 60vh; }
.titre-page { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 20px; }
.titre-page p { color: var(--encre-2); margin-top: 6px; max-width: 70ch; }
.fil { font-size: .86rem; color: var(--encre-3); margin-bottom: 10px; }
.fil a { color: var(--encre-2); }
.grille { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.deux-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.col { display: grid; gap: 16px; align-content: start; min-width: 0; }
.section { margin-top: 28px; }
.section > h2 { margin-bottom: 12px; }
.entre { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rang { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.discret { color: var(--encre-2); font-size: .9rem; }
.mini { color: var(--encre-3); font-size: .8rem; }
.pile > * + * { margin-top: 10px; }

/* Cartes */
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 18px; min-width: 0; }
.carte > h2, .carte > h3 { margin-bottom: 10px; }
.carte.plate { box-shadow: none; background: var(--surface-2); }
.carte.cliquable { display: block; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.carte.cliquable:hover { border-color: var(--primaire); transform: translateY(-1px); }
.vide { text-align: center; padding: 30px 18px; color: var(--encre-2); border: 1px dashed var(--bord-fort); border-radius: var(--rayon); background: var(--surface-2); }
.vide strong { display: block; color: var(--encre); margin-bottom: 4px; }
.vide .btn { margin-top: 12px; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border-radius: 9px; border: 1px solid var(--bord-fort); background: var(--surface); color: var(--encre); font-weight: 600; font-size: .93rem; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn:hover { border-color: var(--encre-3); }
.btn.primaire { background: var(--primaire); border-color: var(--primaire); color: #fff; }
.btn.primaire:hover { background: var(--primaire-fonce); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { background: var(--accent-fonce); }
.btn.danger { color: var(--alerte); border-color: #e2b7b3; }
.btn.lien { border: 0; background: none; padding: 4px 2px; color: var(--primaire); text-decoration: underline; font-weight: 500; }
.btn.petit { padding: 6px 10px; font-size: .84rem; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.large { width: 100%; }

/* Étiquettes */
.etq { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--neutre-fond); color: var(--neutre); white-space: nowrap; }
.etq svg { flex: none; }
.etq.ok { background: var(--ok-fond); color: var(--ok); }
.etq.attention { background: var(--attention-fond); color: var(--attention); }
.etq.alerte { background: var(--alerte-fond); color: var(--alerte); }
.etq.info { background: var(--primaire-clair); color: var(--primaire-fonce); }
.etq.contour { background: transparent; border: 1px solid var(--bord-fort); color: var(--encre-2); }

/* Formulaires */
.champ { display: grid; gap: 5px; }
.champ > span, .champ > legend { font-weight: 600; font-size: .9rem; }
.champ small { color: var(--encre-3); font-size: .8rem; }
fieldset.champ { border: 0; padding: 0; margin: 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=tel], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--bord-fort); border-radius: 8px; background: #fff; min-height: 40px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid #b9d7e3; border-color: var(--primaire); }
.form { display: grid; gap: 16px; }
.form-grille { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.form h3 { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--bord); }
.form h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.coches { display: flex; flex-wrap: wrap; gap: 8px; }
.coche { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid var(--bord-fort); border-radius: 999px; background: #fff; font-size: .9rem; cursor: pointer; }
.coche input { accent-color: var(--primaire); margin: 0; }
.radio-carte { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--bord-fort); border-radius: 10px; background: #fff; cursor: pointer; }
.radio-carte input { margin-top: 4px; accent-color: var(--primaire); }
.radio-carte strong { display: block; }
.radio-carte span { color: var(--encre-2); font-size: .88rem; }
.actions-form { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* Messages d'information */
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--primaire-clair); color: var(--primaire-fonce); font-size: .92rem; align-items: flex-start; }
.note svg { flex: none; margin-top: 2px; }
.note.attention { background: var(--attention-fond); color: #6b4600; }
.note.ok { background: var(--ok-fond); color: var(--ok); }
.note.neutre { background: var(--neutre-fond); color: var(--encre-2); }
.note .btn { margin-top: 8px; }
.avenir { border: 1px dashed var(--bord-fort); background: repeating-linear-gradient(135deg, #fbf9f5, #fbf9f5 10px, #f4f0e8 10px, #f4f0e8 20px); color: var(--encre-2); border-radius: 10px; padding: 14px; font-size: .9rem; }
.avenir strong { color: var(--encre); }

/* Accueil */
.hero { background: linear-gradient(135deg, #14506b 0%, #0d3a4f 100%); color: #fff; border-radius: 18px; padding: clamp(24px, 5vw, 52px); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: center; overflow: hidden; }
.hero h1 { color: #fff; font-size: clamp(1.8rem, 4.4vw, 2.9rem); }
.hero p { color: #d5e6ec; margin-top: 14px; font-size: 1.06rem; max-width: 52ch; }
.hero .rang { margin-top: 22px; }
.hero .btn { border-color: transparent; }
.hero .btn.clair { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .35); }
.hero-ill { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); border-radius: 14px; padding: 16px; }
.hero-ill .ligne { display: flex; align-items: center; gap: 10px; background: #fff; color: var(--encre); border-radius: 10px; padding: 10px 12px; font-size: .88rem; }
.hero-ill .ligne + .ligne { margin-top: 8px; }
.hero-ill .ligne b { margin-left: auto; color: var(--ok); white-space: nowrap; }
.public { border-top: 4px solid var(--primaire); }
.public.b { border-top-color: var(--accent); }
.public.c { border-top-color: #7a6a2f; }
.public ul { margin: 10px 0 0; padding-left: 18px; color: var(--encre-2); font-size: .93rem; }
.public li + li { margin-top: 4px; }

/* Chiffres clés */
.chiffre { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px; }
.chiffre .valeur { font-size: 2rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chiffre .libelle { color: var(--encre-2); font-size: .9rem; margin-top: 2px; }
.chiffre .detail { color: var(--encre-3); font-size: .8rem; margin-top: 6px; }
a.chiffre { text-decoration: none; color: inherit; display: block; }
a.chiffre:hover { border-color: var(--primaire); }

/* Locaux */
.local { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.local .visuel { position: relative; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; }
.local .visuel .etq { position: absolute; top: 10px; left: 10px; }
.local .visuel .score-coin { position: absolute; top: 10px; right: 10px; background: #fff; border-radius: 999px; padding: 3px 10px; font-weight: 700; font-size: .84rem; box-shadow: var(--ombre); }
.local .corps { padding: 14px 16px 16px; display: grid; gap: 8px; flex: 1; align-content: start; }
.local h3 { font-size: 1rem; }
.local .prix { font-weight: 700; }
.faits { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--encre-2); font-size: .88rem; }
.faits span { display: inline-flex; align-items: center; gap: 5px; }
.visuel-grand { border-radius: var(--rayon); aspect-ratio: 21 / 9; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.visuel-grand .mention { position: absolute; bottom: 10px; right: 12px; background: rgba(255, 255, 255, .85); border-radius: 6px; padding: 2px 8px; font-size: .76rem; color: var(--encre-2); }
.filtres { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); align-items: end; }
dl.fiche { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 0; margin: 0; font-size: .93rem; }
dl.fiche dt { color: var(--encre-2); padding: 8px 10px 8px 0; border-top: 1px solid var(--bord); }
dl.fiche dd { margin: 0; padding: 8px 0; border-top: 1px solid var(--bord); font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
dl.fiche dt:first-of-type, dl.fiche dd:first-of-type { border-top: 0; }
.caracs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.carac { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--bord); font-size: .9rem; }
.carac .etat { margin-left: auto; font-weight: 600; font-size: .8rem; }
.carac.oui .etat { color: var(--ok); }
.carac.non .etat { color: var(--alerte); }
.carac.inconnu .etat { color: var(--encre-3); }

/* Score de rapprochement */
.score { display: grid; gap: 8px; }
.score .tete { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.score .note-score { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.score .note-score small { font-size: .95rem; font-weight: 600; color: var(--encre-3); }
.barre { height: 10px; border-radius: 5px; background: #e8e3d8; display: flex; overflow: hidden; gap: 2px; }
.barre i { display: block; height: 100%; }
.barre .acquis { background: var(--primaire); border-radius: 5px 0 0 5px; }
.barre .inconnu { background: repeating-linear-gradient(135deg, #9fb7c2, #9fb7c2 4px, #d3e0e6 4px, #d3e0e6 8px); }
.legende { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: .78rem; color: var(--encre-2); }
.legende span { display: inline-flex; align-items: center; gap: 5px; }
.legende i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.raisons { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .9rem; }
.raisons li { display: flex; gap: 8px; align-items: flex-start; }
.raisons .puce { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; margin-top: 1px; }
.raisons .c .puce { background: var(--ok-fond); color: var(--ok); }
.raisons .e .puce { background: var(--attention-fond); color: var(--attention); }
.raisons .m .puce { background: var(--neutre-fond); color: var(--neutre); }
.raisons .v .puce { background: var(--primaire-clair); color: var(--primaire-fonce); }
.raisons .b .puce { background: var(--alerte-fond); color: var(--alerte); }
.raisons .v, .raisons .m { color: var(--encre-2); }

/* Dossiers */
.etapes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.etapes li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.etapes li:last-child { padding-bottom: 0; }
.etapes li::before { content: ""; position: absolute; left: 12px; top: 24px; bottom: 0; width: 2px; background: var(--bord); }
.etapes li:last-child::before { display: none; }
.etapes .pt { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--bord-fort); background: #fff; display: flex; align-items: center; justify-content: center; font-size: .72rem; color: var(--encre-3); font-weight: 700; z-index: 1; }
.etapes .fait .pt { background: var(--ok); border-color: var(--ok); color: #fff; }
.etapes .fait::before { background: var(--ok); }
.etapes .courant .pt { border-color: var(--primaire); color: var(--primaire); box-shadow: 0 0 0 4px var(--primaire-clair); }
.etapes .courant strong { color: var(--primaire-fonce); }
.etapes .clos .pt { background: var(--alerte); border-color: var(--alerte); color: #fff; }
.etapes .a-venir { color: var(--encre-3); }
.etapes small { display: block; color: var(--encre-3); font-size: .8rem; }
.ligne-liste { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 14px 16px; text-decoration: none; color: inherit; border-top: 1px solid var(--bord); }
.ligne-liste:first-child { border-top: 0; }
a.ligne-liste:hover { background: var(--surface-2); }
.ligne-liste h3 { font-size: .98rem; }
.liste { padding: 0; overflow: hidden; }
.liste > h2, .liste > .entre { padding: 16px 16px 12px; margin: 0; }
.liste > .vide { margin: 0 16px 16px; }

/* Messagerie */
.fil-msg { display: grid; gap: 10px; max-height: 460px; overflow: auto; padding: 4px 2px; }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 14px 14px 14px 4px; background: var(--neutre-fond); justify-self: start; }
.msg.moi-msg { background: var(--primaire); color: #fff; border-radius: 14px 14px 4px 14px; justify-self: end; }
.msg .qui { font-size: .74rem; font-weight: 600; opacity: .8; display: block; margin-bottom: 2px; }
.msg .quand { font-size: .7rem; opacity: .7; display: block; margin-top: 3px; }
.msg.systeme { background: none; justify-self: center; color: var(--encre-3); font-size: .8rem; padding: 2px; max-width: 100%; text-align: center; }
.ecrire { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.ecrire textarea { min-height: 44px; height: 44px; }

/* Notifications */
.notif { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--bord); align-items: start; }
.notif:first-of-type { border-top: 0; }
.notif .point { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; background: transparent; }
.notif.non-lue .point { background: var(--accent); }
.notif.non-lue h3 { font-weight: 700; }
.notif h3 { font-size: .96rem; font-weight: 500; }

/* Tableaux */
.table-defile { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; color: var(--encre-2); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 1px solid var(--bord-fort); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--bord); vertical-align: top; }
tr:last-child td { border-bottom: 0; }

/* Fenêtre modale et messages éphémères */
.voile { position: fixed; inset: 0; background: rgba(28, 43, 51, .5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modale { background: #fff; border-radius: 14px; padding: 22px; width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modale h2 { margin-bottom: 8px; }
.modale .form { margin-top: 14px; }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(520px, calc(100% - 24px)); }
.toast { background: #1c2b33; color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); font-size: .92rem; display: flex; gap: 10px; align-items: flex-start; }
.toast.erreur { background: #8f1f18; }
.toast.ok { background: #175c3a; }

.pied { border-top: 1px solid var(--bord); background: var(--surface); color: var(--encre-2); font-size: .86rem; }
.pied-int { max-width: 1180px; margin: 0 auto; padding: 22px 16px; display: flex; gap: 10px 24px; flex-wrap: wrap; justify-content: space-between; }

.etapes-h { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px; counter-reset: e; }
.etapes-h .carte { counter-increment: e; }
.etapes-h .carte::before { content: counter(e); display: inline-flex; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-clair); color: var(--accent-fonce); font-weight: 700; align-items: center; justify-content: center; margin-bottom: 10px; }
.etapes-h p { color: var(--encre-2); font-size: .92rem; margin-top: 4px; }

@media (max-width: 880px) {
  .deux-col { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .entete-int { gap: 6px 10px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .moi .txt { display: none; }
  .bandeau label { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .bandeau select { flex: 1; width: auto; }
  .msg { max-width: 92%; }
  .ligne-liste { grid-template-columns: 1fr; }
  .ligne-liste > .etq, .ligne-liste > .btn, .ligne-liste > .rang { justify-self: start; }
  .chiffre { padding: 13px; }
  .chiffre .valeur { font-size: 1.6rem; }
  main { padding-top: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ───────────── Compléments propres à l'application réelle ───────────── */
[hidden] { display: none !important; }
.bandeau-lien { margin-left: auto; color: #ffd9a8; font-weight: 600; }
.liste-simple { margin: 0; padding-left: 20px; color: var(--encre-2); }
.liste-simple li + li { margin-top: 4px; }
.ligne-org { padding: 12px 0; border-top: 1px solid var(--bord); }
.ligne-org:first-of-type { border-top: 0; padding-top: 0; }
.coche input[type=radio] { accent-color: var(--primaire); }
.carte h3 svg, .carte h2 svg { vertical-align: -3px; }
.texte-libre { white-space: pre-line; overflow-wrap: anywhere; }
.pousse { flex: 1; }
.fil-etapes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.fil-etapes button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--bord-fort); background: var(--surface); color: var(--encre-2); border-radius: 999px; padding: 6px 12px 6px 6px; font-size: .88rem; font-weight: 600; cursor: pointer; }
.fil-etapes button span { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; align-items: center; justify-content: center; background: var(--neutre-fond); color: var(--encre-2); font-size: .8rem; }
.fil-etapes button.actif { background: var(--primaire-clair); border-color: var(--primaire); color: var(--primaire-fonce); }
.fil-etapes button.actif span { background: var(--primaire); color: #fff; }
.etape-fiche { border: 0; padding: 0; margin: 0; display: grid; gap: 16px; min-width: 0; }
.etape-fiche > legend { font-weight: 700; font-size: 1.05rem; padding: 0; margin-bottom: 4px; }
.nav-etapes { justify-content: flex-start; align-items: center; }
.coches.defilant { max-height: 220px; overflow-y: auto; padding: 10px; border: 1px solid var(--bord-fort); border-radius: 10px; background: #fff; }
.filtre-liste { margin-bottom: 4px; }
.marques { justify-content: flex-end; flex-wrap: wrap; }
.ligne-liste > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.msg .texte-libre { display: block; }
.ecrire textarea { min-height: 72px; height: 72px; }
.outils .pastille-btn { flex: none; }
@media (min-width: 881px) { .nav a.petit-ecran { display: none; } }
.extrait { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.form h3 { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--bord); }
.form h3:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.note-interne { padding: 10px 12px; border: 1px solid var(--bord); border-radius: 10px; background: var(--neutre-fond); }
.note-interne .mini { margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.note-interne .btn.lien { padding: 0; min-height: 0; }
.carte textarea[name=texte] { min-height: 72px; }
.ligne-territoire { padding: 12px 0; border-top: 1px solid var(--bord); gap: 6px; }
.ligne-territoire:first-of-type { border-top: 0; padding-top: 4px; }
@media (min-width: 881px) { .entete-int { gap: 8px 14px; } .nav a { padding: 7px 9px; } .moi .txt { max-width: 150px; } }
/* Sur petit écran, les boutons d'une notification passent sous son texte au lieu de l'écraser. */
@media (max-width: 600px) { .notif { grid-template-columns: 10px minmax(0, 1fr); } .notif > .rang { grid-column: 2; } }
/* ───────────── Photos ───────────── */
.local .visuel.photo { background: var(--neutre-fond); }
.local .visuel.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.galerie { display: grid; gap: 8px; }
/* La photo choisie est montrée en entier (une photo en hauteur n'est pas rognée) ; les vignettes, elles, sont recadrées. */
.photo-grande { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; border-radius: var(--rayon); background: var(--neutre-fond); display: block; }
.vignettes { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.vignettes button { flex: none; width: 84px; height: 60px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--neutre-fond); cursor: pointer; }
.vignettes button.actif { border-color: var(--primaire); }
.vignettes img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos-gestion { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.photos-gestion figure { margin: 0; }
.photos-gestion img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--neutre-fond); display: block; }
.photos-gestion figcaption { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; margin-top: 4px; font-size: .82rem; }
.photos-gestion .btn.lien, .ligne-doc .btn.lien { padding: 0; min-height: 0; }
.btn.depot { cursor: pointer; position: relative; }
.btn.depot.occupe { opacity: .6; cursor: progress; }
.btn.lien.doc { padding: 0; min-height: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.titre-page h1, .ligne-liste h3, .carte.local h3 { overflow-wrap: anywhere; }
.btn.depot:focus-within { outline: 2px solid var(--primaire); outline-offset: 2px; }
.ligne-doc { gap: 6px 12px; flex-wrap: wrap; }
.ligne-doc > span:first-child { min-width: 0; overflow-wrap: anywhere; }
/* ───────────── Carte ───────────── */
.carte-geo { position: relative; height: var(--h, 380px); overflow: hidden; border-radius: 10px; border: 1px solid var(--bord); background: #e9e6df; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
/* Sur un téléphone, la carte ne remplit pas l'écran : il reste de quoi faire défiler la page en la touchant autour. */
@media (max-width: 640px) { .carte-geo { height: min(var(--h, 380px), 320px); } }
.carte-geo[data-choix] { cursor: crosshair; }
.carte-fond { position: absolute; inset: 0; }
.carte-fond img { position: absolute; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.repere { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; padding: 0; }
.repere.exacte { width: 22px; height: 22px; background: var(--accent); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .45); }
/* Position approchée : la zone où se trouve le local (jamais cliquable), et en son centre un point qui, lui, se choisit. */
.zone-approchee { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(20, 80, 107, .13); border: 2px dashed var(--primaire); pointer-events: none; }
.repere.approchee { width: 18px; height: 18px; background: #fff; border: 5px solid var(--primaire); box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.repere.commune { width: 16px; height: 16px; border-radius: 4px; background: #fff; border: 3px solid var(--encre-2); box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
button.repere { cursor: pointer; }
/* La surface qui réagit au doigt est plus large que le repère dessiné. */
button.repere::after { content: ''; position: absolute; inset: -12px; border-radius: 50%; }
button.repere:hover, button.repere:focus-visible { outline: 3px solid rgba(20, 80, 107, .45); outline-offset: 1px; }
.repere.choisi { background: var(--primaire); border-style: solid; border-color: #fff; box-shadow: 0 0 0 3px var(--primaire); }
.carte-zoom { position: absolute; top: 10px; right: 10px; display: grid; gap: 4px; }
.carte-zoom button { width: 34px; height: 34px; border: 1px solid var(--bord-fort); border-radius: 8px; background: #fff; font-size: 1.2rem; font-weight: 700; line-height: 1; cursor: pointer; color: var(--encre); }
.carte-zoom button:disabled { opacity: .45; cursor: default; }
.carte-source { position: absolute; right: 6px; bottom: 4px; background: rgba(255, 255, 255, .85); border-radius: 4px; padding: 1px 6px; font-size: .72rem; color: var(--encre-2); text-decoration: none; }
.legende-carte { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; }
.legende-carte > span { display: inline-flex; align-items: flex-start; gap: 6px; }
.pastille-carte { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: 3px; }
.pastille-carte.exacte { background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--bord-fort); }
.pastille-carte.approchee { background: rgba(20, 80, 107, .13); border: 2px dashed var(--primaire); }
.pastille-carte.commune { border-radius: 3px; background: #fff; border: 2px solid var(--encre-2); }
.carte-locaux { display: grid; gap: 12px; }
.local-choisi .carte.local { max-width: 420px; }
.bascule { display: inline-flex; gap: 4px; }
.bascule .btn.actif { background: var(--primaire-clair); border-color: var(--primaire); color: var(--primaire-fonce); }
/* ───────────── Tableaux de bord ───────────── */
.histo { display: grid; gap: 8px; margin-top: 10px; }
.histo-ligne { display: grid; grid-template-columns: minmax(0, 11rem) minmax(40px, 1fr) 3.2rem; gap: 10px; align-items: center; font-size: .9rem; }
.histo-ligne .nom { color: var(--encre-2); overflow-wrap: anywhere; }
.histo-ligne .piste { height: 10px; border-radius: 999px; background: var(--neutre-fond); overflow: hidden; }
.histo-ligne .piste span { display: block; height: 100%; border-radius: 999px; background: var(--primaire); min-width: 2px; }
.histo-ligne .piste span.alerte { background: var(--accent); }
.histo-ligne .valeur { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.defile { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 10px; }
.tableau th, .tableau td { text-align: right; padding: 8px 10px; border-top: 1px solid var(--bord); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tableau th:first-child, .tableau td:first-child { text-align: left; white-space: normal; }
.tableau th { color: var(--encre-2); font-weight: 600; border-top: 0; }
@media (max-width: 600px) { .histo-ligne { grid-template-columns: minmax(0, 7.5rem) minmax(30px, 1fr) 2.6rem; } }
/* ───────────── Équipe ───────────── */
.ligne-membre { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--bord); }
.ligne-membre:first-child { border-top: 0; padding-top: 2px; }
.ligne-membre > div { min-width: 0; overflow-wrap: anywhere; }
.ligne-membre .commandes { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .88rem; }
.ligne-membre .btn.lien { padding: 0; min-height: 0; }
input.lien-invitation { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
/* ───────────── Pages légales ───────────── */
.page-legale { max-width: 820px; margin: 0 auto; display: grid; gap: 16px; }
.page-legale .carte p, .page-legale .carte li { color: var(--encre-2); }
mark.a-completer { background: #fff1c9; color: #6b4a00; border-radius: 4px; padding: 0 4px; }
.pied a { color: inherit; }

/* ───────────── Bandeau de la commune (espace des communes) ───────────── */
.espace-commune { background: var(--primaire-clair); border-bottom: 1px solid #c5dbe4; }
.espace-commune-int { max-width: 1180px; margin: 0 auto; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 12px 40px; }
.commune-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ecusson { width: 44px; height: 51px; flex: none; }
.ecusson path { fill: var(--primaire); }
.ecusson text { fill: #fff; font-family: var(--serif); font-size: 15px; font-weight: 700; }
.commune-nom { font-family: var(--serif); font-size: clamp(1.3rem, 3.2vw, 1.65rem); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; color: var(--primaire-fonce); overflow-wrap: anywhere; }
.commune-service { color: var(--encre-2); font-size: .9rem; margin-top: 2px; overflow-wrap: anywhere; }
.blason { height: 51px; width: auto; flex: none; }
.blason.petit { height: 40px; }
.credits { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.credit-blason { display: flex; align-items: center; gap: 12px; }
.credit-blason span { min-width: 0; overflow-wrap: anywhere; }
