#ptg-chatroom{--chat-bg:#f6f7fa;--chat-card:#fff;--chat-text:#242833;--chat-muted:#7a8191;--chat-line:#e6e8ee;--chat-active:#fff1e8;color:var(--chat-text);width:100%;font-size:14px}
body.dark #ptg-chatroom,body.night #ptg-chatroom,body.dark-open #ptg-chatroom,html[data-bs-theme=dark] #ptg-chatroom,html[data-theme=dark] #ptg-chatroom,body[data-theme=dark] #ptg-chatroom{--chat-bg:#111214;--chat-card:#191b1e;--chat-text:#e8eaee;--chat-muted:#a3a8b2;--chat-line:#303237;--chat-active:#39251b}
.ptg-chatroom-main{width:100%;max-width:1600px;margin:0 auto;padding:20px 24px}#ptg-chatroom [hidden]{display:none!important}#ptg-chatroom button,#ptg-chatroom input,#ptg-chatroom select,#ptg-chatroom textarea{font:inherit}#ptg-chatroom button{cursor:pointer;border:1px solid var(--chat-line);background:var(--chat-card);color:var(--chat-text);border-radius:10px;padding:8px 12px}#ptg-chatroom button:disabled{opacity:.5;cursor:default}#ptg-chatroom button:focus-visible,#ptg-chatroom a:focus-visible{outline:2px solid #ff6500;outline-offset:2px}#ptg-chatroom input,#ptg-chatroom select{border:1px solid var(--chat-line);border-radius:10px;background:var(--chat-card);color:var(--chat-text);padding:9px 10px;min-width:0}
.ptg-chatroom-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 18px}.ptg-chatroom-heading h1{font-size:25px;font-weight:700;margin:0 0 4px}.ptg-chatroom-heading p,.ptg-chatroom-tip{color:var(--chat-muted);font-size:13px;margin:0}.ptg-chatroom-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap}#ptg-chat-find,#ptg-chat-send{background:#ff6000!important;border-color:#ff6000!important;color:#fff!important}
.ptg-chatroom-stage{height:calc(100dvh - 205px);min-height:520px;max-height:1050px;display:grid;grid-template-columns:238px minmax(0,1fr);overflow:hidden;border:1px solid var(--chat-line);border-radius:20px;background:var(--chat-card)}.ptg-chat-sidebar{background:var(--chat-bg);padding:16px 10px;overflow:auto;border-right:1px solid var(--chat-line);scrollbar-width:thin}#ptg-chat-filter{width:100%;margin-bottom:12px}.ptg-chat-roomgroup{margin-bottom:10px}.ptg-chat-roomgroup summary{cursor:pointer;font-size:12px;font-weight:600;color:var(--chat-muted);padding:7px 8px}.ptg-chat-room{width:100%;display:flex;align-items:center;gap:9px;text-align:left;border:0!important;background:transparent!important;padding:9px!important;min-height:52px}.ptg-chat-room:hover{background:var(--chat-card)!important}.ptg-chat-room[aria-current=true]{background:var(--chat-active)!important;color:#f7610c!important}.ptg-chat-avatar{width:34px;height:34px;flex:0 0 34px;border-radius:9px;object-fit:cover;background:#ffecdf;display:inline-flex;align-items:center;justify-content:center;color:#ea650d;font-weight:700;position:relative}.ptg-chat-avatar img{width:100%;height:100%;object-fit:cover;border-radius:inherit}.ptg-chat-room-label{flex:1;min-width:0;line-height:1.35;overflow-wrap:anywhere}.ptg-chat-unread{font-size:11px;min-width:18px;border-radius:10px;background:#ff6000;color:#fff;text-align:center;padding:0 4px}.ptg-chat-online::after{content:"";position:absolute;width:9px;height:9px;border:2px solid var(--chat-card);border-radius:50%;background:#29c48c;right:-2px;bottom:-2px}
.ptg-chat-conversation{min-width:0;min-height:0;display:flex;flex-direction:column;position:relative}.ptg-chat-roomhead{display:flex;align-items:center;gap:10px;padding:14px 20px;border-bottom:1px solid var(--chat-line);flex-shrink:0}.ptg-chat-roomhead h2{font-size:16px;font-weight:700;margin:0 0 3px}.ptg-chat-roomhead span[role=status]{color:var(--chat-muted);font-size:12px}#ptg-chat-menu{display:none}#ptg-chat-state{padding:16px;text-align:center;color:var(--chat-muted);font-size:13px;border-bottom:1px solid var(--chat-line)}#ptg-chat-state button{margin-left:10px}#ptg-chat-messages{flex:1;min-height:0;overflow:auto;padding:18px 22px;overscroll-behavior:contain;scrollbar-width:thin;overflow-anchor:none}#ptg-chat-older{display:block;margin:0 auto 16px;color:var(--chat-muted)!important;font-size:12px!important}.ptg-chat-message{display:flex;gap:9px;margin:0 0 18px;align-items:flex-start}.ptg-chat-message-body{max-width:min(82%,720px);min-width:0}.ptg-chat-message-meta{font-size:12px;color:var(--chat-muted);margin:0 0 4px;display:flex;gap:9px;align-items:baseline}.ptg-chat-message-meta strong{color:var(--chat-text);font-weight:600}.ptg-chat-message-text{background:var(--chat-bg);padding:10px 13px;border-radius:0 12px 12px 12px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65}.ptg-chat-message.own{flex-direction:row-reverse}.ptg-chat-message.own .ptg-chat-message-meta{justify-content:flex-end}.ptg-chat-message.own .ptg-chat-message-text{background:var(--chat-active);border-radius:12px 0 12px 12px}.ptg-chat-system{text-align:center;color:var(--chat-muted);font-size:12px;margin:12px 0}.ptg-chat-media{display:block;max-width:100%;width:auto;max-height:320px;border-radius:10px;margin-top:7px}.ptg-chat-media-placeholder{color:var(--chat-muted);font-size:12px}#ptg-chat-new{position:absolute;bottom:185px;left:50%;transform:translateX(-50%);box-shadow:0 4px 20px #0001;color:#ff6000!important}
#ptg-chat-composer{position:relative;margin:0;padding:12px 18px 8px;border-top:1px solid var(--chat-line);background:var(--chat-card);flex-shrink:0}#ptg-chat-text{resize:none;width:100%;border:0;background:transparent;outline:none;color:var(--chat-text);line-height:1.6;box-shadow:none;min-height:64px;max-height:150px;padding:3px}.ptg-chat-compose-tools{display:flex;gap:5px;align-items:center}.ptg-chat-compose-tools button{font-size:13px!important;padding:6px 10px!important;border:0!important;background:transparent!important}.ptg-chat-sendhint{margin-left:auto;font-size:11px;color:var(--chat-muted)}#ptg-chat-send{margin-left:auto;min-width:65px}#ptg-chat-compose-status{min-height:17px;margin:3px 0 0;color:#c85d15;font-size:12px}#ptg-chat-emoji,#ptg-chat-mentions{position:absolute;bottom:100%;left:18px;background:var(--chat-card);border:1px solid var(--chat-line);border-radius:12px;box-shadow:0 5px 24px #0002;max-width:340px;padding:10px;z-index:2}#ptg-chat-emoji{display:grid;grid-template-columns:repeat(8,1fr);gap:3px}#ptg-chat-emoji button{font-size:22px;padding:3px;border:0}#ptg-chat-mentions{max-height:230px;overflow:auto}#ptg-chat-mentions button{display:flex;align-items:center;gap:8px;border:0;width:100%}.ptg-chatroom-tip{margin:10px 0 0}
#ptg-chat-players{width:min(460px,94vw);padding:22px;background:var(--chat-card);color:var(--chat-text);border:1px solid var(--chat-line);border-radius:18px}#ptg-chat-players::backdrop{background:#0007;backdrop-filter:blur(4px)}#ptg-chat-players form{display:flex;align-items:center;justify-content:space-between}#ptg-chat-players h2{font-size:20px}#ptg-chat-query{width:100%}#ptg-chat-results{max-height:300px;overflow:auto;margin:14px 0}#ptg-chat-results button{width:100%;display:flex;gap:10px;align-items:center;margin:5px 0;text-align:left}.ptg-chat-dialog-actions{display:flex;gap:8px;margin-top:16px}#ptg-chat-dialog-error{color:#d75d14;font-size:13px}
.ptg-chat-popup .ptg-chatroom-main{padding:14px;max-width:none}.ptg-chat-popup .ptg-chatroom-stage{height:calc(100dvh - 115px);min-height:300px;max-height:none}.ptg-chat-popup #wpadminbar,.ptg-chat-popup .rollbar,.ptg-chat-popup .ptg-global-sidebar{display:none!important}html:has(body.ptg-chat-popup){margin-top:0!important}.ptg-chat-popup{margin:0!important;overflow:hidden}
@media(max-width:900px){.ptg-chatroom-main{padding:12px}.ptg-chatroom-heading{align-items:flex-start}.ptg-chatroom-heading p{display:none}.ptg-chatroom-heading h1{font-size:20px}.ptg-chatroom-tools{gap:5px}.ptg-chatroom-tools button,.ptg-chatroom-tools select{font-size:12px!important;padding:7px!important}.ptg-chatroom-stage{grid-template-columns:195px minmax(0,1fr)}.ptg-chat-sendhint{display:none}}
@media(max-width:620px){.ptg-chatroom-heading{flex-wrap:wrap;gap:10px}.ptg-chatroom-stage{display:flex;height:calc(100dvh - 205px);min-height:400px;position:relative}.ptg-chat-conversation{width:100%}.ptg-chat-sidebar{display:none;position:absolute;inset:0 auto 0 0;width:230px;z-index:5;box-shadow:8px 0 30px #0002}.ptg-chatroom-stage.show-rooms .ptg-chat-sidebar{display:block}#ptg-chat-menu{display:block}.ptg-chat-roomhead{padding:10px}#ptg-chat-messages{padding:12px}#ptg-chat-composer{padding:10px}.ptg-chat-popup .ptg-chatroom-stage{height:calc(100dvh - 150px)}.ptg-chatroom-tip{font-size:11px}}
.ptg-chat-popup{padding:0!important;background:#f6f7fa}.ptg-chat-popup .ptg-chatroom-main{height:100dvh;display:flex;box-sizing:border-box}.ptg-chat-popup #ptg-chatroom{display:flex;flex-direction:column;min-height:0;flex:1}.ptg-chat-popup .ptg-chatroom-stage{flex:1;height:auto;min-height:0}.ptg-chat-popup .ptg-chatroom-heading,.ptg-chat-popup .ptg-chatroom-tip{flex-shrink:0}body.ptg-chat-popup.dark-open,html[data-bs-theme=dark] body.ptg-chat-popup{background:#111214}
#ptg-chat-composer .ptg-chat-pending:not([hidden]){display:flex;align-items:center;gap:10px;margin:0 0 8px;padding:8px;background:var(--chat-card);border:1px solid var(--chat-line);border-radius:10px}.ptg-chat-pending-media img,.ptg-chat-pending-media video{display:block;max-width:100px;max-height:72px;border-radius:6px;object-fit:contain}.ptg-chat-pending-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}.ptg-chat-pending-remove{border:0;background:transparent;color:var(--chat-text);font-size:22px;cursor:pointer}
.ptg-chat-media-wrap{position:relative;display:inline-flex;flex-direction:column;align-items:flex-start;gap:5px}.ptg-chat-media-wrap img,.ptg-chat-pending-media img,.ptg-chat-pending-media video{cursor:zoom-in}.ptg-chat-media-zoom{border:1px solid var(--chat-line);border-radius:8px;background:var(--chat-card);color:var(--chat-text);padding:3px 9px;font-size:12px;cursor:pointer}.ptg-chat-viewer{position:fixed;inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;background:rgba(10,10,14,.94);color:#fff;z-index:999999}.ptg-chat-viewer::backdrop{background:rgba(0,0,0,.8)}.ptg-chat-viewer-bar{height:56px;display:flex;align-items:center;justify-content:flex-end;gap:10px;padding:8px 20px}.ptg-chat-viewer-bar span{margin-right:auto}.ptg-chat-viewer-bar button{border:1px solid #777;background:#252525;color:white;border-radius:8px;padding:7px 12px}.ptg-chat-viewer-stage{height:calc(100% - 56px);overflow:auto;display:flex;align-items:center;justify-content:center}.ptg-chat-viewer-stage img,.ptg-chat-viewer-stage video{max-width:90%;max-height:90%;object-fit:contain;transform-origin:center;transition:transform .08s}
body.ptg-chat-support .ptg-chatroom-heading,body.ptg-chat-support .ptg-chat-sidebar,body.ptg-chat-support .ptg-chatroom-tip,body.ptg-chat-support #ptg-chat-menu{display:none!important}body.ptg-chat-support .ptg-chatroom-main{padding:0!important}body.ptg-chat-support .ptg-chatroom-stage{border:0;border-radius:0;min-height:0;flex:1}body.ptg-chat-support .ptg-chat-conversation{width:100%}body.ptg-chat-support #ptg-chat-composer{padding:8px 12px}body.ptg-chat-support #ptg-chat-text{min-height:44px}body.ptg-chat-support .ptg-chat-sendhint{display:none}
body.ptg-chat-support .ptg-chatroom-stage{display:flex!important;grid-template-columns:none!important;width:100%!important;height:auto!important;max-height:none!important}body.ptg-chat-support .ptg-chat-conversation{flex:1 1 100%;min-width:0!important;width:100%!important}body.ptg-chat-support .ptg-chat-roomhead{flex-shrink:0}body.ptg-chat-support .ptg-chat-compose-tools{flex-wrap:nowrap}body.ptg-chat-support .ptg-chat-compose-tools button{white-space:nowrap}#ptg-chatroom .ptg-chat-avatar{width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;flex:0 0 34px!important;aspect-ratio:1;overflow:visible}#ptg-chatroom .ptg-chat-avatar img{display:block;width:34px!important;height:34px!important;min-width:34px!important;max-width:none!important;max-height:none!important;object-fit:cover!important;aspect-ratio:1}
#ptg-chatroom .ptg-chat-avatar-link{cursor:pointer}#ptg-chatroom .ptg-chat-avatar-link:hover{outline:2px solid #ff6500;outline-offset:2px}.ptg-chat-room-actions{margin-left:auto;display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.ptg-chat-room-actions button{font-size:12px!important;white-space:nowrap}.ptg-chat-message-body .ptg-chat-receipt,.ptg-chat-message-body .ptg-chat-recall{border:0!important;background:transparent!important;font-size:11px!important;color:var(--chat-muted)!important;padding:3px 5px!important;align-self:flex-start}.ptg-chat-message.own .ptg-chat-receipt,.ptg-chat-message.own .ptg-chat-recall{align-self:flex-end}.ptg-chat-receipt:hover,.ptg-chat-recall:hover{color:#ff6500!important}.ptg-chat-search-player{width:100%;display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px!important;text-align:left}#ptg-chat-player-search:not(:empty){padding-bottom:12px;border-bottom:1px solid var(--chat-line);margin-bottom:12px}.ptg-chat-receipt-dialog{border:1px solid #ddd;border-radius:16px;padding:20px;max-width:90vw;width:480px;max-height:80dvh;background:#fff;color:#242833}.ptg-chat-receipt-dialog::backdrop{background:#0008}.ptg-chat-receipt-dialog header{display:flex;justify-content:space-between;align-items:center;gap:20px}.ptg-chat-receipt-dialog h3{font-size:15px;margin:18px 0 10px}.ptg-chat-receipt-people{display:grid;grid-template-columns:1fr 1fr;gap:12px}.ptg-chat-receipt-people>div{display:flex;align-items:center;gap:8px;font-size:13px}.ptg-chat-receipt-people img{width:34px!important;height:34px!important;object-fit:cover}.ptg-chat-receipt-people .ptg-chat-avatar{width:34px;height:34px;flex:0 0 34px}.dark-open .ptg-chat-receipt-dialog{background:#1a1b1e;color:#eee;border-color:#444}body.ptg-chat-support #ptg-chatroom{font-size:14px!important}body.ptg-chat-support .ptg-chat-roomhead{padding:12px 18px!important;gap:10px;flex-wrap:wrap}body.ptg-chat-support .ptg-chat-room-actions{margin-left:auto}body.ptg-chat-support #ptg-chat-messages{padding:18px!important}body.ptg-chat-support #ptg-chat-text{min-height:64px!important;font-size:14px!important}body.ptg-chat-support .ptg-chat-compose-tools button{font-size:13px!important}

#ptg-chatroom .ptg-chat-members-button{color:var(--chat-muted);font-size:12px!important;white-space:nowrap}#ptg-chatroom .ptg-chat-members-button:hover{color:#ff6500;border-color:#ffb888}.ptg-chat-members-drawer{position:absolute;z-index:6;right:0;top:0;bottom:0;width:min(320px,90%);display:flex;flex-direction:column;background:var(--chat-card);border-left:1px solid var(--chat-line);box-shadow:-8px 0 24px #0001;padding:18px}.ptg-chat-members-drawer header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.ptg-chat-members-drawer header strong{font-size:16px}.ptg-chat-members-drawer header button{font-size:22px!important;line-height:1;border:0!important;padding:4px 8px!important}.ptg-chat-members-drawer input{width:100%}.ptg-chat-members-list{overflow:auto;min-height:0;margin-top:12px}.ptg-chat-member{display:flex;align-items:center;gap:12px;padding:9px 4px;border-radius:8px}.ptg-chat-member:hover{background:var(--chat-bg)}.ptg-chat-members-empty{color:var(--chat-muted);text-align:center;padding:20px 0;font-size:13px}

/* 会话列表与聊天区 */
.ptg-chatroom-stage{border-radius:16px;box-shadow:0 8px 32px #1822350c}.ptg-chat-sidebar{padding:16px 12px;background:var(--chat-bg)}#ptg-chat-filter{margin-bottom:10px}.ptg-chat-filters{display:flex;gap:6px;padding-bottom:10px;border-bottom:1px solid var(--chat-line);margin-bottom:8px}.ptg-chat-filters button{border:0!important;background:transparent!important;color:var(--chat-muted)!important;padding:6px 14px!important;font-size:13px!important}.ptg-chat-filters button[aria-pressed=true]{background:var(--chat-active)!important;color:#f7610c!important;font-weight:600}.ptg-chat-list-empty{padding:18px 8px;color:var(--chat-muted);font-size:12px;text-align:center}.ptg-chat-roomgroup summary{padding:9px 8px}.ptg-chat-room{border-radius:9px!important}.ptg-chat-roomhead{min-height:70px;background:var(--chat-card)}.ptg-chat-roomhead h2{font-size:16px}.ptg-chat-room-actions button{border-color:transparent!important;background:transparent!important;color:var(--chat-muted)!important}.ptg-chat-room-actions button:hover{background:var(--chat-bg)!important;color:#ff6500!important}#ptg-chat-messages{background:var(--chat-card)}.ptg-chat-message{margin-bottom:20px}.ptg-chat-message-text{border-radius:4px 12px 12px 12px}.ptg-chat-message.own .ptg-chat-message-text{border-radius:12px 4px 12px 12px}.ptg-chat-message-body .ptg-chat-copy{border:0!important;background:transparent!important;color:var(--chat-muted)!important;font-size:11px!important;padding:3px 5px!important}.ptg-chat-message-body .ptg-chat-copy:hover{color:#ff6500!important}#ptg-chat-composer{padding:12px 18px;background:var(--chat-card)}#ptg-chat-text{min-height:76px}#ptg-chat-send{border-radius:8px!important}.ptg-chat-members-drawer{box-shadow:-10px 0 30px #0002}@media(max-width:620px){.ptg-chat-room-actions{gap:0}.ptg-chat-room-actions button{padding:6px!important}.ptg-chat-roomhead{min-height:60px}.ptg-chat-message-body{max-width:85%}#ptg-chat-text{min-height:55px}}

.ptg-chat-search-result{padding:12px 4px;border-bottom:1px solid var(--chat-line);overflow-wrap:anywhere}.ptg-chat-search-result strong{font-size:13px}.ptg-chat-search-result time{display:block;color:var(--chat-muted);font-size:11px;margin-top:4px}.ptg-chat-search-result p{font-size:13px;line-height:1.5;margin:7px 0 0;white-space:pre-wrap}

/* 固定会话工具栏，滚动仅发生在会话列表内。 */
#ptg-chatroom .ptg-chat-sidebar{display:flex;flex-direction:column;overflow:hidden;min-height:0}#ptg-chatroom #ptg-chat-filter,#ptg-chatroom .ptg-chat-filters{flex-shrink:0}#ptg-chatroom #ptg-chat-rooms{overflow:auto;min-height:0;flex:1;scrollbar-width:thin;scrollbar-color:transparent transparent}#ptg-chatroom #ptg-chat-rooms:hover{scrollbar-color:#a3a8b288 transparent}#ptg-chatroom #ptg-chat-player-search{max-height:32%;overflow:auto;flex-shrink:0}#ptg-chatroom #ptg-chat-rooms::-webkit-scrollbar{width:5px}#ptg-chatroom #ptg-chat-rooms::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}#ptg-chatroom #ptg-chat-rooms:hover::-webkit-scrollbar-thumb{background:#a3a8b288}#ptg-chatroom #ptg-chat-composer{height:auto!important;min-height:0!important;margin:0!important;padding:10px 18px!important;display:flex;flex-direction:column;gap:6px}#ptg-chatroom #ptg-chat-text{height:68px;min-height:50px!important;margin:0!important;padding:4px;flex:none}#ptg-chatroom #ptg-chat-compose-status:empty{display:none}#ptg-chatroom .ptg-chat-compose-tools{margin:0!important;padding:0!important;min-height:32px}#ptg-chatroom #ptg-chat-emoji{display:grid;grid-template-columns:repeat(9,1fr);max-height:300px;overflow:auto;width:330px;max-width:calc(100vw - 40px)}#ptg-chatroom #ptg-chat-emoji button{font-family:'Segoe UI Emoji','Apple Color Emoji',sans-serif}#ptg-chatroom .ptg-chat-quote{margin:5px 0;padding:7px 10px;border-left:3px solid #ff8b43;background:var(--chat-bg);border-radius:5px;max-width:100%;overflow-wrap:anywhere;font-size:12px;color:var(--chat-muted)}.ptg-chat-quote strong,.ptg-chat-quote span{display:block}.ptg-chat-message-actions{display:flex;gap:4px;position:relative}.ptg-chat-message-actions button,.ptg-chat-reactions button{font-size:12px!important;padding:3px 7px!important;background:transparent!important;border:0!important;color:var(--chat-muted)!important}.ptg-chat-message-actions{opacity:0}.ptg-chat-message:hover .ptg-chat-message-actions,.ptg-chat-message:focus-within .ptg-chat-message-actions{opacity:1}.ptg-chat-reactions{display:flex;gap:4px;flex-wrap:wrap}.ptg-chat-reactions button{border:1px solid var(--chat-line)!important;background:var(--chat-bg)!important}.ptg-chat-reactions button[aria-pressed=true]{border-color:#ff9a60!important;background:var(--chat-active)!important}.ptg-chat-reactions-picker{position:absolute;bottom:100%;left:0;display:flex;padding:6px;background:var(--chat-card);border:1px solid var(--chat-line);border-radius:9px;box-shadow:0 3px 15px #0002;z-index:3}.ptg-chat-reactions-picker button{font-size:19px!important}.ptg-chat-reply-preview{display:flex;justify-content:space-between;gap:10px;padding:6px 10px;background:var(--chat-bg);border-left:3px solid #ff8b43;border-radius:6px;color:var(--chat-muted);font-size:12px}.ptg-chat-reply-preview button{padding:0 6px!important;border:0!important}.ptg-chat-member small{display:block;color:var(--chat-muted);font-size:11px;margin-top:3px}@media(hover:none){.ptg-chat-message-actions{opacity:1}}@media(max-width:620px){#ptg-chatroom .ptg-chat-sidebar{display:none}#ptg-chatroom .show-rooms .ptg-chat-sidebar{display:flex}#ptg-chatroom .ptg-chat-roomhead{flex-wrap:wrap}}

#ptg-chatroom #ptg-chat-emoji{display:block;padding:0;width:360px;overflow:hidden;max-height:360px}#ptg-chatroom .ptg-chat-emoji-grid{display:grid;grid-template-columns:repeat(9,1fr);max-height:260px;overflow:auto;padding:8px}#ptg-chatroom .ptg-chat-emoji-tools{display:flex;flex-wrap:wrap;gap:5px;padding:8px;border-bottom:1px solid var(--chat-line)}#ptg-chatroom .ptg-chat-emoji-tools button{font-size:12px;padding:4px 10px}#ptg-chatroom .ptg-chat-emoji-tools button[aria-pressed=true]{background:var(--chat-active);color:#ff6500}#ptg-chatroom .ptg-chat-emoji-tools input{flex:1;min-width:180px;font-size:12px;padding:6px}#ptg-chatroom .ptg-chat-emoji-more{grid-column:1/-1;font-size:12px!important}#ptg-chatroom .ptg-chat-search-drawer{width:min(380px,95%)}

.ptg-chat-join-dialog{width:min(420px,calc(100vw - 32px));padding:24px;border:1px solid var(--chat-line,#e6e8ee);border-radius:18px;color:var(--chat-text,#242833);background:var(--chat-card,#fff);box-shadow:0 18px 70px #0003}.ptg-chat-join-dialog::backdrop{background:#0008;backdrop-filter:blur(3px)}.ptg-chat-join-dialog h2{font-size:20px;margin:0 0 12px}.ptg-chat-join-dialog p{line-height:1.7;color:#7a8191;margin:0 0 22px}.ptg-chat-join-actions{display:flex;justify-content:flex-end;gap:10px}.ptg-chat-join-actions button{border:1px solid #e6e8ee;border-radius:9px;padding:9px 16px;background:#fff;cursor:pointer}.ptg-chat-join-actions .ptg-chat-join-confirm{color:#fff;background:#ff6000;border-color:#ff6000}.dark-open .ptg-chat-join-dialog{background:#191b1e;color:#eee;border-color:#303237}.ptg-chat-message-actions{opacity:1!important}.ptg-chat-message-actions button:hover{color:#ff6500!important}.ptg-chat-conversation.is-direct .ptg-chat-message.own{flex-direction:row}.ptg-chat-conversation.is-direct .ptg-chat-message.own .ptg-chat-message-meta{justify-content:flex-start}.ptg-chat-conversation.is-direct .ptg-chat-message.own .ptg-chat-message-text{border-radius:4px 12px 12px 12px}.ptg-chat-conversation.is-direct .ptg-chat-message-meta time{opacity:0;transition:opacity .15s}.ptg-chat-conversation.is-direct .ptg-chat-message:hover .ptg-chat-message-meta time,.ptg-chat-conversation.is-direct .ptg-chat-message:focus-within .ptg-chat-message-meta time{opacity:1}.ptg-chat-conversation.is-direct #ptg-chat-composer{margin:10px 16px!important;border:1px solid var(--chat-line)!important;border-radius:12px;padding:8px 12px!important}.ptg-chat-conversation.is-direct #ptg-chat-text{height:48px;min-height:40px!important}.ptg-chat-conversation.is-direct .ptg-chat-receipt{color:#18a881!important}.ptg-chat-conversation.is-direct .ptg-chat-message-body .ptg-chat-receipt,.ptg-chat-conversation.is-direct .ptg-chat-message-body .ptg-chat-recall{align-self:flex-start}

@media(hover:none){.ptg-chat-conversation.is-direct .ptg-chat-message-meta time{opacity:1}}html[data-theme=dark] .ptg-chat-join-dialog,html[data-bs-theme=dark] .ptg-chat-join-dialog,body.dark .ptg-chat-join-dialog,body.night .ptg-chat-join-dialog{background:#191b1e;color:#eee;border-color:#303237}

/* 私聊按消息流排列，阅读状态紧贴气泡，操作集中在气泡上方。 */
#ptg-chatroom .is-direct .ptg-chat-message{gap:10px;margin:0 0 18px;align-items:flex-start}#ptg-chatroom .is-direct .ptg-chat-message-body{position:relative;max-width:calc(100% - 90px);min-width:36px;padding-right:24px}#ptg-chatroom .is-direct .ptg-chat-message-meta{height:0;margin:0;overflow:visible}#ptg-chatroom .is-direct .ptg-chat-message-meta strong{display:none}#ptg-chatroom .is-direct .ptg-chat-message-meta time{position:absolute;left:0;top:-17px;font-size:10px;white-space:nowrap;background:var(--chat-card);z-index:1}#ptg-chatroom .is-direct .ptg-chat-message-text{display:block;width:fit-content;max-width:100%;padding:8px 12px;line-height:1.6;border-radius:5px 10px 10px 10px}#ptg-chatroom .is-direct .own .ptg-chat-message-text{background:var(--chat-active)}#ptg-chatroom .is-direct .ptg-chat-message-body>.ptg-chat-receipt{position:absolute;right:0;bottom:0;width:20px;height:20px;padding:0!important;font-size:13px!important;border-radius:50%;line-height:18px;color:var(--chat-muted)!important}#ptg-chatroom .is-direct .ptg-chat-message-body>.ptg-chat-receipt.is-read{color:#13a889!important}#ptg-chatroom .is-direct .ptg-chat-message:not(.own) .ptg-chat-receipt{display:none}#ptg-chatroom .ptg-chat-message-actions{display:flex;align-items:center;width:fit-content;gap:0;border:1px solid var(--chat-line);border-radius:6px;background:var(--chat-card);margin-top:4px;box-shadow:0 2px 7px #00000008}#ptg-chatroom .ptg-chat-message-actions button{min-width:28px;height:26px;font-size:15px!important;line-height:20px;padding:2px 6px!important}#ptg-chatroom .ptg-chat-message-actions button:hover{background:var(--chat-active)!important}#ptg-chatroom .is-direct .ptg-chat-message-actions{position:absolute;top:-29px;left:0;margin:0;z-index:2;opacity:0!important;visibility:hidden;transition:opacity .12s}#ptg-chatroom .is-direct .ptg-chat-message:hover .ptg-chat-message-actions,#ptg-chatroom .is-direct .ptg-chat-message:focus-within .ptg-chat-message-actions{opacity:1!important;visibility:visible}#ptg-chatroom .is-direct .ptg-chat-reactions:not(:empty){margin-top:5px}#ptg-chatroom .is-direct .ptg-chat-reactions button{border-radius:12px;font-size:12px!important}#ptg-chatroom .is-direct #ptg-chat-composer{display:grid!important;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'reply reply' 'pending pending' 'text tools' 'status status';gap:0!important;align-items:end;margin:8px 18px 18px!important;padding:6px 8px!important;min-height:50px!important;border-color:#bdc4ce!important;background:var(--chat-card);border-radius:9px}#ptg-chatroom .is-direct #ptg-chat-text{grid-area:text;width:100%;height:38px;min-height:38px!important;max-height:140px;resize:none;padding:8px!important;font-size:14px}#ptg-chatroom .is-direct .ptg-chat-compose-tools{grid-area:tools;gap:2px;min-height:36px}#ptg-chatroom .is-direct .ptg-chat-compose-tools button{font-size:21px!important;width:32px;height:34px;padding:2px!important;min-width:32px;display:flex;align-items:center;justify-content:center}#ptg-chatroom .is-direct #ptg-chat-send{margin-left:5px;background:transparent!important;border:0!important;color:#ff6500!important}#ptg-chatroom .is-direct #ptg-chat-send:disabled{color:#9aa1ab!important;opacity:.6}#ptg-chatroom .is-direct .ptg-chat-sendhint{display:none}#ptg-chatroom .is-direct .ptg-chat-reply-preview{grid-area:reply;margin-bottom:6px}#ptg-chatroom .is-direct .ptg-chat-pending{grid-area:pending}#ptg-chatroom .is-direct #ptg-chat-compose-status{grid-area:status;margin:2px 8px 0}#ptg-chatroom .is-direct .ptg-chat-roomhead h2{margin:0}#ptg-chatroom .is-direct .ptg-chat-message-list{padding-top:10px}@media(hover:none){#ptg-chatroom .is-direct .ptg-chat-message-actions{position:relative;top:auto;opacity:1!important;visibility:visible;margin-top:4px}#ptg-chatroom .is-direct .ptg-chat-message-meta time{position:static}}@media(max-width:620px){#ptg-chatroom .is-direct #ptg-chat-composer{margin:6px 8px 10px!important}#ptg-chatroom .is-direct .ptg-chat-compose-tools{gap:0}#ptg-chatroom .is-direct .ptg-chat-compose-tools button{width:26px;min-width:26px}}

#ptg-chatroom .is-direct .ptg-chat-message-meta time{left:135px;top:-22px;font-size:10px}.ptg-chat-join-dialog .ptg-chat-join-actions button:focus-visible{outline:2px solid #ff6500;outline-offset:3px}

/* 群聊与私聊共用消息方向、阅读圆点及侧边悬浮工具条。 */
#ptg-chatroom .ptg-chat-conversation .ptg-chat-message{flex-direction:row;gap:10px;margin-bottom:24px;padding-top:8px}#ptg-chatroom .ptg-chat-conversation .ptg-chat-message.own{flex-direction:row-reverse}#ptg-chatroom .ptg-chat-conversation .ptg-chat-message-body{position:relative;width:fit-content;max-width:min(70%,720px);min-width:30px;padding:0;overflow:visible}#ptg-chatroom .ptg-chat-conversation .ptg-chat-message-meta{height:0;margin:0;overflow:visible}#ptg-chatroom .ptg-chat-conversation .ptg-chat-message-meta strong{display:none}#ptg-chatroom .ptg-chat-conversation .ptg-chat-message-meta time{position:absolute;top:-20px;left:0;bottom:auto;opacity:0;white-space:nowrap;background:var(--chat-card);font-size:10px;transition:opacity .12s}#ptg-chatroom .ptg-chat-conversation .ptg-chat-message.own .ptg-chat-message-meta time{left:auto;right:0}#ptg-chatroom .ptg-chat-conversation .ptg-chat-message:hover time,#ptg-chatroom .ptg-chat-conversation .ptg-chat-message:focus-within time{opacity:1}#ptg-chatroom .ptg-chat-conversation .ptg-chat-message-text{width:fit-content;max-width:100%;border-radius:4px 12px 12px 12px}#ptg-chatroom .ptg-chat-conversation .own .ptg-chat-message-text{border-radius:12px 4px 12px 12px}#ptg-chatroom .ptg-chat-conversation .ptg-chat-message-body>.ptg-chat-receipt{position:absolute;bottom:0;left:calc(100% + 5px);right:auto;width:18px;height:18px;min-width:18px;padding:3px!important;display:flex!important;align-items:center;justify-content:center;font-size:0!important;border:0!important;background:transparent!important}#ptg-chatroom .ptg-chat-conversation .own .ptg-chat-message-body>.ptg-chat-receipt{left:auto;right:calc(100% + 5px)}#ptg-chatroom .ptg-chat-conversation .ptg-chat-message:not(.own) .ptg-chat-receipt{display:none!important}#ptg-chatroom .ptg-chat-receipt::before{content:'';width:8px;height:8px;border:1.4px solid #98a2b3;border-radius:50%;box-sizing:border-box;background:transparent}#ptg-chatroom .ptg-chat-receipt.is-read::before{border-color:#16ad96;background:#16ad96}#ptg-chatroom .ptg-chat-conversation .ptg-chat-message-actions{position:absolute;bottom:23px;top:auto;left:calc(100% + 4px);right:auto;height:28px;margin:0;display:flex;flex-wrap:nowrap;width:max-content;opacity:0!important;visibility:hidden;z-index:4;border:1px solid var(--chat-line);border-radius:5px;box-shadow:0 2px 6px #0000000a;transition:opacity .12s}#ptg-chatroom .ptg-chat-conversation .own .ptg-chat-message-actions{left:auto;right:calc(100% + 4px)}#ptg-chatroom .ptg-chat-conversation .ptg-chat-message:hover .ptg-chat-message-actions,#ptg-chatroom .ptg-chat-conversation .ptg-chat-message:focus-within .ptg-chat-message-actions{opacity:1!important;visibility:visible}#ptg-chatroom .ptg-chat-message-actions button{border-right:1px solid var(--chat-line)!important;border-radius:0!important;color:#8c95a3!important;display:flex;align-items:center;justify-content:center;padding:3px 6px!important;width:28px;height:26px}#ptg-chatroom .ptg-chat-message-actions button:last-child{border-right:0!important}#ptg-chatroom .ptg-chat-message-actions button:hover{color:#ff6500!important}#ptg-chatroom .ptg-chat-reactions-picker{position:fixed;z-index:9999;display:flex;flex-direction:column;gap:5px;max-height:340px;bottom:auto;right:auto;padding:10px;overflow:hidden;border-radius:12px;background:var(--chat-card);border:1px solid var(--chat-line);box-shadow:0 10px 35px #0002}#ptg-chatroom .ptg-chat-reactions-picker input{width:100%;padding:7px;font-size:12px;flex-shrink:0}#ptg-chatroom .ptg-chat-reaction-heading{font-size:11px;color:var(--chat-muted);padding:3px 0 5px}#ptg-chatroom .ptg-chat-reaction-grid{display:grid;grid-template-columns:repeat(9,1fr);gap:2px;min-height:0;overflow:auto}#ptg-chatroom .ptg-chat-reaction-grid button{font-size:23px!important;border:0;padding:3px!important;height:32px;background:transparent;line-height:1}#ptg-chatroom .ptg-chat-reaction-grid button:hover{background:var(--chat-active)}#ptg-chatroom .ptg-chat-reaction-recent{flex-shrink:0}#ptg-chatroom .ptg-chat-reaction-grid .ptg-chat-emoji-more{font-size:12px!important;grid-column:1/-1}@media(hover:none){#ptg-chatroom .ptg-chat-conversation .ptg-chat-message-actions{position:static;visibility:visible;opacity:1!important;margin-top:5px}#ptg-chatroom .ptg-chat-conversation .ptg-chat-message-meta time{position:static;opacity:1}#ptg-chatroom .ptg-chat-conversation .ptg-chat-message-meta{height:auto}}@media(max-width:620px){#ptg-chatroom .ptg-chat-conversation .ptg-chat-message-body{max-width:75%}}

#ptg-chatroom .ptg-chat-reaction-grid{grid-template-columns:repeat(9,minmax(0,1fr));overflow-x:hidden}#ptg-chatroom .ptg-chat-reaction-grid button{min-width:0;width:100%;max-width:100%}

#ptg-chatroom .ptg-chat-conversation .ptg-chat-message-actions::before{content:"";position:absolute;inset:-4px -7px;z-index:-1}

/* 阅读圆点与工具条固定在消息内容旁，不受下方表情回应影响。 */
#ptg-chatroom .ptg-chat-message-content{position:relative;max-width:100%;width:fit-content}#ptg-chatroom .ptg-chat-reading-anchor{position:absolute;bottom:2px;left:calc(100% + 5px);width:18px;height:18px;z-index:3}#ptg-chatroom .own .ptg-chat-reading-anchor{left:auto;right:calc(100% + 5px)}#ptg-chatroom .ptg-chat-reading-anchor .ptg-chat-receipt{position:static!important;width:18px;height:18px;padding:3px!important;display:flex;align-items:center;justify-content:center;font-size:0!important;background:transparent!important}#ptg-chatroom .ptg-chat-conversation .ptg-chat-reading-anchor .ptg-chat-message-actions{left:0;right:auto;bottom:21px;top:auto}#ptg-chatroom .ptg-chat-conversation .own .ptg-chat-reading-anchor .ptg-chat-message-actions{left:auto;right:0;bottom:21px;top:auto}#ptg-chatroom .ptg-chat-reactions:not(:empty){margin-top:5px}#ptg-chatroom .ptg-chat-conversation #ptg-chat-composer{display:grid!important;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'reply reply' 'pending pending' 'text tools' 'status status';gap:0!important;align-items:end;margin:8px 18px 18px!important;padding:6px 8px!important;min-height:50px!important;border:1px solid #bdc4ce!important;background:var(--chat-card);border-radius:9px}#ptg-chatroom .ptg-chat-conversation #ptg-chat-text{grid-area:text;width:100%;height:38px;min-height:38px!important;max-height:140px;padding:8px!important;font-size:14px}#ptg-chatroom .ptg-chat-conversation .ptg-chat-compose-tools{grid-area:tools;gap:2px;min-height:36px}#ptg-chatroom .ptg-chat-conversation .ptg-chat-compose-tools button{width:32px;height:34px;min-width:32px;padding:2px!important;display:flex;align-items:center;justify-content:center}#ptg-chatroom .ptg-chat-conversation #ptg-chat-send{margin-left:5px;background:transparent!important;border:0!important;color:#ff6500!important}#ptg-chatroom .ptg-chat-conversation #ptg-chat-send:disabled{color:#9aa1ab!important;opacity:.6}#ptg-chatroom .ptg-chat-conversation .ptg-chat-sendhint{display:none}#ptg-chatroom .ptg-chat-conversation .ptg-chat-reply-preview{grid-area:reply;margin-bottom:6px}#ptg-chatroom .ptg-chat-conversation .ptg-chat-pending{grid-area:pending}#ptg-chatroom .ptg-chat-conversation #ptg-chat-compose-status{grid-area:status;margin:2px 8px 0}@media(max-width:620px){#ptg-chatroom .ptg-chat-conversation #ptg-chat-composer{margin:6px 8px 10px!important}#ptg-chatroom .ptg-chat-conversation .ptg-chat-compose-tools button{min-width:26px;width:26px}}@media(hover:none){#ptg-chatroom .ptg-chat-conversation .ptg-chat-reading-anchor .ptg-chat-message-actions{position:absolute;opacity:1!important;visibility:visible;bottom:21px}}

/* 所有消息展示阅读比例，频道保留昵称。 */
#ptg-chatroom .ptg-chat-conversation .ptg-chat-message:not(.own) .ptg-chat-receipt{display:flex!important}#ptg-chatroom .ptg-chat-receipt::before{border:1px solid #9aa4b2;background:conic-gradient(#16ad96 0 var(--read-percent,0%),transparent var(--read-percent,0%) 100%);width:9px;height:9px}#ptg-chatroom .ptg-chat-receipt.is-read::before{border-color:#16ad96;background:#16ad96}#ptg-chatroom .ptg-chat-conversation:not(.is-direct) .ptg-chat-message-meta{height:auto;min-height:19px;margin:0 0 4px;display:flex;align-items:center;gap:9px}#ptg-chatroom .ptg-chat-conversation:not(.is-direct) .ptg-chat-message-meta strong{display:inline;font-size:12px;line-height:19px;color:var(--chat-text);font-weight:500}#ptg-chatroom .ptg-chat-conversation:not(.is-direct) .ptg-chat-message-meta time{position:static;opacity:0;font-size:10px;background:transparent}#ptg-chatroom .ptg-chat-conversation:not(.is-direct) .ptg-chat-message:hover .ptg-chat-message-meta time,#ptg-chatroom .ptg-chat-conversation:not(.is-direct) .ptg-chat-message:focus-within .ptg-chat-message-meta time{opacity:1}#ptg-chatroom .ptg-chat-conversation:not(.is-direct) .own .ptg-chat-message-meta{justify-content:flex-end}#ptg-chatroom .ptg-chat-read-popover{position:fixed;z-index:10000;border:1px solid var(--chat-line);border-radius:9px;box-shadow:0 8px 28px #0002;background:var(--chat-card);color:var(--chat-text);overflow:hidden}#ptg-chatroom .ptg-chat-read-popover header{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;border-bottom:1px solid var(--chat-line);font-size:12px}#ptg-chatroom .ptg-chat-read-popover header button{border:0;padding:0 5px;font-size:20px}#ptg-chatroom .ptg-chat-read-columns{display:grid;grid-template-columns:1fr 1fr}#ptg-chatroom .ptg-chat-read-columns>section{min-width:0;padding:12px}#ptg-chatroom .ptg-chat-read-columns>section+section{border-left:1px solid var(--chat-line)}#ptg-chatroom .ptg-chat-read-columns h3{font-size:13px;margin:0 0 10px;font-weight:500}#ptg-chatroom .ptg-chat-read-users{height:245px;overflow:auto;scrollbar-width:thin}#ptg-chatroom .ptg-chat-read-user{display:flex;align-items:center;gap:8px;min-height:39px;font-size:12px;overflow-wrap:anywhere}#ptg-chatroom .ptg-chat-read-user .ptg-chat-avatar,#ptg-chatroom .ptg-chat-read-user .ptg-chat-avatar img{width:26px!important;height:26px!important;min-width:26px!important;min-height:26px!important;flex:0 0 26px!important;border-radius:50%}#ptg-chatroom .ptg-chat-read-empty{font-size:12px;color:var(--chat-muted);padding:10px 0}@media(hover:none){#ptg-chatroom .ptg-chat-conversation:not(.is-direct) .ptg-chat-message-meta time{opacity:1}}

#ptg-chatroom.is-guest .ptg-chat-room-actions{display:none}#ptg-chatroom.is-guest #ptg-chat-messages{display:flex;align-items:center;justify-content:center}#ptg-chatroom.is-guest #ptg-chat-message-list{width:100%}#ptg-chatroom .ptg-chat-guest-lock{text-align:center;max-width:410px;margin:28px auto;padding:24px;color:var(--chat-text)}#ptg-chatroom .ptg-chat-guest-symbol{display:flex;align-items:center;justify-content:center;width:52px;height:52px;margin:0 auto 16px;border-radius:16px;background:var(--chat-active);color:#ff6500;font-size:25px}#ptg-chatroom .ptg-chat-guest-lock h3{font-size:18px;font-weight:600;margin:0 0 10px}#ptg-chatroom .ptg-chat-guest-lock p{color:var(--chat-muted);font-size:13px;line-height:1.8;margin:0 0 20px}#ptg-chatroom .ptg-chat-guest-lock a{display:inline-block;padding:9px 24px;border-radius:9px;background:#ff6500;color:#fff;font-size:14px;text-decoration:none}

#ptg-chatroom .ptg-chat-media-wrap{padding:7px;border:1px solid var(--chat-line);border-radius:12px;background:var(--chat-bg);max-width:100%;box-sizing:border-box}#ptg-chatroom .own .ptg-chat-media-wrap{background:var(--chat-active)}#ptg-chatroom .ptg-chat-media-wrap .ptg-chat-media{margin-top:0;display:block;border-radius:7px;max-width:100%}#ptg-chatroom .ptg-chat-media-wrap img{cursor:zoom-in}

/* Unified player workspace. Presentation only; receipts and media keep their anchors. */
#ptg-chatroom {
    --chat-bg: #f6f7f9;
    --chat-card: #fff;
    --chat-text: #253043;
    --chat-muted: #7c8796;
    --chat-line: #e5e8ed;
    --chat-active: #fff0e7;
    --chat-bubble: #f2f4f7;
    --chat-accent: #ff650b;
    --chat-shadow: 0 8px 24px rgba(25,35,50,.035);
    letter-spacing: .01em;
}
body.dark #ptg-chatroom, body.night #ptg-chatroom, body.dark-open #ptg-chatroom,
html[data-bs-theme=dark] #ptg-chatroom, html[data-theme=dark] #ptg-chatroom,
body[data-theme=dark] #ptg-chatroom {
    --chat-bg: #181b20;
    --chat-card: #1d2026;
    --chat-text: #e4e8ef;
    --chat-muted: #919ba9;
    --chat-line: #30353f;
    --chat-active: #392b23;
    --chat-bubble: #272c34;
    --chat-shadow: 0 8px 24px rgba(0,0,0,.1);
}
.ptg-chatroom-main { max-width: 1600px; padding: 24px 28px 16px; }
#ptg-chatroom .ptg-chatroom-heading { margin-bottom: 20px; gap: 20px; }
#ptg-chatroom .ptg-chatroom-title { display: flex; align-items: center; gap: 13px; min-width: 0; }
#ptg-chatroom .ptg-chatroom-mark {
    display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px;
    border: 1px solid var(--chat-line); border-radius: 14px;
    background: var(--chat-card); color: var(--chat-accent); box-shadow: var(--chat-shadow);
}
#ptg-chatroom .ptg-chatroom-mark svg { display: block; width: 23px; height: 23px; }
#ptg-chatroom .ptg-chatroom-heading h1 { font-size: 24px; letter-spacing: -.04em; line-height: 1.4; margin: 0 0 3px; font-weight: 750; }
#ptg-chatroom .ptg-chatroom-heading p { font-size: 12px; line-height: 1.7; }
#ptg-chatroom .ptg-chatroom-tools { gap: 8px; }
#ptg-chatroom .ptg-chatroom-tools button, #ptg-chatroom .ptg-chatroom-tools a {
    display: inline-flex; align-items: center; justify-content: center; min-height: 36px;
    padding: 8px 13px; border: 1px solid var(--chat-line); border-radius: 10px;
    color: var(--chat-muted); background: var(--chat-card); font-size: 12px;
    text-decoration: none; line-height: 1.5; transition: border-color .16s, color .16s;
}
#ptg-chatroom .ptg-chatroom-tools button:hover, #ptg-chatroom .ptg-chatroom-tools a:hover {
    border-color: #f3c3a5; color: var(--chat-accent);
}
#ptg-chatroom .ptg-chatroom-stage {
    grid-template-columns: 264px minmax(0,1fr); height: calc(100dvh - 205px);
    max-height: 1100px; min-height: 520px; border-radius: 18px;
    border-color: var(--chat-line); box-shadow: var(--chat-shadow); isolation: isolate;
}
#ptg-chatroom .ptg-chat-sidebar { padding: 18px 12px 10px; gap: 0; border-color: var(--chat-line); }
#ptg-chatroom .ptg-chat-sidebar-caption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 8px 13px; flex-shrink: 0; }
#ptg-chatroom .ptg-chat-sidebar-caption strong { font-size: 15px; font-weight: 700; color: var(--chat-text); }
#ptg-chatroom .ptg-chat-sidebar-caption span { font-size: 11px; color: var(--chat-muted); }
#ptg-chatroom #ptg-chat-filter {
    height: 38px; border-radius: 10px; font-size: 12px; padding: 9px 12px 9px 34px;
    border-color: var(--chat-line); margin-bottom: 12px; background-color: var(--chat-card);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238793a3' stroke-width='1.6' viewBox='0 0 24 24'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m16 16 4 4' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: 11px center;
}
#ptg-chatroom #ptg-chat-filter:focus { outline: none; border-color: #f4b58d; box-shadow: 0 0 0 3px rgba(255,101,11,.06); }
#ptg-chatroom .ptg-chat-filters { gap: 4px; padding: 0 0 12px; margin: 0 0 7px; }
#ptg-chatroom .ptg-chat-filters button { border-radius: 8px; font-size: 12px!important; padding: 5px 14px!important; line-height: 1.65; }
#ptg-chatroom .ptg-chat-filters button[aria-pressed=true] { background: var(--chat-card)!important; color: var(--chat-text)!important; box-shadow: 0 1px 4px rgba(25,35,50,.05); }
#ptg-chatroom .ptg-chat-roomgroup { margin: 0 0 10px; }
#ptg-chatroom .ptg-chat-roomgroup summary { padding: 10px 8px 7px; font-size: 11px; font-weight: 550; letter-spacing: .025em; }
#ptg-chatroom .ptg-chat-room {
    gap: 11px; min-height: 56px; margin: 3px 0; padding: 10px!important;
    border-radius: 11px!important; transition: background-color .15s, color .15s;
}
#ptg-chatroom .ptg-chat-room:hover { color: var(--chat-text); }
#ptg-chatroom .ptg-chat-room[aria-current=true] { background: var(--chat-active)!important; color: var(--chat-accent)!important; }
#ptg-chatroom .ptg-chat-room-label { font-size: 13px; font-weight: 500; line-height: 1.55; }
#ptg-chatroom .ptg-chat-room[aria-current=true] .ptg-chat-room-label { font-weight: 650; }
#ptg-chatroom .ptg-chat-avatar { background: var(--chat-active); color: var(--chat-accent); border-radius: 10px; font-size: 13px; }
#ptg-chatroom .ptg-chat-unread { min-width: 17px; height: 17px; flex-shrink: 0; line-height: 17px; font-size: 10px; padding: 0 5px; background: var(--chat-accent); }
#ptg-chatroom .ptg-chat-roomhead { min-height: 78px; padding: 16px 24px; gap: 12px; }
#ptg-chatroom .ptg-chat-room-title { min-width: 0; flex: 1; }
#ptg-chatroom .ptg-chat-roomhead h2 { font-size: 16px; line-height: 1.5; margin: 0 0 2px; overflow-wrap: anywhere; }
#ptg-chatroom #ptg-chat-connection { font-size: 11px; line-height: 1.5; }
#ptg-chatroom .ptg-chat-room-actions { flex: 0 1 auto; gap: 3px; margin-left: auto; }
#ptg-chatroom .ptg-chat-room-actions button { padding: 7px 9px!important; border-radius: 8px; font-size: 11px!important; }
#ptg-chatroom #ptg-chat-state { padding: 13px 18px; background: var(--chat-bg); font-size: 12px; line-height: 1.7; }
#ptg-chatroom #ptg-chat-messages { padding: 24px 28px 14px; scrollbar-color: transparent transparent; }
#ptg-chatroom #ptg-chat-messages:hover { scrollbar-color: #98a3b35c transparent; }
#ptg-chatroom #ptg-chat-messages::-webkit-scrollbar { width: 5px; }
#ptg-chatroom #ptg-chat-messages::-webkit-scrollbar-thumb { background: transparent; border-radius: 5px; }
#ptg-chatroom #ptg-chat-messages:hover::-webkit-scrollbar-thumb { background: #98a3b35c; }
#ptg-chatroom .ptg-chat-conversation .ptg-chat-message { margin-bottom: 22px; gap: 11px; }
#ptg-chatroom .ptg-chat-conversation .ptg-chat-message-meta strong { font-size: 11px; font-weight: 550; color: var(--chat-muted); }
#ptg-chatroom .ptg-chat-conversation .ptg-chat-message-text { background: var(--chat-bubble); padding: 10px 14px; font-size: 13px; line-height: 1.75; border-radius: 4px 12px 12px 12px; }
#ptg-chatroom .ptg-chat-conversation .own .ptg-chat-message-text { background: var(--chat-active); border-radius: 12px 4px 12px 12px; }
#ptg-chatroom .ptg-chat-system { font-size: 11px; margin: 18px 0; line-height: 1.7; }
#ptg-chatroom .ptg-chat-message-actions { box-shadow: 0 3px 12px rgba(25,35,50,.08)!important; }
#ptg-chatroom .ptg-chat-reactions button { padding: 3px 8px!important; font-size: 11px!important; line-height: 1.5; }
#ptg-chatroom .ptg-chat-conversation #ptg-chat-composer {
    margin: 8px 22px 20px!important; border: 1px solid var(--chat-line)!important;
    border-radius: 13px; padding: 8px 10px!important;
    box-shadow: 0 2px 8px rgba(25,35,50,.025); transition: border-color .16s, box-shadow .16s;
}
#ptg-chatroom .ptg-chat-conversation #ptg-chat-composer:focus-within { border-color: #f0b38e!important; box-shadow: 0 0 0 3px rgba(255,101,11,.045); }
#ptg-chatroom .ptg-chat-conversation #ptg-chat-text { font-size: 13px; padding: 8px!important; line-height: 1.7; }
#ptg-chatroom #ptg-chat-text::placeholder { color: var(--chat-muted); opacity: .85; }
#ptg-chatroom .ptg-chat-conversation .ptg-chat-compose-tools { gap: 3px; }
#ptg-chatroom .ptg-chat-conversation .ptg-chat-compose-tools button { color: var(--chat-muted); border-radius: 8px; }
#ptg-chatroom .ptg-chat-conversation .ptg-chat-compose-tools button:hover { color: var(--chat-accent); background: var(--chat-active)!important; }
#ptg-chatroom .ptg-chat-conversation #ptg-chat-send { width: 34px; min-width: 34px; height: 34px; margin-left: 7px; color: #fff!important; background: var(--chat-accent)!important; border-radius: 10px!important; }
#ptg-chatroom .ptg-chat-conversation #ptg-chat-send:disabled { background: var(--chat-bg)!important; color: var(--chat-muted)!important; }
#ptg-chatroom #ptg-chat-new { bottom: 88px; padding: 8px 14px; border-radius: 20px; font-size: 12px; box-shadow: 0 4px 16px rgba(25,35,50,.1); }
#ptg-chatroom .ptg-chatroom-tip { font-size: 11px; margin-top: 12px; line-height: 1.7; }
#ptg-chatroom .ptg-chat-member-info{flex:1;min-width:0}
#ptg-chatroom .ptg-chat-member-status{flex:none;font-size:11px;line-height:1.5;border-radius:999px;padding:2px 7px;background:var(--chat-bg);color:var(--chat-muted);white-space:nowrap}
#ptg-chatroom .ptg-chat-member-status.is-online{color:#16845d;background:#19a77814}
#ptg-chatroom .ptg-chat-member-status.is-online::before{content:"";display:inline-block;width:5px;height:5px;border-radius:50%;background:currentColor;margin-right:4px;vertical-align:middle}
#ptg-chatroom .ptg-chat-member-status.is-offline{opacity:.85}
#ptg-chatroom .ptg-chat-members-drawer { border-color: var(--chat-line); box-shadow: -10px 0 30px rgba(25,35,50,.065); }
#ptg-chatroom .ptg-chat-members-drawer header { padding: 20px; }
#ptg-chatroom .ptg-chat-member { border-radius: 10px; }
#ptg-chatroom .ptg-chat-read-popover, #ptg-chatroom #ptg-chat-emoji, #ptg-chatroom .ptg-chat-reactions-picker { box-shadow: 0 8px 24px rgba(25,35,50,.12); border-radius: 13px; }
#ptg-chatroom .ptg-chat-guest-lock { padding: 24px 16px; }
#ptg-chatroom .ptg-chat-guest-symbol { border-radius: 16px; width: 58px; height: 58px; }
#ptg-chatroom .ptg-chat-guest-lock h3 { font-weight: 700; letter-spacing: -.02em; }
#ptg-chatroom .ptg-chat-guest-lock a { background: var(--chat-accent); border-radius: 10px; }

/* Popout and embedded support use the same visual vocabulary without a page shell. */
body.ptg-chat-popup .ptg-chatroom-main { padding: 16px; }
body.ptg-chat-popup #ptg-chatroom .ptg-chatroom-stage { flex: 1; height: auto; min-height: 0; max-height: none; }
body.ptg-chat-popup #ptg-chatroom .ptg-chatroom-heading { margin-bottom: 14px; }
body.ptg-chat-support .ptg-chatroom-main { padding: 0!important; }
body.ptg-chat-support #ptg-chatroom .ptg-chatroom-stage { border: 0; border-radius: 0; box-shadow: none; }
body.ptg-chat-support #ptg-chatroom .ptg-chat-roomhead { min-height: 76px; padding: 14px 20px!important; }
body.ptg-chat-support #ptg-chatroom .ptg-chat-conversation #ptg-chat-composer { margin: 8px 20px 18px!important; }
body.ptg-chat-support #ptg-chatroom .ptg-chat-conversation #ptg-chat-text { min-height: 38px!important; }

@media(max-width:1100px) {
    #ptg-chatroom .ptg-chatroom-stage { grid-template-columns: 224px minmax(0,1fr); }
    #ptg-chatroom .ptg-chat-roomhead { padding: 14px 18px; }
    #ptg-chatroom #ptg-chat-messages { padding: 22px 20px 12px; }
    #ptg-chatroom .ptg-chat-room-actions { gap: 1px; }
}
@media(max-width:620px) {
    .ptg-chatroom-main { padding: 14px 12px!important; }
    #ptg-chatroom .ptg-chatroom-heading { margin-bottom: 14px; flex-wrap: nowrap; align-items: center; gap: 8px; }
    #ptg-chatroom .ptg-chatroom-title { gap: 9px; }
    #ptg-chatroom .ptg-chatroom-mark { width: 36px; height: 36px; flex-basis: 36px; border-radius: 11px; }
    #ptg-chatroom .ptg-chatroom-mark svg { width: 20px; height: 20px; }
    #ptg-chatroom .ptg-chatroom-heading h1 { font-size: 20px; margin: 0; white-space: nowrap; }
    #ptg-chatroom .ptg-chatroom-tools { width: auto; }
    #ptg-chatroom .ptg-chatroom-tools button { min-height: 33px; padding: 6px 9px!important; font-size: 11px!important; white-space: nowrap; }
    #ptg-chatroom .ptg-chatroom-stage { height: calc(100dvh - 200px); min-height: 400px; border-radius: 14px; }
    #ptg-chatroom .ptg-chat-sidebar { width: min(280px,85%); padding: 18px 12px; }
    #ptg-chatroom .ptg-chat-roomhead { gap: 9px; min-height: 72px; padding: 12px!important; }
    #ptg-chatroom .ptg-chat-roomhead h2 { font-size: 14px; }
    #ptg-chatroom .ptg-chat-room-title { min-width: 90px; }
    #ptg-chatroom .ptg-chat-room-actions { max-width: 100%; gap: 0; }
    #ptg-chatroom .ptg-chat-room-actions button { font-size: 10px!important; padding: 5px 7px!important; }
    #ptg-chatroom #ptg-chat-messages { padding: 18px 14px 10px; }
    #ptg-chatroom .ptg-chat-conversation .ptg-chat-message-body { max-width: 75%; }
    #ptg-chatroom .ptg-chat-conversation #ptg-chat-composer { margin: 6px 10px 12px!important; padding: 5px 6px!important; border-radius: 11px; }
    #ptg-chatroom .ptg-chat-conversation #ptg-chat-text:placeholder-shown { white-space: nowrap; overflow: hidden; }
    #ptg-chatroom .ptg-chat-conversation .ptg-chat-compose-tools { gap: 0; }
    #ptg-chatroom .ptg-chat-conversation .ptg-chat-compose-tools button { width: 26px; min-width: 26px; }
    #ptg-chatroom .ptg-chat-conversation #ptg-chat-send { margin-left: 4px; width: 30px; min-width: 30px; height: 30px; border-radius: 8px!important; }
    #ptg-chatroom #ptg-chat-new { bottom: 75px; }
    #ptg-chatroom .ptg-chatroom-tip { font-size: 10px; }
    body.ptg-chat-popup .ptg-chatroom-main { padding: 10px!important; }
    body.ptg-chat-support .ptg-chatroom-main { padding: 0!important; }
    body.ptg-chat-support #ptg-chatroom .ptg-chat-roomhead { padding: 12px!important; }
    body.ptg-chat-support #ptg-chatroom .ptg-chat-conversation #ptg-chat-composer { margin: 6px 10px 12px!important; }
}

/* The site's mobile navigation is absolute and supplies no header gap. */
@media(max-width:767px) {
    body:not(.ptg-chat-popup):not(.ptg-chat-support) .ptg-chatroom-main { padding-top: 78px!important; }
}
