/* Faune & Cultures : jetons de design
   Sol lichen, encre humus, haie, blé, betterave. */
:root {
  --sol: #EEF1E8;
  --sol-2: #E2E8D9;
  --papier: #F9FBF5;
  --encre: #1F2A22;
  --encre-2: #56635A;
  --trait: #CDD5C4;
  --haie: #2F6B4F;
  --haie-fonce: #24543E;
  --haie-pale: #D7E6DA;
  --ble: #E2B13C;
  --ble-pale: #F6E6B8;
  --betterave: #9C2F5A;
  --betterave-pale: #F1D9E2;
  --ombre: 0 1px 0 rgba(31, 42, 34, .06), 0 12px 32px -18px rgba(31, 42, 34, .35);
  --r-s: 6px;
  --r-m: 14px;
  --r-l: 22px;
  --f-titre: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --f-texte: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
  --barre-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sol: #101712; --sol-2: #172019; --papier: #1A241D; --encre: #E4ECE0; --encre-2: #9AA99D;
    --trait: #2B392F; --haie: #62AD87; --haie-fonce: #7CC29E; --haie-pale: #1F3A2B; --ble: #EBC45F;
    --ble-pale: #3A3220; --betterave: #D7679A; --betterave-pale: #3C2030;
    --ombre: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 34px -18px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sol: #101712; --sol-2: #172019; --papier: #1A241D; --encre: #E4ECE0; --encre-2: #9AA99D;
  --trait: #2B392F; --haie: #62AD87; --haie-fonce: #7CC29E; --haie-pale: #1F3A2B; --ble: #EBC45F;
  --ble-pale: #3A3220; --betterave: #D7679A; --betterave-pale: #3C2030;
  --ombre: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 34px -18px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* Base */
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--sol);
  color: var(--encre);
  font-family: var(--f-texte);
  font-size: 15.5px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  --bs-body-bg: var(--sol);
  --bs-body-color: var(--encre);
  --bs-border-color: var(--trait);
}
h1, h2, h3, .titre { font-family: var(--f-titre); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; color: var(--encre); }
h1 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3rem); font-weight: 800; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
a { color: var(--haie); text-underline-offset: 3px; }
a:hover { color: var(--haie-fonce); }
:focus-visible { outline: 3px solid var(--ble); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--encre); color: var(--sol); padding: .5rem 1rem; z-index: 2000; }
.skip:focus { left: 8px; }
.muet { color: var(--encre-2); }
.lien-discret { background: none; border: 0; padding: 0; color: var(--encre-2); font-size: .85rem; text-decoration: underline; text-underline-offset: 3px; }
.lien-discret:hover { color: var(--encre); }

/* Barre */
.barre {
  position: sticky; top: 0; z-index: 1100;
  height: var(--barre-h);
  display: flex; align-items: center; gap: 2rem;
  padding: 0 clamp(16px, 2.5vw, 32px);
  background: color-mix(in srgb, var(--sol) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--trait);
}
.marque { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--encre); font-family: var(--f-titre); font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; white-space: nowrap; }
.marque i { font-style: normal; color: var(--haie); font-weight: 400; }
.marque:hover { color: var(--encre); }
.barre__nav { display: flex; align-items: center; gap: .25rem; flex: 1; }
.barre__nav a { color: var(--encre-2); text-decoration: none; padding: .45rem .8rem; border-radius: 999px; font-weight: 500; }
.barre__nav a:hover { color: var(--encre); background: var(--sol-2); }
.barre__nav a[aria-current="page"] { color: var(--encre); background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait); }
.barre__nav .barre__declarer { margin-left: auto; background: var(--haie); color: #fff; font-weight: 600; }
.barre__nav .barre__declarer:hover, .barre__nav .barre__declarer[aria-current="page"] { background: var(--haie-fonce); color: #fff; box-shadow: none; }
:root[data-theme="dark"] .barre__nav .barre__declarer { color: #0E1A12; }
.barre__compte { display: flex; align-items: center; gap: .7rem; }
.barre__qui { display: flex; flex-direction: column; line-height: 1.15; }
.barre__qui strong { font-size: .88rem; font-weight: 600; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre__qui small { color: var(--encre-2); font-size: .78rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ble); color: #2A2008; font-weight: 700; font-size: .8rem; }
.theme { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--trait); background: var(--papier); color: var(--encre-2); display: grid; place-items: center; }
.theme:hover { color: var(--encre); }
.barre__menu { display: none; }
.ruban { margin: 0; padding: .3rem clamp(16px, 2.5vw, 32px); font-size: .78rem; color: var(--betterave); background: var(--betterave-pale); }

.flash { margin: 1rem auto 0; max-width: 1200px; padding: .8rem 1.1rem; border-radius: var(--r-m); background: var(--haie-pale); color: var(--encre); border-left: 4px solid var(--haie); }
.flash--erreur { background: var(--betterave-pale); border-left-color: var(--betterave); }

/* Conteneurs */
.cadre { max-width: 1240px; margin: 0 auto; padding: clamp(20px, 3vw, 40px) clamp(16px, 2.5vw, 32px) 64px; }
.entete { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.entete p { margin: .4rem 0 0; color: var(--encre-2); max-width: 62ch; }
.feuille { background: var(--papier); border: 1px solid var(--trait); border-radius: var(--r-l); box-shadow: var(--ombre); }

/* Boutons */
.btn-fc { display: inline-flex; align-items: center; gap: .5rem; border: 0; border-radius: 999px; padding: .62rem 1.15rem; font-weight: 600; background: var(--haie); color: #fff; text-decoration: none; transition: background .15s; }
.btn-fc:hover { background: var(--haie-fonce); color: #fff; }
:root[data-theme="dark"] .btn-fc { color: #0E1A12; }
.btn-fc--clair { background: var(--papier); color: var(--encre); box-shadow: inset 0 0 0 1px var(--trait); }
.btn-fc--clair:hover { background: var(--sol-2); color: var(--encre); }
.btn-fc--ble { background: var(--ble); color: #2A2008; }
.btn-fc--ble:hover { background: #D19F2B; color: #2A2008; }
.btn-fc--alerte { background: var(--betterave); color: #fff; }
.btn-fc--alerte:hover { background: #82244A; color: #fff; }
.btn-fc[disabled] { opacity: .45; pointer-events: none; }

/* Statuts */
.statut { display: inline-flex; align-items: center; gap: .4rem; padding: .18rem .65rem .2rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.statut::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.statut--nouveau { background: var(--ble-pale); color: #7A5A0B; }
.statut--en_instruction { background: #E2EAF3; color: #305A85; }
.statut--valide { background: var(--haie-pale); color: var(--haie-fonce); }
.statut--rejete { background: var(--betterave-pale); color: var(--betterave); }
.statut--clos { background: var(--sol-2); color: var(--encre-2); }
:root[data-theme="dark"] .statut--nouveau { color: var(--ble); }
:root[data-theme="dark"] .statut--en_instruction { background: #1E2B3A; color: #8FB6DE; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .statut--nouveau { color: var(--ble); }
  :root:not([data-theme="light"]) .statut--en_instruction { background: #1E2B3A; color: #8FB6DE; }
  :root:not([data-theme="light"]) .barre__nav .barre__declarer,
  :root:not([data-theme="light"]) .btn-fc { color: #0E1A12; }
}
.pastille { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* Formulaires */
.champ { display: flex; flex-direction: column; gap: .35rem; }
.champ label, .champ .label { font-weight: 600; font-size: .9rem; }
.champ small { color: var(--encre-2); }
.saisie, .champ select, .champ input, .champ textarea {
  width: 100%; border: 1px solid var(--trait); background: var(--papier); color: var(--encre);
  border-radius: 10px; padding: .62rem .8rem; font: inherit;
}
.saisie:focus, .champ select:focus, .champ input:focus, .champ textarea:focus { outline: none; border-color: var(--haie); box-shadow: 0 0 0 3px color-mix(in srgb, var(--haie) 25%, transparent); }
.champ .erreur { color: var(--betterave); font-size: .85rem; font-weight: 500; }
.champ[data-erreur] input, .champ[data-erreur] select { border-color: var(--betterave); }

/* Tables */
.table-fc { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-fc th { font-weight: 600; font-size: .8rem; color: var(--encre-2); text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--trait); white-space: nowrap; }
.table-fc td { padding: .8rem 1rem; border-bottom: 1px solid var(--trait); vertical-align: middle; }
.table-fc tbody tr { transition: background .12s; }
.table-fc tbody tr:hover { background: var(--sol); }
.table-fc tbody tr:last-child td { border-bottom: 0; }
.table-fc .num { text-align: right; white-space: nowrap; }
.table-fc a.ref { font-weight: 600; text-decoration: none; color: var(--encre); }
.table-fc a.ref:hover { color: var(--haie); }
.espece { display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap; }

/* ============ Carte (écran d'accueil) ============ */
.page-carte main { height: calc(100dvh - var(--barre-h) - 26px); position: relative; }
.scene { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 380px; }
.scene__carte { position: relative; min-height: 0; }
#carte { position: absolute; inset: 0; background: var(--sol-2); }
.leaflet-container { font-family: var(--f-texte); }
.scene .leaflet-tile-pane, .mini-carte .leaflet-tile-pane { filter: sepia(.18) hue-rotate(45deg) saturate(.9); }
:root[data-theme="dark"] .leaflet-tile-pane { filter: saturate(.4) hue-rotate(60deg) brightness(.95); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-tile-pane { filter: saturate(.4) hue-rotate(60deg) brightness(.95); } }

.calques { position: absolute; top: 16px; left: 16px; z-index: 500; display: flex; background: var(--papier); border-radius: 999px; padding: 4px; box-shadow: var(--ombre); border: 1px solid var(--trait); }
.calques button { border: 0; background: none; padding: .42rem .9rem; border-radius: 999px; font-weight: 500; color: var(--encre-2); font-size: .88rem; }
.calques button[aria-pressed="true"] { background: var(--encre); color: var(--sol); }

/* Frise temporelle : la pièce maîtresse */
.frise {
  position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 500;
  display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: end;
  background: var(--papier); border: 1px solid var(--trait); border-radius: var(--r-l); box-shadow: var(--ombre);
  padding: 14px 18px 12px;
}
.frise__lecture { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--encre); color: var(--sol); display: grid; place-items: center; align-self: center; }
.frise__lecture:hover { background: var(--haie); }
.frise__lecture svg { width: 20px; height: 20px; }
.frise__haut { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 6px; }
.frise__periode { font-family: var(--f-titre); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.frise__aide { font-size: .8rem; color: var(--encre-2); }
.frise__barres { display: flex; align-items: end; gap: 3px; height: 58px; cursor: pointer; touch-action: none; }
.frise__mois { flex: 1; display: flex; flex-direction: column-reverse; height: 100%; position: relative; border-radius: 3px; }
.frise__mois span { display: block; border-radius: 2px; transition: opacity .25s; }
.frise__mois .m { background: var(--betterave); }
.frise__mois .o { background: var(--ble); margin-bottom: 1px; }
.frise__mois[data-hors] span { opacity: .22; }
.frise__mois[data-courant]::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 6px; height: 6px; border-radius: 50%; background: var(--encre); transform: translateX(-50%); }
.frise__axe { display: flex; gap: 3px; margin-top: 10px; font-size: .7rem; color: var(--encre-2); }
.frise__axe span { flex: 1; text-align: center; white-space: nowrap; overflow: visible; }
.frise__legende { display: flex; gap: 1rem; font-size: .78rem; color: var(--encre-2); }
.frise__legende i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }

/* Panneau de lecture */
.panneau { border-left: 1px solid var(--trait); background: var(--papier); overflow-y: auto; padding: 26px 26px 32px; display: flex; flex-direction: column; gap: 1.6rem; }
.panneau__lieu { color: var(--encre-2); font-size: .9rem; margin: 0 0 .3rem; }
.compteur { font-family: var(--f-titre); font-weight: 800; font-size: clamp(3.4rem, 3rem + 1.5vw, 4.6rem); line-height: .9; letter-spacing: -.045em; margin: 0; font-variation-settings: "opsz" 96; }
.compteur + p { margin: .45rem 0 0; color: var(--encre-2); }
.duo { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--trait); border-bottom: 1px solid var(--trait); }
.duo div { padding: .85rem 0; }
.duo div + div { padding-left: 1rem; border-left: 1px solid var(--trait); }
.duo strong { display: block; font-family: var(--f-titre); font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; }
.duo span { font-size: .82rem; color: var(--encre-2); }
.panneau h2 { font-size: 1rem; margin: 0 0 .7rem; }
.especes { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.especes button { width: 100%; display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: .65rem; border: 0; background: none; padding: .42rem .5rem; border-radius: 8px; text-align: left; color: var(--encre); position: relative; isolation: isolate; font-size: .92rem; }
.especes button .jauge { position: absolute; inset: 3px auto 3px 0; border-radius: 6px; z-index: -1; opacity: .16; transition: width .4s cubic-bezier(.2, .7, .2, 1); }
.especes button:hover { background: var(--sol); }
.especes button[aria-pressed="false"] { opacity: .38; }
.especes button b { font-weight: 600; }
.panneau__note { font-size: .8rem; color: var(--encre-2); margin: 0; }

.popup-fc .leaflet-popup-content-wrapper { border-radius: var(--r-m); background: var(--papier); color: var(--encre); box-shadow: var(--ombre); }
.popup-fc .leaflet-popup-tip { background: var(--papier); }
.popup-fc .leaflet-popup-content { margin: 14px 16px; font-family: var(--f-texte); font-size: .88rem; line-height: 1.45; }
.popup-fc h3 { font-size: 1rem; margin: 0 0 .25rem; }
.popup-fc dl { display: grid; grid-template-columns: auto 1fr; gap: .1rem .8rem; margin: .5rem 0 .7rem; }
.popup-fc dt { color: var(--encre-2); font-weight: 400; }
.popup-fc dd { margin: 0; font-weight: 600; text-align: right; }
.dep-tip { background: var(--encre); color: var(--sol); border: 0; border-radius: 8px; font-family: var(--f-texte); box-shadow: none; padding: .35rem .6rem; }
.dep-tip::before { display: none; }
.marker-cluster-fc { background: color-mix(in srgb, var(--betterave) 25%, transparent); border-radius: 50%; }
.marker-cluster-fc div { background: var(--betterave); color: #fff; border-radius: 50%; width: 30px; height: 30px; margin: 5px; display: grid; place-items: center; font-weight: 700; font-size: .78rem; }

/* Pulsation à l'apparition d'un signalement pendant la relecture */
.impact { border-radius: 50%; animation: impact 1.6s ease-out forwards; pointer-events: none; }
@keyframes impact { from { transform: scale(.2); opacity: .9; } to { transform: scale(2.4); opacity: 0; } }

/* ============ Tableau de bord ============ */
.phrase-filtre { font-family: var(--f-titre); font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); font-weight: 600; letter-spacing: -.015em; line-height: 1.6; margin: 0 0 2rem; max-width: 46ch; }
.phrase-filtre select, .phrase-filtre input {
  font: inherit; color: var(--haie); background: transparent; border: 0; border-bottom: 2px dashed color-mix(in srgb, var(--haie) 55%, transparent);
  padding: 0 .1rem; border-radius: 0; appearance: none; -webkit-appearance: none; cursor: pointer; max-width: 100%;
}
.phrase-filtre input[type="date"] { width: auto; }
.phrase-filtre select:focus, .phrase-filtre input:focus { outline: none; border-bottom-style: solid; border-bottom-color: var(--haie); }
.chiffres { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 0; margin-bottom: 2rem; border-top: 2px solid var(--encre); }
.chiffres > div { padding: 1rem 1.2rem 0 0; }
.chiffres > div + div { padding-left: 1.2rem; border-left: 1px solid var(--trait); }
.chiffres strong { display: block; font-family: var(--f-titre); font-weight: 800; letter-spacing: -.035em; font-size: 2.1rem; line-height: 1.05; }
.chiffres > div:first-child strong { font-size: 3.4rem; }
.chiffres span { color: var(--encre-2); font-size: .88rem; }
.grille { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.bloc { padding: 22px 24px; }
.bloc h2 { font-size: 1.08rem; margin: 0 0 .25rem; }
.bloc > p.muet { font-size: .86rem; margin: 0 0 1rem; }
.s-12 { grid-column: span 12; } .s-8 { grid-column: span 8; } .s-7 { grid-column: span 7; } .s-5 { grid-column: span 5; } .s-4 { grid-column: span 4; } .s-6 { grid-column: span 6; }
.rang { list-style: none; padding: 0; margin: 0; }
.rang li { display: grid; grid-template-columns: 2.2rem 1fr auto; gap: .5rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--trait); font-size: .92rem; }
.rang li:last-child { border-bottom: 0; }
.rang .code { font-family: var(--f-titre); font-weight: 700; color: var(--encre-2); }
.rang .barre-fine { grid-column: 2 / 4; height: 4px; background: var(--sol-2); border-radius: 4px; overflow: hidden; margin-top: -2px; }
.rang .barre-fine i { display: block; height: 100%; background: var(--betterave); border-radius: 4px; }
.calendrier { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: .8rem; }
.calendrier th { font-weight: 500; color: var(--encre-2); text-align: center; padding: 0 0 .3rem; }
.calendrier th[scope="row"] { text-align: left; white-space: nowrap; padding-right: .5rem; color: var(--encre); font-weight: 500; }
.calendrier td { height: 26px; border-radius: 5px; background: var(--sol-2); text-align: center; color: transparent; transition: transform .12s; }
.calendrier td:hover { transform: scale(1.12); color: inherit; }
.statuts-bande { display: flex; height: 14px; border-radius: 999px; overflow: hidden; margin: .8rem 0 1rem; }
.statuts-bande i { display: block; height: 100%; }
.legende-statuts { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; font-size: .86rem; }
.legende-statuts span { display: inline-flex; align-items: center; gap: .4rem; }

/* ============ Liste et fiche ============ */
.filtres { display: grid; grid-template-columns: 2fr 1.2fr 1.2fr 1fr 1fr 1fr auto; gap: .7rem; align-items: end; padding: 16px; margin-bottom: 1rem; }
.pagination-fc { display: flex; justify-content: space-between; align-items: center; padding: 1rem; gap: 1rem; flex-wrap: wrap; }
.pagination-fc nav { display: flex; gap: .35rem; }
.pagination-fc a, .pagination-fc span.courant { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; text-decoration: none; color: var(--encre); padding: 0 .6rem; }
.pagination-fc a:hover { background: var(--sol-2); }
.pagination-fc span.courant { background: var(--encre); color: var(--sol); font-weight: 600; }
.vide { padding: 3rem 1rem; text-align: center; }

.fiche { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; }
.fiche__tete { padding: 26px 28px; display: grid; gap: .6rem; }
.fiche__tete .ref { font-family: var(--f-titre); font-weight: 800; font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.6rem); letter-spacing: -.03em; margin: 0; }
.fiche__tete .resume { font-size: 1.08rem; margin: 0; color: var(--encre-2); }
.donnees { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--trait); }
.donnees div { padding: 1rem 1.4rem; border-right: 1px solid var(--trait); }
.donnees div:last-child { border-right: 0; }
.donnees strong { display: block; font-family: var(--f-titre); font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }
.donnees span { font-size: .84rem; color: var(--encre-2); }
.details { display: grid; grid-template-columns: 9.5rem 1fr; gap: .55rem 1rem; margin: 0; padding: 22px 28px; border-top: 1px solid var(--trait); }
.details dt { color: var(--encre-2); font-weight: 400; }
.details dd { margin: 0; }
.mini-carte { height: 300px; border-radius: var(--r-l) var(--r-l) 0 0; overflow: hidden; }
.photo { display: block; width: 100%; border-radius: var(--r-m); }
.sans-photo { aspect-ratio: 16 / 5; border-radius: var(--r-m); display: grid; place-items: center; color: var(--encre-2); font-size: .9rem; background: repeating-linear-gradient(115deg, var(--sol-2) 0 14px, var(--sol) 14px 28px); }
.frise-dossier { list-style: none; margin: 0; padding: 0 0 0 1.2rem; border-left: 2px solid var(--trait); }
.frise-dossier li { position: relative; padding: 0 0 1.1rem .6rem; }
.frise-dossier li::before { content: ""; position: absolute; left: calc(-1.2rem - 7px); top: .4rem; width: 12px; height: 12px; border-radius: 50%; background: var(--papier); border: 3px solid var(--haie); }
.frise-dossier li:last-child { padding-bottom: 0; }
.frise-dossier time { display: block; font-size: .8rem; color: var(--encre-2); }
.actions-statut { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.sms { background: var(--sol); border-radius: 16px 16px 16px 4px; padding: .7rem .9rem; font-size: .88rem; }
.sms small { display: block; color: var(--encre-2); margin-top: .3rem; }

/* ============ Déclaration ============ */
.etapes { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.6rem; counter-reset: etape; }
.etapes li { flex: 1; counter-increment: etape; padding: .7rem 0 0; border-top: 4px solid var(--trait); color: var(--encre-2); font-weight: 500; font-size: .92rem; transition: border-color .3s, color .3s; }
.etapes li::before { content: counter(etape) ". "; font-family: var(--f-titre); font-weight: 700; }
.etapes li[data-etat="fait"] { border-top-color: var(--haie); color: var(--encre); }
.etapes li[data-etat="courant"] { border-top-color: var(--ble); color: var(--encre); font-weight: 600; }
.etape { display: none; }
.etape[data-active] { display: block; animation: entree .35s ease-out; }
@keyframes entree { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.choix-especes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; }
.choix-especes label { position: relative; display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; border: 1px solid var(--trait); border-radius: var(--r-m); background: var(--papier); cursor: pointer; font-weight: 500; transition: border-color .15s, box-shadow .15s; }
.choix-especes input { position: absolute; opacity: 0; pointer-events: none; }
.choix-especes label:hover { border-color: var(--encre-2); }
.choix-especes input:checked + label, .choix-especes label:has(input:checked) { border-color: var(--haie); box-shadow: inset 0 0 0 1px var(--haie); background: var(--haie-pale); }
.choix-especes input:focus-visible + .pastille { outline: 3px solid var(--ble); outline-offset: 2px; }
.groupe-titre { font-size: .9rem; font-weight: 600; color: var(--encre-2); margin: 1.2rem 0 .6rem; }
.estimation { margin-top: 1.4rem; padding: 1.1rem 1.3rem; border-radius: var(--r-m); background: var(--ble-pale); display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.estimation strong { font-family: var(--f-titre); font-size: 1.9rem; letter-spacing: -.03em; }
#carte-saisie { height: 360px; border-radius: var(--r-m); border: 1px solid var(--trait); }
.apercu-photo { max-width: 220px; border-radius: var(--r-m); margin-top: .6rem; display: none; }
.nav-etapes { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.8rem; padding-top: 1.2rem; border-top: 1px solid var(--trait); }

/* ============ Connexion ============ */
.page-connexion { background: var(--encre); }
.page-connexion .ruban { position: fixed; left: 0; right: 0; top: 0; z-index: 5; }
.accueil { min-height: 100dvh; display: grid; grid-template-columns: 1.15fr 1fr; }
.accueil__visuel { position: relative; overflow: hidden; color: #EEF1E8; padding: clamp(28px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; background: #18241C; }
.accueil__visuel canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.accueil__visuel > *:not(canvas) { position: relative; }
.accueil__visuel .marque { color: #EEF1E8; margin-top: 1.5rem; }
.accueil__visuel .marque i { color: var(--ble); }
.accueil__titre { font-family: var(--f-titre); font-weight: 800; font-size: clamp(2.4rem, 1.4rem + 3.6vw, 4.6rem); letter-spacing: -.035em; line-height: .98; margin: 0 0 1.2rem; max-width: 12ch; color: #EEF1E8; }
.accueil__visuel p { max-width: 44ch; color: #C3CDBF; font-size: 1.05rem; }
.accueil__chiffres { display: flex; gap: 2.4rem; flex-wrap: wrap; }
.accueil__chiffres strong { display: block; font-family: var(--f-titre); font-size: 2rem; letter-spacing: -.03em; color: var(--ble); }
.accueil__chiffres span { font-size: .85rem; color: #AEB9AA; }
.accueil__form { background: var(--sol); padding: clamp(28px, 5vw, 72px); display: flex; flex-direction: column; justify-content: center; gap: 1.6rem; }
.accueil__form h2 { font-size: 1.7rem; margin: 0; }
.comptes { display: grid; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.comptes button { width: 100%; }
.comptes button { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: .8rem; text-align: left; border: 1px solid var(--trait); background: var(--papier); border-radius: var(--r-m); padding: .65rem .8rem; color: var(--encre); transition: border-color .15s; }
.comptes button:hover { border-color: var(--haie); }
.comptes small { display: block; color: var(--encre-2); font-size: .8rem; }
.comptes .avatar { width: 34px; height: 34px; }
.comptes .role { font-size: .78rem; color: var(--haie); font-weight: 600; }
.pile { display: flex; flex-wrap: wrap; gap: .4rem .8rem; font-size: .78rem; color: var(--encre-2); }

/* Erreur */
.erreur-page { max-width: 640px; margin: 10vh auto; padding: 0 16px; }
.erreur-page .code { font-family: var(--f-titre); font-weight: 800; font-size: 6rem; color: var(--betterave); letter-spacing: -.05em; line-height: 1; }

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .filtres { grid-template-columns: 1fr 1fr 1fr; }
  .s-8, .s-7, .s-5, .s-4, .s-6 { grid-column: span 12; }
  .fiche { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .barre { gap: 1rem; }
  .barre__menu { display: inline-flex; margin-left: auto; border: 1px solid var(--trait); background: var(--papier); color: var(--encre); border-radius: 999px; padding: .4rem .9rem; font-weight: 600; }
  .barre__nav { display: none; position: absolute; top: var(--barre-h); left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--papier); border-bottom: 1px solid var(--trait); padding: .8rem 16px 1rem; }
  .barre__nav[data-ouvert] { display: flex; }
  .barre__nav .barre__declarer { margin-left: 0; text-align: center; }
  .barre__qui, .barre__compte form { display: none; }
  .scene { grid-template-columns: 1fr; grid-template-rows: 62vh auto; position: static; }
  .page-carte main { height: auto; }
  .scene__carte { min-height: 62vh; }
  .panneau { border-left: 0; border-top: 1px solid var(--trait); }
  .chiffres { grid-template-columns: 1fr 1fr; }
  .chiffres > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .accueil { grid-template-columns: 1fr; }
  .accueil__visuel { min-height: 62vh; }
  .donnees { grid-template-columns: 1fr; }
  .donnees div { border-right: 0; border-bottom: 1px solid var(--trait); }
}
@media (max-width: 600px) {
  .filtres { grid-template-columns: 1fr; }
  .frise { left: 8px; right: 8px; bottom: 8px; padding: 10px 12px; gap: .6rem; }
  .frise__lecture { width: 42px; height: 42px; }
  .frise__aide, .frise__legende { display: none; }
  .frise__axe span:nth-child(odd) { visibility: hidden; }
  .details { grid-template-columns: 1fr; gap: .1rem; }
  .details dd { margin-bottom: .6rem; }
  .table-fc .masque-mobile { display: none; }
  .calques { left: 8px; top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Ajustements après relecture visuelle */
.phrase-filtre select, .phrase-filtre input { field-sizing: content; }
.phrase-filtre input[type="date"] { font-size: .85em; }
.bloc--graphe { display: flex; flex-direction: column; }
.bloc--graphe .graphe { flex: 1; min-height: 300px; position: relative; }
[tabindex="-1"]:focus { outline: none; }
.etape legend { font-family: var(--f-titre); font-weight: 700; letter-spacing: -.02em; margin-bottom: .4rem; }
.frise > div { min-width: 0; }
.frise__haut { flex-wrap: wrap; }
@media (max-width: 600px) {
  .frise__periode { font-size: 1rem; }
  .frise__barres { height: 44px; gap: 2px; }
  .frise__axe { gap: 2px; font-size: .62rem; }
  .calques button { padding: .4rem .65rem; font-size: .82rem; }
  .ruban { font-size: .72rem; }
}
