.community-popover {
  left: 14px;
  width: min(520px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 76px));
  overflow: hidden;
}

.community-head-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.community-manage-link {
  color: var(--color-accent, #4c8a49);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.community-manage-link:hover,
.community-manage-link:focus-visible {
  text-decoration: underline;
}

.community-manage-link.hidden {
  display: none;
}

.community-status {
  min-height: 20px;
  font-size: 13px;
  line-height: 1.45;
}

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

.community-status.is-error {
  color: #b3261e;
}

.community-status.is-success {
  color: #347a3d;
}

.community-feed {
  display: grid;
  gap: 12px;
  overflow: auto;
  max-height: calc(min(680px, calc(100vh - 76px)) - 66px);
  padding: 1px 4px 4px 1px;
}

.community-card {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid color-mix(in srgb, var(--border-color) 82%, transparent);
  border-left: 5px solid #7ca36d;
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-primary) 78%, var(--bg-card));
}

.community-poll {
  border-left-color: #8873c5;
}

.community-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.community-card-heading h3 {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.community-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, #8873c5 18%, var(--bg-card));
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 900;
}

.community-badge.is-pinned {
  background: color-mix(in srgb, #e3b34b 24%, var(--bg-card));
}

.community-badge.is-reminder {
  background: color-mix(in srgb, #d86449 22%, var(--bg-card));
  color: #a33724;
}

.community-card-body {
  margin: 0;
  color: var(--text-primary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.community-card-meta {
  color: var(--text-muted, var(--text-secondary));
  font-size: 12px;
}

.community-poll-options {
  display: grid;
  gap: 7px;
}

.community-poll-option {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.community-poll-option:hover:not(:disabled),
.community-poll-option:focus-visible:not(:disabled) {
  border-color: #8873c5;
  box-shadow: 0 0 0 2px color-mix(in srgb, #8873c5 20%, transparent);
}

.community-poll-option.is-selected {
  border-color: #6f58b2;
  background: color-mix(in srgb, #8873c5 13%, var(--bg-card));
}

.community-poll-option:disabled {
  cursor: default;
  opacity: 0.78;
}

.community-option-label {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 750;
}

.community-option-count {
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.community-empty {
  margin: 8px 0;
  text-align: center;
}

@media (max-width: 620px) {
  .community-popover {
    top: 52px;
    left: 8px;
    width: calc(100vw - 16px);
    max-height: calc(100vh - 64px);
    padding: 12px;
  }

  .community-feed {
    max-height: calc(100vh - 132px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .community-popover:not(.hidden) {
    animation: none;
  }
}

.community-chain-entries {
  max-height: 220px;
  margin: 8px 0 0;
  padding: 8px 10px 8px 28px;
  overflow-y: auto;
  border: 1px solid var(--line-soft, rgba(28, 40, 52, .14));
  border-radius: 8px;
  color: var(--text-secondary, #34495e);
  background: rgba(255, 255, 255, .55);
  font-size: 13px;
  line-height: 1.55;
}

.community-chain-entries b {
  color: var(--text-primary, #243042);
  font-weight: 800;
}

.community-chain-join {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.community-chain-input {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.community-chain-join .community-poll-option {
  width: auto;
  flex: 0 0 auto;
  justify-content: center;
  padding: 0 14px;
}
