/* SoftPulse Builder editor — full-screen, modern UI. */
:root {
	--bvxe-bg: #f4f5f7;
	--bvxe-surface: #ffffff;
	--bvxe-border: #e3e5e8;
	--bvxe-text: #1d2327;
	--bvxe-muted: #6b7280;
	--bvxe-accent: #4f46e5;
	--bvxe-accent-soft: #eef2ff;
	--bvxe-danger: #dc2626;
	--bvxe-success: #16a34a;
	--bvxe-radius: 10px;
	--bvxe-top-h: 56px;
	--bvxe-panel-w: 320px;
}

/* Full-screen: WordPress admin chrome chhupao. */
body.bvx-editor-fullscreen { overflow: hidden; background: var(--bvxe-bg); }
body.bvx-editor-fullscreen #adminmenumain,
body.bvx-editor-fullscreen #wpadminbar,
body.bvx-editor-fullscreen #wpfooter,
body.bvx-editor-fullscreen .notice,
body.bvx-editor-fullscreen .update-nag,
body.bvx-editor-fullscreen #screen-meta-links { display: none !important; }
body.bvx-editor-fullscreen #wpcontent,
body.bvx-editor-fullscreen #wpbody-content { margin: 0 !important; padding: 0 !important; }
html.wp-toolbar { padding-top: 0 !important; }

.bvxe-app {
	position: fixed;
	inset: 0;
	z-index: 99990;
	display: flex;
	flex-direction: column;
	font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--bvxe-text);
	background: var(--bvxe-bg);
}
.bvxe-loading { margin: auto; color: var(--bvxe-muted); }
.bvxe-app *, .bvxe-app *::before, .bvxe-app *::after { box-sizing: border-box; }
.bvxe-app button { font: inherit; cursor: pointer; }

/* Top bar */
.bvxe-top {
	height: var(--bvxe-top-h);
	flex: 0 0 var(--bvxe-top-h);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 0 12px;
	background: var(--bvxe-surface);
	border-bottom: 1px solid var(--bvxe-border);
}
.bvxe-top-left, .bvxe-top-center, .bvxe-top-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bvxe-top-left { flex: 1; }
.bvxe-top-right { flex: 1; justify-content: flex-end; }
.bvxe-logo {
	border: 0; cursor: pointer;
	width: 36px; height: 36px; border-radius: 9px;
	display: grid; place-items: center;
	background: var(--bvxe-accent); color: #fff !important; text-decoration: none; font-size: 18px;
}
.bvxe-title {
	min-width: 0; width: 260px; max-width: 100%;
	border: 1px solid transparent !important; border-radius: 8px !important;
	background: transparent !important; font-weight: 600; font-size: 14px; padding: 6px 8px !important;
	box-shadow: none !important;
}
.bvxe-title:hover, .bvxe-title:focus { border-color: var(--bvxe-border) !important; background: #fff !important; }
.bvxe-type { color: var(--bvxe-muted); text-transform: capitalize; font-size: 12px; background: var(--bvxe-bg); padding: 2px 8px; border-radius: 99px; }
.bvxe-sep { width: 1px; height: 22px; background: var(--bvxe-border); margin: 0 4px; }
.bvxe-app.is-dirty [data-act="publish"]::after { content: " •"; }

.bvxe-icon-btn {
	width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--bvxe-text);
	display: inline-grid; place-items: center; font-size: 16px;
}
.bvxe-icon-btn:hover { background: var(--bvxe-bg); }
.bvxe-icon-btn.is-active { background: var(--bvxe-accent-soft); color: var(--bvxe-accent); }
.bvxe-icon-btn:disabled { opacity: .35; cursor: default; }

.bvxe-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--bvxe-border);
	background: #fff; color: var(--bvxe-text); font-weight: 600; text-decoration: none; white-space: nowrap;
}
.bvxe-btn:hover { border-color: #c9ccd1; color: var(--bvxe-text); }
.bvxe-btn-primary { background: var(--bvxe-accent); border-color: var(--bvxe-accent); color: #fff; }
.bvxe-btn-primary:hover { background: #4338ca; color: #fff; }
.bvxe-btn-ghost { background: transparent; }
.bvxe-btn-ai { background: linear-gradient(135deg, #7c3aed, #db2777); color: #fff; border: 0; }
.bvxe-btn-ai:hover { filter: brightness(1.08); color: #fff; }
.bvxe-btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.bvxe-btn:disabled { opacity: .6; cursor: wait; }
.bvxe-link { border: 0; background: none; color: var(--bvxe-muted); padding: 2px 4px; }
.bvxe-link:hover { color: var(--bvxe-text); }

/* Body */
.bvxe-body { flex: 1; display: flex; min-height: 0; }
.bvxe-panel {
	width: var(--bvxe-panel-w); flex: 0 0 var(--bvxe-panel-w);
	background: var(--bvxe-surface); border-right: 1px solid var(--bvxe-border);
	display: flex; flex-direction: column; min-height: 0;
}
.bvxe-panel-tabs { display: flex; border-bottom: 1px solid var(--bvxe-border); }
.bvxe-panel-tabs button {
	flex: 1; height: 44px; border: 0; background: none; font-weight: 600; color: var(--bvxe-muted);
	border-bottom: 2px solid transparent;
}
.bvxe-panel-tabs button.is-active { color: var(--bvxe-accent); border-bottom-color: var(--bvxe-accent); }
.bvxe-panel-tabs button:disabled { opacity: .4; cursor: default; }
.bvxe-panel-body { flex: 1; overflow-y: auto; padding: 14px; }

.bvxe-search { width: 100%; height: 36px; border-radius: 8px !important; margin-bottom: 8px; }
.bvxe-cat { margin: 16px 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--bvxe-muted); }
.bvxe-widget-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bvxe-widget-btn {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
	height: 78px; padding: 6px; border: 1px solid var(--bvxe-border); border-radius: var(--bvxe-radius);
	background: #fff; color: var(--bvxe-text); font-size: 11.5px; text-align: center; line-height: 1.2;
	cursor: grab; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.bvxe-widget-btn:hover { border-color: var(--bvxe-accent); box-shadow: 0 4px 14px rgba(79, 70, 229, .12); transform: translateY(-1px); }
.bvxe-widget-btn { position: relative; }
.bvxe-wicon { font-size: 20px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; }
/* Registry icons (Buildvex_Icons): fixed box, never stretched; legacy text symbols keep font-size above. */
.bvxe-wicon .bvxe-wsvg { width: 24px; height: 24px; display: block; flex: 0 0 auto; }
.bvxe-widget-name .bvxe-wsvg { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; }
.bvxe-wbadge { position: absolute; top: 4px; right: 4px; padding: 1px 5px; border-radius: 99px; background: var(--bvxe-accent-soft); color: var(--bvxe-accent); font-size: 8.5px; font-weight: 700; letter-spacing: .04em; line-height: 1.4; pointer-events: none; }
.bvxe-widget-btn.ui-draggable-dragging { width: 96px; box-shadow: 0 10px 30px rgba(0,0,0,.18); z-index: 100000; }
.bvxe-hint { color: var(--bvxe-muted); font-size: 12px; margin-top: 18px; }

/* Edit panel */
.bvxe-edit-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 14px; }
.bvxe-control-tabs { display: flex; gap: 4px; background: var(--bvxe-bg); padding: 4px; border-radius: 9px; margin-bottom: 14px; }
.bvxe-control-tabs button { flex: 1; border: 0; background: none; height: 30px; border-radius: 7px; font-weight: 600; color: var(--bvxe-muted); }
.bvxe-control-tabs button.is-active { background: #fff; color: var(--bvxe-text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.bvxe-field { margin-bottom: 14px; }
.bvxe-field > label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 12px; }
.bvxe-field--inline { display: flex; align-items: center; gap: 8px; }
.bvxe-field--inline > label { margin: 0; font-weight: 500; }
.bvxe-field input[type="text"], .bvxe-field input[type="url"], .bvxe-field input[type="number"],
.bvxe-field input[type="datetime-local"], .bvxe-field select, .bvxe-field textarea {
	width: 100%; max-width: none; border-radius: 8px !important; border-color: var(--bvxe-border) !important;
}
.bvxe-field textarea.is-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.bvxe-help { display: block; color: var(--bvxe-muted); margin-top: 4px; font-size: 11.5px; }
.bvxe-range { display: flex; align-items: center; gap: 8px; }
.bvxe-range input[type="range"] { flex: 1; accent-color: var(--bvxe-accent); }
.bvxe-range input[type="number"] { width: 72px !important; flex: 0 0 72px; }
.bvxe-color { display: flex; align-items: center; gap: 6px; }
.bvxe-color input[type="color"] { width: 36px; height: 32px; padding: 0; border: 1px solid var(--bvxe-border); border-radius: 8px; background: none; }
.bvxe-switch { appearance: none; -webkit-appearance: none; width: 36px !important; height: 20px !important; border-radius: 99px !important; background: #d1d5db !important; position: relative; border: 0 !important; margin: 0 !important; transition: background .2s; }
.bvxe-switch::before { content: "" !important; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; margin: 0 !important; }
.bvxe-switch:checked { background: var(--bvxe-accent) !important; }
.bvxe-switch:checked::before { transform: translateX(16px); }
.bvxe-image { border: 1px dashed var(--bvxe-border); border-radius: var(--bvxe-radius); padding: 8px; }
.bvxe-image img { display: block; width: 100%; max-height: 140px; object-fit: contain; border-radius: 6px; background: var(--bvxe-bg); }
.bvxe-image-empty { height: 80px; display: grid; place-items: center; color: var(--bvxe-muted); background: var(--bvxe-bg); border-radius: 6px; }
.bvxe-image-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.bvxe-structures { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.bvxe-structure { display: flex; gap: 3px; width: 72px; height: 40px; padding: 5px; border: 1px solid var(--bvxe-border); border-radius: 8px; background: #fff; }
.bvxe-structure span { background: #c7cbe0; border-radius: 3px; }
.bvxe-structure:hover { border-color: var(--bvxe-accent); }
.bvxe-structure:hover span { background: var(--bvxe-accent); }
.bvxe-structures--sm .bvxe-structure { width: 56px; height: 32px; }

.bvxe-repeater { display: flex; flex-direction: column; gap: 6px; }
.bvxe-rep-item { border: 1px solid var(--bvxe-border); border-radius: 8px; background: #fff; }
.bvxe-rep-head { display: flex; align-items: center; gap: 2px; padding: 4px 6px; }
.bvxe-rep-title { flex: 1; text-align: left; border: 0; background: none; font-weight: 600; padding: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bvxe-rep-body { display: none; padding: 8px 10px 2px; border-top: 1px solid var(--bvxe-border); }
.bvxe-rep-item.is-open .bvxe-rep-body { display: block; }

/* AI */
.bvxe-ai-wrap { position: relative; }
.bvxe-ai-wrap input, .bvxe-ai-wrap textarea { padding-right: 34px !important; }
.bvxe-ai-btn { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border: 0; border-radius: 6px; background: linear-gradient(135deg, #7c3aed, #db2777); color: #fff; font-size: 13px; }
.bvxe-ai-btn.is-busy { animation: bvxe-pulse 1s infinite; }
@keyframes bvxe-pulse { 50% { opacity: .4; } }
.bvxe-ai-menu { position: fixed; z-index: 100002; width: 240px; background: #fff; border: 1px solid var(--bvxe-border); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 6px; }
.bvxe-ai-menu > button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; }
.bvxe-ai-menu > button:hover { background: var(--bvxe-accent-soft); }
.bvxe-ai-translate { display: flex; gap: 4px; padding: 6px 4px 2px; border-top: 1px solid var(--bvxe-border); margin-top: 4px; }
.bvxe-ai-translate input { flex: 1; min-width: 0; }
.bvxe-ai-translate button { border: 0; background: var(--bvxe-accent); color: #fff; border-radius: 6px; padding: 0 8px; }

/* Canvas */
.bvxe-canvas-wrap { flex: 1; overflow: auto; padding: 24px; }
.bvxe-canvas {
	margin: 0 auto; max-width: 100%; min-height: 100%;
	background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.04);
	border-radius: 6px; transition: max-width .3s ease;
	container-type: inline-size; container-name: spcanvas bvx-section;
	font-size: 16px; line-height: 1.6;
}
.bvxe-canvas[data-device="tablet"] { max-width: 820px; }
.bvxe-canvas[data-device="mobile"] { max-width: 400px; }
.bvxe-canvas-inner { min-height: 60vh; padding-bottom: 20px; }

.bvxe-empty { text-align: center; padding: 70px 20px 10px; color: var(--bvxe-muted); }
.bvxe-empty h2 { color: var(--bvxe-text); font-size: 22px; margin: 0 0 6px; }

.bvxe-section { position: relative; outline: 1px dashed transparent; outline-offset: -1px; }
.bvxe-section:hover { outline-color: #a5b4fc; }
.bvxe-section.is-selected { outline: 2px solid var(--bvxe-accent); }
.bvxe-section-bar {
	position: absolute; top: 0; left: 50%; transform: translate(-50%, -100%); z-index: 5;
	display: none; gap: 1px; background: var(--bvxe-accent); border-radius: 8px 8px 0 0; padding: 0 4px;
}
.bvxe-section:hover > .bvxe-section-bar, .bvxe-section.is-selected > .bvxe-section-bar { display: flex; }
.bvxe-section:first-child > .bvxe-section-bar { transform: translate(-50%, 0); border-radius: 0 0 8px 8px; }
.bvxe-section-bar button, .bvxe-section-bar .bvxe-handle { border: 0; background: none; color: #fff; height: 26px; padding: 0 7px; font-size: 12px; display: inline-flex; align-items: center; }
.bvxe-section-bar .bvxe-handle { cursor: grab; }
.bvxe-section-bar button:hover { background: rgba(255,255,255,.18); }
.bvxe-section-inner { position: relative; background-size: cover; background-position: center; }
.bvxe-overlay { position: absolute; inset: 0; pointer-events: none; }
.bvxe-row { position: relative; display: flex; margin: 0 auto; padding: 0 20px; }
.bvxe-row.is-full { padding: 0; }

.bvxe-col { container: bvx-col / inline-size; position: relative; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; min-height: 70px; outline: 1px dashed transparent; outline-offset: -1px; border-radius: 4px; }
.bvxe-section:hover .bvxe-col { outline-color: #dbe0ea; }
.bvxe-col.is-selected { outline: 2px solid #818cf8 !important; }
.bvxe-col-bar { position: absolute; top: 2px; left: 2px; z-index: 4; display: none; background: #818cf8; border-radius: 6px; }
.bvxe-col:hover > .bvxe-col-bar, .bvxe-col.is-selected > .bvxe-col-bar { display: flex; }
.bvxe-col-bar button { border: 0; background: none; color: #fff; height: 22px; padding: 0 6px; font-size: 11px; }
.bvxe-col-widgets { flex: 1; min-height: 40px; }
.bvxe-col-add {
	align-self: center; margin: 6px 0; width: 28px; height: 28px; border-radius: 50%;
	border: 1px dashed #a5b4fc; background: #fff; color: var(--bvxe-accent); opacity: 0; transition: opacity .15s;
}
.bvxe-col:hover .bvxe-col-add, .bvxe-col-widgets:empty + .bvxe-col-add { opacity: 1; }

.bvxe-widget { position: relative; outline: 1px solid transparent; outline-offset: 2px; border-radius: 4px; cursor: pointer; }
.bvxe-widget:hover { outline-color: #a5b4fc; }
.bvxe-widget.is-selected { outline: 2px solid var(--bvxe-accent); }
.bvxe-widget-bar {
	position: absolute; top: -2px; right: -2px; transform: translateY(-100%); z-index: 6;
	display: none; align-items: center; gap: 1px; background: var(--bvxe-accent); border-radius: 6px 6px 0 0; padding: 0 2px;
	color: #fff; font-size: 11px;
}
.bvxe-widget:hover > .bvxe-widget-bar, .bvxe-widget.is-selected > .bvxe-widget-bar { display: flex; }
.bvxe-widget-name { padding: 0 6px; white-space: nowrap; }
.bvxe-widget-bar button { border: 0; background: none; color: #fff; height: 22px; padding: 0 6px; }
.bvxe-widget-preview { min-height: 20px; }
.bvxe-widget-preview a, .bvxe-widget-preview button, .bvxe-widget-preview input, .bvxe-widget-preview select, .bvxe-widget-preview textarea, .bvxe-widget-preview iframe { pointer-events: none; }
.bvxe-widget-preview.is-loading { opacity: .5; transition: opacity .2s; }
.bvxe-skeleton { height: 46px; border-radius: 6px; background: linear-gradient(90deg, #f0f1f4 25%, #e6e8ee 50%, #f0f1f4 75%); background-size: 200% 100%; animation: bvxe-shimmer 1.2s infinite; }
@keyframes bvxe-shimmer { to { background-position: -200% 0; } }
.bvxe-widget-placeholder { height: 46px; border: 2px dashed var(--bvxe-accent); border-radius: 8px; background: var(--bvxe-accent-soft); margin: 4px 0; }
.bvxe-section-placeholder { height: 90px; border: 2px dashed var(--bvxe-accent); background: var(--bvxe-accent-soft); }
.bvxe-col-widgets .bvxe-widget-btn { width: 100%; height: 46px; flex-direction: row; }

.bvxe-add-section { margin: 28px 20px 10px; padding: 24px; border: 2px dashed #d5d9e2; border-radius: 14px; text-align: center; color: var(--bvxe-muted); font-size: 13px; }
.bvxe-add-section p { margin: 0 0 12px; font-weight: 600; }
.bvxe-add-section .bvxe-btn-ai { margin-top: 14px; }

/* Row/column layout in the canvas follows the SELECTED DEVICE (editor.js resolves per-device
   widths, gaps and padding and writes them inline), not the canvas pixel width. A narrow
   "desktop" canvas therefore still shows the desktop layout, and mobile columns are always
   full width. */

/* Modal + toast */
.bvxe-modal { position: fixed; inset: 0; z-index: 100001; background: rgba(17, 24, 39, .45); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(2px); }
.bvxe-modal-box { width: 100%; max-width: 520px; background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.25); overflow: hidden; }
.bvxe-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 6px; }
.bvxe-modal-head h3 { margin: 0; font-size: 16px; }
.bvxe-modal-body { padding: 8px 18px; }
.bvxe-modal-body textarea { width: 100%; border-radius: 8px; }
.bvxe-modal-label { display: block; font-weight: 600; margin-bottom: 6px; }
.bvxe-modal-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.bvxe-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px 18px; }
.bvxe-toast {
	position: fixed; left: 50%; bottom: 24px; z-index: 100003; transform: translate(-50%, 20px); opacity: 0;
	background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	box-shadow: 0 10px 30px rgba(0,0,0,.2); transition: all .25s ease; max-width: 90vw;
}
.bvxe-toast.is-in { transform: translate(-50%, 0); opacity: 1; }
.bvxe-toast.is-success { background: #065f46; }
.bvxe-toast.is-error { background: #991b1b; }
.bvxe-toast.is-warn { background: #92400e; }

@media (max-width: 900px) {
	:root { --bvxe-panel-w: 270px; }
	.bvxe-title { width: 140px; }
	.bvxe-type { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.bvxe-app *, .bvxe-toast { transition: none !important; animation: none !important; }
}

/* Editor: hidden-on-device widgets dikhte rahen (halke). */
.bvxe-widget-preview .bvx-hide-desktop, .bvxe-widget-preview .bvx-hide-mobile { display: block !important; opacity: .35; }

/* Editor previews: har widget alag preview me hai, is liye margin yahan dikhayein. */
.bvxe-widget { margin-bottom: 0; }
.bvxe-widget-preview > .bvx-widget { margin-bottom: var(--bvx-mb, 20px); }
.bvxe-section-inner.bvx-has-color :is(.bvx-heading, .bvx-text :is(h1, h2, h3, h4, h5, h6, p, li, a), .bvx-pricing-title, .bvx-acc-item summary) { color: inherit; }
.bvxe-canvas :is(h1, h2, h3, h4, h5, h6) { color: inherit; }

/* SVG icons */
.bvxe-svg { width: 18px; height: 18px; display: inline-block; vertical-align: middle; flex: 0 0 auto; }
.bvxe-btn .bvxe-svg { width: 16px; height: 16px; }
.bvxe-ai-btn { display: inline-grid; place-items: center; padding: 0; }
.bvxe-ai-btn .bvxe-svg { width: 15px; height: 15px; }

/* Control group headings */
.bvxe-control-heading { margin: 22px 0 12px; padding-top: 14px; border-top: 1px solid var(--bvxe-border); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--bvxe-muted); }
.bvxe-controls > .bvxe-control-heading:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* Color control v2 */
.bvxe-color2 { display: flex; flex-direction: column; gap: 8px; }
.bvxe-color2 .bvxe-color input[type="text"] { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.bvxe-color2 input.is-invalid { border-color: var(--bvxe-danger) !important; box-shadow: 0 0 0 1px var(--bvxe-danger) !important; }
.bvxe-color-chip { position: relative; flex: 0 0 34px; width: 34px; height: 32px; border-radius: 8px; border: 1px solid var(--bvxe-border); overflow: hidden;
	background-image: linear-gradient(45deg, #ddd 25%, transparent 25%), linear-gradient(-45deg, #ddd 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ddd 75%), linear-gradient(-45deg, transparent 75%, #ddd 75%);
	background-size: 10px 10px; background-position: 0 0, 0 5px, 5px -5px, -5px 0; }
.bvxe-color-chip input[type="color"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.bvxe-color-chip.is-empty::after { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; background: var(--bvxe-danger); transform: rotate(45deg); }
.bvxe-alpha { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--bvxe-muted); }
.bvxe-alpha input { flex: 1; accent-color: var(--bvxe-accent); }
.bvxe-alpha output { width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.bvxe-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.bvxe-swatch { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); padding: 0; cursor: pointer; }
.bvxe-swatch:hover { transform: scale(1.15); }

/* Top-left menu (Back to Dashboard etc.) */
.bvxe-menu-wrap { position: relative; }
.bvxe-logo .bvxe-svg { width: 20px; height: 20px; }
.bvxe-logo:hover { filter: brightness(1.1); }
.bvxe-menu { position: absolute; top: 44px; left: 0; z-index: 100005; width: 270px; background: #fff; border: 1px solid var(--bvxe-border); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.16); padding: 6px; }
.bvxe-menu[hidden] { display: none; }
.bvxe-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--bvxe-text); text-decoration: none; font-weight: 500; }
.bvxe-menu a:hover, .bvxe-menu a:focus { background: var(--bvxe-accent-soft); color: var(--bvxe-accent); outline: none; }
.bvxe-menu hr { border: 0; border-top: 1px solid var(--bvxe-border); margin: 6px 4px; }
.bvxe-menu-hint { padding: 8px 10px 4px; font-size: 11px; color: var(--bvxe-muted); line-height: 1.5; }

/* Visual Icon List picker */
.bvxe-field--icon-picker .bvxe-icon-picker {
	display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:6px; max-height:260px; overflow:auto; padding:2px;
}
.bvxe-field--icon-picker .bvxe-icon-choice {
	appearance:none; display:flex; align-items:center; justify-content:center; width:100%; aspect-ratio:1; padding:8px; border:1px solid #dcdcde; border-radius:6px; background:#fff; color:#2c3338; cursor:pointer;
}
.bvxe-field--icon-picker .bvxe-icon-choice:hover { border-color:#2271b1; background:#f6f7f7; }
.bvxe-field--icon-picker .bvxe-icon-choice.is-selected { border-color:#2271b1; box-shadow:inset 0 0 0 1px #2271b1; background:#f0f6fc; }
.bvxe-field--icon-picker .bvxe-icon-choice svg { width:24px; height:24px; display:block; }
.bvxe-field--icon-picker .bvxe-icon-choice-fallback { font-size:12px; font-weight:600; line-height:1; }

/* --------------------------------------------------------------------------
 * SoftPulse Builder 1.2 editor shell — three-pane workflow, navigator and site styles.
 * ----------------------------------------------------------------------- */
:root {
	--bvxe-bg: #f5f6fa;
	--bvxe-border: #e3e6ee;
	--bvxe-text: #0f172a;
	--bvxe-muted: #64748b;
	--bvxe-accent: #6d4aff;
	--bvxe-accent-soft: #f0edff;
	--bvxe-top-h: 60px;
	--bvxe-panel-w: 292px;
	--bvxe-inspector-w: 316px;
	--bvxe-status-h: 34px;
	--bvxe-rail-w: 72px;
}
.bvxe-app { letter-spacing: -.005em; }
.bvxe-top { padding: 0 16px 0 12px; box-shadow: 0 1px 0 rgba(15,23,42,.03); z-index: 20; }
.bvxe-top-left { flex: 1.2; }
.bvxe-brand { font-size: 17px; letter-spacing: -.02em; margin-right: 12px; }
.bvxe-logo { width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(145deg, #795cff, #5636e7); box-shadow: 0 6px 14px rgba(109,74,255,.24); }
.bvxe-title { width: 230px; font-size: 13px; background: #f8fafc !important; border-color: #e8eaf0 !important; }
.bvxe-type { border-radius: 6px; background: #f1f5f9; }
.bvxe-top-center { padding: 3px; border: 1px solid var(--bvxe-border); border-radius: 9px; background: #f8fafc; }
.bvxe-top-center .bvxe-icon-btn { width: 36px; height: 30px; border-radius: 6px; }
.bvxe-top-center .bvxe-sep { height: 18px; }
.bvxe-save-state { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; color: #64748b; font-size: 11.5px; white-space: nowrap; }
.bvxe-save-dot { width: 7px; height: 7px; border-radius: 50%; background: #22a06b; box-shadow: 0 0 0 3px #e8f7f0; }
.bvxe-save-state.is-unsaved .bvxe-save-dot { background: #f59e0b; box-shadow: 0 0 0 3px #fff7e5; }
.bvxe-save-state.is-unsaved { color: #8a5a00; }
.bvxe-btn { height: 36px; border-radius: 8px; font-size: 12.5px; }
.bvxe-btn-primary { background: var(--bvxe-accent); border-color: var(--bvxe-accent); box-shadow: 0 5px 12px rgba(109,74,255,.2); }
.bvxe-btn-primary:hover { background: #5d3be9; }
.bvxe-btn-ai { background: #fff; color: var(--bvxe-accent); border: 1px solid #dcd5ff; }
.bvxe-btn-ai:hover { filter: none; background: var(--bvxe-accent-soft); color: #5233db; }

.bvxe-body { min-height: 0; position: relative; }
.bvxe-rail {
	width: var(--bvxe-rail-w); flex: 0 0 var(--bvxe-rail-w); padding: 12px 8px; background: #111a34;
	display: flex; flex-direction: column; align-items: stretch; gap: 6px; border-right: 1px solid #202a48;
}
.bvxe-rail-btn { min-height: 58px; padding: 7px 3px; border: 0; border-radius: 8px; background: transparent; color: #b9c2dc; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10px !important; line-height: 1.2; }
.bvxe-rail-btn .bvxe-svg { width: 21px; height: 21px; }
.bvxe-rail-btn:hover { color: #fff; background: rgba(255,255,255,.07); }
.bvxe-rail-btn.is-active { color: #fff; background: linear-gradient(145deg, #7655ff, #5b3ce5); box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.bvxe-panel { width: var(--bvxe-panel-w); flex-basis: var(--bvxe-panel-w); transition: width .2s ease, flex-basis .2s ease; }
.bvxe-app.is-panel-collapsed .bvxe-panel { width: 0; flex-basis: 0; overflow: hidden; border: 0; }
.bvxe-panel-head { min-height: 58px; padding: 0 14px 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--bvxe-border); }
.bvxe-panel-head strong { font-size: 15px; letter-spacing: -.015em; }
.bvxe-panel-head .bvxe-link { width: 28px; height: 28px; border-radius: 6px; font-size: 19px; }
.bvxe-panel-body { padding: 16px; scrollbar-width: thin; }
.bvxe-search { height: 40px; margin-bottom: 14px; padding-left: 12px !important; border-color: #dfe3ec !important; background: #fafbfc !important; font-size: 12.5px; }
.bvxe-cat { margin: 18px 0 9px; color: #334155; font-size: 10.5px; letter-spacing: .075em; }
.bvxe-widget-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.bvxe-widget-btn { height: 82px; border-color: #dfe3ec; border-radius: 8px; color: #17213b; font-size: 11.5px; box-shadow: 0 1px 1px rgba(15,23,42,.02); }
.bvxe-widget-btn:hover { border-color: var(--bvxe-accent); box-shadow: 0 7px 18px rgba(109,74,255,.1); }

.bvxe-canvas-wrap { position: relative; padding: 30px; background: #f3f5f9; }
.bvxe-canvas-stage { min-width: min-content; min-height: 100%; display: flex; justify-content: center; align-items: flex-start; }
.bvxe-canvas { --bvxe-zoom: 1; zoom: var(--bvxe-zoom); width: 100%; box-shadow: 0 1px 3px rgba(15,23,42,.05), 0 18px 45px rgba(15,23,42,.06); border: 1px solid #e7e9ef; border-radius: 4px; font-family: var(--bvxe-body-font, inherit); }
.bvxe-canvas :is(h1,h2,h3,h4,h5,h6,.bvx-heading) { font-family: var(--bvxe-heading-font, inherit); }
.bvxe-section.is-selected, .bvxe-widget.is-selected { outline-color: var(--bvxe-accent); }
.bvxe-widget-bar, .bvxe-section-bar { background: var(--bvxe-accent); }

.bvxe-inspector { width: var(--bvxe-inspector-w); flex: 0 0 var(--bvxe-inspector-w); min-height: 0; overflow: hidden; background: #fff; border-left: 1px solid var(--bvxe-border); }
.bvxe-inspector-body { height: 100%; overflow-y: auto; scrollbar-width: thin; }
.bvxe-inspector-body > .bvxe-edit-head { min-height: 58px; margin: 0; padding: 0 16px 0 18px; border-bottom: 1px solid var(--bvxe-border); }
.bvxe-inspector-body > .bvxe-control-tabs { margin: 0; padding: 0 12px; border-radius: 0; border-bottom: 1px solid var(--bvxe-border); background: #fff; gap: 18px; }
.bvxe-inspector-body > .bvxe-control-tabs button { flex: 0 1 auto; height: 45px; padding: 0 2px; border-radius: 0; border-bottom: 2px solid transparent; font-size: 11.5px; }
.bvxe-inspector-body > .bvxe-control-tabs button.is-active { color: var(--bvxe-accent); border-bottom-color: var(--bvxe-accent); background: transparent; box-shadow: none; }
.bvxe-inspector-body > .bvxe-controls { padding: 16px 18px 30px; }
.bvxe-inspector-empty { height: 100%; padding: 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--bvxe-muted); }
.bvxe-inspector-empty .bvxe-svg { width: 28px; height: 28px; color: var(--bvxe-accent); margin-bottom: 12px; }
.bvxe-inspector-empty strong { color: var(--bvxe-text); font-size: 14px; }
.bvxe-inspector-empty p { max-width: 220px; font-size: 12px; }
.bvxe-field > label { color: #24304b; font-size: 11.5px; }
.bvxe-field input[type="text"], .bvxe-field input[type="url"], .bvxe-field input[type="number"], .bvxe-field input[type="datetime-local"], .bvxe-field select, .bvxe-field textarea { min-height: 36px; border-color: #dde2eb !important; font-size: 12px; }

.bvxe-statusbar { height: var(--bvxe-status-h); flex: 0 0 var(--bvxe-status-h); padding: 0 18px 0 calc(var(--bvxe-rail-w) + 14px); display: flex; align-items: center; justify-content: space-between; background: #fff; border-top: 1px solid var(--bvxe-border); color: #65708a; font-size: 10.5px; z-index: 20; }
.bvxe-breadcrumbs { display: flex; align-items: center; gap: 8px; }
.bvxe-breadcrumbs b { color: #a5adbd; font-weight: 400; }
.bvxe-breadcrumbs .is-current { color: var(--bvxe-accent); }
.bvxe-status-actions { display: flex; align-items: center; gap: 9px; }
.bvxe-status-actions button { width: 24px; height: 24px; padding: 0; border: 0; background: transparent; color: #25304a; font-size: 16px; }
.bvxe-status-sep { width: 1px; height: 16px; background: var(--bvxe-border); margin: 0 5px; }

.bvxe-panel-intro { margin: 0 0 16px; color: var(--bvxe-muted); font-size: 11.5px; }
.bvxe-panel-empty, .bvxe-note { padding: 14px; border-radius: 8px; background: #f8fafc; color: var(--bvxe-muted); font-size: 11.5px; }
.bvxe-note { margin-bottom: 16px; border: 1px solid #e5e7eb; }
.bvxe-layer-group { margin-bottom: 8px; }
.bvxe-layer-children { margin-left: 12px; padding-left: 9px; border-left: 1px solid #e1e5ed; }
.bvxe-layer { width: 100%; min-height: 34px; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: #334155; display: flex; align-items: center; gap: 8px; text-align: left; font-size: 11.5px !important; }
.bvxe-layer:hover, .bvxe-layer.is-active { background: var(--bvxe-accent-soft); color: #5034d7; }
.bvxe-layer .bvxe-svg, .bvxe-layer-icon .bvxe-wsvg { width: 15px; height: 15px; }
.bvxe-layer small { margin-left: auto; color: #94a3b8; }
.bvxe-layer-mark { width: 10px; height: 10px; border: 1.5px solid currentColor; border-radius: 2px; }
.bvxe-layer-widget { padding-left: 10px; }
.bvxe-history-list { position: relative; }
.bvxe-history-item { width: 100%; padding: 8px 7px; border: 0; border-radius: 7px; background: transparent; display: flex; gap: 9px; text-align: left; color: #334155; }
.bvxe-history-item:hover, .bvxe-history-item.is-active { background: var(--bvxe-accent-soft); color: #5034d7; }
.bvxe-history-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; border: 2px solid #b8c0d0; background: #fff; }
.bvxe-history-item.is-active .bvxe-history-dot { border-color: var(--bvxe-accent); background: var(--bvxe-accent); box-shadow: 0 0 0 3px #e9e4ff; }
.bvxe-history-item span:last-child { display: flex; flex-direction: column; }
.bvxe-history-item strong { font-size: 11.5px; font-weight: 600; }
.bvxe-history-item small { color: #94a3b8; font-size: 10px; }
.bvxe-save-styles { width: 100%; }

.bvxe-quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bvxe-quick-actions > button { padding: 14px; min-height: 76px; border: 1px solid var(--bvxe-border); border-radius: 9px; background: #fff; display: flex; align-items: flex-start; gap: 10px; text-align: left; }
.bvxe-quick-actions > button:hover { border-color: var(--bvxe-accent); background: var(--bvxe-accent-soft); }
.bvxe-quick-actions .bvxe-svg { color: var(--bvxe-accent); }
.bvxe-quick-actions span { display: flex; flex-direction: column; }
.bvxe-quick-actions small { color: var(--bvxe-muted); font-size: 10.5px; }

@media (max-width: 1260px) {
	:root { --bvxe-inspector-w: 290px; --bvxe-panel-w: 270px; }
	.bvxe-brand, .bvxe-type, .bvxe-save-state { display: none; }
	.bvxe-title { width: 170px; }
}
@media (max-width: 1000px) {
	.bvxe-inspector { position: absolute; z-index: 12; top: 0; right: 0; bottom: 0; box-shadow: -16px 0 36px rgba(15,23,42,.12); }
	.bvxe-inspector:has(.bvxe-inspector-empty) { display: none; }
	.bvxe-top-right .bvxe-btn-ghost { display: none; }
}

/* Per-device widget spacing (previews are server-rendered with -t / -m vars). */
.bvxe-canvas[data-device="tablet"] .bvxe-widget-preview > .bvx-widget { margin-bottom: var(--bvx-mb-t, var(--bvx-mb, 20px)); }
.bvxe-canvas[data-device="mobile"] .bvxe-widget-preview > .bvx-widget { margin-bottom: var(--bvx-mb-m, var(--bvx-mb-t, var(--bvx-mb, 20px))); }
.bvxe-canvas[data-device] .bvxe-widget-preview > .bvx-widget:last-child { margin-bottom: 0; }

/* Responsive fields: device badge, inherited state, reset. */
.bvxe-dev { display: inline-flex; vertical-align: middle; margin-left: 4px; color: var(--bvxe-muted); }
.bvxe-dev .bvxe-svg { width: 13px; height: 13px; }
.bvxe-field--resp.is-inherited input, .bvxe-field--resp.is-inherited select { color: var(--bvxe-muted); font-style: italic; }
.bvxe-field--resp { position: relative; }
.bvxe-dev-reset { position: absolute; top: -2px; right: 0; font-size: 14px; line-height: 1; }
.bvxe-dev-reset[hidden] { display: none; }

/* Page settings tabs + CSS editor. */
.bvxe-ps-tabs { margin: 0 0 12px; }
.bvxe-ps-css { width: 100%; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; white-space: pre; overflow: auto; }
.bvxe-css-count { display: block; text-align: right; }

/* Save status: failed (changes are kept locally and retried). */
.bvxe-save-state.is-failed { color: #b32d2e; }
.bvxe-save-state.is-failed .bvxe-save-dot { background: #b32d2e; }
