/* Shared chat structure + WeChat skin. No legacy chat rules remain in runtime/compat. */
.sim-device .chat-glyph{display:block;width:27px;height:27px;flex-shrink:0;pointer-events:none}
.sim-device .wx-page{background:var(--wx-surface)!important;padding-bottom:0;color:#111}
.wx-nav{height:44px;min-height:44px;position:relative;display:flex;align-items:center;justify-content:center;padding:0 16px}
.wx-nav>b{font-size:17px;font-weight:600}.wx-nav>button{position:absolute;right:8px;width:44px;height:44px;display:grid;place-items:center}.wx-nav .chat-glyph{width:25px;height:25px}
.sim-device .wx-page .sim-search{height:36px;min-height:36px;margin:7px 8px 8px;background:#fff;border-radius:7px;justify-content:center;padding:0 12px;gap:6px}
.wx-page .sim-search:has(input:placeholder-shown):not(:focus-within) .sim-search-input{flex:0 1 61px;text-align:left}.wx-page .sim-search-input{width:100%;min-width:0;font-size:16px;height:36px;line-height:36px}.wx-page .sim-search .icon{width:18px;height:18px}
.sim-thread{position:relative;display:flex;align-items:center;width:100%;min-height:74px;padding:12px 16px;gap:12px;text-align:left;background:white}.sim-thread:active{background:#e4e4e4}.sim-thread+.sim-thread:before{content:'';position:absolute;top:0;left:76px;right:0;border-top:.5px solid #e8e8e8}
.wx-thread-avatar{position:relative;flex-shrink:0;width:48px;height:48px}.wx-thread-avatar>.avatar{width:48px;height:48px;border-radius:6px;overflow:hidden}.wx-count{position:absolute;top:-5px;right:-6px;min-width:18px;height:18px;line-height:18px;padding:0 4px;border-radius:12px;background:#fa5151;color:#fff;text-align:center;font-size:11px;font-style:normal}
.sim-thread-info{min-width:0;flex:1}.sim-thread-info>div{display:flex;align-items:center;justify-content:space-between;gap:9px}.sim-thread-info b{font-size:17px;line-height:1.4;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sim-thread-info small{font-size:11px;color:#aaa;white-space:nowrap}.sim-thread-info p{display:block;margin:5px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px;line-height:1.4;color:#999}
.wx-tabs{display:flex;justify-content:space-around;flex-shrink:0;min-height:83px;height:var(--ios-tab-height);padding:6px 0 var(--phone-safe-bottom);background:#f7f7f7;border-top:.5px solid #d9d9d9}.wx-tabs>button{display:flex;flex-direction:column;align-items:center;gap:3px;min-width:64px;min-height:44px;padding:0;font-size:10px;line-height:1.3;color:#222}.wx-tabs .chat-glyph{width:26px;height:26px}.wx-tabs .active{color:var(--wx-tab-accent)}.wx-tabs .active .chat-glyph{fill:currentColor;stroke:currentColor}.wx-tabs .active .chat-glyph path+path{fill:none;stroke:#f7f7f7}
.wx-contact-row{width:100%;display:flex;align-items:center;min-height:68px;gap:14px;padding:11px 16px;border-bottom:.5px solid #eee;background:white;font-size:17px;text-align:left}.wx-contact-row>.avatar{width:46px;height:46px;border-radius:6px}.wx-contact-row b{font-weight:400}
.wx-menu-row{display:flex;align-items:center;width:100%;gap:16px;padding:16px 20px;min-height:58px;background:white;margin-bottom:10px;font-size:17px;text-align:left}.wx-menu-row>span{flex:1}.wx-menu-row>.icon{width:26px;height:26px;color:#697f97}.wx-menu-row>.icon:last-child{width:13px;color:#aaa}
.wx-profile{display:flex;align-items:center;padding:32px 24px;gap:20px;margin-bottom:12px;background:white}.wx-profile>.avatar{width:68px;height:68px;border-radius:8px}.wx-profile b{font-size:24px}.wx-profile p{font-size:14px;color:#888;margin:8px 0 0}
.sim-device .sim-chat-page{padding-bottom:max(var(--phone-safe-bottom),var(--sim-ime-height));transition:padding-bottom .28s cubic-bezier(.22,.82,.2,1);background:var(--wx-surface)!important;color:#111}
.sim-chat-nav{height:44px;min-height:44px;display:grid;grid-template-columns:64px minmax(0,1fr) 64px;align-items:center;padding:0 10px;gap:8px;background:var(--wx-surface);border-bottom:.5px solid #d9d9d9}.sim-chat-nav>b{font-size:17px;font-weight:600;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sim-chat-nav .sim-back{justify-self:start;min-width:44px;gap:0;color:#111;font-size:17px}.chat-header-actions{display:flex;align-items:center;justify-self:end}.wx-chat-more{height:44px;width:44px;min-width:44px;display:grid;place-items:center;font-size:24px;padding:0}.wx-chat-more .chat-glyph{width:25px;height:25px}
.sim-message-scroll{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:none;overscroll-behavior:contain;touch-action:pan-y;padding:12px 12px 18px;background:var(--wx-surface)}
.sim-message-date{clear:both;color:#999;text-align:center;font-size:12px;line-height:1.5;margin:10px 0 20px}.sim-bubble-row{display:flex;flex-direction:row;align-items:flex-start;gap:10px;width:100%;max-width:100%;padding:0;margin:0 0 18px;position:relative}.sim-bubble-row.me{flex-direction:row-reverse}.sim-bubble-row>.avatar{width:40px;height:40px;border-radius:5px;flex-shrink:0;overflow:hidden}
.sim-bubble{position:relative;min-height:42px;max-width:calc(100% - 114px);padding:9px 12px;background:white;border-radius:4px;color:#111;font-size:17px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere;box-sizing:border-box}.sim-bubble:before{content:'';position:absolute;width:8px;height:8px;top:15px;left:-4px;background:inherit;transform:rotate(45deg)}.me .sim-bubble{background:var(--wx-outgoing)}.me .sim-bubble:before{left:auto;right:-4px}
.sim-compose{display:flex;align-items:flex-end;flex-shrink:0;min-height:56px;height:auto;padding:6px 5px;gap:4px;background:#f7f7f7;border-top:.5px solid #d9d9d9;box-sizing:border-box}.wx-compose-icon{width:44px;height:44px;min-width:44px!important;min-height:44px;display:flex;align-items:center;justify-content:center;flex-shrink:0;padding:0;color:#303030}.wx-compose-icon .chat-glyph{width:28px;height:28px}
.sim-compose-field{flex:1;min-width:0;min-height:44px;max-height:102px;padding:8px 10px;border:0;border-radius:5px;background:white;font-size:17px;line-height:1.6;white-space:pre-wrap;overflow-y:auto;cursor:text;outline:0;box-sizing:border-box}.sim-compose-field [data-reply-text]{color:#111}.sim-cursor{display:inline-block;position:static;vertical-align:middle;width:1.5px;height:21px;margin-left:1px;background:var(--wx-accent);animation:cursor-blink 1s steps(1) infinite}
.sim-device .sim-send{display:none;width:58px;min-width:58px;height:44px;min-height:44px;flex-shrink:0;border-radius:5px;padding:0;transform:none;color:white;background:var(--wx-accent);font-size:15px}.sim-device .sim-send.ready{display:grid;place-items:center}.sim-send:disabled{opacity:.45}.wx-plus.hidden{display:none}
.wx-attachment-panel{display:flex;flex-shrink:0;padding:26px;gap:28px;background:#f5f5f5}.wx-attachment-panel>button{display:flex;flex-direction:column;align-items:center;gap:9px;font-size:13px}.wx-attachment-panel .icon{width:30px;height:30px;padding:17px;box-sizing:content-box;background:white;border-radius:14px}.wx-emoji-panel{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;padding:24px;background:#f6f6f6}.wx-emoji-panel>button{min-height:48px;font-size:32px}.wx-pending{font-size:16px;color:#999;align-self:center}
@keyframes cursor-blink{50%{opacity:0}}
@media(prefers-reduced-motion:reduce){.sim-device .sim-chat-page{transition:none}}
.sim-device .sim-candidates{height:42px}.sim-device .sim-candidates>span,.sim-device .sim-candidates>b{font-size:16px;line-height:24px}.sim-device .sim-candidates>span:first-child{font-size:12px}.sim-device .sim-hide-kbd{height:42px;width:35px;min-width:35px;min-height:42px}.sim-device .sim-hide-kbd .icon{width:18px;height:18px}
.sim-device .sim-key-rows{padding:10px 4px 0;gap:10px}.sim-device .sim-key-row{height:42px;gap:6px}.sim-device .sim-key-row.inset{padding:0 16px}
.sim-device .sim-keyboard .sim-key{min-width:0;min-height:42px;border-radius:6px;font-size:22px;line-height:1;touch-action:manipulation}
.sim-device .sim-key.modifier{min-width:35px;max-width:48px;font-size:21px}.sim-device .sim-key.space{font-size:16px}.sim-device .sim-key.return{font-size:14px}.sim-device .sim-key-row.bottom .modifier{font-size:14px}
.sim-device .sim-key.down:before{bottom:18px;height:61px;border-radius:7px 7px 1px 1px;font-size:33px;padding-top:4px}.sim-device .sim-keyboard-bottom{height:55px;padding:12px 24px 0;font-size:26px}

/* Discover uses grouped rows; only authored Moments is an active story entry. */
.sim-device .wx-discover-page{background:#ededed}.wx-discover-page>.wx-nav{background:#ededed}.wx-discover-page>.sim-list-scroll{padding:0 0 12px}.wx-discover-group{background:#fff;margin:0 0 9px}.sim-device .wx-discover-row{width:100%;min-height:54px;display:flex;align-items:center;gap:17px;padding:11px 15px;background:#fff;color:#171717;text-align:left;border:0;position:relative;font-size:17px;line-height:1.4;box-sizing:border-box}.wx-discover-row:disabled{opacity:1;cursor:default}.wx-discover-row+ .wx-discover-row:before{content:"";position:absolute;left:54px;right:0;top:0;border-top:.5px solid #ececec}.wx-discover-icon{display:grid;place-items:center;width:23px;height:25px;flex-shrink:0}.wx-discover-icon>svg{width:23px;height:23px}.wx-discover-row>span:nth-child(2){flex:1}.wx-discover-row>.icon:last-child{width:13px;height:18px;color:#b7b7b7;flex-shrink:0}.wx-discover-preview{width:29px;height:29px;position:relative;flex-shrink:0}.wx-discover-preview>.avatar{width:29px;height:29px;border-radius:4px}.wx-discover-preview>i{position:absolute;right:-3px;top:-3px;width:7px;height:7px;border-radius:50%;background:#f05255;border:1px solid #fff}
