/* ============================================================
   Desura — Chat / Messagerie · feuille de style partagée (Lot A)
   Widget public visiteur. Reprend les tokens theme.css et le
   vocabulaire du widget existant (chat-widget.js). Préfixe dchat-*.
   Le chrome de présentation (host fictif) est préfixé demo-*.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-sans);
  color: var(--color-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============================================================
   1. Scène de présentation (page hôte fictive)
   ============================================================ */
.demo-stage {
  min-height: 100vh;
  background:
    radial-gradient(120% 80% at 80% -10%, rgba(16,185,129,0.05), transparent 60%),
    var(--color-mist);
  padding: 40px clamp(16px, 4vw, 64px) 64px;
}
.demo-stage--dark {
  background:
    radial-gradient(120% 80% at 80% -10%, rgba(16,185,129,0.12), transparent 60%),
    linear-gradient(165deg, #1c1c22, #09090b 75%);
}
.demo-head { max-width: 1160px; margin: 0 auto 26px; }
.demo-eyebrow {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-ember);
}
.demo-stage--dark .demo-eyebrow { color: var(--color-ember); }
.demo-title {
  font-size: clamp(22px, 3vw, 30px); font-weight: 700; letter-spacing: -0.02em;
  color: var(--color-obsidian); margin: 8px 0 6px; line-height: 1.1;
}
.demo-stage--dark .demo-title { color: #fff; }
.demo-sub { font-size: 14.5px; color: var(--color-slate); max-width: 64ch; line-height: 1.55; margin: 0; }
.demo-stage--dark .demo-sub { color: var(--color-ash); }
.demo-meta {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px;
}
.demo-tag {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: var(--color-steel); background: var(--color-snow);
  box-shadow: inset 0 0 0 1px var(--color-fog); border-radius: var(--radius-pill);
  padding: 4px 11px;
}
.demo-stage--dark .demo-tag { background: rgba(255,255,255,0.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); color: var(--color-pebble); }

/* Galerie de frames (1 ou plusieurs états côte à côte) */
.demo-gallery {
  max-width: 1160px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start;
}
.demo-gallery--grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.demo-col { display: flex; flex-direction: column; gap: 12px; }
.demo-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--color-graphite);
}
.demo-label .n {
  font-family: var(--font-mono); font-size: 10px; color: var(--color-snow); white-space: nowrap;
  background: var(--color-obsidian); border-radius: 6px; padding: 2px 7px; letter-spacing: 0.04em;
}
.demo-label .muted { color: var(--color-steel); font-weight: 500; }
.demo-stage--dark .demo-label { color: var(--color-pebble); }

/* Frame = fenêtre hôte miniature contenant le widget en absolute */
.demo-frame {
  position: relative; overflow: hidden;
  width: 420px; max-width: 100%;
  height: 660px;
  background: var(--color-snow);
  border-radius: 22px;
  box-shadow: 0 1px 0 var(--color-fog), 0 24px 60px -28px rgba(9,9,11,0.45);
  outline: 1px solid var(--color-fog);
}
.demo-frame--dark { background: #111114; outline: 1px solid #26262b; }
.demo-frame--launcher { height: 300px; width: 300px; }
.demo-frame--mobile { width: 300px; height: 600px; }
.demo-frame--tall { height: 720px; }

/* Contenu fictif de la page hôte (ghost) */
.demo-host { position: absolute; inset: 0; padding: 22px; opacity: 0.5; user-select: none; pointer-events: none; }
.demo-host__bar { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.demo-host__logo { width: 84px; height: 14px; border-radius: 7px; background: var(--color-pebble); }
.demo-host__nav { margin-left: auto; display: flex; gap: 14px; }
.demo-host__nav i { width: 38px; height: 9px; border-radius: 5px; background: var(--color-fog); display: block; }
.demo-host__h { height: 22px; border-radius: 8px; background: var(--color-pebble); width: 70%; margin-bottom: 12px; }
.demo-host__h.sm { width: 48%; height: 16px; }
.demo-host__p { height: 10px; border-radius: 5px; background: var(--color-fog); margin-bottom: 9px; }
.demo-host__p.w1 { width: 92%; } .demo-host__p.w2 { width: 84%; } .demo-host__p.w3 { width: 64%; }
.demo-host__block { margin-top: 22px; height: 120px; border-radius: 16px; background: var(--color-fog); }
.demo-frame--dark .demo-host { opacity: 0.35; }
.demo-frame--dark .demo-host__logo, .demo-frame--dark .demo-host__h { background: #3a3a42; }
.demo-frame--dark .demo-host__nav i, .demo-frame--dark .demo-host__p, .demo-frame--dark .demo-host__block { background: #26262b; }

/* Host = espace client (rail latéral ghost) */
.demo-host--app { padding-left: 78px; }
.demo-host--app::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 60px; background: var(--color-snow); box-shadow: inset -1px 0 0 var(--color-fog); }
.demo-host--app::after { content: ""; position: absolute; left: 14px; top: 24px; width: 32px; height: 8px; border-radius: 5px; background: var(--color-pebble); box-shadow: 0 22px 0 var(--color-fog), 0 40px 0 var(--color-fog), 0 58px 0 var(--color-fog); }

/* Le widget se positionne dans le frame (pas en fixed) */
.demo-frame .dchat-launcher { position: absolute; right: 18px; bottom: 18px; }
.demo-frame .dchat-panel { position: absolute; right: 16px; bottom: 88px; }
.demo-frame--full .dchat-panel { inset: 0; right: 0; bottom: 0; width: 100%; height: 100%; max-height: none; border-radius: 22px; }

/* ============================================================
   2. Launcher (bulle flottante)
   ============================================================ */
.dchat-launcher {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--color-obsidian); color: #fff;
  display: grid; place-items: center; cursor: pointer; border: 0;
  box-shadow: 0 10px 30px rgba(9,9,11,0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dchat-launcher svg { width: 24px; height: 24px; }
.dchat-launcher.is-hover, .dchat-launcher:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 16px 38px rgba(9,9,11,0.34); }
.dchat-launcher__dot {
  position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: var(--radius-pill); background: var(--color-ember); color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 0 3px var(--color-mist);
}
.demo-frame--dark .dchat-launcher__dot { box-shadow: 0 0 0 3px #111114; }

/* Annonce / teaser collé au launcher */
.dchat-teaser {
  position: absolute; right: 18px; bottom: 88px; width: 252px;
  background: var(--color-snow); border-radius: 18px;
  box-shadow: 0 18px 44px -16px rgba(9,9,11,0.4), inset 0 0 0 1px var(--color-fog);
  padding: 14px 16px;
}
.dchat-teaser--in { animation: dchat-slideup 0.45s cubic-bezier(0.16,0.84,0.44,1) both; }
.dchat-teaser::after {
  content: ""; position: absolute; right: 22px; bottom: -7px; width: 14px; height: 14px;
  background: var(--color-snow); transform: rotate(45deg);
  box-shadow: 2px 2px 4px -2px rgba(9,9,11,0.12);
}
.dchat-teaser__head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.dchat-teaser__ava { display: flex; }
.dchat-teaser__ava span {
  width: 24px; height: 24px; border-radius: 50%; margin-left: -7px; font-size: 10px; font-weight: 600;
  display: grid; place-items: center; background: var(--color-obsidian); color: #fff; box-shadow: 0 0 0 2px var(--color-snow);
}
.dchat-teaser__ava span:first-child { margin-left: 0; }
.dchat-teaser__name { font-size: 12px; font-weight: 600; color: var(--color-obsidian); }
.dchat-teaser__close {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border: 0; cursor: pointer;
  background: var(--color-mist); border-radius: 50%; color: var(--color-steel); display: grid; place-items: center;
}
.dchat-teaser__txt { font-size: 13px; line-height: 1.45; color: var(--color-slate); margin: 0 0 12px; }
.dchat-teaser__cta {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  color: #fff; background: var(--color-obsidian); border: 0; border-radius: var(--radius-pill);
  padding: 8px 14px; cursor: pointer;
}
@keyframes dchat-slideup { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Tooltip launcher (espace authentifié) */
.dchat-launchwrap { position: absolute; right: 18px; bottom: 18px; }
.dchat-tooltip {
  position: absolute; right: calc(100% + 12px); top: 50%; transform: translateY(-50%);
  white-space: nowrap; background: var(--color-obsidian); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 8px 13px; border-radius: var(--radius-pill); box-shadow: 0 8px 20px -8px rgba(9,9,11,0.5);
}
.dchat-tooltip::after { content: ""; position: absolute; left: 100%; top: 50%; transform: translateY(-50%); border: 6px solid transparent; border-left-color: var(--color-obsidian); }

/* Bandeau "aussi visible dans Messages" */
.dchat-syncbar {
  display: flex; align-items: center; gap: 8px; background: var(--c-info-bg); color: var(--c-info);
  font-size: 11.5px; font-weight: 500; padding: 8px 14px; border-bottom: 1px solid var(--c-info-line);
}
.dchat-syncbar svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ============================================================
   3. Panneau — coquille (head / body / tabs)
   ============================================================ */
.dchat-panel {
  width: 384px; max-width: calc(100% - 32px);
  height: calc(100% - 92px); max-height: 624px;
  background: var(--color-mist); border-radius: var(--radius-card);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(9,9,11,0.28);
  font-family: var(--font-sans);
}
.dchat-panel * { box-sizing: border-box; }

/* Header */
.dchat-head { background: var(--color-snow); padding: 20px 20px 16px; position: relative; flex-shrink: 0; }
.dchat-head--brand {
  background: linear-gradient(160deg, #1d1d23, var(--color-obsidian) 78%); color: #fff;
}
.dchat-head__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dchat-logo { display: inline-flex; align-items: center; gap: 9px; }
.dchat-logo__img { height: 22px; width: auto; display: block; }
.dchat-logo__mark { width: 26px; height: 26px; border-radius: 8px; background: var(--color-obsidian); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.dchat-head--brand .dchat-logo__mark { background: rgba(255,255,255,0.12); }
.dchat-avatars { display: flex; }
.dchat-avatars span {
  width: 32px; height: 32px; border-radius: 50%; margin-left: -8px;
  background: var(--color-fog); color: var(--color-graphite); box-shadow: 0 0 0 2px var(--color-snow);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 600;
}
.dchat-avatars span:first-child { margin-left: 0; }
.dchat-avatars .on { background: var(--color-obsidian); color: #fff; }
.dchat-head--brand .dchat-avatars span { box-shadow: 0 0 0 2px var(--color-obsidian); background: #2a2a31; color: #fff; }
.dchat-iconbtn {
  background: none; border: 0; cursor: pointer; color: var(--color-steel);
  display: grid; place-items: center; padding: 5px; border-radius: 9px; transition: background 0.15s, color 0.15s;
}
.dchat-iconbtn:hover { background: var(--color-mist); color: var(--color-obsidian); }
.dchat-head--brand .dchat-iconbtn { color: var(--color-ash); }
.dchat-head--brand .dchat-iconbtn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.dchat-head__actions { display: flex; align-items: center; gap: 8px; }

.dchat-hi { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.16; color: var(--color-obsidian); margin: 18px 0 0; }
.dchat-head--brand .dchat-hi { color: #fff; }
.dchat-hi b { color: var(--color-ash); font-weight: 700; }
.dchat-head--brand .dchat-hi b { color: var(--color-steel); }

/* statut en ligne / hors-ligne dans le header conv */
.dchat-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; }
.dchat-status .d { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dchat-status--on { color: var(--c-success); }
.dchat-status--on .d { background: var(--c-success); box-shadow: 0 0 0 3px rgba(12,138,94,0.14); }
.dchat-status--off { color: var(--color-steel); }
.dchat-status--off .d { background: var(--color-ash); }

/* Body scrollable */
.dchat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.dchat-body--pad { padding: 18px 16px; }

/* Tabs bas */
.dchat-tabs { display: flex; background: var(--color-snow); border-top: 1px solid var(--color-fog); flex-shrink: 0; }
.dchat-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 9px;
  font-size: 11px; font-weight: 500; color: var(--color-steel); cursor: pointer; background: none; border: 0;
  position: relative;
}
.dchat-tab svg { width: 20px; height: 20px; }
.dchat-tab.is-active { color: var(--color-obsidian); font-weight: 600; }
.dchat-tab.is-active::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 26px; height: 2px; border-radius: 2px; background: var(--color-obsidian); }
.dchat-tab .tab-dot { position: absolute; top: 7px; right: calc(50% - 20px); width: 7px; height: 7px; border-radius: 50%; background: var(--color-ember); box-shadow: 0 0 0 2px var(--color-snow); }

/* ============================================================
   4. Cartes & CTA (accueil)
   ============================================================ */
.dchat-card { background: var(--color-snow); border-radius: 16px; box-shadow: var(--shadow-md); }
.dchat-card--pad { padding: 16px 18px; }
.dchat-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}
.dchat-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -10px rgba(9,9,11,0.3); }
.dchat-cta__t { font-size: 15px; font-weight: 600; color: var(--color-obsidian); }
.dchat-cta__s { font-size: 12.5px; color: var(--color-steel); margin-top: 2px; }
.dchat-cta__ic { width: 36px; height: 36px; border-radius: 50%; background: var(--color-obsidian); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.dchat-cta__ic svg { width: 16px; height: 16px; }

/* bouton plein largeur (primary obsidian) */
.dchat-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: 0; cursor: pointer; font: inherit; font-size: 14.5px; font-weight: 600;
  padding: 13px 18px; border-radius: var(--radius-pill); transition: filter 0.15s, transform 0.15s;
  text-decoration: none;
}
.dchat-btn svg { width: 17px; height: 17px; }
.dchat-btn--primary { background: var(--color-obsidian); color: #fff; box-shadow: var(--shadow-pill); }
.dchat-btn--primary:hover { transform: translateY(-1px); }
.dchat-btn--ghost { background: var(--color-snow); color: var(--color-obsidian); box-shadow: inset 0 0 0 1px var(--color-pebble); }
.dchat-btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--color-graphite); }
.dchat-btn--ember { background: var(--color-ember); color: #fff; }
.dchat-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Section titre dans le body */
.dchat-secttl { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-ash); font-family: var(--font-mono); margin: 4px 2px 2px; }

/* Liste articles (accueil + aide) */
.dchat-art {
  display: flex; align-items: center; gap: 11px; padding: 13px 16px; cursor: pointer; text-align: left;
  border-top: 1px solid var(--color-fog); text-decoration: none; transition: background 0.15s;
}
.dchat-art:first-of-type { border-top: 0; }
.dchat-art:hover { background: var(--color-mist); }
.dchat-art__ic { color: var(--color-ash); flex-shrink: 0; display: grid; place-items: center; }
.dchat-art__ic svg { width: 17px; height: 17px; }
.dchat-art__t { flex: 1; font-size: 13.5px; font-weight: 500; color: var(--color-ink); line-height: 1.35; }
.dchat-art__chev { color: var(--color-ash); flex-shrink: 0; }
.dchat-art__chev svg { width: 15px; height: 15px; }

/* Barre de recherche aide */
.dchat-search {
  display: flex; align-items: center; gap: 9px; background: var(--color-snow);
  box-shadow: inset 0 0 0 1px var(--color-fog); border-radius: 12px; padding: 11px 13px;
}
.dchat-search svg { width: 16px; height: 16px; color: var(--color-ash); flex-shrink: 0; }
.dchat-search input { border: 0; background: none; outline: none; flex: 1; font: inherit; font-size: 13.5px; color: var(--color-ink); min-width: 0; }
.dchat-search input::placeholder { color: var(--color-ash); }
.dchat-search__clear { background: var(--color-mist); border: 0; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: var(--color-steel); }

/* Bandeau hors-ligne */
.dchat-offline {
  display: flex; gap: 11px; align-items: flex-start; background: var(--color-snow);
  border-radius: 14px; box-shadow: inset 0 0 0 1px var(--color-fog); padding: 14px 16px;
}
.dchat-offline__ic { width: 32px; height: 32px; border-radius: 9px; background: var(--color-mist); color: var(--color-steel); display: grid; place-items: center; flex-shrink: 0; }
.dchat-offline__ic svg { width: 16px; height: 16px; }
.dchat-offline__t { font-size: 13.5px; font-weight: 600; color: var(--color-obsidian); }
.dchat-offline__s { font-size: 12.5px; color: var(--color-steel); line-height: 1.45; margin-top: 2px; }

/* ============================================================
   5. Bot de routing
   ============================================================ */
.dchat-choices { display: flex; flex-direction: column; gap: 8px; }
.dchat-choice {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: var(--color-snow); border: 0; box-shadow: inset 0 0 0 1px var(--color-fog);
  border-radius: 13px; padding: 13px 15px; cursor: pointer; font: inherit;
  transition: box-shadow 0.15s, background 0.15s, transform 0.15s;
}
.dchat-choice:hover { box-shadow: inset 0 0 0 1.5px var(--color-ember); background: rgba(16,185,129,0.04); transform: translateX(2px); }
.dchat-choice__ic { width: 34px; height: 34px; border-radius: 10px; background: var(--color-mist); color: var(--color-obsidian); display: grid; place-items: center; flex-shrink: 0; }
.dchat-choice__ic svg { width: 17px; height: 17px; }
.dchat-choice__t { font-size: 14px; font-weight: 600; color: var(--color-obsidian); }
.dchat-choice__s { font-size: 12px; color: var(--color-steel); margin-top: 1px; }
.dchat-choice__chev { margin-left: auto; color: var(--color-pebble); }
.dchat-choice:hover .dchat-choice__chev { color: var(--color-ember); }
.dchat-skip { background: none; border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; color: var(--color-steel); text-decoration: underline; text-underline-offset: 3px; padding: 6px; align-self: center; }
.dchat-skip:hover { color: var(--color-obsidian); }

/* ============================================================
   6. Formulaire d'identification
   ============================================================ */
.dchat-form { display: flex; flex-direction: column; gap: 14px; }
.dchat-field { display: flex; flex-direction: column; gap: 6px; }
.dchat-field__lbl { font-size: 12.5px; font-weight: 600; color: var(--color-graphite); }
.dchat-field__lbl .req { color: var(--color-ember); }
.dchat-field__lbl .opt { color: var(--color-ash); font-weight: 500; }
.dchat-input, .dchat-textarea {
  width: 100%; border: 0; background: var(--color-snow); box-shadow: inset 0 0 0 1px var(--color-pebble);
  border-radius: var(--radius-input); padding: 11px 13px; font: inherit; font-size: 14px; color: var(--color-obsidian);
  transition: box-shadow 0.15s ease;
}
.dchat-input::placeholder, .dchat-textarea::placeholder { color: var(--color-ash); }
.dchat-input:focus, .dchat-textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--color-ember); }
.dchat-textarea { resize: vertical; min-height: 78px; line-height: 1.5; }
.dchat-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* chips type de demande */
.dchat-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.dchat-chip {
  border: 0; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 500;
  color: var(--color-graphite); background: var(--color-snow); box-shadow: inset 0 0 0 1px var(--color-fog);
  border-radius: var(--radius-pill); padding: 7px 13px; transition: all 0.15s ease;
}
.dchat-chip:hover { box-shadow: inset 0 0 0 1px var(--color-pebble); color: var(--color-obsidian); }
.dchat-chip.is-on { background: var(--color-obsidian); color: #fff; box-shadow: none; }

/* checkbox RGPD */
.dchat-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.dchat-check input { position: absolute; opacity: 0; pointer-events: none; }
.dchat-check__box {
  width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0; margin-top: 1px;
  box-shadow: inset 0 0 0 1.5px var(--color-pebble); background: var(--color-snow);
  display: grid; place-items: center; color: #fff; transition: all 0.15s;
}
.dchat-check__box svg { width: 12px; height: 12px; opacity: 0; }
.dchat-check input:checked + .dchat-check__box { background: var(--color-ember); box-shadow: none; }
.dchat-check input:checked + .dchat-check__box svg { opacity: 1; }
.dchat-check__txt { font-size: 12px; color: var(--color-steel); line-height: 1.45; }
.dchat-check__txt a { color: var(--color-obsidian); font-weight: 500; }

/* ============================================================
   7. Conversation — bulles & cartes
   ============================================================ */
.dchat-conv { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dchat-conv__head {
  background: var(--color-snow); padding: 13px 16px; display: flex; align-items: center; gap: 11px;
  border-bottom: 1px solid var(--color-fog); flex-shrink: 0;
}
.dchat-conv__head .dchat-avatars span { width: 34px; height: 34px; }
.dchat-conv__head-main { min-width: 0; }
.dchat-conv__head-name { font-size: 14.5px; font-weight: 600; color: var(--color-obsidian); line-height: 1.2; }
.dchat-conv__msgs { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--color-mist); }

.dchat-day { align-self: center; font-size: 11.5px; color: var(--color-steel); background: var(--color-fog); padding: 4px 12px; border-radius: var(--radius-pill); margin: 2px 0; }

.dchat-b {
  max-width: 82%; padding: 11px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.46;
}
.dchat-b--new { animation: dchat-msgin 0.22s ease both; }
@keyframes dchat-msgin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dchat-b--them { align-self: flex-start; background: var(--color-snow); color: var(--color-ink); border-bottom-left-radius: 5px; box-shadow: var(--shadow-md); }
.dchat-b--me { align-self: flex-end; background: var(--color-obsidian); color: #fff; border-bottom-right-radius: 5px; }
.dchat-b--bot { align-self: flex-start; background: var(--color-snow); color: var(--color-ink); border-bottom-left-radius: 5px; box-shadow: var(--shadow-md); }
.dchat-b a { color: inherit; }

.dchat-row { display: flex; flex-direction: column; max-width: 82%; }
.dchat-row--me { align-self: flex-end; align-items: flex-end; }
.dchat-row--them { align-self: flex-start; }
.dchat-row .dchat-b { max-width: 100%; }
.dchat-sender { font-size: 11px; font-weight: 600; color: var(--color-steel); margin: 0 6px 4px; }
.dchat-time { font-size: 10.5px; color: var(--color-ash); margin: 4px 6px 0; }
.dchat-receipt { display: flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--color-ash); margin: 4px 6px 0; }
.dchat-receipt svg { width: 13px; height: 13px; color: var(--c-success); }

/* avatar mini équipe devant une bulle them */
.dchat-bwrap { display: flex; gap: 8px; align-items: flex-end; max-width: 86%; align-self: flex-start; }
.dchat-bwrap__av { width: 26px; height: 26px; border-radius: 50%; background: var(--color-obsidian); color: #fff; display: grid; place-items: center; font-size: 10.5px; font-weight: 600; flex-shrink: 0; }

/* pièce jointe image dans une bulle */
.dchat-att {
  display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 12px;
  background: rgba(255,255,255,0.12); margin-top: 8px;
}
.dchat-b--me .dchat-att { background: rgba(255,255,255,0.12); }
.dchat-att__thumb { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; flex-shrink: 0; background: var(--color-graphite); display: grid; place-items: center; color: #fff; }
.dchat-att__thumb svg { width: 18px; height: 18px; }
.dchat-att__name { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.2; word-break: break-all; }
.dchat-att__meta { display: block; font-size: 11px; opacity: 0.7; font-family: var(--font-mono); margin-top: 2px; }

/* carte KB / page envoyée par l'équipe */
.dchat-link {
  display: block; margin-top: 8px; background: var(--color-mist); border-radius: 12px; overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--color-fog); cursor: pointer; text-decoration: none; transition: box-shadow 0.15s;
}
.dchat-link:hover { box-shadow: inset 0 0 0 1.5px var(--color-pebble); }
.dchat-link__img { height: 96px; background-size: cover; background-position: center; background-color: var(--color-fog); display: block; }
.dchat-link__body { padding: 11px 13px; }
.dchat-link__kicker { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-ember); font-family: var(--font-mono); }
.dchat-link__kicker svg { width: 13px; height: 13px; }
.dchat-link__title { font-size: 13.5px; font-weight: 600; color: var(--color-obsidian); margin-top: 4px; line-height: 1.3; }
.dchat-link__excerpt { font-size: 12px; color: var(--color-steel); margin-top: 3px; line-height: 1.4; }
.dchat-link__url { font-size: 11px; color: var(--color-ash); margin-top: 6px; font-family: var(--font-mono); display: flex; align-items: center; gap: 5px; }
.dchat-link__url svg { width: 12px; height: 12px; }

/* carte paiement (ember) */
.dchat-pay {
  margin-top: 8px; border-radius: 14px; padding: 15px 16px;
  background: linear-gradient(160deg, #0f9c6e, var(--color-ember)); color: #fff;
  box-shadow: 0 12px 26px -12px rgba(16,185,129,0.6);
}
.dchat-pay__kicker { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.85; font-family: var(--font-mono); }
.dchat-pay__row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 5px; }
.dchat-pay__label { font-size: 14px; font-weight: 600; }
.dchat-pay__amount { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-family: var(--font-mono); }
.dchat-pay__btn {
  display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; margin-top: 12px;
  background: #fff; color: var(--color-obsidian); border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 13.5px;
  padding: 11px; border-radius: var(--radius-pill);
}
.dchat-pay__btn svg { width: 15px; height: 15px; }
.dchat-pay__note { font-size: 10px; opacity: 0.8; margin-top: 8px; text-align: center; }

/* indicateur "écrit…" */
.dchat-typing { align-self: flex-start; background: var(--color-snow); box-shadow: var(--shadow-md); border-radius: 16px; border-bottom-left-radius: 5px; padding: 13px 15px; display: flex; gap: 4px; }
.dchat-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--color-ash); animation: dchat-typing 1.2s infinite; }
.dchat-typing span:nth-child(2) { animation-delay: 0.18s; }
.dchat-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes dchat-typing { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* Composer bas */
.dchat-compose { background: var(--color-snow); border-top: 1px solid var(--color-fog); padding: 11px 13px; flex-shrink: 0; }
.dchat-compose__row { display: flex; align-items: center; gap: 9px; }
.dchat-compose__input {
  flex: 1; border: 0; background: var(--color-mist); border-radius: var(--radius-pill);
  padding: 11px 16px; font: inherit; font-size: 13.5px; color: var(--color-ink); outline: none;
  box-shadow: inset 0 0 0 1px transparent; min-width: 0;
}
.dchat-compose__input:focus { box-shadow: inset 0 0 0 1.5px var(--color-pebble); }
.dchat-clip { background: none; border: 0; cursor: pointer; color: var(--color-steel); display: grid; place-items: center; padding: 7px; border-radius: 50%; flex-shrink: 0; }
.dchat-clip:hover { background: var(--color-mist); color: var(--color-obsidian); }
.dchat-clip svg { width: 19px; height: 19px; }
.dchat-send { width: 40px; height: 40px; border-radius: 50%; background: var(--color-obsidian); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.dchat-send svg { width: 17px; height: 17px; }
.dchat-compose__foot { font-size: 10.5px; color: var(--color-ash); margin: 8px 4px 0; display: flex; align-items: center; gap: 6px; }

/* sélecteur projet (espace authentifié) */
.dchat-projsel {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 12px;
  background: var(--color-mist); border-radius: 10px; font-size: 12.5px; color: var(--color-steel); cursor: pointer;
}
.dchat-projsel b { color: var(--color-obsidian); font-weight: 600; }
.dchat-projsel svg { width: 14px; height: 14px; margin-left: auto; color: var(--color-ash); }

/* ============================================================
   8. Pièces jointes (écran dédié)
   ============================================================ */
.dchat-drop {
  border: 2px dashed var(--color-pebble); border-radius: 16px; background: var(--color-snow);
  padding: 30px 20px; text-align: center; color: var(--color-steel); cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.dchat-drop:hover, .dchat-drop.is-over { border-color: var(--color-ember); background: rgba(16,185,129,0.03); }
.dchat-drop__ic { width: 44px; height: 44px; border-radius: 12px; background: var(--color-mist); color: var(--color-steel); display: grid; place-items: center; margin: 0 auto 12px; }
.dchat-drop__ic svg { width: 22px; height: 22px; }
.dchat-drop__t { font-size: 14px; font-weight: 600; color: var(--color-obsidian); }
.dchat-drop__s { font-size: 12px; margin-top: 4px; }
.dchat-drop__s b { font-family: var(--font-mono); color: var(--color-graphite); }

.dchat-file {
  display: flex; align-items: center; gap: 12px; background: var(--color-snow); border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--color-fog); padding: 11px 13px;
}
.dchat-file__ic { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; color: #fff; }
.dchat-file__ic--pdf { background: #c0392b; } .dchat-file__ic--img { background: var(--c-info); } .dchat-file__ic--doc { background: #2a6fdb; }
.dchat-file__ic svg { width: 17px; height: 17px; }
.dchat-file__main { flex: 1; min-width: 0; }
.dchat-file__name { font-size: 13px; font-weight: 600; color: var(--color-obsidian); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dchat-file__meta { font-size: 11px; color: var(--color-steel); font-family: var(--font-mono); margin-top: 3px; }
.dchat-file__bar { height: 4px; border-radius: var(--radius-pill); background: var(--color-fog); margin-top: 7px; overflow: hidden; }
.dchat-file__bar i { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--color-ember); }
.dchat-file__x { background: var(--color-mist); border: 0; cursor: pointer; width: 26px; height: 26px; border-radius: 50%; color: var(--color-steel); display: grid; place-items: center; flex-shrink: 0; }
.dchat-file__x:hover { color: var(--c-danger); }
.dchat-file--err { box-shadow: inset 0 0 0 1px var(--c-danger-line); background: var(--c-danger-bg); }
.dchat-file--err .dchat-file__ic { background: var(--c-danger); }
.dchat-fileerr { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--c-danger); margin-top: 4px; }
.dchat-fileerr svg { width: 13px; height: 13px; }

/* ============================================================
   9. CSAT
   ============================================================ */
.dchat-csat { text-align: center; }
.dchat-csat__ic { width: 48px; height: 48px; border-radius: 14px; background: var(--color-mist); color: var(--color-obsidian); display: grid; place-items: center; margin: 0 auto 14px; }
.dchat-csat__t { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: var(--color-obsidian); }
.dchat-csat__s { font-size: 13px; color: var(--color-steel); margin-top: 6px; line-height: 1.45; }
.dchat-stars { display: flex; justify-content: center; gap: 8px; margin: 18px 0; }
.dchat-star { background: none; border: 0; cursor: pointer; color: var(--color-pebble); display: grid; place-items: center; padding: 2px; transition: transform 0.12s, color 0.12s; }
.dchat-star svg { width: 32px; height: 32px; }
.dchat-star:hover { transform: scale(1.12); }
.dchat-star.is-on { color: var(--color-ember); }
.dchat-star.is-on svg { fill: currentColor; }

/* succès générique */
.dchat-done { text-align: center; padding: 30px 16px; }
.dchat-done__ic { width: 56px; height: 56px; border-radius: 50%; background: var(--c-success-bg); color: var(--c-success); display: grid; place-items: center; margin: 0 auto 16px; }
.dchat-done__ic svg { width: 26px; height: 26px; }
.dchat-done__t { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: var(--color-obsidian); }
.dchat-done__s { font-size: 13.5px; color: var(--color-steel); margin-top: 7px; line-height: 1.5; }

/* ============================================================
   10. Aide — catégories, recherche, article
   ============================================================ */
.dchat-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dchat-cat {
  background: var(--color-snow); border-radius: 14px; box-shadow: var(--shadow-md); padding: 15px 14px;
  cursor: pointer; text-decoration: none; transition: transform 0.15s, box-shadow 0.15s; display: block;
}
.dchat-cat:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -12px rgba(9,9,11,0.28); }
.dchat-cat__ic { width: 36px; height: 36px; border-radius: 10px; background: var(--color-mist); color: var(--color-obsidian); display: grid; place-items: center; margin-bottom: 10px; }
.dchat-cat__ic svg { width: 18px; height: 18px; }
.dchat-cat__t { font-size: 13.5px; font-weight: 600; color: var(--color-obsidian); line-height: 1.25; }
.dchat-cat__c { font-size: 11.5px; color: var(--color-steel); margin-top: 3px; font-family: var(--font-mono); }

.dchat-result { display: block; padding: 13px 4px; border-top: 1px solid var(--color-fog); cursor: pointer; text-decoration: none; }
.dchat-result:first-of-type { border-top: 0; }
.dchat-result:hover .dchat-result__t { color: var(--color-ember); }
.dchat-result__t { font-size: 14px; font-weight: 600; color: var(--color-obsidian); line-height: 1.3; }
.dchat-result__t mark, .dchat-mark { background: rgba(16,185,129,0.16); color: #0c8a5e; font-weight: 700; border-radius: 3px; padding: 0 1px; }
.dchat-result__snip { font-size: 12.5px; color: var(--color-steel); line-height: 1.5; margin-top: 5px; }
.dchat-result__cat { font-size: 11px; color: var(--color-ash); font-family: var(--font-mono); margin-top: 6px; display: inline-flex; align-items: center; gap: 5px; }
.dchat-result__cat svg { width: 12px; height: 12px; }
.dchat-resultcount { font-size: 12.5px; color: var(--color-steel); padding: 2px; }
.dchat-resultcount b { color: var(--color-obsidian); font-family: var(--font-mono); }

/* article rendu markdown */
.dchat-article { font-size: 14px; line-height: 1.62; color: var(--color-slate); }
.dchat-article h1 { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; color: var(--color-obsidian); margin: 0 0 6px; line-height: 1.2; }
.dchat-article h2 { font-size: 16px; font-weight: 700; color: var(--color-obsidian); margin: 22px 0 8px; }
.dchat-article p { margin: 0 0 13px; }
.dchat-article ul, .dchat-article ol { margin: 0 0 13px; padding-left: 20px; }
.dchat-article li { margin-bottom: 6px; }
.dchat-article li::marker { color: var(--color-ember); }
.dchat-article code { font-family: var(--font-mono); font-size: 12.5px; background: var(--color-mist); padding: 2px 6px; border-radius: 6px; color: var(--color-graphite); }
.dchat-article pre { background: var(--color-obsidian); color: #e4e4e7; border-radius: 12px; padding: 14px 16px; overflow-x: auto; margin: 0 0 14px; }
.dchat-article pre code { background: none; color: inherit; padding: 0; font-size: 12px; line-height: 1.6; }
.dchat-article blockquote { margin: 0 0 14px; padding: 10px 16px; border-left: 3px solid var(--color-ember); background: var(--color-mist); border-radius: 0 10px 10px 0; color: var(--color-graphite); font-size: 13.5px; }
.dchat-article img, .dchat-article .dchat-article__fig { width: 100%; border-radius: 12px; margin: 0 0 14px; display: block; background: var(--color-fog); }
.dchat-article__fig { height: 150px; display: grid; place-items: center; color: var(--color-ash); }
.dchat-article__meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--color-steel); margin-bottom: 18px; font-family: var(--font-mono); }
.dchat-article__meta span { display: inline-flex; align-items: center; gap: 5px; }
.dchat-article__meta svg { width: 13px; height: 13px; }

/* feedback article */
.dchat-feedback { background: var(--color-snow); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--color-fog); padding: 16px; text-align: center; margin-top: 18px; }
.dchat-feedback__t { font-size: 13.5px; font-weight: 600; color: var(--color-obsidian); }
.dchat-feedback__btns { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.dchat-feedback__b { display: inline-flex; align-items: center; gap: 7px; background: var(--color-mist); border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--color-graphite); padding: 9px 18px; border-radius: var(--radius-pill); transition: all 0.15s; }
.dchat-feedback__b:hover { box-shadow: inset 0 0 0 1.5px var(--color-pebble); }
.dchat-feedback__b.yes:hover { background: var(--c-success-bg); color: var(--c-success); box-shadow: none; }
.dchat-feedback__b.no:hover { background: var(--c-danger-bg); color: var(--c-danger); box-shadow: none; }
.dchat-feedback__b svg { width: 16px; height: 16px; }

/* barre retour (article / header secondaire) */
.dchat-back { background: var(--color-snow); padding: 12px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--color-fog); flex-shrink: 0; }
.dchat-back__btn { background: var(--color-mist); border: 0; cursor: pointer; width: 32px; height: 32px; border-radius: 9px; color: var(--color-graphite); display: grid; place-items: center; flex-shrink: 0; }
.dchat-back__btn:hover { color: var(--color-obsidian); }
.dchat-back__btn svg { width: 17px; height: 17px; }
.dchat-back__title { font-size: 14.5px; font-weight: 600; color: var(--color-obsidian); line-height: 1.25; min-width: 0; }

/* sticky bas (contact / pas trouvé) */
.dchat-sticky { background: var(--color-snow); border-top: 1px solid var(--color-fog); padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; }
.dchat-sticky__t { font-size: 12.5px; color: var(--color-steel); }
.dchat-sticky__t b { color: var(--color-obsidian); font-weight: 600; }

/* 293 B CGI mention */
.dchat-cgi { font-size: 9.5px; color: var(--color-ash); font-family: var(--font-mono); text-align: center; margin-top: 6px; }

/* ============================================================
   11. Responsive widget (mobile plein écran)
   ============================================================ */
@media (max-width: 480px) {
  .demo-stage { padding: 20px 12px 32px; }
  .demo-frame { width: 100%; height: 78vh; }
}
