.pr-wrapper {
	max-width: 1150px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ================= Standings / Bar Chart ================= */
.pr-standings-box {
	background-color: #F7FDFF;
	border-radius: 8px;
	padding: 24px 24px 54px;
	margin-bottom: 32px;
}

.pr-standings-title {
	text-align: center;
	font-size: 20px;
	font-weight: 800;
	letter-spacing: 0.5px;
	margin: 0 0 24px;
	color: #1a1a1a;
}

.pr-standings-chart {
	position: relative;
	padding-top: 4px;
}

.pr-majority-line {
	position: absolute;
	top: 0;
	bottom: 0;
	border-left: 2px dashed #d32f2f;
	z-index: 2;
}

.pr-majority-label {
	position: absolute;
	bottom: -18px;
	left: 50%;
	transform: translateX(-50%);
	white-space: nowrap;
	font-size: 11px;
	color: #d32f2f;
	font-weight: 600;
}

.pr-jumlah-dun {
	position: absolute;
	bottom: -34px;
	right: 0;
	white-space: nowrap;
	font-size: 13px;
	color: #000000;
	font-weight: 700;
	text-align: right;
}

.pr-standing-row {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 16px;
}

.pr-standing-label {
	width: 64px;
	flex: 0 0 64px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pr-party-flag {
	max-width: 64px;
	max-height: 34px;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

.pr-standing-bar-wrap {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
}

.pr-standing-bar-track {
	width: 100%;
	background-color: rgba(0, 0, 0, 0.05);
	border-radius: 4px;
	height: 28px;
	position: relative;
	overflow: hidden;
}

.pr-standing-bar {
	height: 100%;
	border-radius: 4px;
	transition: width 0.4s ease;
}

.pr-standing-rasmi {
	margin-top: 4px;
	font-size: 12px;
	font-weight: 700;
	color: #000000;
}

.pr-standing-count {
	flex: 0 0 40px;
	width: 40px;
	text-align: right;
	font-size: 20px;
	font-weight: 800;
}

/* ================= Dun Grid ================= */
.pr-dun-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 18px;
}

@media (max-width: 640px) {
	.pr-dun-grid {
		grid-template-columns: 1fr;
	}
	.pr-standing-label {
		width: 44px;
		flex-basis: 44px;
	}
}

.pr-dun-card {
	border-radius: 6px;
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
	overflow: hidden;
	background: #fff;
	transition: box-shadow 0.2s ease;
}

.pr-dun-card:hover {
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.pr-dun-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 16px;
	transition: background-color 0.3s ease;
}

.pr-dun-header-left {
	display: flex;
	align-items: baseline;
	gap: 8px;
	min-width: 0;
}

.pr-dun-nombor {
	font-size: 11px;
	color: #6c757d;
	flex-shrink: 0;
}

.pr-dun-nama {
	font-weight: 700;
	font-size: 14px;
	color: #1a1a1a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pr-dun-header-right {
	font-size: 11px;
	color: #444444;
	white-space: nowrap;
	flex-shrink: 0;
}

/* Bila DUN sudah ada keputusan, tajuk/nombor DUN & jumlah pemilih bertukar putih
   supaya kelihatan jelas di atas warna latar parti yang menang. */
.pr-dun-header.pr-has-result .pr-dun-nombor,
.pr-dun-header.pr-has-result .pr-dun-nama,
.pr-dun-header.pr-has-result .pr-dun-header-right {
	color: #ffffff;
}

.pr-dun-body {
	padding: 6px 16px 4px;
}

.pr-dun-penyandang {
	padding: 8px 16px 12px;
	border-top: 1px solid #eeeeee;
}

.pr-dun-penyandang-line {
	text-align: left;
	font-size: 11px;
	color: #000000;
}

.pr-dun-status-line {
	text-align: right;
	margin-top: 4px;
}

.pr-dun-status {
	font-size: 13px;
	font-weight: 700;
}

.pr-dun-status.pr-status-kekal {
	color: #2e7d32;
}

.pr-dun-status.pr-status-bertukar {
	color: #c62828;
}

.pr-penyandang-flag {
	max-width: 46px;
	max-height: 28px;
	object-fit: contain;
	vertical-align: middle;
	margin-right: 4px;
}

.pr-penyandang-nama {
	font-weight: 700;
	color: #000000;
	vertical-align: middle;
}

/* ================= Badge TERKINI ================= */
.pr-dun-card.pr-dun-terkini {
	position: relative;
}

.pr-dun-terkini-badge {
	text-align: center;
	background-color: #fbff00;
	color: #000000;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 1px;
	padding: 4px 8px;
}

/* ================= Shortcode Keputusan Ikut Negeri ================= */
.pr-negeri-box {
	max-width: 320px;
	background-color: #EBEFFF;
	border-radius: 8px;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.12);
}

.pr-negeri-header {
	background-color: #404040;
	color: #ffffff;
	text-align: center;
	font-weight: 800;
	font-size: 15px;
	letter-spacing: 0.5px;
	padding: 12px 10px;
}

.pr-negeri-body {
	padding: 10px 18px;
}

.pr-negeri-party-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 10px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.pr-negeri-party-row:last-child {
	border-bottom: none;
}

.pr-negeri-party-logo {
	flex: 0 0 70px;
	width: 70px;
	display: flex;
	align-items: center;
}

.pr-negeri-party-logo img {
	max-width: 70px;
	max-height: 36px;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

.pr-negeri-party-nama {
	flex: 1 1 auto;
	font-size: 14px;
	font-weight: 700;
	min-width: 0;
}

.pr-negeri-party-count {
	font-size: 22px;
	font-weight: 800;
}

.pr-negeri-footer {
	text-align: center;
	font-weight: 700;
	font-size: 13px;
	color: #1a1a1a;
	background-color: rgba(0, 0, 0, 0.04);
	padding: 10px;
}

.pr-calon-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid #eeeeee;
}

.pr-calon-row:last-child {
	border-bottom: none;
}

.pr-calon-logo {
	flex: 0 0 48px;
	width: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pr-calon-logo img {
	width: 100%;
	max-height: 28px;
	object-fit: contain;
	display: block;
}

.pr-calon-nama {
	flex: 1 1 auto;
	font-size: 13px;
	color: #333333;
	min-width: 0;
}

.pr-calon-undi-wrap {
	flex: 0 0 auto;
	text-align: right;
	min-width: 90px;
}

.pr-calon-undi-peratus-row {
	display: flex;
	align-items: baseline;
	justify-content: flex-end;
	gap: 6px;
}

.pr-calon-undi {
	font-size: 13px;
	color: #1a1a1a;
	line-height: 1.3;
}

.pr-calon-peratus {
	font-size: 11px;
	color: #888888;
	line-height: 1.3;
}

.pr-calon-majoriti {
	font-size: 11px;
	color: #2e7d32;
	font-weight: 700;
	line-height: 1.4;
	margin-top: 2px;
}

.pr-calon-row.pr-calon-winner .pr-calon-nama {
	text-transform: uppercase;
	font-weight: 700;
	font-size: 15px;
	color: #000000;
}

.pr-calon-row.pr-calon-winner .pr-calon-undi {
	font-weight: 700;
	font-size: 15px;
}

.pr-calon-row.pr-calon-winner .pr-calon-peratus {
	font-weight: 700;
	color: #555555;
}

/* ==========================================================================
   Seksyen "PRESTASI PILIHAN RAYA" — SATU jadual gabungan (full width, tiada
   header/kad berasingan), digunakan dalam shortcode [pilihan_raya_negeri].
   ========================================================================== */
.pr-prestasi-box {
	width: 100%;
	margin: 0 0 24px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	box-sizing: border-box;
}

.pr-prestasi-title {
	font-size: 20px;
	font-weight: 400;
	text-align: center;
	letter-spacing: 0.5px;
	margin: 0 0 14px;
	color: #1a1a1a;
}

.pr-prestasi-empty {
	text-align: center;
	color: #666666;
	font-size: 13px;
	margin: 0;
	padding: 16px 10px;
}

.pr-prestasi-table {
	width: 100%;
	border-collapse: collapse;
	border-left: 1px solid #EBEBEB;
	border-right: 1px solid #EBEBEB;
	border-top: none;
	border-bottom: none;
}

.pr-prestasi-table th {
	text-align: center;
	font-size: 13px;
	font-weight: 700;
	color: #ffffff;
	background-color: #0D2657;
	padding: 10px 10px 10px;
	border-top: none;
	border-bottom: none;
}

.pr-prestasi-table th.pr-prestasi-th-parti {
	text-align: left;
	padding-left: 14px;
}

.pr-prestasi-table td {
	text-align: center;
	font-size: 14px;
	font-weight: 700;
	padding: 10px;
	border-top: 1px solid #EBEBEB;
}

.pr-prestasi-parti-cell {
	display: flex;
	align-items: center;
	gap: 8px;
	text-align: left !important;
	font-size: 13px;
	padding-left: 14px !important;
}

.pr-prestasi-logo {
	max-width: 44px;
	max-height: 24px;
	width: auto;
	height: auto;
	object-fit: contain;
	flex: 0 0 auto;
}

/* ==========================================================================
   Shortcode [pilihan_raya_kerusi] — "Analisis Kerusi": satu lajur bagi setiap
   parti Penyandang, senarai kerusi mengikut nombor DUN kecil ke besar.
   ========================================================================== */
.pr-kerusi-box {
	width: 100%;
	overflow-x: auto;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.pr-kerusi-table {
	width: 100%;
	min-width: 600px;
	border-collapse: collapse;
	border-left: 1px solid #EBEBEB;
	border-right: 1px solid #EBEBEB;
	border-top: none;
	border-bottom: none;
}

.pr-kerusi-table th {
	text-align: center;
	vertical-align: middle;
	font-size: 13px;
	font-weight: 800;
	background-color: #f5f5f7;
	color: #333333;
	padding: 12px 10px;
	border-top: none;
	border-bottom: none;
}

.pr-kerusi-logo {
	display: block;
	margin: 0 auto 4px;
	max-width: 40px;
	max-height: 24px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.pr-kerusi-table td {
	text-align: center;
	vertical-align: top;
	font-size: 13px;
	padding: 8px 10px;
	border-top: 1px solid #EBEBEB;
}

/* ==========================================================================
   Shortcode [pilihan_raya_peratus_mengundi] — jadual 2 lajur Peratusan
   Keluar Mengundi setiap DUN.
   ========================================================================== */
.pr-peratus-box {
	width: 100%;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.pr-peratus-columns {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
}

.pr-peratus-col {
	flex: 1 1 260px;
	min-width: 240px;
}

.pr-peratus-table {
	width: 100%;
	border-collapse: collapse;
	border-left: 1px solid #EBEBEB;
	border-right: 1px solid #EBEBEB;
	border-top: none;
	border-bottom: none;
}

.pr-peratus-table th {
	text-align: center;
	font-size: 12px;
	font-weight: 700;
	color: #ffffff;
	background-color: #0D2657;
	padding: 8px 8px;
	border-top: none;
	border-bottom: none;
}

.pr-peratus-table td {
	text-align: center;
	font-size: 13px;
	padding: 7px 8px;
	border-top: 1px solid #EBEBEB;
}

.pr-peratus-table td.pr-peratus-nama {
	text-align: left;
}

.pr-peratus-table td.pr-peratus-majoriti {
	padding: 5px 8px;
}

.pr-peratus-majoriti-chip {
	display: inline-block;
	min-width: 46px;
	color: #ffffff;
	font-weight: 700;
	font-size: 13px;
	padding: 3px 10px;
	border-radius: 4px;
}

/* ==========================================================================
   Shortcode [pilihan_raya_undi_popular] — carta pai Undi Popular + petunjuk.
   ========================================================================== */
.pr-undipop-box {
	width: 100%;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.pr-undipop-flex {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 32px;
}

.pr-undipop-chart {
	flex: 0 0 320px;
	max-width: 320px;
}

.pr-undipop-chart svg {
	width: 100%;
	height: auto;
	display: block;
}

.pr-undipop-legend {
	flex: 1 1 260px;
	min-width: 220px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.pr-undipop-legend-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.pr-undipop-legend-logo {
	max-width: 48px;
	max-height: 34px;
	width: auto;
	height: auto;
	object-fit: contain;
	flex: 0 0 auto;
}

.pr-undipop-legend-text {
	font-size: 14px;
	color: #1a1a1a;
}

.pr-undipop-legend-peratus {
	font-weight: 800;
	font-size: 17px;
}

.pr-undipop-turnout {
	margin-top: 6px;
	padding-top: 10px;
	border-top: 1px solid #EBEBEB;
	font-size: 16px;
	font-weight: 800;
	color: #000000;
}

/* ---------- Progress bar: % Undi Dikira (di bawah PENYANDANG dalam kad DUN) ---------- */
.pr-dun-progress {
	padding: 8px 16px 12px;
}

.pr-dun-progress-label {
	font-size: 14px;
	font-weight: 700;
	margin-bottom: 4px;
}

.pr-dun-progress-track {
	width: 100%;
	height: 10px;
	background-color: #E0E0E0;
	border-radius: 5px;
	overflow: hidden;
}

.pr-dun-progress-fill {
	height: 100%;
	border-radius: 5px;
	transition: width 0.3s ease;
}
