/* Design de la page principale (index.html). L'originale d'Alexis : index-old.html.
   Seuls l'habillage et la mise en page changent : le script de la page est
   celui d'index-old.html, recopié à l'identique. */

:root {
  /* Charte GreenScore Capital */
  --nuit: #00251E;
  --nuit-2: #0A3A2F;
  --menthe: #39CC93;
  --menthe-pale: #D7F4E7;
  /* Vert anis des feuilles du logo GreenScore Capital : réservé aux touches de marque. */
  --anis: #CCDC7B;
  --anis-pale: #EEF3D2;
  /* Ambiance : pierre calcaire et eau, pour ancrer l'outil dans la vigne provençale */
  --pierre: #ECF0EC;
  --pierre-2: #E1E8E2;
  --papier: #FFFFFF;
  --encre: #12261F;
  --gris: #5A6863;
  --ligne: #D8E0DA;
  --eau: #2F7FA8;

  --titre: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --texte: "Public Sans", "Segoe UI", Roboto, Arial, sans-serif;

  --rayon: 18px;
  --rayon-petit: 10px;
  --ombre: 0 1px 2px rgba(0, 37, 30, .06), 0 10px 30px -12px rgba(0, 37, 30, .22);
  --ombre-verre: 0 8px 28px -10px rgba(0, 37, 30, .35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--texte);
  font-size: 14px;
  color: var(--encre);
  /* Même fond que la page de connexion : le dégradé d'Alexis. */
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(57, 204, 147, .18), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(0, 37, 30, .12), transparent 55%),
    #F8F8F8;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

:focus-visible { outline: 2px solid var(--eau); outline-offset: 2px; }

button {
  font: inherit;
  font-size: 13px;
  padding: 9px 16px;
  border: 1px solid var(--ligne);
  background: var(--papier);
  border-radius: 999px;
  cursor: pointer;
  color: var(--encre);
  transition: background .15s, border-color .15s, color .15s;
}

button:hover { border-color: #b9c6bd; }

button[hidden] { display: none; }

button.accent {
  background: var(--nuit);
  border-color: var(--nuit);
  color: #fff;
  font-weight: 600;
}

button.accent:hover { background: var(--nuit-2); }

button.discret { background: var(--papier); border-color: var(--ligne); color: var(--encre); padding: 7px 14px; font-weight: 500; }

button.discret:hover { background: var(--pierre); border-color: #b9c6bd; }

/* --- Rail : navigation de l'application --------------------------------- */

/* Courbes de niveau en fond : la signature visuelle de l'outil (terrain et eau). */
.rail {
  width: 148px;
  flex: 0 0 148px;
  background-color: var(--nuit);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 800' preserveAspectRatio='xMidYMid slice'%3E%3Cdefs%3E%3Cpath id='b' vector-effect='non-scaling-stroke' d='M0 -12C8 -12 13 -5 12 3C11 11 3 14 -5 12C-12 10 -14 1 -11 -5C-8 -11 -5 -12 0 -12Z'/%3E%3C/defs%3E%3Cg fill='none' stroke='%2339CC93' stroke-opacity='.2' stroke-width='1'%3E%3Cuse href='%23b' transform='translate(18 640) scale(1)'/%3E%3Cuse href='%23b' transform='translate(18 640) rotate(8) scale(1.9)'/%3E%3Cuse href='%23b' transform='translate(18 640) rotate(16) scale(2.9)'/%3E%3Cuse href='%23b' transform='translate(18 640) rotate(22) scale(4)'/%3E%3Cuse href='%23b' transform='translate(18 640) rotate(30) scale(5.2)'/%3E%3Cuse href='%23b' transform='translate(18 640) rotate(36) scale(6.6)'/%3E%3Cuse href='%23b' transform='translate(18 640) rotate(42) scale(8.2)'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0 20px;
  gap: 10px;
}

.rail-logo {
  width: 124px;
  height: auto;
  display: block;
}

.rail .titre-rail { margin-top: 14px; font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, .6); }

/* Choix du niveau, du plus large au plus fin. Les boutons sont générés par le script d'Alexis (classe .niveau). */
.niveaux { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }

.niveau {
  width: 78px;
  padding: 10px 0 8px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: rgba(255, 255, 255, .85);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.niveau svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.6; }

.niveau b { font-weight: 600; }

.niveau:hover { background: rgba(255, 255, 255, .14); color: #fff; border-color: transparent; }

.niveau[aria-current="true"] { background: var(--menthe); color: var(--nuit); }

.niveau[aria-current="true"] b { font-weight: 700; }

/* Sur ordinateur, le conteneur du menu s'efface : ses enfants restent des éléments du rail.
   Le nom, le burger et le compte n'existent que sur mobile. */
.rail-menu { display: contents; }

.rail-nom, .burger, .menu-compte { display: none; }

.rail-aide {
  margin-top: auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--nuit-2);
  border: 1px solid rgba(57, 204, 147, .35);
  color: rgba(255, 255, 255, .85);
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 13px;
}

.rail-aide:hover { background: var(--menthe); color: var(--nuit); }

main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 0 28px 28px;
}

/* --- En-tête : produit et compte ---------------------------------------- */

.entete {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  /* Bande blanche pleine largeur : annule le retrait latéral de main. */
  margin: 0 -28px 18px;
  padding: 14px 28px;
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--papier);
  border-bottom: 1px solid var(--ligne);
  box-shadow: 0 6px 18px -12px rgba(0, 37, 30, .25);
}

.produit span { font-size: 15px; color: var(--gris); }

.compte { justify-self: end; display: flex; align-items: center; gap: 10px; }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--anis-pale);
  color: var(--nuit);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}

.avatar:empty { display: none; }

.qui { line-height: 1.25; }

.qui b { display: block; font-size: 13px; font-weight: 600; }

.qui span { display: block; font-size: 11.5px; color: var(--gris); }

/* --- Titre de la vue ---------------------------------------------------- */

.tete { padding: 18px 0 16px; border-top: 1px solid var(--ligne); }

.tete h1 {
  font-family: var(--titre);
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.15;
  margin: 0 0 6px;
}

.tete p { margin: 0; font-size: 13px; color: var(--gris); line-height: 1.55; max-width: 75ch; }

/* --- Filtres ------------------------------------------------------------ */

.outils {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 0 18px;
}

.champ { display: flex; flex-direction: column; gap: 5px; }

.champ label { font-size: 12px; font-weight: 600; color: var(--gris); padding-left: 14px; }

select {
  font: inherit;
  font-size: 13.5px;
  padding: 9px 36px 9px 14px;
  border: 1px solid var(--ligne);
  border-radius: 999px;
  background: var(--papier) no-repeat right 14px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' fill='none' stroke='%2300251E' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  min-width: 200px;
  color: var(--encre);
  appearance: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 37, 30, .05);
  transition: border-color .15s, box-shadow .15s;
}

select:hover { border-color: #b9c6bd; }

select:focus { outline: 0; border-color: var(--menthe); box-shadow: 0 0 0 3px rgba(57, 204, 147, .22); }

select:disabled { color: #9aa6a0; background-color: var(--pierre-2); cursor: default; box-shadow: none; }

/* Liste ouverte stylée : « select personnalisable » (Chrome et Edge 135+). Ailleurs, la liste native
   s'affiche, sans rien casser. Le script d'Alexis lit value et selectedOptions : inchangés. */
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }

  /* La flèche du bouton reste la nôtre (image de fond). */
  select::picker-icon { display: none; }

  ::picker(select) {
    margin-top: 6px;
    padding: 6px;
    border: 1px solid var(--ligne);
    border-radius: 14px;
    background: var(--papier);
    box-shadow: var(--ombre-verre);
  }

  select option {
    padding: 9px 12px 9px 10px;
    border-radius: 9px;
    font-size: 13.5px;
    color: var(--encre);
    gap: 8px;
  }

  select option:hover, select option:focus-visible { background: var(--pierre); outline: 0; }

  select option:checked { background: var(--menthe-pale); color: var(--nuit); font-weight: 600; }

  select option::checkmark { color: var(--nuit); }
}

.outils .accent { margin-left: 4px; }

/* --- Carte et panneaux flottants --------------------------------------- */

.scene { position: relative; }

.scene.ancienne #map {
  box-shadow: 0 0 0 3px #c62828, var(--ombre);
}

.alerte-ancienne {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 2px solid #c62828;
  border-radius: 12px;
  background: #fff5f5;
  color: #8e1b1b;
  font-size: 13px;
  line-height: 1.45;
}

.alerte-ancienne[hidden] { display: none; }

.alerte-ancienne b {
  flex: 0 0 auto;
  background: #c62828;
  color: #fff;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

select.ancien {
  border-color: #c62828;
  background-color: #fff5f5;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, .22);
}

.restitution-grilles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 8px 0 12px;
}

@media (max-width: 900px) {
  .restitution-grilles { grid-template-columns: 1fr; }
}

.restitution-grilles h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 650;
}

.restitution-grilles .tableau { max-height: none; }

.tableau tr.courante td { background: var(--menthe-pale); font-weight: 600; }

.tableau .manque { color: var(--gris); font-weight: 500; font-size: 11px; }

.synthese { margin-top: 6px; padding-top: 4px; border-top: 1px solid var(--ligne); }

.synthese h3 { margin: 18px 0 8px; font-size: 14px; font-weight: 650; }

.synthese-duo { display: grid; grid-template-columns: 1.15fr .85fr; gap: 22px; align-items: start; }

.synthese-legende {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 11.5px;
  color: #3f4b46;
  margin: 2px 0 10px;
}

.synthese-legende span.courant { font-weight: 700; color: var(--nuit); }

.synthese-legende i {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

@media (max-width: 900px) {
  .synthese-duo { grid-template-columns: 1fr; }
}

#map {
  height: clamp(480px, calc(100vh - 290px), 780px);
  border-radius: var(--rayon);
  overflow: hidden;
  background: #d9e0dc;
  position: relative;
  box-shadow: var(--ombre);
}

#map svg, #map canvas { position: absolute; inset: 0; display: block; }

#map image { pointer-events: none; -webkit-user-drag: none; }

#map canvas { pointer-events: none; }

#map svg { cursor: grab; }

#map svg:active { cursor: grabbing; }

.verre {
  position: absolute;
  z-index: 4;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 14px;
  box-shadow: var(--ombre-verre);
}

.attrib {
  position: absolute;
  right: 12px;
  bottom: 10px;
  background: rgba(255, 255, 255, .78);
  font-size: 10px;
  color: #40464d;
  padding: 2px 8px;
  border-radius: 999px;
  z-index: 3;
}

.charge {
  position: absolute;
  inset: 0;
  background: rgba(236, 240, 236, .7);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--gris);
  z-index: 5;
}

.charge.on { display: flex; }

/* Fond de carte : un réglage de la carte, donc posé sur la carte. */
.calques {
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.calques svg { width: 18px; height: 18px; stroke: var(--nuit); fill: none; stroke-width: 1.7; flex: 0 0 18px; }

.calques select {
  min-width: 0;
  border: 0;
  background-color: transparent;
  box-shadow: none;
  font-size: 12.5px;
  padding: 6px 30px 6px 6px;
  background-position: right 10px center;
}

.lecteur {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.legend {
  top: 14px;
  right: 14px;
  width: 178px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
}

.legend h2 { font-size: 12.5px; margin: 0 0 12px; font-weight: 600; line-height: 1.35; }

.ramp { display: flex; gap: 10px; height: 170px; }

.ramp .bar { width: 12px; border-radius: 999px; }

.ramp .ticks {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 11.5px;
  color: #3f4b46;
  font-variant-numeric: tabular-nums;
}

.legend .foot { font-size: 10.5px; color: var(--gris); margin-top: 12px; line-height: 1.45; }

.ramp[hidden], #classes[hidden] { display: none; }

#classes { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: #3f4b46; }

#classes span { display: flex; align-items: center; gap: 8px; }

#classes i { width: 14px; height: 14px; border-radius: 4px; flex: 0 0 14px; }

/* Chiffres clés en bandeau sur la carte ; la pastille reprend la couleur
   de la valeur sur la carte (renseignée par design.js). */
.kpis {
  left: 14px;
  bottom: 14px;
  display: flex;
  padding: 6px;
  gap: 2px;
  max-width: calc(100% - 28px);
}

.kpi {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 12px;
  border-radius: 10px;
}

.kpi + .kpi { border-left: 1px solid var(--ligne); border-radius: 0; }

.kpi b {
  display: block;
  font-family: var(--titre);
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.kpi span { font-size: 11.5px; color: var(--gris); }

.kpi svg { width: 22px; height: 22px; stroke: var(--nuit); fill: none; stroke-width: 1.6; }

.pastille {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--pastille, var(--ligne));
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 0 0 4px var(--ligne);
  flex: 0 0 14px;
}

.cell { stroke: none; cursor: pointer; }

.cell:hover { stroke: var(--nuit); stroke-width: 1.6; }

#tip {
  position: fixed;
  pointer-events: none;
  background: rgba(0, 37, 30, .94);
  color: #fff;
  font-size: 12px;
  padding: 8px 11px;
  border-radius: 10px;
  opacity: 0;
  transition: opacity .1s;
  z-index: 10;
  line-height: 1.5;
  box-shadow: var(--ombre-verre);
}

/* --- Suivi de la saison (niveau parcelle) ------------------------------ */

#suivi { margin-top: 28px; }

#suivi[hidden] { display: none; }

.suivi-tete h2 {
  font-family: var(--titre);
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -.015em;
  margin: 0 0 4px;
}

#suivi-source { margin: 0 0 12px; font-size: 12.5px; color: var(--gris); line-height: 1.55; max-width: 80ch; }

.suivi-boite {
  border-radius: var(--rayon);
  background: var(--papier);
  padding: 10px 18px 10px;
  box-shadow: var(--ombre);
}

.suivi-legende {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: #3f4b46;
  padding: 4px 0 10px;
}

.suivi-legende i {
  display: inline-block;
  width: 16px;
  height: 3px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

.onglets {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--ligne);
}

.onglet {
  border: 0;
  background: transparent;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--gris);
}

.onglet:hover { background: var(--pierre); color: var(--encre); }

.onglet[aria-current="true"] { background: var(--menthe-pale); color: var(--nuit); font-weight: 600; }

.onglets .pousse { margin-left: auto; }

/* Même survol que le bouton Déconnexion. */
.onglets .pousse:hover { background: var(--pierre); border-color: #b9c6bd; }

/* Bouton avec picto (flèche de téléchargement pour l'export CSV). */
.btn-picto { display: inline-flex; align-items: center; gap: 8px; }

.btn-picto svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.panneau[hidden] { display: none; }

.tableau { max-height: 320px; overflow: auto; }

.tableau table { border-collapse: collapse; width: 100%; font-size: 12.5px; }

.tableau th {
  position: sticky;
  top: 0;
  background: var(--pierre);
  text-align: left;
  padding: 8px 10px;
  font-weight: 600;
  white-space: nowrap;
}

.tableau td { padding: 7px 10px; border-bottom: 1px solid #edf1ee; }

.tableau tr.total td { font-weight: 700; background: #f6f8f6; border-top: 1px solid var(--ligne); }

.tableau td.num, .tableau th.num { text-align: right; font-variant-numeric: tabular-nums; }

.tableau th.num, .tableau td.num { width: 128px; }

/* --- Onglet Accès (compte autorisé à gérer) ---------------------------- */

main.vue-acces .outils,
main.vue-acces .tete,
main.vue-acces #alerte-ancienne,
main.vue-acces .scene,
main.vue-acces #restitution,
main.vue-acces #suivi,
main.vue-donnees .outils,
main.vue-donnees .tete,
main.vue-donnees #alerte-ancienne,
main.vue-donnees .scene,
main.vue-donnees #restitution,
main.vue-donnees #suivi { display: none; }

#acces, #donnees { margin-top: 8px; }

#acces[hidden], #donnees[hidden] { display: none; }

.don-onglets { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 4px; }

.don-onglets button[aria-current="true"] {
  border-color: var(--menthe);
  background: var(--menthe-pale);
}

.don-aide {
  margin: -6px 0 12px;
  color: var(--gris);
  font-size: 12px;
  line-height: 1.45;
}

.don-nombres {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.don-ligne {
  display: grid;
  grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}

.don-ligne .champ { margin: 0; }

.acces-grille.don-seul { grid-template-columns: 1fr; }

.don-csv {
  width: 100%;
  min-height: 420px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.acces-intro {
  margin: 0 0 14px;
  max-width: 82ch;
  color: var(--gris);
  font-size: 13px;
  line-height: 1.55;
}

.acces-intro code { background: var(--pierre-2); padding: 1px 5px; border-radius: 4px; }

.acces-barre {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0 14px;
}

#acc-message { font-size: 13px; color: var(--nuit); font-weight: 600; }

.acces-grille {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding-bottom: 12px;
}

.acces-form { min-width: 0; }

.acces-liste { display: flex; flex-direction: column; gap: 8px; }

.acces-compte {
  width: 100%;
  text-align: left;
  border-radius: 14px;
  padding: 10px 12px;
}

.acces-compte b { display: block; font-size: 13.5px; }

.acces-compte span { display: block; margin-top: 2px; color: var(--gris); font-size: 12px; }

.acces-compte[aria-current="true"] {
  border-color: var(--menthe);
  background: var(--menthe-pale);
}

.acces-form h3 {
  margin: 0 0 12px;
  font-family: var(--titre);
  font-size: 18px;
  font-weight: 650;
}

.acc-resultat:empty { display: none; }

.acc-resultat {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.acc-resultat.ok {
  background: var(--menthe-pale);
  border: 2px solid var(--menthe);
  color: var(--nuit);
}

.acc-resultat.ko {
  background: #fff5f5;
  border: 2px solid #c62828;
  color: #8e1b1b;
}

.acces-form input.invalide {
  border-color: #c62828;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, .22);
}

.acces-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }

.acces-mots { align-items: start; }

.acces-mdp-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  color: var(--gris);
  line-height: 1.45;
}

.jauge {
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--pierre-2);
  overflow: hidden;
}

.jauge span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width .2s, background .2s;
}

.jauge-legende { margin: 4px 0 0; min-height: 1.2em; font-size: 12px; font-weight: 600; }

.acces-form input[type="text"],
.acces-form input[type="password"],
.acces-form input:not([type]) {
  font: inherit;
  font-size: 13.5px;
  padding: 9px 14px;
  border: 1px solid var(--ligne);
  border-radius: 999px;
  color: var(--encre);
  background: var(--papier);
  box-shadow: 0 1px 2px rgba(0, 37, 30, .05);
}

.acces-form input:focus { outline: 0; border-color: var(--menthe); box-shadow: 0 0 0 3px rgba(57, 204, 147, .22); }

.acces-form fieldset {
  border: 1px solid var(--ligne);
  border-radius: 14px;
  margin: 0 0 14px;
  padding: 10px 14px 12px;
}

.acces-form legend { padding: 0 6px; font-weight: 650; font-size: 13px; }

.acces-choix { display: flex; flex-wrap: wrap; gap: 8px 16px; }

.acces-choix label, .acces-maitre {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}

.acces-maitre { margin: 4px 0 10px; font-weight: 600; }

.acces-domaine { margin-top: 12px; max-width: 280px; }

.acces-parcelles {
  max-height: 240px;
  overflow: auto;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.acces-parcelles h4 {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 650;
  color: var(--gris);
}

.acces-parcelles label { display: flex; align-items: center; gap: 8px; padding: 2px 0; font-size: 13px; }

.acces-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .acces-grille, .acces-champs { grid-template-columns: 1fr; }
}

/* --- Écrans étroits ----------------------------------------------------- */

@media (max-width: 1100px) {
  .qui { display: none; }
}

@media (max-width: 760px) {
  body { flex-direction: column; height: auto; overflow: auto; }
  /* Barre du haut : logo, nom, burger. Le menu s'ouvre dessous (classe .ouvert posée par design.js). */
  .rail { width: 100%; flex: 0 0 auto; flex-direction: row; align-items: center; gap: 12px; padding: 10px 16px; position: sticky; top: 0; z-index: 20; }
  .rail-logo { width: 118px; height: auto; }
  .rail-nom { display: block; color: #fff; font-family: var(--titre); font-size: 19px; font-weight: 650; letter-spacing: -.02em; }
  .burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    margin-left: auto;
    width: 46px;
    height: 46px;
    padding: 0 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 12px;
  }
  .burger:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .4); }
  .burger span { display: block; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
  /* Les trois traits deviennent une croix quand le menu est ouvert. */
  .rail.ouvert .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .rail.ouvert .burger span:nth-child(2) { opacity: 0; }
  .rail.ouvert .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .rail-menu { display: none; }
  .rail.ouvert .rail-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 6px 16px 18px;
    background: var(--nuit);
    border-top: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 18px 30px -12px rgba(0, 37, 30, .5);
  }
  .rail .titre-rail { margin: 8px 0 0; }
  .niveaux { width: 100%; align-items: stretch; }
  .niveau { width: 100%; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; font-size: 15px; }
  .niveau svg { width: 22px; height: 22px; }
  .menu-compte { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .12); color: #fff; }
  .menu-compte .qui { display: block; }
  .menu-compte .qui span { color: rgba(255, 255, 255, .65); }
  .menu-compte .discret { margin-left: auto; background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
  .menu-compte .discret:hover { background: rgba(255, 255, 255, .1); }
  .rail-aide { margin: 4px 0 0; }

  /* Le contenu de l'en-tête (produit, compte) est passé dans la barre et le menu. */
  .entete { display: none; }
  main { padding: 16px 16px 24px; overflow: visible; }
  .tete h1 { font-size: 24px; }
  select { min-width: 0; width: 100%; }
  .champ { flex: 1 1 100%; }
  /* Sur mobile, les panneaux quittent la carte pour ne pas la masquer. */
  .legend, .kpis { position: static; margin-top: 12px; width: auto; }
  .kpis { flex-wrap: wrap; }
  .ramp { height: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
