/*
===============================================================================
PFC RANKING CARDS LIST v3.1 — EASY EDIT CSS
===============================================================================

Change the values in :root first. Most visual changes can be made there
without touching the layout rules below.
*/

:root {
	/* Brand */
	--pfcrcl-navy: #000412;
	--pfcrcl-rank-bg: #002548;
	--pfcrcl-green: #00D6A0;
	--pfcrcl-green-hover: #00C997;
	--pfcrcl-green-dark: #008F6D;

	/* Surfaces */
	--pfcrcl-card-bg: #FFFFFF;
	--pfcrcl-soft-bg: #FAFCFD;
	--pfcrcl-muted-bg: #F2F5F8;
	--pfcrcl-price-bg: rgba(0, 214, 160, 0.10);

	/* Text */
	--pfcrcl-text: #000412;
	--pfcrcl-muted-text: #687689;

	/* Borders / shadows */
	--pfcrcl-border: #E3E8EE;
	--pfcrcl-soft-border: #E9EEF3;
	--pfcrcl-card-radius: 13px;
	--pfcrcl-small-radius: 8px;
	--pfcrcl-shadow: 0 4px 15px rgba(0, 4, 18, 0.055);

	/* Sizing */
	--pfcrcl-card-gap: 20px;
	--pfcrcl-card-padding: 19px 16px 19px 34px;
	--pfcrcl-logo-size: 62px;
	--pfcrcl-button-height: 45px;
}


/* =============================================================================
   1. LIST
   ============================================================================= */

.pfcrcl-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
	width: 100%;
	margin: 24px 0;
}


/* =============================================================================
   2. CARD LAYOUT
   Columns: Firm | Stats | Score/Price | Buttons
   ============================================================================= */

.pfcrcl-card {
	position: relative;
	display: grid;
	grid-template-columns:
		minmax(240px, 1.05fr)
		minmax(390px, 1.70fr)
		135px
		180px;
	align-items: center;
	gap: var(--pfcrcl-card-gap);
	padding: var(--pfcrcl-card-padding);

	background: var(--pfcrcl-card-bg);
	border: 1px solid var(--pfcrcl-border);
	border-radius: var(--pfcrcl-card-radius);
	box-shadow: var(--pfcrcl-shadow);
}


/* =============================================================================
   3. RANK BADGE
   ============================================================================= */

.pfcrcl-rank {
	position: absolute;
	top: -6px;
	left: -6px;

	display: inline-flex;
	align-items: center;
	justify-content: center;

	min-width: 35px;
	height: 29px;
	padding: 0 8px;

	background: var(--pfcrcl-rank-bg);
	color: #FFFFFF;
	border-radius: var(--pfcrcl-small-radius);

	font-size: 14px;
	font-weight: 800;
	line-height: 1;

	box-shadow: 0 2px 5px rgba(0, 4, 18, 0.14);
}


/* =============================================================================
   4. FIRM IDENTITY
   ============================================================================= */

.pfcrcl-identity {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
}

.pfcrcl-logo {
	flex: 0 0 var(--pfcrcl-logo-size);
	display: flex;
	align-items: center;
	justify-content: center;

	width: var(--pfcrcl-logo-size);
	height: var(--pfcrcl-logo-size);
	padding: 3px;

	overflow: hidden;
	background: #FFFFFF;
	border: 1px solid var(--pfcrcl-soft-border);
	border-radius: 11px;

	font-weight: 800;
}

.pfcrcl-logo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.pfcrcl-identity-copy {
	min-width: 0;
}

.pfcrcl-name {
	margin: 0 0 5px !important;
	padding: 0 !important;

	color: var(--pfcrcl-text);
	font-size: 18px !important;
	font-weight: 750 !important;
	line-height: 1.25 !important;
}

.pfcrcl-trust {
	display: flex;
	align-items: center;
	gap: 4px;

	color: var(--pfcrcl-text);
	font-size: 13px;
}

.pfcrcl-star {
	color: #00A77D;
}

.pfcrcl-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 7px;
}

.pfcrcl-badge,
.pfcrcl-programmes {
	display: inline-flex;
	align-items: center;

	min-height: 22px;
	padding: 4px 8px;

	border-radius: 6px;

	font-size: 10.5px;
	font-weight: 700;
}

.pfcrcl-badge {
	background: var(--pfcrcl-price-bg);
	color: var(--pfcrcl-green-dark);
}

.pfcrcl-programmes {
	background: var(--pfcrcl-muted-bg);
	color: #536174;
}


/* =============================================================================
   5. DATABASE FIELDS
   Change "repeat(2" to "repeat(4" for four stats on one row.
   ============================================================================= */

.pfcrcl-stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	min-width: 0;
}

.pfcrcl-stat {
	min-width: 0;
	padding: 10px 11px;

	background: var(--pfcrcl-soft-bg);
	border: 1px solid var(--pfcrcl-soft-border);
	border-radius: 9px;
}

.pfcrcl-stat-label {
	display: block;
	margin-bottom: 4px;

	color: var(--pfcrcl-muted-text);
	font-size: 10.5px;
	font-weight: 550;
	line-height: 1.15;
}

.pfcrcl-stat-value {
	display: block;

	color: #00152D;
	font-size: 13.5px;
	font-weight: 750;
	line-height: 1.25;
}


/* =============================================================================
   6. EDITORIAL SCORE + LOWEST FEE
   ============================================================================= */

.pfcrcl-commercial {
	display: grid;
	gap: 8px;
}

.pfcrcl-score,
.pfcrcl-price {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;

	min-height: 64px;
	padding: 7px;

	border-radius: 9px;
	text-align: center;
}

.pfcrcl-score {
	border: 1px solid var(--pfcrcl-border);
	background: #FFFFFF;
}

.pfcrcl-score strong {
	color: var(--pfcrcl-text);
	font-size: 27px;
	font-weight: 850;
	line-height: 1;
}

.pfcrcl-score span,
.pfcrcl-price span,
.pfcrcl-price small {
	color: #637186;
	font-size: 9.5px;
}

.pfcrcl-price {
	background: var(--pfcrcl-price-bg);
	border: 1px solid rgba(0, 214, 160, 0.10);
}

.pfcrcl-price strong {
	margin: 3px 0;

	color: #00B688;
	font-size: 21px;
	font-weight: 800;
	line-height: 1;
}


/* =============================================================================
   7. BUTTONS
   ============================================================================= */

.pfcrcl-actions {
	display: flex;
	flex-direction: column;
	gap: 9px;
}

.pfcrcl-visit,
.pfcrcl-review {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;

	min-height: var(--pfcrcl-button-height);
	padding: 10px 14px;

	border-radius: 9px;

	font-size: 13.5px;
	font-weight: 700;
	text-decoration: none !important;
}

.pfcrcl-visit {
	background: var(--pfcrcl-green);
	border: 1px solid var(--pfcrcl-green);
	color: var(--pfcrcl-navy) !important;
}

.pfcrcl-visit:hover {
	background: var(--pfcrcl-green-hover);
	border-color: var(--pfcrcl-green-hover);
	color: var(--pfcrcl-navy) !important;
}

.pfcrcl-review {
	background: #FFFFFF;
	border: 1px solid #00BC8F;
	color: var(--pfcrcl-green-dark) !important;
}


/* =============================================================================
   8. ADMIN DEBUG / ERRORS
   ============================================================================= */

.pfcrcl-error,
.pfcrcl-debug {
	margin: 14px 0;
	padding: 12px 14px;
	border-radius: 7px;
	font-size: 13px;
}

.pfcrcl-error {
	background: #FFFFFF;
	border: 1px solid #D63638;
	color: #B32D2E;
}

.pfcrcl-debug {
	overflow-x: auto;
	background: #F7F9FB;
	border: 1px solid #CCD7E2;
	color: var(--pfcrcl-text);
}

.pfcrcl-debug table {
	width: 100%;
	margin-top: 8px;
	border-collapse: collapse;
	background: #FFFFFF;
}

.pfcrcl-debug th,
.pfcrcl-debug td {
	padding: 6px 8px;
	border: 1px solid #E1E6EC;
	text-align: left;
	white-space: nowrap;
}


/* =============================================================================
   9. TABLET
   ============================================================================= */

@media (max-width: 1080px) {

	.pfcrcl-card {
		grid-template-columns:
			minmax(220px, 1fr)
			minmax(330px, 1.45fr)
			125px
			155px;

		gap: 14px;
	}
}

@media (max-width: 900px) {

	.pfcrcl-card {
		grid-template-columns:
			minmax(220px, 1fr)
			minmax(300px, 1.35fr)
			125px;
	}

	.pfcrcl-actions {
		grid-column: 1 / -1;
		display: grid;
		grid-template-columns: 1.15fr 0.85fr;
	}
}


/* =============================================================================
   10. MOBILE
   ============================================================================= */

@media (max-width: 767px) {

	.pfcrcl-list {
		gap: 16px;
		margin: 18px 0;
	}

	.pfcrcl-card {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 14px 10px;
		padding: 18px 14px 14px;
	}

	.pfcrcl-logo {
		flex-basis: 54px;
		width: 54px;
		height: 54px;
	}

	.pfcrcl-name {
		font-size: 16.5px !important;
	}

	.pfcrcl-commercial {
		grid-column: 2;
		grid-row: 1;
		align-self: center;
	}

	.pfcrcl-score {
		min-width: 58px;
		min-height: 56px;
		border: 0;
		padding: 0;
	}

	.pfcrcl-price {
		display: none;
	}

	.pfcrcl-stats {
		grid-column: 1 / -1;
		padding-top: 12px;
		border-top: 1px solid var(--pfcrcl-soft-border);
	}

	.pfcrcl-actions {
		grid-column: 1 / -1;
		display: grid;
		grid-template-columns: 1.15fr 0.85fr;
	}
}

@media (max-width: 390px) {

	.pfcrcl-actions {
		grid-template-columns: 1fr;
	}
}


/* =============================================================================
   11. NESTED JSON RULE FIELDS
   Examples:
   trading_rules_json.weekend_holding
   trading_rules_json.overnight_holding
   trading_rules_json.news_trading

   Values can be longer than numeric fields, so allow them to wrap cleanly.
   ============================================================================= */

.pfcrcl-stat-value {
	overflow-wrap: anywhere;
}

