:root {
  --accent: #000000;
  --accent-clair: #EFEFEF;
  --noir: #141414;
  --gris: #6B6B6B;
  --trait: #DEDEDE;
  --fond: #F8F8F8;
  --blanc: #FFFFFF;
  --vert: #000000;
  --rouge: #B3261E;
  --r: 14px;
  --haut: env(safe-area-inset-top, 0px);
  --bas: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  background: var(--fond); color: var(--noir); font-size: 17px; line-height: 1.4;
  -webkit-text-size-adjust: 100%; overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }

.ecran { min-height: 100dvh; display: flex; flex-direction: column; }

/* En-tête noir */
.tete {
  background: var(--accent); color: var(--blanc);
  padding: calc(var(--haut) + 10px) 16px 10px; display: flex; align-items: center; gap: 12px; min-height: 56px;
}
.tete img { width: 30px; height: 30px; object-fit: contain; filter: invert(1); }
.tete .titre { flex: 1; font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tete .petit { font-weight: 400; opacity: .8; font-size: 14px; }
.tete button { color: var(--blanc); font-size: 15px; padding: 8px 4px; min-width: 44px; min-height: 44px; }
.tete .retour { font-size: 30px; line-height: 1; text-align: left; }
.progression { height: 5px; background: #D9D9D9; }
.progression span { display: block; height: 100%; background: var(--accent); transition: width .2s; }

.corps { flex: 1; padding: 20px 16px calc(var(--bas) + 110px); max-width: 640px; width: 100%; margin: 0 auto; }
.question { font-size: 26px; font-weight: 700; line-height: 1.2; margin: 8px 0 6px; }
.aide { color: var(--gris); font-size: 15px; margin: 0 0 16px; }
.compteur { color: var(--gris); font-size: 14px; font-weight: 600; letter-spacing: .02em; }

/* Tuiles */
.tuiles { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
.tuiles.deux { grid-template-columns: 1fr 1fr; }
.tuile {
  min-height: 64px; padding: 14px 16px; border-radius: var(--r);
  background: var(--blanc); border: 2px solid var(--trait);
  font-size: 19px; font-weight: 600; text-align: left; display: flex; align-items: center; gap: 12px;
}
.tuiles.deux .tuile { justify-content: center; text-align: center; min-height: 84px; font-size: 22px; }
.tuile:active { transform: scale(.985); }
.tuile.choisie { background: var(--accent); border-color: var(--accent); color: var(--blanc); }
.tuile .coche { width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--trait); flex: none; display: grid; place-items: center; font-size: 17px; }
.tuile.choisie .coche { border-color: var(--blanc); background: var(--blanc); color: var(--accent); }

/* Champs */
.champ {
  width: 100%; font-size: 22px; padding: 16px; border-radius: var(--r);
  border: 2px solid var(--trait); background: var(--blanc); margin-top: 14px; outline: none;
}
.champ:focus { border-color: var(--accent); }
.puces { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.puce { padding: 10px 14px; border-radius: 999px; background: var(--blanc); border: 1.5px solid var(--trait); font-size: 16px; font-weight: 600; }
.puce:active, .puce.choisie { background: var(--accent); border-color: var(--accent); color: var(--blanc); }
.erreur { color: var(--rouge); font-weight: 600; font-size: 15px; margin-top: 10px; min-height: 1em; }
.info { color: var(--gris); font-size: 15px; margin-top: 10px; }

/* Barre du bas */
.bas {
  position: fixed; left: 0; right: 0; bottom: 0; background: rgba(248,248,248,.96);
  border-top: 1px solid var(--trait); padding: 12px 16px calc(var(--bas) + 12px);
  display: flex; gap: 10px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.bas > * { flex: 1; }
.btn {
  min-height: 58px; border-radius: var(--r); font-size: 19px; font-weight: 700;
  background: var(--accent); color: var(--blanc); padding: 0 18px;
}
.btn:disabled { opacity: .35; }
.btn.clair { background: var(--blanc); color: var(--noir); border: 2px solid var(--trait); }
.btn.lien { background: none; color: var(--gris); font-weight: 600; font-size: 16px; min-height: 44px; }
.btn.danger { background: var(--blanc); color: var(--rouge); border: 2px solid var(--trait); }

/* Accueil */
.accueil .tete { padding-bottom: 28px; flex-direction: column; align-items: flex-start; gap: 18px; }
.accueil .tete .ligne { display: flex; width: 100%; align-items: center; gap: 12px; }
.accueil .tete img { width: 46px; height: 46px; }
.accueil .salon { font-size: 26px; font-weight: 700; line-height: 1.15; }
.accueil .vendeur { opacity: .85; font-size: 16px; }
.gros {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 150px; border-radius: 20px; background: var(--accent); color: var(--blanc);
  font-size: 26px; font-weight: 700; margin-top: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.22);
}
.gros small { font-size: 15px; font-weight: 400; opacity: .85; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.stat { background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--r); padding: 14px; }
.stat b { display: block; font-size: 30px; line-height: 1.1; }
.stat span { color: var(--gris); font-size: 14px; }
.stat.attente b { color: var(--accent); }
.bandeau { margin-top: 14px; padding: 12px 14px; border-radius: var(--r); background: var(--accent-clair); color: var(--accent); font-size: 15px; font-weight: 600; }
.bandeau.rouge { background: #FBE9E7; color: var(--rouge); }
.pied { text-align: center; color: var(--gris); font-size: 13px; margin-top: 24px; }

/* Accord RGPD */
.texte-accord { background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--r); padding: 14px 16px; font-size: 15px; color: #333; }
.signature { margin-top: 14px; }
.signature .cadre { position: relative; background: var(--blanc); border: 2px dashed #BFBFBF; border-radius: var(--r); height: 170px; touch-action: none; }
.signature canvas { width: 100%; height: 100%; display: block; border-radius: var(--r); }
.signature .vide { position: absolute; inset: 0; display: grid; place-items: center; color: #A0A0A0; pointer-events: none; font-size: 16px; }
.signature .actions { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; color: var(--gris); font-size: 14px; }

/* Merci */
.merci { text-align: center; padding-top: 40px; }
.merci .rond { width: 110px; height: 110px; border-radius: 50%; background: var(--vert); color: #fff; display: grid; place-items: center; font-size: 60px; margin: 0 auto 18px; }
.merci h1 { font-size: 28px; margin: 0 0 6px; }

/* Connexion */
.connexion { background: var(--accent); color: var(--blanc); justify-content: center; padding: calc(var(--haut) + 24px) 24px calc(var(--bas) + 24px); }
.connexion img { width: 92px; height: 92px; filter: invert(1); display: block; margin: 0 auto 10px; }
.connexion h1 { text-align: center; font-size: 26px; margin: 0 0 24px; }
.connexion .champ { border-color: transparent; color: var(--noir); }
.connexion .btn { background: var(--blanc); color: var(--accent); width: 100%; margin-top: 16px; }
.connexion .btn.lien { color: var(--blanc); opacity: .85; background: none; margin-top: 8px; }
.connexion .erreur { color: #FFD7D3; text-align: center; }
.connexion label { display: block; font-size: 14px; opacity: .85; margin-top: 14px; }

.liste-salons .tuile small { display: block; font-weight: 400; font-size: 14px; opacity: .75; }
.sec { font-size: 14px; font-weight: 700; color: var(--gris); text-transform: uppercase; letter-spacing: .05em; margin: 26px 0 0; }

/* Correctifs v1.0.0 */
.tuile .coche { color: transparent; }
.tuile.choisie .coche { color: var(--accent); }
.bas:empty { display: none; }
.signature .vide[hidden] { display: none; }
.liste-salons .tuile { flex-direction: column; align-items: flex-start; gap: 2px; }
.tuiles.colonnes { grid-template-columns: 1fr 1fr; }
.tuiles.colonnes .tuile { font-size: 16px; min-height: 64px; padding: 10px 12px; justify-content: center; text-align: center; }
.accord-cases .tuile { font-size: 16px; font-weight: 600; }
