.faah-index {
	--faah-accent: #4f8f22;
	--faah-border: #d8d8d8;
	box-sizing: border-box;
	max-width: 100%;
	margin: 1.5rem 0;
}

.faah-index *,
.faah-index *::before,
.faah-index *::after {
	box-sizing: border-box;
}

.faah-index__search-wrap {
	position: relative;
	z-index: 5;
	width: 100%;
	max-width: 700px;
	margin: 0 auto 12px;
}

.faah-index__search {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 8px;
}

.faah-index__search-input,
.faah-index__search-button {
	min-height: 46px;
	font: inherit;
}

.faah-index__search-input {
	min-width: 0;
	width: 100%;
	margin: 0;
	border: 1px solid var(--faah-border);
	border-radius: 4px;
	background: #fff;
	color: #333;
	padding: 9px 12px;
}

.faah-index__search-button {
	margin: 0;
	border: 1px solid var(--faah-accent);
	border-radius: 4px;
	background: var(--faah-accent);
	color: #fff;
	font-weight: 600;
	padding: 9px 18px;
	cursor: pointer;
}

.faah-index__search-input:focus,
.faah-index__search-button:focus-visible,
.faah-index__search-result:focus-visible,
.faah-index__search-all:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--faah-accent) 35%, transparent);
	outline-offset: 2px;
}

.faah-index__search-results {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 10;
	max-height: min(480px, 65vh);
	border: 1px solid var(--faah-border);
	border-radius: 4px;
	background: #fff;
	box-shadow: 0 8px 24px rgb(0 0 0 / 15%);
	overflow-y: auto;
}

.faah-index__search-result {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	border-bottom: 1px solid #ededed;
	color: inherit;
	line-height: 1.35;
	padding: 8px 12px;
	text-decoration: none;
}

.faah-index__search-result > span {
	min-width: 0;
	overflow-wrap: anywhere;
}

.faah-index__search-result:hover,
.faah-index__search-result:focus-visible {
	background: #f4f7f2;
	color: var(--faah-accent);
}

.faah-index__search-thumbnail {
	flex: 0 0 52px;
	width: 52px;
	height: 52px;
	border-radius: 3px;
	object-fit: cover;
}

.faah-index__search-all {
	display: block;
	background: #f4f7f2;
	color: var(--faah-accent);
	font-weight: 600;
	padding: 11px 12px;
	text-align: center;
}

.faah-index__search-message {
	margin: 0;
	padding: 12px;
}

.faah-index__filter-status {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
	border-left: 4px solid var(--faah-accent);
	background: #f4f7f2;
	padding: 10px 14px;
}

.faah-index__reset {
	flex: 0 0 auto;
	font-weight: 600;
	white-space: nowrap;
}

.faah-index__controls {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
	gap: 8px;
}

.faah-index__group {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	min-width: 0;
	min-height: 48px;
	border: 1px solid var(--faah-border);
	border-radius: 4px;
	background: #fff;
	color: #333;
	font: inherit;
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: anywhere;
	padding: 10px 14px;
	text-align: left;
	white-space: normal;
	cursor: pointer;
}

.faah-index__group:hover,
.faah-index__group:focus-visible,
.faah-index__group.is-open {
	border-color: var(--faah-accent);
	color: var(--faah-accent);
}

.faah-index__group:focus-visible,
.faah-index__item:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--faah-accent) 35%, transparent);
	outline-offset: 2px;
}

.faah-index__chevron {
	width: 9px;
	height: 9px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	transition: transform 160ms ease;
}

.faah-index__group.is-open .faah-index__chevron {
	transform: rotate(225deg) translate(-2px, -2px);
}

.faah-index__panel {
	min-width: 0;
	max-width: 100%;
	margin-top: 8px;
	border: 1px solid var(--faah-border);
	border-radius: 4px;
	background: #fff;
	padding: 14px;
}

.faah-index__items {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.faah-index__items > li {
	min-width: 0;
	margin: 0;
}

.faah-index__item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 8px;
	min-width: 0;
	width: 100%;
	height: 100%;
	border: 1px solid #e7e7e7;
	border-radius: 3px;
	background: #fafafa;
	color: inherit;
	line-height: 1.35;
	padding: 9px 11px;
	text-decoration: none;
	white-space: normal;
}

.faah-index__item > span:first-child {
	min-width: 0;
	hyphens: auto;
	overflow-wrap: anywhere;
}

.faah-index__item:hover {
	border-color: var(--faah-accent);
	color: var(--faah-accent);
}

.faah-index__count {
	flex: 0 0 auto;
	min-width: 24px;
	border-radius: 999px;
	background: #ededed;
	color: #555;
	font-size: 12px;
	line-height: 1;
	padding: 6px;
	text-align: center;
	white-space: nowrap;
}

@media (max-width: 520px) {
	.faah-index__controls,
	.faah-index__items {
		grid-template-columns: 1fr;
	}

	.faah-index__filter-status {
		align-items: flex-start;
		flex-direction: column;
	}

	.faah-index__search-thumbnail {
		flex-basis: 44px;
		width: 44px;
		height: 44px;
	}

	.faah-index__search-button {
		padding-right: 14px;
		padding-left: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.faah-index__chevron {
		transition: none;
	}
}
