/* ── Dan, l'assistant Décroche Toujours — styles (build 17/10/2026) ──
   Charte : navy #1a2340, doré #C7A059, fond papier #faf6ef.
   Textes du panneau : navy sur papier (≈ 14:1, ≥ 7:1 exigé).
   Cibles : ≥ 48 px partout, 64 px pour les actions de session.
   Aucun état porté par la seule couleur : icône + texte partout. */

.dan-btn {
  position: fixed; right: 16px; z-index: 80;
  bottom: calc(72px + env(safe-area-inset-bottom) + 12px);
  width: 64px; height: 64px; border-radius: 50%;
  background: #C7A059; color: #1a2340;
  border: 2px solid #1a2340;
  box-shadow: 0 6px 18px rgba(26, 35, 64, 0.35);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0; cursor: pointer; padding: 0;
  font-family: inherit;
}
.dan-btn:active { transform: scale(0.96); }
.dan-btn .dan-btn-icone { font-size: 24px; line-height: 1; }
.dan-btn .dan-btn-libelle { font-size: 15px; font-weight: 800; line-height: 1.1; letter-spacing: 0.02em; }
/* Vue Planning / Factures : le bouton Dan s'empile AU-DESSUS des boutons
   de création (#plan-fab fixe, #fx-fab) — jamais côte à côte. */
.dan-btn--empile { bottom: calc(72px + env(safe-area-inset-bottom) + 12px + 72px); }
.dan-cache { display: none !important; }

/* ── Panneau : feuille basse, mobile d'abord ── */
.dan-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  max-height: 82vh; max-height: 82dvh;
  background: #faf6ef; color: #1a2340;
  border-top: 3px solid #C7A059; border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 30px rgba(26, 35, 64, 0.30);
  display: flex; flex-direction: column;
  font-family: inherit;
}
@media (min-width: 720px) {
  .dan-panel { left: 50%; right: auto; transform: translateX(-50%); width: 560px; }
}
.dan-panel-entete {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px 8px;
}
.dan-panel-titre { font-size: 20px; font-weight: 800; margin: 0; }
.dan-panel-sous { font-size: 14px; margin: 2px 0 0; color: #1a2340; }
.dan-fermer {
  min-width: 48px; min-height: 48px; border-radius: 12px; flex: none;
  background: #ffffff; color: #1a2340; border: 2px solid #1a2340;
  font-size: 16px; font-weight: 700; cursor: pointer; padding: 0 12px;
}

/* Bandeau d'état de session : icône + texte, jamais la couleur seule. */
.dan-etat {
  display: flex; align-items: center; gap: 10px;
  margin: 0 16px 8px; padding: 10px 12px; min-height: 48px;
  background: #ffffff; border: 2px solid #1a2340; border-radius: 12px;
  font-size: 17px; font-weight: 700; text-align: left; width: calc(100% - 32px);
  color: #1a2340; cursor: default; font-family: inherit;
}
button.dan-etat { cursor: pointer; }
.dan-etat .dan-etat-icone { font-size: 20px; line-height: 1; flex: none; }

.dan-messages {
  overflow-y: auto; padding: 4px 16px 8px; flex: 1 1 auto;
  font-size: 18px; line-height: 1.45;
}
.dan-msg { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; }
.dan-msg--dan { background: #ffffff; border: 1px solid #d8cfb8; }
.dan-msg--artisan { background: #ece5d3; border: 1px solid #d8cfb8; }
.dan-msg--info { background: #ffffff; border: 2px dashed #1a2340; font-size: 16px; }
.dan-msg-qui { display: block; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }
.dan-msg p { margin: 0; white-space: pre-wrap; }

.dan-reprendre, .dan-escalade-btn, .dan-degrade-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: calc(100% - 32px); margin: 0 16px 10px; min-height: 64px;
  border-radius: 14px; font-size: 18px; font-weight: 800; cursor: pointer;
  font-family: inherit; padding: 10px 14px;
}
.dan-reprendre { background: #C7A059; color: #1a2340; border: 2px solid #1a2340; }
.dan-escalade-btn { background: #1a2340; color: #faf6ef; border: 2px solid #1a2340; }
.dan-degrade-btn { background: #ffffff; color: #1a2340; border: 2px solid #1a2340; }

/* Pastilles de session : 64 px, 1 appui, aucun geste caché. */
.dan-pastilles {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 4px 16px 8px;
}
.dan-pastille {
  min-height: 64px; border-radius: 14px; cursor: pointer;
  background: #ffffff; color: #1a2340; border: 2px solid #1a2340;
  font-size: 17px; font-weight: 800; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px;
}
.dan-pastille .dan-pastille-icone { font-size: 20px; line-height: 1; }
.dan-pastille--actif { background: #C7A059; }
.dan-pastille[disabled] { opacity: 0.55; cursor: default; }

.dan-saisie {
  display: flex; gap: 10px; align-items: stretch;
  padding: 4px 16px calc(12px + env(safe-area-inset-bottom));
}
.dan-champ {
  flex: 1 1 auto; min-height: 56px; max-height: 110px; resize: none;
  border: 2px solid #1a2340; border-radius: 12px; padding: 12px;
  font-size: 18px; font-family: inherit; color: #1a2340; background: #ffffff;
}
.dan-envoyer {
  min-width: 64px; min-height: 56px; border-radius: 12px; cursor: pointer;
  background: #1a2340; color: #faf6ef; border: 2px solid #1a2340;
  font-size: 17px; font-weight: 800; font-family: inherit; padding: 0 14px;
}

/* ── Halo spotlight : doré, 1,5 s, doublé d'une étiquette texte ── */
@keyframes dan-halo-pulse {
  0% { outline-offset: 2px; }
  50% { outline-offset: 6px; }
  100% { outline-offset: 2px; }
}
.dan-halo {
  outline: 4px solid #C7A059 !important; outline-offset: 3px;
  box-shadow: 0 0 0 7px rgba(199, 160, 89, 0.35);
  animation: dan-halo-pulse 0.75s ease-in-out 2;
  border-radius: 8px;
}
.dan-ici {
  display: inline-block; margin: 6px 0; padding: 6px 12px;
  background: #C7A059; color: #1a2340; border: 2px solid #1a2340; border-radius: 999px;
  font-size: 16px; font-weight: 800; font-family: inherit;
}

/* ── Ligne injectée dans Compte : interrupteur Dan ── */
.dan-compte-row {
  background: #ffffff; border: 1px solid #d8cfb8; border-radius: 12px;
  padding: 12px; margin: 10px 0; color: #1a2340;
}
.dan-compte-row .dan-compte-titre { font-size: 16px; font-weight: 800; margin: 0 0 4px; }
.dan-compte-row .dan-compte-txt { font-size: 14px; margin: 0 0 10px; }
.dan-compte-choix { display: flex; flex-wrap: wrap; gap: 10px; }
.dan-compte-choix button {
  min-height: 48px; padding: 8px 14px; border-radius: 10px; cursor: pointer;
  background: #ffffff; color: #1a2340; border: 2px solid #1a2340;
  font-size: 15px; font-weight: 700; font-family: inherit;
}
.dan-compte-choix button.dan-choix--actif { background: #C7A059; }

@media (prefers-reduced-motion: reduce) {
  .dan-halo { animation: none; }
  .dan-btn:active { transform: none; }
}
