/**
 * Code Snippet Module - Admin Styles
 * Matches Options Page Builder design
 *
 * @package CodeSnippet
 * @since 1.0.0
 */

:root {
	--cs-blue: #2271b1;
	--cs-blue-hover: #135e96;
	--cs-black: #1d2327;
	--cs-gray: #50575e;
	--cs-border: #c3c4c7;
	--cs-bg: #f0f0f1;
	--cs-danger: #d63638;
	--cs-danger-hover: #b32d2e;
	--cs-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/*
 * Adopt the active WordPress admin color scheme. WP defines --wp-admin-theme-color on
 * body.admin-color-*, and custom properties only inherit downward, so these must be
 * redefined inside <body> rather than on :root. This stylesheet only loads on Code
 * Snippet screens, so scoping to .wrap safely covers the list, edit, settings, and
 * logs pages. Falls back to the default "fresh" blue.
 */
.wrap {
	--cs-blue: var(--wp-admin-theme-color, #2271b1);
	--cs-blue-hover: var(--wp-admin-theme-color-darker-10, #135e96);
}

.wpps-cs-wrap {
	margin: 20px 20px 20px 0;
}

/* Fixed toast - always visible in viewport (copy shortcode, save, etc.) */
.wpps-cs-toast {
	position: fixed;
	bottom: 24px;
	right: 24px;
	padding: 12px 20px;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	font-size: 14px;
	font-weight: 500;
	z-index: 100000;
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.25s ease, transform 0.25s ease;
	pointer-events: none;
	max-width: 320px;
}

.wpps-cs-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.wpps-cs-toast-success {
	background: #00a32a;
	color: #fff;
}

.wpps-cs-toast-error {
	background: #d63638;
	color: #fff;
}

/* Header */
.wpps-cs-header-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #fff;
	border: 1px solid var(--cs-border);
	box-shadow: var(--cs-shadow);
	margin-bottom: 32px;
	padding: 20px 24px;
}

.wpps-cs-header-left {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 16px;
}

.wpps-cs-header-icon {
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--cs-bg);
	color: var(--cs-black);
}

.wpps-cs-header-icon .dashicons {
	font-size: 24px;
	width: 24px;
	height: 24px;
}

.wpps-cs-title {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--cs-black);
}

.wpps-cs-subtitle {
	margin: 0;
	font-size: 0.875rem;
	color: var(--cs-gray);
}

.wpps-cs-header-right {
	flex-shrink: 0;
}

.wpps-cs-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0 16px;
	min-height: 40px;
	line-height: 1;
	border-radius: 2px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	border: none;
	text-decoration: none;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
	box-sizing: border-box;
}

.wpps-cs-btn .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.wpps-cs-btn-primary {
	background: var(--cs-blue);
	border: 1px solid var(--cs-blue);
	color: #fff;
}

.wpps-cs-btn-primary:hover {
	background: var(--cs-blue-hover);
	border-color: var(--cs-blue-hover);
	color: #fff;
}

.wpps-cs-btn-secondary {
	background: #fff;
	border: 1px solid var(--cs-border);
	color: var(--cs-black);
}

.wpps-cs-btn-secondary:hover {
	background: var(--cs-bg);
	border-color: var(--cs-gray);
	color: var(--cs-black);
}

/* Save button loading state */
.wpps-cs-btn.is-loading {
	pointer-events: none;
	opacity: 0.85;
}

.wpps-cs-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: wpps-cs-spin 0.7s linear infinite;
	vertical-align: middle;
	margin-right: 6px;
}

.wpps-cs-btn-primary .wpps-cs-spinner {
	border-color: rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
}

.wpps-cs-spinner-secondary {
	border-color: rgba(0, 0, 0, 0.15);
	border-top-color: var(--cs-gray);
}

@keyframes wpps-cs-spin {
	to { transform: rotate(360deg); }
}

/* Empty State */
.wpps-cs-empty-state {
	text-align: center;
	padding: 64px 40px;
	background: #fff;
	border: 1px solid var(--cs-border);
	box-shadow: var(--cs-shadow);
}

.wpps-cs-empty-icon {
	width: 80px;
	height: 80px;
	margin: 0 auto 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--cs-bg);
	color: var(--cs-black);
}

.wpps-cs-empty-icon .dashicons {
	font-size: 40px;
	width: 40px;
	height: 40px;
}

.wpps-cs-empty-title {
	margin: 0 0 8px;
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--cs-black);
}

.wpps-cs-empty-desc {
	margin: 0 0 32px;
	font-size: 0.9375rem;
	color: var(--cs-gray);
}

.wpps-cs-empty-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 0 16px;
	min-height: 40px;
	line-height: 2.92307692;
	font-size: 13px;
	font-weight: 500;
	background: var(--cs-blue);
	border: 1px solid var(--cs-blue);
	color: #fff;
	border-radius: 2px;
	text-decoration: none;
	transition: background 0.2s, border-color 0.2s;
	cursor: pointer;
}

.wpps-cs-empty-btn:hover {
	background: var(--cs-blue-hover);
	border-color: var(--cs-blue-hover);
	color: #fff;
}

.wpps-cs-empty-btn .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

/* List table: type badges */
.wpps-cs-type-badge {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 4px;
}

.wpps-cs-type-html {
	background: #e8f4fd;
	color: #0c5a9e;
}

.wpps-cs-type-css {
	background: #f0e6fa;
	color: #6b21a8;
}

.wpps-cs-type-js {
	background: #fef3c7;
	color: #b45309;
}

.wpps-cs-type-php {
	background: #e0e7ff;
	color: #3730a3;
}

/* List table: status toggle */
.wpps-cs-status-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 0.8125rem;
}

.wpps-cs-status-toggle input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.wpps-cs-status-slider {
	position: relative;
	display: inline-block;
	width: 36px;
	height: 20px;
	background: var(--cs-border);
	border-radius: 20px;
	transition: 0.2s;
}

.wpps-cs-status-slider::before {
	content: "";
	position: absolute;
	height: 14px;
	width: 14px;
	left: 3px;
	bottom: 3px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 2px rgba(0,0,0,0.2);
	transition: 0.2s;
}

.wpps-cs-status-toggle input:checked + .wpps-cs-status-slider {
	background: var(--cs-blue);
}

.wpps-cs-status-toggle input:checked + .wpps-cs-status-slider::before {
	transform: translateX(16px);
}

.wpps-cs-status-label {
	font-weight: 500;
}

/* Edit page */
.wpps-cs-back {
	display: inline-block;
	margin-bottom: 10px;
	color: var(--cs-blue);
	text-decoration: none;
	font-size: 0.875rem;
}

.wpps-cs-back:hover {
	color: var(--cs-blue-hover);
	text-decoration: underline;
}

.wpps-cs-edit-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
	flex-wrap: wrap;
	gap: 12px;
}

.wpps-cs-edit-title {
	margin: 0;
	font-size: 1.75rem;
	font-weight: 600;
	color: var(--cs-black);
}

.wpps-cs-edit-header-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

/* Edit page vertical rhythm */
.wpps-cs-edit-wrap {
	--cs-edit-gap: 20px;
}

.wpps-cs-edit-wrap .wpps-cs-back {
	margin-bottom: 14px;
}

.wpps-cs-edit-wrap .wpps-cs-edit-header {
	margin-bottom: var(--cs-edit-gap);
}

.wpps-cs-edit-notices {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: var(--cs-edit-gap);
}

.wpps-cs-edit-notices .notice {
	margin: 0;
}

#wpps-cs-edit-notice[hidden] {
	display: none !important;
}

#wpps-cs-edit-notice:not([hidden]) {
	margin: 0 0 var(--cs-edit-gap);
}

.wpps-cs-edit-stack {
	display: flex;
	flex-direction: column;
	gap: var(--cs-edit-gap);
}

.wpps-cs-edit-stack > .wpps-cs-edit-panel,
.wpps-cs-edit-stack > .wpps-cs-accordions {
	margin-bottom: 0;
}

.wpps-cs-active-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-size: 0.875rem;
	color: var(--cs-gray);
}

.wpps-cs-active-toggle input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.wpps-cs-toggle-slider {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	background: var(--cs-border);
	border-radius: 24px;
	transition: 0.2s;
}

.wpps-cs-toggle-slider::before {
	content: "";
	position: absolute;
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 2px rgba(0,0,0,0.2);
	transition: 0.2s;
}

.wpps-cs-active-toggle input:checked + .wpps-cs-toggle-slider {
	background: var(--cs-blue);
}

.wpps-cs-active-toggle input:checked + .wpps-cs-toggle-slider::before {
	transform: translateX(20px);
}

.wpps-cs-title-panel {
	padding: 16px 20px;
	margin-bottom: 0;
	border: 1px solid var(--cs-border);
	box-shadow: var(--cs-shadow);
	background: #fff;
}

.wpps-cs-title-input {
	width: 100%;
	padding: 8px 12px;
	font-size: 1.125rem;
	border: 1px solid var(--cs-border);
	border-radius: 2px;
	box-sizing: border-box;
}

.wpps-cs-title-input:focus {
	outline: none;
	border-color: var(--cs-blue);
	box-shadow: 0 0 0 1px var(--cs-blue);
}

.wpps-cs-title-input::placeholder {
	color: var(--cs-gray);
}

.wpps-cs-edit-panel {
	background: #fff;
	border: 1px solid var(--cs-border);
	box-shadow: var(--cs-shadow);
	padding: 20px;
	margin-bottom: 16px;
}

.wpps-cs-code-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--cs-border);
	flex-wrap: wrap;
	gap: 12px;
}

.wpps-cs-code-panel-title-row {
	display: flex;
	align-items: center;
	gap: 10px;
}

.wpps-cs-code-panel-icon {
	font-size: 20px;
	width: 20px;
	height: 20px;
	color: var(--cs-blue);
}

.wpps-cs-panel-title {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--cs-black);
}

.wpps-cs-panel-title .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	margin-right: 4px;
	vertical-align: middle;
	color: var(--cs-gray);
}

.wpps-cs-code-type-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
}

.wpps-cs-code-type-label {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--cs-black);
}

.wpps-cs-code-type-trigger {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border: 1px solid var(--cs-border);
	border-radius: 4px;
	background: #fff;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--cs-black);
	cursor: pointer;
	transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.wpps-cs-code-type-trigger:hover {
	border-color: var(--cs-blue);
	background: #f8fafc;
	box-shadow: 0 0 0 1px var(--cs-blue);
}

.wpps-cs-code-type-trigger:focus {
	outline: none;
	border-color: var(--cs-blue);
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.25);
}

.wpps-cs-code-type-trigger .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: var(--cs-gray);
}

/* Code Type Modal */
.wpps-cs-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transition: visibility 0.2s, opacity 0.2s;
}

.wpps-cs-modal.is-open {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
}

.wpps-cs-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	cursor: pointer;
}

.wpps-cs-modal-content {
	position: relative;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	max-width: 720px;
	width: 100%;
	max-height: 90vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	z-index: 100001;
}

.wpps-cs-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid var(--cs-border);
}

.wpps-cs-modal-header h2 {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--cs-black);
}

.wpps-cs-modal-close {
	background: none;
	border: none;
	font-size: 24px;
	line-height: 1;
	color: var(--cs-gray);
	cursor: pointer;
	padding: 0 4px;
	transition: color 0.2s;
}

.wpps-cs-modal-close:hover {
	color: var(--cs-black);
}

.wpps-cs-modal-body {
	padding: 24px;
	overflow-y: auto;
	flex: 1;
	min-height: 0;
}

.wpps-cs-code-type-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
}

.wpps-cs-code-type-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	text-align: left;
	padding: 20px;
	border: 2px solid var(--cs-border);
	border-radius: 4px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.wpps-cs-code-type-card:hover {
	border-color: var(--cs-blue);
	background: #f8fafc;
	box-shadow: 0 2px 8px rgba(34, 113, 177, 0.1);
}

.wpps-cs-code-type-card.is-selected {
	border-color: var(--cs-blue);
	background: #f0f6fc;
	box-shadow: 0 0 0 1px var(--cs-blue);
}

.wpps-cs-code-type-card-title {
	display: block;
	font-size: 1rem;
	font-weight: 600;
	color: var(--cs-black);
	margin-bottom: 8px;
}

.wpps-cs-code-type-card-desc {
	display: block;
	font-size: 0.8125rem;
	color: var(--cs-gray);
	line-height: 1.5;
}

/* Premium badge (shared with WP PowerSuite module UI) */
.wpps-pro-badge,
.wpps-cs-pro-badge {
	display: inline-block;
	vertical-align: middle;
	margin-left: 6px;
	padding: 2px 6px;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	background: linear-gradient(135deg, var(--cs-blue, #2271b1) 0%, var(--cs-blue-hover, #135e96) 100%);
	color: #fff;
	border-radius: 3px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.wpps-freemium-badge {
	display: inline-block;
	vertical-align: middle;
	margin-left: 6px;
	padding: 2px 6px;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	background: #f0f6fc;
	color: #135e96;
	border: 1px solid #c3d9ed;
	border-radius: 3px;
}

/* PRO badge and locked code type cards */
.wpps-cs-code-type-card.wpps-cs-pro-locked {
	position: relative;
	opacity: 0.85;
	cursor: pointer;
}

.wpps-cs-code-type-card.wpps-cs-pro-locked:hover {
	border-color: var(--cs-blue);
	background: #f8fafc;
}

.wpps-cs-pro-lock-overlay {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: 12px;
	padding: 8px 12px;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--cs-blue);
}

.wpps-cs-pro-lock-overlay .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

/* PRO accordion overlay */
.wpps-cs-accordion-pro .wpps-cs-accordion-body {
	position: relative;
	min-height: 160px;
}

.wpps-cs-pro-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 24px;
	background: rgba(255, 255, 255, 0.95);
	z-index: 2;
	border-radius: 0 0 4px 4px;
}

.wpps-cs-pro-overlay .dashicons {
	flex-shrink: 0;
	font-size: 32px;
	width: 32px;
	height: 32px;
	color: var(--cs-gray);
}

.wpps-cs-pro-overlay p {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--cs-gray);
	text-align: center;
}

.wpps-cs-pro-overlay .wpps-cs-btn {
	flex-shrink: 0;
}

/* Accordions */
.wpps-cs-accordions {
	margin-bottom: 0;
	display: flex;
	flex-direction: column;
	gap: var(--cs-edit-gap, 20px);
}

.wpps-cs-accordion {
	background: #fff;
	border: 1px solid var(--cs-border);
	box-shadow: var(--cs-shadow);
	overflow: visible;
}

.wpps-cs-accordion-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 16px 20px;
	background: none;
	border: none;
	font-size: 1rem;
	font-weight: 600;
	color: var(--cs-black);
	text-align: left;
	cursor: pointer;
	transition: background 0.2s;
	overflow: visible;
}

.wpps-cs-accordion-header:hover {
	background: var(--cs-bg);
}

.wpps-cs-accordion-title {
	display: flex;
	align-items: center;
	gap: 8px;
}

.wpps-cs-accordion-tooltip {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-left: 6px;
	cursor: help;
}

.wpps-cs-accordion-tooltip-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	font-size: 12px;
	font-weight: 600;
	color: var(--cs-gray);
	background: var(--cs-bg);
	border-radius: 50%;
	line-height: 1;
	transition: color 0.2s, background 0.2s;
}

.wpps-cs-accordion-tooltip:hover .wpps-cs-accordion-tooltip-trigger {
	color: var(--cs-blue);
	background: #e8f0fe;
}

/* Tooltip hover panel â€” positioned in viewport via wpps-accordion-tooltips.js */
.wpps-cs-accordion-tooltip-panel {
	position: absolute;
	left: 0;
	bottom: calc(100% + 10px);
	transform: translateY(4px);
	min-width: 220px;
	max-width: min(320px, calc(100vw - 32px));
	padding: 12px 14px;
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.5;
	color: var(--cs-black);
	background: #fff;
	border: 1px solid var(--cs-border);
	border-radius: 6px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
	z-index: 100000;
}

.wpps-cs-accordion-tooltip-panel.is-positioned {
	position: fixed !important;
	bottom: auto !important;
	transform: none !important;
	transition: opacity 0.12s ease, visibility 0.12s ease;
}

.wpps-cs-accordion-tooltip-panel::before {
	content: "";
	position: absolute;
	top: 100%;
	left: var(--wpps-tip-x, 14px);
	margin-left: -7px;
	border: 7px solid transparent;
	border-top-color: var(--cs-border);
}

.wpps-cs-accordion-tooltip-panel::after {
	content: "";
	position: absolute;
	top: 100%;
	left: var(--wpps-tip-x, 14px);
	margin-left: -6px;
	margin-top: -1px;
	border: 6px solid transparent;
	border-top-color: #fff;
}

.wpps-cs-accordion-tooltip-panel.wpps-accordion-tooltip-panel--below::before {
	top: auto;
	bottom: 100%;
	margin-top: 0;
	margin-bottom: -1px;
	border-top-color: transparent;
	border-bottom-color: var(--cs-border);
}

.wpps-cs-accordion-tooltip-panel.wpps-accordion-tooltip-panel--below::after {
	top: auto;
	bottom: 100%;
	margin-top: 0;
	margin-bottom: -2px;
	border-top-color: transparent;
	border-bottom-color: #fff;
}

.wpps-cs-accordion-tooltip.is-active .wpps-cs-accordion-tooltip-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* No-JS fallback: open above the trigger */
@media (hover: hover) {
	html:not(.wpps-accordion-tooltips-ready) .wpps-cs-accordion-tooltip:hover .wpps-cs-accordion-tooltip-panel:not(.is-positioned) {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}
}

.wpps-cs-accordion-chevron {
	font-size: 18px;
	width: 18px;
	height: 18px;
	color: var(--cs-gray);
	transition: transform 0.2s;
}

.wpps-cs-accordion.is-open .wpps-cs-accordion-chevron {
	transform: rotate(180deg);
}

.wpps-cs-accordion-body {
	overflow: hidden;
	padding: 20px;
	border-top: 1px solid var(--cs-border);
}

.wpps-cs-accordion:not(.is-open) .wpps-cs-accordion-body {
	display: none;
}

.wpps-cs-insertion-desc {
	margin: 0 0 16px;
	font-size: 0.875rem;
	color: var(--cs-gray);
	line-height: 1.5;
}

.wpps-cs-insert-method {
	margin-bottom: 16px;
}

.wpps-cs-insert-method-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	margin-bottom: 10px;
	color: var(--cs-black);
}

.wpps-cs-insert-method-btns {
	display: flex;
	gap: 0;
}

.wpps-cs-insert-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 20px;
	font-size: 0.875rem;
	font-weight: 500;
	border: 1px solid var(--cs-border);
	background: var(--cs-bg);
	color: var(--cs-gray);
	cursor: pointer;
	transition: all 0.2s;
}

.wpps-cs-insert-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.wpps-cs-insert-btn:first-of-type {
	border-radius: 2px 0 0 2px;
}

.wpps-cs-insert-btn:last-of-type {
	border-radius: 0 2px 2px 0;
}

.wpps-cs-insert-btn {
	border-right: none;
}

.wpps-cs-insert-btn:last-of-type {
	border-right: 1px solid var(--cs-border);
}

.wpps-cs-insert-btn input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.wpps-cs-insert-btn.is-active,
.wpps-cs-insert-btn:hover {
	background: #f0f6fc;
	border-color: var(--cs-blue);
	color: var(--cs-blue);
}

.wpps-cs-insert-btn.is-active {
	background: var(--cs-blue);
	border-color: var(--cs-blue);
	color: #fff;
}

.wpps-cs-location-wrap,
.wpps-cs-shortcode-wrap {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid var(--cs-border);
}

.wpps-cs-shortcode-display-wrap {
	margin-bottom: 16px;
}

.wpps-cs-shortcode-copy-row {
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: 400px;
}

.wpps-cs-shortcode-copy-row .wpps-cs-input {
	flex: 1;
	min-width: 0;
}

.wpps-cs-copy-btn {
	padding: 8px 14px;
	font-size: 0.8125rem;
	flex-shrink: 0;
}

.wpps-cs-custom-shortcode-wrap {
	margin-bottom: 16px;
}

.wpps-cs-location-picker-wrap {
	max-width: 320px;
}

.wpps-cs-location-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	margin-bottom: 6px;
	color: var(--cs-black);
}

/* Location picker - opens modal like code type */
.wpps-cs-location-picker {
	position: relative;
}

.wpps-cs-location-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	max-width: 320px;
	padding: 8px 14px;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--cs-black);
	background: #fff;
	border: 1px solid var(--cs-border);
	border-radius: 4px;
	cursor: pointer;
	transition: border-color 0.2s, box-shadow 0.2s;
	text-align: left;
}

.wpps-cs-location-trigger:hover {
	border-color: var(--cs-blue);
	background: #f8fafc;
	box-shadow: 0 0 0 1px var(--cs-blue);
}

.wpps-cs-location-trigger .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: var(--cs-gray);
	flex-shrink: 0;
}

/* Location modal (sidebar + list) */
.wpps-cs-location-modal-content {
	max-width: 860px;
	max-height: 80vh;
}

.wpps-cs-location-modal-body {
	display: flex;
	min-height: 0;
	flex: 1;
}

.wpps-cs-location-modal-sidebar {
	flex: 0 0 160px;
	padding: 12px 16px 12px 12px;
	border-right: 1px solid var(--cs-border);
	margin-right: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.wpps-cs-location-modal-search {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	border: 1px solid var(--cs-border);
	border-radius: 6px;
	background: #fff;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.wpps-cs-location-modal-search:focus-within {
	border-color: var(--cs-blue);
	box-shadow: 0 0 0 1px var(--cs-blue);
}

.wpps-cs-location-modal-search .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	color: var(--cs-gray);
	flex-shrink: 0;
}

.wpps-cs-location-modal-search input {
	flex: 1;
	min-width: 0;
	padding: 4px 6px;
	border: none;
	background: none;
	font-size: 0.875rem;
	outline: none;
}

.wpps-cs-location-modal-search input::placeholder {
	color: var(--cs-gray);
}

.wpps-cs-location-modal-categories {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wpps-cs-location-modal-categories li {
	margin: 0;
}

.wpps-cs-location-cat-btn {
	display: block;
	width: 100%;
	padding: 8px 12px;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--cs-black);
	background: none;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	text-align: left;
	transition: background 0.2s;
}

.wpps-cs-location-cat-btn:hover {
	background: #f0f4f8;
}

.wpps-cs-location-cat-btn.is-active {
	background: #f0f6fc;
	color: var(--cs-blue);
	font-weight: 600;
}

.wpps-cs-location-cat-btn.wpps-cs-location-disabled {
	opacity: 0.5;
	pointer-events: none;
	cursor: not-allowed;
}

.wpps-cs-location-modal-list-wrap {
	flex: 1;
	min-width: 0;
	overflow-y: auto;
	padding: 12px 16px 12px 0;
}

.wpps-cs-location-modal-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wpps-cs-location-modal-separator {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--cs-gray);
	padding: 12px 0 6px;
	margin-top: 4px;
	border-bottom: 1px solid var(--cs-border);
}

.wpps-cs-location-modal-separator:first-child {
	padding-top: 0;
	margin-top: 0;
}

.wpps-cs-location-modal-item {
	margin: 0;
	padding: 0;
}

.wpps-cs-location-modal-item label {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 10px 12px;
	margin: 2px 0;
	font-size: 0.875rem;
	color: var(--cs-black);
	background: #fff;
	border: 2px solid transparent;
	border-radius: 4px;
	cursor: pointer;
	text-align: left;
	transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.wpps-cs-location-modal-item label:hover {
	border-color: var(--cs-blue);
	background: #f8fafc;
	box-shadow: 0 2px 8px rgba(34, 113, 177, 0.1);
}

.wpps-cs-location-modal-item.is-selected label {
	border-color: var(--cs-blue);
	background: #f0f6fc;
	box-shadow: 0 0 0 1px var(--cs-blue);
}

.wpps-cs-location-item-title {
	font-weight: 600;
}

.wpps-cs-location-item-desc {
	font-size: 0.8125rem;
	font-weight: 400;
	color: var(--cs-gray);
	line-height: 1.4;
}

.wpps-cs-location-modal-item.wpps-cs-location-disabled label {
	opacity: 0.5;
	pointer-events: none;
	cursor: not-allowed;
	background: #f5f5f5;
	border-color: #e0e0e0;
}

.wpps-cs-form-group .wpps-cs-input-sm {
	width: 80px;
}

.wpps-cs-location-param-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 16px;
}

.wpps-cs-location-selector-wrap {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 16px;
}

.wpps-cs-location-selector-wrap .wpps-cs-input {
	max-width: 320px;
}

.wpps-cs-element-index-label {
	display: block;
	margin-top: 8px;
	font-size: 0.8125rem;
	color: var(--cs-gray);
}

.wpps-cs-conditional-toggle {
	display: block;
	margin-bottom: 16px;
}

.wpps-cs-conditional-rules-wrap {
	margin-top: 12px;
}

.wpps-cs-conditional-group {
	margin-bottom: 16px;
	padding: 12px;
	background: var(--cs-bg);
	border-radius: 4px;
	border: 1px solid var(--cs-border);
}

.wpps-cs-conditional-group .wpps-cs-group-label {
	display: inline-block;
	font-weight: 600;
	font-size: 0.75rem;
	text-transform: uppercase;
	color: var(--cs-gray);
	margin-bottom: 8px;
}

.wpps-cs-conditional-group .wpps-cs-group-actions {
	margin-top: 8px;
}

.wpps-cs-conditional-group .wpps-cs-conditional-rules {
	margin-bottom: 0;
}

.wpps-cs-conditional-rules-wrap select {
	margin-right: 8px;
	margin-bottom: 8px;
}

.wpps-cs-conditional-rule {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.wpps-cs-conditional-rule .wpps-cs-rule-type,
.wpps-cs-conditional-rule .wpps-cs-rule-operator {
	min-width: 140px;
}

.wpps-cs-conditional-rule .wpps-cs-rule-value,
.wpps-cs-conditional-rule .wpps-cs-rule-value-wrap select {
	flex: 1;
	min-width: 120px;
}

.wpps-cs-conditional-rule .wpps-cs-rule-value-wrap {
	flex: 1;
	min-width: 120px;
}

.wpps-cs-rule-remove {
	background: #dc3545;
	color: #fff;
	border: none;
	width: 28px;
	height: 28px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	padding: 0;
}

.wpps-cs-rule-remove:hover {
	background: #c82333;
}

/* Device type boxes */
.wpps-cs-device-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	margin-bottom: 12px;
	color: var(--cs-black);
}

.wpps-cs-device-boxes {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
	margin-bottom: 8px;
}

.wpps-cs-device-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 20px 16px;
	border: 2px solid var(--cs-border);
	border-radius: 4px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.wpps-cs-device-box:hover {
	border-color: var(--cs-blue);
	background: #f8fafc;
	box-shadow: 0 2px 8px rgba(34, 113, 177, 0.1);
}

.wpps-cs-device-box.is-selected {
	border-color: var(--cs-blue);
	background: #f0f6fc;
	box-shadow: 0 0 0 1px var(--cs-blue);
}

.wpps-cs-device-box input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.wpps-cs-device-box-icon {
	font-size: 28px;
	width: 28px;
	height: 28px;
	color: var(--cs-gray);
}

.wpps-cs-device-box.is-selected .wpps-cs-device-box-icon {
	color: var(--cs-blue);
}

.wpps-cs-device-box-label {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--cs-black);
	text-align: center;
}

/* Code Revisions */
.wpps-cs-revisions-desc {
	margin: 0 0 20px;
	font-size: 0.875rem;
	color: var(--cs-gray);
	line-height: 1.5;
}

.wpps-cs-revisions-timeline {
	position: relative;
	padding-left: 0;
}

.wpps-cs-revision-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--cs-border);
	position: relative;
}

.wpps-cs-revision-item:last-child {
	border-bottom: none;
}

.wpps-cs-revision-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--cs-border);
	flex-shrink: 0;
}

.wpps-cs-revision-current .wpps-cs-revision-dot,
.wpps-cs-revision-item-current .wpps-cs-revision-dot {
	background: var(--cs-blue);
}

.wpps-cs-revision-avatar {
	flex-shrink: 0;
}

.wpps-cs-revision-avatar-img {
	display: block;
	border-radius: 50%;
	width: 32px;
	height: 32px;
}

.wpps-cs-revision-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
	min-width: 0;
}

.wpps-cs-revision-author {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--cs-black);
}

.wpps-cs-revision-current-label {
	display: block;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--cs-blue);
	text-transform: uppercase;
	letter-spacing: 0.02em;
	margin-bottom: 2px;
}

.wpps-cs-revision-date,
.wpps-cs-revision-status {
	font-size: 0.8125rem;
	color: var(--cs-gray);
}

.wpps-cs-revision-actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
	position: relative;
	z-index: 1;
}

.wpps-cs-revisions-list-wrap {
	margin-top: 16px;
}

.wpps-cs-revisions-load-more-wrap {
	margin-top: 12px;
}

.wpps-cs-revisions-list {
	margin-top: 8px;
}

.wpps-cs-revisions-empty,
.wpps-cs-revisions-loading {
	font-size: 0.875rem;
	color: var(--cs-gray);
	padding: 20px 0;
	text-align: center;
}

/* Revisions compare page */
.wpps-cs-revisions-wrap .wpps-cs-revisions-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 24px;
	gap: 16px;
}

.wpps-cs-revisions-wrap .wpps-cs-revisions-title {
	margin: 0;
	font-size: 1.25rem;
}

.wpps-cs-compare-checkbox {
	margin-bottom: 16px;
}

.wpps-cs-compare-checkbox label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.875rem;
	cursor: pointer;
}

.wpps-cs-revisions-wrap .wpps-cs-revisions-timeline {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 24px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}

.wpps-cs-revisions-timeline-left,
.wpps-cs-revisions-timeline-right {
	flex-shrink: 0;
}

.wpps-cs-revisions-timeline-center {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px 16px;
	flex-wrap: wrap;
	flex: 0 1 auto;
	min-width: 280px;
}

.wpps-cs-revisions-slider {
	margin: 0;
	min-height: 28px;
	display: block;
	width: 220px;
	flex-shrink: 0;
}

/* jQuery UI slider track */
.wpps-cs-revisions-slider.ui-slider {
	position: relative;
	height: 10px;
	background: #e2e4e7;
	border-radius: 5px;
	border: 1px solid #c3c4c7;
}

.wpps-cs-revisions-slider.ui-slider .ui-slider-range {
	position: absolute;
	height: 100%;
	background: var(--cs-blue);
	border-radius: 5px;
	opacity: 0.3;
}

.wpps-cs-revisions-slider.ui-slider-range-min .ui-slider-range {
	left: 0;
}

.wpps-cs-revisions-slider.ui-slider-range-max .ui-slider-range {
	right: 0;
}

/* Slider handle - filled circle, centered on track */
.wpps-cs-revisions-slider.ui-slider .ui-slider-handle {
	position: absolute;
	width: 20px;
	height: 20px;
	margin-left: -10px;
	margin-top: -10px;
	top: 50%;
	background: var(--cs-blue);
	border: none;
	border-radius: 50%;
	cursor: pointer;
	outline: none;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.wpps-cs-revisions-slider.ui-slider .ui-slider-handle:hover,
.wpps-cs-revisions-slider.ui-slider .ui-slider-handle:focus {
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
	transform: scale(1.1);
}

.wpps-cs-revisions-slider.ui-slider .ui-slider-handle:focus {
	outline: 2px solid var(--cs-blue);
	outline-offset: 2px;
}

.wpps-cs-revisions-slider-label {
	font-size: 0.75rem;
	color: var(--cs-gray);
	font-weight: 500;
}

.wpps-cs-revisions-slider-oldest {
	margin-right: 4px;
}

.wpps-cs-revisions-slider-latest {
	margin-left: 4px;
}

.wpps-cs-revisions-slider-position {
	font-size: 0.8125rem;
	color: var(--cs-gray);
	margin-left: 8px;
	font-weight: 500;
	min-width: 2.5em;
}

.wpps-cs-compare-checkbox-help {
	display: block;
	margin-top: 4px;
	font-size: 0.75rem;
	color: var(--cs-gray);
	line-height: 1.4;
}

.wpps-cs-revisions-diff-display {
	margin-top: 24px;
	padding: 20px;
	background: #fff;
	border: 1px solid var(--cs-border);
	border-radius: 4px;
}

.wpps-cs-revision-display {
	display: none;
}

.wpps-cs-revision-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}

.wpps-cs-revision-header .avatar {
	border-radius: 50%;
}

.wpps-cs-revision-header-right {
	margin-left: auto;
}

.wpps-cs-revision-content {
	margin-top: 16px;
}

.wpps-cs-revision-diff-section {
	margin-bottom: 20px;
}

.wpps-cs-revision-diff-section h4 {
	margin: 0 0 8px;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--cs-gray);
}

.wpps-cs-revision-diff-section.wpps-cs-revision-diff-code .diff {
	max-height: 400px;
	overflow: auto;
}

.wpps-cs-revision-diff-section .diff td,
.wpps-cs-revision-diff-section .diff th {
	padding: 6px 12px;
}

.wpps-cs-revision-content .diff,
.wpps-cs-diff-table {
	width: 100%;
	table-layout: fixed;
}

.wpps-cs-diff-table td,
.wpps-cs-diff-table th {
	width: 50%;
	vertical-align: top;
	word-wrap: break-word;
}

.wpps-cs-revision-content .diff td,
.wpps-cs-revision-content .diff th {
	width: 50%;
}

/* Fix overlapping plus/minus icons in diff view */
.wpps-cs-revision-content .diff td.diff-deletedline,
.wpps-cs-revision-content .diff td.diff-addedline {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.wpps-cs-revision-content .diff td.diff-deletedline .dashicons,
.wpps-cs-revision-content .diff td.diff-addedline .dashicons {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	font-size: 20px;
}

.wpps-cs-schedule-wrap,
.wpps-cs-load-file-wrap {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid var(--cs-border);
}

.wpps-cs-schedule-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--cs-black);
	cursor: pointer;
}

.wpps-cs-schedule-wrap .wpps-cs-help,
.wpps-cs-load-file-wrap .wpps-cs-help {
	display: block;
	margin-top: 6px;
	font-size: 0.8125rem;
	color: var(--cs-gray);
}

.wpps-cs-schedule-fields {
	margin-top: 12px;
}

.wpps-cs-schedule-row {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 24px;
}

.wpps-cs-schedule-row .wpps-cs-form-group {
	min-width: 180px;
}

.wpps-cs-settings-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 20px;
}

.wpps-cs-form-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.wpps-cs-form-group label {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--cs-black);
}

.wpps-cs-required {
	color: #dc2626;
}

.wpps-cs-input,
.wpps-cs-select {
	padding: 10px 12px;
	border: 1px solid var(--cs-border);
	border-radius: 2px;
	font-size: 0.875rem;
	box-sizing: border-box;
}

.wpps-cs-input:focus,
.wpps-cs-select:focus {
	outline: none;
	border-color: var(--cs-blue);
	box-shadow: 0 0 0 1px var(--cs-blue);
}

.wpps-cs-input-sm {
	width: 80px;
}

.wpps-cs-help {
	font-size: 0.75rem;
	color: var(--cs-gray);
}

.wpps-cs-help-block {
	display: block;
	margin: 8px 0 14px;
	font-size: 0.8125rem;
	line-height: 1.5;
}

.wpps-cs-fe-php-hint {
	margin-top: 14px;
	padding: 10px 12px;
	background: #f0f6fc;
	border: 1px solid #c3d9ed;
	border-radius: 4px;
	font-size: 13px;
	line-height: 1.5;
}

.wpps-cs-form-group-check {
	justify-content: center;
}

.wpps-cs-form-group-check label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

/* Code Preview â€“ height from settings (--cs-editor-height set by edit.php) */
.wpps-cs-code-panel .wpps-cs-code-wrap {
	min-height: var(--cs-editor-height, 300px);
	height: var(--cs-editor-height, 300px);
	border: 1px solid var(--cs-border);
	border-radius: 4px 4px 0 0;
	overflow: hidden;
	background: #fafafa;
	position: relative;
	contain: layout;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.wpps-cs-code-panel .wpps-cs-code-wrap:focus-within {
	border-color: var(--cs-blue);
	box-shadow: 0 0 0 1px var(--cs-blue);
}

/* Textarea: match editor height so no jump before CodeMirror init */
.wpps-cs-code-panel .wpps-cs-code-editor {
	min-height: var(--cs-editor-height);
	height: var(--cs-editor-height);
	width: 100%;
	padding: 12px 16px;
	margin: 0;
	border: none;
	resize: none;
	box-sizing: border-box;
	font-family: ui-monospace, "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, monospace;
	font-size: 13px;
	line-height: 1.6;
	background: #fafafa;
}

/* Non-selectable read-only prefix (<?php, <script>) */
.wpps-cs-php-prefix-noselect {
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}

.wpps-cs-code-panel .CodeMirror {
	min-height: var(--cs-editor-height);
	height: var(--cs-editor-height);
	border: none;
	font-family: ui-monospace, "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, monospace;
	font-size: 13px;
	line-height: 1.6;
}

.wpps-cs-code-panel .CodeMirror-line {
	line-height: 1.6;
}

.wpps-cs-code-panel .CodeMirror-scroll {
	min-height: var(--cs-editor-height);
}

.wpps-cs-edit-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 8px;
	padding: 24px 0 4px;
	border-top: 1px solid var(--cs-border);
}

.wpps-cs-edit-actions-right {
	display: flex;
	gap: 12px;
}

.wpps-cs-btn-danger {
	background: var(--cs-danger);
	border: 1px solid var(--cs-danger);
	color: #fff;
}

.wpps-cs-btn-danger:hover {
	background: var(--cs-danger-hover);
	border-color: var(--cs-danger-hover);
	color: #fff;
}

/* â”€â”€ Code panel toolbar (theme toggle + code type) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.wpps-cs-code-panel-tools {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}

.wpps-cs-editor-tool-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 12px;
	border: 1px solid var(--cs-border);
	border-radius: 4px;
	background: #fff;
	color: var(--cs-gray);
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}

.wpps-cs-editor-tool-btn:hover {
	border-color: var(--cs-blue);
	color: var(--cs-blue);
	background: #f8fafc;
}

.wpps-cs-editor-tool-btn:focus-visible {
	outline: none;
	border-color: var(--cs-blue);
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.25);
}

.wpps-cs-editor-tool-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.wpps-cs-theme-icon {
	display: inline-flex;
	align-items: center;
	line-height: 0;
}

.wpps-cs-theme-icon .wpps-cs-ico {
	display: block;
}

.wpps-cs-theme-icon .wpps-cs-ico-sun {
	display: none;
}

.wpps-cs-editor-tool-btn[aria-pressed="true"] .wpps-cs-ico-moon {
	display: none;
}

.wpps-cs-editor-tool-btn[aria-pressed="true"] .wpps-cs-ico-sun {
	display: block;
}

.wpps-cs-editor-tool-btn[aria-pressed="true"] {
	background: #1e1e1e;
	border-color: #1e1e1e;
	color: #ffd479;
}

.wpps-cs-editor-tool-btn[aria-pressed="true"]:hover {
	background: #2d2d2d;
	border-color: #2d2d2d;
	color: #ffe0a3;
}

/* VS Code-style editor status bar */
.wpps-cs-code-statusbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 4px 12px;
	background: var(--cs-blue);
	color: #fff;
	font-family: ui-monospace, "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, monospace;
	font-size: 11px;
	line-height: 1.4;
	border: 1px solid var(--cs-blue);
	border-top: none;
	border-radius: 0 0 4px 4px;
	user-select: none;
}

.wpps-cs-code-statusbar .wpps-cs-status-right {
	display: flex;
	align-items: center;
	gap: 16px;
}

.wpps-cs-code-statusbar .wpps-cs-status-item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	white-space: nowrap;
}

.wpps-cs-code-statusbar .wpps-cs-status-lang {
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-weight: 600;
}

/* Copy button "Copied!" feedback */
.wpps-cs-copy-btn.is-copied {
	background: #00a32a;
	border-color: #00a32a;
	color: #fff;
}

/* â”€â”€ VS Code-style dark theme for the code editor â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.wpps-cs-code-panel .wpps-cs-code-wrap.wpps-cs-theme-dark {
	background: #1e1e1e;
	border-color: #3c3c3c;
}

.wpps-cs-code-panel .wpps-cs-code-wrap.wpps-cs-theme-dark:focus-within {
	border-color: #007acc;
	box-shadow: 0 0 0 1px #007acc;
}

.wpps-cs-code-panel .CodeMirror.cm-s-wpps-dark {
	background: #1e1e1e;
	color: #d4d4d4;
}

.cm-s-wpps-dark .CodeMirror-gutters {
	background: #1e1e1e;
	border-right: 1px solid #2b2b2b;
}

.cm-s-wpps-dark .CodeMirror-linenumber {
	color: #858585;
}

.cm-s-wpps-dark .CodeMirror-cursor {
	border-left: 1px solid #aeafad;
}

.cm-s-wpps-dark div.CodeMirror-selected {
	background: #264f78;
}

.cm-s-wpps-dark .CodeMirror-line::selection,
.cm-s-wpps-dark .CodeMirror-line > span::selection,
.cm-s-wpps-dark .CodeMirror-line > span > span::selection {
	background: #264f78;
}

.cm-s-wpps-dark .CodeMirror-activeline-background {
	background: #2a2d2e;
}

.cm-s-wpps-dark .CodeMirror-gutter-elt .CodeMirror-linenumber.CodeMirror-activeline-gutter,
.cm-s-wpps-dark .CodeMirror-activeline-gutter .CodeMirror-linenumber {
	color: #c6c6c6;
}

.cm-s-wpps-dark .CodeMirror-matchingbracket {
	color: #ffd700 !important;
	border-bottom: 1px solid #ffd700;
}

.cm-s-wpps-dark .cm-comment { color: #6a9955; }
.cm-s-wpps-dark .cm-keyword { color: #569cd6; }
.cm-s-wpps-dark .cm-atom { color: #569cd6; }
.cm-s-wpps-dark .cm-number { color: #b5cea8; }
.cm-s-wpps-dark .cm-def { color: #dcdcaa; }
.cm-s-wpps-dark .cm-variable { color: #9cdcfe; }
.cm-s-wpps-dark .cm-variable-2 { color: #9cdcfe; }
.cm-s-wpps-dark .cm-variable-3, .cm-s-wpps-dark .cm-type { color: #4ec9b0; }
.cm-s-wpps-dark .cm-property { color: #9cdcfe; }
.cm-s-wpps-dark .cm-operator { color: #d4d4d4; }
.cm-s-wpps-dark .cm-string { color: #ce9178; }
.cm-s-wpps-dark .cm-string-2 { color: #ce9178; }
.cm-s-wpps-dark .cm-meta { color: #569cd6; }
.cm-s-wpps-dark .cm-qualifier { color: #d7ba7d; }
.cm-s-wpps-dark .cm-builtin { color: #dcdcaa; }
.cm-s-wpps-dark .cm-bracket { color: #d4d4d4; }
.cm-s-wpps-dark .cm-tag { color: #569cd6; }
.cm-s-wpps-dark .cm-attribute { color: #9cdcfe; }
.cm-s-wpps-dark .cm-link { color: #569cd6; }
.cm-s-wpps-dark .cm-error { color: #f44747; }

@media (max-width: 782px) {
	.wpps-cs-header-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 16px;
	}

	.wpps-cs-code-panel-tools {
		width: 100%;
		justify-content: space-between;
	}

	.wpps-cs-shortcode-copy-row {
		max-width: none;
	}

	.wpps-cs-settings-grid {
		grid-template-columns: 1fr;
	}

	.wpps-cs-edit-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.wpps-cs-code-type-grid {
		grid-template-columns: 1fr;
	}

	.wpps-cs-device-boxes {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Header & Footer Code – module settings modal (reuses Code Snippet editor) */
.wp-powersuite-hfc-settings.wpps-cs-wrap,
.wp-powersuite-cac-settings.wpps-cs-wrap {
	max-width: none;
	margin: 0;
}

.wp-powersuite-hfc-settings .wpps-hfc-field-desc,
.wp-powersuite-cac-settings .wpps-cac-field-desc {
	margin: 0 0 10px;
}

.wp-powersuite-hfc-settings .wpps-hfc-code-panel,
.wp-powersuite-cac-settings .wpps-cac-code-panel {
	margin-bottom: 0;
	box-shadow: none;
	padding: 0;
	background: transparent;
	border: none;
}

.wp-powersuite-hfc-settings .wpps-hfc-code-panel .wpps-cs-code-wrap,
.wp-powersuite-cac-settings .wpps-cac-code-panel .wpps-cs-code-wrap {
	border-radius: 4px;
}

/* HFC / Custom Admin CSS modal editors – light vs dark placeholders */
.wp-powersuite-hfc-settings .wpps-cs-code-wrap:not(.wpps-cs-theme-dark) .CodeMirror-placeholder,
.wp-powersuite-hfc-settings .wpps-cs-code-wrap:not(.wpps-cs-theme-dark) .cm-placeholder,
.wp-powersuite-cac-settings .wpps-cs-code-wrap:not(.wpps-cs-theme-dark) .CodeMirror-placeholder,
.wp-powersuite-cac-settings .wpps-cs-code-wrap:not(.wpps-cs-theme-dark) .cm-placeholder {
	color: #a7aaad !important;
	opacity: 1;
}

.wp-powersuite-hfc-settings .wpps-cs-code-wrap.wpps-cs-theme-dark .CodeMirror-placeholder,
.wp-powersuite-hfc-settings .wpps-cs-code-wrap.wpps-cs-theme-dark .cm-placeholder,
.wp-powersuite-cac-settings .wpps-cs-code-wrap.wpps-cs-theme-dark .CodeMirror-placeholder,
.wp-powersuite-cac-settings .wpps-cs-code-wrap.wpps-cs-theme-dark .cm-placeholder {
	color: #858585 !important;
	opacity: 1;
}

/* HFC / Custom Admin CSS dark mode – base text on untokenized lines */
.wp-powersuite-hfc-settings .wpps-cs-code-wrap.wpps-cs-theme-dark .CodeMirror pre.CodeMirror-line,
.wp-powersuite-cac-settings .wpps-cs-code-wrap.wpps-cs-theme-dark .CodeMirror pre.CodeMirror-line {
	color: #d4d4d4;
}

.wp-powersuite-hfc-settings .form-table th,
.wp-powersuite-cac-settings .form-table th {
	vertical-align: top;
	padding-top: 18px;
	width: 160px;
}

.wp-powersuite-hfc-settings .form-table td,
.wp-powersuite-cac-settings .form-table td {
	padding-bottom: 20px;
}

/* Single theme toggle in modal footer (Header & Footer Code, Custom Admin CSS) */
.wp-powersuite-modal__footer .wpps-hfc-modal-theme-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 30px;
	line-height: 1;
}

.wp-powersuite-modal__footer .wpps-hfc-modal-theme-toggle .wpps-cs-theme-icon {
	display: inline-flex;
	align-items: center;
	line-height: 0;
}

.wp-powersuite-modal__footer .wpps-hfc-modal-theme-toggle .wpps-cs-ico-sun {
	display: none;
}

.wp-powersuite-modal__footer .wpps-hfc-modal-theme-toggle[aria-pressed="true"] .wpps-cs-ico-moon {
	display: none;
}

.wp-powersuite-modal__footer .wpps-hfc-modal-theme-toggle[aria-pressed="true"] .wpps-cs-ico-sun {
	display: block;
}

.wp-powersuite-modal__footer .wpps-hfc-modal-theme-toggle[aria-pressed="true"] {
	background: #1e1e1e;
	border-color: #1e1e1e;
	color: #ffd479;
}
