/**
 * Rezolve Ai: v4 admin design system.
 *
 * Mirrors the Rezolve Ai app's branding (indigo primary, soft cards, SegmentedTabs,
 * stat tiles, native-SVG charts). Everything is scoped under .agencoen-wrap so
 * nothing leaks into the rest of wp-admin; the only exceptions are the toast
 * and chart tooltip singletons, which are appended to <body> and styled with
 * literal colors below.
 *
 * Inter is bundled locally (assets/fonts, SIL Open Font License); no external
 * font requests are made.
 */

@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url( '../fonts/Inter-400.woff2' ) format( 'woff2' );
}
@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url( '../fonts/Inter-500.woff2' ) format( 'woff2' );
}
@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url( '../fonts/Inter-600.woff2' ) format( 'woff2' );
}

/* ------------------------------------------------------------------ */
/* Tokens                                                              */
/* ------------------------------------------------------------------ */

.agencoen-wrap {
	--ace-primary: #4f46e5;
	--ace-primary-dark: #4338ca;
	--ace-text: #111827;
	--ace-subdued: #4b5563;
	/* Smallest text and chart labels: 4.8:1 on white (was #9ca3af, 2.5:1). */
	--ace-faint: #6b7280;
	--ace-border: #d1d5db;
	/* The edge of a field or switch has to be seen to be used: 3.2:1 on
	   white, the colour WordPress uses for its own inputs. */
	--ace-control-border: #8c8f94;
	--ace-border-light: #e5e7eb;
	--ace-surface: #ffffff;
	--ace-surface-2: #f9fafb;
	--ace-surface-3: #f3f4f6;

	--ace-indigo: #6366f1;
	--ace-emerald: #10b981;
	--ace-amber: #f59e0b;
	--ace-rose: #f43f5e;
	--ace-cyan: #06b6d4;
	--ace-violet: #8b5cf6;
	--ace-lime: #84cc16;
	--ace-orange: #f97316;

	--ace-success-bg: #d1fae5;
	--ace-success-text: #047857;
	--ace-warning-bg: #fef3c7;
	--ace-warning-text: #b45309;
	--ace-error-bg: #fee2e2;
	--ace-error-text: #b91c1c;
	--ace-info-bg: #dbeafe;
	--ace-info-text: #1d4ed8;
	--ace-neutral-bg: #f3f4f6;
	--ace-neutral-text: #4b5563;

	--ace-radius-sm: 6px;
	--ace-radius-md: 8px;
	--ace-radius-lg: 12px;
	--ace-radius-xl: 16px;
	--ace-card-shadow: 0 1px 3px rgba(16, 24, 40, 0.04), 0 12px 32px -18px rgba(49, 46, 129, 0.18);

	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 14px;
	color: var(--ace-text);
	max-width: 1280px;
	margin-right: 12px;
}

.agencoen-wrap *,
.agencoen-wrap *::before,
.agencoen-wrap *::after {
	box-sizing: border-box;
}

.agencoen-wrap a {
	color: var(--ace-primary);
}
.agencoen-wrap a:hover {
	color: var(--ace-primary-dark);
}

/* ------------------------------------------------------------------ */
/* Header (static aurora accent)                                       */
/* ------------------------------------------------------------------ */

.ace-header {
	position: relative;
	overflow: hidden;
	background: var(--ace-surface);
	border: 1px solid var(--ace-border-light);
	border-radius: var(--ace-radius-xl);
	box-shadow: var(--ace-card-shadow);
	padding: 18px 22px;
	margin: 14px 0 18px;
}
.ace-aurora {
	position: absolute;
	inset: 0;
	pointer-events: none;
}
.ace-aurora span {
	position: absolute;
	border-radius: 50%;
	filter: blur( 60px );
}
.ace-aurora .ace-aurora-a {
	width: 420px;
	height: 220px;
	top: -120px;
	left: -60px;
	background: radial-gradient( closest-side, rgba(99, 102, 241, 0.14), transparent );
}
.ace-aurora .ace-aurora-b {
	width: 380px;
	height: 200px;
	top: -100px;
	right: 6%;
	background: radial-gradient( closest-side, rgba(6, 182, 212, 0.10), transparent );
}
.ace-header-main {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	flex-wrap: wrap;
}
.ace-header-brand {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
}
.ace-logo {
	height: 26px;
	width: auto;
	display: block;
}
.ace-brand-sep {
	width: 1px;
	height: 26px;
	background: var(--ace-border-light);
}
.ace-brand-copy {
	display: flex;
	align-items: baseline;
	gap: 10px;
	min-width: 0;
}
.ace-brand-name {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.08em;
	color: var(--ace-primary-dark);
}
.ace-brand-title,
.agencoen-wrap .ace-brand-title {
	margin: 0;
	padding: 0;
	line-height: 1.3;
	font-size: 16px;
	font-weight: 600;
	color: var(--ace-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ace-header-side {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}
.ace-header-links {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 13px;
}
.ace-header-links a {
	text-decoration: none;
	font-weight: 500;
}
.ace-header-links a:hover {
	text-decoration: underline;
}

/* Connection pill */
.ace-pill {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 12px;
	font-weight: 500;
	padding: 5px 12px;
	border-radius: 9999px;
	white-space: nowrap;
}
.ace-pill::before {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
}
.ace-pill-success { background: var(--ace-success-bg); color: var(--ace-success-text); }
.ace-pill-neutral { background: var(--ace-neutral-bg); color: var(--ace-neutral-text); }
.ace-pill-host { font-weight: 400; }

/* ------------------------------------------------------------------ */
/* Cards + headings                                                    */
/* ------------------------------------------------------------------ */

.ace-card {
	background: var(--ace-surface);
	border: 1px solid var(--ace-border-light);
	border-radius: var(--ace-radius-xl);
	padding: 22px 24px;
	box-shadow: var(--ace-card-shadow);
	margin-bottom: 16px;
}
.ace-card-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--ace-text);
	margin: 0 0 4px;
	display: flex;
	align-items: center;
	gap: 8px;
}
.ace-card-sub {
	font-size: 13px;
	color: var(--ace-subdued);
	margin: 0 0 16px;
}
.ace-h1 { font-size: 22px; font-weight: 600; margin: 8px 0 6px; }
.ace-h2 { font-size: 16px; font-weight: 600; margin: 0 0 16px; }
.ace-h3 {
	font-size: 12px;
	font-weight: 600;
	color: var(--ace-subdued);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin: 0 0 14px;
	display: flex;
	align-items: center;
	gap: 6px;
}

/* Layout grids */
.ace-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.ace-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ace-grid-2 > .ace-card,
.ace-grid-3 > .ace-card { margin-bottom: 0; }
@media (max-width: 1024px) {
	.ace-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 782px) {
	.ace-grid-2, .ace-grid-3 { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ */
/* KPI stat tiles                                                      */
/* ------------------------------------------------------------------ */

.ace-stat-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
	margin-bottom: 16px;
}
.ace-stat-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1180px) {
	.ace-stat-grid.cols-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
	.ace-stat-grid, .ace-stat-grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
	.ace-stat-grid, .ace-stat-grid.cols-5 { grid-template-columns: 1fr; }
}

.ace-stat {
	position: relative;
	overflow: hidden;
	background: var(--ace-surface);
	border: 1px solid var(--ace-border-light);
	border-radius: var(--ace-radius-xl);
	box-shadow: var(--ace-card-shadow);
	padding: 16px 18px 14px;
	--ace-accent: var(--ace-indigo);
	--ace-accent-text: var(--ace-primary-dark);
}
.ace-stat::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	background: var(--ace-accent);
}
/* The bar keeps the accent; the label uses a darker shade of it, because the
   accents themselves are 2.5:1 to 4.5:1 on white and the label is 11px. */
.ace-stat[data-accent="indigo"] { --ace-accent: var(--ace-indigo); --ace-accent-text: #4338ca; }
.ace-stat[data-accent="emerald"] { --ace-accent: var(--ace-emerald); --ace-accent-text: #047857; }
.ace-stat[data-accent="violet"] { --ace-accent: var(--ace-violet); --ace-accent-text: #6d28d9; }
.ace-stat[data-accent="cyan"] { --ace-accent: #0891b2; --ace-accent-text: #0e7490; }
.ace-stat[data-accent="amber"] { --ace-accent: #d97706; --ace-accent-text: #b45309; }

.ace-stat-label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--ace-accent-text);
	margin-bottom: 7px;
}
.ace-stat-row {
	display: flex;
	align-items: baseline;
	gap: 8px;
	flex-wrap: wrap;
}
.ace-stat-value {
	display: block;
	font-size: 24px;
	font-weight: 600;
	line-height: 1.15;
	color: var(--ace-text);
	font-variant-numeric: tabular-nums;
	font-feature-settings: 'tnum';
}
.ace-stat-value.is-text {
	font-size: 15px;
	font-weight: 500;
	line-height: 1.35;
	color: var(--ace-subdued);
}
.ace-stat-sub {
	display: block;
	font-size: 12px;
	color: var(--ace-subdued);
	margin-top: 4px;
}

/* Trend pill */
.ace-trend {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 9999px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.ace-trend.up { background: var(--ace-success-bg); color: var(--ace-success-text); }
.ace-trend.down { background: #ffe4e6; color: #be123c; }

/* ------------------------------------------------------------------ */
/* SegmentedTabs                                                       */
/* ------------------------------------------------------------------ */

.ace-tabs {
	display: flex;
	align-items: center;
	gap: 4px;
	overflow-x: auto;
	background: var(--ace-surface-2);
	border: 1px solid var(--ace-border-light);
	border-radius: var(--ace-radius-xl);
	padding: 6px;
	margin-bottom: 16px;
}
.ace-tab {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	flex-shrink: 0;
	border: none;
	background: none;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 500;
	color: var(--ace-subdued);
	padding: 8px 14px;
	border-radius: var(--ace-radius-lg);
	cursor: pointer;
	transition: color 0.12s ease, background 0.12s ease;
	text-decoration: none;
	line-height: 1.2;
	white-space: nowrap;
}
.ace-tab:hover {
	background: rgba(255, 255, 255, 0.7);
	color: var(--ace-text);
}
.ace-tab:focus-visible {
	outline: 2px solid var(--ace-primary);
	outline-offset: 2px;
}
.ace-tab.is-active {
	background: var(--ace-surface);
	color: var(--ace-primary-dark);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), 0 0 0 1px rgba(199, 210, 254, 0.7);
}
.ace-tab-count {
	display: inline-flex;
	align-items: center;
	font-size: 11px;
	font-weight: 600;
	padding: 1px 7px;
	border-radius: 9999px;
	background: rgba(229, 231, 235, 0.7);
	color: var(--ace-subdued);
	font-variant-numeric: tabular-nums;
}
.ace-tab.is-active .ace-tab-count {
	background: #e0e7ff;
	color: var(--ace-primary-dark);
}

/* ------------------------------------------------------------------ */
/* Chips + badges                                                      */
/* ------------------------------------------------------------------ */

.ace-chip,
.ace-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 10px;
	border-radius: 9999px;
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
	line-height: 1.5;
}
.ace-chip-success, .ace-badge-success { background: var(--ace-success-bg); color: var(--ace-success-text); }
.ace-chip-warning, .ace-badge-warning { background: var(--ace-warning-bg); color: var(--ace-warning-text); }
.ace-chip-error, .ace-badge-error { background: var(--ace-error-bg); color: var(--ace-error-text); }
.ace-chip-info, .ace-badge-info { background: var(--ace-info-bg); color: var(--ace-info-text); }
.ace-chip-neutral, .ace-badge-neutral { background: var(--ace-neutral-bg); color: var(--ace-neutral-text); }

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.ace-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	padding: 9px 16px;
	border-radius: var(--ace-radius-md);
	border: 1px solid transparent;
	cursor: pointer;
	transition: background 0.15s ease, opacity 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
	text-decoration: none;
	line-height: 1.25;
}
.ace-btn:focus-visible {
	outline: 2px solid var(--ace-primary);
	outline-offset: 2px;
}
.ace-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ace-btn-sm { padding: 6px 12px; font-size: 13px; }
.ace-btn-primary { background: var(--ace-primary); color: #fff; }
.ace-btn-primary:hover:not(:disabled) { background: var(--ace-primary-dark); color: #fff; }
.ace-btn-secondary { background: var(--ace-surface); color: var(--ace-text); border-color: var(--ace-border); }
.ace-btn-secondary:hover:not(:disabled) { background: var(--ace-surface-2); color: var(--ace-text); }
.ace-btn-danger { background: var(--ace-surface); color: var(--ace-error-text); border-color: #fecaca; }
.ace-btn-danger:hover:not(:disabled) { background: var(--ace-error-bg); color: var(--ace-error-text); }
/* Anchor-based buttons must beat the `.agencoen-wrap a` link color, which is
   more specific than a bare `.ace-btn-*` class (indigo-on-indigo otherwise). */
.agencoen-wrap a.ace-btn-primary,
.agencoen-wrap a.ace-btn-primary:hover { color: #fff; }
.agencoen-wrap a.ace-btn-secondary,
.agencoen-wrap a.ace-btn-secondary:hover { color: var(--ace-text); }
.agencoen-wrap a.ace-btn-danger,
.agencoen-wrap a.ace-btn-danger:hover { color: var(--ace-error-text); }
.ace-btn.is-busy { opacity: 0.72; pointer-events: none; position: relative; }
.ace-btn.is-busy::after {
	content: '';
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 2px solid currentColor;
	border-top-color: transparent;
	animation: ace-spin 0.7s linear infinite;
}
@keyframes ace-spin {
	to { transform: rotate(360deg); }
}

.ace-link-sm {
	font-size: 13px;
	color: var(--ace-primary);
	background: none;
	border: none;
	cursor: pointer;
	text-decoration: none;
	padding: 0;
	min-height: 24px;
	font-family: inherit;
}
.ace-link-sm:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ */
/* Forms                                                               */
/* ------------------------------------------------------------------ */

.ace-field { margin-bottom: 16px; }
.ace-form-row {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}
.ace-form-row .ace-field { margin-bottom: 0; flex: 1 1 220px; }
.ace-label {
	display: block;
	font-size: 13.5px;
	font-weight: 500;
	margin-bottom: 6px;
	color: var(--ace-text);
}
.ace-input,
.ace-select,
.ace-textarea {
	width: 100%;
	padding: 9px 13px;
	font-family: inherit;
	font-size: 14px;
	color: var(--ace-text);
	background: var(--ace-surface);
	border: 1px solid var(--ace-control-border);
	border-radius: var(--ace-radius-md);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	line-height: 1.4;
	max-width: 100%;
}
.agencoen-wrap select.ace-select,
.agencoen-wrap select.ace-input {
	padding-right: 30px;
	max-width: none;
}
.ace-textarea { min-height: 96px; resize: vertical; }
/* A 2px ring in the primary colour (6.3:1 on white). The old 15% glow was
   1.3:1, which a keyboard user could not find. The transparent outline is
   what Windows high contrast mode draws instead of the shadow. */
.ace-input:focus,
.ace-select:focus,
.ace-textarea:focus {
	outline: 2px solid transparent;
	border-color: var(--ace-primary);
	box-shadow: 0 0 0 1px var(--ace-primary);
}
.ace-input[aria-invalid="true"] { border-color: var(--ace-error-text); }
.ace-input[readonly], .ace-input:disabled { background: var(--ace-surface-2); color: var(--ace-subdued); }
.ace-input-sm { max-width: 230px; }

.ace-toggle {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 14px;
	padding: 7px 0;
	cursor: pointer;
	line-height: 1.45;
}
.ace-toggle input {
	width: 16px;
	height: 16px;
	margin-top: 2px;
	accent-color: var(--ace-primary);
	flex: 0 0 auto;
}
.ace-indent { margin-left: 26px; }

/* Where content goes (4.25.0): one row per content type, with the controls
   for the chosen destination under it. */
.ace-subhead { font-size: 14px; margin: 20px 0 6px; }
.ace-sub-field { display: block; margin-top: 8px; }
.ace-sub-field label { display: block; font-weight: 400; margin-bottom: 2px; }
[data-ace-when][hidden] { display: none !important; }

.ace-help {
	font-size: 13px;
	color: var(--ace-subdued);
	margin: 8px 0 0;
	line-height: 1.5;
}
.ace-help a { color: var(--ace-primary); }
.ace-warn-text { color: var(--ace-warning-text); }

/* ------------------------------------------------------------------ */
/* Banners                                                             */
/* ------------------------------------------------------------------ */

.ace-banner {
	padding: 12px 16px;
	border-radius: var(--ace-radius-lg);
	font-size: 14px;
	margin-bottom: 16px;
	border: 1px solid transparent;
	line-height: 1.5;
}
.ace-banner-success { background: var(--ace-success-bg); border-color: #a7f3d0; color: var(--ace-success-text); }
.ace-banner-warning { background: var(--ace-warning-bg); border-color: #fde68a; color: var(--ace-warning-text); }
.ace-banner-error { background: var(--ace-error-bg); border-color: #fecaca; color: var(--ace-error-text); }
.ace-banner-info { background: var(--ace-info-bg); border-color: #bfdbfe; color: var(--ace-info-text); }
.ace-review-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.ace-connect-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ace-connect-banner .ace-help { color: inherit; margin: 4px 0 0; }
.ace-connect-banner .ace-btn { flex: none; }
.ace-connect-banner-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.ace-connect-banner-actions .ace-link-sm { color: inherit; text-decoration: underline; }

.ace-start-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ace-start-card .ace-help { color: inherit; margin: 4px 0 0; }
.ace-start-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ace-start-note { font-size: 12px; }

/* ------------------------------------------------------------------ */
/* Toolbar, table, pagination                                          */
/* ------------------------------------------------------------------ */

.ace-toolbar {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	padding: 14px 16px;
	background: var(--ace-surface);
	border: 1px solid var(--ace-border-light);
	border-radius: var(--ace-radius-xl);
	box-shadow: var(--ace-card-shadow);
	margin-bottom: 14px;
}
.ace-toolbar .ace-search { flex: 1 1 240px; min-width: 200px; }
.ace-toolbar-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }

.ace-table-card { padding: 0; overflow: hidden; }
.ace-table-scroll { overflow-x: auto; }
.ace-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ace-table th {
	text-align: left;
	font-size: 11.5px;
	font-weight: 600;
	color: var(--ace-subdued);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 12px 16px;
	border-bottom: 1px solid var(--ace-border-light);
	background: var(--ace-surface-2);
	white-space: nowrap;
}
.ace-table td {
	padding: 11px 16px;
	border-bottom: 1px solid var(--ace-border-light);
	vertical-align: middle;
}
.ace-table tbody tr { transition: background 0.1s ease; }
.ace-table tbody tr:hover { background: var(--ace-surface-2); }
.ace-table tr:last-child td { border-bottom: none; }
.ace-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ace-col-check { width: 36px; }
.ace-col-img { width: 52px; }
.ace-col-score { width: 76px; text-align: center; font-variant-numeric: tabular-nums; }
.ace-thumb {
	width: 38px;
	height: 38px;
	object-fit: cover;
	border-radius: var(--ace-radius-md);
	border: 1px solid var(--ace-border-light);
	display: block;
}
.ace-prod-name { font-weight: 500; }
/* A row header (the product name) looks like the cells beside it. */
.ace-table tbody th {
	text-align: left;
	font-size: 14px;
	font-weight: 500;
	color: var(--ace-text);
	text-transform: none;
	letter-spacing: normal;
	padding: 11px 16px;
	border-bottom: 1px solid var(--ace-border-light);
	background: none;
	white-space: normal;
	vertical-align: middle;
}
.ace-table tbody tr:last-child th { border-bottom: none; }
.ace-loading { text-align: center; color: var(--ace-subdued); padding: 26px; }
.ace-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 14px;
	border-top: 1px solid var(--ace-border-light);
	background: var(--ace-surface-2);
	font-variant-numeric: tabular-nums;
}

/* Selection bar */
.ace-selbar {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 16px;
	margin-bottom: 12px;
	background: #eef2ff;
	border: 1px solid #c7d2fe;
	border-radius: var(--ace-radius-lg);
	font-size: 14px;
	flex-wrap: wrap;
}
.ace-selbar-spacer { flex: 1; }

/* Batch progress */
.ace-batch {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 14px;
	padding: 10px 14px;
	background: var(--ace-surface);
	border: 1px solid var(--ace-border-light);
	border-radius: var(--ace-radius-lg);
	box-shadow: var(--ace-card-shadow);
	flex: 1 1 240px;
}
.ace-batch-bar { flex: 1; height: 8px; background: var(--ace-surface-3); border-radius: 9999px; overflow: hidden; }
.ace-batch-fill {
	display: block;
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, var(--ace-primary), #7c6df2);
	border-radius: 9999px;
	transition: width 0.3s ease;
}
.ace-batch-text { font-size: 13px; color: var(--ace-subdued); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Experiment progress: the batch bar, sized for a table cell. The fill takes
   the step's state (done, blocked), like the stepper's chips beside it. */
.ace-exp-progress { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; min-width: 120px; max-width: 240px; }
.ace-exp-progress .ace-batch-bar { flex: none; width: 100%; height: 6px; }
.ace-exp-progress-caption { font-size: 12px; color: var(--ace-subdued); font-variant-numeric: tabular-nums; }
.ace-batch-fill.is-success { background: var(--ace-emerald); }
.ace-batch-fill.is-warning { background: var(--ace-amber); }

/* ------------------------------------------------------------------ */
/* Review list + diffs                                                 */
/* ------------------------------------------------------------------ */

.ace-review-list { display: flex; flex-direction: column; gap: 10px; }
.ace-rev-item {
	background: var(--ace-surface);
	border: 1px solid var(--ace-border-light);
	border-radius: var(--ace-radius-lg);
	box-shadow: var(--ace-card-shadow);
	overflow: hidden;
}
.ace-rev-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.ace-rev-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	border-radius: var(--ace-radius-sm);
	cursor: pointer;
	font-size: 18px;
	color: var(--ace-subdued);
	padding: 0;
	width: 28px;
	height: 28px;
	flex: 0 0 auto;
}
.ace-rev-toggle:hover { background: var(--ace-surface-3); }
.ace-caret { display: inline-block; transition: transform 0.15s ease; }
.ace-rev-item.is-open .ace-caret { transform: rotate(90deg); }
.ace-rev-compact .ace-rev-toggle { display: none; }
.ace-rev-main { flex: 1; min-width: 0; }
.ace-rev-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ace-rev-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.ace-rev-held { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--ace-subdued); }
.ace-rev-held[hidden] { display: none; }
.ace-fieldchip {
	font-size: 11px;
	color: var(--ace-subdued);
	background: var(--ace-surface-3);
	border-radius: 9999px;
	padding: 2px 8px;
}
.ace-rev-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; }
.ace-rev-body { padding: 0 16px 16px; border-top: 1px solid var(--ace-border-light); }
.ace-rev-body .ace-diffs { margin-top: 14px; }
.ace-loadmore { display: flex; justify-content: center; margin-top: 14px; }

.ace-diffs { display: flex; flex-direction: column; gap: 14px; }
.ace-diff { border: 1px solid var(--ace-border-light); border-radius: var(--ace-radius-lg); padding: 14px; }
.ace-diff.is-same { opacity: 0.65; }
.ace-diff-label { font-size: 13px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.ace-diff-tag {
	font-size: 11px;
	font-weight: 500;
	color: var(--ace-subdued);
	background: var(--ace-surface-3);
	border-radius: 9999px;
	padding: 1px 8px;
	text-transform: none;
}
.ace-diff-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ace-diff-col { background: var(--ace-surface-2); border-radius: var(--ace-radius-md); padding: 10px 12px; }
.ace-diff-after { background: #eef2ff; }
.ace-diff-cap {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ace-subdued);
	margin-bottom: 6px;
}
.ace-diff-after .ace-diff-cap { color: var(--ace-primary); }
.ace-diff-text { font-size: 14px; line-height: 1.5; word-break: break-word; }
.ace-diff-text p { margin: 0 0 8px; }
.ace-diff-text :last-child { margin-bottom: 0; }
@media (max-width: 782px) {
	.ace-diff-cols { grid-template-columns: 1fr; }
}

/* Per-content-type review previews */
.ace-ct-block { margin-top: 14px; border-top: 1px solid var(--ace-border-light); padding-top: 14px; }
.ace-ct-title {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ace-subdued);
	margin-bottom: 8px;
}
.ace-ct-irl { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ace-ct-card { background: var(--ace-surface-2); border-radius: var(--ace-radius-md); padding: 10px 12px; font-size: 13px; }
.ace-ct-card strong { display: block; margin-bottom: 4px; }
.ace-ct-links { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ace-text); }
.ace-ct-json {
	background: #0f172a;
	color: #e2e8f0;
	border-radius: var(--ace-radius-md);
	padding: 12px;
	font-size: 11px;
	line-height: 1.5;
	overflow: auto;
	max-height: 240px;
	white-space: pre-wrap;
	word-break: break-word;
}

/* ------------------------------------------------------------------ */
/* Empty state + connect + missing dependency                          */
/* ------------------------------------------------------------------ */

.ace-empty {
	background: var(--ace-surface);
	border: 1px dashed var(--ace-border);
	border-radius: var(--ace-radius-xl);
	padding: 34px 24px;
	text-align: center;
	color: var(--ace-subdued);
	font-size: 14px;
	line-height: 1.55;
}
.ace-empty .ace-empty-title { font-size: 15px; font-weight: 600; color: var(--ace-text); margin: 0 0 6px; }
.ace-empty p { margin: 0 0 12px; }
.ace-empty p:last-child { margin-bottom: 0; }

/* Inline chart empty state (kept compact inside chart cards) */
.ace-chart-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 120px;
	border: 1px dashed var(--ace-border-light);
	border-radius: var(--ace-radius-lg);
	background: var(--ace-surface-2);
	color: var(--ace-faint);
	font-size: 13px;
}

/* Connect (empty state) */
.ace-connect { margin-top: 8px; }
.ace-connect-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: start; }
@media (max-width: 900px) {
	.ace-connect-grid { grid-template-columns: 1fr; }
}
.ace-connect-form .ace-h1 { margin-top: 0; }
.ace-connect-side {
	background: var(--ace-surface-2);
	border: 1px solid var(--ace-border-light);
	border-radius: var(--ace-radius-lg);
	padding: 20px 22px;
}
.ace-connect-side .ace-logo { height: 22px; margin-bottom: 14px; }
.ace-checklist { list-style: none; margin: 10px 0 0; padding: 0; font-size: 14px; color: var(--ace-text); }
.ace-checklist li { display: flex; gap: 9px; align-items: flex-start; padding: 5px 0; line-height: 1.45; }
.ace-checklist li::before {
	content: '';
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	margin-top: 2px;
	border-radius: 50%;
	background: var(--ace-success-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23047857' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M4 8.5l2.5 2.5L12 5.5'/%3E%3C/svg%3E") center/12px no-repeat;
}
.ace-checklist li.is-muted { color: var(--ace-subdued); }
.ace-checklist li.is-muted::before {
	background-color: var(--ace-neutral-bg);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' d='M5 8h6'/%3E%3C/svg%3E");
}
.ace-advanced { margin-top: 18px; }
.ace-advanced summary { cursor: pointer; font-size: 13px; color: var(--ace-subdued); }
.ace-advanced .ace-field { margin-top: 12px; }

/* Missing-dependency state (commerce screens without WooCommerce) */
.ace-dependency { display: flex; justify-content: center; padding: 22px 0; }
.ace-dependency-card { max-width: 620px; width: 100%; padding: 34px 36px; text-align: left; }
.ace-dependency-card .ace-h1 { margin-top: 12px; }
.ace-dependency-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ */
/* Charts                                                              */
/* ------------------------------------------------------------------ */

.ace-chart { min-height: 60px; position: relative; }
.ace-chart svg { display: block; max-width: 100%; }
.ace-axis-label { font-size: 10px; fill: var(--ace-faint); font-family: inherit; }
.ace-grid-line { stroke: var(--ace-border-light); stroke-width: 1; }
.ace-chart-legend {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	flex-wrap: wrap;
	font-size: 12px;
	color: var(--ace-subdued);
	margin-top: 10px;
}
.ace-chart-legend .ace-legend-swatch {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 3px;
	margin-right: 5px;
	vertical-align: -1px;
}
.ace-legend-item-row { display: inline-flex; align-items: center; }

/* Donut */
.ace-donut-wrap { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.ace-donut-svg { flex: 0 0 auto; }
.ace-donut-legend { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-width: 150px; }
.ace-donut-legend .ace-legend-line {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--ace-text);
	background: none;
	border: none;
	padding: 3px 6px;
	border-radius: 6px;
	text-align: left;
	font-family: inherit;
}
.ace-donut-legend button.ace-legend-line { cursor: pointer; }
.ace-donut-legend button.ace-legend-line:hover { background: var(--ace-surface-2); }
.ace-donut-legend .ace-legend-line b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.ace-legend-dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.ace-donut-center-value { font-size: 24px; font-weight: 600; fill: var(--ace-text); font-family: inherit; }
.ace-donut-center-label { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; fill: var(--ace-faint); font-family: inherit; }

/* Gauge + ring */
.ace-gauge-value { font-size: 22px; font-weight: 600; fill: var(--ace-text); font-family: inherit; font-variant-numeric: tabular-nums; }
.ace-gauge-label { font-size: 11px; fill: var(--ace-subdued); font-family: inherit; }
.ace-ring-fg { transition: stroke-dashoffset 0.8s ease; }
.ace-ring-value { font-size: 26px; font-weight: 600; fill: var(--ace-text); font-family: inherit; font-variant-numeric: tabular-nums; }
.ace-ring-label { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; fill: var(--ace-faint); font-family: inherit; }

/* Bar value labels */
.ace-bar-value { font-size: 10px; fill: var(--ace-subdued); font-variant-numeric: tabular-nums; font-family: inherit; }
.ace-barh-label { font-size: 12px; fill: var(--ace-subdued); font-family: inherit; }
.ace-barh-value { font-size: 12px; font-weight: 600; fill: var(--ace-text); font-variant-numeric: tabular-nums; font-family: inherit; }

/* Heatmap */
.ace-heatmap-scroll { overflow-x: auto; }
.ace-heatmap { border-collapse: collapse; width: 100%; font-size: 12px; font-variant-numeric: tabular-nums; }
.ace-heatmap th {
	font-size: 11px;
	font-weight: 600;
	color: var(--ace-subdued);
	text-transform: none;
	padding: 6px 8px;
	text-align: center;
	white-space: nowrap;
	background: none;
	border: none;
}
.ace-heatmap th.ace-heatmap-row-label { text-align: left; font-weight: 500; color: var(--ace-text); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.ace-heatmap td {
	padding: 7px 8px;
	text-align: center;
	border: 2px solid var(--ace-surface);
	border-radius: 4px;
	min-width: 40px;
	color: #000;
}
.ace-heatmap td.is-deep { color: #fff; }

/* Sparkline card helpers */
.ace-spark-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.ace-spark-num { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ace-spark-chart { flex: 1 1 auto; min-width: 120px; max-width: 260px; }

/* Charts grid (dashboard) */
.ace-charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 16px; }
.ace-chart-card { margin-bottom: 0; padding: 18px 20px; }
.ace-chart-wide { grid-column: 1 / -1; }
@media (max-width: 960px) {
	.ace-charts-grid { grid-template-columns: 1fr; }
	.ace-chart-wide { grid-column: auto; }
}

/* ------------------------------------------------------------------ */
/* Skeletons                                                           */
/* ------------------------------------------------------------------ */

.ace-skeleton {
	position: relative;
	overflow: hidden;
	background: var(--ace-surface-3);
	border-radius: var(--ace-radius-md);
}
.ace-skeleton::after {
	content: '';
	position: absolute;
	inset: 0;
	transform: translateX(-100%);
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
	animation: ace-shimmer 1.4s ease infinite;
}
.ace-skeleton-text { height: 12px; margin: 8px 0; }
.ace-skeleton-block { height: 120px; }
.ace-skeleton-tile { height: 92px; border-radius: var(--ace-radius-xl); }
.ace-skeleton-row { height: 40px; margin-bottom: 8px; }
.ace-skeleton-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 960px) {
	.ace-skeleton-grid { grid-template-columns: repeat(2, 1fr); }
}
@keyframes ace-shimmer {
	100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
	.ace-skeleton::after { animation: none; }
	.ace-ring-fg { transition: none; }
	.ace-btn.is-busy::after { animation: none; }
	.ace-batch-fill { transition: none; }
	.ace-caret,
	.ace-tab,
	.ace-btn,
	.ace-input,
	.ace-select,
	.ace-textarea { transition: none; }
	/* Whatever is added later is covered too: ace-spin, tab and caret
	   movement, the switch knob. */
	.agencoen-wrap *,
	.agencoen-wrap *::before,
	.agencoen-wrap *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ------------------------------------------------------------------ */
/* Modal (content-type picker + generic)                               */
/* ------------------------------------------------------------------ */

.ace-modal { position: fixed; inset: 0; z-index: 100050; display: flex; align-items: center; justify-content: center; }
.ace-modal[hidden] { display: none; }
/* `hidden` must win over a component's own display (.ace-selbar is flex), or
   an empty selection bar or pager still draws. */
.agencoen-wrap [hidden] { display: none !important; }
.ace-modal-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, 0.45); }
.ace-modal-card {
	position: relative;
	background: var(--ace-surface);
	border-radius: var(--ace-radius-xl);
	padding: 24px;
	width: 560px;
	max-width: calc(100vw - 40px);
	max-height: calc(100vh - 80px);
	overflow: auto;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.ace-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.ace-types-list { display: flex; flex-direction: column; gap: 18px; margin-top: 10px; }
.ace-types-group { display: flex; flex-direction: column; gap: 8px; }
.ace-types-grouptitle {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ace-subdued);
}
.ace-type-item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 12px;
	border: 1px solid var(--ace-border-light);
	border-radius: var(--ace-radius-md);
	cursor: pointer;
}
.ace-type-item:hover { background: var(--ace-surface-2); }
.ace-type-item input { margin-top: 3px; accent-color: var(--ace-primary); }
.ace-type-main { display: flex; flex-direction: column; gap: 2px; }
.ace-type-label { font-size: 14px; font-weight: 500; }
.ace-type-desc { font-size: 12px; color: var(--ace-subdued); }
.ace-type-rec {
	font-size: 10px;
	font-weight: 600;
	color: var(--ace-success-text);
	background: var(--ace-success-bg);
	border-radius: 9999px;
	padding: 1px 7px;
	margin-left: 6px;
}

/* ------------------------------------------------------------------ */
/* Misc                                                                */
/* ------------------------------------------------------------------ */

.ace-muted { color: var(--ace-subdued); }
.ace-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ace-actions-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.ace-checkall { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.ace-settings-save { margin: 8px 0 24px; }

/* Help icons */
.ace-help-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	margin-left: 2px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid var(--ace-control-border);
	background: var(--ace-surface);
	color: var(--ace-subdued);
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	cursor: help;
	vertical-align: middle;
}
.ace-help-icon:hover { background: var(--ace-primary); border-color: var(--ace-primary); color: #fff; }

/* ------------------------------------------------------------------ */
/* Body-level singletons (toast + chart tooltip); literal colors only  */
/* ------------------------------------------------------------------ */

.ace-toast {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 100060;
	max-width: 380px;
	padding: 12px 16px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.45;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
	border: 1px solid transparent;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.ace-toast-success { background: #d1fae5; border-color: #a7f3d0; color: #047857; }
.ace-toast-error { background: #fee2e2; border-color: #fecaca; color: #b91c1c; }
.ace-toast-info { background: #dbeafe; border-color: #bfdbfe; color: #1d4ed8; }
.ace-toast a { color: inherit; font-weight: 600; }
.ace-toast-close {
	min-width: 24px;
	min-height: 24px;
	margin-left: 6px;
	padding: 0 4px;
	border: 1px solid currentColor;
	border-radius: 6px;
	background: transparent;
	color: inherit;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	vertical-align: middle;
}
.ace-toast-close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.ace-chart-tip {
	position: fixed;
	z-index: 100061;
	background: #111827;
	color: #fff;
	font-size: 12px;
	line-height: 1.45;
	padding: 7px 10px;
	border-radius: 8px;
	pointer-events: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	max-width: 260px;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-variant-numeric: tabular-nums;
}
.ace-chart-tip b { font-weight: 600; }
.ace-chart-tip .ace-tip-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.ace-chart-tip .ace-tip-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: 0 0 auto; }
.ace-chart-tip .ace-tip-val { margin-left: auto; font-weight: 600; padding-left: 10px; }
.ace-help-tip { max-width: 260px; pointer-events: auto; }

/* Utility classes (initial states formerly inline) */
.ace-skeleton-chart { height: 180px; }
.ace-center-note { text-align: center; margin: 8px 0 0; }

/* Review extras (4.16.0): highlights, Q&A, attributes, image alt text. */
.ace-ct-qa { margin: 0; }
.ace-ct-qa dt { font-weight: 600; margin-top: 8px; }
.ace-ct-qa dd { margin: 2px 0 0 0; }
.ace-ct-table { width: 100%; border-collapse: collapse; }
.ace-ct-table th,
.ace-ct-table td { text-align: left; vertical-align: middle; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--ace-border-light); }
/* Custom fields keep their lines (care guides, lists), read top-aligned beside each other. */
.ace-cf-review th,
.ace-cf-review td { vertical-align: top; }
.ace-cf-review td { white-space: pre-line; overflow-wrap: anywhere; }
.ace-ct-alt img { display: block; width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.ace-ct-chip { display: inline-block; font-size: 11px; line-height: 1.6; padding: 0 8px; border-radius: 999px; white-space: nowrap; }
.ace-ct-chip--ok { background: #e7f6ec; color: #1e6b3a; }
.ace-ct-chip--muted { background: #f0f0f1; color: #50575e; }
.ace-ct-chip--warn { background: #fcf0e3; color: #8a4b0f; }

/* Quality scores (4.17.0): the Review screen's measured tiles, per content type. */
.ace-quality { margin-top: 14px; }
.ace-q-group { border: 1px solid var(--ace-border-light); border-radius: var(--ace-radius-lg); padding: 12px 14px; margin-bottom: 10px; }
.ace-q-group-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.ace-q-banner,
.ace-q-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ace-q-banner { background: var(--ace-surface-2); border: 1px solid var(--ace-border-light); border-radius: var(--ace-radius-md); padding: 8px 12px; margin-bottom: 10px; }
.ace-q-banner.is-warning { background: var(--ace-warning-bg); border-color: #fde68a; color: var(--ace-warning-text); }
.ace-q-banner p,
.ace-q-meta p { margin: 0; font-size: 13px; line-height: 1.5; }
.ace-q-meta { margin-bottom: 10px; }
.ace-q-meta p { color: var(--ace-subdued); font-variant-numeric: tabular-nums; }
.ace-q-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ace-q-tile { border: 1px solid var(--ace-border-light); border-radius: var(--ace-radius-md); padding: 10px 12px; background: var(--ace-surface-2); }
.ace-q-tile-label { font-size: 12px; font-weight: 500; color: var(--ace-subdued); margin-bottom: 4px; }
.ace-q-tile-value { font-size: 22px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ace-q-tile-word { font-size: 12px; margin-top: 2px; }
.ace-q-tile-empty { font-size: 13px; font-weight: 600; color: var(--ace-subdued); padding: 4px 0; }
.ace-q-tile.is-excellent { background: var(--ace-success-bg); border-color: #a7f3d0; }
.ace-q-tile.is-excellent .ace-q-tile-value,
.ace-q-tile.is-excellent .ace-q-tile-word { color: var(--ace-success-text); }
.ace-q-tile.is-verygood { background: var(--ace-info-bg); border-color: #bfdbfe; }
.ace-q-tile.is-verygood .ace-q-tile-value,
.ace-q-tile.is-verygood .ace-q-tile-word { color: var(--ace-info-text); }
.ace-q-tile.is-good { background: var(--ace-warning-bg); border-color: #fde68a; }
.ace-q-tile.is-good .ace-q-tile-value,
.ace-q-tile.is-good .ace-q-tile-word { color: var(--ace-warning-text); }
.ace-q-tile.is-weak { background: var(--ace-error-bg); border-color: #fecaca; }
.ace-q-tile.is-weak .ace-q-tile-value,
.ace-q-tile.is-weak .ace-q-tile-word { color: var(--ace-error-text); }
.ace-q-why { margin-top: 10px; font-size: 13px; }
.ace-q-why summary { cursor: pointer; font-weight: 500; color: var(--ace-subdued); }
.ace-q-why p { margin: 6px 0 0; white-space: pre-line; line-height: 1.5; }
.ace-q-note { margin: 8px 0 0; font-size: 12px; color: var(--ace-subdued); }
@media (max-width: 782px) {
	.ace-q-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Editing on Review (4.18.0) */
.ace-rev-applied .ace-rev-body .ace-diffs { margin-top: 14px; }
.ace-diff-label .ace-edit-open { margin-left: auto; }
.ace-ct-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ace-ct-head .ace-ct-title { margin-bottom: 0; }
.ace-diff-live { background: var(--ace-surface-2); }
.ace-edit-section.is-editing > .ace-editor { border: 1px solid var(--ace-primary); border-radius: var(--ace-radius-lg); padding: 14px; margin-top: 14px; background: var(--ace-surface); }
.ace-diffs .ace-edit-section.is-editing > .ace-editor { margin-top: 0; }
.ace-edit-livenote { margin: 0 0 10px; padding: 8px 10px; font-size: 13px; background: var(--ace-warning-bg); color: var(--ace-warning-text); border-radius: var(--ace-radius-md); }
.ace-edit-errors { margin: 0 0 10px; padding: 8px 10px; font-size: 13px; background: var(--ace-error-bg); color: var(--ace-error-text); border-radius: var(--ace-radius-md); }
.ace-edit-rows { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ace-edit-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 8px; border: 1px solid var(--ace-border-light); border-radius: var(--ace-radius-md); }
.ace-edit-row.is-error { border-color: #fecaca; background: var(--ace-error-bg); }
.ace-edit-row > .ace-edit-field,
.ace-edit-pair { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ace-edit-pair-inline { flex-direction: row; flex-wrap: wrap; }
.ace-edit-pair-inline .ace-edit-field { flex: 1 1 180px; }
.ace-edit-field { display: flex; flex-direction: column; gap: 2px; }
.ace-edit-field .ace-input { width: 100%; max-width: none; }
.ace-edit-field textarea.ace-input { min-height: 64px; resize: vertical; }
.ace-input.is-error { border-color: var(--ace-error-text); }
.ace-edit-count { font-size: 11px; color: var(--ace-subdued); }
.ace-edit-count.is-warn { color: var(--ace-warning-text); }
.ace-edit-count.is-over { color: var(--ace-error-text); font-weight: 600; }
.ace-edit-tools { display: flex; gap: 4px; flex: 0 0 auto; }
.ace-edit-rowerr { flex-basis: 100%; font-size: 12px; color: var(--ace-error-text); }
.ace-edit-rowerr:empty { display: none; }
.ace-edit-row-alt img,
.ace-edit-nothumb { display: block; width: 48px; height: 48px; object-fit: cover; border-radius: 4px; background: var(--ace-surface-3); flex: 0 0 48px; }
.ace-edit-note { margin: 0; font-size: 12px; }
.ace-edit-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.ace-editor .wp-editor-wrap { margin-bottom: 4px; }

/* Review: product images and the live page link (4.20.0). */
.ace-rev-thumb { flex: 0 0 auto; }
.ace-rev-thumb.is-empty { background: var(--ace-surface-3); }
.ace-rev-live { white-space: nowrap; }
.ace-gallery-block { padding: 12px 0 4px; }
.ace-gallery-note { margin: 4px 0 0; font-size: 12px; }
.ace-gallery { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.ace-gallery-item { width: 96px; margin: 0; }
.ace-gallery-item figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ace-gallery-link { display: block; border-radius: var(--ace-radius-md); }
.ace-gallery-link:focus-visible { outline: 2px solid var(--ace-primary); outline-offset: 2px; }
.ace-gallery img {
	display: block;
	width: 96px;
	height: 96px;
	object-fit: cover;
	border-radius: var(--ace-radius-md);
	border: 1px solid var(--ace-border-light);
	background: var(--ace-surface-3);
}
.ace-gallery figcaption { font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
@media (max-width: 782px) {
	.ace-rev-head { flex-wrap: wrap; }
	.ace-rev-actions { flex: 1 1 100%; justify-content: flex-end; }
}

/* Custom fields card (4.24) */
/* Custom fields table (Settings, 4.24.1): the index table components, sized
   to sit inside a settings card rather than on the page. */
.agencoen-wrap .ace-custom-fields { margin-top: 14px; }
.agencoen-wrap .ace-cf-tabs { margin-bottom: 10px; }
.agencoen-wrap .ace-cf-toolbar { padding: 0; border: 0; box-shadow: none; background: none; margin-bottom: 10px; }
.agencoen-wrap .ace-cf-frame { border: 1px solid var(--ace-border-light); border-radius: var(--ace-radius-lg); overflow: hidden; }
.agencoen-wrap .ace-cf-frame .ace-pagination { justify-content: space-between; }
.agencoen-wrap .ace-cf-note { margin: 0; padding: 16px; }
.agencoen-wrap .ace-cf-table td { vertical-align: middle; }
.agencoen-wrap .ace-cf-kind { font-size: 12px; color: var(--ace-subdued); margin-top: 2px; }
.agencoen-wrap .ace-cf-example {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	max-width: 360px;
	color: var(--ace-subdued);
}
.agencoen-wrap .ace-cf-action { text-align: right; white-space: nowrap; }

/* An on/off switch drawn on a native checkbox, so it keeps keyboard and
   screen reader behaviour (role="switch" on the input). The selectors carry
   the input type and the wrapper because WordPress's own admin CSS styles
   every input[type="checkbox"] (size, border, checkmark) with more weight
   than a single class. */
.agencoen-wrap input[type="checkbox"].ace-switch {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	display: inline-block;
	width: 34px;
	min-width: 34px;
	height: 20px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--ace-control-border);
	box-shadow: none;
	cursor: pointer;
	transition: background 0.15s ease;
	vertical-align: middle;
}
.agencoen-wrap input[type="checkbox"].ace-switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease;
}
.agencoen-wrap input[type="checkbox"].ace-switch::before,
.agencoen-wrap input[type="checkbox"].ace-switch:checked::before { content: none; display: none; }
.agencoen-wrap input[type="checkbox"].ace-switch:checked { background: var(--ace-primary); }
.agencoen-wrap input[type="checkbox"].ace-switch:checked::after { transform: translateX(14px); }
.agencoen-wrap input[type="checkbox"].ace-switch:focus { box-shadow: none; outline: none; }
.agencoen-wrap input[type="checkbox"].ace-switch:focus-visible { outline: 2px solid var(--ace-primary); outline-offset: 2px; }
.agencoen-wrap input[type="checkbox"].ace-switch:disabled { opacity: 0.5; cursor: default; }

/* ------------------------------------------------------------------ */
/* Accessibility (4.27.0)                                              */
/* ------------------------------------------------------------------ */

/* One focus ring for everything a keyboard can reach in the plugin's screens. */
.agencoen-wrap a:focus-visible,
.agencoen-wrap button:focus-visible,
.agencoen-wrap summary:focus-visible,
.agencoen-wrap [tabindex]:focus-visible,
.agencoen-wrap input[type="checkbox"]:focus-visible,
.agencoen-wrap input[type="radio"]:focus-visible {
	outline: 2px solid var(--ace-primary);
	outline-offset: 2px;
}
.ace-modal-card:focus { outline: none; }

/* Dashboard chart heading with its help button beside it. */
.ace-chart-head { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; }
.ace-chart-head .ace-h3 { margin: 0; }

/* Two radio buttons that answer one question. */
.ace-radio-group { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; border: 0; min-width: 0; }
.ace-radio-group legend { float: left; margin: 0 6px 0 0; padding: 0; }
.ace-radio-group .ace-label { margin-bottom: 0; }

/* A chart's numbers, behind "Show data table". */
.ace-chart-data { margin-top: 8px; }
.ace-chart-data-table { margin-top: 8px; max-height: 320px; overflow: auto; border: 1px solid var(--ace-border-light); border-radius: var(--ace-radius-md); }
.ace-chart-data-table caption { text-align: left; font-size: 12px; font-weight: 600; color: var(--ace-subdued); padding: 8px 12px 4px; }
.ace-chart-data-table .ace-table th,
.ace-chart-data-table .ace-table td { padding: 6px 12px; font-size: 13px; }
.ace-donut-legend .ace-legend-line { min-height: 24px; }

/* Field formats card and layout previews (4.28.0) */
.agencoen-wrap .ace-ff-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.agencoen-wrap .ace-ff-table td { vertical-align: top; }
.agencoen-wrap .ace-ff-table td .ace-chip { margin-bottom: 4px; }
.agencoen-wrap .ace-ff-card { width: 760px; }
.agencoen-wrap .ace-ff-modes,
.agencoen-wrap .ace-ff-locks { border: 0; margin: 12px 0; padding: 0; min-width: 0; }
.agencoen-wrap .ace-ff-option { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--ace-border-light); border-radius: var(--ace-radius-lg); margin-bottom: 6px; cursor: pointer; }
.agencoen-wrap .ace-ff-option input { margin-top: 3px; flex-shrink: 0; }
.agencoen-wrap .ace-ff-option .ace-help { display: block; margin: 2px 0 0; }
.agencoen-wrap .ace-ff-parts { margin: 6px 0 12px 20px; }
.agencoen-wrap .ace-ff-labels { margin: 6px 0 12px; padding: 0; list-style: none; }
.agencoen-wrap .ace-ff-cap { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ace-subdued); margin: 10px 0 4px; }
.agencoen-wrap .ace-layout-preview { border: 1px solid var(--ace-border-light); border-radius: var(--ace-radius-lg); padding: 10px 12px; background: var(--ace-surface); overflow-wrap: anywhere; }
.agencoen-wrap .ace-layout-preview ul,
.agencoen-wrap .ace-layout-preview ol { margin: 0 0 8px 20px; list-style: revert; }
.agencoen-wrap .ace-layout-preview p { margin: 0 0 8px; }
.agencoen-wrap .ace-ff-template { border: 0; margin: 12px 0; padding: 0; min-width: 0; }
.agencoen-wrap .ace-ff-tpl { margin: 6px 0; padding: 0; list-style: none; }
.agencoen-wrap .ace-ff-tpl-part { border: 1px solid var(--ace-border-light); border-radius: var(--ace-radius-lg); padding: 8px 10px; margin-bottom: 6px; }
.agencoen-wrap .ace-ff-tpl-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.agencoen-wrap .ace-ff-tpl-settings,
.agencoen-wrap .ace-ff-tpl-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 6px; }
.agencoen-wrap .ace-ff-tpl-field { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--ace-subdued); }
.agencoen-wrap .ace-ff-tpl-field input[type="number"] { width: 72px; }
.agencoen-wrap .ace-ff-tpl-wide { flex: 1 1 220px; min-width: 0; }
