body { margin: 0; font-family: -apple-system, sans-serif; background: #f4f4f9; height: 100vh; overflow: hidden; }
#loading-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background:white; display:flex; align-items:center; justify-content:center; font-weight:bold; color:#2c3e50; z-index:1000; }
#app-container { display: flex; height: 100vh; }
.sidebar { width: 260px; background: #fff; border-right: 1px solid #ddd; display: flex; flex-direction: column; padding: 1rem; }
.logo { font-size: 1.2rem; font-weight: bold; color: #2271b1; margin-bottom: 1rem; }
.user-status { font-size: 0.85rem; color: #666; margin-bottom: 0.5rem; }
.limit-box { background: #fff3e0; padding: 0.5rem; border-radius: 4px; color: #e65100; font-size: 0.8rem; font-weight: bold; margin-bottom: 1rem; }
.selected-header { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.5rem; display:flex; justify-content:space-between; }
#selected-list { flex: 1; overflow-y: auto; border-top: 1px solid #eee; padding-top: 0.5rem; }
.empty-msg { color: #999; font-size: 0.8rem; font-style: italic; text-align: center; margin-top: 1rem; }
.sel-item { background: #f8f9fa; padding: 8px; margin-bottom: 5px; border-radius: 4px; border: 1px solid #eee; font-size: 0.8rem; display:flex; justify-content:space-between; }
.sel-remove { color: red; cursor: pointer; font-weight: bold; }
.launch-area { margin-top: 1rem; }
button#launch-btn { width: 100%; padding: 10px; background: #2271b1; color: white; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; }
button#launch-btn:disabled { background: #ccc; cursor: not-allowed; }
.chat-area { flex: 1; display: flex; flex-direction: column; background: #f4f4f9; }
#chat-stream { flex: 1; overflow-y: auto; padding: 2rem; display: flex; flex-direction: column; gap: 1rem; }
.msg { display: flex; }
.msg.ai { justify-content: flex-start; } .msg.user { justify-content: flex-end; }
.bubble { max-width: 70%; padding: 1rem; border-radius: 8px; line-height: 1.5; font-size: 0.95rem; }
.ai .bubble { background: white; border: 1px solid #eee; } .user .bubble { background: #2271b1; color: white; }
.card { background: white; border: 1px solid #ddd; border-left: 4px solid #2271b1; padding: 10px; margin-top: 10px; border-radius: 4px; font-size: 0.9rem; }
.card h4 { margin: 0 0 5px 0; color: #2c3e50; }
.card-actions { display: flex; gap: 10px; margin-top: 10px; }
.btn-view { color: #0073aa; text-decoration: none; font-size: 0.8rem; border: 1px solid #0073aa; padding: 2px 8px; border-radius: 3px; }
.btn-sel { background: #e8f5e9; color: green; border: 1px solid green; padding: 2px 8px; border-radius: 3px; cursor: pointer; font-size: 0.8rem; }
.btn-sel.active { background: green; color: white; }
.input-area { padding: 1.5rem; background: white; border-top: 1px solid #ddd; display: flex; gap: 10px; }
input { flex: 1; padding: 10px; border: 1px solid #ccc; border-radius: 4px; }
button { padding: 10px 20px; background: #2c3e50; color: white; border: none; border-radius: 4px; cursor: pointer; }
/* Card Style */
.citation-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.citation-card h4 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 1.1em;
}
.meta-row {
    font-size: 0.85em;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.6;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
}
.meta-item { margin-right: 15px; display: inline-block; }
.meta-label { font-weight: bold; color: #777; }
.snippet {
    font-size: 0.95em;
    color: #333;
    margin-bottom: 15px;
    border-left: 3px solid #3498db;
    padding-left: 10px;
}
.card-actions {
    display: flex;
    gap: 10px;
}
.btn-pdf {
    background: #e74c3c;
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9em;
}
.btn-dive {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
}
.btn-dive.added { background: #27ae60; }