.layout{display:flex;min-height:100vh}.sidebar{width:260px;background:var(--bg-secondary);border-right:1px solid var(--border-color);display:flex;flex-direction:column;position:sticky;top:0;height:100vh}.sidebar-header{padding:2rem 1.5rem;border-bottom:1px solid var(--border-color)}.sidebar-header h1{font-size:1.4rem;color:var(--accent-primary);margin-bottom:.3rem}.sidebar-header p{font-size:.85rem;color:var(--text-secondary)}.sidebar-nav{flex:1;padding:1rem 0;overflow-y:auto}.nav-link{display:flex;align-items:center;gap:.8rem;padding:.8rem 1.5rem;color:var(--text-secondary);text-decoration:none;transition:all .2s ease;border-left:3px solid transparent}.nav-link:hover{background:var(--bg-tertiary);color:var(--text-primary)}.nav-link.active{background:var(--bg-tertiary);color:var(--accent-primary);border-left-color:var(--accent-primary)}.nav-icon{font-size:1.2rem}.sidebar-footer{padding:1rem 1.5rem;border-top:1px solid var(--border-color)}.status-indicator{display:flex;align-items:center;gap:.5rem;font-size:.85rem;color:var(--text-secondary)}.status-dot{width:8px;height:8px;border-radius:50%;background:var(--text-tertiary)}.status-dot.online{background:var(--success);box-shadow:0 0 8px var(--success)}.main-content{flex:1;background:var(--bg-primary);overflow-y:auto}@media (max-width: 768px){.sidebar{position:fixed;left:-260px;transition:left .3s ease;z-index:100}.sidebar.open{left:0}}.sources-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#000000bf;display:flex;align-items:center;justify-content:center;z-index:1000;padding:2rem}.sources-modal-content{background:var(--bg-primary);border-radius:12px;width:100%;max-width:900px;max-height:90vh;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 10px 40px #0000004d}.sources-modal-header{display:flex;justify-content:space-between;align-items:center;padding:1.5rem 2rem;border-bottom:1px solid var(--border-color);background:var(--bg-secondary)}.sources-modal-header h2{margin:0;color:var(--text-primary);font-size:1.5rem}.close-btn{background:none;border:none;font-size:2rem;cursor:pointer;color:var(--text-secondary);padding:0;width:2rem;height:2rem;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:all .2s ease}.close-btn:hover{background:var(--bg-tertiary);color:var(--text-primary)}.sources-modal-body{padding:0;overflow-y:auto;flex:1}.proposal-reason{padding:1.5rem 2rem;border-bottom:1px solid var(--border-color);background:var(--bg-tertiary)}.proposal-reason p{margin:0;color:var(--text-secondary);font-size:1rem;line-height:1.5}.sources-controls{padding:1.5rem 2rem;border-bottom:1px solid var(--border-color);display:flex;justify-content:space-between;align-items:center;background:var(--bg-secondary)}.selection-controls{display:flex;align-items:center;gap:1rem}.select-all-btn{padding:.5rem 1rem;background:var(--bg-tertiary);border:1px solid var(--border-color);border-radius:6px;color:var(--text-primary);cursor:pointer;font-size:.9rem;transition:all .2s ease}.select-all-btn:hover{background:var(--accent-primary);color:var(--bg-primary)}.selection-count{font-size:.9rem;color:var(--text-secondary);font-weight:500}.action-buttons{display:flex;gap:.75rem}.open-all-btn,.ingest-selected-btn{padding:.75rem 1.25rem;border:none;border-radius:8px;cursor:pointer;font-size:.9rem;font-weight:500;transition:all .2s ease}.open-all-btn{background:var(--bg-tertiary);color:var(--text-primary);border:1px solid var(--border-color)}.open-all-btn:hover:not(:disabled){background:var(--accent-primary);color:var(--bg-primary)}.ingest-selected-btn{background:var(--accent-secondary);color:var(--bg-primary);border:1px solid var(--accent-secondary)}.ingest-selected-btn:hover:not(:disabled){background:var(--bg-primary);color:var(--accent-secondary)}.open-all-btn:disabled,.ingest-selected-btn:disabled{opacity:.5;cursor:not-allowed}.sources-list{padding:0;max-height:400px;overflow-y:auto}.source-item{display:flex;gap:1rem;padding:1.5rem 2rem;border-bottom:1px solid var(--border-color);transition:all .2s ease}.source-item:hover{background:var(--bg-tertiary)}.source-item.selected{background:#ffb8000d;border-left:3px solid var(--accent-secondary)}.source-select{display:flex;align-items:flex-start;padding-top:.25rem}.source-select input[type=checkbox]{width:1.2rem;height:1.2rem;cursor:pointer}.source-info{flex:1;min-width:0}.source-header{display:flex;gap:.75rem;margin-bottom:.5rem}.source-badge{padding:.25rem .75rem;border-radius:12px;font-size:.75rem;font-weight:500}.source-badge.openalex{background:var(--accent-primary);color:var(--bg-primary)}.source-badge.arxiv{background:var(--accent-secondary);color:var(--bg-primary)}.source-badge.unknown{background:var(--text-tertiary);color:var(--bg-primary)}.citation-badge{background:var(--error);color:#fff;padding:.25rem .75rem;border-radius:12px;font-size:.75rem;font-weight:500}.source-title{margin:0 0 .75rem;color:var(--text-primary);font-size:1.1rem;line-height:1.3;font-weight:500}.source-abstract{margin:0;color:var(--text-secondary);font-size:.85rem;line-height:1.4}.source-actions{display:flex;flex-direction:column;gap:.5rem;align-items:flex-end;flex-shrink:0}.action-link{padding:.4rem .8rem;font-size:.8rem;text-decoration:none;border-radius:4px;border:1px solid var(--border-color);background:var(--bg-tertiary);color:var(--text-primary);transition:all .2s ease}.action-link:hover{background:var(--accent-primary);color:var(--bg-primary)}.ingest-results{padding:1.5rem 2rem;border-top:1px solid var(--border-color);background:var(--bg-secondary)}.ingest-results h3{margin:0 0 1rem;color:var(--text-primary);font-size:1.2rem}.results-list{display:flex;flex-direction:column;gap:.75rem;margin-bottom:1.5rem}.result-item{padding:1rem;border-radius:8px;border:1px solid var(--border-color);background:var(--bg-primary)}.result-item.success{border-color:var(--success);background:#00dd770d}.result-item.duplicate{border-color:var(--accent-secondary);background:#ffb8000d}.result-item.error{border-color:var(--error);background:#ff44440d}.result-status{display:flex;align-items:center;gap:.75rem;margin-bottom:.5rem}.status-icon{font-size:1.2rem}.result-title{color:var(--text-primary);font-weight:500;font-size:1rem}.result-details{display:flex;justify-content:space-between;align-items:center}.status-text{color:var(--text-secondary);font-size:.85rem}.fallback-link{padding:.4rem .8rem;font-size:.8rem;text-decoration:none;border-radius:4px;border:1px solid var(--error);background:var(--error);color:#fff;transition:all .2s ease}.fallback-link:hover{background:#fff;color:var(--error)}.results-actions{display:flex;justify-content:center}.continue-btn{padding:.75rem 2rem;background:var(--accent-primary);color:var(--bg-primary);border:none;border-radius:8px;font-size:1rem;font-weight:500;cursor:pointer;transition:all .2s ease}.continue-btn:hover{background:var(--bg-primary);color:var(--accent-primary);border:1px solid var(--accent-primary)}@media (max-width: 768px){.sources-modal-overlay{padding:1rem}.sources-modal-content{max-height:95vh}.sources-modal-header{padding:1rem 1.5rem}.sources-modal-header h2{font-size:1.3rem}.sources-controls{padding:1rem 1.5rem;flex-direction:column;gap:1rem;align-items:stretch}.action-buttons{justify-content:center}.source-item{padding:1rem 1.5rem;flex-direction:column;gap:.75rem}.source-select{align-self:flex-start}.source-actions{align-self:flex-end;flex-direction:row;gap:.5rem}.ingest-results{padding:1rem 1.5rem}}.rag-chat{display:flex;flex-direction:column;height:100vh}.chat-header{display:flex;justify-content:space-between;align-items:center;padding:1.5rem 2rem;border-bottom:1px solid var(--border-color);background:var(--bg-secondary)}.chat-header h2{font-size:1.5rem;color:var(--text-primary)}.chat-controls{display:flex;gap:1rem;align-items:center}.k-input{width:60px;margin-left:.5rem;padding:.4rem}.clear-btn{padding:.4rem 1rem}.external-toggle select{background:var(--bg-tertiary);color:var(--text-primary);border:1px solid var(--border-color);padding:.4rem .8rem;border-radius:6px;cursor:pointer;font-size:.9rem}.external-toggle select:hover{border-color:var(--accent-primary)}.hybrid-badge{display:inline-block;margin-top:.8rem;padding:.4rem .8rem;background:#00d4aa1a;border:1px solid var(--accent-primary);border-radius:6px;font-size:.85rem;color:var(--accent-primary)}.source-badge{display:inline-block;padding:.2rem .6rem;border-radius:4px;font-size:.75rem;font-weight:600;margin-right:.5rem;text-transform:uppercase}.source-badge.local{background:#00d4aa33;color:var(--accent-primary);border:1px solid var(--accent-primary)}.source-badge.external{background:#fa03;color:var(--warning);border:1px solid var(--warning)}.sources.external summary{color:var(--warning)}.authors{font-size:.8rem;color:var(--accent-primary);margin-top:.2rem}.abstract{font-size:.82rem;color:var(--text-secondary);margin-top:.3rem;font-style:italic}.messages-container{flex:1;overflow-y:auto;padding:2rem;display:flex;flex-direction:column;gap:1.5rem}.empty-state{flex:1;display:flex;align-items:center;justify-content:center;color:var(--text-secondary);font-size:1.1rem}.message{display:flex;flex-direction:column;gap:.5rem;max-width:80%;animation:slideIn .2s ease}@keyframes slideIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.message.user{align-self:flex-end}.message.assistant{align-self:flex-start}.message-content{padding:1rem 1.2rem;border-radius:12px;line-height:1.6}.message.user .message-content{background:var(--accent-primary);color:var(--bg-primary)}.message.assistant .message-content{background:var(--bg-secondary);color:var(--text-primary);border:1px solid var(--border-color)}.message.loading .message-content{background:var(--bg-tertiary)}.loading-dots{display:inline-block;animation:pulse 1.5s ease-in-out infinite}@keyframes pulse{0%,to{opacity:.5}50%{opacity:1}}.sources{margin-top:.5rem;padding:.8rem;background:var(--bg-tertiary);border-radius:8px;font-size:.9rem}.sources summary{cursor:pointer;font-weight:500;color:var(--accent-primary);margin-bottom:.5rem}.sources ul{list-style:none;padding:0;margin-top:.5rem}.sources li{padding:.5rem 0;border-top:1px solid var(--border-color)}.sources li:first-child{border-top:none}.sources strong{color:var(--text-primary)}.sources p{color:var(--text-secondary);font-size:.85rem;margin-top:.3rem}.chat-input-form{display:flex;gap:1rem;padding:1.5rem 2rem;border-top:1px solid var(--border-color);background:var(--bg-secondary)}.chat-input{flex:1;padding:.8rem 1rem;font-size:1rem}.chat-input:disabled{opacity:.6;cursor:not-allowed}.external-sources-section{margin-top:1rem;padding:1rem;background:var(--bg-tertiary);border-radius:8px;border:1px solid var(--border-color)}.external-sources-header h4{margin:0 0 1rem;color:var(--accent-primary);font-size:1.1rem}.external-sources-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(400px,1fr));gap:1rem}.external-source-card{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:8px;padding:1rem;transition:all .2s ease}.external-source-card:hover{border-color:var(--accent-primary);transform:translateY(-2px);box-shadow:0 4px 12px #00d4aa1a}.source-card-header{display:flex;gap:.5rem;margin-bottom:.5rem}.source-badge.external{background:var(--accent-secondary);color:var(--bg-primary);padding:.2rem .6rem;border-radius:12px;font-size:.75rem;font-weight:500}.citation-badge{background:var(--error);color:#fff;padding:.2rem .6rem;border-radius:12px;font-size:.75rem;font-weight:500}.source-title{margin:0 0 .5rem;color:var(--text-primary);font-size:1rem;line-height:1.3}.source-meta{margin-bottom:.75rem}.source-authors{margin:0 0 .25rem;color:var(--text-secondary);font-size:.85rem;font-style:italic}.source-venue-year{margin:0;color:var(--text-tertiary);font-size:.8rem}.source-abstract{margin:0 0 1rem;color:var(--text-secondary);font-size:.85rem;line-height:1.4}.source-actions{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}.source-link,.add-to-library-btn{padding:.4rem .8rem;font-size:.8rem;text-decoration:none;border-radius:4px;border:1px solid var(--border-color);background:var(--bg-primary);color:var(--text-primary);cursor:pointer;transition:all .2s ease}.source-link:hover,.add-to-library-btn:hover{background:var(--accent-primary);color:var(--bg-primary);border-color:var(--accent-primary)}.pdf-link{background:var(--bg-tertiary)}.add-to-library-btn{background:var(--accent-secondary);color:var(--bg-primary);border-color:var(--accent-secondary)}.add-to-library-btn:hover{background:var(--bg-primary);color:var(--accent-secondary)}@media (max-width: 768px){.external-sources-grid{grid-template-columns:1fr}.source-actions{flex-direction:column}.source-link,.add-to-library-btn{text-align:center}}.message.system{background:var(--accent-secondary);border:1px solid var(--accent-secondary);color:var(--bg-primary);padding:1rem 1.5rem;margin:1rem 0;border-radius:12px;font-weight:500;text-align:center}.message.system:before{content:"💡 ";font-size:1.2rem}.message.improved{border-left:4px solid var(--accent-primary);background:#00d4aa0d}.message.improved:before{content:"✨ ";color:var(--accent-primary);font-size:1.1rem}.message.error{background:#ff44441a;border:1px solid var(--error);color:var(--error)}.message.error:before{content:"⚠️ "}.ingest-page{padding:2rem}.page-header{margin-bottom:2rem}.page-header h2{font-size:1.8rem;margin-bottom:.5rem}.page-header p{color:var(--text-secondary)}.upload-type-selector{display:flex;gap:1rem;margin-bottom:1.5rem;max-width:600px}.upload-type-selector button{flex:1;padding:.8rem;background:var(--bg-secondary);border:1px solid var(--border-color);color:var(--text-secondary);transition:all .2s ease}.upload-type-selector button.active{background:var(--accent-primary);color:var(--bg-primary);border-color:var(--accent-primary)}.upload-section{max-width:600px}.upload-box{position:relative}.file-input{position:absolute;opacity:0;pointer-events:none}.file-label{display:flex;flex-direction:column;align-items:center;gap:1rem;padding:3rem;border:2px dashed var(--border-color);border-radius:12px;background:var(--bg-secondary);cursor:pointer;transition:all .2s ease}.file-label:hover{border-color:var(--accent-primary);background:var(--bg-tertiary)}.file-label.disabled{opacity:.5;cursor:not-allowed}.upload-icon{font-size:3rem}.file-hint{font-size:.85rem;color:var(--text-tertiary)}.result-message{margin-top:1.5rem;padding:1rem;border-radius:8px;display:flex;align-items:center;gap:.8rem}.result-message.success{background:#00dd771a;border:1px solid var(--success);color:var(--success)}.result-message.error{background:#ff44441a;border:1px solid var(--error);color:var(--error)}.upload-progress{margin-top:1.5rem;padding:1rem;background:var(--bg-tertiary);border-radius:8px}.progress-bar{width:100%;height:8px;background:var(--bg-secondary);border-radius:4px;overflow:hidden;margin-bottom:.5rem}.progress-fill{height:100%;background:var(--accent-primary);transition:width .3s ease}.progress-text{font-size:.9rem;color:var(--text-secondary)}.error-details{margin-top:.5rem;padding:.5rem;background:#ff44440d;border-radius:4px;font-size:.85rem}.error-details summary{cursor:pointer;margin-bottom:.5rem;color:var(--error)}.error-details ul{margin:.5rem 0 0 1.5rem;padding:0;list-style:disc}.error-details li{margin:.25rem 0;color:var(--text-secondary)}.search-section{max-width:none}.search-box{display:flex;gap:1rem;margin-bottom:2rem}.search-input{flex:1;padding:.8rem 1rem;font-size:1rem;border:1px solid var(--border-color);border-radius:8px;background:var(--bg-primary);color:var(--text-primary)}.search-input:focus{outline:none;border-color:var(--accent-primary)}.search-btn{padding:.8rem 1.5rem;font-size:1rem;background:var(--accent-primary);color:var(--bg-primary);border:none;border-radius:8px;cursor:pointer;transition:all .2s ease}.search-btn:hover:not(:disabled){background:var(--bg-primary);color:var(--accent-primary);border:1px solid var(--accent-primary)}.search-btn:disabled{opacity:.6;cursor:not-allowed}.search-results{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:8px;padding:1.5rem}.results-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;padding-bottom:1rem;border-bottom:1px solid var(--border-color)}.results-header h3{margin:0;color:var(--text-primary)}.batch-actions{display:flex;align-items:center;gap:1rem}.selected-count{font-size:.9rem;color:var(--text-secondary)}.batch-ingest-btn{padding:.6rem 1rem;font-size:.9rem;background:var(--accent-secondary);color:var(--bg-primary);border:1px solid var(--accent-secondary);border-radius:6px;cursor:pointer;transition:all .2s ease}.batch-ingest-btn:hover:not(:disabled){background:var(--bg-primary);color:var(--accent-secondary)}.batch-ingest-btn:disabled{opacity:.6;cursor:not-allowed}.papers-list{display:flex;flex-direction:column;gap:1rem}.paper-item{display:flex;gap:1rem;padding:1rem;background:var(--bg-primary);border:1px solid var(--border-color);border-radius:6px;transition:all .2s ease}.paper-item:hover{border-color:var(--accent-primary);transform:translateY(-1px);box-shadow:0 2px 8px #00d4aa1a}.paper-item.selected{border-color:var(--accent-secondary);background:#ffb8000d}.paper-item.duplicate{border-color:var(--text-tertiary);background:#8080800d;opacity:.7}.paper-select{display:flex;flex-direction:column;align-items:flex-start;gap:.5rem;padding-top:.3rem}.duplicate-indicator{font-size:.75rem;color:var(--text-tertiary);background:var(--bg-tertiary);padding:.2rem .5rem;border-radius:10px;white-space:nowrap}.paper-info{flex:1;min-width:0}.paper-title{margin:0 0 .5rem;color:var(--text-primary);font-size:1rem;line-height:1.3}.paper-authors{margin:0 0 .25rem;color:var(--text-secondary);font-size:.85rem;font-style:italic}.paper-meta{margin:0 0 .5rem;color:var(--text-tertiary);font-size:.8rem}.paper-abstract{margin:0;color:var(--text-secondary);font-size:.85rem;line-height:1.4}.paper-actions{display:flex;gap:.5rem;align-items:flex-start;flex-shrink:0}.paper-actions a{padding:.4rem .8rem;font-size:.8rem;text-decoration:none;border-radius:4px;border:1px solid var(--border-color);background:var(--bg-tertiary);color:var(--text-primary);transition:all .2s ease}.paper-actions a:hover{background:var(--accent-primary);color:var(--bg-primary)}@media (max-width: 768px){.search-box{flex-direction:column}.results-header{flex-direction:column;gap:1rem;align-items:flex-start}.batch-actions{width:100%;justify-content:space-between}.paper-item{flex-direction:column;gap:.75rem}.paper-select{align-self:flex-start}.paper-actions{align-self:flex-end}}.library-page{padding:2rem}.page-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:2rem}.header-actions{display:flex;flex-direction:column;gap:.75rem;align-items:flex-end}.export-buttons{display:flex;gap:.5rem}.export-btn{padding:.5rem 1rem;font-size:.85rem;border:1px solid var(--border-color);border-radius:6px;background:var(--bg-tertiary);color:var(--text-primary);cursor:pointer;transition:all .2s ease}.export-btn:hover:not(:disabled){background:var(--accent-primary);color:var(--bg-primary);border-color:var(--accent-primary)}.export-btn:disabled{opacity:.5;cursor:not-allowed}.bibtex-btn:hover:not(:disabled){background:var(--accent-secondary);border-color:var(--accent-secondary)}.refresh-btn{padding:.6rem 1.2rem}.empty-library{text-align:center;padding:4rem 2rem;color:var(--text-secondary)}.empty-library .hint{margin-top:.5rem;font-size:.9rem;color:var(--text-tertiary)}.documents-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(350px,1fr));gap:1.5rem;margin-top:2rem}.document-card{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:8px;padding:1.5rem;transition:all .2s ease}.document-card:hover{border-color:var(--accent-primary);transform:translateY(-2px);box-shadow:0 4px 12px #00d4aa1a}.doc-header{display:flex;gap:1rem;margin-bottom:1rem}.doc-icon{font-size:2rem;flex-shrink:0}.doc-title-section{flex:1;min-width:0}.doc-title{font-size:1.1rem;margin-bottom:.3rem;color:var(--text-primary);overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.doc-author{font-size:.9rem;color:var(--accent-primary);margin-bottom:.3rem}.doc-summary{font-size:.85rem;color:var(--text-secondary);line-height:1.4;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.doc-meta{display:flex;flex-wrap:wrap;gap:1rem;padding:.8rem 0;margin:.8rem 0;border-top:1px solid var(--border-color);border-bottom:1px solid var(--border-color);font-size:.85rem;color:var(--text-tertiary)}.doc-filename{font-family:monospace;color:var(--text-secondary)}.doc-actions{display:flex;gap:.8rem;margin-top:1rem}.extract-btn,.delete-btn{flex:1;padding:.6rem;font-size:.9rem}.extract-btn{background:var(--bg-tertiary);color:var(--accent-primary);border-color:var(--accent-primary)}.extract-btn:hover{background:var(--accent-primary);color:var(--bg-primary)}.delete-btn{background:var(--bg-tertiary);color:var(--error);border-color:var(--error)}.delete-btn:hover{background:var(--error);color:#fff}.extract-btn:disabled,.delete-btn:disabled{opacity:.5;cursor:not-allowed}.related-btn{flex:1;padding:.6rem;font-size:.9rem;background:var(--bg-tertiary);color:var(--accent-secondary);border:1px solid var(--accent-secondary);border-radius:4px;cursor:pointer;transition:all .2s ease}.related-btn:hover{background:var(--accent-secondary);color:var(--bg-primary)}.related-btn:disabled{opacity:.5;cursor:not-allowed}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#000000b3;display:flex;align-items:center;justify-content:center;z-index:1000;padding:2rem}.modal-content{background:var(--bg-primary);border-radius:8px;width:100%;max-width:800px;max-height:80vh;overflow:hidden;display:flex;flex-direction:column}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:1.5rem;border-bottom:1px solid var(--border-color)}.modal-header h2{margin:0;color:var(--text-primary)}.close-btn{background:none;border:none;font-size:2rem;cursor:pointer;color:var(--text-secondary);padding:0;width:2rem;height:2rem;display:flex;align-items:center;justify-content:center}.close-btn:hover{color:var(--text-primary)}.modal-body{padding:1.5rem;overflow-y:auto;flex:1}.related-section{margin-bottom:2rem}.related-section h3{margin:0 0 1rem;color:var(--text-primary);border-bottom:1px solid var(--border-color);padding-bottom:.5rem}.related-papers{display:flex;flex-direction:column;gap:1rem}.related-paper-card{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:6px;padding:1rem;transition:all .2s ease}.related-paper-card:hover{border-color:var(--accent-primary);transform:translateY(-1px);box-shadow:0 2px 8px #00d4aa1a}.related-paper-card h4{margin:0 0 .5rem;color:var(--text-primary);font-size:1rem}.paper-authors{margin:0 0 .5rem;color:var(--text-secondary);font-size:.9rem}.paper-meta{margin:0 0 .5rem;color:var(--text-tertiary);font-size:.85rem}.paper-abstract{margin:0 0 1rem;color:var(--text-secondary);font-size:.9rem;line-height:1.4}.paper-actions{display:flex;gap:1rem;align-items:center}.paper-actions a,.paper-actions button{padding:.4rem .8rem;font-size:.85rem;text-decoration:none;border-radius:4px;border:1px solid var(--border-color);background:var(--bg-tertiary);color:var(--text-primary);cursor:pointer;transition:all .2s ease}.paper-actions a:hover,.paper-actions button:hover{background:var(--accent-primary);color:var(--bg-primary);border-color:var(--accent-primary)}.no-related{text-align:center;color:var(--text-secondary);font-style:italic;padding:2rem}@media (max-width: 768px){.documents-grid{grid-template-columns:1fr}.modal-overlay{padding:1rem}.modal-content{max-height:90vh}.paper-actions{flex-direction:column;gap:.5rem}.paper-actions a,.paper-actions button{text-align:center}}.discover-page{padding:2rem;max-width:1200px;margin:0 auto}.page-header h2{margin:0 0 .5rem;color:var(--text-primary)}.page-header p{margin:0;color:var(--text-secondary)}.discover-content{margin-top:2rem;display:flex;flex-direction:column;gap:3rem}.stats-section{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:12px;padding:2rem}.stats-section h3{margin:0 0 1.5rem;color:var(--text-primary);font-size:1.5rem}.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1.5rem;margin-bottom:2rem}.stat-card{background:var(--bg-primary);border:1px solid var(--border-color);border-radius:8px;padding:1.5rem;text-align:center;transition:all .2s ease}.stat-card:hover{border-color:var(--accent-primary);transform:translateY(-2px);box-shadow:0 4px 12px #00d4aa1a}.stat-number{font-size:2.5rem;font-weight:700;color:var(--accent-primary);margin-bottom:.5rem}.stat-label{color:var(--text-secondary);font-size:.9rem;font-weight:500}.highlight-card{background:var(--bg-primary);border:2px solid var(--accent-secondary);border-radius:8px;padding:1.5rem}.highlight-card h4{margin:0 0 1rem;color:var(--accent-secondary);font-size:1.2rem}.highlight-title{margin:0 0 .5rem;color:var(--text-primary);font-size:1.1rem;font-weight:500}.highlight-meta{margin:0;color:var(--text-secondary);font-size:.9rem}.suggestions-section,.gaps-section,.key-papers-section{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:12px;padding:2rem}.suggestions-section h3,.gaps-section h3,.key-papers-section h3{margin:0 0 .5rem;color:var(--text-primary);font-size:1.5rem}.section-description{margin:0 0 2rem;color:var(--text-secondary);font-size:.95rem;line-height:1.5}.suggestions-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(350px,1fr));gap:1.5rem}.suggestion-card{background:var(--bg-primary);border:1px solid var(--border-color);border-radius:8px;padding:1.5rem;transition:all .2s ease}.suggestion-card:hover{border-color:var(--accent-primary);transform:translateY(-2px);box-shadow:0 4px 12px #00d4aa1a}.suggestion-card.priority-high{border-left:4px solid var(--accent-secondary)}.suggestion-card.priority-medium{border-left:4px solid var(--accent-primary)}.suggestion-card.priority-low{border-left:4px solid var(--text-tertiary)}.suggestion-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.priority-badge{padding:.25rem .75rem;border-radius:12px;font-size:.75rem;font-weight:700}.priority-badge.high{background:var(--accent-secondary);color:var(--bg-primary)}.priority-badge.medium{background:var(--accent-primary);color:var(--bg-primary)}.priority-badge.low{background:var(--bg-tertiary);color:var(--text-secondary)}.citation-count{color:var(--text-tertiary);font-size:.85rem;font-weight:500}.suggestion-title{margin:0 0 .75rem;color:var(--text-primary);font-size:1.1rem;line-height:1.3}.suggestion-reason{margin:0 0 1rem;color:var(--text-secondary);font-size:.9rem;line-height:1.4}.suggestion-actions{display:flex;gap:.75rem;align-items:center}.action-link,.add-to-library-btn{padding:.5rem 1rem;font-size:.85rem;text-decoration:none;border-radius:6px;border:1px solid var(--border-color);background:var(--bg-tertiary);color:var(--text-primary);cursor:pointer;transition:all .2s ease}.action-link:hover,.add-to-library-btn:hover{background:var(--accent-primary);color:var(--bg-primary);border-color:var(--accent-primary)}.gaps-list{display:flex;flex-direction:column;gap:1rem}.gap-item{display:flex;justify-content:space-between;align-items:center;background:var(--bg-primary);border:1px solid var(--border-color);border-radius:8px;padding:1.5rem;transition:all .2s ease}.gap-item:hover{border-color:var(--accent-primary);transform:translateY(-1px);box-shadow:0 2px 8px #00d4aa1a}.gap-info h4{margin:0 0 .5rem;color:var(--text-primary);font-size:1.1rem}.gap-reason{margin:0;color:var(--text-secondary);font-size:.9rem}.gap-actions{flex-shrink:0}.key-papers-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:1.5rem}.key-paper-card{background:var(--bg-primary);border:1px solid var(--border-color);border-radius:8px;padding:1.5rem;position:relative;transition:all .2s ease}.key-paper-card:hover{border-color:var(--accent-primary);transform:translateY(-2px);box-shadow:0 4px 12px #00d4aa1a}.key-paper-rank{position:absolute;top:1rem;right:1rem;background:var(--accent-primary);color:var(--bg-primary);width:2rem;height:2rem;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:.8rem;font-weight:700}.key-paper-title{margin:0 0 1rem;color:var(--text-primary);font-size:1.1rem;line-height:1.3;padding-right:3rem}.key-paper-meta{display:flex;gap:1rem;margin-bottom:.75rem}.connections,.citations{font-size:.85rem;color:var(--text-tertiary);font-weight:500}.connections{color:var(--accent-primary)}.citations{color:var(--accent-secondary)}.key-paper-reason{margin:0;color:var(--text-secondary);font-size:.9rem;line-height:1.4}.empty-discover{text-align:center;padding:4rem 2rem;background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:12px}.empty-discover h3{margin:0 0 1rem;color:var(--text-primary)}.empty-discover p{margin:0 0 2rem;color:var(--text-secondary);max-width:600px;margin-left:auto;margin-right:auto;line-height:1.5}.empty-actions{display:flex;gap:1rem;justify-content:center;align-items:center}.empty-actions .action-link{padding:.75rem 1.5rem;background:var(--accent-primary);color:var(--bg-primary);text-decoration:none;border-radius:8px;font-weight:500;transition:all .2s ease}.empty-actions .action-link:hover{background:var(--bg-primary);color:var(--accent-primary);border:1px solid var(--accent-primary)}.refresh-btn{padding:.75rem 1.5rem;background:var(--bg-tertiary);color:var(--text-primary);border:1px solid var(--border-color);border-radius:8px;cursor:pointer;font-size:.9rem;transition:all .2s ease}.refresh-btn:hover{background:var(--accent-primary);color:var(--bg-primary)}.error-message{text-align:center;padding:4rem 2rem;background:#ff44441a;border:1px solid var(--error);border-radius:12px}.error-message h2{margin:0 0 1rem;color:var(--error)}.error-message p{margin:0 0 2rem;color:var(--text-secondary)}.error-message button{padding:.75rem 1.5rem;background:var(--error);color:#fff;border:none;border-radius:8px;cursor:pointer;font-size:.9rem;transition:all .2s ease}.error-message button:hover{background:#c00}@media (max-width: 768px){.discover-page{padding:1rem}.stats-grid{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:1rem}.suggestions-grid,.key-papers-grid{grid-template-columns:1fr}.gap-item{flex-direction:column;gap:1rem;align-items:flex-start}.gap-actions{align-self:stretch}.gap-actions .add-to-library-btn{width:100%;text-align:center}.empty-actions{flex-direction:column}.suggestion-actions,.gap-actions{flex-direction:column;gap:.5rem}.action-link,.add-to-library-btn{text-align:center}}.settings-page{padding:2rem}.settings-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:1.5rem;margin-top:2rem;margin-bottom:2rem}.status-card{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:8px;padding:1.5rem}.status-card h3{font-size:1.1rem;margin-bottom:1rem;color:var(--accent-primary)}.status-row{display:flex;justify-content:space-between;padding:.5rem 0;border-bottom:1px solid var(--border-color)}.status-row:last-child{border-bottom:none}.status-row span:first-child{color:var(--text-secondary)}.status-ok{color:var(--success)}.status-error{color:var(--error)}.refresh-btn{margin-top:1rem}.app{min-height:100vh;display:flex;flex-direction:column}:root{--bg-primary: #0a0a0a;--bg-secondary: #1a1a1a;--bg-tertiary: #2a2a2a;--bg-hover: #333333;--text-primary: #e0e0e0;--text-secondary: #a0a0a0;--text-tertiary: #707070;--accent-primary: #00d4aa;--accent-secondary: #00b894;--border-color: #404040;--error: #ff4444;--warning: #ffaa00;--success: #00dd77;font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif;line-height:1.6;font-weight:400;color-scheme:dark;color:var(--text-primary);background-color:var(--bg-primary);font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}*{margin:0;padding:0;box-sizing:border-box}body{margin:0;min-height:100vh;background:var(--bg-primary)}#root{min-height:100vh;display:flex;flex-direction:column}button{background:var(--bg-tertiary);color:var(--text-primary);border:1px solid var(--border-color);padding:.6rem 1.2rem;border-radius:6px;cursor:pointer;font-size:.95rem;font-weight:500;transition:all .2s ease}button:hover{background:var(--bg-hover);border-color:var(--accent-primary)}button:active{transform:translateY(1px)}button.primary{background:var(--accent-primary);color:var(--bg-primary);border-color:var(--accent-primary)}button.primary:hover{background:var(--accent-secondary);border-color:var(--accent-secondary)}button:disabled{opacity:.5;cursor:not-allowed}input,textarea{background:var(--bg-secondary);color:var(--text-primary);border:1px solid var(--border-color);padding:.6rem;border-radius:6px;font-size:.95rem;font-family:inherit}input:focus,textarea:focus{outline:none;border-color:var(--accent-primary);box-shadow:0 0 0 2px #00d4aa1a}a{color:var(--accent-primary);text-decoration:none}a:hover{text-decoration:underline}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:var(--bg-secondary)}::-webkit-scrollbar-thumb{background:var(--bg-tertiary);border-radius:5px}::-webkit-scrollbar-thumb:hover{background:var(--bg-hover)}
