:root {
	--text: #1a1a1a;
	--muted: #4d5156;
	--link: #1a0dab;
	--url: #1a7f37;
	--line: #ebebeb;
	--bg: #fff;
	--brand: #2b6cb0;
	--brand-dark: #1a365d;
	--accent: #dd6b20;
	--pill: #dfe1e5;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
	font-family: Arial, Helvetica, sans-serif;
	color: var(--text);
	background: var(--bg);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

a { color: var(--link); }

.topbar {
	display: flex;
	justify-content: flex-end;
	padding: 12px 20px;
}
.top-links { display: flex; gap: 18px; font-size: 13px; }
.top-links a { color: var(--text); text-decoration: none; }
.top-links a:hover { text-decoration: underline; }

.home {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 24px 16px 80px;
}
.logo-wrap {
	text-decoration: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 10px;
	line-height: 0;
}
.brand-home {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 22px;
}
.tagline {
	margin: 0;
	font-size: 16px;
	letter-spacing: 0.02em;
	color: var(--muted);
	line-height: 1.4;
}
.logo-img {
	height: auto;
	width: 260px;
	max-width: min(260px, 90vw);
	display: block;
	object-fit: contain;
}
.logo-img-small {
	height: 40px;
	width: auto;
	max-width: 160px;
	display: block;
	object-fit: contain;
}
.badge {
	display: inline-block;
	margin-left: 8px;
	font-size: 11px;
	text-transform: uppercase;
	color: #5f6368;
}
.product-row {
	display: flex;
	gap: 14px;
	align-items: flex-start;
}
.product-row .thumb { flex: 0 0 80px; }
.product-row img {
	width: 80px;
	height: 80px;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid var(--line);
}
.price { color: var(--accent); font-weight: 600; margin: 4px 0; font-size: 15px; }

.home-form, .results-form { width: min(584px, 92vw); position: relative; }
.search-pill {
	display: flex;
	align-items: center;
	border: 1px solid var(--pill);
	border-radius: 24px;
	padding: 6px 8px 6px 16px;
	background: #fff;
}
.search-pill:hover, .search-pill:focus-within {
	box-shadow: 0 1px 6px rgba(32,33,36,.28);
	border-color: transparent;
}
.search-pill .ico { width: 20px; height: 20px; color: #9aa0a6; margin-right: 10px; }
.search-pill input {
	flex: 1;
	border: 0;
	outline: 0;
	font-size: 16px;
	padding: 8px 0;
	background: transparent;
	min-width: 0;
}
.icon-btn {
	border: 0;
	background: transparent;
	cursor: pointer;
	padding: 8px;
	display: flex;
	color: var(--brand);
}
.home-actions {
	margin-top: 22px;
	display: flex;
	gap: 12px;
	justify-content: center;
}
.home-actions button {
	background: #f8f9fa;
	border: 1px solid #f8f9fa;
	border-radius: 4px;
	padding: 10px 16px;
	font-size: 14px;
	color: var(--muted);
	cursor: pointer;
}
.home-actions button:hover { border-color: #dadce0; box-shadow: 0 1px 1px rgba(0,0,0,.1); color: var(--brand-dark); }

.suggest {
	position: absolute;
	left: 0; right: 0; top: 100%;
	background: #fff;
	border: 1px solid #dfe1e5;
	border-top: 0;
	border-radius: 0 0 16px 16px;
	overflow: hidden;
	z-index: 20;
	box-shadow: 0 4px 6px rgba(32,33,36,.1);
}
.suggest a {
	display: block;
	padding: 10px 20px;
	text-decoration: none;
	color: var(--text);
	font-size: 15px;
}
.suggest a:hover, .suggest a.active { background: #f1f3f4; }

.results-page { display: none; flex: 1; flex-direction: column; }
.results-page.show { display: flex; }
.home.hide { display: none; }
body.has-query .topbar { display: none; }

.results-top {
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 16px 24px 8px;
	border-bottom: 1px solid var(--line);
}
.logo-small {
	display: flex;
	align-items: center;
	text-decoration: none;
	flex: 0 0 auto;
}
.tabs {
	display: flex;
	gap: 18px;
	padding: 0 24px;
	margin-left: 170px;
	border-bottom: 1px solid var(--line);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	white-space: nowrap;
}
.tabs a {
	display: inline-block;
	padding: 12px 0 10px;
	text-decoration: none;
	color: #5f6368;
	font-size: 14px;
	border-bottom: 3px solid transparent;
	flex: 0 0 auto;
}
.tabs a.active { color: var(--brand); border-bottom-color: var(--accent); font-weight: 600; }
.stats { color: #70757a; font-size: 14px; padding: 12px 24px 0; margin-left: 170px; }
.layout { max-width: 652px; padding: 8px 24px 48px; margin-left: 170px; }

.answer {
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 16px;
	margin: 0 0 22px;
}
.answer h2 { margin: 0 0 8px; font-size: 20px; font-weight: 400; }
.answer p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.answer img { float: right; width: 100px; height: 100px; object-fit: cover; border-radius: 8px; margin: 0 0 8px 12px; }

.result { margin: 0 0 26px; }
.result h3 { margin: 0 0 2px; font-size: 20px; font-weight: 400; line-height: 1.3; }
.result h3 a { text-decoration: none; }
.result h3 a:hover { text-decoration: underline; }
.cite { color: var(--url); font-size: 14px; }
.snip { color: var(--muted); font-size: 14px; line-height: 1.58; margin-top: 4px; }
.empty { padding: 40px 0; color: var(--muted); }

.pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	margin: 36px 0 56px;
	font-size: 15px;
}
.pager a, .pager span {
	min-width: 36px;
	padding: 8px 10px;
	text-align: center;
	text-decoration: none;
	border-radius: 4px;
}
.pager a { color: var(--link); }
.pager a:hover { text-decoration: underline; }
.pager .current {
	color: var(--accent);
	font-weight: 700;
	border-bottom: 3px solid var(--accent);
}
.pager .prev, .pager .next { min-width: auto; padding: 8px 12px; }

.site-footer {
	background: #f2f2f2;
	color: #70757a;
	font-size: 14px;
	margin-top: auto;
}
.site-footer .loc { margin: 0; padding: 12px 24px; border-bottom: 1px solid #dadce0; }
.footer-row {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px 24px;
}
.footer-row a {
	color: #70757a;
	text-decoration: none;
	margin-right: 18px;
	font-size: 14px;
}
.footer-row a:hover { text-decoration: underline; }

.page {
	max-width: 720px;
	margin: 40px auto 80px;
	padding: 0 20px;
	line-height: 1.6;
}
.page h1 { font-weight: 400; }

.admin-body { background: #f8f9fa; }
.admin { max-width: 860px; margin: 40px auto; background: #fff; padding: 28px; border-radius: 12px; border: 1px solid var(--line); }
.admin h1 { margin-top: 0; }
.admin h2 { font-size: 18px; font-weight: 600; margin: 28px 0 12px; }
.admin label { display: block; margin: 12px 0; font-weight: 600; }
.admin input[type=text], .admin input[type=password] { width: 100%; padding: 10px; border: 1px solid #dadce0; border-radius: 8px; margin-top: 6px; }
.admin .hint { margin: 0 0 16px; text-align: left; color: var(--muted); font-size: 14px; }
.admin-nav { font-size: 14px; }
.admin-error { color: #c5221f; }
.code { background: #202124; color: #e8eaed; padding: 12px; border-radius: 8px; overflow: auto; font-size: 12px; }
.btn {
	display: inline-block;
	margin-top: 8px;
	padding: 10px 18px;
	border: 0;
	border-radius: 8px;
	background: var(--brand);
	color: #fff;
	font-size: 14px;
	cursor: pointer;
}
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 24px; }
.stat-card { background: #f8f9fa; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.stat-card strong { display: block; font-size: 22px; color: #202124; }
.stat-card span { color: #5f6368; font-size: 12px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0 0 24px; }
.data-table th, .data-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); word-break: break-word; }
.data-table th { color: #5f6368; font-weight: 600; }
@media (max-width: 700px) {
	.stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
	.logo-img { width: 260px; height: auto; }
	.tabs, .stats, .layout { margin-left: 0; padding-left: 16px; padding-right: 16px; }
	.results-top { flex-wrap: wrap; gap: 12px; }
}
