:root{--primary:#1e3a8a;--accent:#f59e0b;--bg:#f9fafb}*,:before,:after{box-sizing:border-box}html,body,#root{height:100%}body{background:var(--bg);color:#111827;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizelegibility;margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif}:root{--primary:#1e3a8a;--primary-dark:#172f70;--accent:#f59e0b;--bg:#f9fafb;--border:#e5e7eb;--text:#1f2937;--text-muted:#6b7280;--green:#22c55e;--red:#ef4444;--radius-bubble:12px;--radius-button:8px;--shadow-panel:0 20px 25px -5px #1e3a8a1a, 0 8px 10px -6px #1e3a8a14}.chat-page{justify-content:center;align-items:center;min-height:100vh;padding:24px;display:flex}.chat-panel{border:1px solid var(--border);width:100%;max-width:800px;height:90vh;box-shadow:var(--shadow-panel);background:#fff;border-radius:16px;flex-direction:column;display:flex;overflow:hidden}.chat-header{background:linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);color:#fff;flex-shrink:0;justify-content:space-between;align-items:center;gap:12px;padding:13px 20px;display:flex}.chat-brand{align-items:center;gap:11px;min-width:0;display:flex}.chat-logo{background:var(--accent);color:#fff;border-radius:9px;flex-shrink:0;justify-content:center;align-items:center;width:34px;height:34px;font-size:16px;font-weight:800;display:flex}.chat-brand-text h1{letter-spacing:.01em;white-space:nowrap;margin:0;font-size:16px;font-weight:700}.chat-brand-text p{color:#ffffffb8;white-space:nowrap;text-overflow:ellipsis;margin:1px 0 0;font-size:11.5px;overflow:hidden}.chat-status{flex-shrink:0;align-items:center;gap:6px;display:flex}.status-dot{border-radius:50%;flex-shrink:0;width:9px;height:9px}.status-connected{background:var(--green);animation:2s infinite dot-pulse}.status-disconnected{background:var(--red)}.status-label{color:#ffffffd9;font-size:11px;font-weight:600}@keyframes dot-pulse{0%{box-shadow:0 0 #22c55e8c}70%{box-shadow:0 0 0 6px #22c55e00}to{box-shadow:0 0 #22c55e00}}.chat-messages{background:var(--bg);flex-direction:column;flex:1;gap:14px;padding:20px;display:flex;overflow-y:auto}.chat-messages::-webkit-scrollbar{width:8px}.chat-messages::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:999px}.message-row{display:flex}.message-row-user{justify-content:flex-end}.message-row-assistant,.message-row-error{justify-content:flex-start}.avatar{background:var(--accent);color:#fff;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:30px;height:30px;margin-top:2px;margin-right:10px;font-size:13px;font-weight:800;display:flex}.message-content{flex-direction:column;align-items:flex-start;gap:6px;min-width:0;max-width:78%;display:flex}.bubble{border-radius:var(--radius-bubble);word-break:break-word;padding:10px 14px;font-size:14.5px;line-height:1.55}.bubble-user{background:var(--primary);color:#fff;border-bottom-right-radius:4px}.bubble-assistant{color:var(--text);border:1px solid var(--border);background:#fff;border-bottom-left-radius:4px}.bubble-error{color:#b91c1c;background:#fef2f2;border:1px solid #fecaca}.bubble-user,.bubble-error{white-space:pre-wrap}.md-content>:first-child{margin-top:0}.md-content>:last-child{margin-bottom:0}.md-content p{margin:0 0 8px}.md-content h3,.md-content h4{color:var(--primary);margin:10px 0 6px;font-weight:700;line-height:1.3}.md-content h3{font-size:15.5px}.md-content h4{font-size:14px}.md-content ul,.md-content ol{margin:0 0 8px;padding-left:22px}.md-content li{margin:0;padding-left:2px}.md-content li+li{margin-top:4px}.md-content strong{color:#111827;font-weight:700}.badge{letter-spacing:.02em;border-radius:999px;align-items:center;padding:2px 9px;font-size:11px;font-weight:700;display:inline-flex}.badge-warning{color:#92400e;background:#fef3c7;border:1px solid #fde68a}.sources{flex-direction:column;gap:6px;width:100%;display:flex}.sources-toggle{cursor:pointer;color:var(--primary);background:0 0;border:none;border-radius:6px;align-self:flex-start;align-items:center;gap:6px;padding:3px 6px;font-family:inherit;font-size:12px;font-weight:600;transition:background .15s;display:inline-flex}.sources-toggle:hover{background:#eef2ff}.sources-chevron{font-size:9px;transition:transform .15s;display:inline-block}.sources-chevron-open{transform:rotate(90deg)}.sources-list{flex-direction:column;gap:6px;width:100%;margin:0;padding:0;list-style:none;display:flex}.source-item{border:1px solid var(--border);background:#fff;border-radius:10px;padding:8px 11px;font-size:12px}.source-head{justify-content:space-between;align-items:baseline;gap:10px;display:flex}.source-name{color:#374151;overflow-wrap:anywhere;font-weight:600}.source-score{color:var(--primary);white-space:nowrap;font-weight:600}.source-text{color:var(--text-muted);-webkit-line-clamp:2;-webkit-box-orient:vertical;margin:5px 0 0;line-height:1.45;display:-webkit-box;overflow:hidden}.typing-bubble{align-items:center;gap:5px;padding:13px 15px;display:inline-flex}.typing-bubble .dot{background:#9ca3af;border-radius:50%;width:7px;height:7px;animation:1.2s ease-in-out infinite typing-pulse}.typing-bubble .dot:nth-child(2){animation-delay:.2s}.typing-bubble .dot:nth-child(3){animation-delay:.4s}@keyframes typing-pulse{0%,60%,to{opacity:.4;transform:translateY(0)}30%{opacity:1;transform:translateY(-4px)}}.suggestion-bar{border-top:1px solid var(--border);background:#fff;flex-wrap:wrap;flex-shrink:0;gap:8px;padding:10px 16px;display:flex}.suggestion-chip{white-space:nowrap;border:1px solid var(--border);background:var(--bg);color:var(--text);cursor:pointer;border-radius:999px;flex-shrink:0;padding:7px 14px;font-family:inherit;font-size:13px;line-height:1.2;transition:border-color .15s,background .15s,transform 50ms}.suggestion-chip:hover:not(:disabled){border-color:var(--primary);background:#eef2f7}.suggestion-chip:active:not(:disabled){transform:scale(.97)}.suggestion-chip:disabled{opacity:.5;cursor:not-allowed}.chat-input-bar{border-top:1px solid var(--border);background:#fff;flex-shrink:0;gap:10px;padding:14px 16px;display:flex}.chat-input{border-radius:var(--radius-button);color:#111827;border:1px solid #d1d5db;outline:none;flex:1;min-width:0;height:42px;padding:0 14px;font-family:inherit;font-size:14px;transition:border-color .15s,box-shadow .15s}.chat-input::placeholder{color:#9ca3af}.chat-input:focus{border-color:var(--primary);box-shadow:0 0 0 3px #1e3a8a1f}.send-button{border-radius:var(--radius-button);background:var(--primary);color:#fff;cursor:pointer;border:none;flex-shrink:0;height:42px;padding:0 20px;font-family:inherit;font-size:14px;font-weight:600;transition:background .15s,transform 50ms}.send-button:hover:not(:disabled){background:var(--primary-dark)}.send-button:active:not(:disabled){transform:scale(.98)}.send-button:disabled{opacity:.5;cursor:not-allowed}.chat-disclaimer{text-align:center;color:#9ca3af;background:#fff;flex-shrink:0;margin:0;padding:0 16px 10px;font-size:11px}@media (width<=600px){.chat-page{padding:0}.chat-panel{border:none;border-radius:0;max-width:100%;height:100dvh}.message-content{max-width:88%}.chat-brand-text p{display:none}.suggestion-bar{gap:6px;padding:8px 12px}.suggestion-chip{padding:6px 10px;font-size:12px}}@media (prefers-reduced-motion:reduce){.status-connected,.typing-bubble .dot{animation:none}}
