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

.community-switcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-full, 999px);
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  max-width: min(280px, 42vw);
}

.community-switcher:hover,
.community-switcher.open {
  background: var(--background-soft, #f4f4f5);
}

.community-switcher .community-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-switcher-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 200;
  min-width: 280px;
  max-width: 360px;
  max-height: 70vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
  padding: 8px;
  display: none;
}

.community-switcher-menu.open {
  display: block;
}

.community-switcher-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #888);
  padding: 8px 10px 4px;
}

.community-switcher-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.community-switcher-item:hover {
  background: var(--background-soft, #f4f4f5);
}

.community-switcher-item.active {
  background: rgba(32, 58, 124, 0.08);
}

.community-switcher-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--grad, linear-gradient(90deg, #203a7c, #80348a));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.community-switcher-item-body {
  flex: 1;
  min-width: 0;
}

.community-switcher-item-name {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-switcher-item-meta {
  font-size: 12px;
  color: var(--text-muted, #888);
}

.community-switcher-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 6px;
  background: #ede9fe;
  color: #5b21b6;
  flex-shrink: 0;
}

.community-switcher-badge.member {
  background: #f4f4f5;
  color: #52525b;
}

.community-switcher-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  margin-top: 6px;
  padding-top: 6px;
}

.community-switcher-footer a {
  display: block;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary, #203a7c);
  text-decoration: none;
  border-radius: 8px;
}

.community-switcher-footer a:hover {
  background: var(--background-soft, #f4f4f5);
}
