/* Forum-specific components: the board, discussions and posts, the editor, polls, profiles,
   conversations and events. Colours passed from the server use --c (forums, groups, reactions). */

/* ---------- Small pieces ---------- */
.soft-badge {
  --c: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 12%, transparent);
  color: color-mix(in srgb, var(--c) 78%, var(--text));
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}
.soft-badge svg {
  width: 12px;
  height: 12px;
}
.user-badge {
  --c: var(--text-subtle);
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: color-mix(in srgb, var(--c) 80%, var(--text));
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg-muted);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 550;
}
.tag-chip:hover {
  color: var(--text);
}
.forum-dot {
  --c: var(--brand);
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--c);
}
.online-indicator {
  position: relative;
  display: inline-flex;
  width: 8px;
  height: 8px;
}
.online-indicator::before,
.online-indicator::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #10b981;
}
.online-indicator::before {
  animation: ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
  opacity: 0.6;
}
@keyframes ping {
  75%,
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}
.avatar-wrap {
  position: relative;
  display: inline-flex;
  flex: none;
  vertical-align: middle;
}
.avatar-wrap .presence {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 0 2px var(--surface);
}
.avatar-xs {
  width: 24px !important;
  height: 24px !important;
}
.avatar-md {
  width: 40px !important;
  height: 40px !important;
}
.avatar-xl {
  width: 96px !important;
  height: 96px !important;
  font-size: 32px !important;
}
.meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.meta-line .sep {
  color: var(--text-subtle);
}
.meta-line a:hover {
  color: var(--text);
}
.tabular {
  font-variant-numeric: tabular-nums;
}
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.section-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 650;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.filters .select {
  width: auto;
  height: 34px;
  font-size: 13px;
}
.list-card {
  overflow: hidden;
}
.list-card > * + * {
  border-top: 1px solid var(--border);
}
.list-empty {
  padding: 28px 20px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------- Board ---------- */
.hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
  padding: 28px;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(80% 120% at 100% 0%, var(--brand-soft), transparent 60%);
}
.hero-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.hero h1 {
  margin: 4px 0 6px;
  font-size: 30px;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.hero p {
  margin: 0;
  max-width: 560px;
  color: var(--text-muted);
}
.hero .eyebrow {
  margin: 0;
  padding: 0;
}
.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--border);
}
.stat-strip > div {
  padding: 12px 18px;
  background: var(--surface);
  text-align: center;
}
.stat-strip strong {
  display: block;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-strip span {
  font-size: 12px;
  color: var(--text-muted);
}
.category {
  margin-bottom: 28px;
}
.category-head {
  margin: 0 4px 10px;
}
.category-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}
.category-head p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.forum-icon {
  --c: var(--brand);
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) 12%, transparent);
  color: var(--c);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 20%, transparent);
}
.forum-icon svg {
  width: 20px;
  height: 20px;
}
.forum-icon.sm {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.forum-icon.sm svg {
  width: 16px;
  height: 16px;
}
.forum-icon.lg {
  width: 56px;
  height: 56px;
  border-radius: 16px;
}
.forum-icon.lg svg {
  width: 26px;
  height: 26px;
}
.forum-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  transition: background var(--dur);
}
.forum-row:hover {
  background: var(--bg-subtle);
}
.forum-row-main {
  flex: 1;
  min-width: 0;
}
.forum-row-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 650;
}
.forum-row-title::after {
  content: '';
  position: absolute;
  inset: 0;
}
.forum-row:hover .forum-row-title {
  color: var(--brand-text);
}
.forum-row-desc {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.subforum-chips {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.subforum-chips a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 550;
  color: var(--text-muted);
}
.subforum-chips a:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.subforum-chips svg {
  width: 12px;
  height: 12px;
}
.forum-counts {
  display: grid;
  flex: none;
  grid-template-columns: 1fr 1fr;
  width: 140px;
  text-align: right;
}
.forum-counts strong {
  display: block;
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.forum-counts span {
  font-size: 11px;
  color: var(--text-subtle);
}
.forum-last {
  position: relative;
  z-index: 1;
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  width: 240px;
  padding-left: 18px;
  border-left: 1px solid var(--border);
  font-size: 13px;
}
.forum-last a.title {
  display: block;
  overflow: hidden;
  font-weight: 550;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.forum-last a.title:hover {
  color: var(--brand-text);
}
.side-card {
  padding: 18px;
}
.side-card + .side-card {
  margin-top: 18px;
}
.side-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.side-card-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}
.side-card-head a {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-text);
}
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.activity-list li {
  display: flex;
  gap: 10px;
  min-width: 0;
}
.activity-list a.title {
  font-size: 13px;
  font-weight: 550;
  line-height: 1.35;
}
.activity-list a.title:hover {
  color: var(--brand-text);
}
.avatar-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* Links that only wrap an avatar are flex boxes, so they are exactly the avatar's size (no text-line
   space under it) and avatars line up and scale evenly. */
.avatar-cloud > a,
.poll-voters > a,
.avatar-stack > a {
  display: flex;
}
.avatar-cloud a {
  transition: transform var(--dur);
}
/* "+12" after the avatars when more members are online than are shown. */
.avatar-cloud .avatar-more {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 650;
  color: var(--text-muted);
}
.avatar-cloud a:hover {
  transform: scale(1.1);
}
.forum-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.forum-header .grow {
  min-width: 260px;
}
.forum-rules {
  margin-bottom: 18px;
}
.forum-rules summary {
  cursor: pointer;
  font-weight: 600;
}

/* ---------- Discussion rows ---------- */
.discussion-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 20px;
  transition: background var(--dur);
}
.discussion-row:hover {
  background: var(--bg-subtle);
}
.discussion-row.muted-row {
  background: var(--bg-subtle);
}
.discussion-row .unread-marker {
  position: absolute;
  top: 11px;
  left: 14px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 0 2px var(--surface);
}
.discussion-main {
  flex: 1;
  min-width: 0;
}
.discussion-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 3px;
}
.discussion-badges:empty {
  display: none;
}
.discussion-title {
  display: block;
  font-size: 15px;
  font-weight: 550;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.discussion-title::after {
  content: '';
  position: absolute;
  inset: 0;
}
.discussion-row.unread .discussion-title {
  font-weight: 700;
}
.discussion-row:hover .discussion-title {
  color: var(--brand-text);
}
.discussion-row .meta-line {
  position: relative;
  z-index: 1;
  margin-top: 5px;
}
.discussion-excerpt {
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}
.discussion-counts {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 3px;
  width: 92px;
  font-size: 13px;
  text-align: right;
}
.discussion-counts span {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}
.discussion-counts svg {
  width: 14px;
  height: 14px;
  color: var(--text-subtle);
}
.discussion-last {
  position: relative;
  z-index: 1;
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  width: 190px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
  font-size: 12.5px;
}
.discussion-last strong {
  display: block;
  overflow: hidden;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------- Discussion page ---------- */
.discussion-head {
  margin-bottom: 20px;
}
.discussion-head h1 {
  margin: 6px 0 8px;
  font-size: 28px;
  letter-spacing: -0.025em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.discussion-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.new-posts-banner {
  position: sticky;
  top: calc(var(--header-h) + 10px);
  z-index: 20;
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.posts {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.post {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  overflow: hidden;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.post.highlighted {
  box-shadow: 0 0 0 2px var(--brand), var(--shadow);
}
.post.state-hidden,
.post.state-deleted,
.post.state-pending {
  background: color-mix(in srgb, var(--warning-bg) 40%, var(--surface));
}
.post.is-solution {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--success) 50%, transparent);
}
.post-author {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 14px;
  border-right: 1px solid var(--border);
  background: var(--bg-subtle);
  text-align: center;
}
.post-author .name {
  font-weight: 650;
  overflow-wrap: anywhere;
}
.post-author .name:hover {
  color: var(--brand-text);
}
.post-author .title {
  font-size: 12px;
  color: var(--text-muted);
}
.post-author .badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}
.post-author dl {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 10px;
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-subtle);
}
.post-author dd {
  margin: 0;
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.post-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.post-meta a:hover {
  color: var(--text);
}
.post-content {
  flex: 1;
  padding: 18px 20px;
  overflow-wrap: anywhere;
}
.post-state {
  margin: 14px 20px 0;
}
.post-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 14px;
}
.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}
.attachment-chip:hover {
  border-color: var(--border-strong);
}
.attachment-chip img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
}
.signature {
  margin: 0 20px 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--text-subtle);
  white-space: pre-line;
}
.post-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px 12px 20px;
  border-top: 1px solid var(--border);
}
.post-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}
.post-actions .btn {
  height: 30px;
}
.reactions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.reaction-chip {
  --c: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--dur), background var(--dur);
}
button.reaction-chip:hover {
  border-color: var(--border-strong);
}
.reaction-chip.mine {
  border-color: color-mix(in srgb, var(--c) 50%, transparent);
  background: color-mix(in srgb, var(--c) 12%, transparent);
}
.reaction-picker {
  display: flex;
  gap: 2px;
  padding: 6px !important;
}
.reaction-picker button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  font-size: 20px;
  transition: transform var(--dur), background var(--dur);
}
.reaction-picker button:hover {
  background: var(--bg-hover);
  transform: scale(1.15);
}
.reaction-picker button[aria-pressed='true'] {
  background: var(--brand-soft);
}
.solution-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
  border-radius: var(--radius-lg);
  background: var(--success-bg);
}
.solution-callout svg {
  flex: none;
  color: var(--success);
}
.reply-box {
  margin-top: 22px;
}
.reply-box > .card-body {
  display: flex;
  gap: 16px;
}
.locked-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 16px 20px;
  color: var(--text-muted);
}
.select-post {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}

/* ---------- Rich text editor ---------- */
.rte {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.rte:focus-within {
  border-color: var(--brand);
  box-shadow: var(--focus);
}
.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.rte-toolbar button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
}
.rte-toolbar button:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.rte-toolbar button[aria-pressed='true'] {
  background: var(--brand-soft);
  color: var(--brand-text);
}
.rte-toolbar button svg {
  width: 16px;
  height: 16px;
}
.rte-toolbar .rte-sep {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: var(--border);
}
.rte-content {
  min-height: 160px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 14px 16px;
  outline: none;
}
.rte-content.compact {
  min-height: 90px;
}
.rte-content:empty::before {
  content: attr(data-placeholder);
  color: var(--text-subtle);
  pointer-events: none;
}
.rte-content > :first-child {
  margin-top: 0;
}
.rte-source {
  display: none;
  width: 100%;
  min-height: 160px;
  padding: 14px 16px;
  border: 0;
  background: none;
  font-family: var(--font-mono);
  font-size: 13px;
  resize: vertical;
  outline: none;
}
.rte.source-mode .rte-source {
  display: block;
}
.rte.source-mode .rte-content {
  display: none;
}
.rte-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-subtle);
}
.rte-emoji:not([hidden]) {
  display: grid !important;
}
.rte-emoji {
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  padding: 6px !important;
}
.rte-emoji button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: none;
  font-size: 17px;
}
.rte-emoji button:hover {
  background: var(--bg-hover);
}
.rte-uploading {
  opacity: 0.55;
}
.mention-menu {
  position: absolute;
  z-index: 50;
  min-width: 220px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.mention-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  text-align: left;
  font-size: 13.5px;
}
.mention-menu button[aria-selected='true'],
.mention-menu button:hover {
  background: var(--bg-hover);
}
.chip-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.chip-input:focus-within {
  border-color: var(--brand);
  box-shadow: var(--focus);
}
.chip-input input {
  flex: 1;
  min-width: 120px;
  height: 28px;
  border: 0;
  background: none;
  outline: none;
  font-size: 14px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 4px 0 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-text);
  font-size: 13px;
  font-weight: 550;
}
.chip button {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: inherit;
}
.chip button:hover {
  background: color-mix(in srgb, var(--brand) 20%, transparent);
}

/* ---------- Rendered post content (inside .prose) ---------- */
.prose blockquote.quote {
  margin: 0 0 1em;
  padding: 10px 14px;
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--bg-subtle);
  color: var(--text);
  font-style: normal;
}
.prose blockquote.quote[data-author]::before {
  content: attr(data-author) ' said:';
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-muted);
}
.prose .spoiler {
  position: relative;
  margin: 0 0 1em;
  padding: 10px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
}
.prose .spoiler:not(.revealed) > * {
  filter: blur(6px);
  user-select: none;
}
.prose .spoiler:not(.revealed)::after {
  content: 'Spoiler — click to reveal';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-muted);
}
.prose .spoiler-inline:not(.revealed) {
  background: var(--text);
  color: transparent;
  border-radius: 3px;
  cursor: pointer;
}
.prose a.mention {
  padding: 0 3px;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand-text);
  font-weight: 600;
  text-decoration: none;
}
.prose iframe {
  width: 100%;
  max-width: 640px;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: var(--radius);
}
.prose div.media-embed {
  margin: 0 0 1em;
}
.prose img {
  height: auto;
  border-radius: var(--radius);
}
.prose mark {
  padding: 0 2px;
  border-radius: 3px;
  background: color-mix(in srgb, #facc15 45%, transparent);
  color: inherit;
}
.post-content.prose,
.message-content.prose {
  font-size: 15px;
}
.post-content.prose > :last-child,
.message-content.prose > :last-child {
  margin-bottom: 0;
}

/* ---------- Polls ---------- */
.poll {
  margin-bottom: 18px;
  padding: 18px 20px;
}
.poll h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 16px;
}
.poll-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}
.poll-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}
.poll-option .bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--brand-soft);
  transition: width 400ms var(--ease);
}
.poll-option.mine {
  border-color: var(--brand-border);
}
.poll-option > :not(.bar) {
  position: relative;
}
.poll-option .pct {
  margin-left: auto;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.poll-voters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

/* ---------- Profiles & members ---------- */
.profile-card {
  overflow: hidden;
  margin-bottom: 22px;
}
.profile-banner {
  height: 180px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  background-size: cover;
  background-position: center;
}
.profile-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 18px;
  margin-top: -48px;
  padding: 0 24px 20px;
}
.profile-head .avatar {
  box-shadow: 0 0 0 4px var(--surface);
}
.profile-head h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
}
.profile-stats div strong {
  display: block;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.profile-stats div span {
  font-size: 12px;
  color: var(--text-muted);
}
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.achievement {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
}
.achievement.locked {
  opacity: 0.6;
}
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.member-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  transition: border-color var(--dur), transform var(--dur);
}
.member-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.member-card .name {
  font-weight: 650;
}

/* ---------- Conversations ---------- */
.conv-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
}
.conv-row:hover {
  background: var(--bg-subtle);
}
.conv-row.unread .conv-title {
  font-weight: 700;
}
.conv-title::after {
  content: '';
  position: absolute;
  inset: 0;
}
.avatar-stack {
  display: flex;
  flex: none;
}
.avatar-stack > * + * {
  margin-left: -10px;
}
.avatar-stack .avatar {
  box-shadow: 0 0 0 2px var(--surface);
}
.chat {
  display: flex;
  flex-direction: column;
  min-height: 60vh;
}
.chat-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}
.message {
  display: flex;
  gap: 10px;
  max-width: 82%;
}
.message.mine {
  flex-direction: row-reverse;
  align-self: flex-end;
}
.message-bubble {
  min-width: 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--bg-muted);
}
.message.mine .message-bubble {
  background: var(--brand-soft);
}
.message-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--text-subtle);
}
.message.deleted .message-bubble {
  font-style: italic;
  color: var(--text-subtle);
}
.chat-composer {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
}
.typing-indicator {
  min-height: 18px;
  padding: 0 20px 6px;
  font-size: 12.5px;
  color: var(--text-subtle);
}

/* ---------- Events ---------- */
.event-card {
  display: flex;
  gap: 16px;
  padding: 16px 18px;
}
.event-date {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 64px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-text);
  line-height: 1.1;
}
.event-date .m {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.event-date .d {
  font-size: 22px;
  font-weight: 750;
}
.event-image {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
}

/* ---------- Auth ---------- */
.auth-card {
  padding: 28px;
}
.auth-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  font-size: 12px;
  color: var(--text-subtle);
}
.or-divider::before,
.or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.code-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-muted);
  font-family: var(--font-mono);
  font-size: 14px;
  text-align: center;
}
.qr-box {
  display: inline-block;
  padding: 10px;
  border-radius: var(--radius);
  background: #fff;
}
.qr-box svg {
  display: block;
  width: 180px;
  height: 180px;
}

/* ---------- Moderation ---------- */
.snapshot {
  max-height: 420px;
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.snapshot .reported {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--warning-bg);
}
.note-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.note {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--bg-muted);
  font-size: 13.5px;
  white-space: pre-line;
}
.note.system {
  background: none;
  border: 1px dashed var(--border);
  color: var(--text-muted);
}
.queue-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
/* Centred row (control panel dashboard): tiles keep their width and the row sits in the middle,
   wrapping to further centred rows on narrow screens. */
.queue-tiles.centered {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.queue-tiles.centered > * {
  flex: 0 1 236px;
  min-width: 200px;
}
.queue-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}
.queue-tile:hover {
  border-color: var(--border-strong);
}
.queue-tile strong {
  display: block;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.perm-matrix th,
.perm-matrix td {
  padding: 6px 8px;
  white-space: nowrap;
}
.perm-matrix select {
  width: 92px;
  height: 30px;
  font-size: 12px;
}
.perm-matrix select[data-value='1'] {
  color: var(--success);
}
.perm-matrix select[data-value='-1'] {
  color: var(--danger);
}
.perm-matrix select[data-value='0'] {
  color: var(--warning);
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .forum-last,
  .discussion-last {
    display: none;
  }
}
@media (max-width: 760px) {
  .forum-counts,
  .discussion-counts .views {
    display: none;
  }
  .discussion-counts {
    width: auto;
  }
  .discussion-row .avatar-wrap {
    display: none;
  }
  .post {
    grid-template-columns: minmax(0, 1fr);
  }
  .post-author {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    text-align: left;
  }
  .post-author dl,
  .post-author .title {
    display: none;
  }
  .post-content,
  .post-meta {
    padding-left: 16px;
    padding-right: 16px;
  }
  .reply-box > .card-body > .avatar-wrap {
    display: none;
  }
  .hero {
    padding: 20px;
  }
  .hero h1 {
    font-size: 24px;
  }
  .stat-strip {
    width: 100%;
  }
  .message {
    max-width: 95%;
  }
  .profile-banner {
    height: 120px;
  }
}
