.chat-kb-reference{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:10px;border:1px solid #cfe7fb;background:#f3faff;border-radius:11px;padding:8px 10px;font-size:11px;color:#477ca6}
.chat-kb-reference svg{height:15px;width:15px;color:#4d9edc;flex:none}
.chat-kb-reference span{min-width:0;flex:1;overflow-wrap:anywhere}
.chat-kb-reference button{border:0;border-radius:7px;background:#e2f1ff;padding:6px 9px;color:#2c83d0;font-weight:700;white-space:nowrap;font-size:10px}
.kb-heading{align-items:center}
.kb-heading .button{flex:none}
.kb-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:21px}
.kb-stat{display:flex;align-items:center;gap:15px;background:white;border:1px solid var(--line);border-radius:18px;padding:20px;box-shadow:var(--shadow)}
.kb-stat-icon{display:grid;place-items:center;width:43px;height:43px;background:#e8f5ff;border-radius:13px;color:#368eea;flex:none}
.kb-stat strong{display:block;font:800 24px 'Plus Jakarta Sans','IBM Plex Sans Thai',sans-serif;color:#24415d;letter-spacing:-.04em}
.kb-stat small{color:#8da5b9;font-size:11px}
.kb-content-grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(270px,.85fr);gap:20px;align-items:start}
.kb-content-grid .panel{min-width:0}
.kb-panel-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:20px}
.kb-panel-top h2,.kb-side-panel h2{font-size:16px;color:#27445e;margin:0 0 5px}
.kb-panel-top p,.kb-side-panel p{font-size:12px;color:#8da1b7;line-height:1.85;margin:0}
.kb-icon-btn{width:37px;height:37px;border:1px solid #deebf8;border-radius:10px;background:#f5faff;display:grid;place-items:center;color:#4a92d2}
.kb-icon-btn svg{width:17px;height:17px}
.kb-search{display:flex;align-items:center;gap:10px;padding:7px 7px 7px 14px;border:1px solid #ddebf9;background:#f9fcff;border-radius:12px;margin-bottom:18px}
.kb-search svg{color:#77a8d3;width:18px;height:18px}
.kb-search input{background:transparent;border:0;outline:none;min-width:0;flex:1;color:#315473;font-size:12px}
.kb-search button{padding:9px 15px;border:0;border-radius:8px;background:#e3f2ff;color:#348ed9;font-size:11px;font-weight:700}
.kb-result{padding:12px;border-radius:11px;border:1px solid #cfe6fc;background:#f1f9ff;margin-bottom:14px;font-size:12px;color:#456d8c}
.kb-result b{display:block;margin:0 0 5px;color:#3179b8}
.kb-result article{margin:10px 0;padding-top:9px;border-top:1px solid #e0edf9;white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px;max-height:105px;overflow:auto}
.kb-files{min-height:270px;display:grid;align-content:start;gap:9px}
.kb-empty{min-height:275px;border:1px dashed #dbeafa;border-radius:15px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;gap:12px;padding:22px;color:#9baec0;background:linear-gradient(145deg,#fbfdff,#f7fbff)}
.kb-empty svg{color:#71b1e8;width:48px;height:48px;stroke-width:1.2;padding:11px;box-sizing:content-box;border-radius:17px;background:#ecf7ff;border:1px solid #e0effe}
.kb-empty strong{font-size:14px;color:#577a9b}.kb-empty small{font-size:12px;max-width:320px;line-height:1.9}
.kb-file{display:flex;align-items:center;gap:14px;border:1px solid #e7eef8;background:#fff;border-radius:13px;padding:14px;min-width:0}
.kb-file-icon{display:grid;place-items:center;width:39px;height:43px;border:1px solid #dfedfc;background:#f2f9ff;border-radius:11px;color:#5297dc;flex:none}
.kb-file-info{display:grid;gap:4px;flex:1;min-width:0}.kb-file-info strong{font-size:12px;color:#3c5876;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kb-file-info small{color:#98adbf;font-size:10px}
.kb-file-actions{display:flex;align-items:center;gap:5px;flex:none}
.kb-file-actions button{display:grid;place-items:center;width:33px;height:33px;border:0;border-radius:9px;background:#f4f8fc;color:#7198b6}
.kb-file-actions button:hover{background:#eaf5ff;color:#2684d5}.kb-file-actions .kb-delete:hover{background:#fff0f1;color:#d54e60}
.kb-file-actions button svg{width:16px;height:16px}
.kb-switch{position:relative;display:inline-flex;align-items:center;flex:none;cursor:pointer}
.kb-switch input{position:absolute;opacity:0;width:1px;height:1px}.kb-switch span{width:34px;height:20px;background:#d8e4ee;border-radius:20px;transition:.2s;display:block}
.kb-switch span:after{content:'';position:absolute;top:3px;left:3px;width:14px;height:14px;border-radius:50%;background:white;box-shadow:0 2px 5px #253f5a25;transition:.2s}
.kb-switch input:checked+span{background:#4ca2ec}.kb-switch input:checked+span:after{transform:translateX(14px)}
.kb-switch input:focus-visible+span{outline:3px solid #8ec5f6;outline-offset:2px}
.kb-file-disabled{opacity:.62}.kb-foot{font-size:10px;color:#9db0c3;margin-top:22px;line-height:1.8}
.kb-side{min-width:0}.kb-side-panel{margin-bottom:18px}
.kb-visual{width:60px;height:60px;display:grid;place-items:center;background:linear-gradient(140deg,#e3f4ff,#f2f9ff);border:1px solid #d8ecfb;border-radius:19px;color:#4c9eec;margin:3px 0 22px;box-shadow:0 9px 22px #5298ce15}
.kb-visual svg{width:29px;height:29px}
.kb-security{display:flex;gap:9px;margin:18px 0;border-top:1px solid #eef4fa;padding-top:17px;color:#668ca9;font-size:11px;line-height:1.8}
.kb-security svg{width:18px;height:18px;flex:none;color:#56ae9e}
.kb-side-panel>.button{width:100%}.kb-note-form{display:grid;gap:9px;margin-top:18px}
.kb-note-form label{font-size:11px;font-weight:700;color:#5d7f9c}
.kb-note-form input,.kb-note-form textarea{font-family:inherit;border:1px solid #ddebf7;border-radius:10px;padding:12px;font-size:12px;background:#fbfdff;color:#355879;width:100%;min-width:0;resize:vertical}
.kb-note-form input:focus,.kb-note-form textarea:focus{outline:2px solid #a0d2fc}
.kb-note-form button{margin-top:7px}.kb-note-form textarea{line-height:1.7}
@media(max-width:1080px){.kb-content-grid{grid-template-columns:minmax(0,1fr) 300px}}
@media(max-width:760px){.kb-content-grid{grid-template-columns:1fr}.kb-stats{gap:9px}.kb-stat{padding:13px 10px;gap:8px}.kb-stat-icon{width:34px;height:34px;border-radius:10px}.kb-stat-icon svg{width:17px;height:17px}.kb-stat strong{font-size:19px}.kb-stat small{font-size:9px}.kb-file{gap:9px;padding:10px}.kb-file-icon{width:34px;height:37px}.kb-file-actions button{width:28px;height:30px}.kb-side{display:grid;grid-template-columns:1fr;gap:0}}
@media(max-width:420px){.kb-heading .button{width:100%}.kb-search button{padding:8px}.kb-stat-icon{display:none}.kb-stat{text-align:center;justify-content:center}.kb-file-actions{gap:2px}.kb-file-info small{font-size:9px}}
