:root {
  /* Identite visuelle : librement personnalisable (boutons, en-tete,
     liens, indicateurs generiques bon/mauvais). Changer ces valeurs
     reskinne toute l'appli sans toucher a la carte de sante. */
  --brand: #1e8449;
  --brand-hover: #166a3a;
  --brand-danger: #c0392b;
  --brand-warn: #c98a12;
  --brand-2: #2f6fa8;  /* meteo, pluie */
  --brand-3: #6b5b95;  /* carnet d'entretien */
  --brand-4: #2c5f8a;  /* contours des trous */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-size-base: 100%;  /* taille racine : tout le reste (rem) suit proportionnellement */
  --ink: #1c2b25;
  --muted: #64766c;
  --border: #dfe6e0;
  --bg: #f6f8f6;
  --card: #ffffff;

  /* Couleurs d'etat sante (4 niveaux) -- NE PAS MODIFIER : sens
     fonctionnel fixe, partage entre la carte NDVI, la legende, les badges
     d'etat et les puces "critique/stress/bon/excellent". Independantes des
     couleurs de marque ci-dessus (memes valeurs par defaut aujourd'hui,
     mais un changement de marque ne doit jamais les faire bouger). */
  --status-critique: #c0392b;
  --status-stress: #f1c40f;
  --status-bon: #82c341;
  --status-excellent: #1e8449;
}

* { box-sizing: border-box; }

html { font-size: var(--font-size-base); }

body {
  margin: 0;
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  background: var(--brand);
  color: white;
  padding: 0.9rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 1rem;
}
.topbar-left { min-width: 0; }
.topbar-center { justify-self: center; display: flex; align-items: baseline; gap: 1rem; min-width: 0; overflow: hidden; }
.topbar-right { justify-self: end; display: flex; align-items: center; gap: 1rem; }
.space-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.22);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  white-space: nowrap;
}
@media (max-width: 700px) { .topbar .tagline { display: none; } }
.topbar .brand { color: white; font-weight: 700; font-size: 1.2rem; text-decoration: none; flex-shrink: 0; }
.topbar .tagline { font-size: 0.85rem; opacity: 0.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .space-switcher { display: flex; gap: 0.4rem; }
.topbar .space-link {
  color: white;
  opacity: 0.85;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}
.topbar .space-link:hover { opacity: 1; text-decoration: underline; }
.topbar .space-link.active { background: rgba(255, 255, 255, 0.22); opacity: 1; font-weight: 600; text-decoration: none; }

.app-shell { display: flex; align-items: flex-start; }
.container { max-width: none; margin: 0; padding: 1.5rem; flex: 1; min-width: 0; }

.sidebar {
  flex-shrink: 0;
  width: 268px;
  padding: 1.5rem 1rem;
  border-right: 1px solid var(--border);
  min-height: calc(100vh - 4rem);
  position: sticky;
  top: 0;
}
.sidebar-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0.8rem;
  margin: 1.2rem 0 0.4rem;
}
.sidebar-section-label:first-child { margin-top: 0; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
}
.sidebar-link svg { flex-shrink: 0; color: var(--muted); }
.sidebar-link:hover { background: var(--bg); }
.sidebar-link.active { background: var(--bg); color: var(--brand); }
.sidebar-link.active svg { color: var(--brand); }
.sidebar-link-soon { color: var(--muted); cursor: default; }
.sidebar-link-soon:hover { background: none; }
.sidebar-soon-tag {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
}
.sidebar-link-button {
  width: 100%;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
@media (max-width: 900px) {
  .sidebar { display: none; }
}

.site-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.2rem;
  margin: 1.2rem 0 2rem;
}
.site-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.site-card-thumb {
  height: 160px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg);
}
.site-card-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.site-card-body { padding: 1rem 1.1rem 0.6rem; }
.site-card-client {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-card-title { font-size: 1.15rem; font-weight: 800; margin: 0.15rem 0 0.3rem; }
.site-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.1rem;
  border-top: 1px solid var(--border);
  margin-top: 0.8rem;
}
.site-card-actions a {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--brand);
  text-decoration: none;
}
.site-card-actions a.muted { color: var(--muted); }
.site-card-actions a:hover { text-decoration: underline; }

.fab {
  position: fixed;
  right: 1.8rem;
  bottom: 1.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ink);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.9rem 1.3rem;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.fab:hover { background: color-mix(in srgb, var(--ink) 85%, white); }

.upload-picker-layout {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  margin-top: 1.2rem;
}
.upload-drop-panel {
  flex: 1;
  min-height: 420px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--muted);
  text-align: center;
  padding: 2rem;
  cursor: default;
}
.upload-drop-panel.ready { cursor: pointer; border-color: var(--brand); }
.upload-drop-panel.ready:hover { background: color-mix(in srgb, var(--brand) 5%, var(--card)); }
.upload-params-panel {
  width: 300px;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.upload-params-panel label { display: flex; flex-direction: column; gap: 0.3rem; }
@media (max-width: 760px) {
  .upload-picker-layout { flex-direction: column; }
  .upload-params-panel { width: 100%; }
}

h1 { margin: 0.2rem 0; }
h2 { margin-top: 0; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem;
}
.card.error { border-color: var(--brand-danger); background: #fdecea; color: #7a2018; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

form label {
  display: block;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
  font-weight: 600;
}
form input, form select, form textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
}
form input[type="color"] {
  width: 4rem;
  height: 2.4rem;
  padding: 0.2rem;
  cursor: pointer;
}

button, .button {
  display: inline-block;
  background: var(--brand);
  color: white;
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { background: var(--brand-hover); }
.button-2 { background: var(--brand-2); }
.button-2:hover { filter: brightness(0.9); }
.button-3 { background: var(--brand-3); }
.button-3:hover { filter: brightness(0.9); }
.button-4 { background: var(--brand-4); }
.button-4:hover { filter: brightness(0.9); }
.button-danger { background: var(--brand-danger); }
.button-danger:hover { filter: brightness(0.9); }

.table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.table th, .table td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.table th { color: var(--muted); font-weight: 600; }

.help-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: help;
  vertical-align: middle;
}
.help-hint:hover, .help-hint:focus { background: var(--muted); color: white; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
}
.badge.good { background: var(--brand); }
.badge.warn { background: var(--brand-warn); }
.badge.bad { background: var(--brand-danger); }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1.2rem 0;
}
.kpi-row-main { grid-template-columns: repeat(2, minmax(140px, 1fr)); margin-bottom: 0.8rem; }
.kpi-row-main .kpi-score-full { grid-column: 1 / -1; }
@media (max-width: 760px) { .kpi-row:not(.kpi-row-main) { grid-template-columns: 1fr 1fr; } }
.kpi {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.6rem 1.4rem;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.15s, transform 0.15s;
}
.kpi:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08); transform: translateY(-1px); }
.kpi::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--kpi-accent, var(--brand));
}
.kpi-neutral { --kpi-accent: var(--brand); }
.kpi-bon { --kpi-accent: var(--status-bon); }
.kpi-stress { --kpi-accent: var(--status-stress); }
.kpi-critique { --kpi-accent: var(--status-critique); }
.kpi-icon {
  width: 2.6rem;
  height: 2.6rem;
  margin: 0 auto 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.3rem;
  background: color-mix(in srgb, var(--kpi-accent, var(--brand)) 16%, white);
}
.kpi-value { font-size: 1.8rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.kpi-unit { font-size: 1rem; color: var(--muted); font-weight: 500; }
.kpi-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  min-height: 2.2em;
  line-height: 1.1;
}
.kpi-subtext { font-size: 0.72rem; color: var(--muted); margin-top: 0.3rem; }

.kpi-row .kpi {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  text-align: left;
  background: linear-gradient(135deg, var(--kpi-accent, var(--brand)), color-mix(in srgb, var(--kpi-accent, var(--brand)) 70%, black));
  border: none;
  color: white;
}
.kpi-row .kpi::before { display: none; }
.kpi-row .kpi:hover { transform: none; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18); }
.kpi-row .kpi-icon {
  background: rgba(255, 255, 255, 0.3);
  color: white;
  margin: 0;
  flex-shrink: 0;
}
.kpi-row .kpi-text { min-width: 0; }

/* Un accent de couleur different par indice (NDVI/NDRE/GNDVI/SAVI/...),
   cyclique sur la palette de marque : juste pour les distinguer au premier
   coup d'oeil dans la rangee, pas pour signaler un etat (contrairement a
   kpi-bon/kpi-stress/kpi-critique). */
.kpi-row-indices .kpi:nth-child(4n+1) { --kpi-accent: var(--brand); }
.kpi-row-indices .kpi:nth-child(4n+2) { --kpi-accent: var(--brand-2); }
.kpi-row-indices .kpi:nth-child(4n+3) { --kpi-accent: var(--brand-3); }
.kpi-row-indices .kpi:nth-child(4n+4) { --kpi-accent: var(--brand-4); }
.kpi-row .kpi-label { color: rgba(255, 255, 255, 0.92); margin-bottom: 0.1rem; min-height: 0; }
.kpi-row .kpi-value { color: white; font-size: 1.8rem; }
.kpi-row .kpi-unit { color: rgba(255, 255, 255, 0.85); }
.kpi-row-main .kpi { gap: 2.2rem; padding: 1.6rem 2.4rem; }
.kpi-row-main .kpi-icon { width: 3.6rem; height: 3.6rem; font-size: 1.8rem; }
.kpi-row-main .kpi-value { font-size: 3.4rem; }
.kpi-row-main .kpi-label { font-size: 0.95rem; }
@media (max-width: 600px) {
  .kpi-row-main .kpi { flex-direction: column; text-align: center; gap: 0.5rem; padding: 1.1rem 0.6rem; }
  .kpi-row-main .kpi-icon { width: 2.6rem; height: 2.6rem; font-size: 1.3rem; }
  .kpi-row-main .kpi-label { font-size: 0.8rem; }
}
.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  margin-top: 0.5rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}
.kpi-delta-arrow { font-size: 0.65rem; }
.kpi-delta.good { color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, white); }
.kpi-delta.bad { color: var(--brand-danger); background: color-mix(in srgb, var(--brand-danger) 12%, white); }

.legend { display: flex; gap: 1rem; margin-top: 0.8rem; font-size: 0.85rem; flex-wrap: wrap; }
.legend[hidden] { display: none; } /* [hidden] seul (regle UA) est vaincu par ".legend { display:flex }" ci-dessus -- il faut le re-forcer avec un selecteur plus specifique */
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 0.35rem; vertical-align: middle; }

.map-wrap { position: relative; }
.map-gauge {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 500;
  background: rgba(20, 24, 22, 0.82);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.map-gauge[hidden] { display: none; } /* "display:flex" ci-dessus vainc sinon l'attribut hidden, cf. .legend[hidden] */
.map-gauge-ring {
  --ring-color: var(--status-bon);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), rgba(255, 255, 255, 0.2) 0);
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-gauge-ring.good { --ring-color: var(--status-bon); }
.map-gauge-ring.warn { --ring-color: var(--status-stress); }
.map-gauge-ring.bad { --ring-color: var(--status-critique); }
.map-gauge-hole {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #14201c;
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-gauge-value { font-size: 1rem; font-weight: 800; }
.map-gauge-caption { display: flex; flex-direction: column; line-height: 1.3; }
.map-gauge-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; opacity: 0.85; }
.map-gauge-sub { font-size: 0.8rem; font-weight: 600; }

.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.flight-date-badge {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, white);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
}
select.flight-date-badge {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding-right: 1.8rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e8449' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 0.9rem;
}
select.flight-date-badge:hover { background-color: color-mix(in srgb, var(--brand) 20%, white); }
.compare-label {
  max-width: 44%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
}

.upload-progress:not([hidden]) { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.8rem; }
.upload-progress-track {
  flex: 1;
  max-width: 260px;
  height: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.upload-progress-fill { height: 100%; width: 0%; background: var(--brand); transition: width 0.15s ease; }

.tab-nav {
  display: flex;
  gap: 0.3rem;
  margin: 1.2rem 0 1.2rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.tab-btn {
  background: none;
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.6rem 0.9rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--ink); background: none; }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }

.explorer-subnav {
  display: inline-flex;
  gap: 0.2rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem;
  margin-bottom: 1rem;
}
.explorer-subnav-btn {
  background: none;
  border: none;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
}
.explorer-subnav-btn:hover { color: var(--ink); }
.explorer-subnav-btn.active { background: var(--card); color: var(--brand); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.explorer-subnav-btn.icon {
  width: auto;
  min-width: 3.6rem;
  height: auto;
  padding: 0.5rem 0.6rem 0.4rem;
  font-size: 1.9rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  border-radius: 10px;
}
.explorer-subnav-btn.icon.active { background: var(--ink); color: white; box-shadow: none; }
.explorer-subnav-btn:focus { outline: none; }
.explorer-subnav-btn.icon.soon { position: relative; opacity: 0.4; cursor: default; }
.explorer-subnav-btn.icon.soon:hover { color: var(--muted); }
.subnav-label {
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.subnav-soon-dot {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-warn);
}

.map-mode-bar {
  display: inline-flex;
  gap: 0.2rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.25rem;
}
.map-mode-btn {
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  text-transform: uppercase;
}
.map-mode-btn:hover:not(:disabled):not(.active) { color: var(--ink); }
.map-mode-btn.active { background: var(--ink); color: white; }
.map-mode-btn:disabled { opacity: 0.4; cursor: not-allowed; }
@media print { .tab-panel { display: block !important; } }

.photos-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
  margin-top: 0.6rem;
}
.photos-gallery-grid a {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}
.photos-gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.insight {
  display: flex;
  gap: 0.8rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  padding: 0.8rem 1rem;
  margin-bottom: 0.8rem;
  border-radius: 0 10px 10px 0;
  background: var(--bg);
}
.insight:last-child { margin-bottom: 0; }
.insight p { margin: 0.5rem 0 0; font-size: 0.88rem; color: var(--muted); }
.insight strong { font-size: 0.95rem; }
.insight-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1rem;
  background: var(--card);
}
.insight-body { min-width: 0; }
.insight-critique {
  border-left-color: var(--brand-danger);
  background: color-mix(in srgb, var(--brand-danger) 6%, var(--bg));
}
.insight-critique .insight-icon { background: color-mix(in srgb, var(--brand-danger) 16%, white); }
.insight-critique strong { font-size: 1.02rem; }
.insight-warn { border-left-color: var(--brand-warn); }
.insight-good { border-left-color: var(--brand); }
.insight-chips-more { margin-top: 0.55rem; }
.insight-chips-more summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-danger);
  list-style: none;
}
.insight-chips-more summary::-webkit-details-marker { display: none; }
.insight-chips-more summary:hover { text-decoration: underline; }
.insight-chips-more[open] summary { margin-bottom: 0.55rem; }
.insight-stat {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.insight-stat-values { font-size: 1.3rem; font-weight: 800; color: var(--ink); }
.insight-stat-arrow { color: var(--muted); font-weight: 500; }
.insight-stat-delta {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}
.insight-stat-delta-bad { color: var(--brand-danger); background: color-mix(in srgb, var(--brand-danger) 12%, white); }
.insight-stat-delta-good { color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, white); }
.insight-stat-since { font-size: 0.78rem; color: var(--muted); }
.insight-water { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.insight-water-chip {
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--ink);
}
.insight-water-deficit { color: var(--brand-danger); border-color: color-mix(in srgb, var(--brand-danger) 30%, var(--border)); background: color-mix(in srgb, var(--brand-danger) 8%, white); font-weight: 700; }
.insight-water-surplus { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 30%, var(--border)); background: color-mix(in srgb, var(--brand) 8%, white); font-weight: 700; }
.insight-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.55rem; }
.insight-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--ink);
}
.insight-chip-tag { font-weight: 700; font-size: 0.75rem; }
.insight-chip-danger .insight-chip-tag { color: var(--brand-danger); }
.insight-chip-warn .insight-chip-tag { color: var(--brand-warn); }
.insight-chip-good .insight-chip-tag { color: var(--brand); }
.insight-chip-more { color: var(--muted); font-style: italic; background: none; border-style: dashed; }

.zone-label {
  background: rgba(255,255,255,0.85);
  border: none;
  box-shadow: none;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--ink);
}

.print-only { display: none; }
@media print {
  .topbar, .no-print, a.button { display: none !important; }
  .container { max-width: 100%; }
  .print-only { display: inline-block; }
}

/* Rapport client : etat de sante par puce coloree (4 niveaux, memes
   couleurs que la legende de la carte), zones prioritaires et plus fortes
   baisses vs historique, grille trou x type de surface. */
.mono { font-family: ui-monospace, "SF Mono", "IBM Plex Mono", monospace; }

.state-chip {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: capitalize;
  white-space: nowrap;
}
.state-chip.state-critique { background: var(--status-critique); color: white; }
.state-chip.state-stress { background: var(--status-stress); color: #5c4a05; }
.state-chip.state-bon { background: var(--status-bon); color: white; }
.state-chip.state-excellent { background: var(--status-excellent); color: white; }

.priority-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.priority-row {
  display: grid;
  grid-template-columns: 4px 1fr auto auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
.priority-row:last-child { border-bottom: none; }
.priority-stripe { align-self: stretch; border-radius: 2px; }
.priority-stripe.state-critique { background: var(--status-critique); }
.priority-stripe.state-stress { background: var(--status-stress); }
.priority-where { font-weight: 600; }

.decline-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.decline-row {
  display: grid;
  grid-template-columns: 1fr auto 100px;
  align-items: center;
  gap: 0.9rem;
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.decline-row:last-child { border-bottom: none; }
.decline-pct { font-weight: 700; color: var(--brand-danger); }
.decline-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.decline-bar span { display: block; height: 100%; background: var(--brand-danger); }

.table-scroll { overflow-x: auto; }
table.hole-grid td, table.hole-grid th { white-space: nowrap; }

/* Masque spotlight (carte vol) : evenodd ignore le sens de tracage de
   chaque contour (horaire/antihoraire), sinon un trou du masque dessine
   dans le "mauvais" sens s'affiche plein au lieu d'etre decoupe. */
.spotlight-mask { fill-rule: evenodd; }

.weather-card { margin-bottom: 1.5rem; }
.weather-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.weather-head h2 { margin: 0; }
.weather-period { font-size: 0.85rem; color: var(--muted); }

.weather-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
}
@media (max-width: 600px) { .weather-metrics { grid-template-columns: 1fr; } }

.weather-metric {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}
.weather-metric::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}
.weather-metric:has(.weather-icon.rain)::before { background: var(--brand-2); }
.weather-metric:has(.weather-icon.et0)::before { background: var(--brand-warn); }
.weather-icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.weather-icon svg { width: 20px; height: 20px; }
.weather-icon.rain { background: #e5f0fa; color: var(--brand-2); }
.weather-icon.et0 { background: #fdf1de; color: var(--brand-warn); }

.weather-metric-body { flex: 1; min-width: 0; }
.weather-metric-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.weather-metric-value { font-size: 1.25rem; font-weight: 800; }
.weather-metric-label { font-size: 0.78rem; color: var(--muted); }
.weather-bar-track { position: relative; background: var(--bg); border-radius: 999px; height: 7px; margin-top: 0.4rem; }
.weather-bar-fill { height: 100%; border-radius: 999px; transition: width 0.3s ease; }
.weather-bar-fill.rain { background: var(--brand-2); }
.weather-bar-fill.et0 { background: var(--brand-warn); }
.weather-bar-normal {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: var(--ink); opacity: 0.5; border-radius: 1px;
}
.weather-normal-note { font-size: 0.78rem; color: var(--muted); margin-top: 0.35rem; }

.weather-extra {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1.4rem;
}
.weather-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.weather-chip-icon {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.weather-chip-icon svg { width: 18px; height: 18px; }
.weather-chip-icon.sun { background: #fdf1de; color: var(--brand-warn); }
.weather-chip-icon.rain-days { background: #e5f0fa; color: var(--brand-2); }
.weather-chip-icon.frost { background: #e6f6f8; color: #1f8a9e; }
.weather-chip > div:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.weather-chip-value { font-size: 1.05rem; font-weight: 800; }
.weather-chip-label { font-size: 0.76rem; color: var(--muted); }

.weather-balance {
  margin-top: 1.4rem;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.weather-balance.deficit { background: #fdecea; border-color: color-mix(in srgb, var(--brand-danger) 25%, var(--border)); }
.weather-balance.surplus { background: #eaf7ee; border-color: color-mix(in srgb, var(--brand) 25%, var(--border)); }
.weather-balance.neutral { background: var(--bg); }
.weather-balance-label { font-size: 0.85rem; color: var(--muted); }
.weather-balance-value { font-size: 1.15rem; font-weight: 800; }
.weather-balance-value.deficit { color: var(--brand-danger); }
.weather-balance-value.surplus { color: var(--brand); }

/* Les zones de la carte (Leaflet) sont interactives (tooltip au survol) donc
   focusables : un clic dessus declenche le rectangle de focus bleu par
   defaut du navigateur, qui ressemble a un contour de decoupe indesirable. */
.leaflet-interactive:focus { outline: none; }

.sensor-marker-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 14px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.sprinkler-marker-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 9px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  opacity: 0.85;
}
.layers-toggle { position: relative; }
.layers-panel {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0;
  /* Doit depasser le z-index du gauge de score sur la carte (500) et des
     panes Leaflet (jusqu'a ~1000), sinon ce panneau se retrouve rendu
     derriere eux tout en restant fonctionnel (meme piege que les boutons
     de zoom Avant/Apres plus tot dans ce projet). */
  z-index: 1200;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  padding: 0.7rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 180px;
}
.layers-panel label { display: flex; align-items: center; gap: 0.4rem; font-weight: 500; }
.layers-panel input[type="checkbox"] { width: auto; margin: 0; }

.photos-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 0.8rem;
  transition: border-color 0.15s, background 0.15s;
}
.photos-drop-zone.drag-over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, white); }
#photosDropStatus:empty { display: none; }
