
#lmnpe-chatbot-root{
  --lmnpe-navy:#0f3440;
  --lmnpe-navy-deep:#0b2a34;
  --lmnpe-teal:#008785;
  --lmnpe-teal-dark:#007371;
  --lmnpe-mint:#12be9b;
  --lmnpe-mint-soft:#e9f8f5;
  --lmnpe-blue:#006fcb;
  --lmnpe-text:#16313a;
  --lmnpe-muted:#61727a;
  --lmnpe-border:#dce9e7;
  --lmnpe-surface:#ffffff;
  --lmnpe-page:#f5faf9;

  position:fixed;
  right:18px;
  bottom:18px;
  z-index:999999;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:14px;
  color:var(--lmnpe-text);
}

/* IMPORTANT : un style display:flex ne doit jamais annuler l'attribut hidden. */
#lmnpe-chatbot-root [hidden]{
  display:none!important;
}

.lmnpe-launcher{
  width:48px;
  height:48px;
  border:1px solid rgba(255,255,255,.5);
  border-radius:15px;
  background:linear-gradient(145deg,var(--lmnpe-teal),var(--lmnpe-navy));
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 8px 24px rgba(15,52,64,.22);
  transition:transform .16s ease,box-shadow .16s ease,filter .16s ease;
}

.lmnpe-launcher:hover{
  transform:translateY(-2px);
  box-shadow:0 12px 30px rgba(15,52,64,.28);
  filter:saturate(1.08);
}

.lmnpe-launcher:focus-visible,
.lmnpe-close:focus-visible,
.lmnpe-send:focus-visible,
.lmnpe-form textarea:focus-visible{
  outline:2px solid var(--lmnpe-blue);
  outline-offset:2px;
}

.lmnpe-launcher-icon{
  display:flex;
  align-items:center;
  justify-content:center;
  line-height:1;
}

.lmnpe-panel{
  width:min(344px,calc(100vw - 24px));
  max-height:min(470px,calc(100vh - 28px));
  background:var(--lmnpe-surface);
  border:1px solid var(--lmnpe-border);
  border-radius:18px;
  overflow:hidden;
  box-shadow:0 18px 52px rgba(15,52,64,.18);
  opacity:0;
  transform:translateY(8px) scale(.988);
  transform-origin:bottom right;
  transition:opacity .16s ease,transform .16s ease;
}

.lmnpe-panel.is-open{
  opacity:1;
  transform:translateY(0) scale(1);
}

.lmnpe-header{
  min-height:56px;
  padding:9px 9px 9px 11px;
  display:flex;
  align-items:center;
  gap:8px;
  background:linear-gradient(120deg,var(--lmnpe-navy-deep),var(--lmnpe-navy));
  color:#fff;
  border-bottom:1px solid rgba(255,255,255,.08);
}

.lmnpe-title-wrap{
  flex:1;
  min-width:0;
  display:flex;
  align-items:center;
  gap:9px;
}

.lmnpe-avatar{
  width:30px;
  height:30px;
  flex:none;
  border-radius:9px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--lmnpe-mint);
  color:var(--lmnpe-navy-deep);
  font-size:10px;
  font-weight:800;
  letter-spacing:-.02em;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.25);
}

.lmnpe-title-text{
  min-width:0;
  display:flex;
  flex-direction:column;
  line-height:1.15;
}

.lmnpe-title-text strong{
  font-size:13.5px;
  font-weight:750;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.lmnpe-title-text span{
  margin-top:3px;
  font-size:10.5px;
  color:#cfe2e4;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.lmnpe-badge{
  flex:none;
  font-size:8.5px;
  font-weight:750;
  line-height:1;
  border:1px solid rgba(255,255,255,.24);
  padding:5px 6px;
  border-radius:999px;
  letter-spacing:.03em;
  color:#e7f3f3;
}

.lmnpe-close{
  width:30px;
  height:30px;
  flex:none;
  border:0;
  border-radius:8px;
  background:transparent;
  color:#d6e5e7;
  font-size:22px;
  line-height:1;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:background .15s ease,color .15s ease;
}

.lmnpe-close:hover{
  background:rgba(255,255,255,.09);
  color:#fff;
}

.lmnpe-messages{
  height:304px;
  max-height:calc(100vh - 154px);
  overflow:auto;
  padding:12px 11px 8px;
  background:
    linear-gradient(180deg,#f8fbfb 0%,#f4f9f8 100%);
  scrollbar-width:thin;
  scrollbar-color:#bdcfcd transparent;
}

.lmnpe-messages::-webkit-scrollbar{
  width:5px;
}

.lmnpe-messages::-webkit-scrollbar-thumb{
  background:#bdcfcd;
  border-radius:999px;
}

.lmnpe-msg{
  max-width:88%;
  padding:8px 10px;
  margin:0 0 8px;
  border-radius:13px;
  line-height:1.47;
  font-size:13.25px;
  overflow-wrap:anywhere;
}

.lmnpe-msg-bot{
  background:#fff;
  border:1px solid var(--lmnpe-border);
  border-bottom-left-radius:5px;
  box-shadow:0 1px 0 rgba(15,52,64,.025);
}

.lmnpe-msg-user{
  margin-left:auto;
  background:var(--lmnpe-teal);
  color:#fff;
  border:1px solid rgba(0,0,0,.03);
  border-bottom-right-radius:5px;
  white-space:pre-wrap;
}

.lmnpe-thinking{
  width:max-content;
  max-width:82%;
  display:flex;
  align-items:center;
  gap:7px;
  color:var(--lmnpe-muted);
  background:#fff;
  font-size:12.25px;
}

.lmnpe-thinking-text{
  white-space:nowrap;
}

.lmnpe-thinking-dots{
  display:inline-flex;
  align-items:center;
  gap:3px;
  height:12px;
}

.lmnpe-thinking-dots i{
  width:5px;
  height:5px;
  border-radius:50%;
  background:var(--lmnpe-teal);
  animation:lmnpe-dot 1s infinite ease-in-out;
}

.lmnpe-thinking-dots i:nth-child(2){animation-delay:.14s}
.lmnpe-thinking-dots i:nth-child(3){animation-delay:.28s}

@keyframes lmnpe-dot{
  0%,60%,100%{transform:translateY(0);opacity:.28}
  30%{transform:translateY(-3px);opacity:1}
}

.lmnpe-form{
  display:flex;
  gap:7px;
  align-items:flex-end;
  padding:8px 9px 9px;
  border-top:1px solid var(--lmnpe-border);
  background:#fff;
}

.lmnpe-input-wrap{
  flex:1;
  min-width:0;
  position:relative;
}

.lmnpe-form textarea{
  width:100%;
  box-sizing:border-box;
  min-height:40px;
  max-height:92px;
  resize:none;
  border:1px solid #cfdedc;
  border-radius:11px;
  padding:9px 10px 21px;
  font:inherit;
  font-size:13.25px;
  line-height:1.45;
  color:var(--lmnpe-text);
  background:#fff;
  transition:border-color .15s ease,box-shadow .15s ease;
}

.lmnpe-form textarea::placeholder{
  color:#89999e;
}

.lmnpe-form textarea:focus{
  border-color:#8cbfba;
  box-shadow:0 0 0 3px rgba(0,135,133,.09);
  outline:none;
}

.lmnpe-input-meta{
  position:absolute;
  right:9px;
  bottom:5px;
  pointer-events:none;
  line-height:1;
}

.lmnpe-char-counter{
  font-size:9.5px;
  color:#93a1a5;
  font-variant-numeric:tabular-nums;
  transition:color .15s ease;
}

.lmnpe-char-counter.is-near-limit{
  color:#b45309;
  font-weight:650;
}

.lmnpe-send{
  width:40px;
  height:40px;
  flex:none;
  border:0;
  border-radius:11px;
  background:var(--lmnpe-mint);
  color:var(--lmnpe-navy-deep);
  cursor:pointer;
  font-size:18px;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:transform .15s ease,background .15s ease,opacity .15s ease;
}

.lmnpe-send:hover{
  transform:translateY(-1px);
  background:#18c7a3;
}

.lmnpe-send:disabled{
  opacity:.45;
  cursor:default;
  transform:none;
}

/* Markdown */
.lmnpe-markdown p{
  display:block;
  margin:0 0 7px;
  padding:0;
}
.lmnpe-markdown p:last-child{margin-bottom:0}
.lmnpe-markdown strong{font-weight:700;color:#142b34}
.lmnpe-markdown em{font-style:italic}
.lmnpe-markdown ul{
  display:block;
  list-style-type:disc!important;
  list-style-position:outside!important;
  margin:6px 0 8px 17px!important;
  padding:0 0 0 5px!important;
}
.lmnpe-markdown ol{
  display:block;
  list-style-type:decimal!important;
  list-style-position:outside!important;
  margin:6px 0 8px 17px!important;
  padding:0 0 0 5px!important;
}
.lmnpe-markdown li{
  display:list-item!important;
  margin:3px 0!important;
  padding:0!important;
}
.lmnpe-markdown h3,
.lmnpe-markdown h4,
.lmnpe-markdown h5{
  display:block;
  margin:8px 0 5px;
  font-size:1em;
  font-weight:700;
  line-height:1.3;
  color:var(--lmnpe-navy);
}
.lmnpe-markdown code{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  background:#edf5f4;
  padding:1px 4px;
  border-radius:4px;
}
.lmnpe-markdown a{
  font-weight:650;
  color:var(--lmnpe-blue);
  text-decoration:underline;
  text-decoration-thickness:1px;
  text-underline-offset:2px;
  overflow-wrap:anywhere;
}
.lmnpe-markdown a:hover{
  color:#005aa6;
}
.lmnpe-markdown a:focus{
  outline:2px solid currentColor;
  outline-offset:2px;
}

@media (prefers-reduced-motion:reduce){
  .lmnpe-panel,
  .lmnpe-launcher,
  .lmnpe-send{
    transition:none!important;
  }
  .lmnpe-thinking-dots i{
    animation:none!important;
    opacity:.65;
  }
}

@media(max-width:600px){
  #lmnpe-chatbot-root{
    right:9px;
    bottom:9px;
  }

  .lmnpe-launcher{
    width:46px;
    height:46px;
    border-radius:14px;
  }

  .lmnpe-panel{
    width:calc(100vw - 18px);
    max-height:calc(100vh - 18px);
    border-radius:16px;
  }

  .lmnpe-messages{
    height:min(335px,calc(100vh - 150px));
    max-height:calc(100vh - 150px);
  }
}
