/* ===== Système de composants Carnet Patte (étape 3) =====
   Tout est préfixé « cp- » et n'utilise que les variables de tokens.css.
   Les anciens styles (components.css…) restent actifs : rien ne change pour les pages existantes.
   Les polices Manrope et Inter ne s'appliquent qu'à l'intérieur d'un conteneur .cp.
   La page de référence est #/composants. */

/* ---------- Conteneur : active les polices et couleurs du nouveau système ---------- */
.cp {
  font-family: var(--cp-police-texte);
  font-weight: var(--cp-graisse-texte);
  font-size: var(--cp-taille-m);
  line-height: var(--cp-interligne-m);
  color: var(--cp-texte);
  -webkit-font-smoothing: antialiased;
}
.cp *, .cp *::before, .cp *::after { box-sizing: border-box; }
.cp h1, .cp h2, .cp h3, .cp h4 {
  font-family: var(--cp-police-titre);
  font-weight: var(--cp-graisse-titre);
  line-height: var(--cp-interligne-titre);
  letter-spacing: var(--cp-lettrage-titre);
  margin: 0;
  color: var(--cp-foret-texte);
}
.cp h1 { font-size: var(--cp-taille-xxl); line-height: var(--cp-interligne-xxl); font-weight: var(--cp-graisse-h1); }
.cp h2 { font-size: var(--cp-taille-l); line-height: var(--cp-interligne-l); }
.cp h3 { font-size: var(--cp-taille-m); line-height: var(--cp-interligne-m); }
.cp h4 { font-size: var(--cp-taille-m); }
.cp p { margin: 0 0 var(--cp-espace-3); }
.cp a { color: var(--cp-foret-texte); text-underline-offset: 3px; }
.cp .cp-doux { color: var(--cp-texte-doux); font-size: var(--cp-taille-s); }

/* Anneau de focus clavier commun à tous les composants interactifs */
.cp :is(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--cp-focus);
  outline-offset: 2px;
}

/* Texte réservé aux lecteurs d'écran */
.cp-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Les icônes (js/icons.js) héritent de la couleur du texte */
.cp .ic { flex: none; }

/* =========================================================
   1. BOUTONS
   ========================================================= */
.cp-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--cp-h-bouton); padding: 0 14px;
  border: 1px solid transparent; border-radius: var(--cp-rayon-bouton);
  font: inherit; font-family: var(--cp-police-texte); font-weight: var(--cp-graisse-bouton);
  font-size: var(--cp-taille-m); line-height: 1.2; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background-color var(--cp-duree-rapide) var(--cp-courbe), border-color var(--cp-duree-rapide) var(--cp-courbe),
              color var(--cp-duree-rapide) var(--cp-courbe), box-shadow var(--cp-duree-rapide) var(--cp-courbe),
              transform var(--cp-duree-rapide) var(--cp-courbe);
}
.cp-btn:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(1px); }

/* Principal */
.cp-btn--principal { background: var(--cp-foret); color: var(--cp-texte-inverse); }
.cp-btn--principal:is(:hover, .is-survol):not(:disabled):not([aria-disabled="true"]) { background: var(--cp-foret-survol); }
.cp-btn--principal:active:not(:disabled):not([aria-disabled="true"]) { background: var(--cp-foret-actif); }

/* Secondaire */
.cp-btn--secondaire { background: var(--cp-carte); color: var(--cp-foret-texte); border-color: var(--cp-bordure-forte); }
.cp-btn--secondaire:is(:hover, .is-survol):not(:disabled):not([aria-disabled="true"]) { background: var(--cp-surface-2); }
.cp-btn--secondaire:active:not(:disabled):not([aria-disabled="true"]) { background: var(--cp-vert-clair); }

/* Discret */
.cp-btn--discret { background: transparent; color: var(--cp-texte-doux); padding: 0 12px; }
.cp-btn--discret:is(:hover, .is-survol):not(:disabled):not([aria-disabled="true"]) { background: var(--cp-surface-2); color: var(--cp-texte); }
.cp-btn--discret:active:not(:disabled):not([aria-disabled="true"]) { background: var(--cp-vert-clair); }

/* Danger */
.cp-btn--danger { background: var(--cp-terre); color: var(--cp-texte-inverse); }
.cp-btn--danger:is(:hover, .is-survol):not(:disabled):not([aria-disabled="true"]) { background: var(--cp-terre-survol); }

/* Tailles et variantes de forme */
.cp-btn--s { min-height: var(--cp-h-bouton-s); padding: 0 10px; font-size: var(--cp-taille-s); }
.cp-btn--s:not(.cp-btn--icone) { min-width: var(--cp-cible-tactile); }  /* « Fait » : jamais plus étroit que 44 px */
.cp-btn--icone { width: var(--cp-h-bouton); padding: 0; }
.cp-btn--icone.cp-btn--s { width: var(--cp-h-bouton-s); }
.cp-btn--bloc { display: flex; width: 100%; }

/* Sélectionné (bouton à bascule : aria-pressed) */
.cp-btn[aria-pressed="true"] { background: var(--cp-vert-clair); border-color: var(--cp-foret); color: var(--cp-foret-texte); }

/* Désactivé */
.cp-btn:disabled, .cp-btn[aria-disabled="true"] {
  background: var(--cp-desactive-fond); color: var(--cp-desactive-texte);
  border-color: transparent; box-shadow: none; cursor: not-allowed;
}
.cp-btn--discret:disabled, .cp-btn--discret[aria-disabled="true"] { background: transparent; }

/* En chargement : le libellé reste lisible, une roue tourne à la place de l'icône */
.cp-btn[aria-busy="true"] { cursor: progress; pointer-events: none; }
.cp-btn[aria-busy="true"]::before {
  content: ""; width: 1em; height: 1em; flex: none;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: cp-tourne .8s linear infinite;
}
.cp-btn[aria-busy="true"] > .ic { display: none; }

@keyframes cp-tourne { to { transform: rotate(360deg); } }

/* =========================================================
   2. CHAMPS, FORMULAIRES, SÉLECTEURS
   ========================================================= */
.cp-formulaire { display: grid; gap: var(--cp-espace-4); }

.cp-champ { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--cp-espace-2); min-width: 0; }
.cp-champ__label { font-weight: 500; font-size: var(--cp-taille-s); line-height: var(--cp-interligne-s); color: var(--cp-foret-texte); }
.cp-champ__aide { font-size: var(--cp-taille-xs); color: var(--cp-texte-doux); margin: 0; }
.cp-champ__erreur {
  display: flex; align-items: flex-start; gap: var(--cp-espace-2);
  font-size: var(--cp-taille-xs); color: var(--cp-terre); margin: 0; font-weight: 500;
}
.cp-champ__erreur .ic { margin-top: 1px; }

.cp-input, .cp-select, .cp-textarea {
  width: 100%; min-height: var(--cp-h-champ); padding: 6px 12px;
  font: inherit; font-family: var(--cp-police-texte); font-size: var(--cp-taille-m); color: var(--cp-texte);
  background: var(--cp-carte); border: 1px solid var(--cp-bordure-champ); border-radius: var(--cp-rayon-champ);
  transition: border-color var(--cp-duree-rapide) var(--cp-courbe), box-shadow var(--cp-duree-rapide) var(--cp-courbe), background-color var(--cp-duree-rapide) var(--cp-courbe);
}
/* Champ date (iPhone) : il ne dépasse jamais de sa carte et le texte reste aligné à gauche */
.cp-input[type="date"] { display: block; box-sizing: border-box; max-width: 100%; min-width: 0; -webkit-appearance: none; appearance: none; text-align: left; }
.cp-input[type="date"]::-webkit-date-and-time-value { text-align: left; min-width: 0; }
.cp-input[type="date"]::-webkit-calendar-picker-indicator { margin-inline-start: 4px; }
.cp-input::placeholder, .cp-textarea::placeholder { color: var(--cp-placeholder); opacity: 1; }
.cp-input:hover, .cp-select:hover, .cp-textarea:hover { border-color: var(--cp-foret); }
.cp-input:focus, .cp-select:focus, .cp-textarea:focus {
  outline: none; border-color: var(--cp-foret); box-shadow: 0 0 0 3px var(--cp-vert-clair), 0 0 0 4px var(--cp-foret);
}
.cp-textarea { min-height: 96px; padding: 8px 12px; resize: vertical; }

.cp-select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235B6334' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}

/* Champ avec icône (recherche…) */
.cp-champ__zone { position: relative; }
.cp-champ__zone > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--cp-texte-doux); pointer-events: none; }
.cp-champ__zone > .cp-input { padding-left: 38px; }

/* États : erreur, succès, désactivé, chargement */
.cp-input[aria-invalid="true"], .cp-select[aria-invalid="true"], .cp-textarea[aria-invalid="true"] { border-color: var(--cp-terre); background: #FFFAF8; }
.cp-input[aria-invalid="true"]:focus, .cp-select[aria-invalid="true"]:focus, .cp-textarea[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--cp-terre-pale), 0 0 0 4px var(--cp-terre); }
.cp-input:disabled, .cp-select:disabled, .cp-textarea:disabled {
  background: var(--cp-desactive-fond); color: var(--cp-desactive-texte); border-color: var(--cp-desactive-fond); cursor: not-allowed;
}
.cp-champ[aria-busy="true"] .cp-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235B6B63' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M21 12a9 9 0 1 1-6.2-8.55'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}

/* Cases à cocher, boutons radio, interrupteur */
.cp-case { display: flex; align-items: center; gap: var(--cp-espace-3); min-height: var(--cp-cible-tactile); cursor: pointer; font-size: var(--cp-taille-m); }
.cp-case input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--cp-foret); cursor: pointer; }
.cp-case:has(input:disabled) { color: var(--cp-desactive-texte); cursor: not-allowed; }
.cp-case input:disabled { cursor: not-allowed; }

.cp-interrupteur { display: flex; align-items: center; justify-content: space-between; gap: var(--cp-espace-4); min-height: var(--cp-cible-tactile); cursor: pointer; }
.cp-interrupteur input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cp-interrupteur__piste {
  position: relative; flex: none; width: 48px; height: 28px; border-radius: 999px;
  background: var(--cp-bordure-champ); transition: background-color var(--cp-duree) var(--cp-courbe);
}
.cp-interrupteur__piste::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: var(--cp-ombre-s); transition: transform var(--cp-duree) var(--cp-courbe);
}
.cp-interrupteur input:checked + .cp-interrupteur__piste { background: var(--cp-foret); }
.cp-interrupteur input:checked + .cp-interrupteur__piste::after { transform: translateX(20px); }
.cp-interrupteur input:focus-visible + .cp-interrupteur__piste { outline: 2px solid var(--cp-focus); outline-offset: 2px; }
.cp-interrupteur input:disabled + .cp-interrupteur__piste { opacity: .5; }
.cp-interrupteur:has(input:disabled) { cursor: not-allowed; color: var(--cp-desactive-texte); }

/* Sélecteur de choix en pastilles (radio) : ex. espèce de l'animal */
.cp-choix { display: flex; flex-wrap: wrap; gap: var(--cp-espace-2); border: 0; padding: 0; margin: 0; }
.cp-choix legend { padding: 0; margin-bottom: var(--cp-espace-2); font-weight: 500; font-size: var(--cp-taille-s); color: var(--cp-foret-texte); }
.cp-choix__option { position: relative; }
.cp-choix__option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cp-choix__option span {
  display: inline-flex; align-items: center; gap: var(--cp-espace-2); min-height: var(--cp-h-bouton); padding: 0 14px;
  background: var(--cp-carte); border: 1px solid var(--cp-bordure-champ); border-radius: var(--cp-rayon-bouton);
  font-weight: 500; font-size: var(--cp-taille-s); color: var(--cp-foret-texte);
  transition: background-color var(--cp-duree-rapide) var(--cp-courbe), border-color var(--cp-duree-rapide) var(--cp-courbe);
}
.cp-choix__option:hover span { background: var(--cp-fond-survol); border-color: var(--cp-foret); }
.cp-choix__option input:checked + span { background: var(--cp-vert-clair); border-color: var(--cp-foret); box-shadow: inset 0 0 0 1px var(--cp-foret); }
.cp-choix__option input:focus-visible + span { outline: 2px solid var(--cp-focus); outline-offset: 2px; }
.cp-choix__option input:disabled + span { background: var(--cp-desactive-fond); color: var(--cp-desactive-texte); border-color: transparent; cursor: not-allowed; }

/* Variante « espèces » : pastilles en grille, icône au-dessus du nom (18 choix lisibles sur mobile) */
.cp-choix--especes, .cp-choix--tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 104px), 1fr)); gap: var(--cp-espace-2); }
.cp-choix--especes legend, .cp-choix--tuiles legend { grid-column: 1 / -1; }
.cp-choix--especes .cp-choix__option span, .cp-choix--tuiles .cp-choix__option span {
  flex-direction: column; justify-content: center; gap: 4px; width: 100%; min-height: 68px; padding: var(--cp-espace-2);
  border-radius: var(--cp-rayon-champ); text-align: center; font-size: var(--cp-taille-xs); line-height: 1.25;
}
.cp-choix--especes .cp-choix__option .ic, .cp-choix--tuiles .cp-choix__option .ic { width: 26px; height: 26px; }

/* =========================================================
   3. CARTES
   ========================================================= */
.cp-carte {
  background: var(--cp-carte); border: 1px solid var(--cp-bordure); border-radius: var(--cp-rayon-carte);
  padding: var(--cp-espace-4); box-shadow: var(--cp-ombre-s); color: inherit; text-decoration: none;
  transition: box-shadow var(--cp-duree) var(--cp-courbe), border-color var(--cp-duree) var(--cp-courbe), transform var(--cp-duree) var(--cp-courbe);
}
a.cp-carte, .cp-carte--interactive { display: block; cursor: pointer; }
a.cp-carte:hover, .cp-carte--interactive:hover { box-shadow: var(--cp-ombre-m); }
.cp-carte--selectionnee { border-color: var(--cp-foret); box-shadow: 0 0 0 1px var(--cp-foret), var(--cp-ombre-m); }
.cp-carte[aria-disabled="true"] { background: var(--cp-desactive-fond); box-shadow: none; pointer-events: none; }
.cp-carte[aria-disabled="true"] .cp-carte__titre { color: var(--cp-texte-doux); }
.cp-carte__titre { font-family: var(--cp-police-titre); font-weight: var(--cp-graisse-titre); font-size: var(--cp-taille-m); color: var(--cp-foret-texte); margin: 0 0 var(--cp-espace-2); }

/* Avatar rond (icône d'espèce ou photo) */
.cp-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  background: var(--an-fond, var(--cp-surface-2)); color: var(--an-texte, var(--cp-foret));
  font-family: var(--cp-police-titre); font-weight: 700; font-size: 14px; line-height: 1; letter-spacing: .02em;
}
.cp-avatar--grand { width: 64px; height: 64px; font-size: 22px; }
.cp-avatar--petit { width: 24px; height: 24px; font-size: 10px; }
/* Une couleur par animal : choisie par l'utilisateur dans sa fiche, sinon d'après son identifiant (js/composants.js), donc stable d'une visite à l'autre.
   La classe .cp-an-… pose --an-fond, --an-texte et --an-trait ; les enfants (avatar, graphique…) les reprennent. */
.cp-an-ardoise { --an-fond: var(--cp-an-ardoise-fond); --an-texte: var(--cp-an-ardoise-texte); --an-trait: var(--cp-an-ardoise-trait); }
.cp-an-turquoise { --an-fond: var(--cp-an-turquoise-fond); --an-texte: var(--cp-an-turquoise-texte); --an-trait: var(--cp-an-turquoise-trait); }
.cp-an-indigo { --an-fond: var(--cp-an-indigo-fond); --an-texte: var(--cp-an-indigo-texte); --an-trait: var(--cp-an-indigo-trait); }
.cp-an-magenta { --an-fond: var(--cp-an-magenta-fond); --an-texte: var(--cp-an-magenta-texte); --an-trait: var(--cp-an-magenta-trait); }
.cp-an-brun { --an-fond: var(--cp-an-brun-fond); --an-texte: var(--cp-an-brun-texte); --an-trait: var(--cp-an-brun-trait); }
.cp-an-rose { --an-fond: var(--cp-an-rose-fond); --an-texte: var(--cp-an-rose-texte); --an-trait: var(--cp-an-rose-trait); }
.cp-an-olive { --an-fond: var(--cp-an-olive-fond); --an-texte: var(--cp-an-olive-texte); --an-trait: var(--cp-an-olive-trait); }
.cp-an-gris { --an-fond: var(--cp-an-gris-fond); --an-texte: var(--cp-an-gris-texte); --an-trait: var(--cp-an-gris-trait); }

/* Une couleur par type de soin : posée sur la ligne du soin, elle teinte la pastille d'icône et le libellé du type */
.cp-type--vaccin { --t-fond: var(--cp-type-vaccin-fond); --t-texte: var(--cp-type-vaccin-texte); }
.cp-type--vermifuge { --t-fond: var(--cp-type-vermifuge-fond); --t-texte: var(--cp-type-vermifuge-texte); }
.cp-type--antiparasitaire { --t-fond: var(--cp-type-antiparasitaire-fond); --t-texte: var(--cp-type-antiparasitaire-texte); }
.cp-type--veto { --t-fond: var(--cp-type-veto-fond); --t-texte: var(--cp-type-veto-texte); }
.cp-type--autre { --t-fond: var(--cp-type-autre-fond); --t-texte: var(--cp-type-autre-texte); }

.cp-carte-animal, a.cp-carte.cp-carte-animal { display: flex; align-items: center; gap: var(--cp-espace-3); padding: 12px 14px; }
.cp-carte-animal__texte { min-width: 0; display: grid; gap: 2px; }
.cp-carte-animal__nom { font-family: var(--cp-police-titre); font-weight: var(--cp-graisse-titre); font-size: var(--cp-taille-m); color: var(--cp-foret-texte); }
.cp-carte-animal__meta { font-size: var(--cp-taille-s); color: var(--cp-texte-doux); }
.cp-carte-animal__badges { display: flex; flex-wrap: wrap; gap: var(--cp-espace-2); margin-top: var(--cp-espace-2); }

/* Carte de statistique */
.cp-stat { display: grid; gap: 2px; }
.cp-stat__tete { display: flex; align-items: center; justify-content: space-between; gap: var(--cp-espace-3); color: var(--cp-texte-doux); font-size: var(--cp-taille-s); line-height: var(--cp-interligne-s); font-weight: 400; }
.cp-stat__icone { display: none; }  /* les chiffres clés n'ont plus de pictogramme : le libellé suffit */
.cp-stat__valeur { font-family: var(--cp-police-titre); font-weight: var(--cp-graisse-titre); font-size: var(--cp-taille-chiffre); line-height: var(--cp-interligne-chiffre); letter-spacing: -.02em; color: var(--cp-foret-texte); }
.cp-stat__variation { display: inline-flex; align-items: center; gap: 4px; font-size: var(--cp-taille-xs); font-weight: 500; color: var(--cp-succes-texte); }
.cp-stat__variation--baisse { color: var(--cp-terre); }
.cp-stat__detail { font-size: var(--cp-taille-s); color: var(--cp-texte-doux); overflow-wrap: anywhere; }

/* Carte de produit (mise en forme uniquement : aucun produit réel) */
.cp-produit { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.cp-produit__image {
  position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3;
  background: var(--cp-vert-clair); color: var(--cp-sauge);
}
.cp-produit__image .cp-badge { position: absolute; top: var(--cp-espace-3); left: var(--cp-espace-3); }
.cp-produit__favori { position: absolute; top: var(--cp-espace-3); right: var(--cp-espace-3); }
.cp-produit__corps { display: grid; gap: var(--cp-espace-2); padding: var(--cp-espace-4) var(--cp-espace-5) var(--cp-espace-5); }
.cp-produit__vendeur { font-size: var(--cp-taille-xs); color: var(--cp-texte-doux); }
.cp-produit__nom { font-family: var(--cp-police-titre); font-weight: var(--cp-graisse-titre); font-size: var(--cp-taille-m); color: var(--cp-foret-texte); }
.cp-produit__prix { font-family: var(--cp-police-titre); font-weight: 800; font-size: var(--cp-taille-l); color: var(--cp-foret-texte); }

/* =========================================================
   4. BADGES ET INDICATEURS DE STATUT
   ========================================================= */
.cp-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; min-height: 22px; border-radius: var(--cp-rayon-pastille);
  font-size: var(--cp-taille-xs); font-weight: 500; line-height: var(--cp-interligne-xs); white-space: nowrap;
  background: var(--cp-surface-2); color: var(--cp-texte-doux);
}
.cp-badge--succes { background: var(--cp-succes-pale); color: var(--cp-succes-texte); }
.cp-badge--info { background: var(--cp-info-pale); color: var(--cp-info); }
.cp-badge--attention { background: var(--cp-ambre-pale); color: var(--cp-ambre); }
.cp-badge--alerte { background: var(--cp-terre-pale); color: var(--cp-terre); }
.cp-badge--premium { background: var(--cp-beige); color: var(--cp-foret-texte); }
.cp-badge--neutre { background: var(--cp-desactive-fond); color: var(--cp-texte-doux); }
.cp-badge--bientot { background: var(--cp-foret); color: var(--cp-texte-inverse); }

/* Point de statut (toujours accompagné d'un texte : la couleur ne porte jamais seule l'information) */
.cp-statut { display: inline-flex; align-items: center; gap: var(--cp-espace-2); font-size: var(--cp-taille-s); font-weight: 500; }
.cp-statut::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--cp-sauge); flex: none; }
.cp-statut--ok::before { background: var(--cp-succes); }
.cp-statut--attention::before { background: var(--cp-ambre); }
.cp-statut--alerte::before { background: var(--cp-terre); }

/* Pastille de compteur (ex. rappels en retard) */
.cp-compteur {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: var(--cp-terre); color: var(--cp-texte-inverse); font-size: var(--cp-taille-xs); font-weight: 700;
}

/* =========================================================
   5. MODALES ET CONFIRMATIONS
   ========================================================= */
.cp-modale {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: var(--cp-rayon-carte);
  background: var(--cp-carte); color: var(--cp-texte); box-shadow: var(--cp-ombre-l); overflow: hidden;
  font-family: var(--cp-police-texte); font-size: var(--cp-taille-m); line-height: var(--cp-interligne-m);
}
.cp-modale[open] { animation: cp-apparition var(--cp-duree) var(--cp-courbe); }
.cp-modale::backdrop { background: rgba(var(--cp-ombre-rgb), .45); }
.cp-modale[open]::backdrop { animation: cp-fondu var(--cp-duree) var(--cp-courbe); }
.cp-modale * , .cp-modale *::before, .cp-modale *::after { box-sizing: border-box; }
.cp-modale__tete { display: flex; align-items: center; justify-content: space-between; gap: var(--cp-espace-4); padding: var(--cp-espace-5) var(--cp-espace-5) var(--cp-espace-3); }
.cp-modale__titre { margin: 0; font-family: var(--cp-police-titre); font-weight: var(--cp-graisse-titre); font-size: var(--cp-taille-xl); line-height: var(--cp-interligne-xl); color: var(--cp-foret-texte); }
.cp-modale__corps { padding: 0 var(--cp-espace-5) var(--cp-espace-4); overflow-y: auto; max-height: calc(100dvh - 220px); }
.cp-modale__corps p { margin: 0 0 var(--cp-espace-3); }
.cp-modale__pied { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--cp-espace-3); padding: var(--cp-espace-4) var(--cp-espace-5) var(--cp-espace-5); }
.cp-modale__icone { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--cp-terre-pale); color: var(--cp-terre); margin-bottom: var(--cp-espace-3); }
/* Sans pied de fenêtre, le corps peut occuper toute la hauteur disponible */
.cp-modale__corps:last-child { max-height: calc(100dvh - 120px); padding-bottom: var(--cp-espace-5); }
/* Le fond ne défile pas derrière une fenêtre ouverte */
body:has(dialog[open]) { overflow: hidden; }
/* Mobile : la fenêtre se pose en bas de l'écran (feuille), à portée du pouce */
@media (max-width: 599px) {
  .cp-modale { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: var(--cp-rayon-carte) var(--cp-rayon-carte) 0 0; max-height: calc(100dvh - 24px); padding-bottom: env(safe-area-inset-bottom); }
  .cp-modale[open] { animation-name: cp-feuille; }
  .cp-modale__pied { flex-direction: column-reverse; }
  .cp-modale__pied .cp-btn { width: 100%; }
}
@keyframes cp-feuille { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: none; } }

@keyframes cp-apparition { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes cp-fondu { from { opacity: 0; } to { opacity: 1; } }

/* =========================================================
   6. NOTIFICATIONS ET MESSAGES
   ========================================================= */
.cp-alerte {
  display: flex; align-items: flex-start; gap: var(--cp-espace-3); padding: var(--cp-espace-4);
  border-radius: var(--cp-rayon-champ); border: 1px solid transparent; font-size: var(--cp-taille-s);
}
.cp-alerte__texte { flex: 1; min-width: 0; }
.cp-alerte__titre { display: block; font-weight: 700; margin-bottom: 2px; }
.cp-alerte .ic { margin-top: 1px; }
.cp-alerte--succes { background: var(--cp-succes-pale); color: var(--cp-succes-texte); border-color: #BFD3B9; }
.cp-alerte--info { background: var(--cp-info-pale); color: var(--cp-info); border-color: #CDC8BA; }
.cp-alerte--attention { background: var(--cp-ambre-pale); color: var(--cp-ambre); border-color: #E6D2A3; }
.cp-alerte--erreur { background: var(--cp-terre-pale); color: var(--cp-terre); border-color: #E8C5BA; }

/* Notifications éphémères (toasts) : zone en haut sur mobile, en bas à droite sur ordinateur */
.cp-notifs {
  position: fixed; z-index: 100; left: 0; right: 0; bottom: calc(var(--cp-hauteur-barre-bas) + var(--cp-espace-4));
  display: grid; gap: var(--cp-espace-2); justify-items: center; padding: 0 var(--cp-espace-4); pointer-events: none;
}
.cp-notif {
  display: flex; align-items: center; gap: var(--cp-espace-3); width: min(420px, 100%); padding: var(--cp-espace-3) var(--cp-espace-4);
  border-radius: var(--cp-rayon-champ); background: var(--cp-foret); color: var(--cp-texte-inverse);
  box-shadow: var(--cp-ombre-l); font-family: var(--cp-police-texte); font-size: var(--cp-taille-s); pointer-events: auto;
  animation: cp-apparition var(--cp-duree) var(--cp-courbe);
}
.cp-notif__texte { flex: 1; min-width: 0; }
.cp-notif--succes .ic:first-child { color: var(--cp-sauge); }
.cp-notif--erreur { background: var(--cp-terre); }
.cp-notif--info .ic:first-child { color: var(--cp-vert-clair); }
.cp-notif__fermer { color: inherit; background: transparent; border: 0; border-radius: 8px; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.cp-notif__fermer:hover { background: rgba(255, 255, 255, .15); }
.cp-notif__fermer:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
@media (min-width: 1024px) { .cp-notifs { left: auto; right: var(--cp-espace-5); bottom: var(--cp-espace-5); justify-items: end; } }

/* =========================================================
   7. FILTRES ET ONGLETS
   ========================================================= */
.cp-filtres { display: flex; flex-wrap: wrap; gap: var(--cp-espace-2); }
.cp-filtre {
  display: inline-flex; align-items: center; gap: var(--cp-espace-2); min-height: var(--cp-h-bouton); padding: 0 14px;
  background: var(--cp-carte); color: var(--cp-foret-texte); border: 1px solid var(--cp-bordure-champ); border-radius: var(--cp-rayon-pastille);
  font: inherit; font-family: var(--cp-police-texte); font-weight: 500; font-size: var(--cp-taille-s); cursor: pointer; white-space: nowrap; flex: none;
  transition: background-color var(--cp-duree-rapide) var(--cp-courbe), border-color var(--cp-duree-rapide) var(--cp-courbe);
}
.cp-filtre:hover:not(:disabled) { background: var(--cp-fond-survol); border-color: var(--cp-foret); }
.cp-filtre[aria-pressed="true"] { background: var(--cp-foret); color: var(--cp-texte-inverse); border-color: var(--cp-foret); }
.cp-filtre:disabled { background: var(--cp-desactive-fond); color: var(--cp-desactive-texte); border-color: transparent; cursor: not-allowed; }
.cp-filtre__nombre { font-size: var(--cp-taille-xs); opacity: .85; }

.cp-barre-outils { display: flex; flex-wrap: wrap; gap: var(--cp-espace-3); align-items: center; }
.cp-barre-outils > .cp-champ__zone { flex: 1 1 220px; }

.cp-onglets { display: flex; gap: var(--cp-espace-1); border-bottom: 1px solid var(--cp-bordure); overflow-x: auto; scrollbar-width: none; }
.cp-onglets::-webkit-scrollbar { display: none; }
.cp-onglet {
  position: relative; display: inline-flex; align-items: center; gap: var(--cp-espace-2); min-height: var(--cp-h-bouton); padding: 0 12px;
  background: transparent; border: 0; border-radius: var(--cp-rayon-champ) var(--cp-rayon-champ) 0 0;
  font: inherit; font-family: var(--cp-police-texte); font-weight: 500; font-size: var(--cp-taille-m); color: var(--cp-texte-doux); white-space: nowrap; cursor: pointer;
  transition: color var(--cp-duree-rapide) var(--cp-courbe), background-color var(--cp-duree-rapide) var(--cp-courbe);
}
.cp-onglet:hover:not(:disabled):not([aria-selected="true"]) { background: var(--cp-fond-survol); color: var(--cp-foret-texte); }
.cp-onglet[aria-selected="true"] { color: var(--cp-foret-texte); font-weight: 600; }
.cp-onglet:disabled { color: var(--cp-desactive-texte); cursor: not-allowed; }
.cp-onglet-panneau { padding-top: var(--cp-espace-4); }

/* =========================================================
   8. ÉLÉMENTS DE NAVIGATION (modèles : la navigation de l'appli n'est pas encore remplacée)
   ========================================================= */
.cp-nav-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--cp-espace-1); }
.cp-nav-item {
  display: flex; align-items: center; gap: 10px; min-height: var(--cp-h-bouton); padding: 0 10px;
  border-radius: var(--cp-rayon-bouton); color: var(--cp-foret-texte); text-decoration: none; font-weight: 500; font-size: var(--cp-taille-m);
  transition: background-color var(--cp-duree-rapide) var(--cp-courbe);
}
.cp .cp-nav-item { text-decoration: none; }
.cp-nav-item .ic { color: var(--cp-texte-doux); }
.cp-nav-item:hover { background: rgba(var(--cp-ombre-rgb), .06); }
.cp-nav-item[aria-current="page"] { background: var(--cp-carte); box-shadow: inset 0 0 0 1px var(--cp-bordure), var(--cp-ombre-s); font-weight: 600; }
.cp-nav-item[aria-current="page"] .ic { color: var(--cp-foret-texte); }
.cp-nav-item[aria-disabled="true"] { color: var(--cp-desactive-texte); pointer-events: none; }
.cp-nav-item .cp-compteur, .cp-nav-item .cp-badge { margin-left: auto; }

.cp-nav-bas { display: flex; background: var(--cp-carte); border: 1px solid var(--cp-bordure); border-radius: var(--cp-rayon-carte); box-shadow: var(--cp-ombre-s); }
.cp-nav-bas__item {
  position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--cp-hauteur-barre-bas); padding: var(--cp-espace-1); color: var(--cp-texte-doux);
  font-size: 12px; line-height: 16px; font-weight: 500; text-decoration: none; transition: color var(--cp-duree-rapide) var(--cp-courbe);
}
.cp .cp-nav-bas__item { text-decoration: none; color: var(--cp-texte-doux); }
.cp-nav-bas__item:hover { color: var(--cp-foret-texte); }
.cp .cp-nav-bas__item[aria-current="page"] { color: var(--cp-foret-texte); font-weight: 600; }
/* repère de la page active : un petit trait en haut de l'entrée */
.cp-nav-bas__item[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 50%; width: 24px; height: 2px; margin-left: -12px; border-radius: 0 0 2px 2px; background: var(--cp-foret); }
.cp-nav-bas__icone { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 100%; max-width: 52px; height: 26px; }
.cp-nav-bas__compteur { position: absolute; top: -4px; left: calc(50% + 4px); min-width: 18px; height: 18px; font-size: 12px; }

.cp-fil { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cp-espace-2); list-style: none; margin: 0; padding: 0; font-size: var(--cp-taille-s); color: var(--cp-texte-doux); }
.cp-fil li { display: inline-flex; align-items: center; gap: var(--cp-espace-2); }
.cp-fil [aria-current="page"] { color: var(--cp-foret-texte); font-weight: 500; }

.cp-pagination { display: flex; align-items: center; gap: var(--cp-espace-1); list-style: none; margin: 0; padding: 0; }

/* =========================================================
   9. TABLEAUX ET LISTES
   ========================================================= */
.cp-tableau-enveloppe { container-type: inline-size; border: 1px solid var(--cp-bordure); border-radius: var(--cp-rayon-carte); overflow-x: auto; background: var(--cp-carte); box-shadow: var(--cp-ombre-s); }
.cp-tableau { width: 100%; border-collapse: collapse; font-size: var(--cp-taille-s); }
.cp-tableau caption { text-align: left; padding: var(--cp-espace-4) var(--cp-espace-5); font-family: var(--cp-police-titre); font-weight: var(--cp-graisse-titre); font-size: var(--cp-taille-m); color: var(--cp-foret-texte); }
.cp-tableau th { text-align: left; padding: var(--cp-espace-3) var(--cp-espace-5); background: var(--cp-fond); color: var(--cp-texte-doux); font-weight: 500; font-size: var(--cp-taille-xs); text-transform: uppercase; letter-spacing: .05em; border-top: 1px solid var(--cp-bordure); border-bottom: 1px solid var(--cp-bordure); }
.cp-tableau td { padding: var(--cp-espace-4) var(--cp-espace-5); border-bottom: 1px solid var(--cp-bordure); vertical-align: middle; }
.cp-tableau tbody tr:last-child td { border-bottom: 0; }
.cp-tableau tbody tr:hover { background: var(--cp-fond); }
.cp-tableau tr[aria-selected="true"] { background: var(--cp-vert-clair); }
.cp-tableau__nom { font-weight: 500; color: var(--cp-foret-texte); display: flex; align-items: center; gap: var(--cp-espace-3); }
.cp-tableau .cp-avatar { width: 36px; height: 36px; }
.cp-tableau__actions { text-align: right; white-space: nowrap; }

/* Quand la place manque (téléphone, mais aussi tablette avec menu latéral) : chaque ligne devient une petite fiche.
   On mesure la largeur du tableau lui-même (container query), pas celle de l'écran. */
@container (max-width: 660px) {
  .cp-tableau caption { display: block; }
  .cp-tableau thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cp-tableau, .cp-tableau tbody, .cp-tableau tr, .cp-tableau td { display: block; width: 100%; }
  .cp-tableau tr { padding: var(--cp-espace-3) var(--cp-espace-4); border-bottom: 1px solid var(--cp-bordure); }
  .cp-tableau tbody tr:last-child { border-bottom: 0; }
  .cp-tableau td { display: flex; justify-content: space-between; align-items: center; gap: var(--cp-espace-4); padding: var(--cp-espace-2) 0; border: 0; text-align: right; }
  .cp-tableau td::before { content: attr(data-label); font-size: var(--cp-taille-xs); color: var(--cp-texte-doux); text-align: left; flex: none; }
  .cp-tableau td.cp-tableau__nom { justify-content: flex-start; text-align: left; }
  .cp-tableau td.cp-tableau__nom::before { display: none; }
  .cp-tableau td.cp-tableau__actions { justify-content: flex-end; }
  .cp-tableau td.cp-tableau__actions::before { display: none; }
}

.cp-liste { list-style: none; margin: 0; padding: 0; background: var(--cp-carte); border: 1px solid var(--cp-bordure); border-radius: var(--cp-rayon-carte); box-shadow: var(--cp-ombre-s); overflow: hidden; }
.cp-liste__ligne { display: flex; align-items: center; gap: var(--cp-espace-3); padding: 10px 14px; min-height: 52px; border-bottom: 1px solid var(--cp-bordure); }
.cp-liste__ligne:last-child { border-bottom: 0; }
.cp-liste__icone { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--cp-rayon-bouton); background: var(--t-fond, transparent); color: var(--t-texte, var(--cp-texte-doux)); flex: none; }
.cp-liste__corps { flex: 1; min-width: 0; display: grid; gap: 0; }
.cp-liste__titre { font-weight: 500; color: var(--cp-foret-texte); line-height: var(--cp-interligne-m); }
.cp-liste__meta { font-size: var(--cp-taille-s); line-height: var(--cp-interligne-s); color: var(--cp-texte-doux); }
.cp-liste__fin { display: flex; align-items: center; gap: var(--cp-espace-2); flex: none; }
.cp-liste__ligne--lien { transition: background-color var(--cp-duree-rapide) var(--cp-courbe); color: inherit; text-decoration: none; }
.cp .cp-liste__ligne--lien { text-decoration: none; }
.cp-liste__ligne--lien:hover { background: var(--cp-surface-2); }

/* État vide */
.cp-vide { text-align: center; padding: var(--cp-espace-6) var(--cp-espace-4); display: grid; justify-items: center; gap: var(--cp-espace-3); }
.cp-vide__icone { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--cp-surface-2); color: var(--cp-foret-texte); }
.cp-vide__titre { margin: 0; font-family: var(--cp-police-titre); font-weight: var(--cp-graisse-titre); font-size: var(--cp-taille-l); color: var(--cp-foret-texte); }
.cp-vide p { max-width: 36ch; color: var(--cp-texte-doux); margin: 0; }

/* Chargement : squelettes et roue */
.cp-squelette {
  display: block; border-radius: var(--cp-rayon-champ); min-height: 14px;
  background: linear-gradient(90deg, var(--cp-vert-clair) 0%, var(--cp-fond-survol) 50%, var(--cp-vert-clair) 100%);
  background-size: 200% 100%; animation: cp-brille 1.4s ease-in-out infinite;
}
.cp-squelette--rond { border-radius: 50%; }
@keyframes cp-brille { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.cp-spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid var(--cp-vert-clair); border-top-color: var(--cp-foret); border-radius: 50%; animation: cp-tourne .8s linear infinite; }

/* =========================================================
   Respect de « réduire les animations »
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .cp *, .cp *::before, .cp *::after, .cp-modale, .cp-modale::backdrop, .cp-notif { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .cp-squelette { animation: none; background: var(--cp-vert-clair); }
  .cp-spinner, .cp-btn[aria-busy="true"]::before { animation: none; }
  a.cp-carte:hover, .cp-carte--interactive:hover { transform: none; }
}

/* =========================================================
   PAGE DE RÉFÉRENCE #/composants (mise en page de la démonstration uniquement)
   ========================================================= */
.cp-ref { max-width: 1100px; }
.cp-ref__entete { display: grid; gap: var(--cp-espace-3); margin-bottom: var(--cp-espace-6); }
.cp-ref__sommaire { position: sticky; top: 0; z-index: 5; display: flex; gap: var(--cp-espace-2); overflow-x: auto; padding: var(--cp-espace-3) 0; margin-bottom: var(--cp-espace-5); background: var(--cp-fond); border-bottom: 1px solid var(--cp-bordure); scrollbar-width: thin; }
.cp-ref__section { margin-bottom: var(--cp-espace-8); scroll-margin-top: 72px; }
.cp-ref__section > header { margin-bottom: var(--cp-espace-5); display: grid; gap: var(--cp-espace-2); }
.cp-ref__section > header p { margin: 0; color: var(--cp-texte-doux); max-width: 70ch; }
.cp-ref__groupe { margin-bottom: var(--cp-espace-6); }
.cp-ref__groupe > h3 { font-size: var(--cp-taille-m); margin-bottom: var(--cp-espace-3); }
.cp-ref__bac { display: flex; flex-wrap: wrap; gap: var(--cp-espace-4); align-items: flex-end; padding: var(--cp-espace-5); background: var(--cp-carte); border: 1px dashed var(--cp-sauge); border-radius: var(--cp-rayon-carte); }
.cp-ref__bac--grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-items: start; }
.cp-ref__bac--fond { background: var(--cp-fond); }
.cp-ref__bac--haut { align-items: flex-start; }
.cp-ref__cas { display: grid; gap: var(--cp-espace-2); justify-items: start; }
.cp-ref__cas > small { font-size: var(--cp-taille-xs); color: var(--cp-texte-doux); }
.cp-ref__cas--large { width: 100%; justify-items: stretch; }
.cp-ref__pastilles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--cp-espace-4); }
.cp-ref__couleur { display: grid; gap: var(--cp-espace-2); font-size: var(--cp-taille-xs); }
.cp-ref__echantillon { height: 64px; border-radius: var(--cp-rayon-champ); border: 1px solid var(--cp-bordure); display: flex; align-items: flex-end; padding: var(--cp-espace-2); font-weight: 500; }
.cp-ref__code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: var(--cp-taille-xs); color: var(--cp-texte-doux); }
.cp-ref__icones { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: var(--cp-espace-3); }
.cp-ref__icone { display: grid; justify-items: center; gap: var(--cp-espace-2); padding: var(--cp-espace-3) var(--cp-espace-2); border: 1px solid var(--cp-bordure); border-radius: var(--cp-rayon-champ); background: var(--cp-carte); font-size: 11px; color: var(--cp-texte-doux); text-align: center; word-break: break-word; }
.cp-ref__icone .ic { color: var(--cp-foret-texte); }
.cp-ref__especes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 128px), 1fr)); gap: var(--cp-espace-4); width: 100%; }
.cp-ref__espece { display: grid; justify-items: center; gap: var(--cp-espace-2); padding: var(--cp-espace-4) var(--cp-espace-3); background: var(--cp-carte); border: 1px solid var(--cp-bordure); border-radius: var(--cp-rayon-carte); text-align: center; }
.cp-ref__tailles { display: inline-flex; align-items: center; gap: var(--cp-espace-3); color: var(--cp-foret-texte); }
.cp-ref__rayon { width: 88px; height: 64px; background: var(--cp-vert-clair); border: 1px solid var(--cp-sauge); }
.cp-ref__ombre { width: 120px; height: 72px; background: var(--cp-carte); border-radius: var(--cp-rayon-champ); }
.cp-ref__etats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--cp-espace-4); }
.cp-ref__nav-demo { display: grid; gap: var(--cp-espace-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; }
.cp-ref__nav-demo > div { padding: var(--cp-espace-4); background: var(--cp-carte); border: 1px solid var(--cp-bordure); border-radius: var(--cp-rayon-carte); }

/* États simulés : uniquement pour montrer « survol » et « focus » sur la page de référence */
.cp-input.is-survol, .cp-select.is-survol { border-color: var(--cp-foret); }
.cp-input.is-focus, .cp-select.is-focus { outline: none; border-color: var(--cp-foret); box-shadow: 0 0 0 3px var(--cp-vert-clair), 0 0 0 4px var(--cp-foret); }
.cp-btn.is-focus { outline: 2px solid var(--cp-focus); outline-offset: 2px; }
.cp-filtre.is-survol { background: var(--cp-fond-survol); border-color: var(--cp-foret); }
.cp-carte.is-survol { box-shadow: var(--cp-ombre-m); border-color: var(--cp-sauge); transform: translateY(-2px); }

/* Sommaire collant : sous l'en-tête mobile (≈50 px) ; en haut sur ordinateur */
.cp-ref__sommaire { top: 50px; }
.cp-ref__section { scroll-margin-top: 120px; }
@media (min-width: 800px) { .cp-ref__sommaire { top: 0; } .cp-ref__section { scroll-margin-top: 72px; } }

/* Écrans tactiles : toutes les cibles font au moins 44 px (les variantes « petit » restent compactes à la souris) */
@media (pointer: coarse), (max-width: 599px) {
  .cp-onglet, .cp-case, .cp-interrupteur { min-height: var(--cp-cible-tactile); }
}

/* Un bouton qui est un lien garde les couleurs de sa variante (sinon « .cp a » les écrase : texte vert sur fond vert) */
.cp a.cp-btn { text-decoration: none; }
.cp a.cp-btn--principal, .cp a.cp-btn--danger { color: var(--cp-texte-inverse); }
.cp a.cp-btn--secondaire { color: var(--cp-foret-texte); }
.cp a.cp-btn--discret { color: var(--cp-texte-doux); }

/* Choix de la couleur d'un animal : une pastille de la couleur devant son nom (le nom est toujours écrit : la couleur ne porte jamais seule l'information) */
.cp-choix--couleurs { display: flex; flex-wrap: wrap; gap: var(--cp-espace-2); }
.cp-choix--couleurs .cp-choix__option span { min-height: var(--cp-h-bouton); padding: 0 12px; }
.cp-choix--couleurs .cp-choix__option[class*="cp-an-"] span::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--an-trait); flex: none; }
/* Fenêtre « Couleur de … » : mêmes pastilles que le formulaire, mais ce sont des boutons (un clic enregistre) */
.cp-couleur { display: inline-flex; align-items: center; gap: var(--cp-espace-2); min-height: var(--cp-h-bouton); padding: 0 12px; background: var(--cp-carte); color: var(--cp-foret-texte); border: 1px solid var(--cp-bordure-champ); border-radius: var(--cp-rayon-bouton); font: inherit; font-family: var(--cp-police-texte); font-weight: 500; font-size: var(--cp-taille-s); cursor: pointer; transition: background-color var(--cp-duree-rapide) var(--cp-courbe), border-color var(--cp-duree-rapide) var(--cp-courbe); }
.cp-couleur[class*="cp-an-"]::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--an-trait); flex: none; }
.cp-couleur:hover { background: var(--cp-surface-2); border-color: var(--cp-foret); }
.cp-couleur[aria-pressed="true"] { background: var(--cp-vert-clair); border-color: var(--cp-foret); box-shadow: inset 0 0 0 1px var(--cp-foret); }
.cp-couleur:focus-visible { outline: 2px solid var(--cp-focus); outline-offset: 2px; }
/* Choix du type de soin : l'icône reprend la couleur du type */
.cp-choix__option[class*="cp-type--"] .ic { color: var(--t-texte); }
