/* App de gestion Lorem : style iOS, clair ou sombre, animations courtes et réduites sur demande. */
/* Couleurs claires et sombres en une ligne (light-dark) : thème du téléphone ou thème forcé, accent au choix. */
:root {
	color-scheme: light dark;
	--fond: light-dark(#f2f2f7, #000);
	--carte: light-dark(#fff, #1c1c1e);
	--carte2: light-dark(#f2f2f7, #2c2c2e);
	--texte: light-dark(#000, #fff);
	--texte2: light-dark(rgba(60, 60, 67, .62), rgba(235, 235, 245, .6));
	--trait: light-dark(rgba(60, 60, 67, .16), rgba(84, 84, 88, .55));
	--accent: light-dark(#7826ff, #a67bff);
	--accent-fond: color-mix(in srgb, var(--accent) 12%, transparent);
	--vert: light-dark(#248a3d, #30d158);
	--vert-fond: light-dark(rgba(52, 199, 89, .14), rgba(48, 209, 88, .16));
	--rouge: light-dark(#d70015, #ff453a);
	--rouge-fond: light-dark(rgba(255, 59, 48, .12), rgba(255, 69, 58, .16));
	--orange: light-dark(#c93400, #ff9f0a);
	--orange-fond: light-dark(rgba(255, 149, 0, .14), rgba(255, 159, 10, .16));
	--squelette: light-dark(rgba(60, 60, 67, .09), rgba(235, 235, 245, .1));
	--interrupteur: light-dark(rgba(120, 120, 128, .16), rgba(120, 120, 128, .36));
	--courbe: cubic-bezier(.2, .8, .2, 1);
	--haut: env(safe-area-inset-top);
	--bas: env(safe-area-inset-bottom);
}
:root[data-theme="clair"] { color-scheme: light; }
:root[data-theme="sombre"] { color-scheme: dark; }
/* Sur la racine pour toute l'app, sur une pastille de Réglages pour son aperçu. */
[data-accent="violet"] { --accent: light-dark(#7826ff, #a67bff); }
[data-accent="indigo"] { --accent: light-dark(#5856d6, #7d7aff); }
[data-accent="bleu"] { --accent: light-dark(#007aff, #0a84ff); }
[data-accent="vert"] { --accent: light-dark(#248a3d, #30d158); }
[data-accent="orange"] { --accent: light-dark(#c93400, #ff9f0a); }
[data-accent="rose"] { --accent: light-dark(#d30f45, #ff375f); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fond); color: var(--texte); }
/* Interface fixe comme une app : ni zoom au double toucher (code PIN tapé vite), ni pincement ; le défilement reste. */
html { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; }
.clavier, .nav, .boutons-haut, .segments, .puces, .feuille { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body { font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); text-decoration: none; }
a.ligne, a.carte, a.chiffre { color: var(--texte); }
[hidden] { display: none !important; }

/* Mise en page : barre d'onglets sur téléphone, barre latérale et fiche à droite sur ordinateur. */
.coque { min-height: 100dvh; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: flex-start; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 6px 4px calc(6px + var(--bas)); background: color-mix(in srgb, var(--carte) 82%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--trait); }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: 1 0 21%; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--texte2); padding: 2px 0; }
.nav a.actif { color: var(--accent); }
.nav svg { width: 25px; height: 25px; }
.nav .marque, .nav .verrou, .creer-nav { display: none; }
/* Rangée du haut (Créer, Réglages) au-dessus du grand titre, comme iOS. */
.vue { padding: calc(var(--haut) + 56px) 16px calc(90px + var(--bas)); max-width: 760px; margin: 0 auto; }
.panneau { display: none; }

@media (min-width: 960px) {
	.coque { display: grid; grid-template-columns: 232px minmax(0, 1fr); }
	.coque.avec-fiche { grid-template-columns: 232px minmax(0, 1fr) 400px; }
	.nav { position: sticky; top: 0; height: 100dvh; overflow: visible; flex-direction: column; justify-content: flex-start; gap: 2px; padding: 20px 12px; border-top: 0; border-right: .5px solid var(--trait); background: var(--carte); -webkit-backdrop-filter: none; backdrop-filter: none; }
	.nav a { flex: none; flex-direction: row; gap: 10px; font-size: 15px; padding: 8px 10px; border-radius: 10px; color: var(--texte); }
	.nav a.actif { background: var(--accent-fond); color: var(--accent); }
	.nav svg { width: 20px; height: 20px; }
	.nav .marque { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 19px; padding: 2px 10px 12px; }
	.creer-nav { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 2px 16px; padding: 10px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; transition: transform .15s var(--courbe); }
	.creer-nav:active { transform: scale(.97); }
	.nav .creer-nav svg { width: 18px; height: 18px; stroke-width: 2.4; }
	.nav .verrou { display: flex; margin-top: auto; color: var(--texte2); }
	.vue { max-width: none; width: 100%; padding: 28px 32px 40px; }
	.coque.avec-fiche .panneau { display: block; position: sticky; top: 0; height: 100dvh; overflow-y: auto; border-left: .5px solid var(--trait); background: var(--fond); padding: 24px 22px 40px; }
	.coque.avec-fiche .vue .ecran-fiche { display: none; }
	.retour { display: none !important; }
}

/* Titres, groupes, lignes. */
.surtitre { color: var(--texte2); font-size: 13px; text-transform: none; margin: 2px 4px 0; }
h1 { font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; margin: 2px 4px 16px; }
h2 { font-size: 13px; font-weight: 400; color: var(--texte2); margin: 22px 16px 7px; }
.groupe { background: var(--carte); border-radius: 12px; overflow: hidden; }
.ligne { display: flex; align-items: center; gap: 12px; padding: 11px 16px; min-height: 48px; position: relative; width: 100%; text-align: left; }
.ligne + .ligne::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--trait); }
.ligne .corps { flex: 1; min-width: 0; }
.ligne .titre { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne .sous { color: var(--texte2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne .fin { color: var(--texte2); font-size: 15px; white-space: nowrap; }
button.ligne:active, a.ligne:active { background: var(--carte2); }
.chevron { width: 8px; height: 13px; color: var(--texte2); opacity: .55; flex: none; }
.icone { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--accent-fond); color: var(--accent); }
.icone svg { width: 18px; height: 18px; }
.icone.vert { background: var(--vert-fond); color: var(--vert); }
.icone.rouge { background: var(--rouge-fond); color: var(--rouge); }
.icone.orange { background: var(--orange-fond); color: var(--orange); }
.icone.gris { background: var(--carte2); color: var(--texte2); }

/* Logo de la barre latérale ; « Plus d'actions », « Tout l'historique ». */
.logo-app { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.h2-haut { margin-top: 26px; }
.ligne.lien-plus { justify-content: center; color: var(--accent); font-size: 16px; }

/* Projet de la fiche : étapes cochées en vert. */
.etape .coche { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--trait); display: grid; place-items: center; flex: none; font-size: 13px; color: var(--texte2); transition: background .2s var(--courbe); }
.etape.faite .coche { background: var(--vert); border-color: var(--vert); color: #fff; }
.etape .coche svg { width: 16px; height: 16px; stroke-width: 2.6; }

/* Agenda : heure des rendez-vous, frise des envois prévus. */
.heure-rdv { min-width: 62px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.aide-haut { margin: 0 4px 18px; }
.groupe-mails { margin-top: 22px; }
.frise { margin-left: 8px; padding-left: 20px; border-left: 2px solid var(--trait); }
.frise-jour { position: relative; padding-bottom: 14px; }
.frise-jour::before { content: ""; position: absolute; left: -27px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--fond); }
.frise-date { font-size: 13px; font-weight: 600; color: var(--texte2); margin-bottom: 8px; }
.frise-item { display: flex; align-items: center; gap: 12px; background: var(--carte); color: var(--texte); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; }
.frise-item .corps { flex: 1; min-width: 0; }
.frise-item .sous { color: var(--texte2); font-size: 14px; }
.frise-item .fin { color: var(--texte2); font-size: 15px; white-space: nowrap; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-fond); color: var(--accent); font-weight: 600; font-size: 14px; }
.pastille { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--accent-fond); color: var(--accent); white-space: nowrap; }
.pastille.vert { background: var(--vert-fond); color: var(--vert); }
.pastille.rouge { background: var(--rouge-fond); color: var(--rouge); }
.pastille.orange { background: var(--orange-fond); color: var(--orange); }
.pastille.gris { background: var(--carte2); color: var(--texte2); }
.vide { color: var(--texte2); font-size: 15px; padding: 14px 16px; }

/* Chiffres de l'accueil. */
.chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chiffre { background: var(--carte); border-radius: 12px; padding: 12px 14px; }
.chiffre span { display: block; color: var(--texte2); font-size: 13px; }
.chiffre strong { display: block; font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* Jauge d'avancement (projets). */
.jauge { display: block; width: 100%; height: 4px; margin-top: 7px; }
.jauge rect { fill: var(--accent); }
.jauge rect.fond { fill: var(--squelette); }

/* Demandes : segments, colonnes, recherche. */
.segments { display: flex; background: var(--squelette); border-radius: 9px; padding: 2px; margin: 0 0 14px; }
.segments button { flex: 1; padding: 6px; border-radius: 7px; font-size: 14px; transition: background .2s var(--courbe); }
.segments button.actif { background: var(--carte); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-weight: 600; }
.colonnes { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 8px; scrollbar-width: none; }
.colonnes::-webkit-scrollbar { display: none; }
.colonne { flex: 0 0 min(78vw, 290px); scroll-snap-align: start; border-radius: 14px; padding: 2px; transition: background .2s var(--courbe); }
.colonne.survol { background: var(--accent-fond); }
.colonne h3 { font-size: 13px; font-weight: 600; color: var(--texte2); margin: 4px 6px 8px; display: flex; justify-content: space-between; }
.carte { display: block; width: 100%; text-align: left; background: var(--carte); border-radius: 12px; padding: 11px 13px; margin-bottom: 8px; transition: transform .18s var(--courbe), box-shadow .18s var(--courbe); }
.carte:active { transform: scale(.98); }
.carte .titre { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carte .sous { color: var(--texte2); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carte.choisie { box-shadow: 0 0 0 2px var(--accent); }
.carte[draggable="true"] { cursor: grab; }
.carte.glisse { opacity: .45; }
.chercher { width: 100%; border: 0; border-radius: 10px; background: var(--squelette); padding: 9px 12px; font-size: 17px; outline: none; margin-bottom: 14px; }
.filtres { display: flex; gap: 8px; margin: -4px 0 14px; }
.filtres button { font-size: 13px; padding: 5px 11px; border-radius: 999px; background: var(--carte); color: var(--texte2); }
.filtres button.actif { background: var(--accent); color: #fff; }
@media (min-width: 960px) { .colonnes { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); margin: 0; padding: 0 0 8px; } .colonne { min-width: 0; } }

/* Fiche client. */
.retour { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 17px; margin: -46px 0 14px -4px; padding: 4px; }
.retour svg { width: 12px; height: 20px; }
.entete { text-align: center; margin: 4px 0 16px; }
.entete .avatar { width: 72px; height: 72px; font-size: 26px; margin: 0 auto 10px; }
.entete .nom { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.entete .sous { color: var(--texte2); font-size: 15px; margin-top: 2px; }
.entete .pastilles { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.entete .pastilles button { font: inherit; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 6px; }
.action { background: var(--carte); border-radius: 12px; padding: 10px 4px 9px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--accent); font-size: 12px; }
.action svg { width: 22px; height: 22px; }
.action.inactive { opacity: .35; pointer-events: none; }
.notes { width: 100%; min-height: 84px; border: 0; background: var(--carte); border-radius: 12px; padding: 12px 16px; resize: vertical; outline: none; font-size: 16px; }
.histo .ligne { align-items: flex-start; }
.point { width: 8px; height: 8px; border-radius: 50%; background: var(--trait); margin-top: 7px; flex: none; }
.point.ok { background: var(--vert); }
.point.ko { background: var(--rouge); }
.point.retenu { background: var(--texte2); }
.histo .titre { white-space: normal; font-size: 15px; }
/* Historique et message coupés à 2 lignes, un toucher déplie. */
.pli .titre { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.pli.deplie .titre { -webkit-line-clamp: unset; }
.pliable { cursor: pointer; }
.texte-ok { color: var(--vert); }
.texte-ko { color: var(--rouge); }

/* Bouton Créer : en haut à droite sur téléphone, dans la barre latérale sur ordinateur. */
/* Logo en haut à gauche sur téléphone (la barre latérale le porte sur ordinateur). */
.logo-haut { position: fixed; z-index: 15; top: calc(var(--haut) + 13px); left: 18px; color: var(--texte2); }
.logo-svg { display: block; }
.logo-haut .logo-svg { width: 30px; height: 30px; }
.nav .marque .logo-svg { width: 24px; height: 24px; color: var(--texte2); }
/* Titres des onglets masqués (réglage) : icônes seules dans la barre du bas. */
@media (max-width: 959px) { [data-titres="non"] .nav a span { display: none; } [data-titres="non"] .nav a { padding: 6px 0; } [data-titres="non"] .nav svg { width: 27px; height: 27px; } }

/* Tâches : rond à cocher, texte barré une fois faite, ajout rapide, dates en pastilles. */
.tache { align-items: flex-start; }
.rond { width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; border: 1.8px solid var(--trait); display: grid; place-items: center; flex: none; color: #fff; transition: background .2s var(--courbe), border-color .2s var(--courbe); }
.tache.faite .rond { background: var(--accent); border-color: var(--accent); }
.rond svg { width: 15px; height: 15px; stroke-width: 2.6; }
.tache .corps { cursor: pointer; }
.tache .titre { white-space: normal; transition: color .2s; }
.tache.faite .titre { text-decoration: line-through; color: var(--texte2); }
.ajout-tache { display: flex; align-items: center; gap: 12px; padding: 11px 16px; }
.ajout-tache input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 17px; padding: 0; }
.vide-rond { border-style: dashed; margin-top: 0; }
.ajouter { color: var(--accent); font-size: 16px; font-weight: 600; }
.ajouter:disabled { opacity: .35; }
.dates { margin: 10px 4px 0; }
.puce-date input { inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: auto; }
.puce-date.choisie span { background: var(--accent); color: #fff; font-weight: 600; }
.puce-client { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: light-dark(#eeeef3, #3a3a3c); font-size: 15px; max-width: 100%; }
.puce-client svg { width: 17px; height: 17px; flex: none; }
.puce-client span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.puce-client.choisie { background: var(--accent); color: #fff; font-weight: 600; }
.ligne.note[data-resultats] { display: block; padding: 0; min-height: 0; }
.ligne.note[data-aucun] { justify-content: center; color: var(--accent); cursor: pointer; }
h2.texte-ko { color: var(--rouge); }
.groupe-suite { margin-top: 10px; }
.version { text-align: center; color: var(--texte2); font-size: 12px; margin: 24px 0 6px; }
.sur-fiche .logo-haut { display: none; }
@media (min-width: 960px) { .logo-haut { display: none; } }

/* Actus : zone d'écriture, photo, liste des actus publiées. */
.composer { padding: 12px 16px; }
.composer textarea { width: 100%; min-height: 96px; border: 0; background: none; outline: none; resize: none; font-size: 17px; padding: 0; }
.composer .apercu { display: block; max-width: 100%; max-height: 240px; border-radius: 10px; margin: 6px 0 10px; object-fit: cover; cursor: pointer; }
.composer-bas { display: flex; align-items: center; gap: 12px; padding-top: 10px; border-top: .5px solid var(--trait); }
.photo { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 15px; cursor: pointer; }
.photo svg { width: 22px; height: 22px; }
.compte { margin-left: auto; color: var(--texte2); font-size: 13px; }
.bouton-publier { padding: 8px 18px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; transition: opacity .2s; }
.bouton-publier:disabled { opacity: .4; }
.actu { align-items: flex-start; }
.actu .titre { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.vignette { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; }

.boutons-haut { position: fixed; z-index: 15; top: calc(var(--haut) + 10px); right: 14px; display: flex; gap: 10px; }
.engrenage { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--carte); color: var(--texte2); box-shadow: 0 1px 6px rgba(0, 0, 0, .1); transition: transform .15s var(--courbe), color .2s; }
.engrenage.actif { color: var(--accent); }
.engrenage:active { transform: scale(.9); }
.engrenage svg { width: 21px; height: 21px; }
.plus { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform .15s var(--courbe); }
.plus:active { transform: scale(.9); }
.plus svg { width: 20px; height: 20px; stroke-width: 2.2; }
@media (min-width: 960px) { .plus { display: none; } .boutons-haut { top: 18px; right: 22px; } }
.voir-plus { display: block; margin: 14px auto 0; padding: 9px 20px; border-radius: 999px; background: var(--carte); color: var(--accent); font-size: 15px; font-weight: 600; }
.voir-plus:disabled { opacity: .6; }
.aide { color: var(--texte2); font-size: 13px; margin: 7px 16px 0; }

/* Réglages. */
.teintes { display: flex; flex-wrap: wrap; gap: 16px; padding: 14px 16px; }
.teinte { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--carte), 0 0 0 4px transparent; transition: box-shadow .2s var(--courbe), transform .15s var(--courbe); }
.teinte:active { transform: scale(.9); }
.teinte[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--carte), 0 0 0 4px var(--accent); }

/* Formulaires : libellé à gauche, valeur à droite, interrupteurs iOS. */
.champ > span:first-child { flex: none; max-width: 55%; }
.champ input:not([type="checkbox"]):not([type="radio"]), .champ select { flex: 1; min-width: 0; border: 0; background: none; outline: none; text-align: right; font-size: 17px; color: var(--texte2); padding: 0; }
.champ input:not([type="checkbox"]):not([type="radio"]):focus { color: var(--texte); }
.champ input[type="date"] { -webkit-appearance: none; appearance: none; display: flex; justify-content: flex-end; }
/* Menu (5 choix et plus) : pastille teintée bien visible, comme les menus d'iOS 18. */
.champ select { -webkit-appearance: none; appearance: none; flex: 0 1 auto; max-width: 64%; margin-left: auto; padding: 7px 32px 7px 14px; border-radius: 999px; background: var(--accent-fond); color: var(--accent); font-size: 16px; font-weight: 500; text-align: left; text-overflow: ellipsis; cursor: pointer; }
.chevrons { width: 10px; height: 16px; color: var(--accent); flex: none; margin-left: -30px; pointer-events: none; }
/* Moins de 5 choix : boutons visibles, le choix en couleur. */
.champ.boutons { flex-direction: column; align-items: stretch; gap: 9px; }
.champ.boutons > span:first-child { max-width: none; }
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce { position: relative; cursor: pointer; }
.puce input { position: absolute; opacity: 0; pointer-events: none; }
.puce span { display: block; padding: 8px 15px; border-radius: 999px; background: light-dark(#eeeef3, #3a3a3c); font-size: 15px; transition: background .2s var(--courbe), color .2s var(--courbe); }
.puce input:checked + span { background: var(--accent); color: #fff; font-weight: 600; }
.puce input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.champ.zone textarea { width: 100%; border: 0; background: none; outline: none; resize: vertical; min-height: 70px; font-size: 17px; padding: 0; }
.ligne.note { color: var(--texte2); font-size: 15px; }
.ligne.note:empty { display: none; }
.interrupteur { -webkit-appearance: none; appearance: none; flex: none; margin: 0 0 0 auto; width: 51px; height: 31px; border-radius: 999px; background: var(--interrupteur); position: relative; cursor: pointer; transition: background .25s var(--courbe); }
.interrupteur::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .25s var(--courbe); }
.interrupteur:checked { background: var(--accent); }
.interrupteur:checked::after { transform: translateX(20px); }
.modale { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; top: calc(var(--haut) + 10px); display: flex; flex-direction: column; background: var(--fond); border-radius: 12px 12px 0 0; box-shadow: 0 -4px 24px rgba(0, 0, 0, .18); transform: translateY(105%); transition: transform .38s var(--courbe); }
.modale.ouvert { transform: none; }
.modale header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 14px 16px 6px; }
.modale header strong { font-size: 17px; font-weight: 600; }
.modale header button { justify-self: start; color: var(--accent); font-size: 17px; }
.modale header .ok { justify-self: end; font-weight: 600; }
.modale header .ok:disabled { opacity: .4; }
.corps-modale { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px calc(28px + var(--bas)); }
/* Feuille au-dessus de la page : fond surélevé en sombre, comme iOS. Groupe sans titre séparé du précédent. */
.modale { background: light-dark(#f2f2f7, #1c1c1e); }
.modale .groupe { background: light-dark(#fff, #2c2c2e); }
.corps-modale .bloc > .groupe:first-child { margin-top: 22px; }
.corps-modale .bloc:first-child > .groupe:first-child { margin-top: 12px; }
.champ:has(.interrupteur) > span:first-child { flex: 1; max-width: none; }
.corps-modale .erreur { text-align: center; }
@media (min-width: 700px) {
	.modale { top: 6vh; bottom: auto; max-height: 88vh; width: min(560px, calc(100% - 32px)); margin: 0 auto; border-radius: 14px; opacity: 0; transform: translateY(24px) scale(.98); transition: transform .3s var(--courbe), opacity .3s var(--courbe); }
	.modale.ouvert { opacity: 1; transform: none; }
}

/* Feuille d'action (statuts, menu Créer). */
.voile { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .32); opacity: 0; transition: opacity .25s var(--courbe); }
.voile.ouvert { opacity: 1; }
.feuille { position: fixed; left: 8px; right: 8px; bottom: calc(8px + var(--bas)); z-index: 41; max-width: 440px; margin: 0 auto; transform: translateY(110%); transition: transform .32s var(--courbe); }
.feuille.ouvert { transform: none; }
.feuille .groupe { margin-bottom: 8px; }
.feuille .ligne { justify-content: center; color: var(--accent); font-size: 18px; }
.feuille .ligne.choisi { font-weight: 600; }
.feuille .titre-feuille { text-align: center; color: var(--texte2); font-size: 13px; padding: 12px; }

/* Verrou : connexion, code, PIN. */
.verrou-ecran { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(var(--haut) + 24px) 24px calc(var(--bas) + 24px); text-align: center; }
.verrou-ecran .logo { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 18px; }
.verrou-ecran h1 { font-size: 26px; margin: 0 0 6px; }
.verrou-ecran p { color: var(--texte2); margin: 0 0 22px; max-width: 320px; font-size: 15px; }
.champs { width: 100%; max-width: 340px; }
.champs input { width: 100%; border: 0; background: var(--carte); padding: 14px 16px; font-size: 17px; outline: none; }
.champs input:first-child { border-radius: 12px 12px 0 0; border-bottom: .5px solid var(--trait); }
.champs input:last-child { border-radius: 0 0 12px 12px; }
.champs input:only-child { border-radius: 12px; border-bottom: 0; text-align: center; letter-spacing: .4em; font-size: 24px; }
.bouton { width: 100%; max-width: 340px; margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 600; transition: opacity .2s; }
.bouton:disabled { opacity: .5; }
.erreur { color: var(--rouge); font-size: 14px; min-height: 20px; margin-top: 12px; }
.points-pin { display: flex; gap: 16px; margin: 6px 0 4px; }
.points-pin span { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--texte); transition: background .12s; }
.points-pin span.plein { background: var(--texte); }
.secoue { animation: secoue .4s var(--courbe); }
@keyframes secoue { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.clavier { display: grid; grid-template-columns: repeat(3, 76px); gap: 16px 24px; margin-top: 26px; }
.clavier button { width: 76px; height: 76px; border-radius: 50%; background: var(--carte); font-size: 30px; font-weight: 400; transition: background .12s; }
.clavier button:active { background: var(--squelette); }
.clavier button.sans { background: none; font-size: 16px; color: var(--accent); }
.clavier button.bio { display: grid; place-items: center; }
.clavier button.bio svg { width: 38px; height: 38px; }

/* Chargement : formes grises qui respirent, aucune roue. */
.sq { background: var(--squelette); border-radius: 8px; animation: respire 1.3s ease-in-out infinite; }
.sq-ligne { height: 48px; margin: 0; border-radius: 0; }
.sq-titre { height: 22px; width: 170px; margin: 0 auto; }
.ligne .titre.texte-long { white-space: normal; overflow-wrap: anywhere; }
.ligne .titre.histo-texte { white-space: pre-wrap; }
.sq-ligne + .sq-ligne { border-top: .5px solid var(--trait); }
@keyframes respire { 50% { opacity: .45; } }

/* Apparitions. */
.entre { animation: entre .32s var(--courbe) both; }
@keyframes entre { from { opacity: 0; transform: translateY(8px); } }
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--bas)); z-index: 50; transform: translate(-50%, 20px); opacity: 0; background: var(--texte); color: var(--fond); padding: 10px 16px; border-radius: 999px; font-size: 15px; transition: transform .3s var(--courbe), opacity .3s var(--courbe); pointer-events: none; }
.toast.vu { transform: translate(-50%, 0); opacity: 1; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
