/* Free tools: loaded only on pages with a webstribe/tool or webstribe/tool-cards block. */

.ws-tool { margin-block: var(--wp--preset--spacing--40); }
.ws-tool-form { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: flex-end; }
.ws-tool-form > * { margin: 0; }
.ws-tool-field { flex: 1 1 16rem; min-width: 0; }
.ws-tool-field.is-narrow { flex: 0 1 9rem; }
.ws-tool-field label, .ws-tool-checks legend {
	display: block; font-weight: 600; font-size: var(--wp--preset--font-size--small); margin-bottom: 0.25rem;
}
.ws-tool-field input, .ws-tool-field select {
	width: 100%; box-sizing: border-box; font: inherit; padding: 0.65rem 0.75rem; min-height: 2.9rem;
	border: 1px solid var(--wp--preset--color--muted); border-radius: var(--ws-radius-s);
	background: var(--wp--preset--color--surface); color: var(--wp--preset--color--ink);
}
.ws-tool-checks { flex-basis: 100%; border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; }
.ws-tool-checks legend { width: 100%; padding: 0; }
.ws-tool-field .ws-tool-check { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 400; font-size: inherit; margin: 0; }
.ws-tool-check input { width: 1.1rem; height: 1.1rem; min-height: 0; margin: 0; accent-color: var(--ws-accent); }
.ws-tool-submit { flex: 0 0 auto; }
.ws-tool-submit .ws-btn { min-height: 2.9rem; }
.ws-tool-submit .ws-btn[disabled] { opacity: 0.6; cursor: progress; }
@media (max-width: 599px) {
	.ws-tool-submit, .ws-tool-submit .ws-btn { width: 100%; }
}

.ws-tool-result:empty { display: none; }
.ws-tool-result { margin-top: 1.5rem; }
.ws-tool-result > :first-child { margin-top: 0; }
.ws-tool-wait { color: var(--wp--preset--color--muted); }
.ws-tool-summary {
	margin: 0 0 1rem; padding: 0.75rem 1rem; border-radius: var(--ws-radius-s); font-weight: 600;
	border-left: 4px solid var(--ws-accent); background: var(--wp--preset--color--bar);
}
.ws-tool-summary.is-good { border-color: #1F7A3A; background: #E8F5EC; }
.ws-tool-summary.is-warn { border-color: #8A5A00; background: #FFF4DC; }
.ws-tool-summary.is-bad { border-color: #9B1C1C; background: #FDECEC; }
.ws-tool-h { font-size: var(--wp--preset--font-size--medium); margin: 1.5rem 0 0.5rem; }
.ws-tool-table { overflow-x: auto; }
.ws-tool-table table { width: 100%; border-collapse: collapse; font-size: var(--wp--preset--font-size--small); }
.ws-tool-table th, .ws-tool-table td {
	border: var(--ws-line); padding: 0.5rem 0.75rem; text-align: left; vertical-align: top; overflow-wrap: anywhere;
}
.ws-tool-table thead th, .ws-tool-table .is-pairs th { background: var(--wp--preset--color--bar); font-weight: 600; }
.ws-tool-table .is-pairs th { width: 34%; }
.ws-tool-table td { font-family: var(--wp--preset--font-family--mono); }
.ws-tool-copy { display: flex; gap: 0.75rem; align-items: stretch; flex-wrap: wrap; margin-bottom: 1rem; }
.ws-tool-secret {
	flex: 1 1 16rem; min-width: 0; font-family: var(--wp--preset--font-family--mono); font-size: 1.15rem; overflow-wrap: anywhere;
	padding: 0.7rem 0.9rem; border: 1px solid var(--wp--preset--color--muted); border-radius: var(--ws-radius-s);
	background: var(--wp--preset--color--surface);
}
.ws-tool-note { color: var(--wp--preset--color--muted); }

.ws-tool-cards {
	list-style: none; padding: 0; margin: var(--wp--preset--spacing--30) 0 0; display: grid; gap: 1rem;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
}
.ws-tool-card {
	position: relative; margin: 0; padding: 1.25rem; background: var(--wp--preset--color--surface);
	border: var(--ws-line); border-bottom-width: var(--ws-edge); border-radius: var(--ws-radius);
}
.ws-tool-card:hover { border-color: var(--ws-accent); }
.ws-tool-card h3 { margin: 0 0 0.4rem; font-size: var(--wp--preset--font-size--medium); }
.ws-tool-card h3 a { color: var(--wp--preset--color--ink); text-decoration: none; }
.ws-tool-card h3 a::after { content: ""; position: absolute; inset: 0; }
.ws-tool-card h3 a:focus-visible { outline: none; }
.ws-tool-card:focus-within { outline: 3px solid var(--ws-accent); outline-offset: 2px; }
.ws-tool-card p { margin: 0; color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); }
