/*
 * Racing Fans Members
 * Everything is scoped under .rfm so it cannot leak into the theme, and every
 * colour is a custom property so the whole thing restyles from one block.
 */

.rfm {
	--rf-navy: #0A1628;
	--rf-card: #12243B;
	--rf-line: #22405E;
	--rf-ink: #E8F0F4;
	--rf-muted: #8FA4B5;
	--rf-teal: #258AA6;
	--rf-teal-bright: #5CC3DE;
	--rf-deep: #1A6075;
	--rf-green: #1E9E63;
	--rf-green-bright: #39D98A;
	--rf-gold: #E8B24A;
	--rf-page-ink: #0A1628;
	--rf-page-muted: #4F6272;
	--rf-page-line: #C9D6DC;
	--rf-page-surface: #FFFFFF;
	--rf-page-tint: #EDF2F4;
	--rf-radius: 14px;

	color: var(--rf-page-ink);
	font-size: 16px;
	line-height: 1.55;
	max-width: 760px;
	margin: 0 auto;
}

.rfm *,
.rfm *::before,
.rfm *::after {
	box-sizing: border-box;
}

.rfm img {
	max-width: 100%;
	height: auto;
}

.rfm :focus-visible {
	outline: 2px solid var(--rf-gold);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ *
 * Headings and text
 * ------------------------------------------------------------------ */

/*
 * Headings and labels declare their own colour rather than inheriting it.
 * Every theme sets h1–h6 colours explicitly, and that rule beats inheritance —
 * which is how a navy heading ends up invisible on a navy panel.
 */
.rfm .rfm-h2 {
	font-size: clamp(24px, 5vw, 32px);
	line-height: 1.1;
	margin: 0 0 6px;
	font-weight: 800;
	color: var(--rf-page-ink);
}

.rfm .rfm-h3 {
	font-size: 20px;
	margin: 28px 0 8px;
	font-weight: 700;
	color: var(--rf-page-ink);
}

.rfm .rfm-sub {
	color: var(--rf-page-muted);
	margin: 0 0 18px;
}

.rfm .rfm-hint,
.rfm .rfm-fine {
	display: block;
	font-size: 13px;
	color: var(--rf-page-muted);
	margin-top: 4px;
}

.rfm .rfm-disclosure {
	font-size: 12px;
	line-height: 1.5;
	color: var(--rf-page-muted);
	margin: 24px 0 0;
	padding-top: 14px;
	border-top: 1px solid var(--rf-page-line);
}

.rfm .rfm-opt {
	font-weight: 400;
	color: var(--rf-page-muted);
	font-size: 13px;
}

/* ------------------------------------------------------------------ *
 * Messages
 * ------------------------------------------------------------------ */

.rfm .rfm-msg {
	border-radius: 10px;
	padding: 12px 14px;
	margin: 0 0 14px;
	font-size: 15px;
	border-left: 4px solid;
}

.rfm .rfm-msg-ok {
	background: #E8F5EE;
	border-color: var(--rf-green);
	color: #12503A;
}

.rfm .rfm-msg-error {
	background: #FBEAEA;
	border-color: #B32D2E;
	color: #7A1E1F;
}

.rfm .rfm-msg-warn {
	background: #FDF3E0;
	border-color: var(--rf-gold);
	color: #6B4E12;
}

.rfm .rfm-msg a {
	color: inherit;
}

/* ------------------------------------------------------------------ *
 * Forms
 * ------------------------------------------------------------------ */

.rfm .rfm-form {
	background: var(--rf-page-surface);
	border: 1px solid var(--rf-page-line);
	border-radius: var(--rf-radius);
	padding: 22px;
}

.rfm .rfm-form-title {
	font-size: 26px;
	margin: 0 0 4px;
	font-weight: 800;
	color: var(--rf-page-ink);
}

.rfm .rfm-form-sub {
	color: var(--rf-page-muted);
	margin: 0 0 18px;
}

.rfm .rfm-field {
	margin: 0 0 16px;
}

.rfm .rfm-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 5px;
	color: var(--rf-page-ink);
}

.rfm .rfm-field input[type="text"],
.rfm .rfm-field input[type="email"],
.rfm .rfm-field input[type="password"],
.rfm .rfm-field select {
	width: 100%;
	padding: 11px 12px;
	border: 1px solid var(--rf-page-line);
	border-radius: 10px;
	font: inherit;
	font-size: 16px; /* 16px stops iOS zooming on focus */
	background: #fff;
	color: var(--rf-page-ink);
}

.rfm .rfm-field input:focus,
.rfm .rfm-field select:focus {
	border-color: var(--rf-teal);
}

.rfm .rfm-row2 {
	display: grid;
	gap: 0 14px;
	grid-template-columns: 1fr;
}

@media (min-width: 560px) {
	.rfm .rfm-row2 {
		grid-template-columns: 1fr 1fr;
	}
}

.rfm .rfm-check {
	margin: 0 0 14px;
}

.rfm .rfm-check label {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-size: 15px;
	line-height: 1.45;
	cursor: pointer;
	color: var(--rf-page-ink);
}

.rfm .rfm-check input[type="checkbox"] {
	margin-top: 3px;
	flex: none;
	width: 18px;
	height: 18px;
	accent-color: var(--rf-teal);
}

.rfm .rfm-fieldset {
	border: 1px solid var(--rf-page-line);
	border-radius: 10px;
	padding: 14px;
	margin: 0 0 16px;
}

.rfm .rfm-fieldset legend {
	font-weight: 700;
	padding: 0 6px;
	color: var(--rf-page-ink);
}

.rfm .rfm-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.rfm .rfm-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	border: 1px solid var(--rf-page-line);
	border-radius: 999px;
	padding: 7px 13px;
	font-size: 14.5px;
	cursor: pointer;
	background: #fff;
}

.rfm .rfm-chip.is-on,
.rfm .rfm-chip:has(input:checked) {
	border-color: var(--rf-teal);
	background: var(--rf-teal);
	color: #fff;
}

.rfm .rfm-chip input {
	accent-color: #fff;
	width: 16px;
	height: 16px;
	margin: 0;
}

.rfm .rfm-range {
	width: 100%;
	accent-color: var(--rf-teal);
}

.rfm .rfm-group-label {
	margin: 14px 0 7px;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 1.1px;
	text-transform: uppercase;
	color: var(--rf-teal);
}

.rfm .rfm-group-label:first-of-type {
	margin-top: 2px;
}

/* ------------------------------------------------------------------ *
 * Newsletter list cards
 * ------------------------------------------------------------------ */

.rfm .rfm-lists {
	display: grid;
	gap: 10px;
}

.rfm .rfm-list {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	border: 1px solid var(--rf-page-line);
	border-radius: 12px;
	padding: 14px 16px;
	cursor: pointer;
	background: var(--rf-page-surface);
	color: var(--rf-page-ink);
}

.rfm .rfm-list.is-on,
.rfm .rfm-list:has(input:checked) {
	border-color: var(--rf-teal);
	box-shadow: inset 0 0 0 1px var(--rf-teal);
}

.rfm .rfm-list input[type="checkbox"] {
	margin-top: 3px;
	flex: none;
	width: 20px;
	height: 20px;
	accent-color: var(--rf-teal);
}

.rfm .rfm-list-body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.rfm .rfm-list-top {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 10px;
}

.rfm .rfm-list-top b {
	font-size: 17px;
	font-weight: 700;
}

.rfm .rfm-list-top em {
	font-style: normal;
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: .4px;
	text-transform: uppercase;
	color: var(--rf-teal);
}

.rfm .rfm-list-desc {
	font-size: 14px;
	line-height: 1.5;
	color: var(--rf-page-muted);
}

.rfm .rfm-list-next {
	font-size: 12.5px;
	color: var(--rf-page-muted);
	margin-top: 3px;
}

/* Honeypot */
.rfm .rfm-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ------------------------------------------------------------------ *
 * Buttons
 * ------------------------------------------------------------------ */

.rfm .rfm-btn {
	display: inline-block;
	border: 1px solid transparent;
	border-radius: 999px;
	padding: 12px 22px;
	font-size: 16px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	line-height: 1.2;
}

/*
 * Navy on teal, not white on teal. White on #258AA6 is 3.99:1, and a 16px
 * bold label needs 4.5:1 — 16px bold does not count as large text. Navy on
 * the same teal is 4.54:1 and passes, and it matches the site's own CTA.
 */
.rfm .rfm-btn-primary {
	background: var(--rf-teal);
	color: var(--rf-navy);
}

.rfm .rfm-btn-primary:hover,
.rfm .rfm-btn-primary:focus-visible {
	background: var(--rf-teal-bright);
	color: var(--rf-navy);
}

.rfm .rfm-btn-ghost {
	background: transparent;
	border-color: var(--rf-page-line);
	color: var(--rf-page-ink);
}

.rfm .rfm-btn-ghost:hover {
	border-color: var(--rf-teal);
	color: var(--rf-teal);
}

/* ------------------------------------------------------------------ *
 * Dashboard header
 * ------------------------------------------------------------------ */

.rfm-app .rfm-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 14px;
	background: var(--rf-navy);
	color: var(--rf-ink);
	border-radius: var(--rf-radius);
	padding: 20px;
}

.rfm-app .rfm-greet {
	font-size: clamp(24px, 6vw, 34px);
	font-weight: 800;
	font-style: italic;
	margin: 0 0 4px;
	line-height: 1.05;
}

.rfm-app .rfm-subgreet {
	margin: 0;
	color: var(--rf-muted);
	font-size: 15px;
}

.rfm-app .rfm-head-side {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	flex: none;
}

.rfm .rfm-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--rf-deep);
	color: #fff;
	display: grid;
	place-items: center;
	font-weight: 700;
	font-size: 14px;
	flex: none;
}

.rfm-app .rfm-signout {
	font-size: 12px;
	color: var(--rf-muted);
	text-decoration: underline;
}

/* ------------------------------------------------------------------ *
 * Tabs and filters
 * ------------------------------------------------------------------ */

.rfm .rfm-tabs {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	margin: 16px 0;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.rfm .rfm-tabs::-webkit-scrollbar {
	display: none;
}

.rfm .rfm-tab {
	flex: none;
	padding: 9px 16px;
	border-radius: 999px;
	border: 1px solid var(--rf-page-line);
	background: var(--rf-page-surface);
	color: var(--rf-page-ink);
	text-decoration: none;
	font-weight: 600;
	font-size: 15px;
}

.rfm .rfm-tab.is-on {
	background: var(--rf-navy);
	border-color: var(--rf-navy);
	color: #fff;
}

.rfm .rfm-filters {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	margin: 0 0 14px;
	padding-bottom: 4px;
	scrollbar-width: none;
}

.rfm .rfm-filters::-webkit-scrollbar {
	display: none;
}

.rfm .rfm-filter {
	flex: none;
	border: 1px solid var(--rf-page-line);
	border-radius: 999px;
	padding: 6px 13px;
	font-size: 14px;
	text-decoration: none;
	color: var(--rf-page-ink);
	background: var(--rf-page-surface);
}

.rfm .rfm-filter.is-on {
	background: var(--rf-teal);
	border-color: var(--rf-teal);
	color: #fff;
	font-weight: 600;
}

/* ------------------------------------------------------------------ *
 * Stats
 * ------------------------------------------------------------------ */

.rfm .rfm-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	margin: 0 0 16px;
}

.rfm .rfm-stats-4 {
	grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 560px) {
	.rfm .rfm-stats-4 {
		grid-template-columns: repeat(4, 1fr);
	}
}

.rfm .rfm-stat {
	background: var(--rf-page-surface);
	border: 1px solid var(--rf-page-line);
	border-radius: 10px;
	padding: 10px;
	text-align: left;
}

.rfm .rfm-stat b {
	display: block;
	font-size: 24px;
	line-height: 1.1;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.rfm .rfm-stat span {
	font-size: 12px;
	color: var(--rf-page-muted);
	line-height: 1.3;
	display: block;
}

/* ------------------------------------------------------------------ *
 * Tip cards
 * ------------------------------------------------------------------ */

.rfm .rfm-tip {
	background: var(--rf-card);
	color: var(--rf-ink);
	border: 1px solid var(--rf-line);
	border-radius: var(--rf-radius);
	padding: 14px;
	margin: 0 0 12px;
}

/*
 * Top-aligned, not centred: with a date badge in front of it the venue line
 * can run to two lines, and the tier chip belongs beside the first one.
 */
.rfm .rfm-tip-top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 8px;
	font-size: 12.5px;
	color: var(--rf-muted);
}

.rfm .rfm-tier {
	border-radius: 6px;
	padding: 2px 8px;
	font-weight: 700;
	font-size: 11px;
	color: var(--rf-navy);
	flex: none;
	text-transform: uppercase;
	letter-spacing: .4px;
}

.rfm .rfm-tier-strong {
	background: var(--rf-green-bright);
}

.rfm .rfm-tier-solid {
	background: var(--rf-gold);
}

.rfm .rfm-tier-spec {
	background: #9FB3C4;
}

.rfm .rfm-sel {
	font-size: 22px;
	line-height: 1.15;
	font-weight: 800;
	margin: 7px 0 4px;
	color: var(--rf-ink);
}

.rfm .rfm-nums {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin: 10px 0;
}

.rfm .rfm-nums span {
	display: block;
	font-size: 11.5px;
	color: var(--rf-muted);
	text-transform: uppercase;
	letter-spacing: .4px;
}

.rfm .rfm-nums b {
	display: block;
	font-size: 19px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.rfm .rfm-edge b {
	color: var(--rf-green-bright);
}

.rfm .rfm-why {
	font-size: 14px;
	line-height: 1.55;
	color: #C6D4DE;
}

.rfm .rfm-why p {
	margin: 0 0 8px;
}

.rfm .rfm-why p:last-child {
	margin-bottom: 0;
}

.rfm .rfm-cmp {
	margin-top: 10px;
	font-size: 13.5px;
}

.rfm .rfm-cmp summary {
	cursor: pointer;
	color: var(--rf-teal-bright);
	font-weight: 600;
}

.rfm .rfm-cmp table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 8px;
}

.rfm .rfm-cmp td {
	padding: 5px 0;
	border-bottom: 1px solid var(--rf-line);
}

.rfm .rfm-cmp td:last-child {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.rfm .rfm-cmp .rfm-best td {
	color: var(--rf-green-bright);
	font-weight: 700;
}

.rfm .rfm-cmp .rfm-fine {
	color: var(--rf-muted);
	font-size: 11.5px;
	margin-top: 6px;
}

.rfm .rfm-tip-actions {
	margin-top: 10px;
	display: flex;
	gap: 8px;
}

.rfm .rfm-save {
	background: transparent;
	border: 1px solid var(--rf-line);
	color: var(--rf-muted);
	border-radius: 999px;
	padding: 6px 14px;
	font-size: 13px;
	cursor: pointer;
	font-family: inherit;
}

.rfm .rfm-save.is-on {
	border-color: var(--rf-teal-bright);
	color: var(--rf-teal-bright);
}

/* ------------------------------------------------------------------ *
 * Safer gambling and empty states
 * ------------------------------------------------------------------ */

.rfm .rfm-rg {
	background: #0F2A22;
	border: 1px solid #1E6B4F;
	border-radius: 12px;
	padding: 12px 14px;
	font-size: 13px;
	line-height: 1.55;
	color: #BFE6D5;
	margin: 16px 0 0;
}

.rfm .rfm-rg strong {
	color: #fff;
}

.rfm .rfm-rg a {
	color: var(--rf-green-bright);
}

.rfm .rfm-empty {
	background: var(--rf-page-surface);
	border: 1px dashed var(--rf-page-line);
	border-radius: var(--rf-radius);
	padding: 26px 20px;
	text-align: center;
	color: var(--rf-page-muted);
}

.rfm .rfm-empty p {
	margin: 0 0 10px;
}

/* ------------------------------------------------------------------ *
 * Tomorrow
 *
 * A second, clearly separated section under today's selections. The rule
 * and the heading do the work: nothing here should read as "on now".
 * ------------------------------------------------------------------ */

.rfm .rfm-ahead {
	margin: 26px 0 0;
	padding: 20px 0 0;
	border-top: 1px solid var(--rf-page-line);
}

.rfm .rfm-ahead-head {
	margin: 0 0 14px;
}

.rfm .rfm-ahead .rfm-h3 {
	margin: 0 0 4px;
	font-size: 18px;
}

.rfm .rfm-ahead .rfm-sub {
	margin: 0;
	font-size: 14px;
}

/* Tomorrow's cards sit a step back from today's. */
.rfm .rfm-tip.is-ahead {
	border-left: 3px solid var(--rf-teal);
}

.rfm .rfm-when {
	display: inline-block;
	margin-right: 6px;
	padding: 1px 7px;
	border-radius: 5px;
	background: rgba(92, 195, 222, .16);
	color: var(--rf-teal-bright);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .4px;
	vertical-align: 1px;
}

.rfm .rfm-gate {
	background: var(--rf-page-surface);
	border: 1px solid var(--rf-page-line);
	border-radius: var(--rf-radius);
	padding: 26px 22px;
}

.rfm .rfm-gate .rfm-btn {
	margin: 0 6px 8px 0;
}

.rfm .rfm-pause {
	background: var(--rf-page-tint);
	border-radius: 10px;
	padding: 14px;
	margin: 0 0 16px;
}

/* ------------------------------------------------------------------ *
 * Ledger page: heading, back link, charts
 * ------------------------------------------------------------------ */

.rfm .rfm-back {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 14.5px;
	font-weight: 600;
	color: var(--rf-teal);
	text-decoration: none;
	margin-bottom: 14px;
}

.rfm .rfm-back:hover {
	color: var(--rf-deep);
	text-decoration: underline;
}

.rfm .rfm-page-head {
	margin-bottom: 16px;
}

/*
 * Chart colours. Validated against both panel surfaces for colour-vision
 * deficiency and contrast — see class-rfm-charts.php. Every mark is also
 * directly labelled, so colour is never the only channel.
 */
.rfm {
	--viz-pos: #0092B8;
	--viz-neg: #B5761A;
	--viz-ramp-1: #00738F;
	--viz-ramp-2: #0092B8;
	--viz-ramp-3: #2E99B5;
	--viz-grid: var(--rf-page-line);
}

.rfm[data-theme="dark"] {
	--viz-pos: #2BA2C4;
	--viz-neg: #BC7F20;
	--viz-ramp-1: #7ED3E8;
	--viz-ramp-2: #2BA2C4;
	--viz-ramp-3: #1A7A94;
}

.rfm .rfm-chart {
	margin: 0 0 18px;
	padding: 16px 18px 14px;
	background: var(--rf-page-surface);
	border: 1px solid var(--rf-page-line);
	border-radius: var(--rf-radius);
}

.rfm .rfm-chart-head h4 {
	margin: 0 0 2px;
	font-size: 17px;
	font-weight: 700;
	color: var(--rf-page-ink);
}

.rfm .rfm-chart-head p {
	margin: 0 0 14px;
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--rf-page-muted);
}

.rfm .rfm-chart-note {
	margin: 0;
	font-size: 14px;
	color: var(--rf-page-muted);
}

.rfm .rfm-chart-pair {
	display: grid;
	gap: 0 18px;
	grid-template-columns: 1fr;
}

@media (min-width: 760px) {
	.rfm .rfm-chart-pair {
		grid-template-columns: 1fr 1fr;
	}
}

/* Running-total chart */

.rfm .rfm-chart-body {
	position: relative;
}

.rfm .rfm-svg {
	display: block;
	width: 100%;
	height: 168px;
}

.rfm .rfm-area-up {
	fill: var(--viz-pos);
	opacity: .16;
}

.rfm .rfm-area-down {
	fill: var(--viz-neg);
	opacity: .16;
}

.rfm .rfm-zero {
	stroke: var(--viz-grid);
	stroke-width: 1;
}

.rfm .rfm-line {
	fill: none;
	stroke: var(--viz-pos);
	stroke-width: 2;
	stroke-linejoin: round;
	stroke-linecap: round;
}

.rfm .rfm-chart-points {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.rfm .rfm-point {
	position: absolute;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border-radius: 50%;
	pointer-events: auto;
	cursor: help;
}

.rfm .rfm-point::after {
	content: "";
	position: absolute;
	inset: 6px;
	border-radius: 50%;
	background: var(--viz-pos);
	opacity: 0;
	box-shadow: 0 0 0 2px var(--rf-page-surface);
}

.rfm .rfm-point:hover::after,
.rfm .rfm-point:focus-visible::after {
	opacity: 1;
}

.rfm .rfm-chart-foot {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
	margin-top: 8px;
	font-size: 12.5px;
	color: var(--rf-page-muted);
}

.rfm .rfm-chart-foot strong {
	font-size: 19px;
	font-variant-numeric: tabular-nums;
}

.rfm .rfm-pos {
	color: var(--viz-pos);
}

.rfm .rfm-neg {
	color: var(--viz-neg);
}

/* Bar charts */

.rfm .rfm-bars {
	display: grid;
	gap: 12px;
}

/*
 * The label sits above its bar rather than beside it. Side-by-side looks
 * tidier until a long code name ("UK & Ireland") meets a narrow column, and
 * then it clips or wraps into the track. Stacked never does.
 */
.rfm .rfm-bar-row {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: baseline;
	gap: 5px 12px;
}

.rfm .rfm-bar-label {
	grid-column: 1;
	grid-row: 1;
	font-size: 14px;
	font-weight: 600;
	color: var(--rf-page-ink);
	min-width: 0;
}

.rfm .rfm-bar-track {
	display: block;
	height: 16px;
	background: var(--rf-page-tint);
	border-radius: 4px;
	overflow: hidden;
	grid-column: 1 / -1;
	grid-row: 2;
}

.rfm .rfm-bar-fill {
	display: block;
	height: 100%;
	border-radius: 0 4px 4px 0;
	min-width: 3px;
}

.rfm .rfm-ramp-1 { background: var(--viz-ramp-1); }
.rfm .rfm-ramp-2 { background: var(--viz-ramp-2); }
.rfm .rfm-ramp-3 { background: var(--viz-ramp-3); }

.rfm .rfm-bar-value {
	grid-column: 2;
	grid-row: 1;
	text-align: right;
	line-height: 1.2;
	white-space: nowrap;
	display: flex;
	align-items: baseline;
	gap: 7px;
}

.rfm .rfm-bar-value b {
	font-size: 15px;
	font-variant-numeric: tabular-nums;
	color: var(--rf-page-ink);
}

.rfm .rfm-bar-value em {
	font-style: normal;
	font-size: 12px;
	color: var(--rf-page-muted);
}

/* Diverging: two halves either side of a centre axis */

.rfm .rfm-bar-track-split {
	display: flex;
	align-items: stretch;
	background: transparent;
	overflow: visible;
	grid-column: 1 / -1;
	grid-row: 2;
}

.rfm .rfm-bar-half {
	flex: 1 1 50%;
	display: flex;
	background: var(--rf-page-tint);
	border-radius: 4px;
	overflow: hidden;
	min-width: 0;
}

.rfm .rfm-bar-half:first-child {
	justify-content: flex-end;
}

.rfm .rfm-bar-half:first-child .rfm-bar-fill {
	border-radius: 4px 0 0 4px;
}

.rfm .rfm-bar-axis {
	width: 2px;
	flex: none;
	background: var(--viz-grid);
}

.rfm .rfm-pos-fill { background: var(--viz-pos); }
.rfm .rfm-neg-fill { background: var(--viz-neg); }

.rfm .rfm-bars {
	gap: 14px;
}

/* ------------------------------------------------------------------ *
 * Ledger table
 * ------------------------------------------------------------------ */

.rfm .rfm-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14.5px;
	margin-top: 8px;
}

.rfm .rfm-table th {
	text-align: left;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .5px;
	color: var(--rf-page-muted);
	border-bottom: 2px solid var(--rf-page-line);
	padding: 8px 6px;
}

.rfm .rfm-table td {
	padding: 10px 6px;
	border-bottom: 1px solid var(--rf-page-line);
}

.rfm .rfm-table .rfm-r-won td {
	color: #12703F;
	font-weight: 600;
}

@media (max-width: 600px) {
	.rfm .rfm-table thead {
		display: none;
	}

	.rfm .rfm-table tr {
		display: block;
		border: 1px solid var(--rf-page-line);
		border-radius: 10px;
		padding: 8px 10px;
		margin-bottom: 8px;
	}

	.rfm .rfm-table td {
		display: flex;
		justify-content: space-between;
		gap: 12px;
		border: none;
		padding: 3px 0;
	}

	.rfm .rfm-table td::before {
		content: attr(data-label);
		color: var(--rf-page-muted);
		font-size: 12px;
		text-transform: uppercase;
		letter-spacing: .4px;
	}
}

/* ------------------------------------------------------------------ *
 * Member bar and session nudge
 * ------------------------------------------------------------------ */

/*
 * The member bar almost always sits inside a dark site header, so it carries
 * its own light-on-dark colours rather than the panel palette — otherwise the
 * ghost buttons render navy on navy and vanish.
 * For a light header, use [rf_member_bar theme="light"].
 */
.rfm-bar {
	display: flex;
	align-items: center;
	gap: 8px;
}

.rfm-bar .rfm-btn {
	padding: 8px 15px;
	font-size: 14px;
}

.rfm-bar .rfm-btn-ghost {
	color: #FFFFFF;
	border-color: rgba(255, 255, 255, .34);
}

.rfm-bar .rfm-btn-ghost:hover,
.rfm-bar .rfm-btn-ghost:focus-visible {
	color: var(--rf-teal-bright);
	border-color: var(--rf-teal-bright);
	background: transparent;
}

.rfm-bar[data-bar="light"] .rfm-btn-ghost {
	color: var(--rf-page-ink);
	border-color: var(--rf-page-line);
}

.rfm-bar[data-bar="light"] .rfm-btn-ghost:hover,
.rfm-bar[data-bar="light"] .rfm-btn-ghost:focus-visible {
	color: var(--rf-teal);
	border-color: var(--rf-teal);
}

.rfm-nudge {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: 16px;
	z-index: 9999;
	background: #0F2A22;
	border: 1px solid #1E6B4F;
	color: #BFE6D5;
	border-radius: 12px;
	padding: 14px 16px;
	font-size: 14px;
	line-height: 1.5;
	max-width: 520px;
	margin: 0 auto;
	box-shadow: 0 10px 30px rgba(10, 22, 40, .35);
}

.rfm-nudge button {
	background: transparent;
	border: 1px solid #1E6B4F;
	color: #BFE6D5;
	border-radius: 999px;
	padding: 5px 14px;
	margin-top: 8px;
	cursor: pointer;
	font: inherit;
	font-size: 13px;
}

/* ------------------------------------------------------------------ *
 * Dark theme sites
 * ------------------------------------------------------------------ */

/*
 * Opt-in only, via data-theme="dark" on the wrapper.
 *
 * This used to follow the visitor's prefers-color-scheme. That was wrong here:
 * the theme around it does not follow the OS, so a visitor on a dark desktop
 * got dark plugin panels inside a light page, with the theme's dark heading
 * colour landing on a dark panel. The plugin now matches its theme, not the OS.
 */
.rfm[data-theme="dark"] {
	--rf-page-ink: #E7EEF2;
	--rf-page-muted: #97A9B7;
	--rf-page-line: #23405C;
	--rf-page-surface: #10223A;
	--rf-page-tint: #143049;
}

.rfm[data-theme="dark"] .rfm-field input[type="text"],
.rfm[data-theme="dark"] .rfm-field input[type="email"],
.rfm[data-theme="dark"] .rfm-field input[type="password"],
.rfm[data-theme="dark"] .rfm-field select,
.rfm[data-theme="dark"] .rfm-chip {
	background: #0D1C30;
	color: var(--rf-page-ink);
}

.rfm[data-theme="dark"] .rfm-msg-ok {
	background: #10352A;
	color: #BFE6D5;
}

.rfm[data-theme="dark"] .rfm-msg-error {
	background: #3A1B1C;
	color: #F2C9C9;
}

.rfm[data-theme="dark"] .rfm-msg-warn {
	background: #3A2F16;
	color: #F0DCA9;
}

.rfm[data-theme="dark"] .rfm-table .rfm-r-won td {
	color: var(--rf-green-bright);
}

@media (prefers-reduced-motion: reduce) {
	.rfm * {
		transition: none !important;
	}
}
