.chat-widget{pointer-events:none;z-index:1000;font-family:Inter,system-ui,sans-serif;position:fixed;bottom:24px;right:24px}.chat-widget__button{pointer-events:auto;width:56px;height:56px;border-radius:50%;background:linear-gradient(135deg,#6366f1,#8b5cf6);border:none;box-shadow:0 4px 20px rgba(99,102,241,.4);color:white;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:transform .2s ease,box-shadow .2s ease;position:relative;overflow:hidden}.chat-widget__button img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover;border-radius:50%}.chat-widget__button:hover{transform:scale(1.05);box-shadow:0 6px 24px rgba(99,102,241,.5)}.chat-widget__button:active{transform:scale(.95)}.chat-widget__badge{position:absolute;top:-4px;right:-4px;background:#ef4444;color:white;font-size:12px;font-weight:600;min-width:20px;height:20px;border-radius:10px;display:flex;align-items:center;justify-content:center;padding:0 6px;box-shadow:0 2px 8px rgba(239,68,68,.4)}.chat-widget__window{position:absolute;bottom:72px;right:0;width:300px;max-width:calc(100vw - 16px);height:500px;max-height:calc(100vh - 120px);background:white;border-radius:16px;box-shadow:0 8px 40px rgba(0,0,0,.15);display:flex;flex-direction:column;overflow:hidden;opacity:0;transform:translateY(20px) scale(.95);pointer-events:none;transition:opacity .25s ease,transform .25s ease}.chat-widget__window--open{opacity:1;transform:translateY(0) scale(1);pointer-events:auto}.chat-widget__header{display:flex;align-items:center;justify-content:space-between;padding:16px;background:linear-gradient(135deg,#6366f1,#8b5cf6);color:white}.chat-widget__header-info{display:flex;align-items:center;gap:10px}.chat-widget__header-actions{display:flex;align-items:center;gap:8px}.chat-widget__clear{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;background:rgba(255,255,255,.15);color:white;border-radius:6px;cursor:pointer;transition:background .2s}.chat-widget__clear:hover{background:rgba(255,255,255,.25)}.chat-widget__clear-confirm-text{font-size:12px;white-space:nowrap}.chat-widget__clear-confirm-no,.chat-widget__clear-confirm-yes{padding:4px 8px;border:none;border-radius:4px;font-size:12px;font-weight:600;cursor:pointer;transition:opacity .2s}.chat-widget__clear-confirm-yes{background:#ef4444;color:white}.chat-widget__clear-confirm-yes:hover{background:#dc2626}.chat-widget__clear-confirm-no{background:rgba(255,255,255,.2);color:white}.chat-widget__clear-confirm-no:hover{background:rgba(255,255,255,.3)}.chat-widget__status-dot{width:10px;height:10px;border-radius:50%;background:#9ca3af}.chat-widget__status-dot[data-status=connected]{background:#22c55e}.chat-widget__status-dot[data-status=connecting]{background:#eab308;animation:pulse 1s infinite}.chat-widget__status-dot[data-status=disconnected]{background:#ef4444}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.chat-widget__title{font-weight:600;font-size:16px}.chat-widget__close{background:rgba(255,255,255,.2);border:none;border-radius:8px;padding:6px;cursor:pointer;color:white;display:flex;align-items:center;justify-content:center;transition:background .2s}.chat-widget__close:hover{background:rgba(255,255,255,.3)}.chat-widget__messages{flex:1;overflow-y:auto;overflow-x:hidden;padding:16px;display:flex;flex-direction:column;gap:12px;background:#f9fafb}.chat-widget__empty{text-align:center;padding:32px 16px;color:#6b7280}.chat-widget__empty p{margin:0 0 8px;font-size:14px;line-height:1.5}.chat-widget__empty-hint{font-size:12px!important;color:#9ca3af;font-style:italic}.chat-widget__message{display:flex;flex-direction:column;max-width:80%}.chat-widget__message--user{align-self:flex-end;align-items:flex-end}.chat-widget__message--ai{align-self:flex-start;align-items:flex-start}.chat-widget__message-bubble{padding:10px 14px;border-radius:16px;font-size:14px;line-height:1.4;word-wrap:break-word;overflow-x:auto;max-width:100%}.chat-widget__message--user .chat-widget__message-bubble{background:#6366f1;color:white;border-bottom-right-radius:4px}.chat-widget__message--ai .chat-widget__message-bubble{background:white;color:#1f2937;border:1px solid #e5e7eb;border-bottom-left-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.05)}.chat-widget__message-bubble p{margin:0 0 8px}.chat-widget__message-bubble p:last-child{margin-bottom:0}.chat-widget__message-bubble strong{font-weight:600}.chat-widget__message-bubble em{font-style:italic}.chat-widget__message-bubble code{background:#f3f4f6;padding:2px 6px;border-radius:4px;font-family:Fira Code,Consolas,monospace;font-size:13px}.chat-widget__message-bubble pre{background:#1f2937;color:#e5e7eb;padding:12px;border-radius:8px;overflow-x:auto;margin:8px 0}.chat-widget__message-bubble pre code{background:none;padding:0;color:inherit}.chat-widget__message-bubble ol,.chat-widget__message-bubble ul{margin:8px 0;padding-left:20px}.chat-widget__message-bubble li{margin:4px 0}.chat-widget__message-bubble blockquote{border-left:3px solid #6366f1;margin:8px 0;padding-left:12px;color:#6b7280}.chat-widget__message-bubble table{border-collapse:collapse;width:100%;margin:8px 0;font-size:13px;display:block;overflow-x:auto}.chat-widget__message-bubble td,.chat-widget__message-bubble th{border:1px solid #e5e7eb;padding:6px 8px;text-align:left}.chat-widget__message-bubble th{background:#f3f4f6;font-weight:600}.chat-widget__message-bubble .katex{overflow-x:auto;overflow-y:hidden}.chat-widget__message-bubble .katex-display{margin:8px 0;overflow-x:auto}.chat-widget__message-bubble td .katex,.chat-widget__message-bubble th .katex{display:inline-block}.chat-widget__message-time{font-size:11px;color:#9ca3af;margin-top:4px;padding:0 4px}.chat-widget__typing{display:flex;gap:4px;padding:12px 16px!important}.chat-widget__typing-dot{width:8px;height:8px;background:#9ca3af;border-radius:50%;animation:bounce 1.4s ease-in-out infinite}.chat-widget__typing-dot:first-child{animation-delay:0s}.chat-widget__typing-dot:nth-child(2){animation-delay:.2s}.chat-widget__typing-dot:nth-child(3){animation-delay:.4s}@keyframes bounce{0%,80%,to{transform:translateY(0)}40%{transform:translateY(-6px)}}.chat-widget__input-area{display:flex;gap:8px;padding:12px 16px;background:white;border-top:1px solid #e5e7eb}.chat-widget__input{flex:1;padding:10px 14px;border:1px solid #e5e7eb;border-radius:12px;font-size:14px;font-family:inherit;resize:none;max-height:100px;outline:none;transition:border-color .2s}.chat-widget__input:focus{border-color:#6366f1}.chat-widget__input::-moz-placeholder{color:#9ca3af}.chat-widget__input::placeholder{color:#9ca3af}.chat-widget__send{width:44px;height:44px;border-radius:12px;background:#6366f1;border:none;color:white;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .2s,transform .1s;flex-shrink:0}.chat-widget__send:hover:not(:disabled){background:#4f46e5}.chat-widget__send:active:not(:disabled){transform:scale(.95)}.chat-widget__send:disabled{background:#d1d5db;cursor:not-allowed}.chat-widget__save-btn{position:fixed;z-index:1100;width:40px;height:40px;background:linear-gradient(135deg,#f59e0b,#ea580c);color:white;border:none;border-radius:50%;box-shadow:0 4px 12px rgba(245,158,11,.4);display:flex;align-items:center;justify-content:center;font-size:18px;cursor:pointer;transition:transform .15s,box-shadow .15s}.chat-widget__save-btn:hover{transform:scale(1.1);box-shadow:0 6px 16px rgba(245,158,11,.5)}.chat-widget__save-btn:active{transform:scale(.95)}.chat-widget__sheet-overlay{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:1050}.chat-widget__sheet{position:fixed;bottom:0;left:0;right:0;background:white;border-radius:16px 16px 0 0;box-shadow:0 -4px 24px rgba(0,0,0,.15);z-index:1060;padding:20px;max-height:70vh;overflow-y:auto;display:flex;flex-direction:column;gap:12px}.chat-widget__sheet-header{display:flex;align-items:center;justify-content:space-between}.chat-widget__sheet-title{font-size:16px;font-weight:700;color:#1f2937;margin:0}.chat-widget__sheet-close{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;background:transparent;color:#9ca3af;border-radius:6px;cursor:pointer}.chat-widget__sheet-close:hover{background:#f3f4f6;color:#6b7280}.chat-widget__sheet-preview{background:#fffbeb;border:1px solid #fde68a;border-radius:12px;padding:12px}.chat-widget__sheet-preview-label{font-size:11px;font-weight:600;color:#b45309;margin:0 0 4px}.chat-widget__sheet-preview-text{font-size:13px;color:#1f2937;margin:0;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.chat-widget__sheet-field{display:flex;flex-direction:column;gap:4px}.chat-widget__sheet-label{font-size:12px;font-weight:500;color:#6b7280}.chat-widget__sheet-input,.chat-widget__sheet-select{width:100%;padding:10px 12px;border:1px solid #e5e7eb;border-radius:10px;font-size:14px;font-family:inherit;background:white;color:#1f2937;outline:none;transition:border-color .2s}.chat-widget__sheet-input:focus,.chat-widget__sheet-select:focus{border-color:#f59e0b;box-shadow:0 0 0 2px rgba(245,158,11,.2)}.chat-widget__sheet-save-btn{width:100%;padding:12px;background:linear-gradient(135deg,#f59e0b,#ea580c);color:white;font-size:15px;font-weight:700;border:none;border-radius:10px;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:6px;transition:opacity .2s,transform .1s}.chat-widget__sheet-save-btn:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 4px 12px rgba(245,158,11,.4)}.chat-widget__sheet-save-btn:active:not(:disabled){transform:scale(.98)}.chat-widget__sheet-save-btn:disabled{opacity:.5;cursor:not-allowed}.chat-widget__spinner{width:16px;height:16px;border:2px solid white;border-top-color:transparent;border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(1turn)}}@media (max-width:480px){.chat-widget{top:16px;bottom:16px;right:16px;left:16px}.chat-widget__window{position:fixed;top:0;right:0;bottom:0;left:0;width:100%;height:100%;max-height:100vh;border-radius:0;transform:none}.chat-widget__window:not(.chat-widget__window--open){opacity:0;pointer-events:none}.chat-widget__button{position:fixed;top:auto;bottom:24px;right:24px;width:52px;height:52px}.chat-widget__sheet{border-radius:16px 16px 0 0;max-height:80vh}}