/* ═══════════════════════════════════════════════════════════════════
   lea-talk.css — « Parler à Léa », agent vocal intégré (20/10/2026)
   Préfixe .lea- uniquement (convention maison : dux-, fx-, pv2-, v77-).
   Marque Décroche Toujours : navy #1a2340, or #C7A059, papier #faf6ef.
   Mobile d'abord ; ≥ 900 px : conversation / document en 2 colonnes,
   copie fonctionnelle de la capture démo du site.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Bouton flottant unique ─────────────────────────────────────── */
#lea-talk {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(76px + env(safe-area-inset-bottom) + 12px);
  z-index: 1200;
  min-height: 60px;
  border: none;
  border-radius: 999px;
  background: #1a2340;
  color: #fff;
  box-shadow: 0 10px 24px rgba(26, 35, 64, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 20px;
  cursor: pointer;
  font-family: inherit;
}
#lea-talk:active { transform: scale(.98); }
#lea-talk .lea-talk-ico { font-size: 24px; color: #C7A059; flex: none; }
#lea-talk .lea-talk-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
#lea-talk .lea-talk-label { font-size: 17px; font-weight: 700; }
#lea-talk .lea-talk-sub { font-size: 12px; opacity: .75; font-weight: 400; }
@media (min-width: 480px) {
  #lea-talk { left: auto; min-width: 230px; }
}
/* Au-dessus d'un FAB de création visible (Devis / Factures / Planning) */
#lea-talk.lea-above-fab { bottom: calc(76px + env(safe-area-inset-bottom) + 84px); }
#lea-talk[hidden] { display: none; }

/* Planning : la pastille « Aujourd'hui » se décale au-dessus du bouton */
body.lea-on .pv2-today-pill { bottom: calc(76px + env(safe-area-inset-bottom) + 84px) !important; }
body.lea-on.lea-fab-on .pv2-today-pill { bottom: calc(76px + env(safe-area-inset-bottom) + 156px) !important; }

/* Anciens déclencheurs de dictée création masqués (jamais supprimés) */
.lea-hide { display: none !important; }

/* ── Bannière de reprise de brouillon ───────────────────────────── */
#lea-draft-banner {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(76px + env(safe-area-inset-bottom) + 84px);
  z-index: 1190;
  background: #fff;
  border: 1px solid #E4D8C4;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(26, 35, 64, .18);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: #1a2340;
}
#lea-draft-banner[hidden] { display: none; }
#lea-draft-banner .lea-draft-txt { flex: 1; }
#lea-draft-banner button { min-height: 48px; border-radius: 12px; border: 1px solid #D5C6AF; background: #fff; padding: 0 14px; font-weight: 700; cursor: pointer; }
#lea-draft-banner button.lea-draft-go { background: #1a2340; color: #fff; border-color: #1a2340; }

/* ── Panneau plein écran ────────────────────────────────────────── */
#lea-panel {
  position: fixed; inset: 0; z-index: 3000;
  background: #f4efe6;
  display: flex; flex-direction: column;
}
#lea-panel[hidden] { display: none; }
.lea-head {
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: #1a2340; color: #fff;
}
.lea-head h2 { font-size: 19px; margin: 0; font-weight: 800; }
.lea-head-txt { flex: 1; min-width: 0; }
#lea-ctx { margin: 2px 0 0; font-size: 13px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#lea-close {
  width: 48px; height: 48px; flex: none;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.35);
  background: transparent; color: #fff; font-size: 20px; cursor: pointer;
}
.lea-timer { flex: none; text-align: right; font-size: 13px; opacity: .9; }
.lea-timer b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.lea-alert {
  background: #fdf3e0; color: #6b5216; border-bottom: 1px solid #EADFCB;
  padding: 10px 14px; font-size: 15px;
}
.lea-alert[hidden] { display: none; }

.lea-main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.lea-conv {
  flex: 0 1 32%; overflow-y: auto; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.lea-msg { max-width: 92%; padding: 9px 12px; border-radius: 14px; font-size: 16px; line-height: 1.35; }
.lea-msg .lea-who { font-weight: 800; margin-right: 6px; }
.lea-msg.lea { background: #1a2340; color: #fff; align-self: flex-start; border-bottom-left-radius: 4px; }
.lea-msg.lea .lea-who { color: #C7A059; }
.lea-msg.vous { background: #fff; color: #1a2340; align-self: flex-end; border: 1px solid #E4D8C4; border-bottom-right-radius: 4px; }
.lea-msg.encours { opacity: .65; font-style: italic; }
.lea-msg.sys { background: transparent; color: #5b5344; align-self: center; font-size: 14px; text-align: center; }

/* Zone document « papier » */
.lea-doc {
  flex: 1 1 auto; overflow-y: auto; margin: 0 12px;
  background: #faf6ef; border: 1px solid #E4D8C4; border-radius: 16px;
  padding: 16px; color: #1a2340;
  box-shadow: 0 4px 14px rgba(26, 35, 64, .08);
}
.lea-doc-vide { color: #8a7f68; font-size: 15px; text-align: center; padding: 26px 8px; }
.lea-doc h3 { margin: 0 0 2px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #8E692D; }
.lea-doc .lea-doc-entreprise { font-size: 19px; font-weight: 800; margin: 0 0 2px; }
.lea-doc .lea-doc-titre { font-size: 16px; font-weight: 700; margin: 0 0 2px; }
.lea-doc .lea-doc-client { font-size: 15px; color: #44403a; margin: 0 0 10px; }
.lea-doc table { width: 100%; border-collapse: collapse; font-size: 15px; }
.lea-doc td, .lea-doc th { padding: 8px 4px; border-bottom: 1px solid #EDE4D2; text-align: left; vertical-align: top; }
.lea-doc .lea-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lea-doc tr.lea-ligne-nouvelle { animation: lea-in .35s ease-out; background: #fdf6e3; }
@keyframes lea-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lea-doc tr.lea-ligne-nouvelle { animation: none; } }
.lea-doc .lea-flag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #f7e8c3; color: #6b5216; font-size: 12px; font-weight: 700; white-space: nowrap; }
.lea-doc .lea-ok { display: inline-block; margin-left: 6px; color: #2e7d32; font-size: 13px; font-weight: 700; }
.lea-totaux { margin-top: 10px; font-size: 16px; }
.lea-totaux .lea-trow { display: flex; justify-content: space-between; padding: 3px 4px; }
.lea-totaux .lea-ttc { font-size: 21px; font-weight: 800; border-top: 2px solid #1a2340; margin-top: 6px; padding-top: 8px; }
.lea-doc .lea-carte { border: 1px solid #E4D8C4; border-radius: 12px; padding: 12px; background: #fff; margin-bottom: 10px; font-size: 15px; }
.lea-doc .lea-avant { text-decoration: line-through; opacity: .65; }
.lea-doc .lea-apres { font-weight: 800; }
.lea-doc button.lea-ouvrir {
  width: 100%; min-height: 52px; margin-top: 10px; border: none; border-radius: 12px;
  background: #1a2340; color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
}
.lea-doc .lea-ligne-edit { display: flex; gap: 8px; align-items: center; }
.lea-doc .lea-ligne-edit input {
  width: 92px; min-height: 48px; font-size: 17px; padding: 6px 8px;
  border: 1px solid #D5C6AF; border-radius: 10px; background: #fff;
}

/* Barre de confirmation au doigt */
.lea-confirm {
  margin: 10px 12px 0; background: #fff; border: 1px solid #E4D8C4; border-radius: 16px; padding: 14px;
}
.lea-confirm[hidden] { display: none; }
.lea-confirm h3 { margin: 0 0 6px; font-size: 18px; color: #1a2340; }
.lea-confirm .lea-lettres { font-size: 18px; color: #1a2340; margin: 0 0 4px; }
.lea-confirm .lea-arevoir { color: #8a5a00; font-size: 15px; margin: 0 0 8px; }
.lea-confirm .lea-confirm-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

/* Pied du panneau */
.lea-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}
.lea-btn {
  min-height: 52px; border-radius: 14px; padding: 0 18px;
  font-size: 16px; font-weight: 700; cursor: pointer; border: 1px solid #D5C6AF; background: #fff; color: #1a2340;
}
.lea-btn-primary { flex: 1; background: #1a2340; color: #fff; border-color: #1a2340; min-height: 56px; }
.lea-btn-gold { flex: 1; background: #C7A059; color: #1a2340; border-color: #C7A059; min-height: 56px; font-size: 17px; }
.lea-btn-link { border: none; background: transparent; text-decoration: underline; font-weight: 600; min-height: 48px; }
.lea-btn[disabled] { opacity: .45; cursor: default; }

/* Écran d'état / erreur (dans le panneau) */
.lea-screen { padding: 22px 16px; overflow-y: auto; }
.lea-screen h3 { font-size: 20px; margin: 0 0 8px; color: #1a2340; }
.lea-screen p { font-size: 16px; color: #44403a; margin: 0 0 14px; line-height: 1.45; }
.lea-screen .lea-confirm-btns { display: flex; flex-direction: column; gap: 8px; }

/* Compteur deux lignes (carte Abonnement) */
.lea-min-lines { border-top: 1px solid #EDE4D2; margin-top: 4px; }
.lea-min-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; min-height: 48px; }
.lea-min-line + .lea-min-line { border-top: 1px solid #EDE4D2; }
.lea-min-line .lea-min-titre { font-weight: 700; color: #1a2340; font-size: 15px; }
.lea-min-line .lea-min-sub { font-size: 13px; color: #77705f; }
.lea-min-line .lea-min-num { font-size: 19px; font-weight: 800; color: #1a2340; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lea-offertes { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #eef5e9; color: #2e7d32; font-size: 12px; font-weight: 700; }
.lea-min-resume { font-size: 14px; color: #44403a; margin: 8px 2px 0; }
.lea-min-resume[hidden] { display: none; }

@media (min-width: 900px) {
  .lea-main { flex-direction: row; gap: 0; padding: 12px; }
  .lea-conv { flex: 1 1 50%; background: #1a2340; border-radius: 16px; margin-right: 12px; max-height: none; }
  .lea-msg.vous { background: #26335c; color: #fff; border-color: #26335c; }
  .lea-doc { flex: 1 1 50%; margin: 0; }
}
