/**
 * Basic Forms - Admin Styles
 *
 * @package BasicForms
 * @since 1.0.0
 */

.wpps-bf-wrap,
.wpps-bf-modal-overlay,
#wpps-bf-design-modal,
#wpps-bf-ai-chat {
	--wpps-bf-accent: var(--wpps-accent, var(--wp-admin-theme-color, #2271b1));
	--wpps-bf-accent-hover: var(--wpps-accent-hover, var(--wp-admin-theme-color-darker-10, #135e96));
	--wpps-bf-accent-bg: color-mix(in srgb, var(--wp-admin-theme-color, #2271b1) 12%, #fff);
	--wpps-bf-accent-border: color-mix(in srgb, var(--wp-admin-theme-color, #2271b1) 45%, #fff);
	--wpps-bf-black: #1d2327;
	--wpps-bf-muted: #50575e;
	--wpps-bf-gray: #646970;
	--wpps-bf-border: #c3c4c7;
	--wpps-bf-divider: #dcdcde;
	--wpps-bf-surface: #f0f0f1;
	--wpps-bf-bg: #f6f7f7;
	--wpps-bf-white: #fff;
	--wpps-bf-success: #00a32a;
	--wpps-bf-danger: #d63638;
	--wpps-bf-danger-bg: color-mix(in srgb, var(--wpps-bf-danger) 8%, #fff);
	--wpps-bf-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.wrap.wpps-bf-wrap {
	margin: 20px 20px 20px 0;
	/* Mirror Code Snippet: WP admin theme vars inherit down from body, not :root. */
	--wpps-bf-theme: var(--wp-admin-theme-color, #2271b1);
	--wpps-bf-theme-dark: var(--wp-admin-theme-color-darker-10, #135e96);
}

.wrap.wpps-bf-wrap .wpps-page-hero__meta .button {
	margin: 0;
}

.wpps-bf-privacy-notice {
	margin: 0 0 24px;
}

.wpps-bf-panel,
.wpps-bf-card {
	background: var(--wpps-bf-white);
	border: 1px solid var(--wpps-bf-border);
	box-shadow: var(--wpps-bf-shadow);
	margin-bottom: 24px;
}

.wpps-bf-panel-title,
.wpps-bf-card-title {
	margin: 0;
	padding: 16px 20px;
	font-size: 16px;
	font-weight: 600;
	color: var(--wpps-bf-black);
	border-bottom: 1px solid var(--wpps-bf-divider);
}

.wpps-bf-panel-body,
.wpps-bf-card-body {
	padding: 20px;
}

.wpps-bf-list-panel {
	background: transparent;
	border: none;
	box-shadow: none;
}

.wpps-bf-list-panel .wpps-bf-panel-body {
	padding: 0;
}

/* List table cards: match Posts/Pages (no white box, gray page background shows through) */
.wpps-bf-card.wpps-bf-list-card { background: transparent; border: none; box-shadow: none; }
.wpps-bf-card.wpps-bf-list-card .wpps-bf-card-title { border-bottom: none; padding-left: 0; padding-bottom: 8px; }
.wpps-bf-card.wpps-bf-list-card .wpps-bf-card-body { padding: 0; }
/* Reduce space around search box */
#forms-filter .search-box,
#entries-filter .search-box { margin: 0 0 8px; }
#forms-filter .tablenav.top,
#entries-filter .tablenav.top { margin-bottom: 8px; }
.wpps-bf-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.wpps-bf-title { margin: 0 0 4px; font-size: 23px; font-weight: 400; }
.wpps-bf-subtitle { margin: 0; color: var(--wpps-bf-gray); font-size: 14px; }
.wpps-bf-header-right { display: flex; gap: 8px; }
.wpps-bf-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.wpps-bf-stat-card { background: var(--wpps-bf-white); border: 1px solid var(--wpps-bf-border); border-radius: 4px; padding: 16px; box-shadow: var(--wpps-bf-shadow); }
.wpps-bf-stat-label { display: block; font-size: 12px; color: var(--wpps-bf-gray); margin-bottom: 4px; }
.wpps-bf-stat-value { font-size: 24px; font-weight: 600; color: var(--wpps-bf-black); }
.wpps-bf-layout-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.wpps-bf-card { background: var(--wpps-bf-white); border: 1px solid var(--wpps-bf-border); border-radius: 4px; box-shadow: var(--wpps-bf-shadow); }
.wpps-bf-card-title { margin: 0; padding: 16px 20px; font-size: 16px; font-weight: 600; border-bottom: 1px solid var(--wpps-bf-border); }
.wpps-bf-card-body { padding: 20px; }
.wpps-bf-empty, .wpps-bf-empty-state { color: var(--wpps-bf-gray); padding: 20px 0; text-align: center; }
.wpps-bf-empty-state .button { margin-top: 12px; }
.wpps-bf-badge { padding: 4px 8px; border-radius: 3px; font-size: 11px; font-weight: 500; }
.wpps-bf-badge-warning { background: var(--wpps-bf-white)3cd; color: #856404; }
.wpps-bf-badge-success { background: #d4edda; color: #155724; }
.wpps-bf-shortcode-input { width: 100%; max-width: 280px; font-family: monospace; font-size: 12px; cursor: pointer; }
.wpps-bf-shortcode-copied { margin-left: 8px; color: var(--wpps-bf-success); font-size: 12px; opacity: 0; transition: opacity .2s; }
.wpps-bf-shortcode-copied.show { opacity: 1; }
.wpps-bf-filters { margin-bottom: 16px; }
.wpps-bf-filter-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.wpps-bf-status-badge { padding: 4px 8px; border-radius: 3px; font-size: 11px; }
.wpps-bf-status-badge.status-unread { background: var(--wpps-bf-white)3cd; color: #856404; }
.wpps-bf-status-badge.status-read { background: #d4edda; color: #155724; }
tr.entry-unread { background: #f8f9fa; }
.wpps-bf-modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.6); z-index: 100000; align-items: center; justify-content: center; }
.wpps-bf-modal-overlay.show { display: flex; }
.wpps-bf-modal-container { background: var(--wpps-bf-white); max-width: 800px; width: 90%; max-height: 85vh; overflow-y: auto; border-radius: 8px; box-shadow: 0 4px 24px rgba(0,0,0,.2); }
.wpps-bf-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--wpps-bf-border); }
.wpps-bf-modal-header h2 { margin: 0; font-size: 18px; }
.wpps-bf-modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--wpps-bf-gray); padding: 0; line-height: 1; }
.wpps-bf-modal-close:hover { color: var(--wpps-bf-black); }
.wpps-bf-modal-content { padding: 24px; }
.wpps-bf-modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	padding: 16px 24px 20px;
	border-top: 1px solid var(--wpps-bf-border);
}
.wpps-bf-modal-header .dashicons {
	width: 20px;
	height: 20px;
	font-size: 20px;
	margin-right: 6px;
	vertical-align: text-bottom;
}
.wpps-bf-loading { text-align: center; padding: 40px; color: var(--wpps-bf-gray); }
.wpps-bf-entry-detail { font-size: 14px; }
.wpps-bf-entry-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; padding: 20px; background: var(--wpps-bf-bg); border-radius: 6px; border: 1px solid var(--wpps-bf-border); }
.wpps-bf-entry-meta-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--wpps-bf-gray); margin-bottom: 4px; }
.wpps-bf-entry-meta-value { font-weight: 500; color: var(--wpps-bf-black); }
.wpps-bf-entry-data h3 { margin: 0 0 16px; font-size: 16px; }
.wpps-bf-entry-label { font-weight: 600; color: var(--wpps-bf-muted); }
.wpps-bf-entry-value { word-break: break-word; }
/* Form Builder - 2-column layout (Options Page Builder reference) */
.wpps-bf-editor-layout {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 24px;
}

.wpps-bf-fields-column { min-width: 0; width: 100%; }
.wpps-bf-quickadd-column { position: sticky; top: 32px; align-self: start; }
.wpps-bf-quickadd-panel { position: sticky; top: 32px; }

.wpps-bf-panel-desc {
	margin: 0 0 16px;
	font-size: 0.875rem;
	color: var(--wpps-bf-gray);
}

.wpps-bf-card-panel {
	background: var(--wpps-bf-white);
	border: 1px solid var(--wpps-bf-border);
	box-shadow: var(--wpps-bf-shadow);
	padding: 0;
	width: 100%;
	box-sizing: border-box;
}

/* Form Editor Page */
.wpps-bf-editor-page .wpps-page-hero__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

.wpps-bf-editor-page .wpps-page-hero__meta .button {
	margin: 0;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.wpps-bf-editor-page .wpps-page-hero__meta .button .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 16px;
}

.wpps-bf-editor-page .wpps-page-hero__meta .wpps-bf-ai-btn .wpps-bf-ai-icon,
.wpps-bf-editor-page .wpps-page-hero__meta #wpps-bf-open-design .dashicons {
	color: inherit;
}

.wpps-bf-editor-form { width: 100%; margin-top: 0; }
.wpps-bf-editor-main {
	display: grid;
	grid-template-columns: 1fr 340px;
	gap: 24px;
	align-items: start;
}
.wpps-bf-editor-content { min-width: 0; }
.wpps-bf-editor-sidebar { position: sticky; top: 32px; }
.wpps-bf-editor-section { margin-bottom: 24px; }
.wpps-bf-editor-section:last-child { margin-bottom: 0; }
.wpps-bf-sidebar-panel { margin-bottom: 24px; }
.wpps-bf-sidebar-panel:last-child { margin-bottom: 0; }
.wpps-bf-editor-panel .wpps-bf-panel-body { padding-top: 0; }

/* Quick Add - 2-column grid */
.wpps-bf-quick-add-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.wpps-bf-quick-add-note {
	margin: 0 0 12px;
}

.wpps-bf-quick-add-btn {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	min-width: 0;
	min-height: 42px;
	padding: 10px 12px;
	background: var(--wpps-bf-surface);
	border: 1px solid var(--wpps-bf-border);
	border-radius: 2px;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--wpps-bf-black);
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s, color 0.2s;
	text-align: left;
	box-sizing: border-box;
}

.wpps-bf-quick-add-btn:hover {
	background: var(--wpps-bf-accent-bg);
	border-color: var(--wpps-bf-accent);
	color: var(--wpps-bf-accent-hover);
}

.wpps-bf-quick-add-btn svg {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	color: var(--wpps-bf-muted);
}

.wpps-bf-quick-add-btn:hover svg { color: var(--wpps-bf-accent); }

.wpps-bf-quick-add-group {
	grid-column: 1 / -1;
	flex-direction: row;
	justify-content: flex-start;
	padding: 12px 12px !important;
	background: var(--wpps-bf-accent-bg) !important;
	border: 2px dashed var(--wpps-bf-accent-border) !important;
}

.wpps-bf-quick-add-group:hover {
	background: var(--wpps-bf-border) !important;
	border-color: var(--wpps-bf-accent) !important;
	border-style: solid !important;
}

.wpps-bf-quick-add-group svg { color: var(--wpps-bf-accent) !important; }
.wpps-bf-quick-add-group .wpps-bf-quick-add-label { font-weight: 600 !important; color: var(--wpps-bf-accent-hover) !important; }

.wpps-bf-quick-add-group.wpps-bf-quick-add-btn--locked,
.wpps-bf-quick-add-separator.wpps-bf-quick-add-btn--locked {
	background: var(--wpps-bf-surface) !important;
	border: 1px solid var(--wpps-bf-border) !important;
	border-style: solid !important;
}

.wpps-bf-quick-add-group.wpps-bf-quick-add-btn--locked .wpps-bf-quick-add-label,
.wpps-bf-quick-add-separator.wpps-bf-quick-add-btn--locked .wpps-bf-quick-add-label {
	font-weight: 500 !important;
	color: var(--wpps-bf-black) !important;
}

.wpps-bf-quick-add-group.wpps-bf-quick-add-btn--locked svg,
.wpps-bf-quick-add-separator.wpps-bf-quick-add-btn--locked svg {
	color: var(--wpps-bf-muted) !important;
}

.wpps-bf-quick-add-btn--locked:hover,
.wpps-bf-quick-add-btn--locked:focus,
.wpps-bf-quick-add-btn--locked:focus-visible {
	background: #f6f7f7 !important;
	border-color: #8c8f94 !important;
	color: #1d2327 !important;
}

.wpps-bf-quick-add-btn--locked:hover svg,
.wpps-bf-quick-add-btn--locked:focus svg,
.wpps-bf-quick-add-btn--locked:focus-visible svg {
	color: #787c82 !important;
}

.wpps-bf-quick-add-group.wpps-bf-quick-add-btn--locked:hover,
.wpps-bf-quick-add-group.wpps-bf-quick-add-btn--locked:focus,
.wpps-bf-quick-add-group.wpps-bf-quick-add-btn--locked:focus-visible,
.wpps-bf-quick-add-separator.wpps-bf-quick-add-btn--locked:hover,
.wpps-bf-quick-add-separator.wpps-bf-quick-add-btn--locked:focus,
.wpps-bf-quick-add-separator.wpps-bf-quick-add-btn--locked:focus-visible {
	background: #f6f7f7 !important;
	border-color: #8c8f94 !important;
	border-style: solid !important;
}

.wpps-bf-quick-add-group.wpps-bf-quick-add-btn--locked:hover .wpps-bf-quick-add-label,
.wpps-bf-quick-add-group.wpps-bf-quick-add-btn--locked:focus .wpps-bf-quick-add-label,
.wpps-bf-quick-add-separator.wpps-bf-quick-add-btn--locked:hover .wpps-bf-quick-add-label,
.wpps-bf-quick-add-separator.wpps-bf-quick-add-btn--locked:focus .wpps-bf-quick-add-label {
	font-weight: 500 !important;
	color: #1d2327 !important;
}

.wpps-bf-quick-add-separator {
	grid-column: 1 / -1;
	border-style: dashed;
}

/* Fields list */
.wpps-bf-fields-list {
	min-height: 120px;
	padding: 12px;
	background: var(--wpps-bf-surface);
	border: 2px dashed var(--wpps-bf-border);
	border-radius: 2px;
}

.wpps-bf-fields-list:empty::after {
	content: attr(data-placeholder);
	display: block;
	padding: 32px;
	text-align: center;
	color: var(--wpps-bf-muted);
	font-size: 0.875rem;
}

.wpps-bf-field-palette { margin-bottom: 20px; }
.wpps-bf-palette-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
/* Field Item - Options Page Builder style */
.wpps-bf-form-field-item {
	background: var(--wpps-bf-white);
	border: 1px solid var(--wpps-bf-border);
	border-radius: 2px;
	margin-bottom: 12px;
	overflow: hidden;
	transition: border-color 0.2s, box-shadow 0.2s;
}
.wpps-bf-form-field-item:hover {
	box-shadow: 0 1px 2px 0 rgba(0,0,0,.05);
}
.wpps-bf-field-header {
	display: flex;
	align-items: center;
	padding: 12px 16px;
	background: var(--wpps-bf-surface);
	cursor: pointer;
	transition: background 0.2s;
	gap: 12px;
}
.wpps-bf-field-header:hover { background: var(--wpps-bf-surface); }
.wpps-bf-field-title {
	flex: 1;
	font-weight: 600;
	font-size: 0.9375rem;
	color: var(--wpps-bf-black);
	min-width: 0;
}
.wpps-bf-field-header .wpps-bf-required { color: var(--wpps-bf-danger); margin-left: 2px; }
.wpps-bf-field-type {
	font-size: 0.75rem;
	color: var(--wpps-bf-muted);
	background: #e5e7eb;
	padding: 4px 10px;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	flex-shrink: 0;
}
.wpps-bf-field-id-badge {
	font-size: 0.7rem;
	color: #64748b;
	background: #f1f5f9;
	padding: 2px 8px;
	border-radius: 4px;
	font-family: ui-monospace, monospace;
	flex-shrink: 0;
	max-width: 120px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.wpps-bf-field-actions {
	display: flex;
	gap: 6px;
	flex-shrink: 0;
}
.wpps-bf-field-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	background: var(--wpps-bf-white);
	border: 1px solid var(--wpps-bf-accent-border);
	border-radius: 4px;
	cursor: pointer;
	color: var(--wpps-bf-muted);
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.wpps-bf-field-btn:hover {
	background: var(--wpps-bf-accent-bg);
	color: var(--wpps-bf-accent);
	border-color: var(--wpps-bf-accent);
}
.wpps-bf-field-btn .dashicons { font-size: 18px; width: 18px; height: 18px; }
.wpps-bf-field-btn.delete-field:hover { color: var(--wpps-bf-danger); border-color: var(--wpps-bf-danger); background: var(--wpps-bf-danger-bg); }
.wpps-bf-field-body {
	padding: 20px;
	border-top: 1px solid var(--wpps-bf-border);
}
.wpps-bf-form-field-item.collapsed .wpps-bf-field-body { display: none; }
.wpps-bf-field-body p { margin: 0 0 16px; }
.wpps-bf-field-body p:last-child { margin-bottom: 0; }
/* Drag handle and sortable (like Options Page Builder) */
.wpps-bf-field-drag { cursor: move; color: var(--wpps-bf-muted); padding: 4px; margin-right: 4px; flex-shrink: 0; }
.wpps-bf-field-drag:hover { color: var(--wpps-bf-accent); }
.wpps-bf-field-drag .dashicons { font-size: 18px; width: 18px; height: 18px; }
.wpps-bf-form-field-item.ui-sortable-helper { box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.wpps-bf-field-placeholder { border: 2px dashed var(--wpps-bf-accent-border); background: var(--wpps-bf-accent-bg); margin-bottom: 12px; min-height: 52px; border-radius: 2px; }
.wpps-bf-field-id-width { display: flex; gap: 16px; margin-bottom: 16px; }
.wpps-bf-field-id-width p:first-child { flex: 7 0 0; margin: 0; min-width: 0; }
.wpps-bf-field-id-width p:last-child { flex: 3 0 0; margin: 0; min-width: 0; }
.wpps-bf-required-inline-row { margin-bottom: 16px; }
.wpps-bf-required-inline-row .field-cols { width: auto; min-width: 60px; }
.wpps-bf-field-body label { display: block; margin-bottom: 6px; font-size: 0.875rem; font-weight: 500; }
.wpps-bf-field-body input[type="text"],
.wpps-bf-field-body input[type="number"],
.wpps-bf-field-body input[type="email"],
.wpps-bf-field-body select,
.wpps-bf-field-body textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--wpps-bf-border); border-radius: 2px; font-size: 0.875rem; box-sizing: border-box; }
/* Keep single-line inputs and the Width select the same height. */
.wpps-bf-field-body input[type="text"],
.wpps-bf-field-body input[type="number"],
.wpps-bf-field-body input[type="email"],
.wpps-bf-field-body select { height: 38px; min-height: 38px; line-height: 1.4; }
.wpps-bf-field-body textarea { height: auto; min-height: 80px; line-height: 1.5; }
/* Field ID is auto-generated and read-only. */
.wpps-bf-field-body input.field-field-id[readonly] { background: var(--wpps-bf-accent-bg, #f6f7f7); color: var(--wpps-bf-gray, #646970); cursor: default; }
.row-actions { font-size: 12px; color: var(--wpps-bf-gray); }
.row-actions a { color: var(--wpps-bf-accent); }
@media (max-width: 1024px) {
	.wpps-bf-editor-layout { grid-template-columns: 1fr; }
	.wpps-bf-quickadd-column { position: static; }
	.wpps-bf-quickadd-panel { position: static; }
}

/* Form Editor Page - legacy header removed; PageHero used instead */
.wpps-bf-input {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--wpps-bf-border);
	border-radius: 2px;
	font-size: 0.875rem;
	box-sizing: border-box;
	min-height: 40px;
}
.wpps-bf-input:focus {
	outline: none;
	border-color: var(--wpps-bf-accent);
	box-shadow: 0 0 0 1px var(--wpps-bf-accent);
}
.wpps-bf-form-group { margin-bottom: 20px; }
.wpps-bf-form-group:last-child { margin-bottom: 0; }
.wpps-bf-form-group label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--wpps-bf-black);
}
.wpps-bf-form-group textarea.wpps-bf-input { min-height: 80px; }
.wpps-bf-help { display: block; margin-top: 6px; font-size: 0.75rem; color: var(--wpps-bf-muted); }
.wpps-bf-checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 400; }
.wpps-bf-checkbox-label input { margin: 0; }
.wpps-bf-autoreply-settings { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--wpps-bf-border); }
/* Color field: login customizer style (circle + hex + reset) */
.wpps-color-field-row { display: inline-flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.wpps-color-picker-circle { width: 40px !important; height: 40px !important; min-width: 40px; min-height: 40px; flex-shrink: 0; border-radius: 50% !important; border: 2px solid var(--wpps-bf-divider) !important; padding: 0 !important; cursor: pointer; -webkit-appearance: none !important; -moz-appearance: none !important; appearance: none !important; overflow: hidden; }
.wpps-color-picker-circle::-webkit-color-swatch-wrapper { padding: 0 !important; margin: 0 !important; border: none !important; border-radius: 50% !important; }
.wpps-color-picker-circle::-webkit-color-swatch { border: none !important; border-radius: 50% !important; width: 100% !important; height: 100% !important; }
.wpps-color-picker-circle::-moz-color-swatch { border: none !important; border-radius: 50% !important; width: 100% !important; height: 100% !important; }
.wpps-color-code-wrap { display: inline-block; position: relative; margin: 0; flex-shrink: 0; }
.wpps-color-code-wrap .wpps-color-reset { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); padding: 0; margin: 0; background: none; border: none; cursor: pointer; color: var(--wpps-bf-gray); }
.wpps-color-code-wrap .wpps-color-reset:hover { color: var(--wpps-bf-accent); }
.wpps-color-code-wrap .wpps-color-reset .dashicons { font-size: 16px; width: 16px; height: 16px; }
/* Typography (reuse login customizer styles) */
.wpps-typography-wrap { position: relative; display: inline-flex; align-items: center; gap: 6px; overflow: visible; }
.wpps-typography-reset { background: none; border: none; padding: 4px; margin-left: 0; margin-right: 2px; cursor: pointer; color: var(--wpps-bf-accent); vertical-align: middle; display: inline-flex; align-items: center; justify-content: center; }
.wpps-typography-reset:hover { color: var(--wpps-bf-accent-hover); }
.wpps-typography-reset .dashicons { font-size: 16px; width: 16px; height: 16px; }
.wpps-reset-hidden { display: none !important; }
.wpps-typography-toggle { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; background: var(--wpps-bf-accent); border: 1px solid var(--wpps-bf-accent); border-radius: 4px; cursor: pointer; color: var(--wpps-bf-white); }
.wpps-typography-toggle:hover { background: var(--wpps-bf-accent-hover); border-color: var(--wpps-bf-accent-hover); color: var(--wpps-bf-white); }
.wpps-typography-icon { font-size: 18px; width: 18px; height: 18px; display: inline-block; color: var(--wpps-bf-white); }
.wpps-typography-popover { position: absolute; left: 0; top: 100%; margin-top: 8px; width: 340px; max-height: min(70vh, 420px); overflow-y: auto; padding: 12px; background: var(--wpps-bf-white); border: 1px solid var(--wpps-bf-divider); border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 100110; }
/* Form Design Modal: typography popover floats above modal (position fixed to escape overflow) */
#wpps-bf-design-modal .wpps-typography-popover { position: fixed; z-index: 100200; left: auto; top: auto; margin: 0; }
.wpps-typography-popover-title { font-weight: 600; font-size: 13px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--wpps-bf-divider); }
.wpps-typography-row { margin-bottom: 12px; }
.wpps-typography-row label,
.wpps-typography-row-label { display: block; font-size: 12px; margin-bottom: 4px; }
.wpps-typography-row select { width: 100%; margin: 0; }
.wpps-typography-responsive-row { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; margin-bottom: 12px; }
.wpps-typography-responsive-row > label { flex: 0 0 auto; min-width: 88px; font-size: 12px; margin: 0; }
.wpps-typography-responsive-row .wpps-device-icons-wrapper { flex: 0 0 auto; }
.wpps-typography-responsive-row .wpps-typography-font-size-inputs,
.wpps-typography-responsive-row .wpps-typography-line-height-inputs,
.wpps-typography-responsive-row .wpps-typography-letter-spacing-inputs { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; }
.wpps-typography-responsive-row .wpps-input-unit-row { flex-shrink: 0; }
.wpps-typography-responsive-row .wpps-input-unit-row input.small-text { width: 56px; min-width: 56px; }
.wpps-device-icons-wrapper { display: flex; }
.wpps-device-icons { display: flex; gap: 4px; }
.wpps-device-icon { padding: 6px; border: 1px solid var(--wpps-bf-divider); background: var(--wpps-bf-surface); border-radius: 4px; cursor: pointer; color: var(--wpps-bf-muted); }
.wpps-device-icon.is-active { background: var(--wpps-bf-accent); border-color: var(--wpps-bf-accent); color: var(--wpps-bf-white); }
.wpps-device-icon .dashicons { font-size: 16px; width: 16px; height: 16px; }
/* Form Design Modal: device icons match Login Page Customizer (vertical stacked, circular) */
#wpps-bf-design-modal .wpps-device-icons-wrapper { display: inline-block; position: relative; margin-left: 6px; vertical-align: middle; }
#wpps-bf-design-modal .wpps-device-icons-wrapper:hover { padding-top: 38px; margin-top: -38px; }
#wpps-bf-design-modal .wpps-device-icons { position: relative; width: 18px; height: 18px; display: block; }
#wpps-bf-design-modal .wpps-device-icon { position: absolute; left: 0; bottom: 0; display: flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; background: var(--wpps-bf-white); border: 1px solid var(--wpps-bf-gray); border-radius: 50%; cursor: pointer; color: var(--wpps-bf-black); z-index: 1; }
#wpps-bf-design-modal .wpps-device-icon:hover { background: var(--wpps-bf-surface); border-color: var(--wpps-bf-gray); color: var(--wpps-bf-black); }
#wpps-bf-design-modal .wpps-device-icon.is-active { background: var(--wpps-bf-accent); border-color: var(--wpps-bf-accent); color: var(--wpps-bf-white); opacity: 1; pointer-events: auto; bottom: 0 !important; left: 0 !important; margin-bottom: 0 !important; }
#wpps-bf-design-modal .wpps-device-icon .dashicons { font-size: 10px; width: 10px; height: 10px; }
#wpps-bf-design-modal .wpps-device-icon:not(.is-active) { bottom: 100%; left: auto; right: 0; margin-bottom: 2px; opacity: 0; pointer-events: none; z-index: 2; }
#wpps-bf-design-modal .wpps-device-icon:not(.is-active) ~ .wpps-device-icon:not(.is-active) { margin-bottom: 22px; }
#wpps-bf-design-modal .wpps-device-icons-wrapper:hover .wpps-device-icon { opacity: 1; pointer-events: auto; }
.wpps-style-color-typo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Form Design Modal */
#wpps-bf-design-modal { display: none; align-items: center; justify-content: center; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100100; }
#wpps-bf-design-modal.show { display: flex; }
.wpps-bf-design-modal-container { background: var(--wpps-bf-white); width: 90%; max-width: 720px; max-height: 90vh; display: flex; flex-direction: column; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,.25); overflow: hidden; }
.wpps-bf-design-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--wpps-bf-border); flex-shrink: 0; }
.wpps-bf-design-modal-header h2 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.wpps-bf-design-modal-actions { display: flex; align-items: center; gap: 12px; }
.wpps-bf-btn-link { background: none; border: none; color: var(--wpps-bf-accent); cursor: pointer; font-size: 13px; padding: 0; text-decoration: underline; }
.wpps-bf-btn-link:hover { color: var(--wpps-bf-accent-hover); }
.wpps-bf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0 16px;
	min-height: 36px;
	line-height: 1;
	border-radius: 2px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	border: none;
	text-decoration: none;
	box-sizing: border-box;
}
.wpps-bf-btn-primary { background: var(--wpps-bf-accent); border: 1px solid var(--wpps-bf-accent); color: var(--wpps-bf-white); }
.wpps-bf-btn-primary:hover { background: var(--wpps-bf-accent-hover); border-color: var(--wpps-bf-accent-hover); color: var(--wpps-bf-white); }
.wpps-bf-btn-secondary { background: transparent; border: 1px solid var(--wpps-bf-border); color: var(--wpps-bf-black); }
.wpps-bf-btn-secondary:hover { background: var(--wpps-bf-bg); border-color: var(--wpps-bf-gray); color: var(--wpps-bf-black); }
.wpps-bf-design-modal-close { background: none; border: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--wpps-bf-gray); padding: 0; }
.wpps-bf-design-modal-close:hover { color: var(--wpps-bf-black); }
.wpps-bf-design-modal-body { overflow-y: auto; padding: 0; flex: 1; min-height: 0; }
.wpps-bf-design-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 16px 24px 0; border-bottom: 1px solid var(--wpps-bf-border); background: var(--wpps-bf-bg); }
.wpps-bf-design-tab { padding: 10px 16px; background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; font-size: 0.875rem; font-weight: 500; color: var(--wpps-bf-muted); margin-bottom: -1px; }
.wpps-bf-design-tab:hover { color: var(--wpps-bf-black); }
.wpps-bf-design-tab.is-active { color: var(--wpps-bf-accent); border-bottom-color: var(--wpps-bf-accent); }
.wpps-bf-design-form { padding: 24px; }
.wpps-bf-design-panel { display: none; }
.wpps-bf-design-panel.is-active { display: block; }
.wpps-bf-design-panel h3 { margin: 0 0 20px; font-size: 1rem; font-weight: 600; color: var(--wpps-bf-black); }
.wpps-bf-design-row { margin-bottom: 16px; }
.wpps-bf-design-row:last-child { margin-bottom: 0; }
.wpps-bf-design-row label,
.wpps-bf-design-row-label { display: block; margin-bottom: 6px; font-size: 0.875rem; font-weight: 500; color: var(--wpps-bf-black); }
.wpps-bf-design-row .wpps-bf-input { width: 100%; max-width: 280px; }
.wpps-bf-design-row .wpps-bf-design-custom-css { max-width: none; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 13px; line-height: 1.5; min-height: 220px; }
.wpps-bf-design-row .description { margin-top: 6px; font-size: 12px; color: var(--wpps-bf-gray); }
.wpps-bf-design-modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--wpps-bf-border); background: var(--wpps-bf-bg); flex-shrink: 0; }
.wpps-bf-design-modal-footer .wpps-bf-btn-sm { min-height: 32px; padding: 0 12px; font-size: 12px; }
.wpps-bf-shortcode-wrap { position: relative; display: flex; align-items: center; gap: 8px; }
.wpps-bf-shortcode-wrap .wpps-bf-input { flex: 1; min-width: 0; }
.wpps-bf-copy-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; background: var(--wpps-bf-surface); border: 1px solid var(--wpps-bf-border); border-radius: 4px; cursor: pointer; color: var(--wpps-bf-muted); flex-shrink: 0; }
.wpps-bf-copy-btn:hover { background: var(--wpps-bf-accent); color: var(--wpps-bf-white); border-color: var(--wpps-bf-accent); }
.wpps-bf-copy-btn .dashicons { font-size: 20px; width: 20px; height: 20px; }
.wpps-bf-shortcode-input { font-family: ui-monospace, monospace; font-size: 13px; cursor: pointer; }
@keyframes wpps-bf-spin { to { transform: rotate(360deg); } }
.wpps-bf-btn-loader .spin,
.wpps-bf-apply-loader .spin { animation: wpps-bf-spin 0.8s linear infinite; display: inline-block; }
.wpps-bf-muted { color: var(--wpps-bf-muted); font-size: 0.875rem; margin: 0; }
.wpps-bf-settings-form .wpps-bf-form-group { margin-bottom: 20px; }
.wpps-bf-settings-form .wpps-bf-form-group:last-child { margin-bottom: 0; }

.wpps-bf-template-tabs {
	margin-top: 4px;
}

.wpps-bf-template-tabs__nav {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 14px;
	padding-bottom: 0;
	border-bottom: 1px solid var(--wpps-bf-border);
}

.wpps-bf-template-tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 -1px;
	padding: 8px 12px;
	background: transparent;
	border: 1px solid transparent;
	border-bottom: none;
	border-radius: 4px 4px 0 0;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--wpps-bf-muted);
	cursor: pointer;
}

.wpps-bf-template-tab .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
}

.wpps-bf-template-tab:hover {
	color: var(--wpps-bf-black);
}

.wpps-bf-template-tab.is-active {
	background: var(--wpps-bf-white);
	border-color: var(--wpps-bf-border);
	border-bottom-color: var(--wpps-bf-white);
	color: var(--wpps-bf-accent);
}

.wpps-bf-template-panel {
	margin: 0;
	padding: 14px 0 0;
}

.wpps-bf-template-panel__desc {
	margin: 0 0 12px;
	font-size: 0.8125rem;
	color: var(--wpps-bf-muted);
	line-height: 1.4;
}

.wpps-bf-template-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
}

.wpps-bf-template-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px 12px 10px;
	background: var(--wpps-bf-white);
	border: 1px solid var(--wpps-bf-border);
	border-radius: 4px;
	box-shadow: var(--wpps-bf-shadow);
	text-decoration: none;
	color: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	min-height: 0;
}

.wpps-bf-template-card--blank {
	border-style: dashed;
	background: var(--wpps-bf-bg);
}

.wpps-bf-template-card:hover,
.wpps-bf-template-card:focus {
	border-color: var(--wpps-bf-accent);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
	color: inherit;
}

.wpps-bf-template-card__icon {
	width: 20px;
	height: 20px;
	font-size: 20px;
	color: var(--wpps-bf-accent);
}

.wpps-bf-template-card__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
}

.wpps-bf-template-card__title {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--wpps-bf-black);
	line-height: 1.3;
}

.wpps-bf-template-card__desc {
	font-size: 0.75rem;
	color: var(--wpps-bf-muted);
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wpps-bf-template-card__meta {
	font-size: 0.6875rem;
	font-weight: 500;
	color: var(--wpps-bf-gray);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.wpps-bf-template-card__action {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	padding: 2px 8px;
	font-size: 0.6875rem;
	font-weight: 600;
	color: var(--wpps-bf-accent);
	background: var(--wpps-bf-accent-bg);
	border: 1px solid var(--wpps-bf-accent-border);
	border-radius: 999px;
}

.wpps-bf-ai-builder-promo {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 0 0 16px;
	padding: 14px 16px;
	background: linear-gradient(135deg, rgba(34, 113, 177, 0.08), rgba(34, 113, 177, 0.02));
	border: 1px solid var(--wpps-bf-border);
	border-radius: 6px;
}

.wpps-bf-ai-builder-promo__content {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	min-width: 0;
}

.wpps-bf-ai-builder-promo__icon {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	color: var(--wpps-bf-accent);
}

.wpps-bf-ai-builder-promo__title {
	margin: 0 0 4px;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--wpps-bf-black);
}

.wpps-bf-ai-builder-promo__desc {
	margin: 0;
	font-size: 0.8125rem;
	color: var(--wpps-bf-muted);
	line-height: 1.45;
}

.wpps-bf-fields-toolbar {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.wpps-bf-fields-toolbar .wpps-bf-panel-desc {
	margin: 0;
	flex: 1;
	min-width: 0;
}

.wpps-bf-ai-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	color: var(--wpps-bf-accent);
	vertical-align: middle;
}

.wpps-bf-ai-icon svg {
	display: block;
}

/* Inside buttons the icon should match the button text color (e.g. white on a
   primary button), not the standalone accent color. */
.button .wpps-bf-ai-icon,
.wpps-bf-ai-btn .wpps-bf-ai-icon {
	color: inherit;
}

.wpps-bf-ai-icon--lg {
	width: 28px;
	height: 28px;
}

.wpps-bf-ai-icon--lg svg {
	width: 24px;
	height: 24px;
}

.wpps-bf-ai-btn {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex-shrink: 0;
	height: auto;
	line-height: 1.4;
	padding: 4px 10px;
	white-space: nowrap;
}

.wpps-bf-modal-header h2 .wpps-bf-ai-icon {
	margin-right: 6px;
	vertical-align: -3px;
}

.wpps-bf-ai-chat {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 100001;
	font-size: 13px;
}

.wpps-bf-ai-chat-launcher {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border: 1px solid var(--wpps-bf-accent-border, rgba(34, 113, 177, 0.35));
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	cursor: pointer;
	color: var(--wpps-bf-black);
}

.wpps-bf-ai-chat-launcher:hover {
	border-color: var(--wpps-bf-accent);
	color: var(--wpps-bf-accent);
}

.wpps-bf-ai-chat-launcher__icon {
	width: 18px;
	height: 18px;
}

.wpps-bf-ai-chat-launcher__label {
	font-weight: 600;
	line-height: 1.2;
}

.wpps-bf-ai-chat.is-open .wpps-bf-ai-chat-launcher {
	display: none;
}

.wpps-bf-ai-chat-panel {
	display: flex;
	flex-direction: column;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: min(560px, calc(100vh - 48px));
	background: #fff;
	border: 1px solid var(--wpps-bf-border);
	border-radius: 12px;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.16);
	overflow: hidden;
}

.wpps-bf-ai-chat-panel[hidden] {
	display: none !important;
}

.wpps-bf-ai-chat-panel__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--wpps-bf-border);
	background: linear-gradient(135deg, rgba(34, 113, 177, 0.08), rgba(34, 113, 177, 0.02));
}

.wpps-bf-ai-chat-panel__title-wrap {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	min-width: 0;
}

.wpps-bf-ai-chat-panel__title-wrap h2 {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.3;
}

.wpps-bf-ai-chat-panel__meta {
	margin: 2px 0 0;
	font-size: 0.75rem;
	color: var(--wpps-bf-muted);
}

.wpps-bf-ai-chat-panel__actions {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.wpps-bf-ai-chat-panel__actions .button-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	min-height: 0;
	border-radius: 6px;
	color: var(--wpps-bf-muted);
	text-decoration: none;
	box-shadow: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.wpps-bf-ai-chat-panel__actions .button-link .dashicons {
	width: 18px;
	height: 18px;
	font-size: 18px;
	line-height: 1;
}

.wpps-bf-ai-chat-panel__actions .button-link:hover,
.wpps-bf-ai-chat-panel__actions .button-link:focus {
	background: rgba(34, 113, 177, 0.1);
	color: var(--wpps-bf-accent);
	text-decoration: none;
	box-shadow: none;
	outline: none;
}

.wpps-bf-ai-chat-panel__actions .button-link:focus-visible {
	box-shadow: 0 0 0 2px var(--wpps-bf-accent);
}

.wpps-bf-ai-chat-panel__actions .wpps-bf-ai-chat-clear:hover,
.wpps-bf-ai-chat-panel__actions .wpps-bf-ai-chat-clear:focus {
	background: rgba(214, 54, 56, 0.12);
	color: #d63638;
}

.wpps-bf-ai-chat-panel__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	padding: 12px 16px 0;
}

.wpps-bf-ai-chat__notice {
	margin: 0 0 12px;
}

.wpps-bf-ai-chat-messages {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 4px 0 12px;
}

.wpps-bf-ai-chat-message__label {
	margin-bottom: 4px;
	font-size: 0.6875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--wpps-bf-gray);
}

.wpps-bf-ai-chat-message.is-user .wpps-bf-ai-chat-message__label {
	text-align: right;
}

.wpps-bf-ai-chat-message__bubble {
	max-width: 92%;
	padding: 10px 12px;
	border-radius: 12px;
	line-height: 1.45;
	word-break: break-word;
}

.wpps-bf-ai-chat-message.is-assistant .wpps-bf-ai-chat-message__bubble {
	background: var(--wpps-bf-bg, #f6f7f7);
	border: 1px solid var(--wpps-bf-border);
	color: var(--wpps-bf-black);
}

.wpps-bf-ai-chat-message.is-error .wpps-bf-ai-chat-message__bubble {
	background: #fcf0f1;
	border-color: #f1aeb5;
	color: #8a2424;
}

.wpps-bf-ai-chat-message.is-notice .wpps-bf-ai-chat-message__bubble {
	background: #fcf9e8;
	border-color: #f0e6a6;
	color: #7a5c00;
}

.wpps-bf-ai-chat-retry {
	margin-top: 6px;
}

.wpps-bf-ai-chat-message.is-user {
	align-items: flex-end;
}

.wpps-bf-ai-chat-message.is-user .wpps-bf-ai-chat-message__bubble {
	margin-left: auto;
	background: var(--wpps-bf-accent, #2271b1);
	border: 1px solid var(--wpps-bf-accent, #2271b1);
	color: #fff;
}

.wpps-bf-ai-chat-typing {
	color: var(--wpps-bf-muted);
	font-style: italic;
}

.wpps-bf-ai-chat-examples {
	margin-bottom: 8px;
}

.wpps-bf-ai-chat-examples__label {
	display: block;
	margin-bottom: 8px;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--wpps-bf-gray);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.wpps-bf-ai-chat-examples__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wpps-bf-ai-example {
	display: inline-block;
	max-width: 100%;
	padding: 6px 10px;
	background: var(--wpps-bf-bg);
	border: 1px solid var(--wpps-bf-border);
	border-radius: 999px;
	font-size: 0.75rem;
	line-height: 1.35;
	color: var(--wpps-bf-black);
	cursor: pointer;
	text-align: left;
}

.wpps-bf-ai-example:hover:not(:disabled) {
	border-color: var(--wpps-bf-accent);
	color: var(--wpps-bf-accent);
}

.wpps-bf-ai-chat-panel__composer {
	padding: 12px 16px 16px;
	border-top: 1px solid var(--wpps-bf-border);
	background: #fff;
}

.wpps-bf-ai-chat__input {
	width: 100%;
	min-height: 56px;
	max-height: 140px;
	resize: vertical;
	margin-bottom: 8px;
	box-sizing: border-box;
}

.wpps-bf-ai-chat__composer-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.wpps-bf-ai-chat__char-count {
	margin: 0;
}

.wpps-bf-ai-send__loader {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.wpps-bf-ai-send__loader[hidden] {
	display: none;
}

.wpps-bf-ai-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.45);
	border-top-color: #fff;
	border-radius: 50%;
	box-sizing: border-box;
	animation: wpps-bf-spin 0.7s linear infinite;
}

/* Conditional visibility panel — matches standard field-row design. */
.wpps-bf-conditional-settings {
	margin-top: 4px;
	border: 1px solid var(--wpps-bf-border, #dcdcde);
	border-radius: 4px;
	background: var(--wpps-bf-subtle-bg, #f6f7f7);
}

.wpps-bf-conditional-toggle {
	cursor: pointer;
	font-weight: 600;
	font-size: 0.875rem;
	padding: 10px 12px;
	margin: 0 !important;
	display: flex !important;
	align-items: center;
	gap: 6px;
	user-select: none;
}

.wpps-bf-conditional-toggle input[type="checkbox"] {
	margin: 0;
}

.wpps-bf-conditional-toggle .dashicons {
	color: var(--wpps-bf-accent, #2271b1);
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.wpps-bf-conditional-settings.is-enabled .wpps-bf-conditional-toggle {
	border-bottom: 1px solid var(--wpps-bf-border, #dcdcde);
}

.wpps-bf-conditional-body {
	padding: 14px 12px;
}

.wpps-bf-conditional-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	align-items: start;
}

.wpps-bf-conditional-grid p {
	margin: 0 !important;
	min-width: 0;
}

.wpps-bf-conditional-grid label {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wpps-bf-conditional-grid .field-show-if-field,
.wpps-bf-conditional-grid .field-show-if-operator,
.wpps-bf-conditional-grid .field-show-if-value {
	width: 100%;
	height: auto;
	min-height: 38px;
	padding: 7px 10px;
	line-height: 1.4;
	box-sizing: border-box;
}

.wpps-bf-conditional-grid.is-value-hidden {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wpps-bf-conditional-grid .wpps-bf-conditional-value.is-hidden {
	display: none;
}

.wpps-bf-conditional-relation {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0 0 12px !important;
	font-size: 0.8125rem;
	color: var(--wpps-bf-muted, #646970);
}

.wpps-bf-conditional-relation .field-show-if-relation {
	height: 32px;
	min-height: 32px;
	padding: 4px 8px;
	font-weight: 600;
}

.wpps-bf-conditional-rules {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.wpps-bf-conditional-rule {
	display: flex;
	align-items: start;
	gap: 8px;
}

.wpps-bf-conditional-rule .wpps-bf-conditional-grid {
	flex: 1 1 auto;
	min-width: 0;
}

.wpps-bf-remove-condition {
	flex: 0 0 auto;
	margin-top: 22px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 1px solid var(--wpps-bf-border, #dcdcde);
	border-radius: 4px;
	background: #fff;
	color: var(--wpps-bf-muted, #646970);
	cursor: pointer;
	transition: color .15s ease, border-color .15s ease;
}

.wpps-bf-remove-condition:hover {
	color: #d63638;
	border-color: #d63638;
}

.wpps-bf-remove-condition .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.wpps-bf-add-condition {
	margin-top: 12px !important;
	display: inline-flex !important;
	align-items: center;
	gap: 4px;
}

.wpps-bf-add-condition .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.wpps-bf-conditional-settings .wpps-bf-help {
	display: block;
	margin: 10px 0 0;
	color: var(--wpps-bf-muted, #646970);
	font-size: 0.8125rem;
}

@media (max-width: 600px) {
	.wpps-bf-conditional-grid,
	.wpps-bf-conditional-grid.is-value-hidden {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 782px) {
	.wpps-bf-ai-builder-promo {
		flex-direction: column;
		align-items: stretch;
	}
	.wpps-bf-fields-toolbar {
		flex-direction: column;
		align-items: stretch;
	}
	.wpps-bf-ai-btn {
		align-self: flex-start;
	}
	.wpps-bf-ai-chat {
		right: 12px;
		bottom: 12px;
	}
	.wpps-bf-ai-chat-panel {
		width: calc(100vw - 24px);
		height: min(70vh, 560px);
	}
}

@media (max-width: 1024px) {
	.wpps-bf-editor-main { grid-template-columns: 1fr; }
	.wpps-bf-editor-sidebar { position: static; }
}

@media (max-width: 782px) {
	.wpps-bf-stats { grid-template-columns: 1fr 1fr; }
	.wpps-bf-layout-2col { grid-template-columns: 1fr; }
	.wpps-bf-quick-add-grid { grid-template-columns: 1fr; }
	.wpps-bf-editor-page .wpps-page-hero__meta { justify-content: flex-start; }
	.wpps-bf-template-tabs__nav { gap: 4px; }
	.wpps-bf-template-tab { padding: 7px 10px; font-size: 12px; }
	.wpps-bf-template-grid { grid-template-columns: 1fr 1fr; }
}

/* Premium / freemium locks — theme-aware badge (matches Code Snippet / WP admin color scheme) */
.wpps-bf-wrap .wpps-pro-badge {
	display: inline-block;
	vertical-align: middle;
	margin-left: 6px;
	padding: 2px 6px;
	font-size: 10px;
	font-weight: 600;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-radius: 3px;
	background: linear-gradient(
		135deg,
		var(--wpps-bf-theme, #2271b1) 0%,
		var(--wpps-bf-theme-dark, #135e96) 100%
	);
	color: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.wpps-bf-quick-add-btn--locked {
	cursor: pointer;
}

.wpps-bf-quick-add-label {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wpps-bf-quick-add-lock {
	position: absolute;
	top: 50%;
	right: 10px;
	transform: translateY(-50%);
	margin: 0;
	width: 16px;
	height: 16px;
	font-size: 16px;
	line-height: 16px;
	color: #787c82;
	pointer-events: none;
}

.wpps-bf-quick-add-btn--locked:hover .wpps-bf-quick-add-lock {
	color: #50575e;
}

.wpps-bf-field-premium-locked .wpps-bf-field-body {
	pointer-events: none;
	opacity: 0.72;
}

.wpps-bf-field-premium-locked .wpps-bf-field-actions,
.wpps-bf-field-premium-locked .wpps-bf-field-drag {
	pointer-events: auto;
	opacity: 1;
}

.wpps-bf-premium-locked-note {
	margin-top: 12px;
	padding: 10px 12px;
	background: color-mix(in srgb, var(--wp-admin-theme-color, #2271b1) 8%, #fff);
	border: 1px solid color-mix(in srgb, var(--wp-admin-theme-color, #2271b1) 25%, #c3c4c7);
	border-radius: 2px;
	color: #50575e;
}

.wpps-bf-design-btn--locked .wpps-pro-badge {
	margin-left: 8px;
}
