.dgg-bd-progress {
	--dgg-bd-accent: #b3812f;
	/* Derived from --dgg-bd-accent via color-mix() rather than a fixed hex,
	   so a Project's custom accent color (see class-project.php) recolors
	   the reached-tier fill/text and progress fill too, not just the raw
	   accent spots — no PHP-side color math needed. */
	--dgg-bd-accent-soft: color-mix(in srgb, var(--dgg-bd-accent) 22%, white);
	--dgg-bd-accent-text: color-mix(in srgb, var(--dgg-bd-accent) 70%, black);
	--dgg-bd-border: #e8dfd0;
	--dgg-bd-bg: #f8f5f0;
	--dgg-bd-card-bg: #ffffff;
	--dgg-bd-text: #2b2620;
	--dgg-bd-text-muted: #8a7f6b;

	background: var(--dgg-bd-bg);
	border: 1px solid var(--dgg-bd-border);
	border-radius: 12px;
	padding: 16px;
	margin: 0 0 20px;
	font-size: 14px;
	line-height: 1.5;
	box-sizing: border-box;
}
.dgg-bd-progress * {
	box-sizing: border-box;
}

/*
 * ≤4 tiers: cards share the row equally (.dgg-bd-tier's default flex below) —
 * they always fit, no scrolling needed. >4 tiers: the PHP side adds
 * .dgg-bd-tiers--many, which fixes each card at 25% of the row's width (so
 * roughly 4 fit at a time) instead of shrinking every card to fit; the row
 * scrolls horizontally for the rest. scroll-snap keeps cards aligned as the
 * shopper (or the auto-center script, see progress-bar.js) scrolls.
 *
 * Fade edges are disabled for now (JS still toggles the has-overflow-left/
 * has-overflow-right classes on .dgg-bd-tiers-wrap — harmless with no CSS
 * hooked to them — so they're a one-line add back if wanted later).
 */
.dgg-bd-tiers-wrap {
	position: relative;
	margin: 0 0 14px;
}

.dgg-bd-tiers {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	padding-bottom: 7px;
	scrollbar-width: thin;
	scrollbar-color: var(--dgg-bd-border) transparent;
}
.dgg-bd-tiers::-webkit-scrollbar {
	height: 5px;
}
.dgg-bd-tiers::-webkit-scrollbar-thumb {
	background: var(--dgg-bd-border);
	border-radius: 3px;
}
.dgg-bd-tier {
	flex: 1 1 0;
	min-width: 0;
	scroll-snap-align: start;
	position: relative;
	text-align: center;
	background: var(--dgg-bd-card-bg);
	border: 1px solid var(--dgg-bd-border);
	border-radius: 10px;
	padding: 14px 4px 10px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.dgg-bd-tiers--many .dgg-bd-tier {
	flex: 0 0 25%;
	width: 25%;
}
.dgg-bd-tier.is-next {
	border-color: var(--dgg-bd-accent);
}
.dgg-bd-tier.is-reached {
	background: var(--dgg-bd-accent-soft);
	border-color: var(--dgg-bd-accent);
}
.dgg-bd-tier-num {
	display: block;
	font-size: 20px;
	font-weight: 700;
	color: var(--dgg-bd-text);
}
.dgg-bd-tier-or {
	display: block;
	font-size: 10px;
	line-height: 1.4;
	min-height: 14px;
	color: var(--dgg-bd-text-muted);
	margin-top: 2px;
}
.dgg-bd-tier-reward {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	font-weight: 600;
	color: var(--dgg-bd-text-muted);
	word-break: break-word;
}
.dgg-bd-tier.is-reached .dgg-bd-tier-num,
.dgg-bd-tier.is-reached .dgg-bd-tier-reward {
	color: var(--dgg-bd-accent-text);
}

.dgg-bd-counter {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 14px;
}
.dgg-bd-counter-frac {
	flex: 0 0 auto;
	font-size: 13px;
	font-weight: 700;
	color: var(--dgg-bd-text);
}
.dgg-bd-counter-bar {
	flex: 1 1 auto;
	display: flex;
	gap: 4px;
}
.dgg-bd-counter-seg {
	flex: 1 1 0;
	height: 6px;
	border-radius: 3px;
	background: var(--dgg-bd-border);
}
.dgg-bd-counter-seg.is-filled {
	background: var(--dgg-bd-accent);
}

/*
 * Kiểu "các ô tròn": cùng khung segment ở trên, chỉ đổi hình dạng mỗi ô —
 * ô chưa đạt chỉ có viền nét đứt (rỗng), ô đã đạt tô đặc màu accent.
 */
.dgg-bd-counter--dots .dgg-bd-counter-bar {
	gap: 10px;
}
.dgg-bd-counter--dots .dgg-bd-counter-seg {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: transparent;
	border: 2px dashed var(--dgg-bd-border);
}
.dgg-bd-counter--dots .dgg-bd-counter-seg.is-filled {
	background: var(--dgg-bd-accent);
	border: 2px solid var(--dgg-bd-accent);
}

/* Kiểu "1 thanh liền": một track duy nhất, fill theo % thay vì chia segment. */
.dgg-bd-counter--bar .dgg-bd-counter-track {
	flex: 1 1 auto;
	height: 6px;
	border-radius: 3px;
	background: var(--dgg-bd-border);
	overflow: hidden;
}
.dgg-bd-counter--bar .dgg-bd-counter-fill {
	display: block;
	height: 100%;
	border-radius: 3px;
	background: var(--dgg-bd-accent);
	transition: width 0.2s ease;
}

.dgg-bd-progress-msg {
	margin: 0;
	text-align: left;
	color: var(--dgg-bd-text);
}
.dgg-bd-progress-msg strong {
	color: var(--dgg-bd-accent);
}
.dgg-bd-progress-msg.is-max {
	font-weight: 600;
}

@media (max-width: 420px) {
	.dgg-bd-tier-num {
		font-size: 16px;
	}
	.dgg-bd-tier-reward {
		font-size: 11px;
	}
}
