.community-page #communitySearch {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px;
  background: var(--white); color: var(--ink); font-family: inherit; font-size: 14px; margin-bottom: 16px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.community-page #communitySearch:focus {
  border-color: var(--green2); box-shadow: 0 0 0 3px var(--mint), 0 0 0 4px var(--green2); outline: none;
}

.community-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; align-items: start; }
.community-sidebar { position: sticky; top: 20px; }

.create-post-form { margin-bottom: 24px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); }
.create-post-form textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px;
  font-family: inherit; font-size: 14px; color: var(--ink); background: var(--white); resize: vertical;
}

.feed-list { display: flex; flex-direction: column; gap: 16px; }
.post-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--white);
  box-shadow: var(--shadow-sm); transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.post-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.post-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.post-author-link { font-weight: 700; color: var(--ink); text-decoration: none; }
.post-author-link:hover { color: var(--green); }
.post-date { margin-left: auto; font-size: 12px; color: var(--muted); }

.post-images { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.post-images > div { position: relative; overflow: hidden; border-radius: var(--radius-sm); }
.post-images img { width: 100%; height: 160px; object-fit: cover; display: block; transition: transform .3s var(--ease); }
.post-images > div:hover img { transform: scale(1.04); }
.post-image-label {
  position: absolute; top: 8px; left: 8px; background: rgba(10,28,21,.6); color: #fff;
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 999px;
}

.post-description { font-size: 14px; margin-bottom: 12px; white-space: pre-wrap; }

.post-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.post-actions button {
  border: 1px solid var(--line); background: var(--white); color: var(--ink); border-radius: var(--radius-sm);
  padding: 7px 12px; font-weight: 700; cursor: pointer; font-size: 12px; transition: all .2s var(--ease);
}
.post-actions button:hover { border-color: var(--green2); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.post-actions button.like-button.active { color: #c0446b; border-color: #c0446b; }

.post-comments { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.comments-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.comment-row { font-size: 13px; display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.comment-row button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.comment-form { display: flex; gap: 8px; }
.comment-form input {
  flex: 1; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; font-family: inherit;
  transition: border-color .15s var(--ease);
}
.comment-form input:focus { border-color: var(--green2); outline: none; }
.comment-form button {
  border: 0; background: var(--green); color: #fff; border-radius: var(--radius-sm); padding: 8px 14px; font-weight: 700; cursor: pointer; font-size: 12px;
  transition: background .15s var(--ease);
}
.comment-form button:hover { background: var(--green-deep); }

.leaderboard-panel, .moderation-panel {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--white); margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.leaderboard-panel h3, .moderation-panel h3 { font-size: 15px; margin-bottom: 12px; }
.leaderboard-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.leaderboard-row:last-child { border-bottom: none; }
.leaderboard-rank { font-weight: 800; color: var(--green); width: 20px; }
.leaderboard-name { flex: 1; font-weight: 700; }
.leaderboard-points { color: var(--muted); font-size: 12px; }

.report-row { border-bottom: 1px solid var(--line); padding: 10px 0; font-size: 13px; }
.report-row:last-child { border-bottom: none; }
.report-row .report-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.report-row button { border: 1px solid var(--line); background: var(--white); border-radius: 8px; padding: 5px 10px; font-size: 11px; font-weight: 700; cursor: pointer; }

/* Profile page */
.profile-header { display: flex; align-items: center; gap: 16px; margin: 24px 0 8px; }
.profile-avatar { width: 64px; height: 64px; font-size: 24px; }
.profile-header-info h2 { margin-bottom: 4px; }
.profile-header-info p { color: var(--muted); font-size: 13px; }
.profile-bio-section { margin-bottom: 28px; }
.profile-bio-section textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-family: inherit; margin-bottom: 8px;
}

.badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 16px 0 28px; }
.badge-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-align: center; background: var(--white); }
.badge-card.locked { opacity: .4; }
.badge-icon { font-size: 26px; margin-bottom: 6px; }
.badge-icon .icon { width: 28px; height: 28px; margin-right: 0; }
.badge-card strong { display: block; font-size: 13px; margin-bottom: 4px; }
.badge-card span { font-size: 11px; color: var(--muted); }

.challenges-list { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 28px; }
.challenge-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--white); }
.challenge-card strong { display: block; margin-bottom: 4px; }
.challenge-card p { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.challenge-progress-bar { height: 8px; border-radius: 999px; background: var(--mint); overflow: hidden; margin-bottom: 8px; }
.challenge-progress-fill { height: 100%; background: var(--green); }
.challenge-card button {
  border: 1px solid var(--line); background: var(--white); border-radius: 10px; padding: 6px 12px; font-weight: 700; cursor: pointer; font-size: 12px;
}
.challenge-card.completed { border-color: var(--green); }

@media (max-width: 900px) {
  .community-layout { grid-template-columns: 1fr; }
  .community-sidebar { position: static; }
}
@media (max-width: 560px) {
  .post-images { grid-template-columns: 1fr; }
  .profile-header { flex-direction: column; align-items: flex-start; }
}
