/* KW Search — live search panel. Tokens: see design-plan.md. */

/* ---------- tokens ---------- */

.kws-search,
.kws-results,
.kws-page-banners {
	--kws-bg: #ffffff;
	--kws-ink: #1d2025;
	--kws-ink-muted: #5a606a;
	/* Brand hook for any theme: set --kws-brand on :root. Falls back to Flatsome, then WP theme.json. */
	--kws-accent: var(--kws-brand, var(--fs-color-primary, var(--wp--preset--color--primary, #446084)));
	/* Text on the accent. Light brand colours (avemed sage) need dark text: the plugin sets
	   --kws-brand-on automatically from Flatsome's primary colour; other themes can set it. */
	--kws-on-accent: var(--kws-brand-on, #ffffff);
	/* The panel is neutral on purpose: links, the focus ring and the hover wash use the ink, so the
	   panel reads the same on every brand and the products carry the colour. The accent is spent
	   in one place only — the banner button. */
	--kws-accent-text: var(--kws-ink);
	--kws-surface: color-mix(in srgb, var(--kws-ink) 5%, var(--kws-bg));
	/* Thumbs sit on a neutral wash, not the accent wash, so they stay visible on a hovered row */
	--kws-thumb-bg: color-mix(in srgb, var(--kws-ink) 5%, var(--kws-bg));
	--kws-line: color-mix(in srgb, var(--kws-ink) 10%, transparent);
	--kws-backdrop: rgb(10 12 16 / 0.5);
	--kws-shadow: 0 16px 40px -12px rgb(15 20 30 / 0.22), 0 2px 6px rgb(15 20 30 / 0.06);
	--kws-radius: 10px;
}

/* theme="dark", or theme="auto" inside a Flatsome .dark section (dark header, lightbox) */
.kws-search.kws-theme-dark,
.kws-theme-dark .kws-results,
.dark .kws-search:not(.kws-theme-light),
.dark .kws-results:not(.kws-theme-light .kws-results) {
	--kws-bg: #1c1e22;
	--kws-ink: #f1f2f4;
	--kws-ink-muted: #a8aeb7;
	/* Lightened brand colour. A near-black or grey brand would only lighten to grey, which reads as
	   disabled — for those the plugin sets --kws-brand-dark to the ink, so the button is the one
	   bright object on the dark panel. */
	--kws-accent: var(--kws-brand-dark, color-mix(in srgb, var(--kws-brand, var(--fs-color-primary, var(--wp--preset--color--primary, #446084))) 55%, #ffffff));
	--kws-on-accent: #1c1e22;
	--kws-accent-text: var(--kws-ink);
	--kws-surface: color-mix(in srgb, var(--kws-ink) 10%, var(--kws-bg));
	--kws-thumb-bg: color-mix(in srgb, var(--kws-ink) 8%, var(--kws-bg));
	--kws-line: color-mix(in srgb, var(--kws-ink) 14%, transparent);
	--kws-shadow: 0 16px 40px -12px rgb(0 0 0 / 0.6), 0 2px 6px rgb(0 0 0 / 0.3);
}

/* ---------- results host ---------- */

.kws-results {
	position: relative;
	text-align: left;
	z-index: 1000;
}

/* Opt-in theme forms, Flatsome search lightbox: the theme centres the field vertically, so the
   results would start mid-screen and run under the fold. Once results are open, pin to the top. */
.mfp-container:has(form.kws-open)::before {
	display: none;
}

.mfp-container:has(form.kws-open) .mfp-content {
	vertical-align: top;
}

/* Opt-in theme forms: neutralise Flatsome's own .live-search-results positioning */
.live-search-results.kws-results {
	position: relative !important;
	top: auto !important;
	left: auto !important;
	right: auto !important;
	background: none !important;
	box-shadow: none !important;
	text-align: left;
	z-index: 1000;
}

/* ---------- focus scrim (desktop) ---------- */

/* Placed by kws.js in the form's stacking context; the open form is lifted just above it. */
.kws-scrim {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	background: rgb(0 0 0 / 0.5);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity 150ms ease-out;
}

.kws-scrim.is-on {
	opacity: 1;
	transition-duration: 200ms;
}

.kws-scrim[hidden] {
	display: none;
}

form.kws-lifted {
	position: relative;
	z-index: 2147483001;
}

/* ---------- panel ---------- */

.kws-panel {
	position: absolute;
	top: 12px;
	left: 0;
	right: 0;
	z-index: 1000;
	/* Wider than a typical header field: long names (electronics model codes) fit in two lines */
	min-width: min(440px, calc(100vw - 24px));
	max-height: min(70vh, 640px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 12px;
	background: var(--kws-bg);
	color: var(--kws-ink);
	border: 1px solid var(--kws-line);
	border-radius: var(--kws-radius);
	box-shadow: var(--kws-shadow);
	font-size: 15px;
	line-height: 1.35;
	letter-spacing: normal;
	text-transform: none;
	text-align: left;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 120ms ease-out, transform 120ms ease-out;
}

.kws-panel.is-open {
	opacity: 1;
	transform: none;
	transition-duration: 180ms;
}

/* Flatsome off-canvas menu: the menu already scrolls, so a floating panel with its own scroll
   would nest two scroll regions. Results flow in the menu and push the links down. */
.off-canvas .kws-panel {
	position: static;
	min-width: 0;
	max-height: none;
	overflow: visible;
	margin-top: 12px;
}

/* Flowing results are menu content: they scroll under the menu's sticky header (logo, close)
   like the field does, instead of painting over it with the floating panel's z-index. */
.off-canvas .kws-results,
.off-canvas .kws-panel {
	z-index: auto;
}

/* Flatsome styles every `li > a` in the sidebar nav (`.off-canvas:not(.off-canvas-center)
   .nav-vertical li > a { padding-left: 20px }`, `li li > a { padding: 5px 0 }`, nested li 7.5px)
   and our rows are list items too. Restore the row box with higher specificity. */
.off-canvas .nav-vertical .kws-list li.kws-item,
.off-canvas .nav-vertical .kws-list li.kws-all {
	padding: 0;
}

.off-canvas .nav-vertical .kws-list li > a.kws-link,
.off-canvas .nav-vertical .kws-list li li > a.kws-link {
	padding: 8px;
}

/* Search on the right side of the header: grow leftwards so it never leaves the viewport */
.header .flex-right .kws-panel,
.header .nav-right .kws-panel {
	left: auto;
}

/* Opens towards the left when it would not fit to the right of the field (set by kws.js). */
.kws-panel.kws-panel--end {
	left: auto;
	right: 0;
}

.kws-panel[hidden] {
	display: none;
}

/* ---------- product list ---------- */

.kws-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.kws-item,
.kws-all {
	list-style: none;
	margin: 0;
	padding: 0;
}

.kws-link {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	padding: 8px;
	border-radius: 6px;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 150ms ease-out;
}

/* The pointer and the arrow keys share one state: the script marks the hovered row active,
   so a second treatment would show two highlights at once. */
.is-active > .kws-link {
	background: var(--kws-surface);
	color: inherit;
}

@media (hover: hover) and (pointer: fine) {
	.kws-link:hover {
		background: var(--kws-surface);
		color: inherit;
	}
}

/* Stale results fade only if the answer is slow; fast answers never flicker */
.kws-list,
.kws-banners,
.kws-cats {
	transition: opacity 150ms ease-out;
}

.kws-loading .kws-list,
.kws-loading .kws-banners,
.kws-loading .kws-cats {
	opacity: 0.55;
	transition-delay: 200ms;
}

/* First load on a slow connection: static placeholder rows (no shimmer loop) */
.kws-skeleton {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px;
}

.kws-skeleton__thumb,
.kws-skeleton__line {
	background: var(--kws-thumb-bg);
	border-radius: 6px;
}

.kws-skeleton__thumb {
	flex: 0 0 48px;
	height: 48px;
}

.kws-skeleton__line {
	height: 12px;
	flex: 0 1 60%;
}

.kws-thumb {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	display: grid;
	place-items: center;
	overflow: hidden;
	border-radius: 6px;
	background: var(--kws-thumb-bg);
}

.kws-thumb img {
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: contain;
}

.kws-text {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.kws-name {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
	font-weight: 500;
}

.kws-name mark {
	padding: 0;
	background: none;
	color: inherit;
	font-weight: 700;
}

.kws-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 13px;
	color: var(--kws-ink-muted);
}

.kws-oos {
	font-weight: 600;
}

.is-oos .kws-thumb img {
	opacity: 0.55;
}

.kws-price {
	flex: 0 0 auto;
	font-size: 14px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	text-align: right;
	white-space: nowrap;
}

/* Themes colour WooCommerce's .amount globally (Flatsome: `.dark span.amount { color: #fff }`,
   specificity 0,2,1), which would make the price vanish on a light panel inside a dark
   section. Three classes outrank that without !important. */
.kws-results .kws-price .amount,
.kws-results .kws-price bdi,
.kws-results .kws-price ins {
	color: inherit;
}

.kws-price del {
	display: block;
	font-size: 13px;
	font-weight: 400;
	color: var(--kws-ink-muted);
	opacity: 1;
}

.kws-price ins {
	text-decoration: none;
	font-weight: 600;
}

/* Variable products: "From" is a qualifier, the number is the fact */
.kws-price__from {
	font-weight: 400;
	color: var(--kws-ink-muted);
}

.kws-price .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

.kws-all .kws-link {
	justify-content: space-between;
	margin-top: 4px;
	border-top: 1px solid var(--kws-line);
	border-radius: 0 0 6px 6px;
	color: var(--kws-accent-text);
	font-weight: 600;
}

/* ---------- typo correction ---------- */

.kws-results .kws-corrected {
	margin: 0;
	padding: 4px 8px 12px;
	font-size: 14px;
	color: var(--kws-ink-muted);
}

.kws-corrected strong {
	font-weight: 700;
	color: var(--kws-ink);
}

.kws-corrected--page {
	padding: 0;
	margin: 0 0 16px;
	font-size: 16px;
	color: inherit;
}

.kws-corrected--page strong {
	color: inherit;
}

/* ---------- empty search box: best sellers ---------- */

/* Two classes on the paragraphs: Flatsome's `.nav p { margin: 0 }` (see .kws-empty). */
.kws-intro {
	padding: 4px 8px 12px;
}

.kws-intro .kws-intro__title {
	margin: 0;
	padding: 0;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.35;
	color: var(--kws-ink);
}

.kws-intro .kws-intro__text {
	margin: 2px 0 0;
	padding: 0;
	font-size: 14px;
	line-height: 1.45;
	color: var(--kws-ink-muted);
}

/* ---------- categories + chips ---------- */

.kws-section {
	padding: 4px 8px 16px;
}

.kws-label {
	display: block;
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--kws-ink-muted);
}

.kws-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.kws-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid var(--kws-line);
	border-radius: 999px;
	background: var(--kws-bg);
	color: inherit;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 150ms ease-out, border-color 150ms ease-out, transform 100ms ease-out;
}

@media (hover: hover) and (pointer: fine) {
	.kws-chip:hover {
		background: var(--kws-surface);
		border-color: color-mix(in srgb, var(--kws-ink) 30%, transparent);
		color: inherit;
	}
}

.kws-chip:active {
	transform: scale(0.97);
}

.kws-chip__count {
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	color: var(--kws-ink-muted);
}

@media (pointer: coarse) {
	.kws-chip {
		min-height: 44px;
	}
}

/* ---------- banner (the signature) ---------- */

.kws-banners {
	display: grid;
	gap: 8px;
	margin-bottom: 8px;
}

.kws-banner {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	overflow: hidden;
	border-radius: 8px;
	background: var(--kws-surface);
	color: var(--kws-ink);
	text-decoration: none;
}

.kws-banner:hover {
	color: var(--kws-ink);
}

.kws-banner__img {
	grid-column: 1 / -1;
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	aspect-ratio: 3 / 1;
	max-height: 180px;
	object-fit: cover;
}

.kws-banner--image .kws-banner__img {
	aspect-ratio: auto;
}

.kws-banner__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	padding: 12px;
}

.kws-banner__title {
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.25;
}

.kws-banner__text {
	font-size: 14px;
	color: var(--kws-ink-muted);
}

.kws-banner__cta {
	margin-right: 12px;
	padding: 8px 14px;
	border-radius: 999px;
	background: var(--kws-accent);
	color: var(--kws-on-accent);
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	transition: transform 150ms ease-out;
}

.kws-banner:hover .kws-banner__cta {
	transform: translateX(2px);
}

.kws-page-banners {
	display: grid;
	gap: 16px;
	margin: 0 0 32px;
}

.kws-page-banners .kws-banner__img {
	aspect-ratio: 4 / 1;
	max-height: 260px;
}

.kws-page-banners .kws-banner--image .kws-banner__img {
	aspect-ratio: auto;
}

.kws-page-banners .kws-banner__body {
	padding: 16px;
}

.kws-page-banners .kws-banner__title {
	font-size: 20px;
}

.kws-page-banners .kws-banner__cta {
	margin-right: 16px;
}

/* ---------- empty + error ---------- */

.kws-empty {
	padding: 12px 8px 4px;
}

/* Two classes: inside a Flatsome header the panel sits in .nav, whose `.nav p { margin: 0 }`
   outranks a single class and glued the chips to the hint. */
.kws-empty .kws-empty__title {
	margin: 0 0 8px;
	padding: 0;
	font-weight: 600;
	line-height: 1.45;
}

.kws-empty .kws-empty__hint {
	margin: 0 0 16px;
	padding: 0;
	font-size: 14px;
	line-height: 1.45;
	color: var(--kws-ink-muted);
}

.kws-empty .kws-empty__hint:last-child {
	margin-bottom: 0;
}

/* ---------- link colour inside a theme's .dark scope ---------- */

/* The panel is light even inside a dark section (avemed's mobile menu). Flatsome's
   `.dark a:hover { color: #fff }` (0,2,1) fires on tap and turned chip and row text white on
   white. Three classes on every state outrank it. */
.kws-results .kws-chip,
.kws-results .kws-chip:hover,
.kws-results .kws-chip:focus,
.kws-results .kws-chip:active,
.kws-results .kws-link,
.kws-results .kws-link:hover,
.kws-results .kws-link:focus,
.kws-results .kws-link:active,
.kws-results .kws-banner,
.kws-results .kws-banner:hover,
.kws-results .kws-banner:focus,
.kws-results .kws-banner:active {
	color: var(--kws-ink);
}

.kws-results .kws-all .kws-link,
.kws-results .kws-all .kws-link:hover,
.kws-results .kws-all .kws-link:focus,
.kws-results .kws-all .kws-link:active {
	color: var(--kws-accent-text);
}

/* ---------- focus ---------- */

.kws-link:focus-visible,
.kws-chip:focus-visible,
.kws-banner:focus-visible,
.kws-trigger:focus-visible,
.kws-dialog__close:focus-visible {
	outline: 2px solid var(--kws-accent-text, currentColor);
	outline-offset: 2px;
}

.kws-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- [kw_search] shared ---------- */

.kws-search {
	position: relative;
	color: inherit;
	text-align: left;
}

.kws-search--inline {
	width: 100%;
}

.kws-search--dropdown,
.kws-search--popup {
	display: inline-block;
}

.kws-form {
	position: relative;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
}

.kws-field {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 16px;
	border: 1px solid var(--kws-line);
	border-radius: 999px;
	background: var(--kws-bg);
	color: var(--kws-ink-muted);
}

.kws-field {
	transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}

/* Focus: the 1px border only darkens a little (no thick black ring); the caret and the open
   panel show where typing goes. */
.kws-field:focus-within {
	border-color: color-mix(in srgb, var(--kws-ink) 30%, transparent);
}

/* Doubled class: beats theme rules like `input[type="search"]` and `.nav input` without !important */
.kws-field input.kws-input.kws-input {
	flex: 1;
	min-width: 0;
	width: auto;
	max-width: none;
	height: 42px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--kws-ink);
	font: inherit;
	font-size: 16px; /* no iOS zoom on focus */
	line-height: normal;
	letter-spacing: normal;
	text-transform: none;
	-webkit-appearance: none;
	appearance: none;
}

.kws-field input.kws-input.kws-input:focus {
	outline: none;
	box-shadow: none;
}

.kws-field input.kws-input::placeholder {
	color: var(--kws-ink-muted);
	opacity: 1;
}

/* ---------- Flatsome header element (Customizer → Header → Elements) ---------- */

/* Our own <li>, not Flatsome's li.html, so its .75em font-size and white-on-dark colour don't apply */
.nav > li.header-kws-element {
	display: flex;
	align-items: center;
	padding: 0 6px;
	font-size: 1rem;
	color: inherit;
}

.header-kws-element .kws-search--inline {
	width: var(--kws-header-width, 320px);
	max-width: 100%;
}

/* Mobile header rows are narrow: the field shares the row with the logo and icons */
@media (max-width: 849px) {
	.header-kws-element .kws-search--inline {
		width: min(var(--kws-header-width, 320px), 56vw);
	}
}

/* In the off-canvas menu the field owns the whole row: the header width cap does not apply */
.off-canvas .header-kws-element .kws-search--inline,
.mobile-sidebar .header-kws-element .kws-search--inline {
	width: 100%;
}

/* ---------- [kw_search layout="dropdown"] ---------- */

.kws-pop {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 1001;
	width: min(440px, calc(100vw - 24px));
	padding: 12px;
	background: var(--kws-bg);
	color: var(--kws-ink);
	border: 1px solid var(--kws-line);
	border-radius: var(--kws-radius);
	box-shadow: var(--kws-shadow);
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 120ms ease-out, transform 120ms ease-out;
}

.kws-pop.is-open {
	opacity: 1;
	transform: none;
	transition-duration: 180ms;
}

.kws-pop[hidden] {
	display: none;
}

.kws-align-right > .kws-pop {
	left: auto;
	right: 0;
}

/* Inside the dropdown and the popup the results flow in the box instead of floating */
.kws-pop .kws-results,
.kws-dialog .kws-results {
	overflow-y: auto;
	overscroll-behavior: contain;
}

.kws-pop .kws-results {
	max-height: min(64vh, 560px);
}

.kws-pop .kws-panel,
.kws-dialog .kws-panel {
	position: static;
	min-width: 0;
	max-height: none;
	overflow: visible;
	margin-top: 12px;
	padding: 0;
	border: 0;
	box-shadow: none;
}

@media (max-width: 549px) {
	.kws-pop {
		position: fixed;
		top: var(--kws-pop-top, 64px);
		left: 12px;
		right: 12px;
		width: auto;
	}

	.kws-align-right > .kws-pop {
		left: 12px;
		right: 12px;
	}

	.kws-pop .kws-results {
		max-height: calc(100dvh - var(--kws-pop-top, 64px) - 96px);
	}
}

.kws-field .kws-icon {
	flex: 0 0 auto;
}

/* One clear button for every theme; the browser's own × differs per theme */
.kws-field input.kws-input::-webkit-search-cancel-button,
.kws-field input.kws-input::-webkit-search-decoration {
	-webkit-appearance: none;
	appearance: none;
}

.kws-clear.kws-clear {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	margin: 0 -14px 0 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: none;
	box-shadow: none;
	color: var(--kws-ink-muted);
	cursor: pointer;
}

.kws-clear.kws-clear:hover {
	color: var(--kws-ink);
	background: none;
}

.kws-clear.kws-clear:active {
	transform: scale(0.9);
}

.kws-clear[hidden] {
	display: none;
}

.kws-clear:focus-visible {
	outline: 2px solid var(--kws-accent-text);
	outline-offset: -6px;
}

/* Trigger icon follows the surrounding text size (header nav, body copy) */
.kws-trigger .kws-icon {
	width: 1.25em;
	height: 1.25em;
	min-width: 16px;
	min-height: 16px;
}

.kws-loading .kws-field .kws-icon {
	opacity: 0.4;
}

/* ---------- trigger (dropdown + popup) ---------- */

.kws-trigger.kws-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0 8px;
	border: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	font-weight: 500;
	letter-spacing: normal;
	text-transform: none;
	line-height: 1;
	cursor: pointer;
}

.kws-trigger.kws-trigger:hover {
	background: none;
	color: inherit;
	opacity: 0.75;
}

/* ---------- [kw_search layout="popup"] ---------- */

.kws-dialog {
	position: fixed; /* .kws-search sets relative; the modal must stay in the viewport */
	inset: 0;
	height: fit-content;
	width: min(680px, calc(100vw - 32px));
	max-width: none;
	max-height: 84vh;
	margin: 8vh auto auto;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: 12px;
	background: var(--kws-bg);
	color: var(--kws-ink);
	box-shadow: var(--kws-shadow);
}

.kws-dialog::backdrop {
	background: var(--kws-backdrop);
}

.kws-dialog[open] {
	animation: kws-enter 180ms ease-out;
}

@keyframes kws-enter {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
}

.kws-dialog__inner {
	position: relative;
	padding: 16px;
}

.kws-dialog .kws-field {
	margin-right: 56px;
}

.kws-dialog__close {
	position: absolute;
	top: 16px;
	right: 16px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--kws-thumb-bg);
	color: var(--kws-ink);
	box-shadow: none;
	cursor: pointer;
	transition: background-color 150ms ease-out, transform 100ms ease-out;
}

.kws-dialog__close:hover {
	background: var(--kws-surface);
	color: var(--kws-ink);
}

.kws-dialog__close:active {
	transform: scale(0.94);
}

.kws-dialog .kws-results {
	max-height: calc(84vh - 92px);
}

html.kws-dialog-open {
	overflow: hidden;
}

@media (max-width: 549px) {
	.kws-dialog {
		width: 100vw;
		height: 100dvh;
		max-height: 100dvh;
		margin: 0;
		border-radius: 0;
	}

	.kws-dialog__inner {
		padding-top: calc(16px + env(safe-area-inset-top, 0px));
	}

	.kws-dialog__close {
		top: calc(16px + env(safe-area-inset-top, 0px));
	}

	.kws-dialog .kws-results {
		max-height: calc(100dvh - 92px - env(safe-area-inset-top, 0px));
	}

	.kws-panel {
		max-height: 70dvh;
	}

	/* On phones every field is already as wide as its column (page content, off-canvas menu,
	   the theme's lightbox); a width floor would push the panel past the right edge. */
	.kws-panel {
		min-width: 0;
	}

	/* Narrow panel: text and button side by side squeeze the text into a four-line column.
	   Stack them — the button keeps its own row and full tap height. */
	.kws-banner {
		grid-template-columns: 1fr;
	}

	.kws-banner__cta {
		justify-self: start;
		margin: 0 12px 12px;
		min-height: 44px;
		display: inline-flex;
		align-items: center;
	}

	.kws-banner__body {
		padding-bottom: 8px;
	}
}

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
	.kws-scrim,
	.kws-scrim.is-on,
	.kws-panel,
	.kws-panel.is-open,
	.kws-pop,
	.kws-pop.is-open,
	.kws-banner__cta,
	.kws-chip,
	.kws-clear,
	.kws-dialog__close {
		transition: none;
		transform: none;
	}

	.kws-dialog[open] {
		animation: none;
	}
}
