/* Les couleurs, arrondis et ombres de l'appli sont réglés ici, et nulle part ailleurs (voir DESIGN.md) */
:root {
  color-scheme: light;
  /* le vert de la ferme, et le blé du trait de marge du logo */
  --green: #2f6b3a;
  --green-dark: #23502c;
  --green-light: #e6f0e3;
  --accent: #c9a227;
  --accent-soft: #f1d36b;
  /* papier et encre */
  --bg: #f4f2ea;
  --card: #ffffff;
  --card-soft: #fbfaf6;
  --text: #1f2a1f;
  --muted: #5c665a;
  --border: #dcd9cc;
  --border-strong: #a8a494;
  --track: #e8e4d6;
  /* états : fait, attention, erreur, information */
  --ok-bg: #f3f9f1;
  --ok-border: #9cc59a;
  --warn-bg: #fff3d6;
  --warn-border: #e6c15a;
  --warn-text: #7a4b00;
  --danger: #b23a2c;
  --danger-bg: #f8e7e3;
  --info-bg: #eef4fb;
  /* deux arrondis (boutons et champs, cartes et panneaux) et deux ombres (posé sur la carte, menu ouvert) */
  --radius-s: 8px;
  --radius: 12px;
  --shadow-float: 0 2px 10px rgba(20, 30, 20, .25);
  --shadow-pop: 0 8px 24px rgba(20, 30, 20, .2);
  --topbar-h: 56px;
  --panel-w: 430px;
  --tabs-w: 168px;
  --tabs-h: 58px;
  --sheet-min: 96px;
}

* { box-sizing: border-box; }
/* fond vert : iOS s'en sert pour colorer la barre d'état (heure, batterie) de l'app installée */
html, body { margin: 0; height: 100%; overscroll-behavior: none; background: var(--green); }
body {
  /* police du téléphone ou de l'ordinateur : rien à télécharger au champ, et très lisible en plein soleil */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.4;
  color: var(--text);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, select, summary, label, [role="button"] { touch-action: manipulation; }
.hidden { display: none !important; }
/* Clavier : on voit toujours où l'on est (liseré blanc + vert, lisible sur le vert comme sur le papier) */
:focus-visible { outline: 2px solid var(--green-dark); outline-offset: 2px; box-shadow: 0 0 0 2px #fff; }
:focus:not(:focus-visible) { outline: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: none; }
/* les chiffres s'alignent en colonnes (surfaces, loyers, doses) */
table, .stat b, .ha, .lc-etat, .fm-montant, .ch-total, .az-chiffre, .computed { font-variant-numeric: tabular-nums; }
h1, h2, h3, .empty b { text-wrap: balance; }
/* Animations coupées si le téléphone le demande (Réglages › Accessibilité › Réduire les animations) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Barre du haut ---------- */
.topbar {
  position: sticky; top: 0;
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 10px 0;
  display: flex; align-items: center; gap: 10px;
  background: var(--green); color: #fff;
  z-index: 1000;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; }
.brand img { border-radius: var(--radius-s); }
.search-btn { flex: none; }
.campagne { margin-left: auto; }
.search {
  position: absolute; left: 10px; right: 10px; top: calc(env(safe-area-inset-top) + (var(--topbar-h) - 38px) / 2);
  max-width: 520px; z-index: 2;
}
.search input {
  width: 100%; height: 38px; padding: 0 44px 0 12px;
  border: 0; border-radius: var(--radius-s); background: #fff;
  color: var(--text); font-size: 16px;
}
.search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-close {
  position: absolute; right: 0; top: 0; width: 42px; height: 38px; border: 0; background: none;
  color: var(--muted); font-size: 16px; cursor: pointer; display: grid; place-items: center;
}
.search-results {
  position: absolute; top: 42px; left: 0; right: 0; margin: 0; padding: 4px 0;
  list-style: none; background: #fff; color: var(--text);
  border-radius: var(--radius-s); box-shadow: var(--shadow-pop); max-height: 60vh; overflow: auto;
}
.search-results li { padding: 10px 12px; cursor: pointer; }
.search-results li:hover, .search-results li:focus { background: var(--green-light); outline: none; }
.search-results small { color: var(--muted); display: block; }
.campagne { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.campagne select {
  height: 38px; border: 0; border-radius: var(--radius-s); padding: 0 8px;
  background: rgba(255,255,255,.95); color: var(--text); font-weight: 700; font-size: 16px;
}
.icon-btn {
  width: 40px; height: 40px; border: 0; border-radius: var(--radius-s); padding: 0; flex: none;
  display: grid; place-items: center;
  background: rgba(255,255,255,.14); color: #fff; font-size: 18px; cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,.24); }
.icon-btn:active { background: rgba(255,255,255,.32); }
.icon-btn .ic { width: 22px; height: 22px; }
/* ---------- Réglages (page entière) ---------- */
.reglages { position: fixed; inset: 0; z-index: 3000; background: var(--bg); display: flex; flex-direction: column; }
.reglages-top {
  display: flex; align-items: center; gap: 8px; background: var(--green); color: #fff; flex: none;
  height: calc(var(--topbar-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 10px 0;
}
.reglages-top h2 { margin: 0; font-size: 17px; }
.reglages-retour {
  display: inline-flex; align-items: center; gap: 2px;
  border: 0; background: rgba(255,255,255,.14); color: #fff; border-radius: var(--radius-s);
  height: 40px; padding: 0 12px 0 6px; font-weight: 600; font-size: 15px; cursor: pointer;
}
.reglages-retour:hover { background: rgba(255,255,255,.24); }
.reglages-corps {
  flex: 1; overflow-y: auto; padding: 14px 14px calc(30px + env(safe-area-inset-bottom));
  width: 100%; max-width: 560px; margin: 0 auto;
}
.reglages-groupe { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; margin-bottom: 14px; }
.reglages-groupe h3 { margin: 8px 10px 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.reglages-groupe > button > .ic, .reglages-lien > .ic { color: var(--green); margin-right: 6px; }
.reglages-groupe > .danger-text > .ic { color: inherit; }
.reglages-groupe .field, .reglages-groupe p { margin-left: 10px; margin-right: 10px; }
.reglages-groupe > button, .reglages-lien {
  display: block; width: 100%; text-align: left; padding: 13px 10px; border: 0; border-top: 1px solid var(--border);
  background: none; cursor: pointer; font-size: 15px; color: var(--text); text-decoration: none;
}
.reglages-groupe > h3 + button { border-top: 0; }
.reglages-groupe > .reglages-lien:first-child { border-top: 0; }
.reglages-groupe > button:hover, .reglages-lien:hover { background: var(--green-light); }
.reglages-groupe > button:focus-visible, .reglages-lien:focus-visible { outline-offset: -2px; box-shadow: none; border-radius: var(--radius-s); }
.reglages .danger-text { color: var(--danger); }
.reglages .choix { position: relative; padding-right: 40px; }
.reglages .choix b { display: block; font-weight: 600; }
.reglages .choix.active b { color: var(--green-dark); }
.reglages .choix small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; line-height: 1.35; }
.reglages .choix.active::after {
  content: '✓'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--green); font-weight: 700; font-size: 18px;
}

/* ---------- Mise en page ---------- */
.layout {
  position: relative;
  height: calc(100% - var(--topbar-h) - env(safe-area-inset-top));
  display: grid; grid-template-columns: var(--tabs-w) var(--panel-w) 1fr;
  grid-template-areas: "tabs panel map";
}
/* onglet Carte sur ordinateur : la carte prend toute la place */
body[data-tab="carte"] .layout { grid-template-columns: var(--tabs-w) 1fr; grid-template-areas: "tabs map"; }
body[data-tab="carte"] .panel { display: none; }
#map-wrap { grid-area: map; position: relative; height: 100%; min-width: 0; }

/* ---------- Onglets ---------- */
.tabs {
  grid-area: tabs; display: flex; flex-direction: column; gap: 2px; padding: 10px 8px;
  background: var(--card); border-right: 1px solid var(--border); overflow-y: auto; min-height: 0;
}
.tabs button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--radius-s);
  background: none; color: var(--text); font-size: 15px; font-weight: 600; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tabs button:hover { background: var(--green-light); }
.tabs button.active { background: var(--green); color: #fff; }
.tabs button:focus-visible { outline-offset: -2px; box-shadow: none; }
.tab-em { display: grid; place-items: center; width: 24px; font-size: 18px; color: var(--green); }
.tabs button.active .tab-em { color: inherit; }
.mobile-only { display: none !important; }
#map { position: absolute; inset: 0; background: #ddd; }
/* menu des calques + bouton GPS, au-dessus de la carte quel que soit le moteur */
#map-ui {
  position: absolute; top: 10px; right: 10px; z-index: 800; pointer-events: none;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
#map-ui > * { pointer-events: auto; }
.panel {
  grid-area: panel; position: relative; background: var(--bg); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; min-height: 0;
}
.panel-handle { display: none; }
.panel-content { flex: 1; overflow-y: auto; padding: 14px 14px 40px; -webkit-overflow-scrolling: touch; }

/* Page élargie (ordinateur) : les listes se mettent côte à côte, autant de colonnes que la place le permet */
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); column-gap: 12px; }
.grille > * { min-width: 0; }
.plist.grille { column-gap: 8px; }
/* … et les pages faites de rubriques (Accueil, Documents, Listes) passent sur deux colonnes dès 852 px */
.deux-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 0 12px; align-items: start; }
.deux-col > * { min-width: 0; }

/* Téléphone : panneau en bas de l'écran */
@media (max-width: 899px) {
  :root { --topbar-h: 52px; }
  .brand { font-size: 16px; }
  .tabs .mobile-only { display: flex !important; }
  .btn.mobile-only { display: inline-flex !important; }
  .card.mobile-only, div.mobile-only { display: block !important; }
  .desk-only { display: none !important; }
  /* onglets en bas de l'écran, comme une appli de téléphone */
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1500; flex-direction: row; gap: 0;
    height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding: 0 0 env(safe-area-inset-bottom);
    border-right: 0; border-top: 1px solid var(--border); overflow: hidden;
  }
  .tabs button {
    flex: 1; flex-direction: column; justify-content: center; gap: 1px; padding: 4px 0 2px; border-radius: 0;
    font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; min-width: 0;
  }
  .tabs button:hover { background: none; }
  .tabs button.active { background: none; color: var(--green-dark); font-weight: 700; }
  .tabs button.active .tab-em { background: var(--green-light); border-radius: 99px; color: var(--green-dark); }
  .tab-em { font-size: 19px; width: 52px; height: 28px; color: inherit; }
  .campagne span { display: none; }
  .topbar { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .campagne select { padding: 0 4px; font-size: 15px; }
  .layout { display: block; height: calc(100% - var(--topbar-h) - env(safe-area-inset-top) - var(--tabs-h) - env(safe-area-inset-bottom)); }
  body[data-tab="carte"] .panel { display: flex; }
  /* la carte s'arrête au-dessus du panneau replié : échelle et crédits restent visibles */
  #map-wrap { position: absolute; top: 0; left: 0; right: 0; bottom: calc(var(--sheet-min) - 16px); height: auto; z-index: 0; }
  .leaflet-control-zoom, .maplibregl-ctrl-zoom-in, .maplibregl-ctrl-zoom-out { display: none !important; }
  .panel {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 900;
    height: 62%; border-left: 0; border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,.18);
    transition: height .25s ease;
  }
  .panel.collapsed { height: var(--sheet-min); }
  .panel.expanded { height: 92%; }
  .panel.dragging { transition: none; }
  .panel-handle {
    display: flex; justify-content: center; align-items: center;
    height: 30px; border: 0; background: none; cursor: grab; flex: none;
    touch-action: none; -webkit-tap-highlight-color: transparent;
  }
  /* pas de « tirer pour rafraîchir » quand on fait glisser le panneau vers le bas */
  .panel-content { overscroll-behavior: contain; }
  .year-nav { touch-action: pan-y; }
  .panel-handle span { width: 44px; height: 5px; border-radius: 3px; background: var(--border-strong); }
  .panel-handle:focus-visible { outline-offset: -4px; box-shadow: none; }
  .panel-content { padding-top: 2px; padding-bottom: 40px; }
}

/* ---------- Contrôles de carte ---------- */
.map-ctrl {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-float);
  padding: 8px; font-size: 14px; min-width: 170px;
}
.seg { display: flex; border: 1px solid var(--border); border-radius: var(--radius-s); overflow: hidden; margin-bottom: 8px; }
.seg button { flex: 1; border: 0; background: #fff; padding: 8px 6px; min-height: 36px; cursor: pointer; font-size: 13px; }
.seg button:focus-visible { outline-offset: -2px; box-shadow: none; }
.seg button + button { border-left: 1px solid var(--border); }
.seg.disabled { opacity: .45; }
.ctrl-title { font-size: 12px; font-weight: 700; color: var(--muted); margin: 2px 2px 4px; }
.ctrl-sep { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 6px; }
.map-ctrl .ctrl-check { justify-content: space-between; gap: 10px; padding: 6px 2px; }
/* Interrupteur on/off façon iPhone (case à cocher redessinée) */
.switch {
  flex: none; position: relative; width: 42px; height: 24px; margin: 0; border-radius: 99px;
  appearance: none; -webkit-appearance: none; background: var(--border-strong); cursor: pointer; transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); transition: transform .2s;
}
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(18px); }
.ctrl-check small { display: block; color: var(--muted); font-size: 11px; line-height: 1.3; }
.popup-rpg { margin: -4px 0 10px; padding: 6px 8px; border-radius: var(--radius-s); background: var(--green-light); font-size: 13px; }
.popup-rpg .pac-hist { min-height: 0; padding: 0; font-size: 13px; font-weight: 600; white-space: nowrap; }
.tag-bio {
  display: inline-block; padding: 0 6px; border-radius: 99px; background: #3b8a2e; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 17px; vertical-align: 1px;
}
.popup-pac { max-height: 220px; overflow-y: auto; margin: -4px 0 10px; }
.popup-pac table.simple { font-size: 12px; }
.popup-pac table.simple td { padding: 4px 3px; }
.map-ctrl { width: 250px; }
.seg button.active { background: var(--green); color: #fff; font-weight: 600; }
.map-ctrl label { display: flex; align-items: center; gap: 8px; padding: 4px 2px; cursor: pointer; }
.map-ctrl input[type=range] { width: 100%; accent-color: var(--green); }
.map-ctrl .opacity { padding: 0 2px 2px; color: var(--muted); font-size: 12px; }
.ctrl-collapse { display: none; }
.locate-btn {
  width: 44px; height: 44px; border: 0; border-radius: var(--radius); background: #fff; padding: 0;
  display: grid; place-items: center; color: var(--text);
  box-shadow: var(--shadow-float); font-size: 19px; cursor: pointer;
}
.locate-btn:active, .ctrl-collapse:active { color: var(--green); }
/* menu des calques replié derrière le bouton 🗺️ (téléphone et ordinateur) */
.map-ctrl.closed .ctrl-body { display: none; }
.map-ctrl.closed { min-width: 0; width: auto; padding: 0; }
.map-ctrl:not(.closed) { max-height: calc(100% - 70px); overflow-y: auto; }
#map-ui { bottom: 10px; }
.ctrl-collapse {
  display: grid; place-items: center; width: 44px; height: 44px; border: 0; padding: 0; background: none;
  color: var(--text); font-size: 19px; cursor: pointer; border-radius: var(--radius);
}
/* ouvert : le même bouton devient la croix qui referme le menu */
.map-ctrl:not(.closed) .ctrl-collapse { width: 36px; height: 32px; margin: -2px -2px 2px auto; font-size: 16px; color: var(--muted); }

.parcel-label {
  background: rgba(255,255,255,.85); border: 0; box-shadow: none; border-radius: 4px;
  padding: 1px 5px; font-size: 11px; font-weight: 600; color: #1f2a1f;
}
.parcel-label::before { display: none; }
.hide-labels .parcel-label { display: none; }

.leaflet-popup-content { margin: 12px 14px; font-size: 14px; }
.maplibregl-popup-content { padding: 12px 14px; font-size: 14px; border-radius: var(--radius); box-shadow: 0 3px 14px rgba(0,0,0,.3); }
.maplibregl-popup-close-button { font-size: 18px; width: 26px; height: 26px; }
.popup-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.popup-sub { color: var(--muted); margin-bottom: 10px; }
[data-add-ilot] { margin-top: 8px; width: 100%; }

/* ---------- Panneau ---------- */
h2 { font-size: 20px; line-height: 1.2; letter-spacing: -.01em; margin: 4px 0 2px; }
h3 { font-size: 15px; line-height: 1.25; margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
/* pictogramme d'un titre de rubrique : vert, le texte reste noir */
h2 > .ic, h3 > .ic, summary > .ic { color: var(--green); }
h2 > .ic { width: 1.1em; height: 1.1em; vertical-align: -.16em; margin-right: 2px; }
/* états : « fait » en vert, « attention » en ocre (toujours accompagnés d'un mot, jamais la couleur seule) */
.ic.i-ok { color: var(--green); }
.ic.i-alerte { color: #a85d00; }
.avert .ic.i-alerte, .btn .ic.i-ok { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border-radius: var(--radius-s);
  border: 1px solid var(--border); background: #fff; cursor: pointer; font-weight: 600;
}
.btn:hover { border-color: var(--border-strong); }
.btn:active { background: var(--green-light); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover, .btn.primary:active { background: var(--green-dark); border-color: var(--green-dark); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.danger:active { background: var(--danger-bg); }
.btn.small { min-height: 34px; padding: 0 10px; font-size: 13px; }
.btn.link { border: 0; background: none; color: var(--green-dark); padding: 0 4px; }
.btn.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn.link:active { background: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn > .ic { margin-left: -2px; }
/* Au doigt : des cibles plus grandes (téléphone, tablette) */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn.small { min-height: 40px; padding: 0 12px; font-size: 14px; }
  .btn.link.small { min-height: 36px; }
  .icon-btn { width: 44px; height: 44px; }
  .seg button { min-height: 40px; }
}

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; margin-bottom: 12px;
}
/* Les chiffres de la campagne : un seul bandeau, pas trois cartes */
.summary { display: flex; margin: 10px 0 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.summary .stat { flex: 1; min-width: 0; padding: 10px 12px; border-left: 1px solid var(--border); }
.summary .stat:first-child { border-left: 0; }
.stat b { display: block; font-size: 22px; line-height: 1.15; letter-spacing: -.01em; }
.stat span { color: var(--muted); font-size: 13px; }

.empty {
  text-align: center; padding: 22px 14px; color: var(--muted); text-wrap: pretty;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); margin: 10px 0;
}
.empty b { color: var(--text); display: block; margin-bottom: 6px; font-size: 16px; }

.plist { list-style: none; margin: 0 0 12px; padding: 0; }
.plist li {
  display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
}
.plist li:hover { border-color: var(--green); }
.plist li:active { background: var(--green-light); }
.plist .dot { width: 14px; height: 14px; border-radius: 4px; flex: none; border: 1px solid rgba(0,0,0,.2); }
.plist .info { flex: 1; min-width: 0; }
.plist .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plist .meta { color: var(--muted); font-size: 13px; }
.plist .ha { font-weight: 600; white-space: nowrap; }

table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple th, table.simple td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--border); }
table.simple th { color: var(--muted); font-weight: 600; font-size: 12px; }
table.simple td.num, table.simple th.num { text-align: right; white-space: nowrap; }
table.simple tr.clickable { cursor: pointer; }
table.simple tr.clickable:hover td { background: var(--green-light); }
table.simple tr.total td { font-weight: 700; border-bottom: 0; }

/* Formulaires */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea, .row input, .row select {
  width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-s); background: #fff; font-size: 16px;
}
.field textarea { min-height: 70px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .row input:focus, .row select:focus {
  outline: 2px solid var(--green); outline-offset: -1px; border-color: var(--green);
}
/* align-items: end → les champs restent alignés même si une étiquette passe sur deux lignes */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; align-items: end; }
.grid3 { display: grid; grid-template-columns: minmax(145px, 1.5fr) 1fr 1fr; gap: 0 10px; align-items: end; }

.lines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.line {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius-s); padding: 10px 40px 2px 10px;
  background: var(--card-soft);
}
.line .del {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border: 0; border-radius: var(--radius-s);
  background: none; color: var(--danger); font-size: 18px; cursor: pointer;
}
.line .del:hover { background: var(--danger-bg); }
.computed { font-size: 13px; color: var(--green-dark); margin: -4px 0 8px; font-weight: 600; }
.computed:empty { display: none; }

.fiche-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.fiche-head .grow { flex: 1; min-width: 0; }
.name-input {
  width: 100%; font-size: 19px; font-weight: 700; border: 1px solid transparent; border-radius: var(--radius-s);
  padding: 4px 6px; margin-left: -6px; background: transparent;
}
.name-input:hover { border-color: var(--border); }
.name-input:focus { border-color: var(--green); outline: none; background: #fff; }
.ref { color: var(--muted); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.chip { background: var(--green-light); color: var(--green-dark); padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chip > .ic { width: 1.1em; height: 1.1em; vertical-align: -.18em; }

.year-nav {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--green); color: #fff; border-radius: var(--radius); padding: 6px; margin-bottom: 12px;
}
.year-nav button {
  width: 44px; height: 40px; border: 0; border-radius: var(--radius-s); padding: 0; display: grid; place-items: center;
  background: rgba(255,255,255,.14); color: #fff; font-size: 17px; cursor: pointer;
}
.year-nav button:hover { background: rgba(255,255,255,.24); }
.year-nav b { font-size: 18px; font-variant-numeric: tabular-nums; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.back { margin: 0 0 8px -6px; }

.ref-form { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 6px; align-items: end; }
.ref-form .field { margin: 0; }
@media (max-width: 420px) {
  .ref-form { grid-template-columns: 1fr 1fr; }
  .ref-form .field:first-child { grid-column: 1 / -1; }
  .ref-form button { grid-column: 1 / -1; }
}
/* Rubrique repliable : le chevron à droite dit si elle est ouverte */
details > summary {
  cursor: pointer; font-weight: 600; padding: 2px 0; list-style: none;
  display: flex; align-items: center; gap: 6px; min-height: 28px;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::after {
  content: ''; flex: none; width: 8px; height: 8px; margin: -3px 4px 0 auto;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .15s;
}
details[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
details[open] > summary { margin-bottom: 10px; }
details > summary:focus-visible { border-radius: var(--radius-s); }

/* Écran de connexion : des parcelles vues du ciel, et une carte qui dit l'essentiel */
.login {
  position: fixed; inset: 0; z-index: 3000; overflow-y: auto;
  display: flex; flex-direction: column; background: var(--bg);
}
.login-champs { position: relative; flex: 0 0 34vh; min-height: 170px; overflow: hidden; background: #4f7d3c; }
/* taille fixe et centrée : les parcelles gardent la même échelle sur téléphone et sur grand écran */
.login-champs svg {
  position: absolute; left: 50%; top: 50%; transform: translate(calc(-50% - 50px), calc(-50% + 40px)); /* la parcelle surlignée au centre */
  width: calc(max(100%, 1200px) + 100px); height: calc(max(100%, 800px) + 80px); display: block;
}
.login-parcelle {
  fill: rgba(241, 211, 107, .28); stroke: #f1d36b; stroke-width: 5; stroke-linejoin: round;
  stroke-dasharray: 100; stroke-dashoffset: 0; animation: login-trace 1.6s .3s ease-out both;
}
@keyframes login-trace { from { stroke-dashoffset: 100; fill: rgba(241, 211, 107, 0); } }
@media (prefers-reduced-motion: reduce) { .login-parcelle { animation: none; } }
@media (max-height: 700px) { .login-champs { flex-basis: 28vh; min-height: 150px; } }

.login-card {
  position: relative; flex: 1 0 auto; margin-top: -20px;
  background: var(--bg); border-radius: var(--radius) var(--radius) 0 0;
  padding: 26px 22px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
.login-marque { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--green-dark); }
.login-marque img { border-radius: var(--radius-s); }
.login-card h1 { margin: 18px 0 16px; font-size: 28px; line-height: 1.15; letter-spacing: -.01em; color: var(--text); }
.login-points { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; }
.login-points li { display: flex; align-items: center; gap: 12px; font-size: 16px; color: var(--text); }
.login-points svg {
  flex: none; width: 22px; height: 22px; fill: none; stroke: var(--green);
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.google-btn {
  width: 100%; min-height: 52px; gap: 12px; font-size: 16px; border-radius: var(--radius);
  background: var(--text); border-color: var(--text); color: #fff;
}
.google-btn:hover:not(:disabled) { background: #000; }
.google-g { display: inline-flex; padding: 4px; border-radius: 50%; background: #fff; }
.email-btn {
  width: 100%; min-height: 52px; margin-top: 10px; gap: 12px; font-size: 16px; border-radius: var(--radius);
  background: #fff; border-color: var(--border); color: var(--text);
}
.email-btn svg, .login-form svg {
  width: 20px; height: 20px; fill: none; stroke: var(--green); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.login-form { display: grid; gap: 8px; margin-top: 10px; }
.login-form input {
  width: 100%; min-height: 52px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: #fff; font-size: 17px; /* ≥ 16 px : pas de zoom auto sur iPhone */
}
.login-form input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(47, 107, 58, .2); }
.login-form .code-input { text-align: center; font-size: 26px; letter-spacing: .3em; font-variant-numeric: tabular-nums; }
.login-form .code-input::placeholder { color: #c9c6b8; }
.login-form .btn.primary { min-height: 52px; font-size: 16px; border-radius: var(--radius); }
.login-envoye { margin: 0; font-size: 14px; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.login-envoye b { color: var(--text); }
.login-actions { margin: 2px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.lien-btn { border: 0; background: none; padding: 6px 2px; color: var(--green-dark); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.lien-btn:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.essai-btn {
  width: 100%; min-height: 44px; margin-top: 16px; font-size: 16px;
  background: transparent; border: 0; color: var(--green-dark);
}
.essai-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.login-card p.essai-note { margin-top: 0; }
.google-btn:focus-visible, .email-btn:focus-visible, .essai-btn:focus-visible, .lien-btn:focus-visible,
.login-form .btn:focus-visible, .login-liens a:focus-visible { outline: 3px solid #f1d36b; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.login-rassure { margin: 8px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.login-msg { min-height: 20px; margin: 14px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.login-msg:empty { min-height: 0; margin: 0; }
.login-msg.error { color: var(--danger); }
.login-liens { margin: auto 0 0; padding-top: 14px; font-size: 13px; text-align: center; }
.login-liens a { color: var(--muted); }

/* Ordinateur et tablette : les champs en plein écran, la carte posée dessus */
@media (min-width: 760px) {
  .login { display: block; overflow: hidden; }
  .login-champs { position: absolute; inset: 0; min-height: 0; }
  /* la parcelle surlignée à droite du cadre centré */
  .login-champs svg { transform: translate(calc(-50% + 330px), calc(-50% + 40px)); width: calc(max(100%, 1200px) + 680px); }
  .login-card {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 400px; margin: 0; border-radius: var(--radius); padding: 34px 32px 22px;
    max-height: calc(100vh - 40px); overflow-y: auto;
    box-shadow: 0 20px 60px rgba(20, 40, 20, .35);
  }
  .login-card h1 { font-size: 32px; }
  .login-liens { margin-top: 0; }
}

/* Compte et synchronisation */
.menu-account { padding: 4px 10px 10px; font-size: 13px; color: var(--muted); }
.menu-account b { display: block; color: var(--text); font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.sync-btn { position: relative; }
.sync-btn[data-state="sync"] .ic { animation: tourne 1.2s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.sync-btn[data-state="error"]::after {
  content: ''; position: absolute; top: 6px; right: 6px; width: 9px; height: 9px;
  border-radius: 50%; background: #ff9f1c; border: 2px solid var(--green);
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: #1f2a1f; color: #fff; padding: 10px 16px; border-radius: var(--radius-s); font-size: 14px; line-height: 1.35;
  box-shadow: var(--shadow-pop);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 3500; max-width: min(90vw, 460px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 899px) { .toast { bottom: auto; top: calc(var(--topbar-h) + env(safe-area-inset-top) + 10px); } }

/* ---------- Champs (plusieurs parcelles) ---------- */
.add-banner {
  position: absolute; bottom: 28px; left: 10px; right: 10px; z-index: 850; display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-float); padding: 8px 10px; font-size: 14px;
}
.add-banner span { flex: 1; }
.add-banner:has(.edit-btns) { flex-wrap: wrap; }
.edit-btns { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.chip.chip-dessin { background: var(--danger-bg); color: var(--danger); }
/* outils du contour : deux colonnes régulières plutôt que des boutons de toutes les largeurs */
.part-btns.contour-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: -4px 0 12px; }
.contour-btns .btn { justify-content: flex-start; text-align: left; line-height: 1.2; padding-top: 6px; padding-bottom: 6px; }
.edition-contour path.parcelle { pointer-events: none !important; }
/* Couper un champ / bande le long d'un bord */
.decoupe-label { background: none; border: 0; }
.decoupe-label span {
  display: inline-block; transform: translate(-50%, -50%); white-space: nowrap; color: #fff; font-weight: 700;
  font-size: 13px; padding: 2px 7px; border-radius: 99px; box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.dec-pastille { white-space: nowrap; }
.dec-pastille::before {
  content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c);
  margin-right: 4px; vertical-align: -1px;
}
.dec-reglages { display: flex; flex-wrap: wrap; gap: 6px 14px; width: 100%; }
.dec-reglages label { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.dec-reglages input { width: 76px; padding: 5px 7px; font-size: 16px; border: 1px solid #ccc; border-radius: var(--radius-s); }
.add-banner:has([data-dec]) { z-index: 1001; } /* au-dessus des boutons de zoom */
.add-banner:has([data-dec]) > span { flex-basis: 100%; }
.add-banner.hidden { display: none; }
.part-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ---------- Listes partagées ---------- */
.share-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btns a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.plist .liste-dot { background: none; border: 0; width: auto; height: auto; display: grid; place-items: center; color: var(--green); font-size: 18px; }
.liste-champ.fait { border-color: var(--ok-border); background: var(--ok-bg); }
.lc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.lc-head .grow { flex: 1; min-width: 0; }
.lc-head .num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.lc-etat { font-size: 13px; font-weight: 600; text-align: right; white-space: nowrap; }
.lc-etat small { font-weight: 400; color: var(--muted); }
/* Chantier à déléguer : le travail demandé, puis « en attente » ou « fait le … » */
.dl-resume { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0 0 10px; font-size: 14px; }
.dl-resume dt { color: var(--muted); }
.dl-resume dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.dl-etat { margin: 12px 0 8px; padding: 8px 10px; border-radius: var(--radius-s); background: var(--warn-bg); color: var(--warn-text); font-size: 14px; }
.dl-etat.ok { background: var(--ok-bg); border: 1px solid var(--ok-border); color: var(--text); }
.dl-valider { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.dl-valider .field { flex: 1; min-width: 150px; margin: 0; }
.dl-note { margin: 0 0 8px; padding: 8px 10px; border-radius: var(--radius-s); background: var(--bg); white-space: pre-wrap; font-size: 14px; }
.dl-fait { color: var(--green); font-weight: 600; }
.recu-afaire { color: var(--warn-text); font-weight: 600; }
.recu-titre { font-size: 13px; color: var(--muted); font-weight: 600; margin: 10px 0 6px; text-transform: uppercase; letter-spacing: .03em; }
.plist li.recu-chantier { border-left: 4px solid var(--orange); }
.recu-nb { font-size: 12px; font-weight: 600; color: #fff; background: var(--orange); border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: middle; }
/* Travaux faits pour les autres : un bloc par personne */
.recap-pers { border: 1px solid var(--border); border-radius: var(--radius-s); margin-bottom: 10px; overflow: hidden; }
.recap-tete { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 10px; background: var(--green-light); }
.recap-tete span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.recap-lignes { list-style: none; margin: 0; padding: 0; }
.recap-lignes li { display: flex; align-items: baseline; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--border); cursor: pointer; }
.recap-lignes li:hover { background: var(--bg); }
.recap-lignes .grow { flex: 1; min-width: 0; }
.recap-lignes small { display: block; color: var(--muted); font-size: 12px; }
.recap-date { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.recap-lignes .ha { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Fermages ---------- */
.fm-ligne { padding: 10px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.fm-ligne:first-of-type { border-top: 0; }
.fm-tout { margin: 4px 0 6px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.fm-tout select { width: 100%; }
.fm-tout + .fm-ligne { border-top: 0; }
.fm-tete { display: flex; align-items: center; gap: 8px; }
.fm-ref { font-size: 14px; flex: 1; min-width: 0; }
.fm-ligne select, .fm-loyer input, .fm-loyer select {
  height: 38px; border: 1px solid var(--border); border-radius: var(--radius-s); padding: 0 8px; background: #fff; font-size: 15px;
}
.fm-loyer { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fm-loyer input { width: 90px; }
.fm-montant { font-weight: 600; font-size: 14px; }
.clickable-card { cursor: pointer; }
.clickable-card:hover { border-color: var(--green); }
.fermage-bailleur.paye { border-color: var(--ok-border); background: var(--ok-bg); }
.fermage-bailleur table.simple { margin-top: 6px; }
.fb-head { margin-bottom: 0; }
.fermage-bailleur[hidden] { display: none; }
.fb-outils { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.fb-outils > .btn { min-height: 42px; white-space: nowrap; }
.fb-cherche { position: relative; display: block; flex: 1 1 220px; min-width: 0; }
.fb-cherche .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted, #6b6b60); pointer-events: none; }
.fb-cherche input { width: 100%; min-height: 42px; padding: 8px 10px 8px 36px; border: 1px solid var(--border); border-radius: var(--radius-s); background: #fff; font-size: 16px; }
.fb-cherche input:focus { outline: 2px solid var(--green); outline-offset: -1px; border-color: var(--green); }
/* « ＋ Ajouter » des échanges : un bouton qui ouvre directement la liste des personnes (sélecteur invisible posé dessus) */
.ec-ajouter { position: relative; overflow: hidden; }
.ec-ajouter select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.ec-ajouter:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
.ec-carte[hidden] { display: none; }
.fb-chevron { font-size: 22px; color: var(--muted); line-height: 1; }
.fb-actions { margin: 0 0 12px; }
.fm-plus { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--muted); }
.fm-plus label { display: flex; align-items: center; gap: 6px; }
.fm-plus input:not([type]) , .fm-plus input[inputmode] {
  height: 32px; border: 1px solid var(--border); border-radius: var(--radius-s); padding: 0 8px; background: #fff; font-size: 14px; color: var(--text, #222);
}
.fm-plus [data-fm-lieudit] { width: 140px; }
.fm-ha { width: 80px !important; }
.fm-fixe { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.fm-co-titre { margin-top: 2px; }
.fm-co { display: flex; flex-direction: column; gap: 6px; padding-left: 10px; border-left: 3px solid #d7e6d3; }
.fm-co select, .fm-co input { height: 36px; border: 1px solid var(--border); border-radius: var(--radius-s); padding: 0 8px; background: #fff; font-size: 15px; }
.fm-co-add { align-self: flex-start; padding-left: 0; }
/* À moi / Louée / Échangée : pastilles rondes, puis « à qui » sur une ligne */
.fm-statut { display: flex; gap: 6px; flex-wrap: wrap; }
.fm-statut button {
  min-height: 38px; padding: 0 16px; border: 1px solid var(--border); border-radius: 99px;
  background: #fff; color: var(--text); font-size: 14px; cursor: pointer;
}
.fm-statut button.on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.fm-statut button:focus-visible, .fm-qui:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
.fm-qui {
  display: flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 6px 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-s); background: #fff; cursor: pointer;
}
.fm-qui > span { color: var(--muted); font-size: 14px; }
.fm-qui select { flex: 1; min-width: 0; height: 40px; border: 0; padding: 0 4px; background: transparent; font-weight: 600; outline: none; }
.fm-ech { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: var(--radius-s); background: var(--info-bg); }
.fm-ech .part-btns { margin: 0; }
.pastille-mini { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: #ffd60a; border: 1px solid #1a1a1a; margin-right: 5px; vertical-align: -1px; }
.pastille-mini.bleu { background: #3d8bfd; }
.fm-ech-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 10px; }
.fm-ech-liste { font-size: 14px; margin: 4px 0; }
.fm-ech-donnees { list-style: none; margin: 0 0 8px; padding: 0; }
.fm-ech-donnees li { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-top: 1px solid var(--border); font-size: 14px; }
.fm-ech-donnees li .btn { margin-left: auto; }
.fm-ech-ligne { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--border); }
.fm-ech-ligne:first-of-type { border-top: 0; }
.fm-maj { border-color: var(--warn-border); background: #fffaeb; }
.fm-annee { height: 32px; border: 1px solid var(--border); border-radius: var(--radius-s); padding: 0 6px; background: #fff; font-size: 15px; font-weight: 700; color: var(--text); }
.fm-maj-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.fm-archive { background: var(--bg); }
.fm-tarif { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fm-tarif .fm-loyer input { width: 90px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-s); padding: 0 8px; }
table.fm-hist { width: 100%; border-collapse: collapse; font-size: 14px; }
table.fm-hist th, table.fm-hist td { padding: 5px 4px; border-bottom: 1px solid var(--border); text-align: left; }
table.fm-hist .nb { text-align: right; white-space: nowrap; }

/* ---------- Mise en avant sur la carte (mes terres, ou celles d'un propriétaire) ---------- */
.ctrl-select {
  width: 100%; padding: 8px 6px; border: 1px solid var(--border); border-radius: var(--radius-s);
  background: #fff; font-size: 14px; color: inherit;
}
.surbri-chip {
  position: absolute; top: 10px; left: 10px; z-index: 820; display: flex; align-items: stretch;
  max-width: calc(100% - 80px); background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-float); font-size: 14px; overflow: hidden;
}
.surbri-chip.hidden { display: none; }
.surbri-chip button { border: 0; background: none; cursor: pointer; font: inherit; color: inherit; }
.surbri-voir { display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 10px; text-align: left; min-width: 0; line-height: 1.25; }
.surbri-voir b { overflow-wrap: anywhere; }
.surbri-voir .small { color: var(--muted); font-size: 12px; }
.surbri-pastille { flex: none; width: 16px; height: 16px; border-radius: 4px; background: #ffd60a; border: 2px solid #1a1a1a; }
.surbri-fin { padding: 0 12px; font-size: 16px; color: var(--muted) !important; }
@media (min-width: 900px) { .surbri-chip { max-width: calc(100% - 290px); } }

/* Petits téléphones */
@media (max-width: 359px) {
  .brand span { display: none; }
  .topbar { gap: 4px; padding-left: 6px; padding-right: 6px; }
  .topbar .icon-btn { width: 32px; font-size: 18px; flex: none; }
}

/* ---------- Accueil, Carte, Plus ---------- */
.btn.big { width: 100%; min-height: 48px; font-size: 16px; margin: 0 0 12px; }
.push-right { margin-left: auto; }
.grow { flex: 1; min-width: 0; }
.plist.compact { margin: 0; }
.plist.compact li { padding: 8px; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
.legende small { color: var(--muted); }

/* ---------- Chantiers ---------- */
.type-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.chip-btn {
  border: 1px solid var(--border); background: #fff; border-radius: 99px; padding: 8px 12px;
  font-size: 14px; font-weight: 600; cursor: pointer; color: var(--text);
}
.chip-btn.active { background: var(--green); border-color: var(--green); color: #fff; }
.chip-btn .ic { vertical-align: -3px; }
.ch-filtres { margin: 0 0 6px; }
.ch-filtres .chip-btn { min-height: 40px; }
.ch-nb { font-weight: 500; opacity: .7; font-variant-numeric: tabular-nums; }
.ch-compte { margin: 4px 0 8px; }
.plist li[hidden] { display: none; }
.chip-btn.chip-petit { padding: 6px 10px; font-size: 13px; font-weight: 500; color: var(--muted); }
.chip.chip-ch {
  display: inline-block; border: 0; cursor: pointer; margin: 0 0 8px; font-size: 12px;
  background: var(--warn-bg); color: var(--warn-text);
}
.ch-total { font-weight: 700; color: var(--green-dark); margin-bottom: 8px; }
.ch-sel { list-style: none; margin: 0 0 8px; padding: 0; }
.ch-sel li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); }
.ch-sel li:first-child { border-top: 0; }
.ch-sel .dot { width: 12px; height: 12px; border-radius: 3px; flex: none; border: 1px solid rgba(0,0,0,.2); }
.ch-sel .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ch-sel small { color: var(--muted); }
.ch-q { width: 84px; min-height: 36px; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-s); font-size: 16px; }
.ch-retire { flex: none; width: 32px; height: 32px; border: 0; border-radius: var(--radius-s); background: none; color: var(--danger); font-size: 17px; cursor: pointer; }
.ch-vide { color: var(--muted); font-style: italic; margin: 0 0 8px; }
.avert { background: var(--warn-bg); color: var(--warn-text); border-radius: var(--radius-s); padding: 8px 10px; font-size: 13px; margin: 0 0 8px; }
.ch-cocher { border-top: 1px solid var(--border); padding-top: 8px; }
.ch-groupe { margin-bottom: 8px; }
.ch-case { display: flex; align-items: center; gap: 8px; padding: 7px 2px; cursor: pointer; font-size: 15px; }
.ch-case input { width: 20px; height: 20px; accent-color: var(--green); flex: none; }
.ch-case small { color: var(--muted); }
.ch-groupe-titre { border-bottom: 1px solid var(--border); }
.ch-groupe .ch-case:not(.ch-groupe-titre) { padding-left: 22px; }

/* Ordinateur à petit écran : onglets réduits (pictogramme au-dessus du nom) pour laisser la place à la carte */
@media (min-width: 900px) and (max-width: 1279px) {
  :root { --tabs-w: 78px; --panel-w: 390px; }
  .tabs { padding: 8px 4px; }
  .tabs button { flex-direction: column; gap: 2px; padding: 8px 2px; font-size: 11px; text-align: center; }
  .tab-em { width: auto; font-size: 19px; }
}

/* Bord de la page à glisser (ordinateur) pour partager la place entre la page et la carte */
.splitter {
  position: absolute; top: 0; bottom: 0; right: -6px; width: 12px; z-index: 950;
  cursor: col-resize; touch-action: none;
}
.splitter::after {
  content: ''; position: absolute; top: 50%; left: 4px; width: 4px; height: 44px; margin-top: -22px;
  border-radius: 2px; background: var(--border-strong); opacity: .7; transition: opacity .15s, background .15s;
}
.splitter:hover::after, .splitter:focus-visible::after, body.redim .splitter::after { background: var(--green); opacity: 1; }
.splitter:focus-visible { outline: none; }
body.redim, body.redim * { cursor: col-resize !important; user-select: none; -webkit-user-select: none; }
body.redim #map { pointer-events: none; }
@media (max-width: 899px) { .splitter { display: none; } }

/* ---------- Météo (façon appli Météo de l'iPhone) ---------- */
.card.meteo > summary { font-weight: 700; font-size: 15px; }
.meteo-resume { margin-left: 4px; font-weight: 600; color: var(--muted); }
.mt { margin-top: 8px; padding: 12px 10px 10px; border-radius: var(--radius); color: #fff; }
.mt-beau { background: linear-gradient(180deg, #2c78c9 0%, #4f9de0 55%, #86c0ee 100%); }
.mt-couvert { background: linear-gradient(180deg, #52657a 0%, #7f90a4 100%); }
.mt-pluie { background: linear-gradient(180deg, #37475a 0%, #627489 100%); }
.mt-orage { background: linear-gradient(180deg, #262a40 0%, #4f5577 100%); }
.mt-nuit { background: linear-gradient(180deg, #0b1430 0%, #253660 100%); }
.mt-tete { text-align: center; padding: 4px 0 14px; text-shadow: 0 1px 3px rgba(0,0,0,.18); }
.mt-lieu { font-size: 21px; font-weight: 500; }
.mt-temp { font-size: 68px; font-weight: 200; line-height: 1; margin-left: 20px; }
.mt-cond { font-size: 17px; font-weight: 500; opacity: .92; }
.mt-minmax { font-size: 16px; font-weight: 500; }
.mt-bloc { background: rgba(255,255,255,.16); border-radius: var(--radius); padding: 9px 11px 10px; margin-bottom: 8px; }
.mt-titre {
  display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.78);
  padding-bottom: 6px; margin-bottom: 7px; border-bottom: 1px solid rgba(255,255,255,.22);
}
.mt-ti { width: 22px; height: 22px; margin: -4px 0 -4px -3px; flex: none; }
.mt-i { width: 34px; height: 34px; display: block; }
.mt-hero { width: 96px; height: 96px; display: block; margin: -6px auto -14px; }
.meteo-resume .mt-ti { vertical-align: middle; margin: -4px 0 -2px; }
.mt-page-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.mt-outils { display: flex; gap: 6px; flex: none; }
.btn.actif { border-color: var(--green); color: var(--green); background: var(--green-light); }
.mt-cherche { position: relative; margin: 6px 0 10px; }
.mt-cherche input {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-s); background: #fff; font-size: 16px;
}
.mt-cherche input:focus { outline: 2px solid var(--green); outline-offset: -1px; }
.mt-resultats { list-style: none; margin: 4px 0 0; padding: 0; background: #fff; border-radius: var(--radius-s); box-shadow: var(--shadow-pop); }
.mt-resultats:empty { display: none; }
.mt-resultats li { padding: 10px 12px; cursor: pointer; border-top: 1px solid var(--border); }
.mt-resultats li:first-child { border-top: 0; }
.mt-resultats li:hover, .mt-resultats li:focus { background: var(--green-light); outline: none; }
.mt-resultats small { display: block; color: var(--muted); }
.mt-sous-lieu { font-size: 13px; font-weight: 600; opacity: .85; }
.mt-mini-btn { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; margin: 0 0 12px; font: inherit; }
.mt-mini { display: flex; align-items: center; gap: 10px; border-radius: var(--radius); padding: 8px 12px 8px 6px; color: #fff; min-height: 72px; }
.mt-mini.mt-chargement { background: #7f90a4; padding-left: 14px; font-size: 14px; }
.mt-mini-ic { width: 64px; height: 64px; flex: none; }
.mt-mini-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; line-height: 1.35; }
.mt-mini-txt b { font-size: 17px; font-weight: 600; }
.mt-mini-txt span { opacity: .9; }
.mt-mini-fl { font-size: 24px; opacity: .8; }
.mt-heures { display: flex; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.mt-heures::-webkit-scrollbar { display: none; }
.mt-heures > div { flex: 0 0 54px; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 14px; font-weight: 600; }
.mt-heures b { font-size: 17px; font-weight: 500; }
.mt-proba { display: block; color: #9fd8ff; font-size: 11px; font-weight: 700; min-height: 13px; line-height: 13px; }
.mt-jour {
  display: grid; grid-template-columns: 46px 40px 32px minmax(0, 1fr) 32px; align-items: center; gap: 8px;
  padding: 6px 0; border-top: 1px solid rgba(255,255,255,.2); font-size: 17px; font-weight: 500;
}
.mt-titre + .mt-jour { border-top: 0; }
.mt-jic { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.mt-jic .mt-i { width: 32px; height: 32px; }
.mt-jmin { opacity: .6; text-align: right; }
.mt-barre { position: relative; height: 5px; border-radius: 3px; background: rgba(0,0,0,.2); }
.mt-barre span { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.mt-barre i {
  position: absolute; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 1.5px rgba(0,0,0,.25);
}
.mt-tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mt-tuiles .mt-bloc { margin: 0; }
.mt-large { grid-column: 1 / -1; }
.mt-val { font-size: 30px; line-height: 1.15; }
.mt-note { font-size: 13px; line-height: 1.3; margin: 6px 0 0; opacity: .9; }
.mt-vent { display: flex; align-items: center; gap: 10px; }
.mt-vent b { font-size: 30px; font-weight: 400; }
.mt-vent small { opacity: .85; }
.mt-boussole {
  flex: none; width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5);
  display: flex; align-items: center; justify-content: center;
}
.mt-boussole i { font-style: normal; font-size: 24px; font-weight: 700; display: inline-block; }
.mt-pulve-maint { margin-bottom: 8px; font-size: 15px; }
.mt-pulve-maint small { display: block; font-size: 13px; opacity: .85; }
.mt-source { font-size: 11px; opacity: .7; text-align: center; margin: 8px 0 0; }
.meteo-bande { display: flex; gap: 1px; height: 30px; }
.mh {
  flex: 1; min-width: 0; padding: 0; border: 0; border-radius: 2px; cursor: pointer; position: relative;
  display: flex; align-items: flex-end; justify-content: flex-start;
}
.mh small { position: absolute; bottom: -15px; left: 0; font-size: 10px; color: rgba(255,255,255,.85); white-space: nowrap; }
.mh.bon, .meteo-legende .bon { background: #4cd964; }
.mh.moyen, .meteo-legende .moyen { background: #ffb020; }
.mh.non, .meteo-legende .non { background: #ff5a4f; }
.mh.sel { outline: 2px solid #fff; outline-offset: 1px; z-index: 1; }
.meteo-legende { display: flex; align-items: center; gap: 4px 6px; flex-wrap: wrap; font-size: 12px; opacity: .9; margin-top: 20px; }
.meteo-legende span { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 6px; }
.meteo-legende span:first-child { margin-left: 0; }
.meteo-detail { font-size: 14px; margin: 8px 0 0; }

/* ---------- Azote ---------- */
.az-chiffre { min-height: 42px; display: flex; align-items: center; font-size: 18px; font-weight: 700; color: var(--green-dark); }
.az-barre { height: 10px; border-radius: 5px; background: var(--track); overflow: hidden; }
.az-barre span { display: block; height: 100%; background: var(--green); border-radius: 5px; }
.az-barre.trop span { background: var(--danger); }
.az-txt { margin: 6px 0 0; font-size: 14px; }
.danger-text { color: var(--danger); }
.az-liste { list-style: none; margin: 0; padding: 0; }
.az-liste li { padding: 8px 0; border-top: 1px solid var(--border); cursor: pointer; }
.az-liste li:first-child { border-top: 0; }
.az-l1 { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 4px; flex-wrap: wrap; }

/* ---------- Impression / PDF ---------- */
#print { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  body > *:not(#print) { display: none !important; }
  #print { display: block; color: #000; font: 10pt/1.35 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
  .pr-tete { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #2f6b3a; padding-bottom: 6px; margin-bottom: 10px; font-size: 10pt; }
  .pr-tete > div:last-child { text-align: right; color: #444; }
  #print h2 { font-size: 14pt; margin: 0 0 4px; }
  #print h3 { font-size: 11pt; margin: 10px 0 4px; display: block; }
  #print p { margin: 3px 0; }
  #print table { width: 100%; border-collapse: collapse; margin-bottom: 6px; page-break-inside: auto; }
  #print tr { page-break-inside: avoid; }
  #print th, #print td { border: 1px solid #999; padding: 3px 5px; text-align: left; vertical-align: top; }
  #print th { background: #eef3ec; font-weight: 700; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #print .pr-large { font-size: 9pt; }
  #print small { color: #444; }
  .pr-page { page-break-after: always; }
  .pr-page:last-child { page-break-after: auto; }
  /* fiches de tous les champs : à la suite, un trait entre deux champs, un champ court n'est pas coupé en deux */
  .pr-fiche { break-inside: avoid; page-break-inside: avoid; padding: 6px 0 8px; border-top: 1px solid #999; }
  .pr-fiche:first-of-type { border-top: 0; padding-top: 0; }
  #print .pr-fiche h2 { font-size: 12.5pt; }
  #print .pr-fiche h3 { break-after: avoid; page-break-after: avoid; }
  .pr-vide { color: #555; font-style: italic; }
  .pr-notes { white-space: pre-wrap; }
  .pr-note { font-size: 8.5pt; color: #444; }
  /* lettre au propriétaire */
  .lt { font-size: 10.5pt; }
  .lt-haut { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18mm; }
  .lt-date { text-align: right; white-space: nowrap; }
  .lt-dest { margin: 0 0 14mm 95mm; line-height: 1.4; }
  .lt-objet { font-weight: 700; font-size: 12pt; text-transform: uppercase; margin-bottom: 6mm; }
  .lt-texte { margin: 0 0 6mm; }
  #print .lt table { font-size: 9.5pt; }
  #print .lt td.nb, #print .lt th.nb { text-align: right; white-space: nowrap; }
  #print .lt tfoot th { background: #eef3ec; }
  .lt-total { margin: 4mm 0 8mm !important; font-size: 11pt; }
  /* lettre + chèque sur la même feuille (comme l'ancien logiciel) : page A4 de 273 mm utiles,
     le texte du chèque en bas aux positions de l'ancien modèle (repères depuis le haut et la gauche de la zone imprimable) */
  .ltc { position: relative; height: 270mm; overflow: hidden; }
  .lt-suite { font-size: 9pt; color: #444; }
  .chq-cadre { position: absolute; left: 5.5mm; top: 190mm; width: 175mm; height: 80mm; outline: 0.3mm dashed #888; }
  .chq-zone { position: absolute; inset: 0; font-family: Arial, Helvetica, sans-serif; font-weight: 700; pointer-events: none; }
  .chq-zone > div { position: absolute; white-space: nowrap; }
  .chq-lettres { left: 55mm; top: 220mm; width: 125mm; white-space: normal !important; font-size: 8pt; line-height: 5mm; }
  .chq-ordre { left: 32mm; top: 237mm; font-size: 8pt; }
  .chq-chiffres { right: 9mm; top: 236mm; font-size: 11pt; }
  .chq-lieu { left: 157mm; top: 253mm; font-size: 7pt; }
  .chq-date { left: 157mm; top: 260mm; font-size: 7pt; }
}
.pt-pulve { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 0 1.5px rgba(255,255,255,.6); }
.pt-pulve.bon { background: #4cd964; }
.pt-pulve.moyen { background: #ffb020; }
.pt-pulve.non { background: #ff5a4f; }
/* à la souris (ordinateur), une fine barre permet de faire défiler les heures */
@media (hover: hover) and (pointer: fine) {
  .mt-heures { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.45) transparent; padding-bottom: 4px; }
  .mt-heures::-webkit-scrollbar { display: block; height: 6px; }
  .mt-heures::-webkit-scrollbar-thumb { background: rgba(255,255,255,.45); border-radius: 3px; }
}

/* ---------- Météo : heure par heure, page d'une journée ---------- */
.mt-cliquable { cursor: pointer; }
.mt-titre-seg { justify-content: space-between; gap: 8px; }
.mt-titre-seg > span { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.mt-titre small, .mt-astuce { font-weight: 500; opacity: .8; font-size: 12px; }
.mt-titre-seg small { flex-basis: 100%; padding-left: 22px; }
.mt-astuce { margin-left: auto; }
.mt-seg { display: flex; flex: none; background: rgba(0,0,0,.18); border-radius: 99px; padding: 2px; }
.mt-seg button { width: 40px; height: 30px; border: 0; border-radius: 99px; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.mt-seg button.on { background: rgba(255,255,255,.28); }
.mt-seg-ic { width: 28px; height: 28px; }
.mt-fleche { display: inline-block; width: 34px; height: 34px; line-height: 34px; text-align: center; font-size: 20px; font-weight: 700; }
.mt-fleche.fort { color: #ffb4ae; }
.mt-jour.mt-cliquable:hover, .mt-jour.mt-cliquable:focus-visible { background: rgba(255,255,255,.08); outline: none; border-radius: var(--radius-s); }

.mt-dialog {
  width: 100%; max-width: 560px; height: 100%; max-height: 100%; margin: auto; padding: 0; border: 0;
  background: #1c1c1e; color: #fff; overflow-y: auto; overscroll-behavior: contain;
}
.mt-dialog::backdrop { background: rgba(0,0,0,.55); }
@media (min-width: 600px) { .mt-dialog { height: 92vh; border-radius: var(--radius); } }
.mj { padding: calc(10px + env(safe-area-inset-top)) 14px calc(30px + env(safe-area-inset-bottom)); min-height: 100%; }
.mj-top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; margin-bottom: 10px; }
.mj-top h2 { margin: 0; text-align: center; font-size: 18px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.mj-tic { width: 32px; height: 32px; }
.mj-fermer { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #3a3a3c; color: #fff; font-size: 18px; cursor: pointer; }
.mj-jours { display: flex; overflow-x: auto; gap: 2px; scrollbar-width: none; }
.mj-jours::-webkit-scrollbar { display: none; }
.mj-jours button {
  flex: 1 0 40px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0;
  border: 0; background: none; color: #fff; cursor: pointer;
}
.mj-jours small { font-size: 12px; font-weight: 600; opacity: .8; }
.mj-jours b { width: 36px; height: 36px; line-height: 36px; border-radius: 50%; font-size: 17px; font-weight: 500; }
.mj-jours button.passe b { opacity: .5; }
.mj-jours button.on b { background: #3ab4f2; opacity: 1; }
.mj-date { text-align: center; font-size: 16px; padding: 6px 0 10px; border-bottom: 1px solid #38383a; margin-bottom: 10px; }
.mj-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.mj-gros { font-size: 40px; font-weight: 500; line-height: 1.1; display: flex; align-items: center; gap: 6px; }
.mj-gros small { font-size: 18px; font-weight: 500; opacity: .8; }
.mj-ic { width: 52px; height: 52px; }
.mj-sous { font-size: 15px; opacity: .8; margin-top: 2px; }
.mj-choix {
  flex: none; height: 38px; border: 0; border-radius: 99px; padding: 0 12px; background: #3a3a3c; color: #fff;
  font-size: 14px; font-weight: 600; max-width: 48%;
}
.mj-lecture { min-height: 40px; margin: 10px 0 4px; padding: 6px 10px; border-radius: var(--radius); background: #2c2c2e; font-size: 13px; line-height: 1.4; color: #e5e5ea; }
.g { width: 100%; height: auto; display: block; touch-action: pan-y; margin: 4px 0; }
.g-grille { stroke: #3a3a3c; stroke-width: 1; }
.g-vert { stroke-dasharray: 2 3; }
.g-axe { fill: #a1a1a6; font-size: 11px; }
.g-maint { stroke: #fff; stroke-width: 1.5; opacity: .6; }
.g-curseur { stroke: #fff; stroke-width: 1.5; }
.g-seuil { stroke: #ff5a4f; stroke-width: 1.5; stroke-dasharray: 6 4; }
.g-seuil-txt { fill: #ff8a82; font-size: 10.5px; font-weight: 600; }
.g-fleche { fill: #9fd8ff; font-size: 15px; font-weight: 700; text-anchor: middle; }
.mj-seg2 { display: flex; background: #2c2c2e; border-radius: var(--radius); padding: 3px; margin: 8px 0; }
.mj-seg2 button { flex: 1; height: 34px; border: 0; border-radius: var(--radius-s); background: none; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.mj-seg2 button.on { background: #636366; }
.mj-texte { font-size: 14px; color: #c7c7cc; margin: 6px 0 16px; line-height: 1.4; }
.mj-h { color: #fff; font-size: 20px; margin: 18px 0 0; display: block; }
.mj-sous2 { color: #a1a1a6; margin: 2px 0 6px; font-size: 15px; }
.mj-bande { height: 40px; margin-top: 10px; }
.mj-bande .mh { cursor: default; }
.mj-heures-lib { display: flex; justify-content: space-between; font-size: 11px; color: #a1a1a6; margin: 4px 0 10px; }
.mj-segs { list-style: none; margin: 0 0 8px; padding: 0; }
.mj-segs li { padding: 8px 0; border-top: 1px solid #38383a; font-size: 14px; }
.mj-segs li b { margin-right: 6px; }

/* --- Satellite : entrée depuis la fiche et page « Vu du satellite » --- */
.sat-entree { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer; font-size: 15px; }
.sat-entree:hover { border-color: var(--green); }
.sat-entree-ic { display: grid; place-items: center; font-size: 19px; color: var(--green); }
.sat-entree small { display: block; color: var(--muted); font-size: 13px; }
.sat-entree-fl { color: var(--muted); font-size: 20px; }
.sat-titre { margin: 0 0 10px; font-size: 20px; }
/* quatre modes sur un téléphone : pictogramme au-dessus du nom, pour que rien ne se coupe */
.sat-modes button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 2px; font-size: 12.5px; line-height: 1.15; }
.sat-aide { margin: 0 0 10px; min-height: 2.6em; }
.sat-dates { position: relative; display: flex; align-items: flex-end; gap: 4px; overflow-x: auto; padding: 2px 2px 6px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.sat-dates button { flex: none; width: 40px; border: 1px solid var(--border); background: #fff; border-radius: var(--radius-s);
  padding: 4px 0 3px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.sat-dates button b { font-size: 14px; }
.sat-dates button i { font-style: normal; font-size: 14px; line-height: 1; }
.sat-dates button.nuageux { opacity: .55; }
.sat-dates button.on { background: var(--green); border-color: var(--green); color: #fff; opacity: 1; }
.sat-mois { flex: none; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px; padding: 0 1px; align-self: center; }
.sat-dates-pied { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 2px 0 12px; }
.sat-dates-pied > span { flex: 1 1 100%; }
.sat-check { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.sat-check input { margin: 0; }
.sat-apercu-tete { display: flex; justify-content: space-between; margin-bottom: 8px; text-transform: capitalize; }
.sat-image { background: repeating-conic-gradient(#eeece4 0 25%, #f8f7f2 0 50%) 0 0 / 16px 16px; border-radius: var(--radius-s);
  display: flex; justify-content: center; padding: 6px; }
.sat-image img { display: block; max-width: 100%; max-height: 340px; width: auto; height: auto; }
.sat-attente { min-height: 140px; align-items: center; color: var(--muted); font-size: 13px; }
.sat-legende { margin-top: 10px; }
.sat-rampe { height: 12px; border-radius: var(--radius-s); border: 1px solid rgba(0,0,0,.08); }
.sat-rampe-txt { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin: 3px 0 6px; }
.sat-ligne { margin: 8px 0 0; }
.sat-compare { margin-bottom: 8px; }
.sat-courbe { width: 100%; height: auto; display: block; }
.sat-courbe text { font-size: 9px; fill: var(--muted); }
.sat-courbe .sat-grille { stroke: #e7e4d8; stroke-width: 1; }
.sat-courbe path { fill: none; stroke: #2e8b47; stroke-width: 2; stroke-linejoin: round; }
.sat-courbe circle { fill: #fff; stroke: #2e8b47; stroke-width: 2; cursor: pointer; }
.sat-courbe circle.on { fill: #2e8b47; }
.sat-savoir p { margin: 8px 0 0; }
.sat-savoir summary { cursor: pointer; font-weight: 600; }
/* Satellite sur l'Accueil : champs en baisse de vigueur */
.sat-accueil h3 { display: flex; align-items: center; }
.sat-accueil-msg { margin: 0 0 6px; font-size: 14px; }
.sat-accueil-liste { list-style: none; margin: 0; padding: 0; }
.sat-accueil-ligne { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0;
  border-top: 1px solid var(--border); padding: 9px 2px; cursor: pointer; font-size: 14px; }
.sat-accueil-ligne small { color: var(--muted); }
.sat-accueil-ligne.alerte { background: var(--danger-bg); border-radius: var(--radius-s); border-top-color: transparent; padding: 9px 8px; margin-bottom: 4px; }
.sat-accueil-val { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; }
.sat-accueil-val i { font-style: normal; font-weight: 700; margin-left: 2px; }
.sat-accueil-val .fl-bas { color: var(--danger); }
.sat-accueil-val .fl-haut { color: #2e8b47; }
.sat-accueil-val .fl-stable { color: var(--muted); }
.sat-accueil-fl { color: var(--muted); }
.sat-accueil-tous summary { cursor: pointer; font-size: 14px; color: var(--green); font-weight: 600; padding: 4px 0; }
.sat-accueil-pied { margin: 8px 0 0; }
.sat-accueil-ligne .grow { flex: 1; min-width: 0; }

/* ---------- Registre phyto : saisie d'un traitement ---------- */
.phyto-produit { position: relative; }
.ephy-sugg {
  position: absolute; left: 0; right: 0; top: calc(100% - 8px); z-index: 30; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-s); box-shadow: var(--shadow-pop);
  max-height: 290px; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.ephy-sugg button {
  display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--border);
  background: none; padding: 9px 10px; font-size: 15px; color: var(--text); cursor: pointer;
}
.ephy-sugg button:last-child { border-bottom: 0; }
.ephy-sugg button i { font-style: normal; color: var(--muted); font-size: 13px; }
.ephy-sugg button small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.ephy-sugg button:hover, .ephy-sugg button:focus { background: var(--green-light); }
.phyto-info { font-size: 13px; margin: -4px 0 8px; display: flex; flex-direction: column; gap: 3px; }
.phyto-info:empty { display: none; }
.phyto-info .pi-ok { color: var(--green-dark); }
.phyto-info .pi-avert { color: #9a3b00; font-weight: 600; }
.phyto-info .pi-manque { color: var(--warn-text); background: var(--warn-bg); border-radius: var(--radius-s); padding: 4px 8px; }
.phyto-plus, .sous-details { margin: 0 0 8px; }
.phyto-plus > summary, .sous-details > summary { font-size: 13px; color: var(--muted); }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 8px; cursor: pointer; }
.check-line input { width: 20px; height: 20px; accent-color: var(--green); }
.phyto-form select { text-overflow: ellipsis; }
/* le formulaire s'adapte à sa propre largeur (panneau étroit sur ordinateur, téléphone) */
.phyto-form, .sous-details { container-type: inline-size; }
@container (max-width: 440px) {
  .phyto-quand, .phyto-form .grid3, .sous-details .grid3 { grid-template-columns: 1fr 1fr; }
  .phyto-quand > :first-child, .phyto-form .grid3 > :first-child, .sous-details .grid3 > :first-child { grid-column: 1 / -1; }
}
@container (max-width: 300px) {
  .phyto-form .grid2 { grid-template-columns: 1fr; }
}


/* Deuxième culture de l'année (fiche) */
.culture2 {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px 4px;
  margin: 4px 0 8px; background: rgba(52, 199, 89, .05);
}
.culture2-titre { margin: 0 34px 8px 0; font-size: 15px; }
.culture2 .del {
  position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border: 0; border-radius: var(--radius-s);
  background: none; color: var(--danger); font-size: 18px; cursor: pointer;
}
.radio-line { display: flex; align-items: flex-start; gap: 8px; font-size: 15px; margin: 0 0 8px; cursor: pointer; }
.radio-line input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--green); }
.radio-line small { display: block; color: var(--muted, #777); font-size: 12.5px; }
.culture2 .grid2 { margin-top: 4px; }
.culture2-semis { max-width: 200px; }
.culture2-pac { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 2px 0 6px; }
.culture2-pac > span { flex-basis: 100%; }
.culture2-pac .radio-line { margin: 0; }
.culture-traitee { margin-right: 36px; }

/* Poignées de la découpe (zone de toucher large, point visible au centre) */
.dec-poignee { background: none; border: 0; cursor: grab; }
.dec-poignee::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%);
  border-radius: 50%; background: #ff3b30; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); box-sizing: border-box;
}
.dec-poignee.milieu::after { width: 13px; height: 13px; background: #fff; border: 2px solid #ff3b30; opacity: .9; }
.dec-poignee:active { cursor: grabbing; }
.dec-aide { display: block; margin-top: 2px; }
/* croix d'une rubrique de la fiche (semis, suivi de l'azote, note) */
.card[data-rubrique] { position: relative; }
.rub-del {
  position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border: 0; border-radius: var(--radius-s);
  background: none; color: var(--danger); font-size: 18px; cursor: pointer;
}
.rub-del:hover { background: var(--danger-bg); }
/* Payer : le compte qui paie replié en une ligne */
.fm-compte { margin: 0 0 10px; border: 1px solid var(--border); border-radius: var(--radius-s); padding: 8px 10px; }
.fm-compte > summary { cursor: pointer; }
.fm-compte[open] > summary { margin-bottom: 8px; }
.fm-compte > summary .muted { white-space: nowrap; }
/* Satellite : choix de la période (12 derniers mois ou une campagne) */
.sat-periode { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 8px; }
.sat-periode > span { font-weight: 600; font-size: 13px; }
.sat-periode select { min-height: 36px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 14px; }
.sat-periode small { flex-basis: 100%; }
/* Satellite : « ? » sous chaque type d'image, « En pratique », fenêtre d'explication */
.sat-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
.sat-tete .sat-titre { margin: 0; }
.sat-qs { display: grid; grid-template-columns: repeat(4, 1fr); margin: -4px 0 4px; }
.sat-q { justify-self: center; display: inline-flex; align-items: center; gap: 4px; min-width: 40px; min-height: 36px;
  justify-content: center; border: 0; background: none; color: var(--green); cursor: pointer; border-radius: 99px;
  font-size: 13px; font-weight: 600; padding: 0 8px; }
.sat-q .ic { width: 22px; height: 22px; }
.sat-q:hover { background: var(--green-light); }
.sat-q:focus-visible { outline: 2px solid var(--green-dark); outline-offset: 1px; }
.sat-q-pratique { border: 1px solid var(--border); background: #fff; flex: none; }
@media (pointer: coarse) { .sat-q { min-height: 40px; } }
.sat-dlg { width: calc(100% - 24px); max-width: 460px; max-height: calc(100% - 48px); padding: 0; border: 0;
  border-radius: var(--radius); background: var(--card); color: var(--text); box-shadow: var(--shadow-pop); }
.sat-dlg::backdrop { background: rgba(20, 30, 20, .45); }
.sat-dlg-corps { padding: 16px 18px 18px; max-height: calc(100vh - 48px); overflow-y: auto; overscroll-behavior: contain; }
.sat-dlg-tete { display: flex; align-items: flex-start; gap: 8px; }
.sat-dlg-tete h3 { flex: 1; margin: 4px 0 6px; font-size: 17px; line-height: 1.3; }
.sat-dlg-tete h3 .ic { color: var(--green); }
.sat-dlg-x { background: none; color: var(--muted); margin: -4px -6px 0 0; }
.sat-dlg-x:hover { background: var(--green-light); }
.sat-dlg h4 { margin: 14px 0 4px; font-size: 14px; color: var(--green-dark); }
.sat-dlg p { margin: 6px 0; font-size: 15px; line-height: 1.45; }
.sat-dlg p.small { font-size: 13px; }
.sat-dlg .ic { vertical-align: -.25em; }
.sat-etapes { margin: 6px 0 4px; padding-left: 22px; font-size: 15px; line-height: 1.45; }
.sat-etapes li { margin: 6px 0; }
.sat-dlg-ok { width: 100%; margin-top: 14px; }
/* Satellite : chargement visible (roue sur l'aperçu, pastille sur la carte) */
.sat-roue { display: inline-block; flex: none; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: tourne .8s linear infinite; }
.sat-attente { position: relative; min-height: 140px; align-items: center; }
.sat-attente.avec-ancienne { min-height: 0; }
.sat-attente.avec-ancienne img { opacity: .3; filter: grayscale(.7); }
.sat-attente-txt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--green-dark); }
.sat-carte-charge { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 850; pointer-events: none;
  display: none; align-items: center; gap: 8px; white-space: nowrap; padding: 8px 14px; border-radius: 99px;
  background: var(--card); color: var(--green-dark); box-shadow: var(--shadow-float); font-size: 14px; font-weight: 600; }
.sat-carte-charge.visible { display: flex; }
