.community-shell {
  max-width: 1080px;
  display: grid;
  gap: 18px;
  padding-bottom: calc(72px + var(--safe-bottom));
}

.community-shell > * {
  min-width: 0;
}

.community-shell .top-header {
  margin-bottom: 0;
}

.community-board-card,
.community-detail-card {
  display: grid;
  gap: 20px;
  padding: clamp(18px, 2.3vw, 26px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 255, 0.96)),
    var(--ui-surface-strong);
  border-color: rgba(23, 48, 94, 0.12);
  box-shadow: 0 18px 34px rgba(23, 48, 94, 0.06);
}

.community-page-intro,
.community-composer-head,
.community-detail-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.community-page-intro {
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(23, 48, 94, 0.08);
}

.community-page-intro__copy,
.community-search-field,
.community-main-column,
.community-post-list,
.community-composer-card,
.community-form,
.community-detail-head {
  display: grid;
  gap: 12px;
}

.community-page-intro__copy {
  gap: 8px;
}

.community-page-intro__copy h1,
.community-detail-title {
  margin: 0;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.community-page-intro__copy p,
.community-detail-body,
.community-detail-empty-copy {
  margin: 0;
  color: var(--ui-muted);
  line-height: 1.7;
}

.community-page-intro__actions,
.community-composer-actions,
.community-detail-meta,
.community-category-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.community-page-intro__actions {
  justify-content: flex-end;
  flex-shrink: 0;
}

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

.community-category-tabs {
  overflow-x: auto;
  scrollbar-width: none;
}

.community-category-tabs::-webkit-scrollbar {
  display: none;
}

.community-category-row {
  flex-wrap: nowrap;
  width: max-content;
  min-width: 100%;
}

.community-category-tab {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 12px;
  border: 1px solid rgba(23, 48, 94, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ui-muted);
  font-weight: 700;
  white-space: nowrap;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.community-category-tab:hover,
.community-category-tab:focus-visible {
  border-color: rgba(77, 141, 248, 0.26);
  color: var(--ui-text);
  outline: none;
}

.community-category-tab.is-active {
  border-color: rgba(77, 141, 248, 0.2);
  background: rgba(77, 141, 248, 0.12);
  color: var(--ui-primary-strong);
}

.community-search-field {
  min-width: 0;
  gap: 6px;
}

.community-search-field .field-label {
  margin-bottom: 0;
}

.community-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.community-main-column {
  gap: 0;
  border: 1px solid rgba(23, 48, 94, 0.1);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95);
}

.community-post-list {
  gap: 0;
}

.community-post-list .loading-stack,
.community-post-list .empty-state {
  padding: 24px;
}

.community-post-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-top: 1px solid rgba(23, 48, 94, 0.08);
  background: rgba(255, 255, 255, 0.96);
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.community-post-row:first-child {
  border-top: 0;
}

.community-post-row:hover,
.community-post-row:focus-visible {
  background: rgba(77, 141, 248, 0.06);
  border-color: rgba(77, 141, 248, 0.14);
  outline: none;
}

.community-post-row:active {
  background: rgba(77, 141, 248, 0.1);
}

.community-post-row.is-notice {
  background:
    linear-gradient(90deg, rgba(77, 141, 248, 0.08), rgba(77, 141, 248, 0.02)),
    rgba(255, 255, 255, 0.96);
}

.community-post-row__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.community-post-row__prefix {
  color: var(--ui-primary-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.community-post-row__text {
  min-width: 0;
  color: var(--ui-text);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-post-row__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.community-post-row__meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(23, 48, 94, 0.08);
  background: rgba(23, 48, 94, 0.04);
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.community-post-row__meta-chip--mercenary {
  border-color: rgba(77, 141, 248, 0.14);
  background: rgba(77, 141, 248, 0.08);
  color: var(--ui-primary-strong);
}

.community-composer-card {
  gap: 16px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(23, 48, 94, 0.1);
  background: rgba(247, 249, 253, 0.9);
}

.community-composer-head h2 {
  margin: 4px 0 0;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.community-form {
  gap: 14px;
}

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

.community-form textarea {
  min-height: 220px;
  resize: vertical;
}

.community-composer-actions {
  justify-content: flex-end;
}

.community-detail-head {
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(23, 48, 94, 0.08);
}

.community-detail-meta {
  color: var(--ui-muted);
  font-size: 13px;
  line-height: 1.5;
}

.community-detail-body {
  color: var(--ui-text);
  font-size: 16px;
  white-space: pre-wrap;
}

.community-detail-empty {
  min-height: 300px;
  display: grid;
  place-items: center;
  text-align: center;
}

.community-detail-empty strong {
  font-size: 24px;
  line-height: 1.2;
}

@media (min-width: 900px) {
  .community-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    align-items: end;
  }
}

@media (max-width: 767px) {
  .community-shell {
    gap: 14px;
  }

  .community-page-intro,
  .community-composer-head,
  .community-detail-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .community-page-intro__actions,
  .community-composer-actions {
    width: 100%;
  }

  .community-page-intro__actions > *,
  .community-composer-actions .ui-btn,
  .community-composer-head .ui-btn,
  .community-detail-actions > * {
    width: 100%;
  }

  .community-post-row {
    padding: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .community-post-row__text {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .community-post-row__meta {
    width: 100%;
    justify-content: flex-start;
  }
}
