.pxs-portal {
	--pxs-border: #e2e4e7;
	--pxs-muted: #646970;
	--pxs-bg: #fff;
	--pxs-accent: #1d4ed8;
	margin: 1.5rem 0;
}

.pxs-portal__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
}

.pxs-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px;
	margin-bottom: 1.5rem;
}

.pxs-stat {
	background: var(--pxs-bg);
	border: 1px solid var(--pxs-border);
	border-radius: 8px;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.pxs-stat__value {
	font-size: 1.5rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.pxs-stat__label,
.pxs-note,
.pxs-empty,
.pxs-project__number {
	color: var(--pxs-muted);
	font-size: 0.875rem;
}

.pxs-project {
	background: var(--pxs-bg);
	border: 1px solid var(--pxs-border);
	border-radius: 8px;
	padding: 16px 20px;
	margin-bottom: 16px;
}

.pxs-project__header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
}

.pxs-project__title {
	margin: 0 0 8px;
	font-size: 1.125rem;
}

.pxs-project__number {
	font-weight: 400;
	margin-left: 6px;
}

.pxs-badge {
	background: #eef2ff;
	color: var(--pxs-accent);
	border-radius: 999px;
	padding: 2px 10px;
	font-size: 0.75rem;
	white-space: nowrap;
}

.pxs-project__meta {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 8px 16px;
	margin: 0 0 12px;
}

.pxs-project__meta dt {
	color: var(--pxs-muted);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.pxs-project__meta dd {
	margin: 0;
}

.pxs-table-wrap {
	overflow-x: auto;
}

.pxs-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
}

.pxs-table th,
.pxs-table td {
	text-align: left;
	padding: 8px 10px;
	border-bottom: 1px solid var(--pxs-border);
	white-space: nowrap;
}

.pxs-table th {
	color: var(--pxs-muted);
	font-weight: 500;
}

.pxs-table td:first-child {
	white-space: normal;
}

/* Admin: raw dienst data */
.pxs-raw {
	margin: 0 0 6px;
	min-width: 280px;
}

.pxs-raw summary {
	cursor: pointer;
	color: #646970;
}

.pxs-raw--used summary {
	color: #00a32a;
}

.pxs-raw pre {
	max-height: 400px;
	max-width: 640px;
	overflow: auto;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	padding: 10px;
	font-size: 12px;
	white-space: pre;
}

/* Piggy bank */
.pxs-piggy {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 12px;
	margin-bottom: 12px;
}

.pxs-piggy > div {
	background: var(--pxs-bg);
	border: 1px solid var(--pxs-border);
	border-radius: 8px;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.pxs-piggy__balance {
	border-left: 4px solid #00a32a !important;
}

.pxs-piggy__label {
	color: var(--pxs-muted);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.pxs-piggy__amount {
	font-size: 2rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: 1.2;
}

.pxs-piggy__sub {
	color: var(--pxs-muted);
	font-size: 0.875rem;
}

.pxs-heading {
	margin: 2rem 0 0.75rem;
	font-size: 1.25rem;
}

/* Tier explanation */
.pxs-tiers {
	margin-bottom: 1rem;
}

.pxs-tiers summary {
	cursor: pointer;
	color: var(--pxs-accent);
}

.pxs-table--compact {
	width: auto;
	min-width: 280px;
}

.pxs-table tr.is-current td {
	font-weight: 600;
	background: #eef2ff;
}

/* Timeline */
.pxs-timeline {
	list-style: none;
	margin: 0;
	padding: 0;
	border-left: 2px solid var(--pxs-border);
}

.pxs-timeline__item {
	position: relative;
	display: grid;
	grid-template-columns: 96px 1fr auto;
	gap: 12px;
	align-items: start;
	padding: 10px 0 10px 16px;
	margin: 0;
}

.pxs-timeline__item::before {
	content: "";
	position: absolute;
	left: -7px;
	top: 16px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #00a32a;
	border: 2px solid var(--pxs-bg);
}

.pxs-timeline__item--payout::before {
	background: var(--pxs-accent);
}

.pxs-timeline__item--correction::before {
	background: #dba617;
}

.pxs-timeline__date {
	color: var(--pxs-muted);
	font-size: 0.875rem;
	font-variant-numeric: tabular-nums;
	padding-top: 2px;
}

.pxs-timeline__type {
	display: inline-block;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--pxs-muted);
	margin-right: 6px;
}

.pxs-timeline__meta {
	color: var(--pxs-muted);
	font-size: 0.8125rem;
	margin-top: 2px;
}

.pxs-timeline__amount {
	text-align: right;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.pxs-timeline__amount.is-positive {
	color: #00a32a;
}

.pxs-timeline__amount.is-negative {
	color: #d63638;
}

.pxs-timeline__balance {
	display: block;
	font-weight: 400;
	font-size: 0.75rem;
	color: var(--pxs-muted);
}

@media (max-width: 600px) {
	.pxs-timeline__item {
		grid-template-columns: 1fr auto;
	}

	.pxs-timeline__date {
		grid-column: 1 / -1;
	}
}
