:root{--bg:#0f1115;--bg2:#161a21;--bg3:#1d222b;--line:#262c37;--text:#e6e9ef;--muted:#8b93a3;--accent:#4f8cff;--in:#222936;--out:#2b5278}*{box-sizing:border-box}body,html{margin:0;height:100%}body{background:var(--bg);color:var(--text);font:14px/1.45 -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif}.muted{color:var(--muted)}.login-wrap{height:100vh;display:grid;place-items:center}.login-card{background:var(--bg2);border:1px solid var(--line);border-radius:14px;padding:32px;width:320px;display:flex;flex-direction:column;gap:12px}.login-card h1{margin:0;font-size:20px}.login-card input{background:var(--bg3);border:1px solid var(--line);color:var(--text);padding:11px 12px;border-radius:9px;font-size:14px}.login-card button{background:var(--accent);color:#fff;border:0;padding:11px;border-radius:9px;font-weight:600;cursor:pointer}.login-card .err{color:#ff6b6b;font-size:13px}.app{display:grid;grid-template-columns:340px 1fr;height:100vh}.sidebar{border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0;background:var(--bg2)}.sb-head{padding:14px 14px 10px;border-bottom:1px solid var(--line)}.sb-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.sb-title h1{font-size:16px;margin:0}.sb-title button{background:none;border:1px solid var(--line);color:var(--muted);border-radius:7px;padding:4px 9px;font-size:12px;cursor:pointer}.chips{flex-wrap:wrap}.chip,.chips{display:flex;gap:6px}.chip{align-items:center;padding:5px 10px;border-radius:20px;background:var(--bg3);border:1px solid var(--line);cursor:pointer;font-size:12px;color:var(--muted)}.chip.active{color:#fff;border-color:transparent}.chip .dot{width:8px;height:8px;border-radius:50%}.chip .badge{background:#ff4d4f;color:#fff;border-radius:10px;padding:0 6px;font-size:10px;font-weight:700}.search{margin-top:10px;width:100%;background:var(--bg3);border:1px solid var(--line);color:var(--text);padding:8px 10px;border-radius:8px}.thread-list{overflow-y:auto;flex:1 1;min-height:0}.thread-item{display:flex;gap:10px;padding:11px 14px;border-bottom:1px solid var(--line);cursor:pointer}.thread-item.sel,.thread-item:hover{background:var(--bg3)}.avatar{width:38px;height:38px;border-radius:50%;flex:0 0 38px;display:grid;place-items:center;font-size:13px;font-weight:700;color:#fff;position:relative}.avatar .ch{position:absolute;bottom:-2px;right:-2px;width:13px;height:13px;border-radius:50%;border:2px solid var(--bg2)}.ti-main{flex:1 1;min-width:0}.ti-row{display:flex;justify-content:space-between;gap:8px}.ti-name{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ti-time{font-size:11px}.ti-snippet,.ti-time{color:var(--muted);white-space:nowrap}.ti-snippet{font-size:12.5px;overflow:hidden;text-overflow:ellipsis;margin-top:2px}.ti-unread{background:#ff4d4f;color:#fff;border-radius:10px;min-width:18px;height:18px;padding:0 5px;font-size:11px;font-weight:700;display:grid;place-items:center}.main{display:flex;flex-direction:column;min-width:0;min-height:0}.main-head{padding:13px 18px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:10px;background:var(--bg2)}.main-head .h-name{font-weight:600}.main-head .h-sub{color:var(--muted);font-size:12px}.ch-badge{font-size:10px;text-transform:uppercase;letter-spacing:.04em;padding:2px 7px;border-radius:5px;color:#fff;font-weight:700}.messages{flex:1 1;overflow-y:auto;padding:18px;display:flex;flex-direction:column;gap:8px}.empty{margin:auto;color:var(--muted);text-align:center}.bubble{max-width:68%;padding:8px 12px;border-radius:12px;white-space:pre-wrap;word-wrap:break-word}.bubble.in{background:var(--in);align-self:flex-start;border-bottom-left-radius:4px}.bubble.out{background:var(--out);align-self:flex-end;border-bottom-right-radius:4px}.bubble .meta{font-size:10.5px;color:var(--muted);margin-top:4px;text-align:right}.bubble .sender{font-size:11px;color:#9fd0ff;margin-bottom:3px;font-weight:600}.media-img{max-width:280px;max-height:280px;border-radius:8px;margin-top:6px;display:block}.media-file{display:inline-block;margin-top:6px;color:#9fd0ff;text-decoration:none}.composer{border-top:1px solid var(--line);padding:12px;display:flex;gap:10px;background:var(--bg2)}.composer textarea{flex:1 1;background:var(--bg3);border:1px solid var(--line);color:var(--text);border-radius:10px;padding:10px 12px;resize:none;font:inherit;max-height:140px}.composer button{background:var(--accent);color:#fff;border:0;border-radius:10px;padding:0 18px;font-weight:600;cursor:pointer}.composer button:disabled{opacity:.5;cursor:default}