/**
 * Prompt Engine — hub catalog, dashboard sidebar, lock screen.
 * App-style sidebar that collapses to an icon rail.
 */

/* PE pages set `body.pe-app-page` (see PE_Plugin::maybe_add_app_body_class).
 * Clip horizontal overflow at the document edge so full-bleed backgrounds
 * inside the hub, agency, leads, integrations, and whitelabel screens can
 * never produce a stray horizontal scrollbar. `overflow-x: clip` keeps
 * sticky headers working (unlike `overflow-x: hidden`, which breaks them
 * by establishing a new scrolling context). Modern Chrome/Edge/FF/Safari
 * all support `clip`; we add `hidden` underneath as the legacy fallback. */
body.pe-app-page {
	overflow-x: hidden;
}
@supports (overflow: clip) {
	body.pe-app-page {
		overflow-x: clip;
	}
}

/* ----------------------------------------------------------------------------
   Dashboard shell
   ---------------------------------------------------------------------------- */

.pe-dash-wrap {
	--pe-dash-width: 14rem;
	--pe-dash-collapsed-w: 3.25rem;
	--pe-dash-bg: #0b1020;
	--pe-dash-bg-2: #0f172a;
	--pe-dash-border: rgba(148, 163, 184, 0.14);
	--pe-dash-ink: #e2e8f0;
	--pe-dash-ink-strong: #f8fafc;
	--pe-dash-muted: #94a3b8;
	--pe-dash-hover: rgba(148, 163, 184, 0.08);
	--pe-dash-active: rgba(99, 102, 241, 0.18);
	--pe-dash-active-bar: linear-gradient(180deg, #6366f1, #14b8a6);
	--pe-dash-good: #5eead4;
	--pe-dash-warn: #fdba74;
	--pe-dash-accent: #f97316;
	display: flex;
	flex-direction: row;
	align-items: stretch;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	min-height: 0;
	gap: 0;
	font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

.pe-dash-sidebar {
	flex: 0 0 var(--pe-dash-width);
	width: var(--pe-dash-width);
	min-width: 0;
	align-self: stretch;
	position: sticky;
	top: 0;
	z-index: 5;
	display: flex;
	flex-direction: column;
	max-height: 100vh;
	max-height: 100dvh;
	background: linear-gradient(180deg, var(--pe-dash-bg) 0%, var(--pe-dash-bg-2) 100%);
	border-right: 1px solid var(--pe-dash-border);
	color: var(--pe-dash-ink);
	transition: flex-basis 0.22s ease, width 0.22s ease, min-width 0.22s ease;
	overflow: hidden;
}

.admin-bar .pe-dash-sidebar {
	top: 32px;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
}

@media (max-width: 782px) {
	.admin-bar .pe-dash-sidebar {
		top: 46px;
		max-height: calc(100vh - 46px);
		max-height: calc(100dvh - 46px);
	}
}

.pe-dash-wrap.is-collapsed .pe-dash-sidebar {
	flex: 0 0 var(--pe-dash-collapsed-w);
	width: var(--pe-dash-collapsed-w);
	min-width: var(--pe-dash-collapsed-w);
}

/* ---- Header (brand + toggle) ---- */

.pe-dash-sidebar__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.85rem 0.85rem 0.75rem;
	border-bottom: 1px solid var(--pe-dash-border);
	min-height: 3.25rem;
}

.pe-dash-sidebar__brand {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	min-width: 0;
	overflow: hidden;
}

.pe-dash-sidebar__logo {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	border-radius: 6px;
	background: linear-gradient(135deg, #6366f1 0%, #a78bfa 50%, #14b8a6 100%);
	box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* Whitelabel: customer-supplied logo replaces the gradient mark. */
.pe-dash-sidebar__logo--custom {
	background: var(--pe-dash-bg-2, #0f172a);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.pe-dash-sidebar__logo--custom img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.pe-dash-sidebar__brand-text {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--pe-dash-ink-strong);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pe-dash-wrap.is-collapsed .pe-dash-sidebar__brand-text {
	display: none;
}

.pe-dash-wrap.is-collapsed .pe-dash-sidebar__head {
	padding-left: 0.6rem;
	padding-right: 0.6rem;
	justify-content: center;
}

.pe-dash-wrap.is-collapsed .pe-dash-sidebar__brand {
	display: none;
}

.pe-dash-sidebar__toggle {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	padding: 0;
	margin: 0;
	border-radius: 7px;
	background: rgba(148, 163, 184, 0.06);
	border: 1px solid var(--pe-dash-border);
	color: var(--pe-dash-muted);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pe-dash-sidebar__toggle:hover {
	background: rgba(99, 102, 241, 0.18);
	color: var(--pe-dash-ink-strong);
	border-color: rgba(99, 102, 241, 0.4);
}

.pe-dash-sidebar__toggle:focus-visible {
	outline: 2px solid #818cf8;
	outline-offset: 2px;
}

.pe-dash-sidebar__toggle-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.pe-dash-sidebar__toggle-icon--expand {
	display: none;
}

.pe-dash-wrap.is-collapsed .pe-dash-sidebar__toggle-icon--collapse {
	display: none;
}

.pe-dash-wrap.is-collapsed .pe-dash-sidebar__toggle-icon--expand {
	display: inline-flex;
}

/* ---- Nav body ---- */

.pe-dash-nav {
	flex: 1 1 auto;
	min-height: 0;
	padding: 0.6rem 0.5rem 1rem;
	overflow-y: auto;
	overflow-x: hidden;
	scrollbar-width: thin;
	scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

.pe-dash-nav::-webkit-scrollbar {
	width: 6px;
}

.pe-dash-nav::-webkit-scrollbar-thumb {
	background: rgba(148, 163, 184, 0.25);
	border-radius: 3px;
}

.pe-dash-nav__group + .pe-dash-nav__group {
	margin-top: 0.85rem;
	padding-top: 0.85rem;
	border-top: 1px solid var(--pe-dash-border);
}

.pe-dash-nav__heading {
	margin: 0 0 0.35rem 0.5rem;
	font-size: 0.5625rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--pe-dash-muted);
}

.pe-dash-wrap.is-collapsed .pe-dash-nav__heading {
	display: none;
}

.pe-dash-wrap.is-collapsed .pe-dash-nav__group + .pe-dash-nav__group {
	margin-top: 0.55rem;
	padding-top: 0.55rem;
}

.pe-dash-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.pe-dash-nav__item {
	margin: 0;
	padding: 0;
}

/* ---- Menu row ---- */

.pe-dash-nav__row {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.45rem 0.55rem;
	border-radius: 8px;
	font-size: 0.8rem;
	font-weight: 500;
	line-height: 1.25;
	color: var(--pe-dash-ink);
	text-decoration: none;
	cursor: pointer;
	border: 1px solid transparent;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	min-width: 0;
}

a.pe-dash-nav__row { color: var(--pe-dash-ink); }
span.pe-dash-nav__row { cursor: default; }

.pe-dash-nav__row:hover {
	background: var(--pe-dash-hover);
	color: var(--pe-dash-ink-strong);
}

.pe-dash-nav__row.is-active,
.pe-dash-nav__row.is-active:hover {
	background: var(--pe-dash-active);
	color: var(--pe-dash-ink-strong);
	cursor: default;
}

.pe-dash-nav__row.is-active::before {
	content: "";
	position: absolute;
	left: -0.5rem;
	top: 0.35rem;
	bottom: 0.35rem;
	width: 3px;
	border-radius: 0 3px 3px 0;
	background: var(--pe-dash-active-bar);
	box-shadow: 0 0 12px rgba(99, 102, 241, 0.45);
}

.pe-dash-nav__row.is-locked {
	color: var(--pe-dash-muted);
}

.pe-dash-nav__row.is-locked:hover {
	color: var(--pe-dash-ink);
}

.pe-dash-nav__icon {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	color: currentColor;
	opacity: 0.85;
}

/* Whitelabel per-product logo override: replaces the default SVG icon
 * inside .pe-dash-nav__icon when a customer has uploaded a logo for the
 * product slug. Constrained to the icon slot so the row layout is
 * unchanged. */
.pe-dash-nav__logo {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
	border-radius: 3px;
}

.pe-dash-nav__row.is-active .pe-dash-nav__icon {
	color: #a5b4fc;
	opacity: 1;
}

.pe-dash-nav__label {
	flex: 1 1 auto;
	min-width: 0;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	overflow: hidden;
}

.pe-dash-nav__label-text {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pe-dash-nav__lock {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--pe-dash-warn);
	opacity: 0.75;
	width: 13px;
	height: 13px;
}

.pe-dash-nav__lock svg {
	width: 13px;
	height: 13px;
}

/* ---- Buy button (only on hub for locked items) ---- */

.pe-dash-nav__buy {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	margin: 0.2rem 0 0.35rem 2.05rem;
	padding: 0.3rem 0.55rem;
	border-radius: 7px;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	border: 1px solid rgba(249, 115, 22, 0.55);
	background: rgba(249, 115, 22, 0.12);
	color: #fed7aa;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

a.pe-dash-nav__buy:hover {
	text-decoration: none;
}

.pe-dash-nav__buy:hover {
	background: var(--pe-dash-accent);
	color: #0b0f1f;
	border-color: var(--pe-dash-accent);
}

.pe-dash-nav__buy:active {
	transform: translateY(1px);
}

.pe-dash-nav__buy-icon {
	display: inline-flex;
	width: 13px;
	height: 13px;
}

.pe-dash-nav__buy-icon svg {
	width: 13px;
	height: 13px;
}

.pe-dash-nav__hint {
	display: block;
	margin: 0.2rem 0 0.35rem 2.05rem;
	font-size: 0.65rem;
	line-height: 1.35;
	color: var(--pe-dash-muted);
}

/* ---- Collapsed (icon rail) state ---- */

.pe-dash-wrap.is-collapsed .pe-dash-nav {
	padding-left: 0.35rem;
	padding-right: 0.35rem;
}

.pe-dash-wrap.is-collapsed .pe-dash-nav__row {
	justify-content: center;
	gap: 0;
	padding: 0.55rem 0;
	border-radius: 8px;
}

.pe-dash-wrap.is-collapsed .pe-dash-nav__row.is-active::before {
	left: -0.35rem;
}

.pe-dash-wrap.is-collapsed .pe-dash-nav__label,
.pe-dash-wrap.is-collapsed .pe-dash-nav__hint,
.pe-dash-wrap.is-collapsed .pe-dash-nav__buy {
	display: none;
}

/* ----------------------------------------------------------------------------
   Main content area
   ---------------------------------------------------------------------------- */

.pe-dash-main {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	position: relative;
	z-index: 1;
}

/* Plugin-native dashboards (Leads, Agency, Knowledge Base) need a backdrop
   so their dark gradient cards don't sit on bare white from the theme.
   Reuses the themed sidebar bg-2 token, so light/dark mode swap
   automatically. KB was previously missing — its hero + card grid have
   transparent gaps (page padding, grid gutters, below-the-fold space)
   where the theme's white was bleeding through, leaving visible white
   strips around the content. */
.pe-dash-main:has(> .pe-leads),
.pe-dash-main:has(> .pe-agency),
.pe-dash-main:has(> .pe-kb-page) {
	background: var(--pe-dash-bg-2);
}

/* "Open this prompt in your AI tool" how-to banner shown above every
   prompt textarea across all 3 prompt-engine products. Adapts to dark/light
   parent cards via color: inherit and translucent indigo accents. */
.pe-prompt-howto {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	margin: 0 0 0.7rem;
	padding: 0.65rem 0.85rem;
	border-radius: 10px;
	background: rgba(99, 102, 241, 0.12);
	border: 1px solid rgba(99, 102, 241, 0.30);
	color: inherit;
	font-size: 0.86rem;
	line-height: 1.45;
}
.pe-prompt-howto__icon {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(99, 102, 241, 0.42);
	color: #ffffff;
	font-weight: 800;
	font-size: 0.74rem;
	margin-top: 0.05rem;
}
.pe-prompt-howto__text { min-width: 0; flex: 1 1 auto; }
.pe-prompt-howto strong { color: #c7d2fe; }
[data-pe-theme="light"] .pe-prompt-howto {
	background: rgba(99, 102, 241, 0.08);
	border-color: rgba(99, 102, 241, 0.28);
	color: #1e293b;
}
[data-pe-theme="light"] .pe-prompt-howto strong { color: #4338ca; }
[data-pe-theme="light"] .pe-prompt-howto__icon { background: #6366f1; }

/* Cancel EDAC's full-viewport breakout inside the shell. */
.pe-dash-main > .edac {
	width: 100% !important;
	max-width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	left: auto !important;
	right: auto !important;
	position: relative;
}

@supports (width: 100svw) {
	.pe-dash-main > .edac {
		width: 100% !important;
		max-width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}
}

/* Any vstack layout inside the shell (e.g. vstack--studio) */
.pe-dash-main > .vstack,
.pe-dash-main > .mot,
.pe-dash-main > .edac {
	flex: 1 1 auto;
	min-width: 0;
	min-height: min(100vh, 100dvh);
}

/* Shared backdrop for the three prompt engines — same base as Leads/Agency/KB */
.pe-dash-main:has(> .vstack),
.pe-dash-main:has(> .mot),
.pe-dash-main:has(> .edac) {
	background: var(--pe-dash-bg-2);
}

/* -------------------------------------------------------------------------
   Prompt engines: map product CSS variables to dashboard tokens so colors
   match the sidebar. Light/dark follow [data-pe-theme] on the root element.
   ------------------------------------------------------------------------- */
.pe-dash-main > .vstack {
	--v-ink: var(--pe-dash-ink-strong);
	--v-ink-soft: var(--pe-dash-ink);
	--v-muted: var(--pe-dash-muted);
	--v-faint: var(--pe-dash-muted);
	--v-cream: var(--pe-dash-bg-2);
	--v-cream-deep: var(--pe-dash-bg);
	--v-paper: #1e293b;
	--v-line: var(--pe-dash-border);
	--v-line-soft: var(--pe-dash-border);
	--v-accent: #6366f1;
	--v-accent-deep: #4f46e5;
	--v-accent-soft: var(--pe-dash-active);
	--v-gold: var(--pe-dash-warn);
	--v-gold-soft: rgba(253, 186, 116, 0.22);
	--v-thread-max: 1180px;
	color: var(--v-ink);
	background: var(--v-cream);
	width: 100% !important;
	max-width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	position: relative;
}
[data-pe-theme="light"] .pe-dash-main > .vstack {
	--v-paper: #ffffff;
}
.pe-dash-main > .vstack .vstack-textarea--prompt {
	background: var(--v-paper);
}
.pe-dash-main > .vstack .vstack-btn--primary,
.pe-dash-main > .vstack .vstack-btn--primary:hover {
	color: #ffffff;
}
.pe-dash-main > .vstack .vstack-btn--secondary:hover {
	color: #ffffff;
}

.pe-dash-main > .mot {
	--mot-ink: var(--pe-dash-ink-strong);
	--mot-ink-soft: var(--pe-dash-ink);
	--mot-muted: var(--pe-dash-muted);
	--mot-faint: var(--pe-dash-muted);
	--mot-line: var(--pe-dash-border);
	--mot-line-soft: var(--pe-dash-border);
	--mot-surface: var(--pe-dash-bg-2);
	--mot-panel: var(--pe-dash-bg);
	--mot-accent: #6366f1;
	--mot-accent-deep: #4f46e5;
	--mot-accent-soft: var(--pe-dash-active);
	--mot-code-bg: var(--pe-dash-bg);
	--mot-code-text: var(--pe-dash-ink);
	--mot-code-muted: var(--pe-dash-muted);
	--mot-code-line: var(--pe-dash-border);
	color: var(--mot-ink);
	background: var(--mot-surface);
}
.pe-dash-main > .mot .mot__stage-build {
	background: #6366f1;
	color: #ffffff;
}
.pe-dash-main > .mot .mot__stage-build:hover {
	background: #4f46e5;
}
.pe-dash-main > .mot .mot__stage-build:disabled {
	background: var(--pe-dash-muted);
	color: rgba(255, 255, 255, 0.85);
}
.pe-dash-main > .mot .mot__card-copy:hover,
.pe-dash-main > .mot .mot__stage-copy:hover {
	background: rgba(255, 255, 255, 0.06);
}
[data-pe-theme="light"] .pe-dash-main > .mot .mot__card-copy:hover,
[data-pe-theme="light"] .pe-dash-main > .mot .mot__stage-copy:hover {
	background: rgba(15, 23, 42, 0.06);
}
.pe-dash-main > .mot .mot__card-run,
.pe-dash-main > .mot .mot__stage-run {
	background: #6366f1;
	color: #ffffff;
	border-color: #4f46e5;
}
.pe-dash-main > .mot .mot__card-run:hover,
.pe-dash-main > .mot .mot__stage-run:hover {
	background: #4f46e5;
}

.pe-dash-main > .edac {
	--edac-ink: var(--pe-dash-ink-strong);
	--edac-ink-soft: var(--pe-dash-ink);
	--edac-muted: var(--pe-dash-muted);
	--edac-faint: var(--pe-dash-muted);
	--edac-surface: var(--pe-dash-bg-2);
	--edac-surface-alt: var(--pe-dash-bg);
	--edac-line: var(--pe-dash-border);
	--edac-line-soft: var(--pe-dash-border);
	--edac-accent: #6366f1;
	--edac-accent-soft: var(--pe-dash-active);
	--edac-tint-mint: #14b8a6;
	--edac-tint-mint-soft: rgba(20, 184, 166, 0.18);
	--edac-tint-lavender: #818cf8;
	--edac-tint-lavender-soft: rgba(129, 140, 248, 0.2);
	--edac-tint-peach: #f97316;
	--edac-tint-peach-soft: rgba(249, 115, 22, 0.15);
	--edac-tint-sky: #38bdf8;
	--edac-tint-sky-soft: rgba(56, 189, 248, 0.18);
	--edac-tint-butter: var(--pe-dash-warn);
	--edac-tint-butter-soft: rgba(253, 186, 116, 0.2);
	--edac-tint-sage: #34d399;
	--edac-tint-sage-soft: rgba(52, 211, 153, 0.18);
	--edac-tint-blush: #f472b6;
	--edac-tint-blush-soft: rgba(244, 114, 182, 0.18);
	color: var(--edac-ink);
	background: var(--edac-surface);
}
.pe-dash-main > .edac .edac__cmdbar-go,
.pe-dash-main > .edac .edac__sticky-go,
.pe-dash-main > .edac .edac__refine-btn {
	background: #6366f1;
	color: #ffffff;
}
.pe-dash-main > .edac .edac__cmdbar-go:hover,
.pe-dash-main > .edac .edac__sticky-go:hover,
.pe-dash-main > .edac .edac__refine-btn:hover {
	background: #4f46e5;
}
.pe-dash-main > .edac .edac__refine-btn:disabled {
	background: var(--edac-faint);
	color: rgba(255, 255, 255, 0.9);
}

/* ----------------------------------------------------------------------------
   Mobile
   ---------------------------------------------------------------------------- */

@media (max-width: 900px) {
	.pe-dash-wrap {
		flex-direction: column;
	}

	.pe-dash-sidebar {
		position: sticky;
		top: 0;
		flex: 0 0 auto !important;
		width: 100% !important;
		min-width: 0 !important;
		max-height: none;
		border-right: 0;
		border-bottom: 1px solid var(--pe-dash-border);
	}

	.pe-dash-wrap.is-collapsed .pe-dash-sidebar {
		width: 100% !important;
		min-width: 0 !important;
	}

	.pe-dash-sidebar__head {
		padding: 0.7rem 0.85rem;
		min-height: 2.85rem;
	}

	.pe-dash-wrap.is-collapsed .pe-dash-sidebar__head {
		justify-content: space-between;
	}

	.pe-dash-wrap.is-collapsed .pe-dash-sidebar__brand {
		display: flex;
	}

	.pe-dash-wrap.is-collapsed .pe-dash-sidebar__brand-text {
		display: inline;
	}

	.pe-dash-wrap.is-collapsed .pe-dash-nav {
		display: none;
	}

	.pe-dash-nav__list {
		gap: 0.1rem;
	}
}

/* ----------------------------------------------------------------------------
   Membership hub — full-bleed app layout
   ---------------------------------------------------------------------------- */

.pe-hub-app {
	--hub-bg: #060818;
	--hub-bg-2: #0a0f1f;
	--hub-ink: #e6ebf5;
	--hub-ink-strong: #f8fafc;
	--hub-muted: #8b94a8;
	--hub-border: rgba(148, 163, 184, 0.14);
	--hub-border-strong: rgba(148, 163, 184, 0.22);
	--hub-card-bg: linear-gradient(165deg, rgba(99, 102, 241, 0.05) 0%, rgba(15, 23, 42, 0.6) 60%);
	--hub-radius: 18px;
	--hub-accent: #6366f1;
	--hub-accent-2: #14b8a6;
	--hub-good-bg: rgba(20, 184, 166, 0.15);
	--hub-good-ink: #5eead4;
	--hub-locked-bg: rgba(148, 163, 184, 0.08);
	--hub-locked-ink: #cbd5e1;
	--hub-warm-bg: rgba(249, 115, 22, 0.13);
	--hub-warm-ink: #fdba74;

	/* Full-bleed breakout inside constrained themes.
	 * The previous version used `width: 100vw; margin-left: -50vw;` —
	 * that always pushed 1–2px past the visible viewport on Windows /
	 * any environment where the vertical scrollbar takes its own gutter
	 * (because `vw` *includes* the scrollbar gutter), which surfaced as
	 * a stray horizontal scrollbar on the hub / catalog page.
	 *
	 * Safe baseline: behave like a normal block (no breakout) so the
	 * page never overflows. Modern browsers that understand the small
	 * viewport unit `svw` opt into the real edge-to-edge background. */
	position: relative;
	left: auto;
	right: auto;
	width: 100%;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
	background:
		radial-gradient(ellipse 60% 40% at 0% 0%, rgba(99, 102, 241, 0.16), transparent 60%),
		radial-gradient(ellipse 50% 35% at 100% 0%, rgba(20, 184, 166, 0.10), transparent 65%),
		var(--hub-bg);
	color: var(--hub-ink);
	font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	min-height: min(100vh, 100dvh);
	overflow-x: clip;
}

@supports (width: 100svw) {
	.pe-hub-app {
		width: 100svw;
		max-width: none;
		margin-left: calc(50% - 50svw);
		margin-right: calc(50% - 50svw);
	}
}

/* Belt-and-braces: clip any stray overflow at the document edge when
 * the hub renders. Scoped via `:has()` so it doesn't affect themes that
 * never embed the hub shortcode. */
@supports selector(html:has(*)) {
	html:has(.pe-hub-app) {
		overflow-x: clip;
	}
}

.pe-hub-app * { box-sizing: border-box; }

.pe-hub-app__shell {
	width: 100%;
	max-width: 100%;
}

/* Topbar bridge for non-hub dashboards (leads / agency / integrations /
   branding / knowledge base). The hub's `.pe-hub-app__topbar` styling
   reads `--hub-*` tokens, but those are only declared inside
   `.pe-hub-app`. When the topbar is rendered inside a plain
   `.pe-dash-wrap` (no `.pe-hub-app` ancestor), provide the same tokens
   here so the existing topbar CSS keeps working without any duplication.
   The `:not(.pe-hub-app__shell)` guard keeps the hub itself untouched
   (it sets its own values via the `.pe-hub-app` block above). */
.pe-dash-wrap:not(.pe-hub-app__shell) {
	--hub-ink: #e6ebf5;
	--hub-ink-strong: #f8fafc;
	--hub-muted: #8b94a8;
	--hub-border: rgba(148, 163, 184, 0.14);
	--hub-border-strong: rgba(148, 163, 184, 0.22);
}

/* Light-mode flip for the bridge above. Without this the topbar's
   brand text / tag / user-name / sign-out label all stayed at their
   dark-mode `#f8fafc` color even after the topbar background flipped
   to white via `[data-pe-theme="light"] .pe-hub-app__topbar`,
   producing invisible white-on-white text on every non-hub dashboard
   (Leads, Agency, Integrations, Branding, Knowledge Base). Values
   mirror the hub's own light-mode block (see
   `[data-pe-theme="light"] .pe-hub-app`) so both layouts read
   identically when light theme is active. */
[data-pe-theme="light"] .pe-dash-wrap:not(.pe-hub-app__shell) {
	--hub-ink: #334155;
	--hub-ink-strong: #0f172a;
	--hub-muted: #64748b;
	--hub-border: rgba(15, 23, 42, 0.10);
	--hub-border-strong: rgba(15, 23, 42, 0.16);
}

/* Edge-to-edge breakout for non-hub dashboards (Leads, Agency,
 * Integrations, Branding, Knowledge Base). Themes that constrain
 * `.entry-content` to ~700–1200px were squeezing these dashboards
 * into the same narrow column that body copy uses, leaving large
 * empty gutters on widescreen monitors. The hub already does its
 * own `100svw` breakout (see `.pe-hub-app` block above), so we use
 * `:not(.pe-hub-app__shell)` to avoid double-breaking out there.
 *
 * Scoped to `body.pe-app-page` so this only fires on plugin-owned
 * full-screen pages — themes that embed PE shortcodes on a regular
 * blog post still render at the post column width as before.
 *
 * `100svw` matches the visible viewport (excluding the vertical
 * scrollbar gutter on Windows / GTK), so we never overflow the
 * document edge. Older browsers without `svw` simply skip the
 * breakout and fall back to whatever the theme provides — exactly
 * the prior behaviour, no regression. */
@supports (width: 100svw) {
	body.pe-app-page .pe-dash-wrap:not(.pe-hub-app__shell) {
		width: 100svw;
		max-width: none;
		margin-left: calc(50% - 50svw);
		margin-right: calc(50% - 50svw);
	}
}

.pe-hub-app__main {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: 0;
}

/* ---- Top bar ---- */

.pe-hub-app__topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem clamp(1.1rem, 3vw, 2.25rem);
	border-bottom: 1px solid var(--hub-border);
	background: linear-gradient(180deg, rgba(11, 16, 32, 0.92), rgba(11, 16, 32, 0.6));
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	position: sticky;
	top: 0;
	z-index: 4;
}

.admin-bar .pe-hub-app__topbar { top: 32px; }
@media (max-width: 782px) {
	.admin-bar .pe-hub-app__topbar { top: 46px; }
}

.pe-hub-app__topbar-left {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	min-width: 0;
}

.pe-hub-app__brand-dot {
	flex-shrink: 0;
	width: 26px; height: 26px;
	border-radius: 8px;
	background: linear-gradient(135deg, #6366f1 0%, #a78bfa 50%, #14b8a6 100%);
	box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.pe-hub-app__brand-text {
	font-weight: 700;
	font-size: 0.95rem;
	letter-spacing: -0.01em;
	color: var(--hub-ink-strong);
}

.pe-hub-app__brand-divider {
	display: inline-block;
	width: 1px; height: 16px;
	background: var(--hub-border-strong);
	margin: 0 0.15rem;
}

.pe-hub-app__brand-tag {
	font-size: 0.78rem;
	font-weight: 500;
	color: var(--hub-muted);
	letter-spacing: 0.01em;
}

@media (max-width: 540px) {
	.pe-hub-app__brand-divider,
	.pe-hub-app__brand-tag { display: none; }
}

.pe-hub-app__topbar-right {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
}

.pe-hub-app__user {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.3rem 0.65rem 0.3rem 0.4rem;
	border-radius: 999px;
	background: rgba(148, 163, 184, 0.06);
	border: 1px solid var(--hub-border);
}

.pe-hub-app__avatar {
	display: inline-grid;
	place-items: center;
	width: 26px; height: 26px;
	border-radius: 999px;
	background: linear-gradient(135deg, #6366f1, #14b8a6);
	color: #0b0f1f;
	font-weight: 800;
	font-size: 0.72rem;
	letter-spacing: 0;
}

.pe-hub-app__user-name {
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--hub-ink-strong);
	max-width: 12rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

@media (max-width: 540px) {
	.pe-hub-app__user-name { display: none; }
}

.pe-hub-app__signout {
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--hub-muted);
	text-decoration: none;
	padding: 0.42rem 0.7rem;
	border-radius: 8px;
	border: 1px solid transparent;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.pe-hub-app__signout:hover,
.pe-hub-app__signout:focus-visible {
	color: var(--hub-ink-strong);
	background: rgba(148, 163, 184, 0.08);
	border-color: var(--hub-border);
}

/* ---- Animated Support button (topbar) ----
 *
 * Eye-catching pill that links out to the helpdesk. Uses a warm
 * orange→red gradient that reads well on both the dark hub topbar
 * and the light theme. Layered animations: a soft pulsing ring,
 * a slow shine sweep, and a periodic icon wiggle. Honors
 * prefers-reduced-motion. */

.pe-hub-app__support {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.42rem 0.85rem 0.42rem 0.7rem;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	color: #fff;
	text-decoration: none;
	background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
	border: 1px solid rgba(255, 255, 255, 0.22);
	box-shadow: 0 6px 18px -8px rgba(239, 68, 68, 0.55), 0 1px 0 rgba(255, 255, 255, 0.18) inset;
	overflow: hidden;
	isolation: isolate;
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.pe-hub-app__support:hover,
.pe-hub-app__support:focus-visible {
	color: #fff;
	transform: translateY(-1px);
	filter: brightness(1.08);
	box-shadow: 0 12px 26px -10px rgba(239, 68, 68, 0.7), 0 1px 0 rgba(255, 255, 255, 0.22) inset;
	outline: none;
}
.pe-hub-app__support:focus-visible {
	box-shadow: 0 12px 26px -10px rgba(239, 68, 68, 0.7), 0 0 0 3px rgba(249, 115, 22, 0.45);
}
.pe-hub-app__support::before {
	content: "";
	position: absolute;
	inset: -5px;
	border-radius: 999px;
	border: 2px solid rgba(249, 115, 22, 0.55);
	opacity: 0;
	pointer-events: none;
	z-index: -1;
	animation: peSupportPulse 2.4s ease-out infinite;
}
.pe-hub-app__support::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, 0.32) 50%, transparent 65%);
	background-size: 220% 100%;
	background-position: 200% 0;
	pointer-events: none;
	mix-blend-mode: screen;
	animation: peSupportShine 4.2s ease-in-out infinite;
}
.pe-hub-app__support-icon {
	display: inline-grid;
	place-items: center;
	width: 18px;
	height: 18px;
	color: #fff;
	transform-origin: 50% 50%;
	animation: peSupportWiggle 3.2s ease-in-out infinite;
}
.pe-hub-app__support-icon svg { display: block; }
.pe-hub-app__support-label { line-height: 1; }

@keyframes peSupportPulse {
	0%   { transform: scale(0.94); opacity: 0.55; }
	70%  { transform: scale(1.18); opacity: 0; }
	100% { transform: scale(1.18); opacity: 0; }
}
@keyframes peSupportShine {
	0%, 100% { background-position: 200% 0; }
	60%      { background-position: -120% 0; }
}
@keyframes peSupportWiggle {
	0%, 70%, 100% { transform: rotate(0deg); }
	76%           { transform: rotate(-9deg); }
	82%           { transform: rotate(8deg); }
	88%           { transform: rotate(-4deg); }
	94%           { transform: rotate(2deg); }
}

@media (prefers-reduced-motion: reduce) {
	.pe-hub-app__support::before,
	.pe-hub-app__support::after,
	.pe-hub-app__support-icon { animation: none !important; }
}

@media (max-width: 540px) {
	.pe-hub-app__support-label { display: none; }
	.pe-hub-app__support {
		padding: 0.45rem 0.55rem;
		gap: 0;
	}
}

/* Light-mode polish: deeper shadow + crisper border on white surfaces. */
[data-pe-theme="light"] .pe-hub-app__support {
	border-color: rgba(255, 255, 255, 0.65);
	box-shadow: 0 8px 22px -10px rgba(239, 68, 68, 0.55), 0 1px 0 rgba(255, 255, 255, 0.4) inset;
}
[data-pe-theme="light"] .pe-hub-app__support:hover,
[data-pe-theme="light"] .pe-hub-app__support:focus-visible {
	box-shadow: 0 14px 28px -10px rgba(239, 68, 68, 0.7), 0 1px 0 rgba(255, 255, 255, 0.45) inset;
}
[data-pe-theme="light"] .pe-hub-app__support::before {
	border-color: rgba(239, 68, 68, 0.55);
}

/* ---- Hero ---- */

.pe-hub-app__hero {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(min(420px, 100%), 1fr);
	gap: clamp(1.5rem, 3.5vw, 2.5rem);
	align-items: center;
	padding: clamp(1.75rem, 4vw, 3rem) clamp(1.1rem, 3vw, 2.25rem) clamp(1.4rem, 2.5vw, 1.75rem);
	position: relative;
	overflow: hidden;
}

.pe-hub-app__hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse 50% 60% at 0% 50%, rgba(99, 102, 241, 0.16), transparent 65%),
		radial-gradient(ellipse 40% 60% at 100% 50%, rgba(20, 184, 166, 0.12), transparent 70%);
	pointer-events: none;
}

.pe-hub-app__hero-text { position: relative; z-index: 1; min-width: 0; }

.pe-hub-app__eyebrow {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--hub-accent-2);
	margin: 0 0 0.65rem;
}

.pe-hub-app__title {
	font-size: clamp(1.5rem, 3.4vw, 2.4rem);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.02em;
	color: var(--hub-ink-strong);
	margin: 0 0 0.65rem;
	text-wrap: balance;
}

.pe-hub-app__deck {
	font-size: clamp(0.95rem, 1.6vw, 1.05rem);
	line-height: 1.6;
	color: var(--hub-muted);
	margin: 0;
	max-width: 38rem;
}

.pe-hub-app__notice {
	margin: 1rem 0 0;
	padding: 0.7rem 0.95rem;
	border-radius: 12px;
	background: rgba(20, 184, 166, 0.10);
	border: 1px solid rgba(20, 184, 166, 0.32);
	color: var(--hub-good-ink);
	font-size: 0.85rem;
	font-weight: 500;
	max-width: 38rem;
}

.pe-hub-app__stats {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 0.75rem;
}

.pe-hub-app__stat {
	padding: 1.05rem 1rem 0.95rem;
	border-radius: 14px;
	background: linear-gradient(165deg, rgba(99, 102, 241, 0.06), rgba(15, 23, 42, 0.55));
	border: 1px solid var(--hub-border);
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	align-items: flex-start;
	text-align: left;
	transition: border-color 0.18s ease, transform 0.18s ease;
}

.pe-hub-app__stat:hover { transform: translateY(-1px); border-color: var(--hub-border-strong); }

.pe-hub-app__stat--accent {
	background: linear-gradient(165deg, rgba(20, 184, 166, 0.12), rgba(15, 23, 42, 0.55));
	border-color: rgba(20, 184, 166, 0.28);
}

.pe-hub-app__stat-num {
	font-size: 1.85rem;
	font-weight: 700;
	color: var(--hub-ink-strong);
	letter-spacing: -0.02em;
	line-height: 1;
	font-feature-settings: "tnum";
}

.pe-hub-app__stat-label {
	font-size: 0.78rem;
	font-weight: 500;
	color: var(--hub-muted);
}

@media (max-width: 760px) {
	.pe-hub-app__hero { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ---- Sections ---- */

.pe-hub-app__section {
	padding: clamp(0.75rem, 2vw, 1.4rem) clamp(1.1rem, 3vw, 2.25rem) clamp(1.5rem, 2.5vw, 2rem);
}

.pe-hub-app__section--addons { border-top: 1px solid var(--hub-border); }

.pe-hub-app__section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 0.5rem 1.25rem;
	margin-bottom: 1.1rem;
}

.pe-hub-app__section-title {
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--hub-ink-strong);
	margin: 0 0 0.2rem;
}

.pe-hub-app__section-lead {
	font-size: 0.875rem;
	color: var(--hub-muted);
	margin: 0;
	max-width: 44rem;
	line-height: 1.5;
}

.pe-hub-app__section-count {
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--hub-muted);
	background: rgba(148, 163, 184, 0.06);
	padding: 0.35rem 0.7rem;
	border-radius: 999px;
	border: 1px solid var(--hub-border);
	font-feature-settings: "tnum";
}

/* ---- Grid + cards ---- */

.pe-hub-app__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
	gap: 1.1rem;
}

.pe-hub-app__grid--addons {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr));
}

.pe-hub-app__card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	padding: 1.35rem 1.35rem 1.2rem;
	border-radius: var(--hub-radius);
	background: var(--hub-card-bg);
	border: 1px solid var(--hub-border);
	transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.22s ease;
	overflow: hidden;
	isolation: isolate;
}

.pe-hub-app__card::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.18), transparent 45%);
	opacity: 0;
	transition: opacity 0.22s ease;
	pointer-events: none;
	z-index: -1;
}

.pe-hub-app__card:hover {
	border-color: rgba(99, 102, 241, 0.42);
	transform: translateY(-2px);
	box-shadow: 0 18px 40px -22px rgba(99, 102, 241, 0.5);
}

.pe-hub-app__card:hover::before { opacity: 1; }

.pe-hub-app__card.is-owned {
	border-color: rgba(20, 184, 166, 0.32);
	background: linear-gradient(165deg, rgba(20, 184, 166, 0.08), rgba(15, 23, 42, 0.6) 60%);
}

.pe-hub-app__card.is-owned:hover {
	border-color: rgba(20, 184, 166, 0.55);
	box-shadow: 0 18px 40px -22px rgba(20, 184, 166, 0.55);
}

.pe-hub-app__card.is-owned::before { background: radial-gradient(circle at 0% 0%, rgba(20, 184, 166, 0.18), transparent 45%); }

.pe-hub-app__card--addon {
	background: linear-gradient(165deg, rgba(167, 139, 250, 0.07), rgba(15, 23, 42, 0.6) 60%);
}

.pe-hub-app__card-status {
	display: inline-flex;
	gap: 0.4rem;
	flex-wrap: wrap;
	align-items: center;
}

/* Whitelabel per-product logo on the hub card status row. Sits next to
 * the Owned/Locked pill and shrinks to a small chip so the existing card
 * proportions stay intact. Renders only when an override is uploaded. */
.pe-hub-app__card-logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background: rgba(148, 163, 184, 0.10);
	border: 1px solid var(--hub-border);
	overflow: hidden;
	flex: 0 0 auto;
}
.pe-hub-app__card-logo img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
}

.pe-hub-app__pill {
	display: inline-flex;
	align-items: center;
	gap: 0.32rem;
	padding: 0.24rem 0.6rem;
	border-radius: 999px;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1;
}

.pe-hub-app__pill svg { width: 11px; height: 11px; }

.pe-hub-app__pill--good {
	background: var(--hub-good-bg);
	color: var(--hub-good-ink);
	border: 1px solid rgba(20, 184, 166, 0.32);
}

.pe-hub-app__pill--locked {
	background: var(--hub-locked-bg);
	color: var(--hub-locked-ink);
	border: 1px solid rgba(148, 163, 184, 0.22);
}

.pe-hub-app__pill--addon {
	background: rgba(167, 139, 250, 0.12);
	color: #c4b5fd;
	border: 1px solid rgba(167, 139, 250, 0.32);
}

.pe-hub-app__card-title {
	font-size: 1.1rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--hub-ink-strong);
	margin: 0;
	line-height: 1.3;
}

.pe-hub-app__card-text {
	font-size: 0.9rem;
	line-height: 1.55;
	color: var(--hub-muted);
	margin: 0;
	flex-grow: 1;
}

/* Per-engine chips shown under an active add-on card. Whitelabel
   collapses to a single "Site-wide" chip; agency / leads list each
   engine the user owns the add-on for. */
.pe-hub-app__addon-engines {
	list-style: none;
	margin: 0.6rem 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.4rem;
}

.pe-hub-app__addon-engine {
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	color: var(--hub-ink, #f8fafc);
	background: rgba(34, 197, 94, 0.14);
	border: 1px solid rgba(34, 197, 94, 0.32);
	padding: 0.18rem 0.55rem;
	border-radius: 999px;
	white-space: nowrap;
}

.pe-hub-app__card-foot {
	margin-top: auto;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	flex-wrap: wrap;
}

.pe-hub-app__btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.6rem 1rem;
	border-radius: 10px;
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0;
	text-decoration: none;
	border: 1px solid transparent;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.18s ease, color 0.15s ease;
	color: #0b0f1f;
}

.pe-hub-app__btn--primary {
	background: linear-gradient(135deg, var(--hub-accent), var(--hub-accent-2));
	color: #0b0f1f;
	box-shadow: 0 8px 24px -10px rgba(99, 102, 241, 0.55);
}

.pe-hub-app__btn--primary:hover,
.pe-hub-app__btn--primary:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 14px 30px -10px rgba(99, 102, 241, 0.7);
	color: #0b0f1f;
}

.pe-hub-app__btn--primary:active { transform: translateY(0); }

.pe-hub-app__btn-price {
	font-weight: 800;
	background: rgba(11, 15, 31, 0.18);
	padding: 0.05rem 0.5rem;
	border-radius: 999px;
	font-size: 0.76rem;
	letter-spacing: 0.01em;
}

.pe-hub-app__btn-arrow {
	font-size: 1rem;
	font-weight: 700;
	transform: translateX(0);
	transition: transform 0.18s ease;
	margin-left: 0.05rem;
}

.pe-hub-app__btn:hover .pe-hub-app__btn-arrow { transform: translateX(2px); }

.pe-hub-app__inline-warn {
	font-size: 0.78rem;
	color: var(--hub-warm-ink);
	background: var(--hub-warm-bg);
	border: 1px solid rgba(249, 115, 22, 0.32);
	border-radius: 999px;
	padding: 0.32rem 0.7rem;
	line-height: 1.3;
}

/* ---- Footer ---- */

.pe-hub-app__footer {
	margin-top: auto;
	padding: 1.4rem clamp(1.1rem, 3vw, 2.25rem) 2rem;
	font-size: 0.78rem;
	color: var(--hub-muted);
	text-align: center;
	border-top: 1px solid var(--hub-border);
}

/* ---- Sidebar visual integration on hub ---- */

.pe-hub-app .pe-dash-sidebar {
	background: linear-gradient(180deg, rgba(8, 12, 24, 0.98), rgba(11, 16, 32, 0.95));
}

/* ----------------------------------------------------------------------------
   Lock screen
   ---------------------------------------------------------------------------- */

.pe-lock__bar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.25rem;
}
.pe-lock__section .vstack-gate__cta--secondary {
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.pe-notice--ok { color: #5eead4; }
.pe-notice--warn { color: #fdba74; }

/*
 * Embedded lock card — used when render_locked() is asked to live INSIDE
 * the dashboard-with-sidebar wrapper (Leads gate, Whitelabel gate, etc.).
 *
 * Design notes:
 *  - The dashboard wrapper already provides the brand bar AND the
 *    sign-out shortcut, so the standalone gate's header/footer are
 *    suppressed in PHP and we only ship a polished centred card.
 *  - The card is intentionally narrower than the dashboard content
 *    column so it reads as a focused upsell rather than a stretched-out
 *    page-level slab.
 *  - Light-mode (data-pe-theme="light") swaps colour tokens so the card
 *    keeps proper contrast under the white dashboard chrome.
 */
/*
 * `.pe-lock--embedded` is rendered inside `.pe-dash-main` (a flex column
 * holding the topbar + this gate). With only `display: flex` and
 * intrinsic content height, the gate card sat at the top with a tall
 * empty block of dashboard background bleeding below — the bug the
 * screenshot showed as "cut from bottom and showing whitespace".
 *
 * `flex: 1 1 auto` lets this region claim the remaining height inside
 * `.pe-dash-main`, and `align-items: center` then vertically centres
 * the card within that region. `min-height: min(100vh, 100dvh)` is a
 * safety net for when this gate is rendered outside `.pe-dash-main`
 * (e.g. on a page that doesn't use the dashboard wrapper) — it
 * guarantees a viewport-sized canvas in that case too.
 */
.pe-lock--embedded {
	flex: 1 1 auto;
	min-height: min(100vh, 100dvh);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: clamp(1.5rem, 4vw, 3.25rem) clamp(1rem, 3vw, 2rem);
	box-sizing: border-box;
}

/*
 * When the gate sits inside .pe-dash-main, the topbar already provides
 * vertical space above the card, so the viewport-sized min-height
 * needs to step down by the topbar's worth of height to keep the card
 * truly centred (otherwise it pushes a scrollbar). The dashboard
 * topbar is ~64px in this build; the calc keeps a small safety margin
 * for theme variations.
 */
.pe-dash-main > .pe-lock--embedded {
	min-height: calc(min(100vh, 100dvh) - 5rem);
}

.pe-lock-card {
	position: relative;
	width: 100%;
	max-width: 38rem;
	margin: 0 auto;
	padding: clamp(1.75rem, 4vw, 2.75rem) clamp(1.25rem, 3vw, 2.5rem);
	background: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
	border: 1px solid rgba(99, 102, 241, 0.18);
	border-radius: 20px;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.04) inset,
		0 18px 48px -24px rgba(15, 23, 42, 0.7),
		0 6px 22px -10px rgba(15, 23, 42, 0.5);
	overflow: hidden;
	text-align: center;
	color: #e2e8f0;
	isolation: isolate;
}

/*
 * Soft top accent — the linear gradient that subtly tints the card's
 * upper half. Kept under z-index 0 so all card content sits above it.
 * The previous design had a thin 4px gradient bar that read as a
 * loading spinner / broken decoration; replacing it with a full-bleed
 * radial glow makes the card feel intentional instead.
 */
.pe-lock-card__glow {
	position: absolute;
	inset: -40% 0 auto 0;
	height: 70%;
	background:
		radial-gradient(70% 60% at 50% 0%, rgba(99, 102, 241, 0.32) 0%, rgba(20, 184, 166, 0.12) 45%, transparent 75%);
	z-index: 0;
	pointer-events: none;
	filter: blur(2px);
}

.pe-lock-card > *:not(.pe-lock-card__glow) {
	position: relative;
	z-index: 1;
}

/*
 * Icon MUST be a block-level flex container, not inline-flex. The card
 * uses `text-align: center` so all inline-level children (incl. an
 * `inline-flex` icon and an `inline-block` eyebrow pill) end up on the
 * same line if there's room — that's what made the icon and the
 * "Not purchased yet" badge sit next to each other instead of stacking
 * vertically. `display: flex` keeps it block-level; `margin: 0 auto`
 * still centres it within the card.
 */
.pe-lock-card__icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 1rem;
	border-radius: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #e0e7ff;
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(20, 184, 166, 0.18) 100%);
	border: 1px solid rgba(129, 140, 248, 0.35);
	box-shadow: 0 6px 18px -8px rgba(99, 102, 241, 0.6);
}

.pe-lock-card__eyebrow {
	display: inline-block;
	margin: 0 0 0.6rem;
	padding: 0.35rem 0.85rem;
	border-radius: 999px;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #c7d2fe;
	background: rgba(99, 102, 241, 0.18);
	border: 1px solid rgba(129, 140, 248, 0.32);
}

.pe-lock-card__title {
	font-size: clamp(1.4rem, 3.5vw, 1.85rem);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.2;
	color: #f8fafc;
	margin: 0 0 0.65rem;
	text-wrap: balance;
}

.pe-lock-card__deck {
	font-size: 0.95rem;
	line-height: 1.6;
	color: #cbd5e1;
	margin: 0 auto 1.5rem;
	max-width: 30rem;
}

.pe-lock-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
	justify-content: center;
	align-items: stretch;
}

.pe-lock-card__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	padding: 0.85rem 1.4rem;
	border-radius: 12px;
	font-weight: 600;
	font-size: 0.95rem;
	text-decoration: none;
	border: 1px solid transparent;
	transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
	cursor: pointer;
	min-width: 11rem;
}

.pe-lock-card__cta--primary {
	color: #fff;
	background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
	border-color: rgba(20, 184, 166, 0.7);
	box-shadow: 0 8px 22px -8px rgba(20, 184, 166, 0.55);
}
.pe-lock-card__cta--primary:hover,
.pe-lock-card__cta--primary:focus-visible {
	color: #fff;
	background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
	transform: translateY(-1px);
	box-shadow: 0 12px 30px -10px rgba(20, 184, 166, 0.7);
}

.pe-lock-card__cta--secondary {
	color: #e2e8f0;
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.14);
}
.pe-lock-card__cta--secondary:hover,
.pe-lock-card__cta--secondary:focus-visible {
	color: #fff;
	background: rgba(255, 255, 255, 0.12);
	border-color: rgba(255, 255, 255, 0.24);
	transform: translateY(-1px);
}

.pe-lock-card__cta-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.18s ease;
}
.pe-lock-card__cta--primary:hover .pe-lock-card__cta-icon,
.pe-lock-card__cta--primary:focus-visible .pe-lock-card__cta-icon {
	transform: translate(2px, -2px);
}

.pe-lock-card__notice {
	margin: 1.25rem auto 0;
	max-width: 30rem;
	padding: 0.7rem 1rem;
	border-radius: 12px;
	font-size: 0.85rem;
	line-height: 1.5;
	color: #fde68a;
	background: rgba(120, 53, 15, 0.32);
	border: 1px solid rgba(251, 191, 36, 0.3);
}

/* Light theme overrides — applied when the dashboard runs in the
 * forced-light mode the topbar toggle sets via [data-pe-theme="light"].
 * Without these the card is unreadably dark on a white dashboard. */
[data-pe-theme="light"] .pe-lock-card {
	background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
	border-color: rgba(99, 102, 241, 0.22);
	color: #1e293b;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.6) inset,
		0 18px 36px -22px rgba(15, 23, 42, 0.18),
		0 4px 14px -8px rgba(15, 23, 42, 0.12);
}
[data-pe-theme="light"] .pe-lock-card__glow {
	background:
		radial-gradient(70% 60% at 50% 0%, rgba(99, 102, 241, 0.18) 0%, rgba(20, 184, 166, 0.08) 45%, transparent 75%);
}
[data-pe-theme="light"] .pe-lock-card__icon {
	color: #4f46e5;
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.14) 0%, rgba(20, 184, 166, 0.12) 100%);
	border-color: rgba(99, 102, 241, 0.32);
}
[data-pe-theme="light"] .pe-lock-card__eyebrow {
	color: #4338ca;
	background: rgba(99, 102, 241, 0.12);
	border-color: rgba(99, 102, 241, 0.28);
}
[data-pe-theme="light"] .pe-lock-card__title {
	color: #0f172a;
}
[data-pe-theme="light"] .pe-lock-card__deck {
	color: #475569;
}
[data-pe-theme="light"] .pe-lock-card__cta--secondary {
	color: #1e293b;
	background: #f1f5f9;
	border-color: #e2e8f0;
}
[data-pe-theme="light"] .pe-lock-card__cta--secondary:hover,
[data-pe-theme="light"] .pe-lock-card__cta--secondary:focus-visible {
	color: #0f172a;
	background: #e2e8f0;
	border-color: #cbd5e1;
}
[data-pe-theme="light"] .pe-lock-card__notice {
	color: #92400e;
	background: rgba(254, 243, 199, 0.6);
	border-color: rgba(251, 191, 36, 0.5);
}

@media (max-width: 30rem) {
	.pe-lock-card__cta {
		min-width: 0;
		width: 100%;
	}
}

/* Screen reader helper used inside the toggle. */
.pe-dash-sidebar .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ============================================================================
   Theme switch (sidebar footer toggle + light-mode overrides)
   ============================================================================ */

/* ---- Sidebar footer + toggle button ---- */

.pe-dash-sidebar__foot {
	flex-shrink: 0;
	padding: 0.6rem 0.55rem 0.7rem;
	border-top: 1px solid var(--pe-dash-border);
	background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.18));
}

.pe-dash-wrap.is-collapsed .pe-dash-sidebar__foot {
	padding-left: 0.35rem;
	padding-right: 0.35rem;
}

.pe-dash-theme-toggle {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.4rem 0.45rem;
	border-radius: 9px;
	background: rgba(148, 163, 184, 0.04);
	border: 1px solid var(--pe-dash-border);
	color: var(--pe-dash-ink);
	cursor: pointer;
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: -0.005em;
	line-height: 1.2;
	text-align: left;
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.pe-dash-theme-toggle:hover {
	background: var(--pe-dash-hover);
	color: var(--pe-dash-ink-strong);
	border-color: rgba(99, 102, 241, 0.32);
}

.pe-dash-theme-toggle:focus-visible {
	outline: 2px solid #818cf8;
	outline-offset: 2px;
}

.pe-dash-theme-toggle__track {
	flex-shrink: 0;
	position: relative;
	display: inline-flex;
	align-items: center;
	width: 36px;
	height: 20px;
	padding: 0 3px;
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.55);
	border: 1px solid var(--pe-dash-border);
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
	transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.pe-dash-theme-toggle__icon {
	flex: 0 0 14px;
	width: 14px;
	height: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: rgba(226, 232, 240, 0.5);
	transition: color 0.22s ease, opacity 0.22s ease;
	position: relative;
	z-index: 1;
}

.pe-dash-theme-toggle__icon svg { width: 12px; height: 12px; }

.pe-dash-theme-toggle__icon--sun { margin-right: auto; }
.pe-dash-theme-toggle__icon--moon { margin-left: auto; }

.pe-dash-theme-toggle__thumb {
	position: absolute;
	top: 50%;
	left: 3px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: linear-gradient(135deg, #c7d2fe 0%, #e2e8f0 100%);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
	transform: translate(0, -50%);
	transition: transform 0.24s cubic-bezier(0.5, 0, 0.2, 1.4), background 0.22s ease;
	z-index: 0;
}

/* Dark = current default state -> moon highlighted, thumb on the right */
[data-pe-theme="dark"] .pe-dash-theme-toggle__thumb,
.pe-dash-theme-toggle[aria-pressed="false"] .pe-dash-theme-toggle__thumb {
	transform: translate(16px, -50%);
	background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

[data-pe-theme="dark"] .pe-dash-theme-toggle__icon--moon,
.pe-dash-theme-toggle[aria-pressed="false"] .pe-dash-theme-toggle__icon--moon {
	color: #c7d2fe;
}

[data-pe-theme="light"] .pe-dash-theme-toggle__icon--sun,
.pe-dash-theme-toggle[aria-pressed="true"] .pe-dash-theme-toggle__icon--sun {
	color: #f59e0b;
}

.pe-dash-theme-toggle__label {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--pe-dash-ink);
}

.pe-dash-wrap.is-collapsed .pe-dash-theme-toggle {
	justify-content: center;
	padding: 0.45rem 0;
}

.pe-dash-wrap.is-collapsed .pe-dash-theme-toggle__label {
	display: none;
}

@media (max-width: 900px) {
	.pe-dash-wrap.is-collapsed .pe-dash-sidebar__foot {
		display: none;
	}
}

/* ============================================================================
   Light-mode overrides
   ----------------------------------------------------------------------------
   Default (no attribute / data-pe-theme="dark") = current dark sidebar/hub.
   Light mode swaps the CSS custom properties + a handful of hard-coded
   gradients/colors so every text + hover state stays legible.
   ============================================================================ */

[data-pe-theme="light"] .pe-dash-wrap {
	--pe-dash-bg: #ffffff;
	--pe-dash-bg-2: #f8fafc;
	--pe-dash-border: rgba(15, 23, 42, 0.10);
	--pe-dash-ink: #334155;
	--pe-dash-ink-strong: #0f172a;
	--pe-dash-muted: #64748b;
	--pe-dash-hover: rgba(15, 23, 42, 0.06);
	--pe-dash-active: rgba(99, 102, 241, 0.12);
	--pe-dash-active-bar: linear-gradient(180deg, #6366f1, #14b8a6);
	--pe-dash-good: #0d9488;
	--pe-dash-warn: #b45309;
	--pe-dash-accent: #ea580c;
}

[data-pe-theme="light"] .pe-dash-sidebar {
	background: linear-gradient(180deg, var(--pe-dash-bg) 0%, var(--pe-dash-bg-2) 100%);
	box-shadow: 1px 0 0 rgba(15, 23, 42, 0.04);
}

[data-pe-theme="light"] .pe-dash-sidebar__toggle {
	background: rgba(15, 23, 42, 0.04);
	border-color: var(--pe-dash-border);
	color: var(--pe-dash-muted);
}

[data-pe-theme="light"] .pe-dash-sidebar__toggle:hover {
	background: rgba(99, 102, 241, 0.10);
	color: var(--pe-dash-ink-strong);
	border-color: rgba(99, 102, 241, 0.32);
}

[data-pe-theme="light"] .pe-dash-sidebar__toggle:focus-visible {
	outline-color: #6366f1;
}

[data-pe-theme="light"] .pe-dash-nav::-webkit-scrollbar-thumb {
	background: rgba(15, 23, 42, 0.18);
}

[data-pe-theme="light"] .pe-dash-nav__row.is-active .pe-dash-nav__icon {
	color: #6366f1;
}

[data-pe-theme="light"] .pe-dash-nav__row.is-active::before {
	box-shadow: 0 0 12px rgba(99, 102, 241, 0.22);
}

[data-pe-theme="light"] .pe-dash-nav__buy {
	background: rgba(234, 88, 12, 0.10);
	color: #c2410c;
	border-color: rgba(234, 88, 12, 0.40);
}

[data-pe-theme="light"] .pe-dash-nav__buy:hover {
	background: var(--pe-dash-accent);
	color: #ffffff;
	border-color: var(--pe-dash-accent);
}

[data-pe-theme="light"] .pe-dash-nav__lock { color: #b45309; }

[data-pe-theme="light"] .pe-dash-sidebar__foot {
	background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.04));
}

[data-pe-theme="light"] .pe-dash-theme-toggle {
	background: rgba(15, 23, 42, 0.03);
	color: var(--pe-dash-ink);
}

[data-pe-theme="light"] .pe-dash-theme-toggle:hover {
	background: rgba(99, 102, 241, 0.10);
	color: var(--pe-dash-ink-strong);
	border-color: rgba(99, 102, 241, 0.32);
}

[data-pe-theme="light"] .pe-dash-theme-toggle__track {
	background: rgba(15, 23, 42, 0.10);
	border-color: rgba(15, 23, 42, 0.14);
	box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.10);
}

[data-pe-theme="light"] .pe-dash-theme-toggle__thumb {
	background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.05) inset;
}

[data-pe-theme="light"] .pe-dash-theme-toggle__icon {
	color: rgba(15, 23, 42, 0.45);
}

@media (max-width: 900px) {
	[data-pe-theme="light"] .pe-dash-sidebar {
		border-bottom-color: var(--pe-dash-border);
		box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
	}
}

/* ---- Light-mode hub overrides ---- */

[data-pe-theme="light"] .pe-hub-app {
	--hub-bg: #f8fafc;
	--hub-bg-2: #eef2ff;
	--hub-ink: #334155;
	--hub-ink-strong: #0f172a;
	--hub-muted: #64748b;
	--hub-border: rgba(15, 23, 42, 0.10);
	--hub-border-strong: rgba(15, 23, 42, 0.16);
	--hub-card-bg: linear-gradient(165deg, rgba(99, 102, 241, 0.05) 0%, #ffffff 60%);
	--hub-good-bg: rgba(20, 184, 166, 0.10);
	--hub-good-ink: #0f766e;
	--hub-locked-bg: rgba(15, 23, 42, 0.05);
	--hub-locked-ink: #475569;
	--hub-warm-bg: rgba(234, 88, 12, 0.10);
	--hub-warm-ink: #b45309;

	background:
		radial-gradient(ellipse 60% 40% at 0% 0%, rgba(99, 102, 241, 0.10), transparent 60%),
		radial-gradient(ellipse 50% 35% at 100% 0%, rgba(20, 184, 166, 0.08), transparent 65%),
		var(--hub-bg);
	color: var(--hub-ink);
}

[data-pe-theme="light"] .pe-hub-app__topbar {
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.7));
}

[data-pe-theme="light"] .pe-hub-app__user {
	background: rgba(15, 23, 42, 0.04);
}

[data-pe-theme="light"] .pe-hub-app__signout:hover,
[data-pe-theme="light"] .pe-hub-app__signout:focus-visible {
	background: rgba(15, 23, 42, 0.05);
	color: var(--hub-ink-strong);
	border-color: var(--hub-border);
}

[data-pe-theme="light"] .pe-hub-app__hero::before {
	background:
		radial-gradient(ellipse 50% 60% at 0% 50%, rgba(99, 102, 241, 0.12), transparent 65%),
		radial-gradient(ellipse 40% 60% at 100% 50%, rgba(20, 184, 166, 0.10), transparent 70%);
}

[data-pe-theme="light"] .pe-hub-app__notice {
	background: rgba(20, 184, 166, 0.10);
	border-color: rgba(20, 184, 166, 0.28);
	color: #0f766e;
}

[data-pe-theme="light"] .pe-hub-app__stat {
	background: linear-gradient(165deg, rgba(99, 102, 241, 0.05), #ffffff);
	border-color: var(--hub-border);
}

[data-pe-theme="light"] .pe-hub-app__stat:hover {
	border-color: rgba(99, 102, 241, 0.35);
	box-shadow: 0 8px 24px -16px rgba(99, 102, 241, 0.35);
}

[data-pe-theme="light"] .pe-hub-app__stat--accent {
	background: linear-gradient(165deg, rgba(20, 184, 166, 0.12), #ffffff);
	border-color: rgba(20, 184, 166, 0.30);
}

[data-pe-theme="light"] .pe-hub-app__section-count {
	background: rgba(15, 23, 42, 0.04);
	color: var(--hub-muted);
}

[data-pe-theme="light"] .pe-hub-app__card {
	background: var(--hub-card-bg);
	box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

[data-pe-theme="light"] .pe-hub-app__card:hover {
	border-color: rgba(99, 102, 241, 0.42);
	box-shadow: 0 18px 40px -22px rgba(99, 102, 241, 0.40);
}

[data-pe-theme="light"] .pe-hub-app__card.is-owned {
	background: linear-gradient(165deg, rgba(20, 184, 166, 0.10), #ffffff 60%);
	border-color: rgba(20, 184, 166, 0.32);
}

[data-pe-theme="light"] .pe-hub-app__card.is-owned:hover {
	border-color: rgba(20, 184, 166, 0.55);
	box-shadow: 0 18px 40px -22px rgba(20, 184, 166, 0.45);
}

[data-pe-theme="light"] .pe-hub-app__card--addon {
	background: linear-gradient(165deg, rgba(167, 139, 250, 0.10), #ffffff 60%);
}

[data-pe-theme="light"] .pe-hub-app__pill--addon {
	color: #6d28d9;
	background: rgba(167, 139, 250, 0.16);
	border-color: rgba(167, 139, 250, 0.36);
}

[data-pe-theme="light"] .pe-hub-app__btn--primary {
	color: #ffffff;
	box-shadow: 0 8px 24px -10px rgba(99, 102, 241, 0.45);
}

[data-pe-theme="light"] .pe-hub-app__btn--primary:hover,
[data-pe-theme="light"] .pe-hub-app__btn--primary:focus-visible {
	color: #ffffff;
	box-shadow: 0 14px 30px -10px rgba(99, 102, 241, 0.55);
}

[data-pe-theme="light"] .pe-hub-app__btn-price {
	background: rgba(255, 255, 255, 0.22);
	color: #ffffff;
}

[data-pe-theme="light"] .pe-hub-app__avatar {
	color: #ffffff;
}

[data-pe-theme="light"] .pe-hub-app__inline-warn {
	color: #b45309;
	border-color: rgba(234, 88, 12, 0.32);
	background: rgba(234, 88, 12, 0.10);
}

[data-pe-theme="light"] .pe-hub-app .pe-dash-sidebar {
	background: linear-gradient(180deg, #ffffff, #f8fafc);
}

/* Lock-screen helper colors */
[data-pe-theme="light"] .pe-notice--ok { color: #0f766e; }
[data-pe-theme="light"] .pe-notice--warn { color: #b45309; }

/* ---- Light-mode tweaks for plugin dashboards rendered in main pane ---- */

[data-pe-theme="light"] .pe-dash-main {
	color: #0f172a;
}

/* Flip the design tokens .pe-agency already consumes via var(...). That
   single block fixes ~80% of the agency dashboard (titles, subheads,
   stat labels, card chrome, table cells, link input, prod-list pills,
   muted/empty copy, etc.) automatically. .pe-leads is included so its
   variable-based color (line 6 of pe-leads.css) inherits too. */
[data-pe-theme="light"] .pe-leads,
[data-pe-theme="light"] .pe-agency {
	--pe-text: #1e293b;
	--pe-text-muted: #475569;
	--pe-surface: #ffffff;
	--pe-accent-text: #4338ca;
	color: #1e293b;
}

[data-pe-theme="light"] .pe-leads-title,
[data-pe-theme="light"] .pe-agency-title,
[data-pe-theme="light"] .pe-leads-section-title,
[data-pe-theme="light"] .pe-agency-section-title,
[data-pe-theme="light"] .pe-leads-card-title,
[data-pe-theme="light"] .pe-leads-step-head,
[data-pe-theme="light"] .pe-leads-item-title,
[data-pe-theme="light"] .pe-agency-note {
	color: #0f172a;
}

[data-pe-theme="light"] .pe-leads-subhead,
[data-pe-theme="light"] .pe-agency-subhead,
[data-pe-theme="light"] .pe-leads-eyebrow,
[data-pe-theme="light"] .pe-agency-eyebrow,
[data-pe-theme="light"] .pe-leads-card-sub,
[data-pe-theme="light"] .pe-leads-section-sub,
[data-pe-theme="light"] .pe-leads-step-text,
[data-pe-theme="light"] .pe-leads-item-meta,
[data-pe-theme="light"] .pe-leads-loading,
[data-pe-theme="light"] .pe-leads-empty,
[data-pe-theme="light"] .pe-leads-empty-row td {
	color: #475569;
}

/* ---- pe-leads.css ships hard-coded `rgba(15,23,42,...)` surfaces and
       `#f1f5f9`/`#e2e8f0`/`#94a3b8` text, none of which are var()-driven,
       so we must override them explicitly for light mode. Backgrounds
       become white/near-white, borders become slate-200, body text
       becomes slate-800. */
[data-pe-theme="light"] .pe-leads-card,
[data-pe-theme="light"] .pe-leads-step,
[data-pe-theme="light"] .pe-leads-item,
[data-pe-theme="light"] .pe-leads-howto {
	background: #ffffff;
	border-color: #e2e8f0;
	box-shadow: 0 12px 32px -22px rgba(15, 23, 42, 0.18);
}
[data-pe-theme="light"] .pe-leads-howto {
	background:
		linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(20, 184, 166, 0.05) 70%),
		#ffffff;
}
[data-pe-theme="light"] .pe-leads-empty {
	background: #f8fafc;
	border-color: #cbd5e1;
}
[data-pe-theme="light"] .pe-leads-howto-cta {
	border-top-color: #e2e8f0;
}
[data-pe-theme="light"] .pe-leads-input {
	background: #ffffff;
	border-color: #cbd5e1;
	color: #0f172a;
}
[data-pe-theme="light"] .pe-leads-input:focus {
	background: #ffffff;
	border-color: rgba(99, 102, 241, 0.7);
}
[data-pe-theme="light"] .pe-leads-btn,
[data-pe-theme="light"] .pe-leads-howto-link {
	background: #f1f5f9;
	border-color: #cbd5e1;
	color: #1e293b;
}
[data-pe-theme="light"] .pe-leads-btn:hover,
[data-pe-theme="light"] .pe-leads-howto-link:hover {
	background: #e2e8f0;
	border-color: rgba(99, 102, 241, 0.45);
	color: #0f172a;
}
[data-pe-theme="light"] .pe-leads-btn--primary,
[data-pe-theme="light"] .pe-leads-btn--primary:hover {
	color: #fff;
	border-color: transparent;
}
[data-pe-theme="light"] .pe-leads-btn--ghost {
	background: transparent;
}
[data-pe-theme="light"] .pe-leads-btn--danger {
	background: #fff;
	border-color: rgba(220, 38, 38, 0.45);
	color: #b91c1c;
}
[data-pe-theme="light"] .pe-leads-btn--danger:hover {
	background: rgba(254, 226, 226, 0.9);
	color: #7f1d1d;
}
[data-pe-theme="light"] .pe-leads-howto-link-arrow { color: #4338ca; }
[data-pe-theme="light"] .pe-leads-pill--source {
	background: rgba(99, 102, 241, 0.12);
	color: #4338ca;
}
[data-pe-theme="light"] .pe-leads-table th {
	background: #f1f5f9;
	color: #475569;
	border-bottom-color: #e2e8f0;
}
[data-pe-theme="light"] .pe-leads-table th,
[data-pe-theme="light"] .pe-leads-table td {
	border-bottom-color: #e2e8f0;
	color: #1e293b;
}
[data-pe-theme="light"] .pe-leads-item-leads {
	border-top-color: #e2e8f0;
}

/* ---- pe-agency.css mostly uses var() so the token flip above already
       handles cards/tables/text. These few extras patch the small set of
       hard-coded `rgba(15,23,42,...)` surfaces (stat tiles, form inputs,
       check rows, ghost button, link input, unowned panel). */
[data-pe-theme="light"] .pe-agency-stat,
[data-pe-theme="light"] .pe-agency-check,
[data-pe-theme="light"] .pe-agency-unowned,
[data-pe-theme="light"] .pe-agency-unowned-list li {
	background: #ffffff;
	border-color: #e2e8f0;
}
[data-pe-theme="light"] .pe-agency-check:hover {
	background: #f8fafc;
	border-color: rgba(99, 102, 241, 0.45);
}
[data-pe-theme="light"] .pe-agency-field input[type="text"],
[data-pe-theme="light"] .pe-agency-field select,
[data-pe-theme="light"] .pe-agency-link-input {
	background: #ffffff;
	border-color: #cbd5e1;
	color: #0f172a;
}
[data-pe-theme="light"] .pe-agency-btn-ghost {
	background: #f1f5f9;
	border-color: #cbd5e1;
	color: #1e293b;
}
[data-pe-theme="light"] .pe-agency-btn-ghost:hover {
	background: #e2e8f0;
	border-color: rgba(99, 102, 241, 0.45);
	color: #0f172a;
}
[data-pe-theme="light"] .pe-agency-table thead th {
	border-bottom-color: #e2e8f0;
}
[data-pe-theme="light"] .pe-agency-table tbody td {
	border-bottom-color: #e2e8f0;
}

/* Smooth crossfade between themes for the chrome we control. */
.pe-dash-sidebar,
.pe-dash-sidebar__head,
.pe-dash-sidebar__foot,
.pe-dash-sidebar__toggle,
.pe-dash-nav__row,
.pe-dash-nav__heading,
.pe-dash-nav__buy,
.pe-dash-theme-toggle,
.pe-dash-theme-toggle__track,
.pe-dash-theme-toggle__icon,
.pe-hub-app,
.pe-hub-app__topbar,
.pe-hub-app__card,
.pe-hub-app__stat,
.pe-hub-app__btn,
.pe-hub-app__user,
.pe-hub-app__section-count {
	transition-property: background, background-color, color, border-color, box-shadow;
	transition-duration: 0.22s;
	transition-timing-function: ease;
}

/* =====================================================================
 * Liquid scroll reveal (paired with assets/pe-flow.js)
 *
 * pe-flow.js tags the dashboard hero/card/section blocks with
 * `data-pe-flow` on DOMContentLoaded, then toggles `is-visible` as
 * each one enters the viewport. The CSS below provides:
 *
 *   - The default "off" state: opacity:0 + a small downward translate.
 *     `will-change` lifts each element onto its own composite layer so
 *     the reveal animates on the GPU rather than triggering layout.
 *   - The eased return to identity. The cubic-bezier curve is the
 *     "easeOutQuint"-flavoured ramp a few design systems ship as their
 *     "liquid" preset — fast at the start, very gentle on landing,
 *     which is what makes the motion feel fluid rather than springy.
 *   - A `prefers-reduced-motion: reduce` escape hatch that disables
 *     both opacity and translate, never holding a section invisible
 *     for users who've opted out of motion.
 *   - Native smooth scrolling for in-page anchor jumps and JS-driven
 *     scrollTo calls. Wheel/touch input is smoothed by pe-flow.js on
 *     desktop; this CSS rule only governs anchor / programmatic
 *     scrolls so it stays cooperative with the JS-side wheel layer.
 * ================================================================== */
@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

[data-pe-flow] {
	opacity: 0;
	transform: translate3d(0, 24px, 0);
	transition:
		opacity 700ms cubic-bezier(0.22, 0.61, 0.36, 1),
		transform 800ms cubic-bezier(0.22, 0.61, 0.36, 1);
	will-change: opacity, transform;
}

[data-pe-flow].is-visible {
	opacity: 1;
	transform: translate3d(0, 0, 0);
}

/* Once the reveal has played, drop will-change so we don't hold a
   composite layer for the rest of the page's life. */
[data-pe-flow].is-visible {
	will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
	[data-pe-flow],
	[data-pe-flow].is-visible {
		opacity: 1;
		transform: none;
		transition: none;
		will-change: auto;
	}
}
