/* Community marketplace + agents */

.community-page {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(ellipse 70% 40% at 50% -8%, rgba(232, 192, 74, 0.07), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
}

.community-shell {
  max-width: 52rem;
  margin: 0 auto;
  padding: calc(var(--safe-top, 0px) + 1.5rem) 1.25rem calc(var(--safe-bottom, 0px) + 3rem);
}

.community-page.has-site-header .community-shell {
  padding-top: 0;
}

.community-page.has-site-header .site-header {
  margin-bottom: 0;
}

.community-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.75rem;
}

.community-top .auth-brand {
  margin: 0;
}

.community-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  font-size: 0.9rem;
}

.community-nav a {
  color: var(--text-secondary);
  text-decoration: none;
}

.community-nav a:hover,
.community-nav a[aria-current="page"] {
  color: var(--text);
}

.community-hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 650;
  letter-spacing: -0.03em;
}

.community-hero p {
  margin: 0 0 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 36rem;
}

.community-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.community-toolbar input,
.community-toolbar select {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
}

.community-toolbar input {
  flex: 1 1 12rem;
  min-width: 10rem;
}

.community-toolbar select {
  flex: 0 0 auto;
}

.skill-grid,
.agent-list {
  display: grid;
  gap: 0.85rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.skill-card {
  display: block;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: calc(var(--radius) + 2px);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}

.skill-card:hover {
  border-color: var(--spot-gold, #e8c04a);
}

.skill-card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.skill-card h2,
.agent-card h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.skill-score {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--spot-gold, #e8c04a);
  white-space: nowrap;
}

.skill-card p,
.agent-card p {
  margin: 0.45rem 0 0.65rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.4;
}

.skill-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted, var(--text-secondary));
}

.skill-card-meta a {
  color: inherit;
  text-decoration: none;
}

.skill-card-meta a:hover {
  color: var(--spot-gold, #e8c04a);
  text-decoration: underline;
}

.badge-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.contrib-badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
}

.contrib-badge[data-tier="bronze"] { color: #c4a574; }
.contrib-badge[data-tier="silver"] { color: #c0c6d0; }
.contrib-badge[data-tier="gold"] { color: var(--spot-gold, #e8c04a); }

.pro-cta {
  margin: 1.5rem 0 0;
  padding: 1rem 1.15rem;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius);
  background: rgba(232, 192, 74, 0.04);
}

.pro-cta p {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.skill-detail-actions,
.skill-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
  align-items: center;
}

.vote-group {
  display: inline-flex;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
}

.vote-group button {
  font: inherit;
  border: 0;
  background: var(--surface);
  color: var(--text);
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

.vote-group button + button {
  border-left: 1px solid var(--border-subtle);
}

.vote-group button.is-active {
  background: rgba(232, 192, 74, 0.15);
  color: var(--spot-gold, #e8c04a);
}

.skill-body {
  margin-top: 1rem;
  padding: 1.1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: calc(var(--radius) + 2px);
  white-space: pre-wrap;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.84rem;
  line-height: 1.5;
  overflow-x: auto;
}

.profile-head {
  margin-bottom: 1.5rem;
}

.profile-head h1 {
  margin: 0 0 0.25rem;
  font-size: 1.55rem;
}

.profile-handle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.profile-bio {
  margin: 0.5rem 0 0.75rem;
  color: var(--text-secondary);
  max-width: 36rem;
  line-height: 1.45;
}

.agent-card {
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: calc(var(--radius) + 2px);
}

.agent-skills {
  margin: 0.5rem 0 0.85rem;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.agent-form {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.agent-form textarea,
.flag-form textarea,
.flag-form select {
  min-height: 2.5rem;
  resize: vertical;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.agent-form textarea {
  min-height: 6rem;
}

.flag-form {
  display: none;
  margin-top: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--surface);
  gap: 0.55rem;
}

.flag-form.is-open {
  display: grid;
}

.empty-msg {
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding: 1.5rem 0;
}

.community-muted {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.community-page .auth-submit,
.community-page .auth-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}
