.user__profile-card {
	border-radius: 4px;
	background: #f1f5fc;
	padding: 0 20px 35px;
	width: 100%;
}

.user__profile-side-section {
	border-top: 1px solid #fff;
	width: 100%;
	padding: 18px 10px 22px;
}

.user__profile-txt {
	color: #424242;
	font-family: IRANSans-Medium;
	font-size: 14px;
	font-style: normal;
	font-weight: 500;
}

body[dir="ltr"] .user__profile-txt {
	font-family: Roboto;
	font-weight: 600;
}

.user__profile-txt.secondary-color {
	color: #8c8c8c;
}

.user__profile-primary-text {
	color: #36459b;
	font-family: IRANSans-Medium;
	font-size: 16px;
	font-style: normal;
	font-weight: 700;
}

.user__profile-title {
	color: #424242;
	font-family: IRANSans-Bold;
	font-size: 20px;
	font-style: normal;
	font-weight: 500;
	letter-spacing: -0.2px;
}

.user__profile-action {
	cursor: pointer;
	transition: all 0.2s ease;
}

.user__profile-action:hover {
	transform: scale(1.18);
}

.user__profile-edit-avatar-action {
	padding: 0 22px;
	display: flex;
	align-items: center;
	column-gap: 6px;
	border-radius: 20px;
	border: 1px solid #757775;
	min-height: 36px;
	color: #36459b;
	font-family: IRANSans-Medium;
	font-size: 16px;
	font-style: normal;
	font-weight: 500;
	letter-spacing: -0.16px;
	background: transparent;
	cursor: pointer;
	user-select: none;
}

.user__profile-edit-avatar-action .icon svg {
	transition: all 0.2s ease;
}

.user__profile-edit-avatar-action:hover .icon svg {
	transform: scale(1.14);
}

.user__profile-edit-avatar-action:focus {
	outline: unset;
}

.user__profile-avatar {
	width: 100%;
	border-radius: 15px;
	border: 3px solid #fff;
}

.user__profile-avatar img {
	object-fit: cover;
	min-height: 265px;
	height: 265px;
	width: 100%;
	border-radius: 15px;
}

/* Scale the navbar badge to the larger photo and keep it above the FilePond controls. */
.user-profile-page .person-avatar.bioarc-advanced-ring::after {
	top: 72%;
	right: calc(5% - 21px);
	width: 42px;
	height: 20px;
	font-size: 11px;
	line-height: 20px;
	z-index: 1;
}

.user__profile-qr-code canvas,
.user__profile-qr-code img {
	--size: 173px;
	min-height: var(--size);
	height: var(--size);
	min-width: var(--size);
	width: var(--size);
}

.user__profile-email {
	color: #5f5f63;
	font-family: IRANSans-Medium;
	font-size: 16px;
	font-style: normal;
	font-weight: 400;
}

.user__profile-body-section {
	padding: 20px 0 18px;
	width: 100%;
	border-bottom: 1px solid #e6ecf6;
}

.user__profile-body-section.secondary {
	padding: 25px 0 30px;
}

.user__profile-tab-action,
.user__profile-tab-action:focus {
	border: unset;
	outline: unset;
}

.user__profile-tab-action {
	border-radius: 4px;
	color: #fff;
	font-family: IRANSans-Medium;
	font-size: 16px;
	font-style: normal;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	column-gap: 8px;
	cursor: pointer;
	padding: 0 10px;
	min-height: 60px;
	box-shadow: unset;
}

.user__profile-tab-action.pink {
	background: #a370ed;
}

.user__profile-tab-action.blue {
	background: #6ba9e3;
}

.user__profile-tab-action.purple {
	background: #613aea;
}

.user__profile-switch-box {
	min-height: 60px;
	border-radius: 7px;
	border: 1px solid var(--input-border, #b2c6e3);
	background: #fff;
	display: flex;
	align-items: center;
	padding: 0 24px;
}

.user__profile-fieldset {
	border-radius: 4px;
	border: 1px solid;
	background: #fff;
	min-height: 70px;
	padding-bottom: 15px;
}

.user__profile-fieldset.purple,
.user__profile-fieldset.purple legend {
	border-color: #613aea;
}

.user__profile-fieldset.purple legend {
	color: #613aea;
}

.user__profile-fieldset.low-purple,
.user__profile-fieldset.low-purple legend {
	border-color: #a370ed;
}

.user__profile-fieldset.low-purple legend {
	color: #a370ed;
}

.user__profile-fieldset.blue,
.user__profile-fieldset.blue legend {
	border-color: #6ba9e3;
}

.user__profile-fieldset.blue legend {
	color: #6ba9e3;
}

.user__profile-fieldset legend {
	border-radius: 4px;
	border: 1px solid;
	background: #fff;
	min-height: 32px;
	padding: 2px 26px;
	color: #000;
	text-align: right;
	font-family: IRANSans-Medium;
	font-size: 16px;
	font-style: normal;
	font-weight: 400;
	display: flex;
	align-items: center;
	justify-content: center;
	column-gap: 10px;
}

.user__profile-fieldset legend .action {
	cursor: pointer;
	transition: all 0.2s ease;
}

.user__profile-fieldset legend .action:hover {
	transform: scale(1.15);
}

.user__profile-badge {
	min-height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 3px 10px;
	color: #424242;
	font-family: IRANSans-Medium;
	font-size: 14px;
	font-style: normal;
	font-weight: 500;
	letter-spacing: -0.14px;
	border-radius: 4px;
	background: #f4f6fb;
}

.user__profile-badges {
	width: 100%;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	padding: 10px 24px 0;
}

.user__profile-td-avatar img {
	width: 33px;
	height: 34px;
	min-width: 33px;
	min-height: 34px;
	border-radius: 50%;
}

.user__profile-tabs-bg {
	background: rgba(244, 246, 251, 0.38) !important;
	padding: 32px 23px;
}

#profileSettingModal .modal-body {
	padding: 14px !important;
}

#profileSettingModal .user__profile-tabs-bg {
	padding: 16px 12px;
}

.modal-dialog.user__profile-small-model {
	display: flex;
	justify-content: center;
}

.modal-dialog.user__profile-small-model .modal-content {
	min-width: 630px;
	max-width: 630px;
}

@media (max-width: 680px) {
	.user__profile-switch-box {
		padding: 0 12px;
		min-height: 48px;
	}

	.user__profile-avatar img {
		min-height: 186px;
		height: 186px;
	}

	.user__profile-switch-box .app-switch-extra-text {
		font-size: 14px !important;
	}

	.user__profile-card {
		padding: 0 10px 15px;
	}

	.user__profile-qr-code canvas,
	.user__profile-qr-code img {
		--size: 134px;
	}

	.user__profile-fieldset legend {
		font-size: 11px;
	}

	.user__profile-badges {
		padding: 10px 15px 0;
	}
}

@media (max-width: 767px) {
	.modal-dialog.user__profile-small-model .modal-content {
		min-width: 100vw;
		max-width: unset;
	}
}

body[dir="ltr"] .material-radio-text {
	font-family: Roboto;
}

/* Keep UiController::actionUserProfile's cards and fields on the shared V2 dark palette. */
@media screen {
	html[data-bioarc-theme=dark] body.V2 :is(.user__profile-title,.user__profile-txt,.user__profile-email,.user__profile-primary-text,.user__profile-fieldset legend,.user__profile-badge,.user__profile-tab-action,.user__profile-switch-box .app-switch-extra-text) {
		font-family: var(--font-family-main);
	}

	html[data-bioarc-theme=dark] body.V2 .user__profile-tab-action:is(.pink,.blue) {
		color: var(--bioarc-field-accent);
	}

	html[data-bioarc-theme=dark] body.V2 .user__profile-tab-action.pink {
		background-color: var(--bioarc-navbar-purple-tint);
	}

	html[data-bioarc-theme=dark] body.V2 .user__profile-tab-action.blue {
		background-color: var(--bioarc-field-surface);
	}

	html[data-bioarc-theme=dark] body.V2 .user__profile-card {
		background-color: var(--bioarc-field-raised, #303f4d);
		color: var(--bioarc-field-text, #e4e8eb);
	}

	html[data-bioarc-theme=dark] body.V2 :is(.user__profile-switch-box,.user__profile-fieldset,.user__profile-fieldset legend) {
		background-color: var(--bioarc-field-surface, #272b33);
		border-color: var(--bioarc-field-border, #434b57);
	}

	html[data-bioarc-theme=dark] body.V2 :is(.user__profile-title,.user__profile-txt,.user__profile-email) {
		color: var(--bioarc-field-text, #e4e8eb);
	}

	html[data-bioarc-theme=dark] body.V2 .user__profile-txt.secondary-color {
		color: var(--bioarc-field-muted, #bdc6cd);
	}

	html[data-bioarc-theme=dark] body.V2 :is(.user__profile-primary-text,.user__profile-edit-avatar-action,.user__profile-fieldset legend,.user__profile-action,.user__profile-switch-box .app-switch-extra-text) {
		color: var(--bioarc-field-accent, #a6c9ed);
	}

	html[data-bioarc-theme=dark] body.V2 :is(.user__profile-side-section,.user__profile-body-section,.user__profile-edit-avatar-action) {
		border-color: var(--bioarc-field-border, #434b57);
	}

	html[data-bioarc-theme=dark] body.V2 .user__profile-badge {
		background-color: var(--bioarc-field-surface, #272b33);
		color: var(--bioarc-field-text, #e4e8eb);
	}

	html[data-bioarc-theme=dark] body.V2 .user__profile-tabs-bg {
		background-color: var(--bioarc-field-surface, #272b33) !important;
	}

	/* The real profile view makes this header sticky and explicitly white. */
	html[data-bioarc-theme=dark] body.V2 .user__profile-fieldset .table-scroll-container thead tr {
		background-color: var(--bioarc-field-raised, #303f4d);
	}

	html[data-bioarc-theme=dark] body.V2 #secondary__tab-signature .modified-dropify-ui .dropify-wrapper {
		background-color: var(--bioarc-field-surface, #272b33);
		color: var(--bioarc-field-muted, #bdc6cd);
		border-color: var(--bioarc-field-border, #434b57);
	}

	html[data-bioarc-theme=dark] body.V2 #secondary__tab-signature .modified-dropify-ui .dropify-wrapper:hover {
		background-image: none;
	}

	/* Scope the upload placeholder so the avatar editor keeps its existing upload lifecycle. */
	html[data-bioarc-theme=dark] body.V2 .user__profile-card :is(.filepond--panel-root,.filepond--drop-label) {
		background-color: var(--bioarc-field-surface, #272b33);
		color: var(--bioarc-field-muted, #bdc6cd);
	}

	html[data-bioarc-theme=dark] body.V2 .user__profile-action svg [stroke="#424242"],
	html[data-bioarc-theme=dark] body.V2 .user__profile-action svg [stroke="#36459B"] {
		stroke: var(--bioarc-field-accent, #a6c9ed);
	}
}

/* Keep the real profile's existing cards and table details usable on narrow screens. */
@media screen and (max-width: 768px) {
	.user-profile-page.app-content {
		padding-inline: 12px !important;
	}

	.user-profile-page > .app-fit > div {
		width: 100%;
		min-width: 0;
		padding-inline: 0;
	}

	.user-profile-page .user__profile-card {
		min-width: 0;
		padding-inline: 12px;
	}

	.user-profile-page .user__profile-title {
		font-size: 18px;
		text-align: center;
		overflow-wrap: anywhere;
	}

	.user-profile-page .person-avatar {
		width: 160px !important;
		height: 160px !important;
	}

	.user-profile-page .user__profile-side-section {
		padding: 14px 0;
		row-gap: 12px;
	}

	.user-profile-page .user__profile-txt {
		overflow-wrap: anywhere;
	}

	.user-profile-page .user__profile-body-section > .d-flex {
		flex-wrap: wrap;
		gap: 6px 12px;
	}

	.user-profile-page .user__profile-body-section.secondary {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
		padding-block: 16px;
	}

	.user-profile-page .user__profile-tab-action {
		width: 100%;
		max-width: none;
		min-height: 44px;
		padding: 8px;
		font-size: 14px;
	}

	.user-profile-page .user__profile-switch-box {
		grid-column: 1 / -1;
		width: 100%;
		padding: 10px;
	}

	.user-profile-page .user__profile-switch-box .app-switch-extra-text {
		white-space: normal !important;
	}

	.user-profile-page .user__profile-fieldset {
		min-width: 0;
	}

	.user-profile-page .user__profile-fieldset legend {
		max-width: calc(100% - 16px);
		padding-inline: 12px;
		white-space: normal;
		text-align: start !important;
		font-size: 13px;
	}

	.user-profile-page .user__profile-badges {
		padding-inline: 10px;
		gap: 6px;
	}

	.user-profile-page .secondary-table-section {
		min-width: 0;
		padding-inline: 8px;
	}

	.user-profile-page .table-scroll-container {
		max-height: none;
		overflow: visible;
	}

	/* Stack labels above values so Persian content stays at the reading edge. */
	.user-profile-page .secondary-table.table > tbody > tr > td {
		display: block;
		height: auto;
		min-height: 38px;
		padding: 10px 12px;
		text-align: start;
		overflow-wrap: anywhere;
	}

	.user-profile-page .secondary-table.table > tbody > tr > td:first-child {
		text-align: start !important;
	}

	.user-profile-page .secondary-table.table > tbody > tr > td::before {
		float: none;
		display: block;
		margin-bottom: 6px;
		text-transform: none;
	}

	.user-profile-page .secondary-table.table > tbody > tr > td:not([data-label])::before {
		display: none;
	}

	.user-profile-page .secondary-table.table td > .d-flex {
		justify-content: flex-start;
		gap: 8px;
	}

	.user-profile-page .secondary-table.table td .app-btn2 {
		max-width: 100%;
		min-height: 40px;
		white-space: normal;
		text-align: start;
	}
}

/* Mobile table labels and action icons follow the same dark tokens as the profile cards. */
@media screen {
	html[data-bioarc-theme=dark] body.V2 .user-profile-page .secondary-table.table td::before {
		color: var(--bioarc-field-muted, #bdc6cd);
	}

	html[data-bioarc-theme=dark] body.V2 .user-profile-page .simulate_sync_action i {
		color: inherit;
	}

	html[data-bioarc-theme=dark] body.V2 .user-profile-page .user__profile-side-section svg [stroke]:not([stroke=none]) {
		stroke: var(--bioarc-field-muted, #bdc6cd);
	}

	html[data-bioarc-theme=dark] body.V2 .user-profile-page .user__profile-side-section svg [fill]:not([fill=none]) {
		fill: var(--bioarc-field-muted, #bdc6cd);
	}
}
