:root{--bg-primary: #ffffff;--bg-secondary: #f7f7f8;--bg-tertiary: #ececf1;--bg-hover: #f0f0f0;--text-primary: #202123;--text-secondary: #565869;--text-tertiary: #8e8ea0;--border-light: #e5e5e5;--border-medium: #d1d1d6;--accent-primary: #10a37f;--accent-hover: #0d8a6a;--accent-light: #e7f5f1;--error: #ef4444;--success: #10b981;--sidebar-width: 260px;--header-height: 60px;--shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);--shadow-md: 0 4px 6px rgba(0, 0, 0, .1);--shadow-lg: 0 10px 15px rgba(0, 0, 0, .1);--radius-sm: 4px;--radius-md: 8px;--radius-lg: 12px}*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-color:var(--bg-primary);color:var(--text-primary);font-size:14px;line-height:1.5}code{font-family:Monaco,Courier New,monospace;background-color:var(--bg-tertiary);padding:2px 6px;border-radius:var(--radius-sm);font-size:.9em}.app{display:flex;height:100vh;overflow:hidden}.sidebar{width:var(--sidebar-width);background-color:var(--bg-secondary);border-right:1px solid var(--border-light);display:flex;flex-direction:column;flex-shrink:0;transition:width .2s ease}.sidebar.collapsed{width:50px}.sidebar-header{padding:16px;border-bottom:1px solid var(--border-light);display:flex;align-items:center;justify-content:space-between}.sidebar-title{font-size:16px;font-weight:600;color:var(--text-primary)}.sidebar-toggle{background:none;border:none;cursor:pointer;font-size:18px;color:var(--text-secondary);padding:4px 8px;border-radius:var(--radius-sm)}.sidebar-toggle:hover{background-color:var(--bg-hover)}.sidebar-actions{padding:12px;border-bottom:1px solid var(--border-light)}.sidebar-conversations{flex:1;overflow-y:auto;padding:8px}.sidebar-loading,.sidebar-empty{text-align:center;padding:24px 16px;color:var(--text-secondary)}.sidebar-empty-hint{font-size:12px;margin-top:8px;color:var(--text-tertiary)}.conversation-list{list-style:none}.conversation-item{padding:12px;margin-bottom:4px;border-radius:var(--radius-md);cursor:pointer;transition:background-color .15s ease;display:flex;align-items:center;justify-content:space-between;gap:8px;position:relative}.conversation-item:hover{background-color:var(--bg-hover)}.conversation-item.active{background-color:var(--accent-light);border-left:3px solid var(--accent-primary)}.conversation-content{flex:1;min-width:0}.conversation-title{font-weight:500;color:var(--text-primary);margin-bottom:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conversation-meta{display:flex;justify-content:space-between;font-size:12px;color:var(--text-tertiary)}.conversation-menu{position:relative;flex-shrink:0}.conversation-menu-button{background:none;border:none;padding:4px 8px;cursor:pointer;border-radius:var(--radius-sm);font-size:18px;color:var(--text-tertiary);opacity:0;transition:opacity .15s ease,background-color .15s ease;line-height:1}.conversation-item:hover .conversation-menu-button{opacity:.6}.conversation-menu-button:hover{opacity:1!important;background-color:var(--bg-hover)}.conversation-menu-dropdown{position:absolute;right:0;top:100%;margin-top:4px;background-color:var(--bg-primary);border:1px solid var(--border-light);border-radius:var(--radius-md);box-shadow:var(--shadow-lg);min-width:140px;z-index:1000;overflow:hidden}.conversation-menu-item{width:100%;padding:10px 12px;border:none;background:none;cursor:pointer;text-align:left;font-size:14px;color:var(--text-primary);transition:background-color .15s ease;display:flex;align-items:center;gap:8px}.conversation-menu-item:hover{background-color:var(--bg-hover)}.sidebar-footer{padding:12px;border-top:1px solid var(--border-light)}.main{flex:1;display:flex;flex-direction:column;overflow:hidden}.main-header{height:var(--header-height);padding:0 24px;border-bottom:1px solid var(--border-light);display:flex;align-items:center;justify-content:space-between;background-color:var(--bg-primary)}.header-center{position:absolute;left:50%;top:calc(var(--header-height) / 2);transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;pointer-events:auto}.kofi-cta{display:inline-flex;align-items:center;gap:8px}.kofi-cta img{height:18px}.main-title{font-size:18px;font-weight:600;color:var(--text-primary)}.main-actions{display:flex;gap:8px;align-items:center;margin-left:auto}@media (min-width: 769px){.header-newchat{display:none}}@media (max-width: 768px){.header-newchat{margin-left:0}}.messages-container{flex:1;overflow-y:auto;padding:24px;background-color:var(--bg-primary)}.empty-state{max-width:600px;margin:80px auto 0;text-align:center}.empty-state-icon{font-size:64px;margin-bottom:16px}.empty-state h3{font-size:24px;margin-bottom:8px;color:var(--text-primary)}.empty-state>p{color:var(--text-secondary);margin-bottom:32px}.empty-state-examples{background-color:var(--bg-secondary);border-radius:var(--radius-lg);padding:24px;text-align:left}.empty-state-examples p{font-weight:600;margin-bottom:12px}.empty-state-examples ul{list-style:none;padding-left:0}.empty-state-examples li{padding:8px 12px;margin:4px 0;background-color:var(--bg-primary);border-radius:var(--radius-md);color:var(--text-secondary);cursor:pointer;transition:background-color .15s}.empty-state-examples li:hover{background-color:var(--bg-hover)}.message{margin-bottom:32px;animation:fadeIn .3s ease-in}@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.message-header{display:flex;align-items:center;margin-bottom:8px}.message-avatar{width:32px;height:32px;border-radius:50%;background-color:var(--bg-tertiary);display:flex;align-items:center;justify-content:center;font-size:16px;margin-right:12px}.message.user .message-avatar{background-color:var(--accent-light)}.message-meta{display:flex;align-items:center;gap:12px}.message-role{font-weight:600;color:var(--text-primary)}.message-time{font-size:12px;color:var(--text-tertiary)}.message-content{margin-left:44px;line-height:1.6;color:var(--text-primary)}.message-content p{margin-bottom:12px}.message-content ul,.message-content ol{margin-left:20px;margin-bottom:12px}.message-content code{font-size:.9em}.message-content pre{background-color:var(--bg-secondary);padding:16px;border-radius:var(--radius-md);overflow-x:auto;margin-bottom:12px}.message.loading .message-content{display:flex;align-items:center}.typing-indicator{display:flex;gap:4px}.typing-indicator span{width:8px;height:8px;border-radius:50%;background-color:var(--text-tertiary);animation:typing 1.4s infinite}.typing-indicator span:nth-child(2){animation-delay:.2s}.typing-indicator span:nth-child(3){animation-delay:.4s}@keyframes typing{0%,60%,to{transform:translateY(0);opacity:.7}30%{transform:translateY(-10px);opacity:1}}.message-sources{margin-left:44px;margin-top:16px}.sources-header{margin-bottom:12px}.sources-label{font-size:13px;font-weight:600;color:var(--text-secondary)}.sources-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px}.source-card{background-color:var(--bg-secondary);border:1px solid var(--border-light);border-radius:var(--radius-md);padding:12px;font-size:13px}.source-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.source-anchor{font-weight:600;color:var(--accent-primary);font-family:Monaco,monospace;font-size:12px}.source-score{background-color:var(--accent-light);color:var(--accent-primary);padding:2px 8px;border-radius:12px;font-size:11px;font-weight:600}.source-document{margin-bottom:6px}.source-doc-title{font-weight:500;color:var(--text-primary);font-size:12px}.source-section{margin-bottom:8px;font-size:12px;color:var(--text-secondary)}.source-section-label{font-weight:600;margin-right:4px}.source-preview{margin-top:8px;padding-top:8px;border-top:1px solid var(--border-light)}.source-preview p{color:var(--text-secondary);font-size:12px;line-height:1.5;margin:0}.source-feedback{display:flex;gap:8px;margin-top:12px;padding-top:8px;border-top:1px solid var(--border-light)}.message-feedback{margin-left:44px;margin-top:12px}.feedback{display:flex;align-items:center;gap:12px}.feedback-label{font-size:13px;color:var(--text-secondary)}.feedback-btn{background:none;border:1px solid var(--border-medium);border-radius:var(--radius-sm);padding:6px 12px;font-size:16px;cursor:pointer;transition:all .15s ease}.feedback-btn:hover:not(:disabled){background-color:var(--bg-hover);transform:scale(1.1)}.feedback-btn:disabled{opacity:.5;cursor:not-allowed}.feedback-btn.active{background-color:var(--accent-light);border-color:var(--accent-primary)}.feedback-thanks{font-size:12px;color:var(--success);font-style:italic}.composer-container{padding:16px 24px 24px;border-top:1px solid var(--border-light);background-color:var(--bg-primary)}.composer{max-width:800px;margin:0 auto}.composer-inner{display:flex;gap:12px;background-color:var(--bg-secondary);border:1px solid var(--border-medium);border-radius:var(--radius-lg);padding:12px;transition:border-color .15s ease}.composer-inner:focus-within{border-color:var(--accent-primary);box-shadow:0 0 0 3px var(--accent-light)}.composer-input{flex:1;border:none;outline:none;background:none;font-family:inherit;font-size:14px;color:var(--text-primary);resize:none;max-height:200px}.composer-input::placeholder{color:var(--text-tertiary)}.composer-send{background-color:var(--accent-primary);color:#fff;border:none;border-radius:var(--radius-md);padding:8px 12px;cursor:pointer;transition:background-color .15s ease;display:flex;align-items:center;justify-content:center}.composer-send:hover:not(:disabled){background-color:var(--accent-hover)}.composer-send:disabled{opacity:.5;cursor:not-allowed}.composer-hint{margin-top:8px;text-align:center;font-size:12px;color:var(--text-tertiary)}.btn{padding:8px 16px;border-radius:var(--radius-md);font-size:14px;font-weight:500;cursor:pointer;transition:all .15s ease;border:none;outline:none}.btn-primary{background-color:var(--accent-primary);color:#fff}.btn-primary:hover{background-color:var(--accent-hover)}.btn-secondary{background-color:var(--bg-tertiary);color:var(--text-primary)}.btn-secondary:hover{background-color:var(--border-medium)}.btn-link{background:none;color:var(--text-secondary);padding:4px 8px}.btn-link:hover{color:var(--text-primary);background-color:var(--bg-hover)}.btn-block{width:100%;display:block}.btn-danger{background-color:var(--error);color:#fff}.btn-danger:hover{background-color:#dc2626}.btn:disabled{opacity:.6;cursor:not-allowed}.user-menu{position:relative}.user-button{display:inline-flex;align-items:center;gap:8px;padding:6px 8px;border-radius:var(--radius-md);border:1px solid var(--border-light);background:var(--bg-primary);cursor:pointer}.user-avatar{width:24px;height:24px;border-radius:50%;background:var(--accent-light);display:flex;align-items:center;justify-content:center;font-weight:600;color:var(--accent-hover)}.user-name{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text-primary)}.user-caret{transition:transform .15s ease;color:var(--text-tertiary)}.user-caret.open{transform:rotate(180deg)}.user-dropdown{position:absolute;right:0;top:calc(100% + 6px);min-width:220px;background:var(--bg-primary);border:1px solid var(--border-light);border-radius:var(--radius-md);box-shadow:var(--shadow-lg);padding:8px;z-index:1000}.user-email{font-size:12px;color:var(--text-tertiary);margin:4px 6px 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-action{width:100%;text-align:left;padding:8px 10px;border:none;background:var(--bg-secondary);border-radius:var(--radius-sm);cursor:pointer}.user-action:hover{background:var(--bg-hover)}@media (max-width: 768px){.sidebar{position:absolute;left:0;top:0;bottom:0;z-index:100;box-shadow:var(--shadow-lg)}.sidebar.collapsed{transform:translate(-100%)}.sources-grid{grid-template-columns:1fr}}.sidebar-fab{position:fixed;left:12px;top:12px;z-index:1100;width:40px;height:40px;border-radius:20px;border:1px solid var(--border-light);background:var(--bg-primary);box-shadow:var(--shadow-md);display:inline-flex;align-items:center;justify-content:center;font-size:20px;cursor:pointer}.sidebar-fab:hover{background:var(--bg-secondary)}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:var(--bg-secondary)}::-webkit-scrollbar-thumb{background:var(--border-medium);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--text-tertiary)}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:#00000080;display:flex;align-items:center;justify-content:center;z-index:2000;animation:fadeIn .15s ease}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.modal-content{background-color:var(--bg-primary);border-radius:var(--radius-lg);padding:24px;max-width:420px;width:90%;box-shadow:var(--shadow-lg);animation:slideUp .2s ease}@keyframes slideUp{0%{transform:translateY(20px);opacity:0}to{transform:translateY(0);opacity:1}}.modal-title{font-size:18px;font-weight:600;color:var(--text-primary);margin-bottom:12px}.modal-message{font-size:14px;color:var(--text-secondary);line-height:1.6;margin-bottom:20px}.modal-message strong{color:var(--text-primary);font-weight:500}.modal-actions{display:flex;gap:12px;justify-content:flex-end}.auth-container{min-height:100vh;display:grid;place-items:center;background:linear-gradient(160deg,#f7f7f8,#fff 60%);padding:24px}.auth-card{width:100%;max-width:560px;background:var(--bg-primary);border:1px solid var(--border-light);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);padding:28px}.auth-header{display:flex;align-items:center;gap:12px;margin-bottom:16px}.auth-logo{font-size:28px}.auth-headings{display:flex;flex-direction:column}.auth-title{font-size:28px;margin:0}.auth-subtitle{color:var(--text-secondary);margin:0 0 8px}.auth-oauth{margin:8px 0 12px}.auth-divider{text-align:center;position:relative;margin:8px 0 16px;color:var(--text-tertiary)}.auth-divider:before,.auth-divider:after{content:"";position:absolute;top:50%;width:40%;height:1px;background:var(--border-light)}.auth-divider:before{left:0}.auth-divider:after{right:0}.auth-divider span{padding:0 8px;background:var(--bg-primary)}.auth-form{display:grid;gap:10px}.auth-label{font-weight:600}.auth-input{width:100%;padding:10px 12px;border:1px solid var(--border-medium);border-radius:var(--radius-md);outline:none;font-size:14px}.auth-input:focus{border-color:var(--accent-primary);box-shadow:0 0 0 3px #10a37f26}.auth-submit{margin-top:6px}.auth-status{margin-top:10px;font-size:12px;color:var(--text-tertiary)}.auth-note{margin-top:10px;font-size:13px;color:var(--text-primary)}.auth-captcha{min-height:80px}
