/* Smart Search dropdown. Colors are CSS variables so a theme can override them. */
.ssr-host,
.ssr-modal-trigger,
.ssr-modal {
	--ssr-bg: #fff;
	--ssr-sunken: #eef1f4;
	--ssr-fg: #16202b;
	--ssr-muted: #5b6875;
	--ssr-line: #d6dde4;
	--ssr-accent: var(--wd-primary-color, #0b6fb8);
	--ssr-accent-soft: #e3f0fa;
	--ssr-mark: #fff1b8;
	--ssr-good: #1f8a4c;
	--ssr-warn: #b26a00;
	--ssr-shadow: 0 12px 32px rgba(15, 27, 39, 0.16);
}

.ssr-host {
	position: relative;
}

@media (prefers-color-scheme: dark) {
	.ssr-host,
	.ssr-modal-trigger,
	.ssr-modal {
		--ssr-bg: #16202a;
		--ssr-sunken: #1d2935;
		--ssr-fg: #e4eaf0;
		--ssr-muted: #93a1ae;
		--ssr-line: #2b3a48;
		--ssr-accent-soft: #15324a;
		--ssr-mark: #5a4a10;
		--ssr-good: #4cc27f;
		--ssr-warn: #e0a040;
		--ssr-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
	}
}

/* Hide WoodMart's own suggestion list while the enhanced panel is in charge. */
.ssr-enhanced .ssr-host .wd-search-results,
.ssr-enhanced .ssr-host .autocomplete-suggestions {
	display: none !important;
}

.ssr-panel {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	z-index: 99999;
	min-width: min(560px, 100vw - 24px);
	max-width: 100vw;
	max-height: min(70vh, 640px);
	overflow: auto;
	background: var(--ssr-bg);
	color: var(--ssr-fg);
	border: 1px solid var(--ssr-line);
	border-radius: 12px;
	box-shadow: var(--ssr-shadow);
	font-size: 14px;
	line-height: 1.4;
	text-align: start;
}

.ssr-panel[hidden] {
	display: none;
}

.ssr-panel * {
	box-sizing: border-box;
}

.ssr-grid {
	display: grid;
	grid-template-columns: 210px minmax(0, 1fr);
	min-height: 220px;
}

.ssr-side {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 14px;
	background: var(--ssr-sunken);
	border-inline-end: 1px solid var(--ssr-line);
}

.ssr-main {
	padding: 14px;
	min-width: 0;
}

.ssr-h {
	margin: 8px 0 6px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ssr-muted);
}

.ssr-side .ssr-h:first-child,
.ssr-main .ssr-h:first-child {
	margin-top: 0;
}

.ssr-muted {
	color: var(--ssr-muted);
	font-size: 13px;
}

.ssr-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.ssr-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 3px 10px;
	min-height: 0;
	font-size: 13px;
	line-height: 1.4;
	color: var(--ssr-fg);
	background: var(--ssr-bg);
	border: 1px solid var(--ssr-line);
	border-radius: 999px;
	cursor: pointer;
	text-transform: none;
	box-shadow: none;
}

.ssr-chip:hover,
.ssr-chip.on {
	border-color: var(--ssr-accent);
	color: var(--ssr-accent);
}

.ssr-ct {
	margin-inline-start: 4px;
	font-size: 12px;
	color: var(--ssr-muted);
}

.ssr-cats {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ssr-cats li {
	margin: 0;
	padding: 0;
}

.ssr-cats button,
.ssr-cats a {
	display: flex;
	justify-content: space-between;
	width: 100%;
	margin: 0;
	padding: 5px 8px;
	min-height: 0;
	font-size: 14px;
	line-height: 1.4;
	text-align: start;
	text-transform: none;
	color: var(--ssr-fg);
	background: transparent;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
	box-shadow: none;
	text-decoration: none;
}

.ssr-cats button:hover,
.ssr-cats button.on,
.ssr-cats a:hover {
	background: var(--ssr-bg);
	color: var(--ssr-accent);
}

.ssr-dym {
	margin: 0 0 10px;
	font-size: 13px;
	color: var(--ssr-muted);
}

.ssr-dym strong {
	color: var(--ssr-fg);
}

.ssr-results {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ssr-li {
	margin: 0;
	padding: 0;
}

.ssr-res {
	display: grid;
	grid-template-columns: 52px minmax(0, 1fr) auto;
	gap: 12px;
	align-items: center;
	padding: 8px;
	color: var(--ssr-fg);
	text-decoration: none;
	border-radius: 8px;
}

.ssr-res:hover,
.ssr-res[aria-selected="true"] {
	background: var(--ssr-accent-soft);
	color: var(--ssr-fg);
}

.ssr-thumb {
	width: 52px;
	height: 52px;
	object-fit: contain;
	background: var(--ssr-bg);
	border: 1px solid var(--ssr-line);
	border-radius: 6px;
}

.ssr-thumb--none {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: 600;
	text-transform: uppercase;
	color: var(--ssr-muted);
	background: var(--ssr-sunken);
}

.ssr-type {
	padding: 0 6px;
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ssr-accent);
	background: var(--ssr-accent-soft);
	border-radius: 4px;
}

.ssr-grid--single {
	grid-template-columns: minmax(0, 1fr);
}

.ssr-terms a mark {
	background: var(--ssr-mark);
	color: inherit;
	padding: 0;
}

.ssr-term[aria-selected="true"] {
	background: var(--ssr-accent-soft);
	color: var(--ssr-accent);
}

/* Matching categories, tags and brands above the search results page. */
.ssr-term-block {
	margin: 0 0 1.5em;
	padding: 0.75em 1em;
	border: 1px solid rgba(127, 127, 127, 0.25);
	border-radius: 8px;
	font-size: 0.95em;
}

.ssr-term-block__group {
	margin: 0.25em 0;
}

.ssr-term-block__label {
	margin-inline-end: 0.5em;
	font-weight: 600;
}

.ssr-term-block__link {
	display: inline-block;
	margin: 0.15em 0.35em 0.15em 0;
	padding: 0.1em 0.65em;
	border: 1px solid currentColor;
	border-radius: 999px;
	text-decoration: none;
}

.ssr-body {
	min-width: 0;
}

.ssr-title {
	display: block;
	font-weight: 500;
	font-size: 14px;
}

.ssr-title mark,
.ssr-mono mark {
	background: var(--ssr-mark);
	color: inherit;
	padding: 0;
}

.ssr-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	margin-top: 2px;
	font-size: 12px;
	color: var(--ssr-muted);
}

.ssr-mono {
	font-family: ui-monospace, Consolas, monospace;
	color: var(--ssr-fg);
}

.ssr-badge {
	display: inline-block;
	padding: 1px 6px;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--ssr-accent);
	background: var(--ssr-accent-soft);
	border-radius: 4px;
}

.ssr-price {
	text-align: end;
	font-weight: 600;
	white-space: nowrap;
}

.ssr-amount {
	display: block;
}

.ssr-stock {
	display: block;
	font-size: 11px;
	font-weight: 500;
}

.ssr-stock.ssr-in {
	color: var(--ssr-good);
}

.ssr-stock.ssr-backorder {
	color: var(--ssr-warn);
}

.ssr-stock.ssr-out {
	color: var(--ssr-muted);
}

.ssr-foot {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-top: 1px solid var(--ssr-line);
	font-size: 13px;
}

.ssr-more {
	font-weight: 600;
	color: var(--ssr-accent);
	text-decoration: none;
}

.ssr-empty {
	padding: 18px;
}

.ssr-empty p {
	margin: 0 0 10px;
}

.ssr-btn {
	display: inline-block;
	padding: 7px 14px;
	font-size: 13px;
	font-weight: 600;
	color: #fff;
	background: var(--ssr-accent);
	border-radius: 7px;
	text-decoration: none;
}

.ssr-btn:hover {
	color: #fff;
	opacity: 0.9;
}

/* [ssr_search] shortcode form */
.ssr-search-form {
	display: flex;
	gap: 0;
	max-width: 560px;
}

.ssr-search-form input[type="search"],
.ssr-search-form input[type="text"] {
	flex: 1;
	min-width: 0;
}

/* Shortcode form icon styles: [ssr_search icon="button|inline|pill|label"]. */
.ssr-search-form .ssr-field {
	position: relative;
	flex: 1;
	min-width: 0;
	display: flex;
}

.ssr-search-form .ssr-field input {
	width: 100%;
}

.ssr-icon {
	width: 18px;
	height: 18px;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ssr-search-form button.ssr-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	text-transform: none;
	letter-spacing: normal;
	color: #fff;
	background: var(--ssr-accent, #0b6fb8);
	border: 0;
	cursor: pointer;
}

.ssr-search-form button.ssr-submit:hover {
	opacity: 0.9;
}

.ssr-search-form button.ssr-submit:focus-visible,
.ssr-search-form .ssr-field input:focus-visible {
	outline: 2px solid var(--ssr-accent, #0b6fb8);
	outline-offset: 2px;
}

/* 1. button: icon-only submit button. */
.ssr-icon-button button.ssr-submit {
	min-width: 46px;
	padding: 0 14px;
	border-start-start-radius: 0;
	border-end-start-radius: 0;
	border-start-end-radius: 8px;
	border-end-end-radius: 8px;
}

.ssr-search-form.ssr-icon-button .ssr-field input[type="search"] {
	border-start-start-radius: 8px;
	border-end-start-radius: 8px;
	border-start-end-radius: 0;
	border-end-end-radius: 0;
}

/* 2. inline: magnifier inside the field, text button stays. */
.ssr-icon-inline .ssr-field .ssr-icon {
	position: absolute;
	top: 50%;
	inset-inline-start: 14px;
	transform: translateY(-50%);
	color: var(--ssr-muted, #5b6875);
	pointer-events: none;
}

.ssr-search-form.ssr-icon-inline .ssr-field input[type="search"] {
	padding-inline-start: 42px;
	border-start-start-radius: 8px;
	border-end-start-radius: 8px;
	border-start-end-radius: 0;
	border-end-end-radius: 0;
}

.ssr-icon-inline button.ssr-submit {
	padding: 0 18px;
	border-start-start-radius: 0;
	border-end-start-radius: 0;
	border-start-end-radius: 8px;
	border-end-end-radius: 8px;
}

/* 3. pill: rounded field with a round icon button inside it. */
.ssr-icon-pill {
	position: relative;
}

.ssr-search-form.ssr-icon-pill .ssr-field input[type="search"] {
	padding-inline-end: 56px;
	border-radius: 999px;
}

.ssr-icon-pill button.ssr-submit {
	position: absolute;
	top: 50%;
	inset-inline-end: 5px;
	width: 38px;
	height: 38px;
	min-height: 0;
	padding: 0;
	transform: translateY(-50%);
	border-radius: 50%;
}

/* 4. label: icon next to the button text. */
.ssr-icon-label button.ssr-submit {
	padding: 0 20px;
	border-start-start-radius: 0;
	border-end-start-radius: 0;
	border-start-end-radius: 8px;
	border-end-end-radius: 8px;
}

.ssr-search-form.ssr-icon-label .ssr-field input[type="search"] {
	border-start-start-radius: 8px;
	border-end-start-radius: 8px;
	border-start-end-radius: 0;
	border-end-end-radius: 0;
}

@media (max-width: 640px) {
	.ssr-panel {
		min-width: 0;
		max-height: 60vh;
	}

	.ssr-grid {
		grid-template-columns: 1fr;
		min-height: 0;
	}

	.ssr-side {
		border-inline-end: 0;
		border-bottom: 1px solid var(--ssr-line);
	}

	.ssr-res {
		grid-template-columns: 40px minmax(0, 1fr);
	}

	.ssr-thumb {
		width: 40px;
		height: 40px;
	}

	.ssr-price {
		grid-column: 2;
		text-align: start;
	}
}

/* Beat generic theme button styles (uppercase, bold, heights) inside the panel. */
.ssr-panel button {
	text-transform: none;
	letter-spacing: normal;
	font-weight: 400;
	font-family: inherit;
	min-height: 0;
	height: auto;
}

.ssr-panel .ssr-chip {
	padding: 3px 10px;
	background: var(--ssr-bg);
	border-radius: 999px;
}

.ssr-panel .ssr-chip.on {
	background: var(--ssr-accent-soft);
}

/* [ssr_search_modal]: magnifier trigger + search dialog.
   Styles (class ssr-modal--{style}): center, full, top, side, spotlight, sheet, glass, line. */
.ssr-modal-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-height: 0;
	margin: 0;
	padding: 0;
	color: var(--ssr-fg);
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.ssr-modal-trigger:hover,
.ssr-modal-trigger:focus-visible {
	color: var(--ssr-accent);
	background: var(--ssr-accent-soft);
	outline: 0;
}

.ssr-modal-trigger .ssr-icon {
	width: 22px;
	height: 22px;
}

html.ssr-modal-open {
	overflow: hidden;
}

dialog.ssr-modal {
	position: fixed;
	inset: 0;
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	overflow: visible;
	color: var(--ssr-fg);
	background: transparent;
	border: 0;
}

dialog.ssr-modal[open] {
	display: flex;
	align-items: flex-start;
	justify-content: center;
}

dialog.ssr-modal::backdrop {
	background: rgba(15, 23, 32, 0.4);
	backdrop-filter: blur(4px);
}

.ssr-modal__box {
	position: relative;
	box-sizing: border-box;
	background: var(--ssr-bg);
	border: 1px solid var(--ssr-line);
	border-radius: 18px;
	box-shadow: 0 24px 64px rgba(15, 27, 39, 0.18), 0 2px 6px rgba(15, 27, 39, 0.06);
}

.ssr-modal__body {
	position: relative;
}

.ssr-modal__title {
	margin: 0 0 12px;
	padding-inline-end: 40px;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--ssr-muted);
}

.ssr-modal__hint {
	display: none;
	gap: 16px;
	margin: 0;
	font-size: 12px;
	color: var(--ssr-muted);
}

.ssr-modal__hint kbd {
	display: inline-block;
	min-width: 20px;
	margin-inline-end: 6px;
	padding: 1px 6px;
	font-family: inherit;
	font-size: 11px;
	font-weight: 500;
	line-height: 18px;
	text-align: center;
	color: var(--ssr-fg);
	background: var(--ssr-sunken);
	border: 1px solid var(--ssr-line);
	border-radius: 6px;
	box-shadow: none;
}

/* Form inside the modal. Selectors are specific enough to beat theme input and button styles. */
.ssr-modal .ssr-search-form {
	max-width: none;
	gap: 8px;
}

.ssr-modal .ssr-search-form .ssr-field input[type="search"] {
	box-sizing: border-box;
	height: 52px;
	margin: 0;
	padding-block: 0;
	padding-inline: 46px 16px;
	font-size: 16px;
	color: var(--ssr-fg);
	background: var(--ssr-sunken);
	border: 1px solid transparent;
	border-radius: 12px;
	box-shadow: none;
	transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.ssr-modal .ssr-search-form .ssr-field input[type="search"]::placeholder {
	color: var(--ssr-muted);
	opacity: 1;
}

.ssr-modal .ssr-search-form .ssr-field input[type="search"]:focus {
	background: var(--ssr-bg);
	border-color: var(--ssr-accent);
	box-shadow: 0 0 0 4px var(--ssr-accent-soft);
	outline: 0;
}

.ssr-modal .ssr-icon-inline .ssr-field .ssr-icon {
	left: auto;
	inset-inline-start: 16px;
}

.ssr-modal .ssr-search-form button.ssr-submit {
	height: 52px;
	padding: 0 20px;
	font-size: 15px;
	font-weight: 600;
	border-radius: 12px;
}

.ssr-modal__close {
	position: absolute;
	top: 12px;
	inset-inline-end: 12px;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	min-height: 0;
	margin: 0;
	padding: 0;
	color: var(--ssr-muted);
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.ssr-modal__close:hover,
.ssr-modal__close:focus-visible {
	color: var(--ssr-fg);
	background: var(--ssr-sunken);
	outline: 0;
}

.ssr-modal__close .ssr-icon {
	width: 18px;
	height: 18px;
}

/* Hidden but still a real submit button, so Enter and screen readers keep working. */
.ssr-modal--spotlight .ssr-search-form button.ssr-submit,
.ssr-modal--line .ssr-search-form button.ssr-submit {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* 1. center: dialog card. */
.ssr-modal--center .ssr-modal__box {
	width: min(620px, calc(100vw - 24px));
	margin-top: 14vh;
	padding: 20px;
	animation: ssr-pop 0.18s ease-out;
}

/* 2. full: fullscreen dark overlay, big field. */
dialog.ssr-modal--full::backdrop {
	background: rgba(10, 14, 20, 0.92);
	backdrop-filter: blur(10px);
}

.ssr-modal--full .ssr-modal__box {
	width: min(760px, calc(100vw - 32px));
	margin-top: 20vh;
	background: transparent;
	border: 0;
	box-shadow: none;
	animation: ssr-fade 0.2s ease-out;
}

.ssr-modal--full .ssr-modal__title {
	padding-inline-end: 0;
	text-align: center;
	color: #9aa7b4;
}

.ssr-modal--full .ssr-search-form .ssr-field input[type="search"] {
	height: 64px;
	padding-inline-start: 54px;
	font-size: 20px;
	color: #fff;
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.12);
}

.ssr-modal--full .ssr-search-form .ssr-field input[type="search"]::placeholder {
	color: #9aa7b4;
}

.ssr-modal--full .ssr-search-form .ssr-field input[type="search"]:focus {
	background: rgba(255, 255, 255, 0.12);
	box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.ssr-modal--full .ssr-icon-inline .ssr-field .ssr-icon {
	inset-inline-start: 18px;
	width: 22px;
	height: 22px;
	color: #9aa7b4;
}

.ssr-modal--full .ssr-search-form button.ssr-submit {
	height: 64px;
	padding: 0 26px;
}

.ssr-modal--full .ssr-modal__close {
	position: fixed;
	top: 20px;
	inset-inline-end: 20px;
	width: 44px;
	height: 44px;
	color: #fff;
	background: rgba(255, 255, 255, 0.1);
}

.ssr-modal--full .ssr-modal__close:hover,
.ssr-modal--full .ssr-modal__close:focus-visible {
	color: #fff;
	background: rgba(255, 255, 255, 0.2);
}

/* 3. top: full-width bar sliding down. */
.ssr-modal--top .ssr-modal__box {
	width: 100%;
	padding: 24px max(64px, calc((100vw - 720px) / 2));
	border-width: 0 0 1px;
	border-radius: 0 0 20px 20px;
	animation: ssr-drop 0.22s ease-out;
}

.ssr-modal--top .ssr-modal__close {
	top: 33px;
	inset-inline-end: 16px;
}

/* 4. side: panel sliding in from the end edge. */
dialog.ssr-modal--side[open] {
	justify-content: flex-end;
}

.ssr-modal--side .ssr-modal__box {
	width: min(440px, 100vw);
	height: 100%;
	padding: 64px 20px 20px;
	border-width: 0;
	border-inline-start-width: 1px;
	border-radius: 20px 0 0 20px;
	animation: ssr-slide 0.22s ease-out;
}

[dir="rtl"] .ssr-modal--side .ssr-modal__box {
	border-radius: 0 20px 20px 0;
	animation-name: ssr-slide-rtl;
}

.ssr-modal--side .ssr-modal__title {
	position: absolute;
	top: 22px;
	margin: 0;
}

.ssr-modal--side .ssr-panel {
	min-width: 0;
}

/* 5. spotlight: command palette. */
.ssr-modal--spotlight .ssr-modal__box {
	width: min(600px, calc(100vw - 24px));
	margin-top: 18vh;
	padding: 0;
	animation: ssr-pop 0.16s ease-out;
}

.ssr-modal--spotlight .ssr-modal__close,
.ssr-modal--spotlight .ssr-modal__title {
	display: none;
}

.ssr-modal--spotlight .ssr-search-form .ssr-field input[type="search"],
.ssr-modal--spotlight .ssr-search-form .ssr-field input[type="search"]:focus {
	height: 60px;
	padding-inline-start: 54px;
	font-size: 18px;
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--ssr-line);
	border-radius: 18px 18px 0 0;
	box-shadow: none;
}

.ssr-modal--spotlight .ssr-icon-inline .ssr-field .ssr-icon {
	inset-inline-start: 20px;
}

.ssr-modal--spotlight .ssr-modal__hint {
	display: flex;
	justify-content: flex-end;
	padding: 10px 16px;
}

/* 6. sheet: bottom sheet. */
dialog.ssr-modal--sheet[open] {
	align-items: flex-end;
}

.ssr-modal--sheet .ssr-modal__box {
	width: min(720px, 100vw);
	padding: 30px 20px 28px;
	border-bottom-width: 0;
	border-radius: 22px 22px 0 0;
	animation: ssr-rise 0.24s ease-out;
}

.ssr-modal--sheet .ssr-modal__box::before {
	position: absolute;
	top: 10px;
	left: 50%;
	width: 40px;
	height: 4px;
	content: "";
	background: var(--ssr-line);
	border-radius: 999px;
	transform: translateX(-50%);
}

.ssr-modal--sheet .ssr-modal__close {
	top: 18px;
}

/* The results dropdown opens upward in a bottom sheet. */
.ssr-modal--sheet .ssr-panel {
	top: auto;
	bottom: calc(100% + 8px);
}

/* 7. glass: frosted card. */
dialog.ssr-modal--glass::backdrop {
	background: rgba(225, 232, 240, 0.35);
	backdrop-filter: blur(6px);
}

.ssr-modal--glass .ssr-modal__box {
	width: min(620px, calc(100vw - 24px));
	margin-top: 16vh;
	padding: 20px;
	background: rgba(255, 255, 255, 0.72);
	border-color: rgba(255, 255, 255, 0.6);
	border-radius: 22px;
	backdrop-filter: blur(20px) saturate(160%);
	animation: ssr-pop 0.2s ease-out;
}

.ssr-modal--glass .ssr-search-form .ssr-field input[type="search"] {
	background: rgba(127, 140, 155, 0.12);
}

/* 8. line: editorial, underline-only field on a near-solid page. */
dialog.ssr-modal--line::backdrop {
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: none;
}

.ssr-modal--line .ssr-modal__box {
	width: min(820px, calc(100vw - 32px));
	margin-top: 24vh;
	padding: 0;
	background: transparent;
	border: 0;
	box-shadow: none;
	animation: ssr-fade 0.2s ease-out;
}

.ssr-modal--line .ssr-modal__title {
	padding-inline-end: 0;
	text-align: center;
}

.ssr-modal--line .ssr-search-form .ssr-field input[type="search"],
.ssr-modal--line .ssr-search-form .ssr-field input[type="search"]:focus {
	height: 72px;
	padding-inline: 46px 0;
	font-size: 28px;
	font-weight: 300;
	background: transparent;
	border: 0;
	border-bottom: 2px solid var(--ssr-fg);
	border-radius: 0;
	box-shadow: none;
}

.ssr-modal--line .ssr-search-form .ssr-field input[type="search"]:focus {
	border-bottom-color: var(--ssr-accent);
}

.ssr-modal--line .ssr-icon-inline .ssr-field .ssr-icon {
	inset-inline-start: 4px;
	width: 26px;
	height: 26px;
	color: var(--ssr-fg);
}

.ssr-modal--line .ssr-modal__hint {
	display: flex;
	justify-content: center;
	margin-top: 18px;
}

.ssr-modal--line .ssr-modal__close {
	position: fixed;
	top: 20px;
	inset-inline-end: 20px;
	width: 44px;
	height: 44px;
}

/* Center and glass: keep the field clear of the close button. */
.ssr-modal--center .ssr-modal__body,
.ssr-modal--glass .ssr-modal__body {
	padding-inline-end: 40px;
}

.ssr-modal--center .ssr-modal__close,
.ssr-modal--glass .ssr-modal__close {
	top: 29px;
}

@media (prefers-color-scheme: dark) {
	dialog.ssr-modal::backdrop {
		background: rgba(4, 8, 12, 0.6);
	}

	dialog.ssr-modal--full::backdrop {
		background: rgba(4, 8, 12, 0.94);
	}

	dialog.ssr-modal--glass::backdrop {
		background: rgba(4, 8, 12, 0.45);
	}

	.ssr-modal--glass .ssr-modal__box {
		background: rgba(22, 32, 42, 0.7);
		border-color: rgba(255, 255, 255, 0.08);
	}

	dialog.ssr-modal--line::backdrop {
		background: rgba(15, 23, 31, 0.97);
	}
}

@media (max-width: 640px) {
	.ssr-modal--center .ssr-modal__box,
	.ssr-modal--glass .ssr-modal__box,
	.ssr-modal--spotlight .ssr-modal__box {
		margin-top: 12px;
	}

	.ssr-modal--top .ssr-modal__box {
		padding-inline: 16px 56px;
	}

	.ssr-modal--line .ssr-modal__box {
		margin-top: 20vh;
	}

	.ssr-modal--line .ssr-search-form .ssr-field input[type="search"],
	.ssr-modal--line .ssr-search-form .ssr-field input[type="search"]:focus {
		height: 60px;
		font-size: 22px;
	}
}

@keyframes ssr-pop {
	from { opacity: 0; transform: translateY(8px) scale(0.98); }
	to { opacity: 1; transform: none; }
}

@keyframes ssr-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes ssr-drop {
	from { transform: translateY(-100%); }
	to { transform: none; }
}

@keyframes ssr-rise {
	from { transform: translateY(100%); }
	to { transform: none; }
}

@keyframes ssr-slide {
	from { transform: translateX(100%); }
	to { transform: none; }
}

@keyframes ssr-slide-rtl {
	from { transform: translateX(-100%); }
	to { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.ssr-modal .ssr-modal__box {
		animation: none;
	}
}

/* ==========================================================================
   Dropdown layouts (Settings > Search dropdown).
   The script adds ssr-panel--{columns|stacked|tabs|cards|best|palette} to the panel. Each layout is
   mobile first and widens with container queries on the panel itself, so it adapts to the space it
   gets (a header, a modal, the settings preview) and not to the screen. A browser without container
   queries keeps the narrow version.
   ========================================================================== */

.ssr-panel {
	container: ssr-panel / inline-size;
}

/* Settings preview: the panel flows in the page instead of floating under a field. */
.ssr-preview .ssr-panel {
	position: static;
	min-width: 0;
	max-height: none;
	overflow: visible;
}

/* ---------- shared by the new layouts ---------- */

.ssr-panel .ssr-note {
	margin: 0;
	padding: 14px 16px;
}

.ssr-panel .ssr-pad {
	padding: 10px 14px 0;
}

.ssr-panel .ssr-scrollx {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	padding-bottom: 2px;
	scrollbar-width: none;
}

.ssr-panel .ssr-scrollx::-webkit-scrollbar {
	display: none;
}

.ssr-panel .ssr-scrollx .ssr-chip {
	flex: none;
	white-space: nowrap;
}

.ssr-panel a.ssr-chip {
	text-decoration: none;
}

.ssr-panel mark {
	padding: 0;
	color: inherit;
	background: var(--ssr-mark);
	border-radius: 2px;
}

.ssr-panel kbd {
	padding: 0 5px;
	font: 11px ui-monospace, Consolas, monospace;
	color: var(--ssr-muted);
	background: var(--ssr-bg);
	border: 1px solid var(--ssr-line);
	border-radius: 4px;
}

.ssr-panel .ssr-stack-bar {
	padding: 12px 14px 10px;
	border-bottom: 1px solid var(--ssr-line);
}

.ssr-panel .ssr-topics {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 12px 16px 14px;
	border-top: 1px solid var(--ssr-line);
}

.ssr-panel .ssr-topic .ssr-h {
	margin: 0 0 6px;
}

.ssr-panel .ssr-idle-sec .ssr-h {
	margin-top: 0;
}

.ssr-panel .ssr-cats.ssr-cats--grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 2px 14px;
}

.ssr-panel .ssr-cats--grid a {
	display: flex;
	justify-content: space-between;
	padding: 5px 8px;
	color: var(--ssr-fg);
	border-radius: 6px;
	text-decoration: none;
}

.ssr-panel .ssr-cats--grid a:hover {
	color: var(--ssr-accent);
	background: var(--ssr-accent-soft);
}

/* ---------- Stacked ---------- */

.ssr-panel--stacked .ssr-stack-body {
	padding: 6px;
}

.ssr-panel .ssr-stack--idle .ssr-idle-sec {
	padding: 12px 16px;
	border-top: 1px solid var(--ssr-line);
}

.ssr-panel .ssr-stack--idle .ssr-idle-sec:first-child {
	border-top: 0;
}

/* ---------- Tabs ---------- */

.ssr-panel .ssr-tabs {
	display: flex;
	gap: 2px;
	padding: 0 10px;
	overflow-x: auto;
	border-bottom: 1px solid var(--ssr-line);
	scrollbar-width: none;
}

.ssr-panel .ssr-tabs::-webkit-scrollbar {
	display: none;
}

.ssr-panel .ssr-tab {
	flex: none;
	margin: 0 0 -1px;
	padding: 11px 10px 9px;
	font-size: 13.5px;
	color: var(--ssr-muted);
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
}

.ssr-panel .ssr-tab:hover {
	color: var(--ssr-accent);
}

.ssr-panel .ssr-tab[aria-selected="true"] {
	font-weight: 600;
	color: var(--ssr-accent);
	border-bottom-color: var(--ssr-accent);
}

.ssr-panel .ssr-pane {
	padding: 6px;
	min-height: 120px;
}

.ssr-panel .ssr-idle2 {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 18px;
	padding: 16px;
}

.ssr-panel .ssr-recent-rows {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ssr-panel .ssr-recent-row {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 6px 8px;
	text-align: start;
	color: var(--ssr-fg);
	background: none;
	border: 0;
	border-radius: 8px;
	box-shadow: none;
	cursor: pointer;
}

.ssr-panel .ssr-recent-row:hover {
	background: var(--ssr-accent-soft);
}

.ssr-panel .ssr-recent-ic {
	color: var(--ssr-muted);
}

.ssr-panel .ssr-idle-col {
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
}

@container ssr-panel (min-width: 480px) {
	.ssr-panel .ssr-idle2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ---------- Visual cards ---------- */

.ssr-panel .ssr-cardbody {
	padding: 12px;
}

.ssr-panel .ssr-cardgrid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ssr-panel .ssr-cardgrid > .ssr-li {
	display: flex;
}

.ssr-panel a.ssr-card {
	display: flex;
	flex: 1;
	flex-direction: row;
	align-items: stretch;
	gap: 0;
	min-width: 0;
	padding: 0;
	overflow: hidden;
	color: var(--ssr-fg);
	background: var(--ssr-bg);
	border: 1px solid var(--ssr-line);
	border-radius: 12px;
}

.ssr-panel a.ssr-card:hover,
.ssr-panel a.ssr-card[aria-selected="true"] {
	background: var(--ssr-bg);
	border-color: var(--ssr-accent);
	box-shadow: 0 0 0 3px var(--ssr-accent-soft);
}

.ssr-panel .ssr-card-pic {
	position: relative;
	display: flex;
	flex: none;
	width: 96px;
	min-height: 84px;
	background: var(--ssr-sunken);
}

.ssr-panel .ssr-card-pic .ssr-thumb {
	flex: 1;
	width: 100%;
	height: auto;
	min-width: 0;
	object-fit: cover;
	border: 0;
	border-radius: 0;
	font-size: 26px;
}

.ssr-panel .ssr-card-type {
	display: none;
}

.ssr-panel .ssr-card-tt {
	display: inline-block;
}

.ssr-panel .ssr-card-txt {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	padding: 9px 11px 11px;
}

.ssr-panel .ssr-card-txt .ssr-title {
	display: -webkit-box;
	overflow: hidden;
	font-size: 13.5px;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.ssr-panel .ssr-card-txt .ssr-price {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 2px 8px;
	margin-top: 6px;
	text-align: start;
}

.ssr-panel .ssr-card-txt .ssr-amount,
.ssr-panel .ssr-card-txt .ssr-stock {
	display: inline;
}

.ssr-panel a.ssr-moretile {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	min-height: 72px;
	padding: 14px;
	text-align: center;
	font-weight: 600;
	color: var(--ssr-accent);
	border: 1px dashed var(--ssr-line);
	border-radius: 12px;
	text-decoration: none;
}

.ssr-panel a.ssr-moretile:hover {
	border-color: var(--ssr-accent);
	background: var(--ssr-accent-soft);
}

.ssr-panel .ssr-moretile .ssr-ct {
	font-weight: 400;
}

.ssr-panel .ssr-popbar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border-bottom: 1px solid var(--ssr-line);
}

.ssr-panel .ssr-popbar .ssr-h {
	flex: none;
	margin: 0;
}

.ssr-panel .ssr-popbar .ssr-scrollx {
	flex: 1;
	min-width: 0;
}

.ssr-panel .ssr-cardwrap > .ssr-idle-sec {
	padding: 14px;
}

.ssr-panel .ssr-cats.ssr-tiles {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
}

.ssr-panel a.ssr-tile {
	display: block;
	padding: 12px;
	color: var(--ssr-fg);
	background: var(--ssr-bg);
	border: 1px solid var(--ssr-line);
	border-radius: 10px;
	text-decoration: none;
}

.ssr-panel a.ssr-tile:hover {
	color: var(--ssr-accent);
	border-color: var(--ssr-accent);
	background: var(--ssr-bg);
}

.ssr-panel .ssr-foot--recent {
	justify-content: flex-start;
	gap: 12px;
}

@container ssr-panel (min-width: 400px) {
	.ssr-panel .ssr-cardgrid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ssr-panel a.ssr-card {
		flex-direction: column;
	}

	.ssr-panel .ssr-card-pic {
		width: auto;
		min-height: 0;
		aspect-ratio: 4 / 3;
	}

	.ssr-panel .ssr-card-pic .ssr-thumb {
		position: absolute;
		inset: 0;
		height: 100%;
		font-size: 30px;
	}

	.ssr-panel .ssr-card-type {
		position: absolute;
		top: 8px;
		inset-inline-start: 8px;
		display: inline-block;
		background: var(--ssr-bg);
	}

	.ssr-panel .ssr-card-tt {
		display: none;
	}
}

@container ssr-panel (min-width: 520px) {
	.ssr-panel .ssr-cats.ssr-tiles {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@container ssr-panel (min-width: 640px) {
	.ssr-panel .ssr-cardgrid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* ---------- Best match + list ---------- */

.ssr-panel .ssr-split {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
}

.ssr-panel a.ssr-best-link {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	padding: 16px;
	color: var(--ssr-fg);
	background: var(--ssr-sunken);
	border-radius: 0;
	border-bottom: 1px solid var(--ssr-line);
	text-decoration: none;
}

.ssr-panel a.ssr-best-link:hover,
.ssr-panel a.ssr-best-link[aria-selected="true"] {
	background: var(--ssr-accent-soft);
}

.ssr-panel .ssr-best-label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ssr-accent);
}

.ssr-panel .ssr-best-pic {
	position: relative;
	display: block;
	aspect-ratio: 16 / 7;
	overflow: hidden;
	background: var(--ssr-bg);
	border: 1px solid var(--ssr-line);
	border-radius: 12px;
}

.ssr-panel .ssr-best-pic .ssr-thumb {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
	border-radius: 0;
	font-size: 38px;
}

.ssr-panel .ssr-best-title {
	font-size: 17px;
	font-weight: 650;
	line-height: 1.25;
}

.ssr-panel .ssr-best-ex {
	display: -webkit-box;
	overflow: hidden;
	font-size: 13px;
	color: var(--ssr-muted);
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

.ssr-panel .ssr-best-go {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	margin-top: auto;
}

.ssr-panel .ssr-best-go .ssr-price {
	text-align: start;
}

.ssr-panel .ssr-btn-lite {
	padding: 6px 14px;
	font-size: 13px;
	font-weight: 600;
	color: #fff;
	background: var(--ssr-accent);
	border-radius: 8px;
}

.ssr-panel .ssr-best-rest {
	min-width: 0;
	padding: 8px;
}

.ssr-panel .ssr-best-rest .ssr-h {
	margin: 0;
	padding: 8px 8px 4px;
}

@container ssr-panel (min-width: 540px) {
	.ssr-panel .ssr-split {
		grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	}

	.ssr-panel .ssr-split--single {
		grid-template-columns: minmax(0, 1fr);
	}

	.ssr-panel a.ssr-best-link {
		border-bottom: 0;
		border-inline-end: 1px solid var(--ssr-line);
	}

	.ssr-panel .ssr-split--single a.ssr-best-link {
		border-inline-end: 0;
	}

	.ssr-panel .ssr-best-pic {
		aspect-ratio: 16 / 10;
	}
}

/* ---------- Command palette ---------- */

.ssr-panel .ssr-pal {
	padding: 2px 0 6px;
}

.ssr-panel .ssr-pal-gh {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	padding: 10px 14px 4px;
}

.ssr-panel .ssr-pal-gh .ssr-h {
	margin: 0;
}

.ssr-panel .ssr-pal-note {
	font-size: 11.5px;
	color: var(--ssr-muted);
}

.ssr-panel a.ssr-pal-item,
.ssr-panel button.ssr-pal-item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 7px 14px;
	font-size: 14px;
	text-align: start;
	color: var(--ssr-fg);
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	text-decoration: none;
	cursor: pointer;
}

.ssr-panel a.ssr-pal-item:hover,
.ssr-panel a.ssr-pal-item[aria-selected="true"],
.ssr-panel button.ssr-pal-item:hover {
	background: var(--ssr-accent-soft);
}

.ssr-panel .ssr-pal-ic {
	display: grid;
	flex: none;
	place-items: center;
	width: 26px;
	height: 26px;
	overflow: hidden;
	font-size: 12px;
	font-weight: 700;
	color: var(--ssr-accent);
	background: var(--ssr-accent-soft);
	border-radius: 7px;
}

.ssr-panel .ssr-pal-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ssr-panel .ssr-pal-tx {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.ssr-panel .ssr-pal-sub {
	display: none;
	margin-inline-start: 8px;
	font-size: 12.5px;
	color: var(--ssr-muted);
}

.ssr-panel .ssr-pal-rt {
	flex: none;
	font-size: 12px;
	color: var(--ssr-muted);
}

.ssr-panel .ssr-pal-ret {
	visibility: hidden;
}

.ssr-panel a.ssr-pal-item[aria-selected="true"] .ssr-pal-ret {
	visibility: visible;
}

.ssr-panel .ssr-pal-quick {
	padding: 6px 14px 10px;
}

.ssr-panel .ssr-keys {
	display: none;
	gap: 14px;
	flex-wrap: wrap;
}

.ssr-panel .ssr-key {
	display: inline-flex;
	align-items: center;
	gap: 3px;
}

@container ssr-panel (min-width: 460px) {
	.ssr-panel .ssr-pal-sub {
		display: inline;
	}

	.ssr-panel .ssr-keys {
		display: flex;
	}
}
