:root{--bg:#15171c;--panel:#1c1f26;--border:#2a2e37;--text:#e7e9ee;--muted:#9aa3b2;--me:#2b5278;--them:#262b33;--accent:#e0245e}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--bg);color:var(--text);font-family:system-ui,"Segoe UI",Roboto,sans-serif;font-size:14px}
#app{display:flex;height:100vh}
#sidebar{width:340px;min-width:240px;border-right:1px solid var(--border);display:flex;flex-direction:column;background:var(--panel)}
.top{display:flex;gap:6px;padding:10px;border-bottom:1px solid var(--border)}
.top input{flex:1;background:#15171c;border:1px solid var(--border);color:var(--text);border-radius:8px;padding:8px 10px}
.top button{background:transparent;color:var(--muted);border:0;cursor:pointer;font-size:18px}
.banner{padding:6px 12px;font-size:12px;color:var(--muted);border-bottom:1px solid var(--border)}
.banner.stale{color:#e0a24e}
.list{flex:1;overflow-y:auto}
.list-empty{padding:16px 12px;color:var(--muted);font-size:13px}
.conv{padding:10px 12px;border-bottom:1px solid #20242c;cursor:pointer}
.conv:hover{background:#1c2026}
.conv.active{background:#222838}
.conv-name{font-weight:600;display:flex;align-items:center;gap:6px}
.dot{width:8px;height:8px;border-radius:50%;background:#3fb950;display:inline-block}
.pending{font-size:12px}
.conv-last{color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
.conv-date{color:#6b7280;font-size:11px;margin-top:2px}
#main{flex:1;display:flex;flex-direction:column;min-width:0}
.thread-head{padding:12px;border-bottom:1px solid var(--border);font-weight:600}
.messages{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:6px}
.msg{max-width:70%;padding:7px 10px;border-radius:12px;white-space:pre-wrap;word-break:break-word}
.msg.me{align-self:flex-end;background:var(--me)}
.msg.them{align-self:flex-start;background:var(--them)}
.pending-msg{opacity:.65}
.msg-img{max-width:240px;max-height:240px;border-radius:8px;display:block;cursor:zoom-in}
.msg-date{font-size:10px;color:var(--muted);margin-top:3px;text-align:right}
.composer{display:flex;gap:8px;padding:10px;border-top:1px solid var(--border)}
.composer input[type=file]{max-width:150px;color:var(--muted);align-self:center;font-size:12px}
.composer textarea{flex:1;resize:none;background:#15171c;border:1px solid var(--border);color:var(--text);border-radius:10px;padding:9px 12px;font-family:inherit;font-size:14px;max-height:120px}
.composer button{background:var(--accent);color:#fff;border:0;border-radius:10px;padding:0 18px;cursor:pointer;font-weight:600}
.login-body{display:flex;align-items:center;justify-content:center;height:100vh}
.login-card{background:var(--panel);border:1px solid var(--border);border-radius:14px;padding:28px;width:320px;display:flex;flex-direction:column;gap:12px}
.login-card h1{margin:0 0 6px;font-size:20px;text-align:center}
.login-card input{background:#15171c;border:1px solid var(--border);color:var(--text);border-radius:8px;padding:10px 12px}
.login-card button{background:var(--accent);color:#fff;border:0;border-radius:8px;padding:10px;cursor:pointer;font-weight:600}
.err{color:#f08a8a;font-size:13px;min-height:16px;text-align:center}
.lightbox{position:fixed;inset:0;background:rgba(0,0,0,.85);display:flex;align-items:center;justify-content:center;z-index:100;cursor:zoom-out}
.lightbox img{max-width:92vw;max-height:92vh;border-radius:8px}
.account{display:flex;align-items:center;gap:8px;padding:7px 12px;border-bottom:1px solid var(--border);font-size:12px}
.acc-dot{width:9px;height:9px;border-radius:50%;background:#555}
.acc-dot.on{background:#3fb950}
.acc-dot.off{background:#e0245e}
.acc-label{flex:1;color:var(--muted)}
.acc-btn{background:#2a2e37;color:var(--text);border:0;border-radius:6px;padding:4px 10px;cursor:pointer;font-size:12px}
.acc-btn:hover{background:#363b47}
.acc-pending{color:#e0a24e}
.media-ph{background:#1f2430;color:#9aa3b2;border:1px dashed #39404e;border-radius:8px;padding:18px 22px;cursor:pointer;font-size:13px}
.media-ph:hover{background:#252b38;color:#e7e9ee}
@media(max-width:640px){#sidebar{width:44%;min-width:0}.msg{max-width:85%}}
