﻿*{margin:0;padding:0;box-sizing:border-box}
body{font-family:'Segoe UI',sans-serif;background:#f5e6d3;min-height:100vh;display:flex;justify-content:center;align-items:center;padding:20px}
.c{background:#fff;border-radius:20px;box-shadow:0 20px 60px rgba(0,0,0,.2);width:100%;max-width:800px;height:90vh;display:flex;flex-direction:column;overflow:hidden}
.h{background:linear-gradient(135deg,#d2691e,#8b4513);color:#fff;padding:12px 16px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.h h1{font-size:16px}.h p{font-size:10px;opacity:.9}
.h-right{margin-left:auto;display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.h-right a{color:#fff;text-decoration:none;font-size:11px;font-weight:bold}
.h-right button{background:#8b4513;color:#fff;border:none;padding:4px 10px;border-radius:15px;cursor:pointer;font-size:10px;font-weight:bold}
.guest-badge{background:#ff9800;color:#fff;padding:2px 7px;border-radius:10px;font-size:9px;font-weight:bold;display:none}

.search-bar{display:flex;align-items:center;gap:8px;padding:10px 15px;background:#fff;border-bottom:2px solid #d2691e}
.search-bar input{flex:1;padding:10px 16px;border:2px solid #e0c8a8;border-radius:25px;font-size:14px;outline:0;width:100%;min-width:0}
.search-bar input:focus{border-color:#d2691e;box-shadow:0 0 0 3px rgba(210,105,30,.2)}
.search-close-btn{background:#ff6b6b;color:#fff;border:none;width:32px;height:32px;border-radius:50%;cursor:pointer;font-size:18px;flex-shrink:0;display:flex;align-items:center;justify-content:center}

.search-results{max-height:250px;overflow-y:auto;background:#fff;border-bottom:1px solid #f0e0d0;padding:10px}
.search-result{padding:10px 14px;margin:4px 0;background:#faf5f0;border-radius:8px;cursor:pointer;font-size:13px;color:#555}
.search-result:hover{background:#f0e0d0}
.search-result .highlight{background:#fff3e0;font-weight:bold;color:#d2691e}
.search-result .src{font-size:10px;color:#999;display:block;margin-top:3px}

.search-btn{background:#d2691e;color:#fff;border:none;padding:6px 10px;margin:2px;border-radius:6px;cursor:pointer;font-size:14px;flex-shrink:0;width:32px;height:30px;display:flex;align-items:center;justify-content:center}
.search-btn:hover{background:#8b4513}

.tabs-container{display:flex;align-items:center;background:#fff;border-bottom:2px solid #f0e0d0;min-height:36px;width:100%}
.tabs{display:flex;overflow-x:auto;padding:0 4px;min-height:36px;align-items:flex-end;flex:1;scrollbar-width:none;min-width:0}
.tabs::-webkit-scrollbar{display:none}
.tab{padding:6px 12px;background:#f5e6d3;border:1px solid #e0c8a8;border-bottom:0;border-radius:10px 10px 0 0;margin:0 2px;cursor:pointer;white-space:nowrap;font-size:11px;max-width:130px;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center;gap:4px;flex-shrink:0}
.tab.active{background:#fff;border-bottom:2px solid #fff;margin-bottom:-2px;font-weight:bold;color:#8b4513}
.tab-name{overflow:hidden;text-overflow:ellipsis;flex:1}
.tab .del{width:14px;height:14px;background:#ff6b6b;color:#fff;border-radius:50%;display:none;align-items:center;justify-content:center;font-size:9px;cursor:pointer;flex-shrink:0}
.tab:hover .del{display:flex}
.tab .rename-btn{width:14px;height:14px;background:#ccc;color:#fff;border-radius:50%;display:none;align-items:center;justify-content:center;font-size:8px;cursor:pointer;flex-shrink:0}
.tab:hover .rename-btn{display:flex}
.tab.add{background:#d2691e;color:#fff;font-weight:bold;font-size:14px;padding:4px 8px;border-radius:10px 10px 0 0;cursor:pointer;flex-shrink:0}
.export-btn{background:#f0e0d0;color:#8b4513;border:1px solid #e0c8a8;padding:3px 6px;margin:2px 4px;border-radius:6px;cursor:pointer;font-size:14px;flex-shrink:0;width:28px;height:26px;display:flex;align-items:center;justify-content:center}

#b{flex:1;overflow-y:auto;padding:15px;background:#fffaf5;scroll-behavior:smooth}
.m-wrapper{display:flex;align-items:flex-end;gap:6px;margin:6px 0;width:100%}
.m-wrapper.user{justify-content:flex-end}
.m-wrapper.bot{justify-content:flex-start}
.m{max-width:75%;padding:10px 14px;border-radius:16px;word-wrap:break-word;overflow-wrap:break-word;position:relative;line-height:1.5;font-size:13px}
.u{background:#8b4513;color:#fff;border-bottom-right-radius:6px}
.s{background:#fff;border:2px solid #d2691e;border-bottom-left-radius:6px}
.warning-msg{background:#fff3e0;border:2px solid #ff9800;color:#e65100;padding:8px 14px;border-radius:12px;margin:6px 0;text-align:center;font-weight:bold;font-size:12px;max-width:75%}
.msg-actions{display:flex;gap:3px;opacity:0.5;transition:opacity .2s;flex-shrink:0}
.m-wrapper:hover .msg-actions{opacity:1}
.msg-action-btn{width:22px;height:22px;border-radius:50%;border:0;cursor:pointer;font-size:9px;display:flex;align-items:center;justify-content:center}
.btn-copy{background:#e8f5e9;color:#2e7d32}
.btn-edit{background:#fff3e0;color:#e65100}
.time-stamp{font-size:9px;color:#999;margin-top:3px;text-align:right;opacity:.7}
.i{display:flex;padding:8px 10px;background:#fff;border-top:1px solid #f0e0d0;gap:6px;align-items:center;flex-wrap:wrap}
.file-preview{display:none;align-items:center;gap:6px;padding:4px 10px;background:#fff3e0;border-top:1px solid #f0e0d0;font-size:11px;color:#8b4513;overflow:hidden;max-width:100%;flex-shrink:0}
.attach-btn{display:flex;align-items:center;justify-content:center;width:34px;height:34px;background:#f0e0d0;border-radius:50%;cursor:pointer;font-size:16px;flex-shrink:0;border:none}
#q{flex:1;min-width:0;padding:8px 12px;border:2px solid #e0c8a8;border-radius:25px;font-size:13px;outline:0;resize:none;min-height:36px;max-height:90px;font-family:inherit}
#q:focus{border-color:#d2691e}
button#askBtn{background:#d2691e;color:#fff;border:0;padding:8px 16px;border-radius:25px;cursor:pointer;font-weight:700;white-space:nowrap;flex-shrink:0;font-size:13px}
.typing-indicator{display:none;padding:8px 15px;align-items:center;gap:4px}
.typing-indicator.show{display:flex}
.typing-dot{width:7px;height:7px;background:#d2691e;border-radius:50%;animation:typing 1.4s infinite}
.typing-dot:nth-child(2){animation-delay:.2s}
.typing-dot:nth-child(3){animation-delay:.4s}
@keyframes typing{0%,60%,100%{transform:translateY(0);opacity:.4}30%{transform:translateY(-6px);opacity:1}}
.edit-input{width:100%;padding:8px 12px;border:2px solid #d2691e;border-radius:12px;font-size:13px;font-family:inherit;outline:0;resize:none}
.edit-actions{display:flex;gap:4px;margin-top:4px;justify-content:flex-end}
.edit-actions button{padding:4px 10px;border-radius:12px;border:0;cursor:pointer;font-size:11px;font-weight:bold}
.btn-save{background:#28a745;color:#fff}
.btn-cancel{background:#999;color:#fff}
.f{text-align:center;padding:6px;font-size:9px;color:#999}
.f a{color:#d2691e;text-decoration:none}
.toast{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);background:#333;color:#fff;padding:10px 24px;border-radius:25px;font-size:14px;opacity:0;transition:opacity .3s;z-index:1000;pointer-events:none}
.toast.show{opacity:1}
@media(max-width:600px){
.c{height:95vh;border-radius:15px}
.h{padding:10px}
.m{max-width:85%;font-size:12px}
#q{font-size:12px}
.search-bar{padding:8px 10px}
.search-bar input{padding:8px 12px;font-size:13px}
.search-btn{width:36px;height:34px;font-size:16px}
.export-btn{width:32px;height:30px}
}
.search-highlight{background:#ffeb3b;color:#333;font-weight:bold;padding:0 2px;border-radius:3px}

.login-body{display:flex;justify-content:center;align-items:center;min-height:100vh}
.login-container{background:#fff;border-radius:20px;box-shadow:0 20px 60px rgba(0,0,0,.2);padding:40px;width:100%;max-width:420px}
.login-container h1{color:#8b4513;font-size:24px;text-align:center;margin-bottom:5px}
.login-container p{color:#888;text-align:center;margin-bottom:25px;font-size:14px}
.tab-row{display:flex;gap:10px;margin-bottom:20px}
.tab-btn{flex:1;padding:12px;border:2px solid #d2691e;background:#fff;color:#d2691e;border-radius:10px;cursor:pointer;font-weight:bold;font-size:14px}
.tab-btn.active{background:#d2691e;color:#fff}
label{display:block;margin-bottom:8px;color:#555;font-weight:600;font-size:14px}
input{padding:12px;margin-bottom:18px;width:100%;border:2px solid #e0c8a8;border-radius:10px;font-size:15px;outline:0}
input:focus{border-color:#d2691e}
button[type=submit]{background:#d2691e;color:#fff;border:0;padding:14px;border-radius:10px;cursor:pointer;font-weight:bold;width:100%;font-size:16px}
button[type=submit]:hover{background:#8b4513}
.msg{margin-top:15px;text-align:center;font-size:14px;display:none}
.msg.error{color:#d32f2f;display:block}
.msg.success{color:#2e7d32;display:block}
.back{display:block;text-align:center;margin-top:15px;color:#d2691e;text-decoration:none;font-size:14px}
.forgot-link{display:block;text-align:center;margin-top:10px;color:#d2691e;font-size:12px;text-decoration:none;cursor:pointer}
.forgot-link:hover{text-decoration:underline}
