.am-m3-public-page,
.am-m3-staff {
	background: var(--am-surface);
	color: var(--am-text);
	min-height: 100vh;
}

.am-m3-staff {
	padding: var(--am-space-5);
}

/* Public access pages use the approved single-canvas logo/card composition. */
.am-m3-public-page {
	align-content: center;
	background:
		radial-gradient(circle at 50% 64%, rgb(3 38 75 / 0.09), transparent 27rem),
		var(--am-surface);
	display: grid;
	gap: var(--am-space-5);
	grid-template-columns: minmax(0, 1fr);
	justify-items: center;
	padding: var(--am-space-8) var(--am-space-5);
	position: relative;
}

.am-m3-public-page > :not(.am-molecular-motif) {
	position: relative;
	z-index: 1;
}

.am-m3-public-page > .am-molecular-motif {
	background-size: 34rem auto;
	height: 14rem;
}

.am-m3-public-page__header {
	display: flex;
	justify-content: center;
	max-width: 100%;
	width: 100%;
}

/* Approved public prose: the existing identity plate, not an account shell. */
.am-m3-public-page.am-public-policy {
	align-content: start;
}

.am-public-policy__paper {
	background: var(--am-white);
	border: 1px solid var(--am-border-strong);
	border-radius: var(--am-radius-card);
	line-height: var(--am-leading-normal);
	max-width: 74ch;
	min-width: 0;
	overflow-wrap: anywhere;
	padding: clamp(var(--am-space-5), 4vw, var(--am-space-8));
	width: 100%;
}

.am-public-policy__paper h1 {
	font-size: var(--am-text-2xl);
}

.am-public-policy__paper h2 {
	font-size: var(--am-text-lg);
	margin-top: var(--am-space-8);
}

.am-public-policy__date {
	color: var(--am-text-muted);
}

.am-public-policy__paper li + li {
	margin-top: var(--am-space-3);
}

.am-public-policy__retention {
	table-layout: fixed;
	width: 100%;
}

.am-public-policy__retention tbody th {
	overflow-wrap: normal;
	word-break: normal;
}

.am-public-policy__return {
	margin-top: var(--am-space-8);
}

.am-policy-links {
	background: var(--am-surface);
	display: flex;
	flex-wrap: wrap;
	gap: var(--am-space-2) var(--am-space-5);
	justify-content: center;
	padding: var(--am-space-4) var(--am-space-5) calc(var(--am-space-8) + env(safe-area-inset-bottom, 0px));
}

.am-policy-links a {
	align-items: center;
	color: var(--am-navy-900);
	display: inline-flex;
	min-height: 2.75rem;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

@media (width <= 48rem) {
	.am-policy-links {
		padding-bottom: calc(7rem + env(safe-area-inset-bottom, 0px));
	}

	.am-public-policy + .am-policy-links {
		padding-bottom: calc(var(--am-space-8) + env(safe-area-inset-bottom, 0px));
	}
}

@media print {
	.am-public-policy {
		background: var(--am-white);
		min-height: auto;
		padding: 0;
	}

	.am-public-policy__paper {
		border: 0;
		max-width: none;
		padding: 0;
	}

	.am-public-policy__paper h2 {
		break-after: avoid;
	}

	.am-public-policy__return,
	.am-policy-links {
		display: none;
	}
}

.am-m3-public-page__brand {
	background: var(--am-white);
	border-radius: 0.75rem;
	box-shadow: 0 0.25rem 1.25rem rgb(2 24 52 / 0.04);
	flex: none;
	gap: 0;
	justify-items: center;
	padding: var(--am-space-3) var(--am-space-5) var(--am-space-2);
	text-align: center;
	width: min(100%, 15rem);
}

.am-m3-public-page__brand .am-brand__logo-frame {
	width: min(100%, 10.5rem);
}

.am-m3-public-page__brand .am-brand__portal-label {
	color: var(--am-text-subtle);
}

.am-m3-form-card,
.am-m3-state-card,
.am-m3-panel {
	background: var(--am-white);
	border: 1px solid var(--am-border-strong);
	border-radius: var(--am-radius-card);
	max-width: 34rem;
	padding: var(--am-space-6);
	width: 100%;
}

.am-m3-public-page .am-m3-form-card,
.am-m3-public-page .am-m3-state-card {
	box-shadow: 0 1.5rem 4rem rgb(2 24 52 / 0.12);
}

.am-m3-signin-card {
	max-width: 28.75rem;
	padding: var(--am-space-8);
}

.am-m3-signin-card h1 {
	font-size: 1.625rem;
}

.am-m3-form-card--wide {
	max-width: 40rem;
	padding: var(--am-space-8);
}

.am-m3-public-page .am-m3-state-card {
	max-width: 28.75rem;
}

/* Icon lead-in for the recovery and invitation cards. */
.am-m3-form-card__symbol,
.am-m3-state-card__symbol {
	align-items: center;
	background: var(--am-surface-2);
	border-radius: 50%;
	color: var(--am-navy-900);
	display: flex;
	height: 3.25rem;
	justify-content: center;
	margin-bottom: var(--am-space-4);
	width: 3.25rem;
}

.am-m3-state-card__symbol {
	margin-inline: auto;
}

.am-m3-state-card--success .am-m3-state-card__symbol {
	background: var(--am-status-success-bg);
	color: var(--am-status-success-fg);
}

.am-m3-state-card--denied .am-m3-state-card__symbol,
.am-m3-state-card--suspended .am-m3-state-card__symbol,
.am-m3-state-card--unavailable .am-m3-state-card__symbol {
	background: var(--am-status-warning-bg);
	color: var(--am-status-warning-fg);
}

.am-m3-state-card__note {
	color: var(--am-text-subtle);
	font-size: var(--am-text-sm);
}

.am-m3-eyebrow {
	color: var(--am-orange-text);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	margin-bottom: var(--am-space-2);
	text-transform: uppercase;
}

.am-m3-public-page .am-button--primary {
	color: var(--am-navy-950);
}

.am-m3-public-page .am-button--primary:hover {
	background: var(--am-orange-hover);
	color: var(--am-white);
}

.am-m3-form-card h1,
.am-m3-form-card h2,
.am-m3-state-card h1,
.am-m3-panel h2 {
	margin-bottom: var(--am-space-3);
}

.am-m3-form {
	display: grid;
	gap: var(--am-space-5);
	margin-top: var(--am-space-6);
}

.am-m3-field {
	display: grid;
	gap: var(--am-space-2);
	min-width: 0;
}

.am-m3-field label {
	font-weight: 700;
}

.am-m3-field input {
	background: var(--am-white);
	border: 1px solid var(--am-silver-500);
	border-radius: var(--am-radius-control);
	color: var(--am-text);
	min-height: 3rem;
	min-width: 0;
	padding: var(--am-space-3);
	width: 100%;
}

.am-m3-field__control {
	position: relative;
}

.am-m3-field__control > .am-icon,
.am-m3-password-control > .am-icon {
	color: var(--am-text-subtle);
	height: 1.15rem;
	left: var(--am-space-3);
	pointer-events: none;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 1.15rem;
	z-index: 1;
}

.am-m3-field__control input,
.am-m3-password-control input {
	padding-left: 2.65rem;
}

.am-m3-required-note {
	color: var(--am-text-subtle);
	font-size: var(--am-text-sm);
	white-space: nowrap;
}

.am-m3-field input[aria-invalid="true"] {
	border-color: var(--am-danger);
	border-width: 2px;
}

.am-m3-field__error {
	color: var(--am-danger);
	font-size: 0.875rem;
	font-weight: 700;
}

.am-m3-form__submit {
	width: 100%;
}

.am-m3-text-link {
	color: var(--am-navy-950);
	display: inline-block;
	font-weight: 700;
	margin-top: var(--am-space-5);
}

.am-m3-text-link--centered {
	display: block;
	text-align: center;
}

/*
 * The password-free test-clinic control is a marked local-development
 * affordance. The dashed border and warning-toned label keep it visually
 * distinct from real authentication; the server decides whether it renders.
 */
.am-m3-local-preview {
	background: var(--am-surface);
	border: 1px dashed var(--am-silver-500);
	border-radius: var(--am-radius-control);
	margin-top: var(--am-space-5);
	padding: var(--am-space-4);
}

.am-m3-local-preview > p {
	color: var(--am-text-subtle);
	font-size: var(--am-text-xs);
	margin-bottom: var(--am-space-3);
}

.am-m3-local-preview > p strong {
	color: var(--am-status-warning-fg);
	display: block;
	font-size: var(--am-text-xs);
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.am-m3-divider {
	align-items: center;
	color: var(--am-text-muted);
	display: flex;
	gap: var(--am-space-3);
	margin-block: var(--am-space-5);
}

.am-m3-divider::before,
.am-m3-divider::after {
	background: var(--am-border-strong);
	content: "";
	flex: 1;
	height: 1px;
}

.am-m3-approval-note,
.am-m3-local-note,
.am-m3-form-hint,
.am-m3-empty,
.am-m3-panel__heading p {
	color: var(--am-text-muted);
}

.am-m3-approval-note {
	border-top: 1px solid var(--am-border);
	color: var(--am-text-subtle);
	font-size: var(--am-text-sm);
	margin: var(--am-space-6) 0 0;
	padding-top: var(--am-space-5);
}

/* Auth-scoped field polish; the account and staff screens keep their own. */
.am-m3-public-page .am-m3-field input {
	border-color: var(--am-border-strong);
	transition:
		border-color var(--am-duration) var(--am-ease),
		box-shadow var(--am-duration) var(--am-ease);
}

.am-m3-public-page .am-m3-field input:focus {
	border-color: var(--am-navy-700);
}

.am-m3-public-page .am-m3-field label {
	font-size: var(--am-text-sm);
	font-weight: 600;
}

.am-m3-public-page .am-m3-form-hint {
	color: var(--am-text-subtle);
	font-size: var(--am-text-xs);
	margin: 0;
}

.am-m3-public-page .am-m3-field .am-m3-form-hint {
	margin-top: calc(var(--am-space-1) * -1);
}

.am-m3-field__heading {
	align-items: center;
	display: flex;
	gap: var(--am-space-3);
	justify-content: space-between;
}

.am-m3-password-control {
	position: relative;
}

.am-m3-password-control input {
	padding-right: 3.25rem;
}

.am-m3-password-control__toggle {
	align-items: center;
	background: transparent;
	border: 0;
	color: var(--am-text-subtle);
	cursor: pointer;
	display: flex;
	height: 2.75rem;
	justify-content: center;
	padding: 0;
	position: absolute;
	right: 0.25rem;
	top: 0.125rem;
	width: 2.75rem;
}

.am-m3-password-control__toggle:hover {
	color: var(--am-navy-900);
}

.am-m3-text-link--inline {
	display: inline;
	margin-top: 0;
}

.am-m3-return-link {
	margin-top: var(--am-space-5);
	text-align: center;
}

.am-m3-return-link .am-button {
	width: 100%;
}

.am-m3-local-note {
	font-size: 0.8125rem;
	margin: var(--am-space-3) 0 0;
	text-align: center;
}

/* One callout pattern for both tones: icon, left rule, soft status background. */
.am-m3-notice,
.am-m3-error-summary {
	background: var(--am-status-info-bg);
	border-left: 4px solid var(--am-navy-700);
	border-radius: var(--am-radius-control);
	display: grid;
	gap: var(--am-space-3);
	grid-template-columns: auto minmax(0, 1fr);
	margin-block: var(--am-space-5);
	padding: var(--am-space-4);
}

.am-m3-notice {
	color: var(--am-text);
	grid-template-columns: minmax(0, 1fr);
}

.am-m3-error-summary {
	background: var(--am-status-danger-bg);
	border-left-color: var(--am-danger);
}

.am-m3-error-summary > .am-icon {
	color: var(--am-danger);
	margin-top: 0.15rem;
}

.am-m3-error-summary h2,
.am-m3-error-summary h3,
.am-m3-error-summary p:last-child,
.am-m3-error-summary ul:last-child {
	margin-bottom: 0;
}

.am-m3-error-summary h2,
.am-m3-error-summary h3 {
	font-size: var(--am-text-md);
}

.am-m3-error-summary p {
	margin-bottom: var(--am-space-2);
}

.am-m3-error-summary ul {
	margin: 0;
	padding-left: var(--am-space-5);
}

.am-m3-state-card {
	text-align: center;
}

.am-affiliate-home .am-m3-state-card {
	max-width: none;
	text-align: left;
}

.am-affiliate-home__partners {
	display: grid;
	gap: var(--am-space-3);
	list-style: none;
	margin: var(--am-space-4) 0 0;
	padding: 0;
}

.am-affiliate-home__partners li {
	align-items: center;
	background: var(--am-surface-2);
	border: 1px solid var(--am-border-strong);
	border-radius: var(--am-radius-card);
	display: grid;
	gap: var(--am-space-1) var(--am-space-3);
	grid-template-columns: minmax(0, 1fr) auto;
	min-width: 0;
	padding: var(--am-space-3);
}

.am-affiliate-home__partners strong {
	min-width: 0;
	overflow-wrap: anywhere;
}

.am-affiliate-home__reference {
	color: var(--am-text-subtle);
	font-size: var(--am-text-sm);
	grid-column: 1;
	overflow-wrap: anywhere;
}

.am-affiliate-home__status {
	background: var(--am-status-success-bg);
	border-radius: var(--am-radius-pill);
	color: var(--am-status-success-fg);
	font-size: var(--am-text-sm);
	font-weight: 700;
	grid-column: 2;
	grid-row: 1 / span 2;
	padding: var(--am-space-1) var(--am-space-2);
}

.am-affiliate-home__status--suspended {
	background: var(--am-status-warning-bg);
	color: var(--am-status-warning-fg);
}

.am-affiliate-home__payout {
	border-top: 1px solid var(--am-border-strong);
	margin-top: var(--am-space-6);
	padding-top: var(--am-space-5);
}

.am-affiliate-home__payout-summary {
	display: grid;
	gap: var(--am-space-3);
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
	margin: var(--am-space-4) 0;
}

.am-affiliate-home__payout-summary > div,
.am-affiliate-home__payout-batches li {
	background: var(--am-surface-2);
	border: 1px solid var(--am-border-strong);
	border-radius: var(--am-radius-card);
	min-width: 0;
	padding: var(--am-space-3);
}

.am-affiliate-home__payout-summary dt,
.am-affiliate-home__payout-batches small {
	color: var(--am-text-subtle);
	font-size: var(--am-text-sm);
}

.am-affiliate-home__payout-summary dd {
	font-size: var(--am-text-lg);
	font-weight: 700;
	margin: var(--am-space-1) 0 0;
}

.am-affiliate-home__payout-summary dd small {
	color: var(--am-text-subtle);
	display: block;
	font-size: var(--am-text-sm);
	font-weight: 400;
	margin-top: var(--am-space-1);
}

.am-affiliate-home__payout-batches {
	display: grid;
	gap: var(--am-space-2);
	list-style: none;
	margin: var(--am-space-3) 0 0;
	padding: 0;
}

.am-affiliate-home__payout-batches li {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: var(--am-space-2) var(--am-space-4);
	justify-content: space-between;
}

.am-affiliate-home__payout-batches li > span {
	display: grid;
	gap: var(--am-space-1);
}

.am-affiliate-home__activity {
	border-top: 1px solid var(--am-border-strong);
	margin-top: var(--am-space-6);
	padding-top: var(--am-space-5);
}

.am-affiliate-home__period {
	align-items: end;
	background: var(--am-surface-2);
	border: 1px solid var(--am-border-strong);
	border-radius: var(--am-radius-card);
	display: grid;
	gap: var(--am-space-2) var(--am-space-3);
	grid-template-columns: repeat(3, minmax(9rem, 1fr)) auto;
	margin-top: var(--am-space-4);
	padding: var(--am-space-4);
}

.am-affiliate-home__period label {
	font-weight: var(--am-font-weight-semibold);
}

.am-affiliate-home__period select,
.am-affiliate-home__period input {
	min-height: 2.75rem;
	width: 100%;
}

.am-affiliate-home__period small {
	color: var(--am-text-muted);
	grid-column: 1 / -1;
}

.am-affiliate-home__entries {
	display: grid;
	gap: var(--am-space-2);
	list-style: none;
	margin: var(--am-space-4) 0 0;
	padding: 0;
}

.am-affiliate-home__entries li {
	align-items: center;
	background: var(--am-surface-2);
	border: 1px solid var(--am-border-strong);
	border-radius: var(--am-radius-card);
	display: flex;
	flex-wrap: wrap;
	gap: var(--am-space-2) var(--am-space-4);
	justify-content: space-between;
	min-width: 0;
	padding: var(--am-space-3);
}

.am-affiliate-home__entries li > span {
	display: grid;
	gap: var(--am-space-1);
	min-width: 0;
}

.am-affiliate-home__entries time {
	color: var(--am-text-subtle);
	font-size: var(--am-text-sm);
}

.am-affiliate-home__entries small {
	color: var(--am-text-subtle);
	font-size: var(--am-text-sm);
	line-height: 1.45;
}

.am-affiliate-home__event-reference {
	overflow-wrap: anywhere;
}

.am-affiliate-home__amount {
	color: var(--am-status-success-fg);
	white-space: nowrap;
}

.am-affiliate-home__amount--negative {
	color: var(--am-text);
}

.am-payout-profile__methods {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
	gap: var(--am-space-3);
	margin: 0;
	padding: 0;
	border: 0;
}

.am-payout-profile__methods legend {
	margin-bottom: var(--am-space-3);
	font-weight: 700;
}

.am-payout-profile__method {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: center;
	gap: var(--am-space-2);
	padding: var(--am-space-3);
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius-card);
	background: var(--am-surface);
}

.am-payout-profile__method input {
	grid-row: 1 / span 2;
}

.am-payout-profile__mark {
	font-weight: 800;
	letter-spacing: .04em;
}

.am-payout-profile__mark--paypal {
	color: #003087;
	font-style: italic;
	letter-spacing: -.03em;
}

.am-payout-profile__mark--zelle {
	color: #6d1ed4;
}

.am-payout-profile__fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--am-space-3);
	padding: var(--am-space-4);
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius-card);
}

.am-payout-profile__fields[hidden] {
	display: none;
}

@media (max-width: 42rem) {
	.am-payout-profile__fields {
		grid-template-columns: 1fr;
	}
}

.am-affiliate-home__pages {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: var(--am-space-3);
	justify-content: space-between;
	margin-top: var(--am-space-4);
}

.am-m3-actions {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: var(--am-space-3);
	margin-top: var(--am-space-6);
}

.am-m3-actions--centered {
	justify-content: center;
}

/* The link carries a top margin for body copy; inside an action row it aligns. */
.am-m3-actions .am-m3-text-link {
	margin-top: 0;
}

.am-m3-form__submit--spaced {
	margin-top: var(--am-space-3);
}

.am-m3-button--danger {
	background: var(--am-danger);
	color: var(--am-white);
}

.am-m3-account,
.am-m3-staff {
	margin-inline: auto;
	max-width: 76rem;
}

.am-m3-page-heading,
.am-m3-staff__header,
.am-m3-panel__heading {
	display: flex;
	flex-wrap: wrap;
	gap: var(--am-space-4);
	justify-content: space-between;
}

.am-m3-page-heading,
.am-m3-staff__header {
	align-items: center;
	margin-bottom: var(--am-space-6);
}

.am-m3-page-heading h1,
.am-m3-page-heading p {
	margin-bottom: 0;
}

.am-m3-page-heading > div {
	display: grid;
	gap: var(--am-space-2);
}

.am-m3-panel {
	background: var(--am-white);
	border: 1px solid var(--am-border-strong);
	box-shadow: 0 1rem 2.8rem rgb(2 24 52 / 0.05);
	margin-bottom: var(--am-space-5);
	max-width: none;
}

.am-m3-panel--summary {
	border-left: 4px solid var(--am-orange-500);
}

.am-m3-details,
.am-m3-record dl {
	display: grid;
	gap: var(--am-space-4);
	margin: 0;
}

.am-m3-details > div,
.am-m3-record dl > div {
	display: grid;
	gap: var(--am-space-1);
}

.am-m3-details dt,
.am-m3-record dt {
	color: var(--am-text-muted);
	font-size: 0.8rem;
	font-weight: 700;
}

.am-m3-details dd,
.am-m3-record dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.am-m3-record-list {
	display: grid;
	gap: var(--am-space-3);
	list-style: none;
	margin: var(--am-space-5) 0 0;
	padding: 0;
}

.am-m3-record {
	align-items: center;
	background: var(--am-canvas);
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius-control);
	display: grid;
	gap: var(--am-space-4);
	min-width: 0;
	padding: var(--am-space-4);
}

.am-m3-location-form {
	background: var(--am-surface);
	border: 1px solid var(--am-border);
	margin-top: var(--am-space-6);
	padding-left: var(--am-space-5);
}

.am-m3-member-form,
.am-m3-local-invitation {
	background: var(--am-surface);
	border: 1px solid var(--am-border);
	margin-top: var(--am-space-6);
	padding: var(--am-space-5);
}

.am-m3-local-invitation {
	border-left: 4px solid var(--am-warning);
}

.am-m3-local-invitation input {
	display: block;
	margin: var(--am-space-2) 0;
	max-width: 100%;
	min-height: 2.75rem;
	width: 100%;
}

.am-m3-role-choice {
	align-items: start;
	background: var(--am-white);
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius-control);
	cursor: pointer;
	display: flex;
	gap: var(--am-space-3);
	margin-top: var(--am-space-2);
	min-height: 3.5rem;
	padding: var(--am-space-3);
}

.am-m3-role-choice span {
	display: grid;
	gap: var(--am-space-1);
}

.am-m3-role-choice small {
	color: var(--am-text-muted);
}

.am-button--danger {
	background: var(--am-danger);
	border-color: var(--am-danger);
	color: var(--am-white);
}

.am-m3-record > div:first-child,
.am-m3-record__meta {
	display: grid;
	gap: var(--am-space-1);
}

.am-m3-record span {
	color: var(--am-text-muted);
	overflow-wrap: anywhere;
}

.am-m3-record__link {
	color: var(--am-navy-950);
	font-weight: 700;
}

.am-m3-staff__boundary {
	background: var(--am-navy-950);
	border-radius: 999px;
	color: var(--am-white);
	font-size: 0.75rem;
	font-weight: 700;
	padding: var(--am-space-2) var(--am-space-3);
}

@media (min-width: 48rem) {
	.am-m3-form--two-column {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.am-m3-field--full {
		grid-column: 1 / -1;
	}

	.am-m3-details,
	.am-m3-record dl {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.am-m3-review-layout {
		display: grid;
		gap: var(--am-space-5);
		grid-template-columns: minmax(18rem, 0.75fr) minmax(0, 1.25fr);
	}
}

@media (min-width: 60rem) {
	.am-m3-record {
		grid-template-columns: minmax(14rem, 1.2fr) minmax(18rem, 1fr) auto;
	}

	.am-m3-record > form {
		justify-self: end;
	}

}

@media (max-width: 24rem) {
	.am-m3-public-page,
	.am-m3-staff {
		padding-inline: var(--am-space-3);
	}

	.am-m3-form-card,
	.am-m3-state-card,
	.am-m3-panel {
		padding: var(--am-space-5);
	}

	.am-m3-actions .am-button {
		width: 100%;
	}

	.am-m3-public-page {
		align-content: start;
		gap: var(--am-space-4);
		padding-block: var(--am-space-6);
	}

	.am-m3-public-page__brand {
		width: min(100%, 12.5rem);
	}

	.am-m3-signin-card {
		padding: var(--am-space-5);
	}

	.am-m3-form-card--wide {
		padding: var(--am-space-5);
	}
}

/* Clinic account (Stage 5) ---------------------------------------------------
 *
 * Every rule below is scoped to .am-account so the shared .am-m3-record and
 * .am-m3-panel styles used by staff screens are untouched. Layout decisions
 * are made against the measured width of the account canvas (a size
 * container), not the viewport, because the persistent sidebar leaves the
 * canvas far narrower than the viewport at 1024 px.
 */

.am-account {
	container-name: account;
	container-type: inline-size;
	/* Size containment removes the intrinsic width; give the flex item its
	   width explicitly so the auto margins centre a full-width canvas. */
	width: 100%;
}

.am-account__header {
	background: var(--am-white);
	border: 1px solid var(--am-border);
	border-left: 0.25rem solid var(--am-navy-900);
	border-radius: var(--am-radius-card);
	margin: 0 0 var(--am-space-5);
	max-width: none;
	padding: var(--am-space-4) var(--am-space-5);
	margin-bottom: var(--am-space-5);
	position: relative;
	z-index: 1;
}

.am-account__header > div {
	min-width: 0;
}

.am-account__header h1 {
	font-size: clamp(1.5rem, 2.2vw, 2rem);
	margin: 0;
	overflow-wrap: anywhere;
}

.am-account__header .am-page-title__eyebrow {
	color: var(--am-navy-700);
	margin-bottom: var(--am-space-1);
}

.am-account__title-compact {
	display: none;
}

/* Section navigation follows the shared desktop-chip / compact F3 selector. */
.am-account__nav {
	margin-bottom: var(--am-space-6);
	position: relative;
	z-index: 1;
}

.am-account__nav .am-filter-chip span::before {
	content: "·";
	margin-right: var(--am-space-1);
}

.am-account__nav .am-filter {
	background: var(--am-white);
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius-card);
	padding: var(--am-space-2);
}

/* Panels: bordered surfaces without decorative shadow; anchored sections and
   forms clear the sticky top bar when reached by a deep link. */
.am-account .am-m3-panel {
	box-shadow: none;
	position: relative;
	scroll-margin-top: calc(var(--am-topbar-height) + var(--am-space-4));
	z-index: 1;
}

.am-account .am-m3-panel h2 {
	margin-bottom: var(--am-space-2);
}

.am-account__section-heading {
	display: flex;
	flex-wrap: wrap;
	gap: var(--am-space-3) var(--am-space-5);
	justify-content: space-between;
	margin-bottom: var(--am-space-4);
}

.am-account__section-heading > div {
	min-width: 0;
}

.am-account__section-heading p {
	color: var(--am-text-muted);
	margin-bottom: 0;
}

.am-account__role-note {
	background: var(--am-surface-2);
	border-radius: var(--am-radius-control);
	color: var(--am-text-muted);
	flex: 0 1 18rem;
	font-size: var(--am-text-sm);
	padding: var(--am-space-3) var(--am-space-4);
}

.am-account__subheading {
	font-size: var(--am-text-md);
	margin: var(--am-space-6) 0 var(--am-space-3);
}

.am-account__subheading:first-of-type {
	margin-top: var(--am-space-2);
}

.am-account__details {
	gap: var(--am-space-4) var(--am-space-6);
	grid-template-columns: repeat(auto-fit, minmax(12rem, max-content));
}

.am-account__details dd {
	font-weight: 600;
}

.am-account__managed-note {
	background: var(--am-surface-2);
	border-left: 0.2rem solid var(--am-silver-500);
	color: var(--am-text-muted);
	font-size: var(--am-text-sm);
	margin: var(--am-space-5) 0 0;
	padding: var(--am-space-3) var(--am-space-4);
}

.am-account__signin {
	border-top: 1px solid var(--am-border);
	margin-top: var(--am-space-6);
	padding-top: var(--am-space-5);
}

.am-account__signin .am-account__section-heading {
	align-items: center;
}

.am-account__return {
	margin: var(--am-space-4) 0 0;
}

.am-account__return .am-m3-text-link {
	margin-top: 0;
}

/* Explicit data states share the empty-state surface; "unavailable" is a
   muted, non-alarming state that names the failure and its safety. */
.am-account__state {
	padding: var(--am-space-5);
	text-align: left;
}

.am-account__state h4 {
	font-size: var(--am-text-base);
	margin-bottom: var(--am-space-2);
}

.am-account__state p {
	color: var(--am-text-muted);
	margin: 0;
	max-width: none;
}

.am-account__state--unavailable {
	border-style: solid;
	color: var(--am-text-muted);
}

/* Records ------------------------------------------------------------------
   Base layout is one column (override of the viewport rule that put three
   columns on every .am-m3-record). Wider container queries add columns only
   when the canvas can genuinely hold them. */
.am-account__records {
	margin-top: 0;
}

.am-account .am-account-record {
	align-items: start;
	grid-template-areas:
		"identity"
		"status"
		"actions";
	grid-template-columns: minmax(0, 1fr);
	overflow-wrap: anywhere;
}

.am-account .am-account-record > * {
	min-width: 0;
}

.am-account-record__identity {
	grid-area: identity;
}

.am-account-record__identity strong {
	overflow-wrap: anywhere;
}

.am-account-record__identity small {
	color: var(--am-text-subtle);
	font-size: var(--am-text-xs);
}

.am-account-record__status {
	grid-area: status;
}

.am-account .am-account-record__meta {
	grid-area: status;
	grid-template-columns: repeat(2, minmax(0, max-content));
}

.am-account .am-account-record__meta dd {
	white-space: normal;
}

.am-account .am-account-record__meta .am-badge {
	white-space: normal;
}

.am-account .am-account-record__actions {
	grid-area: actions;
	justify-self: stretch;
}

.am-account .am-account-record__actions--note {
	align-self: center;
}

/* Member actions: the role select and its button form one group, the status
   button another. Everything wraps inside the record; nothing is clipped. */
.am-account .am-m3-member-actions {
	align-items: end;
	display: flex;
	flex-wrap: wrap;
	gap: var(--am-space-3);
}

.am-account .am-account-role-form {
	flex: 1 1 18rem;
	min-width: 0;
}

.am-account .am-account-status-form {
	flex: 0 1 auto;
}

.am-account .am-account-record .am-button {
	min-height: 2.75rem;
	white-space: normal;
}

.am-account .am-account-record--location .am-account-record__actions,
.am-account .am-account-record--invitation .am-account-record__actions {
	display: grid;
	gap: var(--am-space-2);
}

/* Forms -------------------------------------------------------------------- */
.am-account-form {
	background: var(--am-surface);
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius-card);
	margin-top: var(--am-space-6);
	padding: var(--am-space-5);
	scroll-margin-top: calc(var(--am-topbar-height) + var(--am-space-4));
}

.am-account .am-dialog__body > .am-account-form {
	background: transparent;
	border: 0;
	margin: 0;
	padding: 0;
}

.am-account-form__intro h3 {
	margin-bottom: var(--am-space-2);
}

.am-account-form__intro p {
	color: var(--am-text-muted);
	margin-bottom: var(--am-space-3);
}

.am-account-form__intro .am-m5-data-warning {
	margin-bottom: 0;
}

.am-account-form__grid {
	display: grid;
	gap: var(--am-space-4);
	grid-template-columns: minmax(0, 1fr);
	margin-top: var(--am-space-5);
}

.am-account-form__field {
	min-width: 0;
	scroll-margin-top: calc(var(--am-topbar-height) + var(--am-space-4));
}

.am-account-form__field input {
	scroll-margin-top: calc(var(--am-topbar-height) + var(--am-space-4));
}

.am-account-form__actions {
	margin-top: var(--am-space-5);
}

/* Role choices: one radio group, one keyboard stop, arrow keys select. Each
   choice is a compact card with the radio and its text aligned to the start. */
.am-account-roles {
	border: 0;
	margin: 0;
	min-width: 0;
	padding: 0;
}

.am-account-roles legend {
	color: var(--am-text-subtle);
	font-size: var(--am-text-xs);
	font-weight: 600;
	letter-spacing: 0.02em;
	margin-bottom: var(--am-space-2);
	padding: 0;
}

.am-account-roles[aria-invalid="true"] .am-account-roles__choice {
	border-color: var(--am-danger);
}

.am-account-roles__choices {
	display: grid;
	gap: var(--am-space-3);
	grid-template-columns: minmax(0, 1fr);
}

.am-account .am-account-roles__choice {
	margin-top: 0;
	min-height: 2.75rem;
}

.am-account .am-account-roles__choice input {
	flex: none;
	height: 1.25rem;
	margin: 0.1rem 0 0;
	width: 1.25rem;
}

.am-account .am-account-roles__choice span {
	min-width: 0;
}

.am-account .am-account-roles__choice strong {
	font-size: var(--am-text-sm);
}

.am-account .am-account-roles__choice small {
	font-size: var(--am-text-xs);
}

.am-account .am-account-roles__choice:has(input:checked) {
	border-color: var(--am-brand);
	box-shadow: inset 0 0 0 1px var(--am-brand);
}

.am-account .am-account-roles__choice:has(input:focus-visible) {
	outline: 3px solid var(--am-focus);
	outline-offset: 2px;
}

.am-account .am-account-roles .am-m5-field__error {
	display: block;
	margin-top: var(--am-space-2);
}

/* Local activation feedback keeps its warning rule; controls stack. */
.am-account .am-m3-local-invitation {
	border-radius: var(--am-radius-card);
	display: grid;
	gap: var(--am-space-2);
	margin: 0 0 var(--am-space-5);
}

.am-account .am-m3-local-invitation p {
	color: var(--am-text-muted);
	margin: 0;
}

.am-account .am-m3-local-invitation__label {
	color: var(--am-status-warning-fg);
	font-size: var(--am-text-xs);
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: var(--am-leading-normal);
	margin: 0;
	text-transform: uppercase;
}

.am-account .am-m3-local-invitation label {
	font-size: var(--am-text-xs);
	font-weight: 600;
}

.am-account .am-m3-local-invitation input {
	margin: 0;
}

.am-account .am-m3-local-invitation .am-button {
	justify-self: start;
}

/* Visible result of the copy attempt; hidden until the control is used. */
.am-account__copy-status {
	color: var(--am-text);
	font-size: var(--am-text-sm);
	font-weight: 600;
	margin: 0;
}

/* Wider canvases ----------------------------------------------------------
   38rem: two-column forms and records. 58rem: actions can share a row
   without collapsing a long location identity at intermediate widths. */
@container account (min-width: 38rem) {
	.am-account-form__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.am-account-form__field--full {
		grid-column: 1 / -1;
	}

	.am-account .am-account-record--location,
	.am-account .am-account-record--request,
	.am-account .am-account-record--invitation {
		grid-template-areas:
			"identity status"
			"actions actions";
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.am-account .am-account-record--location .am-account-record__actions,
	.am-account .am-account-record--invitation .am-account-record__actions {
		justify-self: end;
	}

	.am-account .am-account-record--member {
		grid-template-areas:
			"identity status"
			"actions actions";
		grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
	}

	.am-account .am-account-record__meta {
		grid-template-columns: repeat(2, minmax(0, max-content));
	}
}

@container account (min-width: 58rem) {
	.am-account .am-account-record--location,
	.am-account .am-account-record--request,
	.am-account .am-account-record--invitation {
		grid-template-areas: "identity status actions";
		grid-template-columns: minmax(0, 1fr) auto auto;
	}

	.am-account .am-account-record--location .am-account-record__actions {
		align-items: center;
		display: flex;
	}

	.am-account .am-account-record--request {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas: "identity status";
	}

	.am-account .am-account-record--member {
		grid-template-areas: "identity status actions";
		grid-template-columns: minmax(11rem, 0.9fr) minmax(10rem, auto) minmax(0, 1.7fr);
	}

	.am-account .am-account-record__actions {
		justify-self: end;
	}

	.am-account .am-m3-member-actions {
		justify-content: flex-end;
	}

	.am-account-roles__choices {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Narrow canvases: full-width controls keep 44 px targets reachable. */
@container account (max-width: 24rem) {
	.am-account .am-m3-member-actions,
	.am-account .am-account-role-form,
	.am-account .am-account-status-form,
	.am-account .am-account-record--location .am-account-record__actions,
	.am-account .am-account-record--invitation .am-account-record__actions {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		width: 100%;
	}

	.am-account .am-account-record .am-button,
	.am-account-form__actions .am-button,
	.am-account .am-m3-local-invitation .am-button {
		justify-self: stretch;
		width: 100%;
	}

	.am-account .am-account-record__meta {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 50rem) {
	.am-m3-signin-card h1 {
		font-size: 1.375rem;
	}

	.am-account__header {
		background: transparent;
		border: 0;
		border-radius: 0;
		padding: 0;
	}

	.am-account__title-wide {
		display: none;
	}

	.am-account__header .am-account__title-compact {
		align-items: center;
		display: flex;
		font-size: var(--am-text-xs);
		font-weight: 800;
		gap: var(--am-space-2);
		letter-spacing: 0.12em;
		margin: 0;
		text-transform: uppercase;
	}

	.am-account__header .am-account__title-compact::before {
		background: var(--am-brand);
		content: "";
		height: 0.15rem;
		width: 1.25rem;
	}

	.am-account__nav .am-filter {
		background: transparent;
		border: 0;
		border-radius: 0;
		padding: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.am-m3-public-page *,
	.am-m3-account *,
	.am-m3-staff * {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}

.am-owner-mfa__setup {
	background: var(--am-surface-2);
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius-card);
	display: grid;
	gap: var(--am-space-3);
	padding: var(--am-space-4);
}

.am-owner-mfa__setup p,
.am-owner-mfa__codes {
	margin: 0;
}

.am-owner-mfa__setup code,
.am-owner-mfa__codes code {
	overflow-wrap: anywhere;
}

.am-owner-mfa__setup code {
	font-size: var(--am-text-sm);
}

.am-owner-mfa__codes {
	background: var(--am-surface-2);
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius-card);
	display: grid;
	gap: var(--am-space-2);
	grid-template-columns: repeat(2, minmax(0, 1fr));
	list-style: none;
	padding: var(--am-space-4);
}

@media (max-width: 30rem) {
	.am-owner-mfa__codes {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: no-preference) {
	.am-account .am-dialog[open] .am-dialog__surface {
		animation-name: am-account-dialog-in;
	}
}

@keyframes am-account-dialog-in {
	from {
		transform: translateY(1rem);
	}

	to {
		transform: translateY(0);
	}
}
.am-timezone-form {
	display: grid;
	gap: var(--am-space-3);
	max-width: 32rem;
}

.am-timezone-form label {
	font-weight: 600;
}

.am-timezone-form select {
	background: var(--am-white);
	border: 1px solid var(--am-silver-300);
	border-radius: var(--am-radius-control);
	color: var(--am-navy-950);
	font: inherit;
	min-height: 44px;
	min-width: 0;
	padding: var(--am-space-2) var(--am-space-3);
	width: 100%;
}

.am-timezone-form select:focus-visible {
	outline: 2px solid var(--am-focus);
	outline-offset: 2px;
}

.am-timezone-form button {
	justify-self: start;
}

.am-referrals {
	display: grid;
	gap: var(--am-space-6);
}

.am-referrals__hero,
.am-referrals__panel,
.am-referrals__generated {
	background: var(--am-white);
	border: 1px solid var(--am-silver-200);
	border-radius: var(--am-radius-card);
	box-shadow: var(--am-shadow-card);
	padding: clamp(var(--am-space-4), 3vw, var(--am-space-7));
}

.am-referrals__hero h1,
.am-referrals__panel h2,
.am-referrals__card h3 {
	margin-top: 0;
}

.am-referrals__grid,
.am-referrals__cards,
.am-referrals__form-grid {
	display: grid;
	gap: var(--am-space-4);
}

.am-referrals__grid,
.am-referrals__cards {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
}

.am-referrals__form-grid label,
.am-referrals__panel form label {
	display: grid;
	font-weight: 600;
	gap: var(--am-space-2);
}

.am-referrals input:not([type="radio"]):not([type="checkbox"]),
.am-referrals select {
	background: var(--am-white);
	border: 1px solid var(--am-silver-300);
	border-radius: var(--am-radius-control);
	color: var(--am-navy-950);
	font: inherit;
	min-height: 44px;
	min-width: 0;
	padding: var(--am-space-2) var(--am-space-3);
	width: 100%;
}

.am-referrals input[type="radio"],
.am-referrals input[type="checkbox"] {
	block-size: 24px;
	inline-size: 24px;
	margin: 0;
}

.am-referrals label:has(> input[type="radio"]),
.am-referrals label:has(> input[type="checkbox"]) {
	align-items: center;
	grid-template-columns: 24px minmax(0, 1fr);
}

.am-referrals fieldset {
	border: 1px solid var(--am-silver-200);
	border-radius: var(--am-radius-control);
	display: grid;
	gap: var(--am-space-3);
	padding: var(--am-space-4);
}

.am-referrals__card {
	border: 1px solid var(--am-silver-200);
	border-radius: var(--am-radius-card);
	display: grid;
	gap: var(--am-space-4);
	padding: var(--am-space-4);
}

.am-referrals__card > header,
.am-referrals__actions,
.am-referrals__copy,
.am-referrals__mode {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: var(--am-space-3);
	justify-content: space-between;
}

.am-referrals__copy input {
	flex: 1 1 15rem;
}

.am-referrals__actions {
	justify-content: flex-start;
}

.am-referrals__list {
	display: grid;
	gap: var(--am-space-3);
	list-style: none;
	margin: 0;
	padding: 0;
}

.am-referrals__list li {
	border-bottom: 1px solid var(--am-silver-200);
	display: grid;
	gap: var(--am-space-1);
	padding-block: var(--am-space-3);
}

@media (max-width: 44rem) {
	.am-affiliate-home__period {
		grid-template-columns: minmax(0, 1fr);
	}

	.am-affiliate-home__period small {
		grid-column: 1;
	}

	.am-referrals__copy,
	.am-referrals__copy .am-button {
		align-items: stretch;
		width: 100%;
	}
}
