:root{--bg: #f5f6fa;--surface: #ffffff;--text: #1c2230;--muted: #677085;--border: #e1e5ee;--primary: #4f46e5;--primary-hover: #4338ca;--primary-soft: #eef0ff;--user-bubble: #4f46e5;--assistant-bubble: #ffffff;--danger: #dc2626;--radius: 18px;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;line-height:1.5;color:var(--text);background:var(--bg)}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}button{font:inherit}.app{--gutter: max(1.25rem, calc((100% - 900px)/2) );display:flex;flex-direction:column;height:100dvh;background:var(--bg)}.header{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.85rem var(--gutter);border-bottom:1px solid var(--border);background:var(--surface)}.brand{display:flex;align-items:center;gap:.75rem;min-width:0}.brand-logo,.avatar,.empty-logo{display:grid;place-items:center;flex-shrink:0;border-radius:12px;background:linear-gradient(135deg,#6366f1,#8b5cf6);color:#fff;font-weight:700}.brand-logo{width:40px;height:40px}.header h1{margin:0;font-size:1.1rem}.subtitle{margin:0;font-size:.8rem;color:var(--muted)}.btn-ghost{display:inline-flex;align-items:center;gap:.4rem;padding:.5rem .85rem;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);font-size:.875rem;cursor:pointer;white-space:nowrap}.btn-ghost:hover:not(:disabled){background:var(--bg)}.btn-ghost:disabled{opacity:.5;cursor:default}.messages{flex:1;overflow-y:auto;padding:1.25rem var(--gutter)}.thread{display:flex;flex-direction:column;gap:1rem}.msg{display:flex;gap:.6rem;align-items:flex-end}.msg-user{justify-content:flex-end}.avatar{width:32px;height:32px;border-radius:50%;font-size:.75rem}.bubble{display:flex;flex-direction:column;gap:.5rem;max-width:min(78%,640px);padding:.7rem 1rem;border-radius:var(--radius);overflow-wrap:anywhere}.msg-user .bubble{background:var(--user-bubble);color:#fff;border-bottom-right-radius:6px}.msg-assistant .bubble{background:var(--assistant-bubble);border:1px solid var(--border);border-bottom-left-radius:6px}.bubble-text{margin:0;white-space:pre-wrap}.bubble-image{display:block;max-width:100%;max-height:280px;border-radius:12px;background:#fff}.bubble-audio{width:260px;max-width:100%;height:40px}.bubble-meta{font-size:.75rem;opacity:.75}.bubble-error{border-color:#fecaca!important}.msg-user .bubble-error{background:#fef2f2;color:var(--text);border:1px solid #fecaca}.bubble-error-text{margin:0;color:#b91c1c;font-size:.875rem}.ocr-details{font-size:.85rem}.ocr-details summary{cursor:pointer;opacity:.9}.ocr-details pre{margin:.4rem 0 0;padding:.6rem;max-height:220px;overflow:auto;border-radius:8px;background:#00000026;white-space:pre-wrap;font-family:inherit}.typing{display:flex;align-items:center;gap:.5rem;font-size:.875rem;opacity:.85}.dots{display:inline-flex;gap:3px}.dots i{width:6px;height:6px;border-radius:50%;background:currentColor;animation:bounce 1.2s infinite ease-in-out}.dots i:nth-child(2){animation-delay:.15s}.dots i:nth-child(3){animation-delay:.3s}@keyframes bounce{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}.cursor{display:inline-block;width:.5em;height:1em;margin-left:2px;vertical-align:text-bottom;background:currentColor;animation:blink 1s steps(2) infinite}@keyframes blink{50%{opacity:0}}.empty{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100%;padding:1rem;text-align:center}.empty-logo{width:56px;height:56px;border-radius:16px;font-size:1.2rem}.empty h2{margin:1rem 0 .25rem;font-size:1.4rem}.empty p{max-width:460px;margin:0 0 1.25rem;color:var(--muted)}.suggestions{display:flex;flex-wrap:wrap;justify-content:center;gap:.5rem}.suggestion{padding:.55rem .9rem;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--text);font-size:.875rem;cursor:pointer}.suggestion:hover:not(:disabled){border-color:var(--primary);background:var(--primary-soft)}.composer{display:flex;flex-direction:column;gap:.5rem;padding:.75rem var(--gutter) calc(.75rem + env(safe-area-inset-bottom));background:var(--bg)}.composer.dragging .composer-box{border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-soft)}.composer-box{display:flex;align-items:flex-end;gap:.35rem;padding:.4rem;border:1px solid var(--border);border-radius:22px;background:var(--surface);box-shadow:0 2px 10px #141e3c0f}.composer-box:focus-within{border-color:#c7caf5}.composer-box textarea{flex:1;min-height:40px;max-height:180px;padding:.55rem .4rem;border:none;outline:none;resize:none;background:transparent;font:inherit;color:inherit}.composer-box.recording{align-items:center}.rec-indicator{flex:1;display:flex;align-items:center;gap:.5rem;color:var(--danger);font-weight:600}.rec-dot{width:10px;height:10px;border-radius:50%;background:var(--danger);animation:blink 1s steps(2) infinite}.icon-btn{display:grid;place-items:center;flex-shrink:0;width:40px;height:40px;border:none;border-radius:50%;background:transparent;color:var(--muted);cursor:pointer}.icon-btn:hover:not(:disabled){background:var(--bg);color:var(--text)}.icon-btn:disabled{opacity:.4;cursor:default}.icon-btn.send{background:var(--primary);color:#fff}.icon-btn.send:hover:not(:disabled){background:var(--primary-hover);color:#fff}.icon-btn.stop{background:var(--text);color:#fff}.icon-btn.small{width:30px;height:30px}.attachment{display:flex;align-items:center;gap:.75rem;align-self:flex-start;max-width:100%;padding:.4rem .5rem .4rem .4rem;border:1px solid var(--border);border-radius:14px;background:var(--surface)}.attachment img{width:52px;height:52px;object-fit:cover;border-radius:10px}.attachment-info{display:flex;flex-direction:column;min-width:0;font-size:.85rem}.attachment-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}.attachment-size{color:var(--muted);font-size:.78rem}.composer-error{margin:0;padding:.5rem .85rem;border:1px solid #fecaca;border-radius:10px;background:#fef2f2;color:#991b1b;font-size:.875rem}.composer-hint{margin:0;text-align:center;font-size:.72rem;color:var(--muted)}@media(max-width:600px){.app{--gutter: .85rem}.header{padding-top:.7rem;padding-bottom:.7rem}.subtitle,.btn-ghost span{display:none}.messages{padding:.85rem}.bubble{max-width:88%}.avatar{display:none}.composer{padding-left:.6rem;padding-right:.6rem}.composer-hint{display:none}}
