:root{--bg:#0b0912;--panel:#14111f;--panel2:#1c1730;--line:#2a2340;--vio:#8b5cf6;--vio2:#6d28d9;--txt:#ece9f5;--mut:#9a93b3}
body{margin:0;background:var(--bg);color:var(--txt);font-family:Vazirmatn,Tahoma,system-ui,sans-serif}
button{font:inherit;color:inherit;cursor:pointer}
.muted{color:var(--mut)}.small{font-size:.8rem}.online{color:#a78bfa}
.input{width:100%;box-sizing:border-box;background:var(--panel2);border:1px solid var(--line);color:var(--txt);border-radius:12px;padding:.7rem .9rem}
.input:focus{border-color:var(--vio);outline:2px solid #8b5cf655}
.btn.primary{background:linear-gradient(135deg,var(--vio),var(--vio2));border:0;border-radius:12px;padding:.75rem;color:#fff;font-weight:700}
.link{background:none;border:0;color:#c4b5fd}
.center{min-height:100vh;display:grid;place-items:center}
.auth-wrap{min-height:100vh;display:grid;place-items:center;padding:1rem;background:radial-gradient(circle at 50% 0,#3b1d7a 0,var(--bg) 60%)}
.auth-card{width:100%;max-width:360px;display:flex;flex-direction:column;gap:.8rem;background:var(--panel);border:1px solid var(--line);padding:2rem 1.5rem;border-radius:22px;text-align:center;animation:pop .4s ease}
.auth-card h1{margin:0}
.logo{width:64px;height:64px;margin:0 auto;border-radius:50%;display:grid;place-items:center;font-size:2rem;background:linear-gradient(135deg,var(--vio),var(--vio2));color:#fff;box-shadow:0 0 30px #8b5cf688}
.logo.big{width:96px;height:96px;font-size:3rem}
@keyframes pop{from{opacity:0;transform:translateY(12px) scale(.97)}to{opacity:1;transform:none}}
.app{display:flex;height:100vh;height:100dvh}
.sidebar{width:340px;max-width:100%;display:flex;flex-direction:column;background:var(--panel);border-inline-end:1px solid var(--line)}
.side-head,.chat-head{display:flex;align-items:center;gap:.6rem;padding:.7rem .9rem;border-bottom:1px solid var(--line);background:var(--panel)}
.side-head{justify-content:space-between}
.brand{font-weight:800;color:#c4b5fd;font-size:1.15rem}
.row-gap{display:flex;gap:.3rem}
.icon{background:none;border:0;width:38px;height:38px;border-radius:50%;font-size:1.1rem}
.icon:hover{background:var(--panel2)}
.search{padding:.6rem .8rem}
.chat-list{flex:1;overflow-y:auto}
.chat-item{display:flex;gap:.7rem;width:100%;align-items:center;padding:.6rem .8rem;background:none;border:0;text-align:start;transition:background .2s}
.chat-item:hover{background:var(--panel2)}.chat-item.active{background:#4c1d95aa}
.ci-body{flex:1;min-width:0}.ci-top{display:flex;justify-content:space-between;gap:.5rem}
.ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.avatar{width:46px;height:46px;flex-shrink:0;border-radius:50%;display:grid;place-items:center;color:#fff;font-weight:700}
.av-wrap{position:relative}.dot{position:absolute;bottom:2px;left:2px;width:11px;height:11px;border-radius:50%;background:#a78bfa;border:2px solid var(--panel)}
.me-bar{display:flex;align-items:center;gap:.6rem;padding:.6rem .9rem;border-top:1px solid var(--line)}
.chat{flex:1;display:flex;flex-direction:column;min-width:0;background:var(--bg) radial-gradient(circle at 20% 20%,#2e106555,transparent 50%)}
.empty-chat{align-items:center;justify-content:center;gap:1rem}
.back{display:none}
.messages{flex:1;overflow-y:auto;padding:1rem;display:flex;flex-direction:column;gap:.35rem}
.msg{display:flex;justify-content:flex-end;animation:pop .25s ease}
.msg.mine{justify-content:flex-start}
.bubble{position:relative;max-width:75%;background:var(--panel2);padding:.5rem .75rem;border-radius:16px 16px 16px 4px;cursor:pointer}
.mine .bubble{background:linear-gradient(135deg,#7c3aed,#5b21b6);border-radius:16px 16px 4px 16px}
.txt{white-space:pre-wrap;word-break:break-word}
.meta{font-size:.68rem;opacity:.7;text-align:end;margin-top:.2rem}
.reply-q{border-inline-start:3px solid #c4b5fd;padding:.2rem .5rem;margin-bottom:.3rem;background:#0003;border-radius:6px;font-size:.8rem;display:flex;flex-direction:column}
.reply-q span{opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.menu{position:absolute;top:100%;inset-inline-start:0;z-index:5;background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:.3rem;display:flex;flex-direction:column;min-width:130px;box-shadow:0 10px 30px #0008;animation:pop .15s}
.menu button{background:none;border:0;text-align:start;padding:.45rem .6rem;border-radius:8px}
.menu button:hover{background:var(--panel2)}.menu .danger{color:#f87171}
.compose-ctx{display:flex;justify-content:space-between;align-items:center;padding:.4rem .9rem;background:var(--panel);border-top:1px solid var(--line);font-size:.85rem;color:#c4b5fd}
.composer{display:flex;gap:.5rem;padding:.6rem .8rem;background:var(--panel);border-top:1px solid var(--line)}
.send{width:46px;height:46px;flex-shrink:0;border-radius:50%;border:0;background:var(--vio);color:#fff;font-size:1.1rem;transform:scaleX(-1)}
.send:disabled{opacity:.4}
@media (max-width:760px){.sidebar{width:100%}.hide-mobile{display:none!important}.back{display:block}}
