// Settings → MCP tab (admin/react/src/components/Settings/tabs/Mcp/).
//
// Ported from the easy.jobs dashboard (Settings → Advanced → MCP) so both
// pages look the same. Every class is `ej-mcp-` prefixed and every rule is
// scoped under `.ej-mcp`, so nothing here can reach another tab or another
// plugin's screen. Icons are inline SVGs (`.ej-mcp-ico`), not an icon font.
.ej-mcp {
	// Every size below is in em, from this base. The dashboard's style.min.css
	// scales html with the screen: 16px, 14px up to 1600px wide, 13px up to
	// 1399px. wp-admin keeps html at a fixed size, so the same steps are set
	// here (breakpoints copied as-is). Body type matches the dashboard's:
	// Poppins 500, Bootstrap's #212529, line-height 1.5.
	font-size: 16px;
	font-family: "Poppins", sans-serif;
	font-weight: 500;
	color: #212529;
	line-height: 1.5;
	letter-spacing: 0;
	// The settings column is a flex item with min-width: auto, so the widest
	// unbreakable thing inside (the capabilities table, even in its scroll
	// box) used to widen the whole column past a phone screen. Containment
	// stops the tab's content from sizing the column; wide parts scroll in
	// their own boxes instead.
	contain: inline-size;
	--ej-mcp-primary: #597dfc;
	--ej-mcp-primary-600: #4468f0;
	--ej-mcp-primary-700: #2756fb;
	--ej-mcp-primary-50: #eef2ff;
	--ej-mcp-primary-100: #e0e7ff;
	--ej-mcp-ring: rgba(89, 125, 252, 0.22);
	--ej-mcp-ink: #1d2339;
	--ej-mcp-ink-2: #454c63;
	--ej-mcp-muted: #667085;
	--ej-mcp-faint: #a3a9bb;
	--ej-mcp-line: #e7eaf3;
	--ej-mcp-line-2: #d6dbe8;
	--ej-mcp-surface-2: #fafbff;
	--ej-mcp-surface-3: #f2f4fb;
	--ej-mcp-ok: #15803d;
	--ej-mcp-ok-bg: #effaf3;
	--ej-mcp-chg: #a2560c;
	--ej-mcp-chg-bg: #fff6ea;
	--ej-mcp-chg-line: #f6d9b1;
	--ej-mcp-chg-dot: #f59e0b;
	--ej-mcp-danger: #b4232f;
	--ej-mcp-pii: #6b4fd3;
	--ej-mcp-pii-bg: #f3f0ff;
	--ej-mcp-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

	@media (max-width: 1600.98px) {
		font-size: 14px;
	}
	@media (max-width: 1399.98px) {
		font-size: 13px;
	}
}

// Every rule below is nested under `.ej-mcp` on purpose. The vendor
// `style.min.css` resets elements as `.easy-page-body button`, `… p`, `… h4`,
// `… section` (specificity 0,1,1), which beats a single `.ej-mcp-x` class and
// squared the tiles, removed margins and broke grids. `.ej-mcp .ej-mcp-x`
// (0,2,0) wins without !important.
.ej-mcp {
	// Base type: the dashboard's `.content-area__body h3/h4/p/label` rules
	// (setting.css), which every element on its MCP page inherits from.
	h3,
	h4,
	p {
		margin: 0;
	}

	h3 {
		font-size: 1.13em;
		font-weight: 500;
		line-height: 1.5em;
		color: #101828;
	}

	h4 {
		font-size: 0.875em;
		font-weight: 500;
		line-height: 1.5em;
		color: #101828;
	}

	label {
		margin: 0;
		font-size: 0.87em;
		font-weight: 500;
		line-height: 1.5em;
		color: #7d8091;
	}

	p {
		font-size: 0.87em;
		font-weight: 400;
		line-height: 1.5em;
		color: #667085;
	}

	// No side padding: `.setting-content` already sets the gutter between the
	// settings sidebar and every tab, so the MCP tab lines up with the others.
	.ej-mcp-body {
		padding: 0 0 30px;
		display: flex;
		flex-direction: column;
		gap: 18px;
	}

	.ej-mcp-lead {
		margin: 0;
		max-width: 760px;
	}

	.ej-mcp-toggle-label {
		cursor: pointer;
		margin: 0;
	}

	/* ── Chips, dots ───────────────────────────────────────────────────────── */
	.ej-mcp-chip {
		display: inline-flex;
		align-items: center;
		gap: 5px;
		height: 22px;
		padding: 0 8px;
		border: 1px solid transparent;
		border-radius: 999px;
		font-size: 0.77em;
		font-weight: 500;
		line-height: 1;
		white-space: nowrap;
	}
	.ej-mcp-chip .ej-mcp-ico {
		font-size: 0.95em;
	}
	.ej-mcp-chip.ok {
		background: var(--ej-mcp-ok-bg);
		color: var(--ej-mcp-ok);
	}
	.ej-mcp-chip.muted {
		background: var(--ej-mcp-surface-3);
		color: var(--ej-mcp-muted);
	}
	.ej-mcp-chip.view {
		background: var(--ej-mcp-primary-50);
		color: var(--ej-mcp-primary-600);
	}
	.ej-mcp-chip.chg {
		background: var(--ej-mcp-chg-bg);
		border-color: var(--ej-mcp-chg-line);
		color: var(--ej-mcp-chg);
	}
	.ej-mcp-chip.pii {
		background: var(--ej-mcp-pii-bg);
		color: var(--ej-mcp-pii);
	}

	.ej-mcp-dot {
		width: 7px;
		height: 7px;
		border-radius: 50%;
		flex: none;
		background: var(--ej-mcp-faint);
	}
	.ej-mcp-dot.ok {
		background: #22c55e;
		box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
	}
	.ej-mcp-chip .ej-mcp-dot {
		width: 6px;
		height: 6px;
		box-shadow: none;
	}
	.ej-mcp-chip.ok .ej-mcp-dot {
		background: #22c55e;
	}

	/* ── Notes ─────────────────────────────────────────────────────────────── */
	.ej-mcp-note {
		display: flex;
		gap: 12px;
		align-items: flex-start;
		padding: 13px 16px;
		border: 1px solid var(--ej-mcp-line-2);
		border-radius: 12px;
		background: var(--ej-mcp-surface-2);
		font-size: 0.87em;
		font-weight: 400;
		line-height: 1.55;
		color: var(--ej-mcp-muted);
	}
	.ej-mcp-note b {
		display: block;
		color: var(--ej-mcp-ink);
		font-weight: 500;
	}
	.ej-mcp-note .ej-mcp-ico {
		color: var(--ej-mcp-muted);
		margin-top: 2px;
		font-size: 1.15em;
	}

	/* ── Cards ─────────────────────────────────────────────────────────────── */
	.ej-mcp-card {
		background: #fff;
		border: 1px solid var(--ej-mcp-line);
		border-radius: 14px;
		box-shadow: 0 1px 2px rgba(28, 34, 56, 0.05);
		overflow: hidden;
	}
	.ej-mcp-card__head {
		display: flex;
		align-items: flex-start;
		gap: 16px;
		padding: 16px 18px 14px;
	}
	.ej-mcp-card__head .grow {
		flex: 1;
		min-width: 0;
	}
	.ej-mcp-card__head h4 {
		margin: 0;
		font-size: 1.07em;
		font-weight: 500;
		color: var(--ej-mcp-ink);
	}
	.ej-mcp-card__head p {
		margin: 3px 0 0;
	}
	.ej-mcp-card__foot {
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		gap: 8px;
		padding: 11px 18px;
		border-top: 1px solid var(--ej-mcp-line);
		font-size: 0.83em;
		font-weight: 400;
		color: var(--ej-mcp-muted);
	}
	.ej-mcp-card__foot b {
		color: var(--ej-mcp-ink);
		font-weight: 500;
	}

	/* ── Buttons ───────────────────────────────────────────────────────────── */
	.ej-mcp-btn {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 6px;
		height: 36px;
		padding: 0 14px;
		border: 1px solid transparent;
		border-radius: 9px;
		background: var(--ej-mcp-surface-3);
		color: var(--ej-mcp-ink);
		font-size: 0.87em;
		font-weight: 500;
		line-height: 1;
		white-space: nowrap;
		cursor: pointer;
		text-decoration: none;
		transition:
			background 0.15s,
			border-color 0.15s,
			color 0.15s;
	}
	.ej-mcp-btn.sm {
		height: 30px;
		padding: 0 10px;
		font-size: 0.83em;
		border-radius: 8px;
	}
	.ej-mcp-btn .ej-mcp-ico {
		font-size: 0.95em;
	}
	.ej-mcp-btn.primary {
		background: var(--ej-mcp-primary);
		color: #fff;
		box-shadow:
			0 1px 2px rgba(28, 34, 56, 0.12),
			0 8px 18px -10px rgba(89, 125, 252, 0.85);
	}
	.ej-mcp-btn.primary:hover {
		background: var(--ej-mcp-primary-700);
		color: #fff;
	}
	.ej-mcp-btn.secondary {
		background: #fff;
		border-color: var(--ej-mcp-line-2);
		color: var(--ej-mcp-ink);
		box-shadow: 0 1px 2px rgba(28, 34, 56, 0.05);
	}
	.ej-mcp-btn.secondary:hover {
		background: var(--ej-mcp-surface-2);
		color: var(--ej-mcp-ink);
	}
	.ej-mcp-btn.ghost {
		background: transparent;
		color: var(--ej-mcp-ink-2);
	}
	.ej-mcp-btn.ghost:hover {
		background: var(--ej-mcp-surface-3);
	}
	.ej-mcp-btn.danger {
		color: var(--ej-mcp-danger);
	}
	.ej-mcp-btn:focus-visible,
	.ej-mcp-atile:focus-visible,
	.ej-mcp-atab:focus-visible,
	.ej-mcp-iconbtn:focus-visible {
		outline: 3px solid var(--ej-mcp-ring);
		outline-offset: 2px;
	}
	.ej-mcp-btn[disabled] {
		opacity: 0.55;
		cursor: not-allowed;
		box-shadow: none;
	}

	.ej-mcp-iconbtn {
		display: grid;
		place-items: center;
		width: 30px;
		height: 30px;
		border: 0;
		border-radius: 8px;
		background: none;
		color: var(--ej-mcp-muted);
		cursor: pointer;
	}
	.ej-mcp-iconbtn:hover {
		background: var(--ej-mcp-surface-3);
		color: var(--ej-mcp-ink);
	}

	/* ── Assistant logos ───────────────────────────────────────────────────── */
	.ej-mcp-logo {
		position: relative;
		display: inline-grid;
		place-items: center;
		flex: none;
		width: 28px;
		height: 28px;
		border-radius: 8px;
		background: #fff;
		border: 1px solid var(--ej-mcp-line);
	}
	.ej-mcp-logo img {
		display: block;
		width: 100%;
		height: 100%;
		border-radius: inherit;
		object-fit: cover;
	}
	.ej-mcp-logo.is-cover {
		border: 0;
	}
	.ej-mcp-logo.is-contain img {
		width: 70%;
		height: 70%;
		object-fit: contain;
	}
	.ej-mcp-logo.is-other {
		background: var(--ej-mcp-surface-3);
		border-color: var(--ej-mcp-line-2);
		color: var(--ej-mcp-ink-2);
	}
	.ej-mcp-logo.lg {
		width: 40px;
		height: 40px;
		border-radius: 11px;
	}
	.ej-mcp-logo.md {
		width: 36px;
		height: 36px;
		border-radius: 10px;
	}
	.ej-mcp-logo.lg.is-other .ej-mcp-ico {
		font-size: 1.4em;
	}
	.ej-mcp-logo.sm {
		width: 22px;
		height: 22px;
		border-radius: 6px;
	}
	.ej-mcp-logo.sm.is-other .ej-mcp-ico {
		font-size: 0.85em;
	}
	.ej-mcp-logo__badge {
		position: absolute;
		right: -4px;
		bottom: -4px;
		display: grid;
		place-items: center;
		width: 16px;
		height: 16px;
		border-radius: 5px;
		border: 1.5px solid #fff;
		background: #1f2433;
		color: #fff;
		font: 700 8px/1 var(--ej-mcp-mono);
	}
	.ej-mcp-logo.sm .ej-mcp-logo__badge {
		width: 12px;
		height: 12px;
		right: -3px;
		bottom: -3px;
		border-radius: 4px;
		font-size: 6px;
	}

	/* ── Connect: URL field, first-run gallery, connected bar + panel ─────── */
	.ej-mcp-flabel {
		display: flex;
		justify-content: space-between;
		gap: 12px;
		margin: 0 0 6px;
		font-size: 0.83em;
		font-weight: 500;
		color: var(--ej-mcp-ink);
	}
	.ej-mcp-flabel em {
		font-style: normal;
		font-weight: 400;
		color: var(--ej-mcp-muted);
	}

	.ej-mcp-copyfield {
		display: flex;
		align-items: center;
		gap: 8px;
		min-width: 0;
		padding: 5px 5px 5px 12px;
		border: 1px solid var(--ej-mcp-line-2);
		border-radius: 10px;
		background: var(--ej-mcp-surface-2);
	}
	.ej-mcp-copyfield code {
		flex: 1;
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		background: none;
		padding: 0;
		color: var(--ej-mcp-ink);
		font: 400 0.87em var(--ej-mcp-mono);
	}
	.ej-mcp-copyfield code.is-placeholder,
	.ej-mcp-code pre.is-placeholder {
		font-style: italic;
		opacity: 0.75;
	}
	.ej-mcp-copyfield .ej-mcp-btn {
		flex: none;
	}

	.ej-mcp-hero__hd {
		padding: 20px 20px 0;
	}
	.ej-mcp-hero__hd h4 {
		margin: 0 0 4px;
		font-size: 1.2em;
		font-weight: 500;
		color: var(--ej-mcp-ink);
	}
	.ej-mcp-hero__hd p {
		margin: 0;
	}
	.ej-mcp-hero__url {
		padding: 16px 20px 18px;
	}
	.ej-mcp-hero__url .ej-mcp-copyfield {
		max-width: 560px;
	}
	.ej-mcp-hero__pick {
		padding: 0 20px;
	}

	.ej-mcp-gallery {
		display: grid;
		grid-template-columns: repeat(6, minmax(0, 1fr));
		gap: 10px;
		padding: 0 0 18px;
	}
	.ej-mcp-atile {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 6px;
		min-width: 0;
		padding: 14px 6px 12px;
		border: 1px solid var(--ej-mcp-line);
		border-radius: 12px;
		background: #fff;
		text-align: center;
		cursor: pointer;
		transition:
			border-color 0.15s,
			background 0.15s,
			box-shadow 0.15s;
	}
	.ej-mcp-atile:hover {
		border-color: var(--ej-mcp-line-2);
		background: var(--ej-mcp-surface-2);
	}
	.ej-mcp-atile[aria-pressed="true"] {
		border-color: var(--ej-mcp-primary);
		background: var(--ej-mcp-primary-50);
		box-shadow: 0 0 0 3px var(--ej-mcp-ring);
	}
	.ej-mcp-atile .ej-mcp-logo {
		margin-bottom: 4px;
	}
	.ej-mcp-atile b {
		font-size: 0.87em;
		font-weight: 500;
		color: var(--ej-mcp-ink);
		white-space: nowrap;
	}
	.ej-mcp-atile small {
		font-size: 0.77em;
		font-weight: 400;
		color: var(--ej-mcp-muted);
		white-space: nowrap;
	}

	.ej-mcp-cbar {
		display: flex;
		align-items: center;
		gap: 14px;
		padding: 12px 14px;
	}
	.ej-mcp-cbar__label {
		font-size: 0.87em;
		font-weight: 500;
		color: var(--ej-mcp-ink);
		white-space: nowrap;
	}
	.ej-mcp-cbar .ej-mcp-copyfield {
		flex: 1;
		max-width: 520px;
	}
	.ej-mcp-cbar__open {
		margin-left: auto;
		flex: none;
	}
	.ej-mcp-cbar__open.is-open {
		background: var(--ej-mcp-primary-50);
		border-color: var(--ej-mcp-primary-100);
		color: var(--ej-mcp-primary-600);
	}

	.ej-mcp-cpanel {
		border-top: 1px solid var(--ej-mcp-line);
	}
	.ej-mcp-cpanel__hd {
		display: flex;
		align-items: flex-start;
		gap: 12px;
		padding: 14px 18px 0;
	}
	.ej-mcp-cpanel__hd > div {
		flex: 1;
	}
	.ej-mcp-cpanel__hd b {
		display: block;
		font-size: 1.07em;
		font-weight: 500;
		color: var(--ej-mcp-ink);
	}
	.ej-mcp-cpanel__hd span {
		font-size: 0.83em;
		font-weight: 400;
		color: var(--ej-mcp-muted);
	}
	.ej-mcp-atabs {
		display: flex;
		gap: 6px;
		padding: 12px 18px 14px;
		overflow-x: auto;
	}
	.ej-mcp-atab {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		height: 36px;
		padding: 0 12px 0 7px;
		border: 1px solid var(--ej-mcp-line);
		border-radius: 999px;
		background: #fff;
		color: var(--ej-mcp-ink-2);
		font-size: 0.87em;
		font-weight: 500;
		white-space: nowrap;
		cursor: pointer;
	}
	.ej-mcp-atab:hover {
		background: var(--ej-mcp-surface-2);
	}
	.ej-mcp-atab[aria-selected="true"] {
		border-color: var(--ej-mcp-primary);
		background: var(--ej-mcp-primary-50);
		color: var(--ej-mcp-primary-600);
	}

	/* how-to: steps on the left, the URL note or a code box on the right */
	.ej-mcp-howto {
		padding: 18px 20px 20px;
		border-top: 1px solid var(--ej-mcp-line);
		background: var(--ej-mcp-surface-2);
	}
	.ej-mcp-howto__grid {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 24px;
		align-items: start;
	}
	.ej-mcp-steps {
		list-style: none;
		margin: 0;
		padding: 0;
		display: grid;
		gap: 12px;
		counter-reset: ej-mcp-step;
	}
	.ej-mcp-steps li {
		display: grid;
		grid-template-columns: 24px minmax(0, 1fr);
		gap: 10px;
		font-size: 0.87em;
		font-weight: 400;
		line-height: 1.6;
		color: var(--ej-mcp-muted);
		counter-increment: ej-mcp-step;
	}
	.ej-mcp-steps li::before {
		content: counter(ej-mcp-step);
		display: grid;
		place-items: center;
		width: 24px;
		height: 24px;
		border: 1px solid var(--ej-mcp-line-2);
		border-radius: 50%;
		background: #fff;
		color: var(--ej-mcp-ink);
		font-size: 0.9em;
		font-weight: 500;
	}
	.ej-mcp-steps b {
		color: var(--ej-mcp-ink);
		font-weight: 500;
	}
	.ej-mcp-steps code {
		padding: 1px 6px;
		border: 1px solid var(--ej-mcp-line);
		border-radius: 5px;
		background: #fff;
		color: var(--ej-mcp-ink);
		font: 400 0.9em var(--ej-mcp-mono);
	}

	.ej-mcp-code {
		min-width: 0;
		overflow: hidden;
		border: 1px solid #232945;
		border-radius: 10px;
		background: #141829;
	}
	.ej-mcp-code__hd {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
		padding: 6px 6px 6px 12px;
		border-bottom: 1px solid #232945;
		color: #9aa3c7;
		font-family: var(--ej-mcp-mono);
	}
	.ej-mcp-code__hd > span {
		font-size: 0.8em;
		font-weight: 400;
	}
	.ej-mcp-code__hd .ej-mcp-btn {
		background: #1d2238;
		border-color: #2c3354;
		color: #dfe5ff;
	}
	.ej-mcp-code__hd .ej-mcp-btn:hover {
		background: #252b46;
	}
	.ej-mcp-code pre {
		margin: 0;
		padding: 12px 14px;
		overflow-x: auto;
		background: none;
		border: 0;
		color: #dfe5ff;
		font: 400 0.85em/1.65 var(--ej-mcp-mono);
		white-space: pre;
	}
	.ej-mcp-oneclick {
		display: flex;
		align-items: center;
		gap: 10px;
		flex-wrap: wrap;
		margin-top: 10px;
	}
	.ej-mcp-oneclick small {
		font-size: 0.8em;
		font-weight: 400;
		color: var(--ej-mcp-muted);
	}

	.ej-mcp-usebox {
		display: grid;
		gap: 10px;
		justify-items: start;
		padding: 14px 16px;
		border: 1px solid var(--ej-mcp-line);
		border-radius: 10px;
		background: #fff;
	}
	.ej-mcp-usebox b {
		display: block;
		font-size: 0.93em;
		font-weight: 500;
		color: var(--ej-mcp-ink);
	}
	.ej-mcp-usebox span,
	.ej-mcp-usebox small {
		display: block;
		font-size: 0.87em;
		font-weight: 400;
		line-height: 1.5;
		color: var(--ej-mcp-muted);
	}
	.ej-mcp-usebox small b {
		display: inline;
		font-size: inherit;
		font-weight: 500;
		color: var(--ej-mcp-ink);
	}
	.ej-mcp-usebox__actions {
		display: flex;
		align-items: center;
		gap: 14px;
		flex-wrap: wrap;
	}
	.ej-mcp-guide {
		display: inline-flex;
		align-items: center;
		gap: 5px;
		font-size: 0.83em;
		font-weight: 500;
		color: var(--ej-mcp-primary);
	}
	.ej-mcp-guide .ej-mcp-ico {
		font-size: 0.8em;
	}
	.ej-mcp-guide:hover {
		color: var(--ej-mcp-primary-700);
	}

	.ej-mcp-assure {
		display: flex;
		gap: 9px;
		align-items: flex-start;
		margin: 16px 0 0;
		padding: 10px 12px;
		border: 1px solid var(--ej-mcp-line);
		border-radius: 10px;
		background: #fff;
	}
	.ej-mcp-assure .ej-mcp-ico {
		color: var(--ej-mcp-ok);
		margin-top: 2px;
	}

	/* ── Overview ──────────────────────────────────────────────────────────── */
	.ej-mcp-stats {
		display: grid;
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
	.ej-mcp-stat {
		padding: 14px 18px;
		border-left: 1px solid var(--ej-mcp-line);
	}
	.ej-mcp-stat:first-child {
		border-left: 0;
	}
	.ej-mcp-stat__k {
		font-size: 0.87em;
		font-weight: 400;
		color: var(--ej-mcp-muted);
	}
	.ej-mcp-stat__v {
		margin-top: 2px;
		font-size: 1.75em;
		font-weight: 500;
		letter-spacing: -0.02em;
		color: var(--ej-mcp-ink);
		font-variant-numeric: tabular-nums;
	}
	.ej-mcp-stat__s {
		font-size: 0.8em;
		font-weight: 400;
		color: var(--ej-mcp-muted);
	}
	.ej-mcp-stat__s .is-bad {
		color: var(--ej-mcp-danger);
		font-weight: 500;
	}

	/* ── Connections ───────────────────────────────────────────────────────── */
	.ej-mcp-conn {
		list-style: none;
		margin: 0;
		padding: 0;
	}
	.ej-mcp-conn__row {
		display: grid;
		grid-template-columns:
			minmax(0, 1.35fr) minmax(0, 0.7fr) minmax(0, 1.5fr) minmax(0, 1fr)
			96px;
		gap: 16px;
		align-items: center;
		padding: 14px 18px;
		border-top: 1px solid var(--ej-mcp-line);
	}
	.ej-mcp-conn__head {
		padding: 9px 18px;
		background: var(--ej-mcp-surface-2);
		font-size: 0.75em;
		font-weight: 500;
		letter-spacing: 0.05em;
		text-transform: uppercase;
		color: var(--ej-mcp-faint);
	}
	.ej-mcp-conn.is-paused .ej-mcp-conn__row {
		opacity: 0.55;
	}
	.ej-mcp-conn__app {
		display: flex;
		align-items: center;
		gap: 12px;
		min-width: 0;
	}
	.ej-mcp-conn__app > div {
		min-width: 0;
	}
	.ej-mcp-conn__app b {
		display: block;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		font-size: 0.93em;
		font-weight: 500;
		color: var(--ej-mcp-ink);
	}
	.ej-mcp-conn__app small {
		display: flex;
		align-items: center;
		gap: 6px;
		font-size: 0.8em;
		font-weight: 400;
		color: var(--ej-mcp-muted);
	}
	.ej-mcp-initial {
		display: grid;
		place-items: center;
		flex: none;
		width: 36px;
		height: 36px;
		border-radius: 10px;
		background: linear-gradient(140deg, #5a6075, #3b4052);
		color: #fff;
		font-size: 1.05em;
		font-weight: 600;
	}
	.ej-mcp-conn__who {
		font-size: 0.87em;
		font-weight: 400;
		color: var(--ej-mcp-ink-2);
	}
	.ej-mcp-conn__access {
		display: flex;
		gap: 6px;
		flex-wrap: wrap;
		min-width: 0;
	}
	/* A chip never spills into the next column: it shortens with an ellipsis instead. */
	.ej-mcp-conn__access .ej-mcp-chip {
		max-width: 100%;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.ej-mcp-conn__used {
		font-size: 0.87em;
		font-weight: 400;
		color: var(--ej-mcp-ink-2);
	}
	.ej-mcp-conn__used span {
		display: block;
		font-size: 0.92em;
		color: var(--ej-mcp-muted);
	}
	.ej-mcp-conn__act {
		display: flex;
		justify-content: flex-end;
	}

	/* ── Activity ──────────────────────────────────────────────────────────── */
	.ej-mcp-act {
		display: grid;
		grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
	}
	.ej-mcp-act__chart {
		padding: 16px 18px 14px;
		border-right: 1px solid var(--ej-mcp-line);
	}
	.ej-mcp-act__top {
		padding: 16px 18px;
	}
	.ej-mcp-act__hd {
		display: flex;
		align-items: baseline;
		gap: 10px;
	}
	.ej-mcp-act__hd h4 {
		margin: 0;
		font-size: 1.07em;
		font-weight: 500;
		color: var(--ej-mcp-ink);
	}
	.ej-mcp-act__hd span {
		font-size: 0.83em;
		font-weight: 400;
		color: var(--ej-mcp-muted);
	}
	.ej-mcp-bars {
		display: flex;
		align-items: stretch;
		gap: 3px;
		height: 120px;
		margin: 14px 0 6px;
		padding-bottom: 1px;
		border-bottom: 1px solid var(--ej-mcp-line);
	}
	.ej-mcp-bars i {
		flex: 1;
		display: flex;
		align-items: flex-end;
		min-width: 0;
		border-radius: 3px 3px 0 0;
		background: var(--ej-mcp-surface-3);
	}
	.ej-mcp-bars s {
		display: block;
		width: 100%;
		border-radius: 3px 3px 0 0;
		background: var(--ej-mcp-primary);
		opacity: 0.85;
	}
	.ej-mcp-bars-x {
		display: flex;
		justify-content: space-between;
		font-size: 0.75em;
		font-weight: 400;
		color: var(--ej-mcp-faint);
	}
	.ej-mcp-top {
		list-style: none;
		margin: 12px 0 0;
		padding: 0;
		display: grid;
		gap: 9px;
	}
	.ej-mcp-top li {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 34px;
		gap: 4px 10px;
		align-items: center;
		font-size: 0.87em;
		font-weight: 400;
	}
	.ej-mcp-top li > span:first-child {
		display: flex;
		align-items: center;
		gap: 7px;
		min-width: 0;
		color: var(--ej-mcp-ink);
	}
	.ej-mcp-top .t {
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.ej-mcp-top em {
		flex: none;
		font-style: normal;
		font-size: 0.88em;
		color: var(--ej-mcp-chg);
	}
	.ej-mcp-top li > b {
		text-align: right;
		font-size: 0.95em;
		font-weight: 500;
		color: var(--ej-mcp-ink-2);
		font-variant-numeric: tabular-nums;
	}
	.ej-mcp-track {
		grid-column: 1 / -1;
		height: 5px;
		overflow: hidden;
		border-radius: 999px;
		background: var(--ej-mcp-surface-3);
	}
	.ej-mcp-track i {
		display: block;
		height: 100%;
		border-radius: 999px;
		background: var(--ej-mcp-primary);
	}
	.ej-mcp-top .is-chg .ej-mcp-track i {
		background: var(--ej-mcp-chg-dot);
	}
	.ej-mcp-cdot {
		flex: none;
		width: 7px;
		height: 7px;
		border-radius: 50%;
		background: var(--ej-mcp-primary);
	}
	.ej-mcp-top .is-chg .ej-mcp-cdot {
		background: var(--ej-mcp-chg-dot);
	}

	/* ── What's possible ───────────────────────────────────────────────────── */
	.ej-mcp-caps-sum {
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		gap: 8px;
		margin-top: 10px;
	}
	.ej-mcp-tablewrap {
		overflow-x: auto;
	}
	.ej-mcp-caps {
		width: 100%;
		border-collapse: collapse;
	}
	.ej-mcp-caps th {
		padding: 10px 18px;
		border-top: 1px solid var(--ej-mcp-line);
		border-bottom: 1px solid var(--ej-mcp-line);
		background: var(--ej-mcp-surface-2);
		text-align: left;
		font-size: 0.75em;
		font-weight: 500;
		letter-spacing: 0.05em;
		text-transform: uppercase;
		color: var(--ej-mcp-faint);
	}
	.ej-mcp-caps th:first-child {
		width: 52%;
	}
	.ej-mcp-caps td {
		padding: 12px 18px;
		border-bottom: 1px solid var(--ej-mcp-line);
		font-size: 0.87em;
		font-weight: 400;
		vertical-align: middle;
	}
	.ej-mcp-caps tr:last-child td {
		border-bottom: 0;
	}
	.ej-mcp-area {
		display: flex;
		align-items: center;
		gap: 12px;
	}
	.ej-mcp-area__icon {
		display: grid;
		place-items: center;
		flex: none;
		width: 32px;
		height: 32px;
		border-radius: 8px;
		background: var(--ej-mcp-surface-3);
		color: var(--ej-mcp-ink-2);
		font-size: 1.2em;
	}
	.ej-mcp-area b {
		display: flex;
		align-items: center;
		gap: 8px;
		font-size: 1.07em;
		font-weight: 500;
		color: var(--ej-mcp-ink);
	}
	.ej-mcp-area small {
		display: block;
		font-size: 0.92em;
		line-height: 1.45;
		color: var(--ej-mcp-muted);
	}
	.ej-mcp-pii {
		font-size: 0.8em;
		font-weight: 500;
		color: var(--ej-mcp-pii);
	}
	.ej-mcp-capcell {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		color: var(--ej-mcp-ink-2);
		white-space: nowrap;
	}
	.ej-mcp-capcell .ej-mcp-ico {
		color: var(--ej-mcp-ok);
		font-size: 0.8em;
	}
	.ej-mcp-capcell.chg .ej-mcp-ico {
		color: var(--ej-mcp-chg-dot);
	}
	.ej-mcp-capcell.none {
		color: var(--ej-mcp-faint);
	}
	.ej-mcp-guards {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		border-top: 1px solid var(--ej-mcp-line);
	}
	.ej-mcp-guard {
		display: flex;
		gap: 10px;
		padding: 14px 18px;
		border-left: 1px solid var(--ej-mcp-line);
		font-size: 0.83em;
		font-weight: 400;
		line-height: 1.5;
		color: var(--ej-mcp-muted);
	}
	.ej-mcp-guard:first-child {
		border-left: 0;
	}
	.ej-mcp-guard b {
		display: block;
		margin-bottom: 2px;
		font-size: 1.05em;
		font-weight: 500;
		color: var(--ej-mcp-ink);
	}
	.ej-mcp-guard .ej-mcp-ico {
		color: var(--ej-mcp-primary);
		margin-top: 3px;
	}

	/* ── Free plan: MCP is Pro-only ───────────────────────────────────────── */
	/* The notice sits between the header and the body. */
	&.ej-mcp--locked .ej-mcp-head__switch {
		opacity: 0.6;
	}
	&.ej-mcp--locked .ej-mcp-switch {
		cursor: not-allowed;
	}

	/* ── Responsive ────────────────────────────────────────────────────────── */
	@media (max-width: 1199px) {
		.ej-mcp-gallery {
			grid-template-columns: repeat(3, minmax(0, 1fr));
		}
		.ej-mcp-conn__head {
			display: none;
		}
		.ej-mcp-conn__row {
			grid-template-columns: minmax(0, 1fr) auto;
			gap: 8px 16px;
		}
		.ej-mcp-conn__who,
		.ej-mcp-conn__used {
			grid-column: 1 / 2;
		}
		.ej-mcp-conn__access {
			grid-column: 1 / -1;
		}
		.ej-mcp-conn__act {
			grid-column: 2 / 3;
			grid-row: 1 / 2;
		}
	}
	@media (max-width: 991px) {
		.ej-mcp-body {
			padding: 0 0 24px;
		}
		.ej-mcp-stats {
			grid-template-columns: repeat(2, minmax(0, 1fr));
		}
		.ej-mcp-stat:nth-child(3) {
			border-left: 0;
		}
		.ej-mcp-stat:nth-child(n + 3) {
			border-top: 1px solid var(--ej-mcp-line);
		}
		.ej-mcp-howto__grid,
		.ej-mcp-act {
			grid-template-columns: minmax(0, 1fr);
		}
		.ej-mcp-act__chart {
			border-right: 0;
			border-bottom: 1px solid var(--ej-mcp-line);
		}
		.ej-mcp-guards {
			grid-template-columns: minmax(0, 1fr);
		}
		.ej-mcp-guard {
			border-left: 0;
			border-top: 1px solid var(--ej-mcp-line);
		}
		.ej-mcp-guard:first-child {
			border-top: 0;
		}
		.ej-mcp-cbar {
			flex-wrap: wrap;
		}
		.ej-mcp-cbar .ej-mcp-copyfield {
			flex-basis: 100%;
			max-width: none;
			order: 3;
		}
	}
	@media (max-width: 575px) {
		.ej-mcp-body {
			padding: 0 0 20px;
		}
		.ej-mcp-gallery {
			grid-template-columns: repeat(2, minmax(0, 1fr));
		}
		.ej-mcp-card__head {
			flex-wrap: wrap;
		}
	}

	/* ── Header and switch ─────────────────────────────────────────────────
	   The dashboard builds these from global utilities (`add-item--wrapper
	   p20-30 flex …`, `.toggle-wrap` / `.slider` in setting.css); the values
	   below are those rules. wp-admin has none of them. The dashboard's 30px
   side padding is dropped here: `.setting-content` already gives every tab
   its gutter from the settings sidebar. */
	.ej-mcp-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		flex-wrap: wrap;
		gap: 16px;
		padding: 20px 0;
	}
	.ej-mcp-head__title {
		display: flex;
		align-items: center;
		gap: 12px;
		max-width: 550px;
	}
	.ej-mcp-head__switch {
		display: flex;
		align-items: center;
		gap: 12px;
	}
	.ej-mcp-head__switch label.ej-mcp-toggle-label {
		cursor: pointer;
	}

	.ej-mcp-switch {
		position: relative;
		display: inline-block;
		flex: none;
		width: 44px;
		min-width: 44px;
		height: 24px;
		margin: 0;
		font-size: 0.7em;
	}
	// The input stays in the label (click + keyboard focus) but draws nothing:
	// wp-admin paints its own checkbox (border, ::before tick) on every
	// input[type=checkbox], which showed through as an overlay on the knob.
	.ej-mcp-switch input {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 12px;
		background: none;
		box-shadow: none;
		opacity: 0;
		appearance: none;
		-webkit-appearance: none;
		cursor: pointer;
		z-index: 1;
	}
	.ej-mcp-switch input::before,
	.ej-mcp-switch input::after {
		content: none;
		display: none;
	}
	// Off state: a white track with a light #d0d5dd edge and a soft grey knob.
	// The dashboard's plain #f2f4f7 track with a white knob is ~1.05:1 against
	// the settings page (#f5f7fd), so "off" was close to invisible. The white
	// track lifts the switch off the page, and the knob (#8a94a6, 3.06:1 on
	// white) carries the state. "On" keeps the dashboard look. The edge is an
	// inset shadow, so the switch keeps its size.
	.ej-mcp-slider {
		position: absolute;
		inset: 0;
		border-radius: 12px;
		background-color: #fff;
		box-shadow: inset 0 0 0 1px #d0d5dd;
		transition:
			background-color 0.35s ease-in-out,
			box-shadow 0.2s ease-in-out;
	}
	.ej-mcp-slider::before {
		content: "";
		position: absolute;
		left: 2px;
		bottom: 2px;
		width: 20px;
		height: 20px;
		border-radius: 50%;
		background-color: #8a94a6;
		box-shadow: 0 1px 2px 0 #1018281a;
		transition:
			transform 0.25s ease-in-out,
			background-color 0.25s ease-in-out;
	}
	// Not while focused: this selector outranks the focus ring below.
	.ej-mcp-switch:hover
		input:not(:checked):not(:disabled):not(:focus-visible)
		+ .ej-mcp-slider {
		box-shadow: inset 0 0 0 1px #98a2b3;
	}
	.ej-mcp-switch input:checked + .ej-mcp-slider {
		background-color: #597dfc;
		box-shadow: none;
	}
	.ej-mcp-switch input:checked + .ej-mcp-slider::before {
		transform: translateX(20px);
		background-color: #fff;
		box-shadow:
			0 1px 2px 0 #1018280f,
			0 1px 3px 0 #1018281a;
	}
	// Keyboard focus: a 2px primary ring outside the track (the old #ebefff
	// halo was ~1:1 on this page). Off keeps its edge inside the ring.
	.ej-mcp-switch input:focus-visible + .ej-mcp-slider {
		box-shadow:
			inset 0 0 0 1px #d0d5dd,
			0 0 0 2px #fff,
			0 0 0 4px #597dfc;
	}
	.ej-mcp-switch input:checked:focus-visible + .ej-mcp-slider {
		box-shadow:
			0 0 0 2px #fff,
			0 0 0 4px #597dfc;
	}
	.ej-mcp-switch input:disabled {
		cursor: not-allowed;
	}
	.ej-mcp-switch input:checked:disabled + .ej-mcp-slider {
		opacity: 0.5;
	}
	// Saving: the knob carries a small spinner and nothing is dimmed, so the
	// switch does not flash grey while the request runs.
	.ej-mcp-switch.is-busy input:checked:disabled + .ej-mcp-slider {
		opacity: 1;
	}
	.ej-mcp-switch.is-busy input {
		cursor: progress;
	}
	.ej-mcp-switch.is-busy .ej-mcp-slider::after {
		content: "";
		position: absolute;
		left: 6px;
		bottom: 6px;
		width: 12px;
		height: 12px;
		box-sizing: border-box;
		border: 2px solid #d0d5dd;
		border-top-color: #597dfc;
		border-radius: 50%;
		animation: ej-mcp-spin 0.7s linear infinite;
		transition: translate 0.25s ease-in-out;
	}
	// Follow the knob with `translate`, never `transform`: the spin animation
	// owns `transform`, and a translateX here became the animation's implicit
	// `from` frame, so the ring slid right-to-left instead of spinning.
	.ej-mcp-switch.is-busy input:checked + .ej-mcp-slider::after {
		translate: 20px 0;
	}
	// The off knob is grey, so the ring turns white there to stay visible.
	.ej-mcp-switch.is-busy input:not(:checked) + .ej-mcp-slider::after {
		border-color: #ffffff73;
		border-top-color: #fff;
	}

	.ej-mcp-ico {
		display: inline-block;
		flex: none;
		height: 1em;
		vertical-align: -0.125em;
	}

	code,
	pre {
		box-sizing: border-box;
	}
	button {
		font-family: inherit;
		font-weight: 400;
	}
	.ej-mcp-btn:focus {
		box-shadow: none;
	}

	// First-load skeleton, shaped like the first-run page. White cards (same
	// edge as .ej-mcp-card) lift it off the #f5f7fd page; the "bones" are a
	// light #eef1f6 with a #f7f8fb shimmer, so it reads clearly without
	// looking heavy. The old plain #f2f4fb bars were ~1.03:1 on the page.
	.ej-mcp-skeleton {
		display: flex;
		flex-direction: column;
		gap: 18px;
		padding: 0 0 30px;
	}
	.ej-mcp-sr {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}
	.ej-mcp-bone {
		display: block;
		height: 12px;
		border-radius: 6px;
		background: linear-gradient(
			90deg,
			#eef1f6 25%,
			#f7f8fb 50%,
			#eef1f6 75%
		);
		background-size: 200% 100%;
		animation: ej-mcp-shimmer 1.4s infinite linear;
	}
	.ej-mcp-bone.is-title {
		height: 18px;
	}
	.ej-mcp-bone.is-field {
		width: min(560px, 100%);
		height: 40px;
		margin: 6px 0 4px;
		border-radius: 10px;
	}
	.ej-mcp-bone.is-logo {
		width: 36px;
		height: 36px;
		border-radius: 10px;
	}
	.ej-mcp-bone.is-num {
		flex: none;
		width: 22px;
		height: 22px;
		border-radius: 50%;
	}
	.ej-mcp-bone.is-chip {
		display: inline-block;
		width: 64px;
		height: 22px;
		border-radius: 999px;
		vertical-align: middle;
	}
	.ej-mcp-bone.is-switch {
		flex: none;
		width: 44px;
		height: 24px;
		border-radius: 12px;
	}
	.ej-mcp-skel-lede {
		display: flex;
		flex-direction: column;
		gap: 8px;
		max-width: 760px;
	}
	.ej-mcp-skel-card {
		display: flex;
		flex-direction: column;
		gap: 10px;
		padding: 20px;
		background: #fff;
		border: 1px solid var(--ej-mcp-line);
		border-radius: 14px;
		box-shadow: 0 1px 2px rgba(28, 34, 56, 0.05);
	}
	.ej-mcp-skel-tiles {
		display: grid;
		grid-template-columns: repeat(6, minmax(0, 1fr));
		gap: 10px;
		margin-top: 6px;
	}
	.ej-mcp-skel-tile {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 8px;
		padding: 16px 10px;
		border: 1px solid var(--ej-mcp-line);
		border-radius: 12px;
	}
	.ej-mcp-skel-steps {
		display: flex;
		flex-direction: column;
		gap: 12px;
		margin-top: 8px;
		padding-top: 16px;
		border-top: 1px solid var(--ej-mcp-line);
	}
	.ej-mcp-skel-step {
		display: flex;
		align-items: center;
		gap: 12px;
	}
	.ej-mcp-skel-chips {
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
		margin-top: 4px;
	}
	// Same columns as .ej-mcp-gallery. Kept here, after the base rule: the
	// shared Responsive block sits earlier in the file and would lose to it.
	@media (max-width: 1199px) {
		.ej-mcp-skel-tiles {
			grid-template-columns: repeat(3, minmax(0, 1fr));
		}
	}
	@media (max-width: 575px) {
		.ej-mcp-skel-tiles {
			grid-template-columns: repeat(2, minmax(0, 1fr));
		}
		.ej-mcp-skel-card {
			padding: 16px;
		}
	}

	/* ── Pro plan ──────────────────────────────────────────────────────────
	   MCP is a Pro feature. Without it the tab leads with an upgrade card and
	   the rest of the page stays readable but inert. The orange tag is the
	   dashboard's `.pro-tag` (SettingTabList.vue). */
	.ej-mcp-pro-tag {
		display: inline-block;
		padding: 1px 6px;
		border-radius: 4px;
		background: #ff9635;
		color: #fff;
		font-size: 10px;
		font-weight: 600;
		line-height: 16px;
		letter-spacing: 0.02em;
		text-transform: uppercase;
	}
	.ej-mcp-upgrade {
		position: relative;
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 24px;
		align-items: center;
		margin: 0 0 18px;
		padding: 22px 24px;
		overflow: hidden;
		border: 1px solid #ffd8b5;
		border-radius: 14px;
		background: linear-gradient(
			135deg,
			#fff8f1 0%,
			#fff 55%,
			var(--ej-mcp-primary-50) 100%
		);
	}
	.ej-mcp-upgrade__hd {
		display: flex;
		align-items: center;
		gap: 10px;
		margin-bottom: 6px;
	}
	.ej-mcp-upgrade h4 {
		font-size: 1.13em;
		color: var(--ej-mcp-ink);
	}
	.ej-mcp-upgrade p {
		max-width: 560px;
	}
	.ej-mcp-upgrade ul {
		display: grid;
		gap: 6px;
		margin: 12px 0 16px;
		padding: 0;
		list-style: none;
	}
	.ej-mcp-upgrade li {
		display: flex;
		align-items: flex-start;
		gap: 8px;
		margin: 0;
		font-size: 0.87em;
		font-weight: 400;
		color: var(--ej-mcp-ink-2);
	}
	.ej-mcp-upgrade li .ej-mcp-ico {
		margin-top: 0.25em;
		color: var(--ej-mcp-ok);
	}
	.ej-mcp-upgrade__cta {
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		gap: 12px;
	}
	.ej-mcp-upgrade__cta small {
		font-size: 0.8em;
		font-weight: 400;
		color: var(--ej-mcp-muted);
	}
	.ej-mcp-btn.pro {
		background: #ff9635;
		color: #fff;
		box-shadow:
			0 1px 2px rgba(28, 34, 56, 0.12),
			0 8px 18px -10px rgba(255, 150, 53, 0.9);
	}
	.ej-mcp-btn.pro:hover,
	.ej-mcp-btn.pro:focus {
		background: #f27c12;
		color: #fff;
	}
	.ej-mcp-upgrade__logos {
		display: grid;
		grid-template-columns: repeat(2, 48px);
		gap: 10px;
	}
	.ej-mcp-upgrade__logos .ej-mcp-logo {
		width: 48px;
		height: 48px;
		border-radius: 12px;
		box-shadow: 0 6px 16px -10px rgba(28, 34, 56, 0.45);
	}
	&.ej-mcp--locked .ej-mcp-body {
		position: relative;
		opacity: 0.55;
		filter: grayscale(0.35);
		pointer-events: none;
		user-select: none;
	}

	@media (prefers-reduced-motion: reduce) {
		.ej-mcp-bone {
			animation: none;
		}
		.ej-mcp-slider,
		.ej-mcp-slider::before {
			transition: none;
		}
		.ej-mcp-switch.is-busy .ej-mcp-slider::after {
			animation-duration: 1.6s;
			transition: none;
		}
	}

	@media (max-width: 575px) {
		.ej-mcp-head {
			padding: 16px 0;
		}
		.ej-mcp-skeleton {
			padding: 0 0 20px;
		}
		.ej-mcp-upgrade {
			grid-template-columns: minmax(0, 1fr);
			margin: 0 0 16px;
			padding: 18px;
		}
		.ej-mcp-upgrade__logos {
			display: none;
		}
	}
}

@keyframes ej-mcp-spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes ej-mcp-shimmer {
	to {
		background-position: -200% 0;
	}
}
