	.mfa-section {
		padding-bottom: max(48px, 8vh);
	}

	.mfa-section .page-card-head {
		display: block;
		text-align: center;
	}

	.mfa-section .page-card-head p {
		max-width: 340px;
		margin: 8px auto 0;
		line-height: 1.45;
	}

	.mfa-section .login-content.page-card {
		max-width: 400px;
	}

	.mfa-panel {
		max-width: 352px;
		margin: 0 auto;
	}

	.mfa-status {
		max-width: 352px;
		min-height: 20px;
		margin: var(--margin-md) auto 0;
		line-height: 1.45;
	}

	/* Method rows (onboarding hub + settings hub) */
	.mfa-rows {
		border: 1px solid var(--border-color);
		border-radius: var(--border-radius-md);
		overflow: hidden;
		margin-bottom: 14px;
	}

	.mfa-row {
		display: flex;
		align-items: center;
		gap: 11px;
		padding: 11px 12px;
		background: var(--card-bg, #fff);
		width: 100%;
		border: 0;
		text-align: left;
		font: inherit;
		color: inherit;
	}

	.mfa-row + .mfa-row {
		border-top: 1px solid var(--border-color);
	}

	button.mfa-row {
		cursor: pointer;
	}

	button.mfa-row:hover {
		background: var(--control-bg);
	}

	.mfa-row .mfa-row-icon {
		width: 32px;
		height: 32px;
		border-radius: 8px;
		background: var(--control-bg);
		color: var(--text-muted);
		display: flex;
		align-items: center;
		justify-content: center;
		flex: none;
	}

	.mfa-row.mfa-row-disabled .mfa-row-icon {
		opacity: 0.55;
	}

	.mfa-row .mfa-row-text {
		flex: 1;
		min-width: 0;
	}

	.mfa-row .mfa-row-title {
		display: block;
		font-size: 13px;
		font-weight: 600;
		line-height: 1.3;
	}

	.mfa-row.mfa-row-disabled .mfa-row-title {
		color: var(--text-muted);
	}

	.mfa-row .mfa-row-sub {
		display: block;
		font-size: 11.5px;
		color: var(--text-muted);
		line-height: 1.4;
		margin-top: 1px;
	}

	.mfa-row .mfa-row-chevron {
		color: var(--text-muted);
		display: flex;
		flex: none;
	}

	.mfa-badge {
		font-size: 11px;
		font-weight: 600;
		padding: 2.5px 9px;
		border-radius: 999px;
		white-space: nowrap;
		flex: none;
	}

	.mfa-badge-green { background: #e4faeb; color: #14804d; }
	.mfa-badge-amber { background: #fff4d3; color: #91400d; }
	.mfa-badge-blue { background: #e6f4ff; color: #0375d3; }
	.mfa-badge-gray { background: var(--control-bg); color: var(--text-muted); }

	.mfa-hub-note {
		font-size: 11.5px;
		color: var(--text-muted);
		text-align: center;
		margin: 10px 0 0;
	}

	/* Radio cards for the default-method step */
	.mfa-radio-card {
		display: flex;
		gap: 11px;
		align-items: flex-start;
		border: 1px solid var(--border-color);
		border-radius: var(--border-radius-md);
		padding: 13px 14px;
		margin-bottom: 10px;
		cursor: pointer;
		background: var(--card-bg, #fff);
		width: 100%;
		text-align: left;
		font: inherit;
		color: inherit;
	}

	.mfa-radio-card:hover {
		background: var(--control-bg);
	}

	.mfa-radio-card.mfa-selected {
		border-color: var(--text-color, #171717);
		box-shadow: 0 0 0 1px var(--text-color, #171717);
	}

	.mfa-radio-dot {
		width: 16px;
		height: 16px;
		border-radius: 999px;
		border: 1.5px solid var(--border-color);
		flex: none;
		margin-top: 2px;
		background: var(--card-bg, #fff);
	}

	.mfa-radio-card.mfa-selected .mfa-radio-dot {
		border: 5px solid var(--text-color, #171717);
	}

	.mfa-radio-title {
		font-size: 13px;
		font-weight: 600;
		display: flex;
		gap: 8px;
		align-items: center;
		flex-wrap: wrap;
	}

	.mfa-radio-sub {
		display: block;
		font-size: 11.5px;
		color: var(--text-muted);
		margin-top: 2px;
		line-height: 1.45;
	}

	/* Verification code entry */
	.mfa-code-input {
		font-size: 20px;
		font-weight: 600;
		letter-spacing: 0.35em;
		text-align: center;
		font-variant-numeric: tabular-nums;
	}

	.mfa-links {
		display: flex;
		justify-content: center;
		gap: 18px;
		margin-top: 14px;
	}

	.mfa-link {
		font-size: 12px;
		color: var(--text-muted);
		text-decoration: underline;
		text-underline-offset: 3px;
		cursor: pointer;
		background: none;
		border: 0;
		padding: 0;
	}

	.mfa-link:hover {
		color: var(--text-color);
	}

	.mfa-method-wrapper {
		position: relative;
	}

	.mfa-method-menu {
		position: absolute;
		z-index: 20;
		top: calc(100% + 6px);
		left: 0;
		right: 0;
		padding: 6px;
		border: 1px solid var(--border-color);
		border-radius: var(--border-radius-md);
		background: var(--card-bg, #fff);
		box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
	}

	.mfa-method-menu .btn {
		min-height: 34px;
		border: 0;
		box-shadow: none;
		text-align: left;
		width: 100%;
	}

	/* Overlay dialogs: centered modal + right-side drawers */
	.mfa-overlay {
		position: fixed;
		inset: 0;
		z-index: 1050;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 24px;
		background: rgba(15, 23, 42, 0.4);
	}

	.mfa-overlay.hide {
		display: none;
	}

	.mfa-overlay.mfa-overlay-drawer {
		align-items: stretch;
		justify-content: flex-end;
		padding: 0;
	}

	.mfa-dialog {
		width: min(420px, 100%);
		background: var(--card-bg, #fff);
		border: 1px solid var(--border-color);
		border-radius: var(--border-radius-md);
		box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2);
		overflow: hidden;
		display: flex;
		flex-direction: column;
		max-height: 90vh;
	}

	.mfa-overlay-drawer .mfa-dialog {
		width: min(420px, 92vw);
		max-height: none;
		height: 100%;
		border-radius: var(--border-radius-md) 0 0 var(--border-radius-md);
		border-right: 0;
		box-shadow: -16px 0 40px -20px rgba(0, 0, 0, 0.35);
	}

	.mfa-dialog-header,
	.mfa-dialog-footer {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 16px 18px;
		flex: none;
	}

	.mfa-dialog-header {
		border-bottom: 1px solid var(--border-color);
	}

	.mfa-dialog-body {
		padding: 18px;
		overflow-y: auto;
	}

	.mfa-dialog-footer {
		border-top: 1px solid var(--border-color);
	}

	.mfa-dialog-close {
		border: 0;
		background: transparent;
		font-size: 24px;
		line-height: 1;
		color: var(--text-muted);
		cursor: pointer;
	}

	.mfa-qr-frame {
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 208px;
		margin: 16px 0;
		padding: 14px;
		border: 1px solid var(--border-color);
		border-radius: var(--border-radius-md);
		background: var(--control-bg);
	}

	.mfa-qr-frame img {
		display: block;
		width: min(190px, 100%);
		height: auto;
	}

	.mfa-timer {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 10px 12px;
		border-radius: var(--border-radius-md);
		background: var(--control-bg);
		margin-top: 12px;
	}

	.mfa-timer strong {
		font-variant-numeric: tabular-nums;
	}

	.mfa-manual-key {
		margin-top: 12px;
	}

	.mfa-manual-key summary {
		cursor: pointer;
		color: var(--text-muted);
		font-size: 13px;
	}

	.mfa-secret-row {
		display: flex;
		align-items: center;
		gap: 8px;
		margin-top: 10px;
	}

	.mfa-secret {
		flex: 1;
		padding: 8px 10px;
		border: 1px solid var(--border-color);
		border-radius: var(--border-radius-sm);
		background: var(--control-bg);
		font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
		font-size: 13px;
		word-break: break-all;
	}

	.mfa-drawer-divider {
		display: flex;
		align-items: center;
		gap: 10px;
		color: var(--text-muted);
		font-size: 11px;
		margin: 14px 0;
		text-transform: lowercase;
	}

	.mfa-drawer-divider::before,
	.mfa-drawer-divider::after {
		content: "";
		height: 1px;
		background: var(--border-color);
		flex: 1;
	}

	.mfa-field-help {
		font-size: 11.5px;
		color: var(--text-muted);
		margin: 6px 0 0;
		line-height: 1.5;
	}

	.mfa-drawer-error {
		color: var(--red-500, #e03434);
		font-size: 12px;
		margin: 10px 0 0;
		line-height: 1.45;
	}

	.mfa-banner-ok {
		display: flex;
		gap: 9px;
		align-items: flex-start;
		border-radius: var(--border-radius-md);
		padding: 10px 12px;
		font-size: 12px;
		line-height: 1.5;
		margin-bottom: 14px;
		background: #e4faeb;
		border: 1px solid #bdefcc;
		color: #14804d;
		font-weight: 500;
	}

	.mfa-banner-info {
		display: flex;
		gap: 9px;
		align-items: flex-start;
		border-radius: var(--border-radius-md);
		padding: 10px 12px;
		font-size: 12px;
		line-height: 1.5;
		margin-bottom: 14px;
		background: #f1f8fe;
		border: 1px solid #d1eaff;
		color: var(--text-color);
	}

	.mfa-toast {
		position: fixed;
		left: 50%;
		transform: translateX(-50%);
		bottom: 24px;
		z-index: 1100;
		background: #171717;
		color: #fff;
		font-size: 12.5px;
		font-weight: 500;
		border-radius: 8px;
		padding: 9px 14px;
		box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.4);
		white-space: nowrap;
	}

	.mfa-toast.hide {
		display: none;
	}

	/* Recovery codes modal */
	.mfa-recovery-codes {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
		margin: 16px 0;
	}

	.mfa-recovery-code {
		padding: 8px 10px;
		border: 1px solid var(--border-color);
		border-radius: var(--border-radius-sm);
		background: var(--control-bg);
		font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
		font-size: 13px;
		text-align: center;
	}

	#mfa-recovery-modal {
		overflow: auto;
	}

	#mfa-recovery-modal .mfa-dialog {
		flex: 0 0 auto;
		margin-block: auto;
	}

	.mfa-recovery-footer {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}

	#mfa-recovery-continue {
		grid-column: 1 / -1;
	}

	@media (max-width: 420px) {
		.mfa-recovery-codes {
			grid-template-columns: 1fr;
		}
	}

	/* Inline mode on the default /login page: the guard hides the stock login
	   card and reveals this panel, which must center like the stock card did
	   (it lives at <body> level, outside the stock centering wrapper). */
	body.mfa-inline-active {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		min-height: 100vh;
	}

	body.mfa-inline-active > #mfa-root.mfa-section {
		width: 100%;
		padding-bottom: 0;
	}
