/* NITI.Chat 1.1.19 — approved product layout for Web and Android WebView. */
:root{
  --p-bg:#edf3f6;--p-panel:#fff;--p-panel-2:#f5f8fa;--p-text:#17272f;--p-muted:#687b84;
  --p-line:#d6e0e5;--p-accent:#27798e;--p-accent-soft:#dcebef;--p-danger:#a94d50;
  --p-rail:#073347;--p-rail-raised:#255c70;--p-shadow:0 14px 36px rgba(11,38,49,.12)
}
html[data-theme="dark"]{
  --p-bg:#151a1f;--p-panel:#20272d;--p-panel-2:#272f36;--p-text:#edf2f4;--p-muted:#aeb9bf;
  --p-line:#39444d;--p-accent:#8bb7c3;--p-accent-soft:#2b3c43;--p-danger:#e09a9d;
  --p-rail:#111a20;--p-rail-raised:#2c3c45;--p-shadow:0 14px 38px rgba(0,0,0,.32)
}
body{background:var(--p-bg);color:var(--p-text)}
button,input,textarea,select{font:inherit}.ui-icon{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
.shell,.main,.workspace,.chat-list,.thread{min-height:0}.shell{display:flex!important;background:var(--p-bg)!important;color:var(--p-text)}.shell>.main{display:flex!important;flex:1;flex-direction:column;min-width:0;min-height:0}.workspace{display:flex!important;flex:1;min-width:0;min-height:0}
.sidebar{width:230px;min-width:230px;padding:18px 14px 16px;background-color:var(--p-rail)!important;background-image:var(--niti-mottle-blue),var(--niti-weave-blue)!important;color:#d9e8ee;gap:7px;border:0!important}
.sidebar-head{margin:0 0 16px}.sidebar .brand-row{padding:4px 6px!important;flex-wrap:nowrap}.sidebar .brand-row img{width:44px;height:44px;border-radius:13px}.sidebar .brand-row h1{font-family:Georgia,serif;font-size:23px;letter-spacing:0;text-transform:none}.sidebar .brand-row h1::after{content:".Chat";font-size:13px;font-weight:500}
.sidebar .brand.theme-only-dark .brand-sub{display:none}.sidebar .brand.theme-only-dark .wordmark{min-width:0}.sidebar .brand.theme-only-dark .mark{width:92px}.sidebar .nav-btn{display:flex;align-items:center;gap:12px;min-height:48px;padding:11px 13px;border:0;border-radius:12px;background:transparent;color:#c4d4da;font-weight:520;text-align:left}.sidebar .nav-btn:hover{background:rgba(255,255,255,.07);color:#fff}.sidebar .nav-btn.active{background:var(--p-rail-raised)!important;color:#fff}.sidebar .nav-btn.active::before{content:"";position:absolute;left:0;width:3px;height:28px;border-radius:0 3px 3px 0;background:#62b7c9}.sidebar .grow{flex:1}.sidebar .help-nav{margin-top:auto}.sidebar .theme-switch{margin:4px 0!important;border-color:rgba(255,255,255,.12)!important;background:rgba(255,255,255,.05)!important}.sidebar .theme-switch button{padding:7px!important;color:#bdd0d8!important}.sidebar .theme-switch button[aria-pressed="true"]{background:rgba(255,255,255,.13)!important;color:#fff!important}.sidebar-fold{justify-content:flex-start!important}.account-card{display:flex;align-items:center;gap:10px;width:100%;min-height:52px;padding:8px;border:0;border-radius:13px;background:rgba(255,255,255,.06);color:#fff;text-align:left;cursor:pointer}.account-card:hover{background:rgba(255,255,255,.1)}.account-avatar{display:grid;place-items:center;width:34px;height:34px;border-radius:11px;background:#d7e3e7;color:#243943;font-weight:700;flex:none}.account-card .who{display:block!important;flex:1;min-width:0;padding:0!important;white-space:normal!important}.account-card .who strong,.account-card .who small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account-card .who strong{font-size:12px}.account-card .who small{margin-top:3px;font-size:9px;color:#aac0c8}
.main{background:var(--p-bg)}.topbar{min-height:68px;padding:15px 24px;background:var(--p-panel)!important;border-color:var(--p-line)!important}.topbar h2{font-size:21px}.kpis{color:var(--p-muted)}.workspace{background:var(--p-bg)}
.chat-list{width:min(370px,38%);background:var(--p-panel)!important;border-color:var(--p-line)!important}.list-actions{display:flex;flex-direction:column;gap:8px;padding:14px 14px 2px}.list-actions>button{display:flex;align-items:center;gap:10px;min-height:55px;padding:10px 12px;border:1px solid var(--p-line);border-radius:12px;background:var(--p-panel-2);color:var(--p-text);text-align:left;cursor:pointer}.list-actions>button:hover{background:var(--p-accent-soft)}.list-actions .ui-icon{color:var(--p-accent)}.list-actions span{flex:1;min-width:0}.list-actions strong,.list-actions small{display:block}.list-actions strong{font-size:12px}.list-actions small{margin-top:4px;color:var(--p-muted);font-size:10px;line-height:1.35}.list-actions b{color:var(--p-muted);font-size:19px}.action-count{min-width:22px;padding:3px 6px;border-radius:7px;background:var(--p-accent-soft);color:var(--p-text);font-style:normal;font-size:10px;text-align:center}
.search{height:44px;margin:12px 14px;padding:10px 13px;background:var(--p-panel-2);border-color:var(--p-line);color:var(--p-text)}.rows{padding:2px 8px 12px;scrollbar-width:thin;scrollbar-color:var(--p-line) transparent}.rows>.row{margin:2px 0;padding:3px 8px!important;border:0!important;border-radius:12px;background:transparent}.rows>.row:hover{background:var(--p-panel-2)}.rows>.row.active{background:var(--p-accent-soft)!important;box-shadow:none!important}.row .open{padding:11px 3px!important;color:var(--p-text)!important}.row .name{font-size:13px}.row .preview{margin-top:6px;color:var(--p-muted)!important;font-size:11px}.badge{box-shadow:none!important}.badge.unread{background:#6f9fad!important;color:#fff!important;box-shadow:none!important}.row-actions{border-color:var(--p-line)!important}.row-actions button{font-size:11px!important;border-color:var(--p-line)!important;color:var(--p-text)!important;background:transparent!important}.row-actions .act-del{color:var(--p-danger)!important}
.thread{background:var(--p-bg)!important}.thread-head{min-height:74px;padding:12px 18px;background:var(--p-panel)!important;border-color:var(--p-line)!important}.thread-head strong{font-size:15px}.thread-head .sub.activity{color:var(--p-muted)}.thread-head .nav-btn{min-height:40px;border:0;border-radius:10px;color:var(--p-muted);background:transparent}.msgs{padding:20px clamp(14px,3vw,34px) 24px!important;background-color:var(--p-bg)!important;background-image:var(--niti-mottle-light),var(--niti-weave-light)!important;scrollbar-width:thin;scrollbar-color:var(--p-line) transparent}.bubble{max-width:76%;padding:10px 12px;border-radius:15px;box-shadow:0 3px 12px rgba(8,27,35,.08)!important}.bubble.in{background:var(--p-panel)!important}.bubble.out{background:#d8e8ee!important}.bubble .ch{color:var(--p-muted)!important}.composer-zone{flex:none;padding:8px 14px calc(10px + var(--safe-b) + var(--kb));background:var(--p-panel);border-top:1px solid var(--p-line)}.schedule-quick{display:inline-flex;align-items:center;gap:7px;min-height:36px;margin:0 0 7px;padding:6px 10px;border:1px solid var(--p-line);border-radius:10px;background:transparent;color:var(--p-text);font-size:11px;cursor:pointer}.schedule-quick:hover{background:var(--p-accent-soft)}.schedule-quick .ui-icon{width:16px;height:16px;color:var(--p-accent)}.schedule-quick b{color:var(--p-muted)}.composer{display:grid!important;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:7px;padding:7px!important;border:1px solid var(--p-line)!important;border-radius:17px;background:var(--p-panel-2)!important}.composer-route{display:flex;align-items:center;gap:7px;min-width:0}.composer-route>span{font-size:10px;color:var(--p-muted);white-space:nowrap}.composer select,.composer textarea{border-color:var(--p-line)!important;background:var(--p-panel)!important;color:var(--p-text)!important}.composer-route,.composer textarea,.composer .attach,.composer .send-message{grid-row:1}.composer-route select{width:105px;max-width:105px;height:40px;padding:7px 9px;border-radius:10px;font-size:11px}.composer textarea{grid-column:2;min-width:0!important;min-height:44px!important;max-height:110px!important;padding:10px!important;resize:none!important}.composer .attach{grid-column:3;width:40px;height:40px;border-color:var(--p-line)!important;background:transparent!important}.composer .send-message{grid-column:4;display:grid;place-items:center;width:44px;height:44px;padding:0;border-radius:13px;background:#527f8f;color:#fff;font-size:19px}.composer .file-name{grid-column:1/-1;grid-row:2}.route-hint{margin:7px 3px 0;color:var(--p-muted);font-size:10px}
.contact-identities{display:flex;align-items:center;gap:6px;margin-top:7px}.contact-identities button{padding:4px 7px;border:1px solid var(--p-line);border-radius:7px;background:var(--p-panel-2);color:var(--p-accent);font-size:10px;cursor:pointer}.contact-identities span{color:var(--p-muted);font-size:10px}
.tools.product-tools{display:flex!important;flex-direction:column;width:100%;padding:30px clamp(20px,5vw,72px);gap:14px;background:var(--p-bg);color:var(--p-text)}.product-page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;max-width:1000px;margin-bottom:8px}.product-page-head h2{margin:0;font-size:28px}.product-page-head p{max-width:650px;margin:8px 0 0;color:var(--p-muted);font-size:13px;line-height:1.55}.product-back{margin:0 0 12px;padding:0;border:0;background:transparent;color:var(--p-accent);cursor:pointer}.product-tools>section{max-width:820px;padding:20px;border:1px solid var(--p-line);border-radius:16px;background:var(--p-panel);box-shadow:0 4px 14px rgba(10,36,47,.04)}.product-tools>section::before{display:none!important}.product-tools>section h3{font-size:16px}.product-tools>section p{color:var(--p-muted)}.product-tools [data-product-section]{display:none}.product-tools[data-product-view="settings"] [data-product-section~="settings"],.product-tools[data-product-view="scheduled"] [data-product-section~="scheduled"],.product-tools[data-product-view="mass"] [data-product-section~="mass"],.product-tools[data-product-view="admin"] [data-product-section~="admin"]{display:block}.product-tools[data-product-view="subscriptions"][data-subtab="groups"] [data-product-section~="groups"],.product-tools[data-product-view="subscriptions"][data-subtab="channels"] [data-product-section~="channels"]{display:block}.product-tabs{display:flex;width:max-content;gap:4px;padding:4px;border:1px solid var(--p-line);border-radius:12px;background:var(--p-panel)}.product-tabs button{min-width:120px;min-height:39px;padding:7px 14px;border:0;border-radius:9px;background:transparent;color:var(--p-muted);cursor:pointer}.product-tabs button[aria-selected="true"]{background:var(--p-accent-soft);color:var(--p-text)}.tool-item,.help-block,.link-out{background:var(--p-panel-2)!important;color:var(--p-text)}.tools input,.tools select,.tools textarea,.mass-text,.bcast-text{background:var(--p-panel-2);border-color:var(--p-line);color:var(--p-text)}.tool-item button,.tool-btns button{background:transparent;border-color:var(--p-line);color:var(--p-text)}.tools .primary{background:#527f8f;color:#fff}.mass-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 18px;max-height:280px;overflow:auto}.mass-row{padding:9px 4px;border-bottom:1px solid var(--p-line)}.mass-route-label{display:block;margin:14px 0 4px;color:var(--p-muted);font-size:12px}.mass-route-label select{display:block;margin-top:7px}.settings-link{display:flex;align-items:center;gap:12px;width:100%;padding:4px;border:0;background:transparent;color:var(--p-text);text-align:left;cursor:pointer}.settings-link span{flex:1}.settings-link strong,.settings-link small{display:block}.settings-link small{margin-top:5px;color:var(--p-muted)}.mobile-settings-help{display:none!important}
.product-dialog{max-width:440px;width:calc(100% - 28px);padding:0;border:1px solid var(--p-line);border-radius:22px;background:var(--p-panel);color:var(--p-text);box-shadow:var(--p-shadow)}.product-dialog::backdrop{background:rgba(5,14,18,.68);backdrop-filter:blur(6px)}.dialog-card{padding:28px}.dialog-head{display:flex;justify-content:space-between;align-items:center}.dialog-head img{width:55px;height:55px;border-radius:15px;object-fit:cover}.dialog-head button{width:38px;height:38px;border:0;background:transparent;color:var(--p-muted);font-size:26px}.dialog-card h2{margin:24px 0 6px}.dialog-muted{color:var(--p-muted)}.account-facts{margin:22px 0}.account-facts>div{display:flex;justify-content:space-between;gap:14px;padding:13px 0;border-bottom:1px solid var(--p-line)}.account-facts dt{color:var(--p-muted)}.account-facts dd{margin:0;text-align:right}.state-ok{display:inline-block;margin-left:8px;padding:4px 7px;border-radius:7px;background:var(--p-accent-soft);color:var(--p-accent);font-size:10px}.danger-outline{width:100%;min-height:46px;border:1px solid var(--p-danger);border-radius:11px;background:transparent;color:var(--p-danger);cursor:pointer}
.shell.sidebar-collapsed .sidebar{display:none!important}.shell.sidebar-collapsed .main{width:100%}.shell.sidebar-collapsed>.sidebar-reopen{display:flex;align-items:center;justify-content:center;left:14px;top:14px;bottom:auto;min-width:74px;height:42px;border:1px solid var(--p-line);border-radius:11px;background:var(--p-panel);color:var(--p-text);z-index:60;box-shadow:var(--p-shadow)}
@media(max-width:1100px) and (min-width:801px){.sidebar{width:78px;min-width:78px;padding:18px 10px}.sidebar .brand-row h1,.sidebar .brand.theme-only-dark,.sidebar .nav-btn span,.sidebar .theme-switch,.sidebar .account-card .who,.sidebar .account-card>span:last-child,.sidebar .help-nav span{display:none!important}.sidebar .brand-row{justify-content:center;padding:2px!important}.sidebar .nav-btn{justify-content:center;padding:10px}.sidebar .account-card{justify-content:center}.sidebar-fold{display:flex!important;justify-content:center!important;font-size:0}.sidebar-fold::after{content:"‹";font-size:25px;line-height:1}.chat-list{width:330px}.composer-route>span{display:none}.composer-route select{width:92px;max-width:92px}}
@media(max-width:800px){
  .topbar{display:none}.workspace{min-height:0}.chat-list{padding-top:max(12px,var(--safe-t));width:100%}.list-actions{padding:8px 14px 2px}.list-actions>button{min-height:52px}.list-actions strong{font-size:13px}.list-actions small{font-size:11px}.row .name{font-size:14px}.row .preview{font-size:12px}.shell.tools-open .thread{display:flex}.thread{padding-top:max(0px,var(--safe-t))}.thread-head{min-height:72px}.thread-menu{display:none!important}.msgs{padding:14px 12px!important}.bubble{max-width:88%}.composer-zone{padding:7px 8px calc(8px + var(--safe-b) + var(--kb))}.schedule-quick{margin-bottom:5px;font-size:12px}.composer{grid-template-columns:auto minmax(0,1fr) auto auto!important;gap:4px}.composer-route{grid-column:1}.composer-route>span{display:none}.composer-route select{width:58px;max-width:58px;height:38px;padding:6px 5px;font-size:11px}.composer textarea{grid-column:2;font-size:16px}.composer .attach{grid-column:3;width:36px;height:36px}.composer .send-message{grid-column:4;width:42px;height:42px}.route-hint{display:none}.tabbar{height:68px;display:flex!important;padding:3px 4px calc(3px + var(--safe-b));background-color:var(--p-rail)!important;background-image:var(--niti-weave-blue)!important}.shell.chat-open .tabbar{display:none!important}.tabbar button{display:flex;flex:1;min-width:0;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:4px 2px;color:#b9ccd3;font-size:10px}.tabbar button.active{border-radius:11px;background:var(--p-rail-raised);color:#fff}.tabbar .ui-icon{width:19px;height:19px}.tools.product-tools{padding:22px 16px calc(88px + var(--safe-b))}.product-page-head h2{font-size:26px}.product-tools>section{padding:16px}.product-tabs{width:100%}.product-tabs button{flex:1;min-width:0}.mass-list{grid-template-columns:1fr}.mobile-theme-setting,.mobile-settings-help{display:none!important}.product-tools[data-product-view="settings"] .mobile-theme-setting,.product-tools[data-product-view="settings"] .mobile-settings-help{display:block!important}.sidebar>.theme-switch,.sidebar .help-nav{display:none!important}.sidebar-reopen{display:none!important}.product-dialog{max-height:calc(100dvh - 20px);overflow:auto}.dialog-card{padding:22px}
}
@media(max-width:520px){.product-page-head h2{font-size:24px}.tool-form{flex-direction:column;align-items:stretch}.tool-form .primary,.tool-form select,.tool-form input{width:100%}.tool-item{align-items:flex-start;flex-direction:column}.tool-btns{width:100%}.contact-identities{align-items:flex-start;flex-wrap:wrap}.contact-identities span{width:100%}}
@media(prefers-reduced-motion:no-preference){.thread,.chat-list,.product-tools>section,.product-dialog{animation:p-enter .2s cubic-bezier(.2,.75,.2,1)}@keyframes p-enter{from{opacity:.01;transform:translateY(6px)}to{opacity:1;transform:none}}}
@media(min-width:801px){.mobile-theme-setting{display:none!important}}

/* Neutralize legacy red accents that belong only to destructive actions. */
.tools .primary{background:#527f8f!important;border-color:#527f8f!important;color:#fff!important;box-shadow:none!important}
.tabbar button.active::before{display:none!important}
.thread{flex:1}
.row.has-unread{box-shadow:inset 3px 0 0 #6f9fad!important}
.rows>.row.active::before{background:#62b7c9!important;box-shadow:none!important}
.send-message{border-color:#527f8f!important;box-shadow:none!important}
html[data-theme="dark"] .bubble.out{background:#304752!important;color:#edf2f4!important}
html[data-theme="dark"] .msgs{background-color:#151a1f!important;background-image:repeating-linear-gradient(90deg,rgba(139,183,195,.035) 0 1px,transparent 1px 4px),repeating-linear-gradient(0deg,rgba(139,183,195,.03) 0 1px,transparent 1px 4px)!important}
.primary{background:#527f8f!important;border-color:#527f8f!important;color:#fff!important;box-shadow:none!important}
.tools section+section::before{display:none!important}
@media(prefers-reduced-motion:no-preference){.sidebar .brand-row img{animation:p-logo 4.8s ease-in-out infinite}@keyframes p-logo{0%,100%{transform:rotate(-1deg) translateY(0)}50%{transform:rotate(1.5deg) translateY(-2px)}}}

/* 1.1.19 — production port of the approved three-column reference. */
@media(min-width:801px){
  .shell{height:100dvh;overflow:hidden}
  .sidebar{width:172px;min-width:172px;padding:17px 10px 12px;gap:5px}
  .sidebar-head{margin:0 0 18px}
  .sidebar .brand-row{padding:3px 7px!important;gap:8px}
  .sidebar .brand-row img{width:36px;height:36px;border-radius:11px}
  .sidebar .brand-row h1{font-size:21px}
  .sidebar .brand-row h1::after{font-size:11px}
  .sidebar .nav-btn{min-height:44px;padding:10px 11px;border-radius:10px;font-size:12px}
  .sidebar .nav-btn.active::before{height:24px}
  .sidebar .theme-switch{display:grid;grid-template-columns:1fr 1fr;margin:3px 0!important;padding:3px!important}
  .sidebar .theme-switch button{min-width:0;padding:6px 2px!important;font-size:9px!important}
  .sidebar-fold{min-height:39px!important;font-size:10px!important}
  .account-card{min-height:47px;padding:6px 8px}
  .account-avatar{width:31px;height:31px;border-radius:10px}

  .shell>.main{display:grid!important;grid-template-columns:320px minmax(0,1fr);grid-template-rows:72px minmax(0,1fr);overflow:hidden}
  .topbar{grid-column:1;grid-row:1;min-height:72px;padding:19px 20px;background:var(--p-panel)!important;border-right:1px solid var(--p-line);border-bottom:0!important}
  .topbar h2{font-size:25px;letter-spacing:-.6px;font-weight:650}
  .title-dot{color:var(--p-accent)}
  .kpis{display:none}
  .workspace{display:contents!important}
  .chat-list{grid-column:1;grid-row:2;width:auto!important;min-width:0;display:flex;flex-direction:column;border-right:1px solid var(--p-line)!important;overflow:hidden}
  .thread{grid-column:2;grid-row:1/3;min-width:0;min-height:0}
  .shell.tools-open .topbar{display:none!important}
  .shell.tools-open .thread{grid-column:1/3;grid-row:1/3}
  .shell.tools-open .chat-list{display:none!important}
}

.search{order:0;height:40px;margin:0 13px 8px;border-radius:9px;font-size:11px}
.list-actions{order:1;display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:0 13px 10px!important;border-bottom:1px solid var(--p-line)}
.list-actions>button{justify-content:flex-start;gap:6px;min-width:0;min-height:34px!important;padding:6px 8px!important;border-radius:8px!important;background:transparent!important}
.list-actions>button:hover{background:var(--p-panel-2)!important}
.list-actions .ui-icon{width:15px;height:15px}
.list-actions>button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;font-weight:600}
.list-actions>button small,.list-actions>button>b{display:none!important}
.list-actions .action-count{margin-left:auto;min-width:18px;padding:2px 4px;font-size:8px}
.rows{order:2;flex:1;padding:6px 8px 16px!important}
.chat-group{display:flex;align-items:center;justify-content:space-between;padding:12px 9px 7px;color:var(--p-muted);font-size:8px;font-weight:700;letter-spacing:.07em;text-transform:uppercase}
.chat-group b{font-weight:600}
.rows>.row{margin:1px 0;min-height:66px;padding:0!important;border-radius:10px!important}
.rows>.row.active{background:#30404b!important}
html[data-theme="standard"] .rows>.row.active{background:var(--p-accent-soft)!important}
.rows>.row.active::before{left:0!important;height:28px!important}
.row .open{display:flex!important;align-items:center;gap:10px;width:100%;min-height:66px;padding:8px 9px!important;text-align:left}
.chat-avatar,.thread-avatar{display:grid;place-items:center;flex:none;width:38px;height:38px;border-radius:13px;color:#f4f7f8;font-size:13px;font-weight:700;background:#53616b}
.chat-avatar.tone-1,.thread-avatar.tone-1{background:#5f6974}.chat-avatar.tone-2,.thread-avatar.tone-2{background:#536b73}.chat-avatar.tone-3,.thread-avatar.tone-3{background:#665f72}.chat-avatar.tone-4,.thread-avatar.tone-4{background:#596b62}.chat-avatar.tone-5,.thread-avatar.tone-5{background:#6e6259}
.row .meta{flex:1;min-width:0}
.chat-row-top{display:flex;align-items:center;gap:7px;min-width:0}
.chat-row-top .name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px!important}
.chat-row-top time{flex:none;color:var(--p-muted);font-size:8px}
.row .preview{margin-top:5px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px!important}
.badge{vertical-align:1px}

.thread-head{min-height:72px!important;padding:10px 20px!important;gap:11px;background:var(--p-bg)!important}
.thread-head .thread-avatar{width:38px;height:38px;border-radius:13px}
.thread-person{min-width:0}
.thread-person strong{font-size:13px!important}
.thread-person .head-badges{display:inline-flex;margin-left:5px;vertical-align:1px}
.thread-person .activity{margin-top:4px!important;font-size:8px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.thread-details{margin-left:auto!important;min-width:38px!important;padding:6px!important;font-size:18px;letter-spacing:2px}
@media(min-width:801px){.thread-back{display:none!important}}
.msgs{display:flex;flex:1;flex-direction:column;min-height:0;padding:24px clamp(24px,6vw,100px) 28px!important;background-image:none!important;overflow-y:auto}
html[data-theme="dark"] .msgs{background-color:#151a1f!important;background-image:radial-gradient(circle at 82% 18%,rgba(112,159,174,.035),transparent 36%)!important}
.bubble{width:fit-content;max-width:min(72%,620px)!important;margin-bottom:10px;padding:10px 13px!important;border:1px solid transparent;border-radius:13px 13px 13px 4px!important;font-size:12px;line-height:1.5;box-shadow:0 2px 8px rgba(0,0,0,.08)!important}
.bubble.in{align-self:flex-start;background:#252c33!important;border-color:#303943}
.bubble.out{align-self:flex-end;border-radius:13px 13px 4px 13px!important;background:#304752!important;border-color:#3b5663}
html[data-theme="standard"] .bubble.in{background:#fff!important;border-color:#dce5e9}
html[data-theme="standard"] .bubble.out{background:#d8e8ee!important;border-color:#c9dde4}
.bubble .ch{margin-top:4px!important;font-size:8px!important}
.day{align-self:center}

.composer-zone{padding:10px 20px 11px!important;background:var(--p-bg)!important;border-top:0!important}
.composer{display:block!important;padding:7px 9px!important;border-radius:15px!important;background:var(--p-panel)!important}
.composer textarea{display:block;width:100%!important;min-height:46px!important;max-height:130px!important;padding:9px 6px!important;border:0!important;background:transparent!important;font-size:12px;line-height:1.5;resize:none!important}
.composer textarea{scrollbar-width:none}
.composer textarea::-webkit-scrollbar{width:0;height:0;display:none}
.composer textarea::-webkit-scrollbar-button{display:none;width:0;height:0}
.composer-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:6px;border-top:1px solid var(--p-line)}
.composer-left,.composer-actions{display:flex;align-items:center;gap:6px;min-width:0}
.composer-route{display:flex!important;align-items:center;gap:6px;min-width:0}
.composer-route>span{font-size:8px!important;color:var(--p-muted)}
/* Reset the legacy dark-theme minimum (7.25rem), which otherwise wins over mobile width. */
.composer-route select{min-width:0!important;width:76px!important;height:34px!important;padding:5px 7px!important;border-radius:8px!important;font-size:10px!important}
.schedule-quick{min-height:34px!important;margin:0!important;padding:5px 8px!important;border:0!important;font-size:9px!important}
.schedule-quick .ui-icon{width:15px;height:15px}
.composer .attach{display:grid;place-items:center;width:35px!important;height:35px!important;min-height:35px!important;padding:0!important;border:0!important;font-size:17px}
.composer .send-message{width:40px!important;height:40px!important;border-radius:11px!important}
.composer .file-name:not(:empty){display:block;margin-bottom:5px;padding:5px 7px;border-radius:7px;background:var(--p-panel-2);font-size:9px}
.route-hint{margin:6px 4px 0!important;font-size:8px!important}
.tools.product-tools .settings-logout{margin-top:16px;color:var(--p-danger);border-color:var(--p-danger);background:transparent}

@media(max-width:1100px) and (min-width:801px){
  .sidebar{width:72px;min-width:72px;padding-left:8px;padding-right:8px}
  .sidebar .brand-row img{width:38px;height:38px}
  .sidebar .theme-switch{display:none!important}
  .shell>.main{grid-template-columns:294px minmax(0,1fr)}
  .topbar{padding-left:17px}.topbar h2{font-size:23px}
  .msgs{padding-left:20px!important;padding-right:20px!important}
}

@media(max-width:800px){
  .shell>.main{display:flex!important;overflow:hidden}
  /* Keep both themes on the same breakpoint; the legacy dark layout stops at 799px. */
  .sidebar{display:none!important}
  .shell.chat-open .chat-list,.shell.tools-open .chat-list{display:none!important}
  .thread{display:none}
  .shell.chat-open .thread,.shell.tools-open .thread{display:flex}
  .workspace{display:flex!important}
  .chat-list{display:flex;flex-direction:column}
  .search{margin-top:0}
  .list-actions{padding-bottom:8px!important}
  .list-actions>button{min-height:37px!important}
  .chat-group{padding-top:10px}
  .row .open{min-height:70px}
  .thread-head{padding:9px 10px!important}
  .thread-head .thread-avatar{width:36px;height:36px}
  .thread-details{display:none!important}
  .thread-back{display:inline-flex!important;margin-left:auto!important}
  .msgs{padding:16px 12px!important}
  .bubble{max-width:88%!important;font-size:13px}
  .composer-zone{padding:6px 7px calc(7px + var(--safe-b) + var(--kb))!important}
  .composer{display:flex!important;align-items:center;gap:4px;padding:5px 6px!important}
  .composer textarea{flex:1;min-width:0!important;min-height:43px!important;height:43px!important;padding:10px 5px!important;font-size:16px}
  .composer-toolbar{flex:none;gap:2px;padding:0;border:0}
  .composer-left,.composer-actions{gap:1px}
  .composer-route>span,.schedule-quick span{display:none!important}
  .composer-route{position:relative}
  .composer-route::after{content:"⌄";position:absolute;right:5px;top:50%;transform:translateY(-50%);font-size:12px;color:var(--p-muted);pointer-events:none}
  .composer-route select{appearance:none;width:72px!important;max-width:72px;height:36px!important;padding:4px 16px 4px 5px!important}
  .schedule-quick{width:34px;min-width:34px;min-height:36px!important;padding:7px!important}
  .composer .attach{width:34px!important;height:36px!important}
  .composer .send-message{width:40px!important;height:40px!important}
  .composer .file-name{position:absolute;left:9px;right:9px;bottom:100%;z-index:2}
  .route-hint{display:none!important}
  .tools.product-tools{padding-top:max(22px,var(--safe-t))}
}

@media(max-width:430px){
  .list-actions>button span{font-size:9px}
  .schedule-quick{width:32px;min-width:32px}
  .composer .attach{width:31px!important}
  .composer .send-message{width:39px!important}
}

@media(prefers-reduced-motion:no-preference){
  .rows>.row,.bubble,.thread-head,.composer-zone{animation:niti-settle .2s cubic-bezier(.2,.75,.2,1)}
  .nav-btn,.list-actions>button,.composer button,.chat-avatar{transition:background-color .18s ease,color .18s ease,transform .18s ease}
  .list-actions>button:hover,.composer button:hover{transform:translateY(-1px)}
  @keyframes niti-settle{from{opacity:.01;transform:translateY(5px)}to{opacity:1;transform:none}}
}

/* Keep bulk recipients readable on narrow screens. */
.mass-list{overflow-x:hidden!important;overflow-y:auto!important}
.mass-row{display:flex!important;align-items:center;gap:10px;min-width:0}
.mass-row input{flex:0 0 18px!important;width:18px!important;min-width:18px!important;height:18px;margin:0}
