.lgw-wrap {
	max-width: 1280px;
	margin: 0 auto;
	padding: 20px;
	color: var(--lgw-text);
}

.lgw-search {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 22px;
}

.lgw-search-label {
	display: block;
	font-weight: 700;
	margin-bottom: 10px;
	color: var(--lgw-text);
}

.lgw-search-row {
	display: flex;
	gap: 10px;
}

.lgw-search input[type="search"] {
	width: 100%;
	min-height: 48px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	padding: 0 14px;
	font-size: 16px;
	color: var(--lgw-text);
}

.lgw-search-reset,
.lgw-search button {
	border: 0;
	border-radius: 8px;
	background: var(--lgw-primary);
	color: #fff;
	font-weight: 700;
	padding: 0 20px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	text-decoration: none;
}

.lgw-search-reset,
.lgw-search button:hover {
	background: var(--lgw-accent);
	color: var(--lgw-primary);
}

.lgw-az {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 24px;
}

.lgw-az-item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	border-radius: 8px;
	background: #f3f4f6;
	color: var(--lgw-text);
	font-weight: 700;
	text-decoration: none;
	border: 1px solid #e5e7eb;
}

.lgw-az-item:hover,
.lgw-az-item.is-active {
	background: var(--lgw-accent);
	color: var(--lgw-primary) !important;
	border-color: var(--lgw-accent);
}

.lgw-kb-grid {
	display: grid;
	grid-template-columns: repeat(1, 1fr);
	gap: 18px;
}

.lgw-kb-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	transition: border-color .2s ease, background .2s ease;
}

.lgw-kb-card:hover {
	border-color: var(--lgw-accent);
	background: color-mix(in srgb, var(--lgw-accent) 7%, #fff);
}

.lgw-kb-card-link {
	display: flex;
	gap: 16px;
	padding: 20px;
	text-decoration: none !important;
	color: inherit;
}

.lgw-kb-icon {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	border-radius: 8px;
	background: var(--lgw-primary);
	color: var(--lgw-accent);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	font-weight: 800;
	line-height: 1;
}

.lgw-kb-content {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.lgw-kb-title {
	color: var(--lgw-heading);
	font-size: 20px;
	font-weight: 800;
	line-height: 1.3;
	margin-bottom: 8px;
}

.lgw-kb-card:hover .lgw-kb-title {
	text-decoration: underline;
	text-decoration-color: var(--lgw-underline);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.lgw-kb-text {
	color: var(--lgw-text);
	font-size: 15px;
	line-height: 1.55;
	margin-bottom: 12px;
}

.lgw-kb-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 13px;
	font-weight: 700;
	color: var(--lgw-text);
}

.lgw-kb-meta span {
	display: inline-flex;
	align-items: center;
	border-radius: 8px;
	background: #f3f4f6;
	padding: 5px 9px;
}

.lgw-kb-meta span:last-child {
	background: var(--lgw-accent);
	color: var(--lgw-primary);
}

.lgw-empty {
	background: #fff7ed;
	border: 1px solid #fed7aa;
	color: #9a3412;
	border-radius: 8px;
	padding: 18px;
	font-weight: 700;
}

.lgw-detail-box,
.lgw-related {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 24px;
	margin-top: 28px;
}

.lgw-detail-box h2,
.lgw-related h2 {
	margin-top: 0;
	margin-bottom: 18px;
	font-size: 26px;
	color: var(--lgw-text);
}

.lgw-detail-row {
	border-top: 1px solid #e5e7eb;
	padding: 16px 0;
}

.lgw-detail-row:first-of-type {
	border-top: 0;
	padding-top: 0;
}

.lgw-detail-row h3 {
	margin: 0 0 6px;
	font-size: 17px;
	color: var(--lgw-heading);
}

.lgw-detail-row p {
	margin: 0;
	color: var(--lgw-text);
	line-height: 1.7;
}

.lgw-badge {
	display: inline-flex;
	align-items: center;
	width: fit-content;
	border-radius: 8px;
	background: color-mix(in srgb, var(--lgw-accent) 18%, #fff);
	color: var(--lgw-primary);
	font-size: 13px;
	font-weight: 700;
	padding: 5px 10px;
	margin-bottom: 10px;
}

.lgw-related-list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.lgw-related-item {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	border-radius: 8px;
	background: #f3f4f6;
	color: var(--lgw-link);
	text-decoration: none;
	font-weight: 700;
	padding: 0 14px;
}

.lgw-related-item:hover {
	background: var(--lgw-primary);
	color: #fff !important;
}

.lgw-back-index-wrap {
	margin: 24px 0;
}

.lgw-back-index {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 42px;
	border-radius: 8px;
	background: var(--lgw-primary);
	color: #fff !important;
	text-decoration: none !important;
	font-weight: 700;
	padding: 0 18px;
}

.lgw-back-index:hover {
	background: var(--lgw-accent);
	color: var(--lgw-primary) !important;
	text-decoration: none;
}

.lgw-pagination {
	margin-top: 40px;
}

.lgw-pagination .page-numbers {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	list-style: none;
	padding: 0;
	margin: 0;
}

.lgw-pagination a,
.lgw-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 14px;
	border-radius: 8px;
	background: #f3f4f6;
	color: var(--lgw-text);
	text-decoration: none;
	font-weight: 700;
	border: 1px solid #e5e7eb;
}

.lgw-pagination .current {
	background: var(--lgw-primary);
	color: var(--lgw-accent) !important;
	border-color: var(--lgw-primary);
}

.lgw-pagination a:hover {
	background: var(--lgw-primary);
	color: var(--lgw-accent) !important;
	border-color: var(--lgw-primary);
}

.lgw-auto-link {
	position: relative;
	color: var(--lgw-link);
	font-weight: 700;
	text-decoration: underline;
	text-decoration-color: var(--lgw-underline);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.lgw-auto-link:hover {
	color: var(--lgw-accent);
	text-decoration-color: var(--lgw-link);
}

.lgw-auto-link[data-lgw-tooltip]:hover::after {
	content: attr(data-lgw-tooltip);
	position: absolute;
	left: 50%;
	bottom: calc(100% + 10px);
	transform: translateX(-50%);
	z-index: 9999;
	width: max-content;
	max-width: 320px;
	background: var(--lgw-primary);
	color: #fff;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.45;
	text-align: left;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
	pointer-events: none;
}

.lgw-auto-link[data-lgw-tooltip]:hover::before {
	content: "";
	position: absolute;
	left: 50%;
	bottom: calc(100% + 3px);
	transform: translateX(-50%);
	border-width: 7px 7px 0 7px;
	border-style: solid;
	border-color: var(--lgw-primary) transparent transparent transparent;
	z-index: 9999;
	pointer-events: none;
}

@media (max-width: 980px) {
	.lgw-kb-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 680px) {
	.lgw-wrap {
		padding: 14px;
	}

	.lgw-search-row {
		flex-direction: column;
	}

	.lgw-search button {
		min-height: 48px;
	}

	.lgw-kb-card-link {
		padding: 16px;
		gap: 12px;
	}

	.lgw-kb-icon {
		width: 42px;
		height: 42px;
		flex-basis: 42px;
		font-size: 19px;
	}

	.lgw-kb-title {
		font-size: 18px;
	}

	.lgw-detail-box,
	.lgw-related {
		padding: 18px;
	}
}
