.community-intro {
  max-width: 700px;
  margin: -0.7rem 0 2.2rem;
  color: var(--nord4);
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
  line-height: 1.55;
}

.community-shell {
  width: min(1180px, 100%);
}

.community-board,
.community-profile {
  background: rgba(50, 40, 51, 0.94);
  border: 2px solid rgba(236, 239, 244, 0.48);
  border-radius: 18px;
  box-shadow: 7px 7px 0 rgba(32, 25, 33, 0.75);
}

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

.community-care-note {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1.15rem;
  background: rgba(163, 190, 140, 0.12);
  border-bottom: 1px solid rgba(163, 190, 140, 0.45);
  color: var(--nord4);
  line-height: 1.4;
}

.community-care-note strong {
  flex: 0 0 auto;
  color: var(--nord14);
}

.community-board-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem;
  border-bottom: 1px solid rgba(236, 239, 244, 0.18);
}

.community-board-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
}

.community-kicker {
  margin-bottom: 0.35rem;
  color: var(--nord13);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.community-board h2,
.community-profile h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.8vw, 2rem);
}

.community-connection {
  flex: 0 0 auto;
  padding: 0.42rem 0.68rem;
  background: rgba(235, 203, 139, 0.1);
  border: 1px solid rgba(235, 203, 139, 0.55);
  border-radius: 999px;
  color: var(--nord13);
  font-size: 0.78rem;
}

.community-connection.connected {
  background: rgba(163, 190, 140, 0.12);
  border-color: rgba(163, 190, 140, 0.6);
  color: var(--nord14);
}

.community-feed {
  min-height: 320px;
  max-height: 610px;
  overflow-y: auto;
  padding: 0.7rem;
  background: rgba(46, 52, 64, 0.32);
  scrollbar-color: rgba(216, 222, 233, 0.42) transparent;
}

.community-empty {
  min-height: 280px;
  display: grid;
  place-content: center;
  gap: 0.35rem;
  padding: 2rem;
  color: var(--nord4);
  text-align: center;
}

.community-empty[hidden] {
  display: none;
}

.community-empty strong {
  color: var(--nord6);
  font-size: 1.25rem;
}

.community-post {
  padding: 1rem;
  background: rgba(69, 57, 71, 0.82);
  border: 1px solid rgba(236, 239, 244, 0.24);
  border-radius: 10px;
}

.community-post + .community-post {
  margin-top: 0.55rem;
}

.community-post-header,
.community-post-identity {
  display: flex;
  align-items: center;
}

.community-post-header {
  justify-content: space-between;
  gap: 0.75rem;
}

.community-post-identity {
  min-width: 0;
  gap: 0.65rem;
}

.post-avatar,
.profile-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(136, 192, 208, 0.18);
  border: 2px solid rgba(216, 222, 233, 0.66);
  color: var(--nord6);
  font-weight: 700;
}

.post-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 9px;
  font-size: 0.78rem;
}

.post-avatar img,
.profile-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.profile-avatar img[hidden],
.profile-avatar span[hidden] {
  display: none;
}

.community-post-username {
  overflow: hidden;
  color: var(--nord14);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-post-meta {
  flex: 0 0 auto;
  color: rgba(216, 222, 233, 0.72);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
}

.community-post-body {
  margin: 0.8rem 0 0 3.05rem;
  color: var(--nord5);
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.community-post-form {
  padding: 1.15rem 1.25rem 1.25rem;
  border-top: 1px solid rgba(236, 239, 244, 0.18);
}

.community-post-form textarea {
  min-height: 130px;
  margin-top: 0.45rem;
  background: rgba(46, 52, 64, 0.72);
}

.community-form-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.55rem 0 0.9rem;
  color: var(--nord8);
  font-size: 0.8rem;
}

.community-action {
  min-height: 46px;
  padding: 0.7rem 1rem;
  background: var(--nord14);
  border: 2px solid rgba(236, 239, 244, 0.72);
  border-radius: 9px;
  color: var(--nord0);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.community-action.secondary {
  width: 100%;
  background: rgba(136, 192, 208, 0.2);
  color: var(--nord6);
}

.community-action.community-settings-button {
  width: auto;
  min-height: 38px;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  font-size: 0.78rem;
}

.community-action:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.community-action:disabled {
  cursor: wait;
  opacity: 0.58;
}

.community-status {
  min-height: 1.35rem;
  margin: 0.75rem 0 0;
  color: var(--nord8);
  font-size: 0.84rem;
  line-height: 1.4;
}

.community-status:empty {
  display: none;
}

.community-status.error {
  color: #e59a9f;
}

.community-status.success {
  color: var(--nord14);
}

.community-profile {
  position: relative;
  padding: 1.25rem;
}

.community-profile-dialog {
  width: min(440px, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  overflow: auto;
  background: transparent;
  border: 0;
  color: var(--nord6);
}

.community-profile-dialog::backdrop {
  background: rgba(18, 18, 18, 0.78);
}

.community-dialog-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.community-profile-copy {
  margin: 0.6rem 0 1rem;
  color: var(--nord4);
  line-height: 1.45;
}

.profile-avatar {
  width: 92px;
  height: 92px;
  margin: 0 auto 1.15rem;
  border-radius: 22px;
  font-size: 1.45rem;
}

.community-field {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.community-field label span,
.community-field small {
  color: rgba(216, 222, 233, 0.68);
}

.community-field input {
  width: 100%;
  min-height: 46px;
  padding: 0.68rem;
  background: rgba(46, 52, 64, 0.72);
  border: 2px solid rgba(236, 239, 244, 0.45);
  border-radius: 8px;
  color: var(--nord6);
  font: inherit;
}

.community-field input[type='file'] {
  padding: 0.45rem;
  font-size: 0.82rem;
}

.community-field input::file-selector-button {
  margin-right: 0.55rem;
  padding: 0.45rem 0.6rem;
  background: rgba(216, 222, 233, 0.12);
  border: 1px solid rgba(216, 222, 233, 0.42);
  border-radius: 6px;
  color: var(--nord6);
  cursor: pointer;
  font: inherit;
}

.community-privacy-note {
  margin-top: 1rem;
  padding: 0.9rem;
  background: rgba(94, 129, 172, 0.14);
  border-left: 3px solid var(--nord8);
  border-radius: 6px;
  color: var(--nord4);
}

.community-privacy-note strong {
  color: var(--nord6);
}

.community-privacy-note p {
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
}

@media (max-width: 560px) {
  .community-intro {
    margin-bottom: 1.35rem;
  }

  .community-board-header,
  .community-care-note,
  .community-post-header {
    flex-direction: column;
  }

  .community-board-actions {
    align-self: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .community-feed {
    min-height: 260px;
    padding: 0.5rem;
  }

  .community-post-body {
    margin-left: 0;
  }

  .community-post-meta {
    padding-left: 3.05rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .community-action:hover:not(:disabled) {
    transform: none;
  }
}
