/* assistant.css — the chat window (js/assistant.js). Self-contained: also used on the demo page. */
.sa {
  --sa-accent: #FF3D2E; --sa-ink: #101217; --sa-ink-2: #3B404C; --sa-muted: #687080; --sa-line: #E6E3DC;
  --sa-bg: #FBFAF7; --sa-surface: #fff; --sa-me: #101217; --sa-wa: #1FAF54;
  position: fixed; right: 18px; bottom: 18px; z-index: 95; width: 380px; height: min(620px, calc(100vh - 36px));
  display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; background: var(--sa-bg);
  border: 1px solid var(--sa-line); box-shadow: 0 30px 60px -20px rgba(16, 18, 23, 0.45);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--sa-ink); font-size: 15px; line-height: 1.5;
}
.sa[hidden] { display: none; }
.sa *, .sa *::before, .sa *::after { box-sizing: border-box; }
.sa--inline { position: relative; right: auto; bottom: auto; z-index: auto; width: 100%; height: 600px; box-shadow: 0 20px 40px -24px rgba(16, 18, 23, 0.35); }
.sa svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.sa__hd { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--sa-ink); color: #fff; flex: none; }
.sa__av { width: 38px; height: 38px; border-radius: 12px; background: var(--sa-accent); display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; flex: none; }
.sa__ttl { flex: 1; min-width: 0; }
.sa__ttl b { display: block; font-size: 0.98rem; line-height: 1.25; }
.sa__ttl small { display: block; font-size: 0.78rem; color: #A9AEBA; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa__wa, .sa__x { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; border: 0; background: rgba(255, 255, 255, 0.08); color: #fff; cursor: pointer; flex: none; text-decoration: none; }
.sa__wa { background: var(--sa-wa); }
.sa__wa:hover, .sa__x:hover { filter: brightness(1.15); }

.sa__log { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.sa__msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: 0.93rem; overflow-wrap: anywhere; }
.sa__msg p { margin: 0; }
.sa__msg p + p, .sa__msg ul + p, .sa__msg p + ul { margin-top: 6px; }
.sa__msg ul { margin: 4px 0 0; padding-left: 18px; }
.sa__msg li + li { margin-top: 3px; }
.sa__msg a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.sa__msg--bot { align-self: flex-start; background: var(--sa-surface); border: 1px solid var(--sa-line); border-bottom-left-radius: 6px; color: var(--sa-ink-2); }
.sa__msg--bot strong { color: var(--sa-ink); }
.sa__msg--me { align-self: flex-end; background: var(--sa-me); color: #fff; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.sa__cta { display: inline-flex; align-items: center; margin-top: 8px; padding: 7px 12px; border-radius: 999px; background: var(--sa-wa); color: #fff !important; text-decoration: none !important; font-weight: 700; font-size: 0.86rem; }
.sa__typing { display: flex; gap: 4px; padding: 13px 14px; }
.sa__typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--sa-muted); animation: sa-dot 1.2s infinite ease-in-out; }
.sa__typing i:nth-child(2) { animation-delay: 0.15s; }
.sa__typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes sa-dot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.sa__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; flex: none; }
.sa__chips[hidden] { display: none; }
.sa__chip { border: 1px solid var(--sa-line); background: var(--sa-surface); color: var(--sa-ink); border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.sa__chip:hover { border-color: var(--sa-ink); }

.sa__form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--sa-line); background: var(--sa-surface); flex: none; }
.sa__form textarea { flex: 1; resize: none; border: 1px solid var(--sa-line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 0.93rem; line-height: 1.4; color: var(--sa-ink); background: var(--sa-bg); max-height: 120px; outline: none; }
.sa__form textarea:focus { border-color: var(--sa-ink); }
.sa__send { width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--sa-accent); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.sa__send:disabled { opacity: 0.5; cursor: default; }
.sa__note { margin: 0; padding: 0 14px 10px; background: var(--sa-surface); font-size: 0.72rem; color: var(--sa-muted); line-height: 1.4; flex: none; }

@media (max-width: 560px) {
  .sa:not(.sa--inline) { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; }
  .sa-open { overflow: hidden; }
  .sa--inline { height: 540px; }
}
@media (prefers-reduced-motion: reduce) { .sa__typing i { animation: none; opacity: 0.6; } }
