.grls-search-wrap {
	--grls-accent: #2563eb;
	position: relative !important;
	display: block !important;
	width: 100%;
	max-width: 560px;
	font-family: inherit;
	box-sizing: border-box;
}
.grls-search-wrap * {
	box-sizing: border-box;
}

/* The pill itself. Border/background/radius live here — on a real flex
   container — rather than on the bare <input>, so a host theme that
   strips input padding/border can't collapse the icon into the text. */
.grls-input-row {
	position: relative !important;
	display: flex !important;
	align-items: center !important;
	gap: 8px !important;
	width: 100% !important;
	background: #fff !important;
	border: 1.5px solid #e2e5ea !important;
	border-radius: 999px !important;
	padding: 0 14px !important;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.grls-input-row:focus-within {
	border-color: var(--grls-accent) !important;
	box-shadow: 0 0 0 4px rgba(37, 99, 235, .15);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--grls-accent) 15%, transparent);
}

.grls-icon {
	flex: none !important;
	display: flex !important;
	align-items: center !important;
	color: #9ca3af;
	pointer-events: none;
	transition: color .15s ease;
}

.grls-input-row:focus-within .grls-icon {
	color: var(--grls-accent);
}

/* Deliberately borderless/transparent — the pill around .grls-input-row
   provides all visible chrome, so this can't visually collide with the
   icon even if a theme stylesheet overrides padding here. */
.grls-input {
	flex: 1 1 auto !important;
	min-width: 0 !important;
	width: auto !important;
	padding: 12px 0 !important;
	margin: 0 !important;
	font-size: 15px !important;
	line-height: 1.4 !important;
	border: none !important;
	background: transparent !important;
	color: #111827 !important;
	box-shadow: none !important;
	height: auto !important;
	outline: none !important;
}

.grls-clear {
	flex: none !important;
	background: none !important;
	border: none !important;
	font-size: 20px;
	line-height: 1;
	color: #9ca3af;
	cursor: pointer;
	padding: 2px 4px !important;
}
.grls-clear:hover {
	color: #374151;
}

.grls-spinner {
	flex: none;
	width: 16px;
	height: 16px;
	border: 2px solid #e2e5ea;
	border-top-color: var(--grls-accent);
	border-radius: 50%;
	animation: grls-spin .6s linear infinite;
}

@keyframes grls-spin {
	to { transform: rotate(360deg); }
}

.grls-results {
	position: absolute !important;
	top: calc(100% + 8px) !important;
	left: 0 !important;
	right: 0 !important;
	z-index: 999999 !important;
	margin: 0 !important;
	padding: 6px;
	list-style: none;
	background: #fff;
	border: 1px solid #eceef1;
	border-radius: 14px;
	box-shadow: 0 16px 40px rgba(17, 24, 39, .14);
	max-height: 440px;
	overflow-y: auto;
	animation: grls-drop .12s ease;
}

@keyframes grls-drop {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: translateY(0); }
}

.grls-result a {
	display: flex;
	flex-direction: column;
	gap: 5px;
	padding: 11px 13px;
	border-radius: 9px;
	text-decoration: none;
	color: inherit;
}

.grls-result:not(:last-child) {
	border-bottom: 1px solid #f3f4f6;
}

.grls-result a:hover,
.grls-result.is-active a {
	background: #f3f4f6;
	background: color-mix(in srgb, var(--grls-accent) 7%, #f8f9fb);
}

.grls-result-title {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 14.5px;
	font-weight: 600;
	color: #111827;
	line-height: 1.45;
}

.grls-result-title .grls-pdf-icon {
	flex: none;
	margin-top: 2px;
	color: var(--grls-accent);
}

.grls-result-title mark,
.grls-snippet mark {
	background: #fef08a;
	color: inherit;
	padding: 0 1px;
	border-radius: 3px;
}

.grls-result-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.grls-badge {
	font-size: 11px;
	font-weight: 600;
	color: var(--grls-accent);
	background: #eef2ff;
	background: color-mix(in srgb, var(--grls-accent) 12%, #fff);
	padding: 2px 8px;
	border-radius: 999px;
	letter-spacing: .01em;
}

.grls-date {
	font-size: 12px;
	color: #6b7280;
}

.grls-cat {
	font-size: 11px;
	color: #065f46;
	background: #d1fae5;
	padding: 2px 8px;
	border-radius: 999px;
}

.grls-snippet {
	font-size: 12.5px;
	color: #8b93a1;
	line-height: 1.4;
}

.grls-empty {
	padding: 20px 12px;
	text-align: center;
	color: #6b7280;
	font-size: 13.5px;
}

/* Mobile */
@media (max-width: 480px) {
	.grls-results {
		max-height: 60vh;
	}
	.grls-input {
		font-size: 16px !important; /* prevents iOS zoom-on-focus */
	}
}
