/* BOTWOW — assistant TEKWOW. Discret : un petit bouton en bas à droite, un panneau seulement si on l'ouvre.
   Jetons propres (--bw-*) pour avoir le même rendu sur le site et sur les pages de réparation. */
.bw {
  --bw-blue: #0071e3; --bw-blue-soft: rgba(0, 113, 227, .09); --bw-blue-text: #0066cc;
  --bw-bg: #ffffff; --bw-glass: rgba(255, 255, 255, .86); --bw-soft: #f2f2f5; --bw-text: #1d1d1f; --bw-text-2: #6e6e73;
  --bw-line: rgba(0, 0, 0, .09); --bw-shadow: 0 18px 50px rgba(0, 0, 0, .16), 0 2px 8px rgba(0, 0, 0, .06);
  --bw-launch-shadow: 0 4px 14px rgba(0, 0, 0, .10), 0 1px 3px rgba(0, 0, 0, .06);
  --bw-lift: 0px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; color: var(--bw-text);
}
:root:not([data-theme="light"]) .bw {
    --bw-blue: #0a84ff; --bw-blue-soft: rgba(10, 132, 255, .16); --bw-blue-text: #4da3ff;
    --bw-bg: #1c1c1e; --bw-glass: rgba(44, 44, 46, .82); --bw-soft: #2c2c2e; --bw-text: #f5f5f7; --bw-text-2: #a1a1a6;
    --bw-line: rgba(255, 255, 255, .12); --bw-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .3);
    --bw-launch-shadow: 0 4px 14px rgba(0, 0, 0, .45);
  }
.bw *, .bw *::before, .bw *::after { box-sizing: border-box; }

/* Bouton d'ouverture : petite pastille, verre dépoli, ampoule bleue. */
.bw-launch {
  position: fixed; z-index: 30; right: 20px; bottom: calc(20px + var(--bw-lift) + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 15px 0 12px; border-radius: 20px;
  border: 1px solid var(--bw-line); background: var(--bw-glass); color: var(--bw-text);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--bw-launch-shadow); font-family: inherit; font-size: 13.5px; font-weight: 600; line-height: 1; letter-spacing: -.01em; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease, bottom .2s ease;
}
.bw-launch:hover { transform: translateY(-1px); }
.bw-launch:focus-visible, .bw button:focus-visible, .bw a:focus-visible { outline: 2px solid var(--bw-blue); outline-offset: 2px; }
.bw-input:focus { outline: none; border-color: var(--bw-blue); box-shadow: 0 0 0 3px var(--bw-blue-soft); }
.bw-launch[aria-expanded="true"] { opacity: 0; pointer-events: none; }
.bw-bulb { display: block; width: 13px; height: 19px; flex: none; background: var(--bw-blue);
  -webkit-mask: url("/assets/img/tekwow-ampoule.png") center / contain no-repeat; mask: url("/assets/img/tekwow-ampoule.png") center / contain no-repeat; }

/* Panneau */
.bw-panel {
  position: fixed; z-index: 45; right: 20px; bottom: calc(20px + var(--bw-lift) + env(safe-area-inset-bottom, 0px));
  width: 380px; height: min(600px, calc(100vh - 110px - var(--bw-lift))); height: min(600px, calc(100dvh - 110px - var(--bw-lift)));
  display: flex; flex-direction: column; overflow: hidden; border-radius: 20px;
  background: var(--bw-bg); border: 1px solid var(--bw-line); box-shadow: var(--bw-shadow);
  transform-origin: bottom right; animation: bw-in .18s ease-out;
}
.bw-panel[hidden] { display: none; }
@keyframes bw-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { .bw-panel { animation: none; } .bw-launch { transition: none; } }

.bw-head { display: flex; align-items: center; gap: 11px; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--bw-line); }
.bw-head .bw-bulb { width: 15px; height: 22px; }
.bw-title { flex: 1; min-width: 0; }
.bw-name { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.bw-sub { margin-top: 2px; font-size: 12px; color: var(--bw-text-2); }
.bw-x { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--bw-soft); color: var(--bw-text-2); cursor: pointer; }
.bw-x:hover { color: var(--bw-text); }
.bw-x svg { width: 11px; height: 11px; }

.bw-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.bw-msg { max-width: 88%; padding: 9px 13px; border-radius: 17px; font-size: 14.5px; line-height: 1.42; overflow-wrap: anywhere; }
.bw-msg.bot { align-self: flex-start; background: var(--bw-soft); border-bottom-left-radius: 6px; }
.bw-msg.me { align-self: flex-end; background: var(--bw-blue); color: #fff; border-bottom-right-radius: 6px; }
.bw-msg b { font-weight: 650; }
.bw-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -2px; }
.bw-act { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 6px 12px; border: 0; border-radius: 980px;
  background: var(--bw-blue-soft); color: var(--bw-blue-text); font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; }
.bw-act:hover { text-decoration: none; filter: brightness(.97); }
.bw-act.primary { background: var(--bw-blue); color: #fff; }
.bw-act.primary::after { content: "›"; font-size: 15px; line-height: 1; margin-left: 1px; }
.bw-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 17px; border-bottom-left-radius: 6px; background: var(--bw-soft); }
.bw-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--bw-text-2); opacity: .5; animation: bw-dot 1s infinite ease-in-out; }
.bw-typing i:nth-child(2) { animation-delay: .15s; } .bw-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bw-dot { 50% { opacity: 1; transform: translateY(-2px); } }

.bw-form { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px; border-top: 1px solid var(--bw-line); }
.bw-input { flex: 1; min-width: 0; height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 19px; background: var(--bw-soft);
  color: var(--bw-text); font-family: inherit; font-size: 15px; }
.bw-input::placeholder { color: var(--bw-text-2); }
.bw-send { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--bw-blue); color: #fff; cursor: pointer; }
.bw-send:disabled { opacity: .35; cursor: default; }
.bw-send svg { width: 15px; height: 15px; }
.bw-note { padding: 0 16px 10px; font-size: 11px; line-height: 1.35; color: var(--bw-text-2); text-align: center; }

/* Téléphone : pastille ronde (ampoule seule), panneau en feuille du bas. */
@media (max-width: 560px) {
  .bw-launch { right: 14px; width: 42px; height: 42px; padding: 0; justify-content: center; border-radius: 50%; }
  .bw-launch .bw-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .bw-panel { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); width: auto; height: min(640px, calc(100vh - 70px)); height: min(640px, calc(100dvh - 70px)); border-radius: 20px; }
  .bw-input { font-size: 16px; }   /* pas de zoom automatique sur iPhone */
}
@media print { .bw { display: none; } }
