.gp-searchbar {
	--gps-bg: #ffffff;
	--gps-bg-soft: #f7f8fb;
	--gps-bg-hover: #f3f4f6;
	--gps-border: #e5e7eb;
	--gps-border-strong: #d1d5db;
	--gps-text: #111827;
	--gps-text-muted: #6b7280;
	--gps-text-subtle: #9ca3af;
	--gps-accent: #111827;
	--gps-highlight: #fff1a8;
	--gps-shadow: 0 18px 50px rgba(17, 24, 39, 0.14), 0 5px 16px rgba(17, 24, 39, 0.08);
	--gps-radius: 999px;
	font-family: inherit;
}

.gp-searchbar *,
.gp-searchbar *::before,
.gp-searchbar *::after,
.gp-search-mobile-overlay *,
.gp-search-mobile-overlay *::before,
.gp-search-mobile-overlay *::after {
	box-sizing: border-box;
}

/* ===== Desktop search row ======================================== */
@media (min-width: 769px) {
	.main-navigation .inside-navigation {
		position: relative;
	}

	.main-navigation .menu-bar-items {
		align-items: center;
		flex: 1;
		justify-content: center;
	}

	.gp-searchbar--desktop {
		display: flex;
		align-items: center;
		justify-content: center;
		flex: 1 1 auto;
		width: auto;
		max-width: 1160px;
		padding: 8px 14px;
		margin-left: auto;
		margin-right: auto;
		background: transparent;
		border: 0;
		min-width: 0;
	}

	.gp-searchbar__row {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 16px;
		width: 100%;
		max-width: 1160px;
		min-width: 0;
		flex-wrap: nowrap;
	}

	.gp-searchbar--desktop .gp-search {
		width: min(560px, 38vw);
		min-width: 340px;
		flex: 0 1 560px;
	}

	.gp-searchbar--desktop .gp-search__wrap {
		height: 46px;
		width: 100%;
		border-radius: 999px;
		border-color: #e5e7eb;
		box-shadow: 0 2px 10px rgba(17, 24, 39, 0.04);
	}

	.gp-searchbar--desktop .gp-search__btn {
		width: 48px;
		height: 46px;
	}

	.gp-searchbar--desktop .gp-search__input {
		font-size: 16px;
		font-weight: 500;
	}

	.gp-searchbar--desktop .gp-search__dropdown {
		width: 100%;
	}

	.gp-searchbar-mobile-item {
		display: none;
	}
}

/* ===== Last-used calculator links ================================= */
.gp-used-calcs {
	display: none;
	align-items: center;
	gap: 9px;
	min-width: 0;
	max-width: 560px;
	flex: 0 1 auto;
	padding: 0;
	overflow: hidden;
	white-space: nowrap;
}

.gp-used-calcs.has-items {
	display: flex;
}

.gp-used-calcs__label {
	flex: 0 0 auto;
	font-size: 12px;
	font-weight: 800;
	color: #ffffff;
	white-space: nowrap;
	letter-spacing: 0;
	text-transform: none;
	opacity: 0.98;
	line-height: 1;
	text-shadow: 0 1px 2px rgba(0,0,0,0.22);
}

.gp-used-calcs__label::after {
	content: ":";
}

.gp-used-calcs__items {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
	min-width: 0;
	max-width: 100%;
	flex: 1 1 auto;
	flex-wrap: nowrap;
	overflow: hidden;
	white-space: nowrap;
}

.gp-used-calcs__item {
	box-sizing: border-box !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex: 0 1 auto !important;
	width: auto !important;
	min-width: 72px !important;
	max-width: 190px !important;
	height: 34px !important;
	min-height: 34px !important;
	max-height: 34px !important;
	padding: 0 13px !important;
	border-radius: 999px !important;
	background: #ffffff !important;
	border: 1px solid rgba(255,255,255,0.95) !important;
	color: #111827 !important;
	text-decoration: none !important;
	font-size: 10px !important;
	font-weight: 800 !important;
	line-height: 1.1 !important;
	white-space: normal !important;
	overflow: hidden !important;
	word-break: normal !important;
	overflow-wrap: anywhere !important;
	text-align: center !important;
	box-shadow: 0 2px 8px rgba(0,0,0,0.14) !important;
	transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.gp-used-calcs__item:hover {
	background: #f8fafc !important;
	color: #000000 !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.18) !important;
}

/* ===== Shared search component =================================== */
.gp-search {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
}

.gp-search__wrap {
	display: flex;
	align-items: center;
	background: var(--gps-bg);
	border: 1px solid var(--gps-border);
	border-radius: var(--gps-radius);
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
	overflow: hidden;
}

.gp-search__wrap:hover {
	border-color: var(--gps-border-strong);
}

.gp-search.is-open .gp-search__wrap,
.gp-search__wrap:focus-within {
	border-color: var(--gps-accent);
	box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.08);
}

.gp-search__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	background: transparent;
	border: 0;
	padding: 0;
	margin: 0;
	color: var(--gps-text-muted);
	cursor: pointer;
	transition: color 0.15s ease;
}

.gp-search__wrap:focus-within .gp-search__btn {
	color: var(--gps-accent);
}

.gp-search__btn.is-loading svg {
	display: none;
}

.gp-search__btn.is-loading::after {
	content: '';
	width: 16px;
	height: 16px;
	border: 2px solid var(--gps-border-strong);
	border-top-color: var(--gps-accent);
	border-radius: 50%;
	animation: gps-spin 0.7s linear infinite;
}

@keyframes gps-spin {
	to {
		transform: rotate(360deg);
	}
}

.gp-search__input {
	flex: 1;
	border: 0;
	outline: 0;
	background: transparent;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	color: var(--gps-text);
	padding: 0 8px 0 0;
	min-width: 0;
	height: 100%;
	letter-spacing: -0.005em;
	box-shadow: none !important;
}

.gp-search__input::placeholder {
	color: var(--gps-text-subtle);
	font-weight: 500;
}

.gp-search__clear {
	display: none;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	margin-right: 8px;
	border: 0;
	background: var(--gps-bg-soft);
	border-radius: 999px;
	color: var(--gps-text-muted);
	cursor: pointer;
	padding: 0;
	transition: all 0.15s ease;
	flex-shrink: 0;
}

.gp-search__clear:hover {
	background: var(--gps-bg-hover);
	color: var(--gps-accent);
}

.gp-search.has-value .gp-search__clear {
	display: flex;
}

/* ===== Dropdown =================================================== */
.gp-search__dropdown {
	position: absolute;
	top: calc(100% + 10px);
	left: 0;
	right: 0;
	background: var(--gps-bg);
	border: 1px solid var(--gps-border);
	border-radius: 18px;
	box-shadow: var(--gps-shadow);
	max-height: 460px;
	overflow-y: auto;
	opacity: 0;
	transform: translateY(-6px);
	pointer-events: none;
	transition: opacity 0.18s ease, transform 0.18s ease;
	z-index: 999999;
}

.gp-search.is-open .gp-search__dropdown {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.gp-search__section {
	padding: 8px 0;
}

.gp-search__section + .gp-search__section {
	border-top: 1px solid var(--gps-border);
}

.gp-search__section-label {
	display: flex;
	justify-content: space-between;
	padding: 8px 18px 6px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--gps-text-subtle);
}

.gp-search__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 14px;
	margin: 0 7px;
	border-radius: 12px;
	cursor: pointer;
	text-decoration: none !important;
	color: inherit !important;
	transition: background 0.12s ease;
}

.gp-search__item:hover,
.gp-search__item.is-active {
	background: var(--gps-bg-hover);
}

.gp-search__section--build {
	padding: 7px 0;
	background: #f4f8ff;
	border-bottom: 1px solid #dbe7fb;
}

.gp-search__item--build {
	background: #ffffff;
	border: 1px solid #c9daf8;
	box-shadow: 0 3px 10px rgba(20, 99, 255, 0.06);
}

.gp-search__item--build:hover,
.gp-search__item--build.is-active {
	background: #eaf2ff;
}

.gp-search__item--build .gp-search__item-icon,
.gp-search__item--build.is-active .gp-search__item-icon {
	background: #1463ff;
	color: #ffffff;
}

.gp-search__item--build .gp-search__item-title {
	color: #102238;
	font-weight: 750;
}

.gp-search__item--build .gp-search__item-subtitle {
	color: #1463ff;
	font-weight: 750;
}

.gp-search__item-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	background: var(--gps-bg-soft);
	border-radius: 11px;
	color: var(--gps-text-muted);
	transition: all 0.15s ease;
}

.gp-search__item.is-active .gp-search__item-icon {
	background: var(--gps-accent);
	color: #ffffff;
}

.gp-search__item-body {
	flex: 1;
	min-width: 0;
}

.gp-search__item-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--gps-text);
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.gp-search__item-title mark {
	background: var(--gps-highlight);
	color: var(--gps-text);
	padding: 0 1px;
	border-radius: 2px;
	font-weight: 800;
}

.gp-search__item-subtitle {
	font-size: 12px;
	color: var(--gps-text-muted);
	margin-top: 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.gp-search__empty {
	padding: 28px 24px;
	text-align: center;
	color: var(--gps-text-muted);
}

.gp-search__empty-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	background: var(--gps-bg-soft);
	border-radius: 13px;
	color: var(--gps-text-subtle);
	margin-bottom: 10px;
}

.gp-search__empty-title {
	font-size: 14px;
	font-weight: 700;
	color: var(--gps-text);
	margin-bottom: 2px;
}

.gp-search__empty-sub {
	font-size: 12.5px;
	color: var(--gps-text-muted);
}

.gp-search__dropdown::-webkit-scrollbar {
	width: 8px;
}

.gp-search__dropdown::-webkit-scrollbar-track {
	background: transparent;
}

.gp-search__dropdown::-webkit-scrollbar-thumb {
	background: var(--gps-border);
	border-radius: 8px;
	border: 2px solid var(--gps-bg);
}

/* ===== Mobile top-bar trigger and overlay ========================= */
.gp-search-mobile-overlay {
	display: none;
}

@media (max-width: 768px) {
	.gp-searchbar--desktop {
		display: none;
	}

	.gp-searchbar-mobile-item {
		display: flex;
		align-items: center;
	}

	.gp-search-mobile-trigger {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		height: 40px;
		padding: 0 10px;
		border: 0;
		background: transparent;
		color: inherit;
		font-family: inherit;
		font-size: 14px;
		font-weight: 700;
		cursor: pointer;
	}

	.gp-search-mobile-trigger svg {
		flex-shrink: 0;
	}

	.gp-search-mobile-overlay {
		--gps-bg: #ffffff;
		--gps-bg-soft: #f7f8fb;
		--gps-bg-hover: #f3f4f6;
		--gps-border: #e5e7eb;
		--gps-border-strong: #d1d5db;
		--gps-text: #111827;
		--gps-text-muted: #6b7280;
		--gps-text-subtle: #9ca3af;
		--gps-accent: #111827;
		--gps-highlight: #fff1a8;
		--gps-shadow: 0 18px 50px rgba(17, 24, 39, 0.18), 0 5px 16px rgba(17, 24, 39, 0.10);
		--gps-radius: 999px;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		display: block;
		background: #ffffff;
		border-bottom: 1px solid rgba(17, 24, 39, 0.10);
		box-shadow: 0 6px 22px rgba(17, 24, 39, 0.12);
		z-index: 999999;
		opacity: 0;
		transform: translateY(-100%);
		pointer-events: none;
		transition: opacity 0.18s ease, transform 0.18s ease;
	}

	body.gp-search-mobile-active .gp-search-mobile-overlay {
		opacity: 1;
		transform: translateY(0);
		pointer-events: auto;
	}

	.gp-search-mobile-overlay__inner {
		display: flex;
		align-items: center;
		gap: 10px;
		width: 100%;
		min-height: 64px;
		padding: 10px 12px;
	}

	.gp-search-mobile-overlay .gp-search {
		flex: 1;
		min-width: 0;
	}

	.gp-search-mobile-overlay .gp-search__wrap {
		height: 44px;
		width: 100%;
		border-radius: 999px;
	}

	.gp-search-mobile-overlay .gp-search__dropdown {
		position: fixed;
		top: 72px;
		left: 10px;
		right: 10px;
		max-height: min(68vh, 520px);
	}

	.gp-search-mobile-close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 42px;
		height: 42px;
		border: 0;
		border-radius: 999px;
		background: #f3f4f6;
		color: #111827;
		cursor: pointer;
		flex-shrink: 0;
		padding: 0;
	}

	.gp-search-mobile-close:hover {
		background: #e5e7eb;
		color: #111827;
	}

	.gp-used-calcs {
		display: none !important;
	}
}

@media (min-width: 769px) {
	.gp-search-mobile-overlay,
	.gp-searchbar-mobile-item {
		display: none !important;
	}
}

/* Mid-size desktop: keep boxes in one line and show fewer if needed */
@media (min-width: 769px) and (max-width: 1180px) {
	.gp-searchbar--desktop {
		max-width: 100%;
		padding-left: 10px;
		padding-right: 10px;
	}

	.gp-searchbar__row {
		gap: 12px;
	}

	.gp-searchbar--desktop .gp-search {
		width: min(500px, 42vw);
		min-width: 300px;
	}

	.gp-used-calcs {
		max-width: 430px;
		gap: 7px;
	}

	.gp-used-calcs__label {
		display: none;
	}

	.gp-used-calcs__items {
		gap: 6px;
		flex-wrap: nowrap;
	}

	.gp-used-calcs__item {
		max-width: 160px !important;
		min-width: 66px !important;
		height: 32px !important;
		min-height: 32px !important;
		max-height: 32px !important;
		padding: 0 11px !important;
		font-size: 10px !important;
		line-height: 1.1 !important;
		white-space: normal !important;
		overflow: hidden !important;
		overflow-wrap: anywhere !important;
	}

	.gp-used-calcs__item:nth-child(3) {
		display: none !important;
	}
}

/* Narrow desktop/tablet: hide chips instead of wrapping or breaking */
@media (min-width: 769px) and (max-width: 960px) {
	.gp-used-calcs {
		display: none !important;
	}

	.gp-searchbar--desktop .gp-search {
		width: min(560px, 70vw);
		min-width: 300px;
	}
}
/* ===== White top bar text fixes ================================== */

/* Last-used chip area */
.gp-used-calcs__label {
	color: #111827 !important;
	text-shadow: none !important;
	opacity: 1 !important;
}

.gp-used-calcs__item {
	background: #f9fafb !important;
	border: 1px solid #e5e7eb !important;
	color: #111827 !important;
	box-shadow: none !important;
}

.gp-used-calcs__item:hover {
	background: #f3f4f6 !important;
	border-color: #d1d5db !important;
	color: #000000 !important;
	box-shadow: none !important;
}

/* Mobile search menu item */
.gp-search-mobile-trigger {
	color: #111827 !important;
}

/* Search icon color */
.gp-search-mobile-trigger svg,
.gp-search__btn {
	color: #111827 !important;
}

/* GeneratePress top-level nav text */
.main-navigation .main-nav ul li a,
.main-navigation .menu-toggle,
.main-navigation .menu-bar-items a,
.main-navigation .menu-bar-items button {
	color: #111827 !important;
}

/* GeneratePress dropdown / Explore menu */
.main-navigation ul ul,
.main-navigation .main-nav ul ul,
.main-navigation .main-nav ul ul li,
.main-navigation .main-nav ul ul li a {
	background: #ffffff !important;
	color: #111827 !important;
}

/* Dropdown hover/focus states */
.main-navigation .main-nav ul ul li:hover > a,
.main-navigation .main-nav ul ul li:focus > a,
.main-navigation .main-nav ul ul li.sfHover > a,
.main-navigation .main-nav ul ul li.current-menu-item > a {
	background: #f3f4f6 !important;
	color: #000000 !important;
}

/* Dropdown borders/shadow so it reads on white */
.main-navigation .main-nav ul ul {
	border: 1px solid #e5e7eb !important;
	box-shadow: 0 12px 30px rgba(17, 24, 39, 0.12) !important;
}

/* Dropdown arrows/icons */
.main-navigation .dropdown-menu-toggle,
.main-navigation .menu-item-has-children .dropdown-menu-toggle {
	color: #111827 !important;
}

/* Header/nav background if needed */
.main-navigation,
.main-navigation .inside-navigation {
	background: #ffffff !important;
}
/* ===== Mobile slideout menu text on white background ============== */

.slideout-navigation,
.slideout-navigation .inside-navigation,
.slideout-navigation .main-nav,
.slideout-navigation ul,
.slideout-navigation ul li {
	background: #ffffff !important;
	color: #111827 !important;
}

.slideout-navigation a,
.slideout-navigation .main-nav ul li a,
.slideout-navigation .main-nav ul ul li a,
.slideout-navigation .menu-item a,
.slideout-navigation .dropdown-menu-toggle {
	color: #111827 !important;
	background: #ffffff !important;
	text-shadow: none !important;
}

.slideout-navigation a:hover,
.slideout-navigation .main-nav ul li:hover > a,
.slideout-navigation .main-nav ul li:focus > a,
.slideout-navigation .main-nav ul li.sfHover > a,
.slideout-navigation .main-nav ul li.current-menu-item > a {
	color: #000000 !important;
	background: #f3f4f6 !important;
}

.slideout-navigation a span,
.slideout-navigation .main-nav ul li a span {
	color: #111827 !important;
}

.slideout-navigation button,
.slideout-navigation .menu-toggle,
.slideout-navigation .slideout-exit {
	color: #111827 !important;
	background: transparent !important;
}