.bptd-open-trades,
.bptd-closed-trades,
.bptd-trade-detail,
.bptd-summary,
.bptd-chart-card {
	--bptd-border: #222;
	--bptd-border-width: 1px;
	--bptd-card-bg: #fff;
	--bptd-card-border: #222;
	--bptd-card-radius: 8px;
	--bptd-cell-padding: 7px 6px;
	--bptd-font-size: 12px;
	--bptd-header-bg: #555a60;
	--bptd-header-text: #fff;
	--bptd-line-height: 1.25;
	--bptd-number-align: center;
	--bptd-positive: #08783e;
	--bptd-negative: #b42318;
	--bptd-row-alt-bg: #f3f3f3;
	--bptd-row-bg: #fff;
	--bptd-text: #667085;
	--bptd-muted: #667085;
	color: var(--bptd-text);
	font-size: var(--bptd-font-size);
}

.bptd-table-scroll { overflow-x: auto; }
.bptd-table {
	border-collapse: collapse;
	font-size: var(--bptd-font-size) !important;
	line-height: var(--bptd-line-height) !important;
	min-width: 920px;
	width: 100%;
}
.bptd-table th {
	background: var(--bptd-header-bg);
	border: var(--bptd-border-width) solid var(--bptd-border);
	color: var(--bptd-header-text);
	font-size: var(--bptd-font-size) !important;
	letter-spacing: .02em;
	line-height: var(--bptd-line-height) !important;
	padding: var(--bptd-cell-padding);
	text-align: center;
	text-transform: uppercase;
	white-space: nowrap;
}
.bptd-sortable-header { cursor: pointer; }
.bptd-sortable-header::after { color: #98a2b3; content: " ↕"; font-size: 10px; }
.bptd-sortable-header[data-order="asc"]::after { content: " ↑"; }
.bptd-sortable-header[data-order="desc"]::after { content: " ↓"; }
.bptd-table th:first-child,
.bptd-table td:first-child { text-align: left; }
.bptd-table td {
	background: var(--bptd-row-bg);
	border: var(--bptd-border-width) solid var(--bptd-border);
	color: var(--bptd-text);
	padding: var(--bptd-cell-padding);
	text-align: var(--bptd-number-align);
	vertical-align: middle;
	white-space: nowrap;
	font-size: var(--bptd-font-size) !important;
	line-height: var(--bptd-line-height) !important;
}
.bptd-table td strong,
.bptd-table td small {
	font-size: inherit !important;
}
.bptd-table tbody tr:nth-child(even) td { background: var(--bptd-row-alt-bg); }

.bptd-table--compact {
	font-size: var(--bptd-font-size);
	min-width: 920px;
}

.bptd-table--compact th {
	padding: var(--bptd-cell-padding);
}

.bptd-table--compact td {
	padding: var(--bptd-cell-padding);
}
.bptd-table td small { color: var(--bptd-text); }
.bptd-security-name { margin-left: .35em; }
.bptd-positive { color: var(--bptd-positive) !important; }
.bptd-negative { color: var(--bptd-negative) !important; }
.bptd-neutral { color: inherit; }
.bptd-direction,
.bptd-status {
	border-radius: 999px;
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	padding: 3px 7px;
}
.bptd-direction--long { background: #ecfdf3; color: #027a48; }
.bptd-direction--short { background: #fef3f2; color: #b42318; }
.bptd-status { background: #f2f4f7; color: #344054; }
.bptd-status--error,
.bptd-status--missing { background: #fff1f0; color: #b42318; }
.bptd-status--stale { background: #fffaeb; color: #b54708; }
.bptd-status--available,
.bptd-status--manual { background: #ecfdf3; color: #027a48; }

.bptd-summary {
	display: grid;
	gap: 10px;
	grid-template-columns: repeat(5, minmax(130px, 1fr));
	margin-top: 18px;
}
.bptd-summary > div {
	background: var(--bptd-card-bg);
	border: var(--bptd-border-width) solid var(--bptd-card-border);
	border-radius: var(--bptd-card-radius);
	color: var(--bptd-text);
	padding: 12px;
}
.bptd-summary span { color: var(--bptd-text); display: block; font-size: 12px; margin-bottom: 4px; }
.bptd-summary strong { font-size: 18px; }

.bptd-summary--standalone,
.bptd-summary--stats {
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	margin-top: 0;
}

.bptd-summary--standalone {
	grid-template-columns: repeat(7, minmax(0, 1fr));
}

.bptd-summary--standalone > div {
	min-width: 0;
	padding: 10px;
}

.bptd-summary--standalone span {
	font-size: calc(var(--bptd-font-size) - 1px);
	white-space: nowrap;
}

.bptd-summary--standalone strong {
	font-size: calc(var(--bptd-font-size) + 5px);
}

.bptd-table-toolbar {
	display: flex;
	justify-content: flex-end;
	margin: 0 0 12px;
}

.bptd-table-filter {
	background: var(--bptd-row-bg) !important;
	border: 1px solid var(--bptd-border);
	border-radius: 4px;
	box-sizing: border-box;
	color: var(--bptd-text) !important;
	font-size: var(--bptd-font-size) !important;
	height: auto !important;
	line-height: var(--bptd-line-height) !important;
	max-width: 260px;
	min-height: 0 !important;
	padding: 6px 9px !important;
	width: 100%;
}

.bptd-chart-card {
	background: #fff;
	border: 1px solid var(--bptd-border);
	border-radius: 8px;
	padding: 16px;
}

.bptd-performance-chart {
	display: block;
	max-width: 100%;
	width: 100%;
}

.bptd-chart-note {
	color: var(--bptd-muted);
	font-size: 12px;
	margin: 8px 0 0;
}

.bptd-cycle {
	border-top: 1px solid #1d2939;
	margin-top: 24px;
	padding-top: 14px;
}

.bptd-cycle:first-of-type {
	margin-top: 12px;
}

.bptd-cycle h4,
.bptd-cycle h5 {
	margin: 0 0 12px;
}

.bptd-trade-detail,
.bptd-trade-detail h3,
.bptd-trade-detail h4,
.bptd-trade-detail h5,
.bptd-cycle-summary {
	color: var(--bptd-text);
	font-size: var(--bptd-font-size);
}

.bptd-cycle h5 {
	border-bottom: 1px solid #1d2939;
	font-size: calc(var(--bptd-font-size) + 2px);
	margin-top: 24px;
	padding-bottom: 8px;
}

.bptd-cycle-summary {
	display: grid;
	grid-template-columns: repeat(9, minmax(100px, 1fr));
	margin-bottom: 12px;
}

.bptd-cycle-summary > div {
	border-bottom: 1px solid var(--bptd-border);
	padding: 9px 8px;
	text-align: center;
}

.bptd-cycle-summary span {
	color: var(--bptd-text);
	display: block;
	font-size: calc(var(--bptd-font-size) - 1px);
	margin-bottom: 5px;
}

.bptd-cycle-summary strong {
	font-size: calc(var(--bptd-font-size) + 1px);
}

@media (max-width: 800px) {
	.bptd-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.bptd-summary--standalone { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.bptd-mobile-cards .bptd-table {
		display: block;
		min-width: 0;
	}
	.bptd-mobile-cards .bptd-table thead { display: none; }
	.bptd-mobile-cards .bptd-table tbody,
	.bptd-mobile-cards .bptd-table tr,
	.bptd-mobile-cards .bptd-table td { display: block; width: 100%; }
	.bptd-mobile-cards .bptd-table tr {
		border: 1px solid var(--bptd-border);
		border-radius: 8px;
		margin-bottom: 12px;
		padding: 8px 12px;
	}
	.bptd-mobile-cards .bptd-table td {
		border-bottom: 1px solid var(--bptd-border);
		padding: 8px 0;
		text-align: left;
		white-space: normal;
	}
	.bptd-mobile-cards .bptd-table td::before {
		color: var(--bptd-muted);
		content: attr(data-label);
		display: block;
		font-size: 10px;
		font-weight: 700;
		letter-spacing: .03em;
		text-transform: uppercase;
	}
	.bptd-mobile-cards .bptd-table td:last-child { border-bottom: 0; }
	.bptd-cycle-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
	.bptd-cycle-summary { grid-template-columns: 1fr; }
}
