
/* Cax mobile layout: touch-first navigation without changing desktop layout */
@media(max-width:700px){
 html,body,#app{width:100%;max-width:100%;overflow-x:hidden}
 .layout{height:100dvh;min-height:0;overflow:hidden}
 .rail{width:54px!important;min-width:54px;overflow-y:auto;overflow-x:hidden;padding:8px 5px}
 .rail button{width:42px!important;height:42px!important;min-height:42px}
 .sidebar{position:fixed!important;top:0;bottom:0;left:54px;z-index:80;width:min(280px,calc(100vw - 54px))!important;max-width:none;transform:translateX(calc(-100% - 54px));transition:transform .2s ease;box-shadow:0 10px 40px #0009}
 body.cax-mobile-sidebar-open .sidebar{transform:translateX(0)}
 .main{width:calc(100vw - 54px);min-width:0!important}
 .main>.header{padding-left:56px!important;min-height:52px;overflow:hidden}
 .main>.header #mainTitle{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .workspace,.chat,.messages,.dm-workspace{min-width:0;width:100%}
 .messages{padding:12px 8px}
 .message{max-width:100%;min-width:0}
 .message .body{overflow-wrap:anywhere}
 .composer{padding:8px;gap:6px}
 .composer textarea,.composer input{min-width:0}
 .memberlist{display:none!important}
 .profile{width:min(360px,calc(100vw - 72px))!important;right:8px!important;left:auto!important;top:60px!important;max-height:calc(100dvh - 75px);overflow-y:auto}
 .modal-back{padding:8px!important}
 .modal{width:100%!important;max-height:calc(100dvh - 16px)!important;padding:14px}
 .ss-modal{width:100%!important;height:calc(100dvh - 16px)!important;max-height:none!important;display:flex;flex-direction:column}
 .ss-nav{width:100%!important;flex:none!important;display:flex;gap:4px;overflow-x:auto;overflow-y:hidden;padding:8px!important;max-height:105px}
 .ss-group{display:flex;flex:none;align-items:center;gap:3px;border:0}
 .ss-group .label{display:none}
 .ss-body{min-width:0;padding:14px!important}
 .ss-section{max-width:100%}
 .ss-line{min-width:0}
 .settings{padding:12px!important;max-width:100%;overflow-x:hidden}
 .grid{grid-template-columns:1fr!important}
 .tabs{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px}
 .tabs button{flex:none}
 input,select,textarea{font-size:16px!important;max-width:100%}
 button{min-height:34px}
 .crop-dialog,.cax-crop-box{width:100%!important;max-height:calc(100dvh - 12px)!important;padding:12px!important}
 .crop-stage{max-height:45dvh}
 .crop-actions button,.cax-crop-actions button{min-height:44px}
 .cax-mobile-menu{display:flex!important}
 .cax-mobile-backdrop{display:none;position:fixed;inset:0;background:#0009;z-index:79}
 body.cax-mobile-sidebar-open .cax-mobile-backdrop{display:block}
}
@media(max-width:390px){
 .rail{width:46px!important;min-width:46px}
 .rail button{width:36px!important;height:36px!important;min-height:36px}
 .sidebar{left:46px;width:calc(100vw - 46px)!important}
 .main{width:calc(100vw - 46px)}
 .profile{width:calc(100vw - 58px)!important}
}
.cax-mobile-menu{display:none;position:fixed;left:66px;top:8px;z-index:75;width:38px;height:38px;align-items:center;justify-content:center;border-radius:9px;background:#242528;border:1px solid #45464a;color:#fff;font-size:19px}
@media(max-width:390px){.cax-mobile-menu{left:55px}}
