/* =====================================================================
   AgriLink — Prototype mobile
   Design System AgriLink (déclinaison mobile / terrain)
   Priorité : lisibilité, gros boutons, peu de texte, feedback immédiat.
   ===================================================================== */

/* ---------- 1. Jetons du Design System ---------- */
:root {
  /* Vert institutionnel AgriLink */
  --green-900: #0F3D22;
  --green-800: #14502B;
  --green-700: #1B6B3A;   /* couleur principale */
  --green-600: #25804A;
  --green-500: #3A9A5F;
  --green-200: #BFE0CB;
  --green-100: #DDEFE3;
  --green-50:  #EEF6F0;

  /* Neutres */
  --ink-900: #16201B;
  --ink-700: #3C4A42;
  --ink-500: #6B7A72;
  --ink-300: #B8C3BD;
  --ink-200: #DCE3DF;
  --ink-100: #EEF1EF;
  --surface: #FFFFFF;
  --bg:      #F4F7F5;

  /* Couleurs fonctionnelles (usage strictement limité) */
  --amber-700: #9A6512;
  --amber-500: #C27C1A;
  --amber-50:  #FBF3E4;
  --red-700:   #8F2A24;
  --red-500:   #B3261E;
  --red-50:    #FBEAE8;
  --ochre:     #E4B94A;   /* grain / soleil (illustrations) */

  /* Typographie */
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --fs-xs: 14px;
  --fs-sm: 16px;
  --fs-md: 18px;
  --fs-lg: 22px;
  --fs-xl: 28px;
  --fs-2xl: 34px;

  /* Espaces & formes */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  --radius: 16px;
  --radius-sm: 10px;
  --tap: 56px;            /* zone tactile minimale */
  --shadow: 0 1px 2px rgba(22, 32, 27, .06), 0 4px 12px rgba(22, 32, 27, .06);
  --tabbar-h: 72px;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.35;
  color: var(--ink-900);
  background: #E6EBE8;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { display: inline-block; vertical-align: middle; }
svg:not([class]) { width: 1.1em; height: 1.1em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--amber-500); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 3. Scène : téléphone + panneau démo ---------- */
.stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  padding: 32px 16px;
}

.demo {
  width: 300px;
  font-size: 14px;
  color: var(--ink-700);
}
.demo__brand { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.demo__tag { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); }
.demo__intro { margin: 0 0 20px; color: var(--ink-500); }
.demo__block { background: #fff; border: 1px solid var(--ink-200); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.demo__block h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); margin: 0 0 10px; }
.demo__toggle { display: flex; gap: 8px; }
.demo__btn { flex: 1; min-height: 40px; border: 1px solid var(--ink-300); border-radius: 8px; background: #fff; padding: 6px 10px; font-size: 14px; }
.demo__btn.is-active { background: var(--green-700); color: #fff; border-color: var(--green-700); }
.demo__btn--primary { width: 100%; margin-top: 10px; background: var(--green-50); border-color: var(--green-200); color: var(--green-800); font-weight: 600; }
.demo__hint { margin: 10px 0 0; font-size: 13px; color: var(--ink-500); }
.demo__steps { margin: 0; padding-left: 20px; }
.demo__steps li { padding: 3px 0; }
.demo__steps li.is-done { color: var(--green-700); text-decoration: line-through; }
.demo__steps li.is-current { font-weight: 700; color: var(--green-800); }

/* Cadre du téléphone */
.phone {
  position: relative;
  width: 390px;
  height: 844px;
  background: var(--bg);
  border-radius: 44px;
  border: 10px solid #1A1F1C;
  box-shadow: 0 30px 60px rgba(0,0,0,.25), 0 0 0 2px #3a403c;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.phone__notch {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 28px; border-radius: 20px; background: #1A1F1C; z-index: 5;
}

/* Sur vrai téléphone : plein écran, pas de cadre */
@media (max-width: 720px) {
  body { background: var(--bg); }
  .stage { padding: 0; gap: 0; min-height: 100dvh; align-items: stretch; }
  .demo { display: none; }
  .phone { width: 100%; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .phone__notch { display: none; }
}

/* ---------- 4. Barre d'état + indicateur réseau ---------- */
.statusbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 6px;
  background: var(--surface);
  font-size: 15px; font-weight: 600;
  z-index: 6;
}
.netpill {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 4px 12px 4px 10px;
  border-radius: 999px; border: 1.5px solid var(--green-200);
  background: var(--green-50); color: var(--green-800);
  font-size: 14px; font-weight: 700;
}
.netpill__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green-600); box-shadow: 0 0 0 3px rgba(37,128,74,.18); }
.is-offline .netpill { background: var(--ink-100); border-color: var(--ink-300); color: var(--ink-700); }
.is-offline .netpill__dot { background: transparent; border: 2.5px solid var(--ink-500); box-shadow: none; }

/* Bandeau hors connexion (sous la barre d'état) */
.offline-banner {
  display: none; align-items: center; gap: 10px;
  padding: 10px 20px; background: var(--ink-900); color: #fff; font-size: 15px; font-weight: 600;
}
.offline-banner svg { width: 22px; height: 22px; flex: none; }
.is-offline .offline-banner { display: flex; }
.offline-banner__count { margin-left: auto; background: var(--amber-500); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 14px; }

/* ---------- 5. Écran ---------- */
.screen {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tabbar-h) + 16px);
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}
.screen.no-tabbar { padding-bottom: 16px; }
.view { padding: 0 var(--sp-4) var(--sp-4); animation: view-in .18s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* En-tête d'écran : retour + titre */
.topbar {
  display: flex; align-items: center; gap: 8px;
  min-height: 60px; padding: 4px 8px;
  position: sticky; top: 0; z-index: 3;
  background: var(--bg);
}
.topbar__back {
  width: var(--tap); height: var(--tap); border: 0; border-radius: 50%;
  background: transparent; display: grid; place-items: center; flex: none;
}
.topbar__back:active { background: var(--ink-200); }
.topbar__back svg { width: 30px; height: 30px; }
.topbar__title { font-size: var(--fs-lg); font-weight: 700; margin: 0; flex: 1; min-width: 0; }
.topbar__img { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.topbar__action { width: var(--tap); height: var(--tap); border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; }
.topbar__action svg { width: 26px; height: 26px; color: var(--green-700); }

/* Fil d'Ariane visuel (parcours Culture → Besoin → Conseil) */
.crumb { display: flex; align-items: center; gap: 8px; padding: 0 var(--sp-4) var(--sp-3); color: var(--ink-500); font-size: 15px; }
.crumb img { width: 28px; height: 28px; border-radius: 6px; }
.crumb svg { width: 16px; height: 16px; }
.crumb b { color: var(--ink-900); }

.h-section { font-size: 17px; font-weight: 700; color: var(--ink-700); margin: var(--sp-5) 0 var(--sp-3); text-transform: uppercase; letter-spacing: .04em; }
.help { color: var(--ink-500); font-size: 16px; margin: 0 0 var(--sp-3); }

/* ---------- 6. Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tap); padding: 0 22px; width: 100%;
  border-radius: var(--radius-sm); border: 2px solid transparent;
  font-size: var(--fs-md); font-weight: 700; line-height: 1.2;
  transition: transform .08s ease, background .15s ease;
  user-select: none;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 26px; height: 26px; flex: none; }
.btn--primary { background: var(--green-700); color: #fff; }
.btn--primary:active { background: var(--green-800); }
.btn--secondary { background: var(--green-50); color: var(--green-800); border-color: var(--green-200); }
.btn--ghost { background: transparent; color: var(--green-800); }
.btn--outline { background: var(--surface); color: var(--ink-900); border-color: var(--ink-300); }
.btn--danger { background: var(--red-50); color: var(--red-700); border-color: #F1C9C5; }
.btn--sm { min-height: 44px; font-size: 16px; padding: 0 16px; width: auto; }
.btn--lg { min-height: 64px; font-size: 20px; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn--success { background: var(--green-100); color: var(--green-900); border-color: var(--green-200); }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; width: auto; }
.btn-stack { display: flex; flex-direction: column; gap: 12px; }

/* Bouton chargement */
.btn.is-loading { pointer-events: none; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn--secondary .spinner, .btn--outline .spinner { border-color: var(--green-200); border-top-color: var(--green-700); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 7. Tuiles visuelles (accueil, cultures, besoins) ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 132px; padding: 16px 10px;
  background: var(--surface); border: 2px solid var(--ink-200); border-radius: var(--radius);
  text-align: center; font-weight: 700; font-size: var(--fs-md);
  transition: transform .08s ease, border-color .15s ease, background .15s ease;
}
.tile:active { transform: scale(.97); border-color: var(--green-500); background: var(--green-50); }
.tile__icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--green-50); color: var(--green-700); }
.tile__icon svg { width: 32px; height: 32px; }
.tile__img { width: 84px; height: 84px; }
.tile__sub { font-size: 14px; font-weight: 500; color: var(--ink-500); margin-top: -6px; }
.tile__badge { position: absolute; top: 10px; right: 10px; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--amber-500); color: #fff; font-size: 14px; display: grid; place-items: center; }
.tile { position: relative; }
.tile--wide { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; min-height: 88px; padding: 14px 18px; text-align: left; }
.tile--wide .tile__icon { flex: none; }
.tile--hero { grid-column: 1 / -1; min-height: 150px; border-color: var(--green-200); background: var(--green-50); }

/* Liste d'options (grosses lignes tactiles) */
.rows { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: flex; align-items: center; gap: 14px;
  min-height: 72px; padding: 12px 16px;
  background: var(--surface); border: 2px solid var(--ink-200); border-radius: var(--radius);
  font-weight: 700; font-size: var(--fs-md); text-align: left; width: 100%;
}
.row:active { border-color: var(--green-500); background: var(--green-50); }
.row__icon { width: 48px; height: 48px; border-radius: 12px; background: var(--green-50); color: var(--green-700); display: grid; place-items: center; flex: none; }
.row__icon svg { width: 28px; height: 28px; }
.row__img { width: 56px; height: 56px; border-radius: 12px; flex: none; }
.row__body { flex: 1; min-width: 0; }
.row__sub { display: block; font-weight: 500; font-size: 15px; color: var(--ink-500); margin-top: 2px; }
.row__arrow { width: 24px; height: 24px; color: var(--ink-300); flex: none; }
.row--done { border-color: var(--green-200); }
.row--done .row__icon { background: var(--green-700); color: #fff; }

/* ---------- 8. Cartes de contenu (formation) ---------- */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 2px solid var(--ink-200); border-radius: var(--radius); overflow: hidden;
  text-align: left; padding: 0; width: 100%;
}
.card:active { border-color: var(--green-500); }
.card__media { position: relative; height: 96px; background: var(--green-100); display: grid; place-items: center; }
.card__media img { width: 64px; height: 64px; }
.card__media svg { width: 44px; height: 44px; color: var(--green-700); }
.card__type { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.95); font-size: 13px; font-weight: 700; color: var(--green-800); }
.card__type svg { width: 16px; height: 16px; }
.card__saved { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--green-700); color: #fff; display: grid; place-items: center; }
.card__saved svg { width: 16px; height: 16px; }
.card__body { padding: 10px 12px 12px; }
.card__title { font-weight: 700; font-size: 16px; line-height: 1.25; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__meta { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-500); }
.card__meta svg { width: 16px; height: 16px; }
.card--list { flex-direction: row; align-items: stretch; }
.card--list .card__media { width: 96px; height: auto; flex: none; }
.card--list .card__body { flex: 1; }

/* ---------- 9. Puces / filtres ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 16px; border-radius: 999px;
  border: 2px solid var(--ink-200); background: var(--surface); font-weight: 700; font-size: 16px; color: var(--ink-700);
}
.chip svg { width: 22px; height: 22px; }
.chip img { width: 26px; height: 26px; border-radius: 6px; }
.chip.is-active { background: var(--green-700); border-color: var(--green-700); color: #fff; }

/* ---------- 10. Champs ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 8px; font-size: 17px; }
.input {
  width: 100%; min-height: 60px; padding: 0 16px; font-size: 20px; font-family: inherit;
  border: 2px solid var(--ink-300); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-900);
}
.input:focus { border-color: var(--green-700); outline: none; box-shadow: 0 0 0 3px var(--green-100); }
.input.is-error { border-color: var(--red-500); }
.input-wrap { position: relative; }
.input-wrap svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; color: var(--ink-500); }
.input-wrap .input { padding-left: 54px; }
.field__error { color: var(--red-700); font-size: 15px; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.field__error svg { width: 18px; height: 18px; }
.pin { display: flex; gap: 12px; justify-content: center; margin: 8px 0 20px; }
.pin__cell { width: 56px; height: 64px; border: 2px solid var(--ink-300); border-radius: 12px; display: grid; place-items: center; font-size: 30px; background: var(--surface); }
.pin__cell.is-filled { border-color: var(--green-700); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { min-height: 62px; border-radius: 12px; border: 2px solid var(--ink-200); background: var(--surface); font-size: 26px; font-weight: 600; }
.keypad button:active { background: var(--green-50); border-color: var(--green-500); }
.keypad button svg { width: 28px; height: 28px; }

/* Sélecteur visuel (profil, commune) */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice__opt {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  min-height: 100px; padding: 12px 8px; border: 2px solid var(--ink-200); border-radius: var(--radius); background: var(--surface);
  font-weight: 700; font-size: 16px; text-align: center; position: relative;
}
.choice__opt svg { width: 34px; height: 34px; color: var(--green-700); }
.choice__opt.is-active { border-color: var(--green-700); background: var(--green-50); }
.choice__opt.is-active::after { content: ""; position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--green-700); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E"); background-size: 16px; background-position: center; background-repeat: no-repeat; }

/* ---------- 11. Onboarding ---------- */
.onb { display: flex; flex-direction: column; min-height: 100%; padding: 24px 24px 20px; text-align: center; }
.onb__skip { align-self: flex-end; min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--ink-500); font-weight: 600; }
.onb__art { flex: 1; display: grid; place-items: center; padding: 10px 0; }
.onb__art svg, .onb__art img { width: 200px; height: 200px; }
.onb__title { font-size: var(--fs-xl); font-weight: 800; margin: 0 0 8px; color: var(--green-900); }
.onb__text { font-size: 18px; color: var(--ink-700); margin: 0 0 20px; }
.onb__dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 20px; }
.onb__dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-300); }
.onb__dots span.is-active { background: var(--green-700); width: 28px; border-radius: 6px; }
.onb__features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 6px 0 16px; }
.onb__feature { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--green-50); color: var(--green-900); font-weight: 700; font-size: 15px; text-align: left; }
.onb__feature svg { width: 28px; height: 28px; color: var(--green-700); flex: none; }

/* ---------- 12. Accueil ---------- */
.hello { display: flex; align-items: center; gap: 12px; padding: 10px var(--sp-4) 6px; }
.hello__avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--green-700); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.hello__name { font-weight: 800; font-size: 20px; margin: 0; }
.hello__place { font-size: 15px; color: var(--ink-500); display: flex; align-items: center; gap: 4px; }
.hello__place svg { width: 16px; height: 16px; }
.hello__bell { margin-left: auto; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--surface); display: grid; place-items: center; position: relative; box-shadow: var(--shadow); }
.hello__bell svg { width: 26px; height: 26px; }
.hello__bell .dot { position: absolute; top: 8px; right: 10px; width: 11px; height: 11px; border-radius: 50%; background: var(--amber-500); border: 2px solid #fff; }

.weather-strip {
  display: flex; align-items: center; gap: 14px; margin: 8px 0 14px;
  padding: 14px 16px; border-radius: var(--radius); background: var(--green-800); color: #fff; width: 100%; border: 0; text-align: left;
}
.weather-strip svg { width: 46px; height: 46px; flex: none; color: var(--ochre); }
.weather-strip__temp { font-size: 30px; font-weight: 800; line-height: 1; }
.weather-strip__label { font-size: 15px; opacity: .9; }
.weather-strip__arrow { margin-left: auto; width: 24px; height: 24px; color: rgba(255,255,255,.7); }

/* ---------- 13. Conseil (détail) ---------- */
.advice-hero { display: flex; align-items: center; gap: 14px; padding: 6px var(--sp-4) 14px; }
.advice-hero img { width: 72px; height: 72px; border-radius: 16px; }
.advice-hero h1 { font-size: var(--fs-lg); font-weight: 800; margin: 0; line-height: 1.2; }
.advice-hero__meta { display: flex; gap: 10px; margin-top: 4px; color: var(--ink-500); font-size: 15px; }
.advice-hero__meta span { display: inline-flex; align-items: center; gap: 4px; }
.advice-hero__meta svg { width: 16px; height: 16px; }

.media-box { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--green-900); height: 190px; margin: 0 var(--sp-4) 14px; display: grid; place-items: center; color: #fff; }
.media-box__play { width: 76px; height: 76px; border-radius: 50%; border: 0; background: #fff; color: var(--green-800); display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.media-box__play svg { width: 36px; height: 36px; margin-left: 4px; }
.media-box__label { position: absolute; left: 14px; bottom: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; font-size: 15px; }
.media-box__label svg { width: 18px; height: 18px; }
.media-box__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255,255,255,.25); }
.media-box__bar i { display: block; height: 100%; width: 0; background: var(--ochre); transition: width .5s linear; }
.media-box__scene { position: absolute; inset: 0; opacity: .35; pointer-events: none; }
.media-box__play, .media-box__label, .media-box__bar { position: relative; z-index: 1; }
.media-box__label { position: absolute; }
.media-box__bar { position: absolute; }

.audio-btn { display: flex; align-items: center; gap: 12px; width: calc(100% - 32px); margin: 0 var(--sp-4) 14px; min-height: 60px; padding: 0 16px; border-radius: var(--radius-sm); border: 2px solid var(--green-200); background: var(--green-50); color: var(--green-900); font-weight: 700; text-align: left; }
.audio-btn svg { width: 28px; height: 28px; flex: none; color: var(--green-700); }
.audio-btn__wave { flex: 1; height: 6px; border-radius: 3px; background: var(--green-200); overflow: hidden; }
.audio-btn__wave i { display: block; height: 100%; width: 0; background: var(--green-700); transition: width .3s linear; }
.audio-btn.is-playing { border-color: var(--green-700); }

.steps { list-style: none; margin: 0; padding: 0 var(--sp-4); display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--ink-200); }
.step__num { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--green-700); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.step__text { font-size: 18px; font-weight: 600; line-height: 1.35; padding-top: 6px; }
.tip { display: flex; gap: 12px; align-items: flex-start; margin: 14px var(--sp-4); padding: 14px; border-radius: var(--radius); background: var(--amber-50); color: var(--amber-700); font-weight: 600; }
.tip svg { width: 26px; height: 26px; flex: none; }

.actions { padding: 6px var(--sp-4) 0; display: flex; flex-direction: column; gap: 10px; }
.saved-state { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--green-100); color: var(--green-900); font-weight: 700; }
.saved-state svg { width: 24px; height: 24px; }

/* ---------- 14. Progression (formation) ---------- */
.progress { height: 10px; border-radius: 5px; background: var(--ink-200); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green-600); transition: width .3s ease; }
.progress-label { display: flex; justify-content: space-between; font-size: 15px; color: var(--ink-500); margin: 6px 0 12px; }

/* ---------- 15. Météo ---------- */
.wx-now { margin: 0 var(--sp-4) 14px; padding: 22px 20px; border-radius: 20px; background: var(--green-800); color: #fff; }
.wx-now__top { display: flex; align-items: center; gap: 18px; }
.wx-now__top svg { width: 84px; height: 84px; color: var(--ochre); flex: none; }
.wx-now__temp { font-size: 58px; font-weight: 800; line-height: 1; }
.wx-now__label { font-size: 18px; opacity: .95; margin-top: 4px; }
.wx-now__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.wx-now__grid div { text-align: center; background: rgba(255,255,255,.12); border-radius: 12px; padding: 10px 4px; }
.wx-now__grid svg { width: 24px; height: 24px; display: block; margin: 0 auto 4px; }
.wx-now__grid b { display: block; font-size: 20px; }
.wx-now__grid span { font-size: 13px; opacity: .85; }

.wx-alert { display: flex; gap: 12px; align-items: flex-start; margin: 0 var(--sp-4) 14px; padding: 14px; border-radius: var(--radius); font-weight: 600; }
.wx-alert svg { width: 28px; height: 28px; flex: none; }
.wx-alert--info { background: var(--green-100); color: var(--green-900); }
.wx-alert--warn { background: var(--amber-50); color: var(--amber-700); border: 2px solid #EED9B4; }

.wx-days { display: flex; flex-direction: column; gap: 8px; padding: 0 var(--sp-4); }
.wx-day { display: grid; grid-template-columns: 52px 44px 1fr auto; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 2px solid var(--ink-200); }
.wx-day.is-today { border-color: var(--green-500); background: var(--green-50); }
.wx-day__name { font-weight: 800; font-size: 17px; }
.wx-day svg { width: 36px; height: 36px; color: var(--green-700); }
.wx-day--rain svg { color: #3F6E8E; }
.wx-day--storm svg { color: var(--amber-700); }
.wx-day--sun svg { color: var(--amber-500); }
.wx-day__rain { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--ink-700); }
.wx-day__rain i { display: inline-block; height: 8px; width: 60px; border-radius: 4px; background: var(--ink-200); position: relative; overflow: hidden; }
.wx-day__rain i b { position: absolute; left: 0; top: 0; bottom: 0; background: #3F6E8E; }
.wx-day__temps { font-weight: 700; font-size: 17px; }
.wx-day__temps small { color: var(--ink-500); font-weight: 500; font-size: 15px; }
.wx-trend { margin: 14px var(--sp-4) 0; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--ink-200); display: flex; gap: 12px; align-items: flex-start; font-weight: 600; color: var(--ink-700); }
.wx-trend svg { width: 26px; height: 26px; color: var(--green-700); flex: none; }
.zone-switch { display: flex; gap: 8px; padding: 0 var(--sp-4) 14px; }
.zone-switch button { flex: 1; min-height: 48px; border-radius: 999px; border: 2px solid var(--ink-200); background: var(--surface); font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.zone-switch button svg { width: 20px; height: 20px; }
.zone-switch button.is-active { background: var(--green-700); border-color: var(--green-700); color: #fff; }

/* ---------- 16. Annuaire / fiche acteur ---------- */
.search-bar { padding: 0 var(--sp-4) 10px; }
.actor { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--ink-200); width: 100%; text-align: left; }
.actor:active { border-color: var(--green-500); }
.actor__avatar { width: 56px; height: 56px; border-radius: 14px; background: var(--green-50); color: var(--green-700); display: grid; place-items: center; flex: none; }
.actor__avatar svg { width: 30px; height: 30px; }
.actor__body { flex: 1; min-width: 0; }
.actor__name { font-weight: 700; font-size: 17px; margin: 0 0 2px; line-height: 1.25; }
.actor__meta { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--ink-500); }
.actor__meta svg { width: 16px; height: 16px; }
.actor__crops { display: flex; gap: 4px; margin-top: 6px; }
.actor__crops img { width: 24px; height: 24px; border-radius: 6px; }
.actor__call { width: 52px; height: 52px; border-radius: 50%; background: var(--green-700); color: #fff; display: grid; place-items: center; flex: none; border: 0; }
.actor__call svg { width: 26px; height: 26px; }

.fiche-hero { text-align: center; padding: 10px var(--sp-4) 14px; }
.fiche-hero .actor__avatar { width: 88px; height: 88px; margin: 0 auto 12px; border-radius: 24px; }
.fiche-hero .actor__avatar svg { width: 46px; height: 46px; }
.fiche-hero h1 { font-size: var(--fs-lg); font-weight: 800; margin: 0 0 4px; }
.fiche-hero p { margin: 0; color: var(--ink-500); font-size: 16px; }
.fiche-cat { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--green-50); color: var(--green-800); font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.fiche-cat svg { width: 18px; height: 18px; }
.fiche-block { margin: 0 var(--sp-4) 12px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--ink-200); }
.fiche-block h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-500); margin: 0 0 8px; }
.fiche-block p { margin: 0; font-size: 17px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { padding: 6px 12px; border-radius: 999px; background: var(--green-50); color: var(--green-900); font-weight: 600; font-size: 15px; }
.crops-row { display: flex; gap: 10px; }
.crops-row img { width: 48px; height: 48px; border-radius: 12px; }
.fiche-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px var(--sp-4) 12px; }
.fiche-actions .btn { width: auto; flex-direction: column; gap: 6px; min-height: 84px; font-size: 16px; }
.fiche-actions .btn svg { width: 30px; height: 30px; }

/* ---------- 17. Carte simulée ---------- */
.map-wrap { position: relative; height: calc(100% - 0px); min-height: 520px; }
.map-canvas { position: absolute; inset: 0; background: #E9EFE3; overflow: hidden; }
.map-canvas svg { width: 100%; height: 100%; display: block; }
.map-marker { cursor: pointer; }
.map-marker circle.halo { fill: rgba(27,107,58,.18); }
.map-marker.is-active circle.halo { fill: rgba(194,124,26,.3); }
.map-marker.is-active .pinbody { fill: var(--amber-500); }
.map-marker.is-dim { opacity: .25; }
.map-me circle { fill: #2C6EA8; stroke: #fff; stroke-width: .8; }
.map-me .pulse { fill: rgba(44,110,168,.25); animation: pulse 2s ease-out infinite; }
@keyframes pulse { 0% { r: 2.5; opacity: .9; } 100% { r: 9; opacity: 0; } }
.map-top { position: absolute; top: 10px; left: 12px; right: 12px; z-index: 2; display: flex; flex-direction: column; gap: 8px; }
.map-top .input-wrap .input { box-shadow: var(--shadow); border-color: transparent; min-height: 54px; }
.map-top .chips { padding-bottom: 0; }
.map-top .chip { box-shadow: var(--shadow); border-color: transparent; }
.map-fabs { position: absolute; right: 12px; bottom: 16px; z-index: 2; display: flex; flex-direction: column; gap: 10px; }
.fab { width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--green-800); }
.fab svg { width: 26px; height: 26px; }
.map-legend { position: absolute; left: 12px; bottom: 16px; z-index: 2; background: rgba(255,255,255,.95); border-radius: 12px; padding: 8px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.map-legend span { display: flex; align-items: center; gap: 8px; }
.map-legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.map-zone { position: absolute; left: 12px; bottom: 16px; z-index: 2; background: rgba(255,255,255,.95); border-radius: 12px; padding: 10px 14px; font-size: 14px; box-shadow: var(--shadow); max-width: 240px; }
.map-zone b { display: block; font-size: 16px; margin-bottom: 4px; }
.map-zone span { color: var(--ink-700); }

/* Feuille inférieure */
.sheet-backdrop { position: absolute; inset: 0; background: rgba(22,32,27,.45); z-index: 20; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 21;
  background: var(--surface); border-radius: 24px 24px 0 0; padding: 12px 16px 24px;
  max-height: 80%; overflow-y: auto; box-shadow: 0 -8px 30px rgba(0,0,0,.18);
  animation: sheet-in .22s ease-out;
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet__handle { width: 44px; height: 5px; border-radius: 3px; background: var(--ink-300); margin: 0 auto 14px; }
.sheet__title { font-size: 20px; font-weight: 800; margin: 0 0 4px; }
.sheet__close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; background: transparent; border-radius: 50%; display: grid; place-items: center; }
.sheet__close svg { width: 24px; height: 24px; }
.sheet p { margin: 0 0 12px; color: var(--ink-700); }
.sheet .btn-row { margin-top: 12px; }

/* ---------- 18. Profil / Hors connexion / Synchronisation ---------- */
.profile-head { text-align: center; padding: 10px var(--sp-4) 16px; }
.profile-head .hello__avatar { width: 84px; height: 84px; font-size: 34px; margin: 0 auto 10px; }
.profile-head h1 { margin: 0; font-size: var(--fs-lg); }
.profile-head p { margin: 4px 0 0; color: var(--ink-500); }

.sync-card { margin: 0 var(--sp-4) 14px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--ink-200); }
.sync-card--pending { border-color: #EED9B4; background: var(--amber-50); }
.sync-card--ok { border-color: var(--green-200); background: var(--green-50); }
.sync-card--error { border-color: #F1C9C5; background: var(--red-50); }
.sync-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.sync-card__head svg { width: 34px; height: 34px; flex: none; }
.sync-card--pending .sync-card__head svg { color: var(--amber-700); }
.sync-card--ok .sync-card__head svg { color: var(--green-700); }
.sync-card--error .sync-card__head svg { color: var(--red-700); }
.sync-card__title { font-weight: 800; font-size: 19px; margin: 0; }
.sync-card__sub { color: var(--ink-700); font-size: 15px; margin: 0; }
.sync-card .btn { margin-top: 12px; }
.sync-card .progress { margin-top: 12px; }
.sync-card__step { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-weight: 600; font-size: 16px; }
.sync-card__step .spinner { border-color: var(--green-200); border-top-color: var(--green-700); }
.sync-card__step svg { width: 22px; height: 22px; color: var(--green-700); }

.queue { display: flex; flex-direction: column; gap: 8px; padding: 0 var(--sp-4); }
.queue__item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 2px solid var(--ink-200); }
.queue__icon { width: 42px; height: 42px; border-radius: 10px; background: var(--green-50); color: var(--green-700); display: grid; place-items: center; flex: none; }
.queue__icon svg { width: 24px; height: 24px; }
.queue__body { flex: 1; min-width: 0; }
.queue__label { font-weight: 700; font-size: 16px; margin: 0; }
.queue__meta { font-size: 14px; color: var(--ink-500); margin: 0; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge svg { width: 14px; height: 14px; }
.badge--pending { background: var(--amber-50); color: var(--amber-700); }
.badge--synced { background: var(--green-100); color: var(--green-900); }
.badge--syncing { background: var(--green-50); color: var(--green-700); }
.badge--error { background: var(--red-50); color: var(--red-700); }

.empty { text-align: center; padding: 30px 20px; color: var(--ink-500); }
.empty svg { width: 64px; height: 64px; color: var(--ink-300); margin-bottom: 10px; }
.empty p { margin: 0 0 12px; font-size: 17px; }

.menu { display: flex; flex-direction: column; gap: 8px; padding: 0 var(--sp-4); }
.menu .row { min-height: 64px; }

/* ---------- 19. Barre d'onglets ---------- */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--tabbar-h); z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--ink-200);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ink-500); }
.tab__icon { width: 28px; height: 28px; }
.tab.is-active { color: var(--green-700); }
.tab.is-active .tab__icon { transform: translateY(-1px); }
.tab.is-active::before { content: ""; position: absolute; top: 0; width: 36px; height: 3px; border-radius: 0 0 3px 3px; background: var(--green-700); }
.tab { position: relative; }
.tabbar.is-hidden { display: none; }

/* ---------- 20. Toast (feedback immédiat) ---------- */
.toast {
  position: absolute; left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + 14px); z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 14px; background: var(--ink-900); color: #fff; font-weight: 700; font-size: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.is-visible { opacity: 1; transform: none; }
.toast svg { width: 26px; height: 26px; flex: none; }
.toast--success { background: var(--green-700); }
.toast--warn { background: var(--amber-700); }
.toast--error { background: var(--red-700); }

/* ---------- 21. Notifications ---------- */
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--ink-200); }
.notif.is-new { border-color: var(--green-200); background: var(--green-50); }
.notif__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--green-100); color: var(--green-700); display: grid; place-items: center; flex: none; }
.notif__icon svg { width: 24px; height: 24px; }
.notif__title { font-weight: 700; margin: 0 0 2px; font-size: 16px; }
.notif__text { margin: 0; color: var(--ink-700); font-size: 15px; }
.notif__time { font-size: 13px; color: var(--ink-500); margin-top: 4px; display: block; }

/* Bouton retour en haut / signal réseau dans les listes */
.inline-offline { display: flex; align-items: center; gap: 10px; margin: 0 var(--sp-4) 12px; padding: 12px 14px; border-radius: 12px; background: var(--ink-100); color: var(--ink-700); font-weight: 600; font-size: 15px; }
.inline-offline svg { width: 22px; height: 22px; flex: none; }

/* Réduction des animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
