.topshit-members-um-field {
	margin: 24px 0;
}

.topshit-members-field-heading {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 16px;
}

.topshit-members-field-heading > .dashicons {
	width: 38px;
	height: 38px;
	font-size: 22px;
	line-height: 38px;
	text-align: center;
	border-radius: 999px;
	background: color-mix(in srgb, var(--tm-btn-bg) 12%, transparent);
	color: var(--tm-btn-bg);
}

.topshit-members-field-heading h3 {
	margin: 0;
	font-size: 1.15rem;
	line-height: 1.35;
}

.topshit-members-field-heading p {
	margin: 5px 0 0;
	opacity: .72;
}

.topshit-members-item-card {
	position: relative;
	margin: 0 0 16px;
	padding: 20px;
	border: 1px solid var(--tm-card-border);
	border-radius: var(--tm-card-radius);
	background: #fff;
	box-shadow: 0 10px 30px rgba(20, 28, 45, .055);
}

.topshit-members-card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
}

.topshit-members-card-title {
	display: flex;
	align-items: center;
	gap: 10px;
}

.topshit-members-card-title > span {
	display: inline-grid;
	place-items: center;
	min-width: 32px;
	height: 32px;
	padding: 0 8px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--tm-btn-bg) 13%, transparent);
	color: var(--tm-btn-bg);
	font-weight: 700;
}

.topshit-members-card-title strong {
	font-size: 1rem;
}

.topshit-members-card-title strong b {
	font: inherit;
}

.topshit-members-fields-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	align-items: start;
}

.topshit-members-fields-grid > .um-field {
	margin: 0 !important;
	min-width: 0;
}

.topshit-members-fields-grid .um-field-label {
	margin-bottom: 7px;
}

.topshit-members-fields-grid input,
.topshit-members-fields-grid select,
.topshit-members-fields-grid textarea,
.topshit-members-fields-grid .select2-container {
	width: 100% !important;
}

.topshit-members-add-button,
.topshit-members-remove-button {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 0;
	font: inherit;
	font-weight: 650;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, transform .2s ease, opacity .2s ease;
}

.topshit-members-add-button {
	padding: var(--tm-btn-py) var(--tm-btn-px);
	border-radius: var(--tm-btn-radius);
	background: var(--tm-btn-bg);
	color: var(--tm-btn-color);
	box-shadow: 0 8px 22px color-mix(in srgb, var(--tm-btn-bg) 25%, transparent);
}

.topshit-members-add-button:hover,
.topshit-members-add-button:focus-visible {
	background: var(--tm-btn-hover-bg);
	color: var(--tm-btn-hover-color);
	transform: translateY(-1px);
}

.topshit-members-add-button:disabled {
	cursor: not-allowed;
	opacity: .48;
	transform: none;
}

.topshit-members-remove-button {
	padding: 8px 10px;
	border-radius: 8px;
	background: transparent;
	color: #b42318;
}

.topshit-members-remove-button:hover,
.topshit-members-remove-button:focus-visible {
	background: #fff1f0;
	color: #912018;
}

.topshit-members-remove-button.is-hidden,
.topshit-members-photo-remove.is-hidden {
	display: none !important;
}

.topshit-members-limit {
	min-height: 20px;
	margin-top: 8px;
	font-size: .9em;
	color: #8a4b00;
}

/* Photo editor: same visual language as Ultimate Member profile photo. */
.topshit-members-photo-editor {
	margin: 0 0 22px;
	padding: 16px;
	border-radius: 10px;
	background: rgba(0, 0, 0, .025);
}

.topshit-members-photo-controls {
	display: flex;
	align-items: center;
	gap: 18px;
	flex-wrap: wrap;
}

.topshit-members-profile-photo.um-profile-photo {
	float: none;
	position: relative;
	width: 112px;
	height: 112px;
	margin: 0;
	flex: 0 0 112px;
}

.topshit-members-profile-photo .um-profile-photo-img,
.topshit-members-profile-photo button.um-profile-photo-img {
	position: relative;
	left: auto;
	float: none;
	display: block;
	width: 112px;
	height: 112px;
	padding: 0;
	border: 5px solid #fff !important;
	border-radius: 100%;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 3px 14px rgba(0, 0, 0, .13);
	cursor: pointer;
}

.topshit-members-profile-photo .um-profile-photo-img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.topshit-members-profile-photo .um-profile-photo-overlay i {
	font-size: 32px;
}

.topshit-members-photo-actions {
	display: flex;
	align-items: flex-start;
	flex-direction: column;
	gap: 8px;
}

.topshit-members-photo-button.um-button {
	width: auto !important;
	min-width: 170px;
	margin: 0 !important;
}

.topshit-members-photo-remove {
	appearance: none;
	border: 0;
	padding: 0;
	background: transparent;
	color: #b42318;
	text-decoration: underline;
	cursor: pointer;
}

.topshit-members-photo-input {
	display: none !important;
}

.topshit-members-photo-status {
	font-size: 13px;
	opacity: .75;
}

.topshit-members-photo-status.is-error {
	color: #b42318;
	opacity: 1;
}

.topshit-members-photo-editor.is-uploading {
	opacity: .68;
	pointer-events: none;
}

/* Public/profile view: use Ultimate Member member-card markup and styles.
 * Ultimate Member sets .um-members-wrapper to a fixed 300px height.
 * Our cards are normal CSS-grid content, so that fixed height causes the
 * following Elementor widget/section to overlap the cards. Keep the whole
 * custom directory in normal document flow and size it from its content. */
.topshit-members-directory {
	display: block;
	position: relative;
	width: 100%;
	max-width: 100%;
	height: auto !important;
	min-height: 0 !important;
	clear: both;
	overflow: visible;
	box-sizing: border-box;
	container-type: inline-size;
	container-name: topshit-members-directory;
}

.topshit-members-directory .um-members-wrapper {
	display: block;
	position: relative;
	width: 100%;
	height: auto !important;
	min-height: 0 !important;
	margin-bottom: 24px;
	overflow: visible !important;
	box-sizing: border-box;
}

.topshit-members-directory .topshit-members-view-list {
	display: grid !important;
	position: relative !important;
	width: 100%;
	height: auto !important;
	min-height: 0 !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: 5%;
	row-gap: 40px;
	align-items: stretch;
	overflow: visible !important;
	box-sizing: border-box;
}

.topshit-members-directory .topshit-members-view-list .um-gutter-sizer {
	display: none;
}

.topshit-members-directory .topshit-members-view-list .um-member {
	position: relative !important;
	left: auto !important;
	top: auto !important;
	width: auto !important;
	min-width: 0;
	margin: 0 !important;
	height: 100%;
	background: #fff;
	box-sizing: border-box;
}

.topshit-members-directory .topshit-members-card-photo {
	display: block;
}

.topshit-members-directory .um-member-photo img {
	object-fit: cover;
	aspect-ratio: 1 / 1;
}

.topshit-members-directory .um-member-card {
	text-align: center;
}

.topshit-members-directory .topshit-members-card-photo,
.topshit-members-directory .topshit-members-card-name {
	pointer-events: none;
	cursor: default;
}

.topshit-members-directory .um-member-name strong {
	font: inherit;
}

.topshit-members-directory .um-member-meta-main .um-member-meta.no-animate {
	display: block;
}

.topshit-members-directory .um-member-metaline strong {
	display: block;
	clear: both;
}

.topshit-members-pmpro-dog {
	margin: 24px 0;
}

.topshit-members-pmpro-dog select {
	width: 100%;
	max-width: 560px;
}

.topshit-members-account-dog {
	margin: 14px 0 0;
	padding: 11px 13px;
	border-radius: 9px;
	background: rgba(0, 0, 0, .035);
}

/* The markup contains UM's clearing helper, but CSS Grid does not need it.
 * Hiding it prevents an unnecessary empty grid row. */
.topshit-members-directory .topshit-members-view-list > .um-clear {
	display: none !important;
}

/* Elementor can place the shortcode inside a narrow desktop column.
 * Container queries respond to that real column width instead of only the
 * browser viewport. The media queries below remain as a fallback. */
@container topshit-members-directory (max-width: 700px) {
	.topshit-members-directory .topshit-members-view-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 5%;
	}
}

@container topshit-members-directory (max-width: 430px) {
	.topshit-members-directory .topshit-members-view-list {
		grid-template-columns: 1fr;
		column-gap: 0;
	}
}

@media (max-width: 900px) {
	.topshit-members-directory .topshit-members-view-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 5%;
	}
}

@media (max-width: 767px) {
	.topshit-members-item-card {
		padding: 16px;
	}

	.topshit-members-fields-grid {
		grid-template-columns: 1fr;
	}

	.topshit-members-card-head {
		align-items: flex-start;
	}

	.topshit-members-remove-button span:last-child {
		display: none;
	}

	.topshit-members-directory .topshit-members-view-list {
		grid-template-columns: 1fr;
		column-gap: 0;
	}
}
