/**
 * Forumax Extension — Forums listing, statistics, and recent topics.
 * Loaded when the forum index / stats widget / recent-topics shortcode renders.
 */

/* =====================================================================
 * Latest-topics feed ([forumax_ext_latest_topics]) — tag tabs + list.
 * ===================================================================== */
.fmxext-feed {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.fmxext-feed-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.fmxext-feed-tab {
	display: inline-flex;
	align-items: center;
	padding: 0.45rem 1rem;
	border: 1px solid #e4e9ee;
	border-radius: 999px;
	background: #fff;
	color: #475467;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.2;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.fmxext-feed-tab:hover {
	border-color: #98a2b3;
	color: #101828;
}

.fmxext-feed-tab.is-active,
.fmxext-feed-tab.is-active:hover {
	background: var(--bbpc_brand_color, #0e9384);
	border-color: var(--bbpc_brand_color, #0e9384);
	color: #fff;
}

/* List card */
.fmxext-feed-list {
	background: #fff;
	border: 1px solid #e4e9ee;
	border-radius: 14px;
	overflow: hidden;
}

/* Brief dimmed state while the AJAX tag filter swaps the list. */
.fmxext-feed-body.is-loading {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.fmxext-feed-row {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	padding: 1.1rem 1.5rem;
	border-bottom: 1px solid #eef1f4;
}

.fmxext-feed-row:last-child {
	border-bottom: 0;
}

.fmxext-feed-avatar img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: block;
	margin: 0;
}

.fmxext-feed-main {
	flex: 1 1 auto;
	min-width: 0;
}

.fmxext-feed-badges {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: 0.35rem;
}

.fmxext-feed-tag {
	display: inline-flex;
	align-items: center;
	padding: 0.15rem 0.6rem;
	border-radius: 6px;
	font-size: 0.75rem;
	font-weight: 700;
	text-decoration: none;
	line-height: 1.5;
}

.fmxext-feed-solved {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.8rem;
	font-weight: 600;
	color: #087443;
}

.fmxext-feed-title {
	display: block;
	font-size: 1rem;
	font-weight: 700;
	color: #101828;
	text-decoration: none;
	line-height: 1.4;
}

.fmxext-feed-title:hover {
	color: var(--bbpc_brand_color, #0e9384);
}

.fmxext-feed-meta {
	margin-top: 0.25rem;
	font-size: 0.82rem;
	color: #667085;
}

.fmxext-feed-dot {
	margin: 0 0.35rem;
	color: #cbd5e1;
}

/* The compact "2h ago" time is shown on mobile only (see media query below). */
.fmxext-feed-time--compact {
	display: none;
}

.fmxext-feed-stats {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	flex: 0 0 auto;
	padding-top: 0.15rem;
}

.fmxext-feed-stat {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.85rem;
	color: #667085;
}

.fmxext-feed-empty {
	background: #fff;
	border: 1px solid #e4e9ee;
	border-radius: 14px;
	padding: 2rem;
	text-align: center;
	color: #667085;
}

@media (max-width: 576px) {
	/* Keep the avatar beside the content (a tight, single-row card) rather than
	 * letting it wrap onto its own line. */
	.fmxext-feed-row {
		gap: 0.75rem;
		padding: 0.85rem 1rem;
		align-items: flex-start;
	}

	.fmxext-feed-avatar img {
		width: 36px;
		height: 36px;
	}

	.fmxext-feed-badges {
		gap: 0.45rem;
		margin-bottom: 0.25rem;
	}

	/* Title clamps to a single line so every row stays a uniform height. */
	.fmxext-feed-title {
		font-size: 0.95rem;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.fmxext-feed-meta {
		font-size: 0.8rem;
	}

	/* Drop the reply/view stats and swap the verbose time for the compact form. */
	.fmxext-feed-stats {
		display: none;
	}

	.fmxext-feed-time--full {
		display: none;
	}

	.fmxext-feed-time--compact {
		display: inline;
	}
}

.fmxext-forums {
	--fmxext-accent: #0e9384;
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

.fmxext-forums *,
.fmxext-forums *::before,
.fmxext-forums *::after {
	box-sizing: border-box;
}

/* ---- Group ---- */
.fmxext-forum-group-title {
	margin: 0 0 0.75rem;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #667085;
}

.fmxext-forum-group-title a {
	color: inherit;
	text-decoration: none;
}

.fmxext-forum-group-title a:hover {
	color: var(--fmxext-accent);
}

/* Each group's rows share one card with dividers (no gaps between rows). */
.fmxext-forum-rows {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid rgba(16, 24, 40, 0.08);
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
	overflow: hidden;
}

/* ---- Row ---- */
.fmxext-forum-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 90px 90px minmax(0, 18rem);
	align-items: center;
	gap: 1.25rem;
	padding: 1.1rem 1.25rem;
	border-bottom: 1px solid rgba(16, 24, 40, 0.08);
}

.fmxext-forum-row:last-child {
	border-bottom: 0;
}

.fmxext-forum-main {
	display: flex;
	align-items: flex-start;
	gap: 0.9rem;
	min-width: 0;
}

.fmxext-forum-icon {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	background: #e9f7f3;
	color: var(--fmxext-accent);
	overflow: hidden;
}

.fmxext-forum-icon img {
	width: 22px;
	height: 22px;
	object-fit: contain;
}

.fmxext-forum-icon svg {
	width: 20px;
	height: 20px;
}

.fmxext-forum-name {
	display: block;
	font-weight: 600;
	color: #111827;
	text-decoration: none;
}

.fmxext-forum-name:hover {
	color: var(--fmxext-accent);
}

.fmxext-forum-desc {
	margin: 0.2rem 0 0;
	font-size: 0.85rem;
	line-height: 1.4;
	color: #667085;
}

.fmxext-forum-stat {
	text-align: center;
}

.fmxext-forum-stat strong {
	display: block;
	font-size: 1rem;
	font-weight: 700;
	color: #111827;
}

.fmxext-forum-stat span {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #98a2b3;
}

.fmxext-forum-latest {
	min-width: 0;
	font-size: 0.85rem;
}

.fmxext-forum-latest-title {
	display: block;
	color: #111827;
	font-weight: 500;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.fmxext-forum-latest-title:hover {
	color: var(--fmxext-accent);
}

.fmxext-forum-latest-meta {
	margin-top: 0.2rem;
	color: #98a2b3;
	font-size: 0.8rem;
}

.fmxext-forum-latest-meta a {
	color: #667085;
	text-decoration: none;
}

.fmxext-dot {
	margin: 0 0.35rem;
	color: #d0d5dd;
}

@media (max-width: 782px) {
	.fmxext-forum-row {
		grid-template-columns: 1fr auto;
		grid-template-areas:
			"main main"
			"topics replies"
			"latest latest";
		gap: 0.75rem;
	}

	.fmxext-forum-main {
		grid-area: main;
	}

	.fmxext-forum-latest {
		grid-area: latest;
	}
}

/* On phones, reduce each forum to icon + title + description (drop the
 * topic/reply counts and the last-topic line for a clean, compact list). */
@media (max-width: 576px) {
	.fmxext-forum-row {
		display: flex;
		align-items: flex-start;
		gap: 0;
		padding: 1rem 1.1rem;
	}

	.fmxext-forum-main {
		flex: 1 1 auto;
	}

	.fmxext-forum-stat,
	.fmxext-forum-latest {
		display: none;
	}
}

/* ---- Shared widget heading (stats + recent topics) ---- */
.fmxext-widget-head {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 1rem;
}

.fmxext-widget-head-icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #0e9384;
}

.fmxext-widget-head-icon svg {
	display: block;
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
}

/* Cross-browser guard: keep every icon SVG at its CSS size (Chrome otherwise
 * expands inline SVGs that lack intrinsic sizing). */
.fmxext-stat-icon svg,
.fmxext-forum-icon svg,
.fmxext-widget-head-icon svg {
	display: block;
	max-width: 100%;
	flex: 0 0 auto;
}

.fmxext-widget-head-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.2;
	color: #111827;
}

/* ---- Forum statistics widget ---- */
.fmxext-stats-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Two-class selector (0,2,0) to beat Oxygen's `:is(li,...) { display:list-item }` (0,1,0). */
.fmxext-stats-list .fmxext-stat-row {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.6rem 0;
	border-bottom: 1px solid #eef1f4;
}

.fmxext-stats-list .fmxext-stat-row:last-child {
	border-bottom: 0;
}

.fmxext-stat-icon {
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	background: #e9f7f3;
	color: #0e9384;
	overflow: hidden;
}

.fmxext-stat-icon svg {
	width: 16px;
	height: 16px;
}

.fmxext-stat-name {
	flex: 1 1 auto;
	color: #475467;
}

.fmxext-stat-num {
	font-weight: 700;
	color: #111827;
}

.fmxext-stats-newest {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-top: 0.85rem;
	padding-top: 0.85rem;
	border-top: 1px solid #eef1f4;
}

.fmxext-stats-newest-avatar img {
	width: 32px;
	height: 32px;
	border-radius: 50%;
}

.fmxext-stats-newest-label {
	display: block;
	font-size: 0.75rem;
	color: #98a2b3;
}

.fmxext-stats-newest-text a {
	color: #0e9384;
	text-decoration: none;
	font-weight: 600;
}

/* ---- Single forum header: breadcrumbs ---- */
.fmxext-breadcrumbs {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.4rem;
	font-size: 0.82rem;
	color: #667085;
}

.fmxext-breadcrumbs-link {
	color: #667085;
	text-decoration: none;
}

.fmxext-breadcrumbs-link:hover {
	color: #0e9384;
}

.fmxext-breadcrumbs-sep {
	color: #cbd5e1;
}

.fmxext-breadcrumbs-current {
	color: #111827;
	font-weight: 600;
}

/* Muted current crumb (e.g. the tag on a topic-tag page, since the tag is
 * already shown as the page heading below). */
.fmxext-breadcrumbs-current--muted {
	color: #98a2b3;
	font-weight: 500;
}

/* ---- Login / register buttons (replaces the inline login form in prompts) ---- */
/* Full-width prompt with centered title, subtitle and buttons. */
.frmx-inline-login-prompt {
	width: 100%;
	max-width: none !important; /* remove Forumax's max-width so it fills the container */
	text-align: center;
}

.fmxext-login-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1rem;
	justify-content: center;
}

.fmxext-login-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	min-width: 150px;
	padding: 12px 24px;
	border-radius: 8px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	line-height: 1.2;
}

.fmxext-login-btn--primary,
.fmxext-login-btn--primary:hover {
	background: var(--bbpc_brand_color, #0e9384);
	color: #fff;
}

.fmxext-login-btn--primary:hover {
	filter: brightness( 0.95 );
}

.fmxext-login-btn--secondary {
	background: #fff;
	border: 1px solid #d0d5dd;
	color: #344054;
}

.fmxext-login-btn--secondary:hover {
	background: #f9fafb;
	border-color: #98a2b3;
	color: #344054;
}

/* ---- "Posting in <icon> <forum>" sub-heading (new-topic page) ---- */
.fmxext-posting-in {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	color: #667085;
}

.fmxext-posting-in-icon {
	display: inline-flex;
	align-items: center;
	color: #0e9384;
}

.fmxext-posting-in .fmxext-forum-title-link,
.fmxext-posting-in .fmxext-forum-title-link:hover {
	color: #0e9384;
	font-weight: 600;
	text-decoration: none;
}

.fmxext-posting-in .fmxext-forum-title-link:hover {
	text-decoration: underline;
}

/* ---- Single forum header: meta row ---- */
.fmxext-forum-meta {
	list-style: none;
	margin: 0.75rem 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	font-size: 0.85rem;
	color: #667085;
}

/* Two-class (0,2,0) to beat Oxygen's :is(li, div._important) (0,1,1). */
.fmxext-forum-meta .fmxext-forum-meta-item {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.fmxext-forum-meta svg {
	display: block;
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	color: #98a2b3;
}

/* ---- Subscription link styled as an outline button ---- */
a.subscription-toggle,
#subscription-toggle a {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 12px 18px;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	background: #fff;
	color: #344054;
	font-weight: 600;
	font-size: 0.9rem;
	line-height: 1;
	text-decoration: none;
}

a.subscription-toggle:hover,
#subscription-toggle a:hover {
	background: #f9fafb;
	border-color: #98a2b3;
}

a.subscription-toggle::before,
#subscription-toggle a::before {
	content: "";
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475467' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.7 21a2 2 0 0 1-3.4 0'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ---- Single forum sidebar cards ---- */
.fmxext-side-card {
	background: #fff;
	border: 1px solid rgba(16, 24, 40, 0.08);
	border-radius: 14px;
	padding: 1.25rem 1.5rem;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.fmxext-side-card + .fmxext-side-card {
	margin-top: 1.5rem;
}

.fmxext-side-title {
	margin: 0 0 1rem;
	font-size: 1rem;
	font-weight: 700;
	color: #111827;
}

/* About this category */
.fmxext-about-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Two-class (0,2,0) to beat Oxygen's :is(li, div._important). */
.fmxext-about-list .fmxext-about-row {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.7rem 0;
	border-bottom: 1px solid #eef1f4;
}

.fmxext-about-list .fmxext-about-row:last-child {
	border-bottom: 0;
}

.fmxext-about-icon {
	display: flex;
	flex: 0 0 auto;
	color: #98a2b3;
}

.fmxext-about-icon svg {
	display: block;
	width: 18px;
	height: 18px;
}

.fmxext-about-label {
	flex: 1 1 auto;
	color: #475467;
}

.fmxext-about-value {
	font-weight: 700;
	color: #111827;
}

/* About this topic — participant avatars */
.fmxext-topic-participants {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin-top: 1rem;
}

.fmxext-participant {
	margin-left: -8px;
}

.fmxext-participant:first-child {
	margin-left: 0;
}

.fmxext-participant img {
	display: block;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-sizing: content-box;
}

.fmxext-participant-more {
	margin-left: 0.6rem;
	font-size: 0.78rem;
	font-weight: 600;
	color: #667085;
}

/* Related topics */
.fmxext-related-list {
	display: flex;
	flex-direction: column;
}

.fmxext-related-item {
	display: flex;
	gap: 0.6rem;
	padding: 0.7rem 0;
	border-bottom: 1px solid #eef1f4;
}

.fmxext-related-item:last-child {
	border-bottom: 0;
}

.fmxext-related-icon {
	flex: 0 0 auto;
	color: #98a2b3;
	margin-top: 2px;
}

.fmxext-related-icon svg {
	display: block;
}

.fmxext-related-link {
	color: #111827;
	font-weight: 600;
	line-height: 1.35;
	text-decoration: none;
}

.fmxext-related-link:hover {
	color: #0e9384;
}

/* Top contributors */
.fmxext-contributors {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fmxext-contributors .fmxext-contributor {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 0;
	border-bottom: 1px solid #eef1f4;
}

.fmxext-contributors .fmxext-contributor:last-child {
	border-bottom: 0;
}

.fmxext-contributor-avatar img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
}

.fmxext-contributor-info {
	flex: 1 1 auto;
	min-width: 0;
}

.fmxext-contributor-name {
	display: block;
	font-weight: 600;
	color: #111827;
	text-decoration: none;
}

.fmxext-contributor-name:hover {
	color: #0e9384;
}

.fmxext-contributor-role {
	font-size: 0.8rem;
	color: #98a2b3;
}

.fmxext-contributor-count {
	flex: 0 0 auto;
	text-align: right;
}

.fmxext-contributor-count strong {
	display: block;
	color: #0e9384;
	font-weight: 700;
}

.fmxext-contributor-count span {
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #98a2b3;
}

/* Editor toolbar separators: Forumax draws them as an inline-block ::after on
 * each .mce-btn-group, which drops below the buttons because the flow-layout
 * item is inline-block. Make the item inline-flex and nudge the separator down. */
.fmxext-topic-lead .mce-flow-layout-item,
.frmx-inline-edit-content .mce-flow-layout-item {
	display: inline-flex !important;
}

.fmxext-topic-lead .mce-btn-group::after,
.frmx-inline-edit-content .mce-btn-group::after {
	margin-top: 4px !important;
}

/* ---- Single topic: inline edit (content only) ---- */
/* The title hook exists only so Forumax's inline editor can preserve the title
 * on save; it's never shown (the title lives in the header). */
.fmxext-topic-lead .q-title {
	display: none;
}

/* Reveal the title field only while editing (title otherwise lives in header). */
.fmxext-topic-lead.frmx-is-editing .q-title {
	display: block;
	margin-bottom: 1rem;
	padding: 0;
}

/* No horizontal padding on the title wrapper so it matches the content width. */
.fmxext-topic-lead .frmx-inline-edit-title {
	margin: 0;
	padding: 0;
}

.fmxext-topic-lead .frmx-edit-title-input {
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 0.6rem 0.8rem;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	font-size: 1.3rem;
	font-weight: 700;
	color: #111827;
}


.fmxext-topic-lead .frmx-edit-content-textarea {
	width: 100%;
	min-height: 220px;
	padding: 0.75rem;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	font: inherit;
}

.fmxext-topic-lead .frmx-inline-edit-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.75rem;
	margin-top: 1.25rem;
}

/* DOM order is Save, Cancel; display Cancel first with Save on the far right. */
.fmxext-topic-lead .frmx-edit-cancel {
	order: 1;
}

.fmxext-topic-lead .frmx-edit-save {
	order: 2;
}

.fmxext-topic-lead .frmx-edit-save,
.fmxext-topic-lead .frmx-edit-cancel {
	padding: 0.6rem 1.1rem;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.9rem;
	cursor: pointer;
	border: 1px solid transparent;
}

.fmxext-topic-lead .frmx-edit-save {
	background: #0e9384;
	color: #fff;
}

.fmxext-topic-lead .frmx-edit-cancel {
	background: #fff;
	border-color: #d0d5dd;
	color: #344054;
}

/* ---- Topic merge / split forms ---- */
.fmxext-topic-form-card {
	background: #fff;
	border: 1px solid rgba(16, 24, 40, 0.08);
	border-radius: 14px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
	padding: 1.75rem;
}

/* Neutralize bbPress's own wrappers so we don't get a nested box/shadow. */
.fmxext-topic-form-card #bbpress-forums,
.fmxext-topic-form-card .bbpress-wrapper,
.fmxext-topic-form-card #bbpress-forums .bbp-topic-merge,
.fmxext-topic-form-card #bbpress-forums .bbp-topic-split {
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
}

.fmxext-topic-form-card #bbpress-forums fieldset.bbp-form {
	border: 0;
	margin: 0 0 1.25rem;
	padding: 0;
	box-shadow: none;
	background: transparent;
}

.fmxext-topic-form-card fieldset.bbp-form:last-of-type {
	margin-bottom: 0;
}

.fmxext-topic-form-card legend {
	display: block;
	width: 100%;
	margin: 0 0 0.75rem;
	padding: 0;
	font-size: 1.05rem;
	font-weight: 700;
	color: #111827;
}

/* Outer legend = the form title, larger. */
.fmxext-topic-form-card form > fieldset.bbp-form > legend {
	font-size: 1.4rem;
	margin-bottom: 1rem;
}

.fmxext-topic-form-card select,
.fmxext-topic-form-card input[type="text"] {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 0.6rem 0.8rem;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	background: #fff;
	font: inherit;
}

/* #bbpress-forums prefix to beat bbPress's id-scoped rules. */
.fmxext-topic-form-card #bbpress-forums .bbp-submit-wrapper {
	display: flex !important;
	flex-direction: row !important;
	justify-content: flex-end !important;
	align-items: center !important;
	width: 100%;
	gap: 0.75rem;
	margin-top: 1.5rem;
	text-align: right;
}

.fmxext-topic-form-card #bbpress-forums .button.submit,
.fmxext-topic-form-card #bbpress-forums .fmxext-form-cancel {
	margin: 0;
	padding: 0.6rem 1.1rem;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.9rem;
	line-height: 1.2;
	cursor: pointer;
	border: 1px solid transparent;
	text-decoration: none;
}

.fmxext-topic-form-card #bbpress-forums .button.submit {
	background: #0e9384;
	color: #fff;
}

.fmxext-topic-form-card #bbpress-forums .fmxext-form-cancel {
	background: #fff;
	border-color: #d0d5dd;
	color: #344054;
}

/* ---- Single topic: lead (description) box ---- */
.fmxext-topic-lead {
	background: #fff;
	border: 1px solid rgba(16, 24, 40, 0.08);
	border-radius: 14px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
	padding: 1.75rem;
}

.fmxext-topic-lead-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid #eef1f4;
}

.fmxext-topic-author {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-width: 0;
}

.fmxext-topic-author-avatar img {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: block;
}

.fmxext-topic-author-line {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	font-weight: 700;
	color: #111827;
}

.fmxext-topic-author-line a {
	color: inherit;
	text-decoration: none;
}

.fmxext-topic-author-meta {
	margin-top: 0.15rem;
	font-size: 0.82rem;
	color: #98a2b3;
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.fmxext-topic-author-meta a {
	color: #0e9384;
	text-decoration: none;
}

.fmxext-topic-head-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex: 0 0 auto;
}

/* Equal height for reactions, subscribe, and the topic menu trigger. */
.fmxext-topic-head-actions .forumax-reactions-wrapper {
	display: inline-flex;
	align-items: center;
}

.fmxext-topic-head-actions a.subscription-toggle,
.fmxext-topic-head-actions .forumax-main-react-btn,
.fmxext-topic-head-actions .frmx-nice-select,
.fmxext-topic-head-actions .bbp-admin-links-dropdown .frmx-nice-select {
	height: 40px;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
}

/* On phones, declutter the header: author details on their own row, with the
 * reaction / subscribe / menu actions moved below (left-aligned). */
@media (max-width: 576px) {
	.fmxext-topic-lead-head {
		flex-direction: column;
		align-items: stretch;
		gap: 0.85rem;
	}

	.fmxext-topic-head-actions {
		flex-wrap: wrap;
		justify-content: flex-start;
	}
}

.fmxext-topic-lead-title {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	margin: 1.25rem 0 1rem;
	font-size: 1.6rem;
	line-height: 1.25;
	font-weight: 800;
	color: #111827;
}

.fmxext-topic-q {
	color: #98a2b3;
	font-weight: 700;
}

.fmxext-topic-lead-content {
	color: #344054;
	line-height: 1.65;
}

.fmxext-topic-lead-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid #eef1f4;
}

.fmxext-topic-lead-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1rem;
}

.fmxext-topic-tags-line {
	font-size: 0.85rem;
	color: #667085;
}

.fmxext-topic-tags-line .tags-label {
	font-weight: 600;
	margin-right: 0.25rem;
}

.fmxext-topic-footer-right {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-left: auto;
}

/* Voting — inline pill: clean arrow to the left of the count. */
.fmxext-topic-footer-left {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

/* Reply action button (pill next to the voting control). */
.fmxext-reply-action-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.5rem 0.95rem;
	border: 1px solid #d0d5dd;
	border-radius: 999px;
	background: transparent;
	color: #344054;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
}

.fmxext-reply-action-btn:hover {
	background: #f9fafb;
	border-color: #98a2b3;
	color: #344054;
}

/* Uniform height for every footer pill (voting, reply, share) so they line up
 * and match the reply button — vertical padding is normalized to a fixed box. */
.fmxext-topic-footer-left .bbp-voting,
.fmxext-reply-footer-left .bbp-voting,
.fmxext-reply-action-btn,
.fmxext-reply-footer .frmx-nested-reply-action a,
.fmxext-reply-footer-left .bbp-reply-to-link,
.fmxext-reply-share,
.fmxext-topic-footer-right .forumax-share-btn {
	height: 34px;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	box-sizing: border-box;
	line-height: 1;
}

.fmxext-topic-footer-left .bbp-voting {
	/* Neutralize Forumax's absolute/negative positioning (floating-column layout). */
	position: static !important;
	inset: auto !important;
	left: auto !important;
	top: auto !important;
	float: none !important;
	margin: 0 !important;
	/* Inline pill, arrow beside the count (row, not stacked). */
	display: inline-flex;
	flex-direction: row;
	align-items: center;
	gap: 0.4rem;
	padding: 0.35rem 0.75rem;
	border: 1px solid #d0d5dd;
	border-radius: 999px;
	line-height: 1;
	cursor: pointer;
}

.fmxext-topic-footer-left .bbp-voting:hover {
	border-color: #98a2b3;
}

.fmxext-topic-footer-left .bbp-voting .score {
	cursor: pointer;
}

.fmxext-topic-footer-left .bbp-voting .bbp-voting-label {
	display: none;
}

.fmxext-topic-footer-left .bbp-voting a.vote {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	font-size: 0;
	color: transparent;
	background-color: transparent;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 24px 24px;
}

.fmxext-topic-footer-left .bbp-voting a.vote::before,
.fmxext-topic-footer-left .bbp-voting a.vote::after {
	content: none !important;
	display: none !important;
}

/* Kill Forumax's CSS border-triangle (higher specificity than its !important
 * rules, including the :hover variant). */
.fmxext-topic-footer-left .bbp-voting a.vote.up,
.fmxext-topic-footer-left .bbp-voting a.vote.down,
.fmxext-topic-footer-left .bbp-voting a.vote.up:hover,
.fmxext-topic-footer-left .bbp-voting a.vote.down:hover {
	border: 0 !important;
}

.fmxext-topic-footer-left .bbp-voting a.vote.up {
	background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475467' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 18v-6H5l7-7 7 7h-4v6H9z'/></svg>") !important;
}

/* Upvoted state: fill the arrow solid and tint teal. */
.fmxext-topic-footer-left .bbp-voting.voted-up a.vote.up {
	background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%230e9384' stroke='%230e9384' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 18v-6H5l7-7 7 7h-4v6H9z'/></svg>") !important;
}

.fmxext-topic-footer-left .bbp-voting.voted-up {
	border-color: #0e9384;
}

.fmxext-topic-footer-left .bbp-voting.voted-up .score {
	color: #0e9384;
}

.fmxext-topic-footer-left .bbp-voting a.vote.down {
	background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475467' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><line x1='12' y1='5' x2='12' y2='18'/><polyline points='6 12 12 18 18 12'/></svg>") !important;
}

.fmxext-topic-footer-left .bbp-voting .score {
	font-size: 0.9rem;
	font-weight: 700;
	color: #111827;
}

/* Share as a bordered pill. */
.fmxext-topic-footer-right .forumax-share-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.5rem 0.95rem;
	border: 1px solid #d0d5dd;
	border-radius: 999px;
	color: #344054;
	font-weight: 500;
	text-decoration: none;
}

.fmxext-topic-footer-right .forumax-share-btn,
.fmxext-topic-footer-right .forumax-share-btn:hover {
	color: #344054;
}

.fmxext-topic-footer-right .forumax-share-btn:hover {
	background: #f9fafb;
	border-color: #98a2b3;
}

/* Replace the filled share glyph with a clean share icon. */
.fmxext-topic-footer-right .forumax-share-btn i {
	display: none;
}

.fmxext-topic-footer-right .forumax-share-btn::before {
	content: "";
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
	background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23344054' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='18' cy='5' r='3'/><circle cx='6' cy='12' r='3'/><circle cx='18' cy='19' r='3'/><line x1='8.59' y1='13.51' x2='15.42' y2='17.49'/><line x1='15.41' y1='6.51' x2='8.59' y2='10.49'/></svg>") no-repeat center / contain;
}

/* ---- Single topic header ---- */
.fmxext-topic-status {
	margin-right: 0.5rem;
}

.fmxext-topic-tag-list {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	vertical-align: middle;
}

.fmxext-topic-header-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.9rem;
	color: #667085;
}

.fmxext-topic-header-author {
	color: #344054;
	font-weight: 600;
	text-decoration: none;
}

.fmxext-topic-header-author:hover {
	color: #0e9384;
}

.fmxext-topic-header-stat {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.fmxext-topic-header-stat svg {
	display: block;
	flex: 0 0 auto;
	color: #98a2b3;
}

/* ---- Sub-forums section (below topics on a single forum) ---- */
.fmxext-subforums {
	margin-top: 2rem;
}

.fmxext-subforums-title {
	margin: 0 0 0.75rem;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #667085;
}

/* ---- Topics listing (single forum) ---- */
.fmxext-topics {
	--fmxext-accent: #0e9384;
}

.fmxext-topics *,
.fmxext-topics *::before,
.fmxext-topics *::after {
	box-sizing: border-box;
}

.fmxext-topics-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.fmxext-topics-left {
	display: flex;
	align-items: center;
	gap: 0.85rem;
}

.fmxext-topic-tabs {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	background: #eef1f4;
	border-radius: 10px;
	padding: 0.25rem;
}

.fmxext-topic-tab {
	padding: 0.4rem 0.9rem;
	border-radius: 8px;
	font-size: 0.85rem;
	font-weight: 600;
	color: #667085;
	text-decoration: none;
}

.fmxext-topic-tab:hover {
	color: #111827;
}

.fmxext-topic-tab.is-active {
	background: #fff;
	color: #111827;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.fmxext-topics-count {
	font-size: 0.82rem;
	color: #98a2b3;
}

.fmxext-topics-sort {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.85rem;
	color: #667085;
}

.fmxext-topics-sort select {
	padding: 0.45rem 0.7rem;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	background: #fff;
	font: inherit;
	color: #111827;
}

/* List container: one card, rows divided. */
.fmxext-topics-list {
	background: #fff;
	border: 1px solid rgba(16, 24, 40, 0.08);
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
	overflow: hidden;
}

.fmxext-topic-row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) 80px 80px minmax(0, 12rem);
	align-items: center;
	gap: 1.25rem;
	padding: 1.1rem 1.25rem;
	border-bottom: 1px solid #eef1f4;
}

.fmxext-topic-row:last-child {
	border-bottom: 0;
}

.fmxext-topic-avatar img {
	width: 44px;
	height: 44px;
	border-radius: 50%;
}

.fmxext-topic-main {
	min-width: 0;
}

.fmxext-topic-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-bottom: 0.35rem;
}

.fmxext-badge {
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	gap: 0.25rem;
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	font-size: 0.72rem;
	line-height: 1.5;
	font-weight: 600;
}

.fmxext-badge--pinned {
	background: #ede9fe;
	color: #6d28d9;
}

.fmxext-badge--solved {
	background: #d8f3ec;
	color: #0e7a6e;
}

.fmxext-badge--unanswered {
	background: #fef3e2;
	color: #b45309;
}

.fmxext-topic-title {
	display: block;
	font-size: 1rem;
	font-weight: 600;
	color: #111827;
	text-decoration: none;
	line-height: 1.35;
}

.fmxext-topic-title:hover {
	color: var(--fmxext-accent);
}

.fmxext-topic-meta {
	margin-top: 0.3rem;
	font-size: 0.82rem;
	color: #98a2b3;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.fmxext-topic-author {
	color: #475467;
	font-weight: 500;
}

.fmxext-topic-tags {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.3rem;
}

.fmxext-topic-stat {
	text-align: center;
}

.fmxext-topic-stat strong {
	display: block;
	font-size: 0.95rem;
	font-weight: 700;
	color: #111827;
}

.fmxext-topic-stat span {
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #98a2b3;
}

.fmxext-topic-last {
	min-width: 0;
	font-size: 0.82rem;
}

.fmxext-topic-last-label {
	display: block;
	color: #667085;
}

.fmxext-topic-last-meta {
	color: #98a2b3;
}

.fmxext-topic-be-first {
	color: #b45309;
	font-weight: 600;
	text-decoration: none;
}

.fmxext-topics-pagination {
	display: flex;
	justify-content: center;
	gap: 0.35rem;
	margin-top: 1.5rem;
}

.fmxext-topics-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 0.5rem;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	color: #344054;
	text-decoration: none;
	font-size: 0.85rem;
}

.fmxext-topics-pagination .page-numbers.current {
	background: var(--fmxext-accent);
	border-color: var(--fmxext-accent);
	color: #fff;
}

.fmxext-topics-empty {
	padding: 2rem;
	text-align: center;
	color: #98a2b3;
	background: #fff;
	border: 1px solid rgba(16, 24, 40, 0.08);
	border-radius: 12px;
}

@media (max-width: 782px) {
	.fmxext-topic-row {
		grid-template-columns: auto 1fr;
		grid-template-areas:
			"avatar main"
			"stats stats"
			"last last";
		gap: 0.5rem 1rem;
	}

	.fmxext-topic-avatar {
		grid-area: avatar;
	}

	.fmxext-topic-main {
		grid-area: main;
	}
}

/* On phones, reduce each topic to avatar + content (badges, title, author/time,
 * tags). The reply/view counts and the last-reply column are dropped for a clean,
 * compact list. */
@media (max-width: 576px) {
	.fmxext-topic-row {
		display: flex;
		align-items: flex-start;
		grid-template-columns: none;
		grid-template-areas: none;
		gap: 0.85rem;
		padding: 1rem 1.1rem;
	}

	.fmxext-topic-avatar {
		flex: 0 0 auto;
	}

	.fmxext-topic-main {
		flex: 1 1 auto;
	}

	.fmxext-topic-stat,
	.fmxext-topic-last {
		display: none;
	}
}

/* ---- Recent topics shortcode ---- */
.fmxext-recent-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Two-class selector (0,2,0) to beat Oxygen's `:is(li,...) { display:list-item }` (0,1,0). */
.fmxext-recent-list .fmxext-recent-item {
	display: flex;
	gap: 0.65rem;
	padding: 0.85rem 0;
	border-bottom: 1px solid #eef1f4;
}

.fmxext-recent-list .fmxext-recent-item:last-child {
	border-bottom: 0;
}

.fmxext-recent-avatar img {
	width: 36px;
	height: 36px;
	border-radius: 50%;
}

.fmxext-recent-body {
	min-width: 0;
}

.fmxext-recent-link {
	display: block;
	font-weight: 600;
	color: #111827;
	text-decoration: none;
	line-height: 1.3;
}

.fmxext-recent-link:hover {
	color: #0e9384;
}

.fmxext-recent-meta {
	margin-top: 0.2rem;
	font-size: 0.8rem;
	color: #98a2b3;
}

.fmxext-recent-forum {
	color: #0e9384;
	text-decoration: none;
	font-weight: 500;
}

.fmxext-recent-tags {
	margin-top: 0.4rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.fmxext-tag {
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	padding: 0.15rem 0.5rem;
	border-radius: 6px;
	font-size: 0.72rem;
	line-height: 1.5;
	background: #f2f4f7;
	color: #475467;
	text-decoration: none;
}

.fmxext-tag:hover {
	background: #e9f7f3;
	color: #0e9384;
}

/* =====================================================================
 * Reply form header — avatar + "Post a reply" / "Replying as <name>".
 * ===================================================================== */

/* Hide the native legend (topic title + chevron) when our header is present.
 * Forumax forces `legend { display: block !important }` with a deep selector,
 * so match its depth and override with !important. */
.bbp-reply-form:has(.fmxext-reply-form-header) > form > fieldset.bbp-form > legend {
	display: none !important;
}

.fmxext-reply-form-header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	/* Pull out to the card edges (card padding is 18px 25px 25px) for a
	 * full-width divider under the header. */
	margin: -18px -25px 20px;
	padding: 18px 25px;
	border-bottom: 1px solid #e4e9ee;
}

.fmxext-reply-form-avatar img {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: block;
	margin: 0;
}

.fmxext-reply-form-heading {
	display: flex;
	flex-direction: column;
	line-height: 1.3;
	min-width: 0;
}

.fmxext-reply-form-title {
	font-size: 1.05rem;
	font-weight: 700;
	color: #101828;
}

.fmxext-reply-form-sub {
	font-size: 0.85rem;
	color: #667085;
}

/* "Post Reply" button: icon to the LEFT of the label, and on hover keep only the
 * background color change (drop the lift + shadow growth). */
#bbp_reply_submit {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

#bbp_reply_submit svg {
	order: -1; /* move the send icon before the text */
	margin: 0 !important; /* neutralize the inline margin-left */
}

#bbp_reply_submit:hover,
#bbp_reply_submit:active {
	transform: none !important;
	box-shadow: 0 4px 16px rgba(76, 76, 241, 0.28) !important; /* same as resting — no growth */
}

/* =====================================================================
 * Topic form (styled like the reply form). The shared .bbp-reply-form class
 * on the wrapper supplies the card/editor/tags/options styling; these rules
 * cover the topic-only fields (title, forum/type/status) + the submit button.
 * ===================================================================== */
.bbp-topic-form .frmx-topic-field {
	margin-bottom: 16px;
}

/* Field labels match the ATTACHMENTS / OPTIONS legend style. */
.bbp-topic-form .frmx-topic-field > label {
	display: block;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	color: var(--black_500, #667085);
	margin-bottom: 10px;
}

/* bbpc-single turns the form content div into a flex row-wrap and only stretches
 * its own known children. Reset it to block so our topic fields flow full-width. */
.bbp-topic-form > form > fieldset.bbp-form > div {
	display: block !important;
}

/* The flex layout above used `gap` for vertical rhythm; block layout loses it,
 * so restore spacing between the direct children (fixes the tags field margins). */
.bbp-topic-form > form > fieldset.bbp-form > div > * {
	margin-bottom: 16px;
}

.bbp-topic-form > form > fieldset.bbp-form > div > *:last-child {
	margin-bottom: 0;
}

/* NOTE: bbPress scopes its reply-form rules with `!important` and, for inputs,
 * an id (#bbpress-forums …). To beat those deterministically (not by load order)
 * we prefix our topic-form overrides with the #bbpress-forums id too. */
#bbpress-forums .bbp-topic-form .frmx-topic-field input[type="text"],
#bbpress-forums .bbp-topic-form .frmx-topic-field select {
	width: 100% !important;
	height: auto !important; /* unset the fixed height bbPress puts on text inputs */
	box-sizing: border-box;
	padding: 10px 12px !important; /* override bbPress's 5px input padding */
	border: 1px solid #d7dce5;
	border-radius: 8px;
	background: #fff;
	font: inherit;
	font-size: 14px;
	color: #1a1a2e;
	line-height: 1.4;
}

/* Title: larger, full-width input. */
#bbpress-forums .bbp-topic-form .frmx-topic-title-field input[type="text"] {
	padding: 14px 16px !important;
	font-size: 16px;
}

/* Restore breathing room around the tags field (bbPress forces margin:0 !important). */
#bbpress-forums .bbp-topic-form .frmx-tags-field {
	margin-top: 16px !important;
	margin-bottom: 16px !important;
}

/* Container: match the reply form's padding (bbPress gives .bbp-topic-form its
 * own 55px), and drop the extra top margin + box shadow (page has its own header).
 * Scoped to the topic form only — the reply form keeps its normal spacing. */
.bbp-topic-form.bbp-reply-form {
	padding: 18px 25px 25px !important;
	margin-top: 0 !important;
	box-shadow: none !important;
}

/* Drop bbPress's 10px/20px padding on the inner fieldset (id-scoped, so match it). */
#bbpress-forums .bbp-topic-form fieldset.bbp-form {
	padding: 0 !important;
}

.bbpress-wrapper:has( .bbp-topic-form ),
#bbpress-forums:has( .bbp-topic-form ) {
	margin-top: 0 !important;
}

/* The reply form (never a topic form) should stay separated from the content above. */
.bbp-reply-form:not( .bbp-topic-form ) {
	margin-top: 24px;
}

.bbp-topic-form .frmx-topic-field input[type="text"]:focus,
.bbp-topic-form .frmx-topic-field select:focus {
	outline: none;
	border-color: var(--bbpc_brand_color, #0e9384);
	box-shadow: 0 0 0 3px rgba(14, 147, 132, 0.12);
}

/* Forum / Type / Status on one responsive row. */
.bbp-topic-form .frmx-topic-selects {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.bbp-topic-form .frmx-topic-selects .frmx-topic-field {
	flex: 1 1 180px;
	margin-bottom: 12px;
}

/* "Posting as <avatar> <name>" in the footer's left corner. */
.bbp-topic-form .fmxext-posting-as {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-right: auto; /* keeps the submit button on the right */
	font-size: 0.9rem;
	color: #667085;
}

.bbp-topic-form .fmxext-posting-as-avatar img {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: block;
	margin: 0;
}

.bbp-topic-form .fmxext-posting-as-label {
	color: #667085;
}

.bbp-topic-form .fmxext-posting-as-name {
	color: #101828;
	font-weight: 700;
	margin-left: 0.25rem;
}

/* "Create Topic" submit: icon to the left + only the color change on hover. */
#bbp_topic_submit {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

#bbp_topic_submit svg {
	order: -1;
}

#bbp_topic_submit:hover,
#bbp_topic_submit:active {
	transform: none !important;
	box-shadow: 0 4px 16px rgba(76, 76, 241, 0.28) !important;
}

/* =====================================================================
 * Reply / topic form editor: keep it within its container at ALL widths.
 *
 * The topic content column is narrow even on desktop, and TinyMCE caches a
 * pixel width at init that can exceed it, so the toolbar (and the whole form)
 * overflows. This is NOT viewport-specific, so it must live outside any media
 * query. Cap every editor element to its parent with max-width (never width, so
 * button groups keep their natural size and can flow), then make the toolbar's
 * button row a wrapping flex container. Mirrors why the inline-edit editors
 * (which carry no width styles) already wrap.
 * ===================================================================== */
.bbp-reply-form,
.bbp-reply-form * {
	box-sizing: border-box;
	/* Nothing in the form may exceed its container. Caps the wrapper chain
	 * (incl. .bbp-the-content-wrapper) and the editor, overriding TinyMCE's
	 * cached inline widths. max-width never forces a size, so it's safe on all. */
	max-width: 100% !important;
}

.bbp-reply-form textarea,
.bbp-reply-form input[type="text"],
.bbp-reply-form select {
	width: 100% !important;
}

/* The whole toolbar row is a single .mce-btn-group here (no separators in the
 * toolbar config), so wrapping the flow-layout does nothing — the buttons have
 * to wrap INSIDE the group. Make the group and its inner wrapper flex-wrap. */
.bbp-reply-form .mce-toolbar .mce-container-body,
.bbp-reply-form .mce-btn-group,
.bbp-reply-form .mce-btn-group > * {
	display: flex !important;
	flex-wrap: wrap !important;
	align-items: center;
}

/* Fixed inline heights are sized for one toolbar row; let them grow so wrapped
 * rows aren't clipped. */
.bbp-reply-form .mce-toolbar-grp,
.bbp-reply-form .mce-toolbar-grp .mce-container-body,
.bbp-reply-form .mce-toolbar,
.bbp-reply-form .mce-btn-group {
	height: auto !important;
}

.bbp-reply-form .mce-flow-layout-item {
	float: none !important;
}

@media (max-width: 576px) {
	.fmxext-reply-form-header {
		margin: -16px -16px 16px;
		padding: 16px;
	}

	/* Tighter side padding so the form content has more room on a phone. */
	.bbp-topic-form.bbp-reply-form,
	.bbp-reply-form:not( .bbp-topic-form ) {
		padding-left: 16px !important;
		padding-right: 16px !important;
	}
}

/* =====================================================================
 * Replies section header — title + connecting rule + sort control.
 * (Extra .all-replies-header class raises specificity above Forumax's rules.)
 * ===================================================================== */
body.bbpress .all-answers .all-replies-header.frmx-all-replies-header {
	gap: 1rem;
	/* Forumax adds margin-top:50px + margin-bottom:15px; keep just 15px padding. */
	margin: 0;
	padding: 15px 0;
}

/* Title hugs its content so the rule can fill the space beside it. */
body.bbpress .all-answers .all-replies-header.frmx-all-replies-header .frmx-header-left {
	flex: 0 0 auto;
}

body.bbpress .all-answers .all-replies-header.frmx-all-replies-header .replies-title {
	font-size: 1.05rem;
	font-weight: 700;
	white-space: nowrap;
}

/* Drop the chat glyph — the reference header is text + rule only. */
body.bbpress .all-answers .all-replies-header.frmx-all-replies-header .replies-title .frmx-reply-count-icon {
	display: none;
}

/* The horizontal rule that stretches from the title to the sort control. */
.fmxext-replies-rule {
	flex: 1 1 auto;
	height: 0;
	border-top: 1px solid #e4e9ee;
}

body.bbpress .all-answers .all-replies-header.frmx-all-replies-header .frmx-header-right {
	flex: 0 0 auto;
}

/* Sort control — label + bordered pill, matching the forums (topics) sort. */
body.bbpress .all-answers .replies-sorting {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

body.bbpress .all-answers .replies-sorting .fmxext-replies-sort-label {
	font-size: 0.85rem;
	color: #667085;
	margin: 0;
}

body.bbpress .all-answers .replies-sorting .replies-sort-select {
	padding: 0.5rem 0.75rem;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	background: #fff;
	box-shadow: none;
	font: inherit;
	font-size: 0.9rem;
	color: #111827;
	cursor: pointer;
}

body.bbpress .all-answers .replies-sorting .replies-sort-select:hover {
	border-color: #98a2b3;
}

/* Drop Forumax's 55px indent on the replies pagination count — it aligned with
 * the old outside-the-card avatar column, which no longer exists. */
body.bbpress .all-answers .pagination-wrapper .view-post-of {
	margin-left: 0 !important;
}

/* =====================================================================
 * Single-topic replies — redesigned reply card
 * ===================================================================== */

/* The whole reply post becomes a bordered card; avatar lives inside it.
 * Neutralize Forumax's flex/column layout on .forum-comment so the card fills
 * the full container width instead of shrink-wrapping to its content. */
.reply-result .forum-comment {
	display: block;
	width: 100%;
	margin: 0 0 1rem;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
}

/* Forumax's `.reply-result > .type-reply` adds `padding: 15px 0` (equal
 * specificity, loaded later, so it wins). Spacing between cards is handled by
 * the margin above — drop that padding. */
body.bbpress .reply-result > .type-reply {
	padding: 0;
}

/* Forumax styles the outer .best-answer with its own padding/background/margin
 * (padding is !important) — neutralize it; our card provides the framing. */
.reply-result .forum-comment.best-answer {
	padding: 0 !important;
	margin: 0 0 1rem;
	background: transparent;
	border-radius: 0;
}

.fmxext-reply-card,
.fmxext-reply-card * {
	box-sizing: border-box;
}

.fmxext-reply-card {
	width: 100%;
	border: 1px solid #e4e9ee;
	border-radius: 14px;
	background: #fff;
	/* No overflow:hidden — it would clip the reply admin dropdown menu. */
}

.fmxext-reply-body {
	padding: 1.25rem 1.5rem;
}

/* Accepted answer — green banner + green frame. */
.fmxext-reply-card.fmxext-reply-accepted {
	border-color: #6ce9c0;
	box-shadow: 0 0 0 1px #6ce9c0;
}

.fmxext-reply-accepted-banner {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1.5rem;
	background: #e6faf4;
	color: #0a7a5c;
	font-weight: 600;
	font-size: 0.9rem;
	border-bottom: 1px solid #b6ecdc;
	/* Match the card's rounded top corners (card has overflow visible now). */
	border-radius: 13px 13px 0 0;
}

.fmxext-reply-accepted-banner svg {
	flex: 0 0 auto;
}

/* Pending (unapproved) reply — amber banner + frame, shown to moderators. */
.fmxext-reply-card.fmxext-reply-pending {
	border-color: #fec84b;
	box-shadow: 0 0 0 1px #fec84b;
}

.fmxext-reply-pending-banner {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1.5rem;
	background: #fffaeb;
	color: #b54708;
	font-weight: 600;
	font-size: 0.9rem;
	border-bottom: 1px solid #fedf89;
	border-radius: 13px 13px 0 0;
}

.fmxext-reply-pending-banner svg {
	flex: 0 0 auto;
}

/* Private reply — slate banner + frame. */
.fmxext-reply-card.fmxext-reply-private {
	border-color: #cbd2e0;
	box-shadow: 0 0 0 1px #cbd2e0;
}

.fmxext-reply-private-banner {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1.5rem;
	background: #f2f4f8;
	color: #475467;
	font-weight: 600;
	font-size: 0.9rem;
	border-bottom: 1px solid #dce1ea;
	border-radius: 13px 13px 0 0;
}

.fmxext-reply-private-banner svg {
	flex: 0 0 auto;
}

/* Hide Forumax's inline "Best Answer" badge — we render our own top banner. */
.fmxext-reply-card .solved-topic-bar {
	display: none !important;
}

/* Tint the "Accept answer" reply-menu icon to match the accepted-answer theme. */
.bbp-admin-links-dropdown .frmx-nice-select .list .option[data-action="fmxext_accept"] .frmx-dropdown-icon svg {
	color: #0e9384;
}

/* Header: avatar + author info on the left, admin menu on the right. */
.fmxext-reply-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.85rem;
}

.fmxext-reply-author {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-width: 0;
}

.fmxext-reply-avatar img.avatar,
.fmxext-reply-avatar img {
	width: 44px !important;
	height: 44px !important;
	border-radius: 50% !important;
	margin: 0 !important;
	display: block;
}

.fmxext-reply-author-info {
	min-width: 0;
}

.fmxext-reply-author-line {
	font-weight: 700;
	color: #101828;
	font-size: 1rem;
	line-height: 1.3;
}

.fmxext-reply-author-line a {
	color: inherit;
	text-decoration: none;
}

.fmxext-reply-author-meta {
	margin-top: 0.15rem;
	font-size: 0.85rem;
	color: #667085;
	line-height: 1.4;
}

.fmxext-reply-author-meta .fmxext-reply-meta-sep {
	color: #98a2b3;
}

/* Right-side admin menu (kebab) — keep it top-aligned. */
.fmxext-reply-head-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex: 0 0 auto;
}

/* Content. */
.fmxext-reply-content {
	color: #344054;
	line-height: 1.6;
	word-break: break-word;
}

.fmxext-reply-content p:last-child {
	margin-bottom: 0;
}

/* Footer: voting (left), reply + reactions + share (right). */
.fmxext-reply-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.1rem;
}

.fmxext-reply-footer-left {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.fmxext-reply-footer-right {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-left: auto;
}

/* Reply "Reply" links (Pro nested-reply + bbPress reply-to fallback) — pills. */
.fmxext-reply-footer .frmx-nested-reply-action a,
.fmxext-reply-footer .frmx-nested-reply-action > a,
.fmxext-reply-footer-left .bbp-reply-to-link {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.5rem 0.95rem;
	border: 1px solid #d0d5dd;
	border-radius: 999px;
	color: #344054;
	font-weight: 500;
	text-decoration: none;
	line-height: 1;
}

.fmxext-reply-footer .frmx-nested-reply-action a:hover,
.fmxext-reply-footer-left .bbp-reply-to-link:hover {
	background: #f9fafb;
	border-color: #98a2b3;
	color: #344054;
}

/* Share pill. */
.fmxext-reply-share {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.5rem 0.95rem;
	border: 1px solid #d0d5dd;
	border-radius: 999px;
	background: transparent;
	color: #344054;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
}

.fmxext-reply-share:hover {
	background: #f9fafb;
	border-color: #98a2b3;
}

.fmxext-reply-share::before {
	content: "";
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
	background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23344054' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='18' cy='5' r='3'/><circle cx='6' cy='12' r='3'/><circle cx='18' cy='19' r='3'/><line x1='8.59' y1='13.51' x2='15.42' y2='17.49'/><line x1='15.41' y1='6.51' x2='8.59' y2='10.49'/></svg>") no-repeat center / contain;
}

.fmxext-reply-share.is-copied {
	border-color: #0e9384;
	color: #0e9384;
}

/* Voting pill — mirror the topic footer voting styling for replies. */
.fmxext-reply-footer-left .bbp-voting {
	position: static !important;
	inset: auto !important;
	left: auto !important;
	top: auto !important;
	float: none !important;
	margin: 0 !important;
	display: inline-flex;
	flex-direction: row;
	align-items: center;
	gap: 0.4rem;
	padding: 0.35rem 0.75rem;
	border: 1px solid #d0d5dd;
	border-radius: 999px;
	line-height: 1;
	cursor: pointer;
}

.fmxext-reply-footer-left .bbp-voting:hover {
	border-color: #98a2b3;
}

.fmxext-reply-footer-left .bbp-voting .bbp-voting-label {
	display: none;
}

.fmxext-reply-footer-left .bbp-voting a.vote {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	font-size: 0;
	color: transparent;
	background-color: transparent;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 24px 24px;
	cursor: pointer;
}

.fmxext-reply-footer-left .bbp-voting a.vote::before,
.fmxext-reply-footer-left .bbp-voting a.vote::after {
	content: none !important;
	display: none !important;
}

.fmxext-reply-footer-left .bbp-voting a.vote.up,
.fmxext-reply-footer-left .bbp-voting a.vote.down,
.fmxext-reply-footer-left .bbp-voting a.vote.up:hover,
.fmxext-reply-footer-left .bbp-voting a.vote.down:hover {
	border: 0 !important;
}

.fmxext-reply-footer-left .bbp-voting a.vote.up {
	background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475467' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 18v-6H5l7-7 7 7h-4v6H9z'/></svg>") !important;
}

.fmxext-reply-footer-left .bbp-voting.voted-up a.vote.up {
	background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%230e9384' stroke='%230e9384' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 18v-6H5l7-7 7 7h-4v6H9z'/></svg>") !important;
}

.fmxext-reply-footer-left .bbp-voting.voted-up {
	border-color: #0e9384;
}

.fmxext-reply-footer-left .bbp-voting.voted-up .score {
	color: #0e9384;
}

.fmxext-reply-footer-left .bbp-voting a.vote.down {
	background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475467' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><line x1='12' y1='5' x2='12' y2='18'/><polyline points='6 12 12 18 18 12'/></svg>") !important;
}

.fmxext-reply-footer-left .bbp-voting .score {
	font-size: 0.9rem;
	font-weight: 700;
	color: #111827;
	cursor: pointer;
}

/* Remove the Visual/Code (TinyMCE/Text) editor switcher on all forum editors:
 * new topic, reply, and inline/standalone topic & reply edit forms. Scoped to
 * #bbpress-forums so it never affects other front-end wp_editor instances. */
#bbpress-forums .wp-editor-tabs.wp-editor-tabs.wp-editor-tabs,
.bbp-topic-form .wp-editor-tabs.wp-editor-tabs.wp-editor-tabs,
.bbp-reply-form .wp-editor-tabs.wp-editor-tabs.wp-editor-tabs,
.frmx-inline-edit-content .wp-editor-tabs.wp-editor-tabs.wp-editor-tabs {
	display: none !important;
}
