@import url(https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap);*{font-family:'Inter',sans-serif}.chat-bubble-plugin{position:fixed;bottom:20px;right:20px;display:block!important;visibility:visible!important;z-index:999999!important}.chat-toggle{width:60px;height:60px;border-radius:50%;background:linear-gradient(135deg,#000000 0%,#00aa2e 100%);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 4px 20px rgba(0,170,46,.4);transition:all 0.3s ease}.chat-toggle:hover{transform:scale(1.1);box-shadow:0 6px 25px rgba(0,170,46,.6)}.chat-window{position:absolute;bottom:80px;right:0;width:380px;height:600px;background:#fff;border-radius:20px;box-shadow:0 20px 60px rgba(0,0,0,.15);display:none;flex-direction:column;overflow:hidden;transform:translateY(20px);opacity:0;transition:all 0.3s ease}.chat-window.active{display:flex;transform:translateY(0);opacity:1}.chat-header{background:linear-gradient(135deg,#000000 0%,#00aa2e 100%);color:#fff;padding:20px;position:relative}.header-actions{position:absolute;top:12px;right:12px;display:flex;gap:8px;align-items:center}.header-btn{width:32px;height:32px;border-radius:50%;background:rgba(255,255,255,.2);border:none;color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:14px;transition:all 0.2s ease}.header-btn:hover{background:rgba(255,255,255,.3)}.provider-selector{margin-top:8px}.provider-select{background:rgba(255,255,255,.2);border:none;color:#fff;padding:4px 8px;border-radius:6px;font-size:12px;cursor:pointer;margin-right:8px}.provider-select option{color:#374151}.model-selector{margin-top:8px}.model-select{width:100%;background:rgba(255,255,255,.2);border:none;color:#fff;padding:4px 8px;border-radius:6px;font-size:11px;cursor:pointer}.model-select option{color:#374151}.chat-messages{flex:1;overflow-y:auto;padding:20px;background:#f8fafc}.message{margin-bottom:16px;animation:fadeInUp 0.3s ease;display:flex;gap:12px;position:relative}.message.user{justify-content:flex-end}.message.bot{justify-content:flex-start;align-items:flex-start}.message-content{max-width:85%;padding:12px 16px;border-radius:20px;word-wrap:break-word;position:relative}.message.user .message-content{background:linear-gradient(135deg,#000000 0%,#00aa2e 100%);color:#fff;border-bottom-right-radius:6px}.message.bot .message-content{background:#fff;color:#374151;border-bottom-left-radius:6px;box-shadow:0 2px 10px rgba(0,0,0,.1)}.copy-btn{position:absolute;top:8px;right:8px;width:24px;height:24px;border:none;background:rgba(0,0,0,.05);border-radius:4px;cursor:pointer;display:none;align-items:center;justify-content:center;font-size:12px;color:#64748b;transition:all 0.2s ease}.message:hover .copy-btn{display:flex}.copy-btn:hover{background:rgba(0,0,0,.1);color:#374151}.copy-btn.copied{color:#10b981;background:rgba(16,185,129,.1)}.copy-notification{position:fixed;top:20px;right:20px;background:#10b981;color:#fff;padding:8px 16px;border-radius:8px;font-size:14px;font-weight:500;z-index:1000000;transform:translateX(100%);transition:transform 0.3s ease}.copy-notification.show{transform:translateX(0)}.message-media{margin-top:8px;display:flex;flex-wrap:wrap;gap:8px}.media-item{position:relative;max-width:120px;border-radius:8px;overflow:hidden}.media-image{width:100%;height:80px;object-fit:cover;cursor:pointer}.media-file{padding:8px;background:#f1f5f9;border:1px solid #e2e8f0;border-radius:6px;display:flex;align-items:center;gap:6px;font-size:11px;color:#64748b;max-width:120px}.avatar{width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,#000000 0%,#00aa2e 100%);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:600;font-size:14px;flex-shrink:0}.chat-input-area{padding:20px;background:#fff;border-top:1px solid #e2e8f0}.input-container{display:flex;align-items:center;background:#f1f5f9;border-radius:25px;padding:2px}.input-actions{display:flex;align-items:center;gap:6px}.chat-bubble-plugin input[type="text"].chat-input{all:unset;box-sizing:border-box;width:100%;font-size:14px;padding:8px 12px;border:none!important;;outline:none;background:transparent!important;}.chat-input{flex:1!important;border:none!important;outline:none!important;background:transparent!important;padding:8px 12px!important;font-size:14px!important;resize:none!important;max-height:100px!important}.input-actions{display:flex;gap:8px}.action-btn{width:36px;height:36px;border-radius:50%;border:none;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all 0.2s ease;position:relative}.send-btn{background:linear-gradient(135deg,#000000 0%,#00aa2e 100%);color:#fff}.send-btn:hover{transform:scale(1.1)}.send-btn:disabled{background:#cbd5e1;cursor:not-allowed;transform:none}.upload-btn,.image-btn{background:#e2e8f0;color:#64748b}.upload-btn:hover,.image-btn:hover{background:#cbd5e1}.status{text-align:center;padding:8px;font-size:12px;color:#64748b;background:#f8fafc}.status.connected{color:#10b981}.status.error{color:#ef4444}.status.connecting{color:#f59e0b}.file-preview{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}.file-container{position:relative;display:inline-block;background:#f1f5f9;border:2px solid #e2e8f0;border-radius:8px;padding:8px;min-width:80px;max-width:120px}.file-image{width:60px;height:60px;border-radius:6px;object-fit:cover;display:block;margin:0 auto 4px}.file-icon{width:60px;height:60px;border-radius:6px;background:#000;color:#fff;display:flex;align-items:center;justify-content:center;font-size:24px;margin:0 auto 4px}.file-name{font-size:10px;color:#64748b;text-align:center;word-break:break-all;line-height:1.2;max-height:24px;overflow:hidden}.remove-file{position:absolute;top:-6px;right:-6px;width:20px;height:20px;border-radius:50%;background:#ef4444;color:#fff;border:none;cursor:pointer;font-size:12px;display:flex;align-items:center;justify-content:center;z-index:10}.remove-file:hover{background:#dc2626}.file-count{position:absolute;top:-2px;right:-2px;background:#ef4444;color:#fff;border-radius:50%;width:16px;height:16px;font-size:10px;display:flex;align-items:center;justify-content:center;font-weight:600}.log-message{font-size:11px;text-align:center;margin:8px 0;padding:4px 8px;border-radius:12px}.log-info{background:#dbeafe;color:#1d4ed8}.log-success{background:#dcfce7;color:#166534}.log-error{background:#fee2e2;color:#dc2626}.log-warning{background:#fef3c7;color:#d97706}.history-modal{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.5);display:none;align-items:center;justify-content:center;z-index:2000000!important}.history-modal.active{display:flex}.history-content{background:#fff;width:90%;max-width:500px;max-height:80%;border-radius:16px;display:flex;flex-direction:column;overflow:hidden;position:relative}.history-header{background:linear-gradient(135deg,#000000 0%,#00aa2e 100%);color:#fff;padding:20px;display:flex;justify-content:space-between;align-items:center}.history-list{flex:1;overflow-y:auto;padding:20px}.history-item{padding:12px;border:1px solid #e2e8f0;border-radius:8px;margin-bottom:8px;cursor:pointer;transition:all 0.2s ease;display:flex;justify-content:space-between;align-items:center}.history-item:hover{background:#f8fafc;border-color:#000}.history-item-info{flex:1}.history-item-title{font-weight:600;font-size:14px;color:#374151;margin-bottom:4px}.history-item-meta{font-size:12px;color:#64748b}.history-item-actions{display:flex;gap:4px}.history-action-btn{width:24px;height:24px;border-radius:4px;border:none;background:#f1f5f9;color:#64748b;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:12px}.history-action-btn:hover{background:#e2e8f0}.history-action-btn.delete:hover{background:#fee2e2;color:#dc2626}.empty-history{text-align:center;color:#64748b;padding:40px 20px}@keyframes fadeInUp{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.drag-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(102,126,234,.1);border:2px dashed #000;border-radius:20px;display:none;align-items:center;justify-content:center;color:#000;font-weight:600}.drag-overlay.active{display:flex}.image-viewer{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.9);display:none;align-items:center;justify-content:center;z-index:10002;cursor:pointer}.image-viewer.active{display:flex}.image-viewer img{max-width:90%;max-height:90%;object-fit:contain}.history-item-title-input{width:100%;background:transparent;border:1px solid rgba(255,255,255,.3);border-radius:4px;padding:2px 4px;color:inherit;font-size:inherit;font-weight:inherit;font-family:inherit}.history-item-title-input:focus{outline:none;border-color:rgba(59,130,246,.5);box-shadow:0 0 0 2px rgba(59,130,246,.2)}.history-action-btn.edit{background:rgba(34,197,94,.1);border:1px solid rgba(34,197,94,.3);color:rgb(34,197,94)}.history-action-btn.edit:hover{background:rgba(34,197,94,.2);border-color:rgba(34,197,94,.5)}.history-item-actions{display:flex;gap:4px;min-width:90px}.chat-bubble-plugin *,.chat-bubble-plugin *::before,.chat-bubble-plugin *::after{box-sizing:border-box}.chat-bubble-plugin{position:fixed!important;bottom:20px!important;right:20px!important;z-index:999999!important;will-change:transform}.chat-window{position:fixed;width:380px;height:600px;background:#fff;border-radius:20px;box-shadow:0 20px 60px rgba(0,0,0,.15);display:none;flex-direction:column;overflow:hidden;bottom:80px;right:0;transform:translateY(20px);opacity:0;transition:all 0.3s ease;max-width:calc(100vw - 40px);max-height:calc(100vh - 120px)}.chat-window.active{display:flex;transform:translateY(0);opacity:1}@media (max-width:1024px) and (min-width:769px){.chat-window{width:360px;height:580px}}@media (max-width:768px){.chat-bubble-plugin{bottom:16px!important;right:16px!important}.chat-toggle{width:56px;height:56px}.chat-window{width:calc(100vw - 32px);height:calc(100vh - 120px);max-width:400px;max-height:700px;bottom:72px;right:0;left:50%;transform:translateX(-50%) translateY(20px);min-width:280px;min-height:400px}.chat-window.active{transform:translateX(-100%) translateY(0)}.chat-header{padding:16px;position:relative}.header-actions{position:absolute;top:12px;right:12px;gap:6px}.header-btn{width:32px;height:32px;font-size:13px}.chat-messages{padding:16px;-webkit-overflow-scrolling:touch;overflow-x:hidden}.message{gap:8px;margin-bottom:12px}.message-content{max-width:80%;padding:10px 12px;font-size:14px;word-break:break-word;overflow-wrap:break-word;line-height:1.4}.avatar{width:32px;height:32px;font-size:12px}.chat-input-area{padding:16px}.chat-input{font-size:16px;padding:10px 12px}.action-btn{width:36px;height:36px;font-size:14px}.history-content{width:calc(100vw - 32px);height:calc(100vh - 80px);max-width:500px;max-height:600px;margin:0;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}}@media (max-width:480px){.chat-bubble-plugin{bottom:12px!important;right:12px!important}.chat-toggle{width:52px;height:52px}.chat-window{width:calc(100vw - 16px);height:calc(100vh - 100px);bottom:68px;left:50%!important;transform:translateX(-50%) translateY(20px)!important;min-width:280px;border-radius:16px}.chat-window.active{transform:translateX(-90%) translateY(0)!important}.chat-header{padding:12px 16px;border-radius:16px 16px 0 0}.header-actions{top:8px;right:8px;gap:4px}.header-btn{width:28px;height:28px;font-size:12px}.chat-messages{padding:12px}.message{gap:6px;margin-bottom:10px}.message-content{max-width:85%;padding:8px 12px;font-size:14px;line-height:1.3}.avatar{width:28px;height:28px;font-size:11px}.chat-input-area{padding:12px;border-radius:0 0 16px 16px}.input-container{border-radius:20px}.chat-input{padding:8px 12px;font-size:16px}.action-btn{width:32px;height:32px;font-size:13px}.input-actions{gap:4px}.file-container{min-width:60px;max-width:80px;padding:4px}.file-image,.file-icon{width:40px;height:40px}.file-name{font-size:9px}.copy-btn{width:20px;height:20px;font-size:10px;top:4px;right:4px}.history-content{width:100vw;height:100vh;max-width:none;max-height:none;border-radius:0;transform:none;top:0;left:0;right:0;bottom:0;position:fixed}.history-header{padding:12px 16px}.history-list{padding:12px}.history-item{padding:10px 8px}.history-action-btn{width:32px;height:32px;font-size:12px}}@media (max-width:375px){.chat-window{width:calc(100vw - 12px);left:6px;right:6px;min-width:260px}.message-content{max-width:90%;font-size:13px;padding:6px 10px}.chat-input{font-size:16px;padding:6px 10px}.action-btn{width:30px;height:30px}}@media (max-width:768px) and (orientation:landscape){.chat-window{height:calc(100vh - 60px);max-height:calc(100vh - 60px);width:min(400px, calc(100vw - 32px))}.chat-messages{padding:10px 16px}.chat-input-area{padding:8px 16px}}@media (max-width:480px) and (orientation:landscape){.chat-window{width:calc(100vw - 100px);height:calc(100vh - 40px);max-width:500px;left:50%;transform:translateX(-50%) translateY(20px)}.chat-window.active{transform:translateX(-100%) translateY(0)}}@supports (-webkit-touch-callout:none){@media (max-width:768px){.chat-window{height:calc(100vh - 140px)}}@media (max-width:480px){.chat-window{height:calc(100vh - 120px)}}}@media (max-width:768px){body:has(.chat-window.active){overflow-x:hidden}.chat-toggle,.action-btn,.header-btn,.history-action-btn{-webkit-tap-highlight-color:rgba(0,0,0,.1);touch-action:manipulation;user-select:none}.chat-messages{scroll-behavior:smooth;transform:translateZ(0)}.message-content{user-select:text;-webkit-user-select:text}}.chat-bubble-plugin.left-positioned{left:20px!important;right:auto!important}.chat-bubble-plugin.left-positioned .chat-window{left:0!important;right:auto!important}@media (max-width:768px){.chat-bubble-plugin.left-positioned{left:16px!important}.chat-bubble-plugin.left-positioned .chat-window{left:50%!important;transform:translateX(-50%) translateY(20px)}.chat-bubble-plugin.left-positioned .chat-window.active{transform:translateX(-100%) translateY(0)}}@media (max-width:480px){.chat-bubble-plugin.left-positioned{left:12px!important}}@media (max-width:768px){.chat-toggle:focus,.header-btn:focus,.action-btn:focus{outline:2px solid #000;outline-offset:2px}.chat-input:focus{outline:2px solid #000;outline-offset:-1px}}.history-item{display:flex;align-items:center;padding:12px;border-bottom:1px solid #e5e5e5;transition:background-color 0.2s}.history-item:hover{background-color:#f8f9fa}.history-item-info{flex:1;cursor:pointer;padding-right:12px;transition:opacity 0.2s}.history-item-info:hover{opacity:.8}.history-item-title{font-weight:500;margin-bottom:4px;color:#333}.history-item-title-input{width:100%;padding:4px 8px;border:1px solid #ddd;border-radius:4px;font-size:14px;background:#fff}.history-item-meta{font-size:12px;color:#666}.history-item-actions{display:flex;gap:4px}.history-action-btn{padding:8px;border:none;background:transparent;border-radius:4px;cursor:pointer;transition:all 0.2s;color:#666}.history-action-btn:hover{background-color:#e9ecef;color:#333}.history-action-btn.edit:hover{background-color:#fff3cd;color:#856404}.history-action-btn.load:hover{background-color:#d4edda;color:#155724}.history-action-btn.delete:hover{background-color:#f8d7da;color:#721c24}.history-loading{text-align:center;padding:20px;color:#666}.history-loading i{animation:spin 1s linear infinite}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}