/* WSC Ferme — formules d'aliment et fabrication (plan 2, lot F), système visuel des maquettes 09 et 10 : cartes
   blanches, encre, orange d'action #C2410C, orange vif #F97316 pour les barres, vert pour la zone d'un besoin et ce qui
   va bien, une seule couleur d'accent. Tout est rangé sous .al (la page) et .al-modale (ses fenêtres). Poste : trois
   colonnes (matières, formule, coût) ; téléphone : une colonne, cibles de 44 px, aucun défilement horizontal. */

.al, .al-modale { --al-zone: #BFE3CB; }
.al .fort, .al-modale .fort { font-weight: 700; }
.al .pile, .al-modale .pile { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.al .rangee, .al-rangee { display: flex; align-items: center; gap: 10px; }
.al-entre { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.al .ko-texte, .al-modale .ko-texte { color: var(--ko); }
.al .num, .al-modale .num { font-variant-numeric: tabular-nums; }
.al.al-calcul .al-principal, .al.al-calcul .al-besoins { opacity: .55; transition: opacity .15s; }

/* ---------------------------------------------------------------- tête, onglets */
.al-tete { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.al-tete-texte { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.al-tete-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.al-tete-actions .bouton { white-space: nowrap; }
.al-onglets { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--gris-clair); align-self: flex-start;
	max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.al-onglets a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 9px; font-size: 13px; font-weight: 700;
	color: var(--gris); text-decoration: none; white-space: nowrap; }
.al-onglets .al-court { display: none; }
.al-onglets a[aria-current] { background: var(--blanc); color: var(--encre); box-shadow: 0 1px 2px rgba(31, 26, 21, .12); }

/* ---------------------------------------------------------------- cartes à tête */
.al .carte.al-c { padding: 0; }
.al-c-tete { padding: 16px 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.al-c-titre { font-size: 15px; font-weight: 800; }
.al-c-corps { padding: 12px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.al-vide { display: flex; gap: 16px; align-items: flex-start; }
.al-vide h2 { font-size: 18px; font-weight: 800; }
.al-note.ko { background: var(--ko-clair); color: var(--ko); border-color: transparent; font-weight: 600; }

/* ---------------------------------------------------------------- choix de l'espèce et du stade */
.al .al-choix { padding: 14px 18px; display: flex; align-items: center; gap: 12px 22px; flex-wrap: wrap; }
.al-groupe { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.al-boutons { display: flex; gap: 6px; flex-wrap: wrap; }
.al-boutons button, .al-boutons .al-tab { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--trait-fort); background: var(--blanc);
	font-size: 14px; font-weight: 700; color: var(--encre); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.al-boutons button[aria-pressed="true"], .al-boutons .al-tab[aria-current] { background: var(--encre); border-color: var(--encre); color: #fff; }
.al-boutons button[disabled] { opacity: .5; cursor: not-allowed; }
.al-boutons.petits button { min-height: 32px; font-size: 13px; padding: 0 10px; }
.al-age { flex-basis: 100%; margin-top: -4px; }

/* ---------------------------------------------------------------- trois colonnes */
.al-principal { display: grid; grid-template-columns: 330px minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.al-colonne { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.al-principal.sans-formule > .al-impossible { grid-column: 2 / 4; }
.al-deux-colonnes { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }

/* vos matières */
.al-matieres .al-c-corps { gap: 0; }
.al-matiere { display: grid; grid-template-columns: minmax(0, 1fr) 50px 52px; gap: 8px; align-items: center; width: 100%; min-height: 30px;
	padding: 3px 4px; margin: 0 -4px; border: 0; border-radius: 8px; background: none; font-size: 13.5px; text-align: left; cursor: pointer; color: var(--encre); }
.al-matiere:hover { background: var(--fond); }
.al-nom { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; row-gap: 2px; }
.al-nom-texte { min-width: 0; }
.al-pt, .al-pt-legende { width: 8px; height: 8px; border-radius: 50%; background: var(--trait-fort); flex: none; display: inline-block; }
.al-pt-legende { background: var(--orange-fonce); margin-right: 5px; }
.al-matiere.dedans .al-pt { background: var(--orange-fonce); }
.al-matiere:not(.dedans) .al-nom-texte { color: var(--gris); }
.al-matiere.ecartee .al-nom-texte { text-decoration: line-through; }
.al-ecartees { margin-top: 8px; color: var(--gris); }
.al-ferme { font-size: 11px; font-weight: 800; color: var(--ok); background: var(--ok-clair); border-radius: 99px; padding: 1px 7px; white-space: nowrap; margin-left: 6px; }
.al-nom .al-ferme { margin-left: 0; }
.al-prix { text-align: right; white-space: nowrap; font-weight: 700; }
.al-stock { text-align: right; white-space: nowrap; color: var(--gris); font-size: 13px; }
.al-sans-prix { margin-top: 8px; }
.al-lien { border: 0; background: none; padding: 0; color: var(--orange-nuit); font: inherit; font-weight: 700; text-decoration: underline;
	text-underline-offset: 3px; cursor: pointer; min-height: 24px; }
.al-lien.clair { color: #FDBA74; }
.al-reglage { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--trait); }
.al-case { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; font-weight: 600; min-height: 32px; cursor: pointer; }
.al-case input { width: 18px; height: 18px; accent-color: var(--orange-fonce); }

/* la formule */
table.al-t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.al-t th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--gris); padding: 8px;
	border-bottom: 1px solid var(--trait-fort); white-space: nowrap; }
table.al-t td { padding: 8px; border-bottom: 1px solid var(--trait); vertical-align: middle; }
table.al-t tbody tr:last-child td { border-bottom: 0; }
table.al-t .d { text-align: right; }
table.al-t.serre td { white-space: nowrap; padding: 11px 8px; }
table.al-t tfoot td { border-top: 1px solid var(--trait-fort); border-bottom: 0; font-weight: 800; }
table.al-t tr[aria-current] td { background: var(--orange-clair); }
.al-table-formule td:first-child { min-width: 0; }
.al-part { display: flex; align-items: center; gap: 8px; justify-content: flex-end; white-space: nowrap; }
.al-part i { display: block; height: 6px; border-radius: 99px; background: var(--orange); flex: none; }
.al-limite { font-size: 11px; font-weight: 700; color: var(--gris); background: var(--gris-clair); border-radius: 99px; padding: 1px 7px; margin-left: 6px;
	white-space: nowrap; display: inline-block; }
.al-valider { background: var(--orange-clair); border: 1px solid var(--orange-trait); color: var(--orange-nuit); border-radius: 12px; padding: 10px 12px;
	font-size: 13px; font-weight: 700; display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.al-arrondi { margin-top: 4px; }
.al-absentes { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--trait); display: flex; flex-direction: column; gap: 4px; }

/* coût du sac (carte sombre) */
.al-prix-sac, .al-cout { background: var(--encre); color: #fff; border-radius: var(--rayon); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.al-prix-sac strong, .al-cout strong { font-size: 32px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
.al-detail { color: #D8CFC4; font-size: 13px; }
.al-trait { border-top: 1px solid rgba(255, 255, 255, .16); margin: 6px 0 2px; }
.al-prix-sac .al-entre b { white-space: nowrap; }
.al-gain { font-size: 22px; font-weight: 800; color: #86EFAC; letter-spacing: -.2px; }
.al-gain.plus { color: #FDBA74; }
.al-autre { color: var(--orange-nuit); }

/* formule impossible */
.al-manques { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.al-debloque { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.al-debloque .al-entre { min-height: 40px; border-top: 1px solid var(--trait); padding-top: 6px; }

/* besoins en jauges */
.al-besoins { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px 28px; }
.al-jauge { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.al-valeur { font-weight: 800; white-space: nowrap; }
.al-piste { position: relative; height: 10px; border-radius: 99px; background: var(--gris-clair); }
.al-zone { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: var(--al-zone); }
.al-point { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--ok); border: 2px solid #fff;
	box-shadow: 0 0 0 1px var(--ok); }
.al-jauge.hors .al-point { background: var(--ko); box-shadow: 0 0 0 1px var(--ko); }
.al-bornes { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--gris); flex-wrap: wrap; }
.al-ecart { font-size: 12px; font-weight: 700; color: var(--ok); white-space: nowrap; }
.al-jauge.hors .al-ecart { color: var(--ko); }
.al-lire { font-size: 13px; color: var(--gris); display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.al-lire b { color: var(--encre); }
.al-sources { max-width: 70ch; text-align: right; }
.al-pied a { font-weight: 700; }
.al-toutes-sources { margin-top: 12px; }
.al-toutes-sources summary { cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; font-weight: 700; }
.al-toutes-sources ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }

/* formules enregistrées, fiche */
.al-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.al-fiche-lien, .al-ordre { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--encre); }
.al-fiche-lien:hover, .al-ordre:hover { border-color: var(--orange-trait); }
.al-fiche-titre, .al-ordre-titre { font-size: 17px; font-weight: 800; line-height: 1.25; }
.al-marque { color: var(--orange-nuit); font-weight: 700; }
.al-bandeau { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.al-bandeau.ok { background: var(--ok-clair); color: var(--ok); }
.al-bandeau.marque { background: var(--orange-clair); color: var(--orange-nuit); border: 1px solid var(--orange-trait); }
.al-bandeau.ko { background: var(--ko-clair); color: var(--ko); }
.al-bandeau.neutre { background: var(--gris-clair); color: var(--gris); }
.al-note-formule { margin-top: 8px; }
.al-ligne-lien { min-height: 44px; border-top: 1px solid var(--trait); text-decoration: none; color: var(--encre); padding: 6px 0; }
.al-ligne-lien:first-child { border-top: 0; }
.al-droite { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.al-stade { display: flex; flex-direction: column; gap: 6px; }
.al-stade .bouton { align-self: flex-start; }

/* ---------------------------------------------------------------- fabrication (téléphone d'abord, maquette 10) */
.al.al-etroite { max-width: 560px; }
.al-tete-retour { display: flex; align-items: center; gap: 6px; }
.al-ordre-tete { display: flex; flex-direction: column; gap: 6px; }
.al-titre-ordre { font-size: 22px; font-weight: 800; letter-spacing: -.3px; line-height: 1.15; }
.al-puces { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.al-faux-bouton { pointer-events: none; }
.al-gachees { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.al-gachee { border: 1px solid var(--trait); border-radius: 12px; padding: 9px 12px; display: flex; flex-direction: column; gap: 1px; background: var(--blanc);
	text-align: left; font: inherit; color: var(--encre); min-height: 56px; }
.al-gachee b { font-size: 15px; }
button.al-gachee { cursor: pointer; }
.al-gachee.faite { background: var(--ok-clair); border-color: transparent; color: var(--ok); }
.al-gachee.encours { border: 2px solid var(--orange-fonce); background: var(--orange-clair); padding: 8px 11px; }
.al-gachee.encours b, .al-gachee.encours span { color: var(--orange-nuit); }
.al .carte.al-bloc { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.al-pesees { list-style: none; margin: 0; padding: 0; }
.al-pesees li { border-top: 1px solid var(--trait); }
.al-pesees li:first-child { border-top: 0; }
.al-pesee { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 9px 0;
	border: 0; background: none; text-align: left; font: inherit; color: var(--encre); cursor: pointer; }
.al-pesee:disabled { cursor: default; }
.al .coche { width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--trait-fort); background: var(--blanc); display: grid; place-items: center; flex: none; }
.al .coche .ic { width: 17px; height: 17px; stroke-width: 3; }
.al .coche.faite { background: var(--ok); border-color: var(--ok); color: #fff; }
.al-p-nom { font-weight: 700; font-size: 15px; line-height: 1.2; }
.al-p-cible { font-size: 13px; color: var(--gris); }
.al-balance { color: var(--info); font-weight: 700; }
.al-p-pese { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.al-p-pese b { font-size: 18px; font-weight: 800; white-space: nowrap; }
.al-p-ecart { font-size: 12px; font-weight: 600; color: var(--gris); white-space: nowrap; }
.al-p-ecart.ko { color: var(--ko); font-weight: 800; }
.al-note-ko { display: block; margin: -2px 0 10px 40px; font-size: 13px; color: var(--ko); background: var(--ko-clair); border-radius: 10px; padding: 6px 10px; }
.al-bilan { background: var(--fond); border-radius: 12px; padding: 2px 12px; font-size: 14px; }
.al-bilan .al-entre { padding: 8px 0; min-height: 40px; border-top: 1px solid var(--trait); }
.al-bilan .al-entre:first-child { border-top: 0; }
.al-cout strong { font-size: 30px; }
.al-reperes { display: flex; gap: 6px; flex-wrap: wrap; }
.al-reperes .puce { background: rgba(255, 255, 255, .12); color: #fff; white-space: normal; }
.al-reperes .puce.ok { background: #DCF3E4; color: #0F5C2C; }
.al-centre { text-align: center; }
.al-annuler { align-self: center; }

/* ---------------------------------------------------------------- fenêtres */
.al-modale .al-deux, .al .al-deux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.al-modale.large { max-width: 720px; }
.al-modale .al-valider { margin-top: 0; }
.al-modale .al-grand { min-height: 64px; text-align: center; font-size: 30px; font-weight: 800; }
.al-ecart-direct { font-size: 15px; font-weight: 700; color: var(--gris); text-align: center; min-height: 22px; }
.al-ecart-direct.ok { color: var(--ok); }
.al-ecart-direct.ko { color: var(--ko); }
.al-composants { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.al-valeurs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 18px; }
.al-ligne-valeur { min-height: 40px; border-top: 1px solid var(--trait); }
.al-petit-champ { width: 96px; min-height: 40px; text-align: right; flex: none; }
.al-modale table .al-petit-champ { width: 84px; }
.al-mot { font-size: 12px; }
.al-grille-champs { display: flex; flex-direction: column; }
.al-gc-tete, .al-gc-ligne { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 88px); gap: 8px; align-items: center; }
.al-grille-champs.deux .al-gc-tete, .al-grille-champs.deux .al-gc-ligne { grid-template-columns: minmax(0, 1fr) repeat(2, 88px); }
.al-gc-tete { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--gris); padding: 4px 0 6px;
	border-bottom: 1px solid var(--trait-fort); }
.al-gc-tete span:not(:first-child) { text-align: right; }
.al-gc-ligne { padding: 6px 0; border-bottom: 1px solid var(--trait); }
.al-gc-ligne > span:not(.al-gc-nom) { text-align: right; }
.al-grille-champs .al-petit-champ { width: 100%; }

/* ---------------------------------------------------------------- écrans moyens et téléphone */
@media (max-width: 1240px) {
	.al-principal { grid-template-columns: 300px minmax(0, 1fr); }
	.al-principal > .al-colonne { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
	.al-principal.sans-formule > .al-impossible { grid-column: 2; }
	.al-besoins { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
	.al-principal, .al-deux-colonnes { grid-template-columns: minmax(0, 1fr); }
	.al-principal > .al-colonne { grid-template-columns: minmax(0, 1fr); display: flex; }
	.al-principal.sans-formule > .al-impossible { grid-column: auto; }
	/* au téléphone : la formule et son coût d'abord, les matières ensuite */
	.al-principal > .al-formule, .al-principal > .al-impossible { order: 1; }
	.al-principal > .al-colonne { order: 2; }
	.al-principal > .al-matieres { order: 3; }
	.al-toutes-sources summary { min-height: 44px; }
	.al-besoins { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
	.al-tete-actions { width: 100%; }
	.al-tete-actions .bouton { flex: 1; }
	.al-boutons button, .al-boutons .al-tab, .al-boutons.petits button { min-height: 44px; }
	.al-matiere { min-height: 44px; }
	.al-lien { min-height: 44px; }
	.al-case { min-height: 44px; }
	.al-onglets a { min-height: 44px; }
	.al-sources { text-align: left; }
	.al-valeurs { grid-template-columns: minmax(0, 1fr); }
	.al-grille { grid-template-columns: minmax(0, 1fr); }
	.al-prix-sac strong { font-size: 30px; }
}
@media (max-width: 520px) {
	.al-onglets .al-long { display: none; }
	.al-onglets .al-court { display: inline; }
	.al-onglets a { padding: 0 9px; }
	.al .al-1t { display: none; }
	.al-modale .al-1t { display: none; }
	table.al-t td, table.al-t th { padding: 8px 5px; }
	.al-part i { display: none; }
	.al-besoins { grid-template-columns: minmax(0, 1fr); }
	.al-modale .al-deux, .al .al-deux { grid-template-columns: minmax(0, 1fr); }
	.al-gc-tete, .al-gc-ligne, .al-grille-champs.deux .al-gc-tete, .al-grille-champs.deux .al-gc-ligne { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.al-grille-champs.deux .al-gc-tete, .al-grille-champs.deux .al-gc-ligne { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.al-gc-nom, .al-gc-tete > span:first-child { grid-column: 1 / -1; text-align: left !important; }
	.al .al-choix { padding: 12px 14px; }
	.al-matiere { grid-template-columns: minmax(0, 1fr) 46px 50px; }
}
