/* AlphaAI chat widget */
.aiw { --aiw: #4f46e5; --aiw-bg: #fff; --aiw-fg: #111827; --aiw-mut: #6b7280; --aiw-line: #e5e7eb; --aiw-bot: #f3f4f6; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--aiw-fg); }
@media (prefers-color-scheme: dark) { .aiw { --aiw-bg: #111827; --aiw-fg: #f3f4f6; --aiw-mut: #9ca3af; --aiw-line: #374151; --aiw-bot: #1f2937; } }
#alphaai-widget { position: fixed; bottom: 22px; z-index: 99990; }
#alphaai-widget.is-right { right: 22px; }
#alphaai-widget.is-left { left: 22px; }
.aiw-launch { width: 58px; height: 58px; border: 0; border-radius: 50%; background: var(--aiw); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.25); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .15s; }
.aiw-launch:hover { transform: scale(1.06); }
.aiw-panel { position: absolute; bottom: 72px; width: 380px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 110px); background: var(--aiw-bg); border: 1px solid var(--aiw-line); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.28); display: none; flex-direction: column; overflow: hidden; }
#alphaai-widget.is-right .aiw-panel { right: 0; }
#alphaai-widget.is-left .aiw-panel { left: 0; }
.aiw-panel.is-open { display: flex; animation: aiw-in .18s ease-out; }
.aiw-panel.is-inline { position: static; width: 100%; max-width: none; height: 100%; max-height: none; box-shadow: none; animation: none; }
@keyframes aiw-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.aiw-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--aiw); color: #fff; }
.aiw-ava { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.aiw-ttl { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.aiw-ttl b { font-size: 15px; }
.aiw-ttl span { font-size: 11px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aiw-x { border: 0; background: transparent; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px; }
.aiw-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.aiw-m { display: flex; flex-direction: column; max-width: 88%; }
.aiw-m.is-user { align-self: flex-end; align-items: flex-end; }
.aiw-b { padding: 10px 13px; border-radius: 14px; background: var(--aiw-bot); font-size: 14px; }
.aiw-b p { margin: 0 0 6px; } .aiw-b p:last-child { margin: 0; }
.aiw-m.is-user .aiw-b { background: var(--aiw); color: #fff; border-bottom-right-radius: 4px; }
.aiw-m.is-bot .aiw-b { border-bottom-left-radius: 4px; }
.aiw-b.is-err { background: #fee2e2; color: #991b1b; }
.aiw-cite { color: var(--aiw); font-weight: 700; font-size: 10px; margin-left: 1px; }
.aiw-src { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--aiw-line); display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.aiw-src b { color: var(--aiw-mut); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.aiw-src a { color: var(--aiw); text-decoration: none; }
.aiw-src a:hover { text-decoration: underline; }
.aiw-fb { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11px; color: var(--aiw-mut); }
.aiw-fb button { border: 0; background: transparent; cursor: pointer; font-size: 14px; padding: 0 2px; opacity: .7; }
.aiw-fb button:hover { opacity: 1; }
.aiw-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.aiw-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--aiw-mut); animation: aiw-dot 1s infinite; }
.aiw-dots i:nth-child(2) { animation-delay: .15s; } .aiw-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes aiw-dot { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.aiw-foot { border-top: 1px solid var(--aiw-line); padding: 10px 12px; }
.aiw-ask { display: flex; gap: 8px; }
.aiw-in { flex: 1; min-width: 0; border: 1px solid var(--aiw-line); border-radius: 999px; padding: 9px 14px; font: inherit; font-size: 14px; background: var(--aiw-bg); color: var(--aiw-fg); outline: none; }
.aiw-in:focus { border-color: var(--aiw); box-shadow: 0 0 0 3px color-mix(in srgb, var(--aiw) 20%, transparent); }
.aiw-send { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--aiw); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; flex: none; }
.aiw-human { margin-top: 8px; border: 0; background: transparent; color: var(--aiw-mut); font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; padding: 0; }
.aiw-form { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--aiw-line); border-radius: 12px; min-width: 250px; }
.aiw-form input, .aiw-form textarea { border: 1px solid var(--aiw-line); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 13px; background: var(--aiw-bg); color: var(--aiw-fg); }
.aiw-go { border: 0; border-radius: 8px; background: var(--aiw); color: #fff; padding: 8px; font: inherit; font-size: 13px; cursor: pointer; }
.aiw-err { color: #991b1b; font-size: 12px; }
@media (max-width: 480px) { #alphaai-widget { bottom: 14px; } #alphaai-widget.is-right { right: 14px; } #alphaai-widget.is-left { left: 14px; } .aiw-panel { width: calc(100vw - 28px); height: calc(100vh - 100px); border-radius: 14px; } }
