/* Fraternal Ballots: voter page and public results. Inherits the theme's fonts and colours. */
.dballot,
.dballot-results {
	box-sizing: border-box;
	max-width: 640px;
	margin: 0 auto;
	font: inherit;
	color: inherit;
}

.dballot *,
.dballot *::before,
.dballot *::after,
.dballot-results *,
.dballot-results *::before,
.dballot-results *::after {
	box-sizing: inherit;
}

.dballot [hidden],
.dballot-results [hidden] {
	display: none !important;
}

.dballot h2,
.dballot-results h2 {
	margin: 0 0 0.75em;
	font-size: 1.4em;
}

.dballot h2:focus {
	outline: none;
}

.dballot-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.dballot-status:empty {
	display: none;
}

.dballot-status {
	margin: 0 0 1em;
	padding: 0.75em 1em;
	border: 2px solid currentColor;
	border-radius: 4px;
}

.dballot-field {
	margin: 0 0 1em;
}

.dballot-field label {
	display: block;
	margin-bottom: 0.35em;
	font-weight: 600;
}

.dballot input[type="text"] {
	display: block;
	width: 100%;
	min-height: 44px;
	padding: 0.5em 0.75em;
	font: inherit;
	color: inherit;
	background: transparent;
	border: 2px solid currentColor;
	border-radius: 4px;
}

.dballot-button {
	display: block;
	width: 100%;
	min-height: 44px;
	padding: 0.6em 1.25em;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	border: 2px solid currentColor;
	border-radius: 4px;
}

.dballot-button:disabled,
.dballot-button[aria-disabled="true"] {
	cursor: not-allowed;
	opacity: 0.55;
}

.dballot-hint {
	margin: 0 0 0.5em;
}

.dballot-choice input:disabled + span {
	opacity: 0.55;
}

.dballot-ranked {
	display: grid;
	gap: 0.5em;
	margin: 0 0 0.5em;
}

.dballot-rank {
	display: flex;
	align-items: center;
	gap: 0.75em;
	width: 100%;
	min-height: 48px;
	padding: 0.4em 0.75em;
	font: inherit;
	color: inherit;
	text-align: left;
	cursor: pointer;
	background: transparent;
	border: 2px solid currentColor;
	border-radius: 4px;
}

.dballot-rank.is-ranked {
	font-weight: 700;
	border-width: 4px;
	padding: calc(0.4em - 2px) calc(0.75em - 2px);
}

.dballot-rank-badge {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 2em;
	height: 2em;
	font-weight: 700;
	border: 2px dashed currentColor;
	border-radius: 50%;
}

.dballot-rank.is-ranked .dballot-rank-badge {
	border-style: solid;
}

.dballot-clear {
	display: block;
	min-height: 44px;
}

.dballot-link {
	min-height: 44px;
	padding: 0.5em 0;
	font: inherit;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
	background: none;
	border: 0;
}

.dballot-change {
	margin: 1em 0 0;
}

.dballot-item {
	margin: 0 0 1.25em;
	padding: 0.75em 1em 1em;
	border: 2px solid currentColor;
	border-radius: 4px;
	min-width: 0;
}

.dballot-item legend {
	padding: 0 0.4em;
	font-weight: 700;
}

.dballot-description {
	margin: 0 0 0.75em;
}

.dballot-choice {
	display: flex;
	align-items: center;
	gap: 0.75em;
	min-height: 44px;
	padding: 0.25em 0;
	cursor: pointer;
}

.dballot-choice input {
	flex: none;
	width: 24px;
	height: 24px;
	margin: 0;
}

.dballot-message {
	margin: 0.75em 0 0;
	font-weight: 600;
}

.dballot-message.is-invalid::before,
.dballot-message.is-error::before,
.dballot-error::before {
	content: "\26A0\00a0";
}

.dballot-error {
	margin: 0.4em 0 0;
	font-weight: 600;
}

.dballot-result {
	margin: 0 0 1em;
	padding: 0.75em 1em;
	border: 2px solid currentColor;
	border-left-width: 8px;
	border-radius: 4px;
}

.dballot-result.is-recorded::before {
	content: "\2713\00a0";
}

.dballot-unsupported {
	margin: 0;
	font-style: italic;
}

.dballot-results-section {
	margin: 2em 0 0;
}

.dballot-results > .dballot-results-section {
	margin-top: 0;
}

.dballot-result-item {
	margin: 0 0 1.5em;
	padding: 0.75em 1em 1em;
	border: 2px solid currentColor;
	border-radius: 4px;
	min-width: 0;
}

.dballot-result-item h3 {
	margin: 0 0 0.25em;
	font-size: 1.15em;
	overflow-wrap: anywhere;
}

.dballot-turnout {
	margin: 0 0 0.75em;
	font-size: 0.9em;
}

.dballot-winner {
	margin: 0 0 0.75em;
}

.dballot-note {
	margin: 0.75em 0 0;
	font-size: 0.9em;
}

.dballot-table-scroll {
	max-width: 100%;
	overflow-x: auto;
}

.dballot-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95em;
}

.dballot-table th,
.dballot-table td {
	padding: 0.4em 0.5em;
	text-align: right;
	vertical-align: top;
	border-bottom: 1px solid currentColor;
}

.dballot-table th:first-child,
.dballot-table td:first-child {
	text-align: left;
	overflow-wrap: break-word;
}

/* Rounds and points keep their cells whole; a wide table scrolls in its box. */
.dballot-irv th:first-child,
.dballot-irv td:first-child,
.dballot-borda th:first-child,
.dballot-borda td:first-child {
	min-width: 7em;
}

.dballot-irv th:not(:first-child),
.dballot-irv td:not(:first-child),
.dballot-borda th:not(:first-child),
.dballot-borda td:not(:first-child) {
	white-space: nowrap;
}

.dballot-table thead th {
	border-bottom-width: 2px;
}

.dballot-table tbody th {
	font-weight: 600;
}

.dballot-totals tbody th {
	width: 60%;
}

.dballot-label {
	display: block;
}

.dballot-bar {
	display: block;
	height: 0.8em;
	margin-top: 0.3em;
	border: 2px solid currentColor;
	border-radius: 4px;
	overflow: hidden;
}

.dballot-bar-fill {
	display: block;
	height: 100%;
	background: currentColor;
}

.dballot a:focus-visible,
.dballot button:focus-visible,
.dballot input:focus-visible,
.dballot fieldset:focus-visible,
.dballot-table-scroll:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 2px;
}
