.chat-workspace{display:grid;grid-template-columns:300px minmax(0,1fr);height: min(780px,76vh);min-height:480px;border:1px solid var(--line);border-radius:18px;overflow:hidden;background:var(--surface)}
.chat-sidebar{display:flex;flex-direction:column;min-height:0;border-right:1px solid var(--line);background:var(--bg)}
.chat-sidebar-head{padding:20px;display:flex;flex-direction:column;gap:14px}.chat-sidebar-head .btn{justify-content:center}
#chat-room-list{overflow:auto;flex:1}.chat-room{display:flex;width:calc(100% - 16px);margin:4px 8px;gap:12px;align-items:center;text-align:left;padding:14px 12px;border:0;border-radius:12px;background:transparent;color:var(--ink);cursor:pointer}.chat-room:hover,.chat-room.active{background:var(--accent-soft, var(--surface))}.chat-room.active{box-shadow:inset 3px 0 var(--accent)}.chat-room-copy{flex:1;min-width:0}.chat-room-copy strong,.chat-room-copy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-room-copy small{margin-top:5px;color:var(--muted);font-size:12px}.chat-room .avatar{flex-shrink:0}
.chat-sidebar-foot{display:grid;gap:12px;padding:16px;border-top:1px solid var(--line)}.chat-sidebar-foot a{font-size:13px;display:flex;justify-content:space-between}.chat-sidebar-foot small{color:var(--muted);font-size:11px}.chat-main{display:flex;flex-direction:column;min-width:0;min-height:0}.chat-room-header{padding:20px 24px;border-bottom:1px solid var(--line)}.chat-room-header h2{margin:0;font-size:19px}.chat-room-header p{margin:6px 0 0;color:var(--muted);font-size:12px;max-height:40px;overflow:auto}
#chat-workspace #messages{flex:1;min-height:0;overflow:auto;padding:24px;display:flex;flex-direction:column;gap:16px;scroll-behavior:auto;background:var(--bg)}.chat-bubble{align-self:flex-start;max-width:82%;padding:14px 17px;background:var(--surface);border:1px solid var(--line);border-radius:16px 16px 16px 4px;overflow-wrap:anywhere}.chat-bubble.mine{align-self:flex-end;border-radius:16px 16px 4px 16px;border-color:var(--accent);background:var(--accent-soft,var(--surface))}.chat-bubble>strong{font-size:12px;color:var(--accent)}.chat-body{white-space:pre-wrap;line-height:1.55;margin:7px 0}.chat-bubble footer{display:flex;gap:12px;justify-content:flex-end;flex-wrap:wrap;font-size:10px;color:var(--muted)}.chat-receipt.read{color:var(--accent);font-weight:700}.chat-welcome{margin:auto;text-align:center;color:var(--muted);padding:25px}.chat-welcome>svg{width:46px;height:46px}.chat-welcome h2{color:var(--ink);font-size:21px}.chat-welcome p{font-size:14px}.chat-history{align-self:center}
#chat-compose{padding:16px 20px;border-top:1px solid var(--line)}#chat-compose textarea{resize:vertical;min-height:65px;max-height:180px;width:100%}#chat-compose>div{display:flex;align-items:center;justify-content:space-between;margin-top:10px;gap:12px}#chat-compose small{font-size:11px;color:var(--muted)}.chat-unread-badge{display:inline-flex;justify-content:center;align-items:center;background:var(--accent);color:var(--accent-ink,#fff);border-radius:20px;min-width:21px;height:21px;padding:0 6px;font-size:11px;font-weight:700;margin-left:5px;flex-shrink:0}.chat-unread-badge[hidden],#chat-compose[hidden],#chat-group-name[hidden],.chat-person[hidden],#chat-people-empty[hidden]{display:none!important}
#chat-new-form{display:grid;gap:16px}#chat-new-form>label{display:grid;gap:7px}.chat-people{max-height:330px;overflow:auto;border:1px solid var(--line);border-radius:12px}.chat-person{display:flex;align-items:center;gap:12px;padding:12px;border-bottom:1px solid var(--line);cursor:pointer}.chat-person:hover{background:var(--bg)}.chat-person input{width:18px;height:18px;flex-shrink:0}.chat-person strong,.chat-person small{display:block}.chat-person small{margin-top:4px;color:var(--muted);font-size:12px}#chat-selected{font-size:13px;margin:0;color:var(--muted)}
@media(max-width:760px){.chat-workspace{grid-template-columns:1fr;height:auto;min-height:0}.chat-sidebar{border-right:0;border-bottom:1px solid var(--line)}.chat-sidebar-head{flex-direction:row;align-items:center;justify-content:space-between;padding:12px}#chat-room-list{max-height:190px}.chat-sidebar-foot{grid-template-columns:1fr 1fr;gap:8px;padding:10px}.chat-sidebar-foot small{grid-column:1/-1}.chat-main{height:65vh;min-height:400px}.chat-room-header{padding:14px}#chat-workspace #messages{padding:14px}.chat-bubble{max-width:94%}#chat-compose{padding:12px}#chat-compose small{display:none}.chat-person{padding:10px}}
#chat-compose textarea,#chat-new-form input:not([type=checkbox]),#chat-new-form select{border:1px solid var(--line);border-radius:10px;background:var(--subtle);color:var(--ink);padding:12px;width:100%;min-width:0}#chat-new-form .chat-people{min-width:0}#chat-new-form .chat-person>span:last-child{min-width:0;overflow-wrap:anywhere}
