/* WSC Ferme — séance de pesée (plan 2, lot TP, maquette 13) : grand clavier au pouce, poids en grand, moyenne,
   homogénéité et CV en direct, résumé de fin de séance. Composants préfixés « pe- ». Téléphone d'abord (360 à 412 px,
   cibles de 44 px et plus) ; au poste, la séance garde la largeur d'un téléphone, centrée. */

.pe-pile { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pe-ligne { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pe-tete { display: flex; align-items: center; gap: 10px; }
.pe-tete > .pe-pile { flex: 1; }
.pe-titre { font-size: 19px; font-weight: 800; }
.pe-bascule { flex: none; min-height: 40px; }
.pe-bascule.reliee { background: var(--ok-clair); color: var(--ok); border-color: transparent; }

/* ---------------------------------------------------------------- accueil */
.pe-lots { display: flex; flex-direction: column; gap: 10px; }
.pe-lot { display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-decoration: none; color: var(--encre); }
.pe-lot > .pe-pile { flex: 1; }
.pe-lot.due { border-color: var(--orange-trait); }
.pe-lot:hover { border-color: var(--orange-fonce); }
.pe-passees { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; }
.pe-passee { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--trait); text-decoration: none; color: var(--encre); min-height: 44px; }
.pe-passee:first-of-type { border-top: 0; }
.pe-passee > .pe-pile { flex: 1; }

/* ---------------------------------------------------------------- départ, reprise */
.pe-depart, .pe-reprise { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.pe-depart-titre { font-size: 20px; font-weight: 800; }
.pe-reprise h2 { font-size: 18px; font-weight: 800; }
.pe-methodes { align-self: flex-start; }
.pe-aides { display: flex; flex-wrap: wrap; gap: 6px; }
.pe-boutons { display: flex; flex-direction: column; gap: 10px; max-width: 560px; }

/* ---------------------------------------------------------------- la séance (maquette 13) */
.pe-direct { display: flex; flex-direction: column; gap: 14px; max-width: 520px; width: 100%; }
.pe-progression { display: flex; flex-direction: column; gap: 8px; }
.pe-segments { display: flex; gap: 3px; height: 8px; }
.pe-segments i { flex: 1; border-radius: 99px; background: var(--gris-clair); }
.pe-segments i.fait { background: var(--ok); }
.pe-segments i.saute { background: var(--trait-fort); }
.pe-segments i.ici { background: var(--orange); }
.pe-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--blanc); border: 1px solid var(--trait); border-radius: 14px; }
.pe-stats > div { padding: 9px 10px; display: flex; flex-direction: column; gap: 1px; border-left: 1px solid var(--trait); min-width: 0; }
.pe-stats > div:first-child { border-left: 0; }
.pe-stats b { font-size: 18px; font-weight: 800; white-space: nowrap; }
.pe-stats span { font-size: 12px; color: var(--gris); font-weight: 600; }
.pe-actuel { border: 2px solid var(--orange-fonce); box-shadow: 0 0 0 4px var(--orange-clair); background: var(--blanc); border-radius: 18px;
	padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 6px; }
.pe-poids { font-size: 56px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; display: flex; align-items: baseline; }
.pe-vide { color: var(--trait-fort); }
.pe-unite { font-size: 22px; letter-spacing: 0; color: var(--gris); margin-left: 6px; }
.pe-curseur { display: inline-block; width: 3px; height: 46px; background: var(--orange-fonce); margin-left: 3px; align-self: center; border-radius: 2px;
	animation: pe-clignote 1.1s steps(2, start) infinite; }
@keyframes pe-clignote { to { visibility: hidden; } }
.pe-classes { display: flex; gap: 6px; flex-wrap: wrap; }
.pe-precedent { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--gris); padding: 0 2px; min-height: 44px; }
.pe-precedent button { border: 0; background: none; color: var(--orange-nuit); font-weight: 700; padding: 6px 0; min-height: 44px; text-decoration: underline;
	text-underline-offset: 3px; cursor: pointer; font-size: 15px; }
.pe-clavier { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pe-clavier button { min-height: 58px; border-radius: 14px; border: 1px solid var(--trait-fort); background: var(--blanc); font-size: 26px; font-weight: 700;
	display: grid; place-items: center; color: var(--encre); cursor: pointer; touch-action: manipulation; }
.pe-clavier button:active { background: var(--orange-clair); border-color: var(--orange-fonce); }
.pe-clavier button[disabled] { color: var(--trait-fort); cursor: default; }
.pe-suivant[disabled] { opacity: .45; }
.pe-bas { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pe-bas:empty { display: none; }
.pe-bas .bouton:only-child { margin-left: auto; }
.pe-note { text-align: center; }

/* ---------------------------------------------------------------- résumé (maquette 13) */
.pe-resume { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.pe-grand-titre { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.pe-tuiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pe-tuile { background: var(--blanc); border: 1px solid var(--trait); border-radius: 16px; box-shadow: var(--ombre); padding: 12px 14px; display: flex;
	flex-direction: column; gap: 3px; min-width: 0; }
.pe-tuile strong { font-size: 26px; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; }
.pe-reperes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pe-reperes .puce { font-size: 12px; min-height: 24px; padding: 3px 8px; white-space: normal; line-height: 1.2; text-decoration: none; }
.pe-bloc { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.pe-histogramme { width: 100%; height: auto; max-width: 520px; }
.pe-classe { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--trait); }
.pe-classe:first-child { border-top: 0; }
.pe-pastille { width: 12px; height: 12px; border-radius: 4px; }
.pe-n { font-size: 20px; font-weight: 800; }
.pe-poids-liste { padding: 12px 16px; }
.pe-poids-liste summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center; }
.pe-poids-liste ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 4px 12px;
	font-size: 14px; }
.pe-action { border: 2px solid var(--orange-fonce); border-radius: var(--rayon); background: var(--blanc); padding: 14px 16px; display: flex;
	flex-direction: column; gap: 10px; max-width: 720px; }
.pe-action .surtitre { color: var(--orange-nuit); }
.pe-action.faite { border-color: var(--trait); }
.pe-action.faite .surtitre { color: var(--ok); }
.pe-action-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pe-action-liste li { display: flex; gap: 10px; align-items: flex-start; }
.pe-action-liste .ic { margin-top: 2px; color: var(--orange-fonce); }
.pe-boutons-ligne { display: flex; gap: 10px; flex-wrap: wrap; }
.pe-boutons-ligne .bouton.plein { flex: 1; min-width: 140px; }
.pe-modifier { display: flex; flex-direction: column; gap: 10px; }
.pe-modifier select.saisie { appearance: auto; }

@media (min-width: 900px) {
	.pe-direct { margin: 0 auto; }
	.pe-tuiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
	.pe-poids { font-size: 48px; }
	.pe-clavier button { min-height: 54px; }
	.pe-tuile strong { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) { .pe-curseur { animation: none; } }

/* ---------------------------------------------------------------- plan 3, lot P (maquette 25) : la bascule Bluetooth
   Séance reliée : le poids lu, le porc qui bouge ; page d'essai « Balance » (pe-ba-) ; les entrées de la séance dans
   la porcherie, la chair et le troupeau (pe-entree). Mêmes couleurs et composants que le reste de la séance. */
.pe-bascule.perdue { background: var(--ko-clair); color: var(--ko); border-color: transparent; }
.pe-actuel.bouge { border-color: var(--trait-fort); box-shadow: 0 0 0 4px var(--gris-clair); }
.pe-poids.bouge { color: #8C8279; }
.pe-lu { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pe-bouge { display: inline-flex; align-items: center; gap: 8px; color: var(--gris); font-weight: 700; font-size: 14px; }
.pe-bouge i { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); display: inline-block; animation: pe-pouls 1s ease-in-out infinite; }
@keyframes pe-pouls { 50% { opacity: .25; } }
.pe-bloc-bascule:empty { display: none; }
.pe-bloc-bascule { margin-top: 8px; }
.pe-lien { color: var(--orange-nuit); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; display: inline-flex; align-items: center; }
.pe-lu-icone { display: inline-flex; vertical-align: -3px; margin-left: 4px; color: var(--ok); }
.pe-lu-icone .ic { width: 15px; height: 15px; }
.pe-vers-balance .picto { color: var(--info); }

/* entrées : porcherie (fiche d'un lot), chair (fiche d'une bande), troupeau (un lot) */
.porc-actions a.pe-entree.bouton, .porc-actions .pe-entree-due { flex: 1 1 100%; }
a.pe-entree { text-decoration: none; }

/* page d'essai « Balance » */
.pe-balance { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.pe-ba-nom { padding: 0 2px; overflow-wrap: anywhere; }
.pe-ba-ligne { display: flex; gap: 10px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--trait); }
.pe-ba-ligne:first-of-type { border-top: 0; }
.pe-ba-ligne > .pe-pile { flex: 1; }
.pe-ba-rond { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.pe-ba-rond .ic { width: 17px; height: 17px; stroke-width: 2.5; }
.pe-ba-rond.ok { background: var(--ok-clair); color: var(--ok); }
.pe-ba-rond.ko { background: var(--ko-clair); color: var(--ko); }
.pe-ba-rond.neutre { background: var(--gris-clair); color: var(--gris); }
.pe-ba-rond.marque { background: var(--orange-clair); color: var(--orange-nuit); }
.pe-ba-etat { padding: 12px 16px 6px; display: flex; flex-direction: column; }
.pe-ba-etapes { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.pe-ba-etapes h2 { font-size: 19px; font-weight: 800; }
.pe-ba-etapes ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; counter-reset: etape; }
.pe-ba-etapes li { display: flex; gap: 12px; align-items: flex-start; counter-increment: etape; }
.pe-ba-etapes li::before { content: counter(etape); width: 26px; height: 26px; border-radius: 50%; background: var(--orange-clair); color: var(--orange-nuit);
	font-weight: 800; font-size: 14px; display: grid; place-items: center; flex: none; }
.pe-ba-details { padding: 12px 16px; }
.pe-ba-details summary { font-weight: 700; cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.pe-ba-details .pe-pile { gap: 10px; margin-top: 8px; align-items: flex-start; }
.pe-ba-simulee { border: 1px dashed var(--trait-fort); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; background: var(--blanc); }
.pe-ba-simulee .pe-pile { gap: 6px; align-items: flex-start; }
.pe-ba-note { text-align: center; }
.pe-ba-mesure { border: 2px solid var(--ok); box-shadow: 0 0 0 4px var(--ok-clair); background: var(--blanc); border-radius: 18px; padding: 12px 16px 14px;
	display: flex; flex-direction: column; gap: 6px; }
.pe-ba-mesure.bouge { border-color: var(--trait-fort); box-shadow: 0 0 0 4px var(--gris-clair); }
.pe-ba-comparer { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.pe-ba-champ { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pe-ba-saisie { flex: 1 1 160px; display: flex; align-items: center; gap: 8px; min-height: 50px; border: 1px solid var(--trait-fort); border-radius: 12px;
	background: var(--blanc); padding: 0 14px; }
.pe-ba-saisie input { flex: 1; min-width: 0; border: 0; padding: 0; min-height: 48px; font-size: 20px; font-weight: 800; background: transparent; box-shadow: none; }
.pe-ba-saisie:focus-within { border-color: var(--orange-fonce); box-shadow: 0 0 0 3px var(--orange-clair); }
.pe-ba-trame { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.pe-ba-octets { display: flex; flex-wrap: wrap; gap: 6px; }
.pe-ba-groupe { display: inline-flex; gap: 3px; padding: 4px; border-radius: 10px; background: var(--gris-clair); color: var(--gris); }
.pe-ba-groupe b { min-width: 30px; height: 30px; border-radius: 7px; background: var(--blanc); display: grid; place-items: center; font-size: 14px; font-weight: 800;
	letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.pe-ba-groupe.drapeaux { background: var(--info-clair); color: var(--info); }
.pe-ba-groupe.poids { background: var(--orange-clair); color: var(--orange-nuit); }
.pe-ba-groupe.heure { background: var(--ok-clair); color: var(--ok); }
.pe-ba-champs { display: flex; flex-direction: column; }
.pe-ba-champ-ligne { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--trait); }
.pe-ba-champ-ligne:first-child { border-top: 0; }
.pe-ba-champ-ligne > b { text-align: right; white-space: nowrap; }
.pe-ba-cle { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.pe-ba-c { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; background: #8C8279; }
.pe-ba-c.drapeaux { background: var(--info); }
.pe-ba-c.poids { background: var(--orange-fonce); }
.pe-ba-c.heure { background: var(--ok); }
.pe-ba-journal { padding: 12px 16px 6px; }
.pe-ba-releve { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--trait); }
.pe-ba-journal .surtitre + .pe-ba-releve { border-top: 0; }
.pe-ba-releve .pe-pile { min-width: 0; overflow-wrap: anywhere; }
.pe-ba-releve.ancienne b { color: var(--gris); }
.pe-balance .bouton { min-height: 44px; }
.pe-ba-boutons { display: flex; gap: 8px; padding: 10px 0; }
.pe-ba-boutons .bouton { flex: 1; }
.pe-ba-non { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; border-color: var(--ko-clair); }
.pe-ba-non h2 { font-size: 17px; font-weight: 800; color: var(--ko); }
@media (prefers-reduced-motion: reduce) { .pe-bouge i { animation: none; } }
.pe-direct .bouton, .pe-balance .bouton { min-height: 44px; }
