/*
 * List boards v3 — compact ledger rows for /news/?group=fraud_warning and
 * /mediation.
 *
 * Loaded after fxm-exposure-board.css so it overrides the card frames there.
 *
 * Why this layer exists: v2's exposure card reserved a 196px grid track for a
 * cover image, but no template ever emitted `.fxm-exp-card__thumb`, so every
 * row carried an empty column, squeezed the text, and stacked head/body/foot
 * into a ~250px block. Ten rows then read as one grey wall and the sidebar
 * was left stranded beside mostly-empty space.
 *
 * v3 drops the phantom column, folds the three bands into a single scan path
 * (byline → claim → evidence), and keeps the risk colour as the only saturated
 * element so a long list still sorts by severity at a glance.
 */

.fxm-board-stream {
	/* Declared here as well as in fxm-exposure-board.css: /mediation/ loads this
	   sheet without that one, so the tokens must not depend on load order. */
	--exp-primary: #4f34d9;
	--exp-ink: #1f2433;
	--exp-text: #5d6478;
	--exp-muted: #8a90a2;
	--exp-line: #e7e4f0;
	--ledger-ink: #16192b;
	--ledger-text: #5b6275;
	--ledger-muted: #8c93a5;
	--ledger-line: #e9ecf4;
	--ledger-hover: #f8f8fc;
}

/* ---------- Exposure rows ---------- */
article.fxm-exp-card:not(.fxm-exp-card--med) {
	border: 1px solid var(--ledger-line);
	border-radius: 16px;
	background: #fff;
	box-shadow: none;
}
article.fxm-exp-card:not(.fxm-exp-card--med):hover {
	border-color: #dcd8ee;
	background: var(--ledger-hover);
	box-shadow: 0 14px 34px -30px rgba(22, 25, 43, .55);
	transform: none;
}
/* No coloured rail on list cards; the risk badge in the byline carries severity. */
article.fxm-exp-card:not(.fxm-exp-card--med)::before { display: none; }
article.fxm-exp-card:not(.fxm-exp-card--med)::after { display: none; }
article.fxm-exp-card:not(.fxm-exp-card--med) .fxm-exp-card__link {
	display: grid;
	gap: 0;
	padding: 16px 20px;
}

/* Vendor line: logo, broker, place · date, severity. */
article.fxm-exp-card:not(.fxm-exp-card--med) .fxm-exp-card__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0;
	border: 0;
	background: none;
}
/* Portal logos are wide wordmarks; at 60x30 they shrank to an unreadable
   smudge, so the frame is now 96x48 on a white plate. */
body .fxm-board-stream .fxm-exp-logo--card {
	width: 96px;
	height: 48px;
	padding: 6px 9px !important;
	border-radius: 10px;
	border-color: var(--ledger-line);
	background: #fff;
}
body .fxm-board-stream .fxm-exp-logo--card > .fxm-broker-logo-viewport { inset: 6px 9px; }
body .fxm-board-stream .fxm-exp-logo--card .fxm-broker-logo-initials { font-size: 15px; }
/* Name over place · date, so the byline matches the taller logo. */
article.fxm-exp-card:not(.fxm-exp-card--med) .fxm-exp-card__who {
	flex-direction: column;
	align-items: flex-start;
	gap: 3px;
	min-width: 0;
}
article.fxm-exp-card:not(.fxm-exp-card--med) .fxm-exp-card__broker-name {
	max-width: 100%;
	font-size: 14px;
	font-weight: 650;
	letter-spacing: 0;
	color: var(--ledger-ink);
}
article.fxm-exp-card:not(.fxm-exp-card--med) .fxm-exp-card__meta {
	margin: 0;
	font-size: 11.5px;
	color: var(--ledger-muted);
}
article.fxm-exp-card:not(.fxm-exp-card--med) .fxm-exp-risk--card {
	margin-left: auto;
	padding: 2px 9px 2px 7px;
	border: 0;
	border-radius: 6px;
	box-shadow: none;
	font-size: 10.5px;
	font-weight: 650;
	letter-spacing: .02em;
}

/* Claim: title on one line, summary on the next. */
article.fxm-exp-card:not(.fxm-exp-card--med) .fxm-exp-card__body {
	display: block;
	min-height: 0;
	padding: 10px 0 0;
}
article.fxm-exp-card:not(.fxm-exp-card--med) .fxm-exp-card__title {
	font-size: 15.5px;
	font-weight: 650;
	line-height: 1.45;
	letter-spacing: -.012em;
	-webkit-line-clamp: 1;
}
article.fxm-exp-card:not(.fxm-exp-card--med) .fxm-exp-card__summary {
	margin-top: 4px;
	font-size: 13px;
	line-height: 1.62;
	color: var(--ledger-text);
	-webkit-line-clamp: 1;
}

/* Evidence line: category, reach, and the row action share one baseline. */
article.fxm-exp-card:not(.fxm-exp-card--med) .fxm-exp-card__foot {
	gap: 10px;
	min-height: 0;
	margin-top: 10px;
	padding: 0;
	border: 0;
	background: none;
}
article.fxm-exp-card:not(.fxm-exp-card--med) .fxm-exp-tag {
	padding: 2px 8px;
	border: 1px solid var(--ledger-line);
	border-radius: 5px;
	background: #fbfbfe;
	color: var(--ledger-text);
	font-size: 11px;
	font-weight: 500;
}
article.fxm-exp-card:not(.fxm-exp-card--med) .fxm-exp-tag--pinned {
	border-color: #ffd9e0;
	background: #fff4f6;
	color: #b42545;
}
article.fxm-exp-card:not(.fxm-exp-card--med) .fxm-exp-card__views {
	padding: 0;
	background: none;
	color: var(--ledger-muted);
	font-size: 11.5px;
}
article.fxm-exp-card:not(.fxm-exp-card--med) .fxm-exp-card__more {
	padding: 0;
	border: 0;
	background: none;
	color: var(--ledger-muted);
	font-size: 11.5px;
	font-weight: 500;
	opacity: 1;
}
article.fxm-exp-card:not(.fxm-exp-card--med):hover .fxm-exp-card__more {
	background: none;
	color: var(--exp-primary);
}

@media (max-width: 639px) {
	article.fxm-exp-card:not(.fxm-exp-card--med) .fxm-exp-card__link { padding: 14px; }
	body .fxm-board-stream .fxm-exp-logo--card { width: 80px; height: 40px; padding: 5px 7px !important; }
	body .fxm-board-stream .fxm-exp-logo--card > .fxm-broker-logo-viewport { inset: 5px 7px; }
	article.fxm-exp-card:not(.fxm-exp-card--med) .fxm-exp-card__summary { -webkit-line-clamp: 2; }
}

/* ---------- Figures strip ---------- */
.fxm-board-stream .fxm-board-stats {
	border-radius: 14px;
	border-color: var(--ledger-line);
	background: #fcfcfe;
}
.fxm-board-stream .fxm-board-stats__item { padding: 14px 18px; }
.fxm-board-stream .fxm-board-stats dt { font-size: 11.5px; letter-spacing: .01em; }
.fxm-board-stream .fxm-board-stats dd { margin-top: 5px; font-size: 21px; font-weight: 650; letter-spacing: -.03em; }

/* ---------- Sidebar ranking ---------- */
.fxm-board-stream .fxm-exp-rank { gap: 0; }
.fxm-board-stream .fxm-exp-rank__row {
	grid-template-columns: 16px 56px minmax(0, 1fr) auto;
	gap: 9px;
	padding: 9px 6px;
	border-radius: 9px;
}
.fxm-board-stream .fxm-exp-rank__row + .fxm-exp-rank__row { border-top: 1px solid #f4f5f9; }
.fxm-board-stream .fxm-exp-rank__no { font-size: 12px; font-weight: 650; }
.fxm-board-stream .fxm-exp-rank__no.is-top { color: var(--ledger-ink); }
.fxm-board-stream .fxm-exp-rank__name { font-size: 12.5px; font-weight: 550; }
.fxm-board-stream .fxm-exp-rank__bar { height: 3px; margin-top: 6px; background: #f0f1f6; }
.fxm-board-stream .fxm-exp-rank__bar > i { background: var(--ledger-muted); opacity: .55; }
.fxm-board-stream .fxm-exp-rank__row:hover .fxm-exp-rank__bar > i { background: #f43f5e; opacity: 1; }
.fxm-board-stream .fxm-exp-rank__count {
	min-width: 28px;
	padding: 1px 6px;
	border-radius: 5px;
	background: #fff4f6;
	color: #b42545;
	font-size: 12px;
	font-weight: 650;
	text-align: center;
}
body .fxm-board-stream .fxm-exp-logo--rank {
	width: 56px;
	height: 28px;
	padding: 3px 4px !important;
	border-radius: 7px;
	border-color: var(--ledger-line);
}

/* ---------- Mediation cards (/mediation and the /news/ mediation tab) ----------
 * Markup: fxm_mcase_list_card() in inc/mediation-case-view.php.
 * Same frame as the exposure cards above: a separate card, no coloured rail,
 * a 96x48 logo. The status tone shows only in the badge, the progress rail
 * and the recovered bar, so the card stays calm until there is a result.
 */
.fxm-mcard-list { display: grid; gap: 12px; }
.fxm-mcard {
	--tone: #4f34d9;
	--tone-soft: #f2efff;
	--tone-ink: #4f34d9;
	border: 1px solid var(--ledger-line);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(22, 25, 43, .04), 0 8px 20px -18px rgba(22, 25, 43, .35);
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background-color .2s ease;
}
.fxm-mcard[data-group="resolved"] { --tone: #10b981; --tone-soft: #e9f9f1; --tone-ink: #0b7a4b; }
.fxm-mcard[data-group="unresolved"] { --tone: #f43f5e; --tone-soft: #fff0f3; --tone-ink: #b42545; }
.fxm-mcard[data-group="closed"] { --tone: #9aa1b2; --tone-soft: #f2f3f7; --tone-ink: #5b6275; }
.fxm-mcard:hover {
	border-color: #dcd8ee;
	background: var(--ledger-hover);
	box-shadow: 0 2px 4px rgba(22, 25, 43, .05), 0 18px 34px -24px rgba(22, 25, 43, .45);
	transform: translateY(-1px);
}
.fxm-mcard__link {
	display: grid;
	gap: 14px;
	padding: 16px 20px;
	border-radius: inherit;
	color: inherit;
	text-decoration: none;
}
.fxm-mcard__link:focus-visible { outline: 2px solid var(--exp-primary); outline-offset: 2px; }

/* Byline: logo, broker over case no · date, status. */
.fxm-mcard__head { display: flex; align-items: center; gap: 12px; min-width: 0; }
body .fxm-mcard .fxm-mcard__logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 96px;
	height: 48px;
	padding: 6px 9px !important;
	overflow: hidden;
	border: 1px solid var(--ledger-line);
	border-radius: 10px;
	background: #fff;
}
body .fxm-mcard .fxm-mcard__logo > .fxm-broker-logo-viewport { inset: 6px 9px; }
body .fxm-mcard .fxm-mcard__logo .fxm-broker-logo-initials { font-size: 15px; }
.fxm-mcard__who { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }
.fxm-mcard__broker {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 14px;
	font-weight: 650;
	line-height: 1.35;
	color: var(--ledger-ink);
}
.fxm-mcard__meta {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	font-size: 11.5px;
	color: var(--ledger-muted);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.fxm-mcard__meta > * + *::before { content: '·'; margin-right: 6px; color: #cbd0dd; }
.fxm-mcard__status {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	gap: 6px;
	align-self: flex-start;
	padding: 3px 10px;
	border-radius: 6px;
	background: var(--tone-soft);
	color: var(--tone-ink);
	font-size: 11.5px;
	font-weight: 600;
	line-height: 1.5;
	white-space: nowrap;
}
.fxm-mcard__status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--tone); }

/* Body: what the case is and how far it got, beside the money. */
.fxm-mcard__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 240px;
	/* Top-aligned: a tall money panel would otherwise push the title down. */
	align-items: start;
	gap: 24px;
}
.fxm-mcard__main { min-width: 0; }
.fxm-mcard__title {
	margin: 0 0 14px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 15.5px;
	font-weight: 650;
	line-height: 1.45;
	letter-spacing: -.012em;
	color: var(--ledger-ink);
	transition: color .2s ease;
}
.fxm-mcard:hover .fxm-mcard__title { color: var(--exp-primary); }

/* Five-step rail, the same steps the case page shows. */
.fxm-mcard__rail {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.fxm-mcard__step { position: relative; min-width: 0; padding-top: 12px; }
.fxm-mcard__step::before {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	height: 4px;
	border-radius: 2px;
	background: #eceef4;
}
.fxm-mcard__step > span {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 11.5px;
	line-height: 1.4;
	color: #a3a9b8;
}
.fxm-mcard__step.is-done::before { background: color-mix(in srgb, var(--tone) 45%, #fff); }
.fxm-mcard__step.is-done > span { color: var(--ledger-text); }
.fxm-mcard__step.is-skipped::before {
	background: repeating-linear-gradient(90deg, #dfe2ea 0 4px, transparent 4px 7px);
}
.fxm-mcard__step.is-current::before,
.fxm-mcard__step.is-final::before { background: var(--tone); }
.fxm-mcard__step.is-current > span { font-weight: 600; color: var(--ledger-ink); }
.fxm-mcard__step.is-final > span { font-weight: 650; color: var(--tone-ink); }

/* Money: label over figure, as in the case page's ledger — the claim beside
   the settled amount (or the latest proposal), the recovered share under
   both. A hairline instead of a filled panel keeps it a column of the row
   rather than a card inside the card, and settled rows no longer stand
   taller than the rest with a gap under the rail. */
.fxm-mcard__money {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	align-content: start;
	gap: 10px 16px;
	margin: 0;
	padding: 1px 0 1px 20px;
	border-left: 1px solid var(--ledger-line);
}
.fxm-mcard__figure { display: grid; gap: 3px; min-width: 0; }
.fxm-mcard__figure:only-child { grid-column: 1 / -1; }
.fxm-mcard__money dt {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 11.5px;
	line-height: 1.4;
	color: var(--ledger-muted);
}
.fxm-mcard__money dd {
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 15px;
	font-weight: 650;
	line-height: 1.3;
	color: var(--ledger-ink);
	font-variant-numeric: tabular-nums;
	letter-spacing: -.01em;
}
.fxm-mcard__figure.is-final dd { color: var(--tone-ink); }
/* Recovered share on one line: label, bar, percentage. */
.fxm-mcard__ratio { display: flex; grid-column: 1 / -1; align-items: center; gap: 10px; min-width: 0; }
.fxm-mcard__ratio dt { flex-shrink: 0; }
.fxm-mcard__ratio > i {
	flex: 1 1 auto;
	order: 1;
	height: 4px;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--tone) var(--ratio, 0%), #e6e8ef var(--ratio, 0%));
}
.fxm-mcard__ratio dd { flex-shrink: 0; order: 2; font-size: 12.5px; line-height: 1.4; color: var(--tone-ink); }

/* Footer: claim type and region, then the row action. */
.fxm-mcard__foot { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fxm-mcard__tags { display: flex; flex: 1; flex-wrap: wrap; gap: 6px; min-width: 0; }
.fxm-mcard__tag {
	padding: 2px 8px;
	border: 1px solid var(--ledger-line);
	border-radius: 5px;
	background: #fbfbfe;
	color: var(--ledger-text);
	font-size: 11px;
	line-height: 1.6;
}
.fxm-mcard__more {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	gap: 4px;
	color: var(--ledger-muted);
	font-size: 11.5px;
	transition: color .2s ease, gap .2s ease;
}
.fxm-mcard:hover .fxm-mcard__more { gap: 7px; color: var(--exp-primary); }

/* Status chips of the /news/ mediation tab (base rules in fxm-exposure-board.css). */
.fxm-board-stream .fxm-board-filter { gap: 6px; margin-bottom: 16px; }
.fxm-board-stream .fxm-board-filter__chip {
	padding: 6px 16px;
	border: 1px solid var(--ledger-line);
	background: #fff;
	color: var(--ledger-text);
	font-size: 13px;
}
.fxm-board-stream .fxm-board-filter__chip:hover { border-color: #d9d4f0; background: #fff; color: var(--ledger-ink); }
.fxm-board-stream .fxm-board-filter__chip.is-active {
	border-color: var(--exp-primary);
	background: var(--exp-primary);
	color: #fff;
	font-weight: 600;
}

@media (max-width: 767px) {
	.fxm-mcard__body { grid-template-columns: minmax(0, 1fr); gap: 14px; }
	/* Stacked under the rail, so the hairline moves to the top. */
	.fxm-mcard__money { padding: 12px 0 0; border-top: 1px solid var(--ledger-line); border-left: 0; }
}
@media (max-width: 639px) {
	.fxm-mcard-list { gap: 10px; }
	.fxm-mcard__link { gap: 12px; padding: 14px; }
	body .fxm-mcard .fxm-mcard__logo { width: 80px; height: 40px; padding: 5px 7px !important; }
	body .fxm-mcard .fxm-mcard__logo > .fxm-broker-logo-viewport { inset: 5px 7px; }
	/* Byline as a grid: the status shares the broker's line only, so the case
	   number and date get the full width underneath instead of "MED-2026…". */
	.fxm-mcard__head {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr) auto;
		grid-template-areas: "logo name status" "logo meta meta";
		align-items: center;
		gap: 3px 10px;
	}
	.fxm-mcard__head > .fxm-mcard__logo { grid-area: logo; }
	.fxm-mcard__who { display: contents; }
	/* Legal names run long ("… Pte. Ltd"); two lines beat an ellipsis on the entity. */
	.fxm-mcard__broker {
		display: -webkit-box;
		grid-area: name;
		white-space: normal;
		overflow-wrap: anywhere;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
	}
	.fxm-mcard__meta { grid-area: meta; }
	.fxm-mcard__status { grid-area: status; }
	.fxm-mcard__meta > span:first-child { overflow: hidden; text-overflow: ellipsis; }
	/* 12px is the H5 caption floor (fxm-mobile.css). */
	.fxm-mcard__step > span { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
	article.fxm-exp-card:not(.fxm-exp-card--med),
	.fxm-mcard { transition: none; }
	.fxm-mcard:hover { transform: none; }
}

/* ---------- Separate cards ----------
 * Each exposure is its own record, so each gets its own card: a gap between
 * rows, a full border, and a resting shadow that lifts on hover. The risk
 * rail stays visible on every card so severity still scans down the list.
 */
.fxm-exp-list {
	display: grid;
	gap: 12px;
}
.fxm-exp-list > article.fxm-exp-card:not(.fxm-exp-card--med) {
	box-shadow: 0 1px 2px rgba(22, 25, 43, .04), 0 8px 20px -18px rgba(22, 25, 43, .35);
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.fxm-exp-list > article.fxm-exp-card:not(.fxm-exp-card--med):hover {
	box-shadow: 0 2px 4px rgba(22, 25, 43, .05), 0 18px 34px -24px rgba(22, 25, 43, .45);
	transform: translateY(-1px);
}

@media (max-width: 639px) {
	.fxm-exp-list { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
	.fxm-exp-list > article.fxm-exp-card:not(.fxm-exp-card--med) { transition: none; }
	.fxm-exp-list > article.fxm-exp-card:not(.fxm-exp-card--med):hover { transform: none; }
}

/* /mediation/ (hero, filter bar, its larger card variant and H5 layout) lives in
   fxm-mediation-list.css. */
