/* purpose: MD Search — Google-style home, results, special pages, browser */
/* author: MD Hub */
/* date: 2026-11-04 */

.mds-root {
	--mds-blue: #1a73e8;
	--mds-blue-h: #1765cc;
	--mds-text: #202124;
	--mds-muted: #4d5156;
	--mds-link: #1a0dab;
	--mds-link-v: #681da8;
	--mds-green: #188038;
	--mds-border: #dfe1e5;
	--mds-bg: #fff;
	--mds-chip: #f1f3f4;
	--mds-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
	--mds-radius: 24px;
	color: var(--mds-text);
	background: var(--mds-bg);
	font-family: arial, sans-serif;
	min-height: 100%;
	display: flex;
	flex-direction: column;
	position: relative;
}
body.ap-kind-md_search #ap_workspace,
body.ap-kind-md_search #md_search_root {
	min-height: 0;
	flex: 1;
}
body.ap-kind-md_search #ap_workspace {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.mds-root[data-view="home"] {
	justify-content: center;
}
.mds-home {
	width: min(100%, 640px);
	margin: 0 auto;
	padding: 24px 16px 48px;
	text-align: center;
}
.mds-logo-wrap {
	margin-bottom: 28px;
}
.mds-logo {
	font-size: clamp(42px, 9vw, 72px);
	font-weight: 700;
	letter-spacing: -1px;
	line-height: 1.1;
	user-select: none;
}
.mds-l.mds-b { color: #4285f4; }
.mds-l.mds-r { color: #ea4335; }
.mds-l.mds-y { color: #fbbc05; }
.mds-l.mds-b2 { color: #4285f4; }
.mds-l.mds-g { color: #34a853; }
.mds-tagline {
	margin: 10px 0 0;
	color: var(--mds-muted);
	font-size: 14px;
}
.mds-search-form {
	position: relative;
}
.mds-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	border: 1px solid var(--mds-border);
	border-radius: var(--mds-radius);
	padding: 6px 10px 6px 14px;
	background: #fff;
	box-shadow: none;
	transition: box-shadow .15s ease, border-color .15s ease;
}
.mds-bar:hover,
.mds-bar:focus-within {
	box-shadow: var(--mds-shadow);
	border-color: transparent;
}
.mds-bar-sm {
	border-radius: 22px;
	padding: 4px 8px 4px 12px;
}
.mds-bar-ico {
	color: #9aa0a6;
	font-size: 15px;
}
.mds-input {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: none;
	font-size: 16px;
	background: transparent;
	color: var(--mds-text);
	padding: 8px 0;
}
.mds-bar-btn,
.mds-bar-go {
	border: 0;
	background: transparent;
	color: #5f6368;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.mds-bar-go {
	color: var(--mds-blue);
	background: #e8f0fe;
}
.mds-bar-go:hover {
	background: #d2e3fc;
}
.mds-home-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: center;
	margin-top: 22px;
}
.mds-pill {
	border: 1px solid transparent;
	background: #f8f9fa;
	color: #3c4043;
	font-size: 14px;
	padding: 10px 16px;
	border-radius: 4px;
	cursor: pointer;
}
.mds-pill:hover {
	border-color: #dadce0;
	box-shadow: 0 1px 1px rgba(0,0,0,.05);
}
.mds-pill-primary {
	background: var(--mds-blue);
	color: #fff;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
}
.mds-pill-primary:hover {
	background: var(--mds-blue-h);
	color: #fff;
}
.mds-shortcuts {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin-top: 28px;
}
.mds-chip {
	border: 1px solid var(--mds-border);
	background: #fff;
	color: #3c4043;
	font-size: 13px;
	padding: 8px 12px;
	border-radius: 999px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.mds-chip:hover {
	background: var(--mds-chip);
}
.mds-chip i {
	color: var(--mds-blue);
}

.mds-suggest {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 4px);
	background: #fff;
	border: 1px solid var(--mds-border);
	border-radius: 12px;
	box-shadow: var(--mds-shadow);
	z-index: 40;
	text-align: left;
	overflow: hidden;
}
.mds-suggest button {
	display: flex;
	width: 100%;
	align-items: center;
	gap: 10px;
	border: 0;
	background: transparent;
	padding: 10px 14px;
	cursor: pointer;
	color: var(--mds-text);
	font-size: 14px;
}
.mds-suggest button:hover,
.mds-suggest button.on {
	background: #f1f3f4;
}
.mds-suggest i {
	color: #9aa0a6;
}

.mds-results-shell {
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1;
}
.mds-top {
	display: grid;
	grid-template-columns: auto minmax(0, 720px) auto;
	align-items: center;
	gap: 12px 16px;
	padding: 12px 16px 4px;
	border-bottom: 1px solid #ebebeb;
	background: #fff;
	position: sticky;
	top: 0;
	z-index: 20;
}
.mds-brand {
	border: 0;
	background: transparent;
	cursor: pointer;
	font-weight: 700;
	font-size: 22px;
	letter-spacing: -0.5px;
	padding: 4px 0;
	white-space: nowrap;
}
.mds-brand-m { color: #4285f4; }
.mds-brand-d { color: #ea4335; }
.mds-brand-s { color: #34a853; margin-left: 2px; font-size: 18px; }
.mds-top-form {
	width: 100%;
}
.mds-top-tools {
	display: flex;
	align-items: center;
	justify-content: flex-end;
}
.mds-ai-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--mds-muted);
	cursor: pointer;
	user-select: none;
}
.mds-tabs {
	display: flex;
	gap: 4px;
	padding: 0 16px;
	overflow-x: auto;
	border-bottom: 1px solid #ebebeb;
	scrollbar-width: none;
}
.mds-tabs::-webkit-scrollbar { display: none; }
.mds-tab {
	border: 0;
	background: transparent;
	color: #5f6368;
	font-size: 13px;
	padding: 12px 12px 10px;
	cursor: pointer;
	border-bottom: 3px solid transparent;
	white-space: nowrap;
}
.mds-tab.on {
	color: var(--mds-blue);
	border-bottom-color: var(--mds-blue);
	font-weight: 600;
}
.mds-body {
	flex: 1;
	min-height: 0;
	overflow: auto;
	padding: 12px 16px 40px;
}
.mds-status {
	color: var(--mds-muted);
	font-size: 13px;
	margin: 4px 0 12px;
	max-width: 1100px;
}
.mds-layout {
	display: grid;
	grid-template-columns: minmax(0, 720px) minmax(240px, 360px);
	gap: 28px;
	align-items: start;
	max-width: 1100px;
}
.mds-layout.mds-no-side {
	grid-template-columns: minmax(0, 720px);
}
.mds-main {
	min-width: 0;
}
.mds-side {
	min-width: 0;
}

.mds-ai-card,
.mds-instant,
.mds-special,
.mds-knowledge {
	border: 1px solid var(--mds-border);
	border-radius: 12px;
	padding: 14px 16px;
	margin-bottom: 16px;
	background: #fff;
}
.mds-ai-card h3,
.mds-knowledge h3,
.mds-special h2 {
	margin: 0 0 8px;
	font-size: 16px;
	font-weight: 600;
}
.mds-ai-card p,
.mds-knowledge p,
.mds-special p {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--mds-text);
}
.mds-knowledge-img {
	width: 100%;
	max-height: 160px;
	object-fit: cover;
	border-radius: 8px;
	margin-bottom: 10px;
	background: #f1f3f4;
}
.mds-knowledge .mds-desc {
	color: var(--mds-muted);
	font-size: 12px;
	margin-bottom: 6px;
}
.mds-knowledge a,
.mds-result a {
	color: var(--mds-link);
	text-decoration: none;
}
.mds-knowledge a:visited,
.mds-result a:visited {
	color: var(--mds-link-v);
}
.mds-result {
	margin: 0 0 18px;
}
.mds-result .mds-url {
	font-size: 12px;
	color: var(--mds-green);
	margin-bottom: 2px;
	word-break: break-all;
}
.mds-result h3 {
	margin: 0 0 4px;
	font-size: 18px;
	font-weight: 400;
	line-height: 1.3;
}
.mds-result .mds-snip {
	font-size: 14px;
	line-height: 1.5;
	color: var(--mds-muted);
}
.mds-result-actions {
	display: flex;
	gap: 8px;
	margin-top: 6px;
}
.mds-result-actions button {
	border: 0;
	background: transparent;
	color: var(--mds-blue);
	font-size: 12px;
	cursor: pointer;
	padding: 0;
}

.mds-special-elections .mds-elec-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 10px;
	margin-top: 12px;
}
.mds-special-elections .mds-elec-card {
	background: #f8f9fa;
	border-radius: 10px;
	padding: 12px;
}
.mds-special-elections .mds-elec-card strong {
	display: block;
	font-size: 13px;
	margin-bottom: 4px;
}
.mds-special-elections .mds-elec-card span {
	font-size: 12px;
	color: var(--mds-muted);
	line-height: 1.4;
}
.mds-states {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 12px;
}
.mds-states span {
	background: #e8f0fe;
	color: #1967d2;
	font-size: 12px;
	padding: 4px 10px;
	border-radius: 999px;
}
.mds-qlinks {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 12px;
}
.mds-qlinks a {
	font-size: 13px;
	color: var(--mds-link);
	text-decoration: none;
}
.mds-qlinks a:hover {
	text-decoration: underline;
}

.mds-special-stocks .mds-quote-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 10px 16px;
}
.mds-special-stocks .mds-price {
	font-size: 28px;
	font-weight: 600;
}
.mds-special-stocks .mds-chg.up { color: #137333; }
.mds-special-stocks .mds-chg.down { color: #c5221f; }
.mds-quote-meta {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin-top: 12px;
	font-size: 12px;
	color: var(--mds-muted);
}
.mds-quote-meta strong {
	color: var(--mds-text);
	display: block;
	font-size: 13px;
}
.mds-chart {
	width: 100%;
	height: 120px;
	margin-top: 12px;
	display: block;
}
.mds-tickers {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 12px;
}
.mds-tickers button {
	border: 1px solid var(--mds-border);
	background: #fff;
	border-radius: 6px;
	padding: 4px 8px;
	font-size: 12px;
	cursor: pointer;
	color: var(--mds-blue);
}

.mds-listen,
.mds-watch {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}
.mds-listen a,
.mds-watch a {
	border: 1px solid var(--mds-border);
	border-radius: 999px;
	padding: 6px 12px;
	font-size: 12px;
	color: var(--mds-text);
	text-decoration: none;
	background: #f8f9fa;
}
.mds-listen a:hover,
.mds-watch a:hover {
	background: #e8f0fe;
}

.mds-empty {
	padding: 40px 8px;
	color: var(--mds-muted);
	font-size: 14px;
}
.mds-loading {
	padding: 24px 8px;
	color: var(--mds-muted);
	font-size: 14px;
}
.mds-loading i {
	margin-right: 8px;
	color: var(--mds-blue);
}

.mds-browser {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
}
.mds-browser-bar {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 10px;
	border-bottom: 1px solid var(--mds-border);
	background: #f8f9fa;
}
.mds-bbtn {
	border: 0;
	background: transparent;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #5f6368;
	cursor: pointer;
	text-decoration: none;
	flex: 0 0 auto;
}
.mds-bbtn:hover {
	background: #e8eaed;
}
.mds-browser-form {
	flex: 1;
	min-width: 0;
	display: flex;
	gap: 4px;
}
.mds-browser-input {
	flex: 1;
	min-width: 0;
	border: 1px solid var(--mds-border);
	border-radius: 999px;
	padding: 8px 14px;
	font-size: 14px;
	outline: none;
	background: #fff;
}
.mds-browser-input:focus {
	border-color: var(--mds-blue);
	box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}
.mds-browser-frame-wrap {
	flex: 1;
	min-height: 0;
	position: relative;
	background: #fff;
}
.mds-browser-frame {
	width: 100%;
	height: 100%;
	border: 0;
	background: #fff;
}
.mds-browser-fallback {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	background: #fff;
	padding: 24px;
	text-align: center;
	color: var(--mds-muted);
}

@media (max-width: 900px) {
	.mds-top {
		grid-template-columns: auto 1fr auto;
	}
	.mds-layout {
		grid-template-columns: 1fr;
	}
	.mds-side {
		order: -1;
	}
}
@media (max-width: 640px) {
	.mds-top {
		grid-template-columns: 1fr;
		gap: 8px;
	}
	.mds-brand {
		justify-self: start;
	}
	.mds-top-tools {
		justify-self: end;
		grid-row: 1;
		grid-column: 1;
	}
	.mds-body {
		padding: 8px 12px 32px;
	}
}
