/* WP MCP page tools: inherit the theme's fonts and colours; only spacing, borders and the accent are set here. */
.wpmcp-tool {
	--wpmcp-accent: var(--wp--preset--color--primary, var(--wp--preset--color--accent, #2563eb));
	--wpmcp-radius: 10px;
	--wpmcp-line: color-mix(in srgb, currentColor 18%, transparent);
	--wpmcp-tint: color-mix(in srgb, var(--wpmcp-accent) 7%, transparent);
	--wpmcp-field: var(--wp--preset--color--base, #fff);
	/* top and bottom only: the theme's content column sets the width and the side margins (constrained layouts) */
	margin-top: 1.75em;
	margin-bottom: 1.75em;
	box-sizing: border-box;
}
.wpmcp-tool *, .wpmcp-tool *::before, .wpmcp-tool *::after { box-sizing: border-box; }
.wpmcp-tool__live {
	border: 1px solid var(--wpmcp-line);
	border-top: 4px solid var(--wpmcp-accent);
	border-radius: var(--wpmcp-radius);
	padding: clamp(14px, 3vw, 24px);
	background: var(--wpmcp-tint);
}
.wpmcp-tool__title { font-weight: 700; font-size: 1.1em; margin: 0 0 .25em; }
.wpmcp-tool__intro { margin: 0 0 1em; opacity: .85; }
.wpmcp-tool__form { margin: 0; }
.wpmcp-tool__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px 18px; }
.wpmcp-tool__field.is-wide, .wpmcp-tool__field--textarea { grid-column: 1 / -1; }
.wpmcp-tool__label { display: block; font-weight: 600; font-size: .92em; margin: 0 0 6px; padding: 0; }
.wpmcp-tool__control { display: flex; align-items: center; gap: 6px; }
.wpmcp-tool__input {
	width: 100%; min-width: 0; font: inherit; color: inherit; background: var(--wpmcp-field);
	border: 1px solid color-mix(in srgb, currentColor 30%, transparent); border-radius: min(var(--wpmcp-radius), 10px);
	padding: .55em .7em; min-height: 44px; margin: 0;
}
textarea.wpmcp-tool__input { min-height: 120px; resize: vertical; }
.wpmcp-tool__input:focus { outline: 2px solid var(--wpmcp-accent); outline-offset: 1px; }
input[type="range"].wpmcp-tool__input { padding: 0; border: 0; background: none; accent-color: var(--wpmcp-accent); }
.wpmcp-tool__unit { opacity: .75; white-space: nowrap; font-size: .95em; }
.wpmcp-tool__rangeval { min-width: 3ch; text-align: right; font-weight: 600; }
.wpmcp-tool__help { display: block; margin-top: 4px; opacity: .75; font-size: .85em; line-height: 1.4; }
.wpmcp-tool__field.is-invalid .wpmcp-tool__input { border-color: #c0392b; }
.wpmcp-tool__choices { border: 0; margin: 0; padding: 0; min-width: 0; }
.wpmcp-tool__choice, .wpmcp-tool__check { display: flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; }
.wpmcp-tool__choice input, .wpmcp-tool__check input { accent-color: var(--wpmcp-accent); width: 18px; height: 18px; margin: 0; }
.wpmcp-tool__results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; margin-top: 18px; }
.wpmcp-tool__result {
	background: var(--wpmcp-field); border: 1px solid var(--wpmcp-line); border-radius: min(var(--wpmcp-radius), 12px);
	padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.wpmcp-tool__result.is-main { grid-column: 1 / -1; border-color: var(--wpmcp-accent); }
.wpmcp-tool__result.is-text { grid-column: 1 / -1; }
.wpmcp-tool__rlabel { font-size: .85em; opacity: .8; }
.wpmcp-tool__value { font-size: 1.25em; font-weight: 700; overflow-wrap: anywhere; }
.wpmcp-tool__result.is-main .wpmcp-tool__value { font-size: 1.6em; color: var(--wpmcp-accent); }
output.wpmcp-tool__value { display: block; white-space: pre-wrap; font-size: 1em; font-weight: 500; font-family: inherit; }
.wpmcp-tool__copy, .wpmcp-tool__reset {
	font: inherit; font-size: .9em; cursor: pointer; align-self: flex-start; min-height: 40px;
	padding: .4em 1em; border-radius: min(var(--wpmcp-radius), 999px); border: 1px solid var(--wpmcp-accent);
	background: transparent; color: inherit;
}
.wpmcp-tool__copy:hover, .wpmcp-tool__reset:hover { background: var(--wpmcp-accent); color: #fff; }
.wpmcp-tool__notes:empty { display: none; }
.wpmcp-tool__notes { margin-top: 14px; }
.wpmcp-tool__note { margin: 0 0 8px; padding: 10px 12px; border-radius: 8px; border-left: 4px solid var(--wpmcp-accent); background: var(--wpmcp-field); }
.wpmcp-tool__note.is-good { border-left-color: #1e8e3e; }
.wpmcp-tool__note.is-warn { border-left-color: #c77700; }
.wpmcp-tool__note.is-bad { border-left-color: #c0392b; }
.wpmcp-tool__actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
/* the part every reader and search engine sees, with or without the live tool */
.wpmcp-tool__static { margin-top: 14px; }
.wpmcp-tool.is-live .wpmcp-tool__nojs { display: none; }
@media (prefers-reduced-motion: no-preference) { .wpmcp-tool__value { transition: color .2s; } }
.wpmcp-tool[data-tone="dark"] { --wpmcp-field: rgba(255, 255, 255, .06); }
/* the worked examples: compact, labels on the left, scroll sideways inside the post on a narrow phone */
.wpmcp-tool__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wpmcp-tool__example { width: 100%; border-collapse: collapse; font-size: .92em; margin: 0; }
.wpmcp-tool__example caption { text-align: left; font-weight: 600; padding: 0 0 6px; }
.wpmcp-tool__example th, .wpmcp-tool__example td { text-align: left; vertical-align: top; padding: 6px 10px; border-bottom: 1px solid var(--wpmcp-line); }
.wpmcp-tool__example tbody th { font-weight: 500; min-width: 9em; }
@media (max-width: 480px) { .wpmcp-tool__example { font-size: .85em; } .wpmcp-tool__example th, .wpmcp-tool__example td { padding: 5px 6px; } }
