/* ==================================================================================================
   Community (public/js/ui/community/*)
   --------------------------------------------------------------------------------------------------
   Split out of board.css in docs/community-v2-plan.md Phase 2b, when the tab
   went from five fields on a card to covers, content previews, stat rows and a
   four-step publish sheet, and the block roughly tripled.

   Contents:
     1. publisher-side hooks   the Tables/Blueprints toolbar buttons and badges
     2. filter bar             search + tag drill-down
     3. tag picker             ui/community/tagPicker.js (Phase 1)
     4. listing grid + card    the feed
     5. skeletons              first-load placeholder
     6. detail views           listing hero and publisher profile
     7. publish/edit sheet     the stepped dialog
   ================================================================================================== */

.dtable-toolbar__subscribed {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

/* publisher community button: published tint + pending-changes badge */
.dtable-toolbar__community {
  position: relative;
}

.dtable-toolbar__community.is-public,
.bp-row__community.is-public {
  color: var(--color-accent);
}

.dtable-toolbar__diff {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-bg);
  font-size: 9px;
  font-weight: var(--weight-semibold);
  line-height: 14px;
  text-align: center;
}

.menu__label--diff {
  color: var(--color-accent);
}

/* filter bar: a tag drill-down, since the vocabulary is a DAG now and cannot be
   enumerated into one <select> (docs/community-v2-plan.md Phase 1) */

.community-filter {
  align-items: center;
}

/* Only Tables/Blueprints get one: Think Tanks is still an unpaginated,
   client-filtered list with nothing to order by. */
.community-filter__sort {
  flex: 0 0 auto;
  width: auto;
  padding-block: 4px;
  font-size: var(--text-xs);
}

.community-filter__chips {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.community-filter__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
}

.community-filter__back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border: none;
  background: none;
  color: var(--color-ink-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

.community-filter__back:hover {
  color: var(--color-ink);
}

.community-filter__clear {
  flex-shrink: 0;
  border: none;
  background: none;
  color: var(--color-ink-faint);
  font-size: var(--text-xs);
  text-decoration: underline;
  cursor: pointer;
}

/* Facet count. Counted BEFORE the tag filter server-side, so it reads as "what
   selecting this would give me" rather than restating the current results. */
.chip__count {
  margin-left: var(--space-1);
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
}

.chip.is-selected .chip__count {
  opacity: 0.7;
}

/* the chevron half of a filter chip: drills in instead of selecting */
.chip__more {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  opacity: 0.5;
}

.chip__more:hover {
  opacity: 1;
}

.chip.is-selected {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: var(--color-bg);
}

.chip--static {
  pointer-events: none;
}

/* ---- tag picker (ui/community/tagPicker.js) --------------------------------------------------- */

.tagpicker {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.tagpicker__selected {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  min-height: 26px;
}

.tagpicker__hint {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-ink-faint);
}

.tagpicker__search {
  width: 100%;
}

/* Bounded and scrollable: the tree is deep enough that an unbounded browse pane
   pushes the dialog's own actions below the fold. */
.tagpicker__browse {
  max-height: 190px;
  overflow-y: auto;
  padding: var(--space-2);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
}

.tagpicker__crumbs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
}

.tagpicker__crumb {
  border: none;
  background: none;
  padding: 0 2px;
  color: var(--color-ink-secondary);
  font-size: var(--text-xs);
  cursor: pointer;
}

.tagpicker__crumb:hover {
  color: var(--color-ink);
  text-decoration: underline;
}

.tagpicker__crumbsep {
  display: inline-flex;
  color: var(--color-ink-faint);
}

.tagpicker__grid {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tagpicker__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  padding: 2px var(--space-1);
  border-radius: var(--radius-sm);
}

.tagpicker__row:hover {
  background: color-mix(in srgb, var(--color-ink) 6%, transparent);
}

.tagpicker__drill {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 2px;
  padding: 2px var(--space-1) 2px var(--space-2);
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-ink-secondary);
  font-size: var(--text-xs);
  cursor: pointer;
}

.tagpicker__drill:hover {
  background: color-mix(in srgb, var(--color-ink) 8%, transparent);
  color: var(--color-ink);
}

.tagpicker__drill-count {
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}

.tagpicker__results {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tagpicker__result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-1) var(--space-2);
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  text-align: left;
  cursor: pointer;
}

.tagpicker__result:hover {
  background: color-mix(in srgb, var(--color-ink) 6%, transparent);
}

.tagpicker__result.is-selected {
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
}

.tagpicker__result-main {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-1);
  min-width: 0;
}

.tagpicker__result-name {
  font-size: var(--text-sm);
  color: var(--color-ink);
}

/* the matched synonym, rendered before the arrow: without it an alias hit looks
   like an unrelated result */
.tagpicker__alias {
  font-size: var(--text-xs);
  color: var(--color-ink-faint);
  font-style: italic;
}

.tagpicker__arrow {
  font-size: var(--text-xs);
  color: var(--color-ink-faint);
}

.tagpicker__path {
  flex-shrink: 0;
  font-size: var(--text-xs);
  color: var(--color-ink-faint);
  white-space: nowrap;
}

.tagpicker__propose {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  width: 100%;
  margin-top: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border: 1px dashed var(--color-line);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-ink-secondary);
  font-size: var(--text-xs);
  text-align: left;
  cursor: pointer;
}

.tagpicker__propose:hover:not(:disabled) {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.tagpicker__propose:disabled {
  opacity: 0.5;
  cursor: default;
}

.tagpicker__error {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-danger);
}

/* selected chips carry two controls (primary toggle, remove), so they are
   compound rather than a plain .chip */
.chip--selected {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding-right: 3px;
}

.chip--selected.is-primary {
  border-color: var(--color-accent);
}

.chip--selected.is-pending {
  border-style: dashed;
  opacity: 0.8;
}

.chip__star,
.chip__x {
  display: inline-flex;
  align-items: center;
  padding: 0 1px;
  border: none;
  background: none;
  color: inherit;
  font-size: var(--text-xs);
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
}

.chip__star:hover,
.chip__x:hover {
  opacity: 1;
}

.chip--selected.is-primary .chip__star {
  color: var(--color-accent);
  opacity: 1;
}

.chip__note {
  font-size: 10px;
  color: var(--color-ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.community-publish__desc {
  height: auto;
  padding: var(--space-2) var(--space-3);
  resize: vertical;
}

/* ---- 4. listing grid and card ------------------------------------------------------------------
   The card is an <article> with a stretched overlay button rather than one big
   <button>, because the tag chips and the publisher chip are interactive too
   and nesting buttons is invalid. Overlay sits at z-index 1, the inner controls
   at 2. ------------------------------------------------------------------------------------------ */

/* The results container has always been in the markup (browse.js) and never had
   a rule. It needs one now: the sentinel below is its last child, and a
   sentinel inside a container with no flow of its own has nothing to sit under. */
.community-results {
  display: flow-root;
}

.community-results__summary {
  margin: 0 0 var(--space-3);
  color: var(--color-ink-faint);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
}

/* Zero-height, watched by an IntersectionObserver with a 600px rootMargin: the
   next page starts loading well before the reader reaches the end, so the grid
   grows without a visible pause. Nothing is rendered into it, so it must not
   take part in layout beyond existing. */
.community-sentinel {
  height: 1px;
  margin-top: calc(var(--space-3) * -1);
  pointer-events: none;
}

.community-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.community-card:hover {
  border-color: var(--color-border-strong);
}

.community-card:focus-within {
  border-color: var(--color-accent);
}

/* The whole-card hit area. Transparent: the card underneath is the visual. */
.community-card__open {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  background: none;
  cursor: pointer;
}

.community-card__open:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
  border-radius: var(--radius-md);
}

/* Cover: an uploaded image, or the deterministic gradient the JS sets inline.
   Never empty, so the grid has no grey holes in it. */
.community-card__cover {
  position: relative;
  height: 96px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.community-card__badge {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-surface);
  background: color-mix(in srgb, var(--color-ink) 72%, transparent);
  backdrop-filter: blur(4px);
}

.community-card__badge--trending {
  background: color-mix(in srgb, var(--color-accent) 88%, transparent);
}

.community-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
  padding: var(--space-3);
  text-align: left;
}

.community-card__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.community-card__desc {
  font-size: var(--text-xs);
  color: var(--color-ink-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Content preview: three cards from preview_cards. This is the feed showing
   what a table CONTAINS rather than what it is called. */
.community-card__preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-1);
}

.community-card__tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-ink) 4%, transparent);
}

.community-card__thumb {
  height: 34px;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  background-color: color-mix(in srgb, var(--color-ink) 8%, transparent);
}

.community-card__tile-title {
  font-size: 10px;
  font-weight: var(--weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-card__tile-field {
  font-size: 10px;
  color: var(--color-ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-card__tags {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

/* A clickable chip sets the filter, which is what turns a card from a dead end
   into a way further in. */
.community-card__tag {
  cursor: pointer;
}

.community-card__tag:hover {
  border-color: var(--color-border-strong);
  color: var(--color-ink);
}

.community-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-1);
}

.community-card__publisher {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-ink-secondary);
  min-width: 0;
  cursor: pointer;
}

.community-card__publisher:hover {
  color: var(--color-ink);
}

.community-card__publisher span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/*
 * The verified tick. An <i>, not a <span>, precisely because the rule above
 * ellipsises every span in this chip: a span badge would be the thing that got
 * truncated instead of the name it qualifies. flex-shrink: 0 for the same
 * reason — the name gives way, the badge does not.
 */
.community-verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-surface);
  vertical-align: middle;
}

.community-verified svg {
  width: 9px;
  height: 9px;
  stroke-width: 3;
}

.community-detail__title .community-verified,
.community-card__title .community-verified {
  width: 16px;
  height: 16px;
  margin-left: var(--space-1);
}

.community-card__stats,
.community-card__meta {
  font-size: var(--text-xs);
  color: var(--color-ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-card--tank .community-card__tankhead {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3) 0;
}

.community-card--preview {
  max-width: 320px;
  margin: 0 auto;
}

.avatar--xs {
  width: 18px;
  height: 18px;
  font-size: 9px;
}

.avatar--lg {
  width: 56px;
  height: 56px;
  font-size: var(--text-lg);
}

/* ---- 5. skeletons -------------------------------------------------------------------------------
   Mirrors the card so the real grid lands without a layout jump. A bare
   "Loading…" blanked the whole tab, and on a fast connection a blank flash
   reads as a fault. --------------------------------------------------------------------------- */

.community-skeleton {
  border: var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
  padding-bottom: var(--space-3);
}

.community-skeleton__cover {
  height: 96px;
  margin-bottom: var(--space-3);
}

.community-skeleton__line {
  height: 10px;
  margin: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}

.community-skeleton__cover,
.community-skeleton__line {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--color-ink) 6%, transparent) 25%,
    color-mix(in srgb, var(--color-ink) 11%, transparent) 37%,
    color-mix(in srgb, var(--color-ink) 6%, transparent) 63%
  );
  background-size: 400% 100%;
  animation: community-skeleton-shimmer 1.4s ease-in-out infinite;
}

.community-skeleton__line--title {
  width: 55%;
  height: 12px;
}

.community-skeleton__line--short {
  width: 35%;
}

.community-skeleton:nth-child(2n) .community-skeleton__cover,
.community-skeleton:nth-child(2n) .community-skeleton__line {
  animation-delay: 0.12s;
}

.community-skeleton:nth-child(3n) .community-skeleton__cover,
.community-skeleton:nth-child(3n) .community-skeleton__line {
  animation-delay: 0.24s;
}

@keyframes community-skeleton-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .community-skeleton__cover,
  .community-skeleton__line {
    animation: none;
  }
}

/* ---- 6. detail views --------------------------------------------------------------------------- */

.community-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.community-detail__head {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.community-detail__cover {
  height: 160px;
  border-radius: var(--radius-md);
  background-size: cover;
  background-position: center;
}

.community-detail__meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.community-detail__head--tank {
  flex-direction: row;
  align-items: flex-start;
  gap: var(--space-3);
}

.community-detail__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

/* draft / unlisted / suspended — the states where what you see is not what
   everyone else sees */
.community-detail__status {
  padding: 1px var(--space-2);
  border-radius: var(--radius-pill);
  border: var(--border-hairline);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-ink-secondary);
  background: color-mix(in srgb, var(--color-ink) 5%, transparent);
}

.community-detail__byline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.community-detail__desc {
  font-size: var(--text-sm);
  color: var(--color-ink-secondary);
  max-width: 60ch;
  white-space: pre-wrap;
}

.community-detail__loading {
  height: 160px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-ink) 6%, transparent);
}

.community-detail__section {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-ink-faint);
  margin-top: var(--space-2);
}

.community-detail__instructions p {
  font-size: var(--text-sm);
  color: var(--color-ink-secondary);
  max-width: 60ch;
  white-space: pre-wrap;
}

.community-detail__preview {
  max-width: 560px;
  border: var(--border-hairline);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-surface);
}

/* ---- 7. publish / edit sheet -------------------------------------------------------------------
   Four steps, and the draft is created on leaving the first one, so closing the
   sheet parks the work instead of losing it. ---------------------------------------------------- */

.dialog--steps {
  width: min(560px, 92vw);
}

.listing-steps {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
  list-style: none;
}

.listing-steps__step {
  flex: 1;
  padding-top: var(--space-2);
  border-top: 2px solid var(--color-border);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-ink-faint);
}

.listing-steps__step.is-done {
  border-top-color: color-mix(in srgb, var(--color-accent) 45%, transparent);
}

.listing-steps__step.is-current {
  border-top-color: var(--color-accent);
  color: var(--color-ink);
  font-weight: var(--weight-semibold);
}

.listing-step {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 220px;
}

.dialog__actions-spacer {
  flex: 1;
}

.listing-cover-preview {
  height: 140px;
  border-radius: var(--radius-md);
  background-size: cover;
  background-position: center;
}

.listing-cover__controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ---- 8. engagement: stars, ratings, comments ------------------------------------------------
   ui/community/{stars,comments}.js. The star and the rating widget both live in
   the detail byline; the thread is a section under the kind-specific body.

   Both widgets paint optimistically, so every state they can be in has to look
   deliberate — including the half-second where the number is ahead of the
   server. That is why `is-on` is a colour change and not an animation: a
   rollback would have to play it backwards. */

.community-star {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border: var(--border-hairline);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-ink-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.community-star:hover {
  color: var(--color-ink);
  border-color: var(--color-border-strong);
}

.community-star.is-on {
  color: var(--color-accent);
  border-color: color-mix(in srgb, var(--color-accent) 40%, transparent);
  background: color-mix(in srgb, var(--color-accent) 8%, transparent);
}

/* Empty until the first star, so a new listing shows a glyph and not a "0". */
.community-star span:empty {
  display: none;
}

.community-rating {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.community-rating__stars {
  display: inline-flex;
  align-items: center;
}

.community-rating__star {
  padding: 0 1px;
  border: 0;
  background: transparent;
  color: var(--color-ink-faint);
  cursor: pointer;
  line-height: 0;
  transition: color var(--dur-fast) var(--ease);
}

.community-rating__star.is-on {
  color: var(--color-ink-secondary);
}

/* Your own rating is the accent; the community average is grey. One control,
   two meanings, and the colour is the only thing telling them apart. */
.community-rating__stars.is-mine .community-rating__star.is-on {
  color: var(--color-accent);
}

.community-rating__star:hover,
.community-rating__stars:hover .community-rating__star.is-on {
  color: var(--color-accent);
}

.community-rating__note {
  font-size: var(--text-xs);
  color: var(--color-ink-faint);
}

/* ---- thread ---- */

.community-comments {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 60ch;
}

.community-comments__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.community-comment {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.community-comment__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.community-comment__name {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
}

.community-comment__badge {
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  color: var(--color-accent);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.community-comment__stamp {
  font-size: var(--text-xs);
  color: var(--color-ink-faint);
}

.community-comment__body {
  font-size: var(--text-sm);
  color: var(--color-ink-secondary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.community-comment__body.is-tombstone {
  font-style: italic;
  color: var(--color-ink-faint);
}

.community-comment__actions {
  display: flex;
  gap: var(--space-2);
}

.community-comment__action {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-ink-faint);
  font-size: var(--text-xs);
  cursor: pointer;
}

.community-comment__action:hover {
  color: var(--color-ink);
}

.community-comment__action--danger:hover {
  color: var(--color-danger);
}

/* One level, and the rule says so: a second indent is unreachable. */
.community-comment__replies {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-2);
  padding-left: var(--space-3);
  border-left: var(--border-hairline);
}

.community-composer {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.community-composer__input {
  resize: vertical;
  min-height: 64px;
  font: inherit;
}

.community-composer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.community-composer__error {
  font-size: var(--text-xs);
  color: var(--color-danger);
}

.community-composer__buttons {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}

/* ---- 9. reporting -------------------------------------------------------------------------------
   ui/community/reportDialog.js. The queue that reads these lives in
   public/js/admin/moderation.js and styles itself from the shared .admin__*
   vocabulary; only the reporter's half needs anything of its own. */

.community-report__reasons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

/* ---- 10. discover ------------------------------------------------------------------------------
   ui/community/discover.js. Horizontally scrolling rails rather than a grid,
   because the question a landing page answers is "what kinds of thing are
   here" and a grid answers "what is the single best thing". */

.community-discover {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.community-rail {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.community-rail__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.community-rail__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
}

.community-rail__blurb {
  font-size: var(--text-xs);
  color: var(--color-ink-faint);
}

/* Pushed right so it is in the same place on every rail, which is what makes
   it scannable rather than something to hunt for. */
.community-rail__see {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-accent);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  cursor: pointer;
}

.community-rail__see:hover {
  text-decoration: underline;
}

/* The rail is bounded server-side, so this scrolls rather than paginating.
   scroll-snap so a flick lands on a card edge instead of halfway through one. */
.community-rail__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 280px);
  gap: var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: var(--space-2);
  scrollbar-width: thin;
}

.community-rail__track > * {
  scroll-snap-align: start;
}

.community-rail__track--tanks {
  grid-auto-columns: minmax(200px, 220px);
}

.community-spotlight {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  padding: var(--space-3);
  border: var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease);
}

.community-spotlight:hover {
  border-color: var(--color-border-strong);
}

.community-spotlight__name {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
}

.community-spotlight__desc {
  font-size: var(--text-xs);
  color: var(--color-ink-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.community-spotlight__stats {
  font-size: var(--text-xs);
  color: var(--color-ink-faint);
}
