/* Agricorn V2 — composants du design system. Ne contient AUCUNE valeur : uniquement des var() de tokens.css.
   Chaque composant porte ses variantes et ses états ; les écrans ne font que les assembler. */

/* ========== Base ========== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: var(--g-normal) var(--t-base) / var(--interligne) var(--police); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
::selection { background: color-mix(in srgb, var(--selection) 55%, transparent); color: var(--texte); }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
.titre-1, h1 { font-size: var(--t-4xl); line-height: var(--interligne-serre); font-weight: var(--g-titre); letter-spacing: var(--approche-titre); font-stretch: var(--chasse-titre); }
.titre-2, h2 { font-size: var(--t-l); line-height: var(--interligne-moyen); font-weight: var(--g-demi); letter-spacing: var(--approche-chiffre); }
.titre-3, h3 { font-size: var(--t-s); font-weight: var(--g-demi); color: var(--texte-2); }
.texte-s { font-size: var(--t-s); } .texte-2 { color: var(--texte-2); } .texte-3 { color: var(--texte-3); }
.chiffre { font-size: var(--t-4xl); font-weight: var(--g-fort); letter-spacing: var(--approche-chiffre); line-height: var(--interligne-serre); font-stretch: var(--chasse-titre); }
a { color: inherit; text-decoration: none; }
.lien { color: var(--primaire); font-weight: var(--g-demi); }
.lien:hover { text-decoration: underline; text-underline-offset: var(--e-1); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: var(--b-focus) solid var(--primaire); outline-offset: var(--e-1); border-radius: var(--r-xs); }
input, textarea { caret-color: var(--primaire); }
* { scrollbar-width: thin; scrollbar-color: var(--trait-fort) transparent; }
.ic { width: var(--ic); height: var(--ic); fill: none; stroke: currentColor; stroke-width: var(--trait-ic); stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-s { width: var(--ic-s); height: var(--ic-s); } .ic-xs { width: var(--ic-xs); height: var(--ic-xs); } .ic-l { width: var(--ic-l); height: var(--ic-l); }
.carre { display: inline-block; width: var(--pastille-carre); height: var(--pastille-carre); border-radius: var(--r-xs); margin-right: var(--e-2); flex: none; background: var(--c, var(--c-autre)); }
.masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pile { display: grid; gap: var(--e-4); } .pile-s { display: grid; gap: var(--e-2); } .pile-l { display: grid; gap: var(--e-6); }
.ligne { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-3); }
.entre { display: flex; align-items: center; justify-content: space-between; gap: var(--e-3); }

/* ========== Matière : trois matières, chacune à sa place (à valider) ==========
   .liquide : couche de navigation et de commandes (rail, capsule, barre du haut, outils de carte, fenêtres) :
              épaisseur, éclat qui suit le pointeur, arête éclairée ; .refracte y ajoute la réfraction des bords.
   .depoli  : panneaux qui flottent au-dessus du contenu ou de la carte (panneau latéral, fiche et liste sur la carte, légendes).
   .solide  : contenu (tableaux, chiffres, graphiques, listes, formulaires) : surface opaque, jamais floutée.
   Une seule règle pose backdrop-filter par matière : aucun composant ne la redéfinit. */
.solide { position: relative; background: var(--surface); box-shadow: var(--matiere-solide); }
.depoli { position: relative; background: var(--verre-fort); -webkit-backdrop-filter: var(--flou); backdrop-filter: var(--flou); box-shadow: var(--matiere); }
.liquide { position: relative; background-color: var(--verre-liquide); background-image: radial-gradient(circle var(--eclat-portee) at var(--px) var(--py), var(--eclat), transparent); background-attachment: fixed; box-shadow: var(--matiere-liquide); -webkit-backdrop-filter: var(--flou-liquide); backdrop-filter: var(--flou-liquide); }
/* Réfraction avec dispersion (filtre SVG #liquide) : Chromium seulement, petites surfaces seulement (coût de calcul).
   La classe .refraction est posée sur <html> par js/app.js quand le navigateur sait l'appliquer ; sinon le verre reste dépoli. */
.refraction .refracte { backdrop-filter: url(#liquide) var(--flou-liquide); }
/* Arête spéculaire : la lumière qui fait « verre », visible partout, iPhone compris. */
.arete::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: var(--specular);
  -webkit-mask: linear-gradient(var(--neutre-900) 0 0) content-box, linear-gradient(var(--neutre-900) 0 0); -webkit-mask-composite: xor; mask: linear-gradient(var(--neutre-900) 0 0) content-box exclude, linear-gradient(var(--neutre-900) 0 0); }
.solide.arete::after { display: none; }

/* ========== Boutons ========== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--e-2); min-height: var(--cible); height: var(--h-ctrl); min-width: var(--cible); padding: 0 var(--e-4); border-radius: var(--r-rond); border: var(--b-fin) solid transparent; background: none; font-weight: var(--g-demi); font-size: var(--t-m); white-space: nowrap; transition: background var(--d-moyen) var(--ease), box-shadow var(--d-moyen), transform var(--d-lent) var(--ressort); }
.btn:active:not([disabled]) { transform: scale(var(--pression)); }
.btn-primaire { color: var(--primaire-texte); background: linear-gradient(180deg, color-mix(in srgb, var(--primaire) 88%, var(--neutre-0)), var(--primaire)); box-shadow: var(--brillance-bouton), var(--ombre-bouton); }
.btn-primaire:hover:not([disabled]) { background: linear-gradient(180deg, color-mix(in srgb, var(--primaire-survol) 88%, var(--neutre-0)), var(--primaire-survol)); }
.btn-secondaire { background: var(--verre-fort); box-shadow: inset 0 1px 0 var(--reflet), inset 0 0 0 var(--b-fin) color-mix(in srgb, var(--trait-fort) 55%, transparent), var(--ombre-douce); }
.btn-secondaire:hover:not([disabled]) { background: var(--surface); }
.btn-discret { color: var(--primaire); padding: 0 var(--e-3); }
.btn-discret:hover:not([disabled]) { background: var(--primaire-voile); }
.btn-danger { color: var(--alerte); background: var(--verre-fort); box-shadow: inset 0 0 0 var(--b-fin) color-mix(in srgb, var(--alerte) 45%, transparent); }
.btn-danger-plein { color: var(--neutre-0); background: var(--rouge-700); }
.btn-icone { width: var(--h-ctrl); padding: 0; color: var(--texte-2); background: var(--surface-2); box-shadow: inset 0 0 0 var(--b-fin) var(--trait); }
.btn-icone:hover:not([disabled]) { color: var(--texte); background: var(--surface-3); }
.btn-icone.liquide { color: var(--texte); }
.btn-icone.liquide:hover:not([disabled]) { background-color: var(--verre-fort); }
.btn-s { height: var(--h-ctrl-s); font-size: var(--t-s); padding: 0 var(--e-3); }
.btn-l { height: var(--h-grand); font-size: var(--t-base); padding: 0 var(--e-6); }
.btn-bloc { width: 100%; }
.btn[disabled], .btn[aria-disabled=true] { opacity: var(--opacite-desactive); cursor: not-allowed; }
.btn[aria-busy=true] { color: transparent; position: relative; pointer-events: none; }
.btn[aria-busy=true]::after { content: ""; position: absolute; width: var(--ic-s); height: var(--ic-s); border-radius: var(--r-rond); border: var(--b-focus) solid var(--primaire-texte); border-right-color: transparent; animation: tourner var(--d-carte) linear infinite; }
.btn-secondaire[aria-busy=true]::after { border-color: var(--texte); border-right-color: transparent; }
.groupe-btn { display: flex; flex-wrap: wrap; gap: var(--e-3); }

/* ========== Pastilles, étiquettes, avatars ========== */
.pastille { display: inline-flex; align-items: center; gap: var(--e-1); height: var(--h-pastille); padding: 0 var(--e-3) 0 var(--e-2); border-radius: var(--r-rond); font-size: var(--t-xs); font-weight: var(--g-demi); white-space: nowrap; color: var(--texte-2); background: var(--surface-2); }
.p-ok { color: var(--ok); background: var(--ok-fond); } .p-attente { color: var(--attente); background: var(--attente-fond); } .p-alerte { color: var(--alerte); background: var(--alerte-fond); }
.p-neutre { color: var(--texte-2); background: var(--surface-2); }
.compteur { display: inline-grid; place-items: center; min-width: var(--e-5); height: var(--e-5); padding: 0 var(--e-1); border-radius: var(--r-rond); background: var(--surface-2); font-size: var(--t-micro); font-weight: var(--g-demi); }
.compteur-alerte { background: var(--alerte); color: var(--neutre-0); }
.avatar { display: inline-grid; place-items: center; width: var(--e-8); height: var(--e-8); border-radius: var(--r-rond); background: var(--primaire-doux); color: var(--primaire); font-weight: var(--g-titre); font-size: var(--t-xs); flex: none; }
.puce-etat { width: var(--ic-l); height: var(--ic-l); display: grid; place-items: center; border-radius: var(--r-s); flex: none; }
.e-alerte { color: var(--alerte); background: var(--alerte-fond); } .e-attente { color: var(--attente); background: var(--attente-fond); }
.e-ok { color: var(--ok); background: var(--ok-fond); } .e-neutre { color: var(--texte-2); background: var(--surface-2); }

/* ========== Formulaires ========== */
.formulaire { display: grid; gap: var(--e-4); }
.champ { display: grid; gap: var(--e-2); min-width: 0; margin: 0; padding: 0; border: 0; align-content: start; }
.champ > label, .champ > legend, .etiquette { font-size: var(--t-m); font-weight: var(--g-demi); padding: 0; }
.champ > legend { margin-bottom: var(--e-2); }
.facultatif { font-weight: var(--g-normal); color: var(--texte-2); }
.saisie { width: 100%; height: var(--h-champ); padding: 0 var(--e-4); border: var(--b-champ) solid var(--trait-fort); border-radius: var(--r-m); background: var(--surface); font-size: var(--t-l); transition: border-color var(--d-rapide), box-shadow var(--d-rapide); }
textarea.saisie { height: auto; min-height: calc(var(--h-champ) * 1.6); padding: var(--e-3) var(--e-4); resize: vertical; }
select.saisie { appearance: none; padding-right: var(--e-9); background-image: linear-gradient(45deg, transparent 50%, var(--texte-2) 50%), linear-gradient(135deg, var(--texte-2) 50%, transparent 50%); background-position: calc(100% - var(--e-6)) 50%, calc(100% - var(--e-5)) 50%; background-size: var(--e-1) var(--e-1); background-repeat: no-repeat; }
/* Champ compact posé dans une ligne de tableau : hauteur de cible tactile, texte de tableau. */
.saisie-s { width: auto; min-width: calc(var(--e-9) * 3); height: var(--cible); font-size: var(--t-m); border-radius: var(--r-s); }
.saisie:hover { border-color: var(--texte-3); }
.saisie:focus { outline: none; border-color: var(--primaire); box-shadow: var(--halo); }
.saisie::placeholder { color: var(--texte-3); }
.saisie:disabled { background: var(--surface-2); color: var(--texte-2); cursor: not-allowed; }
.unite { position: relative; }
.unite .saisie { padding-right: var(--e-10); font-weight: var(--g-demi); font-size: var(--t-xl); }
.unite > span { position: absolute; right: var(--e-4); top: 50%; transform: translateY(-50%); color: var(--texte-2); font-weight: var(--g-moyen); pointer-events: none; }
.aide { font-size: var(--t-s); color: var(--texte-2); }
.invalide .saisie { border-color: var(--alerte); }
.invalide .saisie:focus { box-shadow: var(--halo-alerte); border-color: var(--alerte); }
.invalide .saisie { animation: secouer var(--d-entree) var(--ease) 1; }
.erreur { display: flex; gap: var(--e-2); align-items: flex-start; font-size: var(--t-s); font-weight: var(--g-moyen); color: var(--alerte); }
.estime { font-style: normal; color: var(--attente); font-weight: var(--g-demi); }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--e-4); }
.grille-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--e-4); }
.recherche { display: flex; align-items: center; gap: var(--e-3); height: var(--h-ctrl); min-height: var(--cible); padding: 0 var(--e-4); border-radius: var(--r-rond); background: var(--surface-2); color: var(--texte-2); box-shadow: inset 0 0 0 var(--b-fin) var(--trait); }
.recherche.liquide { background-color: var(--verre-liquide); }
.recherche:focus-within { box-shadow: inset 0 0 0 var(--b-champ) var(--primaire), var(--halo); }
.recherche input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: var(--t-m); color: var(--texte); }
.recherche input::placeholder { color: var(--texte-2); }
kbd { font: var(--g-moyen) var(--t-micro) var(--police); padding: 0 var(--e-2); border-radius: var(--r-xs); background: var(--verre-creux); color: var(--texte-2); }
/* Choix en cases (radio visibles) et choix de type. */
.cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(calc(var(--e-10) * 2), 1fr)); gap: var(--e-3); }
.cases button, .case { display: grid; justify-items: start; align-content: center; gap: 1px; min-height: var(--h-grand); padding: var(--e-2) var(--e-4); border-radius: var(--r-m); border: var(--b-champ) solid var(--trait); background: var(--surface); text-align: left; transition: border-color var(--d-moyen), background var(--d-moyen), transform var(--d-lent) var(--ressort); }
.cases button:active { transform: scale(var(--pression)); }
.cases b { font-size: var(--t-l); } .cases span { font-size: var(--t-xs); color: var(--texte-2); }
.cases [aria-checked=true] { border-color: var(--primaire); background: var(--primaire-doux); }
.cases [aria-checked=true] .ic { color: var(--primaire); }
/* Case à cocher et interrupteur. */
.coche { display: inline-flex; align-items: center; gap: var(--e-3); min-height: var(--cible); font-size: var(--t-m); cursor: pointer; }
.coche input { appearance: none; width: var(--e-5); height: var(--e-5); margin: 0; border: var(--b-champ) solid var(--trait-fort); border-radius: var(--r-xs); background: var(--surface); display: grid; place-items: center; transition: background var(--d-rapide), border-color var(--d-rapide); }
.coche input:checked { background: var(--primaire); border-color: var(--primaire); }
.coche input:checked::after { content: ""; width: var(--e-2); height: var(--e-3); border: solid var(--primaire-texte); border-width: 0 var(--b-focus) var(--b-focus) 0; transform: translateY(-1px) rotate(45deg); }
.coche input[type=radio] { border-radius: var(--r-rond); }
.coche input[type=radio]:checked::after { width: var(--e-2); height: var(--e-2); border: 0; border-radius: var(--r-rond); background: var(--primaire-texte); transform: none; }
.interrupteur { appearance: none; position: relative; width: calc(var(--e-9) - var(--e-1)); height: var(--e-6); margin: 0; border-radius: var(--r-rond); background: var(--trait-fort); transition: background var(--d-moyen); cursor: pointer; flex: none; }
.interrupteur::after { content: ""; position: absolute; top: var(--e-1) ; left: var(--e-1); width: var(--e-4); height: var(--e-4); border-radius: var(--r-rond); background: var(--neutre-0); box-shadow: var(--ombre-1); transition: transform var(--d-lent) var(--ressort); }
.interrupteur:checked { background: var(--primaire); }
.interrupteur:checked::after { transform: translateX(var(--e-5)); }
/* Choix d'une parcelle par la position. */
.choix-parcelle { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: var(--e-3); min-height: calc(var(--h-grand) + var(--e-3)); padding: var(--e-2) var(--e-4) var(--e-2) var(--e-3); border: var(--b-champ) solid var(--trait-fort); border-radius: var(--r-m); background: var(--surface); text-align: left; }
.choix-parcelle > span:nth-child(2) { display: grid; line-height: var(--interligne-moyen); }
.choix-parcelle b { font-size: var(--t-l); } .choix-parcelle span span { font-size: var(--t-s); color: var(--texte-2); }
.gps { display: inline-flex; align-items: center; gap: var(--e-1); height: var(--h-pastille); padding: 0 var(--e-3); border-radius: var(--r-rond); background: var(--ok-fond); color: var(--ok); font-size: var(--t-micro); font-weight: var(--g-demi); }
.resume-saisie { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: var(--e-3) var(--e-5); border-radius: var(--r-m); background: var(--verre-creux); }
.resume-saisie b { grid-column: 2; grid-row: 1 / span 2; font-size: var(--t-2xl); }
.pied-formulaire { display: flex; justify-content: flex-end; gap: var(--e-3); padding-top: var(--e-1); }
.pied-formulaire .btn { height: var(--h-grand); }
.photos { display: flex; gap: var(--e-2); flex-wrap: wrap; }
.photo { width: calc(var(--e-10) + var(--e-4)); aspect-ratio: 1; border-radius: var(--r-s); background: var(--surface-3) center / cover; display: grid; place-items: center; color: var(--texte-2); border: var(--b-champ) dashed var(--trait-fort); }
.photo[style] { border: 0; }

/* ========== Panneaux, listes, indicateurs ========== */
.panneau { border-radius: var(--r-l); padding: var(--e-5) var(--e-6); background: var(--surface); box-shadow: var(--matiere-solide); min-width: 0; }
.panneau > h2, .panneau-tete { margin-bottom: var(--e-4); }
.panneau-tete { display: flex; align-items: center; justify-content: space-between; gap: var(--e-3); }
.panneau-tete h2 { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--matiere-solide); }
.kpi { display: grid; gap: 1px; padding: var(--e-4) var(--e-5); align-content: start; }
.kpi + .kpi { border-left: var(--b-fin) solid var(--arete); }
.kpi > span { font-size: var(--t-s); color: var(--texte-2); }
.kpi > b { font-size: var(--t-4xl); font-weight: var(--g-fort); letter-spacing: var(--approche-chiffre); line-height: var(--interligne-serre); font-stretch: var(--chasse-titre); }
.kpi small { font-size: var(--t-base); color: var(--texte-2); font-weight: var(--g-moyen); letter-spacing: 0; }
.kpi em { font-style: normal; font-size: var(--t-xs); color: var(--texte-3); }
.kpi .estime { font-size: var(--t-xs); }
.taches { list-style: none; margin: 0; padding: 0; }
.taches li { display: grid; grid-template-columns: auto 1fr auto; gap: var(--e-3); align-items: center; padding: var(--e-3) 0; border-top: var(--b-fin) solid color-mix(in srgb, var(--trait) 70%, transparent); }
.taches li:first-child { border-top: 0; padding-top: 0; }
.taches b { display: block; font-weight: var(--g-demi); font-size: var(--t-m); line-height: var(--interligne-moyen); }
.taches span:not(.puce-etat):not(.pastille) { display: block; font-size: var(--t-s); color: var(--texte-2); }
.menu-liste { list-style: none; margin: 0; padding: 0; border-radius: var(--r-l); overflow: hidden; background: var(--surface); box-shadow: var(--matiere-solide); }
.menu-liste a, .menu-liste button { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--e-4); width: 100%; min-height: var(--h-grand); padding: 0 var(--e-5); border: 0; border-top: var(--b-fin) solid color-mix(in srgb, var(--trait) 70%, transparent); background: none; text-align: left; font-weight: var(--g-moyen); }
.menu-liste li:first-child > * { border-top: 0; }
.menu-liste a:hover { background: var(--verre-creux); }
.menu-liste small { display: block; font-size: var(--t-xs); color: var(--texte-2); font-weight: var(--g-normal); }
.faits { display: grid; grid-template-columns: 1fr 1fr; gap: var(--e-3) var(--e-4); margin: 0; }
.faits dt { font-size: var(--t-xs); color: var(--texte-2); }
.faits dd { margin: 1px 0 0; font-weight: var(--g-demi); }
.faits dd a, .jauge-tete a { display: inline-flex; align-items: center; min-height: var(--cible); min-width: var(--cible); }
.bloc-info { display: flex; gap: var(--e-3); padding: var(--e-3) var(--e-4); border-radius: var(--r-m); background: var(--attente-fond); color: var(--attente); }
.bloc-info.alerte { background: var(--alerte-fond); color: var(--alerte); }
.bloc-info.ok { background: var(--ok-fond); color: var(--ok); }
.bloc-info b { display: block; font-size: var(--t-m); }
.bloc-info span { display: block; font-size: var(--t-s); color: var(--texte); }
/* Jauge horizontale, silo, barres. */
.jauge { height: var(--jauge-h); border-radius: var(--r-rond); background: var(--verre-creux); overflow: hidden; box-shadow: var(--ombre-creuse); }
.jauge > i { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--primaire)); transform-origin: left; animation: pousser var(--d-remplir) var(--ease) both; }
.jauge-ligne + .jauge-ligne { margin-top: var(--e-4); }
.jauge-tete { display: flex; justify-content: space-between; align-items: center; font-size: var(--t-s); margin-bottom: var(--e-2); color: var(--texte-2); }
.jauge-tete > span:first-child { display: inline-flex; align-items: center; color: var(--texte); font-weight: var(--g-moyen); }
.jauge-tete b { color: var(--texte); }
.silo { position: relative; width: var(--silo-l); height: var(--silo-h); border-radius: var(--r-m) var(--r-m) var(--r-xs) var(--r-xs); background: var(--verre-creux); overflow: hidden; flex: none; box-shadow: var(--ombre-silo); }
.silo > i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--c, var(--c-mais)); background-image: var(--grain); background-size: var(--e-1) var(--e-1); transform-origin: bottom; animation: remplir var(--d-remplir) var(--ease) both; }
.silo::after { content: ""; position: absolute; top: var(--e-2); bottom: var(--e-2); left: var(--e-1); width: var(--e-1); border-radius: var(--r-xs); background: linear-gradient(var(--blanc-a72), var(--blanc-a12)); }
.silo.plein > i { background-color: var(--alerte); }
.barres { display: flex; align-items: flex-end; gap: var(--e-2); height: calc(var(--e-10) * 2.2); padding-top: var(--e-4); }
.barres > div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: var(--e-1); height: 100%; min-width: 0; font-size: var(--t-micro); color: var(--texte-2); text-align: center; }
.barres i { display: block; width: 100%; max-width: var(--e-8); border-radius: var(--r-xs) var(--r-xs) 0 0; background: var(--c, var(--primaire)); transform-origin: bottom; animation: remplir var(--d-remplir) var(--ease) both; }
.barres b { color: var(--texte); font-size: var(--t-xs); }
.courbe { margin: 0; padding: var(--e-3) var(--e-4) var(--e-2); border-radius: var(--r-m); background: var(--verre-creux); }
.courbe figcaption { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--t-s); color: var(--texte-2); }
.courbe figcaption b { font-size: var(--t-xl); color: var(--texte); letter-spacing: var(--approche-chiffre); }
.courbe svg { width: 100%; height: auto; display: block; margin-top: var(--e-2); overflow: visible; }
.c-aire { fill: var(--primaire-voile); animation: apparaitre var(--d-lent) var(--ease) both; }
.c-ligne { fill: none; stroke: var(--primaire); stroke-width: var(--b-focus); stroke-linejoin: round; stroke-dasharray: 600; animation: tracer var(--d-remplir) var(--ease) both; }
.c-point { fill: var(--surface); stroke: var(--primaire); stroke-width: var(--b-focus); }
.c-repere { stroke: var(--trait); stroke-dasharray: 2 4; }
.c-texte { fill: var(--texte-2); font-size: var(--t-micro); }

/* ========== Tableaux ========== */
.table-outils { display: flex; justify-content: space-between; align-items: center; gap: var(--e-3); flex-wrap: wrap; margin-bottom: var(--e-3); }
.filtres { display: flex; gap: var(--e-2); flex-wrap: wrap; }
.puce-filtre { display: inline-flex; align-items: center; gap: var(--e-2); min-height: var(--cible); height: var(--h-ctrl-s); padding: 0 var(--e-4); border-radius: var(--r-rond); border: 0; background: var(--surface-2); font-size: var(--t-s); font-weight: var(--g-moyen); white-space: nowrap; box-shadow: inset 0 1px 0 var(--reflet), inset 0 0 0 var(--b-fin) color-mix(in srgb, var(--trait-fort) 45%, transparent); }
.puce-filtre .carre { margin: 0; }
.puce-filtre[aria-pressed=true] { background: var(--texte); color: var(--fond); box-shadow: none; }
.table-cadre { border-radius: var(--r-l); overflow: auto; background: var(--surface); box-shadow: var(--matiere-solide); }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-m); }
.table th, .table td { padding: var(--e-3) var(--e-4); text-align: left; white-space: nowrap; }
.table thead th { height: var(--h-ctrl); font-size: var(--t-xs); font-weight: var(--g-demi); color: var(--texte-2); border-bottom: var(--b-fin) solid var(--trait); }
.table th button { display: inline-flex; align-items: center; gap: var(--e-1); padding: 0; border: 0; background: none; font: inherit; color: inherit; }
.table th[aria-sort] button { color: var(--texte); }
.table th[aria-sort=descending] .ic { transform: rotate(180deg); }
.table tbody tr { border-bottom: var(--b-fin) solid color-mix(in srgb, var(--trait) 70%, transparent); transition: background var(--d-instant); }
.table tbody tr:hover { background: var(--verre-creux); }
.table tbody tr[aria-selected=true] { background: var(--primaire-voile); }
.table td b { font-weight: var(--g-demi); }
.table .n { text-align: right; }
.table .col-coche { width: var(--e-9); }
.table tfoot td { height: var(--h-champ); font-weight: var(--g-demi); background: var(--verre-creux); }
.sous { display: flex; align-items: center; font-size: var(--t-xs); color: var(--texte-2); }
.chaud { color: var(--alerte); font-weight: var(--g-moyen); }
[hidden] { display: none !important; } /* l’attribut hidden gagne toujours (barre de sélection, pages du tableau) */
.selection-barre { display: flex; align-items: center; gap: var(--e-3); padding: var(--e-2) var(--e-2) var(--e-2) var(--e-4); border-radius: var(--r-rond); background: var(--texte); color: var(--fond); }
.selection-barre .btn { color: var(--fond); }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: var(--e-3); padding: var(--e-3) var(--e-4); font-size: var(--t-s); color: var(--texte-2); }
.table-mobile { display: none; list-style: none; margin: 0; padding: 0; gap: var(--e-2); }
.table-mobile li > a, .table-mobile li > div { display: flex; justify-content: space-between; gap: var(--e-3); padding: var(--e-3) var(--e-4); border-radius: var(--r-m); background: var(--surface); box-shadow: var(--matiere); }
.table-mobile .gauche, .table-mobile .droite { display: grid; gap: var(--e-1); align-content: start; }
.table-mobile .droite { justify-items: end; }
.table-mobile b { font-size: var(--t-base); }
.table-mobile span:not(.pastille) { font-size: var(--t-s); color: var(--texte-2); }

/* ========== Navigation ========== */
.onglets { display: flex; gap: var(--e-1); border-bottom: var(--b-fin) solid var(--trait); overflow-x: auto; scrollbar-width: none; }
.onglets a, .onglets button { position: relative; display: inline-flex; align-items: center; gap: var(--e-1); min-height: var(--cible); height: var(--h-ctrl); padding: 0 var(--e-3); border: 0; background: none; font-size: var(--t-m); font-weight: var(--g-moyen); color: var(--texte-2); white-space: nowrap; }
.onglets [aria-selected=true], .onglets [aria-current] { color: var(--texte); }
.onglets [aria-selected=true]::after, .onglets [aria-current]::after { content: ""; position: absolute; left: var(--e-2); right: var(--e-2); bottom: calc(var(--b-fin) * -1); height: var(--b-onglet); border-radius: var(--r-xs); background: var(--primaire); }
.segmente { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: var(--e-1); border-radius: var(--r-rond); background: var(--verre-creux); }
.segmente a, .segmente button { display: grid; place-items: center; min-height: var(--cible); height: var(--h-ctrl-s); padding: 0 var(--e-4); border: 0; border-radius: var(--r-rond); background: none; font-weight: var(--g-moyen); font-size: var(--t-s); color: var(--texte-2); white-space: nowrap; transition: background var(--d-moyen), color var(--d-rapide); }
.segmente [aria-checked=true], .segmente [aria-current] { background: var(--surface); color: var(--texte); box-shadow: inset 0 1px 0 var(--reflet), var(--ombre-douce); }
.fil { display: flex; align-items: center; gap: var(--e-1); font-size: var(--t-s); color: var(--texte); margin-bottom: var(--e-2); }
.fil a { display: inline-flex; align-items: center; justify-content: center; min-height: var(--cible); min-width: var(--cible); }
.fil a:hover { color: var(--texte); }
.retour { display: inline-flex; align-items: center; gap: var(--e-1); min-height: var(--cible); color: var(--texte-2); font-weight: var(--g-moyen); }

/* ========== Superposés : feuille, modale, toast ========== */
.voile-modale { position: fixed; inset: 0; z-index: var(--z-modale); display: grid; place-items: center; padding: var(--e-4); background: color-mix(in srgb, var(--neutre-900) 40%, transparent); animation: apparaitre var(--d-moyen) var(--ease); }
.modale { position: relative; width: min(100%, calc(var(--lecture-max) * .7)); border-radius: var(--r-xl); padding: var(--e-6); background-color: var(--verre-fort); box-shadow: var(--ombre-flottant); animation: monter var(--d-lent) var(--ressort); }
.modale h2 { font-size: var(--t-xl); margin-bottom: var(--e-2); }
.modale .groupe-btn { justify-content: flex-end; margin-top: var(--e-6); }
.toast { position: fixed; z-index: var(--z-toast); left: 50%; bottom: var(--e-8); transform: translate(-50%, var(--e-4)); opacity: 0; display: flex; align-items: center; gap: var(--e-2); padding: var(--e-3) var(--e-5); border-radius: var(--r-rond); background: color-mix(in srgb, var(--texte) 88%, transparent); color: var(--fond); font-weight: var(--g-moyen); box-shadow: var(--ombre-flottant); transition: opacity var(--d-moyen), transform var(--d-moyen) var(--ease); pointer-events: none; -webkit-backdrop-filter: var(--flou); backdrop-filter: var(--flou); }
.toast.vu { opacity: 1; transform: translate(-50%, 0); }

/* ========== États ========== */
.vide { display: grid; justify-items: start; gap: var(--e-2); padding: var(--e-7); border-radius: var(--r-l); border: var(--b-champ) dashed var(--trait-fort); color: var(--texte-2); background: var(--verre-creux); }
.vide b { color: var(--texte); font-size: var(--t-l); }
.vide .btn { margin-top: var(--e-2); }
.erreur-bloc { border-color: color-mix(in srgb, var(--alerte) 50%, transparent); }
.erreur-bloc b { color: var(--alerte); }
.squelette { display: block; height: var(--e-4); border-radius: var(--r-xs); background: linear-gradient(90deg, var(--surface-2) 25%, var(--verre-fort) 50%, var(--surface-2) 75%); background-size: 300% 100%; animation: luire var(--d-remplir) linear infinite; }
.squelette.grand { height: var(--e-8); width: 40%; }
.bandeau-etat { display: flex; align-items: center; gap: var(--e-3); padding: var(--e-2) var(--e-4); border-radius: var(--r-rond); font-size: var(--t-s); font-weight: var(--g-moyen); background: var(--attente-fond); color: var(--attente); }
.bandeau-etat.hors { background: var(--texte); color: var(--fond); }
.synchro { min-height: var(--cible);  display: inline-flex; align-items: center; gap: var(--e-2); height: var(--h-ctrl-s); padding: 0 var(--e-3); border-radius: var(--r-rond); background: color-mix(in srgb, var(--attente-fond) 78%, transparent); color: var(--attente); font-size: var(--t-s); font-weight: var(--g-demi); box-shadow: inset 0 1px 0 var(--reflet), inset 0 0 0 var(--b-fin) var(--arete); }

/* ========== Cartographie ========== */
.legende { display: flex; align-items: center; gap: var(--e-3); padding: var(--e-2) var(--e-3); border-radius: var(--r-m); font-size: var(--t-xs); color: var(--texte); }
.degrade { display: flex; width: calc(var(--e-10) * 2.3); height: var(--e-2); border-radius: var(--r-rond); overflow: hidden; }
.degrade i { flex: 1; }
.degrade i:nth-child(1) { background: var(--ndvi-1); } .degrade i:nth-child(2) { background: var(--ndvi-2); } .degrade i:nth-child(3) { background: var(--ndvi-3); }
.degrade i:nth-child(4) { background: var(--ndvi-4); } .degrade i:nth-child(5) { background: var(--ndvi-5); } .degrade i:nth-child(6) { background: var(--ndvi-6); }
.vignette { width: var(--vignette); height: var(--vignette); border-radius: var(--r-s); background: color-mix(in srgb, var(--c) 30%, var(--surface)); border: var(--b-focus) solid var(--c); box-shadow: inset 0 1px 0 var(--blanc-a40); flex: none; }
[data-theme=sombre] .vignette { background: color-mix(in srgb, var(--c) 55%, var(--surface)); }
.ndvi-valeur { display: inline-flex; align-items: center; gap: var(--e-2); font-size: var(--t-s); font-weight: var(--g-moyen); }
.ndvi-valeur i { width: var(--e-3); height: var(--e-3); border-radius: var(--r-xs); background: var(--c); }
.outils-carte { display: grid; overflow: hidden; border-radius: var(--r-l); }
.outils-carte .btn-icone { border-radius: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--texte); }
.outils-carte .btn-icone + .btn-icone { border-top: var(--b-fin) solid var(--arete); }
.marqueur { display: grid; place-items: center; width: var(--e-8); height: var(--e-8); border-radius: var(--r-rond) var(--r-rond) var(--r-rond) 0; transform: rotate(-45deg); background: var(--primaire); color: var(--primaire-texte); box-shadow: var(--ombre-flottant); }
.marqueur .ic { transform: rotate(45deg); }
.marqueur.alerte { background: var(--alerte); }
.frise { display: flex; align-items: center; gap: var(--e-1); padding: var(--e-1) var(--e-2); border-radius: var(--r-rond); }
.frise ol { list-style: none; margin: 0; padding: 0 var(--e-1); display: flex; gap: 1px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; -webkit-mask-image: linear-gradient(90deg, transparent, var(--neutre-900) var(--e-6), var(--neutre-900) calc(100% - var(--e-6)), transparent); mask-image: linear-gradient(90deg, transparent, var(--neutre-900) var(--e-6), var(--neutre-900) calc(100% - var(--e-6)), transparent); }
.frise li { scroll-snap-align: center; }
.frise [data-date] { min-height: var(--cible); height: var(--h-ctrl-s); padding: 0 var(--e-3); border: 0; border-radius: var(--r-rond); background: none; font-size: var(--t-s); font-weight: var(--g-demi); color: var(--texte); white-space: nowrap; transition: background var(--d-moyen), color var(--d-rapide); }
.frise [data-date]:hover { background: var(--verre-creux); }
.frise [data-date][aria-pressed=true] { background: var(--texte); color: var(--fond); box-shadow: var(--ombre-douce); }
.frise .btn-icone { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* ========== Animations ========== */
@keyframes remplir { from { transform: scaleY(0); } }
@keyframes pousser { from { transform: scaleX(0); } }
@keyframes tracer { from { stroke-dashoffset: 600; } to { stroke-dashoffset: 0; } }
@keyframes apparaitre { from { opacity: 0; } }
@keyframes glisser { from { opacity: 0; transform: translateX(var(--e-7)) scale(.98); } }
@keyframes monter { from { opacity: 0; transform: translateY(var(--e-8)); } }
@keyframes secouer { 25% { transform: translateX(calc(var(--e-1) * -1)); } 50% { transform: translateX(var(--e-1)); } 75% { transform: translateX(calc(var(--e-1) * -.5)); } }
@keyframes tourner { to { transform: rotate(360deg); } }
@keyframes luire { from { background-position: 100% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; } }

/* ========== Téléphone ========== */
@media (max-width: 760px) {
  .titre-1, h1 { font-size: var(--t-3xl); }
  .panneau { padding: var(--e-4); }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { padding: var(--e-3) var(--e-4); }
  .kpi > b { font-size: var(--t-3xl); }
  .kpi:nth-child(odd) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: var(--b-fin) solid var(--arete); }
  .table { display: none; }
  .table-cadre .pagination { padding-inline: 0; }
  .table-cadre { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; overflow: visible; }
  .table-mobile { display: grid; }
  .table-outils { flex-wrap: nowrap; margin-inline: calc(var(--e-4) * -1); padding-inline: var(--e-4); overflow-x: auto; scrollbar-width: none; }
  .filtres { flex-wrap: nowrap; }
  .grille-2, .grille-3 { grid-template-columns: 1fr; gap: var(--e-3); }
  .grille-2.garder { grid-template-columns: 1fr 1fr; }
  .choix-parcelle { grid-template-columns: auto 1fr auto; row-gap: var(--e-1); }
  .choix-parcelle .gps { grid-column: 2; grid-row: 2; justify-self: start; }
  .choix-parcelle > .ic { grid-column: 3; grid-row: 1; }
  .cases { grid-template-columns: 1fr 1fr; }
  .faits { gap: var(--e-3); }
  .pied-formulaire { position: sticky; bottom: 0; flex-direction: column-reverse; gap: var(--e-2); margin: 0 calc(var(--e-4) * -1) calc(var(--e-4) * -1); padding: var(--e-4) var(--e-4) calc(var(--e-4) + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--surface) var(--e-5)); }
  .pied-formulaire .btn { width: 100%; }
  .modale { align-self: end; border-radius: var(--r-xl) var(--r-xl) 0 0; width: 100%; padding-bottom: calc(var(--e-6) + env(safe-area-inset-bottom)); }
  .voile-modale { padding: 0; }
}
