:root {
	--rpv2-primary: #0a0a0a;
	--rpv2-accent: #e6bd6a;
	--rpv2-surface: #f8f8f8;
	--rpv2-panel: rgba(255, 255, 255, 0.88);
	--rpv2-border: rgba(10, 10, 10, 0.12);
	--rpv2-text: #111111;
	--rpv2-muted: rgba(17, 17, 17, 0.66);
	--rpv2-shadow: 0 24px 80px rgba(10, 10, 10, 0.08);
	--rpv2-radius: 22px;
	--rpv2-radius-sm: 14px;
}

.rpv2-shell,
.rpv2-public {
	position: relative;
	color: var(--rpv2-text);
	font-family: var(--rpv2-font, "Manrope", sans-serif);
}

.rpv2-shell {
	min-height: 100vh;
	padding: 32px clamp(16px, 2vw, 32px) 72px;
	background:
		radial-gradient(circle at top left, rgba(230, 189, 106, 0.2), transparent 30%),
		radial-gradient(circle at top right, rgba(17, 17, 17, 0.06), transparent 28%),
		linear-gradient(180deg, #fbfbfb 0%, #f4f2ee 100%);
}

.rp-light-theme.rp-grain::before,
.rpv2-public::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	opacity: 0.16;
	mix-blend-mode: multiply;
	background-image:
		linear-gradient(rgba(10, 10, 10, 0.03) 1px, transparent 1px),
		linear-gradient(90deg, rgba(10, 10, 10, 0.03) 1px, transparent 1px);
	background-size: 12px 12px;
}

.rp-dot-grid::after,
.rpv2-public::after {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	opacity: 0.18;
	background-image: radial-gradient(rgba(10, 10, 10, 0.05) 1px, transparent 1px);
	background-size: 22px 22px;
}

.rpv2-topbar,
.rpv2-hero,
.rpv2-stats,
.rpv2-tabs,
.rpv2-section,
.rpv2-public-card {
	position: relative;
	z-index: 1;
}

.rpv2-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 24px;
}

.rpv2-brand {
	display: flex;
	align-items: center;
	gap: 14px;
}

.rpv2-brand img,
.rpv2-form-brand img {
	width: 44px;
	height: 44px;
	border-radius: 14px;
	object-fit: cover;
	background: #fff;
	border: 1px solid var(--rpv2-border);
}

.rpv2-mark {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 14px;
	background: var(--rpv2-primary);
	color: #fff;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.rpv2-brand-name,
.rpv2-title,
.rpv2-card h3,
.rpv2-card h2 {
	font-family: var(--rpv2-font, "Space Grotesk", sans-serif);
	letter-spacing: -0.03em;
}

.rpv2-brand-name {
	font-size: 1rem;
	font-weight: 700;
}

.rpv2-brand-sub,
.rpv2-kicker,
.rpv2-help,
.rpv2-stat,
.rpv2-list span,
.rpv2-copy {
	color: var(--rpv2-muted);
}

.rpv2-brand-sub,
.rpv2-kicker {
	font-size: 0.92rem;
}

.rpv2-link {
	color: var(--rpv2-primary);
	text-decoration: none;
	font-weight: 600;
	border-bottom: 1px solid transparent;
}

.rpv2-link:hover {
	border-bottom-color: currentColor;
}

.rpv2-hero {
	display: grid;
	gap: 10px;
	max-width: 760px;
	margin-bottom: 22px;
}

.rpv2-title {
	margin: 0;
	font-size: clamp(2rem, 4vw, 4rem);
	line-height: 0.96;
}

.rpv2-subtitle {
	margin: 0;
	max-width: 62ch;
	font-size: 1.03rem;
	line-height: 1.65;
	color: var(--rpv2-muted);
}

.rpv2-notice {
	display: inline-flex;
	padding: 12px 16px;
	margin-bottom: 16px;
	border-radius: 999px;
	background: rgba(230, 189, 106, 0.18);
	border: 1px solid rgba(230, 189, 106, 0.28);
	font-weight: 600;
}

.rpv2-stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
	margin: 20px 0;
}

.rpv2-stat {
	padding: 18px 20px;
	border-radius: var(--rpv2-radius-sm);
	background: var(--rpv2-panel);
	border: 1px solid var(--rpv2-border);
	box-shadow: var(--rpv2-shadow);
	backdrop-filter: blur(16px);
}

.rpv2-stat span {
	display: block;
	margin-bottom: 6px;
	font-size: 1.7rem;
	font-weight: 700;
	color: var(--rpv2-primary);
}

.rpv2-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 14px 0 22px;
}

.rpv2-tab {
	padding: 11px 15px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.72);
	border: 1px solid var(--rpv2-border);
	text-decoration: none;
	color: var(--rpv2-primary);
	font-weight: 600;
	transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.rpv2-tab:hover,
.rpv2-tab.is-active {
	transform: translateY(-1px);
	background: #fff;
	border-color: rgba(10, 10, 10, 0.22);
}

.rpv2-section {
	display: grid;
	gap: 18px;
}

.rpv2-panels {
	display: grid;
	gap: 18px;
}

.rpv2-panel {
	display: none;
}

.rpv2-panel.is-active {
	display: grid;
	gap: 18px;
}

.rpv2-grid {
	display: grid;
	gap: 16px;
}

.rpv2-grid--2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rpv2-grid--3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rpv2-card,
.rpv2-public-card,
.rpv2-block {
	background: var(--rpv2-panel);
	border: 1px solid var(--rpv2-border);
	border-radius: var(--rpv2-radius);
	box-shadow: var(--rpv2-shadow);
	backdrop-filter: blur(18px);
}

.rpv2-card,
.rpv2-public-card {
	padding: 22px;
}

.rpv2-card-head,
.rpv2-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.rpv2-actions {
	margin-top: 14px;
}

.rpv2-copy-wrap {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.rpv2-list-actions {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.rpv2-form-panel {
	padding: 18px 0 0;
	margin-top: 18px;
	border-top: 1px solid rgba(10, 10, 10, 0.08);
}

.rpv2-home-cta {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 16px;
}

.rpv2-home-cta h2 {
	margin: 6px 0 8px;
	font-size: clamp(1.5rem, 2.4vw, 2.15rem);
	line-height: 1;
}

.rpv2-actions--stack {
	flex-direction: column;
	align-items: stretch;
	min-width: 220px;
	margin-top: 0;
}

.rpv2-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 18px;
	border: 0;
	border-radius: 999px;
	background: var(--rpv2-primary);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.rpv2-button:hover {
	transform: translateY(-1px);
	opacity: 0.96;
}

.rpv2-button--ghost {
	background: transparent;
	color: var(--rpv2-primary);
	border: 1px solid var(--rpv2-border);
}

.rpv2-form {
	display: grid;
	gap: 14px;
}

.rpv2-form label,
.rpv2-block-body label,
.rpv2-public label,
.rpv2-runtime-block label {
	display: grid;
	gap: 8px;
	font-size: 0.95rem;
	font-weight: 600;
}

.rpv2-form input,
.rpv2-form select,
.rpv2-form textarea,
.rpv2-block input,
.rpv2-block select,
.rpv2-block textarea,
.rpv2-public input,
.rpv2-public select,
.rpv2-public textarea {
	width: 100%;
	border-radius: 16px;
	border: 1px solid var(--rpv2-border);
	background: rgba(255, 255, 255, 0.92);
	padding: 12px 14px;
	color: var(--rpv2-text);
	outline: none;
	transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.rpv2-form input:focus,
.rpv2-form select:focus,
.rpv2-form textarea:focus,
.rpv2-block input:focus,
.rpv2-block select:focus,
.rpv2-block textarea:focus,
.rpv2-public input:focus,
.rpv2-public select:focus,
.rpv2-public textarea:focus {
	border-color: rgba(10, 10, 10, 0.4);
	box-shadow: 0 0 0 4px rgba(230, 189, 106, 0.2);
}

.rpv2-copy {
	width: 100%;
	cursor: copy;
}

.rpv2-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 10px;
}

.rpv2-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid rgba(10, 10, 10, 0.08);
}

.rpv2-list li:last-child {
	border-bottom: 0;
}

.rpv2-template-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 14px;
}

.rpv2-template-card {
	padding: 16px;
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.76);
	border: 1px solid var(--rpv2-border);
	display: grid;
	gap: 10px;
}

.rpv2-builder-toolbar {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding: 14px;
	border-radius: 18px;
	background: rgba(250, 250, 250, 0.9);
	border: 1px solid var(--rpv2-border);
}

.rpv2-slashbox {
	position: relative;
	flex: 1 1 260px;
}

.rpv2-slashmenu {
	position: absolute;
	z-index: 5;
	left: 0;
	right: 0;
	top: calc(100% + 8px);
	display: none;
	max-height: 280px;
	overflow: auto;
	padding: 8px;
	border-radius: 18px;
	background: #fff;
	border: 1px solid var(--rpv2-border);
	box-shadow: var(--rpv2-shadow);
}

.rpv2-slashmenu.is-open {
	display: grid;
	gap: 6px;
}

.rpv2-slashmenu button {
	width: 100%;
	border: 0;
	text-align: left;
	background: transparent;
	padding: 11px 12px;
	border-radius: 12px;
	font-weight: 600;
	cursor: pointer;
}

.rpv2-slashmenu button:hover {
	background: rgba(230, 189, 106, 0.16);
}

.rpv2-canvas {
	display: grid;
	gap: 14px;
	margin-top: 14px;
}

.rpv2-block {
	padding: 14px;
}

.rpv2-block-head {
	display: grid;
	grid-template-columns: auto 160px minmax(0, 1fr) auto;
	gap: 10px;
	align-items: center;
}

.rpv2-drag {
	user-select: none;
	cursor: grab;
	font-size: 1.25rem;
	line-height: 1;
	color: var(--rpv2-muted);
}

.rpv2-block.is-dragging {
	opacity: 0.55;
}

.rpv2-block.is-over {
	outline: 2px solid rgba(230, 189, 106, 0.5);
	outline-offset: 2px;
}

.rpv2-block-body {
	display: grid;
	gap: 14px;
	padding-top: 14px;
}

.rpv2-type-group {
	display: none;
	gap: 12px;
}

.rpv2-type-group.is-visible {
	display: grid;
}

.rpv2-help {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.55;
}

.rpv2-public {
	padding: 28px 16px 48px;
}

.rpv2-cover {
	margin-bottom: 18px;
	border-radius: 28px;
	overflow: hidden;
	border: 1px solid var(--rpv2-border);
	box-shadow: var(--rpv2-shadow);
}

.rpv2-cover img {
	display: block;
	width: 100%;
	height: 240px;
	object-fit: cover;
}

.rpv2-public-card {
	margin: 0 auto;
	width: 100%;
}

.rpv2-form-brand {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 22px;
}

.rpv2-runtime-form {
	display: grid;
	gap: 18px;
}

.rpv2-page {
	display: none;
	gap: 18px;
}

.rpv2-page.is-active {
	display: grid;
}

.rpv2-runtime-block {
	display: grid;
	gap: 12px;
}

.rpv2-runtime-block[data-rpv2-block-type="hidden"],
.rpv2-runtime-block[data-rpv2-block-type="page_break"],
.rpv2-runtime-block[data-rpv2-block-type="thank_you"] {
	display: none;
}

.rpv2-heading {
	margin: 0;
	font-family: var(--rpv2-font, "Space Grotesk", sans-serif);
	line-height: 1.02;
}

.rpv2-heading,
.rpv2-card h2,
.rpv2-card h3 {
	font-size: clamp(1.35rem, 3vw, 2.3rem);
}

.rpv2-text,
.rpv2-thankyou {
	line-height: 1.75;
	font-size: 1rem;
}

.rpv2-divider {
	width: 100%;
	margin: 0;
	border: 0;
	border-top: 1px solid rgba(10, 10, 10, 0.12);
}

.rpv2-image {
	margin: 0;
}

.rpv2-image img {
	display: block;
	width: 100%;
	border-radius: 18px;
}

.rpv2-columns {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.rpv2-field {
	padding: 16px;
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.68);
	border: 1px solid rgba(10, 10, 10, 0.08);
}

.rpv2-rating {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.rpv2-choice {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-right: 14px;
	margin-top: 8px;
}

.rpv2-page-nav {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding-top: 4px;
}

.rpv2-brand-preview {
	margin-top: 10px;
	padding: 10px;
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.72);
	border: 1px solid var(--rpv2-border);
}

.rpv2-brand-preview img {
	max-width: 100%;
	height: 72px;
	object-fit: contain;
}

@media (max-width: 980px) {
	.rpv2-stats,
	.rpv2-grid--2,
	.rpv2-grid--3,
	.rpv2-columns {
		grid-template-columns: 1fr;
	}

	.rpv2-block-head {
		grid-template-columns: 1fr;
	}

	.rpv2-topbar {
		align-items: flex-start;
		flex-direction: column;
	}
}

@media (max-width: 640px) {
	.rpv2-shell,
	.rpv2-public {
		padding-left: 12px;
		padding-right: 12px;
	}

	.rpv2-card,
	.rpv2-public-card {
		padding: 16px;
		border-radius: 18px;
	}

	.rpv2-title {
		font-size: clamp(1.8rem, 11vw, 2.8rem);
	}

	.rpv2-cover img {
		height: 180px;
	}

	.rpv2-page-nav .rpv2-button {
		width: 100%;
	}

	.rpv2-home-cta {
		flex-direction: column;
		align-items: stretch;
	}

	.rpv2-actions--stack {
		min-width: 0;
	}
}

body.rp-light-theme .rpv2-shell,
body.rp-light-theme .rpv2-public {
	max-width: 1200px !important;
	margin: 0 auto !important;
	padding: 36px 28px 72px !important;
	background: transparent !important;
	color: #0a0a0a !important;
	font-family: "Manrope", sans-serif !important;
}

body.rp-light-theme .rpv2-topbar,
body.rp-light-theme .rpv2-hero,
body.rp-light-theme .rpv2-stats,
body.rp-light-theme .rpv2-tabs,
body.rp-light-theme .rpv2-section,
body.rp-light-theme .rpv2-public-card {
	position: relative !important;
	z-index: 1 !important;
}

body.rp-light-theme .rpv2-brand-name,
body.rp-light-theme .rpv2-title,
body.rp-light-theme .rpv2-card h2,
body.rp-light-theme .rpv2-card h3,
body.rp-light-theme .rpv2-heading {
	font-family: "Space Grotesk", sans-serif !important;
	letter-spacing: -0.03em !important;
}

body.rp-light-theme .rpv2-title {
	font-size: clamp(2.1rem, 4vw, 4rem) !important;
	line-height: 0.96 !important;
}

body.rp-light-theme .rpv2-card,
body.rp-light-theme .rpv2-public-card,
body.rp-light-theme .rpv2-block {
	background: rgba(255, 255, 255, 0.82) !important;
	border: 1px solid rgba(0, 0, 0, 0.08) !important;
	border-radius: 0 !important;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05) !important;
	backdrop-filter: blur(14px) !important;
}

body.rp-light-theme .rpv2-card,
body.rp-light-theme .rpv2-public-card {
	padding: 24px !important;
}

body.rp-light-theme .rpv2-button {
	background: #0a0a0a !important;
	color: #fff !important;
	border: 1px solid #0a0a0a !important;
	border-radius: 0 !important;
	font-family: "Space Grotesk", sans-serif !important;
}

body.rp-light-theme .rpv2-button:hover,
body.rp-light-theme .rpv2-button:focus-visible {
	background: #e6bd6a !important;
	border-color: #e6bd6a !important;
	color: #0a0a0a !important;
}

body.rp-light-theme .rpv2-button--ghost {
	background: transparent !important;
	color: #0a0a0a !important;
	border: 1px solid rgba(0, 0, 0, 0.12) !important;
}

body.rp-light-theme .rpv2-tab {
	background: rgba(255, 255, 255, 0.8) !important;
	border: 1px solid rgba(0, 0, 0, 0.12) !important;
	border-radius: 0 !important;
}

body.rp-light-theme .rpv2-tab:hover,
body.rp-light-theme .rpv2-tab.is-active {
	background: #0a0a0a !important;
	border-color: #0a0a0a !important;
	color: #fff !important;
}

body.rp-light-theme .rpv2-form input,
body.rp-light-theme .rpv2-form select,
body.rp-light-theme .rpv2-form textarea,
body.rp-light-theme .rpv2-block input,
body.rp-light-theme .rpv2-block select,
body.rp-light-theme .rpv2-block textarea,
body.rp-light-theme .rpv2-public input,
body.rp-light-theme .rpv2-public select,
body.rp-light-theme .rpv2-public textarea {
	border-radius: 0 !important;
	border: 1px solid rgba(0, 0, 0, 0.16) !important;
	background: rgba(255, 255, 255, 0.92) !important;
	color: #0a0a0a !important;
	box-shadow: none !important;
}

body.rp-light-theme .rpv2-form input:focus,
body.rp-light-theme .rpv2-form select:focus,
body.rp-light-theme .rpv2-form textarea:focus,
body.rp-light-theme .rpv2-block input:focus,
body.rp-light-theme .rpv2-block select:focus,
body.rp-light-theme .rpv2-block textarea:focus,
body.rp-light-theme .rpv2-public input:focus,
body.rp-light-theme .rpv2-public select:focus,
body.rp-light-theme .rpv2-public textarea:focus {
	border-color: #0a0a0a !important;
	box-shadow: none !important;
}

body.rp-light-theme .rpv2-field,
body.rp-light-theme .rpv2-template-card,
body.rp-light-theme .rpv2-builder-toolbar,
body.rp-light-theme .rpv2-slashmenu,
body.rp-light-theme .rpv2-brand-preview,
body.rp-light-theme .rpv2-notice,
body.rp-light-theme .rpv2-stat {
	border-radius: 0 !important;
}

body.rp-light-theme .rpv2-cover {
	border-radius: 0 !important;
}

body.rp-light-theme .rpv2-shell .rpv2-brand img,
body.rp-light-theme .rpv2-shell .rpv2-form-brand img {
	border-radius: 14px !important;
}

/* ── Required field asterisk ─────────────────────────────────────────────── */

.rpv2-required {
	color: #e53e3e;
	font-weight: 700;
	margin-left: 3px;
	font-size: 1em;
}

.rpv2-field > span,
.rpv2-runtime-block label > span {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 0.95rem;
}

/* ── UUID share box in form editor ───────────────────────────────────────── */

.rpv2-uuid-share-box {
	margin-top: 16px;
	padding: 16px 20px;
	border-radius: var(--rpv2-radius-sm);
	background: rgba(230, 189, 106, 0.08);
	border: 1px solid rgba(230, 189, 106, 0.3);
	display: grid;
	gap: 10px;
}

.rpv2-uuid-share-box .rpv2-copy-wrap {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.rpv2-uuid-share-box .rpv2-copy {
	flex: 1 1 220px;
	font-size: 0.85rem;
	padding: 10px 12px;
}

.rpv2-label {
	font-size: 0.82rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--rpv2-muted);
	margin: 0;
}

/* ── Template card enhancements ──────────────────────────────────────────── */

.rpv2-template-card {
	transition: transform 160ms ease, box-shadow 160ms ease;
	cursor: default;
}

.rpv2-template-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 32px rgba(10, 10, 10, 0.12);
}

.rpv2-template-card strong {
	font-size: 1rem;
	font-family: var(--rpv2-font, 'Space Grotesk', sans-serif);
	letter-spacing: -0.02em;
}

.rpv2-template-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	margin-right: 8px;
	flex-shrink: 0;
}

/* ── Public form improvements ────────────────────────────────────────────── */

.rpv2-public {
	min-height: 100vh;
	background: var(--rpv2-surface, #f8f8f8);
}

.rpv2-public-card {
	padding: 32px 28px;
}

@media (max-width: 640px) {
	.rpv2-public-card {
		padding: 20px 16px;
	}
}

.rpv2-thankyou {
	padding: 28px;
	border-radius: 18px;
	background: rgba(103, 215, 200, 0.1);
	border: 1px solid rgba(103, 215, 200, 0.3);
	text-align: center;
}

/* Viewer / editor unique link badge */
.rpv2-access-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(230, 189, 106, 0.14);
	border: 1px solid rgba(230, 189, 106, 0.3);
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--rpv2-primary);
}
