/**
 * Widget Settings Page Styles
 *
 * Refined utilitarian layout: toggle card, compact shortcodes,
 * organized sections with preview + fields, collapsible advanced.
 *
 * @link       https://github.com/sitestaffr/sitestaffr-plugin
 * @since      0.11.96
 *
 * @package    SiteStaffr
 * @subpackage SiteStaffr/assets/css
 */

/* ==========================================================================
   SHORTCODE LABEL + CLICKABLE SHORTCODES — in section headers
   ========================================================================== */

.sitestaffr-ws-shortcode-label {
	font-size: 12px;
	font-weight: 500;
	color: #646970;
	margin-left: auto;
	margin-right: 6px;
}

.sitestaffr-ws-shortcode-click {
	display: inline-flex;
	align-items: center;
	background: #fff;
	padding: 4px 12px;
	border: 1px solid #dcdad4;
	border-radius: 4px;
	font-family: 'SF Mono', Monaco, Consolas, 'Courier New', monospace;
	font-size: 12px;
	color: #d63638;
	cursor: pointer;
	transition: all 0.2s ease;
	user-select: all;
	max-width: 100%;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
	overflow: visible;
}

.sitestaffr-ws-shortcode-click:hover {
	background: #f0ebe0;
	border-color: #c3c4c7;
}

.sitestaffr-ws-shortcode-click.copied {
	color: #00a32a;
	border-color: #00a32a;
	background: #f0faf0;
}

/* ==========================================================================
   SECTION CARDS — Fixed Widget, Button Widget
   ========================================================================== */

.sitestaffr-ws-section {
	background: #fff;
	border: 1px solid #e0ddd6;
	border-radius: 10px;
	margin-bottom: 20px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
	overflow: visible;
}

.sitestaffr-ws-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	row-gap: 8px;
	height: 60px;
	padding: 0 18px;
	border-bottom: 1px solid #f0ebe0;
	border-radius: 10px 10px 0 0;
	background: #FAF8F4;
}

.sitestaffr-ws-section-title {
	display: flex;
	align-items: center;
	gap: 0;
}

.sitestaffr-ws-section-header h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #1d2327;
	display: flex;
	align-items: center;
	gap: 8px;
}

.sitestaffr-ws-section-header h3 .dashicons {
	color: #00838f;
}

/* Auto-display toggle row */
.sitestaffr-ws-auto-display-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 24px;
	border-bottom: 1px solid #f0ebe0;
	background: #ffffff;
}

.sitestaffr-ws-toggle-label {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	white-space: nowrap;
}

.sitestaffr-ws-toggle-label input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.sitestaffr-ws-toggle-switch {
	position: relative;
	display: inline-block;
	width: 38px;
	height: 22px;
	background: #c3c4c7;
	border-radius: 11px;
	transition: background 0.2s ease;
	flex-shrink: 0;
}

.sitestaffr-ws-toggle-switch::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	background: #ffffff;
	border-radius: 50%;
	transition: transform 0.2s ease;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.sitestaffr-ws-toggle-label input:checked + .sitestaffr-ws-toggle-switch {
	background: #00838F;
}

.sitestaffr-ws-toggle-label input:checked + .sitestaffr-ws-toggle-switch::after {
	transform: translateX(16px);
}

.sitestaffr-ws-toggle-text {
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
}

.sitestaffr-ws-toggle-description {
	font-size: 12px;
	color: #8c8f94;
	line-height: 1.4;
}

.sitestaffr-ws-section-body {
	padding: 24px;
}

/* Two-column layout: preview | fields */
.sitestaffr-ws-two-col {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 32px;
}

/* Preview column */
.sitestaffr-ws-preview-col {
	height: fit-content;
	align-self: flex-start;
}

/* Sticky preview variant (used by Button section only) */
.sitestaffr-ws-preview-col--sticky {
	position: -webkit-sticky;
	position: sticky;
	top: 72px;
}

/* Fields column */
.sitestaffr-ws-fields-col {
	min-width: 0;
}

/* ==========================================================================
   SECTION FOOTER — per-section save button
   ========================================================================== */

.sitestaffr-ws-section-footer {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 24px;
	border-top: 1px solid #f0ebe0;
	background: #fff;
}

.sitestaffr-ws-save-btn {
	min-width: 160px;
}

/* State colors come from the shared component
   (.sitestaffr-inline-status in sitestaffr-global.css). */
.sitestaffr-ws-save-status {
	font-size: 13px;
	font-weight: 500;
}

/* ==========================================================================
   FORM FIELDS
   ========================================================================== */

/* Single field */
.sitestaffr-ws-field {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
}

.sitestaffr-ws-field > label {
	width: 100px;
	font-size: 13px;
	font-weight: 500;
	color: #1d2327;
	flex-shrink: 0;
}

.sitestaffr-ws-field input[type="text"],
.sitestaffr-ws-field select {
	width: 240px;
	height: 32px;
	padding: 4px 8px;
	font-size: 13px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
}

.sitestaffr-ws-field input[type="checkbox"] {
	margin: 0 5px 0 0;
}

.sitestaffr-ws-radius-lock-toggle {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
	line-height: 1;
}

.sitestaffr-ws-radius-lock-toggle input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	margin: 0;
}

.sitestaffr-ws-radius-lock-toggle .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: #8c8f94;
	transition: color 0.15s ease;
}

.sitestaffr-ws-radius-lock-toggle:hover .dashicons {
	color: #00838f;
}

.sitestaffr-ws-radius-lock-toggle.is-locked .dashicons {
	color: #00838f;
}

.sitestaffr-ws-radius-heading {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 12px;
}

.sitestaffr-ws-radius-heading-label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #00838f;
}

.sitestaffr-ws-radius-heading--light {
	margin-bottom: 10px;
}

.sitestaffr-ws-radius-heading--light .sitestaffr-ws-radius-heading-label {
	color: #50575e;
}

.sitestaffr-ws-radius-group.is-locked .sitestaffr-ws-radius-input[data-radius-role="linked"] {
	background-color: #f6f7f7;
	color: #8c8f94;
}

/* Compact field variant (inside field-rows) */
.sitestaffr-ws-field--compact > label {
	width: auto;
	margin-right: 4px;
}

.sitestaffr-ws-field--compact input[type="text"],
.sitestaffr-ws-field--compact select {
	width: 110px;
}

/* Field row — multiple compact fields inline */
.sitestaffr-ws-field-row {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.sitestaffr-ws-field-row .sitestaffr-ws-field {
	margin-bottom: 0;
	flex: 0 0 auto;
}

/* Color picker width override */
.sitestaffr-color-field {
	max-width: 100px;
}

/* Number input with px suffix */
.sitestaffr-ws-input-px {
	display: flex;
	align-items: center;
	gap: 4px;
}

.sitestaffr-ws-input-px input[type="number"] {
	width: 70px;
	height: 32px;
	padding: 4px 8px;
	font-size: 13px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	-moz-appearance: textfield;
}

.sitestaffr-ws-input-px input[type="number"]::-webkit-inner-spin-button,
.sitestaffr-ws-input-px input[type="number"]::-webkit-outer-spin-button {
	opacity: 1;
}

.sitestaffr-ws-px-suffix {
	font-size: 12px;
	color: #787c82;
	font-weight: 500;
	user-select: none;
}

/* ==========================================================================
   TABS — chrome comes from the shared component styles
   (.sitestaffr-agent-tabs in sitestaffr-global.css); only the in-card
   layout differs, set via the component's layout variables.
   ========================================================================== */

.sitestaffr-ws-section {
	--sitestaffr-tabs-margin: 0 0 16px;
	--sitestaffr-tabpanel-padding: 0;
}

/* Hide border width/color when style is "none" */
.sitestaffr-ws-border-dependent.is-hidden {
	display: none;
}

/* ==========================================================================
   FIELD GROUPS — visual clustering with left accent
   ========================================================================== */

.sitestaffr-ws-group {
	padding: 16px 0;
	border-bottom: 1px solid #f0ebe0;
}

.sitestaffr-ws-group:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.sitestaffr-ws-group:first-child {
	padding-top: 0;
}

.sitestaffr-ws-group h4 {
	margin: 0 0 12px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #00838F;
}

/* ==========================================================================
   WIDGET PREVIEWS — re-used from previous version
   ========================================================================== */

/* Fixed Widget Preview — backdrop follows the toolbar (light/dark/custom),
   defaulting to a neutral on-brand cream instead of the old purple gradient. */
.sitestaffr-preview-widget-container {
	position: relative;
	width: 100%;
	height: 200px;
	background: var(--ws-backdrop, var(--sitestaffr-bg-alt, #FAF8F4));
	border: 1px solid var(--sitestaffr-border, #E8E2D8);
	border-radius: 8px;
	overflow: hidden;
	transition: background 0.2s ease;
}

.sitestaffr-ws-preview-col.is-dark-backdrop .sitestaffr-preview-widget-container,
.sitestaffr-ws-preview-col.is-dark-backdrop .sitestaffr-button-preview-container {
	background: var(--ws-backdrop, #23282d);
	border-color: #1a1e23;
}

.sitestaffr-ws-preview-col.is-dark-backdrop .sitestaffr-preview-branding,
.sitestaffr-ws-preview-col.is-dark-backdrop .sitestaffr-preview-branding .dashicons {
	color: rgba(255, 255, 255, 0.7);
}

.sitestaffr-preview-scene {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.sitestaffr-preview-widget {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.sitestaffr-preview-tooltip {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: rgba(0, 0, 0, 0.85);
	color: #fff;
	padding: 6px 10px;
	border-radius: 6px;
	font-size: 12px;
	white-space: nowrap;
}

.sitestaffr-preview-branding {
	margin-top: 8px;
	font-size: 11px;
	color: var(--sitestaffr-text-muted, #646970);
	display: inline-flex;
	align-items: center;
	gap: 2px;
	line-height: 1;
}

.sitestaffr-preview-branding .sitestaffr-tooltip-trigger {
	margin-left: 0;
	display: inline-flex;
	align-items: center;
	line-height: 1;
}

.sitestaffr-preview-branding .dashicons {
	font-size: 13px;
	width: 13px;
	height: 13px;
	line-height: 13px;
	color: rgba(255, 255, 255, 0.7);
}

.sitestaffr-widget-trigger {
	width: 60px;
	height: 60px;
	border-radius: 20px 20px 20px 0;
	border: none;
	background-color: #0073aa;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	transition: all 0.3s ease;
}

.sitestaffr-widget-trigger:hover {
	transform: scale(1.05);
}

.sitestaffr-widget-icon {
	stroke: currentColor;
}

.sitestaffr-widget-branding {
	margin-top: 8px;
	text-align: center;
	font-size: 11px;
	color: var(--sitestaffr-text-muted, #646970);
}

/* Button Widget Preview */
.sitestaffr-button-preview-container {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 80px;
	background: var(--ws-backdrop, var(--sitestaffr-bg-alt, #FAF8F4));
	border: 1px solid var(--sitestaffr-border, #E8E2D8);
	border-radius: 8px;
	padding: 20px;
	transition: background 0.2s ease;
}

.sitestaffr-button-preview {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	line-height: 1.4;
}

.sitestaffr-button-preview:hover {
	opacity: 0.9;
}

.sitestaffr-button-preview svg {
	display: block;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1200px) {
	.sitestaffr-ws-two-col {
		grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
		gap: 24px;
	}
}

@media (max-width: 1024px) {
	.sitestaffr-ws-two-col {
		grid-template-columns: 1fr;
	}

	.sitestaffr-ws-preview-col--sticky {
		position: sticky;
		top: 56px; /* WP admin bar 46px + 10px buffer */
	}

	.sitestaffr-ws-section-header {
		height: auto;
		min-height: 60px;
		padding: 12px 18px;
		gap: 8px;
	}

	.sitestaffr-ws-section-title {
		width: 100%;
	}

	.sitestaffr-ws-shortcode-label {
		margin-left: 0;
		display: block;
	}

	.sitestaffr-ws-shortcode-click {
		width: 100%;
		overflow: visible;
		white-space: normal;
		overflow-wrap: anywhere;
		word-break: break-word;
	}

	.sitestaffr-ws-auto-display-row {
		flex-wrap: wrap;
		padding: 12px 16px;
	}

	.sitestaffr-ws-toggle-label {
		white-space: normal;
	}

	.sitestaffr-ws-section-footer {
		padding: 14px 16px;
		flex-wrap: wrap;
	}
}

@media (max-width: 782px) {

	.sitestaffr-ws-section-body {
		padding: 16px;
	}

	.sitestaffr-ws-field {
		flex-direction: column;
		align-items: flex-start;
	}

	.sitestaffr-ws-field > label {
		width: 100%;
		margin-bottom: 4px;
	}

	.sitestaffr-ws-field input[type="text"],
	.sitestaffr-ws-field select {
		width: 100%;
	}

	.sitestaffr-ws-field-row {
		flex-direction: column;
		gap: 12px;
	}

	.sitestaffr-ws-field--compact input[type="text"],
	.sitestaffr-ws-field--compact select {
		width: 100%;
	}

	.sitestaffr-preview-widget-container {
		height: 150px;
	}
}

/* Pulse hover animation for button preview */
@keyframes sitestaffr-ws-pulse {
	0% { transform: scale(1); }
	50% { transform: scale(1.05); }
	100% { transform: scale(1); }
}

.sitestaffr-ws-preview-pulse {
	animation: sitestaffr-ws-pulse 0.6s ease;
}

/* ==========================================================================
   ANALYTICS INTEGRATION (GTM) — event reference + setup guide
   ========================================================================== */

/* "Google Tag Manager" pill in the section header */
.sitestaffr-ws-gtm-badge {
	display: inline-flex;
	align-items: center;
	margin-left: auto;
	padding: 4px 11px;
	background: #E0F7FA;
	border: 1px solid #b2ebf2;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.2px;
	color: #00838F;
	white-space: nowrap;
}

.sitestaffr-ws-gtm-intro {
	margin: 0 0 18px;
	color: #50575e;
	font-size: 13.5px;
	line-height: 1.6;
}

/* Event reference table */
.sitestaffr-ws-gtm-table {
	width: 100%;
	margin: 0 0 24px;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid #e0ddd6;
	border-radius: 8px;
	overflow: hidden;
	font-size: 13.5px;
}

.sitestaffr-ws-gtm-table thead th {
	padding: 11px 16px;
	text-align: left;
	background: #FAF8F4;
	border-bottom: 1px solid #e0ddd6;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #00838F;
}

.sitestaffr-ws-gtm-table tbody td {
	padding: 14px 16px;
	border-bottom: 1px solid #f0ebe0;
	vertical-align: top;
	color: #3c434a;
	line-height: 1.5;
}

.sitestaffr-ws-gtm-table tbody tr:last-child td {
	border-bottom: none;
}

.sitestaffr-ws-gtm-table tbody tr:hover td {
	background: #fcfbf9;
}

/* Stack the event name + classification label in the first column */
.sitestaffr-ws-gtm-table tbody td:first-child {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
}

/* Event-name code pill (the headline attribute of each row) */
.sitestaffr-ws-gtm-event-name {
	display: inline-block;
	padding: 3px 8px;
	background: #E0F7FA;
	border: 1px solid #b2ebf2;
	border-radius: 4px;
	font-family: 'SF Mono', Monaco, Consolas, 'Courier New', monospace;
	font-size: 12px;
	font-weight: 600;
	color: #00838F;
}

/* Engagement / Conversion classification — dot + label, no heavy pill */
.sitestaffr-ws-gtm-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 10.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #0097a7;
}

.sitestaffr-ws-gtm-tag::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #1FB6CC;
}

.sitestaffr-ws-gtm-tag--conversion {
	color: #047857;
}

.sitestaffr-ws-gtm-tag--conversion::before {
	background: #10b981;
}

/* Included data-field chips */
.sitestaffr-ws-gtm-data {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}

.sitestaffr-ws-gtm-data code {
	padding: 2px 6px;
	background: #f6f7f7;
	border: 1px solid #e0ddd6;
	border-radius: 4px;
	font-family: 'SF Mono', Monaco, Consolas, 'Courier New', monospace;
	font-size: 11.5px;
	color: #50575e;
}

/* Setup guide panel */
/* Collapsible setup guide (native <details>) */
.sitestaffr-ws-gtm-setup {
	background: linear-gradient(180deg, #f5fcfd 0%, #eef9fb 100%);
	border: 1px solid #cdebef;
	border-radius: 10px;
	overflow: hidden;
}

.sitestaffr-ws-gtm-setup-summary {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 15px 22px;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.sitestaffr-ws-gtm-setup-summary::-webkit-details-marker {
	display: none;
}

.sitestaffr-ws-gtm-setup-summary-text {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #00838F;
}

.sitestaffr-ws-gtm-setup-summary-hint {
	font-size: 12px;
	font-weight: 500;
	color: #5b8a90;
}

.sitestaffr-ws-gtm-chevron {
	margin-left: auto;
	color: #00838F;
	transition: transform 0.2s ease;
}

.sitestaffr-ws-gtm-setup[open] .sitestaffr-ws-gtm-chevron {
	transform: rotate(180deg);
}

.sitestaffr-ws-gtm-setup-summary:hover .sitestaffr-ws-gtm-setup-summary-text {
	color: #006770;
}

.sitestaffr-ws-gtm-setup[open] .sitestaffr-ws-gtm-setup-summary {
	border-bottom: 1px solid #cdebef;
}

.sitestaffr-ws-gtm-setup-content {
	padding: 18px 22px 22px;
}

/* Numbered steps with teal markers + connector line */
.sitestaffr-ws-gtm-steps {
	counter-reset: gtm-step;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sitestaffr-ws-gtm-steps > li {
	counter-increment: gtm-step;
	position: relative;
	padding: 0 0 28px 44px;
	color: #3c434a;
	font-size: 13.5px;
	line-height: 1.65;
}

.sitestaffr-ws-gtm-steps > li:last-child {
	padding-bottom: 0;
}

.sitestaffr-ws-gtm-steps > li::before {
	content: counter(gtm-step);
	position: absolute;
	left: 0;
	top: -1px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	background: #1FB6CC;
	border-radius: 50%;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	box-shadow: 0 1px 2px rgba(0, 131, 143, 0.3);
}

.sitestaffr-ws-gtm-steps > li:not(:last-child)::after {
	content: "";
	position: absolute;
	left: 12.5px;
	top: 29px;
	bottom: 4px;
	width: 1px;
	background: #b2ebf2;
}

/* Inline "menu path" chips (Triggers → New, Preview, …) */
.sitestaffr-ws-gtm-path {
	display: inline-block;
	padding: 1px 7px;
	background: #fff;
	border: 1px solid #cfe8ec;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	color: #00838F;
	white-space: nowrap;
}

.sitestaffr-ws-gtm-steps code {
	padding: 2px 6px;
	background: #fff;
	border: 1px solid #cfe8ec;
	border-radius: 4px;
	font-family: 'SF Mono', Monaco, Consolas, 'Courier New', monospace;
	font-size: 12px;
	color: #00838F;
}

/* Footnote tip */
.sitestaffr-ws-gtm-note {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 18px 0 0;
	padding-top: 14px;
	border-top: 1px dashed #cdebef;
	color: #50575e;
	font-size: 12.5px;
	line-height: 1.55;
}

.sitestaffr-ws-gtm-note .dashicons {
	flex-shrink: 0;
	margin-top: 1px;
	width: 18px;
	height: 18px;
	font-size: 18px;
	color: #1FB6CC;
}

/* Prerequisites list */
.sitestaffr-ws-gtm-prereq-label {
	margin: 0 0 8px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #00838F;
}

.sitestaffr-ws-gtm-prereq {
	margin: 0 0 22px;
	padding: 0 0 0 18px;
	list-style: disc;
	color: #50575e;
	font-size: 13px;
	line-height: 1.6;
}

.sitestaffr-ws-gtm-prereq li {
	margin: 0 0 5px;
}

/* Rich multi-part steps (title + body inside each numbered step) */
.sitestaffr-ws-gtm-step-title {
	margin: 2px 0 10px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	color: #1d2327;
}

.sitestaffr-ws-gtm-step > p {
	margin: 0 0 12px;
	color: #3c434a;
	font-size: 13.5px;
	line-height: 1.6;
}

/* Compact reference sub-tables (data layer variables, triggers) */
.sitestaffr-ws-gtm-subtable {
	width: 100%;
	margin: 0;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid #e0ddd6;
	border-radius: 7px;
	overflow: hidden;
	font-size: 13px;
}

.sitestaffr-ws-gtm-subtable th {
	padding: 9px 14px;
	text-align: left;
	background: #FAF8F4;
	border-bottom: 1px solid #e0ddd6;
	font-size: 10.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #00838F;
}

.sitestaffr-ws-gtm-subtable td {
	padding: 9px 14px;
	border-bottom: 1px solid #f0ebe0;
	vertical-align: top;
	color: #3c434a;
}

.sitestaffr-ws-gtm-subtable tr:last-child td {
	border-bottom: none;
}

.sitestaffr-ws-gtm-subtable td:first-child {
	font-weight: 500;
	color: #50575e;
}

/* Tag configuration cards */
.sitestaffr-ws-gtm-tagcard {
	margin: 0 0 10px;
	padding: 12px 16px;
	background: #fff;
	border: 1px solid #e0ddd6;
	border-left: 3px solid #1FB6CC;
	border-radius: 6px;
}

.sitestaffr-ws-gtm-tagcard:last-child {
	margin-bottom: 0;
}

.sitestaffr-ws-gtm-tagcard-title {
	display: block;
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 700;
	color: #00838F;
}

.sitestaffr-ws-gtm-tagcard ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sitestaffr-ws-gtm-tagcard li {
	position: relative;
	margin: 0 0 5px;
	padding: 0 0 0 14px;
	font-size: 13px;
	line-height: 1.55;
	color: #3c434a;
}

.sitestaffr-ws-gtm-tagcard li:last-child {
	margin-bottom: 0;
}

.sitestaffr-ws-gtm-tagcard li::before {
	content: "";
	position: absolute;
	left: 2px;
	top: 8px;
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: #80deea;
}

.sitestaffr-ws-gtm-tagcard li strong {
	font-weight: 600;
	color: #1d2327;
}

/* Event-parameter code groups */
.sitestaffr-ws-gtm-params {
	color: #50575e;
}

.sitestaffr-ws-gtm-params code {
	margin: 1px 0;
}

/* Stack the event table into cards on narrow screens */
@media (max-width: 782px) {
	.sitestaffr-ws-gtm-table,
	.sitestaffr-ws-gtm-table tbody,
	.sitestaffr-ws-gtm-table tr,
	.sitestaffr-ws-gtm-table td {
		display: block;
		width: 100%;
	}

	.sitestaffr-ws-gtm-table {
		overflow: visible;
	}

	.sitestaffr-ws-gtm-table thead {
		display: none;
	}

	.sitestaffr-ws-gtm-table tbody tr {
		padding: 14px 16px;
		border-bottom: 1px solid #f0ebe0;
	}

	.sitestaffr-ws-gtm-table tbody tr:last-child {
		border-bottom: none;
	}

	.sitestaffr-ws-gtm-table tbody td {
		padding: 0 0 8px;
		border: none;
	}

	.sitestaffr-ws-gtm-table tbody td:last-child {
		padding-bottom: 0;
	}

	.sitestaffr-ws-gtm-table tbody tr:hover td {
		background: transparent;
	}

	/* The td block rule above (0,1,1) beats .sitestaffr-ws-gtm-data's flex (0,1,0),
	   which let long code chips overflow the card — restore the wrapping
	   chip row, and let a too-long chip break internally as a last resort. */
	.sitestaffr-ws-gtm-table td.sitestaffr-ws-gtm-data {
		display: flex;
	}

	.sitestaffr-ws-gtm-data code {
		overflow-wrap: anywhere;
	}

	/* Sub-tables (data-layer variables, triggers): stack the pairs — the
	   code names are too long for two phone columns. */
	.sitestaffr-ws-gtm-subtable,
	.sitestaffr-ws-gtm-subtable tbody,
	.sitestaffr-ws-gtm-subtable tr,
	.sitestaffr-ws-gtm-subtable td {
		display: block;
		width: 100%;
		box-sizing: border-box;
	}

	.sitestaffr-ws-gtm-subtable thead {
		display: none;
	}

	.sitestaffr-ws-gtm-subtable tr {
		padding: 9px 14px;
		border-bottom: 1px solid #f0ebe0;
	}

	.sitestaffr-ws-gtm-subtable tr:last-child {
		border-bottom: none;
	}

	.sitestaffr-ws-gtm-subtable td {
		padding: 0 0 4px;
		border: none;
	}

	.sitestaffr-ws-gtm-subtable td:last-child {
		padding-bottom: 0;
	}

	/* Reclaim horizontal room: tighter guide padding + step gutter. */
	.sitestaffr-ws-gtm-setup-content {
		padding: 14px 14px 16px;
	}

	.sitestaffr-ws-gtm-steps > li {
		padding-left: 36px;
	}

	/* Menu-path chips wrap instead of forcing overflow. */
	.sitestaffr-ws-gtm-path {
		white-space: normal;
	}

	/* Long {{DLV - …}} parameter values break instead of overflowing. */
	.sitestaffr-ws-gtm-params code {
		white-space: normal;
		overflow-wrap: anywhere;
	}

	/* Collapsed-guide summary wraps title/hint cleanly. */
	.sitestaffr-ws-gtm-setup-summary {
		flex-wrap: wrap;
		row-gap: 2px;
	}
}

/* ==========================================================================
   STYLE PRESETS ROW — the default experience (presets + brand color)
   ========================================================================== */

.sitestaffr-ws-presets {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 16px;
	padding: 16px;
	margin-bottom: 16px;
	background: var(--sitestaffr-bg-alt, #FAF8F4);
	border: 1px solid var(--sitestaffr-border, #E8E2D8);
	border-radius: var(--sitestaffr-radius, 8px);
}

.sitestaffr-ws-presets-title {
	flex-basis: 100%;
	margin: 0;
	font-size: 13px;
	color: var(--sitestaffr-text-muted, #646970);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.sitestaffr-ws-presets-cards {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.sitestaffr-ws-preset-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 10px 14px;
	background: #fff;
	border: 1px solid var(--sitestaffr-border, #E8E2D8);
	border-radius: var(--sitestaffr-radius-sm, 4px);
	font-size: 12px;
	font-weight: 600;
	color: var(--sitestaffr-text, #1D2327);
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sitestaffr-ws-preset-card:hover {
	border-color: var(--sitestaffr-teal, #1FB6CC);
}

.sitestaffr-ws-preset-card.is-active {
	border-color: var(--sitestaffr-teal, #1FB6CC);
	box-shadow: 0 0 0 1px var(--sitestaffr-teal, #1FB6CC);
	background: var(--sitestaffr-teal-light, #E0F7FA);
}

.sitestaffr-ws-preset-swatch {
	width: 28px;
	height: 28px;
	background: var(--sitestaffr-teal, #1FB6CC);
}

.sitestaffr-ws-preset-swatch--round,
.sitestaffr-ws-preset-swatch--pill {
	border-radius: 50%;
}

.sitestaffr-ws-preset-swatch--soft {
	border-radius: 10px 10px 10px 0;
}

.sitestaffr-ws-preset-swatch--rounded {
	border-radius: 8px;
}

.sitestaffr-ws-preset-swatch--square {
	border-radius: 2px;
}

.sitestaffr-ws-preset-swatch--gradient {
	border-radius: 50%;
	background: linear-gradient(135deg, var(--sitestaffr-teal, #1FB6CC) 0%, var(--sitestaffr-green, #10B981) 100%);
}

.sitestaffr-ws-preset-swatch--outline {
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--sitestaffr-teal, #1FB6CC);
}

.sitestaffr-ws-presets-side {
	display: flex;
	align-items: flex-end;
	gap: 12px;
	margin-left: auto;
}

/* The brand-color field carries the shared 12px bottom margin, so on a flex-end
   row its swatch floats above the Reset button. Zero the margin and match the
   swatch's 32px height so the two controls sit on one baseline. */
.sitestaffr-ws-presets-side .sitestaffr-ws-field {
	margin-bottom: 0;
}

/* Core's swatch also carries its own 6px bottom margin inside the picker. */
.sitestaffr-ws-presets-side .wp-picker-container .wp-color-result.button {
	margin-bottom: 0;
}

.sitestaffr-ws-presets-side .sitestaffr-ws-reset-preset {
	height: 32px;
	min-height: 32px;
	padding: 0 12px;
}

/* Essentials — Size (and the button's Label): the two controls owners actually
   touch, kept out of the Advanced accordion. */
.sitestaffr-ws-essentials {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 16px;
	flex-basis: 100%;
	padding-top: 14px;
	border-top: 1px solid var(--sitestaffr-border, #E8E2D8);
}

.sitestaffr-ws-essentials .sitestaffr-ws-field {
	margin: 0;
}

.sitestaffr-ws-essentials-label {
	flex: 1 1 220px;
	max-width: 340px;
}

.sitestaffr-ws-essentials-label input[type="text"] {
	width: 100%;
}

/* ==========================================================================
   ADVANCED CUSTOMIZATION ACCORDION + INTENT GROUPS
   ========================================================================== */

.sitestaffr-ws-advanced {
	border: 1px solid var(--sitestaffr-border, #E8E2D8);
	border-radius: var(--sitestaffr-radius, 8px);
	background: #fff;
}

.sitestaffr-ws-advanced > summary {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 16px;
	font-weight: 600;
	cursor: pointer;
	user-select: none;
	color: var(--sitestaffr-teal-dark, #00838F);
	list-style: none;
}

.sitestaffr-ws-advanced > summary::-webkit-details-marker {
	display: none;
}

.sitestaffr-ws-advanced > summary::after {
	content: "\f347";
	font-family: dashicons;
	margin-left: auto;
	transition: transform 0.2s ease;
	color: var(--sitestaffr-text-muted, #646970);
}

.sitestaffr-ws-advanced[open] > summary::after {
	transform: rotate(180deg);
}

.sitestaffr-ws-advanced-hint {
	font-weight: 400;
	font-size: 12px;
	color: var(--sitestaffr-text-muted, #646970);
}

.sitestaffr-ws-advanced-body {
	padding: 4px 16px 16px;
	border-top: 1px solid var(--sitestaffr-border-soft, #F0EBE0);
}

.sitestaffr-ws-intent-title {
	margin: 20px 0 4px;
	padding-bottom: 6px;
	border-bottom: 2px solid var(--sitestaffr-teal-light, #E0F7FA);
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--sitestaffr-teal-dark, #00838F);
}

/* ==========================================================================
   PREVIEW TOOLBAR (backdrop toggle) + PRESET ANIMATION
   ========================================================================== */

.sitestaffr-ws-preview-toolbar {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 8px;
}

.sitestaffr-ws-backdrop-btn {
	padding: 3px 12px;
	border: 1px solid var(--sitestaffr-border, #E8E2D8);
	border-radius: var(--sitestaffr-radius-pill, 999px);
	background: #fff;
	font-size: 12px;
	cursor: pointer;
	color: var(--sitestaffr-text-soft, #50575E);
}

.sitestaffr-ws-backdrop-btn.is-active {
	background: var(--sitestaffr-teal-dark, #00838F);
	border-color: var(--sitestaffr-teal-dark, #00838F);
	color: #fff;
}

.sitestaffr-ws-backdrop-custom {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
}

.sitestaffr-ws-backdrop-color {
	width: 28px;
	height: 24px;
	padding: 0;
	border: 1px solid var(--sitestaffr-border, #E8E2D8);
	border-radius: var(--sitestaffr-radius-sm, 4px);
	background: none;
	cursor: pointer;
}

@keyframes sitestaffr-ws-preset-pop {
	0% { transform: scale(1); }
	40% { transform: scale(1.06); }
	100% { transform: scale(1); }
}

.sitestaffr-ws-preview-animate .sitestaffr-preview-widget,
.sitestaffr-ws-preview-animate .sitestaffr-button-preview {
	animation: sitestaffr-ws-preset-pop 0.4s ease;
}

@media screen and (max-width: 782px) {
	.sitestaffr-ws-presets-side {
		margin-left: 0;
		flex-basis: 100%;
	}
}
