.community-auth,
.community-search,
.community-post-tools,
.community-comments,
.community-view {
  color: inherit;
  font: inherit;
}

.community-auth,
.community-search,
.community-post-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin: 1rem 0;
}

.community-auth button,
.community-auth input,
.community-search input,
.community-post-tools button,
.community-comments button,
.community-comments textarea,
.community-dialog button,
.community-dialog input,
.community-view button,
.community-view textarea {
  border: 1px solid var(--line, currentColor);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.community-auth button,
.community-post-tools button,
.community-comments button,
.community-dialog button,
.community-view button {
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

.community-auth button:hover,
.community-auth button:focus-visible,
.community-post-tools button:hover,
.community-post-tools button:focus-visible,
.community-comments button:hover,
.community-comments button:focus-visible,
.community-dialog button:hover,
.community-dialog button:focus-visible,
.community-view button:hover,
.community-view button:focus-visible {
  border-color: var(--gold, currentColor);
  color: var(--gold, currentColor);
}

.community-search {
  display: block;
  margin-bottom: 1.5rem;
}

.community-search label,
.community-dialog label {
  display: grid;
  gap: 0.35rem;
}

.community-search input,
.community-dialog input,
.community-comments textarea,
.community-view textarea {
  width: 100%;
  padding: 0.65rem;
}

.community-post-meta,
.community-comment-meta,
.community-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.8rem;
  color: color-mix(in srgb, currentColor 68%, transparent);
  font-size: 0.82rem;
}

.community-post-meta button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.community-post-link {
  color: inherit;
  text-decoration: none;
}

.community-comments {
  margin-top: 1rem;
}

.community-comment-form {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0 1.5rem;
}

.community-comment-form textarea {
  min-height: 7rem;
  resize: vertical;
}

.community-comment-list,
.community-replies {
  display: grid;
  gap: 1rem;
}

.community-comment {
  padding: 1rem 0 0;
  border-top: 1px solid var(--line, currentColor);
}

.community-replies {
  margin: 0.8rem 0 0 clamp(0.75rem, 4vw, 2rem);
}

.community-self-reply {
  padding-left: 0.8rem;
  border-left: 3px solid var(--gold, currentColor);
  background: color-mix(in srgb, var(--gold, currentColor) 6%, transparent);
}

.community-comment-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.community-comment-gif img,
.community-gif-attached img,
.community-moderation-gif {
  display: block;
  width: auto;
  max-width: min(100%, 30rem);
  max-height: 24rem;
  margin-top: 0.65rem;
  object-fit: contain;
}

.community-gif-controls,
.community-gif-panel {
  display: grid;
  gap: 0.65rem;
}

.community-gif-attached {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
}

.community-gif-panel {
  padding: 0.75rem;
  border: 1px solid var(--line, currentColor);
}

.community-gif-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.community-gif-panel input {
  width: 100%;
  padding: 0.55rem;
  border: 1px solid var(--line, currentColor);
  background: transparent;
  color: inherit;
  font: inherit;
}

.community-gif-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.55rem;
}

.community-gif-card {
  display: grid;
  align-content: start;
  gap: 0.25rem;
}

.community-gif-select {
  padding: 0 !important;
  border: 0 !important;
}

.community-gif-select img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.community-gif-favorite {
  font-size: 0.75rem;
}

.community-gif-attribution {
  margin: 0;
  font-size: 0.72rem;
  color: color-mix(in srgb, currentColor 68%, transparent);
}

.community-comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.community-comment-actions button {
  padding: 0.25rem 0.45rem;
  font-size: 0.82rem;
}

.community-collapsed {
  margin-left: clamp(0.75rem, 4vw, 2rem);
}

.community-collapsed summary {
  cursor: pointer;
  color: var(--gold, currentColor);
  font-size: 0.85rem;
}

.community-dialog {
  width: min(30rem, calc(100% - 2rem));
  padding: 1.25rem;
  border: 1px solid var(--line, currentColor);
  background: var(--paper, Canvas);
  color: var(--ink, CanvasText);
}

.community-dialog::backdrop {
  background: rgb(0 0 0 / 0.42);
}

.community-dialog form,
.community-auth-fields {
  display: grid;
  gap: 0.8rem;
}

.community-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.community-error {
  color: #8a1c1c;
}

.community-empty {
  color: color-mix(in srgb, currentColor 68%, transparent);
}

.community-saved-item,
.community-moderation-item {
  padding: 1rem 0;
  border-top: 1px solid var(--line, currentColor);
}

.community-moderation-item textarea {
  min-height: 7rem;
  margin: 0.75rem 0;
}

[hidden] {
  display: none !important;
}
