.communities-page,
.community-page,
.community-members-page,
.community-settings-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px 56px;
  width: 100%;
  box-sizing: border-box;
}

.communities-page {
  max-width: 1180px;
  padding-top: 18px;
}

.communities-hero,
.community-hero {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 14px 16px;
  box-shadow: 0 22px 50px rgba(0,0,0,0.24);
}

.communities-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-radius: 20px;
}

.communities-hero h1 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.1;
}

.communities-hero p {
  margin: 6px 0 0;
  color: #cbd5e1;
  font-size: 0.94rem;
}

.communities-hero-copy {
  min-width: 0;
}

.communities-toolbar,
.community-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.community-admin-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.communities-toolbar .action-btn.active {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(139, 92, 246, 0.24);
}

.community-toolbar-select {
  min-width: 160px;
  background: rgba(255,255,255,0.06);
  color: #f8fafc;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 10px 14px;
  font: inherit;
}

.communities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.community-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 14px;
}

.community-card:hover {
  transform: translateY(-1px);
  border-color: rgba(139,92,246,0.32);
}

.community-card-head,
.community-member {
  display: flex;
  align-items: center;
  gap: 12px;
}

.community-hero .community-card-head {
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.community-avatar,
.community-member-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  overflow: hidden;
}

.community-hero-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.community-hero-avatar-wrap .community-avatar {
  width: 100%;
  height: 100%;
}

.community-avatar img,
.community-member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.community-meta,
.community-member-meta {
  min-width: 0;
  flex: 1;
}

.community-title,
.community-member-name {
  font-size: 0.98rem;
  font-weight: 800;
}

.community-slug,
.community-member-role {
  color: #94a3b8;
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.community-desc {
  margin-top: 6px;
  color: #cbd5e1;
  line-height: 1.36;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.community-stats {
  margin-top: 6px;
  display: flex;
  gap: 4px 6px;
  flex-wrap: wrap;
  color: #cbd5e1;
  font-size: 0.82rem;
}

.community-category-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(139,92,246,0.12);
  color: #ddd6fe;
  font-size: 0.8rem;
  font-weight: 700;
}

.community-conversation-types {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.community-conversation-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(125,211,252,0.08);
  border: 1px solid rgba(125,211,252,0.18);
  color: #bae6fd;
  font-size: 0.78rem;
  font-weight: 700;
}

.community-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(270px, 0.78fr);
  gap: 14px;
  margin-top: 14px;
  min-width: 0;
  align-items: start;
}

.community-layout > section {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.community-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.8fr);
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}

.community-panel {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 12px;
}

.community-sidebar {
  align-self: start;
}

.community-panel h3 {
  margin: 0 0 10px;
}

.community-identity-copy {
  color: #e2e8f0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.community-identity-copy.subtle {
  color: #94a3b8;
}

.community-identity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.community-identity-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.18);
  color: #ddd6fe;
  font-size: 0.78rem;
  font-weight: 700;
}

.community-prompt-list {
  display: grid;
  gap: 10px;
}

.community-prompt-card {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  color: #e2e8f0;
  cursor: pointer;
  font: inherit;
  padding: 12px;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.community-prompt-card:hover {
  border-color: rgba(139,92,246,0.28);
  background: rgba(255,255,255,0.06);
  transform: translateY(-1px);
}

.community-prompt-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(139,92,246,0.22), rgba(236,72,153,0.16));
  color: #f8fafc;
  font-size: 0.8rem;
  font-weight: 800;
}

.community-prompt-copy {
  color: #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.community-permissions-panel,
.community-audit-list,
.community-announcement-copy,
.community-rules-list {
  min-width: 0;
}

.community-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.community-inline-link {
  color: #a78bfa;
  font-size: 0.9rem;
  text-decoration: none;
}

.community-inline-meta {
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 600;
}

.community-inline-link:hover {
  text-decoration: underline;
}

.community-mobile-link {
  display: none;
}

.community-members {
  display: grid;
  gap: 8px;
}

.community-permissions-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: #cbd5e1;
  font-size: 0.86rem;
  line-height: 1.4;
}

.community-announcement-copy {
  color: #f8fafc;
  line-height: 1.5;
  font-size: 0.92rem;
}

.community-announcement-copy p {
  margin: 0 0 10px;
}

.community-announcement-copy p:last-child {
  margin-bottom: 0;
}

.community-copy-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.community-copy-toggle {
  background: none;
  border: 0;
  padding: 2px 0 0;
  color: #a78bfa;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  justify-self: start;
}

.community-copy-toggle:hover {
  color: #c4b5fd;
}

.community-rules-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: #cbd5e1;
  font-size: 0.88rem;
  line-height: 1.42;
}

.community-rules-collapsed {
  max-height: 190px;
  overflow: hidden;
  position: relative;
}

.community-rules-collapsed::after {
  content: "";
  position: absolute;
  left: -18px;
  right: 0;
  bottom: 0;
  height: 44px;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.95));
  pointer-events: none;
}

.community-rules-gate-copy {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.9rem;
  line-height: 1.45;
}

.community-rules-modal .report-modal-body {
  gap: 12px;
}

.community-rules-modal-copy {
  max-height: 46vh;
  overflow: auto;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: #e2e8f0;
  line-height: 1.5;
}

.community-rules-modal-copy p {
  margin: 0 0 12px;
}

.community-rules-modal-copy p:last-child {
  margin-bottom: 0;
}

.community-member {
  justify-content: space-between;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 8px 9px;
  gap: 8px;
  align-items: center;
}

.community-member-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.community-member-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

.community-role-select,
.community-form input,
.community-form textarea,
.community-form select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: block;
  background: rgba(255,255,255,0.06);
  color: #f8fafc;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
}

.community-role-select {
  min-width: 124px;
  width: auto;
  max-width: 160px;
}

.community-member-role-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: #cbd5e1;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: capitalize;
}

.community-member-menu-wrap {
  position: relative;
}

.community-member-menu-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: #e2e8f0;
  font: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.community-member-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.32);
  padding: 6px;
  z-index: 20;
}

.community-member-menu-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  text-align: left;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}

.community-member-menu-item:hover {
  background: rgba(255,255,255,0.06);
}

.community-member-menu-item.danger {
  color: #fda4af;
}

.community-form {
  display: grid;
  gap: 12px;
}

.community-settings-form {
  gap: 16px;
}

.community-settings-form h2 {
  margin: 0;
  font-size: 1.15rem;
}

.community-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.community-settings-field {
  display: grid;
  gap: 10px;
  align-content: start;
}

.community-settings-field > span {
  color: #cbd5e1;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
}

.community-settings-field input,
.community-settings-field select,
.community-settings-field textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
  border: 1px solid rgba(139, 92, 246, 0.18);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.36);
}

.community-settings-field input::placeholder,
.community-settings-field textarea::placeholder {
  color: #94a3b8;
}

.community-settings-field input:focus,
.community-settings-field select:focus,
.community-settings-field textarea:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.52);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}

.community-settings-field textarea {
  min-height: 132px;
  resize: vertical;
}

#communitySettingsAnnouncement {
  min-height: 136px;
}

#communitySettingsRules {
  min-height: 210px;
}

.community-settings-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
}

.community-settings-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.82);
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.community-settings-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.community-settings-check span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.community-settings-check span:last-child::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.03);
  box-shadow: inset 0 0 0 3px transparent;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.community-settings-check:has(input:checked) {
  background: rgba(139,92,246,0.18);
  border-color: rgba(139,92,246,0.38);
  color: #f5f3ff;
}

.community-settings-check:has(input:checked) span:last-child::before {
  border-color: rgba(196,181,253,0.9);
  background: rgba(139,92,246,0.92);
  box-shadow: inset 0 0 0 3px #f8fafc;
}

.community-settings-check:hover {
  transform: translateY(-1px);
  border-color: rgba(139,92,246,0.24);
}

.community-settings-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.community-settings-actions .action-btn,
.community-settings-actions .primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.community-settings-side {
  display: grid;
  gap: 12px;
  align-self: start;
}

.community-settings-avatar-card {
  display: grid;
  gap: 14px;
}

.community-settings-avatar-preview {
  display: flex;
  align-items: center;
  gap: 12px;
}

.community-settings-avatar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
}

.community-reason-input {
  width: 100%;
  min-height: 96px;
  max-width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.06);
  color: #f8fafc;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  resize: vertical;
}

.community-audit-list {
  display: grid;
  gap: 8px;
}

.community-audit-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 10px 11px;
}

.community-audit-text {
  color: #f8fafc;
  font-size: 0.86rem;
  line-height: 1.4;
}

.community-audit-reason {
  margin-top: 4px;
  color: #cbd5e1;
  font-size: 0.8rem;
  line-height: 1.35;
}

.community-audit-time {
  margin-top: 5px;
  color: #94a3b8;
  font-size: 0.75rem;
}

.community-report-list {
  display: grid;
  gap: 10px;
}

.community-report-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 10px 11px;
  display: grid;
  gap: 8px;
}

.community-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.community-report-target {
  color: #f8fafc;
  font-size: 0.88rem;
  font-weight: 800;
}

.community-report-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  color: #cbd5e1;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: capitalize;
}

.community-report-status.open {
  background: rgba(251, 191, 36, 0.16);
  color: #fde68a;
}

.community-report-status.reviewing {
  background: rgba(59, 130, 246, 0.16);
  color: #bfdbfe;
}

.community-report-status.resolved {
  background: rgba(16, 185, 129, 0.16);
  color: #a7f3d0;
}

.community-report-status.accepted {
  background: rgba(16, 185, 129, 0.16);
  color: #a7f3d0;
}

.community-report-status.rejected {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

.community-report-status.dismissed {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.community-report-meta,
.community-report-note,
.community-report-snippet {
  color: #cbd5e1;
  font-size: 0.82rem;
  line-height: 1.42;
}

.community-report-snippet {
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}

.community-report-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.community-report-action-btn {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: #e2e8f0;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.community-report-action-btn:hover {
  background: rgba(255,255,255,0.08);
}

.community-page .post-actions {
  display: flex;
  align-items: center;
}

.community-page .post-actions .react-wrap,
.community-page .post-actions > .action-btn {
  flex: 1 1 0;
}

.community-page .post-actions .react-wrap {
  display: flex;
}

.community-page .post-actions .react-wrap .action-btn,
.community-page .post-actions > .action-btn {
  width: 100%;
  justify-content: center;
}

#createCommunityModal .report-modal {
  max-width: 500px;
  width: min(500px, calc(100vw - 32px));
  border-radius: 20px;
}

#createCommunityModal .report-modal-header {
  padding: 18px 22px;
  font-size: 1rem;
}

#createCommunityModal .report-modal-body {
  padding: 18px 22px 14px;
}

#createCommunityModal .report-modal-footer {
  padding: 14px 22px 18px;
}

#createCommunityModal .community-form input,
#createCommunityModal .community-form textarea,
#createCommunityModal .community-form select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
  color: #f8fafc;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

#createCommunityModal .community-form textarea {
  min-height: 136px;
  resize: vertical;
}

#createCommunityModal .community-form input::placeholder,
#createCommunityModal .community-form textarea::placeholder {
  color: rgba(255,255,255,0.42);
}

#createCommunityModal .community-form input:focus,
#createCommunityModal .community-form textarea:focus,
#createCommunityModal .community-form select:focus {
  outline: none;
  border-color: rgba(139,92,246,0.48);
  box-shadow: 0 0 0 4px rgba(139,92,246,0.12);
}

#createCommunityModal .report-cancel-btn,
#createCommunityModal .report-submit-btn {
  min-width: 88px;
  min-height: 40px;
  border-radius: 12px;
  padding: 9px 16px;
  font-weight: 700;
}

#createCommunityModal .auth-error {
  margin-top: 2px;
}

.community-empty,
.community-loading {
  color: #94a3b8;
  text-align: center;
  padding: 22px 0;
}

.community-admin-note {
  margin-top: 6px;
  color: #94a3b8;
  font-size: 0.88rem;
  line-height: 1.35;
}

.community-admin-note.compact {
  margin-top: 0;
}

.community-hero-main {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  min-width: 0;
}

.community-hero-copy {
  min-width: 0;
  flex: 1;
  width: 100%;
}

.community-hero-side {
  min-width: 240px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  width: 100%;
}

.community-hero-side .community-actions,
.community-hero-side .community-admin-tools {
  margin-top: 0;
  width: 100%;
}

.community-file-input {
  display: none;
}

.community-members-page .community-panel {
  margin-top: 16px;
}

.community-moderation-page .community-panel {
  margin-top: 16px;
}

.community-moderation-tabs-panel {
  display: grid;
  gap: 16px;
}

.community-moderation-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.community-moderation-tab {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: #cbd5e1;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.community-moderation-tab.active {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff;
  border-color: transparent;
}

.community-segmented {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.community-segmented-btn {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: #cbd5e1;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.community-segmented-btn.active {
  background: rgba(139,92,246,0.18);
  border-color: rgba(139,92,246,0.34);
  color: #f5f3ff;
}

.community-members-directory {
  display: grid;
  gap: 14px;
}

.community-members-toolbar {
  margin-bottom: 4px;
}

.community-members-search-wrap {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
}

.community-members-search {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: block;
  background: rgba(255,255,255,0.06);
  color: #f8fafc;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 10px 14px;
  font: inherit;
}

.community-members-section {
  display: grid;
  gap: 8px;
}

.community-members-section + .community-members-section {
  margin-top: 2px;
}

.community-members-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.community-members-section-head h3 {
  margin: 0;
  font-size: 0.98rem;
}

.community-members-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: #cbd5e1;
  font-size: 0.76rem;
  font-weight: 700;
}

.community-members-list {
  display: grid;
  gap: 8px;
}

.community-members-page .community-member {
  padding: 10px 12px;
  gap: 10px;
}

.community-members-page .community-member-actions {
  justify-content: flex-end;
}

#communityMembersLoadMore {
  justify-self: center;
}

.communities-sentinel {
  height: 1px;
}

html[data-theme="light"] .communities-hero,
html[data-theme="light"] .community-hero,
html[data-theme="light"] .community-card,
html[data-theme="light"] .community-panel {
  background: rgba(255,255,255,0.92);
  border-color: rgba(148,163,184,0.18);
  box-shadow: 0 18px 40px rgba(76,29,149,0.10);
}

html[data-theme="light"] .community-desc,
html[data-theme="light"] .community-stats {
  color: #475569;
}

html[data-theme="light"] .communities-hero p {
  color: #64748b;
}

html[data-theme="light"] .community-slug,
html[data-theme="light"] .community-member-role,
html[data-theme="light"] .community-empty,
html[data-theme="light"] .community-loading,
html[data-theme="light"] .community-admin-note {
  color: #64748b;
}

html[data-theme="light"] .community-member {
  background: rgba(248,250,252,0.92);
}

html[data-theme="light"] .community-member-role-chip {
  background: rgba(15,23,42,0.05);
  color: #475569;
}

html[data-theme="light"] .community-member-menu-btn {
  background: #fff;
  color: #334155;
  border-color: rgba(148,163,184,0.28);
}

html[data-theme="light"] .community-member-menu {
  background: #ffffff;
  border-color: rgba(148,163,184,0.18);
  box-shadow: 0 18px 40px rgba(76,29,149,0.12);
}

html[data-theme="light"] .community-member-menu-item {
  color: #0f172a;
}

html[data-theme="light"] .community-member-menu-item:hover {
  background: rgba(15,23,42,0.05);
}

html[data-theme="light"] .community-member-menu-item.danger {
  color: #dc2626;
}

html[data-theme="light"] .community-role-select,
html[data-theme="light"] .community-form input,
html[data-theme="light"] .community-form textarea,
html[data-theme="light"] .community-form select {
  background: #fff;
  color: #0f172a;
  border-color: rgba(148,163,184,0.28);
}

html[data-theme="light"] .community-page,
html[data-theme="light"] .communities-page,
html[data-theme="light"] .community-members-page,
html[data-theme="light"] .community-settings-page,
html[data-theme="light"] .community-moderation-page {
  color: #0f172a;
}

html[data-theme="light"] .community-members-search {
  background: #f8fafc;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.10);
}

html[data-theme="light"] .community-members-count {
  background: #eef2ff;
  color: #4c1d95;
}

html[data-theme="light"] .community-conversation-pill {
  background: rgba(14,165,233,0.08);
  border-color: rgba(14,165,233,0.18);
  color: #0369a1;
}

html[data-theme="light"] .community-settings-check {
  background: rgba(15,23,42,0.04);
  border-color: rgba(15,23,42,0.08);
  color: #334155;
}

html[data-theme="light"] .community-settings-field input,
html[data-theme="light"] .community-settings-field textarea,
html[data-theme="light"] .community-settings-field select {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(148,163,184,0.28);
  box-shadow: inset 0 1px 2px rgba(15,23,42,0.04);
}

html[data-theme="light"] .community-settings-field input::placeholder,
html[data-theme="light"] .community-settings-field textarea::placeholder {
  color: #94a3b8;
}

html[data-theme="light"] .community-settings-field input:focus,
html[data-theme="light"] .community-settings-field textarea:focus,
html[data-theme="light"] .community-settings-field select:focus {
  border-color: rgba(139,92,246,0.34);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.10);
}

html[data-theme="light"] .community-settings-check span:last-child::before {
  border-color: rgba(148,163,184,0.6);
  background: #ffffff;
}

html[data-theme="light"] .community-settings-check:has(input:checked) {
  background: rgba(139,92,246,0.10);
  border-color: rgba(139,92,246,0.24);
  color: #5b21b6;
}

html[data-theme="light"] .community-settings-check:has(input:checked) span:last-child::before {
  border-color: rgba(139,92,246,0.42);
  background: rgba(139,92,246,0.92);
  box-shadow: inset 0 0 0 3px #ffffff;
}

html[data-theme="light"] .community-moderation-tab,
html[data-theme="light"] .community-segmented-btn {
  background: #f8fafc;
  color: #475569;
  border-color: rgba(148,163,184,0.22);
}

html[data-theme="light"] .community-moderation-tab.active {
  background: #ffffff;
  color: #334155;
  border-color: rgba(139,92,246,0.26);
  box-shadow: 0 8px 20px rgba(124,58,237,0.10);
}

html[data-theme="light"] .community-segmented-btn.active {
  background: #ede9fe;
  color: #5b21b6;
  border-color: rgba(139,92,246,0.22);
}

html[data-theme="light"] .communities-toolbar .action-btn.active {
  color: #fff;
}

html[data-theme="light"] .community-toolbar-select {
  background: #fff;
  color: #0f172a;
  border-color: rgba(148,163,184,0.28);
}

html[data-theme="light"] .community-category-pill {
  background: rgba(124,58,237,0.10);
  color: #6d28d9;
}

html[data-theme="light"] .community-inline-link {
  color: #7c3aed;
}

html[data-theme="light"] .community-inline-meta {
  color: #64748b;
}

html[data-theme="light"] .community-permissions-list,
html[data-theme="light"] .community-rules-list,
html[data-theme="light"] .community-announcement-copy,
html[data-theme="light"] .community-rules-gate-copy,
html[data-theme="light"] .community-audit-text,
html[data-theme="light"] .community-settings-field > span {
  color: #334155;
}

html[data-theme="light"] .community-rules-modal-copy {
  background: #f8fafc;
  color: #334155;
  border-color: rgba(148,163,184,0.18);
}

html[data-theme="light"] .community-audit-reason,
html[data-theme="light"] .community-audit-time {
  color: #64748b;
}

html[data-theme="light"] .community-audit-item {
  background: #f8fafc;
  border-color: rgba(148,163,184,0.18);
}

html[data-theme="light"] .community-report-card,
html[data-theme="light"] .community-report-snippet {
  background: #f8fafc;
  border-color: rgba(148,163,184,0.18);
}

html[data-theme="light"] .community-report-target {
  color: #0f172a;
}

html[data-theme="light"] .community-report-meta,
html[data-theme="light"] .community-report-note,
html[data-theme="light"] .community-report-snippet {
  color: #475569;
}

html[data-theme="light"] .community-report-action-btn {
  background: #ffffff;
  color: #334155;
  border-color: rgba(148,163,184,0.28);
}

html[data-theme="light"] .community-report-action-btn:hover {
  background: #f8fafc;
}

html[data-theme="light"] .community-reason-input {
  background: #f8fafc;
  color: #0f172a;
  border-color: rgba(148,163,184,0.28);
}

html[data-theme="light"] #createCommunityModal .report-modal {
  background: #ffffff;
  border-color: rgba(148,163,184,0.18);
  box-shadow: 0 28px 60px rgba(76,29,149,0.14);
}

html[data-theme="light"] #createCommunityModal .report-modal-header,
html[data-theme="light"] #createCommunityModal .report-modal-footer {
  border-color: rgba(148,163,184,0.18);
}

html[data-theme="light"] #createCommunityModal .report-modal-header {
  color: #0f172a;
}

html[data-theme="light"] #createCommunityModal .report-modal-close {
  color: #94a3b8;
}

html[data-theme="light"] #createCommunityModal .report-modal-close:hover {
  background: rgba(15,23,42,0.05);
  color: #475569;
}

html[data-theme="light"] #createCommunityModal .community-form input,
html[data-theme="light"] #createCommunityModal .community-form textarea,
html[data-theme="light"] #createCommunityModal .community-form select {
  background: #f8fafc;
  color: #0f172a;
  border-color: rgba(148,163,184,0.28);
  box-shadow: inset 0 1px 2px rgba(15,23,42,0.04);
}

html[data-theme="light"] #createCommunityModal .community-form input::placeholder,
html[data-theme="light"] #createCommunityModal .community-form textarea::placeholder {
  color: #94a3b8;
}

html[data-theme="light"] #createCommunityModal .report-cancel-btn {
  background: #f8fafc;
  color: #475569;
  border-color: rgba(148,163,184,0.24);
}

html[data-theme="light"] #createCommunityModal .report-cancel-btn:hover {
  background: #eef2ff;
  color: #0f172a;
}

.community-request-actions {
  display: flex;
  gap: 8px;
}

@media (max-width: 860px) {
  .communities-hero {
    display: block;
    padding: 16px;
  }

  .communities-toolbar {
    margin-top: 14px;
  }

  .community-toolbar-select {
    width: 100%;
  }

  .community-layout {
    grid-template-columns: 1fr;
  }

  .community-sidebar {
    display: none;
  }

  .community-settings-layout {
    grid-template-columns: 1fr;
  }

  .community-hero-main {
    display: block;
  }

  .community-hero-side {
    min-width: 0;
    max-width: none;
    margin-top: 12px;
  }

  .community-mobile-link {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  .communities-page {
    padding: 12px 0 32px;
    overflow-x: clip;
  }

  .communities-hero {
    padding: 12px;
    border-radius: 18px;
    overflow: hidden;
  }

  .communities-hero h1 {
    font-size: 1.15rem;
  }

  .communities-hero p {
    font-size: 0.86rem;
  }

  .communities-toolbar {
    width: 100%;
    gap: 8px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .communities-toolbar .action-btn {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .communities-toolbar .community-toolbar-select {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
  }

  .communities-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 10px;
  }

  .community-card {
    width: 100%;
    min-width: 0;
    padding: 12px;
    border-radius: 16px;
    box-sizing: border-box;
  }

  .community-card .community-card-head {
    min-width: 0;
  }

  .community-card .community-avatar {
    width: 40px;
    height: 40px;
  }

  .community-card .community-title {
    font-size: 0.92rem;
  }

  .community-card .community-slug,
  .community-card .community-desc,
  .community-card .community-stats {
    font-size: 0.8rem;
    max-width: 100%;
  }

  .community-members-page {
    padding: 12px 0 32px;
    overflow-x: clip;
  }

  .community-members-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .community-members-search-wrap {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .community-page {
    padding: 12px 0 36px;
    overflow-x: clip;
  }

  .community-hero {
    border-radius: 18px;
    padding: 12px 12px 14px;
    overflow: hidden;
  }

  .community-hero-main {
    gap: 10px;
    width: 100%;
  }

  .community-hero .community-card-head {
    gap: 8px;
    width: 100%;
  }

  .community-hero .community-avatar,
  .community-hero-avatar-wrap {
    width: 40px;
    height: 40px;
  }

  .community-title {
    font-size: 0.9rem;
  }

  .community-slug,
  .community-desc,
  .community-stats,
  .community-admin-note {
    font-size: 0.78rem;
    max-width: 100%;
  }

  .community-desc {
    margin-top: 6px;
    line-height: 1.35;
  }

  .community-stats {
    margin-top: 6px;
    gap: 5px;
  }

  .community-hero-side {
    margin-top: 8px;
    gap: 8px;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .community-actions,
  .community-admin-tools {
    gap: 6px;
    width: 100%;
    min-width: 0;
  }

  .community-actions .action-btn,
  .community-admin-tools .action-btn {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 0.78rem;
    max-width: 100%;
  }

  .community-layout {
    gap: 10px;
    margin-top: 10px;
  }

  .community-settings-page {
    padding: 12px 0 36px;
    overflow-x: clip;
  }

  .community-settings-layout {
    gap: 10px;
    margin-top: 10px;
  }

  .community-settings-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .community-settings-actions {
    width: 100%;
  }

  .community-settings-actions .action-btn,
  .community-settings-actions .primary-btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
  }

  .community-settings-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }

  .community-panel {
    border-radius: 16px;
    padding: 10px;
  }

  .community-panel h3 {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }

  .community-panel-head {
    margin-bottom: 8px;
  }

  .community-members-page .community-panel {
    padding: 10px;
  }

  .community-members-section-head h3 {
    font-size: 0.92rem;
  }

  .community-members-page .community-member {
    padding: 8px 10px;
    gap: 8px;
  }

  .community-members-page .community-member-main {
    gap: 8px;
  }

  .community-members-page .community-member-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .community-members-page .community-member-name {
    font-size: 0.92rem;
  }

  .community-members-page .community-member-role {
    font-size: 0.8rem;
  }

  .community-members-page .community-member-role-chip {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 0.72rem;
  }

  .community-members-page .community-member-menu-btn {
    width: 26px;
    height: 26px;
  }

  .community-members-page .community-stats {
    gap: 4px;
  }

  .community-members-page .community-inline-link {
    font-size: 0.82rem;
  }

  #communityPosts,
  #communityEmpty {
    width: 100%;
    min-width: 0;
  }

  .community-page .compose-box {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    gap: 10px;
    margin-bottom: 10px;
    align-items: flex-start;
    box-sizing: border-box;
  }

  .community-page .compose-avatar {
    width: 34px;
    height: 34px;
  }

  .community-page .compose-box > div:last-child {
    min-width: 0;
    flex: 1;
  }

  .community-page .compose-input {
    width: 100% !important;
    min-width: 0;
    min-height: 44px !important;
    padding: 10px 12px;
    font-size: 13px;
    white-space: normal;
    box-sizing: border-box;
  }

  .community-page #feedComposeActions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .community-page #feedComposeActions > div {
    width: 100%;
    min-width: 0;
  }

  .community-page #feedComposeActions > div:last-child {
    display: flex;
    justify-content: flex-end;
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 1100px) {
  .community-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .community-page .community-sidebar .community-member {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  .community-page .community-sidebar .community-member-main {
    min-width: 0;
  }

  .community-page .community-sidebar .community-member-actions {
    width: auto;
    max-width: 100%;
    justify-content: flex-end;
    flex-wrap: nowrap;
    align-self: center;
  }

  .community-page .community-sidebar .community-member-role-chip {
    flex-shrink: 0;
  }

  .community-page .community-sidebar .community-member-menu {
    right: 0;
    left: auto;
  }
}

@media (max-width: 980px) {
  .community-page .community-sidebar .community-member {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .community-page .community-sidebar .community-member-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .community-page .community-sidebar .community-member-actions .community-role-select,
  .community-page .community-sidebar .community-member-actions .report-cancel-btn,
  .community-page .community-sidebar .community-member-actions .report-submit-btn {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 860px) {
  .community-layout {
    grid-template-columns: 1fr;
  }
}
