/**
 * Custom Fields admin styles.
 * Scoped under .wpps-cf (builder) and .cf-* (meta boxes / term screens).
 * Panel/card design matches the Code Snippets module: flat (no radius),
 * #c3c4c7 borders, and a subtle shadow.
 */

.wpps-cf {
	--wpps-accent: var(--wp-admin-theme-color, #2271b1);
	--wpps-accent-hover: var(--wp-admin-theme-color-darker-10, #135e96);
	--wpps-accent-surface: color-mix(in srgb, var(--wp-admin-theme-color, #2271b1) 12%, #fff);
	--cf-blue: var(--wpps-accent);
	--cf-blue-hover: var(--wpps-accent-hover);
	--cf-black: #1d2327;
	--cf-gray: #50575e;
	--cf-muted: #646970;
	--cf-border: #c3c4c7;
	--cf-divider: #dcdcde;
	--cf-bg: #f6f7f7;
	--cf-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
	--cf-success: #00a32a;
	--cf-success-bg: #edfaef;
	--cf-success-text: #00622b;
	--cf-danger: #d63638;
	--cf-danger-hover: #b32d2e;
}

.wrap.wpps-cf {
	margin: 20px 20px 20px 0;
}

.wpps-cf .cf-muted {
	color: var(--cf-muted);
}

.wpps-cf .cf-req,
.cf-field .cf-req {
	color: var(--cf-danger);
}

/* Empty state — matches Options Page Builder pattern */
.wpps-cf .cf-empty {
	text-align: center;
	background: #fff;
	border: 1px solid var(--cf-border);
	box-shadow: var(--cf-shadow);
	padding: 64px 40px;
	margin-top: 16px;
}

.wpps-cf .cf-empty__icon {
	width: 80px;
	height: 80px;
	margin: 0 auto 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f0f0f1;
	color: var(--cf-black);
	border-radius: 4px;
}

.wpps-cf .cf-empty__icon .dashicons {
	font-size: 40px;
	width: 40px;
	height: 40px;
	color: var(--wpps-accent);
}

.wpps-cf .cf-empty__title {
	margin: 0 0 8px;
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--cf-black);
}

.wpps-cf .cf-empty__desc {
	margin: 0 0 24px;
	font-size: 0.9375rem;
	color: var(--cf-muted);
	max-width: 420px;
	margin-left: auto;
	margin-right: auto;
}

/* Status badges */
.wpps-cf .cf-status {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 12px;
	font-weight: 600;
}

.wpps-cf .cf-status--on {
	background: var(--cf-success-bg);
	color: var(--cf-success-text);
}

.wpps-cf .cf-status--off {
	background: #f0f0f1;
	color: var(--cf-muted);
}

.wpps-cf .cf-actions a.cf-delete {
	color: var(--cf-danger-hover);
}

/* Cards */
.wpps-cf-edit .cf-card {
	background: #fff;
	border: 1px solid var(--cf-border);
	box-shadow: var(--cf-shadow);
	padding: 20px 24px;
	margin: 16px 0;
}

.wpps-cf-edit .cf-card > h2 {
	margin: 0 0 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--cf-border);
	font-size: 1.125rem;
}

/* Action bars */
.wpps-cf-edit .cf-actions-bar {
	display: flex;
	align-items: center;
	gap: 16px;
	justify-content: flex-end;
	margin: 12px 0;
}

.wpps-cf-edit .cf-actions-bar--bottom {
	justify-content: space-between;
}

.wpps-cf-edit .cf-enabled-toggle {
	margin-right: auto;
	font-weight: 600;
}

.wpps-cf-edit .cf-key-readonly {
	background: #f6f7f7;
	padding: 4px 8px;
	border-radius: 2px;
}

/* Checkbox grid */
.wpps-cf-edit .cf-checkbox-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 8px;
}

.wpps-cf-edit .cf-check {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border: 1px solid var(--cf-border);
	border-radius: 2px;
	transition: border-color 0.2s, background 0.2s;
}

.wpps-cf-edit .cf-check:hover {
	border-color: var(--wpps-accent);
	background: var(--wpps-accent-surface);
}

.wpps-cf-edit .cf-check code {
	color: #646970;
	font-size: 11px;
}

/* Field rows — accordion cards (matches Options Page Builder field list) */
.wpps-cf-edit .cf-field-row {
	background: var(--cf-bg);
	border: 1px solid var(--cf-border);
	border-radius: 2px;
	margin-bottom: 8px;
	overflow: hidden;
	width: 100%;
	min-width: 0;
	transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.wpps-cf-edit .cf-field-row:hover {
	background: #fff;
	border-color: var(--wpps-accent);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wpps-cf-edit .cf-field-row__head {
	display: flex;
	align-items: center;
	padding: 12px 15px;
	background: transparent;
	cursor: pointer;
	transition: background 0.2s;
}

.wpps-cf-edit .cf-field-row__handle {
	cursor: move;
	color: var(--cf-gray);
	margin-right: 12px;
	flex-shrink: 0;
}

.wpps-cf-edit .cf-field-row__handle .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.wpps-cf-edit .cf-field-row__toggle {
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	color: var(--cf-gray);
	margin-right: 8px;
	transition: transform 0.2s;
	flex-shrink: 0;
}

.wpps-cf-edit .cf-field-row.collapsed .cf-field-row__toggle {
	transform: rotate(-90deg);
}

.wpps-cf-edit .cf-field-row__toggle .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.wpps-cf-edit .cf-field-row__title {
	flex: 1;
	font-weight: 600;
	font-size: 0.9375rem;
	color: var(--cf-black);
}

.wpps-cf-edit .cf-field-row__type {
	font-size: 0.75rem;
	color: var(--cf-gray);
	background: var(--cf-border);
	padding: 4px 8px;
	border-radius: 6px;
	margin-right: 12px;
	flex-shrink: 0;
}

.wpps-cf-edit .cf-field-row__width-badge {
	display: inline-flex;
	align-items: center;
	background: var(--cf-border);
	color: var(--cf-blue-hover);
	padding: 2px 8px;
	border-radius: 4px;
	font-weight: 600;
	font-size: 0.6875rem;
	margin-right: 12px;
	flex-shrink: 0;
}

.wpps-cf-edit .cf-field-row__head .cf-field-row__actions {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	flex-shrink: 0;
	margin-left: auto;
}

.wpps-cf-edit .cf-field-row__duplicate,
.wpps-cf-edit .cf-field-row__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	background: none !important;
	border: none !important;
	color: var(--cf-gray) !important;
	padding: 4px !important;
	cursor: pointer;
	line-height: 1;
}

.wpps-cf-edit .cf-field-row__duplicate .dashicons,
.wpps-cf-edit .cf-field-row__remove .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.wpps-cf-edit .cf-field-row__duplicate:hover {
	color: var(--wpps-accent) !important;
}

.wpps-cf-edit .cf-field-row__remove:hover {
	color: var(--cf-danger) !important;
}

.wpps-cf-edit .cf-field-row__body {
	padding: 20px;
	border-top: 1px solid var(--cf-border);
	width: 100%;
	box-sizing: border-box;
}

.wpps-cf-edit .cf-field-row.collapsed .cf-field-row__body {
	display: none;
}

.wpps-cf-edit .cf-field-row-placeholder {
	border: 2px dashed var(--wpps-accent);
	background: var(--wpps-accent-surface);
	margin-bottom: 8px;
	height: 60px;
	border-radius: 2px;
}

/* Author display rules above override the UA's [hidden] { display: none },
   so styled containers (e.g. display: grid) would stay visible. */
.wpps-cf [hidden],
.wpps-cf-edit [hidden] {
	display: none !important;
}

.wpps-cf-edit .cf-field-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 8px 16px;
}

.wpps-cf-edit .cf-field-control {
	margin: 10px 0;
}

.wpps-cf-edit .cf-field-control > label,
.wpps-cf-edit .cf-field-control > .cf-field-control__label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
}

/* Checkbox labels: keep the box, text, and help bubble on one line. */
.wpps-cf-edit .cf-field-control > label.cf-check-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 0;
}

.wpps-cf-edit .cf-check-label .wpps-cf-accordion-tooltip {
	margin-left: 0;
}

.wpps-cf-edit .cf-field-control input.regular-text,
.wpps-cf-edit .cf-field-control select {
	width: 100%;
	max-width: 100%;
}

.wpps-cf-edit .cf-fields-empty {
	color: var(--cf-muted);
	font-style: italic;
	padding: 12px 0;
	margin: 0;
}

/* Add Field button — align dashicon with label text */
.wpps-cf-edit #cf-add-field {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 30px;
	line-height: 1;
	vertical-align: middle;
}

.wpps-cf-edit #cf-add-field .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	line-height: 1;
	margin: 0;
	flex-shrink: 0;
}

/* Field controls (meta boxes / term screens) */
.cf-field {
	margin: 0 0 12px;
}

.cf-field__label label {
	font-weight: 600;
	display: block;
	margin-bottom: 4px;
}

.cf-meta-box__cell .cf-field {
	margin-bottom: 0;
}

.cf-meta-box__cell .cf-field__control .description {
	margin-top: 6px;
	margin-bottom: 0;
}

.cf-choices {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.cf-choice,
.cf-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.cf-media__preview {
	margin: 6px 0;
}

.cf-media-preview__img {
	max-width: 150px;
	height: auto;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	display: block;
}

.cf-media-preview__file {
	display: inline-block;
	background: #f6f7f7;
	padding: 4px 8px;
	border-radius: 4px;
}

.cf-field__message {
	background: var(--cf-bg);
	border-left: 3px solid var(--wpps-accent);
	padding: 10px 12px;
	border-radius: 4px;
}

.cf-link p {
	margin: 0 0 10px;
}

.cf-link label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}

.cf-range-field {
	vertical-align: middle;
	max-width: 280px;
}

.cf-range-value {
	display: inline-block;
	min-width: 2.5em;
	margin-left: 8px;
	font-weight: 600;
}

.cf-gallery__preview {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 8px 0;
}

.cf-gallery-preview__item {
	position: relative;
	display: inline-block;
	cursor: move;
}

.cf-gallery-preview__img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	display: block;
}

.cf-gallery-preview__remove {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 20px;
	height: 20px;
	border: none;
	border-radius: 50%;
	background: var(--cf-danger-hover);
	color: #fff;
	cursor: pointer;
	line-height: 1;
	padding: 0;
}

.cf-relational {
	min-width: 240px;
	max-width: 100%;
}

.cf-relational-search {
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-width: 100%;
}

.cf-relational-search.is-loading .cf-relational__select {
	opacity: 0.6;
}

.cf-oembed-preview {
	margin-top: 8px;
}

.cf-oembed-preview.is-loading {
	opacity: 0.6;
}

.cf-oembed-preview iframe,
.cf-oembed-preview embed {
	max-width: 100%;
}

.wpps-cf-edit .cf-checkbox-grid--compact {
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

/* Import panel */
.wpps-cf .cf-import-panel {
	background: #fff;
	border: 1px solid var(--cf-border);
	box-shadow: var(--cf-shadow);
	padding: 20px 24px;
	margin: 16px 0;
}

.wpps-cf .cf-import-panel h2 {
	margin: 0 0 8px;
	font-size: 1.125rem;
}

.wpps-cf .cf-import-panel .description {
	margin-bottom: 12px;
}

.wpps-cf .cf-import-panel textarea {
	margin-top: 8px;
}

.wrap.wpps-cf .wpps-page-hero__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

.wrap.wpps-cf .wpps-page-hero__meta .button {
	margin: 0;
	min-height: 30px;
	line-height: 1.4;
	vertical-align: middle;
}

.wpps-cf .cf-list-badge {
	display: inline-block;
	font-size: 11px;
	background: var(--wpps-accent-surface);
	color: var(--wpps-accent-hover);
	padding: 1px 6px;
	border-radius: 8px;
}

.cf-meta-key-preview code {
	font-size: 12px;
}

/* Meta box grid layout on post edit */
.cf-meta-box--grid {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.cf-meta-box__row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 16px;
	width: 100%;
	align-items: flex-start;
}

.cf-meta-box__cell {
	box-sizing: border-box;
	min-width: 0;
}

.cf-meta-box__cell.cf-field--w100 {
	flex: 1 1 100%;
	width: 100%;
	max-width: 100%;
}

.cf-meta-box__cell.cf-field--w75 {
	flex: 1 1 calc(75% - 12px);
	max-width: calc(75% - 8px);
}

.cf-meta-box__cell.cf-field--w50 {
	flex: 1 1 calc(50% - 12px);
	max-width: calc(50% - 8px);
}

.cf-meta-box__cell.cf-field--w25 {
	flex: 1 1 calc(25% - 12px);
	max-width: calc(25% - 8px);
}

/* Side column and narrow contexts always stack fields vertically */
#side-sortables .cf-meta-box__cell,
.cf-meta-box--side .cf-meta-box__cell,
.cf-term-fields .cf-meta-box__cell {
	flex: 1 1 100% !important;
	max-width: 100% !important;
	width: 100% !important;
}

/* After-title zone spacing */
#wpps-cf-after-title-sortables {
	margin: 0 0 16px;
}

#wpps-cf-after-title-sortables:empty {
	display: none;
}

/* Seamless meta box presentation (SCF/ACF-style) */
.postbox.cf-postbox--seamless {
	border: none;
	box-shadow: none;
	background: transparent;
}

.postbox.cf-postbox--seamless > .postbox-header,
.postbox.cf-postbox--seamless > .handlediv,
.postbox.cf-postbox--seamless .handle-actions {
	display: none;
}

.postbox.cf-postbox--seamless > .inside {
	padding: 0;
	margin: 0;
}

.postbox.cf-postbox > .inside {
	padding-top: 8px;
}

.postbox.cf-postbox .cf-meta-box--grid:first-child {
	margin-top: 0;
}

/* Term edit screen group layout */
.cf-term-group th[scope="row"] {
	vertical-align: top;
	padding-top: 16px;
	width: 200px;
}

.cf-term-group td {
	vertical-align: top;
	padding-top: 12px;
	padding-bottom: 12px;
}

/* Editor controls should fill their grid cell (WP .regular-text defaults to ~25em). */
.cf-meta-box .cf-field__control,
.cf-term-fields .cf-field__control {
	max-width: 100%;
}

.cf-meta-box .cf-field__control input.regular-text,
.cf-meta-box .cf-field__control input[type="text"],
.cf-meta-box .cf-field__control input[type="url"],
.cf-meta-box .cf-field__control input[type="email"],
.cf-meta-box .cf-field__control input[type="tel"],
.cf-meta-box .cf-field__control input[type="number"],
.cf-meta-box .cf-field__control input[type="password"],
.cf-meta-box .cf-field__control input[type="search"],
.cf-meta-box .cf-field__control input[type="date"],
.cf-meta-box .cf-field__control input[type="time"],
.cf-meta-box .cf-field__control input[type="datetime-local"],
.cf-meta-box .cf-field__control input.cf-color-field,
.cf-meta-box .cf-field__control textarea,
.cf-meta-box .cf-field__control select,
.cf-term-fields .cf-field__control input.regular-text,
.cf-term-fields .cf-field__control input[type="text"],
.cf-term-fields .cf-field__control input[type="url"],
.cf-term-fields .cf-field__control input[type="email"],
.cf-term-fields .cf-field__control input[type="tel"],
.cf-term-fields .cf-field__control input[type="number"],
.cf-term-fields .cf-field__control input[type="password"],
.cf-term-fields .cf-field__control input[type="search"],
.cf-term-fields .cf-field__control input[type="date"],
.cf-term-fields .cf-field__control input[type="time"],
.cf-term-fields .cf-field__control input[type="datetime-local"],
.cf-term-fields .cf-field__control input.cf-color-field,
.cf-term-fields .cf-field__control textarea,
.cf-term-fields .cf-field__control select {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.cf-meta-box .cf-field__control input[type="range"],
.cf-term-fields .cf-field__control input[type="range"] {
	width: 100%;
	max-width: 100%;
	vertical-align: middle;
}

.cf-meta-box .cf-field__control .cf-multiselect,
.cf-term-fields .cf-field__control .cf-multiselect {
	min-height: 6em;
}

.cf-meta-box .cf-field__control .cf-relational-search,
.cf-meta-box .cf-field__control .cf-media,
.cf-meta-box .cf-field__control .cf-gallery,
.cf-meta-box .cf-field__control .cf-link,
.cf-meta-box .cf-field__control .wp-editor-wrap,
.cf-term-fields .cf-field__control .cf-relational-search,
.cf-term-fields .cf-field__control .cf-media,
.cf-term-fields .cf-field__control .cf-gallery,
.cf-term-fields .cf-field__control .cf-link,
.cf-term-fields .cf-field__control .wp-editor-wrap {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.cf-meta-box .cf-field__control .wp-picker-container,
.cf-term-fields .cf-field__control .wp-picker-container {
	max-width: 100%;
}

.cf-meta-box .cf-field__control:has(.cf-field__before),
.cf-meta-box .cf-field__control:has(.cf-field__after),
.cf-term-fields .cf-field__control:has(.cf-field__before),
.cf-term-fields .cf-field__control:has(.cf-field__after) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.cf-meta-box .cf-field__control .cf-field__before,
.cf-meta-box .cf-field__control .cf-field__after,
.cf-term-fields .cf-field__control .cf-field__before,
.cf-term-fields .cf-field__control .cf-field__after {
	flex-shrink: 0;
}

.cf-meta-box .cf-field__control:has(.cf-field__before) .regular-text,
.cf-meta-box .cf-field__control:has(.cf-field__after) .regular-text,
.cf-term-fields .cf-field__control:has(.cf-field__before) .regular-text,
.cf-term-fields .cf-field__control:has(.cf-field__after) .regular-text {
	flex: 1 1 12rem;
	min-width: 0;
	width: auto;
	max-width: 100%;
}

/* Nested fields inside meta boxes */
.cf-meta-box .cf-repeater,
.cf-meta-box .cf-flexible,
.cf-meta-box .cf-clone,
.cf-term-fields .cf-repeater,
.cf-term-fields .cf-flexible,
.cf-term-fields .cf-clone {
	width: 100%;
}

.cf-field__before,
.cf-field__after {
	color: #646970;
	font-weight: 600;
}

@media (max-width: 782px) {
	.cf-meta-box__cell.cf-field--w75,
	.cf-meta-box__cell.cf-field--w50,
	.cf-meta-box__cell.cf-field--w25 {
		flex: 1 1 100% !important;
		max-width: 100% !important;
		width: 100% !important;
	}
}

.cf-rules-list .cf-rule-row,
.cf-subfield-row,
.cf-layout-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin-bottom: 8px;
	padding: 10px 12px;
	background: var(--cf-bg);
	border: 1px solid var(--cf-divider);
	border-radius: 2px;
}

.cf-rules-list .cf-rule-row:last-child,
.cf-subfield-row:last-child,
.cf-layout-row:last-child {
	margin-bottom: 0;
}

.cf-rules-list .cf-rule-row select,
.cf-rules-list .cf-rule-row input.regular-text {
	margin: 0;
}

.cf-rules-list .cf-rule-value-select {
	min-width: 200px;
	max-width: 100%;
}

.cf-rules-list .cf-rule-remove,
.cf-subfield-row .cf-subfield-remove,
.cf-layout-row .cf-layout-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	padding: 0;
	color: var(--cf-danger-hover);
	text-decoration: none;
	font-size: 18px;
	line-height: 1;
}

.cf-rules-list .cf-rule-remove:hover,
.cf-subfield-row .cf-subfield-remove:hover,
.cf-layout-row .cf-layout-remove:hover {
	color: var(--cf-danger);
}

/* Conditional logic panel */
.wpps-cf-edit .cf-field-conditional {
	margin-top: 4px;
	padding-top: 16px;
	border-top: 1px solid var(--cf-divider);
}

.wpps-cf-edit .cf-conditional-panel {
	margin-top: 12px;
	padding: 16px;
	background: var(--cf-bg);
	border: 1px solid var(--cf-divider);
	border-radius: 2px;
}

.wpps-cf-edit .cf-conditional-match {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin-bottom: 12px;
}

.wpps-cf-edit .cf-conditional-match__label {
	font-weight: 600;
	font-size: 13px;
	color: var(--cf-black);
	margin: 0;
}

.wpps-cf-edit .cf-conditional-match-select {
	min-width: 100px;
	margin: 0;
}

.wpps-cf-edit .cf-conditional-rules {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 12px;
}

.wpps-cf-edit .cf-conditional-rule-row {
	display: grid;
	grid-template-columns: minmax(140px, 1.2fr) minmax(110px, 0.8fr) minmax(140px, 1.2fr) auto;
	gap: 8px;
	align-items: center;
	margin-bottom: 0;
	padding: 10px 12px;
	background: #fff;
	border: 1px solid var(--cf-divider);
	border-radius: 2px;
}

.wpps-cf-edit .cf-conditional-rule-row > select,
.wpps-cf-edit .cf-conditional-value-wrap {
	min-width: 0;
	max-width: 100%;
	margin: 0;
}

.wpps-cf-edit .cf-conditional-value-wrap .cf-conditional-value {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0;
	box-sizing: border-box;
}

.wpps-cf-edit .cf-conditional-rule-row .cf-conditional-rule-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	padding: 0;
	color: var(--cf-danger-hover);
	text-decoration: none;
	font-size: 18px;
	line-height: 1;
}

.wpps-cf-edit .cf-conditional-rule-row .cf-conditional-rule-remove:hover {
	color: var(--cf-danger);
}

.wpps-cf-edit .cf-add-conditional-rule {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin: 0;
}

@media screen and (max-width: 782px) {
	.wpps-cf-edit .cf-conditional-rule-row {
		grid-template-columns: 1fr;
	}
}

.cf-rule-summary {
	margin: 4px 0 0;
	padding-left: 1.2em;
}

.cf-location-target {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	line-height: 1.4;
}

.cf-location-target .dashicons {
	width: 18px;
	height: 18px;
	font-size: 18px;
	color: #646970;
	flex-shrink: 0;
}

.cf-location-target__icon--multi {
	opacity: 0.85;
}

.cf-location-target--various .dashicons {
	color: #787c82;
}

.cf-repeater__row,
.cf-flexible__row {
	border: 1px solid #dcdcde;
	border-radius: 2px;
	padding: 12px;
	margin-bottom: 10px;
	background: #fafafa;
}

.cf-repeater__row-head,
.cf-flexible__row-head {
	display: flex;
	justify-content: space-between;
	margin-bottom: 8px;
}

@media screen and (max-width: 782px) {
	.wpps-cf-edit .cf-actions-bar {
		flex-wrap: wrap;
	}
}

.wpps-cf .cf-usage-grid {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-top: 12px;
}

.wpps-cf .cf-usage-block {
	background: #f6f7f7;
	border: 1px solid #c3c4c7;
	padding: 14px 16px;
}

.wpps-cf .cf-usage-block__title {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
}

.wpps-cf .cf-usage-block__intro {
	margin: 0 0 12px;
}

.wpps-cf .cf-usage-snippet + .cf-usage-snippet {
	margin-top: 12px;
}

.wpps-cf .cf-usage-snippet__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 6px;
}

.wpps-cf .cf-usage-snippet__label {
	font-size: 12px;
	font-weight: 600;
	color: #50575e;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.wpps-cf .cf-usage-snippet__code {
	display: block;
	padding: 10px 12px;
	background: #fff;
	border: 1px solid #c3c4c7;
	font-size: 12px;
	line-height: 1.5;
	word-break: break-all;
	white-space: pre-wrap;
}

.wpps-cf .cf-usage-snippet--inline {
	display: flex;
	align-items: center;
	gap: 8px;
}

.wpps-cf .cf-usage-snippet--inline .cf-usage-snippet__code {
	flex: 1;
	margin: 0;
}

.wpps-cf .cf-usage-copy {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.wpps-cf .cf-usage-copy .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
}

.wpps-cf .cf-usage-copy.is-copied {
	color: var(--wpps-accent);
	border-color: var(--wpps-accent);
}

.wpps-cf .cf-usage-fields {
	margin: 0;
	background: #fff;
}

.wpps-cf .cf-usage-fields__action {
	width: 72px;
	text-align: center;
}

.wpps-cf .cf-usage-fields code {
	font-size: 12px;
}

.wpps-cf .cf-usage-empty {
	padding: 14px 16px;
	background: #fff;
	border: 1px dashed #c3c4c7;
	color: #646970;
}

.wpps-cf .cf-usage-empty p {
	margin: 0;
}

.wpps-cf .cf-usage-integrations {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.wpps-cf .cf-usage-integrations li {
	display: grid;
	gap: 4px;
	padding-bottom: 12px;
	border-bottom: 1px solid #dcdcde;
}

.wpps-cf .cf-usage-integrations li:last-child {
	padding-bottom: 0;
	border-bottom: none;
}

.wpps-cf .cf-usage-integrations__name {
	font-weight: 600;
	color: #1d2327;
}

.wpps-cf .cf-usage-integrations__detail {
	font-size: 13px;
	color: #646970;
}

.wpps-cptb .cptb-usage-list {
	margin: 0.5em 0 0;
	padding-left: 1.2em;
}

.wpps-cptb .cptb-usage-list code {
	word-break: break-all;
}

.wpps-cf .cf-card--usage {
	margin-top: 16px;
}

.wpps-cptb .cptb-empty--inline {
	padding: 12px 16px;
	margin: 12px 0;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
}

/* List table header (views + search) — WP_List_Table handles the table */
.wpps-cf .cf-list-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 8px 0 0;
}

.wpps-cf .cf-list-header .subsubsub {
	float: none;
	margin: 0;
}

.wpps-cf .cf-list-header .search-box {
	float: none;
	margin: 0;
}

.wpps-cf #cf-groups-list-form {
	margin-top: 0;
	clear: both;
}

.wpps-cf .wp-list-table .column-title {
	width: 22%;
}

.wpps-cf .wp-list-table .column-fields {
	width: 8%;
}

.wpps-cf .wp-list-table .row-actions {
	color: #646970;
}

.wpps-cf .wp-list-table .cf-muted {
	margin-top: 2px;
	font-size: 12px;
}

/* Validation errors. Intentionally not a .notice so admin notice managers
   cannot hide or relocate it. */
.wpps-cf-edit .cf-error-box {
	margin: 0 0 16px;
	padding: 12px 16px;
	background: #fcf0f1;
	border: 1px solid var(--cf-danger);
	border-left-width: 4px;
	color: var(--cf-black);
}

.wpps-cf-edit .cf-error-box p {
	margin: 0 0 4px;
}

/* Settings accordion below the fields builder (matches WP postbox / admin tabs) */
.wpps-cf-edit .cf-settings {
	background: #fff;
	border: 1px solid #c3c4c7;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
	margin: 16px 0;
}

.wpps-cf-edit .cf-settings > summary {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
	cursor: pointer;
	user-select: none;
	list-style: none;
	transition: background 0.15s ease;
}

.wpps-cf-edit .cf-settings > summary:hover {
	background: #f6f7f7;
}

.wpps-cf-edit .cf-settings > summary::-webkit-details-marker {
	display: none;
}

.wpps-cf-edit .cf-settings > summary::after {
	content: "\f140";
	font-family: dashicons;
	margin-left: auto;
	font-size: 18px;
	width: 18px;
	height: 18px;
	color: #787c82;
	transition: transform 0.15s ease;
}

.wpps-cf-edit .cf-settings[open] > summary {
	border-bottom: 1px solid #c3c4c7;
}

.wpps-cf-edit .cf-settings[open] > summary::after {
	transform: rotate(180deg);
}

.wpps-cf-edit .cf-settings > summary .dashicons {
	color: var(--wpps-accent);
}

.wpps-cf-edit .cf-settings__inner {
	padding: 0 16px 16px;
}

.wpps-cf-edit .cf-settings-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 12px 0 0;
	padding: 0;
	border-bottom: 1px solid #c3c4c7;
}

.wpps-cf-edit .cf-settings-tab {
	border: none;
	background: transparent;
	padding: 10px 16px;
	margin: 0 0 -1px;
	font-size: 13px;
	font-weight: 600;
	color: #50575e;
	cursor: pointer;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	box-shadow: none;
}

.wpps-cf-edit .cf-settings-tab:hover {
	color: #1d2327;
}

.wpps-cf-edit .cf-settings-tab.is-active {
	color: var(--wpps-accent);
	border-bottom-color: var(--wpps-accent);
}

.wpps-cf-edit .cf-settings-panel {
	padding-top: 8px;
}

.wpps-cf-edit .cf-settings .wpps-cf-accordion-tooltip:hover .wpps-cf-accordion-tooltip-trigger,
.wpps-cf-edit .cf-settings .wpps-cf-accordion-tooltip.is-active .wpps-cf-accordion-tooltip-trigger {
	color: var(--wpps-accent);
	background: var(--wpps-accent-surface);
}

/* Help tooltips (shared viewport-aware pattern; matches Code Snippets) */
.wpps-cf-accordion-tooltip {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-left: 6px;
	cursor: help;
	vertical-align: middle;
}

.wpps-cf-accordion-tooltip-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	font-size: 12px;
	font-weight: 600;
	color: #50575e;
	background: #f0f0f1;
	border-radius: 50%;
	line-height: 1;
	transition: color 0.2s, background 0.2s;
}

.wpps-cf-accordion-tooltip:hover .wpps-cf-accordion-tooltip-trigger {
	color: var(--wpps-accent);
	background: var(--wpps-accent-surface);
}

.wpps-cf-accordion-tooltip-panel {
	position: absolute;
	left: 0;
	bottom: calc(100% + 10px);
	transform: translateY(4px);
	min-width: 220px;
	max-width: min(320px, calc(100vw - 32px));
	padding: 12px 14px;
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.5;
	color: #1d2327;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
	z-index: 100000;
}

.wpps-cf-accordion-tooltip-panel.is-positioned {
	position: fixed !important;
	bottom: auto !important;
	transform: none !important;
	transition: opacity 0.12s ease, visibility 0.12s ease;
}

.wpps-cf-accordion-tooltip-panel::before {
	content: "";
	position: absolute;
	top: 100%;
	left: var(--wpps-tip-x, 14px);
	margin-left: -7px;
	border: 7px solid transparent;
	border-top-color: #c3c4c7;
}

.wpps-cf-accordion-tooltip-panel::after {
	content: "";
	position: absolute;
	top: 100%;
	left: var(--wpps-tip-x, 14px);
	margin-left: -6px;
	margin-top: -1px;
	border: 6px solid transparent;
	border-top-color: #fff;
}

.wpps-cf-accordion-tooltip-panel.wpps-accordion-tooltip-panel--below::before {
	top: auto;
	bottom: 100%;
	margin-top: 0;
	margin-bottom: -1px;
	border-top-color: transparent;
	border-bottom-color: #c3c4c7;
}

.wpps-cf-accordion-tooltip-panel.wpps-accordion-tooltip-panel--below::after {
	top: auto;
	bottom: 100%;
	margin-top: 0;
	margin-bottom: -2px;
	border-top-color: transparent;
	border-bottom-color: #fff;
}

.wpps-cf-accordion-tooltip.is-active .wpps-cf-accordion-tooltip-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

@media (hover: hover) {
	html:not(.wpps-accordion-tooltips-ready) .wpps-cf-accordion-tooltip:hover .wpps-cf-accordion-tooltip-panel:not(.is-positioned) {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}
}

