/* Viti Vini · identité NoScroll Lab : prune profond, cuivre, crème. Titres Syne, texte Hanken Grotesk. */

@font-face { font-family: 'Syne'; font-weight: 600; font-display: swap; src: url(vendor/polices/syne-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Syne'; font-weight: 700; font-display: swap; src: url(vendor/polices/syne-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-weight: 400; font-display: swap; src: url(vendor/polices/hanken-grotesk-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-weight: 500; font-display: swap; src: url(vendor/polices/hanken-grotesk-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-weight: 600; font-display: swap; src: url(vendor/polices/hanken-grotesk-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-weight: 700; font-display: swap; src: url(vendor/polices/hanken-grotesk-latin-700-normal.woff2) format('woff2'); }

:root {
  /* Palette (60 % crème, 30 % prune, 10 % cuivre) */
  --prune-950: #17131c;
  --prune-900: #1f1a24;
  --prune-800: #2a2230;
  --prune-700: #3b3042;
  --creme-0: #fffdfa;
  --creme-50: #faf6f0;
  --creme-100: #f3ede4;
  --creme-200: #e8dfd2;
  --trait: #e3d9cb;
  --cuivre-200: #f4d0b5;
  --cuivre-300: #e6ad87;
  --cuivre-400: #cf8d66;
  --cuivre-500: #b5734f;
  --cuivre-600: #9c5c3e;
  --cuivre-700: #7a432a;
  --degrade-cuivre: linear-gradient(135deg, #e6ad87 0%, #cf8d66 45%, #a8653f 100%);
  --encre: #1f1a24;
  --gris: #6c6270;
  --vigne: #56723f;
  --vigne-fond: #e6eedc;
  --grenat: #8b2f44;
  --grenat-fond: #f7e4e7;
  --ambre: #9a6a14;
  --ambre-fond: #f8edd5;
  --pluie: #4f86c6;
  --selection: #f0b47f;

  /* Ancien nommage, gardé pour les vues */
  --vert: var(--prune-800);
  --vert-clair: var(--prune-700);
  --vin: var(--cuivre-600);
  --fait: var(--cuivre-500);
  --papier: var(--creme-50);
  --surface: var(--creme-0);

  --ombre-1: 0 1px 2px rgba(31, 26, 36, .06), 0 2px 6px rgba(31, 26, 36, .05);
  --ombre-2: 0 1px 2px rgba(31, 26, 36, .08), 0 6px 16px rgba(31, 26, 36, .08), 0 16px 36px rgba(31, 26, 36, .07);
  --ombre: var(--ombre-2);
  --rayon: 16px;
  --rayon-s: 12px;
  --titre: 'Syne', 'Hanken Grotesk', system-ui, sans-serif;
  --police: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--police); font-size: 16px; line-height: 1.5; color: var(--encre); background: var(--creme-50);
  display: grid; grid-template-rows: auto 1fr auto; height: 100dvh; overflow: hidden;
  -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--cuivre-300); outline-offset: 2px; }
.ico { width: 20px; height: 20px; flex: none; }

/* ---------- Barre du haut ---------- */
.barre {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: linear-gradient(180deg, var(--prune-900), var(--prune-950)); color: var(--creme-50);
}
.barre::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--degrade-cuivre); opacity: .9; }
.marque { display: flex; align-items: center; gap: 10px; }
.marque img { width: 34px; height: 34px; border-radius: 10px; }
.marque .nom { font-family: var(--titre); font-weight: 700; font-size: 1.2rem; letter-spacing: .01em; line-height: 1.1; display: block; }
.marque .signature { display: block; font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: var(--cuivre-300); font-weight: 600; }
.badge { display: none; }
.barre-droite { display: flex; align-items: center; gap: 10px; }
.campagne { font-size: .72rem; display: grid; gap: 2px; color: var(--cuivre-200); letter-spacing: .06em; text-transform: uppercase; }
.campagne select {
  background: var(--prune-800); border: 1px solid rgba(230, 173, 135, .35); color: var(--creme-50); border-radius: 10px;
  padding: 6px 10px; min-height: 38px; font-weight: 600; letter-spacing: 0; text-transform: none;
}
.hors-ligne { font-size: .72rem; background: var(--grenat); padding: 4px 10px; border-radius: 99px; }

/* ---------- Carte ---------- */
.corps { position: relative; overflow: hidden; }
.carte { position: absolute; inset: 0; background: #d9d3c6; }
.outils-carte { position: absolute; right: 12px; top: 12px; z-index: 500; display: grid; gap: 10px; max-height: calc(54% - 24px); overflow-y: auto; padding: 2px; }
.rond {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(31, 26, 36, .06); background: var(--creme-0); color: var(--prune-800);
  box-shadow: var(--ombre-2); display: grid; place-items: center; cursor: pointer; transition: transform .15s ease, background .15s ease;
}
.rond .ico { width: 22px; height: 22px; }
.rond:active { transform: scale(.94); }
.rond.texte { font-family: var(--titre); font-weight: 700; font-size: .72rem; letter-spacing: .04em; }
#btn-radar[aria-pressed="true"], #btn-aoc[aria-pressed="true"] { background: var(--prune-800); color: var(--cuivre-300); }

.bandeau {
  position: absolute; left: 12px; right: 72px; top: 12px; z-index: 600; padding: 12px 14px;
  background: var(--creme-0); border-radius: var(--rayon); box-shadow: var(--ombre-2);
}
.bandeau p { margin: 0 0 10px; font-weight: 600; font-size: .92rem; }
.bandeau-boutons { display: flex; gap: 6px; }
.bandeau-boutons .btn { flex: 1; padding: 8px 6px; min-height: 44px; font-size: .9rem; }

.radar-info {
  position: absolute; left: 50%; bottom: calc(46% + 14px); transform: translateX(-50%); z-index: 650;
  background: rgba(23, 19, 28, .88); color: var(--creme-50); padding: 7px 14px; border-radius: 99px; font-size: .8rem;
  font-variant-numeric: tabular-nums; box-shadow: var(--ombre-1); white-space: nowrap;
}

/* ---------- Panneau ---------- */
.panneau {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 700; height: 46%;
  background: var(--creme-50); border-radius: 24px 24px 0 0;
  box-shadow: 0 -1px 0 rgba(31, 26, 36, .04), 0 -10px 30px rgba(31, 26, 36, .14);
  display: flex; flex-direction: column; transition: height .28s cubic-bezier(.2, .7, .2, 1);
}
.panneau.grand { height: 88%; }
.panneau.petit { height: 64px; }
.poignee { border: 0; background: none; padding: 10px 0 8px; cursor: pointer; display: grid; place-items: center; }
.poignee span { width: 40px; height: 5px; border-radius: 99px; background: var(--creme-200); }
.contenu { overflow-y: auto; padding: 4px 20px 32px; flex: 1; overscroll-behavior: contain; }

@media (min-width: 900px) {
  body { grid-template-columns: 440px 1fr; grid-template-rows: auto 1fr auto; }
  .barre { grid-column: 1 / -1; }
  .corps { grid-column: 1 / -1; grid-row: 2 / 4; }
  .panneau, .panneau.grand, .panneau.petit {
    top: 0; bottom: 72px; right: auto; width: 440px; height: auto; border-radius: 0;
    box-shadow: 1px 0 0 var(--trait), 10px 0 30px rgba(31, 26, 36, .08);
  }
  .poignee { display: none; }
  .contenu { padding: 24px 28px 40px; }
  .onglets { grid-column: 1; grid-row: 3; z-index: 800; }
  .carte { left: 440px; }
  .bandeau { left: 456px; right: 72px; }
  .radar-info { left: calc(440px + (100% - 440px) / 2); bottom: 18px; }
}

/* ---------- Onglets du bas ---------- */
.onglets {
  display: grid; grid-template-columns: repeat(6, 1fr); background: var(--prune-950);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 800; box-shadow: 0 -1px 0 rgba(230, 173, 135, .18);
}
.onglets button {
  position: relative; border: 0; background: none; padding: 8px 2px 6px; min-height: 60px; cursor: pointer;
  display: grid; justify-items: center; align-content: center; gap: 5px;
  font-size: .66rem; font-weight: 500; letter-spacing: .01em; color: rgba(250, 246, 240, .58); transition: color .15s ease;
}
.onglets .ico { width: 23px; height: 23px; }
.onglets button.actif { color: var(--cuivre-300); font-weight: 700; }
.onglets button.actif::before {
  content: ''; position: absolute; top: 0; left: 50%; width: 26px; height: 3px; margin-left: -13px; border-radius: 0 0 3px 3px; background: var(--degrade-cuivre);
}

/* ---------- Typographie ---------- */
h2 { font-family: var(--titre); font-weight: 700; font-size: 1.5rem; line-height: 1.15; letter-spacing: -.01em; margin: 8px 0 6px; color: var(--prune-900); }
h3 {
  display: flex; align-items: center; gap: 8px; font-family: var(--police); font-size: .74rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--cuivre-600); margin: 32px 0 12px;
}
h3 .ico { width: 17px; height: 17px; }
.sous { color: var(--gris); font-size: .92rem; margin: 0 0 20px; }
small { font-size: .82em; }

/* ---------- Boutons ---------- */
.btn {
  border: 0; border-radius: 14px; min-height: 52px; padding: 12px 18px; font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.principal { background: linear-gradient(180deg, var(--prune-800), var(--prune-900)); color: var(--creme-50); box-shadow: var(--ombre-1); }
.principal .ico { color: var(--cuivre-300); }
.principal:hover { box-shadow: var(--ombre-2); }
.secondaire { background: var(--creme-0); color: var(--prune-800); border: 1px solid var(--trait); }
.secondaire .ico { color: var(--cuivre-500); }
.secondaire:hover { border-color: var(--cuivre-300); }
.danger { background: var(--creme-0); color: var(--grenat); border: 1px solid #e7c4cc; }
.plein { width: 100%; }
.mini { min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 12px; font-size: .88rem; }
.rangee { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rangee > .btn { flex: 1; }
.lien { border: 0; background: none; color: var(--cuivre-600); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px 2px; min-height: 32px; }
.retour { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--cuivre-600); font-weight: 600; padding: 8px 0; cursor: pointer; min-height: 44px; }
.chip { border: 1px solid var(--trait); background: var(--creme-0); border-radius: 99px; padding: 8px 16px; min-height: 42px; cursor: pointer; font-size: .86rem; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--prune-800); color: var(--creme-50); border-color: var(--prune-800); }

/* ---------- Cartes et listes ---------- */
.carte-item {
  position: relative; background: var(--creme-0); border: 1px solid var(--creme-200); border-radius: var(--rayon);
  padding: 16px 18px; margin-bottom: 12px; display: block; width: 100%; text-align: left; cursor: pointer;
  box-shadow: var(--ombre-1); transition: border-color .15s ease, box-shadow .15s ease;
}
.carte-item:hover { border-color: var(--cuivre-300); box-shadow: var(--ombre-2); }
.carte-item .titre { font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 1.02rem; }
.carte-item .titre > span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.carte-item .titre .ico { color: var(--cuivre-500); }
.carte-item .infos { display: block; color: var(--gris); font-size: .88rem; margin-top: 4px; }
.carte-item.trt { cursor: default; }
.vide { text-align: center; color: var(--gris); padding: 24px 12px; }
.vide .ico { width: 40px; height: 40px; color: var(--cuivre-300); display: block; margin: 0 auto 10px; }

.progression { height: 8px; background: var(--creme-200); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progression span { display: block; height: 100%; background: var(--degrade-cuivre); border-radius: 99px; }
.progression.alerte-barre span { background: linear-gradient(90deg, #d89a3a, var(--ambre)); }

.note { font-size: .88rem; color: var(--gris); background: var(--creme-100); border-radius: var(--rayon-s); padding: 12px 14px; line-height: 1.5; }
.note p { margin: 0 0 6px; }
.journal-ligne { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; padding: 12px 0; border-bottom: 1px solid var(--creme-200); font-size: .92rem; }
.journal-ligne .date { color: var(--gris); font-variant-numeric: tabular-nums; }

/* ---------- Formulaires ---------- */
.champs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.champs .large, .note.large { grid-column: 1 / -1; }
.champ { display: grid; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--gris); letter-spacing: .01em; min-width: 0; align-content: end; }
.champ.large { grid-column: 1 / -1; }
.champ input, .champ select, .champ textarea, .saisie, .liste-edit input {
  border: 1px solid var(--trait); border-radius: var(--rayon-s); background: var(--creme-0); padding: 12px; min-height: 48px;
  color: var(--encre); font-size: 1rem; font-weight: 400; transition: border-color .15s ease, box-shadow .15s ease;
  width: 100%; min-width: 0;
}
.saisie { width: auto; }
.champ input:focus, .champ select:focus, .champ textarea:focus, .saisie:focus, .liste-edit input:focus {
  outline: none; border-color: var(--cuivre-400); box-shadow: 0 0 0 3px rgba(207, 141, 102, .2);
}
.champ textarea { min-height: 80px; resize: vertical; }
.calcule { background: var(--creme-100) !important; color: var(--prune-800) !important; font-weight: 600 !important; }
.saisie { flex: 2; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.sous-onglets { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 2px; margin: 12px 0 20px; border-bottom: 1px solid var(--creme-200); }
.sous-onglets button {
  display: grid; justify-items: center; gap: 4px; border: 0; background: none; padding: 8px 2px 10px; min-height: 58px; white-space: nowrap;
  cursor: pointer; color: var(--gris); font-size: .76rem; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.sous-onglets .ico { width: 20px; height: 20px; }
.sous-onglets button.actif { color: var(--prune-900); font-weight: 700; border-color: var(--cuivre-500); }
.sous-onglets button.actif .ico { color: var(--cuivre-500); }
.titre-parcelle { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.titre-parcelle h2 { margin: 4px 0; }

.reglage { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 8px; margin-bottom: 10px; }
.reglage .val { min-width: 70px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.liste-edit { display: grid; gap: 8px; }
.liste-edit .ligne { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

/* ---------- Suivi des rangs ---------- */
.grille-rangs { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; }
.rang {
  min-height: 50px; border-radius: 12px; border: 1px solid var(--trait); background: var(--creme-0);
  font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; color: var(--prune-800); transition: background .12s ease;
}
.rang.fait { background: var(--degrade-cuivre); border-color: transparent; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.rang.ici { box-shadow: 0 0 0 3px var(--prune-800); }
.legende { display: flex; flex-wrap: wrap; gap: 16px; font-size: .8rem; color: var(--gris); margin: 12px 0; }
.legende i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; border: 1px solid var(--trait); }

/* ---------- Alertes et pastilles ---------- */
.alerte { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--rayon-s); padding: 12px 14px; margin-bottom: 8px; font-size: .9rem; line-height: 1.45; border: 1px solid transparent; }
.alerte::before { content: ''; flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.alerte.bloquant { background: var(--grenat-fond); color: #5e1a2b; border-color: #efcbd3; }
.alerte.attention { background: var(--ambre-fond); color: #5c400c; border-color: #efdcb0; }
.alerte.info { background: var(--creme-100); color: var(--prune-800); border-color: var(--creme-200); }
.alerte.ok { background: var(--vigne-fond); color: #2f4520; border-color: #d0dfc0; }
.pastille { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .04em; padding: 3px 9px; border-radius: 99px; margin-right: 4px; vertical-align: 1px; }
.pastille.bio { background: var(--vigne-fond); color: var(--vigne); }
.pastille.bc { background: #e4ecf6; color: #2f557f; }
.pastille.prevu { background: var(--ambre-fond); color: var(--ambre); }
.amm { font-weight: 500; font-size: .74rem; color: var(--gris); white-space: nowrap; }

/* ---------- Traitements ---------- */
.fiche-produit { background: var(--creme-0); border: 1px solid var(--creme-200); border-radius: var(--rayon); padding: 16px 18px; box-shadow: var(--ombre-1); }
.fiche-produit .titre { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 1.08rem; }
.fiche-produit .infos { color: var(--gris); font-size: .86rem; margin-top: 6px; }
.fiche-produit .sa { margin: 10px 0; padding-left: 18px; font-size: .92rem; }
.fiche-produit details { margin-top: 10px; font-size: .86rem; }
.fiche-produit summary { cursor: pointer; color: var(--cuivre-600); font-weight: 600; min-height: 32px; }
.fiche-produit .ce { padding-left: 18px; color: var(--gris); }
.usages, .liste-parcelles { display: grid; gap: 8px; }
.usage { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; background: var(--creme-0); border: 1px solid var(--trait); border-radius: var(--rayon-s); padding: 12px 14px; cursor: pointer; }
.usage.choisi { border-color: var(--cuivre-500); box-shadow: 0 0 0 1px var(--cuivre-500); }
.usage input, .case input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--cuivre-500); }
.usage small { color: var(--gris); }
.case { display: flex; align-items: center; gap: 12px; background: var(--creme-0); border: 1px solid var(--trait); border-radius: var(--rayon-s); padding: 12px 14px; min-height: 52px; cursor: pointer; }
.case[data-action] { width: 100%; text-align: left; font-weight: 600; }
.case small { color: var(--gris); margin-left: auto; font-weight: 400; }
.calcul {
  background: linear-gradient(160deg, var(--prune-800), var(--prune-950)); color: var(--creme-50); border-radius: var(--rayon);
  padding: 16px 18px; margin-top: 18px; display: grid; gap: 8px; box-shadow: var(--ombre-2);
}
.calcul div { display: flex; justify-content: space-between; gap: 10px; }
.calcul span { color: rgba(250, 246, 240, .72); }
.calcul b { font-family: var(--titre); font-size: 1.12rem; font-variant-numeric: tabular-nums; color: var(--cuivre-200); }
.calcul .detail { font-size: .85rem; }

/* ---------- Chiffres clés ---------- */
.chiffres, .maintenant { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.maintenant { grid-template-columns: repeat(3, 1fr); }
.chiffres div, .maintenant div { background: var(--creme-0); border: 1px solid var(--creme-200); border-radius: var(--rayon-s); padding: 14px; display: grid; gap: 4px; box-shadow: var(--ombre-1); }
.chiffres b, .maintenant b { font-family: var(--titre); font-weight: 700; font-size: 1.3rem; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--prune-900); }
.chiffres span, .maintenant span { font-size: .76rem; color: var(--gris); line-height: 1.35; }
.chiffres .ico, .maintenant .ico { width: 18px; height: 18px; color: var(--cuivre-500); }

/* ---------- Météo ---------- */
.graphique { width: 100%; height: auto; background: var(--creme-0); border: 1px solid var(--creme-200); border-radius: var(--rayon-s); }
.g-pluie { fill: var(--pluie); }
.g-vent { fill: none; stroke: var(--prune-800); stroke-width: 2.5; }
.g-rafales { fill: none; stroke: #a99ea8; stroke-width: 1.5; stroke-dasharray: 4 3; }
.g-seuil { stroke: var(--cuivre-500); stroke-width: 1.3; stroke-dasharray: 6 4; }
.g-nuit { fill: var(--creme-100); }
.g-txt { font-size: 11px; fill: var(--gris); font-family: var(--police); }
.g-txt.seuil { fill: var(--cuivre-600); font-weight: 700; }
.legende i.l-pluie { background: var(--pluie); border: 0; }
.legende i.l-vent { background: var(--prune-800); border: 0; height: 3px; vertical-align: 3px; }
.legende i.l-rafales { background: #a99ea8; border: 0; height: 2px; vertical-align: 3px; }
.legende i.l-seuil { background: var(--cuivre-500); border: 0; height: 2px; vertical-align: 3px; }
.tableau-meteo { overflow-x: auto; background: var(--creme-0); border: 1px solid var(--creme-200); border-radius: var(--rayon-s); }
.tableau-meteo table { border-collapse: collapse; width: 100%; font-size: .88rem; }
.tableau-meteo th, .tableau-meteo td { padding: 10px; text-align: left; border-bottom: 1px solid var(--creme-200); white-space: nowrap; }
.tableau-meteo tr:last-child td { border-bottom: 0; }
.tableau-meteo th { font-size: .68rem; color: var(--gris); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.tableau-meteo tr.depasse td { background: var(--grenat-fond); color: #5e1a2b; font-weight: 600; }
.tableau-meteo tr.proche td { background: var(--ambre-fond); }
.tableau-meteo td small { color: var(--gris); }
.pluie-passee { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; height: 96px; align-items: end; background: var(--creme-0); border: 1px solid var(--creme-200); border-radius: var(--rayon-s); padding: 10px; }
.pluie-passee span { display: grid; grid-template-rows: 1fr auto; height: 100%; text-align: center; }
.pluie-passee i { align-self: end; background: var(--pluie); border-radius: 4px 4px 0 0; min-height: 1px; }
.pluie-passee small { font-size: .64rem; color: var(--gris); }

/* ---------- Vendanges ---------- */
.origine { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 10px; align-items: center; margin-bottom: 8px; font-size: .92rem; }
.origine .barre { height: 10px; background: var(--creme-200); border-radius: 99px; overflow: hidden; padding: 0; }
.origine .barre::after { display: none; }
.origine .barre i { display: block; height: 100%; background: var(--degrade-cuivre); }

/* ---------- Modale, QR ---------- */
.modale { position: fixed; inset: 0; z-index: 3000; background: rgba(23, 19, 28, .6); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; }
.modale[hidden] { display: none; }
.modale-boite { position: relative; background: var(--creme-50); border-radius: 22px; padding: 22px 20px 20px; width: min(440px, 100%); max-height: 92dvh; overflow-y: auto; box-shadow: 0 30px 80px rgba(23, 19, 28, .35); }
.modale-fermer { position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; border: 0; background: none; font-size: 1.6rem; cursor: pointer; color: var(--gris); border-radius: 50%; }
.modale h2 { margin-right: 44px; }
.qr { background: #fff; border-radius: var(--rayon); padding: 10px; margin: 12px auto 16px; width: min(300px, 100%); box-shadow: var(--ombre-1); }
.qr svg { width: 100%; height: auto; display: block; }
#scan-video { width: 100%; border-radius: var(--rayon); background: #000; aspect-ratio: 1; object-fit: cover; }

/* ---------- Toast et étiquettes carte ---------- */
.toast {
  position: fixed; left: 50%; top: 70px; transform: translateX(-50%); z-index: 2000; text-align: center;
  background: var(--prune-900); color: var(--creme-50); padding: 12px 20px; border-radius: 99px; box-shadow: var(--ombre-2);
  max-width: calc(100% - 32px); font-size: .92rem; border: 1px solid rgba(230, 173, 135, .25);
}
.etiquette-rang { background: rgba(23, 19, 28, .82); color: var(--creme-50); border: 0; border-radius: 6px; padding: 1px 5px; font-weight: 700; font-size: 11px; box-shadow: none; }
.etiquette-rang::before { display: none; }
.etiquette-parcelle { background: var(--creme-0); color: var(--prune-900); border: 0; border-radius: 10px; font-weight: 700; font-family: var(--police); padding: 4px 10px; box-shadow: var(--ombre-2); }
.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: var(--ombre-2); font-family: var(--police); }
.leaflet-container { font-family: var(--police); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Courbe de fermentation */
.g-grille { stroke: var(--creme-200); stroke-width: 1; }
.g-densite { fill: none; stroke: var(--cuivre-600); stroke-width: 2.6; stroke-linejoin: round; }
.g-temp { fill: none; stroke: var(--prune-800); stroke-width: 1.6; stroke-dasharray: 5 4; }
.g-point-densite { fill: var(--cuivre-500); stroke: var(--creme-0); stroke-width: 1.5; }
.g-point-temp { fill: var(--prune-800); stroke: var(--creme-0); stroke-width: 1.2; }
.g-txt-temp { fill: var(--prune-800); }
.legende i.l-densite { background: var(--cuivre-600); border: 0; height: 3px; vertical-align: 3px; }
.legende i.l-temp { background: var(--prune-800); border: 0; height: 2px; vertical-align: 3px; }

/* Journal de cuve */
.journal-cuve { margin-top: 14px; }
.journal-cuve .journal-ligne { grid-template-columns: auto 1fr auto; align-items: start; }
.journal-cuve .journal-ligne .ico { width: 18px; height: 18px; vertical-align: -4px; color: var(--cuivre-600); }
.journal-cuve .infos { color: var(--gris); font-size: .84rem; }

/* Menu des fonds de carte */
.menu-fonds { position: absolute; z-index: 600; min-width: 220px; padding: 8px; border-radius: var(--rayon-s); background: var(--creme-0);
  border: 1px solid var(--creme-200); box-shadow: 0 12px 32px rgba(23, 19, 28, .22), 0 3px 8px rgba(23, 19, 28, .14); }
.menu-fonds p { margin: 4px 10px 6px; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--cuivre-600); font-weight: 700; }
.menu-fonds button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 10px;
  background: none; font: inherit; font-size: .92rem; color: var(--encre, #1f1a24); text-align: left; cursor: pointer; }
.menu-fonds button:hover { background: var(--creme-100); }
.menu-fonds button[aria-checked="true"] { font-weight: 700; background: var(--creme-100); }
.menu-fonds button[aria-checked="true"] .ico { color: var(--cuivre-600); }
.menu-fonds .ico { width: 18px; height: 18px; flex: none; }
.menu-fonds p:not(:first-child) { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--creme-200); }
.case-calque { width: 18px; height: 18px; flex: none; border-radius: 5px; border: 1.5px solid var(--cuivre-600); background: var(--creme-0); }
.menu-fonds button[aria-checked="true"] .case-calque { background: var(--cuivre-500) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fffdfa' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: var(--cuivre-500); }

/* Fiche sol (popup de la carte et terroir de la parcelle) */
.fiche-sol { font-size: .88rem; line-height: 1.45; }
.fiche-sol p { margin: 0 0 8px; }
.fiche-sol .sol-titre { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.pastille-sol { width: 16px; height: 16px; flex: none; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(23, 19, 28, .25); }
.fiche-sol .sol-type { color: var(--gris); font-size: .8rem; }
.fiche-sol .sol-vigne { background: var(--creme-100); border-radius: 8px; padding: 8px 10px; }
.fiche-sol .sol-note { color: var(--gris); font-size: .76rem; margin-bottom: 0; }
.carte-sol { background: var(--creme-0); border: 1px solid var(--creme-200); border-radius: var(--rayon-s); padding: 14px; }

/* Effets du sol (onglet Terroir) */
.effets-sol { margin-top: 14px; }
.effets-titre { margin: 0 0 10px; }
.effets-sous { margin: 16px 0 8px; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--cuivre-600); font-weight: 700; }
.jauges-sol { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px; }
.jauge-sol { background: var(--creme-0); border: 1px solid var(--creme-200); border-radius: 12px; padding: 10px 12px; }
.jauge-sol span { display: block; font-size: .74rem; color: var(--gris); }
.jauge-sol b { font-family: var(--titre); font-size: 1rem; text-transform: capitalize; }
.effets-sol details { margin-top: 10px; background: var(--creme-0); border: 1px solid var(--creme-200); border-radius: var(--rayon-s); padding: 0 14px; }
.effets-sol summary { cursor: pointer; padding: 13px 0; font-weight: 700; list-style-position: inside; }
.effets-sol details[open] summary { border-bottom: 1px solid var(--creme-200); margin-bottom: 10px; }
.effets-sol details p, .effets-sol details ul { font-size: .9rem; line-height: 1.5; margin: 0 0 10px; }
.demarches { margin: 0 0 12px; padding-left: 20px; }
.demarches li { margin-bottom: 10px; font-size: .9rem; line-height: 1.45; }
.demarches li strong { display: block; }
.demarches li span { color: var(--gris); }
.preuve { display: inline-block; font-size: .64rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border-radius: 99px; vertical-align: 1px; margin-left: 2px; }
.preuve-P { background: #e3efe3; color: #2f5a35; }
.preuve-C { background: var(--creme-100); color: var(--cuivre-600); }
.preuve-D { background: #ece6f0; color: #5a4668; }
