:root{--ai4d-primary:#4f46e5;--ai4d-primary-dark:#4338ca;--ai4d-primary-light:#eef2ff;--ai4d-gradient:linear-gradient(135deg,#ad46ff,#2b7fff);--ai4d-gradient-dark:linear-gradient(135deg,#9533e8,#1a6ef0);--ai4d-bot-bg:#f1f5f9;--ai4d-user-bg:#4f46e5;--ai4d-user-text:#fff;--ai4d-bot-text:#1e293b;--ai4d-surface:#fff;--ai4d-border:#e2e8f0;--ai4d-muted:#94a3b8;--ai4d-drawer-w:420px;--ai4d-z-backdrop:99998;--ai4d-z-drawer:99999;--ai4d-z-tab:99997;--ai4d-transition:.32s cubic-bezier(.4,0,.2,1)}.ai4d-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}#ai4d-chatbot-root *,#ai4d-chatbot-root *::before,#ai4d-chatbot-root *::after{box-sizing:border-box}.ai4d-tab{position:fixed;right:0;top:42%;transform:translateY(-50%);z-index:var(--ai4d-z-tab);border-radius:14px 0 0 14px;border:none;padding:18px 11px;background:var(--ai4d-gradient);color:#fff;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:8px;box-shadow:-4px 0 18px rgba(79,70,229,.40);transition:transform var(--ai4d-transition) , opacity var(--ai4d-transition)}.ai4d-tab:hover{background:var(--ai4d-gradient-dark)}.ai4d-tab:focus-visible{outline:3px solid var(--ai4d-primary);outline-offset:3px}.ai4d-tab.is-open{transform:translateY(-50%) translateX(110%);opacity:0;pointer-events:none}.ai4d-tab__icon{width:32px;height:32px;flex-shrink:0}.ai4d-tab__label{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;line-height:1}.ai4d-backdrop{position:fixed;inset:0;z-index:var(--ai4d-z-backdrop);background:rgba(15,23,42,.45);backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);opacity:0;pointer-events:none;transition:opacity var(--ai4d-transition)}.ai4d-backdrop.is-open{opacity:1;pointer-events:auto}.ai4d-drawer{position:fixed;top:0;right:0;height:100vh;height:100dvh;width:var(--ai4d-drawer-w);max-width:100vw;z-index:var(--ai4d-z-drawer);background:var(--ai4d-surface);border-radius:16px 0 0 16px;box-shadow:-8px 0 40px rgba(0,0,0,.18) , -2px 0 8px rgba(0,0,0,.08);display:flex;flex-direction:column;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:14px;transform:translateX(100%);transition:transform var(--ai4d-transition)}.ai4d-drawer.is-open{transform:translateX(0)}.ai4d-drawer__header{flex-shrink:0;display:flex;align-items:center;justify-content:space-between;padding:16px 18px;background:var(--ai4d-gradient);color:#fff;border-radius:16px 0 0 0}.ai4d-drawer__header-info{display:flex;align-items:center;gap:12px}.ai4d-header-avatar{width:44px;height:44px;background:rgba(255,255,255,.18);border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;padding:6px}.ai4d-header-avatar svg{width:100%;height:100%}.ai4d-drawer__title{margin:0;font-weight:700;font-size:15px;line-height:1.2}.ai4d-drawer__subtitle{margin:3px 0 0;font-size:12px;opacity:.82;display:flex;align-items:center;gap:5px;line-height:1}.ai4d-online-dot{width:7px;height:7px;border-radius:50%;background:#4ade80;display:inline-block;box-shadow:0 0 0 2px rgba(74,222,128,.35);animation:ai4d-pulse-dot 2.5s ease-in-out infinite}.ai4d-drawer__header-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}.ai4d-drawer__close,.ai4d-drawer__archived,.ai4d-drawer__new-chat{width:34px;height:34px;border:none;background:rgba(255,255,255,.16);color:#fff;border-radius:10px;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:background .15s ease}.ai4d-drawer__close:hover,.ai4d-drawer__archived:hover,.ai4d-drawer__new-chat:hover{background:rgba(255,255,255,.28)}.ai4d-drawer__close:focus-visible,.ai4d-drawer__archived:focus-visible,.ai4d-drawer__new-chat:focus-visible{outline:2px solid rgba(255,255,255,.7);outline-offset:2px}.ai4d-drawer__archived.is-active{background:rgba(255,255,255,.34)}.ai4d-drawer__close svg,.ai4d-drawer__archived svg,.ai4d-drawer__new-chat svg{width:17px;height:17px;pointer-events:none}.ai4d-drawer__sessions{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;background:#fff}.ai4d-drawer__messages[hidden],.ai4d-drawer__sessions[hidden]{display:none}.ai4d-sessions__header{display:flex;align-items:center;gap:8px;padding:10px 14px;border-bottom:1px solid #e5e7eb;background:#f9fafb}.ai4d-sessions__back{display:inline-flex;align-items:center;gap:4px;background:transparent;border:1px solid #d1d5db;color:#374151;font-size:13px;padding:4px 8px;border-radius:6px;cursor:pointer;transition:background .15s ease , border-color .15s ease}.ai4d-sessions__back:hover{background:#f3f4f6;border-color:#9ca3af}.ai4d-sessions__back:focus-visible{outline:2px solid #4f46e5;outline-offset:1px}.ai4d-sessions__back svg{width:14px;height:14px}.ai4d-sessions__title{margin:0;font-size:13px;font-weight:600;color:#374151}.ai4d-sessions__list{flex:1 1 auto;overflow-y:auto;padding:8px}.ai4d-session-item{display:flex;flex-direction:row;align-items:stretch;width:100%;margin-bottom:6px;background:#fff;border:1px solid #e5e7eb;border-radius:8px;overflow:hidden;transition:background .15s ease , border-color .15s ease}.ai4d-session-item:hover{background:#f9fafb;border-color:#c7d2fe}.ai4d-session-item.is-current{border-color:#4f46e5}.ai4d-session-item__open{flex:1 1 auto;display:flex;flex-direction:column;gap:4px;min-width:0;padding:10px 12px;text-align:left;background:transparent;border:none;color:inherit;cursor:pointer;font:inherit}.ai4d-session-item__open:focus-visible{outline:2px solid #4f46e5;outline-offset:-2px}.ai4d-session-item__delete{flex:0 0 auto;width:36px;align-self:stretch;display:flex;align-items:center;justify-content:center;padding:0;background:transparent;border:none;border-left:1px solid #e5e7eb;color:#9ca3af;cursor:pointer;transition:background .15s ease , color .15s ease}.ai4d-session-item__delete:hover{background:#fef2f2;color:#b91c1c}.ai4d-session-item__delete:focus-visible{outline:2px solid #4f46e5;outline-offset:-2px}.ai4d-session-item__delete svg{width:16px;height:16px;pointer-events:none}.ai4d-session-item__preview{font-size:14px;color:#111827;line-height:1.35;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.ai4d-session-item__meta{font-size:12px;color:#6b7280}.ai4d-sessions__loading,.ai4d-sessions__empty,.ai4d-sessions__error{margin:16px 12px;font-size:13px;color:#6b7280;text-align:center}.ai4d-sessions__error{color:#b91c1c}.ai4d-drawer__messages{flex:1 1 auto;overflow-y:auto;padding:18px 16px;display:flex;flex-direction:column;gap:12px;background:#f8fafc;scroll-behavior:smooth}.ai4d-drawer__messages::-webkit-scrollbar{width:5px}.ai4d-drawer__messages::-webkit-scrollbar-track{background:transparent}.ai4d-drawer__messages::-webkit-scrollbar-thumb{background:var(--ai4d-border);border-radius:99px}.ai4d-message{display:flex;flex-direction:column;max-width:80%;animation:ai4d-slide-in .22s ease}.ai4d-message--user{align-self:flex-end;align-items:flex-end}.ai4d-message--bot{align-self:flex-start;align-items:flex-start}.ai4d-message--error{align-self:center;align-items:center}.ai4d-message__bubble{padding:10px 15px;border-radius:18px;word-break:break-word;white-space:pre-wrap;line-height:1.55;font-size:13.5px}.ai4d-message--user .ai4d-message__bubble{background:var(--ai4d-gradient);color:var(--ai4d-user-text);border-bottom-right-radius:4px}.ai4d-message--bot .ai4d-message__bubble{background:var(--ai4d-bot-bg);color:var(--ai4d-bot-text);border-bottom-left-radius:4px}.ai4d-message__bubble--rich{white-space:normal}.ai4d-message__bubble--rich>*:first-child{margin-top:0}.ai4d-message__bubble--rich>*:last-child{margin-bottom:0}.ai4d-message__bubble--rich p{margin:0 0 8px}.ai4d-message__bubble--rich ul,.ai4d-message__bubble--rich ol{margin:4px 0 8px;padding-left:20px}.ai4d-message__bubble--rich li{margin:2px 0}.ai4d-message__bubble--rich li>p{margin:0}.ai4d-message__bubble--rich h1,.ai4d-message__bubble--rich h2,.ai4d-message__bubble--rich h3,.ai4d-message__bubble--rich h4,.ai4d-message__bubble--rich h5,.ai4d-message__bubble--rich h6{margin:10px 0 6px;font-weight:600;line-height:1.3}.ai4d-message__bubble--rich h1{font-size:1.15em}.ai4d-message__bubble--rich h2{font-size:1.10em}.ai4d-message__bubble--rich h3{font-size:1.05em}.ai4d-message__bubble--rich h4,.ai4d-message__bubble--rich h5,.ai4d-message__bubble--rich h6{font-size:1em}.ai4d-message__bubble--rich strong{font-weight:700}.ai4d-message__bubble--rich em{font-style:italic}.ai4d-message__bubble--rich a{color:var(--ai4d-primary,#4f46e5);text-decoration:underline;word-break:break-word}.ai4d-message__bubble--rich a:hover{text-decoration:none}.ai4d-message__bubble--rich code{background:rgba(0,0,0,.06);border-radius:4px;padding:1px 5px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace;font-size:.92em}.ai4d-message__bubble--rich pre{background:rgba(0,0,0,.06);border-radius:8px;padding:10px 12px;margin:6px 0 8px;overflow-x:auto}.ai4d-message__bubble--rich pre code{background:transparent;padding:0;border-radius:0;font-size:.9em;line-height:1.5;white-space:pre}.ai4d-message__bubble--rich blockquote{border-left:3px solid var(--ai4d-border,#e2e8f0);margin:6px 0;padding:2px 10px;color:var(--ai4d-muted,#64748b)}.ai4d-message--error .ai4d-message__bubble{background:#fef2f2;color:#dc2626;border-radius:10px;font-size:12.5px;border:1px solid #fecaca}.ai4d-message__time{font-size:10.5px;color:var(--ai4d-muted);margin-top:3px;padding:0 2px}.ai4d-empty-notice{text-align:center;color:var(--ai4d-muted);font-size:13px;margin:auto;padding:24px 16px}.ai4d-loading-spinner{display:flex;align-items:center;justify-content:center;gap:5px;padding:40px 0;margin:auto}.ai4d-loading-spinner span{width:8px;height:8px;border-radius:50%;background:var(--ai4d-muted);animation:ai4d-bounce 1.2s ease-in-out infinite;display:block}.ai4d-loading-spinner span:nth-child(2) {animation-delay:.2s}.ai4d-loading-spinner span:nth-child(3) {animation-delay:.4s}.ai4d-typing{align-self:flex-start}.ai4d-typing .ai4d-message__bubble{background:var(--ai4d-bot-bg);border-bottom-left-radius:4px;padding:12px 16px;display:flex;align-items:center;gap:4px}.ai4d-typing .ai4d-dot{width:7px;height:7px;border-radius:50%;background:var(--ai4d-muted);animation:ai4d-bounce 1.2s ease-in-out infinite}.ai4d-typing .ai4d-dot:nth-child(2) {animation-delay:.2s}.ai4d-typing .ai4d-dot:nth-child(3) {animation-delay:.4s}.ai4d-drawer__footer{flex-shrink:0;padding:12px 14px;border-top:1px solid var(--ai4d-border);background:var(--ai4d-surface)}.ai4d-input-row{display:flex;gap:8px;align-items:center}.ai4d-input{flex:1 1 auto;border:1.5px solid var(--ai4d-border);border-radius:24px;padding:10px 16px;font-size:13.5px;font-family:inherit;color:var(--ai4d-bot-text);background:#f8fafc;outline:none;transition:border-color .18s ease , box-shadow .18s ease , background .18s ease;line-height:1.4}.ai4d-input::placeholder{color:var(--ai4d-muted)}.ai4d-input:focus{border-color:var(--ai4d-primary);background:var(--ai4d-surface);box-shadow:0 0 0 3px rgba(79,70,229,.12)}.ai4d-send-btn{width:40px;height:40px;border-radius:50%;border:none;background:var(--ai4d-gradient);color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:filter .15s ease , transform .15s ease}.ai4d-send-btn:hover{filter:brightness(.88);transform:scale(1.06)}.ai4d-send-btn:active{transform:scale(.95)}.ai4d-send-btn:disabled{background:var(--ai4d-border);cursor:not-allowed;transform:none}.ai4d-send-btn:focus-visible{outline:3px solid var(--ai4d-primary);outline-offset:3px}.ai4d-send-btn svg{width:17px;height:17px;pointer-events:none;transform:translateX(1px)}@keyframes ai4d-bounce {
	0%, 60%, 100% { transform: translateY(0); }
	30%           { transform: translateY(-5px); }
}@keyframes ai4d-slide-in {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}@keyframes ai4d-pulse-dot {
	0%, 100% { opacity: 1; }
	50%       { opacity: 0.5; }
}body.ai4d-no-scroll{overflow:hidden}@media (max-width:600px){:root{--ai4d-drawer-w:100vw}.ai4d-drawer{border-radius:0}.ai4d-drawer__header{border-radius:0}.ai4d-tab{top:55%}}