:root{font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;--message-font-size: .95rem}html[data-theme=dark],.theme-dark{color-scheme:dark;--bg-primary: #020617;--bg-secondary: #0f172a;--bg-tertiary: #1e293b;--bg-sidebar: rgba(8, 11, 22, .92);--bg-input: rgba(15, 23, 42, .9);--bg-message-user: linear-gradient(135deg, #3057e1, #7c3aed);--bg-message-assistant: rgba(15, 23, 42, .85);--border-color: rgba(148, 163, 184, .12);--border-color-light: rgba(148, 163, 184, .2);--text-primary: #f8fafc;--text-secondary: #e2e8f0;--text-muted: rgba(226, 232, 240, .6);--text-muted-light: rgba(226, 232, 240, .5);--text-gray: #94a3b8;--badge-text: #c7d2fe;--streaming-indicator-color: rgba(94, 234, 212, .8);--shadow: rgba(0, 0, 0, .5);background-color:var(--bg-primary);color:var(--text-secondary)}html[data-theme=dim],.theme-dim{color-scheme:dark;--bg-primary: #0f172a;--bg-secondary: #1e293b;--bg-tertiary: #334155;--bg-sidebar: rgba(15, 23, 42, .92);--bg-input: rgba(30, 41, 59, .9);--bg-message-user: linear-gradient(135deg, #4f5edb, #8b5dd1);--bg-message-assistant: rgba(30, 41, 59, .85);--border-color: rgba(148, 163, 184, .18);--border-color-light: rgba(148, 163, 184, .25);--text-primary: #f1f5f9;--text-secondary: #cbd5e1;--text-muted: rgba(203, 213, 225, .65);--text-muted-light: rgba(203, 213, 225, .55);--text-gray: #94a3b8;--badge-text: #c7d2fe;--streaming-indicator-color: rgba(94, 234, 212, .8);--shadow: rgba(0, 0, 0, .4);background-color:var(--bg-primary);color:var(--text-secondary)}html[data-theme=light],.theme-light{color-scheme:light;--bg-primary: #ffffff;--bg-secondary: #f8fafc;--bg-tertiary: #e2e8f0;--bg-sidebar: rgba(248, 250, 252, .98);--bg-input: rgba(248, 250, 252, .95);--bg-message-user: linear-gradient(135deg, #3b82f6, #8b5cf6);--bg-message-assistant: rgba(248, 250, 252, .95);--border-color: rgba(100, 116, 139, .15);--border-color-light: rgba(100, 116, 139, .2);--text-primary: #0f172a;--text-secondary: #1e293b;--text-muted: rgba(30, 41, 59, .6);--text-muted-light: rgba(30, 41, 59, .5);--text-gray: #64748b;--badge-text: #4f46e5;--streaming-indicator-color: #0891b2;--shadow: rgba(0, 0, 0, .1);background-color:var(--bg-primary);color:var(--text-secondary)}*{box-sizing:border-box}html,body,#root{height:100%;margin:0;background:var(--bg-primary)}body{overflow:hidden}.status-indicator{position:fixed;bottom:20px;right:20px;z-index:1000}.status-badge{background:#0f172af2;border:1px solid rgba(148,163,184,.2);border-radius:12px;padding:12px 16px;box-shadow:0 8px 32px #0006;-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);cursor:pointer;transition:all .2s ease;min-width:200px;max-width:400px}.status-badge:hover{border-color:#94a3b84d;box-shadow:0 12px 40px #00000080}.status-badge.expanded{max-width:500px}.status-badge.idle{opacity:.8;background:#0f172acc;min-width:160px}.status-badge.idle:hover{opacity:1;background:#0f172af2}.status-item{display:flex;align-items:center;gap:8px;margin-bottom:6px}.status-item:last-child{margin-bottom:0}.status-icon{font-size:14px;flex-shrink:0}.status-text{font-size:13px;color:var(--text-secondary);flex:1}.status-detail{color:var(--text-gray);font-size:12px}.upload-status .status-icon{animation:pulse 2s ease-in-out infinite}.sync-status .status-icon{animation:spin 2s linear infinite}.sync-status .status-icon:has-text("✅"),.sync-status .status-icon:has-text("❌"){animation:none}.idle-status .status-icon{animation:none;opacity:.7}.idle-status .status-text{font-size:12px;opacity:.8}.status-details{margin-top:12px;padding-top:12px;border-top:1px solid rgba(148,163,184,.15)}.sync-details{margin-bottom:12px}.detail-row{display:flex;justify-content:space-between;font-size:12px;margin-bottom:4px;color:var(--text-secondary)}.detail-row span:first-child{color:var(--text-gray);font-weight:500}.failure-reasons{margin-top:8px;font-size:11px;color:#fca5a5}.failure-reason{margin-top:2px;padding:2px 6px;background:#ef44441a;border-radius:4px}.last-sync{font-size:11px;color:var(--text-gray);margin-bottom:8px}.status-actions{display:flex;gap:8px}.sync-button{background:linear-gradient(135deg,#3b82f6,#1e40af);border:none;border-radius:6px;padding:6px 12px;color:#fff;font-size:12px;font-weight:500;cursor:pointer;transition:all .2s ease;flex:1}.sync-button:hover:not(:disabled){background:linear-gradient(135deg,#2563eb,#1d4ed8);transform:translateY(-1px)}.sync-button:disabled{background:#374151;cursor:not-allowed;opacity:.6}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.chat-app{height:100%;display:flex;background:var(--bg-primary)}.sidebar{width:280px;display:flex;flex-direction:column;padding:24px 20px;background:var(--bg-sidebar);border-right:1px solid var(--border-color);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px)}.sidebar-header{margin-bottom:20px}.sidebar-title{margin:0;font-size:1.15rem;font-weight:600;color:var(--text-primary)}.sidebar-new-chat{background:linear-gradient(135deg,#3057e1,#7c3aed);border:none;border-radius:999px;padding:.45rem 1rem;color:#fff;font-size:.85rem;font-weight:600;cursor:pointer;transition:transform .15s ease,box-shadow .15s ease}.sidebar-new-chat:disabled{opacity:.6;cursor:not-allowed}.sidebar-new-chat:not(:disabled):hover{transform:translateY(-1px);box-shadow:0 8px 22px #4f46e559}.sidebar-body{flex:1;overflow-y:auto;padding-right:4px}.sidebar-body::-webkit-scrollbar{width:6px}.sidebar-body::-webkit-scrollbar-thumb{background:#94a3b840;border-radius:999px}.sidebar-empty{color:var(--text-muted);font-size:.9rem;padding-top:40px}.conversation-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px;align-items:center}.conversation-item{width:100%;border:1px solid transparent;border-radius:16px;padding:12px 14px;display:flex;flex-direction:column;align-items:flex-start;gap:6px;background:var(--bg-tertiary);color:var(--text-secondary);text-align:left;cursor:pointer;transition:border-color .2s ease,background .2s ease}.conversation-item:hover{border-color:#4f46e559}.conversation-item.active{background:linear-gradient(135deg,#3057e159,#7c3aed59);border-color:#4f46e580}.conversation-title{font-size:.95rem;font-weight:600;color:var(--text-primary)}.conversation-meta{font-size:.75rem;color:var(--text-muted)}.sidebar-footer{display:flex;flex-direction:column;gap:12px;margin-top:24px;font-size:.8rem;color:var(--text-muted)}.sidebar-settings-button{background:#1e293b99;border:1px solid rgba(148,163,184,.2);border-radius:8px;padding:8px;color:var(--text-muted);cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center;width:fit-content}.sidebar-settings-button:hover{background:#1e293bcc;border-color:#94a3b866;color:var(--text-primary);transform:scale(1.05)}.sidebar-footer-info{display:flex;flex-direction:column;gap:.45rem}.sidebar-footer .badge{align-self:flex-start;background:#3057e12e;padding:.15rem .6rem;border-radius:999px;font-size:.7rem;font-weight:600;color:var(--badge-text)}.sidebar-endpoint{word-break:break-all}.chat-main{flex:1;display:flex;flex-direction:column;position:relative;background:var(--bg-primary);transition:margin-right .3s ease}.chat-main.with-panel{margin-right:450px}.chat-header{padding:24px 32px;border-bottom:1px solid var(--border-color);display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.chat-header-info h2{margin:0;font-size:1.4rem;font-weight:600;color:var(--text-primary)}.chat-header-meta{margin:6px 0 0;color:var(--text-muted);font-size:.9rem;max-width:520px}.tutorial-button{width:40px;height:40px;background:#3b82f61a;border:1px solid rgba(59,130,246,.3);border-radius:8px;color:#3b82f6;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0}.tutorial-button:hover{background:#3b82f626;border-color:#3b82f680;transform:translateY(-1px)}.tutorial-button:active{transform:translateY(0)}.__floater__arrow polygon{fill:#1e293b!important}.react-joyride__tooltip h3{font-size:1.15rem;font-weight:600;color:#f1f5f9;margin:0 0 12px}.react-joyride__tooltip p{color:#cbd5e1;line-height:1.6;margin:0 0 12px}.react-joyride__tooltip ul{color:#cbd5e1;line-height:1.7}.react-joyride__tooltip ul li{margin-bottom:6px}.react-joyride__tooltip strong{color:#f1f5f9;font-weight:600}.react-joyride__tooltip__footer>div:first-child{color:#94a3b8!important;font-size:.85rem}button[data-action=primary]:hover{background:#2563eb!important;transform:translateY(-1px)}button[data-action=back]:hover{background:#94a3b81a!important;border-color:#94a3b84d!important}button[data-action=skip]:hover{color:#cbd5e1!important}.chat-thread{flex:1;overflow-y:auto;padding:32px 16px 120px;display:flex;flex-direction:column;gap:18px;position:relative;align-items:center}.chat-thread::-webkit-scrollbar{width:8px}.chat-thread::-webkit-scrollbar-thumb{background:#94a3b833;border-radius:999px}.hero-empty{margin:auto;text-align:center;max-width:520px;color:var(--text-muted)}.hero-empty h3{margin-bottom:12px;font-size:1.35rem;font-weight:600;color:var(--text-primary)}.chat-message{width:min(100%,720px);max-width:720px;margin:0 auto;padding:18px 20px;border-radius:20px;position:relative;display:flex;flex-direction:column;gap:10px;border:1px solid transparent;box-shadow:0 15px 35px #0f172a59}.chat-message.user{background:var(--bg-message-user);border-color:var(--border-color-light);color:#fff}.chat-message.assistant{background:var(--bg-message-assistant);border-color:var(--border-color-light);color:var(--text-secondary)}.chat-message.streaming{border-style:dashed;border-color:#5eead48c}.message-header{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:.82rem;font-weight:600;color:var(--text-muted)}.message-author{text-transform:uppercase;letter-spacing:.05em;font-size:.75rem}.message-timestamp{color:var(--text-muted-light);font-size:.75rem}.chat-message p{margin:0;white-space:pre-wrap;line-height:1.6}.typing-indicator{font-size:.8rem;color:#5eead4d9}.chat-input-panel{display:flex;flex-direction:column;gap:12px;align-items:center;width:100%;margin:0}.bottom-panel{position:sticky;bottom:0;padding:24px 32px 32px;background:var(--bg-primary);border-top:1px solid var(--border-color);z-index:1}.error-toast{position:absolute;bottom:110px;right:32px;background:#e130492e;border:1px solid rgba(225,48,73,.35);color:#fecdd3;padding:.65rem .9rem;border-radius:12px;font-size:.88rem;max-width:360px;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}@media (max-width: 1024px){.chat-app{flex-direction:column}.sidebar{width:100%;flex-direction:row;align-items:flex-start;gap:24px;overflow-x:auto}.sidebar-header{margin-bottom:0}.sidebar-body{max-height:240px}.chat-main{flex:1}}.chat-input-container{width:min(100%,768px);margin:0 auto}.chat-input-form{display:flex;flex-direction:column;gap:8px}.chat-input-wrapper{position:relative;background:var(--bg-input);border:1px solid var(--border-color-light);border-radius:24px;padding:12px 16px;transition:border-color .2s ease,box-shadow .2s ease}.chat-input-wrapper:focus-within{border-color:#5eead480;box-shadow:0 0 0 3px #5eead41a}.chat-input-textarea{width:100%;background:transparent;border:none;outline:none;color:var(--text-primary);font-size:.95rem;line-height:1.5;resize:none;font-family:inherit;margin-bottom:8px}.chat-input-textarea::placeholder{color:var(--text-muted)}.chat-input-controls{display:flex;align-items:center;justify-content:space-between;gap:12px}.chat-input-left-controls,.chat-input-right-controls{display:flex;align-items:center;gap:8px}.chat-send-button,.chat-stop-button{width:32px;height:32px;border-radius:50%;border:none;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s ease}.chat-send-button{background:linear-gradient(135deg,#4f46e5,#7c3aed);color:#fff}.chat-send-button:disabled{background:#94a3b84d;cursor:not-allowed}.chat-send-button:not(:disabled):hover{transform:scale(1.05);box-shadow:0 4px 12px #4f46e566}.chat-stop-button{background:#ef444433;color:#fca5a5}.chat-stop-button:hover{background:#ef44444d;transform:scale(1.05)}.chat-input-status{display:flex;align-items:center;justify-content:center;padding:4px 0}.model-selector{position:relative}.model-selector-trigger{display:flex;align-items:center;gap:8px;padding:6px 12px;background:var(--bg-tertiary);border:1px solid var(--border-color-light);border-radius:16px;color:var(--text-primary);font-size:.85rem;font-weight:500;cursor:pointer;transition:all .2s ease;white-space:nowrap}.model-selector-trigger:hover{border-color:var(--border-color-light);background:var(--bg-tertiary)}.model-selector-trigger.active{border-color:#5eead480;background:var(--bg-tertiary)}.model-selector-chevron{transition:transform .2s ease;color:var(--text-gray)}.model-selector-chevron.open{transform:rotate(180deg)}.model-selector-menu{position:absolute;bottom:100%;left:0;margin-bottom:8px;min-width:200px;background:var(--bg-secondary);border:1px solid var(--border-color-light);border-radius:12px;padding:8px;box-shadow:0 20px 25px -5px var(--shadow);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);z-index:50}.model-selector-option{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:8px;border:none;background:transparent;color:var(--text-secondary);text-align:left;cursor:pointer;transition:background-color .2s ease}.model-selector-option:hover{background:var(--bg-tertiary)}.model-selector-option.active{background:#4f46e533}.model-option-content{flex:1}.model-option-label{font-weight:500;font-size:.9rem}.model-option-description{font-size:.8rem;color:var(--text-muted);margin-top:2px}.model-option-check{color:#4ade80}.rag-dropdown{position:relative}.rag-dropdown-trigger{display:flex;align-items:center;gap:8px;padding:6px 12px;background:var(--bg-tertiary);border:1px solid var(--border-color-light);border-radius:16px;color:var(--text-primary);font-size:.85rem;font-weight:500;cursor:pointer;transition:all .2s ease;white-space:nowrap}.rag-dropdown-trigger:hover{border-color:var(--border-color-light);background:var(--bg-tertiary)}.rag-dropdown-trigger.active{border-color:#5eead480;background:var(--bg-tertiary)}.rag-dropdown-icon{font-size:1rem}.rag-dropdown-label{font-size:.85rem}.rag-dropdown-chevron{transition:transform .2s ease;color:var(--text-gray)}.rag-dropdown-chevron.open{transform:rotate(180deg)}.rag-dropdown-menu{position:absolute;bottom:100%;left:0;margin-bottom:8px;min-width:280px;max-width:320px;background:var(--bg-secondary);border:1px solid var(--border-color-light);border-radius:12px;padding:12px;box-shadow:0 20px 25px -5px var(--shadow);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);z-index:50}.rag-dropdown-section{margin-bottom:12px}.rag-dropdown-section:last-child{margin-bottom:0}.rag-dropdown-section-title{font-size:.8rem;font-weight:600;color:var(--text-muted);margin:0 0 8px;text-transform:uppercase;letter-spacing:.025em}.rag-dropdown-option{width:100%;display:flex;align-items:flex-start;gap:12px;padding:10px;border-radius:8px;border:none;background:transparent;color:var(--text-secondary);text-align:left;cursor:pointer;transition:background-color .2s ease;margin-bottom:4px}.rag-dropdown-option:hover{background:#1e293b99}.rag-dropdown-option.active{background:#4f46e533;border:1px solid rgba(79,70,229,.3)}.rag-option-icon{font-size:1.2rem;margin-top:2px}.rag-option-content{flex:1}.rag-option-label{font-weight:500;font-size:.9rem;margin-bottom:2px}.rag-option-description{font-size:.8rem;color:var(--text-muted);line-height:1.3}.rag-advanced-toggle{width:100%;display:flex;align-items:center;justify-content:space-between;padding:8px 10px;margin-top:8px;border:1px solid rgba(148,163,184,.2);border-radius:8px;background:#1e293b66;color:var(--text-muted);font-size:.85rem;cursor:pointer;transition:all .2s ease}.rag-advanced-toggle:hover{background:#1e293b99;border-color:#94a3b84d}.rag-advanced-chevron{transition:transform .2s ease}.rag-advanced-chevron.open{transform:rotate(180deg)}.rag-advanced-section{margin-top:12px;padding-top:12px;border-top:1px solid rgba(148,163,184,.1)}.rag-form-group{margin-bottom:12px}.rag-form-group:last-child{margin-bottom:0}.rag-form-label{display:block;font-size:.8rem;font-weight:500;color:var(--text-muted);margin-bottom:6px}.rag-form-select{width:100%;padding:6px 10px;background:#1e293bcc;border:1px solid rgba(148,163,184,.2);border-radius:6px;color:var(--text-primary);font-size:.85rem}.rag-form-range{width:100%;margin:8px 0;-webkit-appearance:none;-moz-appearance:none;appearance:none;height:4px;background:#94a3b833;border-radius:2px;outline:none}.rag-form-range::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:16px;height:16px;background:linear-gradient(135deg,#4f46e5,#7c3aed);border-radius:50%;cursor:pointer}.rag-form-range::-moz-range-thumb{width:16px;height:16px;background:linear-gradient(135deg,#4f46e5,#7c3aed);border-radius:50%;cursor:pointer;border:none}.rag-range-labels{display:flex;justify-content:space-between;font-size:.75rem;color:var(--text-muted-light)}.rag-form-checkbox-wrapper{display:flex;align-items:flex-start;gap:8px;cursor:pointer;-webkit-user-select:none;user-select:none}.rag-form-checkbox{width:16px;height:16px;margin:0;cursor:pointer;accent-color:#4f46e5}.rag-form-checkbox-label{font-size:.85rem;color:var(--text-secondary);font-weight:500;line-height:1.2}.rag-form-description{font-size:.75rem;color:var(--text-muted-light);margin-top:4px;margin-left:24px;line-height:1.3}.system-prompt-button{display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;background:#1e293bcc;border:1px solid rgba(148,163,184,.2);border-radius:50%;color:var(--text-primary);cursor:pointer;transition:all .2s ease}.system-prompt-button:hover:not(:disabled){border-color:#94a3b866;background:#1e293be6;transform:scale(1.05)}.system-prompt-button:disabled{opacity:.5;cursor:not-allowed}.system-prompt-panel{position:fixed;top:0;right:0;width:450px;height:100vh;background:var(--bg-secondary);border-left:1px solid var(--border-color-light);box-shadow:-8px 0 32px var(--shadow);display:flex;flex-direction:column;z-index:100;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);animation:slide-in-from-right .3s ease}.system-prompt-panel-header{display:flex;align-items:flex-start;justify-content:space-between;padding:32px 32px 24px;border-bottom:1px solid var(--border-color-light)}.system-prompt-panel-header h3{margin:0 0 4px;font-size:1.5rem;font-weight:600;color:var(--text-primary)}.system-prompt-panel-subtitle{margin:0;font-size:.9rem;color:var(--text-muted);line-height:1.4}.system-prompt-panel-close{background:transparent;border:none;color:var(--text-muted);cursor:pointer;padding:8px;border-radius:8px;transition:all .2s ease;display:flex;align-items:center;justify-content:center}.system-prompt-panel-close:hover{background:#ef444433;color:#f87171}.system-prompt-panel-body{flex:1;overflow-y:auto;padding:24px 32px}.system-prompt-panel-body::-webkit-scrollbar{width:6px}.system-prompt-panel-body::-webkit-scrollbar-thumb{background:#94a3b866;border-radius:3px}.system-prompt-panel-body::-webkit-scrollbar-track{background:var(--bg-tertiary);border-radius:3px}.system-prompt-editor{display:flex;flex-direction:column;gap:12px}.system-prompt-label{font-size:.9rem;font-weight:600;color:var(--text-muted);margin-bottom:4px}.system-prompt-textarea{width:100%;min-height:300px;padding:16px;background:var(--bg-tertiary);border:1px solid var(--border-color-light);border-radius:12px;color:var(--text-secondary);font-size:.95rem;line-height:1.6;resize:vertical;font-family:inherit;transition:border-color .2s ease,box-shadow .2s ease}.system-prompt-textarea:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.system-prompt-textarea::placeholder{color:var(--text-muted-light)}.system-prompt-meta{display:flex;align-items:center;justify-content:space-between;gap:12px}.character-count{font-size:.85rem;color:var(--text-muted-light)}.btn-reset-prompt{background:#94a3b833;border:1px solid rgba(148,163,184,.3);border-radius:6px;padding:6px 12px;color:var(--text-secondary);font-size:.85rem;font-weight:500;cursor:pointer;transition:all .2s ease}.btn-reset-prompt:hover{background:#94a3b84d;border-color:#94a3b880}.system-prompt-panel-footer{padding:20px 32px;border-top:1px solid rgba(148,163,184,.2);display:flex;justify-content:flex-end;gap:12px;background:var(--bg-secondary)}.notes-fab{position:fixed;bottom:32px;right:32px;width:60px;height:60px;background:#3b82f6;border:none;border-radius:50%;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 8px 16px #3b82f666;transition:all .3s ease;z-index:900}.notes-fab:hover{transform:scale(1.1);box-shadow:0 12px 24px #3b82f680;background:#2563eb}.notes-fab:active{transform:scale(.95)}.notes-panel{position:fixed;top:0;right:0;width:700px;height:100vh;background:var(--bg-secondary);border-left:1px solid var(--border-color-light);box-shadow:-8px 0 32px var(--shadow);display:flex;flex-direction:column;z-index:1000;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);animation:slide-in-from-right .3s ease}@keyframes slide-in-from-right{0%{transform:translate(100%)}to{transform:translate(0)}}.notes-panel-header{display:flex;align-items:center;justify-content:space-between;padding:24px 32px;border-bottom:1px solid var(--border-color-light);background:var(--bg-secondary)}.notes-panel-header h3{margin:0;font-size:1.5rem;font-weight:600;color:var(--text-primary)}.notes-panel-close{background:transparent;border:none;color:var(--text-muted);cursor:pointer;padding:8px;border-radius:8px;transition:all .2s ease;display:flex;align-items:center;justify-content:center}.notes-panel-close:hover{background:#ef444433;color:#f87171}.notes-panel-content{flex:1;display:flex;overflow:hidden}.notes-sidebar{width:30%;background:var(--bg-tertiary);border-right:1px solid var(--border-color-light);display:flex;flex-direction:column;overflow:hidden}.notes-create-button{margin:16px;padding:12px;background:#3b82f6;border:none;border-radius:8px;color:#fff;font-size:.9rem;font-weight:600;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center;gap:8px}.notes-create-button:hover:not(:disabled){background:#2563eb;transform:translateY(-1px);box-shadow:0 4px 12px #3b82f64d}.notes-create-button:disabled{opacity:.5;cursor:not-allowed}.notes-list{flex:1;overflow-y:auto;padding:0 8px}.notes-list::-webkit-scrollbar{width:6px}.notes-list::-webkit-scrollbar-thumb{background:#94a3b866;border-radius:3px}.notes-list::-webkit-scrollbar-track{background:transparent}.notes-list-item{padding:12px;margin-bottom:8px;background:var(--bg-secondary);border:1px solid var(--border-color-light);border-radius:8px;cursor:pointer;transition:all .2s ease;display:flex;align-items:flex-start;gap:8px}.notes-list-item:hover{border-color:#3b82f680;background:#3b82f60d}.notes-list-item.active{border-color:#3b82f6;background:#3b82f61a}.notes-list-item-content{flex:1;min-width:0}.notes-list-item-title{font-size:.9rem;font-weight:600;color:var(--text-primary);margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.notes-list-item-preview{font-size:.8rem;color:var(--text-muted);line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.notes-list-item-delete{background:transparent;border:none;color:var(--text-muted);cursor:pointer;padding:4px;border-radius:4px;transition:all .2s ease;display:flex;align-items:center;justify-content:center;flex-shrink:0}.notes-list-item-delete:hover{background:#ef444433;color:#ef4444}.notes-sidebar-footer{padding:12px 16px;border-top:1px solid var(--border-color-light);background:var(--bg-tertiary)}.notes-count{font-size:.8rem;color:var(--text-muted);text-align:center}.notes-editor{flex:1;display:flex;flex-direction:column;overflow:hidden}.notes-editor-header{padding:20px 24px;border-bottom:1px solid var(--border-color-light)}.notes-editor-title{margin:0;font-size:1.3rem;font-weight:600;color:var(--text-primary);cursor:pointer;padding:8px 12px;border-radius:6px;transition:all .2s ease}.notes-editor-title:hover{background:#3b82f60d;color:#3b82f6}.notes-title-input{width:100%;font-size:1.3rem;font-weight:600;color:var(--text-primary);background:var(--bg-tertiary);border:2px solid #3b82f6;border-radius:6px;padding:8px 12px;outline:none;font-family:inherit}.notes-textarea{flex:1;padding:24px;background:var(--bg-secondary);border:none;color:var(--text-secondary);font-size:.95rem;line-height:1.6;resize:none;font-family:inherit;outline:none}.notes-textarea::placeholder{color:var(--text-muted-light)}.notes-editor-footer{padding:16px 24px;border-top:1px solid var(--border-color-light);background:var(--bg-secondary);display:flex;align-items:center;justify-content:flex-end}.notes-character-count{font-size:.85rem;color:var(--text-muted-light)}.notes-character-count.warning{color:#ef4444;font-weight:600}.notes-editor-empty{flex:1;display:flex;align-items:center;justify-content:center;color:var(--text-muted);font-size:1rem}.message-content{width:100%}.message-text{white-space:pre-wrap;line-height:1.6;font-size:.95rem}.citation-group{position:relative;display:inline}.inline-citation{position:relative;display:inline-block;padding:0 3px;color:#3b82f6;font-weight:600;font-size:.9em;cursor:pointer;transition:all .2s ease;border-radius:3px;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:2px}.inline-citation:hover{background:#3b82f61a;text-decoration:underline;text-decoration-style:solid;transform:scale(1.05)}.inline-citation.hovered{background:#3b82f633;color:#2563eb}.inline-citation:active{transform:scale(.95);background:#3b82f64d}.citation-tooltip{position:absolute;bottom:100%;left:50%;transform:translate(-50%);margin-bottom:8px;padding:8px 12px;background:#0f172af2;border:1px solid rgba(148,163,184,.3);border-radius:8px;color:var(--text-primary);font-size:.85rem;font-weight:400;white-space:normal;width:max-content;max-width:300px;word-wrap:break-word;box-shadow:0 10px 25px -5px #00000080;z-index:1000;pointer-events:none;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);animation:tooltip-fade-in .15s ease-out}@keyframes tooltip-fade-in{0%{opacity:0;transform:translate(-50%) translateY(4px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.citation-tooltip:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid rgba(15,23,42,.95)}.sources-section{margin-top:32px;padding-top:24px;border-top:1px solid rgba(148,163,184,.2)}.sources-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.sources-header h3{margin:0;font-size:1.1rem;font-weight:600;color:var(--text-primary)}.sources-toggle{background:transparent;border:1px solid rgba(148,163,184,.3);border-radius:6px;padding:4px;color:var(--text-muted);cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center}.sources-toggle:hover{background:#1e293b66;border-color:#94a3b880;color:var(--text-secondary)}.sources-chevron{transition:transform .2s ease}.sources-chevron.minimized{transform:rotate(-90deg)}.sources-list{display:flex;flex-direction:column;gap:12px}.source-item{position:relative;display:flex;align-items:flex-start;gap:12px;padding:12px 16px;background:#1e293b4d;border:1px solid transparent;border-radius:8px;transition:all .2s ease;cursor:pointer}.source-item:hover,.source-item.hovered{background:#1e293b80;border-color:#94a3b84d;transform:translate(4px)}.source-item:hover .source-click-hint{opacity:1}.source-number{color:#3b82f6;font-weight:600;flex-shrink:0;font-size:.9rem}.source-text{flex:1;color:var(--text-secondary);font-size:.9rem;line-height:1.5}.source-click-hint{display:flex;align-items:center;gap:6px;color:var(--text-gray);font-size:.75rem;opacity:0;transition:opacity .2s ease;flex-shrink:0}.source-click-hint svg{opacity:.7}.sources-minimized{padding:8px 0}.sources-count{color:var(--text-muted-light);font-size:.85rem;font-style:italic}.message-text h2{margin:20px 0 12px;font-size:1.3rem;font-weight:600;color:var(--text-primary)}.message-text h3{margin:16px 0 8px;font-size:1.1rem;font-weight:600;color:var(--text-primary)}.message-text strong{font-weight:600;color:var(--text-primary)}.chunk-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#000c;display:flex;align-items:center;justify-content:center;z-index:9999;padding:20px;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.chunk-modal-content{background:#0f172af2;border:1px solid rgba(148,163,184,.3);border-radius:16px;max-width:800px;width:100%;max-height:90vh;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 25px 50px -12px #00000080;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.chunk-modal-header{display:flex;align-items:flex-start;justify-content:space-between;padding:24px 24px 16px;border-bottom:1px solid rgba(148,163,184,.2)}.chunk-modal-title h2{margin:0;font-size:1.4rem;font-weight:600;color:var(--text-primary)}.chunk-modal-subtitle{margin-top:4px;color:var(--text-muted);font-size:.9rem}.chunk-modal-close{background:transparent;border:none;color:var(--text-muted);cursor:pointer;padding:8px;border-radius:8px;transition:all .2s ease;margin:-8px -8px -8px 0}.chunk-modal-close:hover{background:#ef444433;color:#f87171}.chunk-modal-body{flex:1;overflow-y:auto;padding:20px 24px}.chunk-relevance{display:flex;align-items:center;gap:12px;margin-bottom:24px;padding:12px 16px;background:#1e293b66;border-radius:8px}.relevance-label{color:var(--text-muted);font-size:.9rem}.relevance-score{color:#4ade80;font-weight:600;font-size:.9rem}.chunk-content,.chunk-source,.chunk-metadata{margin-bottom:24px}.chunk-content h3,.chunk-source h3,.chunk-metadata h3{margin:0 0 12px;font-size:1.1rem;font-weight:600;color:var(--text-primary)}.chunk-text{background:#1e293b4d;border:1px solid rgba(148,163,184,.2);border-radius:8px;padding:16px;color:var(--text-secondary);line-height:1.6;font-size:.95rem;max-height:300px;overflow-y:auto;white-space:pre-wrap}.source-filename{background:#3b82f61a;border:1px solid rgba(59,130,246,.3);border-radius:8px;padding:12px 16px;color:#93c5fd;font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:.9rem}.metadata-grid{display:grid;gap:8px}.metadata-item{display:flex;gap:12px;padding:8px 12px;background:#1e293b4d;border-radius:6px;font-size:.85rem}.metadata-key{color:var(--text-muted);font-weight:500;min-width:120px;flex-shrink:0}.metadata-value{color:var(--text-secondary);word-break:break-all}.chunk-modal-footer{padding:16px 24px;border-top:1px solid rgba(148,163,184,.2);display:flex;justify-content:flex-end;gap:12px}.chunk-modal-button{padding:8px 16px;border-radius:8px;font-size:.9rem;font-weight:500;cursor:pointer;transition:all .2s ease;border:none}.chunk-modal-button.secondary{background:#94a3b833;color:var(--text-secondary)}.chunk-modal-button.secondary:hover{background:#94a3b84d}@media (max-width: 768px){.chunk-modal-overlay{padding:10px}.chunk-modal-content{max-height:95vh}.chunk-modal-header{padding:16px 16px 12px}.chunk-modal-body{padding:16px}.chunk-modal-footer{padding:12px 16px}.chunk-text{max-height:200px}}.message-streaming-indicator{display:flex;align-items:center;gap:8px;margin-top:8px;color:var(--streaming-indicator-color);font-size:.85rem}.typing-dots{display:flex;gap:4px}.typing-dot{width:4px;height:4px;border-radius:50%;background:currentColor;animation:typing-pulse 1.4s infinite ease-in-out}.typing-dot:nth-child(1){animation-delay:-.32s}.typing-dot:nth-child(2){animation-delay:-.16s}@keyframes typing-pulse{0%,80%,to{opacity:.3;transform:scale(.8)}40%{opacity:1;transform:scale(1)}}@media (max-width: 768px){.chat-header{flex-direction:column;align-items:stretch}.chat-thread{padding:24px 20px 120px}.bottom-panel{padding:16px 20px 28px}.chat-input-container{width:100%}.chat-input-controls{flex-wrap:wrap;gap:8px}.chat-input-left-controls{order:2;width:100%;justify-content:center}.chat-input-right-controls{order:1;margin-left:auto}.rag-dropdown-menu,.model-selector-menu{position:fixed;bottom:auto;top:50%;left:50%;transform:translate(-50%,-50%);margin:0}.chat-main.with-panel{margin-right:0}.system-prompt-panel{width:100%;max-width:100%}.system-prompt-panel-header,.system-prompt-panel-body,.system-prompt-panel-footer{padding-left:20px;padding-right:20px}.notes-panel{width:100%;max-width:100%}.notes-panel-header{padding:16px 20px}.notes-panel-content{flex-direction:column}.notes-sidebar{width:100%;max-height:200px;border-right:none;border-bottom:1px solid var(--border-color-light)}.notes-fab{bottom:24px;right:24px;width:50px;height:50px}}.sidebar-buttons{display:flex;flex-direction:column;gap:12px;margin-bottom:24px;padding:0 4px}.sidebar-knowledge-base,.sidebar-case-lookup{background:linear-gradient(135deg,#059669,#16a34a);border:none;border-radius:999px;padding:.45rem 1rem;color:#fff;font-size:.85rem;font-weight:600;cursor:pointer;transition:transform .15s ease,box-shadow .15s ease;display:flex;align-items:center;justify-content:center;gap:6px}.sidebar-knowledge-base:disabled,.sidebar-case-lookup:disabled{opacity:.6;cursor:not-allowed}.sidebar-knowledge-base:not(:disabled):hover,.sidebar-case-lookup:not(:disabled):hover{transform:translateY(-1px);box-shadow:0 8px 22px #05966959}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#000c;display:flex;align-items:center;justify-content:center;z-index:9999;padding:20px;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.modal-content{background:var(--bg-secondary);border:1px solid var(--border-color-light);border-radius:16px;width:100%;max-height:90vh;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 25px 50px -12px var(--shadow);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.kb-modal{width:100vw;height:100vh;max-width:none;max-height:none;border-radius:0;border:none}.modal-header{display:flex;align-items:center;justify-content:space-between;padding:24px 24px 16px;border-bottom:1px solid var(--border-color-light)}.modal-header h2{margin:0;font-size:1.4rem;font-weight:600;color:var(--text-primary)}.modal-close{background:transparent;border:none;color:var(--text-muted);cursor:pointer;padding:8px;border-radius:8px;transition:all .2s ease;font-size:1.5rem;line-height:1}.modal-close:hover{background:#ef444433;color:#f87171}.close-button{background:var(--bg-tertiary);border:1px solid var(--border-color);color:var(--text-primary);cursor:pointer;padding:8px 16px;border-radius:8px;transition:all .2s ease;font-size:.9rem;font-weight:500}.close-button:hover{background:#ef444433;border-color:#ef4444;color:#f87171}.modal-body{flex:1;overflow-y:auto;padding:20px 24px}.kb-modal .modal-body{padding:40px 60px}.kb-modal .modal-header{padding:40px 60px 20px}.kb-actions{margin-bottom:24px;display:flex;gap:12px;flex-wrap:wrap}.btn-primary{background:linear-gradient(135deg,#3057e1,#7c3aed);border:none;border-radius:8px;padding:10px 20px;color:#fff;font-size:.9rem;font-weight:600;cursor:pointer;transition:all .15s ease}.btn-primary:disabled{opacity:.6;cursor:not-allowed}.btn-primary:not(:disabled):hover{transform:translateY(-1px);box-shadow:0 8px 22px #4f46e559}.btn-secondary{background:#94a3b833;border:1px solid rgba(148,163,184,.3);border-radius:8px;padding:8px 16px;color:var(--text-secondary);font-size:.85rem;font-weight:500;cursor:pointer;transition:all .2s ease}.btn-secondary:hover{background:#94a3b84d;border-color:#94a3b880}.btn-secondary:disabled{opacity:.6;cursor:not-allowed}.sync-status{padding:12px 16px;margin-bottom:16px;background:#3b82f61a;border:1px solid rgba(59,130,246,.3);border-radius:8px;color:#3b82f6;font-size:.9rem;font-weight:500}.btn-danger{background:#ef444433;border:1px solid rgba(239,68,68,.3);border-radius:8px;padding:8px 16px;color:#f87171;font-size:.85rem;font-weight:500;cursor:pointer;transition:all .2s ease}.btn-danger:hover{background:#ef44444d;border-color:#ef444480}.btn-small{padding:6px 12px;font-size:.8rem}.kb-create-form{background:#1e293b4d;border:1px solid rgba(148,163,184,.2);border-radius:12px;padding:20px;margin-bottom:24px}.kb-create-form input,.kb-create-form textarea{width:100%;background:#1e293b80;border:1px solid rgba(148,163,184,.3);border-radius:8px;padding:12px;color:var(--text-secondary);font-size:.9rem;margin-bottom:12px;transition:border-color .2s ease}.kb-create-form input:focus,.kb-create-form textarea:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.kb-create-form textarea{resize:vertical;min-height:80px}.form-buttons{display:flex;gap:12px;margin-top:16px}.form-buttons button{padding:10px 20px;border-radius:8px;border:none;font-size:.9rem;font-weight:600;cursor:pointer;transition:all .2s ease}.form-buttons button[type=submit]{background:linear-gradient(135deg,#3057e1,#7c3aed);color:#fff}.form-buttons button[type=button]{background:#94a3b833;color:var(--text-secondary)}.kb-list{display:grid;gap:16px}.kb-card{background:#1e293b4d;border:1px solid rgba(148,163,184,.2);border-radius:12px;padding:20px;transition:all .2s ease}.kb-card:hover{background:#1e293b80;border-color:#94a3b84d;transform:translateY(-2px)}.kb-header{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:12px}.kb-header h3{margin:0;font-size:1.1rem;font-weight:600;color:var(--text-primary)}.kb-date{color:var(--text-muted-light);font-size:.8rem}.kb-description{color:var(--text-muted);font-size:.9rem;line-height:1.5;margin:0 0 16px}.kb-stats{margin-bottom:16px}.kb-doc-count{color:var(--text-muted);font-size:.85rem;display:flex;align-items:center;gap:6px}.kb-actions{display:flex;gap:8px}.loading{text-align:center;color:var(--text-muted);padding:40px;font-size:.9rem}.empty-state{text-align:center;color:var(--text-muted-light);padding:40px;font-size:.9rem}.error-message{background:#ef44441a;border:1px solid rgba(239,68,68,.3);border-radius:8px;padding:12px 16px;color:#f87171;font-size:.9rem;margin-bottom:16px}.upload-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#000000e6;display:flex;align-items:center;justify-content:center;z-index:10000;padding:20px;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}.upload-modal-content{background:#0f172afa;border:1px solid rgba(148,163,184,.3);border-radius:16px;max-width:700px;width:100%;height:90vh;max-height:90vh;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 25px 50px -12px #000000b3;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px)}.upload-tabs{display:flex;border-bottom:1px solid rgba(148,163,184,.2)}.upload-tab{flex:1;background:transparent;border:none;padding:16px 20px;color:var(--text-muted);font-size:.9rem;font-weight:500;cursor:pointer;transition:all .2s ease;border-bottom:2px solid transparent}.upload-tab.active{color:#3b82f6;border-bottom-color:#3b82f6;background:#3b82f60d}.upload-tab:hover:not(.active){color:var(--text-secondary);background:#1e293b4d}.drop-zone{border:2px dashed rgba(148,163,184,.3);border-radius:12px;padding:40px 20px;text-align:center;cursor:pointer;transition:all .2s ease;margin-bottom:20px}.drop-zone:hover,.drop-zone.dragging{border-color:#3b82f6;background:#3b82f60d}.drop-zone-content{display:flex;flex-direction:column;align-items:center;gap:8px}.drop-icon{font-size:2rem;opacity:.7}.drop-zone p{margin:0;color:var(--text-secondary);font-size:.9rem}.drop-hint{color:var(--text-muted-light)!important;font-size:.8rem!important}.file-list{margin-bottom:20px}.file-list h4{margin:0 0 12px;font-size:1rem;font-weight:600;color:var(--text-primary)}.file-list-container{max-height:200px;overflow-y:auto;padding-right:8px}.file-list-container::-webkit-scrollbar{width:6px}.file-list-container::-webkit-scrollbar-thumb{background:#94a3b866;border-radius:3px}.file-list-container::-webkit-scrollbar-track{background:#1e293b4d;border-radius:3px}.file-item{display:flex;align-items:center;gap:12px;padding:10px 12px;background:#1e293b4d;border-radius:8px;margin-bottom:8px}.file-name{flex:1;color:var(--text-secondary);font-size:.9rem;truncate:true}.file-size{color:var(--text-muted-light);font-size:.8rem}.file-remove{background:#ef444433;border:1px solid rgba(239,68,68,.3);border-radius:4px;width:24px;height:24px;color:#f87171;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s ease}.file-remove:hover{background:#ef44444d}.upload-results{margin-bottom:20px}.upload-results h4{margin:0 0 12px;font-size:1rem;font-weight:600;color:var(--text-primary)}.result-item{display:flex;align-items:center;gap:12px;padding:8px 12px;border-radius:6px;margin-bottom:6px;font-size:.85rem}.result-item.success{background:#22c55e1a;color:#4ade80}.result-item.error{background:#ef44441a;color:#f87171}.result-error{color:#f87171cc;font-size:.8rem}.upload-progress{text-align:center;color:#3b82f6;font-size:.9rem;margin-bottom:16px}.upload-actions{display:flex;gap:12px;justify-content:flex-end;margin-top:auto;padding-top:20px;border-top:1px solid rgba(148,163,184,.2);background:#0f172afa;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.upload-content-area{flex:1;overflow-y:auto;padding-right:8px}.upload-content-area::-webkit-scrollbar{width:6px}.upload-content-area::-webkit-scrollbar-thumb{background:#94a3b866;border-radius:3px}.upload-content-area::-webkit-scrollbar-track{background:#1e293b4d;border-radius:3px}.documents-list{max-height:400px;overflow-y:auto}.document-item{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:#1e293b4d;border:1px solid rgba(148,163,184,.2);border-radius:8px;margin-bottom:8px;transition:all .2s ease}.document-item:hover{background:#1e293b80}.document-info{flex:1}.document-name{display:block;color:var(--text-secondary);font-size:.9rem;font-weight:500;margin-bottom:4px}.document-meta{color:var(--text-muted-light);font-size:.8rem}.settings-modal{max-width:600px}.settings-section{margin-bottom:32px}.settings-section:last-child{margin-bottom:0}.settings-section-title{margin:0 0 8px;font-size:1.1rem;font-weight:600;color:var(--text-primary)}.settings-section-description{margin:0 0 16px;font-size:.9rem;color:var(--text-muted);line-height:1.5}.theme-options{display:grid;gap:12px}.theme-option{width:100%;padding:16px;background:#1e293b4d;border:2px solid rgba(148,163,184,.2);border-radius:12px;text-align:left;cursor:pointer;transition:all .2s ease}.theme-option:hover{background:#1e293b80;border-color:#94a3b84d}.theme-option.active{background:#4f46e526;border-color:#4f46e5}.theme-option-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}.theme-option-label{font-size:1rem;font-weight:600;color:var(--text-primary)}.theme-option-check{color:#4ade80}.theme-option-description{margin:0;font-size:.85rem;color:var(--text-muted);line-height:1.4}.font-size-control{display:flex;flex-direction:column;gap:20px}.font-size-slider-wrapper{display:flex;flex-direction:column;gap:12px}.font-size-label{font-size:.9rem;font-weight:500;color:var(--text-muted)}.font-size-slider{width:100%;height:6px;background:#94a3b833;border-radius:3px;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.font-size-slider::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:20px;height:20px;background:linear-gradient(135deg,#4f46e5,#7c3aed);border-radius:50%;cursor:pointer;transition:all .2s ease}.font-size-slider::-webkit-slider-thumb:hover{transform:scale(1.1);box-shadow:0 0 0 4px #4f46e533}.font-size-slider::-moz-range-thumb{width:20px;height:20px;background:linear-gradient(135deg,#4f46e5,#7c3aed);border-radius:50%;border:none;cursor:pointer;transition:all .2s ease}.font-size-slider::-moz-range-thumb:hover{transform:scale(1.1);box-shadow:0 0 0 4px #4f46e533}.font-size-labels{display:flex;justify-content:space-between;font-size:.8rem;color:var(--text-muted-light)}.font-size-preview{padding:16px;background:#1e293b4d;border:1px solid rgba(148,163,184,.2);border-radius:8px}.preview-label{margin:0 0 8px;font-size:.85rem;font-weight:600;color:var(--text-muted)}.preview-text{margin:0;color:var(--text-secondary);line-height:1.6}.modal-footer{padding:16px 24px;border-top:1px solid rgba(148,163,184,.2);display:flex;justify-content:flex-end;gap:12px}@media (max-width: 768px){.modal-overlay,.upload-modal-overlay{padding:10px}.modal-content,.upload-modal-content{max-height:95vh}.modal-header{padding:16px 16px 12px}.modal-body,.kb-card{padding:16px}.kb-actions{flex-direction:column}.sidebar-buttons{gap:6px}.sidebar-new-chat,.sidebar-knowledge-base,.sidebar-case-lookup{font-size:.8rem;padding:.4rem .8rem}}.case-lookup-page{display:flex;height:100vh;width:100%;background-color:var(--bg-primary);color:var(--text-secondary)}.case-lookup-sidebar{width:280px;background:var(--bg-sidebar);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);border-right:1px solid var(--border-color);display:flex;flex-direction:column;flex-shrink:0;padding:24px 20px}.sidebar-back-to-chat{width:100%;padding:.75rem 1rem;background:var(--bg-tertiary);border:1px solid var(--border-color);border-radius:8px;color:var(--text-secondary);font-size:.9rem;font-weight:500;cursor:pointer;transition:all .2s ease}.sidebar-back-to-chat:hover{background:var(--bg-input);border-color:var(--border-color-light)}.sidebar-info{padding:1.5rem;border-top:1px solid var(--border-color)}.sidebar-info h3{margin:0 0 .5rem;font-size:1.1rem;color:var(--text-primary)}.sidebar-info p{margin:0;font-size:.85rem;color:var(--text-muted);line-height:1.5}.case-lookup-main{flex:1;display:flex;flex-direction:column;overflow:hidden}.case-lookup-header{padding:1.5rem 2rem;border-bottom:1px solid var(--border-color);background:var(--bg-secondary)}.case-lookup-header h2{margin:0 0 .25rem;font-size:1.5rem;font-weight:600;color:var(--text-primary)}.case-lookup-subtitle{margin:0;font-size:.9rem;color:var(--text-muted)}.case-lookup-content{flex:1;overflow-y:auto;padding:2rem}.case-search-form{max-width:800px;margin:0 auto 2rem}.search-mode-toggle{display:flex;gap:.5rem;margin-bottom:1rem;background:var(--bg-tertiary);padding:.25rem;border-radius:10px;border:1px solid var(--border-color)}.mode-button{flex:1;padding:.75rem 1rem;background:transparent;border:none;border-radius:8px;color:var(--text-muted);font-size:.9rem;font-weight:500;cursor:pointer;transition:all .2s ease}.mode-button:hover{color:var(--text-secondary);background:#ffffff0d}.mode-button.active{background:var(--bg-primary);color:var(--text-primary);box-shadow:0 2px 8px var(--shadow)}.search-input-group{display:flex;gap:.75rem}.search-input{flex:1;padding:.875rem 1.25rem;background:var(--bg-input);border:1px solid var(--border-color);border-radius:10px;color:var(--text-primary);font-size:.95rem;transition:all .2s ease}.search-input:focus{outline:none;border-color:var(--border-color-light);background:var(--bg-secondary)}.search-input::placeholder{color:var(--text-muted)}.search-button{padding:.875rem 2rem;background:linear-gradient(135deg,#3057e1,#7c3aed);border:none;border-radius:10px;color:#fff;font-size:.95rem;font-weight:600;cursor:pointer;transition:all .2s ease;white-space:nowrap}.search-button:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 4px 12px #3057e166}.search-button:disabled{opacity:.6;cursor:not-allowed}.case-error-message{max-width:800px;margin:0 auto 1.5rem;padding:1rem 1.25rem;background:#ef44441a;border:1px solid rgba(239,68,68,.3);border-radius:8px;color:#fca5a5;font-size:.9rem}.case-results{max-width:1200px;margin:0 auto}.case-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4rem 2rem;color:var(--text-muted)}.loading-spinner{width:40px;height:40px;border:3px solid var(--border-color);border-top-color:#3057e1;border-radius:50%;animation:spin 1s linear infinite;margin-bottom:1rem}@keyframes spin{to{transform:rotate(360deg)}}.case-loading p{font-size:.95rem}.case-empty-state{text-align:center;padding:4rem 2rem;color:var(--text-muted)}.case-empty-state h3{margin:0 0 .5rem;font-size:1.25rem;color:var(--text-secondary)}.case-empty-state p{margin:0;font-size:.95rem;line-height:1.6}.case-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(350px,1fr));gap:1.5rem}.case-card{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:12px;padding:1.5rem;transition:all .2s ease}.case-card:hover{border-color:var(--border-color-light);box-shadow:0 4px 12px var(--shadow);transform:translateY(-2px)}.case-card-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:1rem;gap:1rem}.case-number{margin:0;font-size:.85rem;font-weight:600;color:#3057e1;text-transform:uppercase;letter-spacing:.5px}.case-date{font-size:.8rem;color:var(--text-muted);font-weight:500;white-space:nowrap}.case-card-body{margin-bottom:1.5rem}.case-name{margin:0 0 .75rem;font-size:1rem;font-weight:600;color:var(--text-primary);line-height:1.4}.case-summary{margin:0;font-size:.85rem;color:var(--text-muted);line-height:1.6}.case-card-actions{display:flex;flex-wrap:wrap;gap:.5rem}.case-action-btn{padding:.5rem .875rem;border:1px solid var(--border-color);border-radius:6px;font-size:.8rem;font-weight:500;cursor:pointer;transition:all .2s ease}.case-action-btn.primary{background:linear-gradient(135deg,#3057e1,#7c3aed);border-color:transparent;color:#fff}.case-action-btn.primary:hover{transform:translateY(-1px);box-shadow:0 2px 8px #3057e166}.case-action-btn.secondary{background:var(--bg-tertiary);color:var(--text-secondary)}.case-action-btn.secondary:hover{background:var(--bg-input);border-color:var(--border-color-light)}.case-detail-modal{max-width:700px}.case-detail-section{margin-bottom:1.5rem}.case-detail-section:last-child{margin-bottom:0}.case-detail-label{margin:0 0 .75rem;font-size:.9rem;font-weight:600;color:var(--text-primary);text-transform:uppercase;letter-spacing:.5px}.case-detail-value{margin:0;font-size:1rem;color:var(--text-secondary);line-height:1.6}.case-detail-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:1rem}.case-detail-item{display:flex;flex-direction:column;gap:.25rem}.case-detail-key{font-size:.8rem;color:var(--text-muted);font-weight:500}.case-detail-preview{padding:1rem;background:var(--bg-tertiary);border:1px solid var(--border-color);border-radius:8px;max-height:300px;overflow-y:auto}.case-detail-preview p{margin:0;font-size:.9rem;color:var(--text-secondary);line-height:1.7;white-space:pre-wrap}@media (max-width: 768px){.case-lookup-sidebar{display:none}.case-lookup-content{padding:1rem}.case-grid{grid-template-columns:1fr}.search-input-group{flex-direction:column}.search-button{width:100%}.case-detail-grid{grid-template-columns:1fr}}.document-viewer-modal{max-width:90vw;max-height:90vh;display:flex;flex-direction:column}.document-viewer-body{flex:1;overflow:hidden;display:flex;flex-direction:column;min-height:0}.document-viewer-content{flex:1;overflow:auto;min-height:0}.document-viewer-iframe{width:100%;height:100%;min-height:70vh;border:none;background:#fff;border-radius:4px}.document-viewer-text{width:100%;height:100%;min-height:70vh;margin:0;padding:1.5rem;background:var(--bg-tertiary);border:1px solid var(--border-color);border-radius:8px;color:var(--text-secondary);font-family:Courier New,monospace;font-size:.9rem;line-height:1.6;overflow:auto;white-space:pre-wrap;word-wrap:break-word}.document-viewer-loading,.document-viewer-error,.document-viewer-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4rem 2rem;min-height:300px}.document-viewer-loading{color:var(--text-muted)}.document-viewer-loading p{margin-top:1rem;font-size:.95rem}.document-viewer-error .error-message{color:#fca5a5;background:#ef44441a;border:1px solid rgba(239,68,68,.3);border-radius:8px;padding:1rem 1.5rem;font-size:.9rem}.document-viewer-empty{color:var(--text-muted);font-size:.95rem}.view-full-document-btn{margin-top:1rem;width:100%}@media (max-width: 768px){.document-viewer-modal{max-width:95vw;max-height:95vh}.document-viewer-iframe,.document-viewer-text{min-height:60vh}.document-viewer-text{padding:1rem;font-size:.85rem}}.gallery-modal{position:fixed;top:0;left:0;right:0;bottom:0;background:#000000d9;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);display:flex;align-items:center;justify-content:center;z-index:1000;padding:2rem;animation:fadeIn .2s ease-out}.gallery-container{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:12px;width:100%;max-width:1400px;max-height:90vh;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 20px 50px var(--shadow)}.gallery-header{display:flex;justify-content:space-between;align-items:center;padding:1.5rem 2rem;border-bottom:1px solid var(--border-color);background:var(--bg-tertiary);gap:1rem}.gallery-header h2{margin:0;font-size:1.5rem;color:var(--text-primary)}.gallery-subtitle{margin:.25rem 0 0;font-size:.9rem;color:var(--text-muted)}.gallery-header-left{display:flex;flex-direction:column;gap:.25rem}.gallery-search{position:relative;flex:1;max-width:400px;margin:0 1rem}.gallery-search-input{width:100%;padding:.5rem 2rem .5rem .75rem;background:var(--bg-input);border:1px solid var(--border-color);border-radius:8px;color:var(--text-primary);font-size:.9rem;transition:all .2s}.gallery-search-input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.gallery-search-input::placeholder{color:var(--text-muted)}.gallery-search-clear{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);background:transparent;border:none;color:var(--text-muted);font-size:1.5rem;cursor:pointer;padding:.25rem;line-height:1;transition:color .2s}.gallery-search-clear:hover{color:var(--text-primary)}.gallery-loading,.gallery-error,.gallery-empty{display:flex;align-items:center;justify-content:center;padding:4rem 2rem;color:var(--text-muted);font-size:1rem}.gallery-error{flex-direction:column;gap:1rem}.gallery-error button{padding:.5rem 1.5rem;background:var(--bg-tertiary);color:var(--text-primary);border:1px solid var(--border-color);border-radius:6px;cursor:pointer;transition:all .2s}.gallery-error button:hover{background:var(--bg-input);border-color:var(--border-color-light)}.document-gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1.5rem;padding:2rem;overflow-y:auto;flex:1}.document-card{background:var(--bg-tertiary);border:1px solid var(--border-color);border-radius:8px;padding:1.5rem;display:flex;flex-direction:column;gap:1rem;transition:all .2s;cursor:pointer}.document-card:hover{border-color:var(--border-color-light);box-shadow:0 4px 12px var(--shadow);transform:translateY(-2px)}.document-icon{width:80px;height:80px;border-radius:8px;display:flex;align-items:center;justify-content:center;margin:0 auto;position:relative}.file-extension{color:#fff;font-weight:700;font-size:1.1rem;letter-spacing:.5px;text-shadow:0 1px 2px rgba(0,0,0,.2)}.corner-badge{position:absolute;top:-4px;right:-4px;width:20px;height:20px;border-radius:50%;background:#22c55e;color:#fff;display:flex;align-items:center;justify-content:center;font-size:.7rem;font-weight:700;border:2px solid var(--bg-tertiary);box-shadow:0 2px 4px #0000004d}html[data-theme=light] .corner-badge{background:#16a34a;box-shadow:0 2px 4px #00000026}.document-info{flex:1;min-width:0}.document-title{margin:0;font-size:.95rem;font-weight:500;color:var(--text-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.4}.document-metadata{display:flex;flex-direction:column;align-items:center;gap:.25rem;margin-top:.5rem;font-size:.85rem;color:var(--text-muted)}.metadata-item{white-space:nowrap}.metadata-separator{color:var(--text-muted-light)}.document-status{margin-top:.5rem}.status-badge{display:inline-block;padding:.25rem .75rem;border-radius:12px;font-size:.75rem;font-weight:500}.status-processed{background:#22c55e26;color:#4ade80}.status-processing{background:#fbbf2426;color:#fbbf24}html[data-theme=light] .status-processed{background:#22c55e33;color:#059669}html[data-theme=light] .status-processing{background:#fbbf2433;color:#d97706}html[data-theme=light] .document-card,html[data-theme=light] .action-button,html[data-theme=light] .preview-text,html[data-theme=light] .detail-content{border-color:#64748b4d}html[data-theme=light] .sidebar-settings-button{background:#f8fafccc;border:1px solid rgba(100,116,139,.25)}html[data-theme=light] .sidebar-settings-button:hover{background:#e2e8f0e6;border-color:#64748b66}html[data-theme=light] .system-prompt-button{background:#f8fafce6;border:1px solid rgba(100,116,139,.25)}html[data-theme=light] .system-prompt-button:hover:not(:disabled){background:#e2e8f0f2;border-color:#64748b66}html[data-theme=light] .btn-reset-prompt{background:#e2e8f099;border:1px solid rgba(100,116,139,.3)}html[data-theme=light] .btn-reset-prompt:hover{background:#e2e8f0cc;border-color:#64748b73}html[data-theme=light] .notes-fab{box-shadow:0 8px 16px #3b82f640}html[data-theme=light] .notes-fab:hover{box-shadow:0 12px 24px #3b82f659}html[data-theme=light] .notes-list-item{background:#fffc;border:1px solid rgba(100,116,139,.2)}html[data-theme=light] .notes-list-item:hover{border-color:#3b82f666;background:#3b82f614}html[data-theme=light] .notes-list-item.active{border-color:#3b82f6;background:#3b82f626}html[data-theme=light] .notes-sidebar{background:#f8fafce6;border-right:1px solid rgba(100,116,139,.2)}html[data-theme=light] .notes-sidebar-footer{border-top:1px solid rgba(100,116,139,.2);background:#f8fafce6}html[data-theme=light] .notes-editor-header{border-bottom:1px solid rgba(100,116,139,.2)}html[data-theme=light] .notes-editor-footer{border-top:1px solid rgba(100,116,139,.2)}html[data-theme=light] .notes-title-input{background:#f8fafce6;border:2px solid #3b82f6}html[data-theme=light] .system-prompt-panel-footer{border-top:1px solid rgba(100,116,139,.2)}html[data-theme=light] .rag-form-select{background:#f8fafcf2;border:1px solid rgba(100,116,139,.25)}html[data-theme=light] .rag-form-select:focus{border-color:#3b82f6}html[data-theme=light] .rag-form-range{background:#64748b40}html[data-theme=light] .kb-card{background:#f8fafccc;border:1px solid rgba(100,116,139,.25)}html[data-theme=light] .kb-card:hover{background:#f1f5f9f2;border-color:#64748b59}html[data-theme=light] .btn-secondary{background:#3b82f61a;border:1px solid rgba(59,130,246,.3);color:#1e40af}html[data-theme=light] .btn-secondary:hover{background:#3b82f633;border-color:#3b82f680;color:#1e3a8a}html[data-theme=light] .btn-danger{background:#ef444426;border:1px solid rgba(239,68,68,.4);color:#dc2626}html[data-theme=light] .btn-danger:hover{background:#ef444440;border-color:#ef444499;color:#b91c1c}html[data-theme=light] .rag-advanced-toggle,html[data-theme=light] .rag-advanced-section{border-top:1px solid rgba(100,116,139,.15)}html[data-theme=light] .inline-citation:hover{background:#3b82f626}html[data-theme=light] .inline-citation.hovered{background:#3b82f640}html[data-theme=light] .inline-citation:active{background:#3b82f659}html[data-theme=light] .citation-tooltip{background:#f8fafcfa;border:1px solid rgba(100,116,139,.25);box-shadow:0 10px 25px -5px #00000026}html[data-theme=light] .citation-tooltip:after{border-top-color:#f8fafcfa}html[data-theme=light] .source-item{background:#e2e8f080}html[data-theme=light] .source-item:hover,html[data-theme=light] .source-item.hovered{background:#e2e8f0cc;border-color:#64748b4d}html[data-theme=light] .sources-toggle:hover{background:#e2e8f099;border-color:#64748b66}html[data-theme=light] .chunk-modal-overlay{background:#0f172a80}html[data-theme=light] .chunk-modal-content{background:#fffffffa;border:1px solid rgba(100,116,139,.25);box-shadow:0 25px 50px -12px #00000040}html[data-theme=light] .chunk-text{background:#e2e8f080;border:1px solid rgba(100,116,139,.2)}html[data-theme=light] .chunk-relevance{background:#e2e8f099}html[data-theme=light] .source-filename{background:#3b82f626;border:1px solid rgba(59,130,246,.4)}html[data-theme=light] .chunk-metadata{border-top:1px solid rgba(100,116,139,.2)}html[data-theme=light] .chunk-modal-close:hover{background:#ef444426}.document-actions{display:flex;gap:.5rem;margin-top:.5rem}.action-button{flex:1;padding:.5rem;border:1px solid var(--border-color);border-radius:6px;background:var(--bg-input);color:var(--text-primary);font-size:.85rem;font-weight:500;cursor:pointer;transition:all .2s}.action-button:hover{background:var(--bg-secondary);border-color:var(--border-color-light)}.view-button:hover{border-color:#3b82f6;color:#3b82f6}.download-button:hover{border-color:#10b981;color:#10b981}.delete-button:hover{border-color:#ef4444;color:#ef4444}.gallery-load-more,.gallery-end{padding:2rem;text-align:center;color:var(--text-muted);font-size:.9rem}.gallery-load-more{min-height:100px;display:flex;align-items:center;justify-content:center}.document-detail-modal{position:fixed;top:0;left:0;right:0;bottom:0;background:#000000bf;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:1100;padding:2rem;animation:fadeIn .2s ease-out}.detail-content{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:12px;max-width:600px;width:100%;max-height:80vh;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 20px 50px var(--shadow)}.detail-header{display:flex;justify-content:space-between;align-items:center;padding:1.5rem;border-bottom:1px solid var(--border-color);background:var(--bg-tertiary)}.detail-header h3{margin:0;font-size:1.25rem;color:var(--text-primary)}.detail-body{padding:1.5rem;overflow-y:auto}.detail-row{margin-bottom:1.25rem;display:flex;flex-direction:column;gap:.5rem}.detail-row.detail-preview{flex-direction:column}.detail-label{font-size:.85rem;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px}.detail-value{font-size:.95rem;color:var(--text-primary);word-break:break-word}.preview-text{padding:1rem;background:var(--bg-tertiary);border:1px solid var(--border-color);border-radius:6px;font-family:Courier New,monospace;font-size:.85rem;line-height:1.6;white-space:pre-wrap;max-height:200px;overflow-y:auto}@media (max-width: 1024px){.document-gallery-grid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:1.25rem;padding:1.5rem}}@media (max-width: 768px){.gallery-modal{padding:0}.gallery-container{max-width:100%;max-height:100vh;border-radius:0}.document-gallery-grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:1rem;padding:1rem}.document-card{padding:1rem}.document-icon{width:60px;height:60px}.file-extension{font-size:.9rem}.document-metadata{font-size:.8rem}.gallery-header{padding:1rem}.gallery-header h2{font-size:1.25rem}}@media (max-width: 480px){.document-gallery-grid{grid-template-columns:1fr}.document-metadata{flex-direction:column;align-items:center;gap:.25rem;font-size:.8rem}.metadata-separator{display:none}.document-actions{flex-direction:column}.action-button{width:100%}}
