/* FXNook Backtests - results block, card, preview. */

.fxnbt, .fxnbt-card, .fxnbt-preview {
	--bt-green: var(--fxn-green, #9DCC4C);
	--bt-green-dark: var(--fxn-green-deep, #4A7515);
	--bt-red: #d93025;
	--bt-ink: var(--fxn-ink, #231F20);
	--bt-text: var(--fxn-text, #4A4546);
	--bt-muted: var(--fxn-muted, #6B6667);
	--bt-line: var(--fxn-line, #E7E5E2);
	--bt-bg: var(--fxn-surface, #F7F7F4);
	color: var(--bt-text);
}

/* ---------- charts ---------- */

.fxnbt-chart {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 0 8px;
	color: var(--bt-green-dark);
	font-family: inherit;
}
.fxnbt-chart.is-down { color: var(--bt-red); }

.fxnbt-g    { stroke: var(--fxn-line, #E7E5E2); stroke-width: 1; }
.fxnbt-t    { fill: var(--fxn-muted, #6B6667); font-size: 11px; }
.fxnbt-area { fill: url(#fxnbt-fill); }
.fxnbt-line { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.fxnbt-dd   { stroke: var(--bt-red); stroke-width: 1.5; stroke-dasharray: 4 3; }
.fxnbt-ddp  { fill: var(--bt-red); }
.fxnbt-bar-up   { fill: var(--bt-green); opacity: .85; }
.fxnbt-bar-down { fill: var(--bt-red); opacity: .8; }
.fxnbt-chart--bars { color: var(--bt-ink); }

/* ---------- full block: premium, grouped ---------- */

.fxnbt .woocommerce-Price-amount,
.fxnbt .woocommerce-Price-amount bdi,
.fxnbt .woocommerce-Price-currencySymbol { display: inline !important; white-space: nowrap; font-size: inherit; color: inherit; }

.fxnbt-panel {
	margin: 16px 0 0;
	padding: 18px 20px 14px;
	border: 1px solid var(--bt-line);
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(35, 31, 32, .03);
}
.fxnbt-panel__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; margin: 0 0 10px; }
.fxnbt-panel__title { margin: 0; font-size: 14px; font-weight: 800; color: var(--bt-ink); letter-spacing: .01em; }
.fxnbt-panel__meta  { margin: 0; font-size: 12.5px; color: var(--bt-muted); }
.fxnbt-panel__legend { display: flex; align-items: center; gap: 6px 14px; margin: 4px 0 0; font-size: 12px; color: var(--bt-muted); }
.fxnbt-legend { display: inline-block; width: 18px; height: 3px; border-radius: 2px; background: var(--bt-green); vertical-align: middle; margin-right: 2px; }
.fxnbt-legend--dd { background: repeating-linear-gradient(90deg, var(--bt-red) 0 4px, transparent 4px 7px); }
.fxnbt-panel .fxnbt-chart { margin: 0; }
.fxnbt-panel .fxnbt-hint-line { margin: -4px 0 12px; }

/* ---------- full block ---------- */

.fxnbt-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 18px;
	padding: 0 0 16px;
	border-bottom: 1px solid var(--bt-line);
}
.fxnbt-title  { margin: 0; font-size: 22px; font-weight: 800; color: var(--bt-ink); letter-spacing: -.01em; }
.fxnbt-period { margin: 6px 0 0; font-size: 13px; color: var(--bt-muted); }

.fxnbt-download {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border-radius: 10px;
	background: var(--bt-green);
	color: var(--fxn-ink, #231F20) !important;
	font-size: 13.5px;
	font-weight: 700;
	text-decoration: none !important;
	white-space: nowrap;
}
.fxnbt-download svg { width: 18px; height: 18px; fill: currentColor; }
.fxnbt-download:hover { background: var(--fxn-green-hover, #8BBB3B); }
.fxnbt-download--alt {
	background: #fff; color: var(--bt-ink) !important; border: 1px solid var(--bt-line);
}
.fxnbt-download--alt:hover { background: var(--fxn-surface, #F7F7F4); border-color: var(--fxn-line-strong, #D5D2CE); }
.fxnbt-download--off { background: var(--bt-bg); color: var(--bt-muted) !important; border: 1px solid var(--bt-line); }
.fxnbt-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fxnbt-download--mfb {
	background: #fff;
	color: var(--fxn-ink, #231F20) !important;
	border: 1px solid var(--bt-line);
	box-shadow: 0 1px 2px rgba(35, 31, 32, .05);
}
.fxnbt-download--mfb:hover { background: var(--fxn-surface, #F7F7F4); border-color: var(--fxn-line-strong, #D5D2CE); }

.fxnbt-kpis {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
	margin: 0 0 4px;
	padding: 0;
}
.fxnbt-kpis li {
	position: relative;
	margin: 0;
	padding: 14px 16px 12px;
	border: 1px solid var(--bt-line);
	border-radius: 14px;
	background: linear-gradient(180deg, var(--fxn-surface, #F7F7F4) 0%, #fff 100%);
	overflow: hidden;
}
.fxnbt-kpis li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--fxn-line-strong, #D5D2CE); }
.fxnbt-kpis li.good::before { background: var(--bt-green); }
.fxnbt-kpis li.bad::before  { background: var(--bt-red); }
.fxnbt-kpis li span   { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--bt-muted); }
.fxnbt-kpis li strong { display: block; margin-top: 6px; font-size: 26px; font-weight: 800; color: var(--bt-ink); line-height: 1.1; letter-spacing: -.01em; white-space: nowrap; }
.fxnbt-kpis li em     { display: block; margin-top: 4px; font-size: 12.5px; font-style: normal; color: var(--bt-muted); white-space: nowrap; }
.fxnbt-kpis li.good strong { color: var(--bt-green-dark); }
.fxnbt-kpis li.bad strong  { color: var(--bt-red); }

.fxnbt-sub { margin: 14px 0 4px; font-size: 13px; font-weight: 700; color: var(--bt-ink); }

.fxnbt-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 32px;
	margin: 0;
	padding: 0;
}
.fxnbt-grid > div {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--bt-line);
	font-size: 13.5px;
	min-width: 0;
}
.fxnbt-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
.fxnbt-grid dt { white-space: nowrap; }
.fxnbt-grid dd { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fxnbt-grid dt { margin: 0; color: var(--bt-muted); font-weight: 500; }
.fxnbt-grid dd { margin: 0; color: var(--bt-ink); font-weight: 700; text-align: right; }
.fxnbt-grid dd small { font-weight: 500; color: var(--bt-muted); }
.fxnbt-grid .good dd { color: var(--bt-green-dark); }
.fxnbt-grid .bad dd  { color: var(--bt-red); }

.fxnbt-note {
	margin: 16px 0 0;
	padding: 14px 16px;
	border-radius: 10px;
	background: var(--bt-bg);
	font-size: 14px;
}
.fxnbt-note strong { display: block; margin-bottom: 4px; color: var(--bt-ink); }
.fxnbt-note p { margin: 0 0 6px; }
.fxnbt-note p:last-child { margin: 0; }

.fxnbt-disclaimer { margin: 14px 0 0; font-size: 12px; color: var(--bt-muted); }

/* ---------- the live-results panel ---------- */

.fxnbt-card {
	margin: 4px 0 20px;
	padding: 18px 20px 14px;
	border-radius: 16px;
	background: linear-gradient(160deg, var(--fxn-ink, #231F20) 0%, var(--fxn-ink, #231F20) 60%, var(--fxn-ink, #231F20) 100%);
	color: var(--fxn-line, #E7E5E2);
	box-shadow: 0 12px 32px rgba(35, 31, 32, .22);
	overflow: hidden;
}

.fxnbt-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0 0 6px; }

.fxnbt-card__label {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: rgba(230, 237, 245, .7);
}
.fxnbt-card__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fxn-subtle, #9A9596); box-shadow: 0 0 0 4px rgba(154, 149, 150, .18); }
.fxnbt-card--live .fxnbt-card__dot { background: var(--fxn-green, #9DCC4C); box-shadow: 0 0 0 4px rgba(157, 204, 76, .18); animation: fxnbt-pulse 2s infinite; }
@keyframes fxnbt-pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(157, 204, 76, .18); } 50% { box-shadow: 0 0 0 7px rgba(157, 204, 76, .06); } }
.fxnbt-card__tick { width: 14px; height: 14px; fill: var(--fxn-green, #9DCC4C); }
.fxnbt-card__private { margin: -6px 0 10px; padding: 6px 10px; border-radius: 8px; background: rgba(255, 199, 71, .15); color: #ffd777; font-size: 12px; }

.fxnbt-title .fxnbt-badge { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.fxnbt-badge--backtest { background: var(--fxn-surface-2, #EFEEEA); color: var(--fxn-text, #4A4546); }
.fxnbt-badge--live     { background: var(--fxn-green-tint, #F2F8E6); color: var(--fxn-green-deep, #4A7515); }
.fxnbt-card.is-down .fxnbt-card__dot { background: #ff6b5f; box-shadow: 0 0 0 4px rgba(255, 107, 95, .18); }

.fxnbt-card__growth {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin: 6px 0 0;
	font-size: 34px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -.02em;
	color: var(--fxn-green, #9DCC4C);
}
.fxnbt-card.is-down .fxnbt-card__growth { color: #ff6b5f; }
.fxnbt-card__growth small { font-size: 13.5px; font-weight: 600; color: rgba(230, 237, 245, .75); letter-spacing: 0; }
.fxnbt-card__growth .woocommerce-Price-amount { color: inherit; }

.fxnbt-card__period { margin: 6px 0 0; font-size: 12.5px; color: rgba(230, 237, 245, .6); }

.fxnbt-card__link {
	flex: 0 0 auto;
	padding: 7px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .1);
	color: #fff !important;
	font-size: 12.5px;
	font-weight: 700;
	text-decoration: none !important;
	white-space: nowrap;
}
.fxnbt-card__link:hover { background: rgba(255, 255, 255, .18); }
.fxnbt-card__links { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.fxnbt-card__link--live { background: var(--fxn-green, #9DCC4C); color: var(--fxn-ink, #231F20) !important; }
.fxnbt-card__link--live:hover { background: var(--fxn-green-hover, #8BBB3B); }
.fxnbt-livelink { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--fxn-green-tint, #F2F8E6); color: var(--fxn-green-deep, #4A7515) !important; font-weight: 700; text-decoration: none !important; }

.fxnbt-card__chart { margin: 8px -6px 4px; }
.fxnbt-card__chart .fxnbt-chart { margin: 0; color: var(--fxn-green, #9DCC4C); }
.fxnbt-card.is-down .fxnbt-card__chart .fxnbt-chart { color: #ff6b5f; }
.fxnbt-card .fxnbt-g { stroke: rgba(255, 255, 255, .08); }
.fxnbt-card .fxnbt-t { fill: rgba(230, 237, 245, .55); font-size: 10.5px; }
.fxnbt-card .fxnbt-line { stroke-width: 2.4; }
.fxnbt-card .fxnbt-dd { stroke: #ff6b5f; }
.fxnbt-card .fxnbt-ddp { fill: #ff6b5f; }

.fxnbt-card__kpis {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
	gap: 8px;
	margin: 0;
	padding: 12px 0 0;
	border-top: 1px solid rgba(255, 255, 255, .1);
}
.fxnbt-card__kpis li { margin: 0; min-width: 0; }
.fxnbt-card__kpis span   { display: block; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: rgba(230, 237, 245, .55); white-space: nowrap; }
.fxnbt-card__kpis strong { display: block; margin-top: 2px; font-size: 15px; font-weight: 800; color: #fff; white-space: nowrap; }
.fxnbt-card__kpis strong.good { color: var(--fxn-green, #9DCC4C); }
.fxnbt-card__kpis strong.bad  { color: #ff8a7f; }
.fxnbt-card--linkonly .fxnbt-widget__body { padding: 8px; }
.fxnbt-card__kpis--mfb { grid-template-columns: repeat(3, 1fr); row-gap: 12px; }
.fxnbt-card__foot { margin: 12px 0 0; font-size: 11.5px; color: rgba(230, 237, 245, .5); }
.fxnbt-card__warn { color: #ffd777; }
.fxnbt-widget-preview .fxnbt-card { margin: 6px 0 0; }
.fxnbt-card__note { margin: 8px 0 0; font-size: 12.5px; color: rgba(230, 237, 245, .7); }

/* ---------- the platform's live widget ---------- */

.fxnbt-widget { margin: 0 0 18px; }
.fxnbt-widget__title { display: flex; justify-content: space-between; align-items: center; margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--bt-muted); }
.fxnbt-widget__title a { font-weight: 700; color: var(--bt-green-dark); text-decoration: none; letter-spacing: 0; text-transform: none; }
.fxnbt-widget__body { border: 1px solid var(--bt-line); border-radius: 12px; padding: 10px; background: #fff; overflow: hidden; }
.fxnbt-widget__body img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.fxnbt-widget__body iframe { display: block; width: 100%; max-width: 100%; border: 0; }
.fxnbt-card .fxnbt-widget { margin: 6px 0 12px; }
.fxnbt-card .fxnbt-widget__title { color: rgba(230, 237, 245, .6); }
.fxnbt-card .fxnbt-widget__title a { color: var(--fxn-green, #9DCC4C); }
.fxnbt-card .fxnbt-widget__body { border-color: rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .06); }
.fxnbt-widget-preview { margin-top: 10px; padding: 10px; border: 1px dashed var(--fxn-line, #E7E5E2); border-radius: 10px; background: var(--fxn-surface, #F7F7F4); }
.fxnbt-widget-preview > span { display: block; margin-bottom: 6px; font-size: 12px; color: var(--fxn-muted, #6B6667); }
.fxnbt-widget-preview img { max-width: 100%; height: auto; }
.fxnbt-widget-preview iframe { width: 100%; border: 0; }

/* ---------- light card ---------- */

.fxnbt-card--light {
	background: #fff;
	color: var(--bt-text);
	border: 1px solid var(--bt-line);
	box-shadow: 0 1px 2px rgba(35, 31, 32, .04), 0 10px 28px rgba(35, 31, 32, .07);
}
.fxnbt-card--light .fxnbt-card__label { color: var(--bt-muted); }
.fxnbt-card--light .fxnbt-card__dot { background: var(--fxn-subtle, #9A9596); box-shadow: 0 0 0 4px rgba(154, 149, 150, .18); }
.fxnbt-card--light.fxnbt-card--live .fxnbt-card__dot { background: var(--bt-green); box-shadow: 0 0 0 4px rgba(157, 204, 76, .18); }
.fxnbt-card--light .fxnbt-card__tick { fill: var(--bt-green-dark); }
.fxnbt-card--light .fxnbt-card__growth { color: var(--bt-green-dark); }
.fxnbt-card--light.is-down .fxnbt-card__growth { color: var(--bt-red); }
.fxnbt-card--light .fxnbt-card__growth small { color: var(--bt-muted); }
.fxnbt-card--light .fxnbt-card__period { color: var(--bt-muted); }
.fxnbt-card--light .fxnbt-card__account { color: var(--bt-text); font-weight: 600; }
.fxnbt-card--light .fxnbt-card__link { background: var(--bt-bg); color: var(--bt-ink) !important; border: 1px solid var(--bt-line); }
.fxnbt-card--light .fxnbt-card__link:hover { background: var(--fxn-surface, #F7F7F4); }
.fxnbt-card--light .fxnbt-card__link--live { background: var(--bt-green); color: var(--fxn-ink, #231F20) !important; border-color: var(--bt-green); }
.fxnbt-card--light .fxnbt-card__link--live:hover { background: var(--fxn-green-hover, #8BBB3B); }
.fxnbt-card--light .fxnbt-card__chart .fxnbt-chart { color: var(--bt-green-dark); }
.fxnbt-card--light.is-down .fxnbt-card__chart .fxnbt-chart { color: var(--bt-red); }
.fxnbt-card--light .fxnbt-g { stroke: var(--fxn-surface, #F7F7F4); }
.fxnbt-card--light .fxnbt-t { fill: var(--fxn-muted, #6B6667); }
.fxnbt-card--light .fxnbt-dd { stroke: var(--bt-red); }
.fxnbt-card--light .fxnbt-ddp { fill: var(--bt-red); }
.fxnbt-card--light .fxnbt-card__kpis { border-top-color: var(--bt-line); }
.fxnbt-card--light .fxnbt-card__kpis span { color: var(--bt-muted); }
.fxnbt-card--light .fxnbt-card__kpis strong { color: var(--bt-ink); }
.fxnbt-card--light .fxnbt-card__kpis strong.good { color: var(--bt-green-dark); }
.fxnbt-card--light .fxnbt-card__kpis strong.bad  { color: var(--bt-red); }
.fxnbt-card--light .fxnbt-card__foot { color: var(--bt-muted); }
.fxnbt-card--light .fxnbt-card__warn { color: #8a5a00; }
.fxnbt-card--light .fxnbt-card__note { color: var(--bt-text); }
.fxnbt-card--light .fxnbt-card__private { background: #fdf3d8; color: #8a5a00; }
.fxnbt-card--light .fxnbt-widget__title { color: var(--bt-muted); }
.fxnbt-card--light .fxnbt-widget__title a { color: var(--bt-green-dark); }
.fxnbt-card--light .fxnbt-widget__body { border-color: var(--bt-line); background: #fff; }

.fxnbt-grid--account { margin-bottom: 6px; }
.fxnbt-hint-line { margin: 10px 0 0; font-size: 12.5px; color: var(--bt-muted); }
.fxnbt-hint-line--own {
	padding: 10px 13px; border-radius: 10px; border: 1px dashed var(--bt-line);
	background: var(--bt-bg); line-height: 1.5;
}

/* ---------- preview (vendor form, admin) ---------- */

.fxnbt-preview { margin: 8px 0 0; }
.fxnbt-preview__list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 18px; }
.fxnbt-preview__list li { display: flex; justify-content: space-between; gap: 10px; margin: 0; padding: 5px 0; border-bottom: 1px solid var(--bt-line); font-size: 13px; }
.fxnbt-preview__list span { color: var(--bt-muted); }
.fxnbt-preview__list strong { color: var(--bt-ink); }
.fxnbt-preview__list strong.good { color: var(--bt-green-dark); }
.fxnbt-preview__list strong.bad  { color: var(--bt-red); }
.fxnbt-preview__list small { font-weight: 500; color: var(--bt-muted); }
.fxnbt-preview__period { margin: 8px 0 0; font-size: 12.5px; color: var(--bt-muted); }

@media (max-width: 900px) {
	.fxnbt-grid { grid-template-columns: 1fr; }
	.fxnbt-grid > div:nth-last-child(-n+2) { border-bottom: 1px solid var(--bt-line); }
	.fxnbt-grid > div:last-child { border-bottom: 0; }
}
@media (max-width: 700px) {
	.fxnbt-kpis { grid-template-columns: 1fr 1fr; }
	.fxnbt-kpis li strong { font-size: 22px; }
	.fxnbt-card__body { grid-template-columns: 1fr; }
	.fxnbt-panel { padding: 14px; }
}

/* ---------- performance badges ---------- */

.fxnbt-pbadge {
	--pb: var(--fxn-green-deep, #4A7515);
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	padding: 4px 12px 4px 4px;
	border-radius: 999px;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: .01em;
	line-height: 1.2;
	color: color-mix(in srgb, var(--pb) 78%, #111);
	background:
		linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0)),
		linear-gradient(135deg, color-mix(in srgb, var(--pb) 14%, #fff), color-mix(in srgb, var(--pb) 6%, #fff));
	border: 1px solid color-mix(in srgb, var(--pb) 30%, #fff);
	box-shadow:
		0 1px 2px rgba(35, 31, 32, .06),
		0 4px 12px color-mix(in srgb, var(--pb) 14%, transparent),
		inset 0 1px 0 rgba(255, 255, 255, .7);
	white-space: nowrap;
	cursor: default;
	transition: transform .15s ease, box-shadow .15s ease;
}
.fxnbt-pbadge[data-why] { cursor: pointer; }
.fxnbt-pbadge[data-why]:hover,
.fxnbt-pbadge[data-why]:focus-visible {
	transform: translateY(-1px);
	box-shadow:
		0 2px 4px rgba(35, 31, 32, .08),
		0 8px 18px color-mix(in srgb, var(--pb) 22%, transparent),
		inset 0 1px 0 rgba(255, 255, 255, .7);
	outline: none;
}
.fxnbt-pbadge__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px color-mix(in srgb, var(--pb) 30%, transparent);
	font-size: 13px;
	line-height: 1;
	flex: 0 0 auto;
}
.fxnbt-pbadge__name { padding-right: 1px; }
.fxnbt-pbadge__i {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 15px;
	height: 15px;
	margin-left: 1px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--pb) 16%, #fff);
	color: var(--pb);
	font-size: 9.5px;
	font-weight: 800;
	font-style: italic;
	font-family: Georgia, "Times New Roman", serif;
	line-height: 1;
}
.fxnbt-pbadge--warning { color: color-mix(in srgb, var(--pb) 85%, #111); }
.fxnbt-pbadge--info {
	color: var(--fxn-text, #4A4546);
	background: linear-gradient(180deg, var(--fxn-surface, #F7F7F4), var(--fxn-surface, #F7F7F4));
	border: 1px dashed var(--fxn-line-strong, #D5D2CE);
	box-shadow: 0 1px 2px rgba(35, 31, 32, .05), inset 0 1px 0 #fff;
}
.fxnbt-pbadge--info .fxnbt-pbadge__icon { box-shadow: 0 1px 3px rgba(35, 31, 32, .12); filter: grayscale(.4); }
.fxnbt-pbadge--info .fxnbt-pbadge__i { background: var(--fxn-line, #E7E5E2); color: var(--fxn-text, #4A4546); }

/* the list in the results tab: one row per badge, icon tile on the left */
.fxnbt-badges { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fxnbt-badges li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	margin: 0;
	padding: 10px 12px;
	border-radius: 12px;
	background: linear-gradient(180deg, #fff, var(--fxn-surface, #F7F7F4));
	border: 1px solid var(--fxn-line, #E7E5E2);
}
.fxnbt-badges li p { margin: 0; flex: 1 1 260px; font-size: 13px; line-height: 1.5; color: var(--bt-muted); }
.fxnbt-badges__none { margin: 0; font-size: 13px; color: var(--bt-muted); }
.fxnbt-panel--badges .fxnbt-disclaimer { margin-top: 12px; }

/* "why this badge" popover */
.fxnbt-why {
	--pb: var(--fxn-green-deep, #4A7515);
	position: absolute;
	z-index: 9999;
	width: 330px;
	max-width: calc(100vw - 24px);
	padding: 14px 16px 14px;
	border-radius: 14px;
	background: #fff;
	color: var(--fxn-ink, #231F20);
	border: 1px solid var(--fxn-line, #E7E5E2);
	border-top: 3px solid var(--pb);
	box-shadow: 0 16px 40px rgba(35, 31, 32, .16), 0 2px 6px rgba(35, 31, 32, .06);
	box-sizing: border-box;
	animation: fxnbt-why-in .16s ease-out;
}
@keyframes fxnbt-why-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.fxnbt-why[hidden] { display: none; }
.fxnbt-why__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 32px 8px 0;
	font-size: 14px;
	font-weight: 800;
	color: var(--fxn-ink, #231F20);
}
.fxnbt-why__title .fxnbt-pbadge__icon { width: 26px; height: 26px; background: color-mix(in srgb, var(--pb) 12%, #fff); box-shadow: none; }
.fxnbt-why__source {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 12px;
	padding: 5px 10px;
	border-radius: 8px;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: var(--fxn-green-deep, #4A7515);
	background: var(--fxn-green-tint, #F2F8E6);
	border: 1px solid var(--fxn-green-line, #D9EBBB);
}
.fxnbt-why__source::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.fxnbt-why__source--manual { color: var(--fxn-text, #4A4546); background: var(--fxn-surface-2, #EFEEEA); border-color: var(--fxn-line, #E7E5E2); }
.fxnbt-why__source--status { color: var(--fxn-text, #4A4546); background: var(--fxn-surface, #F7F7F4); border-color: var(--fxn-line, #E7E5E2); }
.fxnbt-why__source[hidden] { display: none; }
.fxnbt-why__sec { margin: 0 0 12px; }
.fxnbt-why__sec:last-child { margin-bottom: 0; }
.fxnbt-why__h {
	margin: 0 0 4px;
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--fxn-muted, #6B6667);
}
.fxnbt-why__p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--fxn-text, #4A4546); }
.fxnbt-why__p + .fxnbt-why__p { margin-top: 3px; }
.fxnbt-why__rows { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; }
.fxnbt-why__rows dt { margin: 0; font-size: 12.5px; color: var(--fxn-muted, #6B6667); }
.fxnbt-why__rows dd { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--fxn-ink, #231F20); }
.fxnbt-why__foot {
	margin: 12px 0 0;
	padding-top: 10px;
	border-top: 1px solid var(--fxn-surface, #F7F7F4);
	font-size: 11.5px;
	line-height: 1.5;
	color: var(--fxn-muted, #6B6667);
}
.fxnbt-why__foot[hidden] { display: none; }
/* the theme styles every <button>; undo all of it for the small close */
.fxnbt-why .fxnbt-why__close,
.fxnbt-why .fxnbt-why__close:hover,
.fxnbt-why .fxnbt-why__close:focus {
	all: unset;
	position: absolute;
	top: 10px;
	right: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--fxn-surface, #F7F7F4);
	color: var(--fxn-muted, #6B6667);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	box-sizing: border-box;
}
.fxnbt-why .fxnbt-why__close:hover { background: var(--fxn-line, #E7E5E2); color: var(--fxn-ink, #231F20); }

/* ---------- backtest quality ---------- */

.fxnbt-quality__top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px 22px; align-items: start; }
.fxnbt-quality__grade p { margin: 8px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--bt-text); }
.fxnbt-quality__pill {
	display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px;
	font-size: 12.5px; font-weight: 700; line-height: 1.3;
	background: var(--fxn-surface-2, #EFEEEA); color: var(--bt-ink);
}
.fxnbt-quality__pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--fxn-subtle, #9A9596); }
.fxnbt-quality--high .fxnbt-quality__pill { background: var(--fxn-green-tint, #F2F8E6); color: var(--fxn-green-deep, #4A7515); }
.fxnbt-quality--high .fxnbt-quality__pill::before { background: var(--fxn-green, #9DCC4C); }
.fxnbt-quality--standard .fxnbt-quality__pill::before { background: var(--fxn-green-deep, #4A7515); }
.fxnbt-quality--low .fxnbt-quality__pill { background: #FFF6E0; color: #8A5A00; }
.fxnbt-quality--low .fxnbt-quality__pill::before { background: #D99A0A; }

.fxnbt-quality__facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 0; }
.fxnbt-quality__facts div { padding: 9px 11px; border: 1px solid var(--bt-line); border-radius: 10px; background: #fff; min-width: 0; }
.fxnbt-quality__facts dt { margin: 0; font-size: 11.5px; color: var(--bt-muted); }
.fxnbt-quality__facts dd { margin: 2px 0 0; font-size: 14px; font-weight: 700; color: var(--bt-ink); overflow-wrap: anywhere; }

/* The file was rebuilt after MetaTrader wrote it: said plainly, in its own box. */
.fxnbt-quality__edited {
	margin: 16px 0 0; padding: 13px 15px; border-radius: 12px;
	border: 1px solid #F0C36B; background: #FFF8E8;
}
.fxnbt-quality__edited-head {
	display: flex; gap: 9px; align-items: flex-start; margin: 0;
	font-size: 13.5px; font-weight: 800; line-height: 1.45; color: #8A5A00;
}
.fxnbt-quality__edited-icon {
	flex: 0 0 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
	font-size: 12px; font-weight: 800; background: #F5B301; color: #fff;
}
.fxnbt-quality__edited ul { list-style: none; margin: 9px 0 0; padding: 0 0 0 29px; display: grid; gap: 6px; }
.fxnbt-quality__edited li { margin: 0; font-size: 13px; line-height: 1.5; color: var(--bt-text); }
.fxnbt-quality__edited strong { display: block; color: var(--bt-ink); font-weight: 700; }
.fxnbt-quality__edited-note { margin: 10px 0 0; padding-left: 29px; font-size: 12px; line-height: 1.5; color: var(--bt-muted); }

.fxnbt-quality__sub { margin: 16px 0 8px; font-size: 13px; font-weight: 700; color: var(--bt-green-dark); }
.fxnbt-quality__sub.is-bad { color: var(--bt-red); }
.fxnbt-quality__checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fxnbt-quality__checks li { display: flex; gap: 9px; align-items: flex-start; margin: 0; font-size: 13px; line-height: 1.5; color: var(--bt-text); }
.fxnbt-quality__checks strong { color: var(--bt-ink); font-weight: 600; }
.fxnbt-quality__icon {
	flex: 0 0 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
	font-size: 11px; font-weight: 800; background: var(--fxn-surface-2, #EFEEEA); color: var(--bt-muted);
}
.fxnbt-quality__checks .is-pass .fxnbt-quality__icon { background: var(--fxn-green-tint, #F2F8E6); color: var(--fxn-green-deep, #4A7515); }
.fxnbt-quality__checks .is-fail .fxnbt-quality__icon { background: #FDECEA; color: var(--bt-red); }
.fxnbt-quality__foot { margin: 14px 0 0; font-size: 12px; line-height: 1.5; color: var(--bt-muted); }

/* One line on the summary card. The card is dark unless it is the light variant. */
.fxnbt-quality-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 12px 0 0; font-size: 12.5px; line-height: 1.4; color: rgba(255, 255, 255, .78); }
.fxnbt-quality-line strong { color: #fff; font-weight: 700; }
.fxnbt-quality-line__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fxn-subtle, #9A9596); }
.fxnbt-quality-line--high .fxnbt-quality-line__dot { background: var(--fxn-green, #9DCC4C); }
.fxnbt-quality-line--standard .fxnbt-quality-line__dot { background: var(--fxn-green-soft, #B9DC7E); }
.fxnbt-quality-line--low .fxnbt-quality-line__dot { background: #F5B301; }
.fxnbt-quality-line__checks.is-bad { color: #ff8a7f; }
.fxnbt-quality-line__edited {
	padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
	background: rgba(245, 179, 1, .18); color: #F5B301;
}
.fxnbt-card--light .fxnbt-quality-line { color: var(--bt-muted); }
.fxnbt-card--light .fxnbt-quality-line strong { color: var(--bt-ink); }
.fxnbt-card--light .fxnbt-quality-line__checks.is-bad { color: var(--bt-red); }
.fxnbt-card--light .fxnbt-quality-line__edited { background: #FFF6E0; color: #8A5A00; }

.fxnbt-preview .fxnbt-quality { margin-top: 14px; }

@media (max-width: 680px) {
	.fxnbt-quality__top { grid-template-columns: 1fr; }
}
