/**
 * Keyword research — module styles.
 * Shared components (inputs, buttons, table, notices, CTA banner,
 * attribution) come from the shared stylesheet; the seed hero, difficulty
 * dial, sparklines and pills live here. All selectors are svt-kw- prefixed
 * so the module never interferes with other tools.
 */

.svt-wrap[data-tool="keyword-research"] {
	max-width: 1040px;
}

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

/* ---------- Form ---------- */

/* The shared .svt-form is a flex row — block layout keeps rows full-width. */
.svt-kw-form {
	display: block;
}

/* Form inputs fill their grid cells; results-toolbar controls size themselves. */
.svt-wrap[data-tool="keyword-research"] .svt-form .svt-input {
	width: 100%;
}

.svt-kw-grid {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 12px 14px;
}

.svt-kw-grid .svt-field {
	margin: 0;
	min-width: 0;
}

.svt-kw-submitrow {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: 14px;
}

.svt-kw-questions {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 13.5px;
	color: var(--svt-muted);
	cursor: pointer;
}

.svt-kw-questions input {
	accent-color: var(--svt-primary);
}

/* ---------- Seed hero ---------- */

.svt-kw-hero {
	display: flex;
	align-items: center;
	gap: 26px;
	border: 2px solid var(--svt-border);
	border-radius: var(--svt-radius-sm);
	background: var(--svt-tile);
	padding: 20px 24px;
}

.svt-kw-heroleft {
	flex: 0 0 220px;
}

.svt-kw-dial {
	position: relative;
	max-width: 220px;
	margin: 0 auto;
	text-align: center;
}

.svt-kw-dial svg {
	display: block;
	width: 100%;
	height: auto;
}

.svt-kw-track {
	fill: none;
	stroke: #e8eaf1;
	stroke-width: 18;
	stroke-linecap: round;
}

.svt-kw-dialvalue {
	position: absolute;
	left: 0;
	right: 0;
	top: 44%;
	transform: translateY(-50%);
	font-size: 34px;
	font-weight: 800;
	color: var(--svt-text);
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.svt-kw-diallabel {
	position: absolute;
	left: 0;
	right: 0;
	top: 64%;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.35;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--svt-muted);
}

.svt-kw-heroright {
	flex: 1 1 auto;
	min-width: 0;
}

.svt-kw-seedname {
	font-size: 20px;
	font-weight: 800;
	color: var(--svt-text);
	overflow-wrap: anywhere;
	margin-bottom: 12px;
}

/* Stat tiles: same card language as the rest of the suite. */
.svt-kw-tiles {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}

.svt-kw-tile {
	background: var(--svt-bg);
	border: 2px solid var(--svt-border);
	border-radius: 10px;
	padding: 12px 14px;
	text-align: center;
}

.svt-kw-tileval {
	font-size: 21px;
	font-weight: 800;
	color: var(--svt-text);
	line-height: 1.25;
	font-variant-numeric: tabular-nums;
}

.svt-kw-tilelabel {
	margin-top: 3px;
	font-size: 11.5px;
	color: var(--svt-muted);
}

.svt-kw-intent {
	display: inline-block;
	font-size: 12.5px;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 999px;
	width: fit-content;
}

.svt-kw-intent.is-informational {
	background: rgba(59, 130, 246, 0.14);
	color: #1d4ed8;
}

.svt-kw-intent.is-navigational {
	background: rgba(80, 92, 124, 0.14);
	color: var(--svt-slate);
}

.svt-kw-intent.is-commercial {
	background: rgba(245, 158, 11, 0.16);
	color: #92400e;
}

.svt-kw-intent.is-transactional {
	background: rgba(22, 163, 74, 0.15);
	color: #166534;
}

.svt-kw-herotrend {
	margin-top: 14px;
}

.svt-kw-trendlabel {
	font-size: 11.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--svt-muted);
	margin-bottom: 6px;
}

/* ---------- Sparklines ---------- */

.svt-kw-spark {
	display: block;
}

.svt-kw-spark--wide {
	width: 100%;
	height: 64px;
}

.svt-kw-cell-trend .svt-kw-spark {
	width: 84px;
	height: 24px;
}

.svt-kw-sparkline {
	fill: none;
	stroke: var(--svt-primary);
	stroke-width: 2;
	stroke-linejoin: round;
	stroke-linecap: round;
}

.svt-kw-sparkfill {
	fill: rgba(98, 78, 222, 0.12);
	stroke: none;
}

/* ---------- Toolbar + table ---------- */

.svt-kw-toolbar {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin: 18px 0 12px;
}

.svt-kw-subtitle {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--svt-text);
	flex: 1 1 100%;
}

.svt-kw-controls {
	display: flex;
	align-items: stretch;
	gap: 8px;
	flex-wrap: wrap;
}

/* Every toolbar control shares one height (matches the Export button). */
.svt-kw-ctl {
	height: 47px;
	box-sizing: border-box;
}

.svt-kw-filter {
	flex: 1 1 120px;
	min-width: 120px;
	width: auto;
	padding-top: 0;
	padding-bottom: 0;
	font-size: 13.5px;
}

.svt-kw-volmin,
.svt-kw-kdband {
	width: auto;
	padding-top: 0;
	padding-bottom: 0;
	font-size: 13.5px;
	cursor: pointer;
}

.svt-kw-datanote {
	margin: 12px 0 0;
	font-size: 12px;
	color: var(--svt-muted);
	line-height: 1.55;
}

.svt-kw-cell-vol {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.svt-kw-cluster {
	color: var(--svt-slate);
	font-weight: 700;
	cursor: help;
}

/* ---------- AI-suggested keywords ---------- */

.svt-kw-aibox {
	margin-top: 16px;
	border: 2px solid rgba(98, 78, 222, 0.35);
	border-radius: var(--svt-radius-sm);
	background: var(--svt-primary-soft);
	padding: 16px 18px;
}

.svt-kw-aihead {
	display: flex;
	align-items: center;
	gap: 10px;
}

.svt-kw-aibadge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: var(--svt-primary);
	color: #fff;
	font-size: 11.5px;
	font-weight: 800;
	letter-spacing: 0.05em;
	padding: 4px 11px;
	border-radius: 999px;
}

.svt-kw-ainote {
	margin: 8px 0 12px;
	font-size: 12.5px;
	color: var(--svt-muted);
	line-height: 1.55;
}

.svt-kw-aibox .svt-tbl-scroll {
	background: var(--svt-bg);
	border-radius: 10px;
}

/* Non-sortable header cells styled like the shared sort buttons. */
.svt-kw-th {
	display: inline-block;
	padding: 12px 14px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--svt-slate);
}

.svt-kw-tbl {
	min-width: 720px;
}

.svt-kw-cell-kw {
	font-weight: 600;
	color: var(--svt-text);
	max-width: 320px;
	overflow-wrap: anywhere;
}

.svt-kw-pill {
	display: inline-block;
	font-size: 12.5px;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 999px;
	font-variant-numeric: tabular-nums;
}

.svt-kw-pill.is-easy {
	background: rgba(22, 163, 74, 0.15);
	color: #166534;
}

.svt-kw-pill.is-mid {
	background: rgba(245, 158, 11, 0.16);
	color: #92400e;
}

.svt-kw-pill.is-hard {
	background: rgba(239, 68, 68, 0.13);
	color: #991b1b;
}

.svt-kw-pill.is-none {
	background: rgba(80, 92, 124, 0.10);
	color: var(--svt-muted);
}

/* ---------- Teaser + empty ---------- */

.svt-kw-teaser {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 16px;
	border: 2px solid var(--svt-primary);
	border-radius: var(--svt-radius-sm);
	background: var(--svt-primary-soft);
	padding: 14px 18px;
	font-size: 14px;
	font-weight: 600;
	color: var(--svt-text);
}

.svt-kw-empty {
	margin-top: 16px;
	border: 2px solid var(--svt-border);
	border-radius: var(--svt-radius-sm);
	background: var(--svt-tile);
	padding: 26px 24px;
	text-align: center;
}

.svt-kw-empty-title {
	font-size: 17px;
	font-weight: 700;
	color: var(--svt-text);
	margin-bottom: 6px;
}

.svt-kw-empty p {
	margin: 0;
	font-size: 14px;
	color: var(--svt-muted);
}

/* ---------- Mobile ---------- */

@media (max-width: 700px) {
	.svt-kw-grid {
		grid-template-columns: 1fr;
	}

	.svt-kw-hero {
		flex-direction: column;
		gap: 8px;
	}

	.svt-kw-heroleft {
		flex-basis: auto;
	}

	.svt-kw-heroright {
		width: 100%;
		text-align: center;
	}

	.svt-kw-stats {
		justify-content: center;
	}

	.svt-kw-herotrend {
		justify-content: center;
	}

	.svt-kw-submitrow {
		flex-wrap: wrap;
	}

	.svt-kw-submitrow .svt-button {
		width: 100%;
	}

	.svt-kw-tiles {
		grid-template-columns: 1fr;
	}

	.svt-kw-controls {
		width: 100%;
	}

	.svt-kw-filter {
		flex-basis: 100%;
	}

	.svt-kw-volmin,
	.svt-kw-kdband {
		flex: 1 1 45%;
	}

	.svt-kw-controls .svt-kw-export {
		width: 100%;
		justify-content: center;
	}
}
