*,:after,:before{box-sizing:border-box;margin:0;padding:0}:root{--bg:#f5f6f8;--surface:#ffffff;--border:#e2e5ea;--text:#1c1c1c;--text-muted:#717680;--user-bg:#002b5c;--user-text:#ffffff;--assistant-bg:#ffffff;--assistant-text:#1c1c1c;--header-h:56px}body,html{height:100%;overflow:hidden}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;color:var(--text);line-height:1.5;-webkit-font-smoothing:antialiased}.app,body{background:var(--bg)}.app{display:flex;flex-direction:column;width:100%;height:100vh;height:100dvh}.header{height:var(--header-h);background:var(--surface);border-bottom:1px solid var(--border);flex-shrink:0}.header-inner{justify-content:space-between;height:100%;padding:0 1.5rem}.header-brand,.header-inner{display:flex;align-items:center}.header-brand{gap:.75rem}.header-logo{display:block;height:26px;width:auto}.header-divider{width:1px;height:20px;background:var(--border)}.header-title{font-size:.9375rem;font-weight:600;color:var(--text)}.clear-btn{padding:.375rem .75rem;background:transparent;border:1px solid var(--border);border-radius:8px;color:var(--text-muted);font-size:.8125rem;font-weight:500;cursor:pointer;transition:background .15s,color .15s,border-color .15s}.clear-btn:hover:not(:disabled){background:var(--surface);color:var(--text);border-color:#b8bcc4}.clear-btn:disabled{opacity:.6;cursor:not-allowed}.chat-main{flex:1;display:flex;flex-direction:column;min-height:0}.chat-loading{flex:1;display:flex;align-items:center;justify-content:center}.spinner{width:28px;height:28px;border:2px solid var(--border);border-top-color:var(--user-bg);border-radius:50%;animation:spin .7s linear infinite}@keyframes spin{to{transform:rotate(1turn)}}.messages{flex:1;overflow-y:auto;padding:1.5rem}.messages-inner{max-width:720px;margin:0 auto;display:flex;flex-direction:column;gap:.75rem;min-height:100%}.welcome{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:2rem 0;gap:1.5rem}.welcome-title{font-size:1.375rem;font-weight:600;color:var(--text)}.preset-list{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:520px}.preset-btn{padding:.75rem 1rem;background:var(--surface);border:1px solid var(--border);border-radius:10px;color:var(--text);font-size:.875rem;line-height:1.4;text-align:left;cursor:pointer;transition:border-color .15s,background .15s}.preset-btn:hover:not(:disabled){border-color:#b8bcc4;background:#fafbfc}.preset-btn:disabled{opacity:.5;cursor:not-allowed}.bubble-wrap{position:relative;display:flex;flex-direction:column;gap:.25rem;max-width:85%}.bubble-wrap.user{align-self:flex-end;align-items:flex-end}.bubble-wrap.assistant{align-self:flex-start;align-items:flex-start}.bubble{padding:.75rem 1rem;border-radius:14px;font-size:.9375rem;line-height:1.55;white-space:pre-wrap;word-break:break-word}.bubble.user{background:var(--user-bg);color:var(--user-text);border-bottom-right-radius:4px}.bubble.assistant{background:var(--assistant-bg);color:var(--assistant-text);border:1px solid var(--border);border-bottom-left-radius:4px}.copy-btn{position:absolute;top:-12px;right:-6px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;background:var(--surface);border:1px solid var(--border);border-radius:8px;color:var(--text-muted);cursor:pointer;opacity:0;box-shadow:0 1px 3px rgba(0,0,0,.1);transition:opacity .15s,color .15s,background .15s,border-color .15s}.copy-btn svg{width:15px;height:15px}.bubble-wrap:focus-within .copy-btn,.bubble-wrap:hover .copy-btn,.copy-btn:focus-visible{opacity:1}.copy-btn:hover{color:var(--text);border-color:#b8bcc4;background:#fafbfc}.copy-btn.copied{opacity:1;color:#15803d;border-color:#bbf7d0;background:#f0fdf4}.bubble.typing{display:flex;gap:4px;align-items:center;padding:1rem}.bubble.typing span{width:6px;height:6px;background:var(--text-muted);border-radius:50%;animation:bounce 1.4s ease-in-out infinite both}.bubble.typing span:first-child{animation-delay:-.32s}.bubble.typing span:nth-child(2){animation-delay:-.16s}@keyframes bounce{0%,80%,to{transform:scale(.6);opacity:.4}40%{transform:scale(1);opacity:1}}.chat-footer{flex-shrink:0;padding:1rem 1.5rem 1.5rem;background:var(--bg)}.error-banner{max-width:720px;margin:0 auto .75rem;background:#fef2f2;color:#b91c1c;font-size:.8125rem;padding:.5rem .75rem;border-radius:8px}.input-form{max-width:720px;margin:0 auto;display:flex;align-items:flex-end;gap:.5rem;background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:.5rem .5rem .5rem 1rem}.input-form:focus-within{border-color:#b8bcc4}.chat-input{flex:1;border:none;outline:none;background:transparent;font-size:.9375rem;font-family:inherit;resize:none;line-height:1.5;max-height:120px;color:var(--text);padding:.375rem 0}.chat-input::-moz-placeholder{color:var(--text-muted)}.chat-input::placeholder{color:var(--text-muted)}.send-btn{width:36px;height:36px;border:none;border-radius:10px;background:var(--user-bg);color:#fff;font-size:1.125rem;font-weight:600;cursor:pointer;flex-shrink:0;display:flex;align-items:center;justify-content:center}.send-btn:hover:not(:disabled){opacity:.9}.send-btn:disabled{background:var(--border);cursor:not-allowed}.bubble.assistant .prose-chat{white-space:normal}.prose-chat>:first-child{margin-top:0}.prose-chat>:last-child{margin-bottom:0}.prose-chat h1,.prose-chat h2,.prose-chat h3{font-weight:600;font-size:1rem;margin:.75rem 0 .25rem}.prose-chat p{margin:.4rem 0}.prose-chat ol,.prose-chat ul{margin:.4rem 0;padding-left:1.25rem}.prose-chat li{margin:.15rem 0}.prose-chat code{background:#eef0f4;color:#0b4aa2;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.8125rem;padding:.1rem .35rem;border-radius:5px}.prose-chat pre{background:#0f172a;color:#e2e8f0;border-radius:10px;padding:.75rem 1rem;overflow-x:auto;margin:.5rem 0}.prose-chat pre code{background:transparent;color:inherit;padding:0}.prose-chat a{color:var(--user-bg);text-decoration:underline;text-underline-offset:2px}.prose-chat blockquote{border-left:3px solid var(--border);padding-left:.75rem;color:var(--text-muted);margin:.4rem 0}.prose-chat table{border-collapse:collapse;margin:.5rem 0;font-size:.875rem}.prose-chat td,.prose-chat th{border:1px solid var(--border);padding:.35rem .6rem;text-align:left}@keyframes blink{0%,to{opacity:1}50%{opacity:0}}.streaming-cursor:after{content:"▍";margin-left:2px;color:var(--user-bg);animation:blink .8s step-end infinite}.source-list{display:flex;flex-wrap:wrap;gap:.375rem;padding:0 .125rem}.source-chip{display:inline-flex;align-items:center;gap:.375rem;max-width:280px;padding:.25rem .625rem;border-radius:999px;border:1px solid var(--border);background:var(--surface);font-size:.75rem;font-weight:500;color:var(--text-muted);text-decoration:none;transition:border-color .15s,background .15s,color .15s}.source-chip .source-label{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.source-chip .source-label.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.source-chip .source-ext{opacity:.5}.source-chip.confluence{color:#0b4aa2;background:#eef4ff;border-color:#d3e0fb}.source-chip.confluence:hover{border-color:var(--user-bg);background:#e3edff}@media (max-width:640px){.chat-footer,.header-inner,.messages{padding-left:1rem;padding-right:1rem}.welcome-title{font-size:1.125rem}.bubble-wrap{max-width:92%}.copy-btn{opacity:1}}