/* Telegram-inspired interface refresh */
:root{--tg-blue:#3390ec;--tg-blue-hover:#2481d7;--tg-bg:#17212b;--tg-panel:#0e1621;--tg-row:#17212b;--tg-hover:#202b36;--tg-border:#263441;--tg-text:#f5f5f5;--tg-muted:#8b9baa;--accent:var(--tg-blue);--accent-hover:var(--tg-blue-hover);--accent-light:#70b5f5;--bg-primary:var(--tg-bg);--bg-secondary:var(--tg-panel);--bg-tertiary:#202b36;--bg-card:#202b36;--bg-input:#242f3d;--border-primary:var(--tg-border);--border-secondary:#344454;--text-primary:var(--tg-text);--text-secondary:#c4cbd2;--text-muted:var(--tg-muted);--bg-active:#2b5278;--radius-md:10px}
body,#app{background:var(--tg-bg)}
/* Account rail: avatar + name for every account, so the account you are
   about to open is readable without hovering for a tooltip. */
.col-accounts{width:272px;background:#0e1621;border-color:#263441}.col-accounts-header{justify-content:flex-start;padding:14px 16px;color:#70b5f5;font-size:11px;letter-spacing:.5px}.col-accounts-body{align-items:stretch;padding:8px;gap:2px}.acc-item{width:100%;min-height:58px;padding:7px 9px;justify-content:flex-start;gap:10px;border:0!important;background:transparent!important;border-radius:10px}.acc-item:hover{transform:none;background:#202b36!important}.acc-item.active{background:#2b5278!important;box-shadow:none}.acc-item::before{display:none}.acc-item .acc-avatar,.acc-item .acc-avatar .avatar-img,.acc-item .acc-avatar .avatar-init{width:40px;height:40px}.acc-item .acc-name{display:flex;min-width:0;flex:1;font-size:13.5px;color:#c9d5df;gap:5px}.acc-item.active .acc-name{color:#fff}.acc-name-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.acc-item .plat-badge{flex-shrink:0}.acc-item .acc-unread-badge{flex-shrink:0}.acc-item.has-unread::after{display:none}.acc-item>div:last-child{position:absolute;right:6px;top:50%;transform:translateY(-50%);display:flex;gap:2px;align-items:center;padding:4px 4px 4px 20px;border-radius:8px;background:linear-gradient(90deg,rgba(32,43,54,0) 0%,#202b36 30%);opacity:0;pointer-events:none;transition:opacity .12s ease}.acc-item:hover>div:last-child,.acc-item:focus-within>div:last-child{opacity:1;pointer-events:auto}.acc-item.active>div:last-child{background:linear-gradient(90deg,rgba(43,82,120,0) 0%,#2b5278 30%)}.col-accounts-footer{padding:8px;background:#0e1621}.col-accounts-footer .footer-actions{flex-wrap:wrap;gap:4px}.acc-action-btn{width:34px!important;height:34px!important}
.col-chats{width:360px;background:#17212b;border-color:#263441}.chats-nav{order:5;display:flex;flex-wrap:nowrap;overflow-x:auto;gap:4px;padding:7px 10px;border-top:1px solid #263441;border-bottom:0;background:#17212b}.chats-nav button{flex:0 0 auto;padding:7px 10px;border-radius:8px;font-size:12px;color:#9eacb8}.chats-nav button.active{background:#2b5278;color:white;box-shadow:none;border-color:transparent}.chats-nav button[style*="linear-gradient"]{background:transparent!important;color:#9eacb8!important;font-weight:500!important}.chats-search{padding:10px 12px;border:0}.chats-search form{background:#242f3d;border-radius:9px;padding:0 9px}.chats-search::before{left:27px;color:#8b9baa}.chats-search input{background:transparent;border:0;border-radius:8px;padding:9px 10px 9px 28px;font-size:14px}.chats-search input:focus{background:transparent;box-shadow:none}.chats-list{padding:2px 0 8px}.chat-item-2{margin:0;padding:10px 12px;border-radius:0;border:0;border-bottom:1px solid rgba(38,52,65,.5);min-height:72px}.chat-item-2:hover{background:#202b36;transform:none}.chat-item-2.active{background:#2b5278;border-color:transparent;box-shadow:none}.chat-item-2 .avatar,.chat-item-2 .avatar img,.chat-item-2 .avatar .avatar-init{width:52px;height:52px}.chat-item-2 .name{font-size:15px;color:#f5f5f5;font-weight:600}.chat-item-2 .preview{font-size:13px;color:#a8b5c2}.chat-item-2 .time{font-size:11px;color:#8b9baa}.chat-item-2 .unread-badge{background:#3390ec;box-shadow:none}
/* Bulk-selection control: no permanent white boxes beside every chat. */
.chat-item-2{position:relative}.chat-checkbox{appearance:none;-webkit-appearance:none;width:18px;height:18px;border:2px solid #71808d;border-radius:50%;background:transparent;margin:0;opacity:0;visibility:hidden;transition:opacity .14s ease,background .14s ease,border-color .14s ease;cursor:pointer;position:absolute;left:15px;top:50%;transform:translateY(-50%);z-index:2;flex-shrink:0}.chat-item-2:hover .chat-checkbox,.chat-item-2:focus-within .chat-checkbox,.chat-item-2.bulk-selected .chat-checkbox{opacity:1;visibility:visible}.chat-checkbox:checked{background:#3390ec;border-color:#3390ec;opacity:1;visibility:visible}.chat-checkbox:checked::after{content:'✓';position:absolute;inset:-1px;color:#fff;font-size:13px;font-weight:700;text-align:center;line-height:15px}.chat-checkbox:focus-visible{outline:2px solid #70b5f5;outline-offset:2px}.chat-item-2.bulk-selected{background:#24496b}
.col-chat{background-color:#0e1621;background-image:radial-gradient(circle at 20% 20%,rgba(42,70,92,.14) 0 2px,transparent 3px),radial-gradient(circle at 70% 60%,rgba(42,70,92,.12) 0 2px,transparent 3px);background-size:38px 38px}.col-chat::before{background:linear-gradient(135deg,rgba(14,22,33,.94),rgba(14,22,33,.86))}.chat-header{background:#17212b;border-bottom:1px solid #263441;padding:10px 18px;box-shadow:none;z-index:2}.chat-header-avatar{width:42px;height:42px;background:#3390ec}.chat-header-name{font-size:16px}.chat-header-status{font-size:12px;color:#8b9baa}.chat-header-status::before{display:none}.chat-header > button:not(#mobile-back-btn){border:0!important;background:transparent!important;color:#aab7c4!important;border-radius:50%!important;width:38px;height:38px;padding:0!important;font-size:15px!important}.chat-header > button:not(#mobile-back-btn):hover{background:#263441!important;color:white!important}.chat-messages{padding:22px clamp(18px,5vw,80px);gap:2px}.chat-messages .msg{font-size:14px;line-height:1.42;border-radius:12px;box-shadow:none;max-width:min(72%,620px);padding:8px 11px}.chat-messages .msg:hover{transform:none;box-shadow:none}.chat-messages .msg.outgoing{background:#2b5278;color:#f5f5f5;border-color:transparent;border-bottom-right-radius:4px}.chat-messages .msg.incoming{background:#182533;color:#f5f5f5;border-color:transparent;border-bottom-left-radius:4px}.chat-messages .msg:has(.media-img){padding:5px 6px 6px}.chat-messages .msg .media-img{max-width:min(440px,100%);max-height:480px;border-radius:9px;border:0}.chat-messages .msg.outgoing.tail{border-bottom-right-radius:4px}.chat-messages .msg.incoming.tail{border-bottom-left-radius:4px}.chat-messages .msg .time{color:#a6c8df}.chat-messages .msg.outgoing .read-receipt.read{color:#74c7f8}.chat-messages .date-separator span{background:#263441;color:#d1d9e0;border:0;border-radius:20px;padding:5px 12px}.chat-input{background:#17212b;border-top:1px solid #263441;padding:10px 18px 12px;gap:8px}.chat-input textarea{background:#242f3d;border:1px solid transparent;border-radius:12px;color:#f5f5f5;font-size:15px;padding:12px 15px;min-height:92px;max-height:min(45vh,320px);line-height:1.45}.chat-input textarea:focus{border-color:#3390ec;box-shadow:0 0 0 2px rgba(51,144,236,.15)}.chat-input .action-btn{color:#8b9baa;border-radius:50%;width:40px;height:40px}.chat-input .action-btn:hover{background:#263441;color:#dce5ed}.chat-input .send-btn{background:#3390ec;color:white;border-radius:22px;padding:10px 20px;box-shadow:none}.chat-input .send-btn:hover{background:#2481d7;transform:none}.empty-state{background:transparent}.empty-state>div:not(.empty-icon){background:#202b36;color:#cad3dc;border-radius:18px;padding:9px 16px}.empty-state .empty-icon{color:#70b5f5}.bulk-bar,#open-link-bar{background:#17212b!important}
button,input,textarea,select{font-family:inherit}button{transition:background-color .16s ease,color .16s ease,border-color .16s ease}.chat-item-2:focus-visible,.chats-nav button:focus-visible{outline:2px solid #70b5f5;outline-offset:-2px}
@media(max-width:1100px){.col-chats{width:320px}}
@media(max-width:768px){.col-accounts{width:60px}.col-accounts-header{justify-content:center;padding:10px 2px;font-size:8px;letter-spacing:0}.col-accounts-body{padding:8px 5px;align-items:center;gap:8px}.acc-item{width:48px;min-height:48px;padding:3px;justify-content:center;gap:0}.acc-item .acc-avatar,.acc-item .acc-avatar .avatar-img,.acc-item .acc-avatar .avatar-init{width:42px;height:42px}.col-chats{width:auto}.chats-nav{order:initial;flex-wrap:nowrap}.chat-header{padding:9px 10px}.chat-header > button:not(#mobile-back-btn):not(#search-btn):not(#mute-chat-btn):not(#chat-background-btn){display:none}.chat-messages{padding:12px}.chat-messages .msg{max-width:84%}.chat-input{padding:8px 10px 10px;gap:6px}.chat-input textarea{font-size:16px;padding:11px 14px;min-height:76px}.chat-input .action-btn{width:38px;height:38px}.chat-input .send-btn{padding:9px 14px}}
/* Narrow desktop chat column: compact composer tool row so the full-width
   message box and the Send button always fit on one line. */
@media(min-width:769px) and (max-width:1200px){.chat-input{gap:6px;padding:8px 12px 10px}.chat-input .action-btn{width:34px;height:34px;font-size:15px}.chat-input .send-btn{height:34px;min-width:62px;padding:8px 14px;font-size:13px}}
@media(max-width:430px){.col-accounts{width:50px}.col-accounts-body{padding:7px 4px}.acc-item{width:42px;min-height:42px;padding:2px}.acc-item .acc-avatar,.acc-item .acc-avatar .avatar-img,.acc-item .acc-avatar .avatar-init{width:38px;height:38px}.col-chats{min-width:0}.chats-nav{gap:2px;padding:6px}.chats-nav button{padding:6px 8px;font-size:11px}.chat-item-2{padding:9px 8px}.chat-item-2 .avatar,.chat-item-2 .avatar img,.chat-item-2 .avatar .avatar-init{width:46px;height:46px}}
/* Chat wallpaper picker and custom wallpaper overlay */
.col-chat.custom-wallpaper::before{background:rgba(10,18,26,.22)}
.wallpaper-picker-modal{position:fixed;inset:0;z-index:10000;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(0,0,0,.68);backdrop-filter:blur(5px)}
.wallpaper-picker{width:min(440px,100%);padding:20px;background:#17212b;border:1px solid #344454;border-radius:16px;box-shadow:0 20px 60px rgba(0,0,0,.5);color:#f5f5f5}
.wallpaper-picker header{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}.wallpaper-picker header strong{display:block;font-size:18px}.wallpaper-picker header small{display:block;margin-top:4px;color:#9eacb8;font-size:12px}
.wallpaper-close{border:0;background:transparent;color:#aab7c4;font-size:26px;cursor:pointer}.wallpaper-swatches{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.wallpaper-swatch{height:72px;border:1px solid rgba(255,255,255,.18);border-radius:11px;color:white;text-align:left;display:flex;align-items:flex-end;padding:9px;cursor:pointer;text-shadow:0 1px 4px #000;font-size:12px}.wallpaper-swatch:hover{outline:2px solid #70b5f5;outline-offset:2px}.wallpaper-upload,.wallpaper-reset{width:100%;margin-top:14px;border:1px solid #3390ec;border-radius:9px;padding:10px;text-align:center;color:#70b5f5;background:transparent;cursor:pointer;font-size:13px}.wallpaper-upload:hover,.wallpaper-reset:hover{background:#20394f}.wallpaper-reset{margin-top:8px;border-color:#435361;color:#c5d0da}

/* ── Account privacy mode ──────────────────────────────────────────────
   Names/phones are replaced with "Account N" + dots by app.js. These rules
   keep the icon-only rail intact and make the lock state obvious. */
.hide-account-names .acc-item .acc-avatar .avatar-init{font-size:18px;color:#9eacb8}
.hide-account-names .acc-item .acc-name{color:#8b9baa}
.acc-action-btn.is-on{color:#fbbf24!important;background:rgba(251,191,36,.12)!important;box-shadow:0 0 0 1px rgba(251,191,36,.35) inset}
.acc-action-btn.is-on:hover{background:rgba(251,191,36,.22)!important}
