/* v1.8 · Giao diện điện thoại (html.m18 khi màn hình ≤ 760px) */
.m18-nav,.m18-sheet,.m18-back,.m18-infobar{display:none}
@media (max-width:760px){
  html.m18,html.m18 body{height:100%;overflow:hidden;overscroll-behavior:none}
  html.m18{--m18-nav:calc(58px + env(safe-area-inset-bottom))}
  html.m18 #appView{display:block!important;position:fixed;inset:0;overflow:hidden}
  html.m18 #v150NavRail,html.m18 #mobileBottomNav,html.m18 #mobileScrim,html.m18 #detailToggleBtn,html.m18 #viewOptionsBtn,html.m18 #mobileMenuBtn,html.m18 #realtimeClock,html.m18 #v150ChannelHealth{display:none!important}

  /* three full-screen layers */
  html.m18 #appView>.sidebar,html.m18 #appView>.chat-pane,html.m18 #appView>#detailPane{position:fixed!important;top:0!important;left:0!important;right:0!important;bottom:var(--m18-nav)!important;width:100%!important;max-width:none!important;min-width:0!important;height:auto!important;margin:0!important;border-radius:0!important;box-shadow:none!important;transition:transform .22s ease,visibility .22s;background:#fff}
  html.m18 #appView>.sidebar{z-index:20;transform:none!important;display:flex!important;flex-direction:column;overflow:hidden}
  html.m18 #appView>.chat-pane{z-index:21;display:flex!important;flex-direction:column;transform:translateX(100%)!important;visibility:hidden}
  html.m18 #appView>#detailPane{z-index:22;display:block!important;overflow-y:auto;transform:translateX(100%)!important;visibility:hidden}
  html.m18 #appView[data-m18=chat]>.chat-pane,html.m18 #appView[data-m18=info]>.chat-pane{transform:none!important;visibility:visible}
  html.m18 #appView[data-m18=info]>#detailPane{transform:none!important;visibility:visible}
  html.m18 #appView[data-m18=chat]>.sidebar,html.m18 #appView[data-m18=info]>.sidebar{visibility:hidden}

  /* list screen */
  html.m18 .sidebar>*{max-width:100%;min-width:0;flex-shrink:0}
  html.m18 .sidebar .conversation-list{flex:1 1 auto!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch;flex-shrink:1}
  html.m18 .sidebar .sidebar-foot{display:none!important}
  html.m18 .sidebar .search-wrap input{font-size:16px!important} /* no zoom on iOS */
  html.m18 #conversationList .conv{padding:12px 14px!important}

  /* chat screen */
  html.m18 .chat-head{display:flex!important;align-items:center;gap:6px!important;padding:8px 10px!important;min-height:56px;flex-wrap:nowrap!important;border-bottom:1px solid #e5e9f0;background:#fff;position:sticky;top:0;z-index:2}
  html.m18 .chat-head>div:first-of-type{flex:1;min-width:0}
  html.m18 #chatTitle{font-size:16px!important;line-height:1.25;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html.m18 #chatSub{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html.m18 .chat-head .icon-btn,html.m18 .m18-back{width:40px;height:40px;min-width:40px;border-radius:12px;display:grid!important;place-items:center;font-size:18px}
  html.m18 .m18-back{border:0;background:#f1f5f9;font-size:26px;line-height:1;color:#0f172a;cursor:pointer;flex:none;padding:0 0 3px}
  html.m18 .chat-head .v150-user-chip{display:none!important}
  html.m18 .chat-pane .messages{flex:1 1 auto;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:10px!important}
  html.m18 .chat-pane .composer{position:sticky;bottom:0;background:#fff;border-top:1px solid #e5e9f0;padding:8px!important;margin:0!important}
  html.m18 .chat-pane .composer textarea,html.m18 .chat-pane .composer input{font-size:16px!important}
  html.m18 .chat-pane .empty-state{padding:20px}

  /* info screen */
  html.m18 .m18-infobar{display:flex;align-items:center;gap:10px;position:sticky;top:0;z-index:3;background:#fff;padding:8px 10px;border-bottom:1px solid #e5e9f0;min-height:56px}
  html.m18 .m18-infobar b{font-size:16px}
  html.m18 #detailPane{padding:0!important}
  html.m18 #detailPane>*:not(.m18-infobar){margin-left:12px;margin-right:12px}

  /* bottom navigation */
  html.m18 .m18-nav{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;left:0;right:0;bottom:0;height:var(--m18-nav);padding-bottom:env(safe-area-inset-bottom);background:#fff;border-top:1px solid #e5e9f0;z-index:60;box-shadow:0 -4px 16px rgba(15,23,42,.06)}
  html.m18 .m18-nav button{position:relative;border:0;background:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:11px;color:#64748b;cursor:pointer;padding:6px 0}
  html.m18 .m18-nav button .i{font-size:20px;line-height:1;filter:grayscale(.4)}
  html.m18 .m18-nav button.active{color:#1d4ed8;font-weight:700}html.m18 .m18-nav button.active .i{filter:none}
  html.m18 .m18-nav .b{position:absolute;top:4px;left:calc(50% + 6px);min-width:17px;height:17px;border-radius:9px;background:#ef4444;color:#fff;font-size:10px;font-style:normal;font-weight:700;display:grid;place-items:center;padding:0 4px}
  html.m18 .m18-nav .b.hidden{display:none}

  /* "Thêm" sheet */
  html.m18 .m18-sheet{display:block;position:fixed;inset:0;z-index:70;background:rgba(15,23,42,.35)}
  html.m18 .m18-sheet.hidden{display:none}
  html.m18 .m18-sheet-card{position:absolute;left:0;right:0;bottom:0;background:#fff;border-radius:20px 20px 0 0;padding:8px 16px calc(16px + env(safe-area-inset-bottom));animation:m18up .2s ease}
  @keyframes m18up{from{transform:translateY(40px);opacity:0}to{transform:none;opacity:1}}
  html.m18 .m18-grab{width:40px;height:4px;border-radius:4px;background:#cbd5e1;margin:4px auto 12px}
  html.m18 .m18-me{display:flex;flex-direction:column;margin-bottom:12px}html.m18 .m18-me span{font-size:12px;color:#64748b}
  html.m18 .m18-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
  html.m18 .m18-grid button{border:1px solid #e5e9f0;background:#f8fafc;border-radius:14px;padding:14px 6px;display:flex;flex-direction:column;align-items:center;gap:6px;font-size:13px;color:#1e293b;cursor:pointer}
  html.m18 .m18-grid button span{font-size:22px}
  html.m18 .m18-grid button.hidden{display:none}
  html.m18 .m18-logout{width:100%;margin-top:12px;border:0;background:#fef2f2;color:#b91c1c;border-radius:12px;padding:12px;font-weight:600;cursor:pointer}

  /* every dialog becomes a full screen page above the bottom bar */
  html.m18 .modal{padding:0!important;align-items:stretch!important;justify-content:stretch!important;z-index:80!important}
  html.m18 .modal>.modal-card{width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;border-radius:0!important;margin:0!important;overflow:auto}
  html.m18 .modal .form-grid-2,html.m18 .modal .ai18-grid,html.m18 .modal .rl18-grid,html.m18 .modal .thr18-grid{grid-template-columns:1fr!important}
  html.m18 input,html.m18 select,html.m18 textarea{font-size:16px}

  /* Kanban on a phone: one column per screen, swipe sideways */
  html.m18 .kb18-board{scroll-snap-type:x mandatory;padding:10px!important;gap:10px!important}
  html.m18 .kb18-col{flex:0 0 86vw!important;scroll-snap-align:center}
  html.m18 .kb18-bar{padding:8px 10px!important;gap:8px!important}
  html.m18 .kb18-sum{order:10;width:100%;margin-left:0!important;overflow-x:auto}
  html.m18 .kb18-stat,html.m18 .kb18-sub{display:none}
  html.m18 .kb18-top{padding:10px!important}

  /* phone call card sits above the bottom bar */
  html.m18 .ph18-card{left:10px;right:10px;width:auto;bottom:calc(var(--m18-nav) + 10px)}
  html.m18 .toast{bottom:calc(var(--m18-nav) + 12px)!important}
}
@media (max-width:760px){
  html.m18 .chat-pane .messages{flex:1 1 0!important;min-height:0!important;height:auto!important;max-height:none!important}
  html.m18 #replyTicketContext{padding:6px 10px!important;font-size:13px}
  html.m18 #replyTicketContext select{max-width:100%}
  html.m18 #conversationHandling170{padding:8px 10px!important;font-size:13px}
}
@media (max-width:760px){
  /* Nhóm Zalo & Nội bộ: list → chat inside the dialog */
  html.m18 .v110-chat-card{display:flex!important;flex-direction:column;padding:0!important}
  html.m18 .v110-chat-card>.modal-head{flex-wrap:wrap!important;gap:6px!important;padding:8px 10px!important;border-bottom:1px solid #e5e9f0;margin:0!important}
  html.m18 .v110-chat-card>.modal-head>div:first-child{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:8px}
  html.m18 .v110-chat-card>.modal-head .zgs-head-title{flex:1 1 auto;min-width:0;width:auto!important}
  html.m18 .v110-chat-card>.modal-head .zgs-head-actions,html.m18 .v110-chat-card>.modal-head>div:last-child{flex:1 1 100%;display:flex!important;flex-wrap:nowrap!important;overflow-x:auto;gap:6px;padding-bottom:2px;-webkit-overflow-scrolling:touch}
  html.m18 .v110-chat-card>.modal-head .zgs-head-actions>*,html.m18 .v110-chat-card>.modal-head>div:last-child>*{flex:none}
  html.m18 .v110-chat-card .v110-chat-layout{display:block!important;flex:1 1 auto;min-height:0;position:relative;padding:0!important;margin:0!important;height:auto!important}
  html.m18 .v110-chat-card .v110-chat-layout>.v110-sidebar{display:flex!important;flex-direction:column;position:absolute;inset:0;width:100%!important;max-width:none!important;overflow-y:auto;background:#fff;z-index:2;border:0!important}
  html.m18 .v110-chat-card .v110-chat-layout>.internal-conversation{position:absolute;inset:0;width:100%!important;display:flex!important;flex-direction:column;min-height:0}
  html.m18 .v110-chat-card[data-m18pane=chat] .v110-chat-layout>.v110-sidebar{display:none!important}
  html.m18 .v110-chat-card:not([data-m18pane=chat]) .v110-chat-layout>.internal-conversation{display:none!important}
  html.m18 .v110-chat-card .member-row{padding:12px 10px!important}
  html.m18 .m18-cback{display:none}
  html.m18 .v110-chat-card[data-m18pane=chat] .m18-cback{display:grid}
}
@media (max-width:760px){
  html.m18 .v110-chat-card .v110-chat-layout>.internal-conversation{top:0!important;bottom:0!important;left:0!important;right:0!important;height:auto!important;min-height:0!important;max-height:none!important}
  html.m18 .v110-chat-card .internal-message-stage{flex:1 1 0!important;min-height:0!important;height:auto!important;overflow-y:auto}
  html.m18 .v110-chat-card .internal-composer{flex:none}
  html.m18 .v110-chat-card:not([data-m18pane=chat]) .m18-cback{display:none!important}
  html.m18 .zgs-head-actions button[title^="Phóng"],html.m18 .zgs-head-actions button[title="Thu nhỏ"]{display:none!important}
  html.m18 .v110-side-section{max-height:none!important;overflow:visible!important}
  html.m18 .v110-chat-card .internal-chat-head{padding:8px 10px!important}
}
@media (max-width:760px){
  html.m18 .v110-chat-card .v110-chat-layout>.v110-sidebar{top:0!important;bottom:0!important;left:0!important;right:0!important;height:auto!important;max-height:none!important;min-height:0!important}
}
@media (max-width:760px){
  html.m18 .v110-chat-card .v110-chat-layout>.internal-conversation,html.m18 .v110-chat-card .v110-chat-layout>.v110-sidebar{position:absolute!important}
}
/* ---- v1.8.4 · list screen polish: compact top area, card-like rows ---- */
@media (max-width:760px){
  html.m18 #appView>.sidebar{background:#f4f6fa!important;padding:0!important;gap:0!important}
  html.m18 .sidebar>.sidebar-head.v150-hide-legacy-head{display:none!important}
  html.m18 #v150InboxHeader{order:-6;display:flex!important;align-items:center;padding:calc(10px + env(safe-area-inset-top)) 14px 6px!important;margin:0!important;border:0!important;background:transparent!important;min-height:0!important}
  html.m18 #v150InboxHeader strong{font-size:20px!important;letter-spacing:-.01em}
  html.m18 #v150InboxHeader>div:first-child>span,html.m18 #v150InboxToggle{display:none!important}
  html.m18 .sidebar>.search-wrap{order:-5;padding:4px 12px 8px!important;margin:0!important;display:block!important;background:transparent!important;border:0!important}
  html.m18 .sidebar>.search-wrap input#searchBox{width:100%!important;height:42px!important;border-radius:12px!important;border:1px solid #e2e8f0!important;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") no-repeat 12px center!important;padding:0 12px 0 36px!important;margin:0!important;box-shadow:0 1px 2px rgba(15,23,42,.04)}
  html.m18 .sidebar>.dashboard-strip{order:-4;display:grid!important;grid-template-columns:repeat(4,1fr)!important;gap:6px!important;margin:0 12px 8px!important;padding:0!important;border:0!important;background:transparent!important;border-radius:0!important;box-shadow:none!important}
  html.m18 .sidebar>.dashboard-strip>div{background:#fff;border:1px solid #e5e9f0!important;border-radius:12px;padding:6px 4px!important;display:flex;flex-direction:column;align-items:center;gap:0;min-width:0}
  html.m18 .sidebar>.dashboard-strip strong{font-size:17px!important;line-height:1.2}
  html.m18 .sidebar>.dashboard-strip span{font-size:10.5px!important;color:#64748b;white-space:nowrap}
  html.m18 .sidebar>#fl18Bar{order:-3;margin:0 12px 8px!important;padding:0!important}
  html.m18 .sidebar>#v150InboxToolbar{order:-2;margin:0!important;padding:0 12px 8px!important;display:flex!important;flex-direction:column;gap:8px;background:transparent!important;border:0!important}
  html.m18 #v150InboxToolbar .v150-filter-line{display:flex!important;gap:8px;margin:0!important}
  html.m18 #v150InboxToolbar select{flex:1;height:40px!important;border-radius:12px!important;background-color:#fff!important;font-size:15px!important;padding:0 12px!important}
  html.m18 #v150InboxToolbar #v150RefreshInbox{width:40px;height:40px;min-width:40px;border-radius:12px;background:#fff}
  html.m18 #sourceFilterRow{display:flex!important;align-items:center;gap:6px;margin:0!important;padding:0!important;flex-wrap:nowrap}
  html.m18 #sourceFilterRow .source-filter{height:28px;padding:0 12px;font-size:12px}
  html.m18 #sourceFilterRow .group-toggle{margin:0 0 0 auto!important;display:flex!important;align-items:center;gap:6px;font-size:12.5px!important;color:#475569;white-space:nowrap;padding:0!important}
  html.m18 #sourceFilterRow .group-toggle input{width:16px;height:16px;margin:0}
  /* list */
  html.m18 #conversationList{background:#fff;border-top:1px solid #e5e9f0;border-radius:16px 16px 0 0;padding:0 0 12px!important;margin:0!important}
  html.m18 #conversationList .conv-group-header:not(.org-folder){position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 14px!important;margin:0!important;background:#f8fafc!important;border:0!important;border-bottom:1px solid #eef1f5!important;font-size:13px!important;min-height:38px}
  html.m18 #conversationList .conv-group-header:not(.org-folder):first-child{border-radius:16px 16px 0 0}
  html.m18 #conversationList .conv-group-header:not(.org-folder) b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
  html.m18 #conversationList .conv-group-header:not(.org-folder) span{flex:none;font-size:11.5px;background:#e2e8f0;color:#475569;border-radius:999px;padding:2px 8px}
  html.m18 #conversationList .conv{padding:11px 14px!important;margin:0!important;border:0!important;border-bottom:1px solid #f1f5f9!important;border-radius:0!important;gap:12px!important;align-items:flex-start}
  html.m18 #conversationList .conv:active{background:#f1f5f9}
  html.m18 #conversationList .conv .avatar{width:42px!important;height:42px!important;min-width:42px;border-radius:14px!important;background:linear-gradient(135deg,#dbeafe,#e0e7ff)!important;color:#1e40af!important;font-size:16px!important}
  html.m18 #conversationList .conv-title{font-size:15px!important;line-height:1.3}
  html.m18 #conversationList .conv-preview{font-size:13px!important;color:#64748b;margin-top:1px}
  html.m18 #conversationList .conv-preview:empty{display:none}
  html.m18 #conversationList .conv-meta{margin-top:5px!important;gap:4px!important}
  html.m18 #conversationList .conv-meta .mini-pill{font-size:10.5px!important;padding:1px 7px!important}
  html.m18 #conversationList .channel-code-badge{font-size:10px!important;padding:2px 5px!important;margin-top:2px}
  /* bottom bar */
  html.m18 .m18-nav button.active::before{content:"";position:absolute;top:0;left:28%;right:28%;height:3px;border-radius:0 0 3px 3px;background:#1d4ed8}
  html.m18 .m18-nav button:active{background:#f1f5f9}
  /* page headers of full-screen dialogs */
  html.m18 .modal>.modal-card>.modal-head{position:sticky;top:0;z-index:5;background:#fff}
  html.m18 .mt18-list{padding:10px!important}
}
/* ---- signed out: never show the app shell or the bottom bar over the sign-in screen ---- */
@media (max-width:760px){
  html.m18 #appView.hidden{display:none!important}
  html.m18-out .m18-nav,html.m18-out .m18-sheet{display:none!important}
  html.m18-out,html.m18-out body{overflow:auto!important;height:auto!important;min-height:100%}
}
/* ---- sign-in screen on a phone ---- */
@media (max-width:760px){
  #authView.auth-shell{min-height:100dvh;padding:20px 16px calc(20px + env(safe-area-inset-bottom))!important;display:grid;place-items:center;background:linear-gradient(160deg,#0f172a,#1e3a8a)!important}
  #authView .auth-card{width:100%!important;max-width:420px;padding:28px 22px!important;border-radius:22px!important;text-align:center;box-shadow:0 20px 50px rgba(0,0,0,.35)!important}
  #authView .brand-mark{margin:0 auto 14px!important;width:60px;height:60px;border-radius:18px;font-size:28px;display:grid;place-items:center}
  #authView h1{font-size:22px!important;line-height:1.25;margin:0 0 6px!important}
  #authView .auth-card>p.muted{font-size:13px!important;margin:0 0 18px!important}
  #authView form{text-align:left;display:flex;flex-direction:column;gap:12px}
  #authView label{font-size:13px;font-weight:600;display:flex;flex-direction:column;gap:6px;margin:0}
  #authView input{height:48px!important;border-radius:12px!important;font-size:16px!important;padding:0 14px!important}
  #authView #authSubmit{height:48px!important;border-radius:12px!important;font-size:16px!important;font-weight:700;margin-top:4px}
  #authView #authHint{text-align:center;margin-top:12px}
}
/* ---- Nhóm Zalo / Nội bộ on a phone: one compact header per screen ---- */
@media (max-width:760px){
  /* list screen: title row + one scrolling row of actions, no long status text */
  html.m18 .v110-chat-card>.modal-head .zgs-sync-state{display:none!important}
  html.m18 .v110-chat-card>.modal-head h3{font-size:18px!important;margin:0!important;white-space:nowrap}
  html.m18 .v110-chat-card>.modal-head .zgs-head-sep{display:none!important}
  html.m18 .v110-chat-card>.modal-head .zgs-head-actions #zgsCloseBtn{margin-left:auto;position:sticky;right:0;background:#fff}
  html.m18 .v110-chat-card>.modal-head .zgs-head-actions::-webkit-scrollbar,html.m18 .internal-chat-head .button-row::-webkit-scrollbar{display:none}
  /* chat screen: the dialog header collapses to just the back button, sitting inside the chat header */
  html.m18 .v110-chat-card[data-m18pane=chat]{position:relative}
  html.m18 .v110-chat-card[data-m18pane=chat]>.modal-head{position:static!important;padding:0!important;border:0!important;min-height:0!important;height:0!important;overflow:visible!important}
  html.m18 .v110-chat-card[data-m18pane=chat]>.modal-head>*:not(.zgs-head-title),html.m18 .v110-chat-card[data-m18pane=chat]>.modal-head .zgs-head-title>*:not(.m18-cback),html.m18 .v110-chat-card[data-m18pane=chat]>.modal-head>div:first-child>*:not(.m18-cback){display:none!important}
  html.m18 .v110-chat-card[data-m18pane=chat]>.modal-head>div:first-child{display:block!important;flex:none!important}
  html.m18 .v110-chat-card[data-m18pane=chat] .m18-cback{position:absolute;top:8px;left:8px;z-index:6}
  html.m18 .v110-chat-card[data-m18pane=chat] .internal-chat-head{display:block!important;padding:8px 10px 8px!important;background:#fff;border-bottom:1px solid #e5e9f0}
  html.m18 .v110-chat-card[data-m18pane=chat] .internal-chat-head>div:first-child{padding-left:48px;min-height:40px;display:flex;flex-direction:column;justify-content:center;min-width:0}
  html.m18 .v110-chat-card[data-m18pane=chat] .internal-chat-head>div:first-child b{font-size:16px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
  html.m18 .v110-chat-card[data-m18pane=chat] .internal-chat-head>div:first-child .tiny{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html.m18 .v110-chat-card[data-m18pane=chat] .internal-chat-head .button-row{display:flex!important;flex-wrap:nowrap!important;gap:6px!important;overflow-x:auto;margin:8px -10px 0!important;padding:0 10px!important;-webkit-overflow-scrolling:touch;justify-content:flex-start!important}
  html.m18 .v110-chat-card[data-m18pane=chat] .internal-chat-head .button-row>*{flex:none;white-space:nowrap}
  html.m18 .v110-chat-card[data-m18pane=chat] .internal-chat-head .button-row button{height:32px;padding:0 10px!important;font-size:12.5px!important;border-radius:999px!important}
  html.m18 .v110-chat-card[data-m18pane=chat] .internal-chat-head .zgs-filter{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 10px;border:1px solid #e2e8f0;border-radius:999px;font-size:12.5px;font-weight:500;margin:0;background:#fff}
  html.m18 .v110-chat-card[data-m18pane=chat] .internal-chat-head .zgs-filter input{width:15px;height:15px;margin:0}
  /* composer: one line until the user types more */
  html.m18 .v110-chat-card .internal-composer{display:flex!important;align-items:flex-end;gap:8px;padding:8px 10px calc(8px + env(safe-area-inset-bottom))!important;background:#fff;border-top:1px solid #e5e9f0}
  html.m18 .v110-chat-card .internal-composer .mention-wrap{flex:1;min-width:0}
  html.m18 .v110-chat-card .internal-composer textarea,html.m18 .chat-pane .composer textarea{height:44px!important;min-height:44px!important;max-height:120px;padding:10px 12px!important;border-radius:14px!important;line-height:1.4;resize:none}
  html.m18 .v110-chat-card .internal-composer textarea::placeholder,html.m18 .chat-pane .composer textarea::placeholder{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html.m18 .v110-chat-card .internal-composer button[type=submit],html.m18 .chat-pane .composer button[type=submit]{height:44px;border-radius:14px;padding:0 16px}
  html.m18 .v110-chat-card .zgs-tools{padding:6px 10px!important;gap:6px!important;background:#fff;overflow-x:auto;flex-wrap:nowrap!important}
  html.m18 .v110-chat-card .zgs-tools>*{flex:none}
}
/* ---- v1.8.8 · friendlier list screen ---- */
@media (max-width:760px){
  html.m18 #appView>.sidebar{background:linear-gradient(180deg,#dfeaff 0,#eef3fb 190px,#f4f6fa 320px)!important}
  /* header: title, greeting, account button */
  html.m18 #v150InboxHeader{padding:14px 16px 8px!important;gap:10px}
  html.m18 #v150InboxHeader>div:first-child{flex:1;min-width:0;display:flex;flex-direction:column-reverse;gap:1px}
  html.m18 #v150InboxHeader strong{font-size:22px!important;font-weight:800;color:#0f172a}
  html.m18 #v150InboxHeader>div:first-child>span{display:block!important;font-size:13px!important;color:#475569!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html.m18 .m18-mebtn{width:40px;height:40px;border-radius:50%;border:2px solid #fff;background:linear-gradient(135deg,#2563eb,#7c3aed);color:#fff;font-weight:700;font-size:16px;flex:none;box-shadow:0 4px 12px rgba(37,99,235,.3);cursor:pointer}
  html.m18 .sidebar>.search-wrap{padding:4px 14px 10px!important}
  html.m18 .sidebar>.search-wrap input#searchBox{height:46px!important;border-radius:16px!important;border-color:transparent!important;box-shadow:0 2px 10px rgba(30,64,175,.08)!important}
  /* stat tiles: a colour each */
  html.m18 .sidebar>.dashboard-strip{margin:0 14px 10px!important;gap:8px!important}
  html.m18 .sidebar>.dashboard-strip>div{border:0!important;border-radius:16px;padding:9px 4px 8px!important;box-shadow:0 2px 8px rgba(15,23,42,.05);position:relative;overflow:hidden}
  html.m18 .sidebar>.dashboard-strip>div::before{content:"";position:absolute;left:0;right:0;top:0;height:3px;background:var(--c,#2563eb)}
  html.m18 .sidebar>.dashboard-strip>div strong{font-size:20px!important;font-weight:800;color:var(--c,#2563eb)}
  html.m18 .sidebar>.dashboard-strip>div span{font-size:11px!important;font-weight:500;color:#64748b}
  html.m18 .sidebar>.dashboard-strip>div:nth-child(1){--c:#2563eb}
  html.m18 .sidebar>.dashboard-strip>div:nth-child(2){--c:#d97706}
  html.m18 .sidebar>.dashboard-strip>div:nth-child(3){--c:#059669}
  html.m18 .sidebar>.dashboard-strip>div:nth-child(4){--c:#7c3aed}
  html.m18 .sidebar>#fl18Bar{margin:0 14px 10px!important}
  html.m18 .sidebar>#fl18Bar .fl18-chip{border:0!important;border-radius:14px!important;box-shadow:0 2px 8px rgba(15,23,42,.05);background:#fff}
  /* filters */
  html.m18 .sidebar>#v150InboxToolbar{padding:0 14px 10px!important}
  html.m18 #v150InboxToolbar select,html.m18 #v150InboxToolbar #v150RefreshInbox{border:0!important;border-radius:14px!important;box-shadow:0 2px 8px rgba(15,23,42,.05)}
  html.m18 #v150InboxToolbar select{height:42px!important;font-weight:600;color:#0f172a}
  html.m18 #v150InboxToolbar #v150RefreshInbox{width:42px;height:42px;min-width:42px;font-size:17px;color:#2563eb}
  html.m18 #sourceFilterRow .source-filter{height:30px;border-radius:999px;font-weight:700}
  html.m18 #sourceFilterRow .group-toggle{font-weight:500}
  html.m18 #sourceFilterRow .group-toggle input{appearance:none;-webkit-appearance:none;width:36px!important;height:20px!important;border-radius:999px;background:#cbd5e1;position:relative;transition:background .15s;cursor:pointer;border:0;order:2}
  html.m18 #sourceFilterRow .group-toggle input::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .15s}
  html.m18 #sourceFilterRow .group-toggle input:checked{background:#2563eb}
  html.m18 #sourceFilterRow .group-toggle input:checked::after{transform:translateX(16px)}
  /* list */
  html.m18 #conversationList{border-top:0!important;border-radius:22px 22px 0 0!important;box-shadow:0 -4px 18px rgba(15,23,42,.06)}
  html.m18 #conversationList .conv-group-header:not(.org-folder){background:#fff!important;border-bottom:0!important;padding:14px 16px 6px!important;min-height:0;font-size:12.5px!important;text-transform:none}
  html.m18 #conversationList .conv-group-header:not(.org-folder):first-child{border-radius:22px 22px 0 0}
  html.m18 #conversationList .conv-group-header:not(.org-folder) b{font-weight:700;color:#334155}
  html.m18 #conversationList .conv-group-header:not(.org-folder) span{background:#eff6ff!important;color:#1d4ed8!important;font-weight:600}
  html.m18 #conversationList .conv{padding:10px 16px!important;border-bottom:0!important;position:relative}
  html.m18 #conversationList .conv::after{content:"";position:absolute;left:72px;right:16px;bottom:0;height:1px;background:#f1f5f9}
  html.m18 #conversationList .conv.active{background:#eff6ff!important}
  html.m18 #conversationList .conv .avatar{width:46px!important;height:46px!important;min-width:46px;border-radius:50%!important;font-weight:700;color:#fff!important;background:linear-gradient(135deg,#3b82f6,#2563eb)!important}
  html.m18 #conversationList .conv .avatar[data-m18c="1"]{background:linear-gradient(135deg,#f59e0b,#ea580c)!important}
  html.m18 #conversationList .conv .avatar[data-m18c="2"]{background:linear-gradient(135deg,#10b981,#059669)!important}
  html.m18 #conversationList .conv .avatar[data-m18c="3"]{background:linear-gradient(135deg,#8b5cf6,#6d28d9)!important}
  html.m18 #conversationList .conv .avatar[data-m18c="4"]{background:linear-gradient(135deg,#ec4899,#be185d)!important}
  html.m18 #conversationList .conv .avatar[data-m18c="5"]{background:linear-gradient(135deg,#06b6d4,#0e7490)!important}
  html.m18 #conversationList .conv-title{font-size:15px!important;font-weight:700;color:#0f172a}
  html.m18 #conversationList .conv-preview{font-size:13.5px!important;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html.m18 #conversationList .conv-meta .mini-pill{border:0!important;font-weight:600;border-radius:6px!important;padding:2px 7px!important;background:#f1f5f9;color:#64748b}
  html.m18 #conversationList .conv-meta .mini-pill[data-m18p=new]{background:#dbeafe;color:#1d4ed8}
  html.m18 #conversationList .conv-meta .mini-pill[data-m18p=unassigned]{background:#fef3c7;color:#b45309}
  html.m18 #conversationList .conv-meta .mini-pill[data-m18p=doing]{background:#d1fae5;color:#047857}
  html.m18 #conversationList .conv-meta .mini-pill[data-m18p=assigned]{background:#ede9fe;color:#6d28d9}
  html.m18 #conversationList .conv-meta .mini-pill[data-m18p=hint]{background:#fce7f3;color:#be185d}
  html.m18 #conversationList .channel-code-badge{border:0!important;background:#e0f2fe!important;color:#0369a1!important;border-radius:6px!important;font-weight:700}
  /* bottom bar: soft pill behind the active icon */
  html.m18 .m18-nav{border-top:0;box-shadow:0 -6px 20px rgba(15,23,42,.08);border-radius:18px 18px 0 0}
  html.m18 .m18-nav button.active::before{top:6px;left:50%;right:auto;width:52px;height:30px;transform:translateX(-50%);border-radius:999px;background:#dbeafe;z-index:0}
  html.m18 .m18-nav button>span{position:relative;z-index:1}html.m18 .m18-nav .b{z-index:2}
  html.m18 .m18-nav button .i{filter:none}
  html.m18 .m18-nav button{gap:5px;font-weight:500}
}
@media (max-width:760px){html.m18 #v150InboxHeader>div:first-child>span[data-hi]{font-size:0!important}html.m18 #v150InboxHeader>div:first-child>span[data-hi]::before{content:attr(data-hi);font-size:13px;color:#475569}}
/* ---- unread marker per group / conversation (all screen sizes): stays until that group is opened ---- */
#zgsGroupList [data-zgs-group].nt18-unread,#conversationList .conv.nt18-unread{position:relative}
#zgsGroupList [data-zgs-group].nt18-unread b,#conversationList .conv.nt18-unread .conv-title{font-weight:800!important;color:#0f172a}
#zgsGroupList [data-zgs-group].nt18-unread small,#conversationList .conv.nt18-unread .conv-preview{color:#0f172a!important;font-weight:600}
#zgsGroupList [data-zgs-group].nt18-unread::after,#conversationList .conv.nt18-unread::before{content:"";position:absolute;right:14px;top:50%;width:11px;height:11px;margin-top:-5px;border-radius:50%;background:#ef4444;box-shadow:0 0 0 3px rgba(239,68,68,.18)}
#conversationList .conv.nt18-unread::before{right:auto;left:6px;width:8px;height:8px;margin-top:-4px}
@media (max-width:760px){
  /* on a phone the list is its own screen: no group is "selected" there */
  html.m18 .v110-chat-card:not([data-m18pane=chat]) #zgsGroupList .member-row.active{background:transparent!important;box-shadow:none!important}
}
