/* 快境IM v2 app UI — WeChat-like, chat only. Login styles live in styles.css. */
#app-shell,dialog,.toast{--accent:#55b9ac;--accent-dark:#3f9f92;--accent-soft:#e8f6f3;--mint:#8ae7d8;--bg:#ededed;--panel:#f7f7f7;--line:#e5e5e5;--text:#191919;--text-2:#888;--text-3:#b2b2b2;--red:#fa5151;--nav:#2e3238;font-family:-apple-system,"PingFang SC","Microsoft YaHei","HarmonyOS Sans SC","Noto Sans CJK SC","Segoe UI",sans-serif;color:var(--text)}
#app-shell{height:100dvh;background:var(--bg);overflow:hidden}
#app-shell button,dialog button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;-webkit-tap-highlight-color:transparent}
#app-shell button:active,dialog button:active{transform:none}
#app-shell button:focus-visible,#app-shell a:focus-visible,dialog button:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
#app-shell textarea{font:inherit}
.svg-library{position:absolute;width:0;height:0;overflow:hidden}
#app-shell .icon,dialog .icon{width:22px;height:22px;stroke:currentColor;stroke-width:1.7;fill:none;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.mobile-only{display:none!important}

/* layout: rail | list | chat */
.workspace{display:grid;grid-template-columns:60px 280px minmax(0,1fr);height:100dvh}
.rail{background:var(--nav);display:flex;flex-direction:column;align-items:center;padding:20px 0 14px;gap:6px}
.rail-avatar{width:38px;height:38px;padding:0;margin-bottom:22px;border-radius:6px;overflow:hidden}
.rail-avatar .avatar{width:38px;height:38px;border-radius:6px;font-size:16px}
.tab{position:relative;width:44px;height:44px;display:grid;place-items:center;color:#8d939c;border-radius:6px}
.tab span{display:none}
.tab .icon{width:25px;height:25px}
.tab:hover{color:#d5d9de}
.tab.selected{color:var(--accent)}
.tab.selected .icon{fill:currentColor;fill-opacity:.18}
.rail-settings{margin-top:auto}
.tab-badge{position:absolute;top:3px;right:1px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--red);color:#fff;font-size:11px;font-style:normal;line-height:18px;text-align:center}

.sidebar{position:relative;background:var(--panel);border-right:1px solid #e3e3e3;display:flex;flex-direction:column;min-height:0;min-width:0}
.topbar{position:relative;display:flex;align-items:center;height:60px;padding:0 10px 0 16px;flex-shrink:0}
.topbar h1,.topbar h2{font-size:16px;font-weight:500;margin:0;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.topbar-right{display:flex;align-items:center}
.topbar-btn{width:38px;height:38px;display:grid;place-items:center;border-radius:6px;color:#333}
#app-shell .topbar-btn:hover{background:#0000000a}
.search-row{padding:0 12px 12px;flex-shrink:0}
.search-box{display:flex;align-items:center;gap:6px;height:32px;padding:0 10px;border-radius:6px;background:#e7e7e7;color:var(--text-3);font-size:14px;margin:0}
#app-shell .search-box .icon{width:16px;height:16px}
#app-shell .search-box input{border:0;margin:0;padding:0;height:100%;background:transparent;font-size:14px;color:var(--text);outline:0;width:100%;min-width:0}
#app-shell .search-box input::placeholder{color:var(--text-3);font-size:14px}
.search-box input::-webkit-search-cancel-button{cursor:pointer}
.list{flex:1;overflow-y:auto;min-height:0;order:2;overscroll-behavior:contain}
.connection-bar{order:1;background:#fdeeee;color:#d9534f;font-size:13px;padding:8px 14px;text-align:center}
.plus-menu{position:absolute;top:54px;right:10px;z-index:30;min-width:156px;padding:6px 0;border-radius:8px;background:#4c4c4c;box-shadow:0 6px 24px #0003}
.plus-menu:before{content:"";position:absolute;top:-6px;right:16px;border:6px solid transparent;border-top:0;border-bottom-color:#4c4c4c}
#app-shell .plus-menu button{display:flex;align-items:center;gap:12px;width:100%;padding:12px 18px;color:#fff;font-size:15px;text-align:left}
#app-shell .plus-menu button:hover{background:#ffffff14}
#app-shell .plus-menu .icon{width:20px;height:20px}

/* avatars */
#app-shell .avatar,dialog .avatar{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:#fff;font-size:16px;font-weight:500;background:#b8c0c4;overflow:hidden;user-select:none}
#app-shell .avatar.sm,dialog .avatar.sm{width:32px;height:32px;font-size:13px}
#app-shell .avatar.xl{width:64px;height:64px;font-size:26px}
#app-shell .avatar.msg{width:40px;height:40px}
#app-shell .avatar.clickable{cursor:pointer}
.group-avatar{background:#dcdcdc!important;display:grid!important;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:1.5px;padding:3px}
.group-avatar span{display:flex;align-items:center;justify-content:center;color:#fff;font-size:10px;border-radius:50%;min-width:0;min-height:0}
.group-avatar.n1{grid-template-columns:1fr;grid-template-rows:1fr}.group-avatar.n1 span{font-size:14px}
.group-avatar.n2{grid-template-rows:1fr}.group-avatar.n2 span{align-self:center;aspect-ratio:1}
.group-avatar.n3 span:first-child{grid-column:1/-1;justify-self:center;aspect-ratio:1}

/* conversation list */
.conv-row{display:flex;align-items:center;gap:12px;width:100%;padding:12px 14px;text-align:left;position:relative}
#app-shell .conv-row:hover{background:#ebebeb}
#app-shell .conv-row.pinned{background:#eeeeee}
#app-shell .conv-row.active{background:#dedede}
.face{position:relative;flex-shrink:0}
.face .count,.count.inline{min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--red);color:#fff;font-size:11px;font-style:normal;line-height:18px;text-align:center}
.face .count{position:absolute;top:-6px;right:-7px;border:1.5px solid var(--panel)}
.face .dot{position:absolute;top:-3px;right:-3px;width:10px;height:10px;border-radius:50%;background:var(--red);border:1.5px solid var(--panel)}
.conv-copy{flex:1;min-width:0}
.conv-top,.conv-bottom{display:flex;align-items:center;gap:8px}
.conv-name{flex:1;min-width:0;font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.conv-top time{font-size:11px;color:var(--text-3);flex-shrink:0}
.conv-bottom{margin-top:5px}
.conv-bottom p{flex:1;min-width:0;margin:0;font-size:13px;color:#999;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.at-me{color:var(--red);font-weight:400}
#app-shell .mute-mark{width:14px;height:14px;color:#c4c4c4}
.list-empty{padding:48px 20px;text-align:center;color:#999;font-size:13px;line-height:1.7}
.list-empty p{margin:0 0 10px}
.link-button{color:var(--accent-dark)!important;font-size:14px}
.list-foot{padding:16px;text-align:center;color:#999;font-size:13px;margin:0}

/* contacts */
.contact-row{display:flex;align-items:center;gap:12px;width:100%;padding:10px 16px;text-align:left;min-height:60px;position:relative}
#app-shell .list .contact-row:hover,#app-shell .page .contact-row:is(button):hover{background:#0000000a}
.contact-copy{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.contact-name{font-size:15px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.contact-row>.contact-name{flex:1}
.contact-copy small{font-size:12px;color:#999;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.entry-icon{width:40px;height:40px;border-radius:6px;display:grid;place-items:center;color:#fff;flex-shrink:0}
.entry-icon.orange{background:#fa9d3b}.entry-icon.teal{background:var(--accent)}
.entry-meta{color:#999;font-size:13px}
.letter-head{padding:5px 16px;font-size:12px;color:#888;background:#efefef}
.letter-index{position:absolute;right:2px;top:50%;transform:translateY(-40%);display:flex;flex-direction:column;z-index:3}
#app-shell .letter-index button{font-size:10px;line-height:16px;width:18px;color:#666;text-align:center}
#app-shell .letter-index button:hover{color:var(--accent-dark)}
.tag{margin-left:auto;font-size:12px;color:#999;flex-shrink:0}
.row-actions{margin-left:auto;display:flex;gap:8px;flex-shrink:0}
#app-shell .small-button,dialog .small-button{background:var(--accent);color:#fff;font-size:13px;padding:6px 14px;border-radius:4px}
#app-shell .small-button.ghost,dialog .small-button.ghost{background:#f0f0f0;color:#333}
#app-shell .small-button:disabled,dialog .small-button:disabled{opacity:.55;cursor:default}

/* me */
.me-card,.profile-head,#app-shell .me-card{display:flex;align-items:center;gap:16px;width:100%;padding:24px 16px;background:#fff;text-align:left}
.me-copy{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}
.me-copy strong{font-size:20px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.me-copy span{font-size:13px;color:#888;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.me-copy small{font-size:12px;color:var(--text-3)}
#app-shell .chevron{width:16px;height:16px;color:#c4c4c4}
.tab-me .list{background:var(--bg)}
.selectable{user-select:all}

/* cells */
.cell-group{background:#fff;margin-top:10px}
.cell{display:flex;align-items:center;gap:10px;width:100%;min-height:54px;padding:0 16px;text-align:left;background:#fff;position:relative;font-size:15px;color:var(--text)}
.cell+.cell:before,.contact-row+.contact-row:before,.cell-group>.contact-row+.cell:before{content:"";position:absolute;top:0;left:16px;right:0;border-top:1px solid #efefef}
.list .contact-row+.contact-row:before{left:68px}
#app-shell button.cell:hover,#app-shell a.cell:hover{background:#f7f7f7}
.cell-label{flex:1;min-width:0}
.cell-value{color:#999;font-size:14px;max-width:62%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cell .avatar{margin-left:auto}
#app-shell label.toggle-cell{display:flex;font-size:15px;color:var(--text);cursor:pointer}
#app-shell .switch{appearance:none;-webkit-appearance:none;width:50px;height:30px;margin:0;padding:0;border:0;border-radius:15px;background:#e5e5e5;position:relative;cursor:pointer;flex-shrink:0;transition:background .2s}
#app-shell .switch:before{content:"";position:absolute;top:2px;left:2px;width:26px;height:26px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #0003;transition:transform .2s}
#app-shell .switch:checked{background:var(--accent)}
#app-shell .switch:checked:before{transform:translateX(20px)}
#app-shell .switch:focus-visible{outline:2px solid var(--accent-dark);outline-offset:2px}
.group-head{padding:16px 16px 6px;font-size:13px;color:#888}
.page-note{padding:8px 16px;margin:0;font-size:12px;color:#999;line-height:1.6}
.page-note.center{text-align:center;padding-top:20px}
.member-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(62px,1fr));gap:16px 6px;padding:18px 14px 14px}
.member-tile{display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0;position:relative}
.member-tile .avatar{width:50px!important;height:50px!important;font-size:19px!important}
.member-tile span{font-size:12px;color:#666;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.member-tile em{position:absolute;top:36px;left:50%;transform:translateX(-50%);font-style:normal;font-size:10px;line-height:14px;padding:0 4px;border-radius:7px;background:var(--accent);color:#fff;white-space:nowrap}
.add-icon{width:50px!important;height:50px!important;padding:13px;border:1.5px dashed #c8c8c8;border-radius:50%;color:#aaa}
#app-shell .member-tile.add:hover .add-icon{border-color:var(--accent);color:var(--accent)}
.profile-actions{padding:24px 16px}
#app-shell .block-button,dialog .block-button{display:block;width:100%;height:46px;border-radius:6px;background:var(--accent);color:#fff;font-size:16px;text-align:center}
#app-shell .block-button:hover,dialog .block-button:hover{background:var(--accent-dark)}
#app-shell .block-button.ghost{background:#fff;color:#999;cursor:default}
#app-shell .block-button:disabled,dialog .block-button:disabled{opacity:.5;cursor:default}
#app-shell .danger-button{display:block;width:100%;height:54px;margin-top:10px;background:#fff;color:var(--red);font-size:16px;text-align:center}
#app-shell .danger-button:hover{background:#f7f7f7}
.about-head{display:flex;flex-direction:column;align-items:center;gap:8px;padding:44px 0 28px}
.about-head img{width:64px;height:64px;border-radius:14px}
.about-head strong{font-size:20px;font-weight:600}
.about-head span{font-size:13px;color:#999}
.search-form{padding:10px 12px 0}
.page .search-box,.search-form .search-box{background:#fff;height:38px}
.results{margin-top:10px}
.hit-top{display:flex;justify-content:space-between;gap:8px}
.hit-top time{font-size:11px;color:var(--text-3);flex-shrink:0}
.hit mark{background:none;color:var(--accent-dark)}

/* chat pane */
.chat-pane{position:relative;min-width:0;min-height:0;background:#f5f5f5;overflow:hidden}
.empty-state{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:#c3c3c3}
.empty-state img{width:72px;height:72px;filter:grayscale(1);opacity:.25}
.empty-state p{font-size:14px;letter-spacing:2px;margin:0}
.conversation{display:flex;flex-direction:column;height:100%;min-height:0}
.chat-topbar{border-bottom:1px solid #e7e7e7;padding:0 12px 0 22px}
.chat-title{display:flex;align-items:center;gap:4px}
.chat-title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.chat-title small{font-size:inherit;font-weight:inherit;flex-shrink:0}
#app-shell .muted-icon{width:15px;height:15px;color:#b5b5b5;margin-left:4px}
.messages{flex:1;overflow-y:auto;min-height:0;padding:16px 24px 8px;overscroll-behavior:contain}
.load-more{display:block;margin:0 auto 10px;color:var(--accent-dark)!important;font-size:13px;padding:6px}
.sys-row{text-align:center;margin:14px 0}
.sys-pill{display:inline-block;max-width:80%;padding:4px 9px;border-radius:4px;background:#00000012;color:#8a8a8a;font-size:12px;line-height:1.5}
.sys-row.time .sys-pill{background:none;color:var(--text-3);padding:0}
.message-row{display:flex;align-items:flex-start;gap:10px;margin:0 0 16px;border-radius:6px;transition:background .4s}
.message-row.mine{flex-direction:row-reverse}
.message-row.flash{background:#55b9ac22}
.message-wrap{display:flex;flex-direction:column;align-items:flex-start;max-width:min(70%,560px);min-width:0}
.mine .message-wrap{align-items:flex-end}
.message-name{font-size:12px;color:#999;margin:0 0 4px 2px}
.bubble{position:relative;background:#fff;color:var(--text);border-radius:6px;padding:9px 12px;font-size:15px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;min-height:40px}
.bubble:before{content:"";position:absolute;top:13px;right:100%;border:6px solid transparent;border-right-color:#fff;border-left:0}
.mine .bubble{background:var(--mint)}
.mine .bubble:before{right:auto;left:100%;border-right:0;border-left:6px solid var(--mint)}
.bubble.media{padding:0;background:none;min-height:0}
.bubble.media:before,.bubble.file:before{display:none}
.bubble.file,.mine .bubble.file{background:#fff;padding:12px 14px;width:240px;max-width:100%}
.mention{color:#2b7bbf}
.mine .mention{color:#1d5e8f}
.mention.me{font-weight:600}
.attachment-link{display:block;color:inherit;text-decoration:none}
.attachment-image{display:block;max-width:240px;max-height:240px;border-radius:6px;object-fit:contain;cursor:zoom-in;background:#e5e5e5}
.bubble:not(.media) .attachment-image{margin-top:6px}
.bubble.file .attachment-link{display:flex;align-items:center;gap:12px}
.file-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
.file-name{font-size:14px;line-height:1.4;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal}
.file-info small{font-size:12px;color:#999}
#app-shell .file-icon{width:36px;height:36px;color:var(--accent);stroke-width:1.3}
.message-controls{margin-top:3px}
#app-shell .message-controls button{font-size:12px;color:#999;padding:0 2px}
#app-shell .message-controls button:hover{color:var(--accent-dark)}

/* composer */
.composer{position:relative;flex-shrink:0;background:#fff;border-top:1px solid #e7e7e7;padding:8px 16px 12px}
.composer-row{display:grid;grid-template-columns:auto auto 1fr auto;grid-template-areas:"e a . ." "t t t t" ". . . s";align-items:center;column-gap:4px}
#emoji-button{grid-area:e}#attach-button{grid-area:a}#message-input{grid-area:t}#send-button{grid-area:s}
.tool-button{width:34px;height:34px;display:grid;place-items:center;border-radius:6px;color:#555!important}
#app-shell .tool-button:hover{background:#0000000a}
#app-shell .tool-button .icon{width:24px;height:24px}
#app-shell #message-input{resize:none;border:0;outline:0;background:transparent;width:100%;min-height:72px;max-height:120px;padding:6px 2px;font-size:15px;line-height:1.5;color:var(--text);margin:0}
#app-shell .send-button{background:var(--accent);color:#fff;font-size:14px;padding:7px 24px;border-radius:4px}
#app-shell .send-button:hover{background:var(--accent-dark)}
#app-shell .composer:not(.has-content) .send-button{background:#e9e9e9;color:#a0a0a0}
.pending-attachment{display:flex;align-items:center;gap:8px;margin-bottom:6px;padding:6px 10px;border-radius:6px;background:#f2f2f2;color:#555;font-size:13px}
.pending-attachment span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#app-shell .pending-attachment .icon{width:16px;height:16px}
#app-shell .pending-attachment .remove{font-size:20px;line-height:1;color:#999;padding:0 4px}
.emoji-picker,.mention-picker{position:absolute;bottom:calc(100% + 6px);left:12px;z-index:6;background:#fff;border-radius:8px;box-shadow:0 6px 28px #0000002a}
.emoji-picker{display:grid;grid-template-columns:repeat(8,1fr);gap:2px;padding:10px;width:min(340px,calc(100vw - 24px))}
#app-shell .emoji-picker button{font-size:22px;padding:5px;border-radius:6px}
#app-shell .emoji-picker button:hover{background:#f2f2f2}
.mention-picker{width:240px;max-height:280px;overflow-y:auto;padding:4px 0}
.picker-title{font-size:12px;color:#999;padding:8px 14px 4px}
#app-shell .picker-row{display:flex;align-items:center;gap:10px;width:100%;padding:7px 14px;text-align:left;font-size:14px}
#app-shell .picker-row:hover{background:#f5f5f5}

/* pages */
.page{position:absolute;inset:0;z-index:8;background:var(--bg);display:flex;flex-direction:column}
.page-topbar{background:var(--bg);border-bottom:1px solid #e2e2e2;padding:0 8px;justify-content:space-between}
.page-topbar h2{text-align:center}
.page-body{flex:1;overflow-y:auto;padding-bottom:28px;overscroll-behavior:contain}
.tab-me .list .cell-group:first-of-type{margin-top:10px}

/* dialogs & toast */
dialog#modal{border:0;border-radius:10px;width:380px;max-width:calc(100% - 40px);max-height:calc(100dvh - 60px);padding:20px;background:#fff;box-shadow:0 18px 60px #0000003d}
dialog#modal::backdrop{background:#0000006b}
.modal-heading{display:flex;align-items:center;margin-bottom:14px}
.modal-heading h2{flex:1;margin:0;font-size:17px;font-weight:600}
dialog .modal-close{font-size:26px!important;line-height:1;color:#999!important;width:30px;height:30px}
.modal-form{display:grid;gap:12px}
dialog label.field{display:block;font-size:13px;color:#666}
dialog input:not([type=checkbox]),dialog .picker-filter{display:block;width:100%;margin-top:6px;padding:10px 12px;border:1px solid #e3e3e3;border-radius:6px;font-size:15px;color:var(--text);background:#fff;font-family:inherit}
dialog input:not([type=checkbox]):focus{border-color:var(--accent);outline:0}
dialog input::placeholder{color:#bbb;font-size:14px}
dialog .picker-filter{margin-top:0}
.friend-select{max-height:min(320px,45dvh);overflow-y:auto;border-top:1px solid #f0f0f0;border-bottom:1px solid #f0f0f0}
dialog .pick-row{display:flex;align-items:center;gap:10px;padding:8px 2px;font-size:15px;color:var(--text);cursor:pointer}
dialog .pick-row>span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
dialog .pick-row input[type=checkbox]{width:18px;height:18px;margin:0;accent-color:var(--accent);flex-shrink:0}
.modal-text{font-size:14px;color:#666;line-height:1.6;margin:0 0 12px;overflow-wrap:anywhere}
.modal-text.small{font-size:12px;color:#999;margin:12px 0 0}
.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}
dialog .list-empty{padding:20px}
.toast{position:fixed;left:50%;top:45%;transform:translate(-50%,-50%);z-index:99;max-width:80%;padding:11px 18px;border-radius:8px;background:#111111d9;color:#fff;font-size:14px;text-align:center;line-height:1.5;pointer-events:none}

/* tablet */
@media(min-width:681px) and (max-width:960px){.workspace{grid-template-columns:56px 240px minmax(0,1fr)}.messages{padding:14px 16px 8px}.message-wrap{max-width:78%}}

#app-shell .me-card{background:#fff}
#app-shell .me-card:hover{background:#fafafa}
/* mobile */
@media(max-width:680px){
.mobile-only{display:grid!important}
.workspace{display:block;position:relative;height:100dvh}
.rail{position:fixed;left:0;right:0;bottom:0;z-index:10;flex-direction:row;justify-content:space-around;align-items:stretch;gap:0;height:calc(56px + env(safe-area-inset-bottom));padding:0 0 env(safe-area-inset-bottom);background:var(--panel);border-top:1px solid #e2e2e2}
.rail-avatar,.rail-settings{display:none!important}
.tab{flex:1;width:auto;height:56px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:#7f7f7f;border-radius:0}
.tab span{display:block;font-size:10px}
.tab .icon{width:26px;height:26px}
.tab:hover{color:#7f7f7f}
.tab.selected,.tab.selected:hover{color:var(--accent-dark)}
.tab-badge{top:4px;right:auto;left:calc(50% + 6px)}
.sidebar{position:absolute;inset:0 0 calc(56px + env(safe-area-inset-bottom)) 0;border:0;background:#fff}
.sidebar .topbar{height:48px;background:var(--bg);padding:0 6px;justify-content:center}
.sidebar .topbar h1{text-align:center;font-size:17px;padding:0 44px}
.topbar-right{position:absolute;right:4px;top:5px}
.search-row{background:var(--bg);padding:0 10px 8px}
.search-box{background:#fff;height:36px;justify-content:center}
.plus-menu{top:46px;right:8px}
.conv-row{padding:12px 16px}
.conv-row+.conv-row:before{content:"";position:absolute;top:0;left:72px;right:0;border-top:1px solid #efefef}
#app-shell .conv-row:hover{background:transparent}
#app-shell .conv-row.pinned{background:#f6f6f6}
#app-shell .conv-row.active{background:transparent}
#app-shell .conv-row:active{background:#ececec}
.face .count,.face .dot{border-color:#fff}
.avatar.msg{width:40px!important;height:40px!important}
.letter-head{background:var(--bg)}
.chat-pane{display:none;position:fixed;inset:0;z-index:20;background:var(--bg)}
.workspace.chat-open .chat-pane,.workspace.page-open .chat-pane{display:block}
.empty-state{display:none}
.chat-topbar{height:48px;background:var(--bg);border-bottom:1px solid #e0e0e0;padding:0 6px;justify-content:space-between}
.chat-title{justify-content:center;font-size:17px!important;padding:0 6px}
.messages{padding:12px 12px 6px;background:var(--bg)}
.message-wrap{max-width:calc(100% - 100px)}
.bubble{font-size:16px}
.composer{background:var(--panel);border-top:1px solid #e0e0e0;padding:8px 8px calc(8px + env(safe-area-inset-bottom))}
.composer-row{grid-template-columns:36px 1fr 36px auto;grid-template-areas:"e t a s";column-gap:6px;align-items:end}
.tool-button{width:36px;height:40px}
#app-shell .tool-button .icon{width:27px;height:27px}
#app-shell #message-input{min-height:40px;max-height:110px;padding:8px 10px;background:#fff;border-radius:6px;font-size:16px}
#app-shell .send-button{height:36px;margin-bottom:2px;padding:0 14px}
#app-shell .composer:not(.has-content) .send-button{display:none}
.emoji-picker{left:8px}
.page-body{padding-bottom:calc(28px + env(safe-area-inset-bottom))}
.page-topbar{height:48px}
.page-topbar h2{font-size:17px}
.me-card{padding:36px 20px 30px}
#app-shell .topbar-btn:hover,#app-shell .tool-button:hover,#app-shell .me-card:hover{background:none}
#app-shell .me-card:hover{background:#fff}
dialog#modal{width:auto}
}

/* phase 2: group announcement, read-only groups, management */
.announcement-bar{display:flex;align-items:center;flex-shrink:0;margin:8px 16px 0;background:#fff;border-radius:6px;box-shadow:0 1px 2px #0000000d}
.announcement-bar[hidden]{display:none}
#app-shell .announcement-open{flex:1;min-width:0;display:flex;align-items:center;gap:8px;padding:9px 4px 9px 12px;text-align:left;font-size:13px;color:#555}
#app-shell .announcement-open .icon{width:18px;height:18px;color:#f6903d}
.announcement-open span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#app-shell .announcement-close{display:grid;place-items:center;width:34px;height:34px;color:#b5b5b5}
#app-shell .announcement-close .icon{width:15px;height:15px}
#app-shell .announcement-close:hover{color:#777}
.readonly-bar{flex-shrink:0;padding:14px 16px calc(14px + env(safe-area-inset-bottom));background:#fff;border-top:1px solid #e7e7e7;text-align:center;font-size:13px;color:#999}
.readonly-bar[hidden],.composer[hidden]{display:none}
.sys-row.system .sys-pill{overflow-wrap:anywhere}
#app-shell .sys-pill.link{cursor:pointer;color:#6b7d99}
#app-shell .sys-pill.link:hover{text-decoration:underline}
.cell.stack{flex-wrap:wrap;row-gap:4px;padding-top:14px;padding-bottom:14px}
.cell.stack .cell-sub{order:3;flex-basis:100%;color:#999;font-size:13px;line-height:1.55;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;white-space:pre-wrap;overflow-wrap:anywhere}
.announcement-page{background:#fff;margin-top:10px;padding:16px}
.announcement-head{display:flex;align-items:center;gap:10px;padding-bottom:12px;border-bottom:1px solid #f0f0f0}
.announcement-head small{display:block;font-size:12px;color:#aaa;margin-top:2px}
.announcement-body{padding-top:14px;font-size:15px;line-height:1.75;color:var(--text);white-space:pre-wrap;overflow-wrap:anywhere}
.announcement-page .list-empty{padding:24px 0;text-align:center}
dialog .modal-input{display:block;width:100%;padding:10px 12px;border:1px solid #e3e3e3;border-radius:6px;font-size:15px;color:var(--text);background:#fff;font-family:inherit;resize:vertical;line-height:1.6}
dialog .modal-input:focus{border-color:var(--accent);outline:0}
dialog .input-count{justify-self:end;margin-top:-6px;font-size:12px;color:#aaa}
@media(max-width:680px){.announcement-bar{margin:8px 10px 0}}
