.affp-account {
	--affp-accent: #4b5563;
	--affp-line: rgba(0, 0, 0, .12);
	--affp-muted: rgba(0, 0, 0, .55);
	font-size: 15px;
}

.affp-account * { box-sizing: border-box; }

.affp-intro { margin-bottom: 20px; }

.affp-notice {
	border: 1px solid var(--affp-line);
	border-left: 3px solid var(--affp-accent);
	padding: 14px 16px;
	border-radius: 4px;
}

/* Code and link */

.affp-code-panel {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 16px;
	margin-bottom: 20px;
	align-items: start;
}

@media (max-width: 700px) {
	.affp-code-panel { grid-template-columns: 1fr; }
}

.affp-code-block {
	border: 1px solid var(--affp-line);
	border-radius: 6px;
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.affp-label {
	font-size: 11px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--affp-muted);
}

.affp-copy-row {
	display: flex;
	gap: 8px;
	align-items: center;
	min-width: 0;
}

.affp-code {
	font-size: 20px;
	font-weight: 700;
	letter-spacing: .06em;
	background: none;
	padding: 0;
}

.affp-link-input {
	flex: 1;
	min-width: 0;
	font-size: 13px;
	padding: 6px 8px;
	border: 1px solid var(--affp-line);
	border-radius: 4px;
	background: rgba(0, 0, 0, .02);
}

.affp-copy {
	border: 1px solid var(--affp-accent);
	background: none;
	color: var(--affp-accent);
	padding: 6px 14px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 12px;
	letter-spacing: .04em;
	text-transform: uppercase;
	white-space: nowrap;
}

.affp-copy.is-copied {
	background: var(--affp-accent);
	color: #fff;
}

/* The code an applicant picks — monospaced so ambiguous characters read clearly. */
.affp-field input.affp-code-input {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 16px;
	letter-spacing: .06em;
	text-transform: lowercase;
}

/* Discount and commission pills */

.affp-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 2px;
}

.affp-pill-stat {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	padding: 6px 14px;
	border-radius: 999px;
	background: rgba(0, 0, 0, .05);
	border: 1px solid transparent;
}

.affp-pill-stat.is-accent {
	background: rgba(0, 0, 0, .04);
	border-color: var(--affp-accent);
}

/* Tinted fill where colour mixing is supported; the border carries it elsewhere. */
@supports (background: color-mix(in srgb, red 10%, transparent)) {
	.affp-pill-stat.is-accent {
		background: color-mix(in srgb, var(--affp-accent) 12%, transparent);
		border-color: color-mix(in srgb, var(--affp-accent) 38%, transparent);
	}
}

.affp-pill-value {
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .01em;
}

.affp-pill-stat.is-accent .affp-pill-value { color: var(--affp-accent); }

.affp-pill-label {
	font-size: 11px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--affp-muted);
}

/* Stats */

.affp-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 12px;
	margin-bottom: 20px;
}

.affp-stat {
	border: 1px solid var(--affp-line);
	border-radius: 6px;
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.affp-stat-label {
	font-size: 11px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--affp-muted);
}

.affp-stat-value { font-size: 20px; font-weight: 700; line-height: 1.2; }
.affp-stat-value.affp-accent { color: var(--affp-accent); }

/* Panels */

.affp-panel {
	border: 1px solid var(--affp-line);
	border-radius: 6px;
	padding: 16px 18px;
	margin-bottom: 20px;
}

.affp-panel-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.affp-panel-head h3 {
	margin: 0;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: .06em;
}

.affp-pill {
	border: 1px solid var(--affp-accent);
	color: var(--affp-accent);
	border-radius: 12px;
	padding: 2px 12px;
	font-size: 12px;
}

.affp-note { color: var(--affp-muted); font-size: 13px; margin: 8px 0 0; }
.affp-empty { color: var(--affp-muted); text-align: center; padding: 18px 0; }

.affp-progress {
	height: 8px;
	border-radius: 4px;
	background: rgba(0, 0, 0, .07);
	overflow: hidden;
}

.affp-progress span {
	display: block;
	height: 100%;
	background: var(--affp-accent);
}

/* Tier cards on the application form */

.affp-tier-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 12px;
	margin-bottom: 24px;
}

.affp-tier-card {
	border: 1px solid var(--affp-line);
	border-radius: 6px;
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.affp-tier-name { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--affp-muted); }
.affp-tier-rate { font-size: 22px; font-weight: 700; color: var(--affp-accent); }
.affp-tier-meta { font-size: 12px; color: var(--affp-muted); }

/* Tables */

.affp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.affp-table th, .affp-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--affp-line); }

.affp-table th {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--affp-muted);
	font-weight: 600;
}

.affp-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 600px) {
	.affp-panel { padding: 14px 12px; }
	.affp-code-block { padding: 12px 14px; }
	.affp-table { font-size: 13px; }
	.affp-table th, .affp-table td { padding: 8px 6px; white-space: nowrap; }
	.affp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.affp-code { font-size: 18px; }
}

.affp-status {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 600;
	background: rgba(0, 0, 0, .06);
}

.affp-status-approved { background: #e6f4ea; color: #1e7a3c; }
.affp-status-pending { background: #fdf3e2; color: #8a6116; }
.affp-status-paid { background: #e8f0fe; color: #1a56b8; }
.affp-status-rejected { background: #fbeaea; color: #a92222; }

/* Forms */

.affp-form { max-width: 560px; }
.affp-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.affp-field label { font-size: 13px; color: var(--affp-muted); }
.affp-field input[type="text"], .affp-field textarea, .affp-field select {
	width: 100%;
	padding: 9px 10px;
	border: 1px solid var(--affp-line);
	border-radius: 4px;
	font: inherit;
	background: #fff;
}

.affp-check label { display: flex; gap: 8px; align-items: center; }

.affp-button {
	background: var(--affp-accent);
	color: #fff;
	border: 0;
	padding: 11px 24px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 13px;
	letter-spacing: .06em;
	text-transform: uppercase;
}

/* Charts */

.affp-chart { width: 100%; }
.affp-svg { width: 100%; height: auto; overflow: visible; }
.affp-grid { stroke: rgba(0, 0, 0, .08); stroke-width: 1; }
.affp-axis { fill: rgba(0, 0, 0, .45); font-size: 11px; }
.affp-hit { cursor: pointer; }

.affp-pager { display: flex; gap: 4px; margin-top: 12px; }

.affp-pager a {
	padding: 4px 10px;
	border: 1px solid var(--affp-line);
	border-radius: 3px;
	text-decoration: none;
	font-size: 13px;
}

.affp-pager a.is-current { background: var(--affp-accent); color: #fff; border-color: var(--affp-accent); }

/* Last so it beats the display rules of anything it is applied to. */
.affp-hidden { display: none !important; }
