/* Mon jardin — voir DESIGN.md. Mobile d'abord ; ≥ 720 px : feuilles en panneau à droite. */
:root {
  --sol: #f6f8f4;          /* fond du plan : blanc à peine vert, contraste maximal au soleil */
  --papier: #ffffff;       /* surfaces : en-tête, barre, feuilles */
  --encre: #18241c;
  --doux: #4f5e54;         /* texte secondaire, 6,9:1 sur blanc */
  --trait: #d3dbd2;
  --survol: #eff3ee;
  --grille: #e2e8e0; --grille-forte: #c3cec1;
  --vert: #2b6a44; --vert-fonce: #1f5434; --vert-clair: #e1eee4;
  --danger: #a8261d; --danger-clair: #fbe9e7;
  --alerte: #8a5200; --alerte-clair: #fdf0dc;
  --ombre: 0 2px 6px rgb(24 36 28 / .08), 0 10px 28px rgb(24 36 28 / .12);
  --r: 16px; --r-champ: 10px;
  --barre-h: 72px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--encre); background: var(--sol);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
::selection { background: #cbe4d3; }
input, textarea { caret-color: var(--vert); }
:focus-visible { outline: 2px solid var(--vert); outline-offset: 2px; }
[hidden] { display: none !important; }
.icone { width: 1.375rem; height: 1.375rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- bandeau de démonstration (visiteur sans compte) ---------- */
/* Il prend sa propre rangée : sans lui, la grille garde ses deux rangées d'origine. */
body:has(#banniere:not([hidden])) { grid-template-rows: auto auto 1fr; }
#banniere { display: flex; align-items: center; gap: .6rem; padding: .4rem .75rem; background: var(--vert-clair); border-bottom: 1px solid var(--trait); z-index: 2; }
#banniere p { margin: 0; flex: 1; min-width: 0; font-size: .8125rem; color: var(--encre); }
#banniere a { flex: none; min-height: 36px; display: inline-flex; align-items: center; padding: 0 .85rem; border-radius: var(--r-champ); background: var(--vert); color: #fff; font-size: .8125rem; font-weight: 600; text-decoration: none; }
#banniere a:hover { background: var(--vert-fonce); }
@media (max-width: 420px) { #banniere p strong { display: block; } }

/* ---------- en-tête : titre, décompte, état d'enregistrement, export ---------- */
.entete { display: flex; align-items: center; gap: .6rem; min-height: 52px; padding: .25rem .5rem .25rem 1rem; padding-top: max(.25rem, env(safe-area-inset-top)); background: var(--papier); border-bottom: 1px solid var(--trait); z-index: 2; }
h1 { font-size: 1.0625rem; margin: 0; font-weight: 680; letter-spacing: -.01em; white-space: nowrap; }
#resume { margin: 0; flex: 1; min-width: 0; font-size: .8125rem; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
#etat { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; color: var(--doux); padding: .25rem .55rem; border-radius: 999px; white-space: nowrap; }
.etat-point { width: .5rem; height: .5rem; border-radius: 50%; background: var(--grille-forte); }
#etat .icone { display: none; width: 1.25rem; height: 1.25rem; color: var(--vert); }
#etat[data-etat="ok"] .icone { display: block; }
#etat[data-etat="ok"] .etat-point { display: none; }
@media (max-width: 479px) { /* état normal : la coche suffit, le texte reste lu par les lecteurs d'écran */
  #etat:is([data-etat="ok"], [data-etat="attente"]) .etat-texte { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
#etat[data-etat="hors-ligne"] { background: var(--alerte-clair); color: var(--alerte); font-weight: 600; }
#etat[data-etat="hors-ligne"] .etat-point { background: var(--alerte); }
#etat[data-etat="refus"] { background: var(--danger-clair); color: var(--danger); font-weight: 600; }
#etat[data-etat="refus"] .etat-point { background: var(--danger); }
.bouton-icone { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-width: 44px; min-height: 44px; padding: 0 .6rem; border: 0; border-radius: 12px; background: transparent; color: var(--encre); }
.bouton-icone:active { background: var(--vert-clair); }
#exporter { font-size: .875rem; font-weight: 600; }
.etiquette-large { display: none; }
@media (min-width: 480px) { .etiquette-large { display: inline; } }

/* ---------- plan ---------- */
main { position: relative; min-height: 0; }
#plan { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; background: var(--sol); }
#plan text { font-size: 11px; fill: var(--doux); pointer-events: none; }
#plan .grille line { stroke: var(--grille); stroke-width: .6; }
#plan .grille line.forte { stroke: var(--grille-forte); stroke-width: 1; }
#plan .cote { font-size: 11px; fill: var(--encre); font-weight: 650; paint-order: stroke; stroke: var(--sol); stroke-width: 3.5px; stroke-linejoin: round; font-variant-numeric: tabular-nums; }
#plan .nom { font-size: 11px; fill: var(--encre); paint-order: stroke; stroke: #fffffff0; stroke-width: 3.5px; stroke-linejoin: round; }
#plan .nom.choisi { font-weight: 700; font-size: 12px; }
#plan .nom .variete { font-size: 9.5px; font-weight: 500; fill: var(--doux); }
#plan .nom.choisi .variete { font-size: 10.5px; font-weight: 600; }
#plan .nom-zone { font-size: 12px; font-weight: 680; paint-order: stroke; stroke: #ffffffd0; stroke-width: 3.5px; stroke-linejoin: round; }
#plan .halo { fill: rgb(24 36 28 / .12); stroke: var(--encre); stroke-width: 1.5; }
#plan .poignee-plus { fill: #ffffffe6; stroke-width: 1.5; stroke-dasharray: 2 2; }
#plan .plus { stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
#plan .brouillon { fill: none; stroke: var(--encre); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
#plan .brouillon.fermeture { stroke-dasharray: 5 5; stroke-width: 1.5; }
#plan .brouillon-fond { fill: rgb(43 106 68 / .12); stroke: none; }
#plan .coin { fill: #fff; stroke: var(--encre); stroke-width: 2.5; }
#plan .coin.premier { fill: var(--vert-clair); stroke: var(--vert); stroke-width: 3; }

/* Vue esthétique : grille effacée, cimes et pieds (voir cimes.js) */
#plan.esthetique { background: #f3f6ef; }
#plan.esthetique .grille line { stroke: #e6ebe2; }
#plan.esthetique .grille line.forte { stroke: #d6ddd3; }
#plan.esthetique .grille text { fill: #6b7a70; }
#plan .fantome { fill: #ffffffb0; stroke: var(--doux); stroke-width: 1.4; stroke-dasharray: 3 2.5; }
#plan .fantome.choisi { stroke: var(--encre); stroke-width: 2.2; }
#plan .emplacement { fill: #fff; stroke: #7d8a81; stroke-width: 1.6; }
#plan .emplacement.choisi { stroke: var(--encre); stroke-width: 2.5; }
#plan .halo-cime { fill: none; stroke: #fff; stroke-width: 2; stroke-opacity: .9; pointer-events: none; }
#plan .anneau { pointer-events: none; }
#plan .fruits { pointer-events: none; }
#plan .emprise-adulte { fill: none; stroke: var(--encre); stroke-width: 1.5; stroke-dasharray: 2 4; stroke-linecap: round; stroke-opacity: .7; pointer-events: none; }

/* Zoom : côté pouce, au-dessus de la barre */
/* Zoom : à GAUCHE, hors du chemin des actions. */
#zoom { position: absolute; left: .75rem; bottom: calc(var(--barre-h) + .75rem); display: grid; gap: .4rem; z-index: 3; }
#presentation { display: grid; gap: .4rem; }
#zoom > .options-filet { width: 24px; height: 1px; margin: .15rem auto; background: var(--trait); }
#zoom .bouton-icone, #presentation .bouton-icone { width: 44px; height: 44px; padding: 0; background: var(--papier); border: 1px solid var(--trait); box-shadow: 0 1px 3px rgb(24 36 28 / .08); }

/* ---------- barre d'actions du bas ---------- */
#barre { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; background: var(--papier); border-radius: var(--r) var(--r) 0 0; box-shadow: var(--ombre); padding: .4rem .5rem max(.4rem, env(safe-area-inset-bottom)); }
.barre-tete { display: flex; align-items: center; gap: .25rem; padding: .3rem 0 .2rem .6rem; }
#infos { flex: 1; min-width: 0; }
.barre-titre { margin: 0; font-weight: 650; font-size: 1rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre-sous-titre { margin: .1rem 0 0; font-size: .8125rem; line-height: 1.35; color: var(--doux); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.barre-fermer { color: var(--doux); }
.barre-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(max-content, 1fr); gap: .25rem; }

/* Colonne de droite : les options du domaine choisi au niveau 0, puis les actions de ce qui est
   sélectionné (dock.js › #options). La navigation reste en bas, les actions sont ici — une seule
   place pour agir, au pouce droit. Apparition en 180 ms, sans pousser le plan. */
#options { position: absolute; right: .75rem; bottom: calc(var(--barre-h) + .75rem); z-index: 3;
  display: grid; gap: .4rem; justify-items: end; animation: options-entre .18s ease-out; }
#options .bouton-icone { width: 44px; height: 44px; padding: 0; background: var(--papier); border: 1px solid var(--trait); box-shadow: 0 1px 3px rgb(24 36 28 / .08); }
#presentation .bouton-icone[aria-pressed="true"], #options .bouton-icone[aria-pressed="true"] { background: var(--vert); border-color: var(--vert-fonce); color: #fff; }
#options .bouton-icone.principal { border-color: var(--vert); color: var(--vert-fonce); }
#options .bouton-icone.danger { color: #a4302a; }
/* Filet : marque le passage « options du domaine » → « actions de la sélection ». */
.options-filet { display: block; width: 24px; height: 1px; margin: .15rem 10px; background: var(--trait); }
@keyframes options-entre { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #options { animation: none; } }

/* Niveau 0 : le domaine ouvert se lit comme « ouvert » sans crier. */
.barre-actions .action[data-action^="menu-"][aria-pressed="true"] { background: var(--vert-clair); }
.barre-actions .action[data-action^="menu-"]:disabled { opacity: .38; }
.action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-height: 56px; padding: .35rem .25rem; border: 0; border-radius: 12px; background: transparent; color: var(--encre); font-size: .75rem; font-weight: 600; line-height: 1.15; }
.action > span:first-child { display: flex; }
.action-nom { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action:active:not(:disabled) { background: var(--vert-clair); }
.action.principal { background: var(--vert); color: #fff; }
.action.principal:active:not(:disabled) { background: var(--vert-fonce); }
.action.danger { color: var(--danger); background: var(--danger-clair); }
.action.large { grid-column: span 2; }
.action[aria-pressed="true"] { background: var(--vert-clair); color: var(--vert-fonce); }
.action:disabled { opacity: .35; }
@media (hover: hover) {
  .action:hover:not(:disabled):not(.principal) { background: var(--survol); }
  .action.principal:hover:not(:disabled) { background: var(--vert-fonce); }
  .bouton-icone:hover { background: var(--survol); }
}

/* Réglette du temps (vue esthétique), dans la barre au-dessus des actions */
/* ---------- les deux réglettes de l'instant (vue esthétique) ----------
   Elles se posent À DROITE de l'icône « Esthétique » (dernier bouton de la colonne de gauche), à la
   même hauteur qu'elle, et flottent au-dessus du plan. Rien d'autre : ni valeur lue, ni bouton
   (Alex, 19/11). La barre du bas ne change plus de hauteur avec la vue, donc le plan ne saute plus.
   Largeur : ce qui reste entre la colonne de gauche et la colonne de droite. */
.hors-ecran { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); }
/* Trois rangées de 44 px, alignées sur le bas de la colonne de gauche et sur son pas (.4rem) : chaque
   réglette tombe EN FACE de son bouton (Temps, Forme, Ombres — la rangée du milieu reste vide, « Forme »
   n'a pas de réglette). Fond opaque : sur la grille, la piste et sa valeur se confondaient avec le
   plan (Alex, 19/11). */
#reglettes { position: absolute; z-index: 3; left: calc(.75rem + 44px + .5rem); right: calc(.75rem + 44px + .5rem);
  bottom: calc(var(--barre-h) + .75rem); display: grid; grid-template-rows: 44px 44px 44px; gap: .4rem;
  align-content: end; --teinte: var(--vert); }
.reglette-ligne { display: flex; align-items: center; gap: .6rem; height: 44px; padding: 0 .8rem;
  border-radius: 12px; background: var(--papier); border: 1px solid var(--trait);
  box-shadow: 0 1px 3px rgb(24 36 28 / .08); }
.reglette-ligne.vide, .reglette-vide { visibility: hidden; }
.reglette-ligne output { flex: none; min-width: 6.2rem; font-size: .9375rem; font-weight: 600; color: var(--vert-fonce); }
#heure-valeur { color: #a8761f; }
.barre-temps[data-nuit="1"] #heure-valeur { color: #44568a; }
.barre-temps[data-repere="mars"] { --teinte: #6aa84f; }
.barre-temps[data-repere="juin"] { --teinte: var(--vert); }
.barre-temps[data-repere="septembre"] { --teinte: #c9822b; }
.barre-temps[data-repere="decembre"] { --teinte: #5b7a99; }
#temps { flex: 1; min-width: 0; height: 34px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; touch-action: pan-x; }
#temps::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--teinte) var(--part, 0%), var(--trait) var(--part, 0%)); }
#temps::-moz-range-track { height: 6px; border-radius: 3px; background: var(--trait); }
#temps::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--teinte); }
#temps::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: var(--papier); border: 2.5px solid var(--teinte); box-shadow: 0 1px 3px rgb(24 36 28 / .2), 0 4px 10px rgb(24 36 28 / .12); }
#temps::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--papier); border: 2.5px solid var(--teinte); box-shadow: 0 1px 3px rgb(24 36 28 / .2); }
#temps:focus-visible { outline: none; }
#temps:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--teinte); outline-offset: 3px; }

/* Piste de l'heure, DANS la barre de temps, sous celle de la date : elle est colorée comme la journée
   choisie (nuit, crépuscule, plein jour), pour qu'on voie où est le jour en décembre comme en juin.
   Sa teinte lui est propre (ambre le jour, bleu la nuit) : c'est ce qui la distingue de la date. */
#heure { --teinte: #d79a2b; }
.barre-temps[data-nuit="1"] #heure { --teinte: #5b6b96; }
#heure { flex: 1; min-width: 0; height: 34px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; touch-action: pan-x; }
#heure::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--piste, var(--trait)); }
#heure::-moz-range-track { height: 6px; border-radius: 3px; background: var(--piste, var(--trait)); }
#heure::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: var(--papier); border: 2.5px solid var(--teinte); box-shadow: 0 1px 3px rgb(24 36 28 / .2), 0 4px 10px rgb(24 36 28 / .12); }
#heure::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--papier); border: 2.5px solid var(--teinte); box-shadow: 0 1px 3px rgb(24 36 28 / .2); }
#heure:focus-visible { outline: none; }
#heure:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--teinte); outline-offset: 3px; }
.bouton-texte { min-height: 44px; padding: 0 .7rem; border: 1px solid var(--trait); border-radius: 12px; background: var(--papier); font-size: .8125rem; font-weight: 600; color: var(--vert-fonce); white-space: nowrap; }
.bouton-texte:disabled { color: var(--doux); opacity: .55; }
.bouton-texte:active:not(:disabled) { background: var(--vert-clair); }
@media (hover: hover) { .bouton-texte:hover:not(:disabled) { background: var(--survol); } }

/* Feuille « Plantes » (liste des espèces et des variétés) */
.legende-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.legende-liste li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: .25rem .65rem; align-items: center; }
.legende-texte { display: grid; min-width: 0; line-height: 1.25; }
.legende-texte > span { font-weight: 600; font-size: .9375rem; }
.legende-texte small { font-size: .8125rem; color: var(--doux); }
.legende-varietes { grid-column: 2; list-style: none; margin: .1rem 0 .2rem; padding: 0; display: grid; gap: .35rem; }
.legende-varietes .legende-texte > span { font-weight: 400; }
.legende-titre { margin: .4rem 0 0; font-size: .8125rem; font-weight: 700; color: var(--doux); }
.echantillon { display: block; }
.echantillon-emplacement { display: block; justify-self: center; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 1.6px solid #7d8a81; }

/* Message temporaire (« Annuler ») */
#toast { position: absolute; left: calc(44px + 1.5rem); right: calc(44px + 1.5rem); bottom: calc(var(--barre-h) + .75rem); z-index: 5; display: flex; align-items: center; gap: .5rem; padding: .25rem .25rem .25rem 1rem; border-radius: 12px; background: var(--encre); color: #fff; font-size: .875rem; box-shadow: var(--ombre); }
.toast-texte { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-action { min-height: 44px; padding: 0 .9rem; border: 0; border-radius: 9px; background: transparent; color: #bfe6cb; font-weight: 700; }
.toast-action:active { background: #ffffff1f; }

/* ---------- feuilles (fiche plante, fiche zone, listes Plantes et Zones) ---------- */
.feuille { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; flex-direction: column; max-height: 62dvh; margin: 0; background: var(--papier); border-radius: var(--r) var(--r) 0 0; box-shadow: 0 -4px 10px rgb(24 36 28 / .06), 0 -14px 36px rgb(24 36 28 / .14); animation: monte .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes monte { from { transform: translateY(24px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .feuille { animation: none; } }
.feuille-tete { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .5rem .4rem 1rem; }
.feuille-tete h2 { margin: 0; font-size: 1.0625rem; font-weight: 680; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feuille-fermer { color: var(--doux); }
.feuille-corps { display: flex; flex-direction: column; gap: .8rem; padding: .2rem 1rem 1rem; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--trait) transparent; }
.feuille-pied { display: flex; justify-content: space-between; gap: .5rem; padding: .6rem 1rem max(.6rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--trait); }
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 48px; padding: 0 1.1rem; border: 1px solid var(--trait); border-radius: 12px; background: var(--papier); font-weight: 600; }
.bouton .icone { width: 1.2rem; height: 1.2rem; }
.bouton.principal { margin-left: auto; min-width: 7rem; background: var(--vert); border-color: var(--vert); color: #fff; }
.bouton.principal:active { background: var(--vert-fonce); }
.bouton.danger { color: var(--danger); border-color: transparent; background: var(--danger-clair); }
@media (hover: hover) { .bouton:not(.principal):hover { background: var(--survol); } .bouton.danger:hover { background: #f6d9d5; } .bouton.principal:hover { background: var(--vert-fonce); } }

/* Champs */
.feuille-corps > * { flex: none; } /* une liste déroulante (zone de défilement) ne doit pas être écrasée */
.champ { display: grid; gap: .3rem; }
.champ-nom { font-size: .8125rem; font-weight: 600; color: var(--doux); }
#f-age-calc { font-weight: 400; }
.champ-saisie { position: relative; display: block; }
.champ input, .champ textarea, .champ select { width: 100%; min-height: 48px; padding: .65rem .75rem; border: 1px solid var(--trait); border-radius: var(--r-champ); background: #fff; font-size: 1rem; color: var(--encre); }
.champ textarea { resize: vertical; line-height: 1.4; }
/* Liste fermée (forme de conduite) : même champ que la saisie, chevron dessiné à droite */
.champ select { appearance: none; -webkit-appearance: none; padding-right: 2.6rem; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f5e54' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .8rem center / 1.1rem; }
.case { display: flex; align-items: center; gap: .75rem; min-height: 48px; cursor: pointer; }
.case input { width: 1.4rem; height: 1.4rem; margin: 0; accent-color: var(--vert); flex: none; }
.case span { display: grid; }
.case b { font-weight: 600; font-size: .95rem; color: var(--encre); }
.case small { font-size: .8125rem; color: var(--doux); }
.champ input::placeholder, .champ textarea::placeholder { color: #6b7a70; }
.champ input:focus, .champ textarea:focus, .champ select:focus { border-color: var(--vert); outline: 2px solid var(--vert-clair); outline-offset: 0; }
.champ.effacable input { padding-right: 2.9rem; }
.champ-effacer { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 9px; background: none; color: var(--doux); }
.champ-effacer .icone { width: 1.1rem; height: 1.1rem; }
.champ-effacer:active { background: var(--survol); }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.aide-champ { margin: -.45rem 0 0; font-size: .8125rem; color: var(--doux); font-style: italic; }
.aide-champ:empty { display: none; }
.meta { margin: 0; font-size: .8125rem; line-height: 1.4; color: var(--doux); }
.discret { color: var(--doux); font-size: .875rem; }

/* Liste avec recherche */
ul.combo-liste { list-style: none; margin: -.45rem 0 0; padding: .25rem 0; max-height: 36dvh; overflow-y: auto; border: 1px solid var(--trait); border-radius: var(--r-champ); background: #fff; box-shadow: 0 4px 14px rgb(24 36 28 / .08); color: var(--encre); font-size: .9375rem; scrollbar-width: thin; }
ul.combo-liste:not([hidden]) + .aide-champ { display: none; }
.combo-liste li[role="option"] { padding: .7rem .8rem; min-height: 44px; cursor: pointer; display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; }
.combo-liste li[role="option"] small { color: var(--doux); font-style: italic; font-size: .75rem; text-align: right; }
.combo-liste li[aria-selected="true"] { background: var(--vert-clair); }
.combo-liste .combo-groupe { padding: .5rem .8rem .2rem; font-size: .6875rem; text-transform: uppercase; letter-spacing: .05em; color: var(--doux); font-weight: 700; }
.combo-liste .combo-vide { padding: .6rem .8rem; color: var(--doux); }

/* Couleurs de zone */
.couleurs { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); justify-items: center; }
.couleurs legend { padding: 0; margin-bottom: .35rem; }
.couleurs label { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; }
.couleurs input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.couleurs span { display: block; width: 36px; height: 36px; border-radius: 50%; border: 2px solid; }
.couleurs input:checked + span { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--encre); }
.couleurs input:focus-visible + span { outline: 2px solid var(--vert); outline-offset: 5px; }

/* Liste des zones */
#cq-liste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; }
#cq-liste li { display: flex; align-items: center; gap: .25rem; }
.cq-nom { flex: 1; min-width: 0; display: flex; align-items: center; gap: .55rem; min-height: 48px; padding: .4rem .6rem; text-align: left; border: 1px solid var(--trait); border-radius: var(--r-champ); background: #fff; }
.cq-nom.actif { border-color: var(--vert); background: var(--vert-clair); }
.cq-texte { display: grid; min-width: 0; line-height: 1.2; }
.cq-texte > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cq-nom small { color: var(--doux); font-size: .75rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cq-pastille { width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid; flex: none; }
.cq-btn { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 48px; border: 0; border-radius: var(--r-champ); background: transparent; color: var(--doux); }
.cq-btn .icone { width: 1.25rem; height: 1.25rem; }
.cq-btn:disabled { opacity: .3; }
.cq-btn:active:not(:disabled) { background: var(--survol); }
#cq-liste li.verrou .cq-btn[aria-label^="Déverrouiller"] { color: var(--vert-fonce); background: var(--vert-clair); }
#cq-liste li.masque .cq-nom { opacity: .5; }

/* ---------- ordinateur, tablette ---------- */
@media (min-width: 720px) {
  #barre { left: 50%; right: auto; bottom: .75rem; width: min(560px, calc(100% - 1.5rem)); transform: translateX(-50%); border-radius: var(--r); padding-bottom: .4rem; }
  .feuille { left: auto; right: .75rem; top: calc(52px + .75rem); bottom: .75rem; width: 380px; max-height: none; border-radius: var(--r); box-shadow: var(--ombre); animation-name: glisse; }
  @keyframes glisse { from { transform: translateX(16px); opacity: .6; } }
  .feuille-pied { padding-bottom: .6rem; }
  body.feuille-ouverte #barre { left: calc((100% - 392px) / 2); }
  body.feuille-ouverte #options { right: calc(392px + 1.25rem); }
  #zoom, #options { bottom: calc(var(--barre-h) + 1.5rem); }
  #toast { left: 50%; right: auto; transform: translateX(-50%); max-width: 480px; bottom: calc(var(--barre-h) + 1.5rem); }
  body.feuille-ouverte #toast { left: calc((100% - 392px) / 2); }
}

/* ---------- Ombre, orientation, espaces libres, lots (demande 16) ---------- */
#rose { position: absolute; right: .75rem; top: .75rem; width: 44px; height: 44px; padding: 0; z-index: 3; background: var(--papier); border: 1px solid var(--trait); border-radius: 50%; box-shadow: 0 1px 3px rgb(24 36 28 / .08); display: grid; place-items: center; }
#rose svg { position: absolute; inset: 0; width: 44px; height: 44px; }
#rose .rose-nord { fill: #a8424f; }
#rose .rose-sud { fill: #c9cfc9; }
#rose .rose-n { position: relative; font-size: .625rem; font-weight: 750; color: var(--encre); background: #ffffffd8; border-radius: 4px; padding: 0 2px; line-height: 1.2; }
#rose[data-hypothese="true"] { border-style: dashed; }
/* Seule couche d'ombre : voile de lumière et silhouettes portées, sous les cimes (section S) */
#plan .couche-soleil { pointer-events: none; }
#plan .couche-soleil .ombre-portee { stroke: none; }
/* Nuit : la grille et les cotes s'estompent, le plan reste lisible */
#plan.nuit .grille line { stroke-opacity: .25; }
#plan.nuit .grille text, #plan.nuit .cote { opacity: .5; }
#plan .hachures { fill: url(#hachures); stroke: none; pointer-events: none; }
#plan .halo-lot { fill: none; stroke: var(--encre); stroke-width: 1.4; stroke-opacity: .8; pointer-events: none; }
#plan .nom-lot { font-style: italic; }
#or-nord { width: 100%; height: 44px; accent-color: var(--vert); }
.meta.alerte { color: #8a5a12; }
.echantillon-hachures, .echantillon-lot, .echantillon-batiment { width: 28px; height: 28px; flex: none; border-radius: 6px; }
.echantillon-hachures { background: repeating-linear-gradient(45deg, #4f5e5459 0 1.2px, transparent 1.2px 5px), #e6e0d4; }
.echantillon-lot { background: radial-gradient(circle at 20% 70%, #2f6b46 3px, transparent 3.5px), radial-gradient(circle at 50% 50%, #2f6b46 3px, transparent 3.5px), radial-gradient(circle at 80% 30%, #2f6b46 3px, transparent 3.5px); }
.echantillon-batiment { background: #e3dbf2; border: 2px dashed #6a4fa0; }


/* ==================================================================
   FORME RÉELLE : un CALQUE, pas une autre vue (Alex, 19/11)
   « Il y a un problème quand on toggle les formes, c'est comme si le tout
   se rechargeait, ça clignote, l'écran bouge un tout petit peu […] donc il
   n'y a pas de disparition. » Tout le bloc « consultation » qui masquait
   l'inventaire, la synchro, les boutons de zoom et les graduations, et qui
   rapetissait l'en-tête, est SUPPRIMÉ : c'est lui qui changeait la hauteur
   de la page, donc la taille du plan, donc la position de la carte à chaque
   bascule. Ne rien remettre ici qui modifie la mise en page.
   La seule différence permise est une teinte (#plan.esthetique plus haut).
   ================================================================== */

/* « Annuler » dans les deux vues : accessible, mais sans place fixe quand il n'y a rien a annuler.
   Les autres boutons desactives du plan (Terminer, Monter, Descendre) gardent leur place : leur
   apparition/disparition pendant un trace serait plus deroutante que leur grisage. */
.barre-actions button[data-action="undo"]:disabled { display: none; }

/* Pas de graduations sous la reglette de l'heure : un <input type=range> reserve la
   largeur de sa poignee, donc des reperes en pourcentage du conteneur tombent a cote
   (mesure : 70 px d'ecart au lieu de 100). Le degrade de la piste montre deja ou est
   le jour, et l'heure est ecrite en clair au-dessus. */

/* ---------- Sculpteur de cage (demande 21) : vue de côté, 4 orientations, points qu'on tire ---------- */
/* Le select et le bouton 3D partagent la ligne du champ Forme : aucune ligne ajoutée à la fiche. */
.champ-saisie-duo { display: flex; gap: 8px; align-items: stretch; }
.champ-saisie-duo select { flex: 1 1 auto; min-width: 0; }
#f-sculpter { flex: 0 0 auto; min-width: 44px; min-height: 44px; font-weight: 600; font-size: .82rem; }
/* Une pastille signale que la forme a été sculptée : pas de phrase, juste un repère. */
#f-sculpter[data-sculptee="1"] { border-color: var(--accent, #18c0d8); color: var(--accent, #18c0d8); }

.sculpteur { position: fixed; inset: 0; z-index: 60; background: rgba(12, 14, 16, .88);
  display: grid; place-items: center; padding: 12px; }
.sculpteur-cadre { display: flex; flex-direction: column; gap: 10px; width: min(100%, 520px); max-height: 100%; }
.sculpteur-vue { width: 100%; flex: 1 1 auto; min-height: 0; background: #11161a; border-radius: 12px; touch-action: none; }
.sculpteur-sol { stroke: #3a4650; stroke-width: .006; }
.sculpteur-masse { fill: #2f7d52; fill-opacity: .55; stroke: #58b47c; stroke-width: .008; }
.sculpteur-niveau { fill: none; stroke: #7fd6a3; stroke-width: .005; stroke-opacity: .5; }
.sculpteur-point { fill: #f2f6f8; stroke: #18c0d8; stroke-width: .012; cursor: grab; }
.sculpteur-point:active { cursor: grabbing; }
.sculpteur-point:focus-visible { outline: none; stroke: #ffd166; stroke-width: .02; }
.sculpteur-rose { display: flex; gap: 8px; justify-content: center; }
.sculpteur-rose button { min-width: 48px; min-height: 44px; border-radius: 10px; border: 1px solid #3a4650;
  background: #1b2228; color: #e8eef2; font-weight: 600; }
.sculpteur-pied { display: flex; gap: 8px; }
.sculpteur-pied .bouton { flex: 1 1 auto; min-height: 44px; }

/* ---- Fiche : silhouette et taille (refonte du système de forme, 18/11) ---- */
.champ-colonne { display: grid; gap: .4rem; align-items: start; }
.silhouettes { display: grid; grid-template-columns: repeat(6, 1fr); gap: .35rem; }
.silhouettes button { padding: .3rem .1rem .25rem; border: 1px solid var(--trait); border-radius: 10px;
  background: var(--papier); color: var(--encre); font: 500 10px/1.15 inherit; cursor: pointer;
  display: grid; justify-items: center; gap: .15rem; }
.silhouettes button svg { width: 100%; height: 34px; display: block; }
.silhouettes button svg path { fill: var(--vert-clair, #cfe8d4); stroke: var(--vert-fonce); stroke-width: 1; }
.silhouettes button[aria-checked="true"] { border-color: var(--vert-fonce); box-shadow: inset 0 0 0 1px var(--vert-fonce); }
.silhouettes button[aria-checked="true"] svg path { fill: var(--vert); }
.silhouettes button span { opacity: .8; text-align: center; }
.taille-duo { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.taille-duo label { position: relative; display: grid; gap: .2rem; font-size: .75rem; }
.taille-duo label .champ-nom { opacity: .75; font-size: .75rem; }
/* Chaque champ du duo ancre SON × : sans position: relative sur le label, les deux se superposaient
   dans le coin du bloc. Le × est plus petit ici, la colonne ne fait que la moitié de la largeur. */
.taille-duo .champ-effacer { width: 34px; height: 34px; right: 0; top: auto; bottom: 0; transform: none; }
.taille-duo input { padding-right: 2.2rem; }
.taille-duo input { width: 100%; }

/* Aperçu de croissance pendant un glissé de la date : les cimes sont mises à l'échelle autour de leur
   pied (cimes.js › ajusterCimes). Sans ceci, le liseré de 3,2 px suivait le facteur et une cime
   multipliée par quatre se retrouvait cernée d'un trait de 13 px. */
#plan g.cime path, #plan g.cime circle { vector-effect: non-scaling-stroke; }
