/* =====================================================================
   Pesty Persona Builder — dashboard styles

   All selectors are scoped under `.pesty-pb-app` to outrank
   Hello Elementor / Elementor frontend resets (which use selectors like
   `button`, `input[type=text]`, `a` at specificity 0,1,1).
   ===================================================================== */

.pesty-pb-app {
	--pesty-bg: #f8fafc;
	--pesty-card: #ffffff;
	--pesty-border: #e2e8f0;
	--pesty-border-strong: #cbd5e1;
	--pesty-text: #0f172a;
	--pesty-text-muted: #64748b;
	--pesty-primary: #6366f1;
	--pesty-primary-hover: #4f46e5;
	--pesty-danger: #dc2626;
	--pesty-success: #16a34a;
	--pesty-radius: 10px;
	--pesty-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	--pesty-shadow-md: 0 10px 25px -10px rgba(15, 23, 42, 0.18);

	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.4;
	color: var(--pesty-text);
	background: var(--pesty-bg);
	border-radius: var(--pesty-radius);
	padding: 16px;
	text-align: left;
}

.pesty-pb-app *,
.pesty-pb-app *::before,
.pesty-pb-app *::after {
	box-sizing: border-box;
}

/* ---------------------------------------------------------------------
   Element reset — neutralize Hello Elementor / theme defaults.
   Uses `.pesty-pb-app button` etc. (specificity 0,1,1) which matches the
   most aggressive theme selectors; the explicit class rules below win on
   top via 0,2,0 specificity.
   --------------------------------------------------------------------- */

.pesty-pb-app a {
	background: transparent;
	color: inherit;
	text-decoration: none;
}

.pesty-pb-app a:hover,
.pesty-pb-app a:focus {
	color: var(--pesty-primary);
	text-decoration: none;
}

.pesty-pb-app button,
.pesty-pb-app [type="button"],
.pesty-pb-app [type="submit"],
.pesty-pb-app [type="reset"] {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: transparent;
	border: 1px solid transparent;
	color: inherit;
	font: inherit;
	font-size: 13px;
	line-height: 1;
	margin: 0;
	padding: 0;
	cursor: pointer;
	text-transform: none;
	text-decoration: none;
	width: auto;
	white-space: nowrap;
	transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}

.pesty-pb-app button:hover,
.pesty-pb-app button:focus,
.pesty-pb-app [type="button"]:hover,
.pesty-pb-app [type="button"]:focus,
.pesty-pb-app [type="submit"]:hover,
.pesty-pb-app [type="submit"]:focus {
	background: transparent;
	color: inherit;
	outline: none;
	text-decoration: none;
}

.pesty-pb-app input,
.pesty-pb-app textarea,
.pesty-pb-app select {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	margin: 0;
	background: #fff;
	color: var(--pesty-text);
	border: 1px solid var(--pesty-border-strong);
	border-radius: 8px;
	padding: 8px 12px;
	font: inherit;
	font-size: 14px;
	line-height: 1.4;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.pesty-pb-app input[type="color"] {
	padding: 2px;
	width: 36px;
	height: 36px;
	cursor: pointer;
}

.pesty-pb-app input[type="file"] {
	display: none;
}

.pesty-pb-app input:focus,
.pesty-pb-app textarea:focus,
.pesty-pb-app select:focus {
	border-color: var(--pesty-primary);
	outline: none;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.pesty-pb-app h1,
.pesty-pb-app h2,
.pesty-pb-app h3,
.pesty-pb-app h4,
.pesty-pb-app h5,
.pesty-pb-app h6 {
	color: var(--pesty-text);
	font-family: inherit;
	font-weight: 600;
	line-height: 1.3;
	margin: 0;
	letter-spacing: normal;
}

.pesty-pb-app ul,
.pesty-pb-app ol {
	list-style: none;
	margin: 0;
	padding: 0;
}

.pesty-pb-app img {
	display: block;
	max-width: 100%;
	height: auto;
}

.pesty-pb-app pre {
	font-family: ui-monospace, Menlo, Consolas, monospace;
	margin: 0;
}

/* ---------------------------------------------------------------------
   Shell layout
   --------------------------------------------------------------------- */

.pesty-pb-app .pesty-pb-shell {
	display: grid;
	grid-template-columns: var(--pesty-sidebar-width, 280px) 1fr;
	gap: 16px;
	align-items: stretch;
	min-height: 600px;
}

/* ---------------------------------------------------------------------
   Sidebar / folders
   --------------------------------------------------------------------- */

.pesty-pb-app .pesty-pb-sidebar {
	background: var(--pesty-card);
	border: 1px solid var(--pesty-border);
	border-radius: var(--pesty-radius);
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	box-shadow: var(--pesty-shadow);
	min-height: 0;
	position: relative;
}

.pesty-pb-app .pesty-pb-sidebar__resizer {
	position: absolute;
	top: 0;
	right: -4px;
	width: 8px;
	height: 100%;
	cursor: col-resize;
	z-index: 5;
	background: transparent;
	transition: background 0.15s;
}

.pesty-pb-app .pesty-pb-sidebar__resizer::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 2px;
	height: 28px;
	border-radius: 2px;
	background: var(--pesty-border-strong);
	opacity: 0;
	transition: opacity 0.15s;
}

.pesty-pb-app .pesty-pb-sidebar__resizer:hover::after,
.pesty-pb-app .pesty-pb-sidebar__resizer.is-resizing::after {
	opacity: 1;
	background: var(--pesty-primary);
}

.pesty-pb-app.is-resizing-sidebar,
.pesty-pb-app.is-resizing-sidebar * {
	cursor: col-resize !important;
	user-select: none;
}

@media (max-width: 900px) {
	.pesty-pb-app .pesty-pb-sidebar__resizer {
		display: none;
	}
}

.pesty-pb-app .pesty-pb-sidebar__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.pesty-pb-app .pesty-pb-sidebar__title {
	font-size: 12px;
	font-weight: 700;
	color: var(--pesty-text);
	margin: 0;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.pesty-pb-app .pesty-pb-folder-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
	overflow-y: auto;
	min-height: 0;
}

.pesty-pb-app .pesty-pb-folder-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border-radius: 8px;
	cursor: pointer;
	border: 1px solid transparent;
	transition: background 0.15s, border-color 0.15s;
	position: relative;
}

.pesty-pb-app .pesty-pb-folder-item:hover {
	background: #f1f5f9;
}

.pesty-pb-app .pesty-pb-folder-item.is-active {
	background: #eef2ff;
	border-color: #c7d2fe;
}

.pesty-pb-app .pesty-pb-folder-item.is-drop-target {
	background: #ecfdf5;
	border-color: #6ee7b7;
}

.pesty-pb-app .pesty-pb-folder-item__swatch {
	width: 14px;
	height: 14px;
	border-radius: 4px;
	flex-shrink: 0;
	border: 1px solid rgba(15, 23, 42, 0.1);
}

.pesty-pb-app .pesty-pb-folder-item__name {
	flex: 1;
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--pesty-text);
}

.pesty-pb-app .pesty-pb-folder-item__count {
	font-size: 11px;
	font-weight: 500;
	color: var(--pesty-text-muted);
	background: #f1f5f9;
	border-radius: 999px;
	padding: 2px 8px;
	line-height: 1;
}

.pesty-pb-app .pesty-pb-folder-item__menu {
	display: inline-flex;
	gap: 2px;
	opacity: 0;
	transition: opacity 0.15s;
}

.pesty-pb-app .pesty-pb-folder-item:hover .pesty-pb-folder-item__menu,
.pesty-pb-app .pesty-pb-folder-item.is-menu-open .pesty-pb-folder-item__menu {
	opacity: 1;
}

/* ---------------------------------------------------------------------
   Main column
   --------------------------------------------------------------------- */

.pesty-pb-app .pesty-pb-main {
	background: var(--pesty-card);
	border: 1px solid var(--pesty-border);
	border-radius: var(--pesty-radius);
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
	min-height: 0;
	box-shadow: var(--pesty-shadow);
}

.pesty-pb-app .pesty-pb-main__header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	flex-wrap: wrap;
}

.pesty-pb-app .pesty-pb-main__title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	color: var(--pesty-text);
}

.pesty-pb-app .pesty-pb-main__subtitle {
	margin: 4px 0 0;
	font-size: 13px;
	color: var(--pesty-text-muted);
}

.pesty-pb-app .pesty-pb-main__actions {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

.pesty-pb-app .pesty-pb-persona-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	min-height: 200px;
}

@media (max-width: 1200px) {
	.pesty-pb-app .pesty-pb-persona-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.pesty-pb-app .pesty-pb-persona-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 540px) {
	.pesty-pb-app .pesty-pb-persona-grid {
		grid-template-columns: 1fr;
	}
}

.pesty-pb-app .pesty-pb-persona-card__folder {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	font-weight: 500;
	color: var(--pesty-text-muted);
	background: #f1f5f9;
	border-radius: 999px;
	padding: 3px 8px;
	width: max-content;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pesty-pb-app .pesty-pb-persona-card__folder-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex-shrink: 0;
}

.pesty-pb-app .pesty-pb-empty {
	grid-column: 1 / -1;
	padding: 60px 20px;
	text-align: center;
	color: var(--pesty-text-muted);
	background: #f8fafc;
	border: 1px dashed var(--pesty-border-strong);
	border-radius: var(--pesty-radius);
}

.pesty-pb-app .pesty-pb-persona-card {
	background: var(--pesty-card);
	border: 1px solid var(--pesty-border);
	border-radius: var(--pesty-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
	cursor: grab;
	position: relative;
}

.pesty-pb-app .pesty-pb-persona-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--pesty-shadow-md);
	border-color: #c7d2fe;
}

.pesty-pb-app .pesty-pb-persona-card.is-dragging {
	opacity: 0.5;
}

/* ----- Locked persona (another user is editing / generating) ----- */
.pesty-pb-app .pesty-pb-persona-card.is-locked {
	cursor: not-allowed;
	border-color: #fcd34d;
	background: #fffbeb;
}

.pesty-pb-app .pesty-pb-persona-card.is-locked:hover {
	transform: none;
	box-shadow: var(--pesty-shadow);
	border-color: #f59e0b;
}

.pesty-pb-app .pesty-pb-persona-card.is-locked .pesty-pb-persona-card__cover img,
.pesty-pb-app .pesty-pb-persona-card.is-locked .pesty-pb-persona-card__placeholder {
	filter: grayscale(0.7) blur(1px);
	opacity: 0.55;
}

.pesty-pb-app .pesty-pb-persona-card__lock {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(15, 23, 42, 0.35);
	pointer-events: none;
}

.pesty-pb-app .pesty-pb-persona-card__lock-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: 90%;
	padding: 6px 10px;
	background: #f59e0b;
	color: #fff;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}

.pesty-pb-app .pesty-pb-persona-card__lock-badge .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.pesty-pb-app .pesty-pb-persona-card__lock-text {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pesty-pb-app .pesty-pb-persona-card.is-locked .pesty-pb-btn[disabled] {
	opacity: 0.45;
	cursor: not-allowed;
}

.pesty-pb-app .pesty-pb-persona-card__cover {
	aspect-ratio: 1 / 1;
	background: linear-gradient(135deg, #eef2ff, #fdf4ff);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	position: relative;
}

.pesty-pb-app .pesty-pb-persona-card__cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pesty-pb-app .pesty-pb-persona-card__placeholder {
	font-size: 48px;
	color: rgba(99, 102, 241, 0.4);
}

.pesty-pb-app .pesty-pb-persona-card__body {
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.pesty-pb-app .pesty-pb-persona-card__name {
	font-weight: 600;
	font-size: 15px;
	color: var(--pesty-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pesty-pb-app .pesty-pb-persona-card__meta {
	font-size: 12px;
	color: var(--pesty-text-muted);
}

.pesty-pb-app .pesty-pb-persona-card__actions {
	display: flex;
	gap: 6px;
	margin-top: 6px;
	flex-wrap: wrap;
}

/* ---------------------------------------------------------------------
   Buttons (class-based — 0,2,0 specificity beats theme element rules)
   --------------------------------------------------------------------- */

.pesty-pb-app .pesty-pb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 14px;
	border-radius: 8px;
	border: 1px solid var(--pesty-border-strong);
	background: var(--pesty-card);
	color: var(--pesty-text);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}

.pesty-pb-app .pesty-pb-btn:hover {
	background: #f1f5f9;
	border-color: #94a3b8;
	color: var(--pesty-text);
}

.pesty-pb-app .pesty-pb-btn:active {
	transform: scale(0.98);
}

.pesty-pb-app .pesty-pb-btn:focus,
.pesty-pb-app .pesty-pb-btn:focus-visible {
	outline: 2px solid rgba(99, 102, 241, 0.4);
	outline-offset: 2px;
}

.pesty-pb-app .pesty-pb-btn--primary {
	background: var(--pesty-primary);
	border-color: var(--pesty-primary);
	color: #fff;
}

.pesty-pb-app .pesty-pb-btn--primary:hover {
	background: var(--pesty-primary-hover);
	border-color: var(--pesty-primary-hover);
	color: #fff;
}

.pesty-pb-app .pesty-pb-btn--danger {
	color: var(--pesty-danger);
	border-color: #fecaca;
	background: #fff;
}

.pesty-pb-app .pesty-pb-btn--danger:hover {
	background: #fef2f2;
	border-color: var(--pesty-danger);
	color: var(--pesty-danger);
}

.pesty-pb-app .pesty-pb-btn--icon {
	padding: 6px;
	border-radius: 6px;
}

.pesty-pb-app .pesty-pb-btn--sm {
	padding: 5px 10px;
	font-size: 12px;
}

.pesty-pb-app .pesty-pb-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 1;
}

/* ---------------------------------------------------------------------
   Inputs (class variants)
   --------------------------------------------------------------------- */

.pesty-pb-app .pesty-pb-input,
.pesty-pb-app .pesty-pb-textarea,
.pesty-pb-app .pesty-pb-select {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid var(--pesty-border-strong);
	border-radius: 8px;
	font-size: 14px;
	background: #fff;
	color: var(--pesty-text);
	transition: border-color 0.15s, box-shadow 0.15s;
	font-family: inherit;
	line-height: 1.4;
}

.pesty-pb-app .pesty-pb-input:focus,
.pesty-pb-app .pesty-pb-textarea:focus,
.pesty-pb-app .pesty-pb-select:focus {
	outline: none;
	border-color: var(--pesty-primary);
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.pesty-pb-app .pesty-pb-input--search {
	min-width: 200px;
}

.pesty-pb-app .pesty-pb-textarea {
	min-height: 80px;
	resize: vertical;
}

.pesty-pb-app .pesty-pb-select {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 14px;
	padding-right: 32px;
}

/* ---------------------------------------------------------------------
   Modal
   --------------------------------------------------------------------- */

.pesty-pb-app .pesty-pb-modal-root,
.pesty-pb-modal-root {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	background: rgba(15, 23, 42, 0.55);
	overflow-y: auto;
	padding: 24px;
}

.pesty-pb-app .pesty-pb-modal-root.is-open,
.pesty-pb-modal-root.is-open {
	display: flex;
	align-items: flex-start;
	justify-content: center;
}

.pesty-pb-modal-root .pesty-pb-modal {
	background: #fff;
	border-radius: 12px;
	width: 100%;
	max-width: 960px;
	margin: auto;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	max-height: calc(100vh - 48px);
	color: var(--pesty-text, #0f172a);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
}

.pesty-pb-modal-root .pesty-pb-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid #e2e8f0;
}

.pesty-pb-modal-root .pesty-pb-modal__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
}

.pesty-pb-modal-root .pesty-pb-modal__close {
	background: none;
	border: none;
	cursor: pointer;
	padding: 6px;
	border-radius: 6px;
	color: #64748b;
	display: inline-flex;
}

.pesty-pb-modal-root .pesty-pb-modal__close:hover {
	background: #f1f5f9;
	color: #0f172a;
}

.pesty-pb-modal-root .pesty-pb-modal__body {
	padding: 20px;
	overflow-y: auto;
	flex: 1;
}

.pesty-pb-modal-root .pesty-pb-modal__footer {
	padding: 14px 20px;
	border-top: 1px solid #e2e8f0;
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	background: #fafbfc;
}

/* Apply element resets inside the modal too (it lives outside .pesty-pb-app) */
.pesty-pb-modal-root button,
.pesty-pb-modal-root [type="button"],
.pesty-pb-modal-root [type="submit"] {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: transparent;
	border: 1px solid transparent;
	color: inherit;
	font: inherit;
	font-size: 13px;
	line-height: 1;
	margin: 0;
	padding: 0;
	cursor: pointer;
	text-transform: none;
	width: auto;
	white-space: nowrap;
}

.pesty-pb-modal-root button:hover,
.pesty-pb-modal-root button:focus,
.pesty-pb-modal-root [type="button"]:hover,
.pesty-pb-modal-root [type="submit"]:hover {
	background: transparent;
	color: inherit;
	outline: none;
}

.pesty-pb-modal-root input,
.pesty-pb-modal-root textarea,
.pesty-pb-modal-root select {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	margin: 0;
	background: #fff;
	color: #0f172a;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	padding: 8px 12px;
	font: inherit;
	font-size: 14px;
	line-height: 1.4;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.pesty-pb-modal-root input[type="color"] {
	padding: 2px;
	width: 36px;
	height: 36px;
}

.pesty-pb-modal-root input[type="file"] {
	display: none;
}

.pesty-pb-modal-root input:focus,
.pesty-pb-modal-root textarea:focus,
.pesty-pb-modal-root select:focus {
	border-color: #6366f1;
	outline: none;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.pesty-pb-modal-root h1,
.pesty-pb-modal-root h2,
.pesty-pb-modal-root h3,
.pesty-pb-modal-root h4 {
	color: #0f172a;
	font-family: inherit;
	font-weight: 600;
	line-height: 1.3;
	margin: 0;
}

.pesty-pb-modal-root .pesty-pb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 14px;
	border-radius: 8px;
	border: 1px solid #cbd5e1;
	background: #fff;
	color: #0f172a;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	line-height: 1;
	white-space: nowrap;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pesty-pb-modal-root .pesty-pb-btn:hover {
	background: #f1f5f9;
	border-color: #94a3b8;
	color: #0f172a;
}

.pesty-pb-modal-root .pesty-pb-btn--primary {
	background: #6366f1;
	border-color: #6366f1;
	color: #fff;
}

.pesty-pb-modal-root .pesty-pb-btn--primary:hover {
	background: #4f46e5;
	border-color: #4f46e5;
	color: #fff;
}

.pesty-pb-modal-root .pesty-pb-btn--danger {
	color: #dc2626;
	border-color: #fecaca;
	background: #fff;
}

.pesty-pb-modal-root .pesty-pb-btn--danger:hover {
	background: #fef2f2;
	border-color: #dc2626;
	color: #dc2626;
}

.pesty-pb-modal-root .pesty-pb-btn--sm {
	padding: 5px 10px;
	font-size: 12px;
}

.pesty-pb-modal-root .pesty-pb-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 1;
}

/* ---------------------------------------------------------------------
   Form
   --------------------------------------------------------------------- */

.pesty-pb-modal-root .pesty-pb-form {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.pesty-pb-modal-root .pesty-pb-section {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 16px;
}

.pesty-pb-modal-root .pesty-pb-section__title {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #6366f1;
	margin: 0 0 12px;
}

.pesty-pb-modal-root .pesty-pb-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0 0 14px;
}

.pesty-pb-modal-root .pesty-pb-field:last-child {
	margin-bottom: 0;
}

/* Hello Elementor's reset sets `label { display:inline-block; vertical-align:middle; line-height:1 }`
   which collapses spacing for any label we render outside the .pesty-pb-field block (e.g. checkbox row). */
.pesty-pb-modal-root label,
.pesty-pb-app label {
	display: inline-block;
	line-height: 1.4;
	vertical-align: baseline;
	margin: 0;
}

.pesty-pb-modal-root .pesty-pb-field__label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #0f172a;
	margin: 0 0 6px;
	line-height: 1.3;
}

.pesty-pb-modal-root .pesty-pb-field__label .pesty-pb-required {
	color: #dc2626;
}

.pesty-pb-modal-root .pesty-pb-input,
.pesty-pb-modal-root .pesty-pb-textarea,
.pesty-pb-modal-root .pesty-pb-select {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 14px;
	background: #fff;
	color: #0f172a;
	transition: border-color 0.15s, box-shadow 0.15s;
	font-family: inherit;
	line-height: 1.4;
}

.pesty-pb-modal-root .pesty-pb-textarea {
	min-height: 80px;
	resize: vertical;
}

.pesty-pb-modal-root .pesty-pb-grid-2 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.pesty-pb-modal-root .pesty-pb-grid-3 {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

@media (max-width: 720px) {
	.pesty-pb-modal-root .pesty-pb-grid-2,
	.pesty-pb-modal-root .pesty-pb-grid-3 {
		grid-template-columns: 1fr;
	}
}

/* ---------------------------------------------------------------------
   Dropzone
   --------------------------------------------------------------------- */

.pesty-pb-modal-root .pesty-pb-dropzone,
.pesty-pb-app .pesty-pb-dropzone {
	border: 2px dashed #cbd5e1;
	border-radius: 10px;
	padding: 24px;
	text-align: center;
	background: #f8fafc;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
	position: relative;
	color: #0f172a;
}

.pesty-pb-modal-root .pesty-pb-dropzone:hover,
.pesty-pb-modal-root .pesty-pb-dropzone.is-dragover,
.pesty-pb-app .pesty-pb-dropzone:hover,
.pesty-pb-app .pesty-pb-dropzone.is-dragover {
	border-color: #6366f1;
	background: #eef2ff;
}

.pesty-pb-modal-root .pesty-pb-dropzone__hint {
	color: #64748b;
	font-size: 13px;
	margin-top: 6px;
}

.pesty-pb-modal-root .pesty-pb-dropzone__preview {
	margin-top: 12px;
	max-height: 200px;
	border-radius: 8px;
	display: inline-block;
}

.pesty-pb-modal-root .pesty-pb-dropzone__status {
	margin-top: 8px;
	font-size: 12px;
	color: #6366f1;
	font-weight: 500;
}

/* ---------------------------------------------------------------------
   Gallery
   --------------------------------------------------------------------- */

.pesty-pb-modal-root .pesty-pb-gallery,
.pesty-pb-app .pesty-pb-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 12px;
}

.pesty-pb-modal-root .pesty-pb-gallery__item,
.pesty-pb-app .pesty-pb-gallery__item {
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	display: flex;
	flex-direction: column;
}

.pesty-pb-modal-root .pesty-pb-gallery__img,
.pesty-pb-app .pesty-pb-gallery__img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	background: #f1f5f9;
	display: block;
}

.pesty-pb-modal-root .pesty-pb-gallery__meta,
.pesty-pb-app .pesty-pb-gallery__meta {
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.pesty-pb-modal-root .pesty-pb-gallery__meta-row,
.pesty-pb-app .pesty-pb-gallery__meta-row {
	font-size: 11px;
	color: #64748b;
}

.pesty-pb-modal-root .pesty-pb-gallery__actions,
.pesty-pb-app .pesty-pb-gallery__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

/* ---------------------------------------------------------------------
   Prompt fields with hint + AI improve button
   --------------------------------------------------------------------- */

.pesty-pb-modal-root .pesty-pb-field--prompt .pesty-pb-field__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 4px;
}

.pesty-pb-modal-root .pesty-pb-field--prompt .pesty-pb-field__label {
	margin: 0;
}

.pesty-pb-modal-root .pesty-pb-field__hint {
	font-size: 12px;
	color: #64748b;
	line-height: 1.4;
	margin: 0 0 6px;
}

.pesty-pb-modal-root .pesty-pb-field__status {
	font-size: 11px;
	color: #6366f1;
	margin-top: 4px;
	min-height: 14px;
}

.pesty-pb-modal-root .pesty-pb-btn--ai {
	background: linear-gradient(135deg, #6366f1, #8b5cf6);
	border-color: transparent;
	color: #fff;
}

.pesty-pb-modal-root .pesty-pb-btn--ai:hover {
	background: linear-gradient(135deg, #4f46e5, #7c3aed);
	border-color: transparent;
	color: #fff;
}

.pesty-pb-modal-root .pesty-pb-btn--ai:disabled {
	opacity: 0.7;
	cursor: wait;
}

.pesty-pb-modal-root .pesty-pb-btn--ai .dashicons-update {
	animation: pesty-pb-spin 1s linear infinite;
}

@keyframes pesty-pb-spin {
	to { transform: rotate(360deg); }
}

/* Tag chips below each prompt textarea — `button.pesty-pb-tag-chip` boosts
   specificity (0,2,1) so the generic modal-root button reset (0,2,0) can't
   override the chip styling. */
.pesty-pb-modal-root .pesty-pb-tag-chips {
	display: flex !important;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 6px;
	padding: 0;
	border: 0;
}

.pesty-pb-modal-root button.pesty-pb-tag-chip {
	display: inline-flex;
	align-items: center;
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 11px;
	font-weight: 500;
	color: #4f46e5;
	background: #eef2ff;
	border: 1px solid #c7d2fe;
	border-radius: 6px;
	padding: 3px 8px;
	cursor: pointer;
	line-height: 1.4;
	white-space: nowrap;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	height: auto;
	width: auto;
	margin: 0;
}

.pesty-pb-modal-root button.pesty-pb-tag-chip:hover,
.pesty-pb-modal-root button.pesty-pb-tag-chip:focus {
	background: #c7d2fe;
	border-color: #6366f1;
	color: #312e81;
	outline: none;
}

.pesty-pb-modal-root button.pesty-pb-tag-chip.is-empty {
	opacity: 0.45;
	cursor: not-allowed;
}

/* Collapsible preview with substituted tags.
   Styled on plain element selectors (no `.pesty-pb-modal-root` prefix) so the
   preview looks identical whether it lives in the modal or anywhere else the
   shared prompt-field module is reused. `details.pesty-pb-prompt-preview`
   gives 0,1,1 specificity which beats any single-class theme override. */
details.pesty-pb-prompt-preview {
	display: block !important;
	margin-top: 8px !important;
	border: 1px solid #e2e8f0 !important;
	border-radius: 8px !important;
	background: #f8fafc !important;
	overflow: hidden !important;
	padding: 0 !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

details.pesty-pb-prompt-preview > summary {
	list-style: none !important;
	cursor: pointer;
	padding: 8px 12px !important;
	margin: 0 !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	color: #475569 !important;
	display: flex !important;
	align-items: center;
	gap: 6px;
	user-select: none;
	background: transparent !important;
	border: 0 !important;
}

details.pesty-pb-prompt-preview > summary::-webkit-details-marker,
details.pesty-pb-prompt-preview > summary::marker {
	display: none;
	content: "";
}

details.pesty-pb-prompt-preview > summary::before {
	content: "▸";
	font-size: 10px;
	color: #94a3b8;
	display: inline-block;
	transition: transform 0.15s;
	margin-right: 2px;
}

details.pesty-pb-prompt-preview[open] > summary::before {
	transform: rotate(90deg);
}

details.pesty-pb-prompt-preview > summary:hover {
	background: #eef2ff !important;
	color: #0f172a !important;
}

details.pesty-pb-prompt-preview > summary .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

details.pesty-pb-prompt-preview > .pesty-pb-prompt-preview__body {
	display: block !important;
	padding: 10px 12px 12px !important;
	margin: 0 !important;
	border-top: 1px solid #e2e8f0;
	font-size: 13px !important;
	line-height: 1.5 !important;
	color: #0f172a !important;
	background: #fff !important;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.pesty-pb-prompt-preview__empty {
	color: #94a3b8;
	font-style: italic;
}

mark.pesty-pb-tag-empty {
	background: #fef2f2 !important;
	color: #b91c1c !important;
	border: 1px dashed #fca5a5 !important;
	border-radius: 4px !important;
	padding: 0 4px !important;
	font-family: ui-monospace, Menlo, Consolas, monospace !important;
	font-size: 11px !important;
}

/* ---------------------------------------------------------------------
   Final preview — collapsible, shows the complete API payload
   --------------------------------------------------------------------- */

details.pesty-pb-final-preview {
	display: block !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0;
	background: transparent;
}

details.pesty-pb-final-preview > summary {
	list-style: none !important;
	cursor: pointer;
	padding: 6px 0 !important;
	margin: 0 0 10px !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #4f46e5 !important;
	display: flex !important;
	align-items: center;
	gap: 6px;
	user-select: none;
}

details.pesty-pb-final-preview > summary::-webkit-details-marker,
details.pesty-pb-final-preview > summary::marker {
	display: none;
	content: "";
}

details.pesty-pb-final-preview > summary::before {
	content: "▸";
	font-size: 10px;
	color: #94a3b8;
	display: inline-block;
	transition: transform 0.15s;
}

details.pesty-pb-final-preview[open] > summary::before {
	transform: rotate(90deg);
}

details.pesty-pb-final-preview > summary .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	color: #6366f1;
}

.pesty-pb-final-preview__hint {
	font-size: 11px;
	font-weight: 500;
	text-transform: none;
	letter-spacing: normal;
	color: #94a3b8;
	margin-left: 2px;
}

.pesty-pb-final-preview__loading {
	padding: 16px;
	color: #94a3b8;
	font-style: italic;
	background: #f8fafc;
	border-radius: 8px;
	text-align: center;
}

.pesty-pb-final-preview__error {
	padding: 12px 16px;
	color: #b91c1c;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
}

.pesty-pb-final-preview__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Meta pills above the parts list */
.pesty-pb-payload-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 4px;
}

.pesty-pb-payload-meta__pill {
	font-size: 11px;
	font-weight: 500;
	color: #475569;
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	padding: 3px 10px;
	line-height: 1.3;
}

.pesty-pb-payload-meta__pill code {
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 11px;
	color: #0f172a;
}

/* Each part card */
.pesty-pb-payload-part {
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}

.pesty-pb-payload-part__head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	font-size: 11px;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
	color: #475569;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.pesty-pb-payload-part__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 18px;
	padding: 0 6px;
	background: #6366f1;
	color: #fff;
	border-radius: 4px;
	font-size: 10px;
}

.pesty-pb-payload-part__role {
	flex: 1;
}

.pesty-pb-payload-part--text .pesty-pb-payload-part__body {
	margin: 0 !important;
	padding: 12px 14px !important;
	background: #0f172a;
	color: #e2e8f0;
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 11.5px;
	line-height: 1.55;
	white-space: pre-wrap;
	word-break: break-word;
	max-height: 320px;
	overflow-y: auto;
}

.pesty-pb-payload-part--text.is-label .pesty-pb-payload-part__body {
	background: #1e293b;
	color: #fef3c7;
	border-left: 3px solid #f59e0b;
}

.pesty-pb-payload-part--image .pesty-pb-payload-part__image {
	display: flex;
	gap: 12px;
	padding: 12px;
	align-items: flex-start;
}

.pesty-pb-modal-root button.pesty-pb-payload-part__thumb {
	padding: 0;
	margin: 0;
	background: none;
	border: 0;
	cursor: zoom-in;
	flex: 0 0 auto;
	display: block;
	border-radius: 6px;
	overflow: hidden;
	transition: transform 0.15s, box-shadow 0.15s;
}

.pesty-pb-modal-root button.pesty-pb-payload-part__thumb:hover {
	transform: scale(1.04);
	box-shadow: 0 8px 16px -6px rgba(15, 23, 42, 0.25);
}

.pesty-pb-payload-part--image img {
	width: 96px;
	height: 96px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid #e2e8f0;
	background: #f1f5f9;
	display: block;
}

.pesty-pb-payload-part__image-meta {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	flex: 1;
}

.pesty-pb-payload-part__caption {
	font-size: 12px;
	font-weight: 500;
	color: #0f172a;
}

.pesty-pb-payload-part__url {
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 11px;
	color: #6366f1;
	background: #eef2ff;
	padding: 4px 8px;
	border-radius: 6px;
	text-decoration: none;
	word-break: break-all;
	display: inline-block;
	max-width: 100%;
}

.pesty-pb-payload-part__url:hover {
	background: #c7d2fe;
}

/* ---------------------------------------------------------------------
   Model warning banner — fires when non-Nano-Banana model is paired with
   an attached logo or reference photo
   --------------------------------------------------------------------- */

.pesty-pb-modal-root .pesty-pb-model-warning {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	margin-top: 12px;
	padding: 12px 14px;
	background: #fef3c7;
	border: 1px solid #f59e0b;
	border-radius: 8px;
	color: #78350f;
}

.pesty-pb-modal-root .pesty-pb-model-warning[hidden] {
	display: none;
}

.pesty-pb-modal-root .pesty-pb-model-warning__icon .dashicons {
	font-size: 22px;
	width: 22px;
	height: 22px;
	color: #d97706;
}

.pesty-pb-modal-root .pesty-pb-model-warning__body {
	flex: 1;
	font-size: 12.5px;
	line-height: 1.5;
}

.pesty-pb-modal-root .pesty-pb-model-warning__body strong {
	display: block;
	font-size: 13px;
	margin-bottom: 4px;
	color: #78350f;
}

.pesty-pb-modal-root .pesty-pb-model-warning__body p {
	margin: 0 0 8px;
	color: #78350f;
}

.pesty-pb-modal-root .pesty-pb-model-warning__body code {
	background: rgba(120, 53, 15, 0.08);
	padding: 1px 5px;
	border-radius: 3px;
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 11px;
}

/* Byte-loaded status badges inside the Final preview image cards */
.pesty-pb-modal-root .pesty-pb-payload-part__badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 11px;
	font-weight: 500;
	padding: 3px 8px;
	border-radius: 4px;
	width: max-content;
	max-width: 100%;
}

.pesty-pb-modal-root .pesty-pb-payload-part__badge.is-ok {
	background: #ecfdf5;
	color: #047857;
	border: 1px solid #6ee7b7;
}

.pesty-pb-modal-root .pesty-pb-payload-part__badge.is-err {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fca5a5;
}

.pesty-pb-modal-root .pesty-pb-payload-part__badge.is-info {
	background: #eef2ff;
	color: #4338ca;
	border: 1px solid #c7d2fe;
}

.pesty-pb-modal-root .pesty-pb-payload-part__badge .dashicons {
	font-size: 13px;
	width: 13px;
	height: 13px;
}

/* ---------------------------------------------------------------------
   Attachment-status chips (above the prompt preview)
   --------------------------------------------------------------------- */

.pesty-pb-modal-root .pesty-pb-attach-status {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

.pesty-pb-modal-root .pesty-pb-attach-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 11px;
	font-weight: 500;
	padding: 4px 10px;
	border-radius: 999px;
	border: 1px solid transparent;
	line-height: 1.2;
}

.pesty-pb-modal-root .pesty-pb-attach-chip.is-on {
	background: #ecfdf5;
	color: #047857;
	border-color: #6ee7b7;
}

.pesty-pb-modal-root .pesty-pb-attach-chip.is-off {
	background: #fef2f2;
	color: #b91c1c;
	border-color: #fecaca;
}

.pesty-pb-modal-root .pesty-pb-attach-chip.is-text {
	background: #f1f5f9;
	color: #64748b;
	border-color: #e2e8f0;
}

.pesty-pb-modal-root .pesty-pb-attach-chip .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

/* ---------------------------------------------------------------------
   Reference image checkboxes (generate modal)
   --------------------------------------------------------------------- */

.pesty-pb-modal-root .pesty-pb-checkbox {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: #fff;
	font-size: 13px;
	color: #0f172a;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
}

.pesty-pb-modal-root .pesty-pb-checkbox:hover {
	border-color: #6366f1;
	background: #f8fafc;
}

.pesty-pb-modal-root .pesty-pb-checkbox.is-disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.pesty-pb-modal-root .pesty-pb-checkbox.is-disabled:hover {
	border-color: #e2e8f0;
	background: #fff;
}

.pesty-pb-modal-root .pesty-pb-checkbox input[type="checkbox"] {
	-webkit-appearance: auto;
	appearance: auto;
	width: 18px;
	height: 18px;
	margin: 0;
	padding: 0;
	flex: 0 0 auto;
	cursor: pointer;
	display: inline-block;
	background: #fff;
	border: 1px solid #cbd5e1;
	border-radius: 4px;
}

.pesty-pb-modal-root .pesty-pb-checkbox span {
	flex: 1;
	line-height: 1.35;
}

.pesty-pb-modal-root .pesty-pb-checkbox .pesty-pb-ref-thumb {
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid #e2e8f0;
	flex: 0 0 auto;
}

.pesty-pb-modal-root .pesty-pb-checkbox--strict {
	align-items: flex-start;
}

.pesty-pb-modal-root .pesty-pb-checkbox--strict span {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

/* Extra references — multi-image staging for a single generate run */
.pesty-pb-modal-root .pesty-pb-extra-refs {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px dashed #cbd5e1;
}

.pesty-pb-modal-root .pesty-pb-extra-refs__head {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 8px;
	flex-wrap: wrap;
}

.pesty-pb-modal-root .pesty-pb-extra-refs__head strong {
	font-size: 13px;
	color: #0f172a;
}

.pesty-pb-modal-root .pesty-pb-extra-refs__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 8px;
}

.pesty-pb-modal-root .pesty-pb-extra-ref {
	position: relative;
	width: 72px;
	height: 72px;
	border-radius: 8px;
	border: 1px solid #cbd5e1;
	overflow: hidden;
	background: #f8fafc;
	flex: 0 0 auto;
}

.pesty-pb-modal-root .pesty-pb-extra-ref img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.pesty-pb-modal-root .pesty-pb-extra-ref.is-pending {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #64748b;
}

.pesty-pb-modal-root .pesty-pb-extra-ref__pending {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	font-size: 10px;
	text-align: center;
	padding: 4px;
}

.pesty-pb-modal-root .pesty-pb-extra-ref__pending .dashicons {
	animation: pesty-pb-spin 1s linear infinite;
}

@keyframes pesty-pb-spin {
	to { transform: rotate( 360deg ); }
}

.pesty-pb-modal-root .pesty-pb-extra-ref__remove {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 0;
	background: rgba(15, 23, 42, 0.7);
	color: #fff;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.pesty-pb-modal-root .pesty-pb-extra-ref__remove:hover {
	background: #ef4444;
}

.pesty-pb-modal-root .pesty-pb-checkbox--strict strong {
	font-size: 13px;
	color: #0f172a;
}

.pesty-pb-modal-root .pesty-pb-checkbox--strict small {
	font-size: 11px;
	color: #64748b;
	line-height: 1.4;
}

/* ---------------------------------------------------------------------
   Service categories — per-persona editor (form) + batch picker (generate)
   --------------------------------------------------------------------- */

.pesty-pb-modal-root .pesty-pb-categories {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 10px;
}

.pesty-pb-modal-root .pesty-pb-category-row {
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: #f8fafc;
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.pesty-pb-modal-root .pesty-pb-category-row__main {
	display: flex;
	align-items: center;
	gap: 8px;
}

.pesty-pb-modal-root .pesty-pb-category-row__main .pesty-pb-cat-name {
	flex: 1 1 auto;
}

.pesty-pb-modal-root .pesty-pb-category-row__main .pesty-pb-btn--ai {
	flex: 0 0 auto;
}

.pesty-pb-modal-root .pesty-pb-category-row__status {
	font-size: 11px;
	color: #64748b;
	line-height: 1.4;
	min-height: 0;
}

.pesty-pb-modal-root .pesty-pb-category-row__status:empty {
	display: none;
}

.pesty-pb-modal-root .pesty-pb-category-row__remove {
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	background: #fff;
	color: #64748b;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.pesty-pb-modal-root .pesty-pb-category-row__remove:hover {
	border-color: #ef4444;
	color: #ef4444;
}

.pesty-pb-modal-root .pesty-pb-cat-prompt {
	width: 100%;
}

/* Generate modal — category picker checkboxes */
.pesty-pb-modal-root .pesty-pb-categories-pick {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 8px;
}

.pesty-pb-modal-root .pesty-pb-category-pick span {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.pesty-pb-modal-root .pesty-pb-category-pick__hint {
	font-size: 11px;
	color: #64748b;
	line-height: 1.4;
}

/* Result grid — per-category group heading (spans the full grid row) */
.pesty-pb-modal-root .pesty-pb-result-group {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 6px;
	padding-bottom: 4px;
	border-bottom: 1px solid #e2e8f0;
	font-size: 13px;
	font-weight: 600;
	color: #0f172a;
}

.pesty-pb-modal-root .pesty-pb-result-group .dashicons {
	color: #64748b;
}

/* ---------------------------------------------------------------------
   Lightbox (overlays modal — must sit ABOVE .pesty-pb-modal-root z-index 99999)
   --------------------------------------------------------------------- */

.pesty-pb-lightbox {
	position: fixed !important;
	inset: 0 !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100vw !important;
	height: 100vh !important;
	z-index: 2147483646 !important; /* one below max — guaranteed to win */
	background: rgba(15, 23, 42, 0.92);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 32px;
	cursor: zoom-out;
	isolation: isolate;
}

.pesty-pb-lightbox.is-open {
	display: flex !important;
}

.pesty-pb-lightbox img {
	max-width: 100%;
	max-height: 100%;
	border-radius: 8px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
	cursor: default;
}

.pesty-pb-lightbox__close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	border: none;
	color: #fff;
	font-size: 20px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.pesty-pb-lightbox__close:hover {
	background: rgba(255, 255, 255, 0.28);
}

/* ---------------------------------------------------------------------
   Gallery filters + pagination + favorites
   --------------------------------------------------------------------- */

.pesty-pb-modal-root .pesty-pb-gallery-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin-bottom: 14px;
	padding-bottom: 12px;
	border-bottom: 1px solid #e2e8f0;
}

.pesty-pb-modal-root button.pesty-pb-filter-pill {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 12px;
	background: #fff;
	border: 1px solid #cbd5e1;
	border-radius: 999px;
	color: #475569;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	line-height: 1;
}

.pesty-pb-modal-root button.pesty-pb-filter-pill:hover {
	border-color: #6366f1;
	color: #4338ca;
}

.pesty-pb-modal-root button.pesty-pb-filter-pill.is-active {
	background: #fffbeb;
	border-color: #f59e0b;
	color: #b45309;
}

.pesty-pb-modal-root button.pesty-pb-filter-pill .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

.pesty-pb-modal-root .pesty-pb-filter-select {
	height: 32px;
	padding: 4px 26px 4px 10px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	background: #fff;
	color: #0f172a;
	font-size: 12px;
	min-width: 140px;
	width: auto;
}

.pesty-pb-modal-root button.pesty-pb-filter-clear {
	background: none;
	border: none;
	color: #64748b;
	font-size: 12px;
	cursor: pointer;
	padding: 4px 8px;
	text-decoration: underline;
}

.pesty-pb-modal-root button.pesty-pb-filter-clear:hover {
	color: #0f172a;
}

.pesty-pb-modal-root .pesty-pb-filter-count {
	margin-left: auto;
	font-size: 11px;
	color: #94a3b8;
	font-weight: 500;
}

/* Favorite star button overlaid on the thumbnail */
.pesty-pb-modal-root .pesty-pb-gallery__item {
	position: relative;
}

.pesty-pb-modal-root button.pesty-pb-gallery__fav {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	width: 30px;
	height: 30px;
	padding: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid rgba(15, 23, 42, 0.08);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #94a3b8;
	box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.2);
	transition: color 0.15s, background 0.15s, transform 0.15s;
}

.pesty-pb-modal-root button.pesty-pb-gallery__fav:hover {
	color: #f59e0b;
	background: #fff;
	transform: scale(1.08);
}

.pesty-pb-modal-root .pesty-pb-gallery__item.is-favorite button.pesty-pb-gallery__fav,
.pesty-pb-modal-root button.pesty-pb-gallery__fav[aria-pressed="true"] {
	color: #f59e0b;
	background: #fff;
}

.pesty-pb-modal-root button.pesty-pb-gallery__fav .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.pesty-pb-modal-root .pesty-pb-gallery__item.is-favorite {
	border-color: #f59e0b;
	box-shadow: 0 0 0 1px #f59e0b inset;
}

/* Bulk-select checkbox overlay (top-left of the thumbnail) */
.pesty-pb-modal-root .pesty-pb-gallery__select {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 2;
	width: 26px;
	height: 26px;
	display: block;
	cursor: pointer;
	opacity: 0.55;
	transition: opacity 0.15s;
}

.pesty-pb-modal-root .pesty-pb-gallery__item:hover .pesty-pb-gallery__select,
.pesty-pb-modal-root .pesty-pb-gallery__item.is-selected .pesty-pb-gallery__select {
	opacity: 1;
}

/* Hide the native checkbox but keep it interactive (covers the box). */
.pesty-pb-modal-root .pesty-pb-gallery__select input[type="checkbox"] {
	position: absolute;
	inset: 0;
	margin: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
	z-index: 1;
}

/* The visible square. */
.pesty-pb-modal-root .pesty-pb-gallery__select-box {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.96);
	border: 1.5px solid #94a3b8;
	border-radius: 6px;
	box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.25);
	transition: background 0.12s, border-color 0.12s, transform 0.12s;
}

.pesty-pb-modal-root .pesty-pb-gallery__select:hover .pesty-pb-gallery__select-box {
	border-color: #6366f1;
}

.pesty-pb-modal-root .pesty-pb-gallery__select-box .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	line-height: 1;
	color: transparent;
	transition: color 0.1s;
}

/* Checked state: filled square + visible check mark. */
.pesty-pb-modal-root .pesty-pb-gallery__select input:checked ~ .pesty-pb-gallery__select-box {
	background: #6366f1;
	border-color: #6366f1;
}

.pesty-pb-modal-root .pesty-pb-gallery__select input:checked ~ .pesty-pb-gallery__select-box .dashicons {
	color: #fff;
}

.pesty-pb-modal-root .pesty-pb-gallery__select input:focus-visible ~ .pesty-pb-gallery__select-box {
	outline: 2px solid #6366f1;
	outline-offset: 2px;
}

.pesty-pb-modal-root .pesty-pb-gallery__item.is-selected {
	border-color: #6366f1;
	box-shadow: 0 0 0 2px #6366f1 inset;
}

/* Locked persona — gallery is read-only; only Download stays usable. */
.pesty-pb-modal-root .pesty-pb-gallery-lockbanner {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	margin-bottom: 12px;
	background: #fffbeb;
	border: 1px solid #fcd34d;
	border-left: 4px solid #f59e0b;
	border-radius: 8px;
	color: #78350f;
	font-size: 13px;
	line-height: 1.4;
}

.pesty-pb-modal-root .pesty-pb-gallery-lockbanner .dashicons {
	color: #b45309;
	font-size: 16px;
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.pesty-pb-modal-root .pesty-pb-gallery__item.is-locked {
	position: relative;
}

.pesty-pb-modal-root .pesty-pb-gallery__item.is-locked .pesty-pb-gallery__select,
.pesty-pb-modal-root .pesty-pb-gallery__item.is-locked .pesty-pb-gallery__fav {
	display: none !important;
}

.pesty-pb-modal-root .pesty-pb-gallery__item.is-locked .pesty-pb-btn[disabled] {
	opacity: 0.45;
	cursor: not-allowed;
	pointer-events: auto;
}

.pesty-pb-modal-root .pesty-pb-gallery__item.is-locked .pesty-pb-btn[data-act="download"] {
	background: #6366f1;
	border-color: #6366f1;
	color: #fff;
	opacity: 1;
	cursor: pointer;
}

.pesty-pb-modal-root .pesty-pb-gallery__item.is-locked .pesty-pb-btn[data-act="download"]:hover {
	background: #4f46e5;
	border-color: #4f46e5;
}

/* Bulk action bar */
.pesty-pb-modal-root .pesty-pb-gallery-bulkbar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	margin-bottom: 12px;
	background: #eef2ff;
	border: 1px solid #c7d2fe;
	border-radius: 8px;
}

.pesty-pb-modal-root .pesty-pb-gallery-bulkbar[hidden] {
	display: none;
}

.pesty-pb-modal-root .pesty-pb-gallery-bulkbar__count {
	font-size: 13px;
	font-weight: 600;
	color: #4338ca;
	margin-right: auto;
}

/* Pagination */
.pesty-pb-modal-root .pesty-pb-gallery-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	justify-content: center;
	margin-top: 16px;
}

.pesty-pb-modal-root button.pesty-pb-page-btn {
	min-width: 32px;
	height: 32px;
	padding: 0 10px;
	background: #fff;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	color: #475569;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
}

.pesty-pb-modal-root button.pesty-pb-page-btn:hover {
	background: #f1f5f9;
	border-color: #94a3b8;
}

.pesty-pb-modal-root button.pesty-pb-page-btn.is-active {
	background: #6366f1;
	border-color: #6366f1;
	color: #fff;
}

.pesty-pb-modal-root button.pesty-pb-page-btn.is-disabled,
.pesty-pb-modal-root button.pesty-pb-page-btn[disabled] {
	opacity: 0.4;
	cursor: not-allowed;
}

/* ---------------------------------------------------------------------
   Toast
   --------------------------------------------------------------------- */

.pesty-pb-toasts {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	gap: 8px;
	pointer-events: none;
}

.pesty-pb-toasts .pesty-pb-toast {
	background: #0f172a;
	color: #fff;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 13px;
	box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.5);
	pointer-events: auto;
	min-width: 220px;
	animation: pesty-pb-toast-in 0.2s ease-out;
}

.pesty-pb-toasts .pesty-pb-toast--success { background: #16a34a; }
.pesty-pb-toasts .pesty-pb-toast--error   { background: #dc2626; }

@keyframes pesty-pb-toast-in {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------------
   Pagination
   --------------------------------------------------------------------- */

.pesty-pb-app .pesty-pb-pagination {
	display: flex;
	gap: 6px;
	justify-content: center;
	margin-top: 8px;
}

.pesty-pb-app .pesty-pb-pagination button {
	border: 1px solid var(--pesty-border-strong);
	background: #fff;
	color: var(--pesty-text);
	padding: 6px 10px;
	border-radius: 6px;
	font-size: 12px;
	cursor: pointer;
}

.pesty-pb-app .pesty-pb-pagination button:hover {
	background: #f1f5f9;
}

.pesty-pb-app .pesty-pb-pagination button.is-active {
	background: var(--pesty-primary);
	border-color: var(--pesty-primary);
	color: #fff;
}

.pesty-pb-app .pesty-pb-pagination button[disabled] {
	opacity: 0.4;
	cursor: not-allowed;
}

/* ---------------------------------------------------------------------
   Folder inline editor
   --------------------------------------------------------------------- */

.pesty-pb-app .pesty-pb-folder-edit {
	display: flex;
	gap: 6px;
	align-items: center;
	padding: 6px 8px;
	background: #eef2ff;
	border-radius: 8px;
}

.pesty-pb-app .pesty-pb-folder-edit input[type="text"] {
	flex: 1;
	min-width: 0;
	padding: 4px 8px;
	border: 1px solid var(--pesty-border-strong);
	border-radius: 6px;
	font-size: 13px;
	width: auto;
}

.pesty-pb-app .pesty-pb-folder-edit input[type="color"] {
	width: 28px;
	height: 28px;
	border: none;
	background: none;
	cursor: pointer;
	padding: 0;
	border-radius: 4px;
}

/* ---------------------------------------------------------------------
   Login notice
   --------------------------------------------------------------------- */

.pesty-pb-login-notice {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 24px;
	text-align: center;
	color: #64748b;
}

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */

@media (max-width: 900px) {
	.pesty-pb-app .pesty-pb-shell {
		grid-template-columns: 1fr;
	}
	.pesty-pb-app .pesty-pb-sidebar {
		max-height: 320px;
	}
}

/* ---------------------------------------------------------------------
   Generic Dashicon sizing inside the app (theme themes can shrink them)
   --------------------------------------------------------------------- */

.pesty-pb-app .dashicons,
.pesty-pb-modal-root .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	line-height: 1;
}

/* ---------------------------------------------------------------------
   Login-required card (shown when the shortcode renders for a guest)
   --------------------------------------------------------------------- */

.pesty-pb-login-required {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 32px 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #0f172a;
}

.pesty-pb-login-required__card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	padding: 32px 28px;
	max-width: 420px;
	width: 100%;
	text-align: center;
}

.pesty-pb-login-required__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #eef2ff;
	color: #6366f1;
	font-size: 22px;
	line-height: 1;
	margin-bottom: 14px;
}

.pesty-pb-login-required__icon.dashicons {
	font-size: 22px;
	width: 44px;
	height: 44px;
	padding: 11px;
	box-sizing: border-box;
}

.pesty-pb-login-required__title {
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 6px;
	color: #0f172a;
	line-height: 1.3;
}

.pesty-pb-login-required__text {
	font-size: 14px;
	color: #64748b;
	margin: 0 0 20px;
	line-height: 1.5;
}

.pesty-pb-login-required__btn {
	display: inline-block;
	background: #6366f1;
	color: #ffffff;
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	padding: 10px 22px;
	border-radius: 8px;
	transition: background 0.15s ease;
	border: 0;
	cursor: pointer;
}

.pesty-pb-login-required__btn:hover,
.pesty-pb-login-required__btn:focus {
	background: #4f46e5;
	color: #ffffff;
	text-decoration: none;
	outline: none;
}

.pesty-pb-login-required__btn:focus-visible {
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}
