/* Copié de gas-chantiers/index.html (interface validée par Geoffroy le 16/11/2026), sans la redessiner.
   Ajouts en fin de fichier : écran Face ID, invitation, RDV date + heure (CSP stricte : aucun style en ligne). */
:root {
  --fond: #e7e8eb; --fenetre: #ffffff; --carte: #f4f4f6; --trait: #e7e8eb; --trait-fort: #d6d8dd;
  --encre: #18191c; --encre-2: #5d6068; --encre-3: #8e9199;
  --bleu: #2a78d6; --bleu-encre: #2560b3; --bleu-fond: #eef3fb;
  --vert: #1baf7a; --vert-encre: #137a55; --vert-fond: #e8f4ec;
  --orange: #eb6834; --orange-encre: #b04d1c; --ambre: #d9a21b; --gris: #a3a7af;
  --piste: #e4e5e9; --bouton: #1b1c1f; --bouton-encre: #ffffff;
  --voile: rgba(16, 18, 24, 0.42);
  --ombre: 0 1px 2px rgba(20, 22, 27, 0.05), 0 24px 60px -24px rgba(20, 22, 27, 0.3);
  --f-ui: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0b0c0e; --fenetre: #16171a; --carte: #1e2023; --trait: #2a2c31; --trait-fort: #383b42;
    --encre: #eceef1; --encre-2: #aeb2ba; --encre-3: #868a93;
    --bleu: #3987e5; --bleu-encre: #8ab8f2; --bleu-fond: #1a2433;
    --vert: #199e70; --vert-encre: #5fd0a6; --vert-fond: #13281b;
    --orange: #d95926; --orange-encre: #f2a473; --ambre: #c99413; --gris: #6b6f78;
    --piste: #2c2e33; --bouton: #eceef1; --bouton-encre: #16171a; --voile: rgba(0, 0, 0, 0.6);
    --ombre: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 60px -24px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font-family: var(--f-ui); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
p, h1, h2, h3, dl { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
svg.ic { width: 18px; height: 18px; flex: none; }

.page { padding: 32px max(20px, env(safe-area-inset-right, 0px)) 48px max(20px, env(safe-area-inset-left, 0px)); }
.fenetre { max-width: 1180px; margin: 0 auto; background: var(--fenetre); border-radius: 22px; box-shadow: var(--ombre); overflow: hidden; }
.barre { display: flex; align-items: center; gap: 14px; padding: 20px 40px; border-bottom: 1px solid var(--trait); }
.barre .logo { color: var(--bleu); width: 24px; height: 24px; }
.marque { font-size: 18px; font-weight: 500; }
.sep { width: 1px; height: 22px; background: var(--trait-fort); }
.lieu { color: var(--encre-2); }
.barre .droite { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.discret { background: none; border: 0; color: var(--encre-2); cursor: pointer; padding: 8px 10px; border-radius: 10px; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; }
.discret:hover { background: var(--carte); }
@media (prefers-reduced-motion: no-preference) { .tourne svg { animation: tourne .9s linear infinite; } @keyframes tourne { to { transform: rotate(360deg); } } }

.onglets { display: flex; align-items: center; gap: 6px; padding: 12px 40px; border-bottom: 1px solid var(--trait); flex-wrap: wrap; }
.onglet { background: none; border: 0; border-radius: 10px; padding: 9px 18px; cursor: pointer; color: var(--encre-2); font-size: 14.5px; min-height: 40px; }
.onglet[aria-pressed="true"] { background: var(--carte); color: var(--encre); }
.campagnes { margin-left: auto; display: flex; gap: 2px; }
.campagnes button { background: none; border: 0; padding: 8px 12px; border-radius: 10px; cursor: pointer; color: var(--encre-3); font-size: 14px; min-height: 40px; }
.campagnes button[aria-pressed="true"] { color: var(--encre); font-weight: 500; }

.corps { padding: 34px 40px 8px; }
.surtitre { font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--encre-2); font-weight: 500; }
.tete { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 12px 0 32px; }
h1 { font-size: 40px; font-weight: 500; letter-spacing: -.035em; line-height: 1.1; }
h1 .point { color: var(--bleu); }
.sous-titre { color: var(--encre-2); font-size: 17px; margin-top: 10px; }
.periode { display: flex; gap: 2px; background: var(--carte); border-radius: 12px; padding: 4px; }
.periode button { background: none; border: 0; border-radius: 9px; padding: 7px 14px; cursor: pointer; color: var(--encre-2); font-size: 14px; min-height: 36px; }
.periode button[aria-pressed="true"] { background: var(--fenetre); color: var(--encre); box-shadow: 0 1px 2px rgba(20, 22, 27, .12); }

.grille { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.cartes { display: grid; gap: 20px; }
.grande { background: var(--carte); border-radius: 20px; padding: 26px 30px 24px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 22px; }
.grande .nom { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 500; }
.grande.bleue .nom { color: var(--bleu-encre); }
.grande.verte .nom { color: var(--vert-encre); }
.grande .nom svg { width: 22px; height: 22px; }
.grande .legende-g { text-align: right; color: var(--encre-2); font-size: 13.5px; align-self: start; padding-top: 4px; }
.grande .bas { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; min-width: 0; }
.grande .chiffre { font-size: 50px; font-weight: 450; letter-spacing: -.04em; line-height: 1; white-space: nowrap; }
.grande .chiffre small { font-size: 15px; letter-spacing: 0; color: var(--encre-2); margin-left: 8px; font-weight: 400; }
.grande .detail { color: var(--encre-2); font-size: 14.5px; }
.courbe { display: block; width: 100%; height: auto; overflow: visible; }
.courbe text { font-family: var(--f-ui); fill: var(--encre-3); font-size: 10.5px; }
.courbe text.val { fill: var(--encre); font-size: 11px; font-weight: 500; }
.graphe .note-g { color: var(--encre-3); font-size: 12.5px; margin-top: 6px; }

.droite-col { display: grid; }
.bloc { padding: 22px 0; border-top: 1px solid var(--trait); }
.bloc:first-child { border-top: 0; padding-top: 4px; }
.bloc-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.bloc-tete h2 { font-size: 19px; font-weight: 500; letter-spacing: -.01em; }
.bloc-tete .grand { font-size: 26px; font-weight: 450; letter-spacing: -.03em; }
.bloc .sous { color: var(--encre-2); font-size: 14px; margin-top: 4px; }
.rappels { display: grid; margin-top: 12px; }
.rappel { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.rappel + .rappel { border-top: 1px solid var(--trait); }
.rappel .qui { flex: 1; min-width: 0; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.rappel .qui b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rappel .qui span { color: var(--encre-3); font-size: 13.5px; }
.rappel .qui span.tard { color: var(--orange-encre); }
.rond { width: 44px; height: 44px; border-radius: 50%; background: var(--bouton); color: var(--bouton-encre); display: inline-flex; align-items: center; justify-content: center; flex: none; text-decoration: none; }
.rond svg { width: 19px; height: 19px; }
.lien { background: none; border: 0; padding: 8px 0 0; color: var(--encre-2); cursor: pointer; font-size: 14px; }
.lien:hover { color: var(--encre); }
.calme { display: flex; gap: 8px; align-items: center; color: var(--vert-encre); margin-top: 10px; font-size: 14.5px; }
.barre-etat { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--piste); margin: 16px 0 12px; gap: 2px; }
.barre-etat i { display: block; height: 100%; }
.leg { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--encre-2); }
.leg span { display: inline-flex; align-items: center; gap: 7px; }
.leg i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.leg b { color: var(--encre); font-weight: 500; }
.action { display: flex; justify-content: flex-end; padding-top: 8px; }
.noir { display: inline-flex; align-items: center; gap: 12px; background: var(--bouton); color: var(--bouton-encre); border: 0; border-radius: 12px; padding: 14px 22px; font-size: 15.5px; cursor: pointer; text-decoration: none; min-height: 50px; }
.noir:disabled { opacity: .6; cursor: progress; }
.noir svg { width: 18px; height: 18px; }

.pied { margin: 30px 40px 0; padding: 18px 0 24px; border-top: 1px solid var(--trait); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--encre-3); font-size: 13.5px; }
.pied .msg { color: var(--orange-encre); }

/* Onglet « Les demandes » */
.outils { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 4px 0 18px; }
.filtres { display: flex; gap: 2px; background: var(--carte); border-radius: 12px; padding: 4px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.filtres::-webkit-scrollbar { display: none; }
.filtres button { background: none; border: 0; border-radius: 9px; padding: 7px 13px; cursor: pointer; color: var(--encre-2); font-size: 14px; white-space: nowrap; min-height: 36px; }
.filtres button[aria-pressed="true"] { background: var(--fenetre); color: var(--encre); box-shadow: 0 1px 2px rgba(20, 22, 27, .12); }
.filtres b { font-weight: 400; color: var(--encre-3); margin-left: 4px; }
.cherche { flex: 1; min-width: 160px; max-width: 280px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--trait-fort); border-radius: 12px; background: var(--fenetre); font-size: 16px; }  /* (16 px au moins : en dessous, l'iPhone zoome toute la page au toucher ; relecture 17/11) */
.ajout { margin-left: auto; }
.liste { display: grid; }
.ligne { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 14px 4px; border-top: 1px solid var(--trait); background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; cursor: pointer; width: 100%; }
.ligne:last-child { border-bottom: 1px solid var(--trait); }
.ligne:hover { background: var(--carte); }
.ligne b { font-weight: 500; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne .meta { color: var(--encre-3); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; grid-column: 1; }
.ligne .etat { grid-row: 1 / span 2; grid-column: 2; text-align: right; font-size: 14px; color: var(--encre-2); display: grid; gap: 2px; justify-items: end; }
.ligne .etat span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.ligne .etat i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ligne .etat em { font-style: normal; color: var(--encre); font-weight: 500; }
.vide { padding: 34px 0; text-align: center; color: var(--encre-3); }

/* Fiche (panneau à droite / feuille du bas) */
.voile { position: fixed; inset: 0; background: var(--voile); z-index: 10; }
.fiche { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: var(--fenetre); z-index: 11; overflow-y: auto; overscroll-behavior: contain; box-shadow: var(--ombre); padding: 26px 28px 0; }
.poignee { display: none; }
.f-tete { display: flex; gap: 12px; align-items: flex-start; }
.f-tete h2 { font-size: 26px; font-weight: 500; letter-spacing: -.03em; line-height: 1.15; overflow-wrap: anywhere; }
.f-tete p { color: var(--encre-3); margin-top: 6px; font-size: 14px; }
.f-tete .discret { margin-left: auto; }
.appels { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 22px 0 6px; }
.appels .noir { justify-content: center; font-size: 17px; }
.contour { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--trait-fort); border-radius: 12px; padding: 0 16px; min-height: 50px; color: var(--encre); text-decoration: none; background: none; cursor: pointer; }
.demande { color: var(--encre-2); font-size: 14.5px; padding: 14px 0 4px; }
.section { padding: 20px 0; border-top: 1px solid var(--trait); margin-top: 14px; }
.section h3 { font-size: 15px; font-weight: 500; margin-bottom: 12px; }
.statuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.statuts button { border: 1px solid var(--trait-fort); background: none; border-radius: 10px; padding: 10px 12px; min-height: 44px; cursor: pointer; text-align: left; }
.statuts button[aria-pressed="true"] { background: var(--bouton); color: var(--bouton-encre); border-color: var(--bouton); }
.essais { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; color: var(--encre-2); font-size: 14px; }
.champs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.champ { display: grid; gap: 5px; font-size: 13.5px; color: var(--encre-2); min-width: 0; }
.champ.large { grid-column: 1 / -1; }
.champ input, .champ select, .champ textarea { min-height: 46px; padding: 9px 12px; border: 1px solid var(--trait-fort); border-radius: 10px; background: var(--fenetre); width: 100%; min-width: 0; font-size: 16px; }
.champ textarea { min-height: 90px; resize: vertical; }
.rdv { margin-top: 12px; padding: 14px; background: var(--bleu-fond); border-radius: 12px; }
.rdv .champ { color: var(--bleu-encre); font-weight: 500; }
.coche { display: flex; gap: 10px; align-items: center; color: var(--encre); font-size: 14.5px; min-height: 40px; }
.coche input { width: 20px; height: 20px; accent-color: var(--bleu); }
details.plus { border-top: 1px solid var(--trait); }
details.plus summary { cursor: pointer; list-style: none; padding: 16px 0; color: var(--encre-2); display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
details.plus summary::-webkit-details-marker { display: none; }
details.plus summary::before { content: ""; border: 5px solid transparent; border-left: 6px solid currentColor; margin-right: 2px; transition: transform .15s; transform-origin: 3px 5px; }
details.plus[open] summary::before { transform: rotate(90deg); }
details.plus > div { padding-bottom: 18px; }
.histo { display: grid; gap: 8px; font-size: 13.5px; color: var(--encre-2); }
.histo div { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; }
.histo b { color: var(--encre); font-weight: 500; }
.enregistrer { position: sticky; bottom: 0; margin: 0 -28px; padding: 12px 28px max(14px, env(safe-area-inset-bottom, 0px)); background: var(--fenetre); border-top: 1px solid var(--trait); display: grid; gap: 6px; }
.enregistrer .noir { justify-content: center; width: 100%; }
.msg { min-height: 20px; text-align: center; font-size: 14px; color: var(--encre-2); }
.msg.erreur { color: var(--orange-encre); }
.msg.ok { color: var(--vert-encre); }

/* Connexion */
.connexion { max-width: 420px; margin: 14vh auto 0; background: var(--fenetre); border-radius: 22px; box-shadow: var(--ombre); padding: 36px 32px 30px; }
.connexion .logo { color: var(--bleu); width: 28px; height: 28px; }
.connexion h1 { font-size: 32px; margin: 16px 0 8px; }
.connexion p { color: var(--encre-2); }
.connexion input { width: 100%; margin-top: 22px; min-height: 52px; padding: 10px 14px; border: 1px solid var(--trait-fort); border-radius: 12px; background: var(--fenetre); font-size: 18px; letter-spacing: .08em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.connexion .noir { width: 100%; justify-content: center; margin-top: 12px; }
.connexion .msg { margin-top: 12px; text-align: left; }
.chargement { text-align: center; color: var(--encre-3); padding: 20vh 0; }

@media (max-width: 960px) {
  .grille { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 640px) {
  .page { padding: 0; }
  .fenetre { border-radius: 0; box-shadow: none; min-height: 100vh; }
  .barre, .onglets, .corps { padding-left: 18px; padding-right: 18px; }
  .pied { margin-left: 18px; margin-right: 18px; }
  .barre { padding-top: 14px; padding-bottom: 14px; }
  .lieu, .sep, .moi { display: none; }
  .onglets { padding-top: 10px; padding-bottom: 10px; }
  .campagnes { margin-left: 0; width: 100%; }
  .campagnes button { padding-left: 10px; padding-right: 10px; }
  .corps { padding-top: 24px; }
  h1 { font-size: 34px; }
  .tete { margin-bottom: 24px; }
  .grande { grid-template-columns: minmax(0, 1fr); padding: 22px 22px 20px; }
  .grande .legende-g { display: none; }
  .grande .chiffre { font-size: 46px; }
  .grande .bas { order: 1; }
  .grande .graphe { order: 2; margin-top: 12px; }
  .cherche { max-width: none; }
  .fiche { top: auto; left: 0; width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 20px 20px 0 0; padding: 8px 18px 0; }
  .poignee { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--trait-fort); margin: 0 auto 14px; }
  .enregistrer { margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
}

/* ── Ajouts de l'app (16-17/11/2026) ── */
.f-tete .titre { min-width: 0; }
.connexion .noir svg { width: 20px; height: 20px; }
.connexion .aide { font-size: 13.5px; color: var(--encre-3); margin-top: 18px; }
.connexion .etapes { margin: 14px 0 0; padding-left: 20px; color: var(--encre-2); font-size: 14.5px; display: grid; gap: 4px; }
@media (max-width: 460px) { .connexion { margin: 12vh 14px 0; padding: 30px 24px 26px; } }  /* (iPhone : la carte ne touche plus les bords ; relecture 17/11) */
.nouveau { animation: arrive 1.6s ease-out; }
@media (prefers-reduced-motion: reduce) { .nouveau { animation: none; } }
@keyframes arrive { from { background: var(--bleu-fond); } to { background: transparent; } }

/* Partie 2/3 : la carte « Installer l'app / Activer les notifications » (public/notifications.js). */
.notif-carte { margin: 14px 20px 0; padding: 14px 16px; border: 1px solid var(--trait-fort); border-radius: 12px; background: var(--bleu-fond); }
.notif-titre { font-weight: 600; margin-bottom: 6px; }
.notif-aide { color: var(--encre-2); font-size: 14px; margin-bottom: 10px; }
.notif-etapes { margin: 0 0 10px; padding-left: 20px; color: var(--encre-2); font-size: 14px; }
.notif-etapes li { margin: 3px 0; }
.notif-boutons { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.notif-ligne { margin: 10px 20px 0; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--encre-3); }
.notif-msg { margin-top: 8px; font-size: 14px; color: var(--encre-2); }
