:root{--primary:#2b5499;--primary-dark:#1e3d70;--primary-bg:#ebf0fa;--bg:#f4f6f9;--surface:#fff;--border:#a8b8cc;--border-input:#6b80a0;--border-focus:#2b5499;--text:#1a2438;--text-sub:#5c6b80;--user-bubble-bg:#d4e2f5;--user-bubble-bd:#a0bce0;--r-sm:6px;--r-md:10px;--shadow-sm:0 1px 3px #00000014;--shadow-md:0 2px 10px #0000001a, 0 0 1px #0000000a}*{box-sizing:border-box;margin:0;padding:0}body{background:var(--bg);color:var(--text);height:100vh;font-family:Hiragino Kaku Gothic ProN,Hiragino Sans,Yu Gothic UI,Meiryo,Segoe UI,system-ui,sans-serif;font-size:15px;line-height:1.6;overflow:hidden}.app-wrapper{background:var(--surface);max-width:780px;height:100vh;box-shadow:var(--shadow-md);flex-direction:column;margin:0 auto;display:flex}.app-header{background:var(--primary-dark);flex-shrink:0;justify-content:space-between;align-items:center;height:52px;padding:0 1.5rem;display:flex}.app-header h1{color:#fff;letter-spacing:.06em;font-size:.9375rem;font-weight:600}.app-header-link{color:#ffffffbf;border-radius:var(--r-sm);border:1px solid #ffffff4d;padding:.35rem .875rem;font-size:.875rem;text-decoration:none;transition:background .15s}.app-header-link:hover{color:#fff;background:#ffffff1f}.chat-messages-area{background:var(--bg);flex-direction:column;flex:1;gap:1rem;padding:1.5rem 1.25rem;display:flex;overflow-y:auto}.chat-message-row{align-items:flex-start;gap:10px;display:flex}.chat-message-row.user{justify-content:flex-end}.chat-message-row.bot{justify-content:flex-start}.bot-icon{background:var(--primary);color:#fff;letter-spacing:.05em;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:28px;height:28px;font-size:.6rem;font-weight:700;display:flex}.chat-bubble{word-break:break-word;font-size:.9375rem;line-height:1.7}.chat-bubble.user{background:var(--user-bubble-bg);border:1px solid var(--user-bubble-bd);color:var(--text);white-space:pre-wrap;text-align:left;border-radius:1.2rem 1.2rem .25rem;max-width:65%;padding:.7rem 1rem}.chat-bubble.bot{white-space:pre-wrap;background:0 0;border:none;border-radius:0;flex:1;min-width:0;max-width:100%;padding:.1rem 0}.loading-bubble{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md) var(--r-md) var(--r-md) 3px;box-shadow:var(--shadow-sm);color:var(--text-sub);letter-spacing:6px;padding:.5rem 1.125rem;font-size:1.25rem}.chat-input-area{border-top:1px solid var(--border);background:var(--surface);flex-direction:column;flex-shrink:0;gap:.5rem;padding:.75rem 1.25rem 1rem;display:flex}.chat-input-row{gap:.75rem;display:flex}.chat-input{border:2px solid var(--border-input);border-radius:var(--r-sm);color:var(--text);resize:none;background:#fff;outline:none;flex:1;min-height:130px;max-height:320px;padding:.65rem 1rem;font-family:inherit;font-size:.9375rem;line-height:1.5;transition:border-color .15s,box-shadow .15s;overflow-y:auto}.chat-input:focus{border-color:var(--border-focus);box-shadow:0 0 0 3px #2b54991f}.chat-input::placeholder{color:var(--text-sub)}.chat-input:disabled{background:var(--bg);opacity:.6}.chat-send-btn{background:var(--primary);color:#fff;border-radius:var(--r-sm);cursor:pointer;white-space:nowrap;border:none;flex-shrink:0;padding:.65rem 1.375rem;font-family:inherit;font-size:.9375rem;font-weight:600;transition:background .15s}.chat-send-btn:hover:not(:disabled){background:var(--primary-dark)}.chat-send-btn:disabled{color:#fff;cursor:not-allowed;background:#b0c0d4}.chat-rag-toggle{align-items:center;gap:.625rem;display:flex}.chat-rag-label{color:var(--text-sub);font-size:.8rem}.rag-toggle{border:1.5px solid var(--border);border-radius:var(--r-sm);display:flex;overflow:hidden}.rag-toggle-btn{cursor:pointer;color:var(--text-sub);background:0 0;border:none;padding:.3rem .875rem;font-family:inherit;font-size:.8rem;font-weight:600;transition:background .15s,color .15s}.rag-toggle-btn.active{background:var(--primary);color:#fff}.rag-toggle-btn:not(.active):hover{background:var(--primary-bg);color:var(--primary)}.chat-response-time{color:var(--text-sub);text-align:right;margin-top:.5rem;font-size:.75rem}.chat-doc-list{border-left:3px solid var(--primary);border-radius:0 var(--r-sm) var(--r-sm) 0;background:#00000008;margin-top:.75rem;padding:.625rem .875rem}.chat-doc-title{color:var(--text-sub);text-transform:uppercase;letter-spacing:.05em;margin-bottom:.375rem;font-size:.75rem;font-weight:700}.chat-doc-item{color:var(--text-sub);white-space:nowrap;text-overflow:ellipsis;padding:.15rem 0;font-size:.8rem;overflow:hidden}.chat-doc-score{color:var(--primary);margin-left:.375rem;font-family:Courier New,monospace;font-size:.75rem}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#8a9ab0}.admin-content--chat{align-items:center;padding-bottom:0;overflow:hidden}.admin-chat-wrap{flex-direction:column;flex:1;width:100%;max-width:780px;min-height:0;display:flex}.admin-chat-messages{flex-direction:column;flex:1;gap:.75rem;min-height:100px;padding:.5rem 0;display:flex;overflow-y:auto}.admin-chat-footer{border-top:1px solid var(--border);flex-direction:column;flex-shrink:0;gap:.5rem;padding-top:.75rem;display:flex}.admin-chat-row{gap:.625rem;display:flex}.admin-chat-input{border:1.5px solid var(--border-input);border-radius:var(--r-sm);resize:vertical;outline:none;flex:1;min-height:70px;max-height:120px;padding:.5rem .875rem;font-family:inherit;font-size:.875rem}.admin-chat-input:focus{border-color:var(--border-focus)}.admin-chat-send{background:var(--primary);color:#fff;border-radius:var(--r-sm);cursor:pointer;white-space:nowrap;border:none;align-self:flex-end;padding:.5rem 1.125rem;font-family:inherit;font-size:.875rem;font-weight:600}.admin-chat-send:hover:not(:disabled){background:var(--primary-dark)}.admin-chat-send:disabled{cursor:not-allowed;background:#b0c0d4}.admin-wrapper{flex-direction:column;height:100vh;display:flex}.admin-header{background:var(--primary-dark);flex-shrink:0;justify-content:space-between;align-items:center;height:52px;padding:0 1.5rem;display:flex}.admin-header h1{color:#fff;letter-spacing:.06em;font-size:.9375rem;font-weight:600}.admin-header-link{color:#ffffffbf;border-radius:var(--r-sm);border:1px solid #ffffff4d;padding:.35rem .875rem;font-size:.875rem;text-decoration:none;transition:background .15s}.admin-header-link:hover{color:#fff;background:#ffffff1f}.admin-body{grid-template-columns:210px 1fr;gap:1rem;height:calc(100vh - 52px);padding:1rem;display:grid;overflow:hidden}.admin-sidebar{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);flex-direction:column;gap:.25rem;padding:.75rem .5rem;display:flex;overflow-y:auto}.admin-nav-label{color:var(--text-sub);text-transform:uppercase;letter-spacing:.08em;padding:.5rem .75rem .25rem;font-size:.7rem;font-weight:700}.admin-nav-btn{width:100%;color:var(--text);border-radius:var(--r-sm);cursor:pointer;text-align:left;background:0 0;border:none;align-items:center;gap:.5rem;padding:.65rem .875rem;font-family:inherit;font-size:.875rem;font-weight:500;line-height:1.4;transition:background .15s,color .15s;display:flex}.admin-nav-btn:hover{background:var(--primary-bg);color:var(--primary)}.admin-nav-btn.active{background:var(--primary-bg);color:var(--primary);font-weight:700}.admin-content{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);flex-direction:column;gap:1rem;min-height:0;padding:1.25rem 1.5rem;display:flex;overflow-y:auto}.admin-section-title{color:var(--text);border-bottom:2px solid var(--primary);flex-shrink:0;padding-bottom:.75rem;font-size:.9375rem;font-weight:700}.admin-action-btn{background:var(--primary);color:#fff;border-radius:var(--r-sm);cursor:pointer;border:none;align-self:flex-start;padding:.625rem 1.5rem;font-family:inherit;font-size:.9375rem;font-weight:700;transition:background .15s}.admin-action-btn:hover:not(:disabled){background:var(--primary-dark)}.admin-action-btn:disabled{cursor:not-allowed;background:#b0c0d4}.status-info{border-radius:var(--r-sm);color:#1d4ed8;background:#eff6ff;border:1px solid #bfdbfe;padding:.75rem 1rem;font-size:.875rem;line-height:1.6}.status-success{border-radius:var(--r-sm);color:#15803d;background:#f0fdf4;border:1px solid #86efac;padding:.75rem 1rem;font-size:.875rem;line-height:1.6}.status-error{border-radius:var(--r-sm);color:#b91c1c;background:#fef2f2;border:1px solid #fecaca;padding:.75rem 1rem;font-size:.875rem;line-height:1.6}.status-warn{border-radius:var(--r-sm);color:#92400e;background:#fffbeb;border:1px solid #fde68a;padding:.75rem 1rem;font-size:.875rem;line-height:1.6}.progress-wrap{background:var(--border);border-radius:3px;width:100%;height:6px;overflow:hidden}.progress-fill{background:var(--primary);border-radius:3px;height:100%;transition:width .3s}.progress-text{color:var(--text-sub);margin-top:.25rem;font-size:.8rem}.admin-log-area{background:var(--bg);border:1px solid var(--border);border-radius:var(--r-sm);flex-direction:column;gap:.2rem;max-height:260px;padding:.75rem;font-size:.8125rem;line-height:1.5;display:flex;overflow-y:auto}.log-info{color:var(--text-sub)}.log-success{color:#15803d;font-weight:500}.log-error{color:#b91c1c}.log-warn{color:#92400e}.metrics-row{flex-wrap:wrap;gap:1rem;display:flex}.metric-card{background:var(--bg);border:1px solid var(--border);border-radius:var(--r-sm);min-width:130px;padding:.875rem 1.125rem}.metric-label{color:var(--text-sub);margin-bottom:.25rem;font-size:.75rem}.metric-value{color:var(--primary);font-size:1.75rem;font-weight:700}.auth-overlay{z-index:9999;background:linear-gradient(135deg,#2b5499 0%,#1e3d70 100%);justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.auth-overlay-box{text-align:center;background:#fff;border-radius:16px;width:90%;max-width:420px;padding:3rem 4rem;box-shadow:0 8px 32px #00000040}.auth-overlay-title{color:var(--primary);margin-bottom:1rem;font-size:1.75rem;font-weight:700}.auth-overlay-msg{color:var(--text-sub);margin-bottom:1.5rem;font-size:1rem}.auth-login-btn{background:var(--primary);color:#fff;border-radius:var(--r-md);cursor:pointer;border:none;padding:.75rem 2rem;font-size:1rem;font-weight:600}.auth-login-btn:hover{background:var(--primary-dark)}.app-header-user{color:#dce8ff;font-size:.875rem}.app-header-logout{border-radius:var(--r-sm);color:#dce8ff;cursor:pointer;background:0 0;border:1px solid #fff6;padding:.25rem .75rem;font-size:.875rem}.app-header-logout:hover{background:#ffffff1a}
