/* Westplan Track Record — brand styling */
.wptr-card {
	--wptr-green: #1F4726;
	--wptr-green-soft: #eaf1ec;
	--wptr-salmon: #F2DBC2;
	--wptr-ink: #1e3d2a;
	--wptr-text: #333333;
	--wptr-muted: #8a8f8b;
	--wptr-line: #ede8e0;
	--wptr-line-soft: #f0ebe3;

	font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	color: var(--wptr-text);
	/* No background / shadow / padding: the table is meant to sit inside your
	   own container so you control the surrounding layout and content. */
	background: transparent;
	border-radius: 0;
	box-shadow: none;
	padding: 0;
	max-width: 100%;
	box-sizing: border-box;
}
.wptr-card *,
.wptr-card *::before,
.wptr-card *::after {
	box-sizing: border-box;
}

/* Tabs */
.wptr-tabs {
	display: inline-flex;
	gap: 4px;
	background: #f4f1ec;
	border-radius: 999px;
	padding: 4px;
	margin-bottom: 16px;
	max-width: 100%;
}
.wptr-tab-btn {
	appearance: none;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	font-size: 13px;
	line-height: 1;
	color: var(--wptr-muted);
	background: transparent;
	padding: 9px 16px;
	border-radius: 999px;
	white-space: nowrap;
	transition: background 0.15s ease, color 0.15s ease;
}
.wptr-tab-btn:hover { color: var(--wptr-ink); }
.wptr-tab-btn.is-active {
	background: var(--wptr-green);
	color: #ffffff;
}
.wptr-count { font-weight: 700; opacity: 0.9; }

/* Panels */
.wptr-panel { display: none; }
.wptr-panel.is-active { display: block; }

/* Horizontal scroll wrapper for small screens */
.wptr-scroll {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* Table */
.wptr-table {
	width: 100%;
	min-width: 760px;
	border-collapse: collapse;
	font-size: 13px;
}
.wptr-table thead th {
	position: relative;
	text-align: left;
	font-weight: 700;
	font-size: 10px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wptr-muted);
	white-space: nowrap;
	padding: 9px 10px;
	border-bottom: 1px solid var(--wptr-line);
	cursor: pointer;
	user-select: none;
}
.wptr-table thead th:focus-visible { outline: 2px solid var(--wptr-green); outline-offset: -2px; }
.wptr-th-label { vertical-align: middle; }
.wptr-caret {
	display: inline-block;
	width: 0;
	height: 0;
	margin-left: 6px;
	vertical-align: middle;
	border-left: 3.5px solid transparent;
	border-right: 3.5px solid transparent;
	opacity: 0.35;
	border-top: 4px solid currentColor; /* default: down */
}
.wptr-th:hover .wptr-caret { opacity: 0.6; }

/* Active sort column */
.wptr-th.is-sorted {
	color: var(--wptr-ink);
	background: var(--wptr-green-soft);
}
.wptr-th.is-sorted .wptr-caret { opacity: 1; }
.wptr-th.is-sorted.asc .wptr-caret {
	border-top: 0;
	border-bottom: 4px solid currentColor;
}
.wptr-th.is-sorted.desc .wptr-caret {
	border-bottom: 0;
	border-top: 4px solid currentColor;
}

/* Body cells */
.wptr-table tbody td {
	padding: 9px 10px;
	border-bottom: 1px solid var(--wptr-line-soft);
	color: var(--wptr-text);
	white-space: nowrap;
	vertical-align: middle;
}
.wptr-table tbody tr:hover td { background: #faf8f4; }

.wptr-num-col { color: var(--wptr-muted); width: 1%; }
.wptr-th.is-sorted.wptr-num-col,
.wptr-table tbody tr td.wptr-num-col { }

/* IRR emphasis */
.wptr-irr { font-weight: 900; color: var(--wptr-ink); }

/* Project: show the full name (no ellipsis) and give it the most room.
   Selectors are scoped to the table so they outrank the base td white-space rule. */
.wptr-table tbody td.wptr-col-project,
.wptr-table thead th.wptr-col-project {
	width: 34%;
	min-width: 200px;
	white-space: normal;
}
/* Market: wrap onto a second line when needed (constrained width forces the wrap). */
.wptr-table tbody td.wptr-col-market,
.wptr-table thead th.wptr-col-market {
	width: 180px;
	max-width: 180px;
	white-space: normal;
	overflow-wrap: break-word;
}

.wptr-empty { color: var(--wptr-muted); padding: 16px 0; }

/* ------------------------------------------------------------------ */
/* Returns-distribution pie                                            */
/* ------------------------------------------------------------------ */
.wptr-pie {
	--wptr-green: #1F4726;
	--wptr-salmon: #F2DBC2;
	--wptr-ink: #1e3d2a;
	--wptr-muted: #8a8f8b;
	font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	color: #333;
	max-width: 100%;
	box-sizing: border-box;
}
.wptr-pie *, .wptr-pie *::before, .wptr-pie *::after { box-sizing: border-box; }

.wptr-pie-head { margin-bottom: 12px; }
.wptr-pie-title {
	font-weight: 700;
	font-size: 15px;
	color: var(--wptr-ink);
	line-height: 1.2;
}
.wptr-pie-sub {
	font-size: 11px;
	color: var(--wptr-muted);
	margin-top: 3px;
}

.wptr-pie-body {
	display: flex;
	align-items: center;
	gap: 28px;
	flex-wrap: wrap;
}
.wptr-pie-figure {
	flex: 0 0 auto;
	width: 190px;
	max-width: 60vw;
}
.wptr-pie-svg { display: block; width: 100%; height: auto; }

.wptr-legend {
	flex: 1 1 180px;
	min-width: 160px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.wptr-legend-item {
	display: flex;
	align-items: baseline;
	column-gap: 10px;
	padding: 8px 0;
}
.wptr-legend-item + .wptr-legend-item { border-top: 1px solid #f0ebe3; }
.wptr-legend-dot {
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	align-self: center;
	display: inline-block;
}
.wptr-legend-text {
	font-weight: 900;
	font-size: 16px;
	color: var(--wptr-ink);
	line-height: 1.2;
}
.wptr-legend-pct {
	font-weight: 400;
	font-size: 12px;
	color: var(--wptr-muted);
	margin-left: 2px;
}

@media (max-width: 600px) {
	.wptr-pie-body { gap: 18px; }
	.wptr-pie-figure { width: 160px; }
	.wptr-legend-text { font-size: 15px; }
}

/* Mobile */
@media (max-width: 600px) {
	.wptr-tab-btn { font-size: 12px; padding: 8px 13px; }
	.wptr-table { font-size: 12px; }
	.wptr-table tbody td.wptr-col-project { min-width: 150px; }
	.wptr-table tbody td.wptr-col-market,
	.wptr-table thead th.wptr-col-market { width: 150px; max-width: 150px; }
	.wptr-table thead th,
	.wptr-table tbody td { padding: 8px 9px; }
}
