/* =========================================================
   Erylo — choix « Couleurs et police »
   (assets/js/apparence.js). Jetons de tokens.css seulement ;
   les couleurs des modèles arrivent par --f, --t, --a, --c.
   ========================================================= */
.ap { display: grid; gap: 22px; }
.ap-bloc { display: grid; gap: 10px; min-width: 0; }
.ap-titre { margin: 0; font-weight: 600; font-size: 15.5px; color: var(--encre); }
.ap-aide { margin: 0; font-size: 14px; color: var(--gris); }

/* Ambiances : une tuile = fond + « Aa » dans la couleur du texte + trait de la couleur des boutons */
.ap-ambiances { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.ap-amb { position: relative; display: grid; gap: 6px; justify-items: center; cursor: pointer; min-width: 0; }
.ap-amb input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ap-tuile {
  position: relative;
  display: grid; place-items: center;
  width: 100%; aspect-ratio: 4 / 3;
  border-radius: 12px;
  background: var(--f);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t) 18%, transparent);
  transition: box-shadow .15s, transform .15s;
}
.ap-aa { font: 650 22px/1 var(--f-titre); color: var(--t); letter-spacing: -0.02em; }
.ap-tuile i { position: absolute; left: 50%; bottom: 14%; width: 38%; height: 6px; border-radius: 99px; background: var(--a); transform: translateX(-50%); }
.ap-nom { font-size: 13.5px; font-weight: 500; color: var(--gris); text-align: center; line-height: 1.25; overflow-wrap: anywhere; }
.ap-amb:hover .ap-tuile { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t) 18%, transparent), 0 0 0 2px var(--lichen); }
.ap-amb input:checked + .ap-tuile { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t) 18%, transparent), 0 0 0 3px var(--doubs); }
.ap-amb input:checked ~ .ap-nom { color: var(--encre); font-weight: 650; }
.ap-amb input:focus-visible + .ap-tuile { outline: 2px solid var(--doubs); outline-offset: 5px; }
.ap-amb input:checked + .ap-tuile::after {
  content: ""; position: absolute; top: -7px; right: -7px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--doubs) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat;
  box-shadow: 0 0 0 2px var(--blanc);
}

/* Polices : échantillon « Aa » dans la police des titres */
.ap-polices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 8px; }
.ap-police { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1.5px solid var(--ligne); border-radius: var(--r-carte); background: var(--blanc); cursor: pointer; min-width: 0; }
.ap-police input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ap-ech { flex: none; width: 46px; font-size: 28px; line-height: 1; color: var(--encre); text-align: center; }
.ap-pol-texte { min-width: 0; }
.ap-police strong { display: block; font-weight: 600; font-size: 15px; line-height: 1.3; }
.ap-police small { display: block; font-size: 13.5px; color: var(--gris); line-height: 1.35; }
.ap-du-modele { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 99px; background: var(--brume); font-size: 11.5px; font-weight: 600; color: var(--doubs); vertical-align: 1px; }
.ap-police:hover { border-color: var(--lichen); }
.ap-police:has(input:checked) { border-color: var(--doubs); box-shadow: inset 0 0 0 1px var(--doubs); }
.ap-police:has(input:focus-visible) { outline: 2px solid var(--doubs); outline-offset: 3px; }

.ap-bloc-taille .bascule { justify-self: start; }

/* Affiner : fond, texte, boutons */
.ap-affiner { border-top: 1px solid var(--ligne); padding-top: 14px; }
.ap-affiner summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 15px; color: var(--doubs); list-style: none; }
.ap-affiner summary::-webkit-details-marker { display: none; }
.ap-affiner summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.ap-affiner[open] summary::before { transform: rotate(45deg); }
.ap-affiner-corps { display: grid; gap: 16px; margin-top: 16px; }
.ap-rangee { display: grid; gap: 8px; }
.ap-sous { margin: 0; font-size: 14.5px; font-weight: 600; }
.ap-pastilles { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ap-pastille { position: relative; cursor: pointer; }
.ap-pastille input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ap-pastille span {
  display: block; width: 34px; height: 34px; border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
  transition: box-shadow .15s;
}
.ap-pastille:hover span { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14), 0 0 0 2px var(--lichen); }
.ap-pastille input:checked + span { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14), 0 0 0 2px var(--blanc), 0 0 0 4px var(--doubs); }
.ap-pastille input:focus-visible + span { outline: 2px solid var(--doubs); outline-offset: 5px; }
.ap-pastille.inactif { cursor: not-allowed; }
.ap-pastille.inactif input { cursor: not-allowed; }
.ap-pastille.inactif span { opacity: .28; background-image: linear-gradient(135deg, transparent 45%, var(--gris) 45%, var(--gris) 55%, transparent 55%); }
.ap-autre { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 4px; border: 1.5px dashed var(--ligne); border-radius: 99px; font-size: 13.5px; font-weight: 600; color: var(--gris); cursor: pointer; }
.ap-autre input { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.ap-autre input::-webkit-color-swatch-wrapper { padding: 0; }
.ap-autre input::-webkit-color-swatch { border: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); }
.ap-autre input::-moz-color-swatch { border: 0; border-radius: 50%; }
.ap-autre:hover { border-color: var(--lichen); }
.ap-autre:has(input:focus-visible) { outline: 2px solid var(--doubs); outline-offset: 3px; }
.ap-lisible { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: var(--r-ctrl); background: var(--ok-pale); color: var(--ok); font-size: 14px; }
.ap-lisible svg { flex: none; margin-top: 2px; }
.ap-lisible span { color: var(--encre); }
.ap-lisible strong { color: var(--ok); font-weight: 650; }
.ap-pied { margin: 0; }

/* Animations du site (interrupteur sous « Couleurs et police », espace thérapeute) */
.ap-animations { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--ligne); }
