/* WSC Ferme — tâches, agenda partagé et fil d'observations (plan 2, lot TP, maquette 17). Composants de la maquette
   (docs/maquettes/maquettes-plan2.css : tâche, coche ronde, fil, composeur, agenda), préfixés « tp- » pour ne rien
   changer aux autres écrans. Poste ≥ 900 px ; téléphone 360 à 412 px, cibles de 44 px. */

/* ---------------------------------------------------------------- petits composants */
.tp-pile { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tp-rangee { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tp-avatar { width: 36px; height: 36px; font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.tp-avatar.mini { width: 26px; height: 26px; font-size: 11px; }
.tp-avatar.info { background: var(--info-clair); color: var(--info); }
.tp-avatar.ko { background: var(--ko-clair); color: var(--ko); }
.tp-avatar .ic { width: 17px; height: 17px; }
.tp-segment { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--gris-clair); flex-wrap: wrap; }
.tp-segment a, .tp-segment button { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 9px;
	font-size: 14px; font-weight: 700; color: var(--gris); text-decoration: none; border: 0; background: none; cursor: pointer; }
.tp-segment [aria-current="page"], .tp-segment [aria-pressed="true"] { background: var(--blanc); color: var(--encre); box-shadow: 0 1px 2px rgba(31, 26, 21, .12); }
.tp-barre { height: 8px; border-radius: 99px; background: var(--gris-clair); overflow: hidden; }
.tp-barre i { display: block; height: 100%; background: var(--orange); border-radius: 99px; }
.tp-jourx { width: 46px; flex: none; text-align: center; border-radius: 10px; background: var(--gris-clair); padding: 5px 0; font-weight: 800;
	line-height: 1.1; font-size: 17px; }
.tp-jourx small { display: block; font-size: 11px; text-transform: uppercase; color: var(--gris); letter-spacing: .4px; }
.tp-photo { display: block; border-radius: 12px; overflow: hidden; background: #E9E1D6; position: relative; flex: none; }
.tp-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tp-photo-bouton { position: relative; border: 0; padding: 0; background: none; cursor: zoom-in; border-radius: 12px; display: block; }
.tp-photo-tache { width: 52px; height: 52px; }
.tp-photo-message { width: 100%; height: 150px; }
.tp-photo-grande { width: 100%; min-height: 160px; max-height: 60vh; }
.tp-photo-grande img { object-fit: contain; max-height: 60vh; background: var(--encre); }
.tp-photo-carte { width: 100%; height: 90px; margin-top: 6px; }
.tp-mini { width: 20px; height: 20px; border-radius: 5px; margin-right: -2px; }
.tp-heure { position: absolute; left: 6px; bottom: 6px; background: rgba(31, 26, 21, .72); color: #fff; font-size: 11px; font-weight: 700;
	padding: 2px 6px; border-radius: 6px; }
.tp-mention { color: var(--orange-nuit); font-weight: 700; background: var(--orange-clair); border-radius: 6px; padding: 0 4px; }
.tp-note { font-size: 13px; color: var(--gris); }
.tp-interrupteur { display: flex; align-items: center; gap: 12px; min-height: 44px; border: 0; background: none; padding: 4px 0; text-align: left;
	cursor: pointer; font-weight: 700; color: var(--encre); }
.tp-interrupteur > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.tp-interrupteur > span:last-child .ic { display: inline; vertical-align: -3px; margin-right: 6px; }
.tp-interrupteur small { font-weight: 500; color: var(--gris); font-size: 13px; }
.tp-glissiere { width: 44px; height: 26px; border-radius: 99px; background: var(--trait-fort); position: relative; flex: none; transition: background .15s; }
.tp-glissiere::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
	box-shadow: 0 1px 2px rgba(31, 26, 21, .25); transition: transform .15s; }
.tp-interrupteur[aria-checked="true"] .tp-glissiere { background: var(--orange-fonce); }
.tp-interrupteur[aria-checked="true"] .tp-glissiere::after { transform: translateX(18px); }

/* ---------------------------------------------------------------- Mes tâches (téléphone d'abord) */
.tp-avance { display: flex; align-items: center; gap: 14px; }
.tp-anneau { width: 56px; height: 56px; flex: none; position: relative; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.tp-anneau svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.tp-jour { font-size: 20px; font-weight: 800; letter-spacing: -.2px; }
.tp-vers-equipe { margin-left: auto; white-space: nowrap; flex: none; }
.tp-liste { padding: 4px 18px; }
.tp-tache { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: start; padding: 12px 0; border-top: 1px solid var(--trait); }
.tp-tache:first-child { border-top: 0; }
.tp-coche { width: 44px; height: 44px; border-radius: 50%; border: 0; background: none; padding: 7px; cursor: pointer; display: grid; place-items: center; }
.tp-coche::before { content: ""; grid-area: 1 / 1; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--trait-fort); background: var(--blanc); box-sizing: border-box; }
.tp-coche .ic { grid-area: 1 / 1; width: 17px; height: 17px; stroke-width: 3; color: #fff; position: relative; }
.tp-coche:hover::before { border-color: var(--orange-fonce); }
.tp-coche[disabled] { cursor: default; }
.tp-tache.faite .tp-coche::before { background: var(--ok); border-color: var(--ok); }
.tp-tache.faite .tp-quoi { color: var(--gris); }
.tp-tache .tp-quoi { font-weight: 700; font-size: 16px; color: var(--encre); text-decoration: none; padding-top: 9px; }
.tp-tache a.tp-quoi { text-decoration: underline; text-decoration-color: var(--orange-trait); text-underline-offset: 3px; }
.tp-quand { font-size: 13px; color: var(--gris); display: block; }
.tp-quand.ko { color: var(--ko); font-weight: 600; }
.tp-quand .ic { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; margin-right: 5px; }
.tp-tache .tp-quand { font-size: 14px; }
.tp-carte-tache .tp-quand { display: flex; align-items: center; gap: 6px; }
.tp-avec-icone .ic { display: inline-block; vertical-align: -3px; margin-right: 6px; }
.tp-encore { cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--orange-nuit); background: var(--orange-clair);
	border-color: var(--orange-trait); }
.tp-encore .ic { color: var(--orange-nuit); }
.tp-jour-liste { display: flex; flex-direction: column; gap: 6px; }
.tp-tache.vive { margin: 4px -10px; padding: 12px 10px; border: 2px solid var(--orange-fonce); border-radius: 14px; background: var(--orange-clair);
	box-shadow: 0 0 0 3px #FFE9D5; }
.tp-tache.vive + .tp-tache { border-top: 0; }
.tp-tache.vive .tp-coche::before { border-color: var(--orange-fonce); }
.tp-tache.vive .bouton { margin-top: 10px; width: 100%; }
.tp-tache.retard .tp-coche::before { border-color: var(--ko); }
.tp-vide { display: flex; gap: 14px; align-items: center; }
.tp-bientot { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; }
.tp-bientot .surtitre { margin-bottom: 4px; }
.tp-bientot-ligne { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--trait); font-size: 15px; }
.tp-bientot-ligne:nth-child(2) { border-top: 0; }
.tp-bientot-ligne > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.tp-signaler { background: var(--blanc); }

/* ---------------------------------------------------------------- poste : par personne, fil, agenda */
.tp-tete { align-items: flex-end; }
.tp-puces { display: flex; gap: 8px; flex-wrap: wrap; }
.tp-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tp-grille { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.tp-grille.seule { grid-template-columns: minmax(0, 1fr); }
.tp-c-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 10px; }
.tp-c-titre { font-size: 16px; font-weight: 800; }
.tp-equipe { padding: 18px 20px; }
.tp-personne { display: grid; grid-template-columns: 196px 96px minmax(0, 1fr); gap: 14px; align-items: center; padding: 11px 0;
	border-top: 1px solid var(--trait); }
.tp-c-tete + .tp-personne { border-top: 0; }
.tp-qui-p { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tp-avancement { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.tp-taches-p { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-puce { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--trait-fort);
	background: var(--blanc); font-size: 13px; font-weight: 600; color: var(--encre); cursor: pointer; max-width: 100%; text-align: left; }
.tp-puce .ic { width: 14px; height: 14px; stroke-width: 2.5; }
.tp-puce.ok { background: var(--ok-clair); border-color: transparent; color: var(--ok); }
.tp-puce.ko { background: var(--ko-clair); border-color: transparent; color: var(--ko); }
.tp-puce.photo-d { border-color: var(--orange-trait); background: var(--orange-clair); color: var(--orange-nuit); }
.tp-puce[aria-pressed="true"] { border-color: var(--orange-fonce); background: var(--orange-clair); color: var(--orange-nuit); }
.tp-fil-poste { padding: 18px 18px 16px; }
.tp-fil { display: flex; flex-direction: column; gap: 12px; }
.tp-message { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; }
.tp-bulle { background: var(--blanc); border: 1px solid var(--trait); border-radius: 4px 16px 16px 16px; padding: 10px 12px; display: flex;
	flex-direction: column; gap: 8px; min-width: 0; }
.tp-message.auto .tp-bulle { background: var(--ko-clair); border-color: #F3C1BB; }
.tp-qui { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.tp-qui b { font-size: 14px; }
.tp-texte { font-size: 15px; overflow-wrap: anywhere; white-space: pre-line; }
.tp-lien-tache { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--orange-nuit);
	background: var(--orange-clair); border-radius: 8px; padding: 5px 8px; align-self: flex-start; }
.tp-lien-tache.ok { color: var(--ok); background: var(--ok-clair); }
.tp-lien-tache .ic { width: 14px; height: 14px; }
.tp-vu { font-size: 12px; color: var(--gris); }
.tp-lien { color: var(--orange-fonce); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.tp-partager { margin-left: auto; display: inline-grid; place-items: center; color: var(--gris); text-decoration: none; width: 32px; height: 32px;
	margin-top: -6px; margin-bottom: -6px; border-radius: 8px; flex: none; }
.tp-partager .ic { width: 16px; height: 16px; }
.tp-qui { align-items: center; }
.tp-partager:hover { color: var(--orange-nuit); background: var(--orange-clair); }
.tp-ecrire { min-height: 46px; border: 1px solid var(--trait-fort); border-radius: 999px; display: flex; align-items: center; justify-content: space-between;
	padding: 0 5px 0 16px; color: var(--gris); font-size: 14px; text-decoration: none; }
.tp-rond { width: 36px; height: 36px; border-radius: 50%; background: var(--orange-fonce); color: #fff; display: grid; place-items: center; }
.tp-ecrire .tp-rond .ic { width: 17px; height: 17px; }
.tp-agenda-carte { padding: 0; overflow: hidden; }
.tp-agenda-carte > .tp-c-tete { padding: 16px 18px 12px; margin: 0; }
.tp-legende { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--gris); }
.tp-legende span { display: inline-flex; align-items: center; gap: 6px; }
.tp-legende .ic { width: 15px; height: 15px; }
.tp-legende .vaccin .ic { color: var(--info); } .tp-legende .naissance .ic { color: var(--orange-nuit); }
.tp-legende .enlev .ic { color: var(--orange-fonce); } .tp-legende .livraison .ic, .tp-legende .culture .ic { color: var(--ok); }
.tp-agenda { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--trait); }
.tp-jour-a { border-right: 1px solid var(--trait); border-bottom: 1px solid var(--trait); padding: 8px 8px 10px; min-height: 132px; display: flex;
	flex-direction: column; gap: 5px; min-width: 0; }
.tp-jour-a:nth-child(7n) { border-right: 0; }
.tp-jour-a.passe { background: #FCFBF9; }
.tp-jour-a.aujourdhui { background: var(--orange-clair); box-shadow: inset 0 3px 0 var(--orange-fonce); }
.tp-date-a { display: flex; align-items: baseline; gap: 6px; font-size: 12px; font-weight: 700; color: var(--gris); text-transform: uppercase; letter-spacing: .4px; }
.tp-date-a b { font-size: 17px; color: var(--encre); letter-spacing: 0; }
.tp-date-a small { margin-left: auto; font-size: 12px; text-transform: none; }
.tp-jour-a.aujourdhui .tp-date-a, .tp-jour-a.aujourdhui .tp-date-a b { color: var(--orange-nuit); }
.tp-ev { display: flex; align-items: flex-start; gap: 5px; font-size: 12.5px; font-weight: 600; line-height: 1.25; padding: 4px 6px; border-radius: 8px;
	background: var(--blanc); border: 1px solid var(--trait); min-width: 0; color: var(--encre); text-decoration: none; text-align: left; overflow-wrap: anywhere; }
.tp-ev .ic { width: 14px; height: 14px; margin-top: 1px; color: var(--gris); }
.tp-ev.fait { color: var(--gris); background: transparent; border-style: dashed; }
.tp-ev.fait .ic { color: var(--ok); }
.tp-ev.retard { border-color: #F3C1BB; background: var(--ko-clair); }
.tp-ev.retard .ic { color: var(--ko); }
.tp-ev.vaccin .ic { color: var(--info); } .tp-ev.enlev .ic, .tp-ev.vente .ic { color: var(--orange-fonce); }
.tp-ev.naissance .ic { color: var(--orange-nuit); } .tp-ev.livraison .ic, .tp-ev.culture .ic { color: var(--ok); }
a.tp-ev:hover { border-color: var(--orange-trait); }
.tp-ev-tache { cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; }
.tp-ev-tache > span { display: flex; flex-direction: column; gap: 1px; }
.tp-ev-tache small { color: var(--gris); font-weight: 500; }
.tp-tableau { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.tp-colonne { display: flex; flex-direction: column; gap: 10px; background: var(--gris-clair); border-radius: var(--rayon); padding: 12px; min-height: 180px; }
.tp-colonne-tete { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.tp-carte-tache { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 12px 14px; cursor: pointer; font: inherit; color: var(--encre); }
.tp-carte-tache .tp-quoi { font-weight: 700; }
.tp-colonne-vide { padding: 8px 4px; }
.tp-detail { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.tp-detail dt { color: var(--gris); font-weight: 600; }
.tp-detail dd { margin: 0; font-weight: 600; }

/* ---------------------------------------------------------------- « Confier une tâche » */
.tp-modale .modale-corps { display: flex; flex-direction: column; gap: 14px; }
.tp-deux { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tp-propositions { display: flex; flex-direction: column; gap: 8px; }
.tp-choix { display: flex; flex-direction: column; gap: 6px; max-height: 230px; overflow-y: auto; }
.tp-choix button { display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 1px solid var(--trait); border-radius: 12px; background: var(--blanc);
	padding: 9px 12px; cursor: pointer; min-height: 44px; color: var(--encre); }
.tp-choix button > span { display: flex; flex-direction: column; gap: 1px; }
.tp-choix button small { color: var(--gris); font-size: 13px; }
.tp-choix button .ic { margin-top: 2px; color: var(--orange-fonce); }
.tp-choix button[aria-pressed="true"] { border-color: var(--orange-fonce); background: var(--orange-clair); }
.tp-modale select.saisie { appearance: auto; }

/* ---------------------------------------------------------------- les fils */
.tp-fils { display: flex; flex-direction: column; gap: 10px; }
.tp-fil-carte { display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-decoration: none; color: var(--encre); }
.tp-fil-carte:hover { border-color: var(--orange-trait); }
.tp-fil-carte.alerte .picto { background: var(--ko-clair); color: var(--ko); }
.tp-fil-carte > .tp-pile { flex: 1; }
.tp-fil-nom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-dernier { color: var(--encre); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tp-fil-tete { display: flex; align-items: center; gap: 10px; }
.tp-fil-tete > .tp-pile { flex: 1; }
.tp-fil-titre { font-size: 20px; font-weight: 800; }
.tp-suivent { display: flex; }
.tp-suivent .tp-avatar { border: 2px solid var(--blanc); margin-left: -8px; }
.tp-suivent .tp-avatar:first-child { margin-left: 0; }
.tp-jour-sep { align-self: center; font-size: 12px; font-weight: 700; color: var(--gris); background: var(--gris-clair); border-radius: 99px; padding: 4px 10px; }
.tp-fil-tel { max-width: 720px; width: 100%; }
.tp-fil-tel .tp-photo-message { height: 180px; }
.tp-vide-fil { text-align: center; padding: 24px 8px; }
.tp-composeur { position: sticky; bottom: 0; z-index: 5; background: var(--blanc); border: 1px solid var(--trait); border-radius: 18px; padding: 10px 12px;
	display: flex; flex-direction: column; gap: 8px; max-width: 720px; width: 100%; box-shadow: var(--ombre); }
.tp-composeur-ligne { display: grid; grid-template-columns: 44px minmax(0, 1fr) 48px; gap: 8px; align-items: end; }
.tp-composeur.avec-tache .tp-composeur-ligne { grid-template-columns: 44px 44px minmax(0, 1fr) 48px; }
.tp-composeur .tp-rond { width: 44px; height: 44px; border: 1px solid var(--trait-fort); background: var(--blanc); color: var(--encre); cursor: pointer; padding: 0; }
.tp-composeur .tp-rond.plein { width: 48px; height: 48px; background: var(--orange-fonce); border-color: var(--orange-fonce); color: #fff; }
.tp-composeur .tp-rond.plein.ecoute { background: var(--ko); border-color: var(--ko); box-shadow: 0 0 0 4px var(--ko-clair); }
.tp-composeur .tp-rond[disabled] { opacity: .5; cursor: default; }
.tp-zone { min-height: 46px; max-height: 140px; border: 1px solid var(--trait-fort); border-radius: 23px; padding: 11px 16px; font-size: 16px; resize: none;
	line-height: 1.4; background: var(--blanc); color: var(--encre); width: 100%; }
.tp-zone:focus { outline: none; border-color: var(--orange-fonce); box-shadow: 0 0 0 3px var(--orange-clair); }
.tp-apercu { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--gris); }
.tp-apercu img { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; }
.tp-suggestions { display: flex; flex-direction: column; gap: 2px; }
.tp-suggestions button { display: flex; align-items: center; gap: 10px; min-height: 44px; border: 0; background: none; text-align: left; padding: 0 6px;
	border-radius: 10px; cursor: pointer; font-weight: 700; color: var(--encre); }
.tp-suggestions button:hover, .tp-suggestions button:focus-visible { background: var(--orange-clair); }

/* ---------------------------------------------------------------- téléphone */
@media (max-width: 1180px) {
	.tp-grille { grid-template-columns: minmax(0, 1fr) 340px; }
	.tp-personne { grid-template-columns: 170px 84px minmax(0, 1fr); }
}
@media (max-width: 899px) {
	.tp-grille, .tp-tableau { grid-template-columns: minmax(0, 1fr); }
	.tp-personne { grid-template-columns: minmax(0, 1fr) 90px; gap: 8px 12px; }
	.tp-taches-p { grid-column: 1 / -1; }
	.tp-actions { width: 100%; }
	.tp-actions .bouton.plein { flex: 1; }
	.tp-agenda { grid-template-columns: minmax(0, 1fr); }
	.tp-jour-a { border-right: 0; min-height: 0; padding: 10px 14px; }
	.tp-jour-a.vide { display: none; }
	.tp-deux { grid-template-columns: minmax(0, 1fr); }
	.tp-page-fil { padding-bottom: 8px; }
	.tp-composeur { bottom: calc(var(--barre-h) + 6px + env(safe-area-inset-bottom)); border-radius: 18px; }
	.tp-liste { padding: 2px 14px; }
	.tp-segment { width: 100%; }
	.tp-segment a, .tp-segment button { flex: 1; justify-content: center; padding: 0 6px; font-size: 13px; min-height: 44px; }
}
