/**
 * Shared UI: footer, districts page, manifesto toolbar/popup, schemes index themes.
 * Load after layout.css + style.css. Manifesto category card colors: _manifesto-cards.css
 */

/* —— Site footer (footer.php): grid (credit | org | social) then campaign PNG below —— */
.site-footer {
	--site-footer-pad-x: 22px;
	--site-footer-pad-y: 20px;
	margin-top: 36px;
	padding: var(--site-footer-pad-y) var(--site-footer-pad-x) 0;
	background: linear-gradient(180deg, #f0f4fb 0%, #e4eaf5 100%);
	border: 1px solid #d0d9ea;
	border-radius: 14px;
	box-shadow: 0 4px 24px rgba(15, 21, 32, 0.06);
	overflow: hidden;
}

.site-footer__inner.site-footer__grid {
	display: grid;
	grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
	align-items: center;
	gap: clamp(18px, 3vw, 32px);
	max-width: 100%;
	box-sizing: border-box;
	padding-bottom: var(--site-footer-pad-y);
}

.site-footer__campaign {
	margin: 0 calc(-1 * var(--site-footer-pad-x));
	padding: 0;
	box-sizing: border-box;
}

.site-footer__campaign-inner {
	/* background: #050508; */
	/* border-top: 1px solid #c5d0e3; */
	padding: clamp(16px, 4vw, 28px) var(--site-footer-pad-x) clamp(20px, 4vw, 30px);
	text-align: center;
	box-sizing: border-box;
}

.site-footer__campaign-img {
	display: block;
	width: 100%;
	max-width: min(100%, 820px);
	height: auto;
	margin: 0 auto;
}

.site-footer__campaign-img--dark {
	display: none;
}

html[data-theme="dark"] .site-footer__campaign-img--light {
	display: none;
}

html[data-theme="dark"] .site-footer__campaign-img--dark {
	display: block;
}
.site-footer__col--credit {
	justify-self: start;
}
.site-footer__col--address {
	justify-self: stretch;
	min-width: 0;
	text-align: center;
}
.site-footer__col--social {
	justify-self: end;
}
.site-footer__credit-box {
	/* background: var(--red, #d92b32); */
	color: var(--ink, #0f1520);
	padding: 12px 18px;
	/* border-radius: 10px; */
	/* box-shadow: 0 4px 14px rgba(217, 43, 50, 0.22); */
	max-width: 100%;
	box-sizing: border-box;
}
.site-footer__credit-box .footer {
	margin: 0;
	font-size: 0.82rem;
	line-height: 1.45;
	font-weight: 600;
	color: var(--ink, #0f1520);
}
.site-footer__credit-box .footer--credit {
	font-weight: 600;
}
.site-footer__credit-box .footer-credit {
	color: var(--red, #d92b32);
	font-weight: 700;
	text-decoration: none;
}
.site-footer__credit-box .footer-credit:hover {
	text-decoration: underline;
	color: #fff;
}
.site-footer__org {
	margin: 0 0 8px;
	font-size: 0.94rem;
	font-weight: 700;
	line-height: 1.45;
	color: var(--ink, #0f1520);
	font-family: "Mukta Malar", system-ui, sans-serif;
}

.site-footer__org-line1,
.site-footer__org-line2 {
	display: inline;
	font-weight: inherit;
}

.site-footer__addr {
	margin: 0;
	font-size: 0.86rem;
	line-height: 1.55;
	color: var(--ink2, #374151);
	font-family: "Mukta Malar", system-ui, sans-serif;
}

.site-footer__addr-line1,
.site-footer__addr-line2 {
	display: inline;
	font-weight: inherit;
}
.site-footer .footer--tagline {
	margin-bottom: 10px;
	font-size: 0.86rem;
	color: #64748b;
}
.site-footer__media + .site-footer {
	margin-top: 0;
}

.site-footer__social {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	align-items: center;
	gap: 12px 14px;
	margin: 0;
	padding: 0;
}

@media (max-width: 900px) {
	.site-footer__inner.site-footer__grid {
		grid-template-columns: 1fr;
		justify-items: center;
		gap: 20px;
	}
	.site-footer__col--credit,
	.site-footer__col--address,
	.site-footer__col--social {
		justify-self: center;
		width: 100%;
	}
	.site-footer__col--social {
		display: flex;
		justify-content: center;
	}
	.site-footer__social {
		justify-content: center;
	}

	/* Org title: break after first comma on narrow screens */
	.site-footer__org-line2 {
		display: block;
		margin-top: 4px;
	}

	/* Address: “Chennai - …” on its own line */
	.site-footer__addr-line2 {
		display: block;
		margin-top: 4px;
	}
}

.site-footer__social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 12px;
	/* background: rgba(255, 255, 255, 0.92);
	border: 1px solid #e2e8f0; */
	/* box-shadow: 0 2px 8px rgba(15, 21, 32, 0.06); */
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.site-footer__social-link:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(15, 21, 32, 0.12);
	border-color: #cbd5e1;
}

.site-footer__social-link:focus-visible {
	outline: 2px solid #d92b32;
	outline-offset: 2px;
}

.site-footer__social-img {
	display: block;
	width: 24px;
	height: 24px;
	object-fit: contain;
	pointer-events: none;
}

.site-footer__social-img--dark {
	display: none;
}

/* —— Footer embedded media (YouTube): above .site-footer; legacy district class names —— */
.site-footer__media,
.district-page .district-page__footer-media {
	margin-top: 36px;
	margin-bottom: 16px;
	padding: 0;
}
.site-footer__media-youtube,
.district-page .district-page__footer-media-youtube {
	position: relative;
	width: 100%;
	max-width: 920px;
	margin: 0 auto;
	min-height: 400px;
	aspect-ratio: 16 / 9;
	height: auto;
	overflow: hidden;
	border-radius: 14px;
	border: 1px solid var(--line, #dde3f0);
	box-shadow: 0 8px 32px rgba(15, 21, 32, 0.1);
	background: #0f1520;
}
.site-footer__media-iframe,
.district-page .district-page__footer-media-iframe {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 2;
	width: 100%;
	height: 100%;
	border: 0;
}
.site-footer__media-hint,
.district-page .district-page__footer-media-hint {
	margin: 0 auto;
	max-width: 42rem;
	padding: 14px 16px;
	text-align: center;
	font-size: 0.88rem;
	line-height: 1.5;
	color: var(--muted, #64748b);
	background: var(--surface, #fff);
	border: 1px dashed var(--line2, #c9d3e6);
	border-radius: 12px;
}
.site-footer__media-hint code,
.district-page .district-page__footer-media-hint code {
	font-size: 0.82em;
	word-break: break-all;
}

/* —— Schemes index: department card themes —— */
.schemes-index .grid .card {
	animation: fadeUp 0.35s ease both;
	animation-delay: var(--anim-delay, 0s);
}
.schemes-index .card.scheme-dept-edu .card-top {
	background: linear-gradient(90deg, #221f20, #221f2088);
}
.schemes-index .card.scheme-dept-edu .dept-emoji {
	background: #f5f3ff;
	color: #221f20;
}
.schemes-index .card.scheme-dept-trans .card-top {
	background: linear-gradient(90deg, #7c3aed, #7c3aed88);
}
.schemes-index .card.scheme-dept-trans .dept-emoji {
	background: #f5f3ff;
	color: #7c3aed;
}
.schemes-index .card.scheme-dept-health .card-top {
	background: linear-gradient(90deg, #221f20, #221f20b0);
}
.schemes-index .card.scheme-dept-health .dept-emoji {
	background: #ecfdf5;
	color: #059669;
}
.schemes-index .card.scheme-dept-women .card-top {
	background: linear-gradient(90deg, #db2777, #db277788);
}
.schemes-index .card.scheme-dept-women .dept-emoji {
	background: #fdf2f8;
	color: #db2777;
}
.schemes-index .card.scheme-dept-agri .card-top {
	background: linear-gradient(90deg, #6d4c41, #6d4c4188);
}
.schemes-index .card.scheme-dept-agri .dept-emoji {
	background: #efebe9;
	color: #5d4037;
}
.schemes-index .card.scheme-dept-sports .card-top {
	background: linear-gradient(90deg, #d97706, #d9770688);
}
.schemes-index .card.scheme-dept-sports .dept-emoji {
	background: #fffbeb;
	color: #d97706;
}
.schemes-index .card.scheme-dept-skill .card-top {
	background: linear-gradient(90deg, #0891b2, #0891b288);
}
.schemes-index .card.scheme-dept-skill .dept-emoji {
	background: #ecfeff;
	color: #0891b2;
}
.schemes-index .card.scheme-dept-social .card-top {
	background: linear-gradient(90deg, #9333ea, #9333ea88);
}
.schemes-index .card.scheme-dept-social .dept-emoji {
	background: #faf5ff;
	color: #9333ea;
}
.schemes-index .card.scheme-dept-house .card-top {
	background: linear-gradient(90deg, #0ea5e9, #0ea5e988);
}
.schemes-index .card.scheme-dept-house .dept-emoji {
	background: #ecfeff;
	color: #0ea5e9;
}
.schemes-index .card.scheme-dept-water .card-top {
	background: linear-gradient(90deg, #0284c7, #0284c788);
}
.schemes-index .card.scheme-dept-water .dept-emoji {
	background: #e0f2fe;
	color: #0284c7;
}
.schemes-index .card.scheme-dept-energy .card-top {
	background: linear-gradient(90deg, #f97316, #f9731688);
}
.schemes-index .card.scheme-dept-energy .dept-emoji {
	background: #fff7ed;
	color: #f97316;
}
.schemes-index .card.scheme-dept-env .card-top {
	background: linear-gradient(90deg, #c70404, #df212188);
}
.schemes-index .card.scheme-dept-env .dept-emoji {
	background: #ecfdf5;
	color: #16a34a;
}
.schemes-index .card.scheme-dept-emp .card-top {
	background: linear-gradient(90deg, #6d28d9, #6d28d988);
}
.schemes-index .card.scheme-dept-emp .dept-emoji {
	background: #f5f3ff;
	color: #6d28d9;
}
.schemes-index .card.scheme-dept-urban .card-top {
	background: linear-gradient(90deg, #0d9488, #0d948888);
}
.schemes-index .card.scheme-dept-urban .dept-emoji {
	background: #ccfbf1;
	color: #0d9488;
}
.schemes-index .card.scheme-dept-rural .card-top {
	background: linear-gradient(90deg, #b45309, #b4530988);
}
.schemes-index .card.scheme-dept-rural .dept-emoji {
	background: #fffbeb;
	color: #b45309;
}
.schemes-index .card.scheme-dept-default .card-top {
	background: linear-gradient(90deg, #d92b32, #d92b3288);
}
.schemes-index .card.scheme-dept-default .dept-emoji {
	background: #fff1f1;
	color: #d92b32;
}

/* —— Department row: pill badge (uses --dept-accent); dept-emoji uses scheme background only —— */
.schemes-index .card .dept-row {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: 8px;
	max-width: 100%;
	margin-bottom: 10px;
	padding: 4px 12px 4px 4px;
	border-radius: 999px;
	/* border: 1px solid color-mix(in srgb, var(--dept-accent, #d92b32) 26%, transparent);
	background: linear-gradient(
		180deg,
		color-mix(in srgb, var(--dept-accent, #d92b32) 9%, #ffffff) 0%,
		color-mix(in srgb, var(--dept-accent, #d92b32) 14%, #ffffff) 100%
	);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.85) inset,
		0 1px 2px rgba(15, 21, 32, 0.05),
		0 4px 12px color-mix(in srgb, var(--dept-accent, #d92b32) 8%, transparent); */
}
/* dept-emoji: only scheme background (+ color) from .scheme-dept-* .dept-emoji — no extra chrome */
.schemes-index .card .dept-row .dept-name {
	min-width: 0;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-transform: none;
	letter-spacing: 0.03em;
	font-size: 0.74rem;
	font-weight: 800;
	color: color-mix(in srgb, var(--dept-accent, #d92b32) 42%, var(--muted));
}

/* Manifesto hero + dropdown: stack above card grid; hero overflow must not clip the list */
.manifesto-app .hero.hero--schemes {
	overflow: visible;
	z-index: 4;
}
.manifesto-app section.manifesto-grid {
	position: relative;
	z-index: 1;
}

.manifesto-app .dept-name {
	font-size: 12px;
}

/* —— Manifesto: selector bar (matches districts .selector-bar pattern) —— */
.manifesto-app .selector-bar {
	background: var(--surface);
	border-radius: 14px;
	padding: 0px 0px;
	margin: 16px 0 0;
	box-shadow: 0 1px 4px rgba(15, 21, 32, 0.04);
	position: relative;
	z-index: 20;
}
.manifesto-app .selector-bar .sel-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.manifesto-app .selector-bar .sel-group label {
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--ink2);
	font-family: "Mukta Malar", sans-serif;
}

/* Manifesto category filter — same control pattern as schemes index toolbar */
.manifesto-app .selector-bar .manifesto-toolbar__category {
	flex: 0 1 auto;
	width: 100%;
	max-width: min(100%, 480px);
	min-width: 0;
	position: relative;
}
.manifesto-app .selector-bar .search-category-btn {
	width: 100%;
	margin: 0;
	border: 1.5px solid var(--line2);
	border-radius: 12px;
	padding: 11px 32px 11px 14px;
	background-color: var(--surface2);
	color: var(--ink);
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 700;
	cursor: pointer;
	text-align: left;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	-webkit-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
}
.manifesto-app .selector-bar .search-category-btn:focus {
	outline: none;
}
.manifesto-app .selector-bar .search-category-btn:focus-visible {
	box-shadow: inset 0 0 0 2px rgba(217, 43, 50, 0.35);
}
.manifesto-app .selector-bar .search-category-dropdown {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 6px);
	z-index: 200;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	background: var(--surface);
	color: var(--ink);
	border: 1px solid var(--line2);
	border-radius: 14px;
	box-shadow: 0 12px 36px rgba(15, 21, 32, 0.14);
	max-height: min(60vh, 320px);
	overflow-y: auto;
}
.manifesto-app .selector-bar .search-category-dropdown__item {
	padding: 10px 14px;
	font-size: 0.9rem;
	font-weight: 700;
	cursor: pointer;
	border-radius: 8px;
	margin: 2px 6px;
	transition: background 0.12s ease;
}
.manifesto-app .selector-bar .search-category-dropdown__item:hover {
	background: rgba(217, 43, 50, 0.08);
}
.manifesto-app .selector-bar .search-category-dropdown__item[aria-selected="true"] {
	background: #2563eb;
	color: #fff;
}
.manifesto-app .selector-bar .search-category-dropdown__item[aria-selected="true"]:hover {
	background: #1d4ed8;
	color: #fff;
}
.manifesto-toolbar__btn {
	border: 1px solid #c7d2e8;
	background: #ffffff;
	color: #1e293b;
	padding: 7px 12px;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 700;
}
.manifesto-toolbar__btn:hover {
	border-color: #d92b32;
	color: #d92b32;
}

@media (max-width: 640px) {
	.manifesto-app .selector-bar .search-category-btn {
		width: 100%;
		min-width: 0;
	}
}

/* —— Manifesto popup —— */
.manifesto-popup {
	position: fixed;
	inset: 0;
	z-index: 9999;
}

/* Toast above manifesto modal (layout .toast defaults to z-index 200) */
#manifestoToast.toast {
	z-index: 10050;
	white-space: normal;
	max-width: min(92vw, 360px);
	text-align: center;
	line-height: 1.35;
}
.manifesto-popup__overlay {
	position: absolute;
	inset: 0;
	background: rgba(8, 14, 28, 0.55);
}
.manifesto-popup__panel {
	position: relative;
	max-width: 860px;
	margin: 5vh auto 0;
	background: #fff;
	border-radius: 16px;
	border: 1px solid #dde3f0;
	box-shadow: 0 16px 56px rgba(15, 21, 32, 0.2);
	overflow: hidden;
}
.manifesto-popup__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	padding: 14px 18px;
	border-bottom: 1px solid #e5e7eb;
}
.manifesto-popup__title {
	margin: 0;
	font-size: 1.02rem;
	color: #0f172a;
	font-weight: 800;
}
.manifesto-popup__actions {
	display: flex;
	gap: 8px;
}
.manifesto-popup__btn {
	border: 1px solid #cbd5e1;
	background: #f8fafc;
	border-radius: 8px;
	padding: 5px 10px;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}
.manifesto-popup__btn:hover {
	border-color: #d92b32;
	color: #d92b32;
}
.manifesto-popup__btn--download {
	font-weight: 600;
}
.manifesto-popup__btn--share {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 5px 8px;
	min-width: 36px;
}
.manifesto-popup__btn--share .manifesto-popup__share-icon {
	display: block;
}
.manifesto-popup__body {
	padding: 16px 22px 22px;
	max-height: min(68vh, 720px);
	overflow: auto;
	overflow-anchor: none;
	color: #1f2937;
	line-height: 1.65;
	font-size: 0.95rem;
}
.manifesto-popup__line {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 14px;
}
.manifesto-popup__num {
	flex-shrink: 0;
	min-width: 2em;
	font-weight: 800;
	color: #d92b32;
	line-height: 1.65;
}
.manifesto-popup__text {
	flex: 1;
	min-width: 0;
	overflow-wrap: break-word;
	word-break: break-word;
	line-height: 1.65;
}
.manifesto-popup__more {
	margin: 8px 0 0;
	padding-top: 6px;
	color: #6b7280;
	font-size: 0.92rem;
}

.manifesto-card.manifesto-card--hidden {
	display: none !important;
}

.manifesto-app .manifesto-card .card-body {
	cursor: pointer;
}

@media (max-width: 480px) {
	.manifesto-popup__panel {
		margin: 2vh 10px 0;
		border-radius: 12px;
	}
}

/* —— Districts page —— */
body.district-page {
	font-family: "Mukta Malar", sans-serif;
	line-height: 1.7;
	overscroll-behavior-x: none;
}

@media (max-width: 768px) {
	body.district-page {
		touch-action: pan-y pinch-zoom;
	}
}

/* Same max-width as .manifesto-app / .wrap (1240px); keep min-width for flex overflow */
.manifesto-app.district-page {
	min-width: 0;
	box-sizing: border-box;
}
.manifesto-app.district-page .hero.hero--schemes {
	max-width: 100%;
	box-sizing: border-box;
}
.manifesto-app.district-page .hero--schemes .hero__grid,
.manifesto-app.district-page .hero--schemes .hero__copy,
.manifesto-app.district-page .hero--schemes .hero__figure {
	max-width: 100%;
	min-width: 0;
}
.district-page .hero.hero--schemes h1 {
	max-width: 100%;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.district-page .district-page__footer-media-intro {
	margin-bottom: 16px;
	text-align: center;
}
.district-page .district-page__footer-media-kicker {
	margin: 0 0 8px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #d92b32;
}
.district-page .district-page__footer-media-title {
	margin: 0;
	font-family: "Mukta Malar", sans-serif;
	font-size: clamp(1.05rem, 2.4vw, 1.35rem);
	font-weight: 800;
	line-height: 1.35;
	color: var(--ink, #0f1520);
}
.district-page {
	--bg: #f0f4fb;
	--surface: #fff;
	--ink: #0f1520;
	--ink2: #374151;
	--muted: #6b7280;
	--line: #dde3f0;
	--line2: #c9d3e6;
	--red: #d92b32;
	--red-light: #fff1f1;
	--green: #16a34a;
	--green-light: #ecfdf5;
	--amber: #d97706;
	--amber-light: #fffbeb;
	--radius: 16px;
	--shadow: 0 4px 20px rgba(15, 21, 32, 0.07);
	--shadow-lg: 0 16px 48px rgba(15, 21, 32, 0.15);
}
.district-page .selector-bar {
	background: var(--surface);
	border-radius: 14px;
	padding: 18px 0px;
	margin-bottom: 20px;
	box-shadow: 0 1px 4px rgba(15, 21, 32, 0.04);
	position: relative;
	z-index: 20;
}
.district-page .district-pick-title {
	margin: 0 0 14px;
	padding: 0;
	font-size: clamp(1rem, 2.4vw, 1.2rem);
	font-weight: 800;
	font-family: "Mukta Malar", sans-serif;
	color: var(--ink);
	line-height: 1.35;
}
.district-page .district-pick-title__prefix {
	color: var(--red);
}
.district-page .district-pick-title__sep {
	color: var(--muted);
	font-weight: 600;
}
.district-page .district-pick-title__name {
	color: var(--ink);
}
.district-page .sel-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.district-page .sel-group label {
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--ink2);
	font-family: "Mukta Malar", sans-serif;
}

/* District picker: custom listbox (aligned with schemes / manifesto toolbar) */
.district-page .district-inner {
	position: relative;
	z-index: 1;
}
.district-page .selector-bar .district-page__district-wrap {
	position: relative;
	width: 100%;
	max-width: min(100%, 480px);
	min-width: 0;
}
.district-page .selector-bar .search-category-btn {
	width: 100%;
	margin: 0;
	border: 1.5px solid var(--line2);
	border-radius: 12px;
	padding: 11px 32px 11px 14px;
	background-color: var(--surface2);
	color: var(--ink);
	font-family: "Mukta Malar", sans-serif;
	font-size: 0.92rem;
	font-weight: 700;
	cursor: pointer;
	text-align: left;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	-webkit-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
}
.district-page .selector-bar .search-category-btn:focus {
	outline: none;
}
.district-page .selector-bar .search-category-btn:focus-visible {
	box-shadow: inset 0 0 0 2px rgba(217, 43, 50, 0.35);
}
.district-page .selector-bar .search-category-dropdown {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 6px);
	z-index: 200;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	background: var(--surface);
	color: var(--ink);
	border: 1px solid var(--line2);
	border-radius: 14px;
	box-shadow: 0 12px 36px rgba(15, 21, 32, 0.14);
	max-height: min(60vh, 320px);
	overflow-y: auto;
}
.district-page .selector-bar .search-category-dropdown__item {
	padding: 10px 0px;
	font-size: 0.9rem;
	font-weight: 700;
	cursor: pointer;
	border-radius: 8px;
	margin: 2px 6px;
	transition: background 0.12s ease;
	font-family: "Mukta Malar", sans-serif;
}
.district-page .selector-bar .search-category-dropdown__item:hover {
	background: rgba(217, 43, 50, 0.08);
}
.district-page .selector-bar .search-category-dropdown__item[aria-selected="true"] {
	background: #2563eb;
	color: #fff;
}
.district-page .selector-bar .search-category-dropdown__item[aria-selected="true"]:hover {
	background: #1d4ed8;
	color: #fff;
}
.district-page .content-section {
	display: none;
	margin-bottom: 20px;
}
.district-page .content-section.visible {
	display: block;
}
.district-page .section-box {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow);
}
.district-page .section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	padding: 14px 20px;
	border-bottom: 1px solid var(--line);
	background: #fafbfe;
}
.district-page .section-header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}
.district-page .district-share-btn {
	padding: 8px 14px;
	border-radius: 10px;
	border: 1.5px solid var(--red);
	background: var(--red-light);
	color: var(--red);
	font-size: 0.8rem;
	font-weight: 700;
	cursor: pointer;
	font-family: "Mukta Malar", sans-serif;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: all 0.18s;
	white-space: nowrap;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}
.district-page .district-share-btn svg {
	flex-shrink: 0;
}
.district-page .district-share-btn:hover {
	background: var(--red);
	color: #fff;
}
.district-page .section-title {
	font-family: "Mukta Malar", sans-serif;
	font-size: 0.9rem;
	font-weight: 800;
	display: flex;
	align-items: center;
	gap: 8px;
}
.district-page .copy-btn {
	padding: 8px 18px;
	border-radius: 10px;
	border: 1.5px solid var(--red);
	background: var(--red-light);
	color: var(--red);
	font-size: 0.8rem;
	font-weight: 700;
	cursor: pointer;
	font-family: "Mukta Malar", sans-serif;
	display: flex;
	align-items: center;
	gap: 6px;
	transition: all 0.18s;
	white-space: nowrap;
}
.district-page .copy-btn:hover {
	background: var(--red);
	color: #fff;
}
.district-page .copy-btn .check {
	display: none;
}
.district-page .copy-btn.copied {
	background: var(--green);
	color: #fff;
	border-color: var(--green);
}
.district-page .copy-btn.copied .lbl {
	display: none;
}
.district-page .copy-btn.copied .check {
	display: inline;
}
.district-page .section-body {
	padding: 20px 24px;
	font-size: 0.88rem;
	color: var(--ink);
	line-height: 1.85;
	max-height: 500px;
	overflow-y: auto;
}
.district-page .section-body p {
	margin: 0 0 10px 0;
}
.district-page .section-body p:last-child {
	margin-bottom: 0;
}
.district-page .section-body .heading {
	font-weight: 700;
	color: var(--ink);
	margin-top: 18px;
	margin-bottom: 6px;
	font-size: 0.92rem;
}
.district-page .section-body::-webkit-scrollbar {
	width: 6px;
}
.district-page .section-body::-webkit-scrollbar-thumb {
	background: var(--line2);
	border-radius: 3px;
}
.district-page .cards-section {
	display: none;
	margin-bottom: 20px;
}
.district-page .cards-section.visible {
	display: block;
}
.district-page .cards-section-title {
	font-family: "Mukta Malar", sans-serif;
	font-size: 0.9rem;
	font-weight: 800;
	color: var(--ink);
	margin-bottom: 14px;
	display: flex;
	align-items: center;
	gap: 8px;
}
.district-page .cards-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 12px;
	margin-bottom: 8px;
}
.district-page .scheme-card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 16px 12px;
	text-align: center;
	box-shadow: 0 2px 8px rgba(15, 21, 32, 0.05);
	transition: transform 0.15s, box-shadow 0.15s;
	cursor: default;
}
.district-page .scheme-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow);
}
.district-page .card-icon {
	font-size: 1.8rem;
	margin-bottom: 6px;
}
.district-page .card-value {
	font-family: "Mukta Malar", sans-serif;
	font-size: 0.95rem;
	font-weight: 800;
	color: var(--red);
	margin-bottom: 4px;
}
.district-page .card-name {
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--ink2);
	line-height: 1.3;
}
.district-page .section-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 24px 0 16px;
}
.district-page .section-divider.section-divider--hidden {
	display: none;
}
.district-page .section-divider-line {
	flex: 1;
	height: 1.5px;
	background: var(--line2);
}
.district-page .section-divider-text {
	font-family: "Mukta Malar", sans-serif;
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--red);
	background: var(--red-light);
	padding: 6px 16px;
	border-radius: 999px;
	white-space: nowrap;
}
.district-page .district-page__pick-banner {
	margin: 0 0 12px;
	font-weight: 600;
	color: var(--ink2);
}
.district-page .empty-state {
	text-align: center;
	padding: 24px 0 48px;
	color: var(--muted);
}
.district-page .empty-state.empty-state--hidden {
	display: none;
}
.district-page .empty-state__banner {
	margin: 0 auto 20px;
	width: 100%;
	max-width: 100%;
	border-radius: 14px;
	overflow: hidden;
	border: 1px solid var(--line);
	box-shadow: var(--shadow);
	background: var(--surface);
	line-height: 0;
}
.district-page .empty-state__img {
	display: block;
	width: 100%;
	height: auto;
	/* max-height: min(52vh, 420px); */
	object-fit: contain;
	object-position: center center;
}
.district-page .empty-state__hint {
	font-size: clamp(0.88rem, 2.5vw, 1rem);
	line-height: 1.55;
	max-width: 36rem;
	margin: 0 auto;
	padding: 0 12px;
	color: var(--ink2);
}
@media (max-width: 640px) {
	.district-page .empty-state {
		padding: 16px 0 36px;
	}
	.district-page .empty-state__img {
		max-height: min(40vh, 280px);
	}
}
.district-page .toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(80px);
	background: var(--ink);
	color: #fff;
	padding: 10px 22px;
	border-radius: 10px;
	font-size: 0.82rem;
	font-weight: 600;
	z-index: 200;
	box-shadow: var(--shadow-lg);
	transition: transform 0.3s ease;
	pointer-events: none;
}
.district-page .toast.show {
	transform: translateX(-50%) translateY(0);
}

@media (max-width: 1024px) {
	.district-page .cards-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}
@media (max-width: 768px) {
	.district-page .cards-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 8px;
	}
}
@media (max-width: 640px) {
	.district-page .section-header {
		flex-direction: column;
		gap: 8px;
		align-items: flex-start;
	}
	.district-page .section-body {
		padding: 14px 16px;
		max-height: 400px;
	}
	.district-page .cards-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 8px;
	}
	.district-page .scheme-card {
		padding: 12px 8px;
	}
	.district-page .card-icon {
		font-size: 1.4rem;
	}
	.district-page .card-value {
		font-size: 0.82rem;
	}
	.district-page .card-name {
		font-size: 0.68rem;
	}
}

/* —— Hero hero--schemes: schemes index + manifesto (copy + metrics + CM image) —— */
.schemes-index .hero.hero--schemes,
.manifesto-app .hero.hero--schemes {
	grid-template-columns: 1fr;
}
.schemes-index .hero--schemes .hero__grid,
.manifesto-app .hero--schemes .hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(160px, 480px);
	gap: clamp(16px, 4vw, 36px);
	align-items: center;
	width: 100%;
	position: relative;
	z-index: 1;
}
.schemes-index .hero--schemes .hero__copy,
.manifesto-app .hero--schemes .hero__copy {
	min-width: 0;
}
.hero.hero--schemes #heroH1 {
	max-width: 600px;
}
.schemes-index .hero--schemes .metric-grid.metric-grid--3 {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin-top: 20px;
	align-content: start;
	width: 100%;
}
.schemes-index .hero--schemes .metric-grid--3 .metric {
	min-width: 0;
}
.schemes-index .hero--schemes .metric-grid--3 .metric .num {
	font-size: clamp(1.55rem, 4.5vw, 2.35rem);
	word-break: break-word;
	overflow-wrap: anywhere;
	line-height: 1.15;
}
/* Manifesto: four stat tiles in hero */
.manifesto-app .hero--schemes .metric-grid.metric-grid--4 {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin-top: 20px;
	align-content: start;
	width: 100%;
}
.manifesto-app .hero--schemes .metric-grid--4 .metric {
	min-width: 0;
}
.manifesto-app .hero--schemes .metric-grid--4 .metric .num {
	font-size: clamp(1.55rem, 4.5vw, 2.35rem);
	word-break: break-word;
	overflow-wrap: anywhere;
	line-height: 1.15;
}
.schemes-index .hero--schemes .hero__figure,
.manifesto-app .hero--schemes .hero__figure {
	display: flex;
	justify-content: center;
	align-items: flex-end;
	pointer-events: none;
	position: relative;
	top: 34px;
}
.schemes-index .hero--schemes .hero__cm,
.manifesto-app .hero--schemes .hero__cm {
	width: 100%;
	max-width: 500px;
	height: auto;
	max-height: min(52vh, 420px);
	object-fit: contain;
	object-position: bottom center;
}

/* Tablet + mobile: single column, copy first then CM image (DOM order; no order:-1 on figure) */
@media (max-width: 1024px) {
	.schemes-index .hero--schemes .hero__grid,
	.manifesto-app .hero--schemes .hero__grid {
		grid-template-columns: 1fr;
		align-items: stretch;
	}
	.schemes-index .hero--schemes .hero__copy,
	.manifesto-app .hero--schemes .hero__copy {
		order: 0;
	}
	.schemes-index .hero--schemes .hero__figure,
	.manifesto-app .hero--schemes .hero__figure {
		order: 1;
		padding-top: 12px;
		padding-bottom: 0;
		top: 0;
	}
	.schemes-index .hero--schemes .hero__cm,
	.manifesto-app .hero--schemes .hero__cm {
		max-width: min(280px, 62vw);
		max-height: min(260px, 38vh);
		margin: 0 auto;
	}
	.schemes-index .hero--schemes .metric-grid.metric-grid--3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
	.manifesto-app .hero--schemes .metric-grid.metric-grid--4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.schemes-index .hero--schemes .metric-grid.metric-grid--3 {
		grid-template-columns: 1fr;
		gap: 10px;
	}
	.schemes-index .hero--schemes .metric-grid--3 .metric .num {
		font-size: clamp(1.5rem, 6vw, 2rem);
	}
	.manifesto-app .hero--schemes .metric-grid.metric-grid--4 {
		grid-template-columns: 1fr;
		gap: 10px;
	}
	.manifesto-app .hero--schemes .metric-grid--4 .metric .num {
		font-size: clamp(1.5rem, 6vw, 2rem);
	}
}

/* Candidates hero: four tiles, each only as wide as its label/number */
.candidates-page .hero--schemes .metric-grid.metric-grid--candidates-hero {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 12px;
	margin-top: 20px;
	align-items: stretch;
	width: 100%;
	box-sizing: border-box;
}
.candidates-page .hero--schemes .metric-grid--candidates-hero .metric {
	flex: 0 0 auto;
	width: max-content;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}
.candidates-page .hero--schemes .metric-grid--candidates-hero .metric .num {
	font-size: clamp(1.55rem, 4.5vw, 2.35rem);
	word-break: break-word;
	overflow-wrap: anywhere;
	line-height: 1.15;
}
@media (max-width: 640px) {
	.candidates-page .hero--schemes .metric-grid--candidates-hero .metric .num {
		font-size: clamp(1.5rem, 6vw, 2rem);
	}
}

/* —— Schemes index: toolbar — 40% category / 60% search —— */
.schemes-index .visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.schemes-index .toolbar--search {
	display: block;
}
.schemes-index .search-wrap--split {
	display: flex;
	align-items: stretch;
	width: 100%;
	max-width: 100%;
	border: 1.5px solid var(--line2);
	border-radius: 999px;
	overflow: visible;
	background: var(--surface);
	box-shadow: 0 1px 3px rgba(15, 21, 32, 0.06);
}
.schemes-index .search-category-wrap {
	flex: 0 0 40%;
	width: 40%;
	max-width: 40%;
	min-width: 0;
	position: relative;
}
.schemes-index .search-category-btn {
	width: 100%;
	margin: 0;
	border: none;
	border-right: 1px solid var(--line2);
	border-radius: 999px 0 0 999px;
	padding: 11px 32px 11px 14px;
	background-color: var(--surface2);
	color: var(--ink);
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 700;
	cursor: pointer;
	text-align: left;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	-webkit-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
}
.schemes-index .search-category-btn:focus {
	outline: none;
}
.schemes-index .search-category-btn:focus-visible {
	box-shadow: inset 0 0 0 2px rgba(217, 43, 50, 0.35);
}
.schemes-index .search-category-dropdown {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 6px);
	z-index: 60;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	background: var(--surface);
	color: var(--ink);
	border: 1px solid var(--line2);
	border-radius: 14px;
	box-shadow: 0 12px 36px rgba(15, 21, 32, 0.14);
	max-height: min(60vh, 320px);
	overflow-y: auto;
}
.schemes-index .search-category-dropdown__item {
	padding: 10px 14px;
	font-size: 0.9rem;
	font-weight: 700;
	cursor: pointer;
	border-radius: 8px;
	margin: 2px 6px;
	transition: background 0.12s ease;
}
.schemes-index .search-category-dropdown__item:hover {
	background: rgba(217, 43, 50, 0.08);
}
.schemes-index .search-category-dropdown__item[aria-selected="true"] {
	background: #2563eb;
	color: #fff;
}
.schemes-index .search-category-dropdown__item[aria-selected="true"]:hover {
	background: #1d4ed8;
	color: #fff;
}
.schemes-index .search-wrap__field {
	flex: 1 1 60%;
	min-width: 0;
	width: 60%;
	position: relative;
}
.schemes-index .search-wrap__field .search {
	width: 100%;
	border: none;
	border-radius: 0 999px 999px 0;
	background: #fff;
	padding: 11px 14px 11px 40px;
}
.schemes-index .search-wrap__field .search:focus {
	box-shadow: none;
	outline: none;
}
.schemes-index .search-wrap--split:focus-within {
	border-color: var(--red);
	box-shadow: 0 0 0 3px rgba(217, 43, 50, 0.1);
}
@media (max-width: 560px) {
	.schemes-index .search-wrap--split {
		flex-direction: column;
		border-radius: 16px;
	}
	.schemes-index .search-category-wrap {
		flex: 1 1 auto;
		width: 100%;
		max-width: 100%;
	}
	.schemes-index .search-category-btn {
		border-radius: 16px 16px 0 0;
		border-right: none;
		border-bottom: 1px solid var(--line2);
	}
	.schemes-index .search-wrap__field {
		width: 100%;
	}
	.schemes-index .search-wrap__field .search {
		border-radius: 0 0 16px 16px;
	}
}

/* —— Theme switch (horizontal pill, aligns with nav pills + logo) —— */
.theme-switch__fab-icons {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 2px;
	line-height: 1;
}
.theme-switch__fab-moon,
.theme-switch__fab-sun {
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
}
.theme-switch {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: center;
	flex-shrink: 0;
	padding: 0;
	border: none;
	cursor: pointer;
	background: transparent;
	color: inherit;
	height: 38px;
}
.theme-switch:focus-visible {
	outline: 2px solid var(--red);
	outline-offset: 3px;
	border-radius: 999px;
}
.theme-switch__track {
	position: relative;
	display: block;
	width: 76px;
	height: 32px;
	border-radius: 999px;
	background: linear-gradient(180deg, #eceff3 0%, #e2e6ec 100%);
	box-shadow:
		inset 0 2px 4px rgba(15, 21, 32, 0.07),
		0 1px 2px rgba(255, 255, 255, 0.9);
}
html[data-theme="dark"] .theme-switch__track {
	background: linear-gradient(90deg, #2a3340 0%, #222b38 100%);
	box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
}
.theme-switch__glyph {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	font-size: 20px;
	line-height: 1;
	color: var(--ink);
	pointer-events: none;
	opacity: 0.38;
	font-weight: 600;
}
.theme-switch__glyph--moon {
	left: 15px;
    top: 18px;
}
.theme-switch__glyph--sun {
	right: 10px;
}
html[data-theme="dark"] .theme-switch__glyph {
	color: #cbd5e1;
	opacity: 0.45;
}
.theme-switch__thumb {
	position: absolute;
	top: 50%;
	width: 30px;
	height: 30px;
	margin-top: -15px;
	border-radius: 50%;
	background: #fff;
	box-shadow:
		0 3px 10px rgba(15, 21, 32, 0.18),
		0 1px 2px rgba(15, 21, 32, 0.08);
	display: flex;
	align-items: center;
	justify-content: center;
	transition:
		left 0.28s cubic-bezier(0.4, 0, 0.2, 1),
		right 0.28s cubic-bezier(0.4, 0, 0.2, 1),
		box-shadow 0.2s ease;
}
/* Light: thumb right (sun) */
html[data-theme="light"] .theme-switch__thumb {
	left: auto;
	right: 4px;
}
/* Dark: thumb left (moon) */
html[data-theme="dark"] .theme-switch__thumb {
	left: 4px;
	right: auto;
	box-shadow:
		0 3px 12px rgba(0, 0, 0, 0.45),
		0 1px 2px rgba(0, 0, 0, 0.25);
	background: #f1f5f9;
}
.theme-switch__thumb-icon {
	font-size: 15px;
	line-height: 1;
	font-weight: 700;
	color: #0f1520;
}
html[data-theme="light"] .theme-switch__thumb-icon--moon {
	display: none;
}
html[data-theme="light"] .theme-switch__thumb-icon--sun {
	display: block;
}
html[data-theme="dark"] .theme-switch__thumb-icon--moon {
	display: block;
}
html[data-theme="dark"] .theme-switch__thumb-icon--sun {
	display: none;
}
html[data-theme="dark"] .theme-switch__thumb-icon--moon {
	color: #0f1520;
}

/* Mobile: viewport-fixed FAB — one icon: ☀ light mode, ☽ dark mode (tap toggles) */
@media (width<=768px) {
	.theme-switch {
		position: fixed !important;
		left: auto !important;
		top: auto !important;
		right: max(20px, env(safe-area-inset-right, 0px)) !important;
		bottom: max(60px, env(safe-area-inset-bottom, 0px)) !important;
		z-index: 4100;
		width: 42px;
		height: 42px;
		min-width: 42px;
		min-height: 42px;
		box-sizing: border-box;
		border-radius: 50%;
		background: linear-gradient(165deg, #ffffff 0%, #eef1f6 100%);
		border: 1px solid var(--line2);
		box-shadow:
			0 6px 24px rgba(15, 21, 32, 0.14),
			0 2px 8px rgba(15, 21, 32, 0.08),
			inset 0 1px 0 rgba(255, 255, 255, 0.9);
		-webkit-tap-highlight-color: transparent;
	}

	.theme-switch:focus-visible {
		border-radius: 50%;
		outline-offset: 4px;
	}

	html[data-theme="dark"] .theme-switch {
		background: linear-gradient(165deg, #2f3a4a 0%, #252e3c 100%);
		border-color: #3d4b5e;
		box-shadow:
			0 8px 28px rgba(0, 0, 0, 0.45),
			0 2px 10px rgba(0, 0, 0, 0.3),
			inset 0 1px 0 rgba(255, 255, 255, 0.06);
	}

	.theme-switch__fab-icons {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		height: 100%;
		gap: 0;
	}

	.theme-switch__fab-moon,
	.theme-switch__fab-sun {
		font-size: 20px;
		line-height: 1;
	}

	/* Default (light / no data-theme): sun only */
	.theme-switch__fab-moon {
		display: none !important;
	}
	.theme-switch__fab-sun {
		display: block !important;
		color: #c2410c;
	}

	html[data-theme="dark"] .theme-switch__fab-sun {
		display: none !important;
	}
	html[data-theme="dark"] .theme-switch__fab-moon {
		display: block !important;
		color: #e8ecf1;
	}

	.theme-switch__track {
		display: none !important;
	}
}

html[data-theme="dark"] {
	color-scheme: dark;
}

html[data-theme="dark"] {
	--bg: #0e1318;
	--bg2: #141a22;
	--surface: #1a222d;
	--surface2: #222b38;
	--ink: #e8ecf1;
	--ink2: #b8c4d4;
	--muted: #8b95a8;
	--line: #2d3848;
	--line2: #3d4a5e;
	--red-light: #2a181a;
	--red-mid: #3d2226;
	--cyan-light: #1a2838;
	--gold-light: #2a2418;
	--green-light: #1a2e22;
	--shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
	--shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
	--share-bg-start: #1a2330;
	--share-bg-end: #152028;
	--share-border: #3b4a5f;
}

html[data-theme="dark"] body {
	background-color: var(--bg);
	background-image:
		linear-gradient(180deg, rgba(14, 19, 24, 0.92) 0%, rgba(14, 19, 24, 0.97) 100%),
		url("../assets/flag.webp");
	background-position: 0 0, center bottom;
	background-repeat: no-repeat;
	background-size: auto, 100% auto;
	background-attachment: scroll, fixed;
}

@media (max-width: 768px) {
	html[data-theme="dark"] body {
		background-image: linear-gradient(180deg, rgba(14, 19, 24, 0.92) 0%, rgba(14, 19, 24, 0.97) 100%);
		background-position: 0 0;
		background-repeat: no-repeat;
		background-size: auto;
		background-attachment: scroll;
	}
}

html[data-theme="dark"] .district-page {
	--bg: #0e1318;
	--surface: #1a222d;
	--ink: #e8ecf1;
	--ink2: #b8c4d4;
	--muted: #8b95a8;
	--line: #2d3848;
	--line2: #3d4a5e;
	--red-light: #2a181a;
	--green-light: #1a2e22;
	--amber-light: #2a2418;
	--shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
	--shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .site-topbar-group {
	background: rgba(22, 28, 38, 0.94);
	border-color: var(--line);
}

@media (width<=768px) {
	html[data-theme="dark"] .site-topbar-group {
		background: rgb(22, 28, 38);
		border-radius: 0 0 16px 16px;
	}
}

html[data-theme="dark"] .topbar--nav-open .top-links {
	background: var(--surface);
	border-color: var(--line);
	box-shadow: -8px 0 48px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .topbar-nav-backdrop {
	background: rgba(0, 0, 0, 0.58);
}

html[data-theme="dark"] .topbar-nav-drawer-head {
	border-color: var(--line);
}

html[data-theme="dark"] .topbar-nav-drawer-title {
	color: var(--ink);
}

html[data-theme="dark"] .topbar-nav-close {
	background: var(--surface2);
	border-color: var(--line2);
	color: var(--ink);
}

html[data-theme="dark"] .topbar-nav-close:hover {
	background: var(--red-light);
	border-color: var(--red);
	color: #fff;
}

/* Topbar PDF download: red accent default; :visited kept explicit so link colour stays consistent */
a.pill.pill--download:link,
a.pill.pill--download:visited {
	border-color: var(--red);
	color: var(--red);
	background: var(--red-light);
}

a.pill.pill--download:hover {
	border-color: var(--red);
	color: #fff;
	background: var(--red);
}

html[data-theme="dark"] a.pill.pill--download:link,
html[data-theme="dark"] a.pill.pill--download:visited {
	border-color: var(--red);
	color: var(--red);
	background: var(--red-light);
}

html[data-theme="dark"] a.pill.pill--download:hover {
	border-color: var(--red);
	color: #fff;
	background: var(--red);
}

a.pill.pill--download {
	gap: 6px;
}

.pill-download__icon {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
	color: inherit;
}

.pill-download__icon svg {
	width: 17px;
	height: 17px;
	display: block;
}

/* Manifesto nav (தேர்தல் அறிக்கை / Manifesto): purple ↔ mint blink — all pages */
@keyframes nav-manifesto-blink {
	0%,
	100% {
		background-color: #ea232c;
		text-shadow: none;
	}
	50% {
		background-color: #221f20;
		text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
	}
}

a.pill.pill--manifesto {
	background-color: #8eddbe;
	color: #fff !important;
	border-color: rgba(255, 255, 255, 0.35);
	animation: nav-manifesto-blink 1s linear infinite;
	box-shadow: 0 2px 16px rgba(63, 6, 255, 0.35);
	font-weight: 700;
}

a.pill.pill--manifesto:hover {
	border-color: rgba(255, 255, 255, 0.55);
	animation: nav-manifesto-blink 1s linear infinite;
}

a.pill.pill--manifesto.pill-active {
	box-shadow:
		0 0 0 2px rgba(255, 255, 255, 0.4),
		0 4px 20px rgba(63, 6, 255, 0.45);
}

html[data-theme="dark"] a.pill.pill--manifesto {
	box-shadow:
		0 2px 18px rgba(99, 102, 241, 0.45),
		0 0 24px rgba(63, 6, 255, 0.25);
}

@media (prefers-reduced-motion: reduce) {
	a.pill.pill--manifesto {
		animation: none;
		background-color: #3f06ff;
		color: #fff !important;
		border-color: rgba(255, 255, 255, 0.35);
		box-shadow: 0 2px 12px rgba(63, 6, 255, 0.3);
	}
	a.pill.pill--manifesto.pill-active {
		box-shadow:
			0 0 0 2px rgba(255, 255, 255, 0.35),
			0 4px 16px rgba(63, 6, 255, 0.4);
	}
}

html[data-theme="dark"] .hero {
	background: linear-gradient(135deg, var(--surface) 50%, #231a1e 100%);
	border-color: var(--line);
}

/* Hero: primary copy was --ink (#e8ecf1); use yellow in dark mode for contrast on gradient */
html[data-theme="dark"] .hero h1 {
	color: #fde047;
}

html[data-theme="dark"] .hero .hero-desc {
	color: #facc15;
}

html[data-theme="dark"] .hero .metric .num {
	color: #fde047;
}

html[data-theme="dark"] .kicker {
	background: var(--red-light);
}

html[data-theme="dark"] .metric {
	background: var(--surface2);
	border-color: var(--line);
}

html[data-theme="dark"] .card {
	background: var(--surface);
	border-color: var(--line);
}

html[data-theme="dark"] .mini-box {
	background: var(--surface2);
	border-color: var(--line);
}

html[data-theme="dark"] .modal .overlay {
	background: rgba(4, 8, 14, 0.72);
}

html[data-theme="dark"] .panel {
	background: var(--surface);
	border-color: var(--line);
}

html[data-theme="dark"] .panel-head,
html[data-theme="dark"] .share-block .share-label {
	background: var(--surface2);
	border-color: var(--line);
}

html[data-theme="dark"] .site-footer {
	background: linear-gradient(180deg, #1a222d 0%, #141a22 100%);
	border-color: var(--line);
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .site-footer__campaign-inner {
	border-top-color: var(--line);
}

html[data-theme="dark"] .site-footer__media-youtube,
html[data-theme="dark"] .district-page .district-page__footer-media-youtube {
	border-color: var(--line);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .site-footer__media-hint,
html[data-theme="dark"] .district-page .district-page__footer-media-hint {
	background: var(--surface2, #222b38);
	border-color: var(--line2);
	color: var(--muted);
}

html[data-theme="dark"] .site-footer .footer--tagline {
	color: var(--ink2);
}

html[data-theme="dark"] .site-footer__org {
	color: var(--ink);
}

html[data-theme="dark"] .site-footer__addr {
	color: var(--ink2);
}

html[data-theme="dark"] .site-footer__credit-box .footer,
html[data-theme="dark"] .site-footer__credit-box .footer-credit {
	color: #fff;
}

html[data-theme="dark"] .site-footer__social-link {
	/* background: var(--surface2); */
	/* border-color: var(--line2);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); */
}

html[data-theme="dark"] .site-footer__social-link:hover {
	/* border-color: var(--muted); */
	/* box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); */
}

html[data-theme="dark"] .site-footer__social-img--light {
	display: none;
}

html[data-theme="dark"] .site-footer__social-img--dark {
	display: block;
}

html[data-theme="dark"] .schemes-index .search-wrap--split {
	background: var(--surface);
	border-color: var(--line2);
}

html[data-theme="dark"] .schemes-index .search-category-btn {
	background: var(--surface2);
	color: var(--ink);
	border-color: var(--line2);
}

html[data-theme="dark"] .schemes-index .search-wrap__field .search {
	background: var(--surface);
	color: var(--ink);
}

html[data-theme="dark"] .schemes-index .search-category-dropdown {
	background: var(--surface);
	border-color: var(--line2);
	box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .manifesto-app .selector-bar {
	/* background: var(--surface);
	border: 1px solid var(--line);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25); */
}

html[data-theme="dark"] .manifesto-app .selector-bar .search-category-btn {
	background: var(--surface2);
	color: var(--ink);
	border-color: var(--line2);
}
html[data-theme="dark"] .manifesto-app .selector-bar .search-category-dropdown {
	background: var(--surface);
	border-color: var(--line2);
	box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .manifesto-toolbar__btn {
	background: var(--surface);
	border-color: var(--line2);
	color: var(--ink);
}

html[data-theme="dark"] .dmkitwing-btn img {
	filter: brightness(0) invert(1);
	opacity: 0.92;
}

html[data-theme="dark"] .toast {
	background: var(--surface2);
	color: var(--ink);
	border: 1px solid var(--line);
}

html[data-theme="dark"] .district-page .section-header {
	background: var(--surface2);
	border-color: var(--line);
}

html[data-theme="dark"] .district-page .selector-bar .search-category-btn {
	background: var(--surface2);
	color: var(--ink);
	border-color: var(--line2);
}
html[data-theme="dark"] .district-page .selector-bar .search-category-dropdown {
	background: var(--surface);
	border-color: var(--line2);
	box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .manifesto-popup__overlay {
	background: rgba(4, 8, 14, 0.78);
}

html[data-theme="dark"] .manifesto-popup__panel {
	background: var(--surface);
	border: 1px solid var(--line);
	box-shadow: var(--shadow-lg);
}

html[data-theme="dark"] .manifesto-popup__head {
	background: var(--surface2);
	border-color: var(--line);
}

html[data-theme="dark"] .manifesto-popup__btn {
	background: var(--surface2);
	border-color: var(--line2);
	color: var(--ink);
}

html[data-theme="dark"] .manifesto-popup__title {
	color: var(--ink);
}

html[data-theme="dark"] .manifesto-popup__body {
	color: var(--ink);
}

html[data-theme="dark"] .manifesto-popup__text {
	color: var(--ink2);
}

html[data-theme="dark"] .manifesto-popup__more {
	color: var(--muted);
}

html[data-theme="dark"] .manifesto-popup__num {
	color: #f87171;
}

/* —— Candidates page (candidates.php): toolbar + modal body —— */
.candidates-pdf-cta {
	margin: 10px 0 16px;
}
.candidates-pdf-cta__link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 8px 18px 8px 10px;
	border-radius: 999px;
	font-size: 0.88rem;
	font-weight: 800;
	text-decoration: none;
	color: #fff;
	background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
	box-shadow: 0 4px 14px rgba(29, 78, 216, 0.35);
	border: 1px solid rgba(255, 255, 255, 0.2);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.candidates-pdf-cta__icon {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/* background: #fff; */
	color: #fff;
	/* box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); */
}
.candidates-pdf-cta__icon svg {
	width: 22px;
	height: 22px;
	display: block;
}
.candidates-pdf-cta__label {
	line-height: 1.25;
}
.candidates-pdf-cta__link:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 22px rgba(29, 78, 216, 0.45);
	color: #fff;
}

/* Candidates modal share card: smaller district / தொகுதி values (layout .sp-stat .v is 1.2rem) */
.candidates-page .share-preview .sp-stat .v {
	font-size: clamp(0.72rem, 1vw + 0.42rem, 0.95rem);
	line-height: 1.3;
}

/* Candidate card: top = மாவட்டம் (dept-name); below name = சட்டமன்றத் தொகுதி */
.candidates-page .card .dept-row.dept-row--candidate {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
	align-self: stretch;
	width: 100%;
	max-width: 100%;
	gap: 10px;
	margin-bottom: 10px;
	padding: 0;
}
.candidates-page .card .dept-row__left {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	flex: 1 1 0%;
}
.candidates-page .card .dept-row--candidate .dept-name {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 100%;
	white-space: normal;
	overflow: visible;
	text-overflow: clip;
	overflow-wrap: break-word;
	word-wrap: break-word;
	word-break: normal;
	text-transform: none;
	letter-spacing: 0.03em;
	font-size: 0.74rem;
	font-weight: 800;
	/* Fallback when color-mix is unsupported (older mobile WebViews) */
	color: var(--muted);
	color: color-mix(in srgb, var(--dept-accent, #f11017) 42%, var(--muted));
}

.candidates-page .card .card-body {
	min-width: 0;
}

/* Grid min-width:auto + .card overflow:hidden clipped long Tamil names — allow shrink + wrap */
.candidates-page .grid .card {
	min-width: 0;
}

.candidates-page .card .card-title {
	min-width: 0;
	max-width: 100%;
	white-space: normal;
	word-break: normal;
	overflow-wrap: break-word;
	word-wrap: break-word;
	hyphens: none;
}

.candidates-page .card .mini-box.mini-box--constituency {
	min-width: 0;
	overflow: hidden;
}

.candidates-page .card .mini-box--constituency span {
	font-size: 8px;
}

/* Number + name inline — same text row until the line wraps */
.candidates-page .card .mini-box--constituency .candidate-constituency-value {
	display: block;
	margin-top: 4px;
	font-size: clamp(0.68rem, 0.9vw + 0.5rem, 0.88rem);
	font-weight: 700;
	color: red;
	line-height: 1.45;
	word-break: break-word;
	overflow-wrap: anywhere;
	hyphens: auto;
}

.candidates-page .card .mini-box--constituency .candidate-constituency-num {
	display: inline;
	font-weight: 800;
	color: red;
	font-size: 12px;
	white-space: nowrap;
	margin-right: 0.15em;
}

.candidates-page .card .mini-box--constituency .candidate-constituency-text {
	display: inline;
	font-weight: 800;
	font-size: 12px;
	color: red;
}
.candidates-page .card .dept-row__thumb-wrap {
	flex-shrink: 0;
}
.candidates-page .card .dept-row__thumb {
	width: 62px;
	height: 62px;
	object-fit: cover;
	/* border-radius: 50%; */
	/* border: 2px solid var(--line); */
	display: block;
	background: var(--surface);
	/* box-shadow: 0 1px 4px rgba(15, 21, 32, 0.08); */
}
.candidates-page .card .dept-row__thumb--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	/* border-radius: 50%; */
	border: 2px dashed var(--line2);
	font-size: 1.1rem;
	background: var(--surface2);
}

.candidates-page .card .mini--district-only {
	grid-template-columns: 1fr;
}

.candidates-page .toolbar--search {
	display: block;
}

/* Women toggle: fixed 200px only; search row uses flex:1 for the rest */
.candidates-page .candidates-toolbar label.candidates-women-filter.candidates-women-filter--toolbar {
	display: inline-flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0 10px;
	position: relative;
	border: none;
	border-left: 1px solid var(--line2);
	border-radius: 0 999px 999px 0;
	/* image.png */
	cursor: pointer;
	font-family: "Mukta Malar", sans-serif;
	color: var(--ink);
	user-select: none;
	flex: 0 0 200px;
	width: 200px;
	min-width: 200px;
	max-width: 200px;
	box-sizing: border-box;
	align-self: stretch;
	min-height: 0;
}

.candidates-page .candidates-toolbar .candidates-women-filter__label {
	display: block;
	font-size: 0.78rem;
	font-weight: 800;
	line-height: 1.2;
	text-align: left;
	letter-spacing: 0.02em;
	color: inherit;
	pointer-events: none;
	white-space: nowrap;
}

.candidates-page .candidates-toolbar .candidates-women-filter--toolbar:hover {
	background: var(--red-light);
	color: var(--red);
}

.candidates-page .candidates-toolbar .candidates-women-filter--toolbar:has(.candidates-women-filter__input:focus-visible) {
	outline: 2px solid var(--red);
	outline-offset: -2px;
	z-index: 1;
}

.candidates-page .candidates-toolbar .candidates-women-filter--toolbar:has(.candidates-women-filter__input:checked) {
	background: var(--red-light);
	color: var(--red, #dc2626);
}

.candidates-page .candidates-toolbar .candidates-women-filter__input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
	opacity: 0;
}

.candidates-page .candidates-toolbar .candidates-women-filter__icon-wrap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	color: inherit;
	line-height: 0;
	padding: 0;
	pointer-events: none;
}

.candidates-page .candidates-toolbar .candidates-women-filter__icon {
	display: block;
	vertical-align: middle;
}

.candidates-page .candidates-toolbar .candidates-women-filter--toolbar:hover .candidates-women-filter__icon-wrap {
	color: var(--red);
}

.candidates-page .candidates-toolbar .candidates-women-filter--toolbar:has(.candidates-women-filter__input:checked) .candidates-women-filter__icon-wrap {
	color: var(--red, #dc2626);
}

.candidates-page .candidates-toolbar .search-wrap__field .search {
	border-radius: 0;
	border-right: none;
}

/* Toolbar sits in .wrap; prevent flex/grid min-width:auto from causing horizontal scroll */
.candidates-page .candidates-toolbar.search-wrap--split {
	min-width: 0;
	max-width: 100%;
	width: 100%;
	box-sizing: border-box;
}

.candidates-page .candidates-toolbar.search-wrap--split .search-category-wrap {
	flex: 0 0 20%;
	max-width: 20%;
	min-width: 0;
}

.candidates-page .candidates-toolbar .search-wrap__field {
	flex: 1 1 auto;
	min-width: 0;
	max-width: none;
	width: auto;
}

.candidates-page .candidates-toolbar .search-category-wrap:nth-of-type(2) .search-category-btn {
	border-radius: 0;
	border-right: 1px solid var(--line2);
}

.candidates-page .candidates-toolbar .search-category-wrap:first-of-type .search-category-btn {
	border-radius: 999px 0 0 999px;
}

/*
 * Row layout: each category cell is ~20% wide; absolute dropdown used left+right:0 so the
 * list matched that sliver and looked like a broken left rail over the cards.
 */
.candidates-page .candidates-toolbar .search-category-wrap .search-category-dropdown {
	left: 0;
	right: auto;
	width: min(max(100%, 17.5rem), 100%);
	box-sizing: border-box;
	z-index: 70;
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.candidates-page a.act-btn {
	text-decoration: none;
	box-sizing: border-box;
}

.candidates-page .act-btn--pdf {
	border-color: #1d4ed866;
	background: rgba(29, 78, 216, 0.1);
	color: #1d4ed8;
}

.candidates-page .act-btn--pdf:hover {
	background: #1d4ed8;
	color: #fff;
	border-color: #1d4ed8;
}

/* Stack before small phones: 4-across pill is too tight on portrait phones & small tablets */
@media (max-width: 768px) {
	.candidates-page .candidates-toolbar.search-wrap--split {
		flex-direction: column;
		align-items: stretch;
		align-content: stretch;
		border-radius: 16px;
		overflow: visible;
		gap: 0;
	}
	.candidates-page .candidates-toolbar .search-category-wrap {
		flex: 0 0 auto;
		width: 100%;
		max-width: 100%;
		min-width: 0;
	}
	.candidates-page .candidates-toolbar .search-category-wrap:first-of-type .search-category-btn {
		border-radius: 16px 16px 0 0;
		border-right: none;
		border-bottom: 1px solid var(--line2);
		min-height: 48px;
		padding-top: 12px;
		padding-bottom: 12px;
		box-sizing: border-box;
	}
	.candidates-page .candidates-toolbar .search-category-wrap:nth-of-type(2) .search-category-btn {
		border-radius: 0;
		border-right: none;
		border-bottom: 1px solid var(--line2);
		min-height: 48px;
		padding-top: 12px;
		padding-bottom: 12px;
		box-sizing: border-box;
	}
	.candidates-page .candidates-toolbar .search-wrap__field {
		flex: 0 0 auto;
		width: 100%;
		max-width: 100%;
		min-width: 0;
	}
	.candidates-page .candidates-toolbar .search-wrap__field .search {
		border-radius: 0;
		border-right: none;
		border-bottom: 1px solid var(--line2);
		width: 100%;
		min-width: 0;
		box-sizing: border-box;
		min-height: 48px;
		font-size: max(1rem, 16px);
		padding-top: 12px;
		padding-bottom: 12px;
	}
	.candidates-page .candidates-toolbar label.candidates-women-filter.candidates-women-filter--toolbar {
		display: flex;
		flex-direction: row;
		/* Column toolbar: flex-basis is height — do not use 200px here (was a 200px-tall strip) */
		flex: 0 0 auto;
		align-self: center;
		width: 200px;
		min-width: 200px;
		max-width: 200px;
		height: auto;
		border-left: none;
		border-top: none;
		border-radius: 0 0 16px 16px;
		padding: 8px 10px;
		min-height: 44px;
		box-sizing: border-box;
		justify-content: center;
		align-items: center;
		gap: 8px;
	}
	.candidates-page .candidates-toolbar .candidates-women-filter__label {
		font-size: 0.85rem;
	}
	/* Every toolbar row (flex item) flush to the shell — no shrink-to-content strips */
	.candidates-page .candidates-toolbar.search-wrap--split > .search-category-wrap,
	.candidates-page .candidates-toolbar.search-wrap--split > .search-wrap__field {
		width: 100%;
		max-width: 100%;
		min-width: 0;
		box-sizing: border-box;
		flex: 0 0 auto;
		align-self: stretch;
	}
	.candidates-page .candidates-toolbar.search-wrap--split > label.candidates-women-filter.candidates-women-filter--toolbar {
		width: 200px;
		max-width: 200px;
		min-width: 200px;
		flex: 0 0 auto;
		height: auto;
		align-self: center;
		box-sizing: border-box;
	}
	.candidates-page .candidates-toolbar.search-wrap--split .search-category-btn {
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
	}
	/* Stacked cell is full width — list should match (overrides min-width panel rule) */
	.candidates-page .candidates-toolbar .search-category-wrap .search-category-dropdown {
		left: 0;
		right: 0;
		width: auto;
		max-width: none;
	}
}

@media (max-width: 600px) {
	/* Narrow cards: district line can wrap — keep photo top-aligned */
	.candidates-page .card .dept-row.dept-row--candidate {
		align-items: flex-start;
	}
	.candidates-page .card .dept-row__thumb-wrap {
		align-self: flex-start;
	}
	.candidates-page .action-row {
		display: grid;
		grid-template-columns: 1fr 1fr;
		grid-template-areas:
			"copy share"
			"dl dl";
		gap: 10px;
		padding: 12px 16px;
		justify-items: stretch;
		width: 100%;
		max-width: none;
		margin: 0;
		box-sizing: border-box;
		align-self: stretch;
	}
	.candidates-page .action-row .act-btn.copy-text {
		grid-area: copy;
	}
	.candidates-page .action-row .act-btn.share-candidate {
		grid-area: share;
	}
	.candidates-page .action-row .act-btn.dl-img {
		grid-area: dl;
	}
	.candidates-page .action-row .act-btn {
		width: 100%;
		min-width: 0;
		justify-content: center;
		box-sizing: border-box;
	}
}
