@font-face {
	font-family: "PST Barlow Condensed";
	src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "PST Barlow Condensed";
	src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

.pst-wrap {
	--pst-a: #1F2D7A;
	--pst-b: #C8102E;
	--pst-ink: #1A1D24;
	--pst-muted: #5F6673;
	--pst-line: #D5D9E0;
	--pst-panel: #FFFFFF;
	--pst-none: #C3C8D0;
	color: var(--pst-ink);
	max-width: 860px;
	margin: 0 auto;
	font-size: 16px;
	line-height: 1.45;
	box-sizing: border-box;
	text-align: left;
}
.pst-wrap *,
.pst-wrap *::before,
.pst-wrap *::after { box-sizing: border-box; }

.pst-wrap .pst-num {
	font-family: "PST Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
	font-variant-numeric: tabular-nums;
}
.pst-wrap .pst-title {
	font-family: "PST Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
	font-weight: 600;
	font-size: 1.6em;
	line-height: 1.2;
	margin: 0 0 4px;
	padding: 0;
	color: var(--pst-ink);
	text-transform: none;
	letter-spacing: .01em;
}
.pst-wrap .pst-sub { color: var(--pst-muted); margin: 0 0 14px; font-size: .95em; }
.pst-wrap .pst-disclaimer {
	margin: 0 0 20px;
	padding: 10px 14px;
	font-size: .88em;
	line-height: 1.5;
	color: var(--pst-ink);
	background: var(--pst-panel);
	border: 1px solid var(--pst-line);
	border-left: 4px solid var(--pst-muted);
	border-radius: 8px;
}

/* Placar */
.pst-board {
	background: var(--pst-panel);
	border: 1px solid var(--pst-line);
	border-radius: 14px;
	padding: 22px 22px 18px;
	margin: 0 0 22px;
}
.pst-wrap .pst-verdict { font-size: 1.12em; margin: 0 0 16px; }
.pst-sides { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.pst-side-name { font-weight: 600; }
.pst-side-pct { font-size: 3.4em; font-weight: 700; line-height: 1; }
.pst-side-votes { color: var(--pst-muted); font-size: .92em; }
.pst-side-b { text-align: right; }
.pst-side-a .pst-side-pct { color: var(--pst-a); }
.pst-side-b .pst-side-pct { color: var(--pst-b); }

.pst-split-wrap { position: relative; padding: 6px 0; }
.pst-split { display: flex; height: 22px; border-radius: 4px; overflow: hidden; background: var(--pst-line); }
.pst-split-a { background: var(--pst-a); transition: width .25s ease; }
.pst-split-b { background: var(--pst-b); flex: 1; }
.pst-half { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--pst-ink); transform: translateX(-1px); }
.pst-half-label { text-align: center; color: var(--pst-muted); font-size: .8em; margin-top: 2px; }
.pst-wrap .pst-ref { margin: 12px 0 0; font-size: .9em; color: var(--pst-muted); }
.pst-ref b { color: var(--pst-ink); font-weight: 600; }
.pst-meta {
	display: flex; flex-wrap: wrap; gap: 6px 22px;
	margin-top: 14px; padding-top: 12px;
	border-top: 1px solid var(--pst-line);
	color: var(--pst-muted); font-size: .92em;
}
.pst-meta b { color: var(--pst-ink); font-weight: 600; }

/* Barra fixa com os percentuais (aparece ao rolar até os controles) */
.pst-sticky {
	--pst-a: #1F2D7A;
	--pst-b: #C8102E;
	--pst-ink: #1A1D24;
	--pst-muted: #5F6673;
	--pst-line: #D5D9E0;
	--pst-panel: #FFFFFF;
	color: var(--pst-ink);
	font-size: 16px;
	line-height: 1.35;
	box-sizing: border-box;
	text-align: left;
}
.pst-sticky *, .pst-sticky *::before, .pst-sticky *::after { box-sizing: border-box; }
.pst-sticky .pst-num {
	font-family: "PST Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
	font-variant-numeric: tabular-nums;
}
.pst-sticky {
	position: fixed;
	left: 0;
	right: 0;
	top: var(--pst-sticky-top, 0px);
	z-index: 9990;
	padding-top: env(safe-area-inset-top, 0px);
	background: var(--pst-panel);
	border-bottom: 1px solid var(--pst-line);
	box-shadow: 0 4px 14px rgba(20, 24, 32, .10);
	transform: translateY(-110%);
	visibility: hidden;
	transition: transform .2s ease, visibility 0s linear .2s;
}
.pst-sticky.is-visible {
	transform: translateY(0);
	visibility: visible;
	transition: transform .2s ease, visibility 0s;
}
.pst-sticky-inner { padding: 8px 16px 9px; margin: 0 auto; max-width: 860px; }
.pst-sticky-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pst-sticky-side { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.pst-sticky-name { font-weight: 600; font-size: .95em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pst-sticky-pct { font-size: 1.75em; font-weight: 700; line-height: 1.05; }
.pst-sticky-a .pst-sticky-pct { color: var(--pst-a); }
.pst-sticky-b .pst-sticky-pct { color: var(--pst-b); }
.pst-sticky-bar { position: relative; display: flex; height: 8px; margin-top: 5px; border-radius: 3px; overflow: hidden; background: var(--pst-line); }
.pst-sticky-half { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--pst-panel); transform: translateX(-1px); }
.pst-sticky-votes { display: flex; justify-content: space-between; margin-top: 3px; font-size: .78em; color: var(--pst-muted); }

/* Cenários */
.pst-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px; }
.pst-presets-label { color: var(--pst-muted); font-size: .92em; }
.pst-preset { display: inline-flex; align-items: center; gap: 5px; }

.pst-wrap .pst-btn {
	appearance: none;
	margin: 0;
	padding: 7px 13px;
	min-height: 0;
	font: inherit;
	font-size: .92em;
	font-weight: 400;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: normal;
	text-decoration: none;
	color: var(--pst-ink);
	background: var(--pst-panel);
	border: 1px solid var(--pst-line);
	border-radius: 999px;
	box-shadow: none;
	cursor: pointer;
}
.pst-wrap .pst-btn:hover,
.pst-wrap .pst-btn:focus { color: var(--pst-ink); background: var(--pst-panel); border-color: var(--pst-muted); }
.pst-wrap .pst-btn:disabled,
.pst-wrap .pst-btn:disabled:hover { color: var(--pst-muted); border-color: var(--pst-line); border-style: dashed; cursor: not-allowed; opacity: .75; }
.pst-preset-reset { margin-left: auto; }
.pst-wrap .pst-btn.is-active { border-color: var(--pst-ink); font-weight: 600; }

.pst-tip { position: relative; display: inline-flex; }
.pst-wrap .pst-tip-btn {
	appearance: none;
	display: inline-flex; align-items: center; justify-content: center;
	width: 20px; height: 20px; min-height: 0;
	margin: 0; padding: 0;
	font: 600 12px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	text-transform: none; letter-spacing: normal;
	color: var(--pst-muted);
	background: transparent;
	border: 1px solid var(--pst-muted);
	border-radius: 50%;
	box-shadow: none;
	cursor: help;
}
.pst-wrap .pst-tip-btn:hover,
.pst-wrap .pst-tip-btn:focus { color: var(--pst-ink); background: transparent; border-color: var(--pst-ink); }

.pst-tip-box {
	position: absolute;
	bottom: calc(100% + 10px);
	left: 50%;
	transform: translateX(calc(-50% + var(--pst-shift, 0px)));
	width: max-content;
	max-width: min(280px, 82vw);
	padding: 10px 12px;
	font-size: .85rem;
	font-weight: 400;
	line-height: 1.45;
	text-align: left;
	color: #fff;
	background: var(--pst-ink);
	border-radius: 8px;
	box-shadow: 0 8px 20px rgba(20, 24, 32, .25);
	visibility: hidden;
	opacity: 0;
	transition: opacity .15s ease;
	pointer-events: none;
	z-index: 100;
}
.pst-tip-box::after {
	content: "";
	position: absolute;
	top: 100%;
	left: calc(50% - var(--pst-shift, 0px));
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: var(--pst-ink);
}
@media (hover: hover) {
	.pst-tip:hover .pst-tip-box { visibility: visible; opacity: 1; }
}
.pst-tip-btn:focus-visible + .pst-tip-box,
.pst-tip.is-open .pst-tip-box { visibility: visible; opacity: 1; }

/* Candidatos */
.pst-cands { background: var(--pst-panel); border: 1px solid var(--pst-line); border-radius: 14px; overflow: hidden; }
.pst-cand { padding: 16px 20px; border-top: 1px solid var(--pst-line); }
.pst-cand:first-child { border-top: 0; }
.pst-cand-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pst-cand-name { font-weight: 700; }
.pst-cand-party { color: var(--pst-muted); font-size: .88em; margin-left: 6px; }
.pst-cand-votes { color: var(--pst-muted); font-size: .95em; }
.pst-stack { display: flex; height: 8px; border-radius: 3px; overflow: hidden; margin: 10px 0 12px; background: var(--pst-none); }
.pst-stack-a { background: var(--pst-a); }
.pst-stack-b { background: var(--pst-b); }
.pst-ctrls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; }
.pst-ctrl label { display: flex; justify-content: space-between; gap: 8px; margin: 0; font-size: .9em; font-weight: 400; color: var(--pst-muted); }
.pst-ctrl output { font-weight: 600; }
.pst-ctrl-a output { color: var(--pst-a); }
.pst-ctrl-b output { color: var(--pst-b); }
.pst-wrap input[type=range] { width: 100%; margin: 6px 0 0; padding: 0; border: 0; background: transparent; box-shadow: none; accent-color: var(--pst-a); }
.pst-wrap .pst-ctrl-b input[type=range] { accent-color: var(--pst-b); }
.pst-rest { grid-column: 1 / -1; font-size: .86em; color: var(--pst-muted); }
.pst-wrap .pst-note { color: var(--pst-muted); font-size: .86em; margin: 18px 0 0; max-width: 70ch; }

@media (max-width: 560px) {
	.pst-sticky-inner { padding: 7px 12px 8px; }
	.pst-sticky-pct { font-size: 1.5em; }
	.pst-side-pct { font-size: 2.6em; }
	.pst-ctrls { grid-template-columns: 1fr; }
	.pst-board { padding: 18px 16px; }
	.pst-cand { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
	.pst-split-a, .pst-tip-box, .pst-sticky, .pst-sticky.is-visible { transition: none; }
}
