.gh-chat{display:grid;grid-template-columns:270px minmax(0,1fr);height:calc(100dvh - 154px);min-height:480px;max-height:1000px;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--surface);position:relative}
.gh-chat *, .gh-chat-group-detail *, .gh-chat-peer-detail *{box-sizing:border-box}
.gh-chat button,.gh-chat a{touch-action:manipulation}
.gh-chat button:focus-visible,.gh-chat a:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.gh-chat [hidden]{display:none!important}
.gh-chat-sidebar{display:flex;min-width:0;min-height:0;flex-direction:column;border-right:1px solid var(--line);background:var(--bg)}
.gh-chat-sidebar-head{padding:17px 16px 12px;display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.gh-chat-sidebar-head h1{font-size:21px;letter-spacing:0;margin:0;font-weight:600}
.gh-chat-sidebar-head>div{display:flex;gap:3px}
.gh-chat-button{border:0;background:transparent;color:var(--text);padding:8px 10px;border-radius:7px;min-height:40px;cursor:pointer;font-size:13px;white-space:nowrap}
.gh-chat-button:hover{background:var(--raised)}
.gh-chat-button.is-danger{color:var(--danger)}
.gh-chat-icon{display:inline-flex;justify-content:center;align-items:center;flex-shrink:0;width:40px;height:40px;padding:0;border:0;background:transparent;color:var(--muted);border-radius:7px;cursor:pointer}
.gh-chat-icon:hover{background:var(--raised);color:var(--text)}
.gh-chat-icon .icon{height:20px;width:20px}
.gh-chat-conversations{overflow:auto;min-height:0;padding:0 8px 16px;flex:1}
.gh-chat-section{font-size:12px;font-weight:500;color:var(--muted);margin:17px 10px 5px;letter-spacing:0}
.gh-chat-conversation{display:flex;gap:10px;align-items:center;min-height:70px;padding:10px;border-radius:8px}
.gh-chat-conversation:hover,.gh-chat-conversation.is-active{background:var(--raised)}
.gh-chat-conversation .avatar{width:37px;height:37px;border:0;font-size:14px}
.gh-chat-conversation-copy{display:block;min-width:0;flex:1}
.gh-chat-conversation-copy strong{display:block;font-size:14px;font-weight:550;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gh-chat-conversation-copy small{display:block;max-width:100%;font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-height:19px}
.gh-chat-unread{display:grid;place-items:center;min-width:19px;height:19px;padding:0 5px;font-size:10px;line-height:1;background:var(--accent);color:var(--accent-ink);border-radius:12px;flex-shrink:0}
.gh-chat-queue{color:var(--muted);font-size:12px;padding:10px;margin:0;line-height:1.5}
.gh-chat-request-area:empty{display:none}
.gh-chat-requests{margin:0 12px 8px;border-bottom:1px solid var(--line);font-size:13px}
.gh-chat-requests summary{padding:10px 4px;cursor:pointer}
.gh-chat-requests summary span{margin-left:8px;color:var(--accent)}
.gh-chat-request{padding:8px 4px;border-top:1px solid var(--line)}
.gh-chat-request p{margin:4px 0;overflow-wrap:anywhere;font-size:12px;color:var(--muted)}
.gh-chat-main{display:flex;flex-direction:column;position:relative;min-height:0;min-width:0}
.gh-chat-head{display:flex;align-items:center;gap:10px;min-height:73px;padding:12px 22px;border-bottom:1px solid var(--line);flex-shrink:0}
.gh-chat-head-title{min-width:0;flex:1}
.gh-chat-head-title h2{font-size:16px;font-weight:600;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gh-chat-head-state{display:block;font-size:11px;color:var(--muted);min-height:16px}
.gh-chat-back{display:none}
.gh-chat-network{padding:8px 18px;margin:0;font-size:12px;color:var(--danger);border-bottom:1px solid var(--line)}
.gh-chat-scroll{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;padding:16px 24px;scrollbar-gutter:stable;overflow-anchor:none}
.gh-chat-history{display:block;margin:0 auto 18px;border:0;background:transparent;color:var(--muted);font-size:12px;padding:8px 12px;min-height:40px}
.gh-chat-history:hover{color:var(--accent)}
.gh-chat-items{display:flex;flex-direction:column;gap:14px;min-width:0}
.gh-chat-message{display:flex;flex-direction:column;align-self:flex-start;max-width:83%;min-width:0;align-items:flex-start}
.gh-chat-message.is-mine{align-self:flex-end;align-items:flex-end}
.gh-chat-message-top{display:flex;gap:8px;align-items:center;font-size:11px;color:var(--muted);padding:0 2px 4px;max-width:100%}
.gh-chat-author{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gh-chat-message-top time{flex-shrink:0;font-size:10px}
.gh-chat-bubble{background:var(--raised);border-radius:3px 10px 10px 10px;max-width:100%;padding:10px 13px;min-width:22px}
.gh-chat-message.is-mine .gh-chat-bubble{background:color-mix(in srgb,var(--accent) 14%,var(--raised));border-radius:10px 3px 10px 10px}
.gh-chat-text{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.7}
.gh-chat-bubble>.gh-chat-text:not(:first-child){margin-top:8px}
.gh-chat-tombstone{font-size:12px;color:var(--muted);margin:0}
.gh-chat-message.is-unavailable .gh-chat-bubble{background:transparent;padding:5px 0}
.gh-chat-image-link{display:block;max-width:240px;overflow:hidden;border-radius:6px}
.gh-chat-image-link img{display:block;width:240px;max-width:100%;height:180px;object-fit:cover;background:var(--bg)}
.gh-chat-audio{display:block;width:280px;max-width:100%;height:40px}
.gh-chat-activity{display:flex;align-items:center;gap:12px;max-width:300px;padding:4px 0}
.gh-chat-activity>span{min-width:0;flex:1}
.gh-chat-activity strong{font-size:14px;font-weight:550;display:block;overflow-wrap:anywhere}
.gh-chat-activity small{font-size:11px;color:var(--muted);display:block;margin-top:5px}
.gh-chat-activity>.icon{flex-shrink:0;width:19px;height:19px;color:var(--accent)}
.gh-chat-message-foot{display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-height:25px;margin-top:2px}
.gh-chat-message.is-mine .gh-chat-message-foot{justify-content:flex-end}
.gh-chat-read{font-size:10px;color:var(--muted)}
.gh-chat-message-actions{display:flex;gap:6px}
.gh-chat-text-button{background:none;border:0;padding:3px 5px;color:var(--muted);font-size:11px;min-height:28px}
.gh-chat-text-button:hover{color:var(--text)}
.gh-chat-new-messages{position:absolute;right:20px;bottom:163px;display:flex;align-items:center;gap:6px;background:var(--raised);color:var(--text);border:1px solid var(--line);border-radius:20px;padding:6px 12px;font-size:12px;min-height:36px;z-index:2}
.gh-chat-new-messages>.icon{width:15px;height:15px}
.gh-chat-composer{flex-shrink:0;padding:10px 18px 12px;border-top:1px solid var(--line);position:relative;background:var(--surface)}
.gh-chat-tools{display:flex;gap:3px;align-items:center;margin-bottom:4px}
.gh-chat-input-row{display:flex;align-items:flex-end;gap:12px}
.gh-chat-input-row textarea{flex:1;resize:none;border:0;background:transparent;padding:6px 2px;border-radius:3px;min-height:54px;max-height:130px;font-size:15px;line-height:1.6}
.gh-chat-input-row textarea:focus{outline:0}
.gh-chat-input-row textarea:focus-visible{box-shadow:inset 0 -2px var(--accent)}
.gh-chat-send{background:var(--accent);color:var(--accent-ink);border:0;border-radius:7px;min-height:39px;padding:7px 19px;font-size:13px}
.gh-chat-compose-state{font-size:11px;color:var(--muted);margin:5px 0 0;min-height:17px}
.gh-chat-emoji{position:absolute;bottom:100%;left:12px;padding:12px;background:var(--surface);border:1px solid var(--line);border-radius:10px;display:grid;grid-template-columns:repeat(8,36px);box-shadow:0 6px 25px #0003;z-index:4}
.gh-chat-emoji button{border:0;background:transparent;padding:4px;border-radius:5px;font-size:23px;min-height:36px}
.gh-chat-emoji button:hover{background:var(--raised)}
.gh-chat-draft{display:flex;align-items:center;gap:10px;padding:9px 0;max-width:100%;min-height:45px}
.gh-chat-draft>img{width:72px;height:60px;object-fit:cover;border-radius:5px}
.gh-chat-draft>audio{max-width:calc(100% - 50px);height:38px}
.gh-chat-draft>span{font-size:13px;overflow-wrap:anywhere;min-width:0}
.gh-chat-draft>span>.icon{vertical-align:middle;width:18px;height:18px}
.gh-chat-recording{color:var(--accent);font-variant-numeric:tabular-nums}
.gh-chat-placeholder{display:grid;place-items:center;color:var(--muted);font-size:14px;flex:1}
.gh-chat-empty-small{font-size:13px;color:var(--muted);text-align:center;padding:24px 10px;margin:0}
.gh-chat-group-detail h3{font-size:14px;margin:22px 0 8px}
.gh-chat-detail-meta{font-size:13px;color:var(--muted);margin:0 0 12px;white-space:pre-wrap;overflow-wrap:anywhere}
.gh-chat-announcement{font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere;padding:12px 0;margin:0}
.gh-chat-management{display:flex;flex-wrap:wrap;gap:6px;padding:8px 0;border-bottom:1px solid var(--line)}
.gh-chat-member{display:flex;align-items:center;gap:10px;padding:12px 0;border-bottom:1px solid var(--line)}
.gh-chat-member>span:not(.avatar){min-width:0;flex:1}
.gh-chat-member strong{font-size:13px;font-weight:500;overflow-wrap:anywhere}
.gh-chat-member small{display:block;font-size:11px;color:var(--muted)}
.gh-chat-member-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:2px}
.gh-chat-member-actions .gh-chat-button{font-size:11px;padding:6px 7px;min-height:36px}
.gh-chat-detail-footer{margin-top:24px;padding-top:14px}
.gh-chat-peer-detail{text-align:center;padding:8px}
.gh-chat-peer-detail>.avatar{width:52px;height:52px;font-size:22px;margin-bottom:12px}
.gh-chat-peer-detail h3{font-size:18px;margin:0 0 18px}
.gh-chat-activity-options{display:grid;gap:4px}
.gh-chat-activity-option{display:block;text-align:left;width:100%;padding:14px;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--text);font-size:15px;min-height:50px}
.gh-chat-activity-option:hover{background:var(--raised)}
body.gh-chat-open .workspace-footer{display:none}
@media(max-width:1100px){.gh-chat{grid-template-columns:230px minmax(0,1fr)}.gh-chat-scroll{padding:16px}.gh-chat-head{padding:12px 16px}.gh-chat-sidebar-head>div{gap:0}.gh-chat-sidebar-head .gh-chat-button{padding:5px;font-size:12px}}
@media(max-width:760px){
  body.gh-chat-open .workspace{padding:76px 0 75px}
  .gh-chat{display:block;height:calc(100dvh - 152px - env(safe-area-inset-bottom));min-height:320px;border:0;border-radius:0;max-height:none}
  .gh-chat-sidebar{height:100%;border:0}.gh-chat-main{display:none;height:100%}
  .gh-chat.has-conversation .gh-chat-sidebar{display:none}.gh-chat.has-conversation .gh-chat-main{display:flex}
  .gh-chat-back{display:inline-flex}.gh-chat-head{padding:9px 10px;min-height:64px;gap:6px}.gh-chat-head-title h2{font-size:16px}.gh-chat-head-state{font-size:11px}
  .gh-chat-button,.gh-chat-icon{min-height:44px}.gh-chat-icon{min-width:44px}
  .gh-chat-sidebar-head{padding:12px 18px}.gh-chat-sidebar-head .gh-chat-button{font-size:13px;padding:8px}
  .gh-chat-conversations{padding:0 8px 20px}.gh-chat-conversation{min-height:76px;padding:12px}.gh-chat-conversation-copy strong{font-size:16px}.gh-chat-conversation-copy small{font-size:12px}
  .gh-chat-scroll{padding:14px 12px}.gh-chat-message{max-width:88%}.gh-chat-text{font-size:16px}.gh-chat-bubble{padding:9px 12px}
  .gh-chat-message-foot{min-height:28px}.gh-chat-text-button{min-height:36px;padding:5px 7px}.gh-chat-read{font-size:11px}
  .gh-chat-composer{padding:5px 12px 7px}.gh-chat-input-row{gap:8px}.gh-chat-input-row textarea{font-size:16px;min-height:44px}.gh-chat-send{min-height:44px;padding:8px 16px}
  .gh-chat-compose-state{min-height:15px;margin-top:3px}.gh-chat-tools{margin:0}.gh-chat-emoji{left:8px;grid-template-columns:repeat(6,44px)}.gh-chat-emoji button{min-height:44px}
  .gh-chat-audio{width:230px}.gh-chat-image-link,.gh-chat-image-link img{max-width:220px}
  .gh-chat-new-messages{bottom:157px;right:14px}.gh-chat-member{flex-wrap:wrap}.gh-chat-member-actions{width:100%;justify-content:flex-start;padding-left:49px}.gh-chat-member-actions .gh-chat-button{min-height:44px;font-size:12px}
}
@media(prefers-reduced-motion:reduce){.gh-chat{scroll-behavior:auto}}
