/* Assistant Racing-WEST — widget de chat (bas droite). Aucune dépendance. */
.rw-chat { position: fixed; right: 20px; bottom: 20px; z-index: 99990; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: #15171a; }
.rw-chat *, .rw-chat *::before, .rw-chat *::after { box-sizing: border-box; }
.rw-chat__fab { display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 22px 0 18px; border: 0; border-radius: 999px; background: #ff6a13; color: #111; font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; box-shadow: 0 10px 28px rgba(255,106,19,.45), 0 2px 8px rgba(0,0,0,.25); transition: transform .15s, box-shadow .15s; }
.rw-chat__fab:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(255,106,19,.55), 0 2px 8px rgba(0,0,0,.25); }
.rw-chat__fab:focus-visible { outline: 3px solid #15171a; outline-offset: 3px; }
.rw-chat.is-open .rw-chat__fab { display: none; }
.rw-chat:not(.is-open) .rw-chat__fab { animation: rw-chat-pop .6s .8s backwards; }
@keyframes rw-chat-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

.rw-chat__panel { position: fixed; right: 20px; bottom: 20px; width: min(392px, calc(100vw - 24px)); height: min(640px, calc(100vh - 40px)); display: flex; flex-direction: column; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.35), 0 0 0 1px rgba(0,0,0,.06); animation: rw-chat-in .22s ease-out; }
.rw-chat__panel[hidden] { display: none; }
@keyframes rw-chat-in { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

.rw-chat__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; background: #15171a; color: #fff; border-bottom: 4px solid #ff6a13; }
.rw-chat__head strong { display: block; font-size: 1.05rem; font-style: italic; letter-spacing: .02em; }
.rw-chat__head small { display: flex; align-items: center; gap: 6px; color: #c9ccd0; font-size: .75rem; }
.rw-chat__head small i { width: 8px; height: 8px; border-radius: 50%; background: #2ee06b; box-shadow: 0 0 8px #2ee06b; }
.rw-chat__tools { display: flex; gap: 6px; }
.rw-chat__tools button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 1rem; cursor: pointer; }
.rw-chat__tools button:hover { background: #ff6a13; color: #111; }

.rw-chat__log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; background: #fafafa; scroll-behavior: smooth; }
.rw-chat__msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: .93rem; line-height: 1.5; word-wrap: break-word; animation: rw-chat-msg .25s ease-out; }
@keyframes rw-chat-msg { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.rw-chat__msg--b { align-self: flex-start; background: #f0f1f3; border-bottom-left-radius: 4px; }
.rw-chat__msg--u { align-self: flex-end; background: #ff6a13; color: #111; font-weight: 600; border-bottom-right-radius: 4px; }
.rw-chat__msg p { margin: 0 0 8px; } .rw-chat__msg p:last-child, .rw-chat__msg ul:last-child, .rw-chat__msg ol:last-child { margin-bottom: 0; }
.rw-chat__msg ul, .rw-chat__msg ol { margin: 4px 0 8px; padding-left: 1.25em; } .rw-chat__msg li { margin: 2px 0; }
.rw-chat__msg a { color: #c24d08; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.rw-chat__msg small { color: #5f646a; }
.rw-chat__sub { align-self: flex-start; color: #5f646a; font-size: .8rem; margin: -4px 4px 2px; }

.rw-chat__chips { display: flex; flex-wrap: wrap; gap: 7px; align-self: flex-start; max-width: 96%; }
.rw-chat__chip { padding: 7px 13px; border: 1.5px solid #ff6a13; border-radius: 999px; background: #fff; color: #15171a; font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; transition: background .15s; text-align: left; }
.rw-chat__chip:hover { background: #ff6a13; }
.rw-chat__fb { display: flex; gap: 6px; align-items: center; align-self: flex-start; margin: -2px 4px 0; color: #5f646a; font-size: .75rem; }
.rw-chat__fb button { border: 1px solid #d5d7da; background: #fff; border-radius: 999px; padding: 2px 9px; cursor: pointer; font-size: .85rem; }
.rw-chat__fb button:hover { border-color: #ff6a13; }

.rw-chat__typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: #f0f1f3; border-radius: 16px; border-bottom-left-radius: 4px; }
.rw-chat__typing i { width: 7px; height: 7px; border-radius: 50%; background: #9a9ea3; animation: rw-chat-dot 1s infinite ease-in-out; }
.rw-chat__typing i:nth-child(2) { animation-delay: .15s; } .rw-chat__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes rw-chat-dot { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }

.rw-chat__form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #e6e8ea; background: #fff; }
.rw-chat__form input { flex: 1; min-width: 0; height: 44px; padding: 0 16px; border: 2px solid #e1e3e6; border-radius: 999px; font: inherit; font-size: .95rem; color: #15171a; background: #fff; }
.rw-chat__form input:focus { outline: none; border-color: #ff6a13; box-shadow: 0 0 0 3px rgba(255,106,19,.2); }
.rw-chat__form button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: #ff6a13; color: #111; font-size: 1.1rem; cursor: pointer; }
.rw-chat__form button:hover { background: #15171a; color: #fff; }
.rw-chat__note { margin: 0; padding: 0 14px 10px; background: #fff; color: #8a8f95; font-size: .7rem; text-align: center; }

@media (max-width: 520px) {
  .rw-chat { right: 14px; bottom: 14px; }
  .rw-chat__fab span { display: none; } .rw-chat__fab { width: 56px; padding: 0; justify-content: center; }
  .rw-chat__panel { inset: 0; right: 0; bottom: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { .rw-chat *, .rw-chat__panel { animation: none !important; transition: none !important; } .rw-chat__log { scroll-behavior: auto; } }
@media print { .rw-chat { display: none; } }

/* Formulaire « transmettre ma question au bureau » */
.rw-chat__ask { display: grid; gap: 6px; margin: 8px 0 4px; padding: 10px; border: 1px solid #fed7aa; border-radius: 12px; background: #fff7ed; position: relative; }
.rw-chat__ask p { margin: 0; font-size: 13px; }
.rw-chat__ask input, .rw-chat__ask textarea { width: 100%; box-sizing: border-box; padding: 7px 9px; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; font-size: 13px; }
.rw-chat__ask button { justify-self: start; }
.rw-chat__err { font-size: 12px; color: #b91c1c; }
