:root{--cw-primary: #0ea5e9;--cw-primary-dark: #0284c7;--cw-bg: #ffffff;--cw-surface: #f8fafc;--cw-text: #0f172a;--cw-text-muted: #94a3b8;--cw-border: #e2e8f0;--cw-user-bg: #0ea5e9;--cw-user-text: #ffffff;--cw-bot-bg: #f1f5f9;--cw-bot-text: #0f172a;--cw-error-bg: #fef2f2;--cw-error-text: #dc2626;--cw-error-border: #fecaca;--cw-radius: 16px;--cw-radius-sm: 8px;--cw-shadow: 0 8px 32px rgba(0, 0, 0, .16);--cw-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;--cw-z: 9999}.cw-container{position:fixed;bottom:24px;right:24px;z-index:var(--cw-z);font-family:var(--cw-font);display:flex;flex-direction:column;align-items:flex-end;gap:12px}.cw-panel{width:360px;max-height:520px;background:var(--cw-bg);border-radius:var(--cw-radius);box-shadow:var(--cw-shadow);display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--cw-border);animation:cw-slide-in .2s ease}@keyframes cw-slide-in{0%{opacity:0;transform:translateY(12px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}.cw-header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;background:var(--cw-primary);color:#fff;flex-shrink:0}.cw-header-title{font-weight:600;font-size:.95rem;letter-spacing:.01em}.cw-close-btn{background:none;border:none;color:#fff;font-size:1.4rem;line-height:1;cursor:pointer;padding:0 4px;opacity:.85;transition:opacity .15s}.cw-close-btn:hover{opacity:1}.cw-body{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:2px;background:var(--cw-surface);scroll-behavior:smooth}.cw-messages{display:flex;flex-direction:column;gap:6px;flex:1}.cw-messages--empty{align-items:center;justify-content:center;min-height:120px;color:var(--cw-text-muted);font-size:.9rem;text-align:center}.cw-messages--empty p{margin:0}.cw-bubble-row{display:flex}.cw-bubble-row--user{justify-content:flex-end}.cw-bubble-row--bot{justify-content:flex-start}.cw-bubble{max-width:78%;padding:9px 13px;border-radius:var(--cw-radius);display:flex;flex-direction:column;gap:4px}.cw-bubble-row--user .cw-bubble{background:var(--cw-user-bg);color:var(--cw-user-text);border-bottom-right-radius:var(--cw-radius-sm)}.cw-bubble-row--bot .cw-bubble{background:var(--cw-bot-bg);color:var(--cw-bot-text);border-bottom-left-radius:var(--cw-radius-sm)}.cw-bubble-content{margin:0;font-size:.875rem;line-height:1.5;white-space:pre-wrap;word-break:break-word}.cw-bubble-time{font-size:.7rem;opacity:.65;align-self:flex-end}.cw-bubble--typing{display:flex;flex-direction:row;align-items:center;gap:5px;padding:12px 16px;min-width:56px}.cw-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--cw-text-muted);animation:cw-bounce 1.2s infinite ease-in-out}.cw-dot:nth-child(2){animation-delay:.2s}.cw-dot:nth-child(3){animation-delay:.4s}@keyframes cw-bounce{0%,80%,to{transform:translateY(0)}40%{transform:translateY(-6px)}}.cw-error{margin:6px 0 2px;padding:8px 12px;background:var(--cw-error-bg);color:var(--cw-error-text);border:1px solid var(--cw-error-border);border-radius:var(--cw-radius-sm);font-size:.8rem;line-height:1.4;cursor:pointer}.cw-error:hover{background:#fee2e2}.cw-input-form{display:flex;align-items:flex-end;gap:8px;padding:10px 12px;border-top:1px solid var(--cw-border);background:var(--cw-bg);flex-shrink:0}.cw-textarea{flex:1;resize:none;border:1px solid var(--cw-border);border-radius:20px;padding:8px 14px;font-family:var(--cw-font);font-size:.875rem;line-height:1.5;color:var(--cw-text);background:var(--cw-surface);outline:none;max-height:96px;overflow-y:auto;transition:border-color .15s;field-sizing:content}.cw-textarea:focus{border-color:var(--cw-primary)}.cw-textarea:disabled{opacity:.6;cursor:not-allowed}.cw-send-btn{width:36px;height:36px;border-radius:50%;border:none;background:var(--cw-primary);color:#fff;font-size:1rem;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:background .15s,transform .1s}.cw-send-btn:hover:not(:disabled){background:var(--cw-primary-dark)}.cw-send-btn:active:not(:disabled){transform:scale(.94)}.cw-send-btn:disabled{opacity:.45;cursor:not-allowed}.cw-toggle{width:52px;height:52px;border-radius:50%;border:none;background:var(--cw-primary);color:#fff;font-size:1.3rem;cursor:pointer;box-shadow:0 4px 16px #0ea5e973;display:flex;align-items:center;justify-content:center;transition:background .15s,transform .2s,box-shadow .15s;flex-shrink:0}.cw-toggle:hover{background:var(--cw-primary-dark);box-shadow:0 6px 20px #0ea5e98c}.cw-toggle:active{transform:scale(.92)}.cw-toggle--open{font-size:1.5rem}@media (max-width: 480px){.cw-container{bottom:16px;right:16px}.cw-panel{position:fixed;top:0;right:0;bottom:0;left:0;width:100%;max-width:100%;max-height:100%;border-radius:0;border:none}}
