.communities-shell {
  color: #1f2937;
  flex: 1 0 auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  width: 100%;
}

.community-page-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

@media (min-width: 768px) {
  .communities-shell {
    padding-top: 2rem;
  }
}

/* ===== TOOLBAR FIXES ===== */
.community-toolbar-top {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  min-width: 0;
  width: 100%;
}

.community-toolbar-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.community-toolbar-title-row {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.community-toolbar-title {
  color: #1f2937;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-skeleton {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
}

.community-skeleton-row {
  align-items: center;
  display: flex;
  gap: 14px;
}

.community-skeleton-icon,
.community-skeleton-line {
  animation: communitySkeleton 1.2s ease-in-out infinite;
  background: linear-gradient(90deg, #f1f5f9, #e5e7eb, #f1f5f9);
  background-size: 200% 100%;
}

.community-skeleton-icon {
  border-radius: 10px;
  flex: 0 0 auto;
  height: 38px;
  width: 38px;
}

.community-skeleton-line {
  border-radius: 999px;
  height: 12px;
  margin: 8px 0;
  width: 100%;
}

.community-skeleton-line.short {
  width: 42%;
}

@keyframes communitySkeleton {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.community-toolbar-subtitle {
  color: #64748b;
  font-size: 1rem;
  line-height: 1.625;
  margin: 4px 0 4px;
  max-width: 46rem;
}

.community-toolbar-top.is-root .community-toolbar-title {
  color: #1f2937;
  font-size: 1.625rem;
  line-height: 1.25;
}

.community-toolbar-top.is-thread .community-toolbar-title {
  font-size: 1.25rem;
  line-height: 1.25;
  white-space: normal;
}

@media (min-width: 640px) {
  .community-toolbar-top.is-thread .community-toolbar-title {
    font-size: 1.5rem;
  }

  .community-toolbar-subtitle {
    font-size: 1.125rem;
  }
}

/* Button group styling */
.community-toolbar-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  order: 3;
  width: 100%;
}

.community-toolbar-actions.hidden,
.community-toolbar-actions .hidden {
  display: none;
}

@media (min-width: 768px) {
  .community-page-toolbar {
    align-items: start;
    display: grid;
    gap: 10px 16px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .community-toolbar-top {
    grid-column: 1 / -1;
  }

  .community-search {
    grid-column: 1;
    max-width: 520px;
  }

  .community-toolbar-actions {
    align-self: center;
    grid-column: 2;
    justify-content: flex-end;
    width: auto;
  }
}

.community-toolbar-top .community-btn-primary,
.community-toolbar-top .community-btn-outline,
.community-toolbar-actions .community-btn-primary,
.community-toolbar-actions .community-btn-outline {
  align-items: center;
  border-radius: 12px;
  display: inline-flex;
  font-size: 0.875rem;
  font-weight: 600;
  gap: 6px;
  justify-content: center;
  min-height: 40px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.community-toolbar-top .community-btn-primary,
.community-toolbar-actions .community-btn-primary {
  background: #16a34a;
  border: 1px solid #16a34a;
  color: #fff;
  padding: 9px 14px;
}

.community-toolbar-top .community-btn-primary:hover,
.community-toolbar-actions .community-btn-primary:hover {
  background: #15803d;
  border-color: #15803d;
}

.community-toolbar-top .community-btn-outline,
.community-toolbar-actions .community-btn-outline {
  background: #fff;
  border: 1px solid #d1d5db;
  color: #1f2937;
  min-height: 40px;
  padding: 0;
  width: 40px;
}

.community-toolbar-top .community-btn-outline:hover,
.community-toolbar-actions .community-btn-outline:hover {
  background: #f0fdf4;
  border-color: #15803d;
  color: #166534;
}

/* ===== MOBILE TOOLBAR FIXES ===== */
@media (max-width: 640px) {
  .community-toolbar-top {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .community-toolbar-top .community-toolbar-title-wrap {
    flex: 1 1 auto;
    order: 1;
  }

  .community-toolbar-top .community-toolbar-title {
    font-size: 1.125rem;
    white-space: normal;
    line-height: 1.4;
  }

  .community-toolbar-top.is-root .community-toolbar-title {
    font-size: 1.5rem;
  }

  .community-toolbar-top .community-btn-primary,
  .community-toolbar-top .community-btn-outline {
    font-size: 0.82rem;
    min-height: 40px;
    padding: 7px 12px;
    justify-content: center;
  }

  .community-toolbar-actions {
    order: 3;
    width: 100%;
  }

  .community-toolbar-actions .community-btn-primary {
    flex: 1 1 auto;
  }

  .community-toolbar-actions .community-btn-outline {
    flex: 0 0 40px;
    padding: 0;
    width: 40px;
  }

  .community-toolbar-top .community-btn-primary span,
  .community-toolbar-top .community-btn-outline span {
    display: inline;
  }

  .community-toolbar-top .community-btn-primary .lucide,
  .community-toolbar-top .community-btn-outline .lucide {
    width: 16px;
    height: 16px;
  }

  .community-toolbar-top .community-toolbar-title-wrap + .community-btn-primary {
    order: 2;
  }

  .community-toolbar-top .community-toolbar-title-wrap + .community-btn-primary + .community-btn-outline {
    order: 3;
  }
}

/* ===== TABLET TOOLBAR FIXES ===== */
@media (min-width: 641px) and (max-width: 1024px) {
  .community-toolbar-top {
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .community-toolbar-top .community-toolbar-title-wrap {
    flex: 1 1 auto;
    min-width: 120px;
  }

  .community-toolbar-top .community-toolbar-title {
    font-size: 1.25rem;
  }

  .community-toolbar-top.is-root .community-toolbar-title {
    font-size: 1.625rem;
  }

  .community-toolbar-top .community-btn-primary,
  .community-toolbar-top .community-btn-outline {
    font-size: 0.85rem;
    min-height: 40px;
  }

  .community-toolbar-top .community-btn-primary {
    padding: 8px 14px;
  }

  .community-toolbar-top .community-btn-outline {
    padding: 0;
  }
}

@media (max-width: 768px) {
  .community-reply-label {
    display: none;
  }
}

/* ===== SEARCH BAR FIXES ===== */
.community-search {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  display: flex;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
}

.community-search:focus-within {
  border-color: #15803d;
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.1);
}

.community-search input {
  background: transparent;
  border: 0;
  flex: 1;
  font-size: 0.875rem;
  min-width: 0;
  outline: 0;
}

@media (min-width: 641px) {
  .community-search {
    max-width: 520px;
  }
}

@media (max-width: 640px) {
  .community-search {
    height: 40px;
    padding: 0 12px;
    max-width: 100%;
  }

  .community-search input {
    font-size: 0.85rem;
  }

  .community-search .lucide {
    width: 16px;
    height: 16px;
  }
}

/* ===== CARD STYLES ===== */
.community-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.community-card:hover {
  border-color: #15803d;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.community-icon {
  align-items: center;
  background: #f0fdf4;
  border-radius: 10px;
  color: #15803d;
  display: inline-flex;
  flex: 0 0 auto;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.community-category-card {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 78px;
  padding: 12px;
  position: relative;
}

.community-category-card::before {
  background: #16a34a;
  border-radius: 999px;
  content: "";
  height: calc(100% - 28px);
  left: 0;
  opacity: 0;
  position: absolute;
  top: 14px;
  transition: opacity 0.15s ease;
  width: 3px;
}

.community-category-card:hover::before {
  opacity: 1;
}

.community-category-main {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  gap: 14px;
  min-width: 0;
}

.community-category-copy {
  display: block;
  min-width: 0;
}

.community-category-title {
  color: #0f172a;
  display: -webkit-box;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.community-category-description {
  color: #64748b;
  display: -webkit-box;
  font-size: 0.92rem;
  line-height: 1.45;
  margin-top: 4px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.community-category-stats {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 14px;
}

.community-stat {
  align-items: center;
  display: inline-flex;
  gap: 4px;
  justify-content: center;
  min-width: 58px;
  text-align: center;
}

.community-stat-number {
  color: #0f172a;
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
}

.community-stat-label {
  color: #8b95a5;
  display: inline;
  font-size: 0.72rem;
  line-height: 1.25;
  margin-top: 0;
}

.community-chevron {
  color: #94a3b8;
  height: 18px;
  width: 18px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.community-category-card:hover .community-chevron {
  color: #15803d;
  transform: translateX(2px);
}

.community-category-mobile-stats {
  color: #94a3b8;
  display: none;
  font-size: 0.75rem;
  line-height: 1.35;
  margin-top: 6px;
}

/* ===== DESKTOP LAYOUT ===== */
.community-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}

.community-main {
  min-width: 0;
}

.community-sidebar {
  display: none;
}

.community-sidebar-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
}

.community-sidebar-title {
  color: #111827;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.community-sidebar-text {
  color: #64748b;
  font-size: 0.84rem;
  line-height: 1.55;
}

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

.community-sidebar-link {
  align-items: center;
  border-radius: 8px;
  color: #334155;
  display: flex;
  font-size: 0.86rem;
  font-weight: 650;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
  padding: 8px;
  text-align: left;
  width: 100%;
}

.community-sidebar-link:hover {
  background: #f0fdf4;
  color: #166534;
}

.community-sidebar-muted {
  color: #94a3b8;
  font-size: 0.76rem;
  margin-top: 2px;
}

.community-profile-stats {
  border-top: 1px solid #e5e7eb;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 12px;
}

.community-profile-stats span {
  color: #64748b;
  display: grid;
  font-size: 0.72rem;
  gap: 2px;
  min-width: 0;
}

.community-profile-stats strong {
  color: #111827;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.1;
}

@media (min-width: 1024px) {
  .community-layout.has-sidebar {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
  }

  .community-sidebar {
    align-self: start;
    display: grid;
    gap: 14px;
    position: sticky;
    top: 92px;
  }
}

/* ===== BUTTONS ===== */
.community-btn-primary,
.community-btn-outline,
.community-icon-btn {
  align-items: center;
  border-radius: 12px;
  display: inline-flex;
  font-size: 0.875rem;
  font-weight: 600;
  gap: 6px;
  justify-content: center;
  min-height: 38px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.community-btn-primary:active,
.community-btn-outline:active,
.community-icon-btn:active {
  transform: scale(0.98);
}

.community-btn-primary {
  background: #16a34a;
  border: 1px solid #16a34a;
  color: #fff;
  padding: 10px 16px;
}

.community-btn-primary:hover {
  background: #15803d;
  border-color: #15803d;
}

.community-btn-outline {
  background: #fff;
  border: 1px solid #d1d5db;
  color: #1f2937;
  padding: 8px 14px;
}

.community-btn-outline:hover {
  background: #f0fdf4;
  border-color: #15803d;
  color: #166534;
}

.community-icon-btn {
  background: transparent;
  border: 0;
  color: #6b7280;
  height: 38px;
  padding: 0;
  width: 38px;
}

.community-icon-btn:hover {
  background: #f3f4f6;
  color: #166534;
}

/* ===== BADGES ===== */
.community-badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 700;
  gap: 4px;
  line-height: 1.4;
  padding: 2px 9px;
  white-space: nowrap;
}

.community-badge.solved {
  background: #dcfce7;
  color: #15803d;
}

.community-badge.pinned {
  background: #fef3c7;
  color: #92400e;
}

.community-badge.faculty {
  background: #dcfce7;
  border: 1px solid #86efac;
  box-shadow: none;
  color: #166534;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  padding: 2px 8px;
  text-transform: none;
}

.community-badge.faculty-soft {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
  font-weight: 800;
}

.community-badge.best {
  background: #15803d;
  color: #fff;
  font-size: 0.62rem;
  padding: 1px 7px;
}

.community-reply.best-answer {
  border-left: 2px solid #16a34a;
  border-radius: 8px;
}

.community-best-answer-label {
  align-items: center;
  color: #15803d;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 700;
  gap: 5px;
  line-height: 1.2;
  margin-bottom: 8px;
}

/* ===== NESTED REPLIES ===== */
.community-nested-group {
  border-left: 2px solid #d1fae5;
  margin-left: 22px;
  padding-left: 14px;
}

.community-nested-reply {
  background: #fbfdfc;
  border: 1px solid #e8f5e9;
  border-left: 0;
  border-radius: 0 10px 10px 0;
  box-shadow: none;
  margin-top: 8px;
  position: relative;
}

.community-nested-reply::before {
  background: #d1fae5;
  content: "";
  height: 2px;
  left: -14px;
  position: absolute;
  top: 24px;
  width: 14px;
}

.community-nested-reply .community-avatar {
  height: 30px;
  width: 30px;
  font-size: 0.7rem;
}

.community-handle {
  color: #9ca3af;
  font-size: 0.75rem;
  font-weight: 500;
}

.community-meta {
  color: #9ca3af;
  font-size: 0.75rem;
}

/* ===== DISCUSSION CARDS ===== */
.community-discussion-card {
  color: inherit;
  display: block;
  padding: 12px;
  text-decoration: none;
}

.community-discussion-layout {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.community-discussion-main {
  flex: 1 1 auto;
  min-width: 0;
}

.community-discussion-title-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.community-discussion-title {
  color: #111827;
  display: -webkit-box;
  flex: 1 1 auto;
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.35;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.community-result-count {
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.4;
  margin: 0 0 10px;
}

.community-reply .community-btn-outline {
  border-radius: 999px;
  font-size: 0.78rem;
  min-height: 32px;
  padding: 5px 10px;
}

.community-reply {
  padding: 12px !important;
}

.community-reply > .community-content {
  margin-top: 8px !important;
}

.community-reply > .community-content + div {
  margin-top: 8px !important;
}

.community-main-reply-btn {
  border-radius: 999px;
  font-size: 0.8rem;
  min-height: 32px;
  padding: 6px 11px;
}

.community-like-button.is-liked {
  border-color: #fecdd3;
  color: #e11d48;
}

.community-like-button.is-liked .lucide,
.community-like-button.is-liked svg {
  fill: currentColor;
}

.community-report-btn {
  padding-left: 9px;
  padding-right: 9px;
}

.community-moderation-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.community-moderation-actions .community-btn-outline {
  border-radius: 999px;
  font-size: 0.76rem;
  min-height: 30px;
  padding: 5px 10px;
}

.community-btn-danger {
  border-color: #fecaca;
  color: #b91c1c;
}

.community-btn-danger:hover {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}

.community-thread-chevron {
  color: #cbd5e1;
  flex: 0 0 auto;
  height: 17px;
  margin-top: 8px;
  width: 17px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.community-discussion-card:hover .community-thread-chevron {
  color: #15803d;
  transform: translateX(2px);
}

.community-discussion-pin {
  color: #b45309;
  flex: 0 0 auto;
  height: 17px;
  margin-top: 5px;
  width: 17px;
}

.community-discussion-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  line-height: 1.4;
  margin-top: 8px;
}

.community-author-line {
  align-items: baseline;
  display: inline-flex;
  gap: 4px;
  min-width: 0;
}

.community-author-name {
  color: #4b5563;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-author-compact {
  min-width: 0;
  overflow: hidden;
}

.community-author-primary {
  align-items: center;
  color: #475569;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.82rem;
  gap: 5px;
  line-height: 1.35;
  min-width: 0;
}

.community-author-primary .community-author-name {
  color: #1f2937;
  max-width: 100%;
}

.community-author-primary .community-meta {
  color: #94a3b8;
}

.community-dot {
  background: #d1d5db;
  border-radius: 999px;
  display: inline-block;
  height: 4px;
  width: 4px;
}

.community-reply-count {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: #475569;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  gap: 4px;
  justify-content: center;
  line-height: 1;
  min-width: 64px;
  padding: 7px 9px;
  text-align: center;
}

.community-reply-number {
  color: inherit;
  display: inline;
  font-size: inherit;
  font-weight: 800;
}

.community-reply-label {
  display: inline;
  margin-top: 0;
}

.community-content {
  color: #374151;
  font-size: 0.925rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.community-original-post {
  background: #fcfffc;
  border-top: 3px solid #16a34a;
  padding: 12px;
}

.community-replies-header {
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
}

.community-replies-title {
  color: #111827;
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}

.community-mention {
  background: #e8f5e9;
  border-radius: 4px;
  color: #15803d;
  font-weight: 700;
  padding: 0 4px;
}

.community-avatar {
  align-items: center;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  color: #166534;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.community-avatar.faculty {
  border: 2px solid #15803d;
}

/* ===== FORMS ===== */
.community-form textarea,
.community-form input {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 0.9rem;
  outline: none;
  padding: 10px 12px;
  width: 100%;
}

.community-form textarea:focus,
.community-form input:focus {
  border-color: #15803d;
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.1);
}

.community-mention-wrap {
  position: relative;
}

.community-mention-suggestions {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  left: 0;
  margin-top: 6px;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 80;
}

.community-mention-option {
  align-items: center;
  border-radius: 8px;
  color: #1f2937;
  display: flex;
  gap: 10px;
  padding: 8px;
  text-align: left;
  width: 100%;
}

.community-mention-option:hover,
.community-mention-option:focus {
  background: #f0fdf4;
  outline: none;
}

.community-empty {
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  color: #6b7280;
  padding: 28px 16px;
  text-align: center;
}

.community-toast {
  background: #111827;
  border-radius: 999px;
  bottom: calc(6.25rem + env(safe-area-inset-bottom, 0px));
  color: #fff;
  font-size: 0.82rem;
  left: 50%;
  max-width: min(92vw, 420px);
  opacity: 0;
  padding: 10px 14px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 90;
}

.community-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.community-view {
  animation: communityFade 0.18s ease;
}

@keyframes communityFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== MOBILE RESPONSIVE OVERRIDES ===== */
@media (max-width: 640px) {
  .community-card {
    border-radius: 10px;
  }

  .community-page-toolbar {
    gap: 12px;
    margin-bottom: 14px;
  }

  .community-toolbar-top {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .community-toolbar-title-wrap {
    min-height: 36px;
  }

  .community-toolbar-top:not(.is-root) .community-toolbar-title {
    font-size: 1.125rem;
    white-space: normal;
  }

  .community-category-card {
    align-items: flex-start;
    gap: 12px;
    min-height: 0;
    padding: 12px;
  }

  .community-category-main {
    gap: 12px;
  }

  .community-category-title {
    font-size: 0.98rem;
  }

  .community-category-description {
    font-size: 0.84rem;
  }

  .community-category-stats {
    display: flex;
    gap: 0;
  }

  .community-category-stats .community-stat {
    display: none;
  }

  .community-category-mobile-stats {
    display: block;
  }

  .community-icon {
    border-radius: 9px;
    height: 38px;
    width: 38px;
  }

  .community-discussion-card {
    padding: 12px;
  }

  .community-discussion-layout {
    gap: 12px;
  }

  .community-discussion-title {
    font-size: 1rem;
    white-space: normal;
  }

  .community-thread-chevron {
    display: block;
    height: 16px;
    margin-top: 4px;
    width: 16px;
  }

  .community-discussion-meta {
    gap: 5px 7px;
    margin-top: 8px;
  }

  .community-author-line {
    max-width: 100%;
  }

  .community-reply-count {
    font-size: 0.7rem;
    padding: 7px 9px;
  }

  .community-reply-label {
    display: none;
  }

  .community-original-post {
    padding: 12px;
  }

  .community-replies-header {
    align-items: stretch;
    flex-direction: column;
  }

  .community-replies-header .community-main-reply-btn {
    align-self: flex-end;
    width: auto;
  }

  .community-badge.pinned.hide-mobile,
  .community-badge.solved.hide-mobile {
    display: none;
  }

  .community-btn-primary,
  .community-btn-outline {
    font-size: 0.82rem;
    min-height: 36px;
    padding: 7px 12px;
  }

  .community-main-reply-btn {
    font-size: 0.8rem;
    min-height: 32px;
    padding: 6px 11px;
  }

  .community-nested-group {
    margin-left: 12px;
    padding-left: 10px;
  }

  .community-nested-reply::before {
    left: -10px;
    width: 10px;
  }
}

/* ===== DARK MODE ===== */
.dark .communities-shell {
  color: #e4e4e7;
}

.dark .community-card,
.dark .community-sidebar-card,
.dark .community-skeleton,
.dark .community-nested-reply,
.dark .community-search,
.dark .community-mention-suggestions,
.dark .community-form textarea,
.dark .community-form input,
.dark .community-btn-outline {
  background: #18181b;
  border-color: #27272a;
  color: #e4e4e7;
}

.dark .community-card:hover,
.dark .community-search:focus-within,
.dark .community-form textarea:focus,
.dark .community-form input:focus {
  border-color: #15803d;
}

.dark .community-content {
  color: #d4d4d8;
}

.dark .community-icon {
  background: rgba(20, 83, 45, 0.45);
  color: #86efac;
}

.dark .community-toolbar-title {
  color: #f4f4f5;
}

.dark .community-skeleton-icon,
.dark .community-skeleton-line {
  background: linear-gradient(90deg, #27272a, #3f3f46, #27272a);
  background-size: 200% 100%;
}

.dark .community-toolbar-subtitle {
  color: #a1a1aa;
}

.dark .community-sidebar-title {
  color: #f4f4f5;
}

.dark .community-sidebar-text,
.dark .community-sidebar-muted {
  color: #a1a1aa;
}

.dark .community-sidebar-link {
  color: #d4d4d8;
}

.dark .community-sidebar-link:hover {
  background: rgba(20, 83, 45, 0.35);
  color: #86efac;
}

.dark .community-profile-stats {
  border-top-color: #27272a;
}

.dark .community-profile-stats span {
  color: #a1a1aa;
}

.dark .community-profile-stats strong {
  color: #f4f4f5;
}

.dark .community-category-title,
.dark .community-stat-number,
.dark .community-discussion-title,
.dark .community-reply-number {
  color: #f4f4f5;
}

.dark .community-category-description,
.dark .community-author-name {
  color: #a1a1aa;
}

.dark .community-stat-label,
.dark .community-category-mobile-stats,
.dark .community-reply-count {
  color: #71717a;
}

.dark .community-reply-count {
  background: #27272a;
  border-color: #3f3f46;
  color: #d4d4d8;
}

.dark .community-author-primary,
.dark .community-author-primary .community-author-name {
  color: #e4e4e7;
}

.dark .community-original-post {
  background: rgba(20, 83, 45, 0.12);
}

.dark .community-replies-header {
  border-bottom-color: #27272a;
}

.dark .community-replies-title {
  color: #f4f4f5;
}

.dark .community-dot {
  background: #52525b;
}

.dark .community-nested-group {
  border-left-color: rgba(34, 197, 94, 0.3);
}

.dark .community-nested-reply::before {
  background: rgba(34, 197, 94, 0.3);
}

.dark .community-mention-option {
  color: #e4e4e7;
}

.dark .community-mention-option:hover,
.dark .community-mention-option:focus {
  background: rgba(20, 83, 45, 0.35);
}

.dark .community-toolbar-top .community-btn-outline,
.dark .community-toolbar-actions .community-btn-outline {
  background: #18181b;
  border-color: #27272a;
  color: #e4e4e7;
}

.dark .community-toolbar-top .community-btn-outline:hover,
.dark .community-toolbar-actions .community-btn-outline:hover {
  background: rgba(20, 83, 45, 0.35);
  border-color: #15803d;
  color: #86efac;
}

.dark .community-like-button.is-liked {
  border-color: rgba(251, 113, 133, 0.45);
  color: #fb7185;
}

.dark .community-btn-danger {
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.dark .community-btn-danger:hover {
  background: rgba(127, 29, 29, 0.35);
  border-color: #f87171;
  color: #fecaca;
}
