/* rSocials Campaign Planner — n8n-style flow canvas */
folk-campaign-planner {
	display: block;
	height: 100%;
}

.cp-root {
	display: flex;
	flex-direction: column;
	height: 100%;
	font-family: system-ui, -apple-system, sans-serif;
	color: var(--rs-text-primary, #e2e8f0);
}

/* ── Toolbar ── */
.cp-toolbar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 20px;
	min-height: 46px;
	border-bottom: 1px solid var(--rs-border, #2d2d44);
	background: var(--rs-bg-surface, #1a1a2e);
	z-index: 10;
}

.cp-toolbar__title {
	font-size: 15px;
	font-weight: 600;
	flex: 1;
	display: flex;
	align-items: center;
	gap: 8px;
}

.cp-demo-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	background: #f59e0b22;
	color: #f59e0b;
	font-size: 11px;
	font-weight: 600;
}

.cp-toolbar__actions {
	display: flex;
	gap: 6px;
	align-items: center;
}

.cp-btn {
	padding: 6px 12px;
	border-radius: 8px;
	border: 1px solid var(--rs-input-border, #3d3d5c);
	background: var(--rs-input-bg, #16162a);
	color: var(--rs-text-primary, #e2e8f0);
	font-size: 12px;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
	white-space: nowrap;
}

.cp-btn:hover {
	border-color: var(--rs-border-strong, #4d4d6c);
}

.cp-btn--add {
	background: #10b98122;
	border-color: #10b98155;
	color: #34d399;
}

.cp-btn--add:hover {
	background: #10b98133;
	border-color: #10b981;
}

.cp-btn--postiz {
	background: #6366f122;
	border-color: #6366f155;
	color: #818cf8;
}

.cp-btn--postiz:hover {
	background: #6366f133;
	border-color: #6366f1;
}

/* ── Canvas area ── */
.cp-canvas-area {
	flex: 1;
	display: flex;
	overflow: hidden;
	position: relative;
}

.cp-canvas {
	flex: 1;
	position: relative;
	overflow: hidden;
	cursor: grab;
	background: var(--rs-canvas-bg, #0f0f23);
}

.cp-canvas.grabbing {
	cursor: grabbing;
}

.cp-canvas.wiring {
	cursor: crosshair;
}

.cp-canvas svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* ── Zoom controls ── */
.cp-zoom-controls {
	position: absolute;
	bottom: 12px;
	right: 12px;
	display: flex;
	align-items: center;
	gap: 4px;
	background: var(--rs-bg-surface, #1a1a2e);
	border: 1px solid var(--rs-border-strong, #3d3d5c);
	border-radius: 8px;
	padding: 4px 6px;
	z-index: 5;
}

.cp-zoom-btn {
	width: 28px;
	height: 28px;
	border: none;
	border-radius: 6px;
	background: transparent;
	color: var(--rs-text-primary, #e2e8f0);
	font-size: 16px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s;
}

.cp-zoom-btn:hover {
	background: var(--rs-bg-surface-raised, #252545);
}

.cp-zoom-level {
	font-size: 11px;
	color: var(--rs-text-muted, #94a3b8);
	min-width: 36px;
	text-align: center;
}

/* ── Node styles ── */
.cp-node { cursor: pointer; }
.cp-node.selected > foreignObject > div,
.cp-node.selected > rect {
	outline: 2px solid #6366f1;
	outline-offset: 2px;
}

.cp-node foreignObject > div {
	transition: border-color 0.15s;
}

.cp-node:hover foreignObject > div {
	border-color: #4f46e5 !important;
}

/* ── Port styles ── */
.port-group { cursor: crosshair; }
.port-dot {
	transition: r 0.15s, filter 0.15s;
}

.port-group:hover .port-dot {
	r: 7;
	filter: drop-shadow(0 0 4px currentColor);
}

.port-group--wiring-source .port-dot {
	r: 7;
	filter: drop-shadow(0 0 6px currentColor);
}

.port-group--wiring-target .port-dot {
	r: 7;
	animation: port-pulse 0.8s ease-in-out infinite;
}

.port-group--wiring-dimmed .port-dot {
	opacity: 0.2;
}

@keyframes port-pulse {
	0%, 100% { filter: drop-shadow(0 0 3px currentColor); }
	50% { filter: drop-shadow(0 0 8px currentColor); }
}

/* ── Edge styles ── */
.edge-group { pointer-events: stroke; }

.edge-path-publish {
	stroke-dasharray: 8 4;
	animation: edge-dash 1s linear infinite;
	filter: drop-shadow(0 0 3px var(--edge-color, #10b981));
}

.edge-path-sequence {
	stroke-linecap: round;
}

.edge-path-target {
	stroke-dasharray: 4 6;
}

.edge-hit-area { cursor: pointer; }

.edge-glow {
	pointer-events: none;
}

.edge-drag-handle {
	fill: var(--rs-bg-surface, #1a1a2e);
	stroke: var(--rs-text-muted, #94a3b8);
	stroke-width: 1.5;
	cursor: grab;
	opacity: 0;
	transition: opacity 0.15s;
}

.edge-group:hover .edge-drag-handle {
	opacity: 1;
}

@keyframes edge-dash {
	to { stroke-dashoffset: -24; }
}

/* ── Wiring temp line ── */
.wiring-temp-path {
	fill: none;
	stroke: #6366f1;
	stroke-width: 2;
	stroke-dasharray: 6 4;
	opacity: 0.7;
	pointer-events: none;
}

/* ── Inline config panel ── */
.cp-inline-config {
	background: var(--rs-bg-surface, #1a1a2e);
	border: 1px solid var(--rs-border-strong, #3d3d5c);
	border-radius: 10px;
	overflow: hidden;
	font-size: 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.cp-icp-header {
	padding: 10px 12px;
	border-bottom: 1px solid var(--rs-border, #2d2d44);
	font-weight: 600;
	font-size: 13px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.cp-icp-body {
	padding: 10px 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 300px;
	overflow-y: auto;
}

.cp-icp-body label {
	font-size: 11px;
	color: var(--rs-text-muted, #94a3b8);
	margin-bottom: 2px;
}

.cp-icp-body input,
.cp-icp-body select,
.cp-icp-body textarea {
	width: 100%;
	padding: 6px 8px;
	border-radius: 6px;
	border: 1px solid var(--rs-input-border, #3d3d5c);
	background: var(--rs-input-bg, #16162a);
	color: var(--rs-text-primary, #e2e8f0);
	font-size: 12px;
	font-family: inherit;
	box-sizing: border-box;
}

.cp-icp-body textarea {
	resize: vertical;
	min-height: 60px;
}

.cp-icp-toolbar {
	padding: 8px 12px;
	border-top: 1px solid var(--rs-border, #2d2d44);
	display: flex;
	gap: 6px;
}

.cp-icp-toolbar button {
	flex: 1;
	padding: 5px 8px;
	border-radius: 6px;
	border: none;
	font-size: 11px;
	cursor: pointer;
	font-weight: 600;
}

.cp-icp-btn-done {
	background: #10b981;
	color: white;
}

.cp-icp-btn-delete {
	background: #ef4444;
	color: white;
}

/* ── Context menu ── */
.cp-context-menu {
	position: absolute;
	z-index: 50;
	background: var(--rs-bg-surface, #1a1a2e);
	border: 1px solid var(--rs-border-strong, #3d3d5c);
	border-radius: 10px;
	padding: 4px;
	min-width: 160px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.cp-ctx-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 12px;
	color: var(--rs-text-primary, #e2e8f0);
	transition: background 0.1s;
}

.cp-ctx-item:hover {
	background: var(--rs-bg-surface-raised, #252545);
}

.cp-ctx-sep {
	height: 1px;
	background: var(--rs-border, #2d2d44);
	margin: 4px 8px;
}

/* ── Phase node (background container) ── */
.cp-phase-rect {
	rx: 12;
	ry: 12;
	stroke-width: 1.5;
	stroke-dasharray: 6 3;
}

.cp-phase-label {
	font-size: 13px;
	font-weight: 700;
	fill: var(--rs-text-primary, #e2e8f0);
}

.cp-phase-date {
	font-size: 10px;
	fill: var(--rs-text-muted, #94a3b8);
}

.cp-phase-progress-bg {
	fill: rgba(255, 255, 255, 0.06);
	rx: 2;
	ry: 2;
}

.cp-phase-progress-fill {
	rx: 2;
	ry: 2;
}

/* ── Postiz slide-out panel ── */
.cp-postiz-panel {
	width: 0;
	overflow: hidden;
	border-left: 1px solid var(--rs-border, #2d2d44);
	background: var(--rs-bg-surface, #1a1a2e);
	display: flex;
	flex-direction: column;
	transition: width 0.3s ease;
}

.cp-postiz-panel.open {
	width: 60%;
	min-width: 400px;
}

.cp-postiz-header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border-bottom: 1px solid var(--rs-border, #2d2d44);
	min-height: 44px;
}

.cp-postiz-title {
	font-size: 13px;
	font-weight: 600;
	flex: 1;
}

.cp-postiz-close {
	background: none;
	border: none;
	color: var(--rs-text-muted, #94a3b8);
	font-size: 16px;
	cursor: pointer;
	padding: 4px;
}

.cp-postiz-close:hover {
	color: var(--rs-text-primary, #e2e8f0);
}

.cp-postiz-iframe {
	flex: 1;
	border: none;
	width: 100%;
}

/* ── Mobile ── */
@media (max-width: 768px) {
	.cp-postiz-panel.open {
		position: absolute;
		top: 0;
		right: 0;
		width: 100%;
		height: 100%;
		z-index: 20;
		min-width: unset;
	}

	.cp-toolbar {
		flex-wrap: wrap;
		padding: 8px 12px;
	}

	.cp-toolbar__actions {
		flex-wrap: wrap;
	}
}

/* ── View Switcher ── */
.cp-view-switcher {
	display: flex;
	gap: 2px;
	background: var(--rs-input-bg, #16162a);
	border: 1px solid var(--rs-input-border, #3d3d5c);
	border-radius: 8px;
	padding: 2px;
}

.cp-view-btn {
	width: 30px;
	height: 28px;
	border: none;
	border-radius: 6px;
	background: transparent;
	color: var(--rs-text-muted, #94a3b8);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, color 0.15s;
}

.cp-view-btn:hover {
	background: var(--rs-bg-surface-raised, #252545);
	color: var(--rs-text-primary, #e2e8f0);
}

.cp-view-btn.active {
	background: #6366f133;
	color: #818cf8;
}

/* ── Alt view container ── */
.cp-alt-view {
	display: none;
	flex: 1;
	overflow: auto;
	background: var(--rs-canvas-bg, #0f0f23);
}

/* ── Timeline View ── */
.cp-timeline {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.cp-tl-scroll {
	flex: 1;
	overflow: auto;
	padding: 16px;
}

.cp-tl-grid {
	display: grid;
	gap: 0;
	min-width: max-content;
}

.cp-tl-header {
	display: contents;
}

.cp-tl-day {
	padding: 8px 12px;
	font-size: 11px;
	font-weight: 600;
	color: var(--rs-text-muted, #94a3b8);
	border-bottom: 1px solid var(--rs-border, #2d2d44);
	position: sticky;
	top: 0;
	background: var(--rs-canvas-bg, #0f0f23);
	z-index: 2;
	text-align: center;
}

.cp-tl-phases {
	display: flex;
	gap: 4px;
	padding: 8px 0;
}

.cp-tl-phase {
	padding: 4px 10px;
	border-radius: 6px;
	white-space: nowrap;
}

.cp-tl-body {
	display: grid;
	gap: 0;
}

.cp-tl-col {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 8px 6px;
	border-right: 1px solid var(--rs-border, #2d2d44);
	min-height: 60px;
}

.cp-tl-col:last-child {
	border-right: none;
}

.cp-tl-card {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 8px;
	background: var(--rs-bg-surface, #1a1a2e);
	border: 1px solid var(--rs-border, #2d2d44);
	border-radius: 6px;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
	font-size: 11px;
}

.cp-tl-card:hover {
	border-color: #6366f1;
	background: var(--rs-bg-surface-raised, #252545);
}

.cp-tl-card__icon {
	font-size: 12px;
	flex-shrink: 0;
}

.cp-tl-card__label {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--rs-text-primary, #e2e8f0);
}

.cp-tl-card__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	flex-shrink: 0;
}

.cp-tl-card__time {
	font-size: 9px;
	color: var(--rs-text-muted, #94a3b8);
	white-space: nowrap;
}

/* ── Platform View ── */
.cp-platform-view {
	display: flex;
	gap: 16px;
	padding: 16px;
	height: 100%;
	overflow-x: auto;
}

.cp-pv-column {
	flex: 1;
	min-width: 220px;
	max-width: 320px;
	display: flex;
	flex-direction: column;
	background: var(--rs-bg-surface, #1a1a2e);
	border: 1px solid var(--rs-border, #2d2d44);
	border-radius: 10px;
	overflow: hidden;
}

.cp-pv-column__header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-bottom: 1px solid var(--rs-border, #2d2d44);
}

.cp-pv-column__title {
	font-size: 13px;
	font-weight: 600;
	color: var(--rs-text-primary, #e2e8f0);
	flex: 1;
}

.cp-pv-column__count {
	font-size: 10px;
	background: var(--rs-bg-surface-raised, #252545);
	color: var(--rs-text-muted, #94a3b8);
	padding: 2px 6px;
	border-radius: 10px;
	font-weight: 600;
}

.cp-pv-column__body {
	flex: 1;
	overflow-y: auto;
	padding: 8px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 100%;
}

.cp-pv-card {
	padding: 10px;
	background: var(--rs-input-bg, #16162a);
	border: 1px solid var(--rs-border, #2d2d44);
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
}

.cp-pv-card:hover {
	border-color: #6366f1;
	background: var(--rs-bg-surface-raised, #252545);
}

.cp-pv-card__header {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 4px;
}

.cp-pv-card__label {
	font-size: 12px;
	font-weight: 600;
	color: var(--rs-text-primary, #e2e8f0);
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cp-pv-card__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	flex-shrink: 0;
}

.cp-pv-card__preview {
	font-size: 11px;
	color: var(--rs-text-muted, #94a3b8);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	margin-bottom: 6px;
}

.cp-pv-card__meta {
	display: flex;
	justify-content: space-between;
	font-size: 10px;
	color: #64748b;
}

.cp-pv-card__type {
	text-transform: capitalize;
}

.cp-pv-card__tags {
	display: flex;
	gap: 4px;
	margin-top: 6px;
	flex-wrap: wrap;
}

.cp-pv-tag {
	font-size: 9px;
	padding: 1px 5px;
	border-radius: 4px;
	background: #6366f122;
	color: #818cf8;
}

/* ── Table View ── */
.cp-table-view {
	padding: 16px;
	overflow: auto;
	height: 100%;
}

.cp-tv-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
}

.cp-tv-table thead th {
	position: sticky;
	top: 0;
	background: var(--rs-bg-surface, #1a1a2e);
	text-align: left;
	padding: 8px 12px;
	font-size: 11px;
	font-weight: 600;
	color: var(--rs-text-muted, #94a3b8);
	border-bottom: 1px solid var(--rs-border-strong, #3d3d5c);
	white-space: nowrap;
	z-index: 2;
}

.cp-tv-row {
	cursor: pointer;
	transition: background 0.1s;
}

.cp-tv-row:hover {
	background: var(--rs-bg-surface-raised, #252545);
}

.cp-tv-row td {
	padding: 8px 12px;
	border-bottom: 1px solid var(--rs-border, #2d2d44);
	color: var(--rs-text-primary, #e2e8f0);
	white-space: nowrap;
}

.cp-tv-content {
	max-width: 300px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap !important;
	color: var(--rs-text-muted, #94a3b8) !important;
}

.cp-tv-dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	margin-right: 6px;
	vertical-align: middle;
}

.cp-tv-tag {
	font-size: 9px;
	padding: 1px 5px;
	border-radius: 4px;
	background: #6366f122;
	color: #818cf8;
	margin-right: 3px;
}

/* ── Mobile: alt views ── */
@media (max-width: 768px) {
	.cp-view-switcher {
		order: -1;
		width: 100%;
		justify-content: center;
	}

	.cp-platform-view {
		flex-direction: column;
		gap: 12px;
	}

	.cp-pv-column {
		max-width: 100%;
		min-width: 0;
	}

	.cp-pv-column__body {
		max-height: 300px;
	}

	.cp-tl-card {
		font-size: 10px;
		padding: 4px 6px;
	}

	.cp-tv-table {
		font-size: 11px;
	}

	.cp-tv-row td {
		padding: 6px 8px;
	}

	.cp-tv-content {
		max-width: 150px;
	}
}

/* ── Brief panel (collapsible left sidebar) ── */
.cp-brief-panel {
	width: 0;
	overflow: hidden;
	border-right: 1px solid var(--rs-border, #2d2d44);
	background: var(--rs-bg-surface, #1a1a2e);
	display: flex;
	flex-direction: column;
	transition: width 0.3s ease;
	flex-shrink: 0;
}

.cp-brief-panel.open {
	width: 300px;
}

.cp-brief-header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border-bottom: 1px solid var(--rs-border, #2d2d44);
	min-height: 44px;
}

.cp-brief-title {
	font-size: 13px;
	font-weight: 600;
	flex: 1;
}

.cp-brief-close {
	background: none;
	border: none;
	color: var(--rs-text-muted, #94a3b8);
	font-size: 16px;
	cursor: pointer;
	padding: 4px;
}

.cp-brief-close:hover {
	color: var(--rs-text-primary, #e2e8f0);
}

.cp-brief-body {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.cp-brief-body label {
	font-size: 11px;
	color: var(--rs-text-muted, #94a3b8);
	font-weight: 600;
}

.cp-brief-body textarea {
	width: 100%;
	padding: 8px 10px;
	border-radius: 8px;
	border: 1px solid var(--rs-input-border, #3d3d5c);
	background: var(--rs-input-bg, #16162a);
	color: var(--rs-text-primary, #e2e8f0);
	font-size: 12px;
	font-family: inherit;
	box-sizing: border-box;
	resize: vertical;
	min-height: 120px;
}

/* ── Platform selector chips ── */
.cp-platform-checkboxes {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.cp-platform-check {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	border-radius: 6px;
	border: 1px solid var(--rs-input-border, #3d3d5c);
	background: var(--rs-input-bg, #16162a);
	cursor: pointer;
	font-size: 11px;
	color: var(--rs-text-primary, #e2e8f0);
	transition: border-color 0.15s, background 0.15s;
}

.cp-platform-check:has(input:checked) {
	border-color: #6366f1;
	background: #6366f122;
}

.cp-platform-check input {
	display: none;
}

/* ── Brief / Generate buttons ── */
.cp-btn--brief {
	background: #8b5cf622;
	border-color: #8b5cf655;
	color: #a78bfa;
}

.cp-btn--brief:hover {
	background: #8b5cf633;
	border-color: #8b5cf6;
}

.cp-btn--brief.active {
	background: #8b5cf633;
	border-color: #8b5cf6;
}

.cp-btn--generate {
	width: 100%;
	padding: 10px;
	border-radius: 8px;
	border: none;
	background: #6366f1;
	color: white;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s;
}

.cp-btn--generate:hover {
	background: #4f46e5;
}

.cp-btn--generate:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ── Stale badge ── */
.cp-stale-badge {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 2px 6px;
	border-radius: 4px;
	background: #f59e0b22;
	color: #f59e0b;
	font-size: 9px;
	font-weight: 600;
	white-space: nowrap;
}

/* ── Regen button (amber) ── */
.cp-btn--regen {
	background: #f59e0b22;
	border-color: #f59e0b55;
	color: #fbbf24;
}

.cp-btn--regen:hover {
	background: #f59e0b33;
	border-color: #f59e0b;
}

/* ── AI fill button (indigo) ── */
.cp-icp-btn-ai {
	background: #6366f1;
	color: white;
	flex: 1;
}

.cp-icp-btn-ai:hover {
	background: #4f46e5;
}

.cp-icp-btn-ai:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ── Feeds edge style ── */
.edge-path-feeds {
	stroke-dasharray: 6 4;
	filter: drop-shadow(0 0 2px #6366f1);
}

/* ── Preview banner (brief-generated nodes awaiting confirmation) ── */
.cp-preview-banner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.75rem;
	padding: 10px 16px;
	margin: 8px 12px 0;
	border-radius: 8px;
	background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(139, 92, 246, 0.15));
	border: 1px solid rgba(236, 72, 153, 0.35);
}
.cp-preview-banner__label {
	font-size: 13px;
	font-weight: 600;
	color: #f9a8d4;
}
.cp-preview-banner__actions {
	display: flex;
	gap: 6px;
}

/* ── Preview nodes: dashed outline + pulse ── */
.cp-node--preview {
	animation: cp-preview-pulse 2s ease-in-out infinite;
}
.cp-node--preview foreignObject > div {
	box-shadow: 0 0 0 2px #ec4899, 0 0 12px rgba(236, 72, 153, 0.4);
	border-radius: 10px;
}
@keyframes cp-preview-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.85; }
}

/* ── Primary button ── */
.cp-btn--primary {
	background: #6366f1;
	color: #fff;
	border-color: #6366f1;
}
.cp-btn--primary:hover {
	background: #4f46e5;
	border-color: #4f46e5;
}

/* ── Modal overlay + modal (import) ── */
.cp-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
}
.cp-modal-overlay[hidden] {
	display: none;
}
.cp-modal {
	background: var(--rs-bg-surface, #1e293b);
	border: 1px solid var(--rs-input-border, #334155);
	border-radius: 12px;
	padding: 1.25rem 1.5rem;
	width: 92%;
	max-width: 580px;
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	max-height: 90vh;
	overflow-y: auto;
}
.cp-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.cp-modal__header h3 {
	margin: 0;
	font-size: 1.05rem;
	color: var(--rs-text-primary, #f1f5f9);
}
.cp-modal__close {
	background: none;
	border: none;
	color: var(--rs-text-muted, #64748b);
	font-size: 1.5rem;
	cursor: pointer;
	line-height: 1;
}
.cp-modal__close:hover {
	color: var(--rs-text-primary, #f1f5f9);
}
.cp-modal__hint {
	margin: 0;
	font-size: 0.8rem;
	color: var(--rs-text-secondary, #94a3b8);
	line-height: 1.5;
}
.cp-modal__hint code {
	background: var(--rs-input-bg, #0f172a);
	padding: 1px 5px;
	border-radius: 4px;
	font-size: 0.75rem;
}
.cp-modal__textarea {
	width: 100%;
	min-height: 180px;
	background: var(--rs-input-bg, #0f172a);
	color: var(--rs-input-text, #f1f5f9);
	border: 1px solid var(--rs-input-border, #334155);
	border-radius: 8px;
	padding: 0.7rem;
	font-family: inherit;
	font-size: 0.85rem;
	resize: vertical;
	line-height: 1.5;
	box-sizing: border-box;
}
.cp-modal__textarea:focus {
	outline: none;
	border-color: #6366f1;
}
.cp-modal__row {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	flex-wrap: wrap;
}
.cp-modal__label {
	font-size: 0.8rem;
	color: var(--rs-text-secondary, #94a3b8);
	font-weight: 600;
}
.cp-modal__select {
	background: var(--rs-input-bg, #0f172a);
	color: var(--rs-input-text, #f1f5f9);
	border: 1px solid var(--rs-input-border, #334155);
	border-radius: 6px;
	padding: 0.45rem 0.65rem;
	font-size: 0.85rem;
	min-width: 140px;
}
.cp-modal__select:focus {
	outline: none;
	border-color: #6366f1;
}

/* ── Mobile: modal ── */
@media (max-width: 768px) {
	.cp-modal {
		width: 95%;
	}
}
