#m-back{display:none}
@media (max-width:768px){
html,body{height:100%;overflow:hidden;overscroll-behavior:none}
.container-fluid,.container-fluid>.row{height:100vh;height:100dvh;margin:0;padding:0;flex-wrap:nowrap}
#sidebar{height:100vh!important;height:100dvh!important;width:100%!important;max-width:100%!important;border:0!important;overflow-y:auto;-webkit-overflow-scrolling:touch;padding-top:env(safe-area-inset-top)!important}
.chat-pane{display:none!important}
body.m-chat #sidebar{display:none!important}
body.m-chat .chat-pane{display:flex!important;flex-direction:column;width:100%!important;max-width:100%!important;height:100vh;height:100dvh;padding:0!important}
#m-back{display:inline-block;font-size:1.1rem;line-height:1;min-width:44px;min-height:40px}
#conversation-header{flex-direction:row!important;align-items:center!important;gap:6px!important;margin:0!important;padding:calc(6px + env(safe-area-inset-top)) 8px 6px;background:#fff;border-bottom:1px solid #ddd}
#conversation-title{flex:1;min-width:0;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:1rem!important}
#exit-btn{display:none!important}
#chat-box{flex:1 1 auto;height:auto;min-height:0;padding:0 8px calc(8px + env(safe-area-inset-bottom))}
#messages-container{flex:1 1 auto;height:auto!important;min-height:0;border-radius:0;padding:10px 6px;margin-bottom:6px!important}
.message{max-width:88%}
#send-form{flex-direction:row!important;gap:6px!important;align-items:flex-end}
#send-form .btn{width:auto!important;min-width:44px;min-height:44px}
#message-input{font-size:16px;min-height:44px}
#conv-search{font-size:16px}
#conv-search-wrap{position:sticky;top:0;z-index:2;background:#fff}
.conversation-item{padding:12px 14px!important;min-height:56px;font-size:1rem!important}
#push-row .btn{min-height:38px}
}
/* font-size control */
:root{--m-fs:17px}
@media (max-width:768px){
.message{font-size:var(--m-fs)!important;line-height:1.55!important}
.conversation-item{font-size:calc(var(--m-fs) - 1px)!important}
.m-fs{display:inline-flex;gap:4px;align-items:center;flex:0 0 auto}
.m-fs button{border:1px solid #bbb;background:#fff;border-radius:8px;min-width:38px;min-height:38px;font-weight:700;line-height:1;padding:0 8px}
.m-fs button.s{font-size:13px}.m-fs button.b{font-size:20px}
#conv-search-wrap{display:flex;gap:6px;align-items:center}
#conv-search-wrap input{flex:1 1 auto;min-width:0}
}
/* v4: bigger top buttons + clearer font buttons */
@media (max-width:768px){
#sidebar{padding-top:calc(env(safe-area-inset-top) + 6px)!important}
#sidebar>a.btn{display:inline-flex;align-items:center;justify-content:center;min-height:46px;min-width:104px;margin:10px 0 4px 10px;padding:0 18px;font-size:1.05rem;border-radius:12px;font-weight:600}
.m-fs button{min-width:44px;min-height:44px;border-radius:10px}
.m-fs button.s,.m-fs button.b{font-size:16px;font-weight:700}
#conversation-header .m-fs{margin-inline-start:auto}
}
