/* Social expansion: close friends and independent group chat UI. */
#modal-root .pati-private-note{color:#666a72;font-size:12px;line-height:1.55;margin:9px 0 12px}
#modal-root .pati-social-search{display:block;width:100%;min-height:42px;box-sizing:border-box;border:1px solid #d9dae0;border-radius:10px;padding:10px 12px;font-size:16px;margin-bottom:12px}
#modal-root .pati-social-people{width:100%;min-width:0;max-height:min(55dvh,500px);overflow:auto;overscroll-behavior:contain}
#modal-root .pati-social-person{display:flex;align-items:center;gap:10px;min-width:0;border-bottom:1px solid #ededf0;padding:10px 4px}
#modal-root .pati-social-person[hidden]{display:none!important}
#modal-root .pati-social-person>.avatar{flex:0 0 40px;width:40px;height:40px}
#modal-root .pati-social-person>span:not(.avatar){display:flex;flex:1;flex-direction:column;min-width:0;gap:3px;overflow:hidden}
#modal-root .pati-social-person strong{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:13px}
#modal-root .pati-social-person small{color:#85858c;font-size:11px;overflow:hidden;text-overflow:ellipsis}
#modal-root .pati-social-person button{flex:none;min-width:72px;min-height:36px;background:#f1f1f4;border:0;border-radius:9px;padding:8px;color:#25252a;font-weight:750;font-size:12px}
#modal-root .pati-social-person button.active{background:#e6f4e9;color:#197444}
#modal-root .pati-social-person input[type="checkbox"]{flex:0 0 20px;width:20px;height:20px;accent-color:#242424}
#modal-root .pati-group-tools{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:0 0 12px}
#modal-root .pati-group-tools button{border:1px solid #e2e2e6;border-radius:9px;background:#f7f7f9;color:#242429;min-height:39px;padding:7px 11px;font-weight:700;font-size:12px}
#modal-root .pati-group-list-item{width:100%;display:flex;align-items:center;gap:10px;min-height:58px;padding:10px;border:0;border-bottom:1px solid #efeff0;background:transparent;color:#262626;text-align:left}
#modal-root .pati-group-list-item>span{display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:#f3f3f5}
#modal-root .pati-group-list-item>strong{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#modal-root .pati-group-list-item>small{color:#8b8c91}
#modal-root .pati-group-history{display:flex;flex-direction:column;gap:9px;min-height:150px;height:min(47dvh,440px);padding:10px 4px;overflow:auto;overscroll-behavior:contain}
#modal-root .pati-group-bubble{align-self:flex-start;min-width:0;max-width:82%;border-radius:13px;padding:9px 12px;background:#f1f1f4;color:#24242a}
#modal-root .pati-group-bubble.mine{align-self:flex-end;background:#e6e6eb}
#modal-root .pati-group-bubble strong{font-size:11px;font-weight:800}
#modal-root .pati-group-bubble p{font-size:14px;overflow-wrap:anywhere;margin:4px 0}
#modal-root .pati-group-bubble small{display:block;text-align:right;color:#85858d;font-size:10px}
#modal-root #pati-group-message-form [name="group_body"]{width:100%;min-height:46px;padding:12px;border:1px solid #d5d5dc;border-radius:12px;box-sizing:border-box;font-size:16px}
#patiyiz-system-media .pati-system-audience{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:11px 0;font-size:13px;font-weight:700;color:#24242a}
#patiyiz-system-media .pati-system-audience select{font-size:14px;max-width:58%;min-height:42px;border:1px solid #d4d4dc;border-radius:9px;padding:8px;background:#fff;color:#171717}
#main-content .pati-dm-top-actions{flex-wrap:wrap;justify-content:flex-end;gap:5px}
#main-content .pati-dm-top-actions .pati-dm-new[data-action="pati-group-list"]{white-space:nowrap}
@media(max-width:480px){
 #main-content .pati-dm-top-actions .pati-dm-new[data-action="pati-group-list"]{font-size:11px;padding:7px}
 #modal-root .pati-group-history{height:48dvh}
 #patiyiz-system-media .pati-system-audience{padding:10px 0}
}
html[data-pati-theme="dark"] #modal-root .pati-private-note{color:#c5c5cf}
html[data-pati-theme="dark"] #modal-root .pati-social-person{border-color:#42424a}
html[data-pati-theme="dark"] #modal-root .pati-social-person button,
html[data-pati-theme="dark"] #modal-root .pati-group-tools button{background:#36363d;color:#f4f4f7;border-color:#4a4a53}
html[data-pati-theme="dark"] #modal-root .pati-group-list-item{color:#f5f5f6}
html[data-pati-theme="dark"] #modal-root .pati-group-bubble{background:#35353b;color:#f2f2f4}
html[data-pati-theme="dark"] #modal-root .pati-group-bubble.mine{background:#494954}


/* Group inbox: compact previews, legible unread badge, unobtrusive deletion */
#modal-root .pati-group-list-item{gap:10px;text-align:left}
#modal-root .pati-group-list-item .pati-group-icon{
 display:grid;place-items:center;flex:none;width:40px;height:40px;
 border-radius:13px;background:#f1f1f4;color:#25252a;
}
#modal-root .pati-group-list-item .pati-group-list-details{
 display:flex;min-width:0;flex:1;flex-direction:column;gap:4px;
}
#modal-root .pati-group-list-item .pati-group-list-details strong,
#modal-root .pati-group-list-item .pati-group-list-details small{
 width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
#modal-root .pati-group-list-item .pati-group-list-details small{
 color:#7c7f88;font-size:12px;
}
#modal-root .pati-group-list-meta{
 display:flex;flex:none;flex-direction:column;align-items:flex-end;gap:5px;
}
#modal-root .pati-group-list-meta small{color:#868890;font-size:11px}
#modal-root .pati-group-unread{
 display:grid;place-items:center;min-width:23px;min-height:23px;padding:0 5px;
 border-radius:20px;background:#191a1e;color:white;font-size:11px;box-sizing:border-box;
}
#modal-root .pati-group-unread-total{margin-left:auto;font-size:12px;color:#63666d}
#modal-root .pati-group-message-meta{
 display:flex;align-items:center;justify-content:flex-end;gap:9px;
}
#modal-root .pati-group-message-meta button{
 font:600 11px system-ui,sans-serif;min-height:25px;padding:3px 8px;
 background:transparent;border:0;border-radius:7px;color:#8d4242;
 cursor:pointer;opacity:.75;
}
#modal-root .pati-group-message-meta button:hover,
#modal-root .pati-group-message-meta button:focus-visible{
 background:#fceced;opacity:1;
}
#modal-root .pati-group-history{overflow-anchor:auto}
html[data-pati-theme="dark"] #modal-root .pati-group-list-item .pati-group-list-details small,
html[data-pati-theme="dark"] #modal-root .pati-group-list-meta small{color:#bbbcc6}
html[data-pati-theme="dark"] #modal-root .pati-group-unread-total{color:#c8c8ce}
html[data-pati-theme="dark"] #modal-root .pati-group-list-item .pati-group-icon{background:#3b3b45;color:#fafafa}
html[data-pati-theme="dark"] #modal-root .pati-group-message-meta button{color:#e9b2b2}


/* One messaging inbox for people and groups, including narrow phones. */
#main-content .pati-group-thread-row .pati-group-inbox-avatar,
#main-content .pati-group-chat-window .pati-group-avatar{
 display:grid;place-items:center;flex:0 0 44px;
 width:44px;height:44px;border-radius:50%;
 background:#e9eaef;color:#292b31;
}
#main-content .pati-group-thread-row .pati-group-inbox-avatar .icon,
#main-content .pati-group-chat-window .pati-group-avatar .icon{
 width:21px;height:21px;stroke-width:2;
}
#main-content .pati-group-thread-row.selected{background:#f4f4f6}
#main-content .pati-group-thread-row .chat-person{min-width:0;flex:1 1 0}
#main-content .pati-group-thread-row .pati-dm-row-menu button{
 display:flex;align-items:center;gap:9px;width:100%;
 padding:10px 12px;min-height:40px;
 background:none;color:inherit;border:none;border-radius:8px;
 text-align:left;font-size:13px;font-weight:650;
}
#main-content .pati-group-chat-window{
 display:flex;flex-direction:column;min-width:0;min-height:0;
}
#main-content .pati-group-chat-header{
 display:flex;align-items:center;gap:10px;
}
#main-content .pati-group-chat-header .pati-group-chat-title{
 display:flex;flex:1;flex-direction:column;min-width:0;gap:3px;
}
#main-content .pati-group-chat-header .pati-group-chat-title strong{
 overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
#main-content .pati-group-chat-header .pati-group-chat-title small{font-size:11px;opacity:.67}
#main-content .pati-group-chat-window .chat-history{
 display:flex;flex:1;flex-direction:column;gap:12px;
 min-height:0;overflow:auto;overscroll-behavior:contain;
}
#main-content .pati-group-chat-window .pati-group-bubble{
 width:max-content;max-width:82%;min-width:0;
 display:flex;flex-direction:column;align-self:flex-start;
 padding:10px 13px;border-radius:15px;
 overflow-wrap:anywhere;background:#f1f1f4;color:#202027;
}
#main-content .pati-group-chat-window .pati-group-bubble.mine{
 align-self:flex-end;background:#e8e8ee;color:#202027;
}
#main-content .pati-group-chat-window .pati-group-bubble>strong{
 font-size:11px;font-weight:800;line-height:1.2;
}
#main-content .pati-group-chat-window .pati-group-bubble>p{
 margin:5px 0;font-size:14px;line-height:1.45;white-space:pre-wrap;
}
#main-content .pati-group-chat-window .pati-group-chat-form{
 display:flex;align-items:center;flex:0 0 auto;min-height:60px;gap:8px;
}
#main-content .pati-group-chat-window .pati-group-chat-form input[name="group_body"]{
 flex:1;min-width:0;width:100%;min-height:42px;
 border-radius:22px;padding:10px 13px;font-size:16px;
}
#main-content .pati-group-chat-window .pati-group-chat-form .primary-btn{
 flex:none;display:grid;place-items:center;min-width:42px;min-height:42px;
}
#main-content .pati-group-chat-window .pati-group-empty{
 text-align:center;color:#898b93;margin:auto;font-size:13px;
}
html[data-pati-theme="dark"] #main-content .pati-group-thread-row .pati-group-inbox-avatar,
html[data-pati-theme="dark"] #main-content .pati-group-chat-window .pati-group-avatar{
 background:#393943;color:#f3f3f7;
}
html[data-pati-theme="dark"] #main-content .pati-group-thread-row.selected{background:#303036}
html[data-pati-theme="dark"] #main-content .pati-group-chat-window .pati-group-bubble{
 background:#35353d;color:#f5f5f8;
}
html[data-pati-theme="dark"] #main-content .pati-group-chat-window .pati-group-bubble.mine{
 background:#484852;color:#fff;
}
@media(max-width:740px){
 #main-content .pati-group-chat-window .pati-group-bubble{max-width:88%}
 #main-content .pati-group-chat-window .pati-group-chat-form{padding-bottom:max(8px,env(safe-area-inset-bottom,0px))}
 #main-content .pati-dm-top-actions .pati-dm-new[data-action="pati-group-create-open"]{white-space:nowrap;font-size:11px}
}
