*{box-sizing:border-box}
:root{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
html,body{margin:0;height:100%;background:#eef2f7;color:#172033}
body{display:flex;align-items:center;justify-content:center;padding:18px}
button,input,textarea{font:inherit}
button{cursor:pointer}
.app{width:min(1100px,100%);height:min(760px,calc(100vh - 36px));display:flex;overflow:hidden;background:#fff;border-radius:22px;box-shadow:0 20px 60px #17203322;border:1px solid #e5eaf1}
.sidebar{width:340px;border-right:1px solid #e7ebf1;background:#fbfcfe;display:flex;flex-direction:column}
.brand{display:flex;align-items:center;gap:12px;padding:22px 20px 15px;font-size:20px}
.brand>div:last-child{display:flex;flex-direction:column}.brand span{font-size:11px;color:#8992a3;margin-top:2px}
.brand-icon{width:42px;height:42px;border-radius:13px;background:#2878ff;color:#fff;display:grid;place-items:center;font-weight:800}
.profile{display:flex;align-items:center;gap:10px;padding:12px 18px;border-bottom:1px solid #edf0f4}
.profile>div:nth-child(2){display:flex;flex-direction:column;flex:1}.profile small,.chat-person small{color:#8a94a6;font-size:11px}
.profile button,.header-actions button{border:0;background:transparent;color:#8490a2;padding:7px;border-radius:9px}.profile button:hover,.header-actions button:hover{background:#edf2f8}
.search{margin:15px 16px;display:flex;align-items:center;gap:8px;background:#f0f3f7;border-radius:11px;padding:8px 11px;color:#8a94a6}
.search input{border:0;outline:0;background:transparent;width:100%;font-size:13px}
.contacts{overflow:auto;padding:0 9px 15px}.contact{width:100%;display:flex;align-items:center;gap:11px;padding:11px;border:0;background:transparent;text-align:left;border-radius:13px;margin-bottom:3px}.contact:hover{background:#f0f4f9}.contact.active{background:#eaf2ff}.contact-copy{display:flex;flex-direction:column;min-width:0;flex:1}.contact-copy strong{font-size:14px}.contact-copy span{font-size:11px;color:#8b95a5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:3px}.contact time{font-size:9px;color:#9ba3b0}
.avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;color:#fff;font-weight:700;flex:none;background:#2878ff}.avatar.me{width:38px;height:38px}.avatar.blue{background:#2878ff}.avatar.pink{background:#e86b9b}.avatar.green{background:#37a66b}.avatar.purple{background:#8067d9}
.chat{flex:1;min-width:0;display:flex;flex-direction:column;background:#fff}
.chat-header{height:75px;border-bottom:1px solid #e9edf3;display:flex;align-items:center;justify-content:space-between;padding:0 22px}.chat-person{display:flex;align-items:center;gap:11px}.chat-person>div:last-child{display:flex;flex-direction:column}.chat-person strong{font-size:15px}.header-actions{display:flex;gap:2px}.header-actions span{font-size:21px}
.messages{flex:1;overflow:auto;padding:25px 7%;background:linear-gradient(180deg,#fbfcfe,#f8fafc)}
.message-row{display:flex;margin:7px 0}.message-row.mine{justify-content:flex-end}.bubble{max-width:min(70%,500px);padding:10px 13px;border-radius:16px;background:#fff;border:1px solid #e7ebf1;font-size:13px;line-height:1.45;box-shadow:0 2px 7px #1720330a}.mine .bubble{background:#2878ff;color:#fff;border-color:#2878ff;border-bottom-right-radius:5px}.theirs .bubble{border-bottom-left-radius:5px}.bubble small{display:block;font-size:9px;opacity:.65;margin-top:4px;text-align:right}
.typing{height:22px;padding:0 7%;font-size:10px;color:#8993a3}
.composer{display:flex;align-items:flex-end;gap:8px;padding:12px 18px;border-top:1px solid #e9edf3;background:#fff}.composer textarea{flex:1;resize:none;max-height:120px;border:1px solid #dfe5ed;border-radius:13px;padding:10px 12px;outline:0;font-size:13px;line-height:18px}.composer textarea:focus{border-color:#2878ff}.composer>button{border:0;background:#f0f3f7;width:40px;height:40px;border-radius:11px;color:#687588;display:grid;place-items:center}.composer .send{background:#2878ff;color:#fff}.composer>button:first-child{font-size:21px}
@media(max-width:700px){body{padding:0}.app{height:100vh;border-radius:0;border:0}.sidebar{width:86px}.brand>div:last-child,.profile>div:nth-child(2),.profile button,.search input,.search,.contact-copy,.contact time{display:none}.brand{justify-content:center;padding:18px 0}.profile{justify-content:center;padding:12px 0}.contacts{padding:5px}.contact{justify-content:center;padding:9px}.chat-header{padding:0 13px}.messages{padding:18px 4%}.bubble{max-width:82%}}
@media(max-width:420px){.sidebar{width:68px}.brand-icon{width:38px;height:38px}.avatar{width:38px;height:38px}.chat-header{height:65px}.composer{padding:9px}.composer>button{width:38px;height:38px}}
