* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* prime sur #app{display:flex} / #portail{display:flex} */
html, body { margin: 0; height: 100%; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #222; }

/* Vue principale */
#app { display: flex; flex-direction: column; height: 100%; }
header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: .7rem 1.5rem; background: #3d6b4a; color: #fff; flex-wrap: wrap; }
header h1 { margin: 0; font-size: 1.15rem; }
.sous-titre { margin: .15rem 0; font-size: .9rem; opacity: .95; }
.badge { background: #f0ad4e; color: #222; font-size: .7rem; padding: .1rem .4rem; border-radius: 4px; margin-left: .4rem; }
.zones { margin: .1rem 0 0; font-size: .85rem; opacity: .9; }
.filtre-zone { display: flex; align-items: center; gap: .55rem; }
.filtre-label { font-size: .9rem; opacity: .95; white-space: nowrap; }
.filtre { display: inline-flex; gap: 2px; background: rgba(255,255,255,.18); padding: 3px; border-radius: 9px;
  border: 1px solid rgba(255,255,255,.35); }
.filtre button { border: 0; padding: .55rem 1.1rem; border-radius: 7px; cursor: pointer;
  background: transparent; color: #fff; font-weight: 600; font-size: .92rem; transition: background .15s; }
.filtre button:hover { background: rgba(255,255,255,.15); }
.filtre button.actif { background: #fff; color: #234; box-shadow: 0 1px 3px rgba(0,0,0,.25); }

main { flex: 1; display: flex; min-height: 0; }
#carte { flex: 1; min-height: 300px; }
#fiche { width: 340px; padding: 1.3rem 2rem 1.3rem 1.6rem; background: #f7f7f5; border-left: 1px solid #ddd; overflow: auto; }
#fiche td:last-child { padding-right: .2rem; }
#fiche h2 { font-size: 1rem; margin: 0 0 .6rem; }
#fiche .hint { color: #888; font-size: .9rem; }
.fiche-hint-moyenne { color: #777; font-size: .78rem; font-style: italic; margin: 0 0 .6rem; }
#fiche table { width: 100%; border-collapse: collapse; font-size: .9rem; }
#fiche td { padding: .25rem 0; border-bottom: 1px solid #eee; }
#fiche td:first-child { color: #666; }
#fiche td:last-child { text-align: right; font-weight: 600; }

/* Légende (S5.6) */
.legende { background: #fff; padding: .5rem .6rem; border-radius: 6px; box-shadow: 0 1px 5px rgba(0,0,0,.3); font-size: .8rem; line-height: 1.4; }
.legende .barre { height: 10px; width: 140px; border-radius: 3px;
  background: linear-gradient(to right, rgb(0,255,0), rgb(255,255,0), rgb(255,0,0)); margin: 3px 0; }
.legende .bornes { display: flex; justify-content: space-between; }

#liste-mobile { display: none; }

/* Responsive (S5.5) */
@media (max-width: 768px) {
  main { flex-direction: column; }
  #fiche { width: auto; border-left: 0; border-top: 1px solid #ddd; max-height: 40vh; }
  #fiche.vide { display: none; }
  #liste-mobile { display: block; padding: .5rem 1rem; background: #fff; overflow: auto; max-height: 35vh; }
  #liste-mobile h3 { margin: .6rem 0 .3rem; font-size: .95rem; }
  #liste-mobile .parcelle { display: flex; align-items: center; gap: .5rem; padding: .2rem 0; font-size: .85rem; }
  #liste-mobile .pastille { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
}
