.election-hero {
    border-left: 4px solid var(--accent);
}

.election-hero > p {
    max-width: 900px;
    color: var(--muted);
}

.election-process-schedule {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.nomination-callout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    margin-top: 14px;
}

.ballot-privacy-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: .88rem;
}

.ballot-question {
    padding: 0;
    overflow: hidden;
}

.ballot-question-legend {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
}

.ballot-question-number {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--primary);
    font-weight: 850;
}

.ballot-question-title {
    display: grid;
}

.ballot-question-title small {
    color: var(--muted);
    font-size: .72rem;
    text-transform: uppercase;
}

.ballot-question-intro {
    position: relative;
    padding: 12px 14px 4px;
}

.ballot-option-grid {
    display: grid;
    gap: 10px;
    padding: 12px 14px 15px;
}

.ballot-option-grid--candidates {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ballot-option-grid--responses {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.ballot-option-card {
    position: relative;
    display: block;
    min-width: 0;
    cursor: pointer;
}

.ballot-choice-control {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.ballot-option-visual {
    display: flex;
    min-height: 72px;
    gap: 10px;
    align-items: center;
    border: 2px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    background: var(--surface);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.ballot-option-card:hover .ballot-option-visual {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-soft);
}

.ballot-choice-control:focus-visible + .ballot-option-visual {
    outline: 3px solid rgba(23, 50, 77, .25);
    outline-offset: 2px;
}

.ballot-choice-control:checked + .ballot-option-visual {
    border-color: var(--success);
    background: #f1faf5;
    box-shadow: 0 0 0 2px rgba(23, 107, 70, .12);
}

.candidate-photo-frame {
    display: grid;
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
    overflow: hidden;
    place-items: center;
    border-radius: 10px;
    background: var(--surface-soft);
}

.candidate-photo,
.candidate-photo-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.candidate-photo-placeholder {
    display: grid;
    place-items: center;
    color: var(--danger);
    text-align: center;
    font-size: .7rem;
}

.candidate-card-body,
.response-card-body {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.candidate-name {
    overflow-wrap: anywhere;
}

.candidate-choice-caption {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: .76rem;
}

.candidate-choice-selected {
    display: none;
    color: var(--success);
    font-weight: 750;
}

.ballot-choice-control:checked + .ballot-option-visual .candidate-choice-default {
    display: none;
}

.ballot-choice-control:checked + .ballot-option-visual .candidate-choice-selected {
    display: inline;
}

.selection-mark {
    width: 18px;
    height: 18px;
    margin-left: auto;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
}

.ballot-choice-control:checked + .ballot-option-visual .selection-mark {
    border: 5px solid var(--success);
}

.ballot-option-card--abstain .ballot-option-visual {
    background: var(--surface-soft);
}

.ballot-submit-panel {
    position: sticky;
    bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 10px 28px rgba(20, 36, 52, .16);
}

.ballot-submit-panel .final-warning {
    flex: 1 1 auto;
}

.success-panel {
    width: min(680px, 100%);
    margin: 32px auto;
    padding: 26px;
    text-align: center;
}

.receipt-box {
    display: grid;
    gap: 9px;
    margin: 18px 0;
}

.receipt-box strong {
    overflow-wrap: anywhere;
    font: 800 1.3rem Consolas, monospace;
    letter-spacing: .04em;
}

.verification-result {
    margin-top: 12px;
    padding: 11px 12px;
}

.verification-result.success {
    border-color: #acd3bd;
    background: #edf8f2;
    color: var(--success);
}

.verification-result.error,
.error-summary,
.field-errors {
    border-color: #dfb2b5;
    background: #fff1f1;
    color: var(--danger);
}

.error-summary,
.field-errors {
    margin: 10px 14px;
    padding: 9px 11px;
    border: 1px solid;
    border-radius: 7px;
}

.status-badge {
    display: inline-flex;
    padding: 3px 7px;
    border-radius: 99px;
    background: var(--surface-tint);
    color: var(--muted);
    font-size: .74rem;
    font-weight: 750;
}

/* Public candidate presentation is shared with election pages. */
.candidate-publication-section,
.candidate-position-list,
.candidate-cart-items {
    display: grid;
    gap: 14px;
}

.candidate-publication-header,
.candidate-position-cart,
.candidate-cart-item {
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.candidate-publication-header,
.candidate-position-cart-header,
.candidate-cart-item {
    padding: 14px;
}

.candidate-position-cart-header,
.candidate-position-identity,
.candidate-publication-header,
.candidate-publication-summary,
.candidate-cart-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.candidate-position-number,
.candidate-publication-summary-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 850;
}

.candidate-cart-item {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) 150px;
    gap: 14px;
    align-items: center;
    border-radius: 0;
    box-shadow: none;
}

.candidate-cart-photo {
    width: 90px;
    height: 90px;
    overflow: hidden;
    border-radius: 11px;
    background: var(--surface-soft);
}

.candidate-cart-photo img,
.candidate-cart-photo-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.candidate-cart-photo-placeholder {
    display: grid;
    place-items: center;
    font-size: 1.7rem;
    font-weight: 850;
}

.candidate-cart-status {
    border-left: 1px solid var(--line);
    padding-left: 12px;
}

.challenge-guidance-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.challenge-guidance-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 11px;
    background: var(--surface);
}

@media (max-width: 1000px) {
    .ballot-option-grid--candidates,
    .election-process-schedule {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .nomination-callout,
    .ballot-submit-panel,
    .candidate-publication-header {
        align-items: stretch;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .candidate-cart-item {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .candidate-cart-photo {
        width: 76px;
        height: 76px;
    }

    .candidate-cart-status {
        grid-column: 2;
        border-top: 1px solid var(--line);
        border-left: 0;
        padding: 8px 0 0;
    }

    .challenge-guidance-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .ballot-option-grid--candidates,
    .election-process-schedule {
        grid-template-columns: 1fr;
    }
}

@media print {
    .ballot-submit-panel,
    .ballot-submit-button {
        display: none !important;
    }
}

/* =========================================================
   SEQUENTIAL BALLOT WIZARD
   Progressive enhancement: without JavaScript every position remains visible.
   ========================================================= */


/* Enhanced controls stay out of the fallback layout until JavaScript starts. */
.ballot-progress,
.ballot-wizard__navigation,
.ballot-review {
    display: none;
}

.ballot-wizard.is-enhanced .ballot-progress,
.ballot-wizard.is-enhanced .ballot-wizard__navigation,
.ballot-wizard.is-enhanced .ballot-review:not([hidden]) {
    display: grid;
}

.ballot-progress {
    display: grid;
    gap: 9px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.ballot-progress__text {
    display: flex;
    gap: 14px;
    align-items: baseline;
    justify-content: space-between;
}

.ballot-progress__track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-soft);
    box-shadow: inset 0 0 0 1px var(--line);
}

.ballot-progress__track > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width .22s ease;
}

.ballot-progress__status {
    margin: 0;
    color: var(--muted);
    font-size: .86rem;
}

.ballot-wizard__steps {
    display: grid;
}

.ballot-wizard.is-enhanced .ballot-wizard__step[hidden] {
    display: none !important;
}

.ballot-wizard.is-enhanced .ballot-question,
.ballot-review {
    min-height: 420px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.ballot-wizard.is-enhanced .ballot-question-legend {
    min-height: 72px;
}

.ballot-step-error {
    margin-top: 0;
}

.ballot-wizard__navigation {
    position: sticky;
    z-index: 10;
    bottom: 8px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 10px 28px rgba(20, 36, 52, .16);
    backdrop-filter: blur(8px);
}

.ballot-wizard__navigation-note {
    color: var(--muted);
    font-size: .82rem;
    text-align: center;
}

.ballot-review {
    overflow: hidden;
}

.ballot-review__heading {
    padding: 18px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
}

.ballot-review__heading h2 {
    margin: 4px 0 6px;
}

.ballot-review__heading p {
    max-width: 800px;
    margin: 0;
    color: var(--muted);
}

.ballot-review__list {
    display: grid;
}

.ballot-review-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.ballot-review-item__identity {
    display: flex;
    min-width: 0;
    gap: 12px;
    align-items: center;
}

.ballot-review-item__number {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-tint);
    color: var(--accent);
    font-weight: 850;
}

.ballot-review-item h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.ballot-review-item__selection {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--success);
    font-weight: 750;
}

.ballot-final-warning {
    margin: 18px;
    padding: 14px 16px;
    border: 1px solid #dfc18a;
    border-left: 4px solid #ad6d00;
    border-radius: 11px;
    background: #fff8e8;
}

.ballot-final-warning p {
    margin: 5px 0 0;
}

@media (max-width: 700px) {
    .ballot-progress__text {
        display: grid;
        gap: 3px;
    }

    .ballot-wizard.is-enhanced .ballot-question,
    .ballot-review {
        min-height: 0;
    }

    .ballot-wizard__navigation {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ballot-wizard__navigation-note {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .ballot-wizard__navigation .button {
        width: 100%;
        justify-content: center;
    }

    .ballot-review-item {
        grid-template-columns: 1fr;
    }

    .ballot-review-item .button {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ballot-progress__track > span {
        transition: none;
    }
}

@media print {
    .ballot-progress,
    .ballot-wizard__navigation {
        display: none !important;
    }

    .ballot-wizard.is-enhanced .ballot-wizard__step[hidden] {
        display: block !important;
    }
}
