.filtres { display: grid; gap: 8px; }
.champ-recherche { position: relative; }
.champ-recherche input { padding-right: 34px; }
.champ-recherche .jeter { position: absolute; right: 4px; top: 5px; }

.ligne-outils { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }

.puces { display: flex; flex-wrap: wrap; gap: 5px; }

.puces button, .puce {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--fh-surface-2);
  border: 1px solid transparent;
  color: var(--fh-muted);
  font-size: 11.5px;
  font-weight: 600;
}

.puces button.actif {
  color: var(--fh-orange);
  background: color-mix(in srgb, var(--fh-orange) 12%, transparent);
  border-color: color-mix(in srgb, var(--fh-orange) 40%, transparent);
}

.segments { display: inline-flex; padding: 3px; border: 1px solid var(--fh-line); border-radius: 10px; background: var(--fh-surface-2); }
.segments button { min-height: 30px; padding: 0 11px; border: 0; background: transparent; color: var(--fh-muted); font-size: 12px; }
.segments button.actif { color: var(--fh-ink); background: var(--fh-surface); box-shadow: var(--fh-shadow); }

.liste { display: grid; gap: 5px; align-content: start; }
/* Vue en vignettes en flex, pas en grille CSS : au-dela d'une centaine de
   cartes, les rangees auto s'effondraient a la hauteur d'une ligne de texte
   et les vignettes debordaient sur leurs voisines. */
.liste.grille { display: flex; flex-wrap: wrap; gap: 8px; align-content: start; }

.carte {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  min-width: 0;
  gap: 10px;
  align-items: center;
  padding: 8px;
  min-height: 58px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  font-weight: 400;
}

.carte:hover { background: var(--fh-surface-2); border-color: var(--fh-line); }

.carte.actif {
  background: var(--fh-surface);
  border-color: var(--fh-orange);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--fh-orange) 18%, transparent);
}

.carte-visuel {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--fh-surface-2);
  color: var(--fh-muted);
  font-weight: 650;
  font-size: 12px;
  overflow: hidden;
}

.carte-visuel img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carte-textes { display: flex; flex-direction: column; min-width: 0; }
.carte-textes strong { font-size: 12.5px; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-textes small { color: var(--fh-muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-marques { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 11px; }

/* En grille, la carte redevient un bloc simple : un bouton en grille ne prend
   pas la hauteur de ses lignes, et la vignette debordait sur ses voisines. */
.liste.grille .carte { display: block; flex: 0 1 calc(50% - 4px); min-height: 0; padding: 9px; text-align: center; }
.liste.grille .carte-visuel { width: 100%; height: 84px; margin-bottom: 7px; }
.liste.grille .carte-textes { width: 100%; min-width: 0; text-align: center; }
.liste.grille .carte-marques { flex-direction: row; justify-content: center; margin-top: 5px; }

.pastille { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #c8c6bf; }
.pastille.conforme { background: var(--succes); }
.pastille.probleme { background: var(--fh-orange); }
.etoile { color: var(--fh-orange); }

.vide { padding: 24px 12px; text-align: center; color: var(--fh-muted); }

.entete-fiche { display: flex; align-items: center; justify-content: space-between; }
.entete-fiche h2 { margin: 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--fh-muted); }

.fiche { display: grid; gap: 10px; align-content: start; }
.fiche-bloc { padding: 12px; border: 1px solid var(--fh-line); border-radius: 14px; background: var(--fh-surface); box-shadow: var(--fh-shadow); }
.fiche-bloc h3 { margin: 0 0 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--fh-muted); }
.fiche-ligne { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; padding: 4px 0; }
.fiche-ligne dt { color: var(--fh-muted); font-size: 11.5px; }
.fiche-ligne dd { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.fiche dl { margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }

.recette-rapide { flex-direction: column; align-items: stretch; gap: 8px; }
.recette-rapide .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.etat-recette { font-size: 11.5px; color: var(--fh-muted); }

.chargement {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(17, 24, 35, .84);
  color: #e7ecf3;
  font-size: 12px;
}

.chargement i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .25);
  border-top-color: var(--fh-orange-2);
  animation: tourner .7s linear infinite;
}

@keyframes tourner { to { transform: rotate(360deg); } }

.erreur {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #2a1512;
  color: #ffd9d0;
  font-size: 12px;
  text-align: center;
}

dialog {
  border: 0;
  border-radius: 24px;
  padding: 0;
  width: min(820px, 94vw);
  color: var(--fh-ink);
  background: var(--fh-surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}

dialog::backdrop { background: rgba(20, 25, 37, .6); }
dialog form { padding: 22px; display: grid; gap: 14px; position: relative; }
dialog .fermer { position: absolute; right: 14px; top: 14px; }
dialog h2 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.03em; }
dialog label { display: grid; gap: 6px; font-weight: 600; font-size: 12px; }
dialog fieldset { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; padding: 12px; border: 1px solid var(--fh-line); border-radius: 14px; }
dialog .actions { display: flex; flex-wrap: wrap; gap: 8px; }

.indicateurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.indicateurs article { padding: 14px; border: 1px solid var(--fh-line); border-radius: 16px; background: var(--fh-surface); box-shadow: var(--fh-shadow); }
.indicateurs strong { display: block; font-size: 24px; font-weight: 650; letter-spacing: -.04em; }
.indicateurs span { color: var(--fh-muted); font-size: 11.5px; }

.tableau-recette { max-height: 42vh; overflow: auto; border: 1px solid var(--fh-line); border-radius: 14px; }
.tableau-recette table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tableau-recette th, .tableau-recette td { padding: 9px 11px; text-align: left; border-bottom: 1px solid var(--fh-line); }
.tableau-recette th { position: sticky; top: 0; background: var(--fh-surface); color: var(--fh-muted); font-size: 11px; }
.tableau-recette tr:last-child td { border-bottom: 0; }
.tableau-recette tbody tr { cursor: pointer; }
.tableau-recette tbody tr:hover { background: var(--fh-surface-2); }

.progression { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--fh-muted); }
