/* Mobile shell and controls; desktop layout is owned by ksan-unified.css. */
@media(max-width:760px){
 body.ksan-unified{--ksan-edge:0px;--ksan-gap:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
 body.ksan-unified::after{content:attr(data-mobile-title);position:fixed;inset:0 0 auto;height:calc(56px + env(safe-area-inset-top));box-sizing:border-box;padding:calc(17px + env(safe-area-inset-top)) 56px 0;background:#212121;color:#f2f2f4;font-size:18px;font-weight:600;z-index:1500;pointer-events:none}
 body.ksan-unified.has-site-header[data-view]>.ksan-shell,body.ksan-unified.has-site-header>.ksan-shell{inset:calc(56px + env(safe-area-inset-top)) 0 0!important}
 body.ksan-unified #ksanMobileMenu{top:calc(6px + env(safe-area-inset-top));left:6px;width:44px;height:44px;border:0;border-radius:50%;background:transparent}
 body.ksan-unified.has-site-header #appSidebar.ksan-unified-panel{inset:0 auto 0 0!important;width:min(340px,calc(100vw - 40px))!important;height:100dvh!important;border-radius:0 20px 20px 0!important;padding-top:env(safe-area-inset-top)!important}
 body.ksan-unified .ksan-menu-bottom{padding-bottom:max(12px,env(safe-area-inset-bottom))}
 body.ksan-unified #appSidebar .ksan-nav-link{min-height:58px;padding:6px 12px}
 body.ksan-unified #appSidebar .ksan-section-avatar{width:48px;height:48px;flex-basis:48px}
 body.ksan-unified #appSidebar .ksan-section-copy strong{font-size:16px}
 body.ksan-unified #appSidebar .ksan-section-copy small{font-size:13px}
 body.ksan-unified #appSidebar .ksan-bottom-banner{font-size:14px;padding:10px 12px}
 body.ksan-unified #appSidebar .ksan-ai-entry .ksan-nav-link.is-ai{min-height:58px;padding:6px 12px}
 body.ksan-unified.has-site-header[data-view="wall"] #wall2010Posts{padding:8px!important;gap:10px!important}
 body.ksan-unified.has-site-header[data-view="wall"] #wall2010Posts .wall2010-post{width:100%!important;max-width:none!important;border-radius:16px!important;padding:12px!important}
 body.ksan-unified #wall2010Posts .wall2010-post>.ksan-post-like{position:static;transform:none;width:max-content;min-height:36px;margin:8px 0 0 auto}
 body.ksan-unified .wall2010-postactions{flex-wrap:wrap;gap:10px!important}
 body.ksan-unified .wall2010-comment-form>input{font-size:16px!important}
 body.ksan-unified .wall2010-comment-pages button{min-width:36px!important;height:36px!important}
 body.ksan-unified .ksan-user-ai-header{border-radius:0!important;margin:0!important;min-height:56px}
 body.ksan-unified .ksan-user-ai-greeting{min-width:0}
 body.ksan-unified #communitiesView{padding:12px 12px calc(76px + env(safe-area-inset-bottom))!important}
 body.ksan-unified .efir-cover{max-height:300px}
 
 body.ksan-unified .chats-layout,body.ksan-unified .dialog-thread{height:100%!important;min-height:0!important;border:0!important;border-radius:0!important}
 body.ksan-chat-sidebar #chatsLayout .dialogs-panel{inset:calc(56px + env(safe-area-inset-top)) 0 0!important;width:100%!important;height:calc(100dvh - 56px - env(safe-area-inset-top))!important;border-radius:0!important}
 body.ksan-unified .dialog-row{min-height:76px;padding:10px 12px!important;border:0!important}
 body.ksan-unified .thread-head{min-height:56px!important;border-radius:0!important;padding:8px 12px!important;background:#212121!important}
 body.ksan-unified .thread-messages{padding:12px 8px!important}
 body.ksan-unified .thread-composer{flex-shrink:0;margin:0!important;border-radius:0!important;padding:8px 10px max(8px,env(safe-area-inset-bottom))!important;background:#212121!important}
 body.ksan-unified .thread-compose-field{font-size:16px!important;min-height:40px}
 body.ksan-unified #aiWorkspace{border-radius:0!important}
}

/* Compact phone scale. These rules own mobile density across the shared views. */
@media(max-width:760px){
 html{width:100%;text-size-adjust:100%;-webkit-text-size-adjust:100%}
 body.ksan-unified{width:100%;min-width:0;overflow:hidden}
 body.ksan-unified.has-site-header[data-view]>.ksan-shell>.ksan-main{width:100%!important;max-width:100%!important;padding:0!important}
 body.ksan-unified #appSidebar .ksan-menu-links{flex:1;overflow-y:auto;padding:4px 6px}
 body.ksan-unified #appSidebar .ksan-section-avatar svg{width:30px;height:30px;flex-basis:30px}
 body.ksan-unified #appSidebar .ksan-section-avatar img.ksan-art-icon{width:40px;height:40px}
 body.ksan-unified #appSidebar .ksan-section-copy strong{font-size:14px;line-height:19px}
 body.ksan-unified #appSidebar .ksan-section-copy small{font-size:12px;line-height:16px}
 body.ksan-unified #appSidebar .ksan-menu-bottom{flex-shrink:0;gap:8px;padding:8px 8px max(8px,env(safe-area-inset-bottom))}
 body.ksan-unified #appSidebar .ksan-ai-entry .ksan-nav-link.is-ai{min-height:58px;padding:6px 10px}
 body.ksan-unified #appSidebar .ksan-bottom-banner{min-height:58px;margin:0 4px;font-size:13px;line-height:18px}
 body.ksan-unified.has-site-header[data-view="communities"] #communitiesView.efir-view{width:100%!important;max-width:100%!important;padding:8px 10px calc(74px + env(safe-area-inset-bottom))!important}
 body.ksan-unified #communitiesView .efir-channels{gap:12px;padding:4px 0 10px;margin:0 0 12px}
 body.ksan-unified #communitiesView .efir-channels button{width:64px;flex-basis:64px;font-size:11px;gap:6px}
 body.ksan-unified #communitiesView .efir-channel-image{width:60px;height:60px;font-size:30px;padding:3px}
 body.ksan-unified #communitiesView .efir-channel-label{max-width:64px}
 body.ksan-unified #communitiesView .efir-player{grid-template-columns:40px minmax(0,1fr) 32px 32px;gap:8px;padding:12px;border-radius:16px}
 body.ksan-unified #communitiesView .efir-music-art{width:40px;height:40px;border-radius:10px;font-size:23px!important}
 body.ksan-unified #communitiesView .efir-music-copy strong{font-size:14px}
 body.ksan-unified #communitiesView .efir-music-copy button{font-size:12px}
 body.ksan-unified #communitiesView .efir-section-heading{margin:18px 0 10px}
 body.ksan-unified #communitiesView .efir-section-heading h2{font-size:19px;line-height:24px;margin:0}
 body.ksan-unified #communitiesView .efir-section-heading a,body.ksan-unified #communitiesView .efir-section-heading button{font-size:13px}
 body.ksan-unified #communitiesView .efir-categories{gap:6px;margin-bottom:12px}
 body.ksan-unified #communitiesView .efir-categories button{min-height:36px;padding:6px 10px;gap:6px;font-size:13px;line-height:20px;border-radius:11px}
 body.ksan-unified #communitiesView .efir-category-icon{font-size:17px}
 body.ksan-unified #communitiesView #efirPosts{gap:12px;min-width:0}
 body.ksan-unified #communitiesView #efirPosts .wall2010-post{width:100%!important;max-width:100%!important;min-width:0!important;border-radius:16px!important}
 body.ksan-unified #communitiesView #efirPosts .wall2010-postrow{padding:12px!important;min-width:0!important}
 body.ksan-unified #communitiesView #efirPosts .wall2010-postrow>div{min-width:0!important}
 body.ksan-unified #communitiesView #efirPosts .wall2010-posthead{gap:8px!important;margin-bottom:8px!important}
 body.ksan-unified #communitiesView #efirPosts .wall2010-postavatar{width:32px!important;height:32px!important;min-width:32px!important}
 body.ksan-unified #communitiesView #efirPosts .wall2010-author{font-size:14px!important;line-height:18px!important;overflow-wrap:anywhere}
 body.ksan-unified #communitiesView #efirPosts .wall2010-time{font-size:11px!important;line-height:15px!important}
 body.ksan-unified #communitiesView #efirPosts .wall2010-text{font-size:14px!important;line-height:1.45!important;margin:8px 0 10px!important;overflow-wrap:anywhere}
 body.ksan-unified #communitiesView #efirPosts .efir-cover{border-radius:15px 15px 0 0}
 body.ksan-unified #communitiesView #efirPosts .efir-cover img,body.ksan-unified #communitiesView #efirPosts .efir-cover video{height:clamp(160px,52vw,220px)!important;max-height:220px!important}
 body.ksan-unified.has-site-header[data-view] :is(#wall2010Posts,#efirPosts,#efirTopicBody) .wall2010-post .wall2010-reaction-chip{min-height:28px!important;height:28px!important;padding:3px 8px 3px 3px!important;font-size:12px!important;line-height:18px!important;gap:4px!important}
 body.ksan-unified.has-site-header[data-view] :is(#wall2010Posts,#efirPosts,#efirTopicBody) .wall2010-post .wall2010-reaction-chip img{width:22px!important;height:22px!important}
 body.ksan-unified.has-site-header[data-view] :is(#wall2010Posts,#efirPosts,#efirTopicBody) .wall2010-post .wall2010-postactions{gap:6px 10px!important;flex-wrap:wrap!important}
 body.ksan-unified.has-site-header[data-view] :is(#wall2010Posts,#efirPosts,#efirTopicBody) .wall2010-post .wall2010-postactions button{font-size:12px!important}
 body.ksan-unified.has-site-header[data-view] :is(#wall2010Posts,#efirPosts,#efirTopicBody) .wall2010-post .vk2010-comment{padding:10px 0!important;gap:8px!important}
 body.ksan-unified.has-site-header[data-view] :is(#wall2010Posts,#efirPosts,#efirTopicBody) .wall2010-post .vk2010-comment>img{width:30px!important;height:30px!important;flex-basis:30px!important}
 body.ksan-unified.has-site-header[data-view] :is(#wall2010Posts,#efirPosts,#efirTopicBody) .wall2010-post .vk2010-comment p{font-size:14px!important;margin:4px 0!important}
 body.ksan-unified.has-site-header[data-view] :is(#wall2010Posts,#efirPosts,#efirTopicBody) .wall2010-post .vk2010-comment small{font-size:11px!important}
 body.ksan-unified.has-site-header[data-view] :is(#wall2010Posts,#efirPosts,#efirTopicBody) .wall2010-post .wall2010-comment-form>input{font-size:16px!important}
 body.ksan-unified.has-site-header[data-view="wall"] #wall2010Posts .wall2010-text{font-size:14px!important}
 body.ksan-unified.has-site-header[data-view="wall"] #wall2010Posts .wall2010-user-attachment :is(img,video){max-height:240px!important}
 body.ksan-unified.has-site-header[data-view="wall"] #wall2010Posts .wall2010-media img{height:120px!important}
 body.ksan-unified #appsPreview{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;overflow:visible}
 body.ksan-unified #appsPreview .ksan-app-item{min-width:0;font-size:11px;gap:6px}
 body.ksan-unified #appsPreview .ksan-app-tile{width:100%;height:auto;aspect-ratio:1;border-radius:18px}
 body.ksan-unified .ksan-apps-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:16px 10px}
 body.ksan-unified .ksan-apps-header h1{font-size:19px}
 
 
 
}
.mobile-chat-ai,.mobile-chat-more,.mobile-chat-empty,.mobile-chat-menu{display:none}
@media(max-width:760px){
 body.ksan-chat-sidebar::after{display:none}
 body.ksan-chat-sidebar.has-site-header[data-view]>.ksan-shell{inset:0!important}
 body.ksan-chat-sidebar #chatsLayout .dialogs-panel{inset:0!important;width:100%!important;height:100dvh!important;padding-top:env(safe-area-inset-top)!important;background:#161618!important}
 body.ksan-chat-sidebar #chatsLayout .dialogs-head{position:relative;flex:0 0 54px;box-sizing:border-box;height:54px;padding:0 16px!important;align-items:center!important;background:transparent!important}
 body.ksan-chat-sidebar #chatsLayout .dialogs-head>div{position:absolute;left:80px;right:80px;text-align:center;pointer-events:none}
 body.ksan-chat-sidebar #chatsLayout .dialogs-head h1{font-size:18px!important;line-height:24px;margin:0!important;color:#eee}
 body.ksan-chat-sidebar #chatsLayout .dialogs-head>div>span{display:none!important}
 body.ksan-chat-sidebar #chatsLayout .new-chat-btn{position:absolute;right:10px;top:5px;width:44px;height:44px;border:0!important;background:none!important;color:#eee!important;font-size:28px;border-radius:0!important}
 body.ksan-chat-sidebar #chatsLayout .mobile-chat-ai{display:grid;place-items:center;position:absolute;right:54px;top:5px;width:44px;height:44px;color:#ab82f5}
 .mobile-chat-ai svg,.mobile-chat-empty-icon svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round}
 body.ksan-chat-sidebar #chatsLayout .dialogs-search-wrap{height:40px!important;min-height:40px!important;margin:4px 16px 10px!important;border:0!important;border-radius:13px!important;background:#252527!important;padding:0 12px!important}
 body.ksan-chat-sidebar #chatsLayout .dialogs-search-wrap input{font-size:16px!important;color:#eee!important;min-width:0}
 body.ksan-chat-sidebar #chatsLayout .dialog-tabs,body.ksan-chat-sidebar #chatsLayout .tg-presence{display:none!important}
 body.ksan-chat-sidebar #chatsLayout .dialog-list{padding:0 16px!important;min-height:0!important;flex:1}
 body.ksan-chat-sidebar #chatsLayout .tg-row{margin:0!important;border-bottom:1px solid #ffffff08;border-radius:0!important;background:transparent!important}
 body.ksan-chat-sidebar #chatsLayout .dialog-row{width:100%!important;height:72px!important;min-height:72px!important;padding:10px 0!important;gap:12px!important;border-radius:0!important;background:transparent!important;box-sizing:border-box!important}
 body.ksan-chat-sidebar #chatsLayout .dialog-avatar{width:44px!important;height:44px!important;min-width:44px!important;flex:0 0 44px!important;border-radius:50%!important}
 body.ksan-chat-sidebar #chatsLayout .dialog-avatar img{width:100%;height:100%;border-radius:50%!important;object-fit:cover}
 body.ksan-chat-sidebar #chatsLayout .dialog-avatar i{width:9px;height:9px;border:2px solid #161618;background:#b579ee;right:0;bottom:0}
 body.ksan-chat-sidebar #chatsLayout .dialog-body{min-width:0;flex:1;padding:0!important}
 body.ksan-chat-sidebar #chatsLayout .dialog-line{display:flex;gap:8px;min-width:0;align-items:baseline}
 body.ksan-chat-sidebar #chatsLayout .dialog-line strong{font-size:15px!important;line-height:21px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#eee}
 body.ksan-chat-sidebar #chatsLayout .dialog-line time{font-size:11px!important;color:#87858e;flex:none}
 body.ksan-chat-sidebar #chatsLayout .dialog-preview{margin-top:3px;font-size:13px!important;line-height:19px;color:#99959f;padding-right:58px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 body.ksan-chat-sidebar #chatsLayout .dialog-badge{right:28px;bottom:13px;min-width:18px;height:18px;font-size:11px;line-height:18px;padding:0 5px;background:#9e70df;color:white;border-radius:10px}
 body.ksan-chat-sidebar #chatsLayout .tg-pin,body.ksan-chat-sidebar #chatsLayout .tg-delete{display:none!important}
 body.ksan-chat-sidebar #chatsLayout .mobile-chat-more{display:grid;place-items:center;position:absolute;right:-8px;bottom:2px;width:32px;height:32px;border:0;background:transparent;color:#aaa;font-size:20px}
 body.ksan-chat-sidebar #chatsLayout .is-pinned .dialog-preview::before{content:'⌖';margin-right:5px;color:#b699df}
 
 
 
 
 
 body.ksan-chat-sidebar .mobile-chat-menu:not([hidden]){display:grid;position:fixed;right:16px;z-index:2300;min-width:205px;border:1px solid #ffffff12;border-radius:16px;background:#29282d;box-shadow:0 12px 40px #0006;padding:6px}
 .mobile-chat-menu button{height:44px;padding:0 12px;text-align:left;border:0;background:none;color:#eee;font:14px system-ui;border-radius:10px}
 .mobile-chat-menu button:hover{background:#ffffff0a}
 body.ksan-chat-sidebar .mobile-chat-empty:not([hidden]):not(.is-search){display:flex;flex:1;min-height:0;flex-direction:column;align-items:center;padding:20px 16px;gap:10px;color:#ddd;text-align:center;font:15px/1.5 system-ui}
 .mobile-chat-empty-icon{margin-top:auto;color:#bda0ef;background:linear-gradient(135deg,#7166bf33,#c56dd333);border-radius:32px;padding:24px}
 .mobile-chat-empty-icon svg{width:58px;height:58px}
 .mobile-chat-empty p{margin:12px 0 auto}
 .mobile-chat-empty>button,.mobile-chat-empty>a{width:100%;box-sizing:border-box;border:0;border-radius:14px;padding:13px;text-decoration:none;font:500 14px system-ui;background:linear-gradient(100deg,#7560d4,#ad65c5);color:#fff}
 .mobile-chat-empty>a{background:#27232f;color:#c5abe9}
 body.ksan-chat-sidebar .dialogs-panel:has(.mobile-chat-empty:not([hidden]):not(.is-search)) .dialog-list,body.ksan-chat-sidebar .dialogs-panel:has(.mobile-chat-empty:not([hidden]):not(.is-search)) .tg-no-results{display:none!important}
 body.ksan-chat-sidebar #chatsLayout.is-thread-open .dialog-thread{height:100dvh!important;padding-top:env(safe-area-inset-top);box-sizing:border-box;background:#161618!important}
}
@media(max-width:760px){
 .mobile-chat-empty>a{border:1px solid transparent;background:linear-gradient(#161618,#161618) padding-box,linear-gradient(100deg,#7560d4,#bc65ce) border-box;color:#c5abe9}
 .mobile-chat-empty-icon{background:radial-gradient(ellipse at 35% 20%,#d0e4ff88,transparent 55%),linear-gradient(145deg,#8a8af477,#bc7de766);box-shadow:inset 0 1px 4px #d6d8ff99,inset 0 -3px 7px #c389ec66;color:#ddd1ff;border:1px solid #c6b5f755;border-radius:45% 45% 45% 12%;transform:rotate(-8deg)}
}

/* One persistent navigation bar for every authenticated mobile view. */
#ksanMobileTabs{display:none}
@media(max-width:760px){
 body.ksan-unified{--ksan-tab-height:calc(60px + env(safe-area-inset-bottom))}
 body.ksan-unified #ksanMobileTabs{position:fixed;inset:auto 0 0;z-index:1850;height:var(--ksan-tab-height);box-sizing:border-box;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));padding:6px 6px calc(6px + env(safe-area-inset-bottom));background:#1d1d20;border-top:1px solid #ffffff0a}
 body.ksan-unified #ksanMobileTabs>a,body.ksan-unified #ksanMobileTabs>button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:46px;padding:0 2px;border:0;border-radius:12px;background:none;text-decoration:none;color:#96909f;font:500 10px/14px system-ui;cursor:pointer}
 body.ksan-unified #ksanMobileTabs svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
 body.ksan-unified #ksanMobileTabs [aria-current],body.ksan-unified #ksanMobileTabs .is-active{color:#b797f0}
 body.ksan-unified #ksanMobileTabs [aria-current] svg{fill:#b797f020}
 body.ksan-unified.has-site-header[data-view]>.ksan-shell,body.ksan-unified.has-site-header>.ksan-shell{bottom:var(--ksan-tab-height)!important}
 body.ksan-unified.has-site-header[data-view="communities"] #communitiesView.efir-view{padding-bottom:20px!important}
 body.ksan-chat-sidebar #chatsLayout .dialogs-panel{bottom:var(--ksan-tab-height)!important;height:calc(100dvh - var(--ksan-tab-height))!important}
 body.ksan-chat-sidebar #chatsLayout.is-thread-open .dialog-thread{height:100%!important;min-height:0!important}
 body.ksan-chat-sidebar.ksan-menu-open #appSidebar.ksan-unified-panel{display:flex!important;z-index:2000!important}
 body.ksan-chat-sidebar.ksan-menu-open #ksanMenuShade{display:block!important;position:fixed;inset:0;z-index:1900;background:#0008}
 body.ksan-chat-sidebar.ksan-menu-open #ksanMobileMenu{display:grid!important}
}

.mobile-thread-more,.mobile-thread-menu{display:none}
@media(max-width:760px){
 body.ksan-chat-sidebar #chatsView.chats-workspace{height:100%!important;padding:0!important;min-height:0!important;max-height:100%!important}
 body.ksan-chat-sidebar #chatsLayout #dialogThread{min-height:0!important;max-height:100%!important;overflow:hidden!important;border-radius:0!important;background:#141416!important}
 body.ksan-chat-sidebar #dialogThread .thread-head{display:flex!important;align-items:center!important;gap:8px!important;flex-shrink:0;min-height:58px!important;padding:6px 10px!important;border:0!important;background:#1d1d20!important}
 body.ksan-chat-sidebar #dialogThread .thread-back-btn{width:32px;height:40px;padding:6px;border:0;background:none;color:#ddd;flex-shrink:0}
 body.ksan-chat-sidebar #dialogThread .thread-head-avatar .dialog-avatar{width:36px!important;height:36px!important;border-radius:50%!important}
 body.ksan-chat-sidebar #dialogThread .thread-head-avatar img{border-radius:50%!important}
 body.ksan-chat-sidebar #dialogThread .thread-head-meta{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
 body.ksan-chat-sidebar #dialogThread .thread-head-meta strong{font-size:14px;line-height:19px;color:#eee}
 body.ksan-chat-sidebar #dialogThread .thread-head-meta span{font-size:11px;line-height:15px;color:#9a94a4}
 body.ksan-chat-sidebar #dialogThread .thread-head-actions{display:flex;position:relative;gap:0;flex:none}
 body.ksan-chat-sidebar #dialogThread .thread-head-btn{width:34px;height:40px;padding:7px;background:none;border:0;color:#a9a0b5}
 body.ksan-chat-sidebar #dialogThread .tg-delete-header{display:none!important}
 body.ksan-chat-sidebar #dialogThread .mobile-thread-more{display:block;width:32px;height:40px;border:0;background:none;color:#ddd;font:26px system-ui}
 body.ksan-chat-sidebar #dialogThread .mobile-thread-menu:not([hidden]){display:block;position:absolute;right:0;top:44px;width:230px;z-index:50;padding:6px;background:#29272e;border:1px solid #ffffff0f;border-radius:14px;box-shadow:0 12px 30px #0005}
 .mobile-thread-menu button{border:0;background:none;color:#eee;padding:12px;text-align:left;font:14px system-ui;width:100%}
 body.ksan-chat-sidebar #dialogThread .thread-messages{display:flex!important;flex-direction:column;gap:10px;padding:12px 14px 16px!important;background:#141416!important;flex:1;min-height:0;overflow:auto!important}
 body.ksan-chat-sidebar #dialogThread .thread-day{align-self:center;margin:8px 0;padding:4px 10px;font:11px/16px system-ui;background:transparent;color:#817b89}
 body.ksan-chat-sidebar #dialogThread .msg{width:fit-content;max-width:84%;box-sizing:border-box;min-width:60px;padding:10px 12px 7px!important;border:0!important;border-radius:18px!important;gap:4px;box-shadow:none!important}
 body.ksan-chat-sidebar #dialogThread .msg--in{align-self:flex-start;background:#28232e!important;border-bottom-left-radius:6px!important}
 body.ksan-chat-sidebar #dialogThread .msg--out{align-self:flex-end;background:#343045!important;border-bottom-right-radius:6px!important}
 body.ksan-chat-sidebar #dialogThread .msg__text{font:14px/1.45 system-ui;color:#eee;overflow-wrap:anywhere}
 body.ksan-chat-sidebar #dialogThread .msg__time{font:10px/15px system-ui;color:#aaa1b7;justify-content:flex-end;gap:4px}
 body.ksan-chat-sidebar #dialogThread .msg:has(.msg__media){padding:4px!important}
 body.ksan-chat-sidebar #dialogThread .msg__media img{width:100%;max-width:250px;max-height:280px;height:auto;aspect-ratio:auto;object-fit:contain;border:0;border-radius:14px}
 body.ksan-chat-sidebar #dialogThread .msg__media .msg__text{padding:4px 8px}
 body.ksan-chat-sidebar #dialogThread .msg:has(.msg__media)>.msg__time{padding:0 8px 3px}
 body.ksan-chat-sidebar #dialogThread .thread-composer{display:flex!important;align-items:flex-end!important;gap:8px;flex-shrink:0;margin:0!important;padding:8px 12px 10px!important;background:#141416!important;border:0!important;border-radius:0!important;box-sizing:border-box}
 body.ksan-chat-sidebar #dialogThread .thread-compose-field{flex:1;min-width:0;width:auto!important;min-height:42px;max-height:112px;padding:10px 12px!important;border:0!important;border-radius:21px!important;background:#262529!important;color:#eee;font:16px/22px system-ui;resize:none}
 body.ksan-chat-sidebar #dialogThread .thread-compose-plus{width:36px;height:42px;flex:0 0 36px;border:0;background:none;color:#b59cde;font:26px system-ui;padding:0}
 body.ksan-chat-sidebar #dialogThread .thread-compose-send{width:40px;height:40px;flex:0 0 40px;display:grid;place-items:center;border:0;border-radius:50%;background:#a88cdb;color:#19141e;padding:9px}
}

@media(max-width:760px){
 body.ksan-unified.has-site-header>#appSidebar.ksan-unified-panel{position:fixed!important;z-index:2000!important;top:0!important;bottom:0!important;height:100dvh!important;max-height:100dvh!important;overflow-y:auto!important;overscroll-behavior:contain;box-sizing:border-box;padding-bottom:max(12px,env(safe-area-inset-bottom))!important}
 body.ksan-unified>#appSidebar .ksan-menu-links{flex:0 0 auto!important;overflow:visible!important}
 body.ksan-unified>#appSidebar .ksan-menu-bottom{margin-top:auto;flex-shrink:0;padding-bottom:8px!important}
 body.ksan-unified>#appSidebar .ksan-premium-copy{font-size:13px;line-height:18px;min-height:36px}
 body.ksan-unified>#appSidebar .ksan-panel-header{flex-shrink:0}
}

/* Bounded mobile workspace: content scrolls inside the space between both bars. */
@media(max-width:760px){
 body.ksan-unified.has-site-header>.ksan-shell{grid-template-rows:minmax(0,1fr)!important;height:calc(100dvh - 56px - env(safe-area-inset-top) - var(--ksan-tab-height))!important;overflow:hidden!important}
 body.ksan-unified.has-site-header>.ksan-shell>.ksan-main{height:100%!important;max-height:100%!important;min-height:0!important;overflow-x:hidden!important;overflow-y:auto!important;touch-action:pan-y;-webkit-overflow-scrolling:touch}
 body.ksan-unified.ksan-chat-sidebar.has-site-header>.ksan-shell{height:calc(100dvh - var(--ksan-tab-height))!important}
 body.ksan-unified.has-site-header #wall2010View[data-mobile-wall="true"],
 body.ksan-unified.has-site-header #wall2010View[data-mobile-wall="true"] .wall2010-shell,
 body.ksan-unified.has-site-header #wall2010View[data-mobile-wall="true"] .wall2010-grid{height:100%!important;min-height:0!important;max-height:100%!important;overflow:hidden!important}
 body.ksan-unified.has-site-header #wall2010View[data-mobile-wall="true"] .ksan-wall-scroll{touch-action:pan-y;overscroll-behavior-y:contain}
}

@media(max-width:760px){body.ksan-unified #appSidebar .ksan-nav-link.is-ai img{width:46px;height:46px}}

@media(max-width:760px){
 body.ksan-unified::after{content:attr(data-mobile-title);text-align:right;font-size:13px;font-weight:500;color:#b8b3c0;padding:calc(19px + env(safe-area-inset-top)) 16px 0 175px;background-image:url('../images/nav/ksan-ai-menu-logo.webp');background-repeat:no-repeat;background-size:104px 35px;background-position:56px calc(10px + env(safe-area-inset-top));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 body.ksan-unified[data-view="ai"]{--ksan-tab-height:0px}
 body.ksan-unified[data-view="ai"] #ksanMobileTabs{display:none!important}
 body.ksan-unified.has-site-header[data-view="ai"]>.ksan-shell{bottom:0!important}
}
