/* The original dialog list stays in place, preserving all chat event handlers. */
body.ksan-chat-sidebar #appSidebar,body.ksan-chat-sidebar #ksanMobileMenu,body.ksan-chat-sidebar #ksanMenuShade{display:none!important}
body.ksan-chat-sidebar #chatsLayout{display:block!important;position:static!important;height:100%!important;min-height:0!important;max-height:none!important;border:0!important;background:transparent!important;overflow:visible!important}
body.ksan-chat-sidebar #chatsLayout .dialogs-panel{position:fixed!important;inset:var(--ksan-edge) auto var(--ksan-edge) var(--ksan-edge)!important;width:var(--ksan-nav-width)!important;height:calc(100dvh - 2 * var(--ksan-edge))!important;min-height:0!important;max-height:none!important;display:flex!important;flex-direction:column!important;border:0!important;border-radius:18px!important;background:#212121!important;overflow:hidden!important;z-index:110!important;box-sizing:border-box!important}
body.ksan-chat-sidebar .dialogs-head{display:flex!important;gap:12px;padding:12px 14px 8px!important}
body.ksan-chat-sidebar .dialogs-head>div{flex:1}
body.ksan-chat-sidebar .dialogs-head h1{font-size:17px!important}
.ksan-chats-menu-back{display:grid;place-items:center;width:32px;height:36px;flex:none;border:0;background:none;color:#aaa;cursor:pointer}
.ksan-chats-menu-back svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
body.ksan-chat-sidebar .dialogs-search-wrap{height:44px!important;border-radius:24px!important;background:#2b2b2b!important;margin:4px 14px 10px!important}
body.ksan-chat-sidebar .dialogs-search-wrap input{font-size:15px!important}
body.ksan-chat-sidebar .dialog-list{flex:1;overflow:auto!important;padding:8px!important}
body.ksan-chat-sidebar .dialog-row{height:76px!important;min-height:76px!important;border-radius:14px!important;position:relative!important}
body.ksan-chat-sidebar .dialog-line strong{font-size:16px!important}
body.ksan-chat-sidebar .dialog-line time{font-size:12px!important}
body.ksan-chat-sidebar .dialog-preview{font-size:14px!important;margin-top:4px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.ksan-chat-sidebar .tg-presence{display:none}
body.ksan-chat-sidebar .tg-row:has(.is-selected),body.ksan-chat-sidebar .dialog-row.is-selected{background:#7463bb!important;border-radius:14px!important}
body.ksan-chat-sidebar .is-selected .dialog-preview,body.ksan-chat-sidebar .is-selected time{color:#eee5ff!important}
body.ksan-chat-sidebar #dialogThread{width:100%!important;max-width:760px!important;height:100%!important;min-height:0!important;margin:0 auto!important;background:transparent!important;border:0!important;gap:8px!important}
body.ksan-chat-sidebar .thread-head{border:0!important;border-radius:16px!important;background:#212121!important;padding:8px 14px!important}
body.ksan-chat-sidebar .thread-messages{flex:1;min-height:0;overflow:auto!important;background:transparent!important;padding:14px 4px!important}
body.ksan-chat-sidebar .thread-composer{border:0!important;border-radius:26px!important;padding:7px 10px!important;margin:0 0 4px!important;background:#212121!important}
body.ksan-chat-sidebar .thread-compose-field{background:transparent!important;font-size:15px!important}
body.ksan-chat-sidebar .tg-empty{height:100%;background:transparent!important;color:#ddd}
@media(max-width:760px){
 body.ksan-chat-sidebar.has-site-header>.ksan-shell>.ksan-main{padding:0!important}
 body.ksan-chat-sidebar #chatsLayout .dialogs-panel{inset:8px!important;width:calc(100vw - 16px)!important;height:calc(100dvh - 16px)!important}
 body.ksan-chat-sidebar #chatsLayout.is-thread-open .dialogs-panel{display:none!important}
 body.ksan-chat-sidebar #dialogThread .thread-back-btn{display:grid!important}
}

/* Chat content reveals the shared wallpaper instead of an opaque page layer. */
body[data-view="chats"] .ksan-main,
body[data-view="chats"] #chatsView,
body[data-view="chats"] #chatsLayout,
body[data-view="chats"] #dialogThread,
body[data-view="chats"] #dialogThread .thread-messages{background:transparent!important;box-shadow:none!important}
