:root{color-scheme:light;--bg:#f3f6fb;--surface:#fff;--ink:#1d2d44;--muted:#74829a;--primary:#2869d8;--soft:#e9f1ff;--border:#e2e8f0;--danger:#b91c1c;--green:#15975b;--shadow:0 8px 28px rgba(22,42,78,.07)}
*{box-sizing:border-box}body{font:14px/1.6 system-ui,-apple-system,'Segoe UI','Microsoft YaHei',sans-serif;color:var(--ink);background:var(--bg);margin:0}button,input,textarea,select{font:inherit}button{cursor:pointer;border:1px solid var(--border);background:var(--surface);color:var(--ink);border-radius:8px;padding:8px 12px}button:hover{background:#edf3fd}a{color:var(--primary)}input,textarea,select{border:1px solid #d7dfeb;background:var(--surface);padding:9px 11px;border-radius:9px;width:100%;min-width:0;outline:none;color:var(--ink)}input:focus,textarea:focus,select:focus{border-color:#5291ed;box-shadow:0 0 0 3px #dceaff}input[type=checkbox]{width:auto}textarea{resize:none}.hidden{display:none!important}.primary{background:var(--primary);border-color:var(--primary);color:#fff;font-weight:600}.primary:hover{background:#175bc9}.error{background:#feecec;color:var(--danger);padding:10px;border-radius:8px}.toast{display:none;position:fixed;z-index:50;bottom:24px;right:24px;background:#1c3555;color:white;padding:12px 20px;border-radius:10px;box-shadow:var(--shadow);max-width:min(90vw,460px)}.toast.show{display:block}
.login-view{min-height:100dvh;display:grid;place-items:center;padding:20px}.login-card{width:min(100%,390px);background:var(--surface);box-shadow:var(--shadow);border-radius:17px;padding:35px}.login-card h1{margin:5px 0 0}.login-card p{color:var(--muted);margin:4px 0 20px}.login-card label,.install label,dialog label{display:block;margin:12px 0}.login-card label input,.install label input,dialog label input{margin-top:5px}.login-card .primary{width:100%;margin-top:14px;padding:11px}.login-card small{display:block;text-align:center;color:var(--muted);margin-top:20px}.brandmark{font-size:29px;color:var(--primary)}
#registration-entry,#registration-back{display:block;width:100%;margin-top:12px}
#registration-result{overflow-wrap:anywhere;color:var(--green);margin-top:12px}
.layout{display:flex;height:100dvh;min-height:500px;overflow:hidden}.rail{width:215px;min-width:215px;background:linear-gradient(170deg,#172b48,#1c385b);color:#e9f2ff;display:flex;flex-direction:column;padding:20px 12px}.brand{font-size:17px;font-weight:700;margin:4px 7px 22px}.brand small{font-weight:400;font-size:10px;opacity:.75}.brand-icon{color:#70b5ff}.profile{display:flex;align-items:center;gap:10px;border-top:1px solid #ffffff22;border-bottom:1px solid #ffffff22;padding:14px 6px;margin-bottom:18px}.avatar{width:38px;height:38px;display:grid;place-items:center;border-radius:50%;color:#fff;background:#7c8fe9;font-size:19px}.profile small{display:block;color:#b5c5d9}.rail nav{display:grid;gap:4px}.rail .nav,.rail .quiet{text-align:left;border:0;color:#dae5f2;background:transparent;width:100%}.rail .nav:hover,.rail .nav.active{background:#2b66c3;color:white}.rail-bottom{margin-top:auto}.rail .quiet{font-size:12px;color:#c4d1e1}.workspace{flex:1;min-width:0}.chat-workspace{display:flex}.chat-list{width:290px;flex-shrink:0;border-right:1px solid var(--border);background:var(--surface);overflow-y:auto;padding:15px}.list-head{display:flex;justify-content:space-between;align-items:center}.list-head h2{font-size:17px;margin:0 0 15px}.list-head button{font-size:22px;border:0}.label-muted{margin:15px 0 8px;color:var(--muted);font-size:12px}.user-items{display:grid;gap:5px}.contact{display:flex;align-items:center;text-align:left;border:none;background:transparent;width:100%;padding:9px;border-radius:10px;gap:10px}.contact.selected{background:var(--soft)}.bubble-avatar{width:34px;height:34px;display:grid;place-items:center;background:#dce7ff;border-radius:50%;font-weight:650;color:#2f62ab}.contact-main{min-width:0;flex:1}.contact-name{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.contact-preview{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.count{background:#df3d4f;color:#fff;border-radius:16px;font-size:11px;padding:1px 6px}.conversation{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--chat-bg,#fafcff)}.conversation-head{background:var(--surface);border-bottom:1px solid var(--border);height:70px;display:flex;align-items:center;justify-content:space-between;padding:13px 23px}.conversation-head h2{margin:0;font-size:16px}.conversation-head small{color:var(--muted)}.status{color:var(--green);font-size:12px}.messages{min-height:0;flex:1;overflow:auto;padding:24px 30px;display:flex;flex-direction:column;gap:14px}.empty{color:var(--muted);align-self:center;margin:auto}.msg{display:flex;gap:8px;max-width:84%}.msg.mine{align-self:flex-end;flex-direction:row-reverse}.msg.theirs{align-self:flex-start}.msg-box{overflow-wrap:anywhere}.msg-content{white-space:pre-wrap;padding:10px 13px;border:1px solid var(--border);background:var(--surface);border-radius:14px;border-top-left-radius:4px}.mine .msg-content{background:var(--mine-bg,#dceaff);border:0;border-top-left-radius:14px;border-top-right-radius:4px}.msg-meta{color:var(--muted);font-size:11px;margin:4px 3px}.mine .msg-meta{text-align:right}.msg-image{display:block;max-width:260px;max-height:200px;border-radius:9px;margin:6px 0}.attachment-link{display:block;text-decoration:none;font-size:13px;padding:8px;border:1px solid #c9d8ec;border-radius:7px;margin-top:5px}.composer{display:flex;align-items:end;gap:9px;background:var(--surface);border-top:1px solid var(--border);padding:13px 20px}.attach{font-size:25px;cursor:pointer;color:var(--primary);padding:0 7px 3px}.send{min-width:70px}.upload-progress{margin:0 20px;padding:10px;background:#e8f2ff;border-radius:8px;font-size:12px}.mobile-back{display:none}
.panel{overflow:auto}.panel>header{height:70px;background:var(--surface);border-bottom:1px solid var(--border);padding:14px 28px}.panel h2{font-size:18px;margin:0}.panel-content{padding:23px 28px;max-width:1160px}.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:14px;margin-bottom:18px}.metric{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:17px}.metric strong{display:block;font-size:26px;color:var(--primary)}.metric small{color:var(--muted)}.box{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:18px;margin:12px 0;box-shadow:var(--shadow)}.box h3{margin:0 0 12px}.toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:12px}.toolbar>*{max-width:250px}.table-wrap{overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:13px}th,td{text-align:left;padding:9px;border-bottom:1px solid var(--border);white-space:nowrap}th{background:var(--soft);color:var(--ink)}td button{padding:4px 8px;font-size:12px;margin:0 2px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.form-grid label{display:block;font-weight:600}.form-grid input,.form-grid select{margin-top:5px}.actions{display:flex;gap:10px;justify-content:flex-end;margin-top:15px}.muted{color:var(--muted)}.danger{color:var(--danger)}.ok{color:var(--green)}.audit-msg{border-bottom:1px solid var(--border);padding:8px 0;white-space:pre-wrap}.install{max-width:600px;margin:6vh auto;padding:30px;background:var(--surface);border-radius:15px;box-shadow:var(--shadow)}.install h1{margin:0;font-size:22px}.install h2{font-size:17px}.install label{display:block}.install button{background:var(--primary);color:white;border:0;margin-top:12px}.install code{background:#eef2f7;padding:2px 5px}dialog{border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);width:min(95vw,440px);padding:22px}dialog::backdrop{background:#10243d88}

:where(html.mivchat-mobile-intermediate) .rail{width:170px;min-width:170px}
:where(html.mivchat-mobile-intermediate) .chat-list{width:250px}
:where(html.mivchat-mobile-intermediate) .brand{font-size:15px}
:where(html.mivchat-mobile-intermediate) .panel-content{padding:14px}


:where(html.mivchat-mobile-compact) .layout{display:block}
:where(html.mivchat-mobile-compact) .rail{position:absolute;bottom:0;left:0;right:0;width:auto;min-width:0;height:55px;padding:3px;flex-direction:row;z-index:4}
:where(html.mivchat-mobile-compact) .rail .brand,:where(html.mivchat-mobile-compact) .rail .profile,:where(html.mivchat-mobile-compact) .rail-bottom{display:none}
:where(html.mivchat-mobile-compact) .rail nav{display:flex;flex-direction:row;overflow:auto;width:100%;gap:0}
:where(html.mivchat-mobile-compact) .rail .nav{white-space:nowrap;font-size:11px;padding:6px 9px;text-align:center}
:where(html.mivchat-mobile-compact) .workspace{height:calc(100dvh - 55px)}
:where(html.mivchat-mobile-compact) .chat-list{width:100%;border:0}
:where(html.mivchat-mobile-compact) .conversation{display:none}
:where(html.mivchat-mobile-compact) .chat-workspace.in-conversation .chat-list{display:none}
:where(html.mivchat-mobile-compact) .chat-workspace.in-conversation .conversation{display:flex}
:where(html.mivchat-mobile-compact) .form-grid{grid-template-columns:1fr}
:where(html.mivchat-mobile-compact) .install{margin:12px; padding:20px}
:where(html.mivchat-mobile-compact) .nav.admin-nav{display:inline-block}
:where(html.mivchat-mobile-compact) .rail nav{align-items:center}


.green-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--green);flex-shrink:0}

/* 提示不遮挡发送；小屏仍可直接退出和修改密码。 */
.toast{pointer-events:none;bottom:auto;top:max(14px,env(safe-area-inset-top));right:14px}
.local-draft-note{font-size:11px;color:var(--muted);margin:4px 16px}
.pending-messages{max-height:180px;overflow:auto;margin:4px 14px;border:1px solid var(--border);border-radius:8px;background:var(--surface)}
.pending-message{padding:8px 10px;border-bottom:1px solid var(--border);overflow-wrap:anywhere;white-space:pre-wrap}
.pending-message>span{display:block;max-height:90px;overflow:auto}.pending-message>small{display:block}
.pending-actions{display:flex;gap:6px;margin-top:5px}.pending-actions button{padding:3px 9px;font-size:12px}

:where(html.mivchat-mobile-compact) .rail .rail-bottom{display:flex;flex-shrink:0;gap:2px;margin:0;align-items:center}
:where(html.mivchat-mobile-compact) .rail .rail-bottom .quiet{font-size:10px;width:auto;white-space:nowrap;padding:5px}
:where(html.mivchat-mobile-compact) .rail nav{width:auto;flex:1;min-width:0}
:where(html.mivchat-mobile-compact) .rail{padding-bottom:env(safe-area-inset-bottom);height:calc(55px + env(safe-area-inset-bottom))}
:where(html.mivchat-mobile-compact) .workspace{height:calc(100dvh - 55px - env(safe-area-inset-bottom))}

/* F08：复用原紧凑规则，桌面仅启用同一规则及520px容器。 */
:where(html.mivchat-mobile-compact) .mobile-back{display:block;border:0;font-size:26px;padding:0 12px 0 0}:where(html.mivchat-mobile-compact) .conversation-head{height:58px;padding:9px 14px}:where(html.mivchat-mobile-compact) .messages{padding:14px}:where(html.mivchat-mobile-compact) .msg{max-width:93%}:where(html.mivchat-mobile-compact) .composer{padding:9px}:where(html.mivchat-mobile-compact) .panel>header{height:58px}:where(html.mivchat-mobile-compact) .panel-content{padding:10px}:where(html.mivchat-mobile-compact) .local-draft-note{margin:3px 10px;font-size:10px}:where(html.mivchat-mobile-compact) .pending-messages{max-height:125px;margin:3px 9px}:where(html.mivchat-mobile-compact) .toast{font-size:12px}


/* RC2：日志筛选和统一结果提示；全部为本地 CSS */
.toast[data-kind="success"]{background:#176d4b!important}.toast[data-kind="error"]{background:#a72a38!important}.toast[data-kind="warning"]{background:#a46a17!important}.toast[data-kind="working"]{background:#264c75!important}
.log-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(138px,1fr));gap:8px;margin:12px 0 18px}.log-filters input,.log-filters select{min-width:0;max-width:100%;height:38px}.log-filters button{min-height:38px}button:disabled{opacity:.55;cursor:wait}@media(max-width:650px){.log-filters{grid-template-columns:1fr 1fr}.log-filters button{grid-column:span 1}}

/* 原生预览对话框，移动端限制在视口内。 */
#guest-entry{display:block;text-align:center;margin-top:12px}#guest-entry.hidden{display:none}
#paste-preview,#image-full{display:block;max-width:100%;max-height:70dvh;object-fit:contain;margin:12px auto}
#image-dialog{max-width:95vw}.msg-image{cursor:zoom-in}dialog{max-width:min(94vw,760px)}


/* 原生大图查看器覆盖通用dialog的表单宽度，触控仅作用于图片。 */
#image-dialog{width:94vw;max-width:94vw;height:92dvh;max-height:94dvh;overflow:auto;padding:16px;background:#142030;color:white}
#image-full{display:block;max-width:100%;max-height:calc(86dvh - 72px);width:auto;height:auto;margin:16px auto;touch-action:none;transform-origin:center;cursor:grab}
#image-full.original-size{max-width:none;max-height:none}
.drag-active{outline:3px dashed #397df0;outline-offset:-6px}

.image-toolbar{display:flex;gap:8px;align-items:center;position:sticky;top:0;z-index:10;background:#142030;padding:4px}.image-toolbar a{margin-left:auto;color:white}.image-stage{position:relative;overflow:auto;height:calc(100% - 56px)}

/* 网络故障只占一个状态区；不遮挡导航、在线状态或消息输入。 */
.sync-status{position:fixed;z-index:55;top:8px;left:50%;transform:translateX(-50%);display:flex;gap:8px;align-items:center;max-width:min(92vw,820px);padding:8px 12px;background:var(--surface)3cd;border:1px solid #cba75a;border-radius:9px;color:#62470b;box-shadow:var(--shadow);overflow-wrap:anywhere}.sync-status button{flex-shrink:0}.brand{display:flex;flex-wrap:wrap;gap:5px;white-space:normal;overflow-wrap:anywhere}.brand small{width:100%;padding-left:20px}.site-name{overflow-wrap:anywhere}.row-actions{display:flex;gap:5px;flex-wrap:wrap}.profile-editor{display:grid;gap:7px;min-width:180px}
@media(max-width:480px){.sync-status{font-size:12px;max-height:22dvh;overflow:auto;align-items:flex-start}.sync-status button{padding:6px}.row-actions button{min-height:44px}.profile-editor{min-width:140px}}

/* 两端附件入口采用同一可键盘操作的44px蓝色加号。 */
.composer .attach{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;min-height:44px;flex-shrink:0;padding:0;border:1px solid #b7cef5;border-radius:8px;background:#e9f1ff;color:#175bc9;font-size:28px;font-weight:400;line-height:1}
.composer .attach:focus-visible{outline:3px solid #2869d8;outline-offset:2px}
@media(prefers-color-scheme:dark){:where(:root:not([data-theme])) .composer .attach{background:#193657;color:#94c5ff;border-color:#5f86b7}}:where(:root[data-theme="dark"]) .composer .attach{background:#193657;color:#94c5ff;border-color:#5f86b7}

/* 菜单图标独立占位，长标签换行后与首行文字起点一致；保留移动横向滚动。 */
.rail .nav{display:flex;align-items:flex-start;gap:8px}
.rail .nav .nav-icon{flex:0 0 1em;text-align:center}


:where(html.mivchat-mobile-compact) .rail .nav{display:inline-flex;align-items:center}

/* RC5.3.2 grouped navigation and transient login states. */
.mfa-hidden{display:none!important}.subnav{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:12px}.subnav button{padding:6px 10px;font-size:13px}.subnav .active{background:#357bd5;color:white}.profile-actions{margin-top:auto}.profile-actions summary{cursor:pointer;list-style:none}.profile-actions .profile{margin:0;padding:8px 0}.profile-actions button{width:100%}.rail nav .nav{min-height:44px}.composer .attach{background:transparent;border:0;box-shadow:none}.msg-content{overflow:visible}#toaster{cursor:pointer;pointer-events:auto}
:where(html.mivchat-mobile-narrow) .rail nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;overflow:visible}
:where(html.mivchat-mobile-narrow) .rail nav .nav{min-width:0;justify-content:center;padding:8px 4px;flex-direction:row;font-size:13px}
:where(html.mivchat-mobile-narrow) .rail nav .nav.hidden{display:none}
:where(html.mivchat-mobile-narrow) .rail-bottom{position:fixed;right:8px;top:4px;z-index:15;max-width:200px;background:var(--panel,#fff);border-radius:8px}
:where(html.mivchat-mobile-narrow) .rail-bottom:not([open]) .profile{padding:2px}
:where(html.mivchat-mobile-narrow) .rail-bottom:not([open]) #my-name,:where(html.mivchat-mobile-narrow) .rail-bottom:not([open]) #my-role{display:none}
:where(html.mivchat-mobile-narrow) .rail-bottom[open]{padding:8px}
:where(html.mivchat-mobile-narrow) .subnav{gap:3px}
:where(html.mivchat-mobile-narrow) .subnav button{font-size:12px;padding:5px 7px}


#sync-error-dismiss{display:inline-block}

/* 跟随系统主题；组件使用同一组颜色，原浅色布局保持。 */
@media(prefers-color-scheme:dark){:root:where(:not([data-theme])){color-scheme:dark;--bg:#101b2a;--surface:#172639;--chat-bg:#111f30;--mine-bg:#21436b;--ink:#e1eaf6;--muted:#a8b8ce;--primary:#4a8be6;--soft:#263e5d;--border:#354b65;--danger:#ff9ca5;--green:#72d6a8;--shadow:0 8px 28px #0004}:where(:root:not([data-theme])) button:hover{background:#29425e}:where(:root:not([data-theme])) input,:where(:root:not([data-theme])) textarea,:where(:root:not([data-theme])) select{border-color:var(--border)}:where(:root:not([data-theme])) .msg-content{border-color:var(--border)}:where(:root:not([data-theme])) .profile-actions{color:var(--ink)}:where(:root:not([data-theme])) .bubble-avatar{background:#294974;color:#c2d9ff}:where(:root:not([data-theme])) .error{background:#562a37}:where(:root:not([data-theme])) .profile-actions[open]{background:var(--surface)}}:root:where([data-theme="dark"]){color-scheme:dark;--bg:#101b2a;--surface:#172639;--chat-bg:#111f30;--mine-bg:#21436b;--ink:#e1eaf6;--muted:#a8b8ce;--primary:#4a8be6;--soft:#263e5d;--border:#354b65;--danger:#ff9ca5;--green:#72d6a8;--shadow:0 8px 28px #0004}:where(:root[data-theme="dark"]) button:hover{background:#29425e}:where(:root[data-theme="dark"]) input,:where(:root[data-theme="dark"]) textarea,:where(:root[data-theme="dark"]) select{border-color:var(--border)}:where(:root[data-theme="dark"]) .msg-content{border-color:var(--border)}:where(:root[data-theme="dark"]) .profile-actions{color:var(--ink)}:where(:root[data-theme="dark"]) .bubble-avatar{background:#294974;color:#c2d9ff}:where(:root[data-theme="dark"]) .error{background:#562a37}:where(:root[data-theme="dark"]) .profile-actions[open]{background:var(--surface)}

:where(html.mivchat-mobile-narrow) .rail .profile-actions{display:block;bottom:auto;left:auto;right:8px;top:4px;color:var(--ink);background:var(--surface)}
:where(html.mivchat-mobile-narrow) .rail .profile-actions .profile{display:flex;min-height:40px}
:where(html.mivchat-mobile-narrow) .rail .profile-actions summary{min-width:40px;min-height:40px}
:where(html.mivchat-mobile-narrow) .rail .profile-actions .quiet{color:var(--ink);width:100%;min-height:40px}
:where(html.mivchat-mobile-narrow) .conversation-head{padding-right:60px}
:where(html.mivchat-mobile-narrow) .conversation-head>div{min-width:0}
:where(html.mivchat-mobile-narrow) .conversation-head h2{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
:where(html.mivchat-mobile-narrow) .panel>header{padding-right:60px}
:where(html.mivchat-mobile-narrow) .list-head{padding-right:44px}
:where(html.mivchat-mobile-narrow) .list-head #enable-notifications{font-size:13px;min-height:40px}


.settings-group{border:1px solid var(--border);border-radius:8px;margin:12px 0;padding:8px 12px;min-width:0}.settings-group legend{font-size:13px;font-weight:600;padding:0 5px}.settings-group .form-grid{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}.settings-group label{min-width:0}.profile-dialog{width:min(92vw,440px)}.profile-dialog .profile-editor{display:block;min-width:0}.profile-editor label{display:block;margin:10px 0}.profile-editor input{display:block;margin-top:4px}.profile-editor .actions{justify-content:flex-end}
:where(html.mivchat-mobile-compact) .settings-group .form-grid{grid-template-columns:1fr}
:where(html.mivchat-mobile-compact) .settings-group{padding:6px 8px}


.notification-services-grid,.notification-binding-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:16px 0}.notification-card{min-width:0;margin:0}.notification-card summary{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;min-height:36px}.notification-card form{margin-top:12px}.notification-card .form-grid{grid-template-columns:minmax(0,1fr)}.notification-card label{min-width:0}.notification-card input,.notification-card select{min-width:0;max-width:100%}.notification-toggle{display:flex!important;align-items:center;gap:8px}.notification-toggle input{width:auto}.notification-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.notification-actions button{min-height:36px}.notification-result{overflow-wrap:anywhere;min-height:20px}.notification-card small{display:block;font-weight:400}.notification-confirm{border-top:1px solid var(--border,#8191a6);margin-top:12px;padding-top:12px}.notification-diagnostics .table-wrap{margin-top:12px}
:where(html.mivchat-mobile-intermediate) .notification-services-grid,:where(html.mivchat-mobile-intermediate) .notification-binding-grid{grid-template-columns:minmax(0,1fr)}


/* 固定大小的通知铃铛与版本标记，不由状态文案改变布局。 */
.list-head .push-bell{width:44px;height:44px;min-width:44px;min-height:44px;flex:0 0 44px;padding:10px;display:inline-flex;align-items:center;justify-content:center;border:0;background:transparent;box-shadow:none;color:#7b8490}
.list-head .push-bell.is-on{color:#18854c}.push-bell svg{flex:none}.push-bell:focus-visible{outline:2px solid #438ce0;outline-offset:1px}.push-bell[aria-busy=true]{opacity:.6}
#app-version{white-space:nowrap;flex-shrink:0;font-variant-numeric:tabular-nums;font-size:11px;letter-spacing:0}.brand #sidebar-site-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(prefers-color-scheme:dark){:where(:root:not([data-theme])) .list-head .push-bell{color:#a7afbb}:where(:root:not([data-theme])) .list-head .push-bell.is-on{color:#66d89b}}:where(:root[data-theme="dark"]) .list-head .push-bell{color:#a7afbb}:where(:root[data-theme="dark"]) .list-head .push-bell.is-on{color:#66d89b}

/* 紧凑输入区与单列推送配置。 */
.composer{gap:4px;align-items:center;flex-wrap:nowrap}.composer textarea{min-width:0;flex:1}.composer button[type=submit]{width:64px;min-width:64px;height:44px;padding:4px;flex:0 0 64px}.notification-services-grid,.notification-binding-grid{display:grid;grid-template-columns:1fr!important}.notification-card summary{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;min-height:44px}.system-message small{font-style:italic}.settings-group textarea{width:100%;min-height:80px}

.avatar-photo{width:100%;height:100%;border-radius:inherit;object-fit:cover;display:block}.avatar-preview{display:inline-grid;width:72px;height:72px;font-size:30px;overflow:hidden}.avatar-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:12px 0}.avatar-grid button{padding:4px;min-width:44px;min-height:44px}.avatar-grid img{display:block;margin:auto;max-width:100%;border-radius:10px}.avatar-dialog{max-width:min(94vw,440px)}.avatar-dialog input{max-width:100%}.bubble-avatar{overflow:hidden;flex-shrink:0}

.notification-log-policy{display:grid;gap:8px}.notification-log-policy label{display:grid;gap:4px}.notification-log-policy input{max-width:100%;width:200px}.notification-log-policy button{max-width:100%}

#refresh-chat{min-width:44px;min-height:44px}#refresh-chat.is-refreshing{cursor:wait}@keyframes chat-refresh-spin{to{transform:rotate(360deg)}}

/* 好友仅占用原聊天侧栏及轻量面板，窄屏换行。 */
.friend-dialog{width:min(620px,calc(100vw - 24px));max-height:85dvh;overflow:auto;box-sizing:border-box}
.friend-tabs{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0}
.friend-tabs button[aria-pressed="true"]{outline:2px solid var(--accent,#4684de)}
.friend-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:12px 0;border-bottom:1px solid var(--line,#8884)}
.friend-name{display:flex;flex:1;min-width:100px;flex-direction:column;overflow-wrap:anywhere}.friend-row small{max-width:100%;overflow-wrap:anywhere}
.friend-dialog input:not([type="checkbox"]){max-width:100%;box-sizing:border-box}.friend-dialog form{display:flex;align-items:end;gap:8px;flex-wrap:wrap}.friend-dialog label{max-width:100%}
#friend-pending{position:absolute;right:-3px;top:-5px;font-size:10px}#friend-requests{position:relative}#friend-add,#friend-requests{flex-shrink:0}

.friend-dialog{max-width:92vw;border:1px solid #91a5c2;border-radius:14px;padding:18px;color:inherit;background:#fff}.friend-dialog button{min-width:44px;min-height:44px;margin:4px}.friend-dialog::backdrop{background:#0006}.friend-dialog p{overflow-wrap:anywhere;white-space:pre-wrap}@media(max-width:390px){.friend-dialog{padding:12px}}@media(prefers-color-scheme:dark){:where(:root:not([data-theme])) .friend-dialog{background:#182941;color:#e2ebfc}}:where(:root[data-theme="dark"]) .friend-dialog{background:#182941;color:#e2ebfc}

.conversation-entry{display:grid;grid-template-columns:minmax(0,1fr) minmax(66px,max-content);grid-template-rows:auto auto;column-gap:5px;position:relative;align-items:stretch;min-width:0}.conversation-entry>.contact{grid-column:1;grid-row:1 / span 2;min-width:0;min-height:0;display:grid;grid-template-columns:34px minmax(0,1fr);gap:10px;padding-inline-end:6px}.conversation-entry{border-radius:10px}.conversation-entry.selected{background:var(--soft)}.conversation-entry>.contact.selected,.conversation-entry>.contact:active{background:transparent}.conversation-entry>.contact>.contact-main{display:grid;grid-template-rows:auto auto;row-gap:2px;align-items:center;min-height:0}.conversation-entry .contact-name{line-height:20px}.conversation-entry>.conversation-recent-time{grid-column:2;grid-row:1;justify-self:end;align-self:start;margin:9px 9px 0 0}.conversation-list-actions{grid-column:2;grid-row:2;justify-self:end;align-self:end;display:grid;grid-template-columns:36px 24px;gap:2px;align-items:center;margin:0 4px 8px 0;height:24px}.conversation-menu{position:relative;z-index:3}.conversation-menu>summary{list-style:none;cursor:pointer;display:block;padding:1px 2px;font-size:20px;line-height:1;color:var(--muted)}.conversation-menu>summary::-webkit-details-marker{display:none}.conversation-menu>summary:focus-visible{outline:2px solid var(--primary)}.conversation-menu>button{position:absolute;inset-inline-end:0;top:100%;white-space:nowrap;max-width:85vw;background:var(--surface);box-shadow:var(--shadow);z-index:4}.admin-friend-dialog{width:min(92vw,600px)}.admin-friend-dialog input{max-width:100%}.admin-friend-dialog .friend-row{overflow-wrap:anywhere}.image-toolbar #image-close{margin-inline-start:auto;order:99;min-width:44px;min-height:44px}.audit-history-messages{overflow-wrap:anywhere}
.image-toolbar{padding-inline-end:56px;min-height:52px}.image-toolbar #image-close{position:absolute;inset-block-start:4px;inset-inline-end:4px;margin:0;width:44px;height:44px}

.mivchat-android #enable-notifications{display:none!important}

/* 仅移动在线标记；头像图片的原有替换逻辑保持独立。 */
.contact-avatar{position:relative;display:inline-flex;flex-shrink:0;overflow:visible}.contact-avatar .green-dot{position:absolute;right:-1px;bottom:-1px;border:2px solid var(--surface);width:10px;height:10px;box-sizing:content-box;z-index:1}.friend-dialog .dialog-titlebar .dialog-close{margin-inline-start:auto;order:99;align-self:flex-start}.notification-card form{display:grid;gap:12px}.notification-card .notification-actions{margin-top:0;align-items:center}.notification-card .notification-actions button{min-height:44px}.notification-card input:not([type=checkbox]),.notification-card select{min-height:42px}.notification-card .notification-toggle{margin:0}.notification-diagnostics td{white-space:normal;overflow-wrap:anywhere;min-width:90px}.notification-diagnostics .table-wrap{max-width:100%}.composer .attach.on{color:var(--danger);outline:1px solid var(--danger);border-radius:8px}

/* T05：局部搜索表单对齐，不更改好友请求或其他面板布局。 */
.friend-dialog .friend-search-form{display:flex;align-items:flex-end;gap:8px;flex-wrap:nowrap}
.friend-dialog .friend-search-form label{display:grid;gap:5px;flex:1;min-width:0;margin:0}
.friend-dialog .friend-search-form input{width:100%;height:44px;margin:0}
.friend-dialog .friend-search-form>button{flex:0 0 auto;min-height:44px;height:44px;margin:0;padding:6px 14px}
@media(max-width:300px){.friend-dialog .friend-search-form{flex-wrap:wrap}}
/* F07：两枚按钮跨端共用原SVG、22px轮廓及44px点击区域。 */


 .list-head #friend-requests,.list-head #refresh-chat{display:inline-flex;align-items:center;justify-content:center;position:relative;width:44px;height:44px;min-width:44px;min-height:44px;flex:0 0 44px;padding:10px;border:0;background:transparent;color:var(--muted)}
 .list-head .list-icon{display:block;width:22px;height:22px;flex:none}
 .list-head #refresh-chat>.list-icon{width:20px;height:20px}
 .list-head #friend-requests:hover,.list-head #refresh-chat:hover{background:var(--soft)}
 .list-head #friend-requests:focus-visible,.list-head #refresh-chat:focus-visible{outline:2px solid var(--primary);outline-offset:0}
 .list-head #friend-pending{right:0;top:0;z-index:2;pointer-events:auto}
 #refresh-chat.is-refreshing>.list-icon{animation:chat-refresh-spin .9s linear infinite}

@media(prefers-reduced-motion:reduce){#refresh-chat.is-refreshing>.list-icon{animation:none}}
/* F05/F08：共用现有C-右移动布局，不复制页面或个人中心。 */
.me-nav-icon{width:22px;height:22px;flex:none}.me-account{display:flex;align-items:center;gap:16px;padding:20px;background:var(--surface);border:1px solid var(--border);border-radius:14px;margin:0 0 16px}
.me-avatar{width:56px;height:56px;flex:0 0 56px;font-size:28px}.me-account>div{display:flex;flex-direction:column;gap:5px;min-width:0}.me-account strong{overflow-wrap:anywhere}.me-account small{color:var(--muted)}
.me-actions{display:grid;gap:0;max-width:100%;background:var(--surface);border:1px solid var(--border);border-radius:14px;overflow:hidden}
.me-actions .me-action{display:flex;align-items:center;gap:14px;width:100%;min-height:56px;text-align:left;margin:0;padding:12px 16px;border:0;border-bottom:1px solid var(--border);border-radius:0;color:var(--ink);background:transparent}
.me-action-icon{display:inline-flex;width:24px;height:24px;flex:0 0 24px;color:var(--primary)}.me-action-icon svg{width:24px;height:24px}.me-chevron{margin-inline-start:auto;color:var(--muted);font-size:24px}
.me-actions #logout{margin-top:12px;color:var(--danger);border-top:1px solid var(--border);border-bottom:0}.me-actions #logout .me-action-icon{color:inherit}
.mivchat-mobile-web .layout{display:block}.mivchat-mobile-web .rail{position:fixed;inset:auto 0 0;width:auto;min-width:0;height:calc(55px + env(safe-area-inset-bottom));padding:0 0 env(safe-area-inset-bottom);display:flex;flex-direction:row;z-index:4}
.mivchat-mobile-web .rail .brand,.mivchat-mobile-web .rail .profile-actions{display:none!important}
.mivchat-mobile-web .rail nav{display:flex;align-items:stretch;width:100%;height:55px;gap:0;overflow:visible}
.mivchat-mobile-web .rail nav .nav{flex:1;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;min-width:44px;min-height:44px;padding:4px 2px;font-size:12px;line-height:16px}
.mivchat-mobile-web .rail nav .nav>span:first-child{font-size:22px;line-height:22px}.mivchat-mobile-web .rail nav .nav.hidden{display:none}
.mivchat-mobile-web .workspace{height:calc(100dvh - 55px - env(safe-area-inset-bottom))}.mivchat-mobile-web .chat-list{width:100%;border:0}.mivchat-mobile-web .conversation{display:none}.mivchat-mobile-web .chat-workspace.in-conversation .chat-list{display:none}.mivchat-mobile-web .chat-workspace.in-conversation .conversation{display:flex}
.mivchat-mobile-web .conversation-head{padding-right:14px}.mivchat-mobile-web .list-head{padding-right:0}.mivchat-mobile-web .panel>header{padding-right:14px}

/* T06：仅临时上传气泡，沿用.msg.mine/.msg-content的原颜色、圆角、宽度限制。 */
.upload-card{min-width:0}.upload-card .msg-content{width:min(340px,calc(100vw - 92px));box-sizing:border-box;min-width:0;max-width:100%;white-space:normal}
.upload-file-title{display:flex;gap:10px;align-items:flex-start;min-width:0}.upload-file-icon{display:inline-flex;flex:0 0 24px}.upload-file-icon svg{width:24px;height:24px}.upload-file-name{min-width:0;overflow-wrap:anywhere;font-size:14px}
.upload-file-size,.upload-file-count,.upload-file-error{display:block;overflow-wrap:anywhere;font-size:11px;margin-top:4px}.upload-file-status{font-size:12px;margin:8px 0 5px}.upload-file-progress{display:block;width:100%;height:4px;accent-color:var(--primary);margin:0;border:0}.upload-file-actions{display:flex;gap:6px;margin-top:7px}.upload-file-actions button{min-width:44px;min-height:32px;padding:4px 8px;font-size:12px}.upload-waiting-confirmation{display:none!important}

.mobile-nav-icon{display:none}.mivchat-mobile-web .rail nav .desktop-nav-icon{display:none}.mivchat-mobile-web .rail nav .mobile-nav-icon{display:block;width:22px;height:22px;flex:none}

.upload-file-status,.upload-file-count{font-variant-numeric:tabular-nums}

/* F06：仅收到的待处理申请行增加状态标记。 */
.friend-pending-marker{color:var(--primary);font-size:12px;font-weight:600}

.mivchat-desktop-mobile .layout{max-width:520px;margin-inline:auto}
.mivchat-desktop-mobile .rail{inset-inline:max(0px,calc((100vw - 520px)/2))}
.mivchat-desktop-mobile .friend-dialog{max-width:calc(min(100vw,520px) - 24px)}

/* 会话日期和操作按实际内容自然排布。 */
.conversation-recent-time{display:block;font-size:10px;line-height:12px;text-align:end;white-space:nowrap;color:var(--muted);pointer-events:none}.local-draft-note>summary{cursor:pointer;width:fit-content}.local-draft-note>summary:focus-visible{outline:2px solid var(--primary)}

/* v1.0.0：只调整聊天头部返回分组；原会话行、气泡和连接状态保持。 */
.conversation-return-group{display:flex;align-items:center;gap:10px;min-width:0;flex:1}.conversation-peer{min-width:0}.conversation-peer h2,.conversation-peer small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conversation-head>.status{flex:none;margin-inline-start:10px;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mivchat-mobile-web .conversation-return-group>.mobile-back{display:grid;place-items:center;flex:0 0 44px;min-width:44px;min-height:44px;padding:0;border:0;font-size:26px}

/* v1.0.2: text width is independent of the sender/time/receipt metadata row. */
.msg-box{display:flex;flex-direction:column;min-width:0;max-width:100%}
.msg.mine .msg-box{align-items:flex-end}.msg:not(.mine) .msg-box{align-items:flex-start}
.msg-content{width:fit-content;max-width:100%;box-sizing:border-box}
/* Existing upload-card width remains the more specific attachment exception. */

.pending-actions button,.rail button,button,summary,[role=button],select,input:not([type=hidden]):not([type=checkbox]):not([type=radio]){min-height:44px}
button,[role=button]{min-width:44px}
.avatar-grid{max-height:min(46dvh,380px);overflow-y:auto;padding:4px;scrollbar-gutter:stable}
.avatar-grid button{margin:0;border:2px solid transparent}
.avatar-grid button[aria-pressed=true]{border-color:var(--primary,#2869d8);background:#4d91ed22}
.avatar-grid button:focus-visible{outline:2px solid var(--primary,#2869d8);outline-offset:1px}
@media(min-width:681px){:where(html:not(.mivchat-desktop-mobile)) .avatar-grid{grid-template-columns:repeat(6,minmax(0,1fr))}}

/* Explicit compact disclosure exception on both mouse and touch; other targets retain 44px. */
#pending-help>summary{min-height:0;line-height:20px;padding-block:2px}

.device-sessions{min-width:0;max-width:100%}.device-sessions .table-wrap{max-width:100%}.device-sessions table{table-layout:auto;width:max-content;min-width:100%}.device-sessions td,.device-sessions th{white-space:nowrap;overflow-wrap:normal}.device-sessions button{white-space:nowrap}

/* Reserve the full disclosure target below the time. */
.conversation-entry>.contact::after{content:"";position:absolute;inset:0}
.conversation-entry .conversation-list-actions{height:44px;margin-bottom:0}
.conversation-entry .conversation-menu{width:24px;height:44px}
.conversation-entry .conversation-menu>summary{position:absolute;inset:0 -10px;display:grid;place-items:center;min-width:44px;min-height:44px;padding:0}
.conversation-entry .conversation-menu[open]{z-index:5}
.conversation-unread-slot{display:flex;align-items:center;justify-content:center;min-width:0;height:24px;pointer-events:none}
.conversation-unread-slot>.count{white-space:nowrap;line-height:16px;font-variant-numeric:tabular-nums}
.conversation-entry .e2ee-contact-name{display:flex;align-items:center;gap:5px;min-width:0}
.e2ee-name-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.conversation-entry .e2ee-inline-lock.e2ee-indicator{display:inline-grid;place-items:center;flex:0 0 14px;width:14px;height:14px;min-width:0;min-height:0;margin:0;padding:0;--e2ee-glyph-size:14px}

/* Configuration backup child page only; chat and navigation geometry are unchanged. */
.configuration-backups{display:grid;gap:16px;max-width:1100px}.configuration-backups .box{margin:0}.backup-statistics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.backup-statistics article{display:grid;gap:10px}.backup-statistics strong{font-size:20px}.backup-toggle{display:flex;align-items:center;gap:10px}.backup-toggle input{width:auto}.backup-settings-form,.backup-restore-form{display:grid;gap:12px}.backup-settings-form h3,.backup-history h3,.configuration-restore h3{margin-top:0}.backup-record{display:grid;grid-template-columns:minmax(160px,2fr) repeat(3,minmax(70px,1fr)) auto;gap:12px;align-items:center;padding:16px 0;border-top:1px solid var(--border)}.backup-record-field{display:grid;gap:6px;min-width:0;overflow-wrap:anywhere}.backup-record-actions{display:flex;gap:6px;flex-wrap:wrap}.backup-record-error{grid-column:1/-1;margin:0}.backup-record-version{grid-column:1/-1}.backup-eligible{color:var(--green)}.configuration-restore input[type=file]{max-width:100%}.backup-result{max-width:min(92vw,480px)}.backup-restore-feedback{overflow-wrap:anywhere}

:where(html.mivchat-mobile-compact) .backup-statistics{gap:8px}
:where(html.mivchat-mobile-compact) .backup-statistics .box{padding:12px}
:where(html.mivchat-mobile-compact) .backup-statistics strong{font-size:16px}
:where(html.mivchat-mobile-compact) .backup-records{display:grid;gap:12px}
:where(html.mivchat-mobile-compact) .backup-record{grid-template-columns:repeat(2,minmax(0,1fr));padding:14px;border:1px solid var(--border);border-radius:12px}
:where(html.mivchat-mobile-compact) .backup-record-actions{grid-column:1/-1}
:where(html.mivchat-mobile-compact) .configuration-backups .actions{flex-wrap:wrap}
:where(html.mivchat-mobile-compact) .backup-record-field:first-child{grid-column:1/-1}


/* v2.0.1: scoped notification controls; other log forms retain their layout. */
.notification-log-filters{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px;margin:16px 0}
.notification-log-filters>label{flex:1 1 180px;min-width:0;display:flex;flex-direction:column;gap:6px}
.notification-log-filters select{width:100%;min-width:0;min-height:44px}
.notification-filter-actions{display:flex;gap:8px;flex-wrap:wrap}
.notification-filter-actions button{min-height:44px}
@media(max-width:480px){.notification-log-filters>label{flex-basis:100%}.notification-filter-actions{width:100%}.notification-filter-actions button{flex:1}}

.brand-icon{display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;flex-shrink:0}

/* 2.1.0 配置备份：独立同级页，首次配置引导。 */
.backup-setup-notice{border-left:3px solid var(--accent,#357bd5);padding:12px 16px;font-weight:600}

.fcm-attempts summary{min-width:44px;min-height:44px;align-content:center;cursor:pointer;white-space:nowrap}
.fcm-attempts-content{min-width:min(13rem,55vw);white-space:normal;overflow-wrap:anywhere}
.fcm-attempt{border-top:1px solid var(--border);padding:.5rem 0}
.fcm-attempt ul{margin:.4rem 0;padding-inline-start:1.2rem}

.notification-card .fcm-admin-layout {
  display:grid;grid-template-columns:minmax(0,1fr);gap:14px;min-width:0;
  container-type:inline-size;
}
.fcm-subcard {
  min-width:0;display:grid;gap:10px;padding:16px;border:1px solid var(--border);
  border-radius:12px;background:var(--surface);overflow-wrap:anywhere;
}
.fcm-subcard h3,.fcm-subcard p,.fcm-subcard pre,.fcm-subcard dl,.fcm-disclosure h3,.fcm-disclosure p {margin:0}
.fcm-subcard h3,.fcm-disclosure h3 {font-size:1rem;color:var(--ink)}
.fcm-subcard small {font-size:.86em;margin-top:3px}
.fcm-device-controls {display:inline-flex;align-items:stretch;gap:8px;max-width:100%;min-width:0}
.fcm-device-controls>button {min-width:0;white-space:normal;overflow-wrap:anywhere}
.fcm-subcard .fcm-switch-row,.notification-card .fcm-switch-row,.backup-settings-form .backup-toggle {
  display:flex;justify-content:space-between;gap:12px;align-items:center;min-height:44px;margin:0;cursor:pointer;
}
.notification-card input[type=checkbox].fcm-switch,.backup-settings-form input[type=checkbox].fcm-switch {
  appearance:none;width:44px;height:25px;flex:none;padding:0;margin:0;border:1px solid var(--border);
  border-radius:99px;background:var(--border);position:relative;cursor:pointer;
}
.notification-card input[type=checkbox].fcm-switch:checked,.backup-settings-form input[type=checkbox].fcm-switch:checked {background:var(--primary);border-color:var(--primary)}
.backup-settings-form .backup-toggle {display:flex}
.fcm-switch::before {
  content:"";position:absolute;inset-block-start:2px;inset-inline-start:2px;width:19px;height:19px;
  border-radius:50%;background:white;box-shadow:0 1px 3px #0003;
}
.fcm-switch:checked::before {inset-inline-start:21px}
.fcm-protocol {background:linear-gradient(var(--bg),var(--surface))}
.fcm-mode-options {min-width:0;margin:0;padding:0;border:0;display:grid;gap:8px}
.fcm-mode-options legend {font-weight:700;padding:0;margin-bottom:8px}
.fcm-mode-option {
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:8px;
  min-height:44px;margin:0;padding:10px;border:1px solid var(--border);border-radius:9px;background:var(--surface);cursor:pointer;
}
.fcm-mode-option:has(input:checked) {background:var(--soft);border-color:var(--primary)}
.fcm-mode-option:focus-within,.fcm-switch:focus-visible {outline:2px solid var(--primary);outline-offset:2px}
.notification-card .fcm-mode-option input[type=radio] {
  width:17px;height:17px;min-height:0;margin:3px 0 0;padding:0;accent-color:var(--primary);
}
.fcm-recommended,.fcm-format {width:max-content;border-radius:5px;padding:3px 6px;font-size:.8em;font-weight:700}
.fcm-recommended {background:color-mix(in srgb,var(--green),transparent 86%);color:var(--green)}
.fcm-format {max-width:100%;background:var(--soft);color:var(--ink)}
.fcm-subcard .fcm-risk,.fcm-technical-section .fcm-callout {
  padding:10px;border:1px solid var(--border);border-radius:8px;background:var(--bg);font-size:.88em;
}
.fcm-subcard .fcm-risk {background:color-mix(in srgb,var(--surface),#f1b145 14%);color:var(--ink)}
.fcm-routes {display:grid}
.fcm-route {
  display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;padding:8px 0;
  border-block-end:1px solid var(--border);
}
.fcm-route:last-child {border-block-end:0}
.fcm-device-preview,.fcm-section-title {display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.fcm-device-preview select {flex:1 0 150px}
.fcm-section-title button {min-height:44px}
.fcm-technical-section .fcm-config-json {
  overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;background:#182941;color:#dbeaff;border-radius:8px;padding:12px;margin:0;
}
.fcm-rules {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:8px;font-size:.9em}
.fcm-rules dt {color:var(--muted)}
.fcm-rules dd {margin:0}
.fcm-admin-layout button,.notification-card [data-fcm-refresh] {min-height:44px;max-width:100%;overflow-wrap:anywhere}
.fcm-admin-layout .notification-result:empty {display:none}
.fcm-admin-layout .notification-actions {margin:0}
.fcm-admin-layout .fcm-save {justify-content:flex-end;border-top:1px solid var(--border);padding-top:12px}
.fcm-credential-status {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.fcm-credential-status>div {display:flex;flex-direction:column;gap:5px;min-width:0;padding:9px;border:1px solid var(--border);border-radius:8px;background:var(--bg);font-size:12px}
.fcm-credential-status dd {margin:0;font-weight:650;overflow-wrap:anywhere}
.fcm-disclosure {min-width:0;padding:0 13px;border:1px solid var(--border);border-radius:10px;background:var(--surface);overflow-wrap:anywhere}
.notification-card .fcm-disclosure>summary {min-height:50px;gap:8px;list-style:none}
.fcm-disclosure>summary::-webkit-details-marker {display:none}
.fcm-disclosure>summary::before {content:"▸";color:var(--muted)}
.fcm-disclosure[open]>summary::before {content:"▾"}
.fcm-disclosure>summary>strong {flex:1}
.fcm-disclosure-status {max-width:50%;padding:3px 6px;border:1px solid var(--border);border-radius:6px;background:var(--bg);color:var(--muted);font-size:12px;text-align:end}
.fcm-disclosure-body {display:grid;grid-template-columns:minmax(0,1fr);gap:10px;border-top:1px solid var(--border);padding:12px 0}
.fcm-disclosure-body label input {width:100%}
.fcm-disclosure-body [data-fcm-credential-sources] {background:var(--bg)}
.fcm-technical-section {display:grid;gap:8px;padding-bottom:12px;border-bottom:1px solid var(--border)}
.fcm-technical-section:last-child {padding-bottom:0;border-bottom:0}
@container(max-width:470px){
  .fcm-admin-layout>.fcm-subcard {padding:11px}
  .fcm-mode-option {grid-template-columns:auto minmax(0,1fr)}
  .fcm-recommended {grid-column:2}
  .fcm-credential-status {grid-template-columns:minmax(0,1fr)}
  .fcm-credential-status>div {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center}
  .fcm-credential-status dd {text-align:end}
  .fcm-admin-layout .notification-actions button {flex:1 1 115px}
}
.backup-settings-actions{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;border-top:1px solid var(--border);padding-top:12px}
.backup-settings-note{margin:0;min-width:0;flex:1 1 24rem;overflow-wrap:anywhere}

.settings-form{max-width:1100px;min-width:0}
.settings-content h3:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.settings-content{display:grid;gap:14px;min-width:0}
.settings-content>section{min-width:0;margin:0;scroll-margin-block-start:10px;overflow-wrap:anywhere}
.settings-content>section>h3{margin:0 0 14px;padding-bottom:10px;border-bottom:1px solid var(--border)}
.settings-content .settings-group{min-width:0;margin:0;padding:0 0 14px;border:0;border-bottom:1px solid var(--border);border-radius:0}
.settings-content .settings-group+.settings-group{margin-top:14px}
.settings-content .settings-group:last-child{padding-bottom:0;border-bottom:0}
.settings-content .settings-group legend{padding:0;margin-bottom:8px;font-size:13px;font-weight:700}
.settings-content .form-grid{align-items:start}
.settings-content .form-grid>label{min-width:0}
.settings-content .form-grid>:is(.settings-switch,.settings-wide,p){grid-column:1/-1}
.settings-content .form-grid>p{margin:0;padding:8px 10px;border-inline-start:2px solid var(--border);border-radius:4px;background:var(--bg)}
.settings-content .form-grid>.settings-switch{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;margin:0;padding:5px 0;border-bottom:1px solid var(--border);font-weight:400}
.settings-content .form-grid>.settings-switch:last-child{border-bottom:0}
.settings-content .settings-group textarea{margin-top:5px;resize:vertical}
.settings-switch input.fcm-switch{appearance:none;width:44px;height:25px;flex:none;padding:0;margin:0;border:1px solid var(--border);border-radius:99px;background:var(--border);position:relative;cursor:pointer}
.settings-switch input.fcm-switch:checked{background:var(--primary);border-color:var(--primary)}
.settings-actions{display:flex;justify-content:flex-end;position:sticky;bottom:0;margin-top:12px;padding:10px;background:var(--bg);border-top:1px solid var(--border)}
.settings-actions button{min-height:44px}
.panel:has(.settings-form){scroll-padding-block-end:76px}
.notification-card [data-service-form=webpush]{container-type:inline-size;display:grid;gap:14px}
[data-service-form=webpush]>.notification-result,[data-service-form=webpush]>p.muted{margin:0}
[data-service-form=webpush]>.notification-result:empty{display:none}
[data-service-form=webpush]>p.muted:last-child{font-size:12px}
.webpush-fast,.webpush-advanced{min-width:0;border:1px solid var(--border);border-radius:10px;padding:0 14px}
.webpush-fast{background:linear-gradient(var(--bg),var(--surface))}
.notification-card .webpush-fast>summary{min-height:44px;gap:8px}
.webpush-fast>summary::before{content:"▸";color:var(--muted)}
.webpush-fast[open]>summary::before{content:"▾"}
.webpush-fast>summary strong{flex:1}
.webpush-fast-content{padding-block:0 12px}
.webpush-fast p,.webpush-advanced p,.webpush-notes p{margin:0;font-size:12px;line-height:1.6;overflow-wrap:anywhere}
.webpush-status-heading{display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:4px 8px;border-top:1px solid var(--border);margin-top:12px;padding:10px 0 8px;font-size:12px}
.webpush-fast-runs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-bottom:8px}
.webpush-run{display:flex;flex-direction:column;gap:6px;padding:8px;border:1px solid var(--border);border-radius:8px;background:var(--surface);font-size:12px;overflow-wrap:anywhere}
.webpush-run strong::before{content:"";display:inline-block;width:7px;height:7px;border:1px solid var(--muted);border-radius:50%;margin-inline-end:5px;vertical-align:middle}
.webpush-fast .notification-actions{margin:8px 0 0;justify-content:flex-end;flex-wrap:wrap}
.webpush-fast .notification-actions button{min-height:44px;max-width:100%;white-space:normal;overflow-wrap:anywhere}
.webpush-fast .webpush-host-hint{margin-bottom:8px}
.webpush-fast .notification-result:empty{display:none}
.notification-card .webpush-advanced>summary{gap:8px;min-height:50px}
.webpush-advanced>summary::before{content:"▸";color:var(--muted)}
.webpush-advanced[open]>summary::before{content:"▾"}
.webpush-advanced summary strong{flex:1}
.webpush-mode-preview{border:1px solid var(--border);border-radius:6px;padding:3px 6px;background:var(--bg);color:var(--muted);font-size:11px;text-align:end;overflow-wrap:anywhere}
.webpush-advanced fieldset{border:0;border-top:1px solid var(--border);margin:0;padding:0 0 12px;min-width:0}
.webpush-advanced legend{font-size:12px;font-weight:600;padding:6px 4px}
.webpush-modes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:4px 0 8px}
.webpush-modes label{display:flex;align-items:center;gap:8px;margin:0;padding:7px;min-height:44px;border:1px solid var(--border);border-radius:8px;font-size:12px;overflow-wrap:anywhere;cursor:pointer}
.webpush-modes label:has(input:checked){border-color:var(--primary);background:var(--bg)}
.webpush-modes input[type=radio]{margin:0;width:16px;height:16px;flex:none;accent-color:var(--primary)}
.webpush-notes{display:grid;gap:5px;border-inline-start:3px solid var(--border);border-radius:8px;background:var(--bg);padding:8px 10px}
.webpush-notes p::before{content:"•";margin-inline-end:6px}
.webpush-notes+.notification-actions{border-top:1px solid var(--border);padding-top:10px;margin:0}
@container(max-width:390px){
 .webpush-fast-runs,.webpush-modes{grid-template-columns:minmax(0,1fr)}
 .webpush-run{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center}
 .webpush-run strong{text-align:end}
 .webpush-notes+.notification-actions button{flex:1 1 115px}
}

/* Runtime overview and client information are scoped to their own modules. */
.dashboard-runtime{display:grid;gap:14px;min-width:0;overflow-wrap:anywhere}
.dashboard-body{display:grid;gap:12px;min-width:0}
.dashboard-runtime h3,.dashboard-summary{margin:0}
.dashboard-statistics{display:grid;gap:12px;min-width:0}
.dashboard-toolbar,.dashboard-card-heading,.dashboard-detail-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.dashboard-runtime button,.device-client-popup button{min-height:44px;max-width:100%;overflow-wrap:anywhere}
.dashboard-summary{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:10px 14px;color:var(--muted)}
.dashboard-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.dashboard-grid .dashboard-card{display:grid;align-content:start;text-align:start;gap:7px;min-width:0;min-height:144px;white-space:normal;padding:12px;border-radius:12px}
.dashboard-card[aria-pressed=true]{outline:2px solid var(--primary);outline-offset:-2px}
.dashboard-icon{display:grid;place-items:center;width:33px;height:33px;background:var(--soft);color:var(--primary);border-radius:8px;font-size:18px}
.dashboard-state{font-size:12px;border-radius:12px;padding:2px 7px;background:var(--bg);color:var(--muted)}
.dashboard-state[data-tone=ok]{color:var(--green);background:color-mix(in srgb,var(--surface),var(--green) 12%)}
.dashboard-state[data-tone=error]{color:var(--danger);background:color-mix(in srgb,var(--surface),var(--danger) 12%)}
.dashboard-state:is([data-tone=warning],[data-tone=paused]){color:var(--ink);background:color-mix(in srgb,var(--surface),#efb654 24%)}
.dashboard-card-link{text-align:end;font-size:12px;color:var(--primary);margin-top:2px}
.dashboard-runtime .box,.dashboard-runtime .cards{margin:0}
.dashboard-detail dl{margin:8px 0 12px}
.dashboard-detail dl>div{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:8px;border-block-end:1px solid var(--border);padding:7px 0}
.dashboard-detail dd{margin:0;color:var(--muted)}
.dashboard-detail-actions{display:flex;justify-content:flex-end}

:where(html.mivchat-mobile-compact) .dashboard-grid,:where(html.mivchat-mobile-compact) .dashboard-runtime .cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
:where(html.mivchat-mobile-compact) .dashboard-grid .dashboard-card{padding:9px}
:where(html.mivchat-mobile-compact) .dashboard-detail dl>div{grid-template-columns:minmax(0,1fr);gap:2px}

.device-sessions .device-client-truncate{display:inline-block;max-width:195px;min-height:44px;overflow:hidden;text-overflow:ellipsis;text-align:start;vertical-align:middle;padding:5px 8px;color:var(--ink);background:var(--soft)}
.device-client-truncate[aria-expanded=true],.device-client-truncate:focus-visible{outline:2px solid var(--primary);outline-offset:-2px}
.device-client-popup{position:fixed;z-index:120;overflow:auto;border:1px solid var(--border);background:var(--surface);border-radius:12px;box-shadow:var(--shadow);padding:14px;overscroll-behavior:contain}
.device-client-heading,.device-client-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.device-client-heading h3,.device-client-actions p{margin:0;overflow-wrap:anywhere}
.device-client-raw{white-space:pre-wrap;overflow-wrap:anywhere;user-select:text;background:var(--bg);border-radius:8px;padding:10px;margin:10px 0;font-size:12px}
.device-client-actions button{margin-inline-start:auto}

:where(html.mivchat-mobile-compact) .device-sessions .device-client-truncate{max-width:135px}

.backup-settings-buttons{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;max-width:100%;margin-inline-start:auto}
.backup-settings-buttons button{min-height:44px}

/* The administration subnavigation and its content share an inline edge.
   Keep the gap here so default margins on the first card cannot add to it. */
#panel-view:has(#subnav [data-subview]) {
  --admin-inline: 28px;
  --admin-gap: 16px;
}
#subnav:has([data-subview]) {
  max-width: 1160px;
  padding-inline: var(--admin-inline);
  margin-block-end: 0;
}
#subnav:has([data-subview]) + #panel-content {
  padding-inline: var(--admin-inline);
  padding-block-start: var(--admin-gap);
}
#subnav:has([data-subview]) + #panel-content > div > :first-child,
#subnav:has([data-subview]) + #panel-content > div > [hidden]:first-child + .box {
  margin-block-start: 0;
}
#subnav:has([data-subview]) + #panel-content > div > .box {
  padding: var(--admin-gap);
}
#panel-content .log-filters :is(button, input, select) {
  min-height: 44px;
}

:where(html.mivchat-mobile-narrow) #panel-view:has(#subnav [data-subview]){--admin-inline: 12px;
    --admin-gap: 12px;}


[data-fcm-identity] .identity-details{display:grid;gap:12px;min-width:0;overflow-wrap:anywhere}
[data-fcm-identity] .identity-details[hidden]{display:none}
[data-fcm-identity] .identity-value{display:grid;gap:6px;min-width:0;border:1px solid var(--border);border-radius:10px;padding:12px;background:var(--bg)}
[data-fcm-identity] code{white-space:normal;overflow-wrap:anywhere;user-select:text}
[data-fcm-identity] .identity-meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(125px,100%),1fr));gap:10px;margin:0}
[data-fcm-identity] .identity-meta dt{color:var(--muted)}
[data-fcm-identity] .identity-meta dd{margin:3px 0 0;font-weight:600}

/* Optional E2EE controls use the existing conversation and personal action layouts. */
.e2ee-contact-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;border-radius:8px}
.e2ee-contact-row:has(:focus-visible){background:var(--hover,rgba(127,127,127,.12))}
.conversation-entry:active:not(:has(.conversation-menu:active)),.e2ee-contact-row:active,.contact:active{background:var(--soft)}
.conversation-entry>.contact:active,.e2ee-contact-row>.contact:active{background:transparent}
@media(hover:hover) and (pointer:fine){
 .contact:hover,.conversation-entry:hover{background:var(--soft)}
 .e2ee-contact-row:hover{background:var(--hover,rgba(127,127,127,.12))}
 .conversation-entry>.contact:hover,.e2ee-contact-row>.contact:hover{background:transparent}
}
.e2ee-history-action{grid-column:1/-1;justify-self:start;min-height:44px;margin-inline-start:8px}
.e2ee-indicator{display:inline-grid;place-items:center;min-width:44px;min-height:44px;padding:0;color:inherit;background:transparent;border:0;font-weight:700}
.e2ee-indicator.trusted{color:#2869d8}.e2ee-indicator.normal{color:#24804b}.e2ee-indicator.waiting{color:var(--muted,#747f8b)}.e2ee-indicator.verify{color:#b86513}.e2ee-indicator.fault{color:#cf3d4e}
.e2ee-indicator:hover,.e2ee-indicator:active{background:transparent}
.e2ee-indicator svg,.e2ee-personal svg{height:1em;width:1em;fill:none;stroke:currentColor;stroke-width:2}
.e2ee-list[hidden]{display:none}.e2ee-code{display:block;overflow-wrap:anywhere;margin:.6em 0;user-select:all}
.e2ee-settings-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.e2ee-settings-actions button{min-height:44px;white-space:normal}
.e2ee-confirm{display:flex;align-items:center;gap:.5em;margin:.6em 0}
.e2ee-dialog{max-width:min(500px,calc(100vw - 1.5rem))}
.e2ee-dialog .actions{display:flex;gap:8px;flex-wrap:wrap}
.e2ee-dialog button.action-danger{border-color:var(--danger);background:var(--danger);color:var(--surface)}
.e2ee-invitation-entry{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;margin:0 0 10px;padding:8px 10px;border:1px solid var(--border);border-radius:9px;background:var(--soft);text-align:start}
.e2ee-invitation-entry svg{width:19px;height:19px;fill:none;stroke:var(--primary);stroke-width:1.6;flex:none}
.e2ee-invitation-entry .invitation-label{display:grid;flex:1;min-width:0;gap:2px}
.e2ee-invitation-entry .invitation-names{color:var(--muted);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.invitation-card{display:grid;justify-items:center;gap:8px;width:min(100%,342px);margin:auto;padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--surface);text-align:center}
.invitation-card+.invitation-card{margin-top:10px}
.invitation-card h3,.invitation-card p{margin:0;overflow-wrap:anywhere}
.invitation-card p{font-size:14px;line-height:1.5}
.invitation-card .muted,.invitation-card time{color:var(--muted);font-size:12px}
.invite-symbol{display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:var(--soft);color:var(--primary)}
.invite-symbol svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.6}
.invite-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;width:100%}
.invite-actions button{padding-inline:6px;overflow-wrap:anywhere}
.invite-actions button,.invitation-more{min-height:44px}
.invitation-more{margin-top:10px}


.conversation-head.e2ee-header,.conversation-head.e2ee-readonly-header{height:auto;min-height:70px;flex:none}
.conversation-head.e2ee-verified-header{height:70px}
:where(html.mivchat-mobile-compact) .conversation-head.e2ee-header,
:where(html.mivchat-mobile-compact) .conversation-head.e2ee-readonly-header{min-height:58px}
:where(html.mivchat-mobile-compact) .conversation-head.e2ee-verified-header{height:58px}
.e2ee-header #peer-title{display:flex;align-items:center}
.e2ee-peer-name{overflow:hidden;text-overflow:ellipsis}
.e2ee-header #peer-title>.e2ee-indicator{flex:none}
.e2ee-verified-header #peer-title{position:relative;padding-inline-end:44px;overflow:visible;width:max-content;max-width:100%;box-sizing:border-box}
.e2ee-verified-header #peer-title>.e2ee-indicator{position:absolute;inset-inline-end:0;inset-block-start:50%;transform:translateY(-50%)}
:where(html.mivchat-mobile-compact) .e2ee-verified-header #peer-title>.e2ee-indicator{transform:translateY(calc(-50% + 6px))}
:where(html.mivchat-mobile-compact) .e2ee-verified-header #peer-title>.e2ee-indicator [data-e2ee-glyph]{transform:translateY(-6px)}
.e2ee-reactions[hidden]{display:none}
.e2ee-header #peer-info,.e2ee-readonly-header #peer-info{display:flex;align-items:center;flex-wrap:wrap;gap:5px;white-space:normal}
.e2ee-header #peer-info:empty{display:none}
.e2ee-verified-header #peer-info[data-chat-status]{display:block;white-space:nowrap}
.e2ee-header #peer-info button,.e2ee-readonly-header #peer-info button{max-width:100%;white-space:normal}
.e2ee-header~#pending-help{display:none}
.conversation-menu-items{position:absolute;inset-inline-end:0;top:100%;z-index:4;display:grid;
  width:max-content;max-width:min(85vw,18rem);background:var(--surface);box-shadow:var(--shadow);border:1px solid var(--border);border-radius:8px;padding:4px;gap:4px}
.conversation-menu-items button{min-height:44px;text-align:start;white-space:normal;overflow-wrap:anywhere}
button.danger:not(.primary):not(.action-danger){color:var(--danger);border-color:var(--danger)}
.configuration-restore .backup-restore-form button{justify-self:start}

/* Preserve the module navigation buttons. */
#panel-view .subnav{gap:6px}
#panel-view .subnav>:is(button,a){
  box-sizing:border-box;min-width:44px;min-height:44px;max-width:100%;padding:8px 12px;border:1px solid var(--border);
  border-radius:8px;background:var(--surface);color:var(--ink);font-size:14px;line-height:1.25;
  justify-content:center;text-align:center;white-space:normal;overflow-wrap:anywhere
}
:lang(zh) #panel-view .subnav>:is(button,a){min-width:min(100%,calc(6em + 26px))}
#panel-view .subnav>:is(button,a):hover{background:var(--soft)}
#panel-view .subnav>:is(.active,[aria-pressed=true],[aria-selected=true],[aria-current=true]){
  background:var(--primary);border-color:var(--primary);color:#fff
}
#panel-view .subnav>:is(button,a):focus-visible{outline:2px solid var(--primary);outline-offset:2px}

/* Shared inner navigation for the four settings panels. */
#panel-view :is(.ac-tabs,.pwa-tabs,.notification-tabs,.settings-directory){display:flex;flex-wrap:wrap;align-items:stretch;gap:4px 12px;margin-bottom:12px;padding-top:8px;border-top:1px solid var(--border)}
#panel-view :is(.ac-tabs,.pwa-tabs,.notification-tabs,.settings-directory)>:is(button,a){display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;max-width:100%;padding:8px 0;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;box-shadow:none;color:var(--muted);font-size:13px;line-height:1.25;font-weight:400;text-decoration:none;white-space:normal;overflow-wrap:anywhere}
:lang(zh) #panel-view :is(.ac-tabs,.pwa-tabs,.notification-tabs,.settings-directory)>:is(button,a){min-width:44px}
#panel-view :is(.ac-tabs,.pwa-tabs,.notification-tabs,.settings-directory)>:is(button,a):hover{background:transparent;color:var(--primary)}
#panel-view :is(.ac-tabs,.pwa-tabs,.notification-tabs,.settings-directory)>:is(.active,[aria-selected=true],[aria-pressed=true],[aria-current=page],[aria-current=location]){background:transparent;color:var(--primary);border-bottom-color:var(--primary);font-weight:600}
#panel-view :is(.ac-tabs,.pwa-tabs,.notification-tabs,.settings-directory)>:is(button,a):focus-visible{outline:2px solid var(--primary);outline-offset:-2px}

.e2ee-indicator [data-e2ee-glyph],.e2ee-personal [data-e2ee-glyph]{
  display:inline-grid;place-items:center;inline-size:var(--e2ee-glyph-size,14px);block-size:var(--e2ee-glyph-size,14px);
  font-size:var(--e2ee-glyph-size,14px);line-height:1
}
#peer-title .e2ee-indicator{--e2ee-glyph-size:16px}
.e2ee-personal.me-action{--e2ee-glyph-size:24px}
.e2ee-personal.me-action svg{stroke-width:1.8}
.e2ee-entry[hidden]{display:none}

/* Concept A, within the Bot workspace only. */
.bots-workspace {min-width:0;overflow-wrap:anywhere;padding:12px 8px 24px;color:var(--ink);--bot-shadow:0 3px 14px #233c5d0c}

.bots-workspace *, .bots-workspace *::before {box-sizing:border-box}
.bots-workspace button {min-width:0;max-width:100%;line-height:1.35}
.bots-workspace small {color:var(--muted)}
.my-bots-icon {color:#3478c9}
#my-bots .my-bots-icon {width:20px;height:20px;margin-inline-end:8px;vertical-align:middle}
.bots-workspace .app-header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}
.bots-workspace .app-header h2{font-size:22px;line-height:1.25;margin:0 0 4px}
.bots-workspace .app-header p{margin:0;color:var(--muted);font-size:13px}
.bots-workspace .app-kicker{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#8190a5;font-weight:700;margin-bottom:4px}
.bots-workspace .primary{background:var(--primary);border-color:var(--primary);color:#fff;font-weight:650}
.bots-workspace .primary:hover{background:#175bc9}
.bots-workspace .soft-button{background:var(--soft);border-color:#d5e4ff;color:#225fbd}
.bots-workspace .danger-button{color:var(--danger,#a72b36);border-color:#f1d1d1;background:#fffafa}
.bots-workspace .ghost-button{background:transparent;border-color:transparent;color:var(--muted)}
.bots-workspace .pill{display:inline-flex;align-items:center;gap:5px;padding:3px 8px;border-radius:20px;background:#f0f3f8;color:#607089;font-size:11px;font-weight:650;white-space:nowrap}
.bots-workspace .pill.good{background:#e7f6ee;color:#187a4a}
.bots-workspace .pill.bad{background:#fff0f0;color:#a72b36}
.bots-workspace .pill.info{background:#eaf2ff;color:#2869c6}
.bots-workspace .pill.warn{background:#fff5e5;color:#956016}
.bots-workspace .pill .state-dot{width:6px;height:6px;border-radius:50%;background:currentColor}
.bots-workspace .bot-summary {margin-bottom:17px}
.bots-workspace .bot-summary .cards {grid-template-columns:repeat(4,minmax(0,1fr))}
.bots-workspace .stat{padding:14px 16px;background:var(--surface);border:1px solid var(--border);border-radius:12px;min-width:0}
.bots-workspace .stat strong{display:block;font-size:24px;line-height:1.2;color:var(--primary);font-weight:750;font-variant-numeric:tabular-nums}
.bots-workspace .stat span{display:block;color:var(--muted);font-size:12px;margin-top:5px}
.bots-workspace .bot-panel{background:var(--surface);border:1px solid var(--border);border-radius:13px;box-shadow:var(--bot-shadow);min-width:0}
.bots-workspace .panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.bots-workspace .panel-head h3{font-size:14px;margin:0}
.bots-workspace .bot-avatar{width:38px;height:38px;flex:0 0 38px;display:grid;place-items:center;border-radius:12px;background:linear-gradient(145deg,#dceaff,#c7dcff);color:#245eae;font-weight:800;font-size:15px}
.bots-workspace .bot-avatar.large{width:52px;height:52px;flex-basis:52px;border-radius:15px;font-size:19px}
.bots-workspace .bot-code{font:11px ui-monospace,SFMono-Regular,Consolas,monospace;color:var(--muted)}
.bots-workspace .bots-columns{display:grid;grid-template-columns:minmax(245px,290px) minmax(0,1fr);gap:14px;align-items:start}
.bots-workspace .bot-side{padding:14px}
.bots-workspace .bot-side-list{display:grid;gap:6px}
.bots-workspace .bot-side-item{display:flex;align-items:center;gap:10px;text-align:left;width:100%;padding:11px 10px;border:1px solid transparent;background:transparent;border-radius:10px}
.bots-workspace .bot-side-item:hover{background:#f5f8fd}
.bots-workspace .bot-side-item[aria-pressed="true"]{background:#edf4ff;border-color:#d7e6ff}
.bots-workspace .bot-side-item .item-copy{min-width:0;flex:1}
.bots-workspace .bot-side-item .item-copy strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px}
.bots-workspace .bot-side-item .item-copy small{display:block;white-space:normal;line-height:1.4;margin-top:3px}
.bots-workspace .bot-detail{padding:18px}
.bots-workspace .bot-back{display:none;margin-bottom:10px}
.bots-workspace .detail-identity{display:flex;align-items:center;gap:13px;min-width:0;margin-bottom:14px}
.bots-workspace .detail-identity .copy{min-width:0;flex:1}
.bots-workspace .detail-identity h3{font-size:18px;margin:0 0 3px;overflow-wrap:anywhere}
.bots-workspace .detail-identity p{margin:5px 0 0;color:var(--muted);font-size:13px}
.bots-workspace .detail-topline{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.bots-workspace .overview-desc{font-size:13px;color:#5f6e84;margin:0 0 16px}
.bots-workspace .meta-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:13px 0 17px}
.bots-workspace .meta{padding:11px 12px;border:1px solid var(--border);border-radius:10px;background:color-mix(in srgb,var(--surface) 92%,var(--soft));min-width:0}
.bots-workspace .meta span{display:block;color:var(--muted);font-size:11px;margin-bottom:3px}
.bots-workspace .meta strong{display:block;font-size:13px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.bots-workspace .detail-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}
.bots-workspace .directory-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:12px 0 14px}
.bots-workspace .directory-toolbar input{flex:1;min-width:170px;max-width:320px}
.bots-workspace .directory-toolbar select{width:auto;min-width:150px;max-width:220px}
.bots-workspace .records{display:grid;gap:8px}
.bots-workspace .record{display:flex;align-items:center;gap:12px;padding:11px 12px;border:1px solid var(--border);border-radius:10px;background:var(--surface);min-width:0}
.bots-workspace .record-main{flex:1;min-width:0}
.bots-workspace .record-main strong{display:block;font-size:13px;overflow-wrap:anywhere}
.bots-workspace .record-main small{display:block;font-size:11px;margin-top:3px;overflow-wrap:anywhere}
.bots-workspace .record-side{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.bots-workspace .record-side .meta-mini{font-size:11px;color:var(--muted);white-space:nowrap}
.bots-workspace .record button{white-space:nowrap}
.bots-workspace .key-card,.bots-workspace .event-card,.bots-workspace .sub-card{padding:13px;border:1px solid var(--border);border-radius:11px;background:var(--surface)}
.bots-workspace .key-card code{display:inline-block;margin:5px 0 3px;padding:4px 7px;background:#f2f5fa;border-radius:6px;color:#42536b;font-size:12px;overflow-wrap:anywhere}
.bots-workspace .key-meta{display:flex;gap:8px 16px;flex-wrap:wrap;margin-top:9px;color:var(--muted);font-size:11px}
.bots-workspace .event-card{display:grid;gap:9px}
.bots-workspace .event-meta{display:flex;gap:8px 16px;flex-wrap:wrap;color:var(--muted);font-size:11px}
.bots-workspace .event-card .event-key{font:12px ui-monospace,SFMono-Regular,Consolas,monospace;overflow-wrap:anywhere}
.bots-workspace .load-more{width:100%;margin-top:10px;color:#5c6f89}
.bots-workspace .personal-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:14px;align-items:start}
.bots-workspace .personal-list,.bots-workspace .history-panel{padding:17px}
.bots-workspace .personal-cards,.bots-workspace .history-list{display:grid;gap:9px}
.bots-workspace .personal-bot{display:flex;align-items:center;gap:12px;padding:13px;border:1px solid var(--border);border-radius:11px;background:var(--surface);min-width:0}
.bots-workspace .personal-bot .copy{flex:1;min-width:0}
.bots-workspace .personal-bot .copy strong{display:block;overflow-wrap:anywhere}
.bots-workspace .personal-bot .copy p{font-size:12px;color:var(--muted);margin:4px 0}
.bots-workspace .personal-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.bots-workspace .history-item{display:flex;align-items:center;gap:10px;padding:11px;border:1px solid var(--border);border-radius:10px;background:var(--surface);min-width:0}
.bots-workspace .history-item .copy{min-width:0;flex:1}
.bots-workspace .history-item .copy strong{display:block;overflow-wrap:anywhere}
.bots-workspace .history-item .copy small{display:block;margin-top:3px}
.bots-workspace .empty-state{padding:24px;text-align:center;color:var(--muted);border:1px dashed #d8e1ed;border-radius:10px}
.bots-workspace .table-note{font-size:11px;color:var(--muted);margin:9px 0 0}
.bots-workspace .modal-head h3{font-size:16px;margin:0}
.bots-workspace .secret-box{font:12px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;min-height:94px;overflow-wrap:anywhere}
.bots-workspace .bot-list-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.bots-workspace .bot-list-heading{display:flex;align-items:center;gap:8px;min-width:0}
.bots-workspace .bot-list-heading h3{font-size:14px;margin:0}
.bots-workspace .bot-list-head>.primary{min-height:0;height:auto;line-height:1.55;white-space:nowrap;padding:7px 10px;font-size:12px}
.bots-workspace .bot-side{padding:14px}
.bots-workspace .bot-side-item{align-items:center}
.bots-workspace .bot-side-item .item-copy{display:grid;gap:5px}
.bots-workspace .item-heading{display:flex;align-items:center;justify-content:space-between;gap:7px;min-width:0}
.bots-workspace .item-heading strong{min-width:0;white-space:normal;overflow-wrap:anywhere}
.bots-workspace .item-heading .pill{flex:0 0 auto}
.bots-workspace .item-metrics{display:flex;gap:10px;flex-wrap:wrap;color:var(--muted);font-size:11px}
.bots-workspace .bot-code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;overflow-wrap:anywhere}
.bots-workspace .bot-avatar{overflow:hidden}
.bots-workspace .bot-avatar .avatar-photo{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}
.bots-workspace .avatar-preview-row{display:flex;align-items:center;gap:12px}
.bots-workspace .avatar-preview-row>span:last-child{display:grid;gap:3px}
.bots-workspace .avatar-preview-row small{font-size:11px;color:var(--muted)}
.bots-workspace .avatar-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
.bots-workspace .avatar-choice{display:grid;place-items:center;padding:4px;aspect-ratio:1;border:1px solid var(--border);border-radius:10px;background:var(--surface)}
.bots-workspace .avatar-choice img{display:block;width:100%;height:100%;object-fit:cover;border-radius:7px}
.bots-workspace .avatar-choice[aria-pressed=true]{border:2px solid var(--primary);padding:3px;background:#edf4ff;box-shadow:0 0 0 2px #dbeaff}
.bots-workspace .avatar-default{justify-self:start;border:0;background:transparent;color:var(--muted);padding:5px 0;font-size:12px}
.bots-workspace .avatar-default[aria-pressed="true"]{color:var(--primary);font-weight:700}

.bots-workspace .app-header {display:block}
.bots-workspace .avatar-editor {display:grid;gap:12px;padding:13px;border:1px solid var(--border);border-radius:12px;background:var(--surface)}
.bots-workspace .key-top,.bots-workspace .event-top {display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.bots-workspace .notice {padding:10px 12px;border-radius:9px;background:#fff6e8;color:#885912;font-size:12px}
.bots-workspace .bot-side-item[aria-pressed=true] {background:var(--soft);border-color:color-mix(in srgb,var(--primary) 32%,var(--border))}
.bots-workspace .item-heading strong {white-space:normal}
.bots-workspace .detail-topline .pill.good::before,.bots-workspace .detail-topline .pill.bad::before,
.bots-workspace .item-heading .pill::before {content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.bots-workspace .bot-add::before {content:"＋ ";white-space:pre}
.bots-workspace .bot-back::before {content:"← "}
.bots-workspace .detail-topline {display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.bots-workspace .overview-desc {font-size:13px;color:var(--muted);margin:0 0 16px}
.bots-workspace .sub-identity {border:0;padding:0}
.bots-workspace .event-key {font:12px ui-monospace,monospace;overflow-wrap:anywhere}
.bots-workspace .event-meta {display:flex;gap:8px 16px;flex-wrap:wrap;color:var(--muted);font-size:11px}
.bots-workspace .load-more {width:100%;margin-top:10px}
.bots-workspace .modal-body {min-height:0}
.bots-workspace .modal-body label {display:grid;gap:5px;min-width:0}
.bots-workspace .modal-body :is(input,textarea) {width:100%;min-width:0}
.bots-workspace .bot-dialog .modal-actions {flex-shrink:0}
.bots-workspace .modal-body [role=alert] {color:var(--danger,#a72b36)}
.bots-workspace button:focus-visible {outline:2px solid var(--primary);outline-offset:2px}
.bots-workspace .history-item .detail-topline {font-size:11px;color:var(--muted)}
.bots-workspace .personal-layout>* {min-width:0}
.bots-workspace .bot-back {display:none}
.bots-workspace .directory-toolbar > * {max-width:100%}
html[data-theme=dark] .bots-workspace :is(.soft-button,.danger-button,.notice,.bot-side-item:hover,.key-card code) {background:var(--soft);color:var(--ink);border-color:var(--border)}
html[data-theme=dark] .bots-workspace .overview-desc {color:var(--muted)}
@media(max-width:900px) {
 .bots-workspace .personal-layout {grid-template-columns:minmax(0,1fr)}
 .bots-workspace .personal-bot,.bots-workspace .history-item {flex-wrap:wrap}
}
@media(max-width:680px) {
 .bots-workspace {padding:4px 0 calc(16px + env(safe-area-inset-bottom))}
 .bots-workspace .app-header h2 {font-size:19px}
 .bots-workspace .app-header p {font-size:12px}
 .bots-workspace .bot-summary .cards {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .bots-workspace .stat {padding:11px}
 .bots-workspace .stat strong {font-size:21px}
 .bots-workspace .bots-columns {display:block}
 .bots-workspace .personal-layout {grid-template-columns:minmax(0,1fr)}
 .bots-workspace .bot-detail {display:none;padding:14px}
 .bots-workspace.bot-selected :is(.bot-summary,.bot-list) {display:none}
 .bots-workspace.bot-selected .bot-detail {display:block}
 .bots-workspace .bot-back {display:inline-flex}
 .bots-workspace .meta-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
 .bots-workspace .detail-identity,.bots-workspace .personal-bot,.bots-workspace .history-item,.bots-workspace .record {align-items:flex-start}
 .bots-workspace .record {flex-wrap:wrap}
 .bots-workspace .record-side,.bots-workspace .personal-actions {width:100%;justify-content:flex-start}
 .bots-workspace .directory-toolbar :is(input,select) {width:100%;min-width:0;max-width:none;flex:1 1 100%}
 .bots-workspace .avatar-grid {gap:6px}
 .bots-workspace .meta {padding:9px}
}
#conversation #composer[data-composer-style="classic"]{gap:9px}
#conversation #composer .attach{flex:0 0 38px;width:38px;height:44px;padding:0;border:0;background:transparent;color:#6d7f95;font-size:24px}
#conversation #composer textarea{flex:1;min-width:0;min-height:48px;max-height:112px;resize:none;border:1px solid var(--border,#cfd9e6);border-radius:9px;padding:12px 13px;line-height:21px;font-size:14px;background:var(--surface)}
#composer .composer-right{display:flex;align-items:center;gap:2px;flex:0 0 auto;min-width:0}
#conversation #composer .send{min-width:64px;height:44px;border-radius:8px}
#conversation #composer[data-composer-style="modern"]{gap:3px;padding:4px 7px;border:1px solid var(--border,#cfd9e6);border-radius:10px;background:var(--surface)}
#conversation #composer[data-composer-style="modern"] textarea{border:0;box-shadow:none;padding:10px 5px;min-height:44px}
#conversation #composer[data-composer-style="modern"] .attach,#conversation #composer[data-composer-style="modern"] :is(.compose-emoji,.compose-voice){width:40px;height:40px;flex:0 0 40px;min-width:40px;min-height:40px;border:0;background:transparent;border-radius:50%;display:grid;place-items:center;padding:0;color:var(--muted)}
#conversation #composer[data-composer-style="modern"] .composer-right{gap:2px;flex:0 0 auto;justify-content:flex-end}
#conversation #composer[data-composer-style="modern"] .compose-voice,#conversation #composer[data-composer-style="modern"] button[type="submit"]{position:relative;inset:auto}

/* Microphone and send share one fixed action slot in Modern mode. */
#composer .composer-action-slot{position:relative;display:block;flex:0 0 64px;width:64px;height:44px;min-width:0}
#composer .composer-action-slot>button{position:absolute;inset:0;width:64px;height:44px;min-width:64px;min-height:44px;margin:0}
#composer .composer-action-slot>button[hidden]{display:none!important}
#conversation #composer[data-composer-style="modern"] .composer-action-slot{flex:0 0 40px;width:40px;height:40px}
#conversation #composer[data-composer-style="modern"] .composer-action-slot>button{position:absolute;inset:0;width:40px;height:40px;min-width:40px;min-height:40px;flex:0 0 40px;border-radius:50%;padding:0;display:grid;place-items:center}
#conversation #composer[data-composer-style="modern"] .composer-action-slot>button[hidden]{display:none!important}
#conversation #composer[data-composer-style="modern"] .compose-voice svg{width:21px;height:21px}
#conversation #composer[data-composer-style="modern"] button[type="submit"]{font-size:21px;line-height:1}
#conversation #composer[data-composer-style="modern"] button[type="submit"][hidden]{display:none!important}
#conversation #composer[data-composer-style="classic"]{border:0;background:transparent;padding:0;margin:0}
#conversation #composer[data-composer-style="classic"] textarea{border:1px solid var(--border,#cfd9e6);border-radius:9px;background:var(--surface)}
#conversation #composer[data-composer-style="modern"]{border:1px solid var(--border,#cfd9e6);border-radius:10px;background:var(--surface);padding:3px 7px;margin:0}
#conversation #composer[data-composer-style="modern"] textarea{border:0!important;background:transparent!important;box-shadow:none!important}
#conversation #composer[data-composer-style="modern"]:focus-within{border-color:#8fb5ed;box-shadow:0 0 0 2px #2869d812}
#conversation #composer[data-composer-style="modern"] .attach,#conversation #composer[data-composer-style="modern"] :is(.compose-emoji,.compose-voice){background:transparent;border:0;box-shadow:none}
#conversation #composer[data-composer-style="modern"] :is(.compose-emoji,.compose-voice){display:grid}
#conversation #composer[data-composer-style="modern"] .send{border-radius:50%;width:40px;height:40px;min-width:40px;min-height:40px;padding:0}
#conversation #composer[data-composer-style="classic"] :is(.compose-emoji,.compose-voice){display:none!important}
#conversation #composer[data-composer-style="classic"] .send{min-width:64px;border-radius:8px}

#composer-frame{display:contents}
#conversation #composer{display:flex;align-items:center;flex-wrap:nowrap;box-sizing:border-box}
#conversation #composer.hidden{display:none}
#conversation #composer textarea{box-sizing:border-box;height:auto;overflow:auto}
#conversation #composer[data-composer-style="modern"] .composer-action-slot>button{position:absolute;inset:0;margin:0}
#conversation #composer[data-composer-style="modern"] .send{background:var(--primary);color:white;font-size:0;border:0}
#conversation #composer[data-composer-style="modern"] .send span{display:none}
#conversation #composer[data-composer-style="modern"] .send::after{content:'↑';font-size:23px;line-height:1}
#conversation #composer .send[aria-busy="true"] span{display:none}
#conversation #composer .send[aria-busy="true"]::after{content:'';display:inline-block;box-sizing:border-box;width:16px;height:16px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:send-spin .7s linear infinite}
@keyframes send-spin{to{transform:rotate(360deg)}}
#conversation #composer button:disabled{opacity:.42;filter:none;cursor:not-allowed}
#conversation #composer [hidden],#conversation #composer .compose-hide,#conversation #composer .compose-no-tools{display:none!important}
#conversation #composer [aria-busy="true"]:disabled{cursor:progress}
#conversation #composer[data-composer-style="modern"] :is(.compose-voice,.compose-emoji) svg{width:21px;height:21px}
body>dialog.native-tools.native-tools-auto-width,body>dialog.native-tools.composer-emoji-popup{width:max-content;min-width:62px;max-width:calc(100vw - 16px);padding:6px 8px}
body>dialog.native-tools.native-tools-auto-width>.native-tools-grid,body>dialog.composer-emoji-popup[open]{display:flex;flex-wrap:wrap;align-items:center;gap:4px}
body>dialog.native-tools .native-tool,body>dialog.composer-emoji-popup button{width:44px;height:44px;min-width:44px;padding:8px}
body>dialog.composer-emoji-popup button{font-size:21px}
.bots-workspace .personal-intro {margin:0 0 14px;color:var(--muted);font-size:13px}

:is(.profile-actions,.me-actions)[data-role="super_admin"] #my-bots .my-bots-icon {display:none}
.me-actions #logout:not(.account-divider){margin-top:0;border-top:0}
.profile-actions button.account-divider,.me-actions button.account-divider{border-top:1px solid var(--border,#dde4ef);margin-top:4px}

.bots-workspace .create-avatar-section{border:1px solid var(--border);border-radius:11px;padding:12px;display:grid;gap:10px}
.bots-workspace .create-avatar-grid{grid-template-columns:repeat(6,minmax(0,1fr));max-height:150px;overflow:auto}
.bots-workspace .create-avatar-grid .avatar-choice{padding:3px}
.bots-workspace .create-avatar-grid .avatar-choice img{width:100%;aspect-ratio:1;object-fit:contain}
.bots-workspace .avatar-default{justify-self:start;min-height:34px;padding:6px 10px;font-size:12px}
.bots-workspace .create-avatar-section .bot-avatar{width:48px;height:48px;flex-basis:48px}
.bots-workspace .avatar-caption{display:grid;gap:3px}
.bots-workspace .create-avatar-grid{margin:0;scrollbar-gutter:auto}
.bots-workspace .create-avatar-grid .avatar-choice{min-height:0;min-width:0;border:2px solid transparent;background:var(--surface);border-radius:9px}
.bots-workspace .create-avatar-grid .avatar-choice[aria-pressed="true"]{border-color:var(--primary)}
.bots-workspace .create-avatar-section .avatar-default{border:1px solid var(--border);border-radius:8px;color:var(--ink)}
@media(max-width:560px){.bots-workspace .create-avatar-grid{max-height:136px}}
