/**
 * Westphal Solutions — UTM link builder (self-contained)
 *
 * Owns everything under the `wsutm` prefix. Reads only the theme's brand
 * variables from main.css; shares no classes, files, or hooks with any other
 * tool. Safe to edit or delete on its own.
 */

.wsutm {
	--wsutm-mono: 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
	--wsutm-gap: 1px;

	border: 1px solid var(--ws-border);
	border-radius: var(--ws-radius);
	background: var(--ws-surface);
	overflow: hidden;
	font-family: var(--ws-font);
	color: var(--ws-text);
}

/* ---- Top bar --------------------------------------------------------------- */
.wsutm__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-bottom: 1px solid var(--ws-border);
	background: var(--ws-bg);
}
.wsutm__bar-label { font-size: 0.8rem; font-weight: 700; color: var(--ws-muted); }
.wsutm__spacer { flex: 1 1 auto; }
.wsutm__actions { display: flex; align-items: center; gap: 8px; }

.wsutm__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--ws-font);
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1;
	padding: 9px 14px;
	border-radius: var(--ws-radius);
	border: 1px solid var(--ws-border);
	background: var(--ws-surface);
	color: var(--ws-text);
	cursor: pointer;
	transition: transform 0.15s var(--ws-ease),
				background-color 0.2s var(--ws-ease),
				border-color 0.2s var(--ws-ease),
				color 0.2s var(--ws-ease);
}
.wsutm__btn:hover { border-color: var(--ws-accent); }
.wsutm__btn:active { transform: translateY(1px); }
.wsutm__btn:focus-visible { outline: 2px solid var(--ws-accent); outline-offset: 2px; }
.wsutm__btn.is-copied {
	background: var(--ws-slate);
	border-color: var(--ws-slate);
	color: var(--ws-white);
}

/* ---- Panes ----------------------------------------------------------------- */
.wsutm__panes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--wsutm-gap);
	background: var(--ws-border);
}
.wsutm__pane {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: var(--ws-surface);
}
.wsutm__label {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ws-muted);
	padding: 9px 12px;
	border-bottom: 1px solid var(--ws-border);
}

/* ---- Tagged URL output ----------------------------------------------------- */
.wsutm__field {
	flex: 1 1 auto;
	width: 100%;
	min-height: 200px;
	resize: vertical;
	border: 0;
	padding: 14px 16px;
	font-family: var(--wsutm-mono);
	font-size: 0.92rem;
	line-height: 1.6;
	font-weight: 700;
	color: var(--ws-slate);
	background: var(--ws-surface);
	word-break: break-all;
}
.wsutm__field:focus { outline: 0; box-shadow: inset 0 0 0 2px var(--ws-accent); }
[data-theme="dark"] .wsutm__field { color: var(--ws-accent); }

/* ---- Form fields (left pane) ----------------------------------------------- */
.wsutm__form {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 13px;
	padding: 16px;
	overflow: auto;
}
.wsutm__group { display: flex; flex-direction: column; gap: 4px; }
.wsutm__group-label { font-size: 0.78rem; font-weight: 700; color: var(--ws-text); }
.wsutm__req { color: var(--ws-slate); font-weight: 900; }
[data-theme="dark"] .wsutm__req { color: var(--ws-accent); }
.wsutm__param {
	font-family: var(--wsutm-mono);
	font-size: 0.72rem;
	font-weight: 400;
	color: var(--ws-muted);
}
.wsutm__input {
	padding: 9px 11px;
	border: 1px solid var(--ws-border);
	border-radius: var(--ws-radius);
	background: var(--ws-bg);
	color: var(--ws-text);
	font-family: var(--ws-font);
	font-size: 0.92rem;
}
.wsutm__input::placeholder { color: var(--ws-muted); opacity: 0.7; }
.wsutm__input:focus { outline: 0; border-color: var(--ws-accent); box-shadow: 0 0 0 2px rgba(195, 221, 34, 0.35); }

/* ---- Footnote -------------------------------------------------------------- */
.wsutm__note {
	margin: 0;
	padding: 10px 14px;
	font-size: 0.8rem;
	color: var(--ws-muted);
	border-top: 1px solid var(--ws-border);
	background: var(--ws-bg);
}

/* ---- Responsive ------------------------------------------------------------ */
@media (max-width: 720px) {
	.wsutm__panes { grid-template-columns: 1fr; }
	.wsutm__field { min-height: 120px; }
}
