/* Simple responsive Telegram-like UI (local demo) */
:root{
  --bg:#f6f7fb; --accent:#0088cc; --muted:#6b7280; --card:#fff;
  --maxwidth:1100px;
}
*{box-sizing:border-box}
html,body,#app{height:100%;}
body{margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial;color:#111;background:var(--bg);display:flex;justify-content:center;padding:20px}
#app{width:100%;max-width:var(--maxwidth);background:transparent;display:flex;gap:16px}
aside#sidebar{width:320px;background:var(--card);border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:12px;box-shadow:0 6px 18px rgba(2,6,23,0.08)}
.brand{display:flex;gap:12px;align-items:center}
.brand-icon{width:44px;height:44px}
.brand-meta h1{margin:0;font-size:18px;color:var(--accent)}
.brand-meta small{color:var(--muted)}
.accounts-section{border-top:1px solid #eef1f6;padding-top:8px}
.accounts-list{display:flex;flex-direction:column;gap:8px;max-height:160px;overflow:auto;padding-right:6px}
.account{display:flex;align-items:center;gap:8px;padding:6px;border-radius:8px}
.account .avatar.small{width:36px;height:36px;border-radius:50%}
.account .meta .name{font-weight:600}
.account .meta .email{color:var(--muted);font-size:12px}
.account .actions{margin-left:auto;display:flex;gap:6px}
.btn{background:transparent;border:1px solid #e6eef6;padding:8px 10px;border-radius:8px;cursor:pointer}
.btn.small{padding:6px 8px;font-size:13px}
.btn.primary{background:var(--accent);color:#fff;border-color:transparent}
.nav-section{display:flex;flex-direction:column;gap:8px}
#searchInput{padding:8px;border-radius:8px;border:1px solid #e6eef6}
.tabs{display:flex;gap:6px}
.tab{background:transparent;border:none;padding:6px 8px;border-radius:8px;cursor:pointer}
.tab.active{background:#e8f6fd;color:var(--accent)}
.conversations{display:flex;flex-direction:column;gap:6px;overflow:auto;max-height:calc(100vh - 360px);padding-right:6px}
.conv{display:flex;gap:8px;padding:8px;border-radius:8px;align-items:center;cursor:pointer}
.conv:hover{background:#fbfdff}
.conv .avatar.small{width:44px;height:44px;border-radius:8px}
.conv .meta .title{font-weight:700}
.conv .meta .last{color:var(--muted);font-size:12px}
.create-row{display:flex;gap:6px;justify-content:space-between;padding-top:6px}
main#mainView{flex:1;min-width:0;background:var(--card);border-radius:12px;padding:12px;display:flex;flex-direction:column;overflow:hidden}
.empty-view{display:flex;flex-direction:column;align-items:center;justify-content:center;height:60vh;color:var(--muted)}
.chat-view.hidden{display:none}
.chat-header{display:flex;justify-content:space-between;align-items:center;padding-bottom:8px;border-bottom:1px solid #eef1f6}
.chat-header-left{display:flex;gap:12px;align-items:center}
.avatar{width:56px;height:56px;border-radius:10px;object-fit:cover}
.chat-title{font-weight:800}
.chat-subtitle{color:var(--muted);font-size:13px}
.messages{flex:1;overflow:auto;padding:16px;display:flex;flex-direction:column;gap:12px;scroll-behavior:smooth}
.msg{display:flex;gap:10px;align-items:flex-start}
.msg .avatar.tiny{width:36px;height:36px;border-radius:50%}
.bubble{background:#f1f5f9;padding:10px;border-radius:12px;min-width:80px;max-width:70%}
.msg.me{flex-direction:row-reverse}
.msg.me .bubble{background:var(--accent);color:white}
.msg-header{font-size:12px;color:var(--muted);display:flex;gap:8px;align-items:center}
.msg-name{font-weight:700;color:inherit}
.msg-time{font-size:11px;color:#94a3b8;margin-left:auto}
.msg-body{margin-top:6px;white-space:pre-wrap}
.composer{display:flex;gap:8px;padding-top:8px;border-top:1px solid #eef1f6}
.composer input[type="text"], .composer input[type="file"]{flex:1;padding:10px;border-radius:8px;border:1px solid #e6eef6}
.dropdown{position:relative}
.dropdown-menu{position:absolute;right:0;top:36px;background:var(--card);box-shadow:0 10px 30px rgba(2,6,23,0.08);border-radius:8px;padding:6px;display:flex;flex-direction:column;gap:6px}
.hidden{display:none}
.small-text{font-size:12px;color:var(--muted)}

/* responsive */
@media (max-width:900px){
  body{padding:8px}
  aside#sidebar{width:100%;order:2;border-radius:10px}
  main#mainView{order:1;margin-bottom:12px}
  #app{flex-direction:column;max-width:900px}
}
