/* ============================================================
   PIXEL — le robot guide de Nimsea (bulle de discussion)
   ============================================================ */
.px-launch {
  position: fixed; right: 24px; bottom: 24px; z-index: 950;
  width: 64px; height: 64px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: radial-gradient(circle at 32% 28%, #3fe0d0, var(--teal, #00B5A5) 55%, var(--teal-d, #005E70));
  box-shadow: 0 16px 38px rgba(0, 94, 112, 0.38), inset 0 -6px 14px rgba(0, 0, 0, 0.18);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.35s var(--ease, ease), box-shadow 0.35s;
}
.px-launch:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 22px 48px rgba(0, 94, 112, 0.45), inset 0 -6px 14px rgba(0, 0, 0, 0.18); }
.px-launch:focus-visible { outline: 3px solid var(--ink, #0E1A2B); outline-offset: 4px; }
.px-launch::before { /* antenne */
  content: ''; position: absolute; top: -9px; left: 50%; width: 3px; height: 11px; margin-left: -1.5px;
  background: var(--navy, #0E1A2B); border-radius: 2px;
}
.px-launch::after { /* bout de l'antenne */
  content: ''; position: absolute; top: -14px; left: 50%; width: 9px; height: 9px; margin-left: -4.5px;
  border-radius: 50%; background: #3fe0d0; box-shadow: 0 0 10px #3fe0d0; animation: px-blink 2.4s infinite;
}
.px-launch.open::after { animation: none; }

/* visière + yeux (utilisés dans le bouton et dans l'en-tête) */
.px-face { width: 38px; height: 20px; border-radius: 10px; background: var(--navy, #0E1A2B);
  display: flex; align-items: center; justify-content: center; gap: 8px; }
.px-face i { width: 7px; height: 9px; border-radius: 4px; background: #7ff5ea; box-shadow: 0 0 8px #3fe0d0;
  animation: px-eyes 4.5s infinite; }
@keyframes px-eyes { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.15); } }
@keyframes px-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* petite bulle d'invitation */
.px-teaser {
  position: fixed; right: 24px; bottom: 102px; z-index: 950; max-width: 230px;
  background: #fff; color: var(--ink, #0E1A2B); border-radius: 18px 18px 4px 18px; padding: 11px 34px 11px 15px;
  font: 600 14px/1.35 var(--font-body, sans-serif); box-shadow: 0 14px 36px rgba(14, 26, 43, 0.18);
  opacity: 0; transform: translateY(8px) scale(0.96); pointer-events: none;
  transition: opacity 0.35s var(--ease, ease), transform 0.35s var(--ease, ease);
}
.px-teaser.show { opacity: 1; transform: none; pointer-events: auto; cursor: pointer; }
.px-teaser button { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: #f2efe8; color: #5b6472; font-size: 11px; cursor: pointer; line-height: 1; }

/* panneau de discussion */
.px-panel {
  position: fixed; right: 24px; bottom: 104px; z-index: 960;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 140px));
  background: #fff; border-radius: 26px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(14, 26, 43, 0.28), 0 0 0 1px rgba(14, 26, 43, 0.06);
  opacity: 0; transform: translateY(16px) scale(0.97); transform-origin: 100% 100%; pointer-events: none;
  transition: opacity 0.3s var(--ease, ease), transform 0.35s var(--ease, ease);
  font-family: var(--font-body, sans-serif); color: var(--ink, #0E1A2B);
}
.px-panel.open { opacity: 1; transform: none; pointer-events: auto; }
.px-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 18px;
  background: linear-gradient(135deg, var(--navy, #0E1A2B), #16304a); color: #fff;
}
.px-avatar { position: relative; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #3fe0d0, var(--teal, #00B5A5) 60%, var(--teal-d, #005E70));
  display: flex; align-items: center; justify-content: center; }
.px-avatar .px-face { width: 28px; height: 15px; gap: 6px; }
.px-avatar .px-face i { width: 5px; height: 7px; }
.px-title { flex: 1; min-width: 0; }
.px-title strong { display: block; font: 900 18px/1.1 var(--font-display, sans-serif); }
.px-title span { font-size: 12.5px; opacity: 0.75; }
.px-badge { font: 700 10px/1 var(--font-display, sans-serif); letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(255, 255, 255, 0.14); border-radius: 100px; padding: 5px 9px; margin-left: 6px; vertical-align: 2px; }
.px-close { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 15px; }
.px-close:hover { background: rgba(255, 255, 255, 0.24); }

.px-msgs { flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: #f6f4ef; scroll-behavior: smooth; }
.px-msg { display: flex; margin: 0 0 10px; animation: px-in 0.35s var(--ease, ease); }
@keyframes px-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.px-msg > div { max-width: 86%; padding: 10px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.45; }
.px-bot > div { background: #fff; border-bottom-left-radius: 5px; box-shadow: 0 2px 8px rgba(14, 26, 43, 0.06); }
.px-user { justify-content: flex-end; }
.px-user > div { background: var(--teal, #00B5A5); color: #fff; border-bottom-right-radius: 5px; }
.px-msg ul { margin: 8px 0 2px; padding: 0; list-style: none; }
.px-msg li { margin: 0 0 6px; }
.px-msg a { color: var(--teal-d, #005E70); font-weight: 700; text-decoration: none; }
.px-msg a:hover { text-decoration: underline; }
.px-msg small { display: block; color: #5b6472; font-size: 12.5px; }
.px-typing > div { display: inline-flex; gap: 4px; padding: 13px 16px; }
.px-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa4b2; animation: px-dot 1.1s infinite; }
.px-typing i:nth-child(2) { animation-delay: 0.15s; }
.px-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes px-dot { 0%, 60%, 100% { transform: none; opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

.px-chips { display: flex; flex-wrap: nowrap; gap: 6px; padding: 4px 14px 10px; background: #f6f4ef;
  overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.px-chips::-webkit-scrollbar { display: none; }
.px-chips button { flex: 0 0 auto; white-space: nowrap; }
.px-chips button { border: 1px solid rgba(0, 181, 165, 0.45); background: #fff; color: var(--teal-d, #005E70);
  border-radius: 100px; padding: 7px 12px; font: 600 13px/1.2 var(--font-body, sans-serif); cursor: pointer;
  transition: background 0.2s, color 0.2s; }
.px-chips button:hover { background: var(--teal, #00B5A5); color: #fff; }

.px-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #eee; background: #fff; }
.px-form input { flex: 1; min-width: 0; border: 2px solid #e4e0d6; border-radius: 100px; padding: 10px 16px;
  font: 15px var(--font-body, sans-serif); color: var(--ink, #0E1A2B); background: #fff; }
.px-form input:focus { outline: none; border-color: var(--teal, #00B5A5); }
.px-form button { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--teal, #00B5A5); color: #fff; font-size: 18px; }
.px-form button:hover { background: var(--teal-d, #005E70); }
.px-note { margin: 0; padding: 0 16px 10px; background: #fff; font-size: 11.5px; line-height: 1.4; color: #7a8290; }

/* le bouton « retour en haut » se place à gauche de Pixel, sur la même ligne :
   il reste visible et cliquable même quand la conversation est ouverte (elle s'ouvre au-dessus) */
.to-top { right: 100px !important; bottom: 30px !important; }

@media (max-width: 560px) {
  .px-launch { right: 16px; bottom: 16px; width: 58px; height: 58px; }
  .px-teaser { right: 16px; bottom: 90px; }
  .px-panel { right: 8px; left: 8px; width: auto; bottom: 92px; height: min(560px, calc(100vh - 116px)); border-radius: 22px; }
  .to-top { right: 86px !important; bottom: 19px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .px-launch::after, .px-face i, .px-typing i { animation: none; }
  .px-msg { animation: none; }
}
