/* L'appli de tournée : les couleurs et les lettres du cabinet (bin/feuille.py du marketing),
   des cibles de 44 px au moins, des phrases entières, et une seule action principale par écran. */
:root {
  --petrole: #0E4D5A; --petrole-fonce: #0A3A44; --sauge: #7AAE9B; --sauge-clair: #E3F0EB; --vert-pale: #EAF3F0;
  --or: #F2C14E; --or-pale: #FDF3D7; --or-texte: #6B4E00;
  --encre: #16232B; --gris: #5C6B70; --gris-fonce: #4A585D; --trait: #DCE4E6; --bord: #B9C6C9;
  --fond: #F3F6F6; --blanc: #FFFFFF; --rouge: #B3261E; --rouge-pale: #FBE9E7;
  --titre: Montserrat, "Segoe UI", system-ui, sans-serif;
  --texte: "Source Sans 3", system-ui, -apple-system, sans-serif;
  --rayon: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #E4EAEB; color: var(--encre); font-family: var(--texte); font-size: 17px; line-height: 1.45;
  -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--petrole); }
h1, h2, h3 { font-family: var(--titre); letter-spacing: -0.01em; margin: 0; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 800; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }

.coquille { position: relative; max-width: 520px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; background: var(--fond);
  display: flex; flex-direction: column; }
.ecran { flex: 1; display: flex; flex-direction: column; padding: 0 0 calc(24px + env(safe-area-inset-bottom)); }
.ecran.avec-nav { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.ecran.avec-pied { padding-bottom: calc(190px + env(safe-area-inset-bottom)); }
.zone { padding: 0 20px; }
.haut { padding: calc(14px + env(safe-area-inset-top)) 20px 12px; }

/* Bandeaux d'état */
.bandeau { display: flex; gap: 8px; align-items: center; padding: 8px 20px; font-size: 14px; font-weight: 600; }
.bandeau.essai { background: var(--or-pale); color: var(--or-texte); }
.bandeau.attente { background: var(--petrole); color: #fff; }
.bandeau button { margin-left: auto; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 2px solid currentColor;
  background: transparent; font-weight: 700; font-size: 13px; }

/* En-têtes */
.retour { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-left: -6px; padding: 0 6px; border: 0;
  background: none; font-size: 16px; font-weight: 600; color: var(--petrole); text-decoration: none; }
.surtitre { font-family: var(--titre); font-weight: 700; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--petrole); margin: 6px 0 4px; }
.sous-titre { color: var(--gris); font-size: 15px; margin-top: 4px; }
.ligne-titre { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

/* Boutons */
.bouton { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; padding: 0 18px;
  border-radius: var(--rayon); border: 2px solid var(--petrole); background: var(--petrole); color: #fff; font-family: var(--titre);
  font-weight: 800; font-size: 16px; text-decoration: none; text-align: center; }
.bouton:active { background: var(--petrole-fonce); }
.bouton.or { background: var(--or); border-color: var(--or); color: var(--encre); }
.bouton.clair { background: #fff; color: var(--petrole); border-color: var(--trait); font-weight: 700; }
.bouton.petit { min-height: 46px; font-size: 15px; width: auto; }
.bouton[disabled], .bouton[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.pilule { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 2px solid var(--petrole); background: #fff; color: var(--petrole); font-family: var(--titre); font-weight: 700;
  font-size: 14px; text-decoration: none; white-space: nowrap; }
.pied { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 520px;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--fond) 78%, rgba(243,246,246,0));
  display: flex; flex-direction: column; gap: 10px; z-index: 5; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.deux.large { grid-template-columns: 1.4fr 1fr; }

/* Cartes */
.carte { background: #fff; border: 1px solid var(--trait); border-radius: 16px; padding: 16px 18px; }
.carte + .carte { margin-top: 12px; }
.carte.accent { border: 2px solid var(--petrole); }
.carte.petrole { background: var(--petrole); border-color: var(--petrole); color: #fff; }
.carte.verte { background: var(--vert-pale); border-color: var(--vert-pale); }
.carte.alerte { background: var(--rouge-pale); border-color: var(--rouge-pale); color: var(--rouge); }
.carte h2 { margin-bottom: 8px; }
.carte .etiquette-carte { font-family: var(--titre); font-weight: 700; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--petrole); margin-bottom: 8px; }
.carte.petrole .etiquette-carte { color: var(--or); }
.question { font-size: 21px; line-height: 1.35; font-weight: 600; }
.discret { color: var(--gris); font-size: 15px; }
.petit { font-size: 14px; }
.pile { display: flex; flex-direction: column; gap: 12px; }
.espace { height: 14px; }

/* Étiquettes d'étape */
.puce { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
  white-space: nowrap; background: #E8EDEE; color: var(--gris-fonce); }
.puce.ECHANGE_FAIT, .puce.MAIL_ENVOYE, .puce.RDV_CALE, .puce.PROPOSITION_ENVOYEE, .puce.MISSION_SIGNEE { background: var(--sauge-clair); color: var(--petrole); }
.puce.A_REPASSER { background: var(--or-pale); color: var(--or-texte); }
.puce.PAS_BESOIN, .puce.AFFAIRE_PERDUE { background: #EEE; color: #555; }
.puce.offre { background: var(--sauge-clair); color: var(--petrole); }
.puce.contour { background: #fff; border: 1px solid var(--trait); color: var(--petrole); }
.puces { display: flex; flex-wrap: wrap; gap: 8px; }

/* Tournée */
.jours { display: flex; gap: 8px; overflow-x: auto; padding: 2px 20px 10px; scrollbar-width: none; }
.jours::-webkit-scrollbar { display: none; }
.jour { flex: none; min-height: 44px; padding: 6px 14px; border-radius: 12px; border: 2px solid var(--trait); background: #fff;
  text-align: left; line-height: 1.2; }
.jour strong { display: block; font-family: var(--titre); font-size: 14px; }
.jour span { font-size: 13px; color: var(--gris); }
.jour[aria-pressed="true"] { border-color: var(--petrole); background: var(--vert-pale); }
.avance { display: flex; justify-content: space-between; font-size: 15px; margin: 4px 0 6px; }
.barre { height: 8px; border-radius: 999px; background: var(--trait); overflow: hidden; }
.barre span { display: block; height: 100%; background: var(--petrole); border-radius: 999px; transition: width .3s; }
.plan { margin: 14px 20px; border-radius: 16px; overflow: hidden; border: 1px solid var(--trait); background: #E4ECE9; }
.plan svg { display: block; width: 100%; height: auto; }
.liste { background: #fff; border-top: 1px solid var(--trait); border-bottom: 1px solid var(--trait); margin-top: 14px; }
.liste a, .liste button.rangee { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 20px;
  border: 0; border-bottom: 1px solid var(--trait); background: none; text-align: left; text-decoration: none; color: var(--encre); }
.liste a:last-child { border-bottom: 0; }
.numero { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 999px;
  border: 2px solid var(--petrole); color: var(--petrole); font-family: var(--titre); font-weight: 800; font-size: 14px; background: #fff; }
.numero.fait { background: var(--sauge); border-color: var(--sauge); color: #fff; }
.numero.suivant { background: var(--or); border-color: var(--encre); color: var(--encre); }
.rangee-texte { flex: 1; min-width: 0; }
.rangee-texte strong { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rangee-texte span { display: block; font-size: 14px; color: var(--gris); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Navigation du bas */
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 520px; display: grid;
  grid-template-columns: repeat(3, 1fr); background: #fff; border-top: 1px solid var(--trait); padding-bottom: env(safe-area-inset-bottom); z-index: 6; }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 64px;
  font-size: 13px; font-weight: 600; color: var(--gris); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--petrole); font-weight: 700; }
.nav a[aria-current="page"] svg { stroke: var(--petrole); }

/* Micro */
.micro-zone { display: flex; flex-direction: column; align-items: center; padding: 10px 20px 4px; }
.anneau { display: flex; align-items: center; justify-content: center; width: 188px; height: 188px; border-radius: 999px;
  background: var(--sauge-clair); transition: transform .12s; }
.anneau-2 { display: flex; align-items: center; justify-content: center; width: 154px; height: 154px; border-radius: 999px; background: #CDE4DA; }
.micro { display: flex; align-items: center; justify-content: center; width: 120px; height: 120px; border-radius: 999px;
  border: 3px solid var(--petrole); background: var(--petrole); }
.micro.pause { background: #fff; }
.micro svg { stroke: #fff; }
.micro.pause svg { stroke: var(--petrole); fill: var(--petrole); }
.micro-etat { margin-top: 12px; font-family: var(--titre); font-weight: 800; font-size: 18px; text-align: center; }
.micro-aide { margin-top: 2px; color: var(--gris); font-size: 15px; text-align: center; }
.onde { display: flex; align-items: center; justify-content: center; gap: 4px; height: 36px; margin-top: 8px; }
.onde span { width: 5px; border-radius: 3px; background: var(--sauge); height: 6px; transition: height .08s; }
.questions button { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--trait); background: #fff;
  font-weight: 600; font-size: 15px; text-align: left; }
.questions button[aria-pressed="true"] { background: var(--petrole); border-color: var(--petrole); color: #fff; }

/* Formulaires */
label.champ-titre, .champ-titre { display: block; margin: 16px 0 6px; font-size: 15px; font-weight: 700; }
.champ { display: block; width: 100%; min-height: 50px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--bord);
  background: #fff; font-size: 17px; }
textarea.champ { min-height: 96px; resize: vertical; line-height: 1.45; }
.aide { margin-top: 4px; font-size: 14px; color: var(--gris); }
.segments { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; padding: 4px; border-radius: 12px; background: #E3EAEC; }
.segments button { min-height: 44px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; font-size: 15px; padding: 0 6px; }
.segments button[aria-pressed="true"] { background: var(--petrole); color: #fff; }
.ia-note { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--petrole);
  background: var(--sauge-clair); padding: 3px 10px; border-radius: 999px; }
.lecteur { display: flex; align-items: center; gap: 12px; }
.lecteur button { flex: none; display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 999px;
  border: 0; background: var(--petrole); }
details.transcription summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--petrole); cursor: pointer; }

/* Candidats (hors liste) */
.candidat { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 62px; padding: 10px 14px;
  border-radius: 14px; border: 2px solid var(--trait); background: #fff; text-align: left; }
.candidat[aria-pressed="true"] { border-color: var(--petrole); background: var(--vert-pale); }
.candidat strong { display: block; font-family: var(--titre); font-size: 16px; }
.candidat span.ligne { display: block; font-size: 14px; color: var(--gris-fonce); }
.candidat .distance { flex: none; font-size: 14px; font-weight: 700; color: var(--petrole); }

/* Attente */
.chargement { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 48px 20px; text-align: center; color: var(--gris); }
.roue { width: 36px; height: 36px; border-radius: 999px; border: 4px solid var(--trait); border-top-color: var(--petrole); animation: tourne 0.9s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.squelette { height: 62px; border-radius: 14px; background: linear-gradient(90deg, #E9EEEF 25%, #F5F7F7 50%, #E9EEEF 75%); background-size: 200% 100%;
  animation: luit 1.2s infinite; }
@keyframes luit { to { background-position: -200% 0; } }

/* Message flottant */
.message { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100% - 32px);
  width: 488px; padding: 14px 18px; border-radius: 14px; background: var(--encre); color: #fff; font-weight: 600; font-size: 15px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 20; }
.message.bon { background: var(--petrole); }

/* Feuille (choix d'une date, doublons) */
.voile { position: fixed; inset: 0; background: rgba(22,35,43,.45); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.feuille { width: 100%; max-width: 520px; background: #fff; border-radius: 20px 20px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  max-height: 85vh; overflow: auto; }
.feuille h2 { font-size: 20px; margin-bottom: 6px; }

.qr { display: flex; gap: 14px; align-items: center; }
.qr canvas, .qr img { flex: none; width: 104px; height: 104px; border: 1px solid var(--trait); border-radius: 10px; padding: 6px; background: #fff; image-rendering: pixelated; }
.case { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 600; }
.case input { width: 24px; height: 24px; accent-color: var(--petrole); }
.connexion { padding: 48px 24px; }
.connexion img { height: 52px; width: auto; margin-bottom: 28px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
