/**
 * Meta generator — module styles.
 * Inherits Solvid tokens (--svt-*) from .svt-wrap.
 */

.svt-wrap[data-tool="meta-generator"] {
	max-width: 1080px;
}

.svt-required {
	color: var(--svt-primary);
}

/* ---------- Top bar: language switcher, right-aligned ---------- */

.svt-mg-topbar {
	flex-basis: 100%;
	display: flex;
	justify-content: flex-end;
	margin-bottom: 2px;
}

.svt-select {
	appearance: none;
	font: inherit;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--svt-slate);
	background: var(--svt-bg);
	border: 2px solid var(--svt-border-strong);
	border-radius: 10px;
	padding: 7px 30px 7px 12px;
	cursor: pointer;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23505c7c' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 11px center;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.svt-select:hover {
	border-color: #aab1c7;
}

.svt-select:focus-visible {
	outline: none;
	border-color: var(--svt-primary);
	box-shadow: 0 0 0 3px var(--svt-primary-soft);
}

/* ---------- Brief textarea ---------- */

textarea.svt-mg-brief {
	resize: vertical;
	min-height: 86px;
	line-height: 1.5;
}

.svt-mg-error {
	margin: 2px 0 0;
	color: #991b1b;
	font-size: 13.5px;
}

/* Form flow: brief full-width, then brand (2/3) + Generate button (1/3). */
.svt-mg-form .svt-field--half {
	flex: 1 1 calc(66.666% - 7px);
	min-width: 220px;
}

.svt-mg-form .svt-button {
	flex: 1 1 calc(33.333% - 7px);
	min-width: 150px;
	/* Match the 49px rendered height of the brand input beside it. */
	height: 49px;
	padding-top: 0;
	padding-bottom: 0;
	align-self: flex-end;
}

/* ---------- Length legend ---------- */

.svt-mg-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	margin: 0 0 18px;
	font-size: 13px;
	color: var(--svt-muted);
}

.svt-mg-legend span {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.svt-mg-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	flex-shrink: 0;
}

.svt-mg-dot.is-short { background: var(--svt-warning); }
.svt-mg-dot.is-ideal { background: var(--svt-success); }
.svt-mg-dot.is-over  { background: var(--svt-danger); }

/* ---------- Results layout: options left, sticky SERP preview right ---------- */

.svt-mg-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 420px;
	gap: 30px;
	align-items: start;
}

.svt-mg-options {
	display: flex;
	flex-direction: column;
	gap: 26px;
	min-width: 0;
}

.svt-mg-side {
	position: sticky;
	top: 24px;
}

.svt-mg-colhead {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 10px;
}

.svt-mg-colhead h3,
.svt-mg-sidehead {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--svt-slate);
	margin: 0;
}

.svt-mg-sidehead {
	margin-bottom: 10px;
}

.svt-mg-hint {
	font-size: 12px;
	color: var(--svt-muted);
}

.svt-mg-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Option rows: white bordered tiles, violet when selected. */
.svt-mg-option {
	position: relative;
	border: 2px solid var(--svt-border);
	border-radius: var(--svt-radius-sm);
	background: var(--svt-bg);
	padding: 13px 15px;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.svt-mg-option:hover {
	border-color: #b4a9f0;
}

/* No UA focus box on mouse interaction; keyboard users get a clean ring. */
.svt-mg-option:focus {
	outline: none;
}

.svt-mg-option:focus-visible {
	outline: 2px solid var(--svt-primary);
	outline-offset: 2px;
}

/* Selected: single clean violet border + faint tint — no extra glow rings. */
.svt-mg-option.is-selected {
	border-color: var(--svt-primary);
	background: rgba(98, 78, 222, 0.04);
}

.svt-mg-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
}

.svt-mg-text {
	font-size: 14.5px;
	line-height: 1.5;
	color: var(--svt-text);
}

/* Icon-only copy button. */
.svt-mg-copy {
	appearance: none;
	flex-shrink: 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	color: var(--svt-slate);
	background: transparent;
	border: 2px solid var(--svt-border);
	border-radius: 8px;
	padding: 0;
	transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.svt-mg-copy:hover,
.svt-mg-copy:focus-visible {
	color: var(--svt-primary);
	border-color: var(--svt-primary);
	background: var(--svt-primary-soft);
}

.svt-mg-copy.is-copied {
	color: #0d7d71;
	border-color: rgba(56, 225, 208, 0.6);
	background: rgba(56, 225, 208, 0.14);
}

/* ---------- Pixel meter ---------- */

.svt-mg-meter {
	height: 4px;
	border-radius: 999px;
	background: #eef0f5;
	margin: 11px 0 7px;
	overflow: hidden;
}

.svt-mg-meter-fill {
	display: block;
	height: 100%;
	border-radius: inherit;
	transition: width 0.3s ease;
}

.svt-mg-meter-fill.is-short { background: var(--svt-warning); }
.svt-mg-meter-fill.is-ideal { background: var(--svt-success); }
.svt-mg-meter-fill.is-over  { background: var(--svt-danger); }

.svt-mg-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	font-size: 12.5px;
	color: var(--svt-muted);
}

.svt-mg-status {
	font-weight: 600;
}

.svt-mg-status.is-short { color: #a06a10; }
.svt-mg-status.is-ideal { color: #15803d; }
.svt-mg-status.is-over  { color: #991b1b; }

/* ---------- SERP preview ---------- */

.svt-serp {
	border: 2px solid var(--svt-border);
	border-radius: var(--svt-radius-sm);
	background: var(--svt-bg);
	padding: 18px 20px;
	font-family: Arial, sans-serif;
	box-shadow: 0 1px 2px rgba(28, 35, 64, 0.03);
}

.svt-serp-sitename {
	font-size: 14px;
	color: #202124;
	line-height: 1.3;
}

.svt-serp-url {
	font-size: 12px;
	color: #4d5156;
	line-height: 1.5;
	margin-bottom: 8px;
}

.svt-serp-title {
	font-size: 18px;
	line-height: 1.35;
	color: #1a0dab;
	margin-bottom: 5px;
	cursor: pointer;
}

.svt-serp-title:hover {
	text-decoration: underline;
}

.svt-serp-desc {
	font-size: 13.5px;
	line-height: 1.58;
	color: #474747;
}

/* Regenerate sits right-aligned under the preview. */
.svt-mg-actions {
	display: flex;
	justify-content: flex-end;
	margin: 14px 0 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
	.svt-mg-layout {
		grid-template-columns: 1fr;
	}

	/* Preview first on small screens, options below it. */
	.svt-mg-side {
		position: static;
		order: -1;
	}
}
