/**
 * Coinfolio: bbPress author column — unified profile sidebar + post body (scoped to #bbpress-forums).
 */

/* --- Host: same design tokens as profile page (scoped, no global theme bleed) --- */
#bbpress-forums .cf-forum-profile-sidebar-host {
	--cf-bg-primary: #141824;
	--cf-bg-secondary: #1b202f;
	--cf-bg-content: #242b3d;
	--cf-bg-card: #111827;
	--cf-border-color: #2a3143;
	--cf-gold: #d4af37;
	--cf-text: #e2e8f0;
	--cf-muted: #94a3b8;
	--cf-border-radius-holder: 8px;
	--cf-shadow-elevation: 0 4px 12px rgba(0, 0, 0, 0.3);
	color: var(--cf-text);
	font-family: system-ui, -apple-system, sans-serif;
	font-size: 0.92rem;
	line-height: 1.45;
	max-width: 100%;
}

#bbpress-forums .cf-forum-profile-sidebar-host *,
#bbpress-forums .cf-forum-profile-sidebar-host *::before,
#bbpress-forums .cf-forum-profile-sidebar-host *::after {
	box-sizing: border-box;
}

/* Sidebar column: match public profile chrome inside narrow forum author cell */
#bbpress-forums .cf-profile-sidebar--forum {
	background: var(--cf-bg-secondary);
	border: none;
	padding: 12px 10px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
	max-width: 100%;
}

#bbpress-forums .cf-profile-sidebar-name-link {
	color: inherit;
	text-decoration: none;
	display: inline;
	max-width: 100%;
}

#bbpress-forums .cf-profile-sidebar-name-link:hover {
	color: var(--cf-gold, #d4af37);
}

/* Compare to my collection — icon (modal from collection-comparison.js); same size as contact icons in toolbar */
#bbpress-forums .cf-forum-compare-collection-wrap {
	display: flex;
	justify-content: center;
	margin-top: 4px;
}

#bbpress-forums .cf-profile-forum-toolbar .cf-forum-compare-icon-btn.cf-compare-collection-btn,
#bbpress-forums .cf-forum-compare-icon-btn.cf-compare-collection-btn {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	min-width: 32px;
	min-height: 32px;
	padding: 0;
	border-radius: 6px;
	border: 1px solid var(--cf-border-color, #2a3143);
	background: var(--cf-bg-primary, #141824);
	color: var(--cf-gold, #d4af37);
	cursor: pointer;
	box-sizing: border-box;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
}

#bbpress-forums .cf-profile-forum-toolbar .cf-forum-compare-icon-btn.cf-compare-collection-btn:hover,
#bbpress-forums .cf-forum-compare-icon-btn.cf-compare-collection-btn:hover {
	border-color: rgba(212, 175, 55, 0.45);
	background: rgba(212, 175, 55, 0.08);
	color: var(--cf-gold, #d4af37);
}

#bbpress-forums .cf-profile-forum-toolbar .cf-forum-toolbar-svg,
#bbpress-forums .cf-forum-compare-icon-btn .cf-forum-toolbar-svg {
	display: block;
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

#bbpress-forums .cf-profile-forum-toolbar .cf-forum-compare-icon-btn .dashicons,
#bbpress-forums .cf-forum-compare-icon-btn .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
	line-height: 1;
}

/* RTL: collections inline-end (מימין), contacts inline-start (משמאל) */
#bbpress-forums .cf-profile-forum-toolbar {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	margin-top: 6px;
	padding-top: 8px;
	border-top: 1px solid var(--cf-border-color, #2a3143);
	direction: rtl;
}

/* Align with “contacts” layout: collections stay inline-end (מימין) even without contact icons */
#bbpress-forums .cf-profile-forum-toolbar--collections-only {
	justify-content: flex-start;
}

#bbpress-forums .cf-profile-forum-toolbar--collections-only .cf-profile-forum-toolbar__collections {
	justify-content: flex-start;
}

#bbpress-forums .cf-profile-forum-toolbar__collections,
#bbpress-forums .cf-profile-forum-toolbar__contacts {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex-wrap: nowrap;
	min-width: 0;
}

#bbpress-forums .cf-profile-forum-icon-btn,
#bbpress-forums .cf-profile-forum-toolbar .cf-profile-forum-contact-btn {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	min-width: 32px;
	min-height: 32px;
	padding: 0;
	border-radius: 6px;
	border: 1px solid var(--cf-border-color, #2a3143);
	background: var(--cf-bg-primary, #141824);
	color: var(--cf-gold, #d4af37);
	text-decoration: none !important;
	box-sizing: border-box;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
}

#bbpress-forums .cf-profile-forum-icon-btn:hover,
#bbpress-forums .cf-profile-forum-toolbar .cf-profile-forum-contact-btn:hover {
	border-color: rgba(212, 175, 55, 0.45);
	background: rgba(212, 175, 55, 0.08);
	color: var(--cf-gold, #d4af37);
}

#bbpress-forums .cf-profile-forum-icon-btn .cf-forum-toolbar-svg,
#bbpress-forums .cf-profile-forum-toolbar .cf-profile-forum-contact-btn .cf-forum-toolbar-svg {
	display: block;
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

#bbpress-forums .cf-profile-forum-icon-btn .dashicons,
#bbpress-forums .cf-profile-forum-toolbar .cf-profile-forum-contact-btn .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
	line-height: 1;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-achievements-row--forum-in-card {
	justify-content: center;
	margin: 0 0 8px;
	padding-bottom: 8px;
	border-bottom: 1px solid rgba(42, 49, 67, 0.65);
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-sidebar-header {
	text-align: center;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-sidebar-avatar-img {
	width: 88px;
	height: 88px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid var(--cf-gold);
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-sidebar-name {
	color: var(--cf-text);
	font-size: 1.05rem;
	margin: 0;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-sidebar-name span {
	display: inline !important;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-summary-card {
	background: var(--cf-bg-content);
	border: 1px solid var(--cf-border-color);
	border-radius: var(--cf-border-radius-holder);
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-summary-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-summary-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--cf-bg-secondary);
	border: 1px solid var(--cf-border-color);
	border-radius: 8px;
	padding: 6px 8px;
	gap: 6px;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-summary-label {
	font-size: 0.68rem;
	color: var(--cf-muted);
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-summary-value {
	font-size: 0.88rem;
	font-weight: 700;
	color: var(--cf-gold);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 58%;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-rank-capsules {
	display: flex;
	margin-top: 0;
	flex-direction: column;
	flex-wrap: nowrap;
	justify-content: center;
	align-items: center;
	gap: 8px;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-rank-capsule-group--forum,
#bbpress-forums .cf-profile-sidebar--forum .cf-profile-rank-capsule-group--collectors {
	display: inline-flex;
	align-items: center;
	width: auto;
	max-width: 100%;
	justify-content: center;
}

/* Capsule shape (overrides theme span { display:block } stretching pills full width) */
#bbpress-forums .cf-profile-sidebar--forum .cf-profile-rank-pill {
	display: inline-flex !important;
	flex-direction: row-reverse;
	align-items: center;
	justify-content: center;
	flex-wrap: nowrap;
	gap: 6px;
	width: auto !important;
	max-width: 100%;
	min-height: 30px;
	padding: 4px 14px !important;
	border-radius: 999px !important;
	border: 1px solid rgba(42, 49, 67, 0.95);
	box-sizing: border-box;
	font-size: 0.78rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-rank-pill--default {
	background: var(--cf-bg-secondary, #1b202f) !important;
	color: var(--cf-text, #e2e8f0) !important;
	border: 1px solid var(--cf-border-color, #2a3143) !important;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-rank-pill .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-achievements-row {
	justify-content: center;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-contact-row {
	justify-content: center;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-contact-icon {
	color: var(--cf-gold) !important;
	text-decoration: none;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-contact-icon:hover {
	text-decoration: underline;
}

/*
 * Override theme inline rules (astra/functions.php): fixed 219px author column,
 * span/a { display:block; width:100% }, .coinfolio-reply-wrap { overflow:hidden }.
 * Without this, unified profile sidebar is clipped and rank pills stack wrong.
 */
#bbpress-forums .cf-forum-unified-reply-wrap {
	overflow: visible !important;
}

/* Narrow author column — desktop only (mobile = full width in @media max-width 768px below). */
@media (min-width: 769px) {
	#bbpress-forums .bbp-reply-author.cf-forum-unified-author,
	#bbpress-forums .coinfolio-reply-wrap .bbp-reply-author.cf-forum-unified-author,
	body #bbpress-forums .bbp-reply-author.cf-forum-unified-author,
	body #bbpress-forums .coinfolio-reply-wrap .bbp-reply-author.cf-forum-unified-author.coinfolio-reply-author-sep {
		flex: 0 0 min(252px, calc(34vw * 0.9)) !important;
		min-width: min(252px, calc(34vw * 0.9)) !important;
		max-width: min(270px, calc(38vw * 0.9)) !important;
		width: min(252px, calc(34vw * 0.9)) !important;
		align-items: stretch !important;
		text-align: right !important;
		padding: 10px 8px !important;
		overflow: visible !important;
	}

	#bbpress-forums .bbp-lead-topic.cf-forum-unified-lead-topic .coinfolio-topic-author-cell.cf-forum-unified-author,
	body #bbpress-forums .bbp-lead-topic.cf-forum-unified-lead-topic .coinfolio-topic-author-cell.cf-forum-unified-author,
	body #bbpress-forums .bbp-lead-topic.cf-forum-unified-lead-topic .coinfolio-topic-author-cell.cf-forum-unified-author.coinfolio-topic-author-cell {
		flex: 0 0 min(252px, calc(34vw * 0.9)) !important;
		min-width: min(252px, calc(34vw * 0.9)) !important;
		max-width: min(270px, calc(38vw * 0.9)) !important;
		width: min(252px, calc(34vw * 0.9)) !important;
		align-items: stretch !important;
		text-align: right !important;
		padding: 12px 8px 16px !important;
		overflow: visible !important;
		border-left: none !important;
	}
}

/* Remove duplicate vertical rule (theme .coinfolio-reply-author-sep + sidebar border) */
#bbpress-forums .cf-forum-unified-author.coinfolio-reply-author-sep {
	border-left: none !important;
	box-shadow: none !important;
}

/* Duplicate rank strip from theme / legacy hooks — sidebar already shows ranks */
#bbpress-forums .cf-forum-unified-author .coinfolio-reputation-badges-wrap,
#bbpress-forums .cf-forum-unified-author .coinfolio-rank-badge,
#bbpress-forums .cf-forum-unified-author .cf-forum-user-title,
#bbpress-forums .coinfolio-reply-wrap .bbp-reply-author .coinfolio-reputation-badges-wrap,
#bbpress-forums .bbp-lead-topic .bbp-topic-author .coinfolio-reputation-badges-wrap {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
	height: 0 !important;
	overflow: hidden !important;
	visibility: hidden !important;
}

/* Undo theme forcing every span/link to block inside author column */
#bbpress-forums .cf-forum-unified-author .cf-forum-profile-sidebar-host a,
#bbpress-forums .cf-forum-unified-author .cf-forum-profile-sidebar-host span {
	display: unset !important;
	width: auto !important;
	text-align: inherit !important;
}

/* Toolbar / compare: undo display:unset on icon cells — keeps SVG + dashicons centered in 32×32 (H8) */
#bbpress-forums .cf-forum-unified-author .cf-forum-profile-sidebar-host .cf-profile-forum-toolbar a.cf-profile-forum-icon-btn,
#bbpress-forums .cf-forum-unified-author .cf-forum-profile-sidebar-host .cf-profile-forum-toolbar .cf-forum-compare-icon-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	line-height: 0 !important;
	text-align: center !important;
}

#bbpress-forums .cf-forum-unified-author .cf-forum-profile-sidebar-host .cf-profile-forum-toolbar a.cf-profile-forum-icon-btn .dashicons,
#bbpress-forums .cf-forum-unified-author .cf-forum-profile-sidebar-host .cf-profile-forum-toolbar .cf-forum-compare-icon-btn .dashicons {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 16px !important;
	height: 16px !important;
	line-height: 1 !important;
	margin: 0 !important;
}

#bbpress-forums .cf-forum-unified-author .cf-forum-profile-sidebar-host .cf-profile-forum-toolbar .cf-forum-toolbar-svg {
	display: block !important;
	margin: 0 auto !important;
	flex-shrink: 0 !important;
}

/* Mobile popover (inside host): same flex fix for icon cells */
#bbpress-forums .cf-forum-unified-author .cf-forum-mobile-actions-panel .cf-profile-forum-icon-btn,
#bbpress-forums .cf-forum-unified-author .cf-forum-mobile-actions-panel .cf-forum-compare-icon-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	line-height: 0 !important;
}

#bbpress-forums .cf-forum-unified-author .cf-forum-mobile-actions-panel .cf-forum-toolbar-svg {
	display: block !important;
	margin: 0 auto !important;
	flex-shrink: 0 !important;
}

#bbpress-forums .cf-forum-unified-author .cf-profile-rank-pill,
#bbpress-forums .cf-forum-unified-author .cf-profile-rank-pill > span,
#bbpress-forums .cf-forum-unified-author .cf-profile-achievement-chip {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
}

#bbpress-forums .cf-forum-unified-author .cf-profile-rank-pill > span:last-child {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 11em;
}

#bbpress-forums .cf-forum-unified-author .cf-profile-sidebar-header {
	text-align: center;
	width: 100%;
}

#bbpress-forums .cf-forum-unified-author .cf-profile-sidebar-name {
	width: 100%;
}

#bbpress-forums .cf-forum-unified-author .cf-profile-sidebar-name a.cf-profile-sidebar-name-link {
	display: inline;
}

/* Desktop: unified author column — center profile stack; summary card + toolbar stay full width (H7) */
@media (min-width: 769px) {
	#bbpress-forums .cf-forum-unified-author .cf-forum-profile-sidebar-host {
		text-align: center !important;
	}

	#bbpress-forums .cf-forum-unified-author .cf-profile-sidebar--forum {
		align-items: center;
	}

	#bbpress-forums .cf-forum-unified-author .cf-profile-sidebar--forum .cf-profile-summary-card,
	#bbpress-forums .cf-forum-unified-author .cf-profile-sidebar--forum .cf-profile-forum-toolbar {
		align-self: stretch;
		width: 100%;
	}
}

/* Compact summary: label above value — no clipping (theme forced nowrap + 58% max) */
#bbpress-forums .cf-profile-sidebar--forum .cf-profile-summary-row {
	flex-direction: column;
	align-items: stretch;
	gap: 2px;
	padding: 5px 6px;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-summary-label {
	width: 100%;
	text-align: center;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-summary-value {
	max-width: none !important;
	width: 100%;
	white-space: normal !important;
	overflow: visible !important;
	text-overflow: unset !important;
	text-align: center;
	font-size: 0.82rem;
	line-height: 1.25;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-ranks-below-name {
	flex-direction: column;
	flex-wrap: nowrap;
	justify-content: center;
	align-items: center;
	gap: 8px;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-rank-pill--forum {
	font-size: 0.75rem;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-summary-card {
	padding: 8px;
	gap: 6px;
}

#bbpress-forums .cf-profile-summary-card--forum-compact .cf-profile-summary-row {
	padding: 4px 6px;
}

#bbpress-forums .cf-profile-summary-card--forum-compact .cf-profile-summary-value {
	font-size: 0.8rem;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-sidebar-avatar-img {
	width: 64px;
	height: 64px;
}

#bbpress-forums .cf-profile-sidebar--forum .cf-profile-achievements-row {
	flex-wrap: wrap;
}

/* --- Post body: typography + tables (Coinfolio dark theme) --- */
#bbpress-forums .cf-forum-post-body {
	color: var(--cf-text, #e2e8f0);
	font-size: 0.95rem;
	line-height: 1.55;
	word-wrap: break-word;
	overflow-wrap: break-word;
	overflow-x: visible;
	max-width: 100%;
	min-width: 0;
}

#bbpress-forums .cf-forum-post-body a {
	color: var(--cf-gold, #d4af37);
	text-decoration: none;
}

#bbpress-forums .cf-forum-post-body a:hover {
	text-decoration: underline;
}

#bbpress-forums .cf-forum-post-body p {
	margin: 0 0 0.85em;
}

#bbpress-forums .cf-forum-post-body h2,
#bbpress-forums .cf-forum-post-body h3,
#bbpress-forums .cf-forum-post-body h4 {
	color: var(--cf-text, #e2e8f0);
	margin: 1em 0 0.5em;
	font-weight: 700;
	line-height: 1.25;
}

#bbpress-forums .cf-forum-post-body ul,
#bbpress-forums .cf-forum-post-body ol {
	margin: 0 1.1em 0.85em 0;
	padding: 0;
}

#bbpress-forums .cf-forum-post-body blockquote {
	margin: 0.5em 0;
	padding: 8px 12px;
	border-right: 3px solid var(--cf-gold, #d4af37);
	background: rgba(27, 32, 47, 0.65);
	border-radius: 0 8px 8px 0;
	color: var(--cf-muted, #94a3b8);
}

#bbpress-forums .cf-forum-post-body table {
	width: 100%;
	border-collapse: collapse;
	background: var(--cf-bg-secondary, #1b202f);
	border: 1px solid var(--cf-border-color, #2a3143);
	border-radius: 8px;
	overflow: hidden;
	font-size: 0.88rem;
}

#bbpress-forums .cf-forum-post-body th,
#bbpress-forums .cf-forum-post-body td {
	border: 1px solid var(--cf-border-color, #2a3143);
	padding: 8px 10px;
	text-align: right;
	vertical-align: top;
}

#bbpress-forums .cf-forum-post-body th {
	background: rgba(212, 175, 55, 0.12);
	color: var(--cf-gold, #d4af37);
	font-weight: 600;
}

#bbpress-forums .cf-forum-post-body caption {
	caption-side: top;
	padding: 6px 4px;
	font-size: 0.82rem;
	color: var(--cf-muted, #94a3b8);
}

#bbpress-forums .cf-forum-post-body hr {
	border: none;
	border-top: 1px solid var(--cf-border-color, #2a3143);
	margin: 1em 0;
}

#bbpress-forums .cf-forum-post-body img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

#bbpress-forums .cf-forum-post-body pre,
#bbpress-forums .cf-forum-post-body code {
	font-family: ui-monospace, monospace;
	font-size: 0.86em;
}

#bbpress-forums .cf-forum-post-body pre {
	background: var(--cf-bg-primary, #141824);
	border: 1px solid var(--cf-border-color, #2a3143);
	border-radius: 8px;
	padding: 10px 12px;
	overflow-x: auto;
}

/*
 * Lead topic header: one row — override Astra parent inline CSS (column) on .coinfolio-topic-header-bar.
 * RTL: title/date inline-end; admin links inline-start (visual left) via flex order + justify.
 */
body #bbpress-forums .bbp-lead-topic li.bbp-header.coinfolio-topic-header-bar {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 10px 12px !important;
	direction: rtl !important;
	width: 100% !important;
	box-sizing: border-box !important;
}

#bbpress-forums .bbp-lead-topic .coinfolio-topic-header-bar {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 12px;
	direction: rtl;
	width: 100%;
	box-sizing: border-box;
}

#bbpress-forums .bbp-lead-topic .coinfolio-topic-header-title-date-row {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: baseline;
	justify-content: flex-start;
	gap: 10px;
	flex: 1 1 auto;
	min-width: 0;
}

#bbpress-forums .bbp-lead-topic .coinfolio-topic-header-title {
	font-size: 1rem;
	font-weight: 700;
	color: var(--cf-gold, #d4af37);
	text-align: right;
	flex: 0 1 auto;
	min-width: 0;
	white-space: normal;
}

#bbpress-forums .bbp-lead-topic .coinfolio-topic-header-date {
	font-size: 0.82rem;
	font-weight: 500;
	color: var(--cf-text, #e2e8f0);
	opacity: 0.9;
	flex-shrink: 0;
	white-space: nowrap;
}

#bbpress-forums .bbp-lead-topic .coinfolio-topic-header-actions-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 6px;
	flex: 0 0 auto;
	width: auto;
	max-width: min(50%, 100%);
	min-width: 0;
}

/*
 * Reply header: physical order LTR → # (left) | admin (center, RTL text) | date (right).
 * Keeps reply number on the far left; management links follow; timestamp on the far right.
 */
#bbpress-forums .coinfolio-reply-wrap .bbp-reply-header {
	position: relative;
	z-index: 1000;
}

#bbpress-forums .cf-forum-reply-meta-bar {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 10px 12px;
	flex-wrap: nowrap;
	direction: ltr;
	width: 100%;
	box-sizing: border-box;
}

#bbpress-forums .cf-forum-reply-permalink-num {
	flex: 0 0 auto;
	white-space: nowrap;
	font-weight: 600;
}

#bbpress-forums .cf-forum-reply-meta-actions {
	flex: 1 1 auto;
	min-width: 0;
	max-width: none;
	position: relative;
	display: flex;
	justify-content: flex-start;
	align-items: center;
	direction: rtl;
	text-align: right;
}

#bbpress-forums .cf-forum-reply-meta-datetime {
	flex: 0 1 auto;
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 8px;
	direction: rtl;
	text-align: right;
	min-width: 0;
}

/* Desktop / mobile: two separate header bars — only one visible per breakpoint */
#bbpress-forums .cf-forum-reply-meta-bar--mobile {
	display: none;
}

@media (min-width: 769px) {
	#bbpress-forums .cf-forum-reply-meta-bar--mobile {
		display: none !important;
	}
}

#bbpress-forums .cf-forum-reply-meta-actions .bbp-admin-links {
	display: inline;
}

#bbpress-forums .bbp-lead-topic .coinfolio-topic-header-actions-wrap {
	position: relative;
}

#bbpress-forums .cf-forum-bbp-admin-more-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--cf-border-color, #2a3143);
	border-radius: 8px;
	background: var(--cf-bg-primary, #141824);
	color: var(--cf-gold, #d4af37);
	cursor: pointer;
	line-height: 1;
	vertical-align: middle;
}

#bbpress-forums .cf-forum-bbp-admin-more-dots {
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1;
}

/* Desktop: expand “more” inline; hide ⋯ trigger */
@media (min-width: 769px) {
	#bbpress-forums .cf-forum-mobile-profile-bar {
		display: none !important;
	}

	#bbpress-forums .cf-forum-bbp-admin-more-trigger {
		display: none !important;
	}

	#bbpress-forums .cf-forum-bbp-admin-more-panel {
		display: inline !important;
		position: static !important;
		background: transparent !important;
		border: none !important;
		padding: 0 !important;
		margin: 0 !important;
		box-shadow: none !important;
		min-width: 0 !important;
	}

	#bbpress-forums .cf-forum-bbp-admin-more-panel[hidden] {
		display: inline !important;
	}
}

#bbpress-forums .bbp-lead-topic .coinfolio-topic-header-actions-wrap .bbp-admin-links a {
	font-size: 0.8rem;
}

/* Topic toolbar (עקוב / מועדפים): hide BuddyBoss pipe span if any remains */
#bbpress-forums .coinfolio-topic-actions .bb-topic-content-meta-sep {
	display: none !important;
}

/* Discussion / topic list — reinforce table-like list (discussion index) */
#bbpress-forums ul.bbp-topics {
	border: 1px solid var(--cf-border-color, #2a3143);
	border-radius: var(--cf-border-radius-holder, 8px);
	overflow: hidden;
	background: transparent;
}

#bbpress-forums .bbp-topics .bbp-header .forum-titles li {
	color: var(--cf-gold, #d4af37);
	font-weight: 600;
}

#bbpress-forums .bbp-topics .bbp-body ul.bbp-topic {
	border-color: var(--cf-border-color, #2a3143);
}

#bbpress-forums .bbp-topics .bbp-body ul.bbp-topic:hover {
	border-color: rgba(212, 175, 55, 0.25);
}

@media (max-width: 768px) {
	/* Widen gold forum box to viewport (Astra inline padding leaves black side gutters on phones) */
	body.single-topic #bbpress-forums,
	body.single-forum #bbpress-forums,
	body.topic.single #bbpress-forums,
	body.forum.single #bbpress-forums,
	body:has(#bbpress-forums) #bbpress-forums {
		width: calc(100vw - 24px) !important;
		max-width: min(100%, 100vw - 24px) !important;
		margin-left: auto !important;
		margin-right: auto !important;
		padding: 12px 10px !important;
		box-sizing: border-box !important;
	}

	body #bbpress-forums .coinfolio-reply-wrap {
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		box-sizing: border-box;
	}

	#bbpress-forums .cf-forum-reply-meta-bar--desktop {
		display: none !important;
	}

	#bbpress-forums .cf-forum-reply-meta-bar--mobile {
		display: flex !important;
		flex-direction: column;
		align-items: stretch;
		gap: 0.45rem;
		width: 100%;
		box-sizing: border-box;
		direction: rtl;
	}

	/* שורה 1: מספר תגובה + הגב משמאל, תאריך/שעה מימין (פיזי LTR) */
	#bbpress-forums .cf-forum-reply-meta-bar--mobile .cf-forum-reply-meta-row1 {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		gap: 6px 10px;
		width: 100%;
		direction: ltr;
	}

	#bbpress-forums .cf-forum-reply-meta-bar--mobile .cf-forum-reply-meta-num-reply-wrap {
		display: inline-flex;
		flex-direction: row;
		align-items: center;
		flex-wrap: wrap;
		gap: 4px 8px;
		justify-content: flex-start;
		flex: 0 1 auto;
		min-width: 0;
	}

	#bbpress-forums .cf-forum-reply-meta-bar--mobile .cf-forum-reply-meta-row1 .cf-forum-reply-meta-datetime {
		direction: rtl;
		text-align: right;
		flex: 0 1 auto;
		min-width: 0;
	}

	#bbpress-forums .cf-forum-reply-meta-bar--mobile .cf-forum-reply-meta-row2 {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: flex-end;
		gap: 6px;
		flex-wrap: wrap;
		width: 100%;
	}

	#bbpress-forums .cf-forum-reply-meta-bar--mobile .cf-forum-reply-meta-row2-links {
		display: inline-flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: flex-end;
		gap: 4px;
	}

	/* Stack profile strip + message full width (override theme side-by-side) */
	body #bbpress-forums .coinfolio-reply-wrap .reply,
	body #bbpress-forums .bbp-replies .coinfolio-reply-wrap .reply,
	#bbpress-forums .bbp-lead-topic .coinfolio-topic-post-row {
		display: flex !important;
		flex-direction: column !important;
		flex-wrap: nowrap !important;
		align-items: stretch !important;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
	}

	body #bbpress-forums .coinfolio-reply-wrap .bbp-reply-content,
	body #bbpress-forums .bbp-lead-topic .coinfolio-topic-content-cell {
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		flex: 1 1 auto !important;
		box-sizing: border-box;
	}

	body #bbpress-forums .coinfolio-reply-wrap .bbp-reply-author,
	body #bbpress-forums .bbp-lead-topic .coinfolio-topic-author-cell {
		width: 100% !important;
		max-width: 100% !important;
		float: none !important;
		clear: both !important;
		display: block !important;
	}

	#bbpress-forums .coinfolio-reply-wrap .bbp-reply-content.cf-forum-post-body,
	#bbpress-forums .bbp-lead-topic .bbp-topic-content.cf-forum-post-body {
		display: flex;
		flex-direction: column;
	}

	#bbpress-forums .coinfolio-reply-wrap .bbp-reply-content .coinfolio-forum-vote,
	#bbpress-forums .bbp-lead-topic .bbp-topic-content .coinfolio-forum-vote {
		order: 100;
		margin-top: 12px;
		width: 100%;
		box-sizing: border-box;
	}

	/* Narrow screens: allow topic header to wrap if admin links are long */
	#bbpress-forums .bbp-lead-topic .coinfolio-topic-header-bar {
		flex-wrap: wrap;
		align-items: flex-start;
	}

	#bbpress-forums .bbp-lead-topic .coinfolio-topic-header-actions-wrap {
		max-width: 100%;
		width: 100%;
		justify-content: flex-end;
	}

	#bbpress-forums .bbp-lead-topic .coinfolio-topic-post-row,
	#bbpress-forums .coinfolio-reply-wrap .reply,
	#bbpress-forums .bbp-replies .reply {
		flex-direction: column !important;
	}

	/* Mobile: admin “⋯” dropdown */
	#bbpress-forums .cf-forum-bbp-admin-more-panel[hidden] {
		display: none !important;
	}

	#bbpress-forums .cf-forum-bbp-admin-more-panel:not([hidden]) {
		display: block !important;
		position: absolute;
		left: 0;
		top: calc(100% + 4px);
		z-index: 10040;
		min-width: min(320px, calc(100vw - 24px));
		max-width: calc(100vw - 24px);
		padding: 10px !important;
		background: var(--cf-bg-secondary, #1b202f) !important;
		border: 1px solid var(--cf-border-color, #2a3143) !important;
		border-radius: 10px;
		box-shadow: var(--cf-shadow-elevation, 0 4px 12px rgba(0, 0, 0, 0.3));
	}

	#bbpress-forums .cf-forum-bbp-admin-more-panel.cf-forum--fixed-panel {
		position: fixed !important;
		left: 12px !important;
		right: 12px !important;
		width: auto !important;
		max-width: none !important;
		min-width: 0 !important;
		z-index: 10050 !important;
	}

	#bbpress-forums .coinfolio-reply-wrap.cf-forum-unified-reply-wrap {
		overflow: visible !important;
	}

	#bbpress-forums .bbp-lead-topic .coinfolio-topic-author-cell,
	#bbpress-forums .bbp-reply-author,
	#bbpress-forums .coinfolio-reply-wrap .bbp-reply-author,
	body #bbpress-forums .bbp-reply-author {
		flex: none !important;
		width: 100% !important;
		min-width: 0 !important;
		max-width: 100% !important;
		flex-direction: column !important;
		align-items: stretch !important;
		justify-content: flex-start !important;
		gap: 0 !important;
		padding: 0 !important;
		text-align: right !important;
		border-left: none !important;
		border-bottom: 1px solid var(--cf-border-color, #2a3143) !important;
	}

	#bbpress-forums .bbp-reply-author.cf-forum-unified-author,
	#bbpress-forums .coinfolio-topic-author-cell.cf-forum-unified-author {
		width: 100% !important;
		min-width: 0 !important;
		max-width: 100% !important;
	}

	/* Horizontal compact profile strip (mobile): name + forum rank + achievements + post count; 3-dot = gallery/compare/contacts/full profile */
	#bbpress-forums .bbp-reply-author .cf-forum-profile-sidebar-host,
	#bbpress-forums .bbp-topic-author .cf-forum-profile-sidebar-host {
		width: 100%;
		position: relative;
		padding-top: 4px;
		padding-bottom: 0 !important;
		margin-bottom: 0 !important;
		min-height: 0 !important;
	}

	/* Lead post: override Astra functions.php fixed 219px column — match reply strip width (H4). */
	body #bbpress-forums .bbp-lead-topic.cf-forum-unified-lead-topic .coinfolio-topic-author-cell.cf-forum-unified-author,
	body #bbpress-forums .bbp-lead-topic .coinfolio-topic-author-cell.cf-forum-unified-author {
		flex: 0 0 auto !important;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		min-height: 0 !important;
		padding: 8px 12px 0 !important;
	}

	#bbpress-forums .cf-forum-mobile-profile-bar {
		position: absolute;
		left: 8px;
		top: 6px;
		z-index: 20;
	}

	#bbpress-forums .cf-forum-mobile-actions-trigger {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 34px;
		height: 34px;
		margin: 0;
		padding: 0;
		border: 1px solid var(--cf-border-color, #2a3143);
		border-radius: 8px;
		background: var(--cf-bg-primary, #141824);
		color: var(--cf-gold, #d4af37);
		cursor: pointer;
		line-height: 1;
	}

	#bbpress-forums .cf-forum-mobile-actions-trigger-dots {
		font-size: 1.1rem;
		font-weight: 700;
		line-height: 1;
	}

	#bbpress-forums .cf-forum-mobile-actions-panel {
		position: absolute;
		left: 0;
		top: calc(100% + 4px);
		min-width: min(280px, calc(100vw - 32px));
		max-width: calc(100vw - 24px);
		z-index: 10045;
		padding: 10px;
		background: var(--cf-bg-secondary, #1b202f);
		border: 1px solid var(--cf-border-color, #2a3143);
		border-radius: 10px;
		box-shadow: var(--cf-shadow-elevation, 0 4px 12px rgba(0, 0, 0, 0.3));
		box-sizing: border-box;
	}

	#bbpress-forums .cf-forum-mobile-actions-panel.cf-forum--fixed-panel {
		position: fixed !important;
		left: 12px !important;
		right: 12px !important;
		width: auto !important;
		max-width: none !important;
		min-width: 0 !important;
		z-index: 10050 !important;
	}

	#bbpress-forums .cf-forum-mobile-actions-panel[hidden] {
		display: none !important;
	}

	#bbpress-forums .cf-forum-mobile-actions-panel:not([hidden]) {
		display: block !important;
	}

	#bbpress-forums .cf-forum-mobile-actions-inner {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		justify-content: center;
		gap: 8px;
	}

	#bbpress-forums .cf-profile-sidebar--forum .cf-profile-forum-toolbar {
		display: none !important;
	}

	#bbpress-forums .cf-profile-sidebar--forum {
		flex-direction: column !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		align-content: center !important;
		justify-content: flex-start !important;
		gap: 8px !important;
		padding: 8px 12px 0 12px !important;
		border-left: none !important;
		border-bottom: none !important;
		box-sizing: border-box !important;
	}

	#bbpress-forums .cf-profile-sidebar--forum .cf-profile-sidebar-avatar {
		display: none !important;
	}

	#bbpress-forums .cf-profile-sidebar--forum .cf-profile-sidebar-header {
		display: flex !important;
		flex-direction: row !important;
		align-items: center !important;
		justify-content: center !important;
		gap: 6px !important;
		text-align: center !important;
		width: 100% !important;
		flex: 0 1 auto !important;
		min-width: 0 !important;
		margin: 0 !important;
	}

	#bbpress-forums .cf-profile-sidebar--forum .cf-profile-sidebar-name {
		font-size: 0.88rem !important;
		white-space: nowrap !important;
		overflow: hidden !important;
		text-overflow: ellipsis !important;
		text-align: center !important;
		line-height: 1.25 !important;
		margin: 0 !important;
		max-width: 100%;
	}

	#bbpress-forums .cf-profile-sidebar--forum .cf-profile-ranks-below-name {
		flex: 0 1 auto !important;
		flex-direction: column !important;
		flex-wrap: nowrap !important;
		justify-content: center !important;
		align-items: center !important;
		gap: 5px !important;
		margin: 0 !important;
		width: 100% !important;
	}

	#bbpress-forums .cf-profile-sidebar--forum .cf-profile-rank-capsule-group--forum,
	#bbpress-forums .cf-profile-sidebar--forum .cf-profile-rank-capsule-group--collectors {
		display: flex !important;
		justify-content: center !important;
		width: 100% !important;
	}

	/* Pills: framed border from global rule; icon + label vertically centered in capsule (mobile). */
	#bbpress-forums .cf-profile-sidebar--forum .cf-profile-rank-pill {
		display: inline-flex !important;
		flex-direction: row-reverse !important;
		align-items: center !important;
		justify-content: center !important;
		align-self: center !important;
		padding: 6px 14px !important;
		min-height: 34px !important;
		box-sizing: border-box !important;
		line-height: 1 !important;
	}

	#bbpress-forums .cf-profile-sidebar--forum .cf-profile-rank-pill--forum {
		font-size: 0.68rem !important;
	}

	#bbpress-forums .cf-profile-sidebar--forum .cf-profile-rank-pill .dashicons {
		display: inline-flex !important;
		align-items: center !important;
		justify-content: center !important;
		line-height: 1 !important;
		margin: 0 !important;
		width: 14px !important;
		height: 14px !important;
		font-size: 14px !important;
		flex-shrink: 0 !important;
	}

	#bbpress-forums .cf-profile-sidebar--forum .cf-profile-rank-pill > span:not(.dashicons) {
		display: inline-flex !important;
		align-items: center !important;
		line-height: 1.15 !important;
	}

	#bbpress-forums .cf-profile-sidebar--forum .cf-profile-summary-card {
		flex: 0 0 auto !important;
		display: flex !important;
		flex-direction: column !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		justify-content: center !important;
		gap: 6px !important;
		padding: 0 0 5px 0 !important;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		background: transparent !important;
		border: none !important;
	}

	#bbpress-forums .cf-profile-sidebar--forum .cf-profile-achievements-row--forum-in-card {
		margin: 0 !important;
		padding: 0 !important;
		border: none !important;
		flex: 0 0 auto !important;
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: wrap !important;
		align-items: center !important;
		justify-content: center !important;
		gap: 6px !important;
		width: 100% !important;
	}

	#bbpress-forums .cf-profile-sidebar--forum .cf-profile-summary-list {
		display: contents;
	}

	#bbpress-forums .cf-profile-sidebar--forum .cf-profile-summary-row {
		padding: 0 !important;
		flex-direction: row !important;
		align-items: center !important;
		justify-content: center !important;
		gap: 4px !important;
		width: 100% !important;
	}

	#bbpress-forums .cf-profile-sidebar--forum .cf-profile-summary-list .cf-profile-summary-row:nth-child(2) {
		display: none !important;
	}

	#bbpress-forums .cf-profile-sidebar--forum .cf-profile-summary-label {
		display: inline !important;
		font-size: 0.72rem !important;
		font-weight: 500 !important;
		color: var(--cf-muted, #94a3b8) !important;
	}

	#bbpress-forums .cf-profile-sidebar--forum .cf-profile-summary-value {
		font-size: 0.8rem !important;
		font-weight: 700 !important;
		color: var(--cf-gold, #d4af37) !important;
		width: auto !important;
	}

	#bbpress-forums .cf-profile-sidebar--forum .cf-profile-summary-row:nth-child(1) .cf-profile-summary-value::before {
		content: none !important;
	}

	.coinfolio-podium-signature {
		display: none !important;
	}

	.cf-forum-contact-wrap {
		display: inline !important;
		margin: 0 4px !important;
	}

	.cf-forum-post-count {
		display: inline !important;
		margin: 0 4px !important;
	}
}

/*
 * Desktop forum: embedded binders / single holder / podium — rectangular flags, link btn contrast, signature actions visible.
 * Flag size: same as ui-renderers.php unified holder + like (mobile block ~7587–7612): 18×18px box, img max 18×14 — matches .cf-like-btn min-height 18px.
 * (Mobile binder rules live in @media max-width 768 above.)
 */
@media (min-width: 769px) {
	/* Flags: show in forum embeds (profile-embed-support hides globally); dimensions = core holder grid, not enlarged */
	#bbpress-forums .cf-binder-embed .cf-binder-holder-podium .cf-v4-flag-corner.cf-v4-flag-iso,
	#bbpress-forums .cf-binder-embed .cf-binder-holder-podium .cf-v4-flag-corner.cf-v4-flag-lazy:not(:empty),
	#bbpress-forums .cf-embed-holder-wrap .cf-binder-holder-podium .cf-v4-flag-corner.cf-v4-flag-iso,
	#bbpress-forums .cf-embed-holder-wrap .cf-binder-holder-podium .cf-v4-flag-corner.cf-v4-flag-lazy:not(:empty),
	#bbpress-forums .coinfolio-podium-signature .cf-v4-flag-corner.cf-v4-flag-iso,
	#bbpress-forums .coinfolio-podium-signature .cf-v4-flag-corner.cf-v4-flag-lazy:not(:empty) {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		top: auto !important;
		left: auto !important;
		bottom: 0 !important;
		right: 0 !important;
		transform: translate(50%, 50%) !important;
		width: 18px !important;
		height: 18px !important;
		min-width: 18px !important;
		min-height: 18px !important;
		max-width: none !important;
		max-height: none !important;
		padding: 0 !important;
		border-radius: 4px !important;
		border-width: 1px !important;
		background: rgba(20, 24, 36, 0.9) !important;
		border: 1px solid var(--cf-border-color, #2a3143) !important;
		overflow: hidden !important;
		box-sizing: border-box !important;
		z-index: 15;
	}

	#bbpress-forums .cf-binder-embed .cf-binder-holder-podium .cf-v4-flag-corner-img,
	#bbpress-forums .cf-embed-holder-wrap .cf-binder-holder-podium .cf-v4-flag-corner-img,
	#bbpress-forums .coinfolio-podium-signature .cf-v4-flag-corner-img {
		display: block !important;
		width: auto !important;
		max-width: 18px !important;
		height: 14px !important;
		max-height: 14px !important;
		min-height: 0 !important;
		object-fit: contain !important;
		object-position: center !important;
		border-radius: 2px !important;
	}

	/* “מעבר לפריט”: dark chip + gold stroke (like album grid), not gold-on-gold */
	#bbpress-forums .cf-binder-embed .cf-binder-holder-podium .cf-v4-link.cf-v4-link-to-coin,
	#bbpress-forums .cf-embed-holder-wrap .cf-binder-holder-podium .cf-v4-link.cf-v4-link-to-coin,
	#bbpress-forums .coinfolio-podium-signature .cf-v4-link.cf-v4-link-to-coin {
		background: var(--cf-bg-secondary, #1b202f) !important;
		color: var(--cf-gold, #d4af37) !important;
		border: 1px solid var(--cf-gold, #d4af37) !important;
		border-radius: 6px !important;
	}

	#bbpress-forums .cf-binder-embed .cf-binder-holder-podium .cf-v4-link.cf-v4-link-to-coin:hover,
	#bbpress-forums .cf-embed-holder-wrap .cf-binder-holder-podium .cf-v4-link.cf-v4-link-to-coin:hover,
	#bbpress-forums .coinfolio-podium-signature .cf-v4-link.cf-v4-link-to-coin:hover {
		background: rgba(212, 175, 55, 0.12) !important;
		color: var(--cf-gold, #d4af37) !important;
	}

	#bbpress-forums .cf-binder-embed .cf-binder-holder-podium .cf-v4-link.cf-v4-link-to-coin svg,
	#bbpress-forums .cf-embed-holder-wrap .cf-binder-holder-podium .cf-v4-link.cf-v4-link-to-coin svg,
	#bbpress-forums .coinfolio-podium-signature .cf-v4-link.cf-v4-link-to-coin svg {
		stroke: currentColor !important;
		fill: none !important;
	}

	#bbpress-forums .coinfolio-podium-signature .cf-like-wrap-holder-frame,
	#bbpress-forums .coinfolio-podium-signature .cf-like-wrap-holder-in-album {
		z-index: 17;
	}
}
