.community-space { padding: 30px 0 60px; background: #f8fafc; }
.community-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; align-items: start; }
.community-sidebar { display: grid; gap: 16px; }
.community-panel { padding: 20px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 8px 22px rgba(32,33,43,.06); }
.community-panel h3 { font-size: 20px; color: #20212B; margin-bottom: 14px; }
.community-rules-panel p { margin: 10px 0 5px; color: #20212B; }
.community-rules-panel ul { margin: 0; padding-left: 20px; color: #475467; font-size: 14px; line-height: 1.5; }
.community-rules-report { padding: 10px 12px; border-radius: 8px; background: #fff7e6; font-size: 13px; line-height: 1.45; }
.community-panel .form-control { margin-bottom: 10px; }
.group-limit-notice { margin: 2px 0 10px; padding: 10px 12px; border: 1px solid #d9e8ff; border-radius: 8px; background: #f3f8ff; color: #344054; font-size: 14px; line-height: 1.35; }
.community-safety-note { padding: 11px 13px; border: 1px solid #fde68a; border-radius: 8px; background: #fffbeb; color: #78350f; font-size: 14px; line-height: 1.45; }
.community-safety-note a,
.report-content-link { color: #8a4b00; font-weight: 800; text-decoration: underline; }
.report-content-link { display: inline-flex; margin-top: 8px; font-size: 13px; }
.group-limit-notice strong { color: #20212B; }
.group-limit-notice.is-full { border-color: #fecaca; background: #fff1f2; color: #991b1b; }
.chat-groups-list, .posts-list { display: grid; gap: 12px; }
.chat-group-btn { width: 100%; text-align: left; padding: 13px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; }
.chat-group-btn.is-active, .chat-group-btn:hover { border-color: #FDBE33; background: #fffaf0; }
.chat-group-btn strong, .chat-group-btn span { display: block; }
.chat-group-btn span, .community-status, .community-empty, .chat-header p, .post-author small { color: #667085; }
.chat-header { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 18px; }
.chat-header h1 { color: #20212B; margin: 0 0 4px; }
.chat-header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.invite-chip { padding: 9px 12px; border-radius: 999px; background: #f3f6ff; color: #20212B; font-weight: 800; white-space: nowrap; }
.icon-action-btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid #e5e7eb; background: #fff; color: #20212B; display: inline-flex; align-items: center; justify-content: center; }
.icon-action-btn:hover { border-color: #FDBE33; background: #fffaf0; }
.btn-outline-custom { border: 1px solid #20212B; color: #20212B; background: #fff; font-weight: 800; }
.btn-outline-custom:hover { background: #20212B; color: #fff; }
.btn-danger-custom { width: 100%; border: 1px solid #dc2626; background: #dc2626; color: #fff; font-weight: 800; }
.btn-danger-custom:hover { background: #b91c1c; color: #fff; }
.danger-link-btn { border: 1px solid #fecaca; background: #fff1f2; border-radius: 999px; padding: 6px 12px; color: #b91c1c; font-weight: 800; }
.danger-link-btn:hover { border-color: #dc2626; color: #991b1b; }
.community-modal[hidden] { display: none; }
.community-modal { position: fixed; inset: 0; z-index: 10050; display: grid; place-items: center; padding: 18px; }
.community-modal-backdrop { position: absolute; inset: 0; background: rgba(32,33,43,.58); }
.community-modal-dialog { position: relative; z-index: 1; width: min(720px, 100%); max-height: min(86vh, 760px); overflow: auto; background: #fff; border-radius: 8px; box-shadow: 0 24px 70px rgba(32,33,43,.28); }
.community-modal-dialog-sm { width: min(560px, 100%); }
.community-modal-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 22px 22px 12px; border-bottom: 1px solid #eef2f6; }
.community-modal-header h2 { margin: 0; color: #20212B; font-size: 24px; }
.community-modal-body { display: grid; gap: 16px; padding: 20px 22px 22px; }
.group-edit-stack { display: grid; gap: 8px; }
.group-edit-stack label { margin: 0; font-weight: 800; color: #20212B; }
.private-group-controls { display: grid; gap: 14px; padding-top: 12px; border-top: 1px solid #eef2f6; }
.invite-management { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.invite-management h3, .group-members-panel h3 { margin: 0 0 4px; font-size: 18px; color: #20212B; }
.invite-management p { margin: 0; color: #667085; }
.invite-code-box { padding: 11px 14px; border-radius: 8px; background: #f3f6ff; color: #20212B; font-weight: 900; overflow-wrap: anywhere; }
.group-members-panel { margin-top: 14px; }
.group-members-list { display: grid; gap: 8px; }
.group-member-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 8px; background: #fff; border: 1px solid #e5e7eb; }
.group-member-row strong, .group-member-row span { display: block; }
.group-member-row span { color: #667085; font-size: 13px; overflow-wrap: anywhere; }
.group-member-row small { color: #667085; font-weight: 800; }
.remove-member-btn, .edit-post-btn { border: 1px solid #e5e7eb; background: #fff; border-radius: 999px; padding: 6px 12px; color: #344054; font-weight: 800; }
.remove-member-btn:hover, .edit-post-btn:hover { border-color: #FDBE33; color: #20212B; }
.post-form { display: grid; gap: 10px; margin-bottom: 18px; }
.community-post { padding: 18px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; }
.post-author { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.post-author img, .post-author span { width: 42px; height: 42px; border-radius: 999px; object-fit: cover; }
.post-author span { display: inline-flex; align-items: center; justify-content: center; background: #FDBE33; color: #20212B; font-weight: 800; }
.post-author strong { display: block; color: #20212B; }
.post-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.like-btn { border: 1px solid #e5e7eb; background: #fff; border-radius: 999px; padding: 6px 12px; color: #667085; font-weight: 800; }
.like-btn.is-liked { color: #b91c1c; background: #fff0f0; border-color: #fecaca; }
.post-comments { display: grid; gap: 8px; margin: 12px 0; }
.post-comment { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 10px 12px; background: #f8fafc; border-radius: 8px; }
.post-comment strong, .post-comment span { display: block; }
.comment-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.report-comment-btn { border: 1px solid #fed7aa; background: #fff7ed; border-radius: 999px; padding: 6px 12px; color: #9a3412; font-weight: 800; }
.report-comment-btn:hover, .report-comment-btn:focus { border-color: #f97316; color: #7c2d12; }
.comment-form-inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.community-empty { padding: 16px; border: 1px dashed #d0d5dd; border-radius: 8px; background: #fff; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.community-modal-open { overflow: hidden; }
@media (max-width: 991px) { .community-layout { grid-template-columns: 1fr; } .chat-header { flex-direction: column; } .chat-header-actions { justify-content: flex-start; } }
@media (max-width: 575px) { .comment-form-inline, .modal-actions, .invite-management, .post-comment { grid-template-columns: 1fr; } .modal-actions, .invite-management, .post-comment { display: grid; } }

/* Conversation-led community experience */
.community-chat-hero{min-height:280px!important;padding-top:130px!important;padding-bottom:54px!important}
.community-space{background:var(--color-page)!important;padding:28px 0 64px}
.community-space .container{max-width:1440px}
.club-chat-guest[hidden],.community-layout[hidden]{display:none!important}
.club-chat-guest{align-items:center;background:linear-gradient(145deg,var(--color-surface-1),var(--color-surface-2));border:1px solid var(--color-border-default);border-radius:18px;box-shadow:var(--shadow-panel);display:flex;flex-direction:column;margin:18px auto 34px;max-width:780px;overflow:hidden;padding:clamp(34px,6vw,68px);position:relative;text-align:center}
.club-chat-guest:before{background:radial-gradient(circle,rgba(22,132,255,.2),transparent 68%);content:"";height:360px;position:absolute;right:-170px;top:-190px;width:360px}
.club-chat-guest>*{position:relative}.club-chat-guest-icon{align-items:center;background:var(--color-primary-soft);border:1px solid var(--color-border-accent);border-radius:50%;color:var(--color-primary-bright);display:flex;font-size:1.8rem;height:72px;justify-content:center;margin-bottom:20px;width:72px}
.club-chat-guest h1{color:var(--color-text-primary);font-size:clamp(2.25rem,5vw,4rem);line-height:1;margin:4px 0 18px}.club-chat-guest>p:not(.portal-eyebrow){color:var(--color-text-secondary);font-size:1rem;line-height:1.65;margin:0;max-width:590px}.club-chat-guest small{color:var(--color-text-muted);margin-top:18px}
.club-chat-guest-actions{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:28px}.club-chat-guest-actions .btn{align-items:center;display:inline-flex;gap:8px;justify-content:center;min-height:48px}
.community-layout{grid-template-columns:360px minmax(0,1fr);gap:18px}
.community-sidebar{max-height:calc(100vh - 130px);overflow-y:auto;padding-right:4px;scrollbar-color:var(--color-border-strong) transparent}
.community-panel{background:var(--color-surface-1)!important;border:1px solid var(--color-border-default)!important;border-radius:14px;box-shadow:var(--shadow-panel);color:var(--color-text-primary)!important}
.community-panel h1,.community-panel h2,.community-panel h3,.community-panel strong{color:var(--color-text-primary)!important}
.community-panel p,.community-panel li,.community-status{color:var(--color-text-secondary)!important}
.community-sidebar>.community-panel:first-child{padding:12px;position:static}
.community-sidebar>.community-panel:first-child h3{padding:7px 8px 12px;margin:0}
.chat-groups-list{gap:4px}
.chat-group-btn{align-items:center;background:transparent!important;border:1px solid transparent!important;border-radius:10px;display:grid;gap:13px;grid-template-columns:68px minmax(0,1fr) auto;min-height:86px;padding:9px 10px;color:var(--color-text-primary)!important}
.chat-group-btn:hover{background:var(--color-surface-hover)!important;border-color:var(--color-border-default)!important}
.chat-group-btn.is-active{background:var(--color-primary-soft)!important;border-color:var(--color-border-accent)!important;box-shadow:inset 3px 0 0 var(--color-primary)}
.chat-group-btn>i{color:var(--color-text-muted);font-size:.72rem}
.chat-group-avatar,.chat-avatar,.comment-avatar{align-items:center;background:linear-gradient(145deg,var(--color-primary),#42a5ff);border:2px solid rgba(255,255,255,.12);border-radius:50%;color:#fff!important;display:inline-flex;flex:none;font-size:.76rem;font-weight:900;justify-content:center;letter-spacing:.03em;overflow:hidden}
.chat-group-avatar{font-size:1rem;height:68px;line-height:1;text-align:center;width:68px}.chat-avatar{height:42px;width:42px}.comment-avatar{height:30px;width:30px}
.chat-group-btn .chat-group-avatar,.post-comment .comment-avatar{align-items:center;display:inline-flex;justify-content:center;font-family:Arial,sans-serif;line-height:1;padding:0;text-align:center}
.chat-avatar img{height:100%;object-fit:cover;width:100%}
.chat-group-copy{min-width:0}.chat-group-copy strong,.chat-group-copy>span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-group-copy>span{color:var(--color-text-secondary)!important;font-size:.72rem;margin-top:4px}
.chat-panel{display:flex;flex-direction:column;height:clamp(650px,calc(100vh - 125px),900px);overflow:hidden;padding:0!important}
.chat-header{align-items:center;background:var(--color-surface-1);border-bottom:1px solid var(--color-border-default);flex:none;margin:0;padding:17px 20px}
.chat-header h1{font-size:clamp(1.35rem,2vw,1.75rem);margin:1px 0 3px}.chat-header p{margin:0}.chat-header #activeGroupDescription{font-size:.82rem}
.invite-chip,.icon-action-btn{background:var(--color-surface-2)!important;border-color:var(--color-border-default)!important;color:var(--color-text-primary)!important}
.posts-list{background-color:var(--color-page-alt);background-image:radial-gradient(circle at 1px 1px,rgba(73,155,235,.09) 1px,transparent 0);background-size:24px 24px;display:flex;flex:1;flex-direction:column;gap:9px;overflow-y:auto;padding:24px clamp(14px,3vw,42px);scroll-behavior:smooth}
.community-post{align-items:flex-end;background:transparent!important;border:0!important;border-radius:0;box-shadow:none;display:flex;gap:9px;max-width:min(78%,760px);padding:0}
.community-post.is-self{align-self:flex-end;flex-direction:row-reverse}
.post-author{flex:none;margin:0}.post-author img,.post-author span{border:2px solid var(--color-border-accent);height:38px;width:38px}.post-author span{background:var(--color-surface-3);color:var(--color-primary-bright)}
.message-stack{align-items:flex-start;display:flex;flex-direction:column;min-width:0}.is-self .message-stack{align-items:flex-end}
.message-bubble{background:var(--color-surface-1);border:1px solid var(--color-border-default);border-radius:14px 14px 14px 4px;box-shadow:0 8px 22px rgba(0,0,0,.16);min-width:150px;padding:10px 13px 8px;position:relative}
.is-self .message-bubble{background:linear-gradient(145deg,var(--color-primary),#0865d8);border-color:#388eea;border-radius:14px 14px 4px 14px;color:#fff}
.message-meta{align-items:center;display:flex;gap:14px;justify-content:space-between;margin-bottom:4px}.message-meta strong{color:var(--color-primary-bright)!important;font-size:.76rem}.message-meta small{color:var(--color-text-muted)!important;font-size:.65rem;white-space:nowrap}.is-self .message-meta strong,.is-self .message-meta small{color:#eaf5ff!important}
.post-text{color:var(--color-text-primary)!important;font-size:.94rem;line-height:1.5;margin:0;overflow-wrap:anywhere;white-space:pre-wrap}.is-self .post-text{color:#fff!important}
.post-actions{gap:4px;justify-content:flex-end;margin:7px -5px -3px}.post-actions button{background:transparent!important;border:0!important;color:var(--color-text-secondary)!important;font-size:.67rem;padding:4px 6px}.is-self .post-actions button{color:#dceeff!important}.post-actions .like-btn.is-liked{color:#ffb4bd!important}
.post-comments{gap:6px;margin:7px 0 0;max-width:100%}.post-comment{align-items:start;background:var(--color-surface-2)!important;border:1px solid var(--color-border-subtle);border-radius:10px;display:grid;grid-template-columns:30px minmax(0,1fr) auto;min-width:min(420px,100%);padding:8px}.post-comment strong{font-size:.7rem}.post-comment span:not(.comment-avatar){color:var(--color-text-secondary);font-size:.8rem;line-height:1.4}.comment-actions button{background:transparent!important;border:0!important;font-size:.62rem;padding:3px}
.comment-form-inline{grid-template-columns:minmax(130px,1fr) 40px;margin-top:6px;max-width:430px;width:100%}.comment-form-inline .form-control{background:var(--color-surface-2)!important;border-color:var(--color-border-default)!important;border-radius:999px!important;color:var(--color-text-primary)!important;height:40px;margin:0!important;padding:8px 14px}.comment-form-inline .btn{border-radius:50%;height:40px;padding:0;width:40px}.comment-form-inline .btn span{display:none}
.report-content-link{color:var(--color-text-muted)!important;font-size:.62rem;margin:3px 5px 0;opacity:.75;text-decoration:none}.report-content-link:hover{color:var(--color-warning)!important;opacity:1}
.post-form{background:var(--color-surface-1);border-top:1px solid var(--color-border-default);flex:none;gap:7px;margin:0;padding:11px 18px 13px}
.chat-composer-row{align-items:flex-end;display:grid;gap:10px;grid-template-columns:42px minmax(0,1fr) 46px}
.post-form #postText{background:var(--color-surface-2)!important;border:1px solid var(--color-border-default)!important;border-radius:22px!important;color:var(--color-text-primary)!important;margin:0;max-height:120px;min-height:46px;padding:11px 16px;resize:none}
.chat-send-btn{align-items:center;background:var(--color-primary);border:0;border-radius:50%;color:#fff;display:flex;height:46px;justify-content:center;transition:transform .18s,background .18s;width:46px}.chat-send-btn:hover{background:var(--color-primary-hover);transform:translateY(-1px)}
.community-safety-note{background:transparent!important;border:0!important;color:var(--color-text-muted)!important;font-size:.68rem;margin:0;padding:0 52px}.community-safety-note a{color:var(--color-primary-bright)!important}.post-form .community-status{font-size:.72rem;min-height:0;padding-left:52px}
.community-empty{align-self:stretch;margin:auto}.posts-list .community-empty:before{content:'\f075'}
.community-rules-report,.group-limit-notice,.invite-code-box,.group-member-row{background:var(--color-surface-2)!important;border-color:var(--color-border-default)!important;color:var(--color-text-secondary)!important}
.community-panel .form-control,.community-modal .form-control{background:var(--color-surface-2)!important;border-color:var(--color-border-default)!important;color:var(--color-text-primary)!important}
.community-modal-dialog{background:var(--color-surface-1)!important;border:1px solid var(--color-border-default)}.community-modal-header{border-color:var(--color-border-default)}
@media(max-width:991px){.community-layout{grid-template-columns:300px minmax(0,1fr)}.community-sidebar{max-height:none}.community-sidebar>.community-panel:not(:first-child){display:none}.chat-panel{height:calc(100vh - 100px);min-height:620px}}
@media(max-width:767px){.community-chat-hero{min-height:210px!important;padding-top:72px!important;padding-bottom:38px!important}.community-space{padding:12px 0 30px}.community-space>.container{padding:0 10px}.club-chat-guest{margin:8px auto 24px;padding:34px 20px}.club-chat-guest-actions{display:grid;width:100%}.club-chat-guest-actions .btn{width:100%}.community-layout{display:block}.community-layout[hidden]{display:none!important}.community-sidebar>.community-panel:first-child{margin-bottom:10px;position:static}.chat-groups-list{display:flex;overflow-x:auto;padding-bottom:4px}.chat-group-btn{flex:0 0 220px}.chat-group-btn>i{display:none}.chat-panel{height:calc(100vh - 155px);min-height:560px}.chat-header{padding:12px 14px}.chat-header #activeGroupDescription{display:none}.posts-list{padding:16px 10px}.community-post{max-width:94%}.post-author img,.post-author span{height:32px;width:32px}.message-bubble{padding:9px 11px}.post-form{padding:9px}.chat-composer-row{grid-template-columns:minmax(0,1fr) 44px}.chat-composer-row>.chat-avatar{display:none}.community-safety-note{display:none}.post-form .community-status{padding-left:4px}.post-comment{grid-template-columns:26px minmax(0,1fr)}.post-comment .comment-actions{grid-column:2}.comment-avatar{height:26px;width:26px}}
