:root {
  --fond: #FBF5F2;
  --carte: #FFFFFF;
  --encre: #2B1B21;
  --doux: #6E5A61;
  --rose: #B8355F;
  --rose-fonce: #7A1631;
  --rose-pale: #FCEFF3;
  --rose-clair: #FBE3EA;
  --ligne: #F0DDE2;
  --ligne-forte: #E6C9D2;
  --vert: #2E7D5B;
  --ambre: #8A5A00;
  --nuit: #2B1B21;
  --titre: 'Fraunces', Georgia, serif;
  --texte: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fond); color: var(--encre); font-family: var(--texte); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--rose); }
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.page { flex: 1; padding: max(28px, env(safe-area-inset-top)) 20px 28px; display: flex; flex-direction: column; gap: 14px; }
.page.avec-onglets { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.page.centre { justify-content: center; }
h1, h2, h3 { font-family: var(--titre); font-weight: 600; margin: 0; }
h1 { font-size: 48px; line-height: 1.02; color: var(--rose-fonce); }
h2 { font-size: 30px; line-height: 1.12; color: var(--rose-fonce); }
h3 { font-size: 21px; line-height: 1.25; }
p { margin: 0; line-height: 1.55; }
.doux { color: var(--doux); font-size: 14px; }
.petit { font-size: 13px; }
.sur-titre { font: 600 12px var(--texte); color: var(--doux); text-transform: uppercase; letter-spacing: 1px; }
.question { font-family: var(--titre); font-size: 22px; line-height: 1.3; }
.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.carte.rose { background: var(--rose-pale); border-color: #F3D3DD; }
.carte .entete { display: flex; justify-content: space-between; align-items: center; gap: 8px; font: 600 13px var(--texte); color: var(--rose-fonce); }
.ligne { display: flex; gap: 10px; align-items: center; }
.ligne.espace { justify-content: space-between; }
.ligne.haut { align-items: flex-start; }
.pile { display: flex; flex-direction: column; gap: 10px; }
.grille2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border-radius: 999px; border: none;
  background: var(--rose); color: #fff; font-weight: 600; font-size: 16px; cursor: pointer; width: 100%; text-decoration: none; text-align: center; }
.btn:hover { background: #9E2B50; }
.btn:disabled { background: #D9B3C0; cursor: not-allowed; }
.btn2 { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid var(--ligne-forte); background: #fff; color: var(--rose-fonce); font-weight: 600; font-size: 15px; cursor: pointer; width: 100%; text-align: center; }
.btn2:hover { background: var(--rose-pale); }
.btn2.actif { background: var(--rose); color: #fff; border-color: var(--rose); }
.btn2.danger { color: #9B1C1C; }
.lien { background: none; border: none; color: var(--rose-fonce); font-weight: 600; font-size: 14px; cursor: pointer; padding: 10px 2px; min-height: 44px; align-self: flex-start; }
.retour { padding-left: 0; }
.option { display: block; width: 100%; text-align: left; background: #fff; border-radius: 18px; padding: 14px 16px; border: 1.5px solid var(--ligne);
  font-size: 15px; line-height: 1.45; cursor: pointer; }
.option:hover { border-color: #D99AAE; }
.option.choisie { border-color: var(--rose); background: var(--rose-pale); }
.option.jouee { color: #8A757C; background: #F7EEF0; }
.option .titre { display: block; font-family: var(--titre); font-size: 18px; color: var(--rose-fonce); margin-bottom: 4px; }
.option .num { font-weight: 600; color: var(--rose-fonce); margin-right: 8px; }
.texte-long p + p { margin-top: 8px; }
.resume { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; color: #4A353C; }
.puce { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--rose-clair); color: var(--rose-fonce); font: 600 12px var(--texte); align-self: flex-start; }
.puce.verte { background: #E3F2EA; color: var(--vert); }
.champ { width: 100%; border: 1.5px solid var(--ligne-forte); border-radius: 16px; padding: 14px; font-size: 16px; line-height: 1.5; background: #fff; }
.champ:focus, select:focus { outline: 2px solid var(--rose); outline-offset: 1px; }
textarea.champ { min-height: 200px; resize: vertical; }
label { font-weight: 600; font-size: 14px; }
.case { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.case input { width: 22px; height: 22px; accent-color: var(--rose); flex: none; margin: 0; }
.niveau { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; border: 1.5px solid var(--ligne); border-radius: 16px;
  padding: 12px 14px; cursor: pointer; font-size: 15px; font-weight: 500; min-height: 52px; }
.niveau.choisi { border-color: var(--rose); background: var(--rose-pale); }
.icones { display: inline-flex; gap: 2px; min-width: 56px; }
.progression { display: flex; gap: 3px; }
.progression span { flex: 1; height: 8px; border-radius: 4px; }
.barre { height: 6px; border-radius: 3px; background: var(--ligne); overflow: hidden; }
.barre span { display: block; height: 100%; background: var(--rose); }
.bandeau-arret { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--nuit); color: #fff; font-size: 14px; }
.erreur { background: #FDECEC; color: #8A1C1C; border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.info { background: #E9F3EE; color: #1F5A41; border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.qr { background: #fff; border-radius: 18px; padding: 14px; align-self: center; width: 220px; }
.qr svg { display: block; width: 100%; height: auto; }
.code { font: 600 26px var(--texte); letter-spacing: 5px; text-align: center; }
.cercle { width: 104px; height: 104px; border-radius: 50%; background: var(--rose-clair); display: flex; align-items: center; justify-content: center; align-self: center; }
.onglets { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--ligne); display: flex; justify-content: center;
  padding: 4px 6px calc(10px + env(safe-area-inset-bottom)); z-index: 10; }
.onglets div { display: flex; width: 100%; max-width: 560px; }
.onglet { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: none; border: none;
  font-size: 11px; font-weight: 500; color: #7C676E; cursor: pointer; min-height: 56px; }
.onglet.actif { color: var(--rose); }
.vignette { background: #fff; border: 1px solid var(--ligne); border-radius: 18px; padding: 8px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.vignette img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 12px; background: #F6E6EB; }
.vignette .nom { font-weight: 600; font-size: 14px; }
.grande-image { width: 100%; border-radius: 18px; background: #F6E6EB; }
.contrat-item { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--ligne); }
.contrat-item:last-child { border-bottom: none; }
.contrat-item .selects { display: flex; gap: 8px; }
.contrat-item select { flex: 1; min-height: 44px; border: 1.5px solid var(--ligne-forte); border-radius: 12px; background: #fff; padding: 0 8px; font-size: 14px; }
.sous-groupe { font: 600 12px var(--texte); color: var(--doux); text-transform: uppercase; letter-spacing: .8px; margin-top: 10px; }
details summary { cursor: pointer; font-weight: 600; color: var(--rose-fonce); padding: 6px 0; }
.collant-bas { position: sticky; bottom: calc(80px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--fond) 30%); padding-top: 16px; }
.attente { animation: battre 1.6s ease-in-out infinite; }
@keyframes battre { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .attente { animation: none; } }
