.community-page {
  min-height: 60vh;
  padding: 1.5rem 0 5rem;
  background: #f7f6f2;
}

.community-nav {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding: .5rem 0 1rem;
  border-bottom: 1px solid var(--line);
}

.community-nav a {
  flex: 0 0 auto;
  padding: .55rem .8rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
}

.community-nav a:hover {
  background: #fff;
}

.community-nav form {
  display: flex;
  align-items: center;
}

.community-nav form button {
  padding: .55rem .8rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
}

.community-nav form button:hover {
  background: #fff;
}

.community-heading {
  max-width: 760px;
  padding: 2.2rem 0 1.4rem;
}

.community-heading h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  letter-spacing: -.065em;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.community-heading > p:last-child {
  max-width: 650px;
  color: var(--muted);
}

.community-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
  gap: 1.3rem;
}

.community-main,
.community-aside {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.community-panel {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 28px #20211f08;
}

.community-panel h2 {
  margin: 0 0 .6rem;
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: -.035em;
}

.community-panel p {
  color: #5f605c;
}

.community-welcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 780px;
  padding: clamp(1.4rem, 5vw, 3rem);
}

.community-welcome h2 {
  max-width: 650px;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  letter-spacing: -.055em;
}

.community-welcome li {
  margin: .5rem 0;
  color: #5f605c;
}

.community-auth {
  width: min(100%, 650px);
}

.community-form {
  display: grid;
  gap: 1rem;
}

.community-form .field input,
.community-form .field textarea,
.community-form .field select,
.community-comment-form input,
.community-composer textarea,
.community-composer select,
.community-report input,
.community-report textarea,
.community-report select,
.community-search input {
  width: 100%;
  min-height: 46px;
  padding: .65rem .75rem;
  border: 1px solid #d6d6d0;
  border-radius: 6px;
  background: #fff;
}

.community-form .field textarea,
.community-composer textarea,
.community-report textarea {
  min-height: 110px;
  resize: vertical;
}

.community-privacy-note {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
}

.community-composer {
  display: grid;
  gap: .75rem;
}

.community-composer > label,
.community-composer-actions label {
  font-size: .9rem;
  font-weight: 800;
}

.community-composer-actions {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  align-items: end;
  gap: .65rem 1rem;
}

.community-composer-actions label {
  grid-column: 1;
}

.community-composer-actions select {
  grid-column: 1;
}

.community-composer-actions button {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.community-post {
  padding: 1.25rem;
}

.community-post-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.community-post-header > div {
  display: grid;
  gap: .15rem;
}

.community-member-name {
  font-weight: 800;
}

.community-post-header span,
.community-post-header time {
  color: var(--muted);
  font-size: .75rem;
}

.community-group-tag {
  width: fit-content;
  margin-top: .35rem;
  padding: .2rem .5rem;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: .72rem;
  font-weight: 700;
}

.community-post-body {
  padding: .85rem 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.community-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .55rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
}

.community-action-button {
  padding: .35rem .2rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.community-action-button.is-liked {
  color: var(--accent);
}

.community-report {
  position: relative;
  margin-left: auto;
  font-size: .78rem;
}

.community-report > summary {
  cursor: pointer;
}

.community-report form {
  position: absolute;
  z-index: 5;
  top: 1.8rem;
  right: 0;
  display: grid;
  width: min(300px, 80vw);
  gap: .6rem;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 12px 30px #20211f1c;
}

.community-report form label {
  display: grid;
  gap: .4rem;
}

.community-comments {
  display: grid;
  gap: .45rem;
  padding-top: .6rem;
}

.community-comment {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .7rem;
  padding: .6rem .7rem;
  border-radius: 6px;
  background: var(--soft);
}

.community-comment p {
  margin: 0;
  font-size: .85rem;
  overflow-wrap: anywhere;
}

.community-comment p a {
  color: var(--ink);
  font-weight: 800;
}

.community-comment .community-report {
  flex: 0 0 auto;
}

.community-comment-form {
  display: flex;
  gap: .5rem;
  padding-top: .7rem;
}

.community-comment-form input {
  min-width: 0;
}

.community-aside .community-panel p {
  font-size: .86rem;
}

.community-group-grid,
.community-member-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 1rem;
}

.community-group-card,
.community-member-grid > article {
  height: 100%;
}

.community-group-card h2 a,
.community-member-grid h2 a {
  color: var(--ink);
}

.community-search {
  display: flex;
  max-width: 650px;
  gap: .6rem;
  margin-bottom: 1rem;
}

.community-search input {
  min-width: 0;
}

.community-group-detail {
  margin-bottom: 1rem;
}

.community-joined {
  margin-bottom: 0;
}

.community-profile-post {
  padding: .75rem 0;
  border-top: 1px solid var(--line);
}

.community-profile-post p {
  margin: 0 0 .5rem;
}

.community-profile-post small {
  color: var(--muted);
}

.community-profile-actions,
.community-connection-row,
.community-connection-row > div,
.community-connection-row .button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem;
}

.community-profile-actions {
  margin: 1rem 0;
}

.community-connection-row {
  justify-content: space-between;
  padding: .8rem 0;
  border-top: 1px solid var(--line);
}

.community-connection-row p {
  margin: .2rem 0 0;
  color: var(--muted);
  font-size: .84rem;
}

.community-connection-status {
  display: inline-block;
  margin-left: .4rem;
  color: var(--muted);
  font-size: .82rem;
}

.community-danger-zone {
  margin-top: 2rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--line);
}

.button-danger {
  background: #992b27;
  border-color: #992b27;
}

.community-report-card {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.community-report-card > header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.community-report-card > header span {
  color: var(--muted);
  font-size: .75rem;
}

.community-report-card blockquote {
  margin: .8rem 0;
  padding: .65rem .8rem;
  border-left: 3px solid var(--accent);
  background: var(--soft);
  overflow-wrap: anywhere;
}

@media (max-width: 850px) {
  .community-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-aside {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .community-page {
    padding-top: .6rem;
  }

  .community-heading {
    padding-top: 1.5rem;
  }

  .community-panel {
    padding: 1rem;
  }

  .community-group-grid,
  .community-member-grid,
  .community-aside {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-post-header {
    flex-direction: column;
    gap: .35rem;
  }

  .community-composer-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-composer-actions label,
  .community-composer-actions select,
  .community-composer-actions button {
    grid-column: 1;
    grid-row: auto;
  }

  .community-search {
    flex-direction: column;
  }

  .community-comment {
    flex-direction: column;
  }
}
