/* Kechlab, widget du chatbot de vente. Mobile d'abord (plein écran), puis panneau flottant sur bureau.
   Aucun style en ligne : les couleurs de l'aperçu arrivent par des variables posées via le CSSOM. */

.sc-sr {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
html.sales-chat-lock, html.sales-chat-lock body { overflow: hidden; }

.sc-panel {
  --sc-ink: #0A0A0B;
  --sc-ivory: #F4EFE6;
  --sc-blue: #2B4BF2;
  --sc-blue-2: #8EA0FF;
  --sc-saffron: #F2B13A;
  --sc-terra: #D9653B;
  --sc-text: #F4EFE6;
  --sc-muted: rgba(244, 239, 230, .7);
  --sc-faint: rgba(244, 239, 230, .56);
  --sc-line: rgba(255, 255, 255, .12);
  --sc-ease: cubic-bezier(.2, .7, .2, 1);
  position: fixed; z-index: 90; inset: 0;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  color: var(--sc-text);
  background:
    radial-gradient(120% 70% at 100% 0%, rgba(43, 75, 242, .22), transparent 60%),
    radial-gradient(90% 60% at 0% 100%, rgba(242, 177, 58, .08), transparent 60%),
    rgba(12, 12, 15, .97);
  -webkit-backdrop-filter: blur(26px) saturate(150%); backdrop-filter: blur(26px) saturate(150%);
  font-family: var(--sans, 'Inter Tight', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
  font-size: 1rem; line-height: 1.45; letter-spacing: -.005em;
  opacity: 0; transform: translateY(18px);
  transition: opacity .3s var(--sc-ease), transform .4s var(--sc-ease);
  outline: none;
}
.sc-panel[hidden] { display: none; }
.sc-panel.is-open { opacity: 1; transform: none; }
.sc-panel *, .sc-panel *::before, .sc-panel *::after { box-sizing: border-box; }
.sc-panel :focus-visible { outline: 2px solid var(--sc-saffron); outline-offset: 2px; border-radius: 10px; }
.sc-panel a { color: inherit; }

/* ----- en-tête ----- */
.sc-head {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 12px 12px 16px;
  border-bottom: 1px solid var(--sc-line);
}
.sc-mark {
  position: relative; flex: none; width: 42px; height: 42px; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 130%, rgba(43, 75, 242, .95), rgba(43, 75, 242, .2) 62%), #15151a;
  border: 1px solid var(--sc-line);
}
.sc-mark::before {
  content: ''; position: absolute; left: 50%; bottom: 0; width: 18px; height: 22px; transform: translateX(-50%);
  border: 2px solid var(--sc-ivory); border-bottom: 0; border-radius: 10px 10px 0 0;
}
.sc-mark::after {
  content: ''; position: absolute; left: 50%; bottom: 6px; width: 6px; height: 6px; transform: translateX(-50%);
  border-radius: 50%; background: var(--sc-saffron);
}
.sc-titles { min-width: 0; flex: 1; }
.sc-title { margin: 0; font-weight: 800; font-size: 1.08rem; line-height: 1.1; letter-spacing: -.02em; }
.sc-title em {
  font-family: var(--serif, 'Instrument Serif', 'Iowan Old Style', Georgia, serif); font-style: italic; font-weight: 400;
  font-size: 1.28em; letter-spacing: -.01em;
}
.sc-sub { margin: 3px 0 0; display: flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--sc-muted); }
.sc-live { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #7BE0B0; box-shadow: 0 0 0 3px rgba(123, 224, 176, .18); }
.sc-close {
  flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%;
  border: 1px solid var(--sc-line); background: rgba(255, 255, 255, .06); color: var(--sc-text); cursor: pointer;
  transition: background .2s, transform .3s var(--sc-ease);
}
.sc-close:hover { background: rgba(255, 255, 255, .12); transform: rotate(90deg); }
.sc-i { width: 20px; height: 20px; flex: none; }

/* ----- conversation ----- */
.sc-log {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; scroll-padding-bottom: 12px;
}
.sc-log::before { content: ''; margin-top: auto; }
.sc-log:focus-visible { outline-offset: -3px; }
.sc-msg { display: flex; min-width: 0; }
.sc-msg--bot { justify-content: flex-start; }
.sc-msg--user { justify-content: flex-end; }
.sc-bubble {
  max-width: 88%; padding: 11px 15px; border-radius: 20px 20px 20px 6px; white-space: pre-wrap; overflow-wrap: anywhere;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1);
}
.sc-bubble:empty { display: none; }
.sc-msg--user .sc-bubble {
  max-width: 84%; border: 0; border-radius: 20px 20px 6px 20px; font-weight: 500;
  background: var(--sc-ivory); color: var(--sc-ink);
}
.sc-msg--card { width: 100%; }

.sc-typing .sc-bubble { display: inline-flex; align-items: center; gap: 5px; padding: 14px 16px; }
.sc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sc-muted); opacity: .6; }

@media (prefers-reduced-motion: no-preference) {
  .sc-msg { animation: sc-in .4s var(--sc-ease) both; }
  .sc-dot { animation: sc-bounce 1.1s ease-in-out infinite; }
  .sc-dot:nth-child(2) { animation-delay: .15s; }
  .sc-dot:nth-child(3) { animation-delay: .3s; }
}
@keyframes sc-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sc-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ----- puces ----- */
.sc-chips {
  flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 16px 10px; max-height: 46%; overflow-y: auto; overscroll-behavior: contain;
}
/* Liste de puces plus haute que sa zone : un fondu en bas dit qu'on peut faire défiler. */
.sc-chips.is-scroll { -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 22px), transparent); }
.sc-chips[hidden] { display: none; }
.sc-chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .07); color: var(--sc-text);
  font-family: inherit; font-weight: 600; font-size: .92rem; line-height: 1.1; text-align: left;
  transition: transform .3s var(--sc-ease), background .2s, border-color .2s, box-shadow .3s var(--sc-ease);
}
.sc-chip:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .34); }
.sc-chip:active { transform: translateY(0); }
.sc-chip.is-primary { background: var(--sc-ivory); color: var(--sc-ink); border-color: var(--sc-ivory); font-weight: 700; }
.sc-chip.is-primary:hover { background: #fff; box-shadow: 0 10px 28px -10px rgba(244, 239, 230, .55); }
.sc-chip.is-subtle { background: transparent; border-color: rgba(255, 255, 255, .12); color: var(--sc-muted); font-weight: 500; }
.sc-chip:disabled { opacity: .5; cursor: default; transform: none; }

/* ----- saisie ----- */
.sc-form { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px 6px; border-top: 1px solid var(--sc-line); }
.sc-panel.has-chips .sc-form { border-top-color: transparent; }
.sc-input {
  flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 0 18px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .07); color: var(--sc-text);
  font: inherit; font-size: 16px; letter-spacing: 0; appearance: none; -webkit-appearance: none;
}
.sc-input::placeholder { color: var(--sc-faint); opacity: 1; }
.sc-input:focus { border-color: var(--sc-saffron); outline: none; box-shadow: 0 0 0 3px rgba(242, 177, 58, .22); }
.sc-send {
  flex: none; display: inline-grid; place-items: center; width: 48px; height: 48px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 0; background: var(--sc-blue); color: #fff;
  transition: transform .3s var(--sc-ease), box-shadow .3s var(--sc-ease), opacity .2s;
}
.sc-send:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -8px rgba(43, 75, 242, .8); }
.sc-send:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.sc-foot { flex: none; margin: 0; padding: 2px 18px calc(10px + env(safe-area-inset-bottom)); font-size: .74rem; line-height: 1.35; color: var(--sc-faint); }
/* Zone de toucher de 44 px autour du lien, sans changer la mise en page. */
.sc-foot a { display: inline-block; padding: 14px 6px; margin: -14px -6px; color: var(--sc-muted); text-decoration: underline; text-underline-offset: 2px; }

/* ----- carte « votre démo est prête » ----- */
.sc-card {
  width: min(100%, 340px); border-radius: 24px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06);
  box-shadow: 0 24px 60px -28px rgba(0, 0, 0, .9), 0 0 0 1px rgba(43, 75, 242, .18);
}
.sc-card__view {
  position: relative; isolation: isolate; min-height: 150px; padding: 14px 16px 16px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  background: var(--sc-bg, #111114); color: var(--sc-tx, #F4EFE6);
}
.sc-card__view::before {
  content: ''; position: absolute; inset: 0; z-index: -2; opacity: .5;
  background: radial-gradient(90% 120% at 100% 0%, var(--sc-ac, #2B4BF2), transparent 62%);
}
.sc-card__view.has-image::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .72)), var(--sc-img) center / cover no-repeat;
}
.sc-card__view.has-image { color: #fff; }
.sc-card__badge {
  position: absolute; top: 12px; left: 12px; padding: 6px 11px; border-radius: 999px;
  background: rgba(0, 0, 0, .5); border: 1px solid rgba(255, 255, 255, .22); color: #fff;
  font-weight: 700; font-size: .68rem; line-height: 1; letter-spacing: .12em; text-transform: uppercase;
}
.sc-card__copy { display: flex; flex-direction: column; gap: 4px; margin-top: 30px; }
.sc-card__kicker { font-weight: 600; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.sc-card__line {
  font-weight: 800; font-size: 1.42rem; line-height: 1.02; letter-spacing: -.03em; text-transform: uppercase; text-wrap: balance;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.sc-card__cta { display: flex; gap: 8px; margin-top: 6px; }
.sc-card__pill { width: 88px; height: 26px; border-radius: 999px; background: var(--sc-ac, #2B4BF2); }
.sc-card__pill.is-ghost { width: 64px; background: transparent; border: 1.5px solid currentColor; opacity: .55; }
.sc-card__body { padding: 14px 14px 14px; }
.sc-card__name { margin: 0; font-weight: 800; font-size: 1.1rem; line-height: 1.15; letter-spacing: -.02em; overflow-wrap: anywhere; }
.sc-card__meta { margin: 4px 0 12px; font-size: .84rem; color: var(--sc-muted); }
.sc-card__actions { display: flex; flex-direction: column; gap: 8px; }
.sc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  font-family: inherit; font-weight: 700; font-size: .95rem; line-height: 1;
  transition: transform .3s var(--sc-ease), background .2s, box-shadow .3s var(--sc-ease), border-color .2s;
}
.sc-btn:hover { transform: translateY(-2px); }
.sc-btn--primary { background: var(--sc-ivory); color: var(--sc-ink) !important; }
.sc-btn--primary:hover { background: #fff; box-shadow: 0 12px 30px -10px rgba(244, 239, 230, .6); }
.sc-btn--ghost { background: rgba(255, 255, 255, .07); color: var(--sc-text); border-color: rgba(255, 255, 255, .2); }
.sc-btn--ghost:hover { background: rgba(255, 255, 255, .13); }
.sc-btn--ghost.is-done { border-color: #7BE0B0; color: #7BE0B0; }

/* ----- rappel noté ----- */
.sc-note {
  display: flex; align-items: center; gap: 12px; width: min(100%, 340px); padding: 14px 16px; border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06);
}
.sc-note__i { width: 36px; height: 36px; padding: 8px; border-radius: 50%; background: rgba(123, 224, 176, .16); color: #7BE0B0; }
.sc-note__t { min-width: 0; }
.sc-note__h { margin: 0; font-weight: 800; letter-spacing: -.01em; }
.sc-note__p { margin: 2px 0 0; font-size: .86rem; color: var(--sc-muted); overflow-wrap: anywhere; }

/* ----- exemples et liens ----- */
.sc-examples { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.sc-ex {
  display: flex; flex-direction: column; min-width: 0; border-radius: 18px; overflow: hidden; text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06);
  transition: transform .3s var(--sc-ease), border-color .2s;
}
.sc-ex:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, .3); }
.sc-ex__img {
  display: block; height: 62px;
  background: radial-gradient(90% 120% at 100% 0%, var(--sc-blue), transparent 62%), #15151a;
}
.sc-ex__img.has-image { background: linear-gradient(180deg, rgba(0, 0, 0, .05), rgba(0, 0, 0, .5)), var(--sc-img) center / cover no-repeat; }
.sc-ex__t { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px 11px; min-width: 0; }
.sc-ex__n { font-weight: 700; font-size: .86rem; line-height: 1.2; overflow-wrap: anywhere; }
.sc-ex__m { font-size: .74rem; color: var(--sc-muted); }
.sc-links { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .07); text-decoration: none;
  font-weight: 600; font-size: .9rem; transition: transform .3s var(--sc-ease), background .2s;
}
.sc-link:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .13); }

/* ----- bureau : panneau flottant en pilule de verre ----- */
@media (min-width: 641px) {
  .sc-panel {
    background:
      radial-gradient(120% 70% at 100% 0%, rgba(43, 75, 242, .22), transparent 60%),
      radial-gradient(90% 60% at 0% 100%, rgba(242, 177, 58, .08), transparent 60%),
      rgba(12, 12, 15, .93);
    inset: auto 24px 24px auto; width: 412px; height: min(720px, calc(100vh - 48px)); border-radius: 30px;
    border: 1px solid var(--sc-line);
    box-shadow: 0 50px 110px -30px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .04), 0 0 90px -30px rgba(43, 75, 242, .6);
    transform: translateY(20px) scale(.98); transform-origin: 100% 100%;
  }
  .sc-panel.is-open { transform: none; }
  .sc-head { padding-top: 12px; }
  .sc-foot { padding-bottom: 12px; }
  .sc-log { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
}

/* Petits écrans très étroits (320 px) : les cartes prennent toute la largeur. */
@media (max-width: 360px) {
  .sc-card, .sc-note { width: 100%; }
  .sc-card__line { font-size: 1.3rem; }
  .sc-examples { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .sc-panel, .sc-chip, .sc-btn, .sc-send, .sc-close, .sc-ex, .sc-link { transition: none; }
  .sc-panel { transform: none; }
  .sc-chip:hover, .sc-btn:hover, .sc-send:hover, .sc-ex:hover, .sc-link:hover, .sc-close:hover { transform: none; }
}

@media (forced-colors: active) {
  .sc-panel { border: 1px solid CanvasText; background: Canvas; }
  .sc-bubble, .sc-chip, .sc-input { border: 1px solid CanvasText; }
}
