.community {
  max-width: 1100px;
  margin: auto;
  min-width: 0;
}
.community-header,
.community-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.community-header > div {
  flex: 1 1 22rem;
  min-width: 0;
}
.community h1 {
  font-size: clamp(1.6rem, 4vw, 2.7rem);
}
.community h2 {
  font-size: 1.35rem;
  margin: 0 0 0.7rem;
}
.community h3 {
  font-size: 1.12rem;
}
.community p {
  line-height: 1.8;
}
.community-card,
.community-rules {
  background: var(--paper, #fff);
  border: 1px solid var(--line, #d4e0d9);
  border-radius: 22px;
  padding: clamp(1rem, 3vw, 1.7rem);
  margin: 1rem 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.community-card h2,
.community-card h3 {
  word-break: normal;
}
.community-user,
.community-small,
.community-list-item small {
  color: var(--muted, #64716a);
  font-size: 0.88rem;
  line-height: 1.65;
}
.community-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.7rem 0;
}
.community-tabs button {
  flex: none;
}
.community-tabs [aria-current="page"] {
  background: var(--teal, #176653);
  color: #fff;
}
.community button,
.community .btn,
.community-dialog button {
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line, #ccdcd4);
  background: var(--paper, #fff);
  color: var(--ink, #203a31);
  cursor: pointer;
  font: inherit;
  line-height: 1.4;
  white-space: normal;
}
.community button:disabled {
  opacity: 0.55;
  cursor: default;
}
.community .primary,
.community-dialog .primary {
  background: var(--teal, #176653);
  color: #fff;
}
.community .danger {
  color: #a72235;
  border-color: #cd9fa5;
}
.community-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.community-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line, #d7e1dc);
  flex-wrap: wrap;
}
.community-list-item > div {
  min-width: 0;
}
.community-list-item small,
.community-ranking small {
  display: block;
  margin: 0.3rem 0;
}
.community-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 1rem;
}
.community-team-grid > article {
  padding: 1rem;
  border: 1px solid var(--line, #d7e1dc);
  border-radius: 16px;
}
.community-tag {
  display: inline-block;
  background: var(--bg, #e3eee9);
  color: var(--teal, #176653);
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  font-size: 0.8rem;
}
.community-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}
.community-stats > div {
  background: var(--bg, #eef5f1);
  border-radius: 12px;
  padding: 0.8rem 0.3rem;
  text-align: center;
}
.community-stats b {
  display: block;
  font-size: 1.65rem;
}
.community-stats span {
  font-size: 0.85rem;
}
.community-check {
  display: flex !important;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0;
  line-height: 1.7;
}
.community-check input {
  width: 22px !important;
  height: 22px;
  flex: none;
  margin-top: 0.25rem;
  accent-color: var(--teal, #176653);
}
.community label,
.community-dialog label {
  display: block;
  margin: 0.7rem 0;
  line-height: 1.7;
}
.community input:not([type="checkbox"]),
.community select,
.community-dialog input:not([type="checkbox"]),
.community-dialog textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--line, #c7d7ce);
  background: var(--paper, #fff);
  color: var(--ink, #203a31);
  font: inherit;
  font-size: 16px;
}
.community-message {
  padding: 1rem;
  background: var(--bg, #e3eee9);
  border-radius: 12px;
}
.community-rank-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.community-rank-controls label {
  flex: 1 1 230px;
}
.community-ranking {
  padding: 0;
  list-style: none;
}
.community-ranking li {
  display: flex;
  gap: 1rem;
  align-items: center;
  border-bottom: 1px solid var(--line, #d7e1dc);
  padding: 1rem 0;
}
.community-ranking li > b {
  font-size: 1.4rem;
  width: 2rem;
  text-align: center;
}
.community-ranking li > div {
  flex: 1;
  min-width: 0;
}
.community-ranking li span {
  display: block;
  margin-top: 0.5rem;
  line-height: 1.7;
}
.community-rules summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  align-content: center;
}
.community-dialog {
  color: var(--ink, #203a31);
  background: var(--paper, #fff);
  border: 1px solid var(--line, #d7e1dc);
  border-radius: 20px;
  max-width: 580px;
  width: calc(100% - 2rem);
  max-height: 85dvh;
  box-sizing: border-box;
  padding: 1.3rem;
  overflow: auto;
}
.community-dialog::backdrop {
  background: rgba(14, 32, 25, 0.5);
}
.community-dialog header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}
.community-dialog header h2 {
  margin: 0;
  font-size: 1.3rem;
}
.community-dialog header button {
  flex: none;
}
.community-dialog p {
  line-height: 1.8;
}
.community-dialog .community-actions {
  margin-top: 1.2rem;
  justify-content: flex-end;
}
.community-invitation {
  border: 2px solid var(--teal, #176653);
}
@media (max-width: 400px) {
  .community-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .community-actions button {
    flex: 1 1 auto;
  }
  .community-header > a {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
  .community-dialog {
    padding: 1rem;
  }
  .community-card {
    border-radius: 16px;
  }
}

.community p + p,
.community h3 {
  margin-top: 0.7rem;
}
.community-card > .community-actions,
.community-card > button {
  margin-top: 0.8rem;
}
