/* ArtisanApp — design calé sur la charte TonTon (rp-core/reseau-peinture.css).
   Thème CLAIR (lisible en plein soleil), élégant, ergonomie pouce. */
/* TOKENS : plus de :root ici. L'ArtisanApp est un CONSOMMATEUR du design system —
   skb-ui.tokens.css (canon, vendoré) + skb-ui.artisan.css (thème local TonTon sur noms
   skb-ui), liés AVANT ce fichier dans index.html. Les composants utilisent les noms skb-ui
   (--primary / --ink / --surface / --bg / --font-display|body / --r-lg …). */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--font-body); -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
body.has-bar main { padding-bottom: 104px; }            /* place pour la barre d'action */
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; display: block; }

/* ---------- Barre du haut ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 14px) 18px 14px;
  background: linear-gradient(180deg, var(--forest), var(--forest-deep));
  color: #fff; box-shadow: var(--sh-hero);
}
.topbar .title { font-family: var(--font-display); font-weight: 800; font-size: 19px; flex: 1; letter-spacing: -.015em; }
.topbar button.ghost { background: rgba(255,255,255,.12); border: none; color: #fff; font-size: 20px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.topbar button.ghost:active { background: rgba(255,255,255,.22); }
.net { font-family: var(--font-body); font-weight: 600; font-size: 12px; letter-spacing: .01em; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.12); white-space: nowrap; }
.net.online { color: var(--green-soft); }
.net.offline { color: #ffdca1; background: rgba(226,104,60,.28); }

main { padding: 18px 16px; max-width: 640px; margin: 0 auto; }

/* ---------- Liste ---------- */
.list { display: flex; flex-direction: column; gap: 12px; }
.card {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 15px 14px 15px 20px; color: inherit;
  box-shadow: var(--sh-card); overflow: hidden; transition: transform .12s ease;
}
.card:active { transform: scale(.985); }
.card-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--green-soft); }
.card-ic { width: 46px; height: 46px; border-radius: 13px; background: var(--success-weak); color: var(--primary); display: grid; place-items: center; flex: none; }
.card-ic svg.i { width: 24px; height: 24px; }
.card-ic.av { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--forest); letter-spacing: -.01em; }   /* avatar initiales client (passe pro Fable) */
.card-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* Lot P : réf technique (INT-…) RETIRÉE de la fiche chantier (bruit). Sur la carte de liste,
   décision David 23/07 : visible en DESKTOP seulement — en mobile le titre (nom client) suffit. */
.card-ref { display: none; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (min-width: 768px) { .card-ref { display: inline; } }
.card-title { font-family: var(--font-display); font-weight: 800; font-size: 18px; line-height: 1.15; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.card-chev { color: var(--line-2); display: grid; place-items: center; }
.card-chev svg.i { width: 22px; height: 22px; stroke-width: 1.7; }

/* ---------- Pastilles & tags ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: .01em; padding: 4px 11px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.pill svg.i { width: 14px; height: 14px; }   /* icône + libellé sur UNE ligne (svg.i global est display:block → inline-flex remet en ligne) */
/* Palette statuts PAR PHASE (aligné Cockpit L4) : forêt (attente bureau) · vert (chez l'artisan) · ambre (actif) · gris (soldé). Rouge = urgence only. */
.pill.st-a_valider { background: #e7efe9; color: var(--forest); border-color: #cfe0d6; }   /* Proposé / attente bureau : forêt */
.pill.st-assigne  { background: var(--success-weak); color: var(--primary); border-color: var(--mint-2); }   /* À accepter : vert (même que Planifié — choix David) */
.pill.st-planifie { background: var(--success-weak); color: var(--primary); border-color: var(--mint-2); }
.pill.st-en_cours { background: #fdf3d6; color: #755b00; border-color: #f2e2a4; }   /* En cours : ambre */
.pill.st-termine  { background: #eef1ef; color: var(--muted); border-color: var(--line-2); }   /* Terminé : gris neutre (soldé) */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--bg); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; }
.tag svg.i { width: 14px; height: 14px; }
.tag-urgent { color: #A63A14; background: #fcebe4; border-color: #f6d2c4; }   /* texte assombri : AA sur le fond terra clair */

/* accent latéral de carte par PHASE (aligné Cockpit L4 : forêt/vert/ambre/gris ; rouge = urgence) */
.card-accent.st-a_valider { background: var(--forest); }
.card-accent.st-assigne  { background: var(--primary); }
.card-accent.st-planifie { background: var(--primary); }
.card-accent.st-en_cours { background: var(--chip-yellow); }
.card-accent.st-termine  { background: var(--muted); }
.card.is-urgent .card-accent { background: var(--chip-terra); }

/* ---------- Fiche détail ---------- */
.detail { display: flex; flex-direction: column; }
.hero { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 18px; box-shadow: var(--sh-card); }
.hero-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }   /* Lot P : ne porte plus que le tag « Urgent » (réf technique INT-… retirée de l'affichage) */
.hero h2 { font-family: var(--font-display); margin: 0; font-size: 26px; line-height: 1.08; letter-spacing: -.02em; }
.hero-type { display: inline-flex; align-items: center; gap: 8px; color: var(--primary); margin-top: 8px; font-weight: 600; font-size: 14.5px; }
.hero-type svg.i { width: 18px; height: 18px; }

/* stepper du cycle de vie */
.stepper { display: flex; margin-top: 20px; }
.step { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.step::before { content: ""; position: absolute; top: 9px; right: 50%; width: 100%; height: 2px; background: var(--line-2); }
.step:first-child::before { display: none; }
.step .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-2); display: grid; place-items: center; position: relative; z-index: 1; }
.step .dot svg.i { width: 11px; height: 11px; stroke: #fff; stroke-width: 2.6; }
.step .slbl { font-size: 11px; font-weight: 600; color: var(--muted); }
.step.done::before { background: var(--primary); }
.step.done .dot { background: var(--primary); border-color: var(--primary); }
.step.cur::before { background: var(--primary); }
.step.cur .dot { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(30,142,90,.16); }
.step.cur .slbl, .step.done .slbl { color: var(--ink); }

/* lignes d'info */
.info { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 4px 16px; margin-top: 14px; box-shadow: var(--sh-card); }
.info-row { display: flex; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.info-row:last-child { border-bottom: none; }
.info-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--success-weak); color: var(--primary); display: grid; place-items: center; flex: none; }
.info-ic svg.i { width: 18px; height: 18px; }
.info-kv { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.info-kv .ik { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.info-kv .iv { font-size: 15.5px; word-break: break-word; }
.iv a.tel, .iv a.map { color: var(--primary); text-decoration: none; font-weight: 700; }

.actions-content { margin-top: 6px; }

/* ---------- Sections / formulaires ---------- */
.section-title { font-family: var(--font-body); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink); margin: 24px 4px 10px; }   /* Inter (passe pro Fable) — plus « produit » que la mono ; contraste ink gardé (audit 48 #10) */
.section-title svg.i { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; margin-right: 4px; }
.locked { color: var(--muted); font-style: italic; font-size: 14px; }
.opt-lbl { color: var(--muted); font-weight: 400; font-size: 13px; }

/* callout contraintes de planning (accent forêt, aligné palette — plus de bleu) */
.plan-callout { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--forest); border-radius: var(--r-sm); color: var(--ink); box-shadow: var(--sh-card); }
.plan-callout svg.i { width: 22px; height: 22px; color: var(--forest); flex: none; margin-top: 1px; }
.plan-callout strong { display: block; font-family: var(--font-display); font-size: 15px; color: var(--ink); }
.plan-callout span { font-size: 14.5px; line-height: 1.5; color: var(--muted); }

/* callout remarque de démarrage */
.note-callout { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--chip-yellow); border-radius: var(--r-sm); color: var(--ink); box-shadow: var(--sh-card); }
.note-callout svg.i { width: 22px; height: 22px; color: var(--chip-yellow); flex: none; margin-top: 1px; }
.note-callout strong { display: block; font-family: var(--font-display); font-size: 15px; color: var(--ink); }
.note-callout span { font-size: 14.5px; line-height: 1.5; color: var(--muted); }
label.field { display: block; margin: 18px 4px 7px; color: var(--ink); font-size: 14px; font-weight: 600; }
textarea, input.text {
  width: 100%; background: var(--card); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 13px 14px; font: inherit;
}
textarea { min-height: 104px; resize: vertical; }
input.text:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(30,142,90,.13); }

/* chip-bouton (GPS) */
.chip-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; background: var(--success-weak); color: var(--forest); border: 1px solid var(--mint-2); border-radius: 999px; padding: 11px 18px; font: inherit; font-weight: 600; }
.chip-btn svg.i { width: 18px; height: 18px; }
.chip-btn.ok { background: #def0e6; color: var(--primary); border-color: var(--green-soft); }

/* ---------- Capture photos ---------- */
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.shot { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--success-weak); border: 1px solid var(--line); }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot .pend { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(17,39,30,.45); color: #fff; font-size: 13px; }
.add-shot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; aspect-ratio: 1; border: 1.5px dashed var(--green-soft); border-radius: var(--r-sm); color: var(--primary); background: var(--surface); font-size: 12px; font-weight: 600; }
.add-shot svg.i { width: 26px; height: 26px; }
.add-shot input { display: none; }
.add-shot:active { background: var(--success-weak); }

/* ---------- Barre d'action (collée en bas) ---------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; gap: 10px; padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px);
  background: rgba(248,247,242,.86); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); box-shadow: var(--sh-bar);
}
.actionbar:empty { display: none; }

/* ---------- Boutons contact WhatsApp (bas de fiche) ---------- */
.contact-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 20px; }
.wa-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 13px 16px;
  border-radius: var(--r-sm); font-family: var(--font-body); font-weight: 700; font-size: 15px; text-decoration: none; border: 1px solid transparent; }
.wa-btn svg.i { width: 20px; height: 20px; }
.wa-btn.client { background: var(--primary); color: #fff; }
.wa-btn.client:active { background: var(--forest); }
.wa-btn.bureau { background: var(--card); color: var(--primary); border-color: var(--green-soft); }
.wa-btn.bureau:active { background: var(--success-weak); }

/* ---------- Footer persistant : barre « Contacter le bureau » + menu (bottom-nav, comme le Cockpit mobile) ---------- */
.app-footer { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; box-shadow: var(--sh-bar); }
body.has-nav .app-footer { display: block; }
body.has-nav main { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
.bureau-bar { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px;
  background: var(--success-weak); color: var(--forest); font-family: var(--font-body); font-weight: 700; font-size: 13px;
  text-decoration: none; border-top: 1px solid var(--line); }
.bureau-bar svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bureau-bar:active { background: var(--mint-2); }
.bottom-nav { display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); gap: 2px; }
.bn-item { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 5px 2px; min-height: 52px; background: none; border: none; color: var(--muted);
  font-family: var(--font-body); font-weight: 600; font-size: 11px; border-radius: 12px; position: relative; }
.bn-item svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; display: block; }
.bn-item.on { color: var(--primary); }
.bn-item:active { background: var(--success-weak); }
.bn-badge { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 16px; height: 16px; line-height: 16px;
  padding: 0 4px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 9.5px; font-weight: 800; text-align: center; }
.bn-badge.err { background: var(--chip-terra); }
.btn {
  flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--r-sm); padding: 15px 14px; font-size: 15px; font-weight: 700;
  white-space: nowrap;                     /* jamais de libellé sur 2 lignes ; basis auto = jamais tronqué */
  font-family: var(--font-body); color: #fff; transition: transform .1s ease, background .15s;
}
.btn.wide { flex: 1 1 100%; }
.btn svg.i { width: 19px; height: 19px; stroke-width: 1.7; }
.btn.primary { background: var(--primary); box-shadow: 0 10px 22px -12px rgba(30,142,90,.8); }
.btn.primary:active { background: var(--forest); transform: scale(.98); }
.btn.warn { background: var(--chip-terra); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line-2); box-shadow: none; }
.btn.ghost:active { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: .5; }
.btn.primary:disabled { background: var(--line-2); color: var(--muted); box-shadow: none; opacity: 1; }   /* désactivé = gris franc, pas vert délavé (passe pro Fable) */

/* fin de chantier */
.done-card { display: flex; align-items: center; gap: 14px; background: #def0e6; border: 1px solid var(--green-soft); border-radius: var(--r-lg); padding: 18px; margin-top: 16px; color: var(--forest); }
.done-card svg.i { width: 30px; height: 30px; color: var(--primary); flex: none; }
.done-card strong { display: block; font-family: var(--font-display); font-size: 17px; }
.done-card span { font-size: 13px; color: var(--muted); }
.report { white-space: pre-wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; font-size: 14.5px; line-height: 1.55; }

/* ---------- États ---------- */
.empty { text-align: center; color: var(--muted); padding: 64px 20px; }
.empty-ic { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; background: var(--success-weak); color: var(--primary); display: grid; place-items: center; }
.empty-ic svg.i { width: 30px; height: 30px; }
.empty p { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--ink); margin: 0 0 4px; }
.hint { color: var(--muted); font-size: 13.5px; }
.skeleton { height: 92px; border-radius: var(--r-lg); background: linear-gradient(100deg, var(--card) 30%, var(--success-weak) 50%, var(--card) 70%); background-size: 220% 100%; animation: sk 1.3s infinite; margin-bottom: 12px; border: 1px solid var(--line); }
@keyframes sk { from { background-position: 180% 0; } to { background-position: -40% 0; } }

/* ---------- Setup ---------- */
.setup { padding-top: 8px; }
.setup label { display: block; margin: 18px 4px 7px; color: var(--ink); font-size: 14px; font-weight: 600; }
.setup .btn { margin-top: 22px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 92px);
  transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 14px;
  box-shadow: 0 12px 32px rgba(17,39,30,.40); z-index: 50; max-width: 90%; text-align: center;
}
.toast.err { background: var(--chip-terra); }

/* ---------- Bandeau hors-ligne (données servies depuis le cache) ---------- */
.stale-banner { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; padding: 10px 14px;
  background: #fdf3d6; border: 1px solid #f2e2a4; border-radius: var(--r-sm); color: #6b520a; font-size: 13px; font-weight: 600; }
.stale-banner svg.i { width: 17px; height: 17px; color: var(--chip-yellow); flex: none; }

/* indicateur réseau : teinte d'alerte s'il y a des envois en échec */
.net.has-failed { color: #ffdca1; background: rgba(226,104,60,.34); }

/* ---------- Lot P : bandeau « Envoyer » de la fiche chantier ----------
   Rend l'état de synchro VISIBLE sur la fiche + geste explicite « Envoyer » (COMPLÉMENT de la sync auto). */
.send-status { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 12px 10px 14px;
  border-radius: var(--r-sm); font-size: 13px; font-weight: 600; border: 1px solid transparent; }
.send-status[hidden] { display: none; }
.send-status .ss-ic { flex: none; display: grid; place-items: center; }
.send-status .ss-ic svg.i { width: 18px; height: 18px; }
.send-status .ss-lbl { flex: 1; min-width: 0; }
.send-status .btn-pill { flex: none; border: none; border-radius: 999px; padding: 8px 16px; font: inherit;
  font-weight: 700; font-size: 13px; color: #fff; background: var(--primary); cursor: pointer; }
.send-status .btn-pill:active { transform: scale(.97); }
.send-status .btn-pill:disabled { opacity: .6; }
.send-status .btn-pill.ghost { background: #fff; color: var(--chip-terra); border: 1px solid #f6d2c4; }
/* modifs en attente d'envoi : amber « action douce » (le travail est gardé, il ne reste qu'à l'envoyer) */
.send-status.has-pending { background: #fdf3d6; border-color: #f2e2a4; color: #6b520a; }
.send-status.has-pending .ss-ic { color: var(--chip-yellow); }
/* tout est parti : confirmation sobre, vert discret (aucun bouton actif — rien à envoyer) */
.send-status.is-clean { background: var(--success-weak); border-color: var(--mint-2); color: var(--primary); }
.send-status.is-clean .ss-ic { color: var(--primary); }
/* un envoi de ce chantier est bloqué (lettre morte) : terracotta, renvoie vers « État d'envoi » */
.send-status.has-failed { background: #fdf0ea; border-color: #f6d2c4; color: #8a2f18; }
.send-status.has-failed .ss-ic { color: var(--chip-terra); }

/* ---------- Écran « État d'envoi » ---------- */
.sync-list { display: flex; flex-direction: column; gap: 10px; }
.sync-row { display: flex; align-items: center; gap: 13px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 11px 13px; box-shadow: var(--sh-card); }
.sync-row.is-failed { border-color: #f6d2c4; background: #fdf0ea; }
.sync-ic { width: 42px; height: 42px; border-radius: 11px; overflow: hidden; flex: none;
  background: var(--success-weak); color: var(--primary); display: grid; place-items: center; }
.sync-ic.err { background: #fcebe4; color: var(--chip-terra); }
.sync-ic img { width: 100%; height: 100%; object-fit: cover; }
.sync-ic svg.i { width: 20px; height: 20px; }
.sync-kv { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.sync-kv .sk { font-weight: 700; font-size: 15px; }
.sync-kv .ss { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.sync-kv .ss svg.i { width: 13px; height: 13px; }
.sync-kv .ss.err { color: var(--chip-terra); font-family: var(--mono); }
.sync-act { display: flex; gap: 8px; flex: none; }
.sync-act .mini { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line-2);
  background: #fff; color: var(--primary); display: grid; place-items: center; }
.sync-act .mini:active { transform: scale(.94); }
.sync-act .mini.danger { color: var(--chip-terra); border-color: #f6d2c4; }
.sync-act .mini svg.i { width: 19px; height: 19px; }

/* ---------- Correctifs revue Lot 1 (accès / file / terrain) ---------- */
/* indicateur réseau = vrai bouton tapable (reset UA + repère visible quand il y a des envois) */
.net { border: none; cursor: pointer; appearance: none; -webkit-appearance: none; font-family: var(--mono); }
.net.has-queue { background: rgba(255,255,255,.22); box-shadow: inset 0 0 0 1px rgba(255,255,255,.30); }
.net.has-queue::after { content: " ›"; opacity: .7; }
.net:active { transform: scale(.96); }

/* bandeau « accès expiré » (rouge, distinct du hors-ligne jaune) + lien d'action */
.stale-banner.is-auth { background: #fdeae7; border-color: #f6d2c4; color: #8a2f18; }
.stale-banner .mini-link { margin-left: auto; background: none; border: none; color: inherit; font: inherit;
  font-weight: 800; text-decoration: underline; padding: 0 2px; white-space: nowrap; cursor: pointer; }

/* boutons de l'écran d'envoi : texte visible + taille pouce (les échecs passent les boutons sur une 2e ligne) */
.sync-act .mini.lbl { width: auto; padding: 0 14px; height: 40px; gap: 7px; font-weight: 700; font-size: 13.5px; }
.sync-act .mini.lbl svg.i { width: 17px; height: 17px; }
.sync-row.is-failed { flex-wrap: wrap; }
.sync-row.is-failed .sync-act { flex: 0 0 100%; justify-content: flex-end; margin-top: 8px; }

/* photo confirmée envoyée : le ⏳ devient une pastille verte ✓ */
.shot .pend.sent { background: rgba(30,142,90,.62); }

/* setup : réglages manuels repliés (moins de jargon en façade) */
.setup details.adv { margin-top: 14px; }
.setup details.adv summary { color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 2px; }
.setup details.adv[open] summary { margin-bottom: 4px; }
/* N6 : bottom-sheet de confirmation (remplace confirm() natif — gros boutons, slide-up) */
.sheet-ov { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end;
  background: rgba(17, 39, 30, .45); opacity: 0; transition: opacity .18s ease; }
.sheet-ov.in { opacity: 1; }
.sheet { width: 100%; background: #fff; border-radius: 20px 20px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px -10px rgba(0, 0, 0, .35); display: flex; flex-direction: column; gap: 10px;
  transform: translateY(14px); transition: transform .18s ease; }
.sheet-ov.in .sheet { transform: translateY(0); }
.sheet-title { font-weight: 700; font-size: 17px; color: var(--ink); }
.sheet-msg { margin: 0 0 4px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.sheet .btn { margin-top: 0; }

/* F12 : visionneuse photo plein écran (tap sur une vignette) */
.shot img { cursor: zoom-in; }
.photo-ov { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center;
  padding: 12px; background: rgba(0, 0, 0, .92); }
.photo-ov img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.photo-ov .photo-close { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 14px; color: #fff; opacity: .85; }
.photo-ov .photo-close svg.i { width: 30px; height: 30px; }

/* F2 : section « Terminés récemment » (atténuée, sous les chantiers actifs).
   NB : PAS d'opacity globale (elle faisait chuter le contraste du texte sous AA) → fond crème + ombre discrète. */
.done-sep { margin-top: 22px; }
.list.done .card { background: var(--bg); box-shadow: 0 1px 3px -1px rgba(17,39,30,.12); }
.list.done .card .card-ic { background: var(--mint-2); }

/* N7 : « renvoie-moi mon accès » (visible seulement si le lien magique portait un webhook `help`) */
.lost-access { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; }
.lost-access .hint { margin: 0 0 12px; }
.lost-access .btn { margin-top: 0; }

/* ---------- Lot 2 : pointage / matériel / signature / galerie ---------- */
.add-shot.alt { border-style: solid; border-color: var(--line-2); color: var(--muted); background: var(--card); }

.pointage-row { display: flex; gap: 10px; }
.pointage-row .chip-btn { flex: 1; justify-content: center; margin-top: 0; }
.point-log { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.point-line { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--forest); font-weight: 600; }
.point-line svg.i { width: 15px; height: 15px; color: var(--primary); }

.mat-list { display: flex; flex-direction: column; gap: 8px; }
.mat-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
/* U3 : quantité en stepper +/− (l'input reste tapable pour une grosse quantité) */
.mat-qty { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line-2); border-radius: var(--r-xs); overflow: hidden; background: #fff; }   /* groupé en 1 contrôle (passe pro Fable) */
.mat-qty .mat-qte { width: 44px; text-align: center; padding: 0 4px; border: none; border-radius: 0; background: transparent; }
.qty-btn { width: 38px; height: 44px; flex: none; border: none; border-radius: 0; background: transparent; color: var(--forest); font-size: 22px; line-height: 1; font-weight: 600; display: grid; place-items: center; }
.qty-btn:first-child { border-right: 1px solid var(--line); }
.qty-btn:last-child { border-left: 1px solid var(--line); }
.qty-btn:active { background: var(--success-weak); }
/* U2 : panneau des motifs de refus (chips réutilisent .mat-chips) */
.refuse-panel { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.refuse-panel .mini-link { color: var(--muted); text-decoration: underline; }
.mat-del { width: 44px; height: 44px; border-radius: var(--r-xs); border: 1px solid var(--line-2);
  background: #fff; color: var(--muted); display: grid; place-items: center; flex: none; }
.mat-del:active { color: var(--chip-terra); border-color: #f6d2c4; }
.mat-del svg.i { width: 18px; height: 18px; }
.mat-recap { margin: 4px 0 0; padding-left: 20px; font-size: 14.5px; line-height: 1.6; }
.mat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.mat-chip { font-size: 13px; font-weight: 600; color: var(--forest); background: var(--success-weak);
  border: 1px solid var(--mint-2); border-radius: 999px; padding: 7px 12px; }
.mat-chip:active { background: var(--mint-2); }

/* ---------- Lot 4 : checklist / dictée / install / paiement ---------- */
.checklist { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 2px 8px; box-shadow: var(--sh-card); }
.check-item { display: flex; align-items: center; gap: 12px; padding: 13px 6px; border-bottom: 1px solid var(--line); font-size: 15px; }
.check-item:last-child { border-bottom: none; }
.check-item input { width: 22px; height: 22px; flex: none; accent-color: var(--primary); }

.chip-btn.mic { margin-top: 8px; }
.chip-btn.mic.rec { background: #fcebe4; color: var(--chip-terra); border-color: #f6d2c4; }

/* bannière install = « smart app banner » (carte blanche, icône app, CTA plein) — passe pro Fable */
.install-banner { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--sh-card); }
.ib-ic { width: 38px; height: 38px; border-radius: 9px; flex: none; }
.ib-txt { flex: 1; min-width: 0; font-size: 13px; line-height: 1.3; color: var(--ink); font-weight: 500; }
.install-banner .btn-pill { flex: none; background: var(--primary); color: #fff; border: none; border-radius: 999px; padding: 8px 15px; font: inherit; font-weight: 700; font-size: 13px; }
.install-banner .btn-pill:active { background: var(--forest); }
.install-x { flex: none; background: none; border: none; color: var(--muted); line-height: 1; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.install-x svg.i { width: 16px; height: 16px; }
.install-x:active { background: rgba(0,0,0,.05); }

.paye-badge { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; font-size: 12.5px; font-weight: 700;
  color: var(--primary); background: #def0e6; border: 1px solid var(--green-soft); border-radius: 999px; padding: 4px 11px; }
.paye-badge svg.i { width: 14px; height: 14px; }
.pause-badge { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700; vertical-align: middle;
  color: #b45309; background: #fdefc7; border: 1px solid #f3d99b; border-radius: 999px; padding: 1px 8px; }

.sign-pad { width: 100%; height: 170px; background: #fff; border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 3px rgba(17,39,30,.06); border-radius: var(--r-sm); display: block; touch-action: none; margin-top: 2px; }
.sign-wrap { position: relative; }   /* audit 48 #3 : invite « Signez ici » centrée sur le pad, masquée au 1er trait */
.sign-hint { position: absolute; inset: 2px 0 0; display: flex; align-items: center; justify-content: center; gap: 6px; pointer-events: none; color: var(--muted); font-size: 14px; font-weight: 500; }

/* --- Accueil : bascule (thumb glissant) + calendrier mois NATIF iOS (sans bordures, cercles pleins) — passe pro Fable --- */
.home-toggle { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--line); border-radius: 999px; padding: 3px; margin: 2px 0 16px; }
.home-toggle::before { content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); background: var(--card); border-radius: 999px; box-shadow: 0 1px 3px -1px rgba(17,39,30,.25); transition: transform .2s ease; }
.home-toggle.is-cal::before { transform: translateX(100%); }
.ht-btn { position: relative; z-index: 1; border: none; background: none; box-shadow: none; padding: 8px 0; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.ht-btn.on { color: var(--ink); }
.cal-head { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.cal-title { font-family: var(--font-display); font-size: 21px; font-weight: 800; text-transform: capitalize; margin-right: auto; white-space: nowrap; color: var(--ink); letter-spacing: -.02em; }
.cal-nav { width: 34px; height: 34px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: none; border: none; color: var(--forest); font-size: 22px; line-height: 1; }
.cal-nav svg.i { width: 20px; height: 20px; }
.cal-nav.prev svg.i { transform: rotate(180deg); }
.cal-nav:active { background: var(--line); }
.cal-today-btn { flex: none; background: none; border: none; padding: 6px 8px; font: inherit; font-size: 14px; font-weight: 700; color: var(--primary); }
.cal-frame { border: none; background: transparent; }
.cal-grid7 { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.cal-dow { border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.cal-dowh { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; padding: 6px 0; }
.cal-cell { min-height: 54px; border: none; background: none; padding: 3px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; font: inherit; cursor: pointer; }
.cal-cell.cal-out { cursor: default; }
.cal-cell.cal-out .cal-dnum { opacity: .32; }
.cal-dnum { font-size: 15px; font-weight: 500; color: var(--ink); width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-sel .cal-dnum { background: var(--forest); color: #fff; font-weight: 700; }
.cal-today-n { background: var(--primary); color: #fff; font-weight: 700; }
.cal-dots { display: flex; gap: 3px; min-height: 7px; flex-wrap: wrap; justify-content: center; }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.cal-agenda { margin-top: 8px; }
.cal-agenda-h { font-size: 14px; font-weight: 700; color: var(--ink); text-transform: capitalize; margin: 0 2px 10px; }
.cal-agenda-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 26px 0; }
.sign-bar { display: flex; align-items: center; justify-content: space-between; margin: 8px 2px 0; }
.sign-bar .mini-link { margin-left: 0; color: var(--primary); text-decoration: none; }
.sign-absent { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--muted); font-weight: 600; }
.sign-absent input { width: 18px; height: 18px; }
#sign-nom { margin-top: 10px; }
