/* ===== Assistant IA ===== */
.aiw { --aiw-v: #5700c3; --aiw-deep: #1c0a3d; --aiw-cyan: #00fdff; font-size: 15px; }
.aiw-fab { position: fixed; right: 20px; bottom: 20px; z-index: 900; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 999px;
  padding: 14px 20px; background: var(--aiw-v); color: #fff; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 10px 30px rgba(43, 0, 102, .35); }
.aiw-fab:hover { background: #4600a0; }
.aiw-fab:focus-visible, .aiw button:focus-visible { outline: 3px solid var(--aiw-cyan); outline-offset: 2px; }
.aiw.is-open .aiw-fab span { display: none; }
.aiw-panel { position: fixed; right: 20px; bottom: 88px; z-index: 901; width: 380px; height: 600px; max-height: calc(100vh - 110px);
  display: flex; flex-direction: column; background: var(--surface, #fff); color: var(--text, #1c2230); border-radius: 18px; overflow: hidden;
  box-shadow: 0 18px 60px rgba(28, 10, 61, .35); border: 1px solid var(--border, #dfe3ea); }
.aiw-panel[hidden] { display: none; }
.aiw.is-embedded .aiw-panel { position: static; width: 100%; height: 100vh; max-height: none; border-radius: 0; border: 0; box-shadow: none; }
.aiw-body { margin: 0; background: var(--surface, #fff); }
.aiw-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--aiw-deep); color: #fff; }
.aiw-head img { border-radius: 10px; background: #fff; flex: none; }
.aiw-head div { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.aiw-head span { font-size: .8rem; color: #cfc6e8; display: flex; align-items: center; gap: 6px; }
.aiw-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; display: inline-block; }
.aiw-close { background: none; border: 0; color: #fff; font-size: 1.7rem; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 8px; min-width: 44px; min-height: 44px; }
.aiw-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg, #f5f6f8); }
.aiw-msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.aiw-msg p { margin: 0 0 .5em; } .aiw-msg p:last-child, .aiw-msg ul:last-child, .aiw-msg ol:last-child { margin-bottom: 0; }
.aiw-msg ul, .aiw-msg ol { margin: 0 0 .5em; padding-left: 1.2em; }
.aiw-msg a { color: inherit; text-decoration: underline; font-weight: 600; }
.aiw-msg.is-bot { align-self: flex-start; background: var(--surface, #fff); border: 1px solid var(--border, #dfe3ea); border-bottom-left-radius: 4px; }
.aiw-msg.is-bot a { color: var(--primary, #5700c3); }
.aiw-msg.is-user { align-self: flex-end; background: var(--aiw-v); color: #fff; border-bottom-right-radius: 4px; }
.aiw-msg.is-error { color: var(--ko, #c2410c); }
.aiw-msg.is-typing { display: flex; gap: 5px; padding: 14px; }
.aiw-msg.is-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted, #5d6677); animation: aiw-b 1s infinite ease-in-out; }
.aiw-msg.is-typing span:nth-child(2) { animation-delay: .15s; } .aiw-msg.is-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes aiw-b { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .aiw-msg.is-typing span { animation: none; } }
.aiw-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; background: var(--bg, #f5f6f8); }
.aiw-chips[hidden] { display: none; }
.aiw-chip { border: 1px solid var(--aiw-v); color: var(--primary, #5700c3); background: var(--surface, #fff); border-radius: 999px; padding: 8px 12px; font: inherit; font-size: .86rem; cursor: pointer; min-height: 36px; }
.aiw-chip:hover { background: var(--primary-soft, #f1e8ff); }
.aiw-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--border, #dfe3ea); background: var(--surface, #fff); }
.aiw-form[hidden], .aiw-lead[hidden] { display: none; }
.aiw-form textarea { flex: 1; margin: 0; resize: none; min-height: 44px; max-height: 120px; padding: 11px 12px; border-radius: 12px; font: inherit; }
.aiw-send { flex: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--aiw-v); color: #fff; display: grid; place-items: center; cursor: pointer; }
.aiw-lead { display: grid; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border, #dfe3ea); background: var(--surface, #fff); }
.aiw-lead label { font-size: .85rem; margin: 0; } .aiw-lead label span { font-weight: 400; color: var(--muted, #5d6677); }
.aiw-lead input, .aiw-lead textarea { margin: 4px 0 0; padding: 9px 10px; font: inherit; }
.aiw-lead-actions { display: flex; gap: 12px; align-items: center; }
.aiw-btn { border: 0; border-radius: 10px; background: var(--aiw-v); color: #fff; font: inherit; font-weight: 700; padding: 10px 16px; cursor: pointer; min-height: 44px; }
.aiw-btn[disabled] { opacity: .6; }
.aiw-cta { align-self: flex-start; }
.aiw-link { background: none; border: 0; padding: 4px 0; color: var(--primary, #5700c3); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; min-height: 32px; }
.aiw-foot { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 6px 14px 10px; font-size: .74rem; color: var(--muted, #5d6677); background: var(--surface, #fff); }
.aiw-foot .aiw-link { font-size: .8rem; white-space: nowrap; }
.aiw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 520px) {
  .aiw-panel { right: 0; left: 0; bottom: 0; width: 100%; height: 100%; max-height: none; border-radius: 0; z-index: 1001; }
  .aiw.is-open .aiw-fab { display: none; }
  .aiw-fab { right: 14px; bottom: 14px; padding: 13px 16px; }
}
